33 #ifndef __H__UG__LIB_DISC__COMMON__MULTI_INDEX__
34 #define __H__UG__LIB_DISC__COMMON__MULTI_INDEX__
48 template<
int N,
typename TSingleIndexType =
size_t>
56 inline size_t size()
const {
return N;}
75 for(
size_t i=0; i < N; ++i)
106 inline size_t size()
const {
return 1;}
155 inline size_t size()
const {
return 2;}
221 inline size_t size()
const {
return 3;}
258 for(
size_t i = 0; i < N; ++i)
261 if(i != N-1) outStream <<
",";
274 template <
typename TMatrix>
278 return BlockRef(mat(iInd[0], jInd[0]), iInd[1], jInd[1]);
281 template <
typename TMatrix>
285 return BlockRef(mat(iInd[0], jInd[0]), iInd[1], jInd[1]);
288 template <
typename TVector>
292 return BlockRef(vec[ind[0]], ind[1]);
295 template <
typename TVector>
299 return BlockRef(vec[ind[0]], ind[1]);
302 template <
typename TMatrix>
308 template <
typename TMatrix>
311 SetRow(mat, ind[0], ind[1], val);
size_t size() const
number of indices in multi index
Definition: multi_index.h:106
size_t single_index_type
Definition: multi_index.h:94
bool operator==(const MultiIndex &o) const
comparison operator
Definition: multi_index.h:123
MultiIndex()
Default constructor.
Definition: multi_index.h:98
bool operator!=(const MultiIndex &o) const
Definition: multi_index.h:128
single_index_type m_indices
Definition: multi_index.h:134
MultiIndex(single_index_type a)
Constructor with values.
Definition: multi_index.h:101
bool operator!=(const MultiIndex &o) const
Definition: multi_index.h:177
bool operator<(const MultiIndex &o) const
Definition: multi_index.h:182
size_t size() const
number of indices in multi index
Definition: multi_index.h:155
MultiIndex()
Default constructor.
Definition: multi_index.h:146
bool operator==(const MultiIndex &o) const
comparison operator
Definition: multi_index.h:172
bool operator>(const MultiIndex &o) const
Definition: multi_index.h:190
MultiIndex(single_index_type a, single_index_type b)
Constructor with values.
Definition: multi_index.h:149
size_t single_index_type
Definition: multi_index.h:142
MultiIndex(single_index_type a, single_index_type b, single_index_type c)
Constructor with values.
Definition: multi_index.h:214
bool operator==(const MultiIndex &o) const
comparison operator
Definition: multi_index.h:238
size_t size() const
number of indices in multi index
Definition: multi_index.h:221
MultiIndex()
Default constructor.
Definition: multi_index.h:211
size_t single_index_type
Definition: multi_index.h:207
bool operator!=(const MultiIndex &o) const
Definition: multi_index.h:245
Definition: multi_index.h:50
size_t size() const
number of indices in multi index
Definition: multi_index.h:56
single_index_type & operator[](size_t i)
access to index component
Definition: multi_index.h:59
bool operator==(const MultiIndex &o) const
comparison operator
Definition: multi_index.h:73
TSingleIndexType single_index_type
Definition: multi_index.h:52
bool operator!=(const MultiIndex &o) const
Definition: multi_index.h:80
single_index_type m_indices[N]
Definition: multi_index.h:86
void SetDirichletRow(TSparseMatrix &A, size_t i, size_t alpha)
Definition: sparsematrix_util.h:796
void SetRow(TSparseMatrix &A, size_t i, size_t alpha, number val=0.0)
Definition: sparsematrix_util.h:710
std::ostream & operator<<(std::ostream &outStream, const ug::MathMatrix< 2, 2 > &m)
Definition: math_matrix.cpp:38
#define UG_ASSERT(expr, msg)
Definition: assert.h:70
double number
Definition: types.h:124
number & DoFRef(TMatrix &mat, const DoFIndex &iInd, const DoFIndex &jInd)
Definition: multi_index.h:276
double & BlockRef(T &vec, size_t i)
Definition: blocks.h:66
MultiIndex< 2 > DoFIndex
type of DoF-Index used to identify an DoF in the Algebra
Definition: multi_index.h:272