Jpp  18.2.0-rc.1
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 414 of file JKatoomba_t.hh.

Member Function Documentation

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

Resize matrix.

Definition at line 422 of file JKatoomba_t.hh.

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

Set matrix to the null matrix.

Definition at line 430 of file JKatoomba_t.hh.

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

Invert matrix according SVD decomposition.

Definition at line 438 of file JKatoomba_t.hh.

439  {
440 #ifdef THREAD_SAFE
441  using namespace std;
442 
443  unique_lock<mutex> lock(mtx);
444 #endif
445  TDecompSVD svd(*this, TOLERANCE);
446 
447  Bool_t status;
448 
449  static_cast<TMatrixD&>(*this) = svd.Invert(status);
450  }
static std::mutex mtx
TDecompSVD.
Definition: JKatoomba_t.hh:480
static constexpr double TOLERANCE
Tolerance for SVD.
Definition: JKatoomba_t.hh:417
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 458 of file JKatoomba_t.hh.

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

Member Data Documentation

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

Tolerance for SVD.

Definition at line 417 of file JKatoomba_t.hh.

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

TDecompSVD.

Declaration of mutex.

Definition at line 480 of file JKatoomba_t.hh.


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