Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
3a5ad7ee
Commit
3a5ad7ee
authored
5 years ago
by
Kutalmış Berçin
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add identity matrix constructor to RectangularMatrix
parent
64614cfc
No related branches found
No related tags found
1 merge request
!305
ENH|BUG: Misc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H
+5
-0
5 additions, 0 deletions
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H
+17
-0
17 additions, 0 deletions
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H
with
22 additions
and
0 deletions
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrix.H
+
5
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/matrices/RectangularMatrix/RectangularMatrixI.H
+
17
−
0
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
(
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment