Reference documentation for deal.II version Git d4ec8156ca 2019-11-18 14:03:00 -0700
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
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
 
constexpr TableIndices (const std::size_t index0)
 
constexpr TableIndices (const std::size_t index0, const std::size_t index1)
 
constexpr TableIndices (const std::size_t index0, const std::size_t index1, const std::size_t index2)
 
constexpr TableIndices (const std::size_t index0, const std::size_t index1, const std::size_t index2, const std::size_t index3)
 
constexpr TableIndices (const std::size_t index0, const std::size_t index1, const std::size_t index2, const std::size_t index3, const std::size_t index4)
 
 TableIndices (const std::size_t index0, const std::size_t index1, const std::size_t index2, const std::size_t index3, const std::size_t index4, const std::size_t index5, const std::size_t index6=numbers::invalid_unsigned_int, const std::size_t index7=numbers::invalid_unsigned_int, const std::size_t index8=numbers::invalid_unsigned_int)
 
DEAL_II_CONSTEXPR std::size_t operator[] (const unsigned int i) const
 
DEAL_II_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
 
DEAL_II_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.
Author
Wolfgang Bangerth, Matthias Maier, 2002, 2015

Definition at line 44 of file table_indices.h.

Constructor & Destructor Documentation

◆ TableIndices() [1/7]

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

Default constructor. This constructor sets all indices to zero.

◆ TableIndices() [2/7]

template<int N>
constexpr TableIndices< N >::TableIndices ( const std::size_t  index0)
explicit

Constructor. This is the appropriate constructor for an object of type TableIndices<1> and initializes the single index with index0.

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

Definition at line 191 of file table_indices.h.

◆ TableIndices() [3/7]

template<int N>
constexpr TableIndices< N >::TableIndices ( const std::size_t  index0,
const std::size_t  index1 
)

Constructor. This is the appropriate constructor for an object of type TableIndices<2> and initializes the indices stored by this object by the given arguments.

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

Definition at line 201 of file table_indices.h.

◆ TableIndices() [4/7]

template<int N>
constexpr TableIndices< N >::TableIndices ( const std::size_t  index0,
const std::size_t  index1,
const std::size_t  index2 
)

Constructor. This is the appropriate constructor for an object of type TableIndices<3> and initializes the indices stored by this object by the given arguments.

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

Definition at line 212 of file table_indices.h.

◆ TableIndices() [5/7]

template<int N>
constexpr TableIndices< N >::TableIndices ( const std::size_t  index0,
const std::size_t  index1,
const std::size_t  index2,
const std::size_t  index3 
)

Constructor. This is the appropriate constructor for an object of type TableIndices<4> and initializes the indices stored by this object by the given arguments.

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

Definition at line 224 of file table_indices.h.

◆ TableIndices() [6/7]

template<int N>
constexpr TableIndices< N >::TableIndices ( const std::size_t  index0,
const std::size_t  index1,
const std::size_t  index2,
const std::size_t  index3,
const std::size_t  index4 
)

Constructor. This is the appropriate constructor for an object of type TableIndices<5> and initializes the indices stored by this object by the given arguments.

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

Definition at line 237 of file table_indices.h.

◆ TableIndices() [7/7]

template<int N>
TableIndices< N >::TableIndices ( const std::size_t  index0,
const std::size_t  index1,
const std::size_t  index2,
const std::size_t  index3,
const std::size_t  index4,
const std::size_t  index5,
const std::size_t  index6 = numbers::invalid_unsigned_int,
const std::size_t  index7 = numbers::invalid_unsigned_int,
const std::size_t  index8 = numbers::invalid_unsigned_int 
)

Convenience constructor that takes up to 9 arguments. It can be used to populate a TableIndices object upon creation, either completely, or partially.

Index entries that are not set by these arguments (either because they are omitted, or because \(N > 9\)) are set to numbers::invalid_unsigned_int.

Note that only the first N arguments are actually used.

Deprecated:
Use the constructor with the appropriate number of arguments to initialize the N indices instead.

Definition at line 251 of file table_indices.h.

Member Function Documentation

◆ operator[]() [1/2]

template<int N>
DEAL_II_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 340 of file table_indices.h.

◆ operator[]() [2/2]

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

Write access the value of the ith index.

Definition at line 349 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 358 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 368 of file table_indices.h.

◆ sort()

template<int N>
DEAL_II_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 376 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 385 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 399 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 181 of file table_indices.h.


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