Reference documentation for deal.II version Git ee8a81293c 2020-10-19 10:17:29 -0400
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Public Member Functions | Protected Attributes | Related Functions | List of all members
TableIndices< N > Class Template Reference

#include <deal.II/base/table_indices.h>

Inheritance diagram for TableIndices< N >:
[legend]

Public Member Functions

constexpr TableIndices ()=default
 
template<typename... T>
constexpr TableIndices (const T... indices)
 
constexpr std::size_t operator[] (const unsigned int i) const
 
constexpr std::size_t & operator[] (const unsigned int i)
 
constexpr bool operator== (const TableIndices< N > &other) const
 
constexpr bool operator!= (const TableIndices< N > &other) const
 
constexpr void sort ()
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Attributes

std::size_t indices [N] {}
 

Related Functions

(Note that these are not member functions.)

template<int N>
std::ostream & operator<< (std::ostream &out, const TableIndices< N > &indices)
 

Detailed Description

template<int N>
class TableIndices< N >

A class representing a fixed size array of indices.

It is used in tensorial objects like the TableBase and SymmetricTensor classes to represent a nested choice of indices.

Template Parameters
NThe number of indices stored in each object.

Definition at line 44 of file table_indices.h.

Constructor & Destructor Documentation

◆ TableIndices() [1/2]

template<int N>
constexpr TableIndices< N >::TableIndices ( )
default

Default constructor. This constructor sets all indices to zero.

◆ TableIndices() [2/2]

template<int N>
template<typename... T>
constexpr TableIndices< N >::TableIndices ( const T...  indices)

Constructor. Initializes the indices stored by this object by the given arguments indices

This constructor will result in a compiler error if the template argument N is different from the number of the arguments.

Definition at line 116 of file table_indices.h.

Member Function Documentation

◆ operator[]() [1/2]

template<int N>
constexpr std::size_t TableIndices< N >::operator[] ( const unsigned int  i) const
inline

Read-only access the value of the ith index.

Definition at line 128 of file table_indices.h.

◆ operator[]() [2/2]

template<int N>
constexpr std::size_t & TableIndices< N >::operator[] ( const unsigned int  i)
inline

Write access the value of the ith index.

Definition at line 137 of file table_indices.h.

◆ operator==()

template<int N>
constexpr bool TableIndices< N >::operator== ( const TableIndices< N > &  other) const

Compare two index fields for equality.

Definition at line 146 of file table_indices.h.

◆ operator!=()

template<int N>
constexpr bool TableIndices< N >::operator!= ( const TableIndices< N > &  other) const

Compare two index fields for inequality.

Definition at line 156 of file table_indices.h.

◆ sort()

template<int N>
constexpr void TableIndices< N >::sort ( )
inline

Sort the indices in ascending order. While this operation is not very useful for Table objects, it is used for the SymmetricTensor class.

Definition at line 164 of file table_indices.h.

◆ serialize()

template<int N>
template<class Archive >
void TableIndices< N >::serialize ( Archive &  ar,
const unsigned int  version 
)
inline

Write or read the data of this object to or from a stream for the purpose of serialization.

Definition at line 173 of file table_indices.h.

Friends And Related Function Documentation

◆ operator<<()

template<int N>
std::ostream & operator<< ( std::ostream &  out,
const TableIndices< N > &  indices 
)
related

Output operator for TableIndices objects; reports them in a list like this: [i1,i2,...].

Definition at line 187 of file table_indices.h.

Member Data Documentation

◆ indices

template<int N>
std::size_t TableIndices< N >::indices[N] {}
protected

Store the indices in an array.

Definition at line 107 of file table_indices.h.


The documentation for this class was generated from the following file: