[Insight-users] qury regarding vnl library of ITk
Luis Ibanez
luis.ibanez at kitware.com
Mon Mar 7 19:37:12 EST 2011
Hi Chinmay,
1) The determinant of a 3x4 matrix is always zero.
2) vnl_det can only be called on "vnl_matrix_fixed" types.
Please do:
#include "vnl/vnl_det.h"
#include "vnl/vnl_matrix_fixed.h"
#include <iostream>
int main()
{
vnl_matrix_fixed<double,3,3> m;
m(0,0) = 1;
m(1,1) = 2;
m(2,2) = 3;
double det = vnl_det( m );
std::cout << "det = " << det << std::endl;
return 0;
}
Thanks
Luis
-------------------------------------
On Sat, Mar 5, 2011 at 8:02 PM, Chinmay Srivastav
<srivastavchinmay at gmail.com> wrote:
> Hi Luiz,
>
> I am a newbie in ITK and I am given a task to find out the determinant and
> rank of the matrix using ITK. I have written the following code:
>
> #include <itkMatrix.h>
> #include <vnl/vnl_matrix.h>
> #include <vnl/vnl_vector.h>
> #include <vnl/vnl_det.h>
>
> int main()
> {
> vnl_matrix<double> P(3,4);
> P.set_identity();
> vcl_cerr << "The First matrix is ";
> vcl_cerr <<P;
> vnl_det(P);
> return 0;
> }
>
> On building the code i get following error message:
>
> error: no matching function for call to 'vnl_det(vnl_matrix<double>&)'
>
> Unfortunately I am not able to debug this error. Kindly provide me help so
> that I can debug this error.
>
> Also provide me some link that provides good documentation about the vnl
> library. I have searched a lot but was unable to get good documentation
> regarding this especially for computing Determinant and Rank.
>
>
> Please help and oblige
>
> Thanks
> Regards
> Chinmaya Srivastava
>
>
More information about the Insight-users
mailing list