SLIP  1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
slip::block4d< T, NS, NP, NR, NC > Class Template Reference

This a four-dimensional static and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 4d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the quadruple bracket element access. More...

#include <Block4d.hpp>

Public Types

typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
typedef block4d< T, NS, NP, NR,
NC > 
self
 
typedef ptrdiff_t difference_type
 
typedef std::size_t size_type
 
typedef pointer iterator
 
typedef const_pointer const_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef
std::random_access_iterator4d_tag 
iterator_category
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
void fill (const T &val)
 Init the block4d filled it with val value. More...
 
void fill (const T *val)
 Init the block4d filled it with values contained by val array. More...
 
std::string name () const
 Returns the name of the class. More...
 
void swap (self &M)
 Swaps the contents of two block4d. More...
 

Static Public Member Functions

static std::size_t dim ()
 Returns the dimension of the block4d. More...
 
static std::size_t dim1 ()
 Returns the first dimension of the block4d (number of slabs) More...
 
static std::size_t dim2 ()
 Returns the second dimension of the block4d (number of plans) More...
 
static std::size_t dim3 ()
 Returns the third dimension of the block4d (number of rows) More...
 
static std::size_t dim4 ()
 Returns the fourth dimension of the block4d (number of columns) More...
 
static std::size_t size ()
 Returns the size (number of elements) of the block4d. More...
 
static std::size_t size_max ()
 Returns the maximal size (number of elements) of the block4d. More...
 
static bool empty ()
 Returns true if the block4d size is 0. More...
 

Public Attributes

slip::block3d< T, NP, NR, NC > data [NS]
 

Static Public Attributes

static const std::size_t SIZE = NS * NP * NR * NC
 
static const std::size_t DIM = 4
 

Friends

class boost::serialization::access
 

Operators

std::ostream & operator<< (std::ostream &out, const self &b)
 Write the block2d to ab ouput stream. More...
 
bool operator== (const self &x, const self &y)
 Equality Compare operator. More...
 
bool operator!= (const self &x, const self &y)
 Equality Compare operator. More...
 
bool operator< (const self &x, const self &y)
 LessThan Compare operator. More...
 
bool operator> (const self &x, const self &y)
 MoreThan Compare operator. More...
 
bool operator<= (const self &x, const self &y)
 LessThan Compare operator. More...
 
bool operator>= (const self &x, const self &y)
 MoreThan Compare operator. More...
 
slip::block3d< T, NP, NR, NC > & operator[] (const std::size_t i)
 Returns a reference to the i'th slab of the block4d. More...
 
const slip::block3d< T, NP, NR,
NC > & 
operator[] (const std::size_t i) const
 Returns a const reference to the i'th slab of the block4d. More...
 
T * operator() (const std::size_t l, const std::size_t i, const std::size_t j)
 Returns a pointer at the first element of the l'th slab, the i'th plan and the j'th row. More...
 
const T * operator() (const std::size_t l, const std::size_t i, const std::size_t j) const
 Returns a const pointer at the first element of the l'th slab, the i'th plan and the j'th row. More...
 
T & operator() (const std::size_t l, const std::size_t i, const std::size_t j, const std::size_t k)
 Returns a reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column. More...
 
const T & operator() (const std::size_t l, const std::size_t i, const std::size_t j, const std::size_t k) const
 Returns a const reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column. More...
 

Detailed Description

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
class slip::block4d< T, NS, NP, NR, NC >

This a four-dimensional static and generic container. This container statisfies the BidirectionnalContainer concepts of the STL. It is also an 4d extension of the RandomAccessContainer concept. That is to say the bracket element access is replaced by the quadruple bracket element access.

Version
Fluex 1.0
Date
2013/07/01
Since
1.4.0
Author
Denis Arrivault <denis.arrivault_AT_inria.fr>
Parameters
TType of object in the block4d
NSnumber of slabs of the block4d
NPnumber of plans of the block4d
NRnumber of rows of the block4d
NCnumber of columns of the block4d
Todo:
add iterator member functions to be compliant with other 4d slip interfaces.

Definition at line 94 of file Block4d.hpp.

Member Typedef Documentation

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef const_pointer slip::block4d< T, NS, NP, NR, NC >::const_iterator

Definition at line 153 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef const value_type* slip::block4d< T, NS, NP, NR, NC >::const_pointer

Definition at line 143 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef const value_type& slip::block4d< T, NS, NP, NR, NC >::const_reference

Definition at line 145 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef std::reverse_iterator<const_iterator> slip::block4d< T, NS, NP, NR, NC >::const_reverse_iterator

Definition at line 156 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef ptrdiff_t slip::block4d< T, NS, NP, NR, NC >::difference_type

Definition at line 149 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef pointer slip::block4d< T, NS, NP, NR, NC >::iterator

Definition at line 152 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef std::random_access_iterator4d_tag slip::block4d< T, NS, NP, NR, NC >::iterator_category

Definition at line 159 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef value_type* slip::block4d< T, NS, NP, NR, NC >::pointer

Definition at line 142 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef value_type& slip::block4d< T, NS, NP, NR, NC >::reference

Definition at line 144 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef std::reverse_iterator<iterator> slip::block4d< T, NS, NP, NR, NC >::reverse_iterator

Definition at line 155 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef block4d<T,NS,NP,NR,NC> slip::block4d< T, NS, NP, NR, NC >::self

Definition at line 147 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef std::size_t slip::block4d< T, NS, NP, NR, NC >::size_type

Definition at line 150 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
typedef T slip::block4d< T, NS, NP, NR, NC >::value_type

Definition at line 141 of file Block4d.hpp.

Member Function Documentation

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
T * slip::block4d< T, NS, NP, NR, NC >::begin ( )
inline

Definition at line 394 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const T * slip::block4d< T, NS, NP, NR, NC >::begin ( ) const
inline

Definition at line 408 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::dim ( )
inlinestatic

Returns the dimension of the block4d.

Definition at line 348 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::dim1 ( )
inlinestatic

Returns the first dimension of the block4d (number of slabs)

Definition at line 350 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::dim2 ( )
inlinestatic

Returns the second dimension of the block4d (number of plans)

Definition at line 352 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::dim3 ( )
inlinestatic

Returns the third dimension of the block4d (number of rows)

Definition at line 354 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::dim4 ( )
inlinestatic

Returns the fourth dimension of the block4d (number of columns)

Definition at line 356 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static bool slip::block4d< T, NS, NP, NR, NC >::empty ( )
inlinestatic

Returns true if the block4d size is 0.

Definition at line 362 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
T * slip::block4d< T, NS, NP, NR, NC >::end ( )
inline

Definition at line 401 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const T * slip::block4d< T, NS, NP, NR, NC >::end ( ) const
inline

Definition at line 415 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
void slip::block4d< T, NS, NP, NR, NC >::fill ( const T &  val)
inline

Init the block4d filled it with val value.

Parameters
valinit value

Definition at line 617 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
void slip::block4d< T, NS, NP, NR, NC >::fill ( const T *  val)
inline

Init the block4d filled it with values contained by val array.

Parameters
valinit array value

Definition at line 627 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::string slip::block4d< T, NS, NP, NR, NC >::name ( ) const
inline

Returns the name of the class.

Definition at line 345 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
T * slip::block4d< T, NS, NP, NR, NC >::operator() ( const std::size_t  l,
const std::size_t  i,
const std::size_t  j 
)
inline

Returns a pointer at the first element of the l'th slab, the i'th plan and the j'th row.

Parameters
lindex of the slab
iindex of the plan
jindex of the row
Returns
reference to the element at the l'th slab, the i'th plan and the j'th row
Precondition
l < NS
i < NP
j < NR

Definition at line 567 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const T * slip::block4d< T, NS, NP, NR, NC >::operator() ( const std::size_t  l,
const std::size_t  i,
const std::size_t  j 
) const
inline

Returns a const pointer at the first element of the l'th slab, the i'th plan and the j'th row.

Parameters
lindex of the slab
iindex of the plan
jindex of the row
Returns
const reference to the element at the l'th slab, the i'th plan, and the j'th row
Precondition
l < NS
i < NP
j < NR

Definition at line 578 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
T & slip::block4d< T, NS, NP, NR, NC >::operator() ( const std::size_t  l,
const std::size_t  i,
const std::size_t  j,
const std::size_t  k 
)
inline

Returns a reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column.

Parameters
lindex of the slab
iindex of the plan
jindex of the row
kindex of the column
Returns
reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column
Precondition
l < NS
i < NP
j < NR
k < NC

Definition at line 590 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const T & slip::block4d< T, NS, NP, NR, NC >::operator() ( const std::size_t  l,
const std::size_t  i,
const std::size_t  j,
const std::size_t  k 
) const
inline

Returns a const reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column.

Parameters
lindex of the slab
iindex of the plan
jindex of the row
kindex of the column
Returns
const reference to the element at the l'th slab, the i'th plan, the j'th row and the k'th column
Precondition
l < NS
i < NP
j < NR
k < NC

Definition at line 603 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
slip::block3d< T, NP, NR, NC > & slip::block4d< T, NS, NP, NR, NC >::operator[] ( const std::size_t  i)
inline

Returns a reference to the i'th slab of the block4d.

Parameters
iindex of the slab to return
Returns
the pointer of the block3d of the i'th slab of the block4d.
Precondition
i < NS

Definition at line 451 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const slip::block3d< T, NP, NR, NC > & slip::block4d< T, NS, NP, NR, NC >::operator[] ( const std::size_t  i) const
inline

Returns a const reference to the i'th slab of the block4d.

Parameters
iindex of the slab to return
Returns
const the pointer of the block3d of the i'th slab of the block4d.
Precondition
i < NS

Definition at line 459 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::reverse_iterator< T * > slip::block4d< T, NS, NP, NR, NC >::rbegin ( )
inline

Definition at line 423 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::reverse_iterator< const T * > slip::block4d< T, NS, NP, NR, NC >::rbegin ( ) const
inline

Definition at line 437 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::reverse_iterator< T * > slip::block4d< T, NS, NP, NR, NC >::rend ( )
inline

Definition at line 430 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::reverse_iterator< const T * > slip::block4d< T, NS, NP, NR, NC >::rend ( ) const
inline

Definition at line 444 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::size ( )
inlinestatic

Returns the size (number of elements) of the block4d.

Definition at line 358 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
static std::size_t slip::block4d< T, NS, NP, NR, NC >::size_max ( )
inlinestatic

Returns the maximal size (number of elements) of the block4d.

Definition at line 360 of file Block4d.hpp.

template<typename T , std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
void slip::block4d< T, NS, NP, NR, NC >::swap ( self M)
inline

Swaps the contents of two block4d.

Parameters
Mblock4d to swap with

Definition at line 637 of file Block4d.hpp.

Friends And Related Function Documentation

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
friend class boost::serialization::access
friend

Definition at line 373 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator!= ( const self x,
const self y 
)
friend

Equality Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x != y
Precondition
x.dim() == y.dim()

Definition at line 497 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator< ( const self x,
const self y 
)
friend

LessThan Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x < y
Precondition
x.dim() == y.dim()

Definition at line 512 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
std::ostream& operator<< ( std::ostream &  out,
const self b 
)
friend

Write the block2d to ab ouput stream.

Parameters
outoutput stream
bblock4d to write to an output stream

Definition at line 468 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator<= ( const self x,
const self y 
)
friend

LessThan Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x <= y
Precondition
x.dim() == y.dim()

Definition at line 540 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator== ( const self x,
const self y 
)
friend

Equality Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x == y
Precondition
x.dim() == y.dim()

Definition at line 483 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator> ( const self x,
const self y 
)
friend

MoreThan Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x > y
Precondition
x.dim() == y.dim()

Definition at line 526 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
bool operator>= ( const self x,
const self y 
)
friend

MoreThan Compare operator.

Parameters
xfirst block4d to compare
ysecond block4d to compare return true if x >= y
Precondition
x.dim() == y.dim()

Definition at line 554 of file Block4d.hpp.

Member Data Documentation

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
slip::block3d<T,NP,NR,NC> slip::block4d< T, NS, NP, NR, NC >::data[NS]

Definition at line 370 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const std::size_t slip::block4d< T, NS, NP, NR, NC >::DIM = 4
static

Definition at line 163 of file Block4d.hpp.

template<typename T, std::size_t NS, std::size_t NP, std::size_t NR, std::size_t NC>
const std::size_t slip::block4d< T, NS, NP, NR, NC >::SIZE = NS * NP * NR * NC
static

Definition at line 162 of file Block4d.hpp.


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