RectangularMatrix.H 3.51 KB
Newer Older
1
2
3
4
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
5
    \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
6
7
8
9
10
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

11
12
13
14
    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
15
16
17
18
19
20
21

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
22
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
23
24

Class
25
    Foam::RectangularMatrix
26
27

Description
28
29
30
    A templated 2D rectangular m x n matrix of objects of \<Type\>.

    The matrix dimensions are used for subscript bounds checking etc.
31
32

SourceFiles
33
34
    RectangularMatrixI.H
    RectangularMatrix.C
35
36
37

\*---------------------------------------------------------------------------*/

38
39
#ifndef RectangularMatrix_H
#define RectangularMatrix_H
40
41

#include "Matrix.H"
42
#include "Identity.H"
43
44
45
46
47
48
49

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
50
                           Class Matrix Declaration
51
52
\*---------------------------------------------------------------------------*/

53
54
55
56
template<class Type>
class RectangularMatrix
:
    public Matrix<RectangularMatrix<Type>, Type>
57
58
59
60
61
62
{

public:

    // Constructors

63
64
        //- Null constructor.
        inline RectangularMatrix();
65

66
67
        //- Construct given number of rows and columns,
        inline RectangularMatrix(const label m, const label n);
68

69
70
71
72
73
74
75
76
77
78
79
        //- Construct from a block of another matrix
        inline RectangularMatrix(const typename RectangularMatrix::Block&);

        //- Construct with given number of rows and columns
        //  initializing all elements to zero
        inline RectangularMatrix(const label m, const label n, const zero);

        //- Construct given number of rows/columns
        //  Initializing to the identity matrix
        inline RectangularMatrix(const label n, const Identity<Type>);

80
81
82
        //- Construct with given number of rows and columns
        //  and value for all elements.
        inline RectangularMatrix(const label m, const label n, const Type&);
83

84
85
        //- Construct from Istream.
        inline RectangularMatrix(Istream&);
86

87
        //- Clone
88
        inline autoPtr<RectangularMatrix<Type>> clone() const;
89
90
91
92
93
94


    // Member operators

        //- Assignment of all entries to zero
        void operator=(const zero);
95
96
97
};


98
99
100
101
102
103
// Global functions and operators

template<class Type>
RectangularMatrix<Type> outer(const Field<Type>& f1, const Field<Type>& f2);


104
105
106
107
108
109
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

110
#include "RectangularMatrixI.H"
111
112
113
114
115
116

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //