Skip to content
Snippets Groups Projects
Commit af9869d7 authored by Max Kahnt's avatar Max Kahnt
Browse files

Several minor changes.

Update docu.
Remove outcommented lines.
Add descriptive enums.
Comment aut unusued matrix traits iterator methods.
parent 45c3c667
No related branches found
No related tags found
No related merge requests found
......@@ -13,9 +13,7 @@
* \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.
* \tparam Storage values of nonzero column are copied and hold in an array. Pass a const reference type to avoid this, e.g. FieldMatrix<K, 1, ROWS>.
*/
template<class K, int ROWS, int COLS, class Storage = Dune::array<K, ROWS> >
class SingleNonZeroColumnMatrix
......@@ -53,7 +51,6 @@ public:
typedef typename std::size_t size_type;
typedef typename RowProxy::ConstIterator ConstColIterator;
// typedef typename Dune::FieldMatrix<K, ROWS, 1> SingleColumnMatrix;
/**
* \brief Create from single column matrix and column index
......@@ -97,7 +94,6 @@ public:
const_row_reference operator[] (size_type rowIndex) const
{
// return const_row_reference(&(nonZeroColumn_[rowIndex]), columnIndex_);
return const_row_reference(&(static_cast<K&>(nonZeroColumn_[rowIndex])), columnIndex_);
}
......@@ -120,9 +116,12 @@ namespace Arithmetic
struct MatrixTraits<SingleNonZeroColumnMatrix<K, ROWS, COLS> >
{
enum { isMatrix = true };
enum { sizeIsStatic = true };
enum { isDense = false };
enum { sizeIsStatic = true }; //TODO only one of these should be used
enum { hasStaticSize = true }; //TODO only one of these should be used
enum { rows = ROWS};
enum { cols = COLS};
/*
typedef typename SingleNonZeroColumnMatrix<K, ROWS, COLS>::ConstColIterator ConstColIterator;
static ConstColIterator rowBegin(const typename SingleNonZeroColumnMatrix<K, ROWS, COLS>::row_type& m, int row)
......@@ -136,6 +135,7 @@ namespace Arithmetic
int nzCol = m.nonZeroColumnIndex();
return ConstColIterator(m[row][nzCol], nzCol+1);
}
*/
};
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment