Jpp master_rocky-44-g75b7c4f75
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 356 of file JKatoomba_t.hh.

Member Function Documentation

◆ resize()

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

Resize matrix.

Definition at line 364 of file JKatoomba_t.hh.

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

◆ reset()

void JACOUSTICS::TMatrixDS::reset ( )
inline

Set matrix to the null matrix.

Definition at line 372 of file JKatoomba_t.hh.

373 {
374 Zero();
375 }

◆ invert()

void JACOUSTICS::TMatrixDS::invert ( )
inline

Invert matrix according SVD decomposition.

Definition at line 380 of file JKatoomba_t.hh.

381 {
382#ifdef THREAD_SAFE
383 using namespace std;
384
385 unique_lock<mutex> lock(mtx);
386#endif
387 TDecompSVD svd(*this, TOLERANCE);
388
389 Bool_t status;
390
391 static_cast<TMatrixD&>(*this) = svd.Invert(status);
392 }
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 400 of file JKatoomba_t.hh.

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

Member Data Documentation

◆ TOLERANCE

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

Tolerance for SVD.

Definition at line 359 of file JKatoomba_t.hh.

◆ mtx

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

TDecompSVD.

Declaration of mutex.

Definition at line 422 of file JKatoomba_t.hh.


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