easy question

View: New views
5 Messages — Rating Filter:   Alert me  

easy question

by ender85 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys, so brand spankin new to boost and BLAS for that matter.  I just have a quick question, and ive tried to find a answer online, but it seems so trivial that its not on there.  

here it goes, how to i do simple matrix math operations once i have two matices...

ie, im tryin to multiply two matrices right now, i have two of them defined


matrix<double>m (3, 3)
matrix<double>n (3, 3)

what is m * n

i havnt done lin alg in a while but im pretty sure you can multiply two matrices w/ the same amount of rows and cols

thanks for you help guys

Re: easy question

by Janek Kozicki :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ender85 said:     (by the date of Wed, 12 Jul 2006 08:25:21 -0700 (PDT))

> matrix<double>m (3, 3)
> matrix<double>n (3, 3)
>
> what is m * n

IIRC prod(m,n);


--
Janek Kozicki                                                         |
_______________________________________________
ublas mailing list
ublas@...
http://lists.boost.org/mailman/listinfo.cgi/ublas

Re: easy question

by ender85 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

thanks

Re: easy question

by Riccardo Rossi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2006-07-12 at 08:25 -0700, ender85 wrote:

> Hey guys, so brand spankin new to boost and BLAS for that matter.  I just
> have a quick question, and ive tried to find a answer online, but it seems
> so trivial that its not on there.  
>
> here it goes, how to i do simple matrix math operations once i have two
> matices...
>
> ie, im tryin to multiply two matrices right now, i have two of them defined
>
>
> matrix<double>m (3, 3)
> matrix<double>n (3, 3)
>
> what is m * n
>
> i havnt done lin alg in a while but im pretty sure you can multiply two
> matrices w/ the same amount of rows and cols
>
> thanks for you help guys

simply write

Matrix<double> result(3,3);
noalias(result) = prod(m,n);

the noalias is telling that result is different from m and n so you can
avoid the creationg of any temporary

greetings

Riccardo



_______________________________________________
ublas mailing list
ublas@...
http://lists.boost.org/mailman/listinfo.cgi/ublas

Re: easy question

by Gunter Winkler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wednesday 12 July 2006 17:25, ender85 wrote:
> i havnt done lin alg in a while but im pretty sure you can multiply two
> matrices w/ the same amount of rows and cols

simple: RTFM

the best pages are these two:

(operations)
http://www.boost.org/libs/numeric/ublas/doc/operations_overview.htm

(types)
http://www.boost.org/libs/numeric/ublas/doc/types_overview.htm

mfg
Gunter
_______________________________________________
ublas mailing list
ublas@...
http://lists.boost.org/mailman/listinfo.cgi/ublas