From: Ian S. <ian...@st...> - 2005-01-11 13:21:35
|
Riccardo Lattanzi wrote: > Hi, > > A friend of mine has just introduced me to VNL, but I'm not sure > if I'll be able to use it as-is for my purposes. > > I need to invert a matrix of complex numbers whose rows are almost > linearly dependent. I hope somebody can help me with the following > questions: I take it using an SVD based inverse with double precision is not sufficient? > > 1- Can I create a matrix of complex elements? > Yes vnl_matrix<vcl_complex<double> > M(m,n); > 2- Is there a way to use arbitrary precision for the complex > data type (kind of what can be done with mathematica)? Unfortunately we don't have an infinite precision real number class. That said it would not be difficult to create one. Create a new class vnl_arbitrary_precision, that looks the same as vnl_rational, and change the type of the numerator and denominator to vnl_bignum. There would no doubt be a several other changes to the class's API to get this to work smoothly. vnl should then allow you to create a matrix with a complex version of this new type: vnl_matrix<vcl_complex<vnl_arbitrary_precision> > The biggest problem however is that most (and probably all) of the matrix decomposition and inversion classes in vnl_algo are actually just thin wrappers around the netlib library. This Fortran library can only cope with matrices of float, double, complex<float> and complex<double> types. Writing a basic LU decomposition based class would be possible. Ian. |