Chombo + EB  3.0
Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ConstrainedLS Class Reference

#include <ConstrainedLS.H>

Public Types

enum  Bound { LOWER_BOUND, UPPER_BOUND, UNCONSTRAINED }
 
enum  LSResult {
  SUCCESS, INCONSISTENT_BOUNDS, UNDERDETERMINED, SINGULAR,
  UNCONVERGED
}
 

Public Member Functions

 ConstrainedLS ()
 
LSResult solveBoundConstrained (Vector< Real > &a_x, Real **a_A, const Vector< Real > &a_rhs, const Vector< Real > &a_lowerBound, const Vector< Real > &a_upperBound)
 
LSResult solveUnconstrained (Vector< Real > &a_x, Real **a_A, const Vector< Real > &a_rhs)
 
bool boundsConsistent (const Vector< Real > &a_lowBound, const Vector< Real > &a_hiBound) const
 
Vector< BoundgetConstraints () const
 
int numberActiveConstraints () const
 
Real getResidual () const
 
LSResult qrSolution (Real **a_A, Vector< Real > &a_x, Vector< Real > &a_b, Real &resq)
 

Protected Attributes

Vector< Boundm_boundState
 
int m_nbound
 

Private Member Functions

void allocArray (const int &rows, const int &cols, Real **&A)
 
void freeArray (const int &rows, const int &cols, Real **&A)
 

Private Attributes

Real m_residual
 

Member Enumeration Documentation

Enumerator
LOWER_BOUND 
UPPER_BOUND 
UNCONSTRAINED 
Enumerator
SUCCESS 
INCONSISTENT_BOUNDS 
UNDERDETERMINED 
SINGULAR 
UNCONVERGED 

Constructor & Destructor Documentation

ConstrainedLS::ConstrainedLS ( )

Member Function Documentation

LSResult ConstrainedLS::solveBoundConstrained ( Vector< Real > &  a_x,
Real **  a_A,
const Vector< Real > &  a_rhs,
const Vector< Real > &  a_lowerBound,
const Vector< Real > &  a_upperBound 
)

Solve the bound-constrained least squares Uses the Lawson-Hanson active set method as given by P.B. Stark and R.L. Parker, Bounded-Variable Least-Squares: An Algorithm and Applications, Computational Statistics, 10:129-141, 1995. Uses solveUnconstrained for sub-problems

Referenced by LSProblem< dim >::invertNormalEq().

LSResult ConstrainedLS::solveUnconstrained ( Vector< Real > &  a_x,
Real **  a_A,
const Vector< Real > &  a_rhs 
)

Solve the unconstrained least squares problem

bool ConstrainedLS::boundsConsistent ( const Vector< Real > &  a_lowBound,
const Vector< Real > &  a_hiBound 
) const
Vector<Bound> ConstrainedLS::getConstraints ( ) const

Get a vector of Bound indicating constraint activity.

int ConstrainedLS::numberActiveConstraints ( ) const

Query the number of active constraints. Bails if a LS problem has not been solved yet

Referenced by LSProblem< dim >::invertNormalEq().

Real ConstrainedLS::getResidual ( ) const

Get the LS residual Bails if a LS problem has not been solved yet

LSResult ConstrainedLS::qrSolution ( Real **  a_A,
Vector< Real > &  a_x,
Vector< Real > &  a_b,
Real resq 
)

Solve the least squares problem. Uses successive Householder rotations

void ConstrainedLS::allocArray ( const int &  rows,
const int &  cols,
Real **&  A 
)
private
void ConstrainedLS::freeArray ( const int &  rows,
const int &  cols,
Real **&  A 
)
private

Member Data Documentation

Vector<Bound> ConstrainedLS::m_boundState
protected
int ConstrainedLS::m_nbound
protected
Real ConstrainedLS::m_residual
private

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