CppNoddy  0.92
Loading...
Searching...
No Matches
Public Member Functions | Protected Types | List of all members
CppNoddy::DenseLinearSystem< _Type > Class Template Reference

A linear system class for vector right-hand sides. More...

#include <DenseLinearSystem.h>

Public Member Functions

 DenseLinearSystem (DenseMatrix< _Type > *m_pA, DenseVector< _Type > *m_pB, std::string which="native")
 Constructor for a dense linear system object. More...
 
 ~DenseLinearSystem ()
 Destructor for a linear system object. More...
 
void solve ()
 Solve the sparse system. More...
 
int get_det_sign () const
 Get the sign of the determinant of the LHS matrix from the linear system just computed. More...
 
void set_monitor_det (bool flag)
 Store the sign of the determinant of the LHS matrix every time a solve is requested on a real system. More...
 

Protected Types

typedef DenseMatrix< _Type >::row_iter row_iter
 
typedef DenseMatrix< _Type >::row_riter row_riter
 
typedef DenseMatrix< _Type >::row_citer row_citer
 
typedef DenseMatrix< _Type >::elt_iter elt_iter
 
typedef DenseMatrix< _Type >::elt_riter elt_riter
 
typedef DenseMatrix< _Type >::elt_citer elt_citer
 

Detailed Description

template<typename _Type>
class CppNoddy::DenseLinearSystem< _Type >

A linear system class for vector right-hand sides.

The class is constructed for dense typed problems of the form

\[ A_{NxN} \,{\underline x}_i = B_{1xN} \]

.

Definition at line 16 of file DenseLinearSystem.h.

Member Typedef Documentation

◆ elt_citer

template<typename _Type >
typedef DenseMatrix<_Type>::elt_citer CppNoddy::DenseLinearSystem< _Type >::elt_citer
protected

Definition at line 26 of file DenseLinearSystem.h.

◆ elt_iter

template<typename _Type >
typedef DenseMatrix<_Type>::elt_iter CppNoddy::DenseLinearSystem< _Type >::elt_iter
protected

Definition at line 24 of file DenseLinearSystem.h.

◆ elt_riter

template<typename _Type >
typedef DenseMatrix<_Type>::elt_riter CppNoddy::DenseLinearSystem< _Type >::elt_riter
protected

Definition at line 25 of file DenseLinearSystem.h.

◆ row_citer

template<typename _Type >
typedef DenseMatrix<_Type>::row_citer CppNoddy::DenseLinearSystem< _Type >::row_citer
protected

Definition at line 22 of file DenseLinearSystem.h.

◆ row_iter

template<typename _Type >
typedef DenseMatrix<_Type>::row_iter CppNoddy::DenseLinearSystem< _Type >::row_iter
protected

Definition at line 20 of file DenseLinearSystem.h.

◆ row_riter

template<typename _Type >
typedef DenseMatrix<_Type>::row_riter CppNoddy::DenseLinearSystem< _Type >::row_riter
protected

Definition at line 21 of file DenseLinearSystem.h.

Constructor & Destructor Documentation

◆ DenseLinearSystem()

template<typename _Type >
CppNoddy::DenseLinearSystem< _Type >::DenseLinearSystem ( DenseMatrix< _Type > *  m_pA,
DenseVector< _Type > *  m_pB,
std::string  which = "native" 
)

Constructor for a dense linear system object.

Parameters
m_pAA pointer to the 'A matrix', an nxn double/complex dense matrix
m_pBA pointer to the 'B vector' a size n double/complex dense vector
whichA string that indicates which solver to use

Definition at line 15 of file DenseLinearSystem.cpp.

17 :
18 m_minPivot(1.e-12), m_detSign(0), m_monitorDet(false) {
19 this -> m_pA = p_A;
20 this -> m_pB = p_B;
21 m_version = which;
22 if((m_version != "lapack") && (m_version != "native")) {
23 std::string problem;
24 problem = "The DenseLinearSystem has been instantiated with an unrecognised\n";
25 problem += "request for a solver type. Options are 'native' or 'lapack'. \n";
26 throw ExceptionRuntime(problem);
27 }
28 }

◆ ~DenseLinearSystem()

template<typename _Type >
CppNoddy::DenseLinearSystem< _Type >::~DenseLinearSystem ( )
inline

Destructor for a linear system object.

Definition at line 37 of file DenseLinearSystem.h.

38 {}

Member Function Documentation

◆ get_det_sign()

template<typename _Type >
int CppNoddy::DenseLinearSystem< _Type >::get_det_sign

Get the sign of the determinant of the LHS matrix from the linear system just computed.

Returns
The sign of the determinant of the LAST solved system.

Definition at line 241 of file DenseLinearSystem.cpp.

241 {
242 return m_detSign;
243 }

Referenced by CppNoddy::Newton< _Type >::arclength_solve(), and CppNoddy::Newton< _Type >::iterate().

◆ set_monitor_det()

template<typename _Type >
void CppNoddy::DenseLinearSystem< _Type >::set_monitor_det ( bool  flag)

Store the sign of the determinant of the LHS matrix every time a solve is requested on a real system.

Parameters
flagThe boolean value to set.

Definition at line 246 of file DenseLinearSystem.cpp.

246 {
247 m_monitorDet = flag;
248 }

Referenced by CppNoddy::Newton< _Type >::arclength_solve(), and CppNoddy::Newton< _Type >::iterate().

◆ solve()

template<typename _Type >
void CppNoddy::DenseLinearSystem< _Type >::solve

Solve the sparse system.

Definition at line 31 of file DenseLinearSystem.cpp.

31 {
32 if("lapack" == m_version) {
33 solve_lapack();
34 } else { // we catch incorrect m_version choices in the ctor
35 solve_native();
36 }
37 }

Referenced by CppNoddy::Newton< _Type >::arclength_solve(), CppNoddy::Newton< _Type >::iterate(), and main().


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

© 2012

R.E. Hewitt