Re: vecLib framework sample code (Tony Royal, Timothy Ritchey)
Re: vecLib framework sample code (Tony Royal, Timothy Ritchey)
- Subject: Re: vecLib framework sample code (Tony Royal, Timothy Ritchey)
- From: Jim Jaeger <email@hidden>
- Date: Tue, 4 Mar 2003 23:37:52 -0800
To my request for help on finding a solution to matrix multiplication
and inversion...
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...
Tony Royal wrote
There is an excellent reference at
http://developer.apple.com/hardware/ve/vector_libraries.html. Download
the sample code for the Basic Linear Algebra Sub programs (BLAS).
Timothy Ritchey wrote
...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...
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.
Thanks, Tony. I've now run several of the samples and have convinced
myself that they work. It doesn't appear that they address my inversion
problem, most likely for the reason that Timothy points out: the BLAS
routines are a level below what I need to do an inversion.
Timothy, thanks for the pointer to the LAPACK routines. I'll have a
look at those over the next few days. No offense was taken for the
cautions on matrix inversion. I'm aware of the problems (graduate level
linear algebra), but hoping for a straightforward, maybe simple,
solution.
Thanks, Tony and Timothy.
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.