Template Numerical Library  version develop:3271efbb
Classes | Functions
TNL::Containers Namespace Reference

Namespace for TNL containers. More...

Classes

class  Array
 Array is responsible for memory management, access to array elements, and general array operations. More...
 
class  ArrayView
 ArrayView is a simple data structure which provides a non-owning encapsulation of array data. That is, ArrayView is like Array without memory management. More...
 
class  ConstStaticSizesHolder
 
class  DistributedArray
 
class  DistributedArrayView
 
class  DistributedNDArray
 
class  DistributedNDArraySynchronizer
 
class  DistributedNDArrayView
 
class  DistributedVector
 
class  DistributedVectorView
 
class  IndexedMap
 
class  IndexedSet
 
class  NDArray
 
class  NDArrayIndexer
 
class  NDArrayStorage
 
class  NDArrayView
 
class  Partitioner
 
class  SizesHolder
 
class  SlicedNDArray
 
struct  SliceInfo
 
class  StaticArray
 Array with constant size. More...
 
class  StaticMatrix
 
class  StaticNDArray
 
class  StaticVector
 Vector with constant size. More...
 
class  Subrange
 
class  UnorderedIndexedSet
 
class  Vector
 Vector extends Array with algebraic operations. More...
 
class  VectorView
 VectorView extends ArrayView with algebraic operations. More...
 

Functions

template<typename Output , typename Input >
void nd_absolute (Output &output, const Input &input)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_add (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Input >
void nd_assign (Output &output, const Input &input)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_divide (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Func , typename... Input>
void nd_map (Output &output, Func f, const Input &... input)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_maximum (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_minimum (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_multiply (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_pow (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename Output , typename Input >
void nd_sign (Output &output, const Input &input)
 
template<typename Output , typename Input >
void nd_sqrt (Output &output, const Input &input)
 
template<typename Output , typename Input >
void nd_square (Output &output, const Input &input)
 
template<typename Output , typename Input1 , typename Input2 >
void nd_subtract (Output &output, const Input1 &input1, const Input2 &input2)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator!= (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator!= (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator!= (const Vector< Real1, Device1, Index, Allocator > &a, const Vector< Real2, Device2, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator!= (const Vector< Real1, Device1, Index, Allocator > &a, const VectorView< Real2, Device2, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator!= (const VectorView< Real1, Device1, Index > &a, const Vector< Real2, Device2, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator* (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator* (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator* (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator* (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator* (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator+ (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Index , std::size_t... sizes, typename OtherHolder >
SizesHolder< Index, sizes... > operator+ (const SizesHolder< Index, sizes... > &lhs, const OtherHolder &rhs)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator+ (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 Addition of vector and vector expression. More...
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator+ (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator+ (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator+ (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET1 , typename ET2 >
Real operator, (const ET1 &a, const ET2 &b)
 Computes scalar product of two vectors or vector expressions. Equivalent to TNL::dot. More...
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator- (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Index , std::size_t... sizes, typename OtherHolder >
SizesHolder< Index, sizes... > operator- (const SizesHolder< Index, sizes... > &lhs, const OtherHolder &rhs)
 
template<typename Real , typename Device , typename Index , typename Allocator >
auto operator- (const Vector< Real, Device, Index, Allocator > &a)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator- (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator- (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator- (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator- (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator/ (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto operator/ (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator/ (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator/ (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
auto operator/ (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator< (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator< (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator< (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator< (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator< (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Value , typename Device , typename Index , typename Allocator >
Fileoperator<< (File &&file, const Array< Value, Device, Index, Allocator > &array)
 
template<typename Value , typename Device , typename Index >
Fileoperator<< (File &&file, const ArrayView< Value, Device, Index > view)
 
template<int Size, typename Value >
Fileoperator<< (File &&file, const StaticArray< Size, Value > &array)
 Serialization of static arrays into binary files. More...
 
template<typename Value , typename Device , typename Index , typename Allocator >
Fileoperator<< (File &file, const Array< Value, Device, Index, Allocator > &array)
 Serialization of arrays into binary files.
 
template<typename Value , typename Device , typename Index >
Fileoperator<< (File &file, const ArrayView< Value, Device, Index > view)
 Serialization of array views into binary files.
 
template<int Size, typename Value >
Fileoperator<< (File &file, const StaticArray< Size, Value > &array)
 Serialization of static arrays into binary files. More...
 
template<typename Value , typename Device , typename Index , typename Allocator >
std::ostreamoperator<< (std::ostream &str, const Array< Value, Device, Index, Allocator > &array)
 
template<typename Value , typename Device , typename Index >
std::ostreamoperator<< (std::ostream &str, const ArrayView< Value, Device, Index > &view)
 
template<typename Index , std::size_t... sizes>
std::ostreamoperator<< (std::ostream &str, const SizesHolder< Index, sizes... > &holder)
 
template<int Size, typename Value >
std::ostreamoperator<< (std::ostream &str, const StaticArray< Size, Value > &a)
 
template<typename Index >
std::ostreamoperator<< (std::ostream &str, const Subrange< Index > &range)
 
template<typename Value , typename Index , typename Key >
std::ostreamoperator<< (std::ostream &str, IndexedMap< Value, Index, Key > &set)
 
template<typename Element , typename Index >
std::ostreamoperator<< (std::ostream &str, IndexedSet< Element, Index > &set)
 
template<class Key , class Index , class Compare , class Allocator >
std::ostreamoperator<< (std::ostream &str, IndexedSet< Key, Index, Compare, Allocator > &set)
 
template<typename Element , typename Index >
std::ostreamoperator<< (std::ostream &str, UnorderedIndexedSet< Element, Index > &set)
 
template<class Key , class Index , class Hash , class KeyEqual , class Allocator >
std::ostreamoperator<< (std::ostream &str, UnorderedIndexedSet< Key, Index, Hash, KeyEqual, Allocator > &set)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator<= (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator<= (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator<= (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator<= (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator<= (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator== (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator== (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator== (const Vector< Real1, Device1, Index, Allocator > &a, const Vector< Real2, Device2, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator== (const Vector< Real1, Device1, Index, Allocator > &a, const VectorView< Real2, Device2, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device1 , typename Device2 , typename Index , typename Allocator >
bool operator== (const VectorView< Real1, Device1, Index > &a, const Vector< Real2, Device2, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator> (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator> (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator> (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator> (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator> (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename ET , typename Real , typename Device , typename Index , typename Allocator , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator>= (const ET &a, const Vector< Real, Device, Index, Allocator > &b)
 
template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
bool operator>= (const Vector< Real, Device, Index, Allocator > &a, const ET &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator>= (const Vector< Real1, Device, Index, Allocator > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator>= (const Vector< Real1, Device, Index, Allocator > &a, const VectorView< Real2, Device, Index > &b)
 
template<typename Real1 , typename Real2 , typename Device , typename Index , typename Allocator >
bool operator>= (const VectorView< Real1, Device, Index > &a, const Vector< Real2, Device, Index, Allocator > &b)
 
template<typename Value , typename Device , typename Index , typename Allocator >
Fileoperator>> (File &&file, Array< Value, Device, Index, Allocator > &array)
 
template<typename Value , typename Device , typename Index >
Fileoperator>> (File &&file, ArrayView< Value, Device, Index > view)
 
template<int Size, typename Value >
Fileoperator>> (File &&file, StaticArray< Size, Value > &array)
 Deserialization of static arrays from binary files. More...
 
template<typename Value , typename Device , typename Index , typename Allocator >
Fileoperator>> (File &file, Array< Value, Device, Index, Allocator > &array)
 Deserialization of arrays from binary files.
 
template<typename Value , typename Device , typename Index >
Fileoperator>> (File &file, ArrayView< Value, Device, Index > view)
 Deserialization of array views from binary files.
 
template<int Size, typename Value >
Fileoperator>> (File &file, StaticArray< Size, Value > &array)
 Deserialization of static arrays from binary files. More...
 
template<typename Real >
__cuda_callable__ Real TriangleArea (const StaticVector< 2, Real > &a, const StaticVector< 2, Real > &b, const StaticVector< 2, Real > &c)
 
template<typename Real >
__cuda_callable__ Real TriangleArea (const StaticVector< 3, Real > &a, const StaticVector< 3, Real > &b, const StaticVector< 3, Real > &c)
 
template<typename Real >
__cuda_callable__ StaticVector< 3, Real > VectorProduct (const StaticVector< 3, Real > &u, const StaticVector< 3, Real > &v)
 

Detailed Description

Namespace for TNL containers.

Function Documentation

◆ operator+()

template<typename Real , typename Device , typename Index , typename Allocator , typename ET , typename... , typename = std::enable_if_t< Expressions::IsNumericExpression<ET>::value >>
auto TNL::Containers::operator+ ( const Vector< Real, Device, Index, Allocator > &  a,
const ET &  b 
)

Addition of vector and vector expression.

Parameters
a
b
Returns

◆ operator,()

template<typename ET1 , typename ET2 >
Real TNL::Containers::operator, ( const ET1 &  a,
const ET2 &  b 
)

Computes scalar product of two vectors or vector expressions. Equivalent to TNL::dot.

Parameters
ainput vector or vector expression
binput vector or vector expression
Returns
scalar product of a and b.

◆ operator<<() [1/2]

template<int Size, typename Value >
File & TNL::Containers::operator<< ( File &&  file,
const StaticArray< Size, Value > &  array 
)

Serialization of static arrays into binary files.

Parameters
fileoutput file
arrayis an array to be written into the output file.

◆ operator<<() [2/2]

template<int Size, typename Value >
File & TNL::Containers::operator<< ( File file,
const StaticArray< Size, Value > &  array 
)

Serialization of static arrays into binary files.

Parameters
fileoutput file
arrayis an array to be written into the output file.

◆ operator>>() [1/2]

template<int Size, typename Value >
File & TNL::Containers::operator>> ( File &&  file,
StaticArray< Size, Value > &  array 
)

Deserialization of static arrays from binary files.

Parameters
fileinput file
arrayis an array to be read from the input file.

◆ operator>>() [2/2]

template<int Size, typename Value >
File & TNL::Containers::operator>> ( File file,
StaticArray< Size, Value > &  array 
)

Deserialization of static arrays from binary files.

Parameters
fileinput file
arrayis an array to be read from the input file.