FEMTIC
RougheningSquareMatrix.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------------
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2021 Yoshiya Usui
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //-------------------------------------------------------------------------------------------------------
24 #ifndef DBLDEF_ROUGHENING_SQUARE_MATRIX
25 #define DBLDEF_ROUGHENING_SQUARE_MATRIX
26 
29 
31 
32 public:
33 
34  //Default Constructer
35  explicit RougheningSquareMatrix();
36 
37  //Constructer
38  explicit RougheningSquareMatrix( const int nEq, const int nRhs = 1 );
39 
40  //Destructer
41  virtual ~RougheningSquareMatrix();
42 
43  //Input component of matrix.
44  virtual void setStructureByTripletFormat( const int row, const int col );
45 
46  // Set matrix structure ( locations of non-zero components ) and add values by triplet format
47  virtual void setStructureAndAddValueByTripletFormat( const int row, const int col, const double val );
48 
49  //Add non-zero value to matrix
50  virtual void addNonZeroValues( const int row, const int col, const double val );
51 
52  //Make [R]T[R] matrix, where [R] is a constraining matrix
53  void makeRTRMatrix( DoubleSparseSquareSymmetricMatrix& RTRMatrix, const double smallValueOnDiagonals = 0.0 ) const;
54 
55  // Calculate model roughness
56  double calcModelRoughness( const double* modelVec ) const;
57 
58  // Calculate model roughness for difference filter
59  double calcModelRoughnessForDifferenceFilter( const double* modelVec ) const;
60 
61  // Calculate vector of model roughness
62  void calcVectorOfModelRoughness( const double* modelVec, double* roughnessVec ) const;
63 
64  // Postmultiply diagonal matrix
65  void postmultiplyDiagonalMatrix( const double* diagMatrix );
66 
67  //Calculaste singular values
68  void calcSingularValues() const;
69 
70  //Calculaste eigen values
71  void calcEigenValues() const;
72 
73  // Output roughneing matrix
74  void outputRougheningMatrix() const;
75 
76 private:
77  //Copy constructer
79 
80  // Assignment operator
82 
83 };
84 
85 #endif
Definition: DoubleSparseSquareSymmetricMatrix.h:31
Definition: DoubleSparseSquareUnsymmetricMatrix.h:31
Definition: RougheningSquareMatrix.h:30
void calcEigenValues() const
Definition: RougheningSquareMatrix.cpp:250
virtual void setStructureByTripletFormat(const int row, const int col)
Definition: RougheningSquareMatrix.cpp:53
virtual ~RougheningSquareMatrix()
Definition: RougheningSquareMatrix.cpp:48
double calcModelRoughnessForDifferenceFilter(const double *modelVec) const
Definition: RougheningSquareMatrix.cpp:112
RougheningSquareMatrix()
Definition: RougheningSquareMatrix.cpp:38
virtual void addNonZeroValues(const int row, const int col, const double val)
Definition: RougheningSquareMatrix.cpp:64
void makeRTRMatrix(DoubleSparseSquareSymmetricMatrix &RTRMatrix, const double smallValueOnDiagonals=0.0) const
Definition: RougheningSquareMatrix.cpp:69
void calcSingularValues() const
Definition: RougheningSquareMatrix.cpp:167
void outputRougheningMatrix() const
Definition: RougheningSquareMatrix.cpp:317
virtual void setStructureAndAddValueByTripletFormat(const int row, const int col, const double val)
Definition: RougheningSquareMatrix.cpp:58
void postmultiplyDiagonalMatrix(const double *diagMatrix)
Definition: RougheningSquareMatrix.cpp:142
RougheningSquareMatrix & operator=(const RougheningSquareMatrix &rhs)
Definition: RougheningSquareMatrix.cpp:161
double calcModelRoughness(const double *modelVec) const
Definition: RougheningSquareMatrix.cpp:95
void calcVectorOfModelRoughness(const double *modelVec, double *roughnessVec) const
Definition: RougheningSquareMatrix.cpp:129