1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM 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 2 of the License, or (at your
14 option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::DiagonalMatrix<Type>
29 DiagonalMatrix<Type> is a 2D diagonal matrix of objects
30 of type Type, size nxn
35 \*---------------------------------------------------------------------------*/
37 #ifndef DiagonalMatrix_H
38 #define DiagonalMatrix_H
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 // * * * * * * * * * * * * Class Forward declaration * * * * * * * * * * * //
49 template<class Form, class Type> class Matrix;
51 /*---------------------------------------------------------------------------*\
52 Class DiagonalMatrix Declaration
53 \*---------------------------------------------------------------------------*/
64 //- Construct from diagonal component of a Matrix
66 DiagonalMatrix<Type>(const Matrix<Form, Type>&);
68 //- Construct empty from size
69 DiagonalMatrix<Type>(const label size);
71 //- Construct from size and a value
72 DiagonalMatrix<Type>(const label, const Type&);
77 //- Invert the diaganol matrix and return itself
78 DiagonalMatrix<Type>& invert();
84 //- Return the diagonal Matrix inverse
86 DiagonalMatrix<Type> inv(const DiagonalMatrix<Type>&);
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 } // End namespace Foam
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
96 # include "DiagonalMatrix.C"
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 // ************************************************************************* //