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_qr_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_QR_H_INCLUDED)
14 #define KRATOS_DENSE_QR_H_INCLUDED
15 
16 // External includes
17 
18 // Project includes
19 #include "includes/define.h"
20 
21 namespace Kratos {
22 
25 
29 
33 
37 
41 
42 template<class TDenseSpaceType>
44 {
45 public:
46 
49 
52 
53  typedef typename TDenseSpaceType::DataType DataType;
56 
60 
61  DenseQRDecomposition() = default;
62 
63  virtual ~DenseQRDecomposition() = default;
64 
68 
69 
73 
79  static std::string Name()
80  {
81  return "dense_qr_decomposition";
82  }
83 
89  virtual void Compute(MatrixType& rInputMatrix) = 0;
90 
98  virtual void Compute(
99  MatrixType& rInputMatrix,
100  MatrixType& rMatrixQ,
101  MatrixType& rMatrixR) = 0;
102 
109  virtual void Solve(
110  MatrixType& rB,
111  MatrixType& rX) const = 0;
112 
119  virtual void Solve(
120  const VectorType& rB,
121  VectorType& rX) const = 0;
122 
128  virtual void MatrixQ(MatrixType& rMatrixQ) const = 0;
129 
135  virtual void MatrixR(MatrixType& rMatrixR) const = 0;
136 
142  virtual void MatrixP(MatrixType& rMatrixP) const = 0;
143 
149  virtual std::size_t Rank() const = 0;
150 
156  virtual void PrintInfo(std::ostream &rOStream) const = 0;
157 
161 
162 
166 
167 
171 
172 
176 
177 
179 };
180 
183 
184 
188 
189 
191 } // namespace Kratos
192 
193 #endif // defined(KRATOS_DENSE_QR_H_INCLUDED)
Definition: dense_qr_decomposition.h:44
TDenseSpaceType::MatrixType MatrixType
Definition: dense_qr_decomposition.h:55
virtual void MatrixP(MatrixType &rMatrixP) const =0
Pivoting matrix getter If computed, this method sets the pivoting matrix.
virtual std::size_t Rank() const =0
Rank of the provided array Calculates and returns the rank of the array decomposed with the QR.
virtual void MatrixR(MatrixType &rMatrixR) const =0
Upper triangular matrix getter If computed, this method sets the upper triangular matrix in the provi...
TDenseSpaceType::DataType DataType
Definition: dense_qr_decomposition.h:53
static std::string Name()
Name of the QR Returns a string containing the name of the current QR decomposition.
Definition: dense_qr_decomposition.h:79
virtual ~DenseQRDecomposition()=default
virtual void Compute(MatrixType &rInputMatrix, MatrixType &rMatrixQ, MatrixType &rMatrixR)=0
Compute the QR Computes the QR (QR) of the given input matrix.
virtual void MatrixQ(MatrixType &rMatrixQ) const =0
Unitary matrix getter If computed, this method sets the unitary matrix in the provided array.
virtual void Solve(MatrixType &rB, MatrixType &rX) const =0
Solves the problem Ax=b Being A the input matrix, this method solves the problem Ax = b.
virtual void Solve(const VectorType &rB, VectorType &rX) const =0
Solves the problem Ax=b Being A the input matrix, this method solves the problem Ax = b.
KRATOS_CLASS_POINTER_DEFINITION(DenseQRDecomposition)
Definition of the shared pointer of the class.
virtual void PrintInfo(std::ostream &rOStream) const =0
QR information Outputs the QR class information.
virtual void Compute(MatrixType &rInputMatrix)=0
Compute the QR Computes the QR Decomposition (QR) of the given imput matrix.
TDenseSpaceType::VectorType VectorType
Definition: dense_qr_decomposition.h:54
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