Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
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.
 
void reset ()
 Set matrix to the null matrix.
 
void invert ()
 Invert matrix according SVD decomposition.
 
template<class JVectorND_t >
void solve (JVectorND_t &u)
 Get solution of equation A x = b.
 

Static Public Attributes

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

Detailed Description

Auxiliary data structure for compatibility of symmetric matrix.

Inversion is based on SVD algorithm.

Definition at line 355 of file JKatoomba_t.hh.

Member Function Documentation

◆ resize()

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

Resize matrix.

Definition at line 363 of file JKatoomba_t.hh.

364 {
365 ResizeTo(size, size);
366 }

◆ reset()

void JACOUSTICS::TMatrixDS::reset ( )
inline

Set matrix to the null matrix.

Definition at line 371 of file JKatoomba_t.hh.

372 {
373 Zero();
374 }

◆ invert()

void JACOUSTICS::TMatrixDS::invert ( )
inline

Invert matrix according SVD decomposition.

Definition at line 379 of file JKatoomba_t.hh.

380 {
381#ifdef THREAD_SAFE
382 using namespace std;
383
384 unique_lock<mutex> lock(mtx);
385#endif
386 TDecompSVD svd(*this, TOLERANCE);
387
388 Bool_t status;
389
390 static_cast<TMatrixD&>(*this) = svd.Invert(status);
391 }
static std::mutex mtx
TDecompSVD.
static constexpr double TOLERANCE
Tolerance for SVD.

◆ solve()

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 399 of file JKatoomba_t.hh.

400 {
401#ifdef THREAD_SAFE
402 using namespace std;
403
404 unique_lock<mutex> lock(mtx);
405#endif
406 TDecompSVD svd(*this, TOLERANCE);
407
408 TVectorD b(u.size());
409
410 for (size_t i = 0; i != u.size(); ++i) {
411 b[i] = u[i];
412 }
413
414 svd.Solve(b);
415
416 for (size_t i = 0; i != u.size(); ++i) {
417 u[i] = b[i];
418 }
419 }

Member Data Documentation

◆ TOLERANCE

double JACOUSTICS::TMatrixDS::TOLERANCE = 1.0e-8
staticconstexpr

Tolerance for SVD.

Definition at line 358 of file JKatoomba_t.hh.

◆ mtx

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

TDecompSVD.

Declaration of mutex.

Definition at line 421 of file JKatoomba_t.hh.


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