Array3DShape Class Reference

#include <Array3DShape.hpp>

Collaboration diagram for Array3DShape:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool operator== (const Array3DShape &s) const
size_t operator() (const size_t &i, const size_t &j, const size_t &k) const
size_t operator() (const TinyVector< 3, size_t > &index) const
const size_t & nx () const
 Access to the first component of the shape.
const size_t & ny () const
 Access to the second component of the shape.
const size_t & nz () const
 Access to the third component of the shape.
const size_t & operator[] (const size_t &i) const
size_t size () const
 Returns the product of shape components (ie: the number of elements when tensorized).
Array3DShape operator- (size_t i) const
Array3DShapeoperator= (const Array3DShape &s)
 Array3DShape (const size_t &i, const size_t &j, const size_t &k)
 Constructs a Array3DShape.
 Array3DShape (const TinyVector< 3, size_t > &shape)
 Array3DShape (const Array3DShape &s)
 Copy constructor.
 Array3DShape ()
 Default Constructor.
 ~Array3DShape ()

Private Attributes

TinyVector< 3, size_t > __shape
 The shape.

Friends

std::ostream & operator<< (std::ostream &os, const Array3DShape &a)


Detailed Description

This class defines the shape of a 3d structure (mesh, vector, ...)

Author:
Stéphane Del Pino.

Definition at line 35 of file Array3DShape.hpp.


Constructor & Destructor Documentation

Array3DShape::Array3DShape ( const size_t &  i,
const size_t &  j,
const size_t &  k 
) [inline]

Constructs a Array3DShape.

Definition at line 117 of file Array3DShape.hpp.

References __shape.

00120   {
00121     __shape[0]=i;
00122     __shape[1]=j;
00123     __shape[2]=k;
00124   }

Array3DShape::Array3DShape ( const TinyVector< 3, size_t > &  shape  )  [inline]

Constructs an Array3DShape by a TinyVector

Parameters:
shape given shape

Definition at line 131 of file Array3DShape.hpp.

00132     : __shape(shape)
00133   {
00134     ;
00135   }

Array3DShape::Array3DShape ( const Array3DShape s  )  [inline]

Copy constructor.

Definition at line 138 of file Array3DShape.hpp.

00139     : __shape(s.__shape)
00140   {
00141     ;
00142   }

Array3DShape::Array3DShape (  )  [inline]

Default Constructor.

Definition at line 145 of file Array3DShape.hpp.

Referenced by operator-().

00146   {
00147     ;
00148   }

Array3DShape::~Array3DShape (  )  [inline]

Definition at line 150 of file Array3DShape.hpp.

00151   {
00152     ;
00153   }


Member Function Documentation

bool Array3DShape::operator== ( const Array3DShape s  )  const [inline]

Definition at line 48 of file Array3DShape.hpp.

References __shape.

00049   {
00050     return (__shape==s.__shape);
00051   }

size_t Array3DShape::operator() ( const size_t &  i,
const size_t &  j,
const size_t &  k 
) const [inline]

Returns the global number associated to the (i,j,k) representation

Definition at line 55 of file Array3DShape.hpp.

References __shape.

00058   {
00059     return (i*__shape[1]*__shape[2] + j*__shape[2] + k);
00060   }

size_t Array3DShape::operator() ( const TinyVector< 3, size_t > &  index  )  const [inline]

Definition at line 62 of file Array3DShape.hpp.

00063   {
00064     return (*this)(index[0],index[1],index[2]);
00065   }

const size_t& Array3DShape::nx (  )  const [inline]

const size_t& Array3DShape::ny (  )  const [inline]

const size_t& Array3DShape::nz (  )  const [inline]

const size_t& Array3DShape::operator[] ( const size_t &  i  )  const [inline]

Definition at line 86 of file Array3DShape.hpp.

References __shape, and ASSERT.

00087   {
00088     ASSERT(i<3);
00089     return __shape[i];
00090   }

size_t Array3DShape::size (  )  const [inline]

Returns the product of shape components (ie: the number of elements when tensorized).

Definition at line 93 of file Array3DShape.hpp.

References __shape.

Referenced by Structured3DVector< bool >::resize().

00094   {
00095     return __shape[0]*__shape[1]*__shape[2];
00096   }

Array3DShape Array3DShape::operator- ( size_t  i  )  const [inline]

Computes the Array3DShape of an object for which 1 element is removed in each direction. Example:

Definition at line 101 of file Array3DShape.hpp.

References __shape, Array3DShape(), and ASSERT.

00102   {
00103     ASSERT ((i<__shape[0])&&(i<__shape[1])&&(i<__shape[2]));
00104     return Array3DShape(__shape[0]-i, __shape[1]-i, __shape[2]-i);
00105   }

Here is the call graph for this function:

Array3DShape& Array3DShape::operator= ( const Array3DShape s  )  [inline]

Computes the Array3DShape of an object for which 1 element is removed in each direction. Example:

Definition at line 110 of file Array3DShape.hpp.

References __shape.

00111   {
00112     __shape = s.__shape;
00113     return *this;
00114   }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Array3DShape a 
) [friend]

Definition at line 42 of file Array3DShape.hpp.

00043   {
00044     os << a.__shape;
00045     return os;
00046   }


Member Data Documentation

TinyVector<3,size_t> Array3DShape::__shape [private]

The shape.

Definition at line 39 of file Array3DShape.hpp.

Referenced by Array3DShape(), nx(), ny(), nz(), operator()(), operator-(), operator=(), operator==(), operator[](), and size().


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

Generated on Wed Nov 19 00:04:01 2008 for FreeFEM3D (aka ff3d) by  doxygen 1.5.6