MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
LinearSolver Class Referenceabstract

#include <ls.h>

Inheritance diagram for LinearSolver:
Collaboration diagram for LinearSolver:

Classes

struct  ErrFactor
 
struct  ErrNoPivot
 
struct  ErrNullColumn
 

Public Member Functions

 LinearSolver (SolutionManager *pSM=NULL)
 
virtual ~LinearSolver (void)
 
virtual void Reset (void)
 
virtual void Solve (void) const =0
 
virtual void SolveT (void) const
 
bool bReset (void) const
 
void SetSolutionManager (SolutionManager *pSM)
 
doublerealpdGetResVec (void) const
 
doublerealpdGetSolVec (void) const
 
doublerealpdSetResVec (doublereal *pd)
 
doublerealpdSetSolVec (doublereal *pd)
 
virtual void MakeCompactForm (SparseMatrixHandler &mh, std::vector< doublereal > &Ax, std::vector< integer > &Ar, std::vector< integer > &Ac, std::vector< integer > &Ap) const
 
virtual bool bGetConditionNumber (doublereal &dCond)
 

Protected Attributes

SolutionManagerpSM
 
bool bHasBeenReset
 
doublerealpdRhs
 
doublerealpdSol
 

Detailed Description

Definition at line 57 of file ls.h.

Constructor & Destructor Documentation

LinearSolver::LinearSolver ( SolutionManager pSM = NULL)

Definition at line 46 of file ls.cc.

References NO_OP.

47 : pSM(psm), bHasBeenReset(true), pdRhs(0), pdSol(0)
48 {
49  NO_OP;
50 }
bool bHasBeenReset
Definition: ls.h:73
#define NO_OP
Definition: myassert.h:74
SolutionManager * pSM
Definition: ls.h:72
doublereal * pdSol
Definition: ls.h:75
doublereal * pdRhs
Definition: ls.h:74
LinearSolver::~LinearSolver ( void  )
virtual

Definition at line 52 of file ls.cc.

References NO_OP.

53 {
54  NO_OP;
55 }
#define NO_OP
Definition: myassert.h:74

Member Function Documentation

bool LinearSolver::bGetConditionNumber ( doublereal dCond)
virtual

Definition at line 132 of file ls.cc.

Referenced by SolutionManager::bGetConditionNumber().

133 {
134  return false; // true means that the condition number was returned in dCond
135 }
bool LinearSolver::bReset ( void  ) const
inline

Definition at line 89 of file ls.h.

References bHasBeenReset.

Referenced by NaiveSparseSolutionManager::ScaleMatrixAndRightHandSide().

89 { return bHasBeenReset; };
bool bHasBeenReset
Definition: ls.h:73
void LinearSolver::MakeCompactForm ( SparseMatrixHandler mh,
std::vector< doublereal > &  Ax,
std::vector< integer > &  Ar,
std::vector< integer > &  Ac,
std::vector< integer > &  Ap 
) const
virtual

Definition at line 123 of file ls.cc.

References NO_OP.

128 {
129  NO_OP;
130 }
#define NO_OP
Definition: myassert.h:74
doublereal * LinearSolver::pdGetResVec ( void  ) const

Definition at line 88 of file ls.cc.

References pdRhs.

89 {
90  return pdRhs;
91 }
doublereal * pdRhs
Definition: ls.h:74
doublereal * LinearSolver::pdGetSolVec ( void  ) const

Definition at line 106 of file ls.cc.

References pdSol.

107 {
108  return pdSol;
109 }
doublereal * pdSol
Definition: ls.h:75
doublereal * LinearSolver::pdSetResVec ( doublereal pd)

Definition at line 95 of file ls.cc.

References pdRhs.

Referenced by NaiveSparseSolutionManager::NaiveSparseSolutionManager(), and SolutionManager::pdSetResVec().

96 {
97  doublereal *p = pdRhs;
98 
99  pdRhs = pd;
100 
101  return p;
102 }
doublereal * pdRhs
Definition: ls.h:74
double doublereal
Definition: colamd.c:52
doublereal * LinearSolver::pdSetSolVec ( doublereal pd)

Definition at line 113 of file ls.cc.

References pdSol.

Referenced by NaiveSparseSolutionManager::NaiveSparseSolutionManager(), and SolutionManager::pdSetSolVec().

114 {
115  doublereal *p = pdSol;
116 
117  pdSol = pd;
118 
119  return p;
120 }
doublereal * pdSol
Definition: ls.h:75
double doublereal
Definition: colamd.c:52
void LinearSolver::Reset ( void  )
virtual

Reimplemented in NaiveSolver.

Definition at line 68 of file ls.cc.

References bHasBeenReset.

Referenced by NaiveSparseSolutionManager::MatrReset().

69 {
70  bHasBeenReset = true;
71 }
bool bHasBeenReset
Definition: ls.h:73
void LinearSolver::SetSolutionManager ( SolutionManager pSM)

Definition at line 81 of file ls.cc.

References pSM.

Referenced by NaiveSparseSolutionManager::NaiveSparseSolutionManager().

82 {
83  pSM = psm;
84 }
virtual void LinearSolver::Solve ( void  ) const
pure virtual

Implemented in NaiveSolver.

Referenced by NaiveSparseSolutionManager::Solve().

void LinearSolver::SolveT ( void  ) const
virtual

Definition at line 74 of file ls.cc.

References MBDYN_EXCEPT_ARGS.

75 {
76  silent_cerr("LinearSolver::SolveT() not supported" << std::endl);
78 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63

Member Data Documentation

bool LinearSolver::bHasBeenReset
mutableprotected

Definition at line 73 of file ls.h.

Referenced by bReset(), NaiveSolver::Reset(), Reset(), and NaiveSolver::Solve().

doublereal* LinearSolver::pdRhs
protected

Definition at line 74 of file ls.h.

Referenced by pdGetResVec(), pdSetResVec(), and NaiveSolver::Solve().

doublereal* LinearSolver::pdSol
protected

Definition at line 75 of file ls.h.

Referenced by pdGetSolVec(), pdSetSolVec(), and NaiveSolver::Solve().

SolutionManager* LinearSolver::pSM
protected

Definition at line 72 of file ls.h.

Referenced by SetSolutionManager().


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