18 #ifndef __VNLIterativeSparseSolverTraits_h
19 #define __VNLIterativeSparseSolverTraits_h
21 #include "vnl/vnl_vector.h"
22 #include "vnl/vnl_sparse_matrix.h"
23 #include "vnl/vnl_sparse_matrix_linear_system.h"
24 #include "vnl/algo/vnl_lsqr.h"
42 template<
typename T =
double >
90 typedef vnl_sparse_matrix_linear_system< ValueType > SparseLinearSystemType;
91 SparseLinearSystemType system(iA, iB);
94 return solver.minimize(oX);
102 bool result1 =
Solve(iA, iBx, 100000, oX);
103 bool result2 =
Solve(iA, iBy, 100000, oY);
104 bool result3 =
Solve(iA, iBz, 100000, oZ);
106 return ( result1 && result2 && result3 );
114 bool result1 =
Solve(iA, iBx, oX);
115 bool result2 =
Solve(iA, iBy, oY);
117 return ( result1 && result2 );
123 const long & iNbIter,
126 typedef vnl_sparse_matrix_linear_system< ValueType > SparseLinearSystemType;
127 SparseLinearSystemType system(iA, iB);
130 solver.set_max_iterations(iNbIter);
131 return solver.minimize(oX);