GEOSX
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
LvArray Namespace Reference

The top level namespace. More...

Namespaces

 arrayManipulation
 Contains functions for operating on a contiguous array of values.
 
 bufferManipulation
 Contains template functions for performing common operations on buffers.
 
 indexing
 Contains functions to aid in multidimensional indexing.
 
 input
 Contains functions for filling array objects from strings.
 
 math
 Contains protable wrappers around cmath functions and some cuda specific functions.
 
 sortedArrayManipulation
 Contains functions for operating on a contiguous sorted unique array of values.
 
 system
 Contains functions that interact with the system or runtime environment.
 
 tensorOps
 Contains operations for operating on compile time sized vectors and matrices.
 
 typeManipulation
 Contains templates for manipulating types.
 

Classes

class  Array
 This class provides a fixed dimensional resizeable array interface in addition to an interface similar to std::vector for a 1D array. More...
 
class  ArrayOfArrays
 This class implements an array of arrays like object with contiguous storage. More...
 
class  ArrayOfArraysView
 This class provides a view into an array of arrays like object. More...
 
class  ArrayOfSets
 This class implements an array of sets like object with contiguous storage. More...
 
class  ArrayOfSetsView
 This class provides a view into an array of sets like object. More...
 
class  ArraySlice
 This class serves to provide a sliced multidimensional interface to the family of LvArray classes. More...
 
class  ArrayView
 This class serves to provide a "view" of a multidimensional array. More...
 
class  ChaiBuffer
 Implements the Buffer interface using CHAI. More...
 
class  CRSMatrix
 This class implements a compressed row storage matrix. More...
 
class  CRSMatrixView
 This class provides a view into a compressed row storage matrix. More...
 
class  MallocBuffer
 Implements the Buffer interface using malloc and free. More...
 
struct  NumericLimits
 A wrapper for the std::numeric_limits< T > member functions, this allows their values to be used on device. More...
 
struct  NumericLimitsNC
 The same as NumericLimits except the entries are not static or constexpr. More...
 
class  SortedArray
 This class provides an interface similar to an std::set. More...
 
class  SortedArrayView
 This class provides a view into a SortedArray. More...
 
class  SparsityPattern
 This class implements a compressed row storage sparsity pattern. More...
 
class  SparsityPatternView
 This class provides a view into a compressed row storage sparsity pattern. More...
 
class  StackBuffer
 This class implements the Buffer interface using a c-array. More...
 

Typedefs

template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , int LENGTH>
using StackArray = typename internal::StackArrayHelper< T, NDIM, PERMUTATION, INDEX_TYPE, LENGTH >::type
 An alias for a Array backed by a StackBuffer. More...
 

Enumerations

enum  MemorySpace { NONE, CPU }
 An enum containing the available memory spaces.
 

Functions

std::ostream & operator<< (std::ostream &os, MemorySpace const space)
 Output a MemorySpace enum to a stream. More...
 
template<typename OUTPUT , typename INPUT >
std::enable_if_t< internal::canEasilyConvert< INPUT, OUTPUT >, OUTPUT > constexpr integerConversion (INPUT input)
 
template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > &&std::is_unsigned< INPUT >::value, OUTPUT > integerConversion (INPUT input)
 
template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > &&!std::is_unsigned< INPUT >::value, OUTPUT > integerConversion (INPUT input)
 
template<typename T , int NDIM, int USD, typename INDEX_TYPE >
std::ostream & operator<< (std::ostream &stream, ::LvArray::ArraySlice< T, NDIM, USD, INDEX_TYPE > const slice)
 This function outputs the contents of an array slice to an output stream. More...
 
template<typename T , int NDIM, int USD, typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, ::LvArray::ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > const &view)
 This function outputs the contents of an ArrayView to an output stream. More...
 
template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > const &view)
 This function outputs the contents of view to an output stream. More...
 
template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, SortedArray< T, INDEX_TYPE, BUFFER_TYPE > const &array)
 This function outputs the contents of array to an output stream. More...
 
template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > const &view)
 This function outputs the contents of view to an output stream. More...
 
template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, ArrayOfArrays< T, INDEX_TYPE, BUFFER_TYPE > const &array)
 This function outputs the contents of array to an output stream. More...
 
template<typename T , typename COL_TYPE , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream & operator<< (std::ostream &stream, CRSMatrixView< T const, COL_TYPE const, INDEX_TYPE const, BUFFER_TYPE > const &view)
 This function outputs the contents of view to an output stream. More...
 
template<typename T , int N>
std::enable_if_t< !std::is_same< T, char >::value, std::ostream &> operator<< (std::ostream &stream, T const (&array)[N])
 Output a c-array to a stream. More...
 
template<typename T , int M, int N>
std::ostream & operator<< (std::ostream &stream, T const (&array)[M][N])
 Output a 2D c-array to a stream. More...
 
template<typename T , typename LAMBDA >
void forValuesInSlice (T &value, LAMBDA &&f)
 Apply the given function to the given value. More...
 
template<typename T , int NDIM, int USD, typename INDEX_TYPE , typename LAMBDA >
void forValuesInSlice (ArraySlice< T, NDIM, USD, INDEX_TYPE > const slice, LAMBDA &&f)
 Iterate over the values in the slice in lexicographic order. More...
 
template<typename T , typename LAMBDA , typename ... INDICES>
void forValuesInSliceWithIndices (T &value, LAMBDA &&f, INDICES const ... indices)
 Apply the function f to the value value also passing f any indices used to reach value. More...
 
template<typename T , int NDIM, int USD, typename INDEX_TYPE , typename LAMBDA , typename ... INDICES>
void forValuesInSliceWithIndices (ArraySlice< T, NDIM, USD, INDEX_TYPE > const slice, LAMBDA &&f, INDICES const ... indices)
 Iterate over the values in the slice in lexicographic order, passing the indices as well as the value to the lambda. More...
 
template<typename T , int USD_SRC, typename INDEX_TYPE >
void sumOverFirstDimension (ArraySlice< T const, 1, USD_SRC, INDEX_TYPE > const src, T &dst)
 Add the values in src to dst. More...
 
template<typename T , int NDIM, int USD_SRC, int USD_DST, typename INDEX_TYPE >
void sumOverFirstDimension (ArraySlice< T const, NDIM, USD_SRC, INDEX_TYPE > const src, ArraySlice< T, NDIM - 1, USD_DST, INDEX_TYPE > const dst)
 Sum over the first dimension of src adding the results to dst. More...
 

Variables

template<typename >
constexpr bool isArray = false
 True if the template type is an Array.
 
template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool isArray< Array< T, NDIM, PERMUTATION, INDEX_TYPE, BUFFER_TYPE > > = true
 Specialization of isArray for the Array class. More...
 
template<class >
constexpr bool isArrayView = false
 True if the template type is a ArrayView.
 
template<typename T , int NDIM, int USD, typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool isArrayView< ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > > = true
 Specialization of isArrayView for the ArrayView class. More...
 
template<class >
constexpr bool isSortedArray = false
 True if the template type is a SortedArray.
 
template<class T , class INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool isSortedArray< SortedArray< T, INDEX_TYPE, BUFFER_TYPE > > = true
 Specialization of isSortedArrayView for the SortedArray class. More...
 
template<class >
constexpr bool isSortedArrayView = false
 True if the template type is a SortedArrayView.
 
template<class T , class INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool isSortedArrayView< SortedArrayView< T, INDEX_TYPE, BUFFER_TYPE > > = true
 Specialization of isSortedArrayView for the SortedArrayView class. More...
 

Detailed Description

The top level namespace.

Typedef Documentation

◆ StackArray

template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , int LENGTH>
using LvArray::StackArray = typedef typename internal::StackArrayHelper< T, NDIM, PERMUTATION, INDEX_TYPE, LENGTH >::type

An alias for a Array backed by a StackBuffer.

Template Parameters
TThe type of the values stored in the Array.
NDIMThe number of dimensions in the Array.
PERMUTATIONThe layout of the data in memory.
INDEX_TYPEThe integer used for indexing.
LENGTHThe capacity of the backing c-array.

Definition at line 739 of file Array.hpp.

Function Documentation

◆ forValuesInSlice() [1/2]

template<typename T , typename LAMBDA >
void LvArray::forValuesInSlice ( T &  value,
LAMBDA &&  f 
)

Apply the given function to the given value.

Template Parameters
TThe type of value.
LAMBDAthe type of the function f to apply.
Parameters
valuethe value to pass to the function.
fthe function to apply to the value.

Definition at line 31 of file sliceHelpers.hpp.

◆ forValuesInSlice() [2/2]

template<typename T , int NDIM, int USD, typename INDEX_TYPE , typename LAMBDA >
void LvArray::forValuesInSlice ( ArraySlice< T, NDIM, USD, INDEX_TYPE > const  slice,
LAMBDA &&  f 
)

Iterate over the values in the slice in lexicographic order.

Template Parameters
TThe type of values stored in slice.
NDIMthe dimension of slice.
USDthe unit stride dimension of slice.
INDEX_TYPEthe integer used to index into slice.
LAMBDAthe type of the function f to apply.
Parameters
slicethe slice to iterate over.
fthe function to apply to each value.

Definition at line 47 of file sliceHelpers.hpp.

◆ forValuesInSliceWithIndices() [1/2]

template<typename T , typename LAMBDA , typename ... INDICES>
void LvArray::forValuesInSliceWithIndices ( T &  value,
LAMBDA &&  f,
INDICES const ...  indices 
)

Apply the function f to the value value also passing f any indices used to reach value.

Template Parameters
TThe type of value.
INDICESvariadic pack of indices.
LAMBDAthe type of the function f to apply.
Parameters
valueThe value to apply f to.
fThe function to apply to each value.
indicesThe previous sliced off indices.

Definition at line 68 of file sliceHelpers.hpp.

◆ forValuesInSliceWithIndices() [2/2]

template<typename T , int NDIM, int USD, typename INDEX_TYPE , typename LAMBDA , typename ... INDICES>
void LvArray::forValuesInSliceWithIndices ( ArraySlice< T, NDIM, USD, INDEX_TYPE > const  slice,
LAMBDA &&  f,
INDICES const ...  indices 
)

Iterate over the values in the slice in lexicographic order, passing the indices as well as the value to the lambda.

Template Parameters
TThe type of values stored in slice.
NDIMthe dimension of slice.
USDthe unit stride dimension of slice.
INDEX_TYPEthe integer used to index into slice.
INDICESvariadic pack of indices.
LAMBDAthe type of the function f to apply.
Parameters
sliceThe slice to iterate over.
fThe lambda to apply to each value.
indicesThe previous sliced off indices.

Definition at line 87 of file sliceHelpers.hpp.

◆ integerConversion() [1/3]

template<typename OUTPUT , typename INPUT >
std::enable_if_t< internal::canEasilyConvert< INPUT, OUTPUT >, OUTPUT > constexpr LvArray::integerConversion ( INPUT  input)
inline
Template Parameters
INPUTThe input integer type.
OUTPUTThe output integer type.
Returns
Return input to type
Template Parameters
OUTPUT,abortingexecution if the conversion can't be performed.
Parameters
inputThe value to convert.

Definition at line 115 of file limits.hpp.

◆ integerConversion() [2/3]

template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > && std::is_unsigned< INPUT >::value, OUTPUT > LvArray::integerConversion ( INPUT  input)
inline
Template Parameters
INPUTThe input integer type.
OUTPUTThe output integer type.
Returns
Return input to type
Template Parameters
OUTPUT,abortingexecution if the conversion can't be performed.
Parameters
inputThe value to convert.

Definition at line 134 of file limits.hpp.

◆ integerConversion() [3/3]

template<typename OUTPUT , typename INPUT >
std::enable_if_t< !internal::canEasilyConvert< INPUT, OUTPUT > && !std::is_unsigned< INPUT >::value, OUTPUT > LvArray::integerConversion ( INPUT  input)
inline
Template Parameters
INPUTThe input integer type.
OUTPUTThe output integer type.
Returns
Return input to type
Template Parameters
OUTPUT,abortingexecution if the conversion can't be performed.
Parameters
inputThe value to convert.

Definition at line 155 of file limits.hpp.

◆ operator<<() [1/10]

template<typename T , int NDIM, int USD, typename INDEX_TYPE >
std::ostream& LvArray::operator<< ( std::ostream &  stream,
::LvArray::ArraySlice< T, NDIM, USD, INDEX_TYPE > const  slice 
)

This function outputs the contents of an array slice to an output stream.

Template Parameters
TThe type of the values in slice.
NDIMThe number of dimensions of slice.
USDThe unit stride dimension of slice.
INDEX_TYPEThe integer used by slice.
Parameters
streamThe output stream to write to.
sliceThe slice to output.
Returns
stream .

Definition at line 40 of file output.hpp.

◆ operator<<() [2/10]

std::ostream& LvArray::operator<< ( std::ostream &  os,
MemorySpace const  space 
)
inline

Output a MemorySpace enum to a stream.

Parameters
osThe output stream to write to.
spaceThe MemorySpace to output.
Returns
os.

Definition at line 46 of file bufferManipulation.hpp.

◆ operator<<() [3/10]

template<typename T , int NDIM, int USD, typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
::LvArray::ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > const &  view 
)

This function outputs the contents of an ArrayView to an output stream.

Template Parameters
TThe type of the values in view.
NDIMThe number of dimensions of view.
USDThe unit stride dimension of view.
INDEX_TYPEThe integer used by view.
BUFFER_TYPEThe buffer type used by view.
Parameters
streamThe output stream to write to.
viewThe view to output.
Returns
stream .

Definition at line 77 of file output.hpp.

◆ operator<<() [4/10]

template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > const &  view 
)

This function outputs the contents of view to an output stream.

Template Parameters
TThe type of the values in view.
INDEX_TYPEThe integer used by view.
Parameters
streamThe output stream to write to.
viewThe SortedArrayView to output.
Returns
stream .

Definition at line 90 of file output.hpp.

◆ operator<<() [5/10]

template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
SortedArray< T, INDEX_TYPE, BUFFER_TYPE > const &  array 
)

This function outputs the contents of array to an output stream.

Template Parameters
TThe type of the values in array.
INDEX_TYPEThe integer used by array.
Parameters
streamThe output stream to write to.
arrayThe SortedArray to output.
Returns
stream .

Definition at line 122 of file output.hpp.

◆ operator<<() [6/10]

template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
ArrayOfArraysView< T const, INDEX_TYPE const, true, BUFFER_TYPE > const &  view 
)

This function outputs the contents of view to an output stream.

Template Parameters
TThe type of the values in view.
INDEX_TYPEThe integer used by view.
Parameters
streamThe output stream to write to.
viewThe ArrayOfArraysView to output.
Returns
stream .

Definition at line 135 of file output.hpp.

◆ operator<<() [7/10]

template<typename T , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
ArrayOfArrays< T, INDEX_TYPE, BUFFER_TYPE > const &  array 
)

This function outputs the contents of array to an output stream.

Template Parameters
TThe type of the values in array.
INDEX_TYPEThe integer used by array.
Parameters
streamThe output stream to write to.
arrayThe ArrayOfArrays to output.
Returns
stream .

Definition at line 164 of file output.hpp.

◆ operator<<() [8/10]

template<typename T , typename COL_TYPE , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
CRSMatrixView< T const, COL_TYPE const, INDEX_TYPE const, BUFFER_TYPE > const &  view 
)

This function outputs the contents of view to an output stream.

Template Parameters
TThe type of the values in view.
INDEX_TYPEThe integer used by view.
Parameters
streamThe output stream to write to.
viewThe ArrayOfArraysView to output.
Returns
stream .

Definition at line 177 of file output.hpp.

◆ operator<<() [9/10]

template<typename T , int N>
std::enable_if_t< !std::is_same< T, char >::value, std::ostream & > LvArray::operator<< ( std::ostream &  stream,
T const (&)  array[N] 
)

Output a c-array to a stream.

Template Parameters
TThe type contained in the array.
NThe size of the array.
Parameters
streamThe output stream to write to.
arrayThe c-array to output.
Returns
stream.

Definition at line 202 of file output.hpp.

◆ operator<<() [10/10]

template<typename T , int M, int N>
std::ostream& LvArray::operator<< ( std::ostream &  stream,
T const (&)  array[M][N] 
)

Output a 2D c-array to a stream.

Template Parameters
TThe type contained in the array.
MThe size of the first dimension.
NThe size of the second dimension.
Parameters
streamThe output stream to write to.
arrayThe 2D c-array to output.
Returns
stream.

Definition at line 223 of file output.hpp.

◆ sumOverFirstDimension() [1/2]

template<typename T , int USD_SRC, typename INDEX_TYPE >
void LvArray::sumOverFirstDimension ( ArraySlice< T const, 1, USD_SRC, INDEX_TYPE > const  src,
T &  dst 
)

Add the values in src to dst.

Template Parameters
TThe type of values stored in src.
NDIMthe dimension of src.
USD_SRCthe unit stride dimension of src.
INDEX_TYPEthe integer used to index into src.
Parameters
srcThe array slice to sum over.
dstThe value to add the sum to.

Definition at line 108 of file sliceHelpers.hpp.

◆ sumOverFirstDimension() [2/2]

template<typename T , int NDIM, int USD_SRC, int USD_DST, typename INDEX_TYPE >
void LvArray::sumOverFirstDimension ( ArraySlice< T const, NDIM, USD_SRC, INDEX_TYPE > const  src,
ArraySlice< T, NDIM - 1, USD_DST, INDEX_TYPE > const  dst 
)

Sum over the first dimension of src adding the results to dst.

Template Parameters
TThe type of values stored in src.
NDIMthe dimension of src.
USD_SRCthe unit stride dimension of src.
USD_DSTthe unit stride dimension of dst.
INDEX_TYPEthe integer used to index into src and dst.
Parameters
srcThe slice to sum over.
dstThe slice to add to.

Definition at line 129 of file sliceHelpers.hpp.

Variable Documentation

◆ isArray< Array< T, NDIM, PERMUTATION, INDEX_TYPE, BUFFER_TYPE > >

template<typename T , int NDIM, typename PERMUTATION , typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool LvArray::isArray< Array< T, NDIM, PERMUTATION, INDEX_TYPE, BUFFER_TYPE > > = true

Specialization of isArray for the Array class.

Template Parameters
TThe type contained in the Array.
NDIMThe number of dimensions in the Array.
PERMUTATIONThe way that the data is layed out in memory.
INDEX_TYPEThe integral type used as an index.
BUFFER_TYPEThe type used to manage the underlying allocation.

Definition at line 691 of file Array.hpp.

◆ isArrayView< ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > >

template<typename T , int NDIM, int USD, typename INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool LvArray::isArrayView< ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > > = true

Specialization of isArrayView for the ArrayView class.

Template Parameters
TThe type contained in the ArrayView.
NDIMThe number of dimensions in the ArrayView.
USDThe unit stride dimension.
INDEX_TYPEThe integral type used as an index.
BUFFER_TYPEThe type used to manager the underlying allocation.

Definition at line 685 of file ArrayView.hpp.

◆ isSortedArray< SortedArray< T, INDEX_TYPE, BUFFER_TYPE > >

template<class T , class INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool LvArray::isSortedArray< SortedArray< T, INDEX_TYPE, BUFFER_TYPE > > = true

Specialization of isSortedArrayView for the SortedArray class.

Template Parameters
TThe type contained in the SortedArray.
INDEX_TYPEThe integral type used as an index.
BUFFER_TYPEThe type used to manager the underlying allocation.

Definition at line 401 of file SortedArray.hpp.

◆ isSortedArrayView< SortedArrayView< T, INDEX_TYPE, BUFFER_TYPE > >

template<class T , class INDEX_TYPE , template< typename > class BUFFER_TYPE>
constexpr bool LvArray::isSortedArrayView< SortedArrayView< T, INDEX_TYPE, BUFFER_TYPE > > = true

Specialization of isSortedArrayView for the SortedArrayView class.

Template Parameters
TThe type contained in the SortedArrayView.
INDEX_TYPEThe integral type used as an index.
BUFFER_TYPEThe type used to manager the underlying allocation.

Definition at line 316 of file SortedArrayView.hpp.