Re: Pointers of a Matrix

Leopold Palomo Avellaneda <[email protected]> Tue, 10 Feb 2004 10:17:26 +0100
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
A Dilluns 09 Febrer 2004 19:04, Sven Olsen va escriure:
> dude - operator precedence!
>
> () has a higher precedence than *.
> (*bigK)(25,39) = 2.0;
>
> should fix the problem :-P.

Ok,

thank's. It works now.

Leo


> 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/

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