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

◆ Bound

Enumerator
LOWER_BOUND 
UPPER_BOUND 
UNCONSTRAINED 

◆ LSResult

Enumerator
SUCCESS 
INCONSISTENT_BOUNDS 
UNDERDETERMINED 
SINGULAR 
UNCONVERGED 

Constructor & Destructor Documentation

◆ ConstrainedLS()

ConstrainedLS::ConstrainedLS ( )

Member Function Documentation

◆ solveBoundConstrained()

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().

◆ solveUnconstrained()

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

Solve the unconstrained least squares problem

◆ boundsConsistent()

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

◆ getConstraints()

Vector<Bound> ConstrainedLS::getConstraints ( ) const

Get a vector of Bound indicating constraint activity.

◆ numberActiveConstraints()

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().

◆ getResidual()

Real ConstrainedLS::getResidual ( ) const

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

◆ qrSolution()

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

◆ allocArray()

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

◆ freeArray()

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

Member Data Documentation

◆ m_boundState

Vector<Bound> ConstrainedLS::m_boundState
protected

◆ m_nbound

int ConstrainedLS::m_nbound
protected

◆ m_residual

Real ConstrainedLS::m_residual
private

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