RowVector.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::RowVector
28
29Description
30 Templated 3D row-vector derived from MatrixSpace adding construction from
31 3 components and element access using x(), y() and z().
32
33SourceFiles
34 RowVectorI.H
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef RowVector_H
39#define RowVector_H
40
41#include "MatrixSpace.H"
42#include "Vector.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class RowVector Declaration
51\*---------------------------------------------------------------------------*/
52
53template<class Cmpt>
54class RowVector
55:
56 public MatrixSpace<RowVector<Cmpt>, Cmpt, 1, 3>
57{
58
59public:
60
61 //- Equivalent type of labels used for valid component indexing
63
64
65 //- Component labeling enumeration
66 enum components { X, Y, Z };
67
68
69 // Constructors
70
71 //- Construct null
72 inline RowVector();
73
74 //- Construct initialized to zero
75 inline RowVector(const Foam::zero);
76
77 //- Construct given VectorSpace of the same rank
78 template<class Cmpt2>
79 inline RowVector(const MatrixSpace<RowVector<Cmpt2>, Cmpt2, 1, 3>&);
80
81 //- Construct given three components
82 inline RowVector(const Cmpt& rvx, const Cmpt& rvy, const Cmpt& rvz);
83
84 //- Construct from Istream
85 inline RowVector(Istream&);
86
87
88 // Member Functions
89
90 // Access
91
92 inline const Cmpt& x() const;
93 inline const Cmpt& y() const;
94 inline const Cmpt& z() const;
95
96 inline Cmpt& x();
97 inline Cmpt& y();
98 inline Cmpt& z();
99};
100
101
102template<class Cmpt>
103class typeOfTranspose<Cmpt, Vector<Cmpt>>
104{
105public:
107 typedef RowVector<Cmpt> type;
108};
109
110
111template<class Cmpt>
112class typeOfTranspose<Cmpt, RowVector<Cmpt>>
113{
114public:
116 typedef Vector<Cmpt> type;
117};
118
119
120// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121
122} // End namespace Foam
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126#include "RowVectorI.H"
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
Templated matrix space.
Definition: MatrixSpace.H:61
Templated 3D row-vector derived from MatrixSpace adding construction from 3 components and element ac...
Definition: RowVector.H:56
components
Component labeling enumeration.
Definition: RowVector.H:65
Cmpt & x()
Definition: RowVectorI.H:96
RowVector< label > labelType
Equivalent type of labels used for valid component indexing.
Definition: RowVector.H:61
RowVector()
Construct null.
Definition: RowVectorI.H:31
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
Abstract template class to provide the transpose form of a form.
Definition: products.H:63
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598