Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Tobias Leibner
dune-common
Commits
ed79fe85
Commit
ed79fe85
authored
18 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
added ISTL-style assignment from scalar and umv()
[[Imported from SVN: r4570]]
parent
3ceb90f1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/matrix.hh
+25
-0
25 additions, 0 deletions
common/matrix.hh
with
25 additions
and
0 deletions
common/matrix.hh
+
25
−
0
View file @
ed79fe85
...
...
@@ -42,6 +42,13 @@ namespace Dune {
data
[
i
]
=
0
;
}
/** \brief Assignment from scalar */
Matrix
&
operator
=
(
const
T
&
t
)
{
for
(
unsigned
int
i
=
0
;
i
<
data
.
size
();
i
++
)
data
[
i
]
=
t
;
}
/** \brief The index operator */
T
*
operator
[](
int
row
)
{
#ifdef DUNE_ISTL_WITH_CHECKING
...
...
@@ -141,6 +148,24 @@ namespace Dune {
return
out
;
}
//! y += A x
template
<
class
X
,
class
Y
>
void
umv
(
const
X
&
x
,
Y
&
y
)
const
{
#ifdef DUNE_ISTL_WITH_CHECKING
if
(
x
.
N
()
!=
M
())
DUNE_THROW
(
ISTLError
,
"index out of range"
);
if
(
y
.
N
()
!=
N
())
DUNE_THROW
(
ISTLError
,
"index out of range"
);
#endif
for
(
int
i
=
0
;
i
<
rows_
;
i
++
)
{
for
(
int
j
=
0
;
j
<
cols_
;
j
++
)
(
*
this
)[
i
][
j
].
umv
(
x
[
j
],
y
[
i
]);
}
}
protected
:
std
::
vector
<
T
>
data
;
...
...
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