Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
vnl_lsqr Class Reference

Linear least squares. More...

#include <vnl_lsqr.h>

Public Member Functions

 vnl_lsqr (vnl_linear_system &ls)
 
 ~vnl_lsqr ()
 
void set_max_iterations (long max_iter)
 
int minimize (vnl_vector< double > &x)
 Perform the minimization starting from x=0 and putting the result into x. More...
 
long get_number_of_iterations () const
 
void diagnose_outcome (std::ostream &os) const
 Pontificate about the outcome of the last minimization. More...
 
double get_resid_norm_estimate () const
 Return the residual norm estimate:. More...
 
long return_code () const
 Get the return code for the last minimization. More...
 

Static Public Member Functions

static void translate_return_code (std::ostream &os, int return_code)
 

Static Protected Member Functions

static int aprod_ (const long *mode, const long *m, const long *n, double *x, double *y, long *leniw, long *lenrw, long *iw, double *rw, void *userdata)
 

Protected Attributes

vnl_linear_systemls_
 
long max_iter_
 
long num_iter_
 
double resid_norm_estimate_
 
double result_norm_estimate_
 
double A_condition_estimate_
 
double result_norm_
 
long return_code_
 

Detailed Description

Linear least squares.

vnl_lsqr implements an algorithm for large, sparse linear systems and sparse, linear least squares. It is a wrapper for the LSQR algorithm of Paige and Saunders (ACM TOMS 583). The sparse system is encapsulated by a vnl_linear_system.

Definition at line 37 of file vnl_lsqr.h.

Constructor & Destructor Documentation

◆ vnl_lsqr()

vnl_lsqr::vnl_lsqr ( vnl_linear_system ls)
inline

Definition at line 40 of file vnl_lsqr.h.

◆ ~vnl_lsqr()

vnl_lsqr::~vnl_lsqr ( )
default

Member Function Documentation

◆ aprod_()

int vnl_lsqr::aprod_ ( const long *  mode,
const long *  m,
const long *  n,
double *  x,
double *  y,
long *  leniw,
long *  lenrw,
long *  iw,
double *  rw,
void *  userdata 
)
staticprotected

Definition at line 83 of file vnl_lsqr.cxx.

◆ diagnose_outcome()

void vnl_lsqr::diagnose_outcome ( std::ostream &  os) const

Pontificate about the outcome of the last minimization.

Definition at line 178 of file vnl_lsqr.cxx.

◆ get_number_of_iterations()

long vnl_lsqr::get_number_of_iterations ( ) const
inline

Definition at line 52 of file vnl_lsqr.h.

◆ get_resid_norm_estimate()

double vnl_lsqr::get_resid_norm_estimate ( ) const
inline

Return the residual norm estimate:.

Definition at line 60 of file vnl_lsqr.h.

◆ minimize()

int vnl_lsqr::minimize ( vnl_vector< double > &  x)

Perform the minimization starting from x=0 and putting the result into x.

Return code may be translated with translate_return_code(), or the result of the minimization may be printed in more detail with diagnose_outcome()

Definition at line 112 of file vnl_lsqr.cxx.

◆ return_code()

long vnl_lsqr::return_code ( ) const
inline

Get the return code for the last minimization.

Definition at line 63 of file vnl_lsqr.h.

◆ set_max_iterations()

void vnl_lsqr::set_max_iterations ( long  max_iter)
inline

Definition at line 45 of file vnl_lsqr.h.

◆ translate_return_code()

void vnl_lsqr::translate_return_code ( std::ostream &  os,
int  return_code 
)
static

Definition at line 187 of file vnl_lsqr.cxx.

Member Data Documentation

◆ A_condition_estimate_

double vnl_lsqr::A_condition_estimate_
protected

Definition at line 71 of file vnl_lsqr.h.

◆ ls_

vnl_linear_system* vnl_lsqr::ls_
protected

Definition at line 66 of file vnl_lsqr.h.

◆ max_iter_

long vnl_lsqr::max_iter_
protected

Definition at line 67 of file vnl_lsqr.h.

◆ num_iter_

long vnl_lsqr::num_iter_
protected

Definition at line 68 of file vnl_lsqr.h.

◆ resid_norm_estimate_

double vnl_lsqr::resid_norm_estimate_
protected

Definition at line 69 of file vnl_lsqr.h.

◆ result_norm_

double vnl_lsqr::result_norm_
protected

Definition at line 72 of file vnl_lsqr.h.

◆ result_norm_estimate_

double vnl_lsqr::result_norm_estimate_
protected

Definition at line 70 of file vnl_lsqr.h.

◆ return_code_

long vnl_lsqr::return_code_
protected

Definition at line 73 of file vnl_lsqr.h.


The documentation for this class was generated from the following files: