![]() |
Blitz Support : |
From: Julian Cummings (cummings_at_[hidden])
Date: 2003-04-03 15:03:52
Hi Mark,
I was just wondering if you were able to resolve your problems after
working with
the example code matmult.cpp. The code should produce the output shown
within
the code comments. If it is not, please reply and let me know what
output you see.
There are some alternatives to using a 2D Array for this. If the matrix
extents are
relatively small and known at compile time, you can use the TinyMatrix
class. There
is a blitz::product() method provided for doing matrix-matrix
multiplication of two
TinyMatrix objects. For larger matrices with extents only known at run
time, there
is a Matrix class available. The implementation of this class is
somewhat incomplete
and it is not discussed in the Blitz documentation. It appears that
there is no implementation
provided for blitz::product() for two Matrix objects. The missing parts
here could be
filled in if there is sufficient interest from the Blitz community.
Regards, Julian C.
Mark Hymers wrote:
>On Tue, 25, Mar, 2003 at 03:17:46PM -0500, Xudong Xiao spoke thus..
>
>
>>Hi, Mark,
>>
>>I assume you are trying to do matrix multiplication.
>>
>>
>
>Correct.
>
>
>
>>But the "*" operation in Blitz++ is "elementwise", based on the user's
>>guide.
>>
>>
>
>Ah. That makes sense. I'm digging through the users guide again now
>(more thouroughly than before) but can't see a generic matrix
>multiplication method. In the examples/ dir there is a comment about
>doing matrix multiplication in matmult.cpp but I can't seem to get it to
>work.
>
>Sorry for these basic questions but is there a simple way of multiplying
>two 2D matrices (defined as Array<double,2>) in Blitz or do I have to
>write a for() construct to do it myself?
>
>Thanks for the help,
>
>Mark
>
>
>
-- Dr. Julian C. Cummings E-mail: cummings_at_[hidden] California Institute of Technology Phone: 626-395-2543 1200 E. California Blvd., Mail Code 158-79 Fax: 626-584-5917 Pasadena, CA 91125