Memory preallocation in python

Matthew Knepley knepley at gmail.com
Mon Aug 21 08:29:19 CDT 2006


On 8/21/06, Marek Wojciechowski <mwojc at p.lodz.pl> wrote:
>
>
> >   1) It would have to be for a subclass like MatSeqAIJ
> >
> >   2) It is setPreallocation()
> >
> >   Thanks,
> >
> >      Matt
> >
>
> Honestly, I can find neither subclass MatSeqAIJ nor the method
> setPreallocation(). I create matrix as follows:
>
> import PETSc.Mat
> K = PETSc.Mat.Mat()   ## as far as i know this is the only way to create
> matrix in python
> K.setSizes(size, size, Size, Size)
> K.setFromOptions()
> K.setType("seqaij")   ## i choose matrix type here, I don't know another
> way...
>
> Where is the moment to preallocate?


It may be that they never wrapped the preallocation methods. It seems
strange, but
possible. I guess I would mail Lisandro and see.

  Matt

--
> Marek Wojciechowski
>
-- 
"Failure has a thousand explanations. Success doesn't need one" -- Sir Alec
Guiness
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20060821/ed2afb13/attachment.htm>


More information about the petsc-users mailing list