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 );


-- 
JDL



_______________________________________________
Help-gsl mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gsl

Reply via email to