Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
ag-ohlberger
dune-community
dune-xt
Commits
f886cfe6
Commit
f886cfe6
authored
14 years ago
by
René Fritze
Browse files
Options
Downloads
Patches
Plain Diff
move row matrix mult
parent
633b894b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
stuff/math.hh
+0
-28
0 additions, 28 deletions
stuff/math.hh
stuff/matrix.hh
+29
-0
29 additions, 0 deletions
stuff/matrix.hh
with
29 additions
and
28 deletions
stuff/math.hh
+
0
−
28
View file @
f886cfe6
...
@@ -63,34 +63,6 @@ static RangeType1 dyadicProduct(const RangeType2& arg1, const RangeType2& arg2)
...
@@ -63,34 +63,6 @@ static RangeType1 dyadicProduct(const RangeType2& arg1, const RangeType2& arg2)
return
ret
;
return
ret
;
}
}
/**
* \brief multiplies rows of arg2 with arg1
* \todo doc
**/
template
<
class
FieldMatrixImp
>
FieldMatrixImp
rowWiseMatrixMultiplication
(
const
FieldMatrixImp
&
arg1
,
const
FieldMatrixImp
&
arg2
)
{
typedef
FieldMatrixImp
FieldMatrixType
;
typedef
typename
FieldMatrixType
::
row_type
RowType
;
typedef
typename
FieldMatrixType
::
ConstRowIterator
ConstRowIteratorType
;
typedef
typename
FieldMatrixType
::
RowIterator
RowIteratorType
;
assert
(
arg2
.
rowdim
()
==
arg1
.
coldim
());
FieldMatrixType
ret
(
0.0
);
ConstRowIteratorType
arg2RowItEnd
=
arg2
.
end
();
RowIteratorType
retRowItEnd
=
ret
.
end
();
RowIteratorType
retRowIt
=
ret
.
begin
();
for
(
ConstRowIteratorType
arg2RowIt
=
arg2
.
begin
();
arg2RowIt
!=
arg2RowItEnd
,
retRowIt
!=
retRowItEnd
;
++
arg2RowIt
,
++
retRowIt
)
{
RowType
row
(
0.0
);
arg1
.
mv
(
*
arg2RowIt
,
row
);
*
retRowIt
=
row
;
}
return
ret
;
}
/** \brief a vector wrapper for continiously updating min,max,avg of some element type vector
/** \brief a vector wrapper for continiously updating min,max,avg of some element type vector
\todo find use? it's only used in minimal as testcase for itself...
\todo find use? it's only used in minimal as testcase for itself...
**/
**/
...
...
This diff is collapsed.
Click to expand it.
stuff/matrix.hh
+
29
−
0
View file @
f886cfe6
...
@@ -215,6 +215,35 @@ void readSparseMatrix(SparseMatrixImpl& matrix, Input& in)
...
@@ -215,6 +215,35 @@ void readSparseMatrix(SparseMatrixImpl& matrix, Input& in)
}
}
}
}
/**
* \brief multiplies rows of arg2 with arg1
* \todo doc
**/
template
<
class
FieldMatrixImp
>
FieldMatrixImp
rowWiseMatrixMultiplication
(
const
FieldMatrixImp
&
arg1
,
const
FieldMatrixImp
&
arg2
)
{
typedef
FieldMatrixImp
FieldMatrixType
;
typedef
typename
FieldMatrixType
::
row_type
RowType
;
typedef
typename
FieldMatrixType
::
ConstRowIterator
ConstRowIteratorType
;
typedef
typename
FieldMatrixType
::
RowIterator
RowIteratorType
;
assert
(
arg2
.
rowdim
()
==
arg1
.
coldim
());
FieldMatrixType
ret
(
0.0
);
ConstRowIteratorType
arg2RowItEnd
=
arg2
.
end
();
RowIteratorType
retRowItEnd
=
ret
.
end
();
RowIteratorType
retRowIt
=
ret
.
begin
();
for
(
ConstRowIteratorType
arg2RowIt
=
arg2
.
begin
();
arg2RowIt
!=
arg2RowItEnd
,
retRowIt
!=
retRowItEnd
;
++
arg2RowIt
,
++
retRowIt
)
{
RowType
row
(
0.0
);
arg1
.
mv
(
*
arg2RowIt
,
row
);
*
retRowIt
=
row
;
}
return
ret
;
}
namespace
Matrix
{
namespace
Matrix
{
//! prints actual memusage of matrix in kB
//! prints actual memusage of matrix in kB
template
<
class
MatrixType
,
class
Stream
>
template
<
class
MatrixType
,
class
Stream
>
...
...
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