Re: vecLib framework sample code
Re: vecLib framework sample code
- Subject: Re: vecLib framework sample code
- From: Timothy Ritchey <email@hidden>
- Date: Tue, 4 Mar 2003 10:40:32 -0500
The cblas routines work one-level below an invert routine. The routines
you will need for inversion are defined in lapack.h. Even then,
inversion isn't going to be a single-step process - there are 101
different ways to go about it. Just one example: to process a
single-precision matrix you can first run your matrix through sgetrf_
to compute the LU factorization and pivots, and then sgetri_ to compute
the inverse from the results of sgetrf. You can find docs for LAPACK
online (just do a google for "lapack").
I'm not sure what kind of number crunching you are doing, nor your
knowledge of matrix operations. I am going to assume the worst in what
I have to say here, but please don't take it as an insult. If you know
this stuff, just ignore me:
a) Inversion is not a simple operation such as matrix addition or
multiply. In fact, some matrices don't even have an inverse.
b) Some methods for inverting a matrix require specific matrix types
(positive semi-definite, etc), but are much faster. There are more
general methods, but they are slower (LU decomposition for example).
c) Depending on the size and sparsity of your matrix you can easily run
up against the limits of single precision calculations. If you have to
go with double precision, AltiVec will not help you.
Matrix inversion in any case is an expensive operation, and can
sometimes be avoided. Without knowing the specifics of what kind of
matrices you are working with, it is difficult to make any
recommendations one way or another.
Cheers,
tim
On Tuesday, March 4, 2003, at 03:25 AM, Jim Jaeger wrote:
I've spent some time designing an application around matrix processing
to get the increased speed of the G4's vector processor. Now I need to
learn how to use the vecLib framework to perform matrix inversion and
multiplication.
I have worked through Hillegas, I've read the book and done all the
exercises in Garfinkle and Mahoney, and I'm half way through Anguish
et.al. (I gave up on the first edition of _Learning_Cocoa_ at page
147). I have searched the Apple Developer web site for a simple
tutorial on how to use vecLib for simple multiplication and inversion.
Nothing tells me what I want to know.
So far, I think I have learned that cblas_sgemm() will multiply two
matrices for me, but I can find nothing that looks like it will do an
inversion. The documentation I've been able to uncover is anything but
clear. The header files I've found list the functions and parameters,
but the naming conventions carefully hide the purpose of the functions
[who would guess that cblas_sgemm() is a multiplication routine?].
Tomorrow, I'll try again to read the BLAS report to see if I can learn
how to read the function names.
Can someone point me to a source of information on vecLib suitable for
beginners at Cocoa and Obj-C? All I need to do is a few simple matrix
multiplications and inversions for matrices up to 10x10, single
precision.
jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.