Problem with mpicxx

Matthew Knepley knepley at gmail.com
Thu Aug 9 10:09:55 CDT 2007


Mat is just a typedef for a pointer, so NULL initialization is correct. You
should put a call to MatCreate() in the constructor if you want the object
to be initialized.

  Thanks,

    Matt

On 8/9/07, John R. Wicks <jwicks at cs.brown.edu> wrote:
> I would like to define a class with a matrix as an member:
>
> class Foo {
>
> public:
>
>   Mat A;
> };
>
> I would expect that when an instance of Foo is created, A should be
> initialized, just as it would be if it were declared as ordinary variable in
> C:
> int main (int argc,char **args) {
>   Mat A;
> ...
>
> However, when an instance of Foo is created, A is initialized to NULL.  How
> can I get it to initialize properly?
>
>


-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which
their experiments lead.
-- Norbert Wiener




More information about the petsc-users mailing list