FEMTIC
ComplexSparseSquareSymmetricMatrix.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_COMPLEX_SPARSE_SQUARE_SYMMETRIC_MATRIX
25 #define DBLDEF_COMPLEX_SPARSE_SQUARE_SYMMETRIC_MATRIX
26 
27 #include <complex>
28 #include <set>
29 
31 
33 
34 public:
35 
36  //Default Constructer
38 
39  //Constructer
40  explicit ComplexSparseSquareSymmetricMatrix( const int nEq, const int nRhs = 1 );
41 
42  //Destructer
44 
45  //Input component of matrix.
46  virtual void setStructureByTripletFormat( const int row, const int col );
47 
48  // Set matrix structure ( locations of non-zero components ) and add values by triplet format
49  virtual void setStructureAndAddValueByTripletFormat( const int row, const int col, const std::complex<double>& val );
50 
51  //Add non-zero value to matrix
52  virtual void addNonZeroValues( const int row, const int col, const std::complex<double>& val );
53 
54  //Initialize matrix solver
55  virtual void initializeMatrixSolver( const std::string& oocHeaderName, const int imode );
56 
57  //Multiply matrix by inputed vector and subtract calculated vector from another vector for the case the indexes of inputed vector does not correspond to colunm number
58  //void postmultiplyByVectorAndSubtractResult( const std::complex<double>* const vecIn, const int* convertArray, std::complex<double>* const vecOut ) const;
59  void postmultiplyByVectorAndSubtractResult( const std::complex<double>* const vecIn, const int numCompsCopied, const int* const compsCopied2Full, const int* const full2CompsCopied, std::complex<double>* const vecOut ) const;
60 
61 private:
62  //Copy constructer
64 
65  // Assignment operator
67 
68 };
69 
70 #endif
Definition: ComplexSparseSquareMatrix.h:32
Definition: ComplexSparseSquareSymmetricMatrix.h:32
ComplexSparseSquareSymmetricMatrix()
Definition: ComplexSparseSquareSymmetricMatrix.cpp:32
virtual void initializeMatrixSolver(const std::string &oocHeaderName, const int imode)
Definition: ComplexSparseSquareSymmetricMatrix.cpp:87
virtual void setStructureByTripletFormat(const int row, const int col)
Definition: ComplexSparseSquareSymmetricMatrix.cpp:47
virtual ~ComplexSparseSquareSymmetricMatrix()
Definition: ComplexSparseSquareSymmetricMatrix.cpp:42
virtual void addNonZeroValues(const int row, const int col, const std::complex< double > &val)
Definition: ComplexSparseSquareSymmetricMatrix.cpp:74
virtual void setStructureAndAddValueByTripletFormat(const int row, const int col, const std::complex< double > &val)
Definition: ComplexSparseSquareSymmetricMatrix.cpp:60
void postmultiplyByVectorAndSubtractResult(const std::complex< double > *const vecIn, const int numCompsCopied, const int *const compsCopied2Full, const int *const full2CompsCopied, std::complex< double > *const vecOut) const
Definition: ComplexSparseSquareSymmetricMatrix.cpp:96
ComplexSparseSquareSymmetricMatrix & operator=(const ComplexSparseSquareSymmetricMatrix &rhs)
Definition: ComplexSparseSquareSymmetricMatrix.cpp:143