Jpp  18.5.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Attributes | List of all members
JACOUSTICS::TMatrixDS Struct Reference

Auxiliary data structure for compatibility of symmetric matrix. More...

#include <JKatoomba_t.hh>

Inheritance diagram for JACOUSTICS::TMatrixDS:

Public Member Functions

void resize (const size_t size)
 Resize matrix. More...
 
void reset ()
 Set matrix to the null matrix. More...
 
void invert ()
 Invert matrix according SVD decomposition. More...
 
template<class JVectorND_t >
void solve (JVectorND_t &u)
 Get solution of equation A x = b. More...
 

Static Public Attributes

static constexpr double TOLERANCE = 1.0e-8
 Tolerance for SVD. More...
 
static std::mutex mtx
 TDecompSVD. More...
 

Detailed Description

Auxiliary data structure for compatibility of symmetric matrix.

Inversion is based on SVD algorithm.

Definition at line 415 of file JKatoomba_t.hh.

Member Function Documentation

void JACOUSTICS::TMatrixDS::resize ( const size_t  size)
inline

Resize matrix.

Definition at line 423 of file JKatoomba_t.hh.

424  {
425  ResizeTo(size, size);
426  }
void JACOUSTICS::TMatrixDS::reset ( )
inline

Set matrix to the null matrix.

Definition at line 431 of file JKatoomba_t.hh.

432  {
433  Zero();
434  }
void JACOUSTICS::TMatrixDS::invert ( )
inline

Invert matrix according SVD decomposition.

Definition at line 439 of file JKatoomba_t.hh.

440  {
441 #ifdef THREAD_SAFE
442  using namespace std;
443 
444  unique_lock<mutex> lock(mtx);
445 #endif
446  TDecompSVD svd(*this, TOLERANCE);
447 
448  Bool_t status;
449 
450  static_cast<TMatrixD&>(*this) = svd.Invert(status);
451  }
static std::mutex mtx
TDecompSVD.
Definition: JKatoomba_t.hh:481
static constexpr double TOLERANCE
Tolerance for SVD.
Definition: JKatoomba_t.hh:418
template<class JVectorND_t >
void JACOUSTICS::TMatrixDS::solve ( JVectorND_t &  u)
inline

Get solution of equation A x = b.

Parameters
ucolumn vector; b on input, x on output(I/O)

Definition at line 459 of file JKatoomba_t.hh.

460  {
461 #ifdef THREAD_SAFE
462  using namespace std;
463 
464  unique_lock<mutex> lock(mtx);
465 #endif
466  TDecompSVD svd(*this, TOLERANCE);
467 
468  TVectorD b(u.size());
469 
470  for (size_t i = 0; i != u.size(); ++i) {
471  b[i] = u[i];
472  }
473 
474  svd.Solve(b);
475 
476  for (size_t i = 0; i != u.size(); ++i) {
477  u[i] = b[i];
478  }
479  }
static std::mutex mtx
TDecompSVD.
Definition: JKatoomba_t.hh:481
static constexpr double TOLERANCE
Tolerance for SVD.
Definition: JKatoomba_t.hh:418
double u[N+1]
Definition: JPolint.hh:865

Member Data Documentation

constexpr double JACOUSTICS::TMatrixDS::TOLERANCE = 1.0e-8
static

Tolerance for SVD.

Definition at line 418 of file JKatoomba_t.hh.

std::mutex JACOUSTICS::TMatrixDS::mtx
static

TDecompSVD.

Declaration of mutex.

Definition at line 481 of file JKatoomba_t.hh.


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