2 #ifndef vnl_sparse_lst_sqr_function_h_ 3 #define vnl_sparse_lst_sqr_function_h_ 19 #include "vnl/vnl_export.h" 66 unsigned int num_params_per_a,
68 unsigned int num_params_per_b,
69 unsigned int num_params_c,
70 unsigned int num_residuals_per_e,
83 unsigned int num_params_per_a,
85 unsigned int num_params_per_b,
86 unsigned int num_params_c,
87 const std::vector<std::vector<bool> >& xmask,
88 unsigned int num_residuals_per_e,
103 const std::vector<unsigned int>& b_sizes,
104 unsigned int num_params_c,
105 const std::vector<unsigned int>& e_sizes,
106 const std::vector<std::vector<bool> >& xmask,
191 virtual void fij(
int i,
int j,
198 virtual void jac_Aij(
unsigned int i,
unsigned int j,
205 virtual void jac_Bij(
unsigned int i,
unsigned int j,
212 virtual void jac_Cij(
unsigned int i,
unsigned int j,
219 void fd_jac_Aij(
int i,
int j,
227 void fd_jac_Bij(
int i,
int j,
235 void fd_jac_Cij(
int i,
int j,
245 virtual void compute_weight_ij(
int i,
int j,
254 virtual void apply_weight_ij(
int i,
int j,
255 double const& weight,
260 virtual void apply_weight_ij(
int i,
int j,
261 double const& weight,
267 virtual void trace(
int iteration,
288 int k = residual_indices_(i,j);
290 else return number_of_residuals(k);
294 unsigned int index_a(
int i)
const {
return indices_a_[i]; }
297 unsigned int index_b(
int j)
const {
return indices_b_[j]; }
300 unsigned int index_e(
int k)
const {
return indices_e_[k]; }
303 unsigned int number_of_a()
const {
return (
unsigned int)(indices_a_.size()-1); }
306 unsigned int number_of_b()
const {
return (
unsigned int)(indices_b_.size()-1); }
309 unsigned int number_of_e()
const {
return (
unsigned int)(indices_e_.size()-1); }
332 void dim_warning(
unsigned int n_unknowns,
unsigned int n_residuals);
335 #endif // vnl_sparse_lst_sqr_function_h_ unsigned int number_of_params_a(int i) const
Return the number of parameters of a_j.
unsigned int number_of_residuals(int i, int j) const
Return the number of residuals for x_ij.
unsigned int index_a(int i) const
return the index of aj in a.
unsigned int number_of_b() const
Return the number of subsets in b.
unsigned int number_of_params_c() const
Return the number of parameters of c.
Compressed Row Storage (CRS) indexing.
std::vector< unsigned int > indices_e_
const vnl_crs_index & residual_indices() const
Return a const reference to the residual indexer.
unsigned int number_of_residuals(int k) const
Return the number of residuals in the kth residual vector.
unsigned int index_b(int j) const
return the index of bj in b.
An ordinary mathematical matrix.
vnl_crs_index residual_indices_
unsigned int number_of_a() const
Return the number of subsets in a.
unsigned int index_e(int k) const
return the index of ek in e.
Abstract base for sparse least squares functions.
bool has_weights() const
Return true if the derived class has indicated that.
unsigned int num_params_c_
std::vector< unsigned int > indices_b_
unsigned int number_of_e() const
Return the number of residual vectors.
Represents the configuration of a sparse matrix but not the data.
unsigned int number_of_params_b(int j) const
Return the number of parameters of b_i.
std::vector< unsigned int > indices_a_
bool has_gradient() const
Return true if the derived class has indicated that gradf has been implemented.