Re: Pointers of a Matrix

Sven Olsen <[email protected]> Mon, 09 Feb 2004 13:04:08 -0500
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
dude - operator precedence!

() has a higher precedence than *.
(*bigK)(25,39) = 2.0;

should fix the problem :-P.

At 02:42 PM 2/9/2004 +0100, you wrote:
>Hi,
>
>I have an stupid problem that I'm not be able to solve. I would like to
>declare a pointer of a Matrix:
>
>typedef matrix<double,
>                  rectangle<>,
>                  compressed<>,
>                  row_major >::type MatB;
>...
>sizeT size = 100;
>MatB *bigK;
>bigK = new MatB(size,size);
>
>My problem, is when I try to access to the matrix:
>*bigK(25,39) = 2.0;
>
>I have an error when I compile complaining about there's no function with 
>name
>bigK??
>
>fengine.cpp:207: error: call to non-function `fengine::bigK'
>
>  It's curious, because I have another part that I use :
>
>MatB *listK;
>listK = new MatB[25](size,size);
>...
>listK[2](25,39) = 2.0
>...
>and all works OK.
>
>I'm doing something wrong, but I don't know what. Please, could you help me?
>
>Bes regards,
>
>Leo
>
>_______________________________________________
>This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/