Lagrangian Particle Code for The Simulation of 2D/3D Fluid Dynamics
 All Classes Files Functions Variables Typedefs Friends Pages
Public Member Functions | Protected Attributes | List of all members
LSSolver Class Referenceabstract

An abstract class for the family of solvers for the least squares problem. More...

#include <ls_solver.h>

Inheritance diagram for LSSolver:
QRSolver

Public Member Functions

virtual ~LSSolver ()
 Destructor. More...
 
virtual int solve (double *result, double *b)=0
 Solves the least squares problem Ax = b. More...
 

Protected Attributes

std::size_t m_iNumRow
 The number of rows in matrix A.
 
std::size_t m_iNumCol
 The number of columns in matrix A.
 
double * m_vA
 The matrix A.
 
double * m_vb
 The vector b (the right-hand-side)
 

Detailed Description

An abstract class for the family of solvers for the least squares problem.

Author
Chen, Hsin-Chiang (morri.nosp@m.sche.nosp@m.n2008.nosp@m.@gma.nosp@m.il.co.nosp@m.m)

Co-author: Yu, Kwangmin (yukwa.nosp@m.ngmi.nosp@m.n@gma.nosp@m.il.c.nosp@m.om) on initial interface design

Version
1.0
Date
2014/10/09

Created on: 2014/09/20

Constructor & Destructor Documentation

virtual LSSolver::~LSSolver ( )
inlinevirtual

Destructor.

Note
The data members m_vA and m_vb will point to some memory outside this class , as a result no memory should be deleted in this destructor

Member Function Documentation

virtual int LSSolver::solve ( double *  result,
double *  b 
)
pure virtual

Solves the least squares problem Ax = b.

A is a mxn matrix, b is a mx1 vector, and x is the solution which is a nx1 vector.

Parameters
[out]resultThe x in Ax = b, which is a nx1 vector
[in]bThe right-hand-size, which is a mx1 vector
Returns
0 if success; otherwise if failure
Warning
The input array b may be modified in this method

Implemented in QRSolver.


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