help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] Matrix / Vector multiplication


From: Peter Jay Salzman
Subject: Re: [Help-gsl] Matrix / Vector multiplication
Date: Sun, 11 Feb 2007 03:51:36 -0500
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun 11 Feb 07,  8:43 AM, John D Lamb <address@hidden> said:
> On Sun, 2007-02-11 at 02:28 -0500, Peter Jay Salzman wrote:
> > Just discovered GSL a few hours ago.  Very neat!
> 
> > I've been trying to figure out how to multiply a vector and matrix.  How is
> > one supposed to compute something like
> > 
> >    A x
> > 
> > given a gsl_matrix A and a gsl_vector x?   Does x need to be defined as a
> > nx1 gsl_matrix for a column vector and a 1xn gsl_matrix for a row vector?
> 
> Look at the documentation for gsl_blas_dgemv. The vector x should be a
> gsl_vector and the result a vector y. Vectors and matrices are passed as
> pointers. You should end up with something like
> 
> #include<gsl/gsl_blas.h>
> ...
> 
> err = gsl_blas_dgemv( CblasNoTrans, 1.0, A, x, 0.0, y );
 
Thanks, John!


gsl_blas_dgemv?!?  Holy smokes!  No wonder I had a hard time finding it.
Has anyone thought of renaming this function something like
"gsl_matrix_multiply()"?

:-P

Thanks again!  :)  Judging by that name, I may have a lot of Googling ahead
of me tonight!

Pete

-- 
How VBA rounds a number depends on the number's internal representation.
You cannot always predict how it will round when the rounding digit is 5.
If you want a rounding function that rounds according to predictable rules,
you should write your own.
              -- MSDN, on Microsoft VBA's "stochastic" rounding function

Peter Jay Salzman, email: address@hidden web: http://www.dirac.org/p    
PGP Fingerprint: B9F1 6CF3 47C4 7CD8 D33E  70A9 A3B9 1945 67EA 951D




reply via email to

[Prev in Thread] Current Thread [Next in Thread]