Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3a5ad7ee
Commit
3a5ad7ee
authored
Nov 13, 2019
by
Kutalmış Berçin
Browse files
ENH: add identity matrix constructor to RectangularMatrix
parent
64614cfc
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H
View file @
3a5ad7ee
...
@@ -80,6 +80,11 @@ public:
...
@@ -80,6 +80,11 @@ public:
//- initializing all elements to the given value
//- initializing all elements to the given value
inline
RectangularMatrix
(
const
label
m
,
const
label
n
,
const
Type
&
val
);
inline
RectangularMatrix
(
const
label
m
,
const
label
n
,
const
Type
&
val
);
//- Construct for given number of rows/columns
//- initializing all elements to zero, and diagonal to one
template
<
class
AnyType
>
inline
RectangularMatrix
(
const
labelPair
&
dims
,
const
Identity
<
AnyType
>
);
//- Construct given number of rows/columns
//- Construct given number of rows/columns
inline
explicit
RectangularMatrix
(
const
labelPair
&
dims
);
inline
explicit
RectangularMatrix
(
const
labelPair
&
dims
);
...
...
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H
View file @
3a5ad7ee
...
@@ -80,6 +80,23 @@ inline Foam::RectangularMatrix<Type>::RectangularMatrix
...
@@ -80,6 +80,23 @@ inline Foam::RectangularMatrix<Type>::RectangularMatrix
{}
{}
template
<
class
Type
>
template
<
class
AnyType
>
inline
Foam
::
RectangularMatrix
<
Type
>::
RectangularMatrix
(
const
labelPair
&
dims
,
const
Identity
<
AnyType
>
)
:
Matrix
<
RectangularMatrix
<
Type
>
,
Type
>
(
dims
.
first
(),
dims
.
second
(),
Zero
)
{
for
(
label
i
=
0
;
i
<
min
(
dims
.
first
(),
dims
.
second
());
++
i
)
{
this
->
operator
()(
i
,
i
)
=
pTraits
<
Type
>::
one
;
}
}
template
<
class
Type
>
template
<
class
Type
>
inline
Foam
::
RectangularMatrix
<
Type
>::
RectangularMatrix
inline
Foam
::
RectangularMatrix
<
Type
>::
RectangularMatrix
(
(
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment