1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Sparse matrix in compressed row format
31 Hrvoje Jasak, Wikki Ltd. All rights reserved
36 \*---------------------------------------------------------------------------*/
41 #include "crAddressing.H"
42 #include "primitiveFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 /*---------------------------------------------------------------------------*\
50 Class crMatrix Declaration
51 \*---------------------------------------------------------------------------*/
70 //- Construct from addressing
71 crMatrix(const crAddressing& addr);
73 //- Construct from row and column size and row count
78 const labelList& count
81 //- Construct from components of addressing
91 crMatrix(const crMatrix& m);
93 //- Construct as copy of tmp<crMatrix> deleting argument
94 crMatrix(const tmp<crMatrix>& tm);
96 //- Construct from Istream
100 // Destructor - default
107 //- Return addressing
108 const crAddressing& crAddr() const
113 //- Return coefficients
114 const scalarField& coeffs() const
119 //- Return coefficients to be set
120 scalarField& coeffs()
125 //- Return column array to be set
128 return crAddr_.col();
134 //- Return transpose matrix
135 tmp<crMatrix> T() const;
137 // Matrix-vector operations
139 //- Calculate b += A*x
140 void dotPlus(scalarField& b, const scalarField& x) const;
145 void operator=(const crMatrix&);
146 void operator=(const tmp<crMatrix>&);
149 // IOstream Operators
151 friend Ostream& operator<<(Ostream&, const crMatrix&);
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 } // End namespace Foam
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 // ************************************************************************* //