[Insight-users] about Matrix operation

zhuang song songz at seas . upenn . edu
Wed, 20 Aug 2003 17:47:18 -0400


Hi,
I want to solve a linear equation. A*X=B, X=inv(A)*B. 
To do the matrix inversion, I used vnl classes.

double A[64][64];
double B[64];
double C[64];

vnl_matrix<double> vnl_a(64,64);
vnl_vector<double > vnl_b(64), vnl_c(64);

1. how to assign A to vnl_a, and then vice versa in a simple way?
2. can I do the inversion like:
vnl_c = vnl_matrix_inverse(vnl_a) * vnl_b  ?

thanks,
Zhuang