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::block3d< T, NP, NR, NC > Class Template Reference

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

#include <Block3d.hpp>

Public Types

typedef T value_type
 
typedef value_typepointer
 
typedef const value_typeconst_pointer
 
typedef value_typereference
 
typedef const value_typeconst_reference
 
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_iterator3d_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 block3d filled it with val value. More...
 
void fill (const T *val)
 Init the block3d filled it with values contained by val array. More...
 
std::string name () const
 Returns the name of the class. More...
 
void swap (block3d< T, NP, NR, NC > &M)
 Swaps the contents of two block3d. More...
 

Static Public Member Functions

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

Public Attributes

slip::block2d< T, NR, NC > data [NP]
 Prints the elements of the block3d on the standard output. More...
 

Static Public Attributes

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

Friends

class boost::serialization::access
 

Operators

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

Detailed Description

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

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

Author
Julien Dombre <dombre_AT_sic.univ-poitiers.fr>
Version
0.0.1
Date
08/08/2006
Since
1.0.0
Parameters
TType of object in the block3d
NPnumber of plan of the block3d
NRnumber of row of the block3d
NCnumber of column of the block3d
Todo:
add iterator member functions to be compliant with other 3d slip interfaces.

Definition at line 96 of file Block3d.hpp.

Member Typedef Documentation

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

Definition at line 151 of file Block3d.hpp.

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

Definition at line 143 of file Block3d.hpp.

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

Definition at line 145 of file Block3d.hpp.

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

Definition at line 154 of file Block3d.hpp.

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

Definition at line 147 of file Block3d.hpp.

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

Definition at line 150 of file Block3d.hpp.

template<typename T, std::size_t NP, std::size_t NR, std::size_t NC>
typedef std::random_access_iterator3d_tag slip::block3d< T, NP, NR, NC >::iterator_category

Definition at line 157 of file Block3d.hpp.

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

Definition at line 142 of file Block3d.hpp.

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

Definition at line 144 of file Block3d.hpp.

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

Definition at line 153 of file Block3d.hpp.

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

Definition at line 148 of file Block3d.hpp.

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

Definition at line 141 of file Block3d.hpp.

Member Function Documentation

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

Definition at line 385 of file Block3d.hpp.

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

Definition at line 399 of file Block3d.hpp.

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

Returns the dimension of the block3d.

Definition at line 338 of file Block3d.hpp.

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

Returns the first dimension of the block3d (number of plans)

Definition at line 340 of file Block3d.hpp.

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

Returns the second dimension of the block3d (number of rows)

Definition at line 342 of file Block3d.hpp.

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

Returns the third dimension of the block3d (number of columns)

Definition at line 344 of file Block3d.hpp.

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

Returns true if the block3d size is 0.

Definition at line 350 of file Block3d.hpp.

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

Definition at line 392 of file Block3d.hpp.

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

Definition at line 406 of file Block3d.hpp.

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

Init the block3d filled it with val value.

Parameters
valinit value

Definition at line 603 of file Block3d.hpp.

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

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

Parameters
valinit array value

Definition at line 613 of file Block3d.hpp.

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

Returns the name of the class.

Definition at line 335 of file Block3d.hpp.

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

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

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

Definition at line 558 of file Block3d.hpp.

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

Returns a reference to the element at the i'th plan, the j'th row.

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

Definition at line 568 of file Block3d.hpp.

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

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

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

Definition at line 579 of file Block3d.hpp.

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

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

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

Definition at line 591 of file Block3d.hpp.

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

Returns a pointer to the i'th plan of the block3d.

Parameters
iindex of the plan to return
Returns
the pointer of the block2d of the i'th plan of the block3d.
Precondition
i < NP

Definition at line 442 of file Block3d.hpp.

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

Returns a const pointer to the i'th plan of the block3d.

Parameters
iindex of the plan to return
Returns
const the pointer of the block2d of the i'th plan of the block3d.
Precondition
i < NP

Definition at line 450 of file Block3d.hpp.

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

Definition at line 414 of file Block3d.hpp.

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

Definition at line 428 of file Block3d.hpp.

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

Definition at line 421 of file Block3d.hpp.

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

Definition at line 435 of file Block3d.hpp.

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

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

Definition at line 346 of file Block3d.hpp.

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

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

Definition at line 348 of file Block3d.hpp.

template<typename T , std::size_t NP, std::size_t NR, std::size_t NC>
void slip::block3d< T, NP, NR, NC >::swap ( block3d< T, NP, NR, NC > &  M)
inline

Swaps the contents of two block3d.

Parameters
Mblock3d to swap with

Definition at line 623 of file Block3d.hpp.

Friends And Related Function Documentation

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

Definition at line 365 of file Block3d.hpp.

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

Equality Compare operator.

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

Definition at line 488 of file Block3d.hpp.

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

LessThan Compare operator.

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

Definition at line 503 of file Block3d.hpp.

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

Write the block2d to ab ouput stream.

Parameters
outoutput stream
bblock3d to write to an output stream

Definition at line 459 of file Block3d.hpp.

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

LessThan Compare operator.

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

Definition at line 531 of file Block3d.hpp.

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

Equality Compare operator.

Parameters
xfirst block3d to copare
ysecond block3d to copare return true if x == y
Precondition
x.dim() == y.dim()

Definition at line 474 of file Block3d.hpp.

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

MoreThan Compare operator.

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

Definition at line 517 of file Block3d.hpp.

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

MoreThan Compare operator.

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

Definition at line 545 of file Block3d.hpp.

Member Data Documentation

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

Prints the elements of the block3d on the standard output.

Definition at line 361 of file Block3d.hpp.

template<typename T, std::size_t NP, std::size_t NR, std::size_t NC>
const std::size_t slip::block3d< T, NP, NR, NC >::DIM = 3
static

Definition at line 161 of file Block3d.hpp.

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

Definition at line 160 of file Block3d.hpp.


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