Go to the documentation of this file.00001
00002 #ifndef vnl_sparse_matrix_linear_system_h_
00003 #define vnl_sparse_matrix_linear_system_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include <vnl/vnl_linear_system.h>
00024 #include <vnl/vnl_sparse_matrix.h>
00025
00026
00027
00028 template <class T>
00029 class vnl_sparse_matrix_linear_system : public vnl_linear_system
00030 {
00031 public:
00032
00033
00034 vnl_sparse_matrix_linear_system(vnl_sparse_matrix<T> const& A, vnl_vector<T> const& b) :
00035 vnl_linear_system(A.columns(), A.rows()), A_(A), b_(b), jacobi_precond_() {}
00036
00037
00038 void multiply(vnl_vector<double> const& x, vnl_vector<double> & b) const;
00039
00040 void transpose_multiply(vnl_vector<double> const& b, vnl_vector<double> & x) const;
00041
00042 void get_rhs(vnl_vector<double>& b) const;
00043
00044 void apply_preconditioner(vnl_vector<double> const& x, vnl_vector<double> & px) const;
00045
00046 protected:
00047 vnl_sparse_matrix<T> const& A_;
00048 vnl_vector<T> const& b_;
00049 vnl_vector<double> jacobi_precond_;
00050 };
00051
00052 #if !defined(VCL_VC_7)
00053 VCL_DEFINE_SPECIALIZATION
00054 void vnl_sparse_matrix_linear_system<double>::get_rhs(vnl_vector<double>& b) const;
00055 VCL_DEFINE_SPECIALIZATION
00056 void vnl_sparse_matrix_linear_system<double>::transpose_multiply(vnl_vector<double> const& b, vnl_vector<double> & x) const;
00057 VCL_DEFINE_SPECIALIZATION
00058 void vnl_sparse_matrix_linear_system<float>::get_rhs(vnl_vector<double>& b) const;
00059 VCL_DEFINE_SPECIALIZATION
00060 void vnl_sparse_matrix_linear_system<float>::transpose_multiply(vnl_vector<double> const& b, vnl_vector<double> & x) const;
00061 VCL_DEFINE_SPECIALIZATION
00062 void vnl_sparse_matrix_linear_system<double>::multiply(vnl_vector<double> const& x, vnl_vector<double> & b) const;
00063 VCL_DEFINE_SPECIALIZATION
00064 void vnl_sparse_matrix_linear_system<float>::multiply(vnl_vector<double> const& x, vnl_vector<double> & b) const;
00065 #endif
00066
00067 #endif // vnl_sparse_matrix_linear_system_h_