Gradient Augmented Levelset Implementation in CPU & GPU
Array< T_GRID, T_ARRAY > Class Template Reference

#include <array.h>

Public Types

using value_type = T_ARRAY
 

Public Member Functions

 Array (const Grid< typename T_GRID::value_type, T_GRID::dim > &grid)
 
 ~Array ()
 
const std::size_t size () const
 
const T_GRID & grid () const
 
const Vec3< int > numCells () const
 
const std::vector< T_ARRAY > & data () const
 
const T_ARRAY & operator[] (const std::size_t idx) const
 
T_ARRAY & operator[] (const std::size_t idx)
 
const T_ARRAY & operator() (const int i, const int j, const int k) const
 
T_ARRAY & operator() (const int i, const int j, const int k)
 
const T_ARRAY & operator() (const Vec3< int > node_id) const
 
T_ARRAY & operator() (const Vec3< int > node_id)
 
void operator= (const Array< T_GRID, T_ARRAY > &array)
 

Friends

std::ostream & operator<< (std::ostream &out, const Array< T_GRID, T_ARRAY > &array)
 

Detailed Description

template<typename T_GRID, typename T_ARRAY>
class GALS::CPU::Array< T_GRID, T_ARRAY >

Class to create Array.

Definition at line 49 of file array.h.

Member Typedef Documentation

using value_type = T_ARRAY

Definition at line 52 of file array.h.

Constructor & Destructor Documentation

Array ( const Grid< typename T_GRID::value_type, T_GRID::dim > &  grid)

Constructor called using grid.

Parameters
gridobject of Grid.

Definition at line 38 of file array.cc.

~Array ( )

Destructor

Definition at line 53 of file array.cc.

Member Function Documentation

const std::vector<T_ARRAY>& data ( ) const
inline

Get data.

Returns
vector that stores data.

Definition at line 88 of file array.h.

const T_GRID & grid ( ) const

Returns attached grid.

Definition at line 66 of file array.cc.

const GALS::CPU::Vec3< int > numCells ( ) const

Returns a vector of size 3 with number of cells along x, y, z directions.

Vector of size 3: {nx, ny, nz}.

Returns
vector of size 3.

Definition at line 72 of file array.cc.

const T_ARRAY & operator() ( const int  i,
const int  j,
const int  k 
) const

Overloaded operator to return value of array using 3D cell indices.

Parameters
izero based index along x-direction.
jzero based index along y-direction.
kzero based index along z-direction.
Returns
value at given 3D cell indices.

Definition at line 90 of file array.cc.

T_ARRAY & operator() ( const int  i,
const int  j,
const int  k 
)

Overloaded operator to return reference to value of array using 3D cell indices.

Parameters
izero based index along x-direction.
jzero based index along y-direction.
kzero based index along z-direction.
Returns
reference to value at given 3D cell indices.

Definition at line 97 of file array.cc.

const T_ARRAY & operator() ( const Vec3< int >  node_id) const

Overloaded operator to return value of array using 3D cell index.

Parameters
node_idnode id of type GALS::CPU::Vec3<int>.
Returns
value at given 3D cell index.

Definition at line 104 of file array.cc.

T_ARRAY & operator() ( const Vec3< int >  node_id)

Overloaded operator to return value of array using 3D cell index.

Parameters
node_idnode id of type GALS::CPU::Vec3<int>.
Returns
value at given 3D cell index.

Definition at line 110 of file array.cc.

void operator= ( const Array< T_GRID, T_ARRAY > &  array)

Overloaded operator to assign values.

Parameters
arrayarray from which values will be copied.

Definition at line 116 of file array.cc.

const T_ARRAY & operator[] ( const std::size_t  idx) const

Overloaded subscript operator to return value of array at a given 1D array based index.

Parameters
idx1D array based index.
Returns
value at given index.

Definition at line 78 of file array.cc.

T_ARRAY & operator[] ( const std::size_t  idx)

Overloaded subscript operator to return reference to value of array at a given 1D array based index.

Parameters
idx1D array based index.
Returns
reference to value at given index.

Definition at line 84 of file array.cc.

const std::size_t size ( ) const

Returns 1D array size of array.

Data of array is stored in 1D vector with some padding. This function returns 1D vector size.

Returns
1D array size.

Definition at line 60 of file array.cc.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Array< T_GRID, T_ARRAY > &  array 
)
friend

Output operator overload.

Parameters
outoutput stream.
arrayArray object to output stream.
Returns
reference to output stream.

Definition at line 155 of file array.h.


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