KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
dense_svd_decomposition.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Ruben Zorrilla
11 //
12 
13 #if !defined(KRATOS_DENSE_SVD_H_INCLUDED)
14 #define KRATOS_DENSE_SVD_H_INCLUDED
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/define.h"
21 
22 namespace Kratos {
23 
26 
30 
34 
38 
42 
43 template<class TDenseSpaceType>
45 {
46 public:
47 
50 
53 
54  typedef typename TDenseSpaceType::DataType DataType;
57 
61 
63 
64  virtual ~DenseSingularValueDecomposition() = default;
65 
69 
70 
74 
80  static std::string Name()
81  {
82  return "dense_singular_value_decomposition";
83  }
84 
91  virtual void Compute(
92  MatrixType& rInputMatrix,
93  Parameters Settings) = 0;
94 
104  virtual void Compute(
105  MatrixType& rInputMatrix,
106  VectorType& rVectorS,
107  MatrixType& rMatrixU,
108  MatrixType& rMatrixV,
109  Parameters Settings) = 0;
110 
116  virtual void MatrixU(MatrixType& rMatrixU) = 0;
117 
125  virtual void MatrixV(MatrixType& rMatrixV) = 0;
126 
132  virtual void SingularValues(VectorType& rVectorS) = 0;
133 
139  virtual std::size_t NonZeroSingularValues() = 0;
140 
148  virtual void SetThreshold(const double RelTolerance) = 0;
149 
155  virtual std::size_t Rank() = 0;
156 
162  virtual void PrintInfo(std::ostream &rOStream) const = 0;
163 
167 
168 
172 
173 
177 
178 
182 
183 
185 };
186 
189 
190 
194 
195 
197 } // namespace Kratos
198 
199 #endif // defined(KRATOS_DENSE_SVD_H_INCLUDED)
Definition: dense_svd_decomposition.h:45
virtual void PrintInfo(std::ostream &rOStream) const =0
SVD information Outputs the SVD class information.
virtual void Compute(MatrixType &rInputMatrix, VectorType &rVectorS, MatrixType &rMatrixU, MatrixType &rMatrixV, Parameters Settings)=0
Compute the SVD Computes the Singular Value Decomposition (SVD) of the given input matrix.
virtual ~DenseSingularValueDecomposition()=default
TDenseSpaceType::VectorType VectorType
Definition: dense_svd_decomposition.h:55
virtual void SetThreshold(const double RelTolerance)=0
Set the relative threshold tolerance This method sets the relative threshold tolerance to consider si...
virtual void SingularValues(VectorType &rVectorS)=0
Singular values vector getter This method sets the singular values vector in the provided array.
static std::string Name()
Name of the SVD Returns a string containing the name of the current SVD decomposition.
Definition: dense_svd_decomposition.h:80
virtual std::size_t NonZeroSingularValues()=0
Number of non-zero singular values This method returns the number of non-zero singular values.
TDenseSpaceType::MatrixType MatrixType
Definition: dense_svd_decomposition.h:56
virtual std::size_t Rank()=0
Rank of the provided array Calculates and returns the rank of the array decomposed with the SVD.
TDenseSpaceType::DataType DataType
Definition: dense_svd_decomposition.h:54
virtual void MatrixU(MatrixType &rMatrixU)=0
Left singular vectors matrix getter If computed, this method sets the left singular vectors matrix in...
virtual void MatrixV(MatrixType &rMatrixV)=0
Right singular vectors matrix getter If computed, this method sets the right singular vectors matrix ...
KRATOS_CLASS_POINTER_DEFINITION(DenseSingularValueDecomposition)
Definition of the shared pointer of the class.
virtual void Compute(MatrixType &rInputMatrix, Parameters Settings)=0
Compute the SVD Computes the Singular Value Decomposition (SVD) of the given imput matrix.
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Vector VectorType
Definition: geometrical_transformation_utilities.h:56
Matrix MatrixType
Definition: geometrical_transformation_utilities.h:55
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21