Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-matrix-vector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
agnumpde
dune-matrix-vector
Commits
45c3c667
"README.md" did not exist on "60b0c4097be5cc919b17f11b3623993a279088a1"
Commit
45c3c667
authored
10 years ago
by
Max Kahnt
Browse files
Options
Downloads
Patches
Plain Diff
Remove SingleNonZeroColumn code from SingleNonZeroRow class.
parent
ab3ff5fc
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/matrix-vector/singlenonzerorowmatrix.hh
+0
-131
0 additions, 131 deletions
dune/matrix-vector/singlenonzerorowmatrix.hh
with
0 additions
and
131 deletions
dune/matrix-vector/singlenonzerorowmatrix.hh
+
0
−
131
View file @
45c3c667
...
...
@@ -9,137 +9,6 @@
#include
<dune/fufem/arithmetic.hh>
#include
<dune/fufem/indexedsliceiterator.hh>
/**
* \brief A static matrix that has only a single nonzero column
*
* The number and values of this column are dynamic.
* For simplicity this derives from FieldMatrix and sets
* all entries accordingly. So it will not reduce memory
* requirements but allows to implement methods more efficiently.
*/
template
<
class
K
,
int
ROWS
,
int
COLS
>
class
SingleNonZeroColumnMatrix
{
class
RowProxy
{
public:
typedef
IndexedSliceIterator
<
const
K
*
,
const
K
>
ConstIterator
;
typedef
ConstIterator
const_iterator
;
RowProxy
(
const
K
&
value
,
size_type
nzCol
)
:
value_
(
value
),
nzCol_
(
nzCol
)
{}
ConstIterator
begin
()
const
{
return
ConstIterator
(
value_
,
nzCol
,
0
,
1
);
}
ConstIterator
end
()
const
{
return
ConstIterator
(
value_
,
nzCol
+
1
,
0
,
1
);
}
protected
:
const
K
*
value_
;
size_type
nzCol_
;
};
public
:
typedef
RowProxy
row_type
;
typedef
row_type
const_row_reference
;
typedef
std
::
size_t
size_type
;
typedef
RowProxy
::
ConstIterator
ConstColIterator
;
typedef
typename
Dune
::
FieldMatrix
<
K
,
ROWS
,
1
>
SingleColumnMatrix
;
/**
* \brief Create from single column matrix and column index
*/
SingleNonZeroColumnMatrix
(
const
SingleColumnMatrix
&
c
,
size_type
columnIndex
)
:
nonZeroColumn_
(
c
),
columnIndex_
(
columnIndex
)
{}
size_type
N
()
const
{
return
ROWS
;
}
size_type
M
()
const
{
return
COLS
;
}
template
<
class
X
,
class
Y
>
void
umv
(
const
X
&
x
,
Y
&
y
)
const
{
for
(
size_type
i
=
0
;
i
<
N
();
++
i
)
y
[
i
]
+=
nonZeroColumn_
[
i
]
*
x
[
columnIndex_
];
}
template
<
class
X
,
class
Y
>
void
umtv
(
const
X
&
x
,
Y
&
y
)
const
{
for
(
size_type
i
=
0
;
i
<
N
()
::
rows
;
++
i
)
y
[
columnIndex_
]
=
nonZeroColumn_
[
i
]
*
x
[
i
];
}
template
<
class
X
,
class
Y
>
void
mtv
(
const
X
&
x
,
Y
&
y
)
const
{
y
=
0.0
;
umtv
(
x
,
y
);
}
const_row_reference
operator
[]
(
size_type
rowIndex
)
const
{
return
const_row_reference
(
nonZeroColumn_
[
rowIndex
],
columnIndex_
);
}
size_type
nonZeroColumnIndex
()
const
{
return
columnIndex_
;
}
protected
:
SingleColumnMatrix
nonZeroColumn_
;
const
size_type
columnIndex_
;
};
namespace
Arithmetic
{
template
<
class
K
,
int
ROWS
,
int
COLS
>
struct
MatrixTraits
<
SingleNonZeroColumnMatrix
<
K
,
ROWS
,
COLS
>
>
{
enum
{
isMatrix
=
true
};
enum
{
sizeIsStatic
=
true
};
enum
{
rows
=
ROWS
};
enum
{
cols
=
COLS
};
typedef
SingleNonZeroColumnMatrix
<
K
,
ROWS
,
COLS
>::
ConstColIterator
ConstColIterator
;
static
ConstColIterator
rowBegin
(
const
typename
SingleNonZeroColumnMatrix
<
K
,
ROWS
,
COLS
>::
row_type
&
m
,
int
row
)
{
int
nzCol
=
m
.
nonZeroColumnIndex
();
return
ConstColIterator
(
m
[
row
][
nzCol
],
nzCol
);
}
static
ConstColIterator
rowEnd
(
const
typename
SingleNonZeroColumnMatrix
<
K
,
ROWS
,
COLS
>::
row_type
&
m
,
int
row
)
{
int
nzCol
=
m
.
nonZeroColumnIndex
();
return
ConstColIterator
(
m
[
row
][
nzCol
],
nzCol
+
1
);
}
};
};
/**
* \brief A static matrix that has only a single nonzero row
*
...
...
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