#include <Structured3DVector.hpp>


Public Types | |
| typedef T | ValueType |
| T ValueType Used to be able to access to T using typename. | |
Public Member Functions | |
| size_t | nx () const |
| size_t | ny () const |
| size_t | nz () const |
| const Array3DShape & | shape () const |
| const T & | operator() (const size_t &i, const size_t &j, const size_t &k) const |
| T & | operator() (const size_t &i, const size_t &j, const size_t &k) |
| Structured3DVector< T > & | operator= (const T &t) |
| Structured3DVector< T > & | operator= (const Structured3DVector< T > &v) |
| const Structured3DVector< T > & | operator= (const Vector< T > &v) |
| void | resize (const Array3DShape &shape) |
| Structured3DVector (const size_t &nx, const size_t &ny, const size_t &nz) | |
| Structured3DVector (const Array3DShape &shape) | |
| Structured3DVector (const Structured3DVector &v) | |
| ~Structured3DVector () | |
| const size_t & | size () const |
| Read-only access to the size of the vector. | |
| size_t | number (T const &e) const |
| Finds the number of an element of the vector. | |
| const T & | operator[] (const size_t &i) const |
| Read-only access to the ith __values of the vector. | |
| T & | operator[] (const size_t &i) |
| Access to the ith element of the vector. | |
| const T & | operator() (const size_t &i) const |
| T & | operator() (const size_t &i) |
| void | resize (const size_t &newSize) |
| Vector< T > | operator* (const T &t) const |
| real_t | operator* (const Vector< T > &V) const |
operator* overloading. Scalar product. | |
| template<class T2> | |
| const Vector< T > & | operator*= (const T2 &t) |
operator*= overloading. The vector is multiplied by t. | |
| Vector< T > | operator+ (const Vector< T > &V) const |
| Vector< T > | operator- (const Vector< T > &V) const |
| const Vector< T > & | operator+= (const Vector< T > &V) |
operator+= overloading. Addes V to the vector. | |
| const Vector< T > & | operator+= (const T &t) |
operator+= overloading. Addes V to the vector. | |
| const Vector< T > & | operator-= (const Vector< T > &V) |
operator-= overloading. Substractes V to the vector. | |
Protected Attributes | |
| size_t | __size |
| The number of elements of the vector. | |
| T *__restrict | __values |
| The elements of the vector. | |
Private Member Functions | |
| void | __buildView () |
| void | __clean () |
Private Attributes | |
| T *** | __structured3dView |
| allows access to the data using the structured organization. | |
| Array3DShape | __shape |
| The vector shape. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const Vector< T > &V) |
| writes a vector in a stream. | |
| Vector< T > | operator* (const T &t, const Vector< T > &V) |
| real_t | Norm (const Vector< T > &v) |
Definition at line 37 of file Structured3DVector.hpp.
T ValueType Used to be able to access to T using typename.
Definition at line 51 of file Vector.hpp.
| Structured3DVector< T >::Structured3DVector | ( | const size_t & | nx, | |
| const size_t & | ny, | |||
| const size_t & | nz | |||
| ) | [inline] |
| Structured3DVector< T >::Structured3DVector | ( | const Array3DShape & | shape | ) | [inline] |
Constructor
| shape | given shape of the Structured3DVector |
Definition at line 210 of file Structured3DVector.hpp.
00211 : Vector<T>(shape.size()), 00212 __shape(shape) 00213 { 00214 this->__buildView(); 00215 }
| Structured3DVector< T >::Structured3DVector | ( | const Structured3DVector< T > & | v | ) | [inline] |
Copy constructor
| v | given Structured3DVector |
Definition at line 222 of file Structured3DVector.hpp.
00223 : Vector<T>(v), 00224 __shape(v.__shape) 00225 { 00226 this->__buildView(); 00227 }
| Structured3DVector< T >::~Structured3DVector | ( | ) | [inline] |
Destructor
Definition at line 233 of file Structured3DVector.hpp.
00234 { 00235 this->__clean(); 00236 }
| void Structured3DVector< T >::__buildView | ( | ) | [inline, private] |
Constructs the structured view
Definition at line 51 of file Structured3DVector.hpp.
Referenced by Structured3DVector< bool >::resize(), and Structured3DVector< bool >::Structured3DVector().
00052 { 00053 __structured3dView = new T**[__shape.nx()]; 00054 for (size_t i=0; i < __shape.nx(); ++i) { 00055 __structured3dView[i] = new T* [__shape.ny()]; 00056 for (size_t j=0; j < __shape.ny(); ++j) { 00057 __structured3dView[i][j] 00058 = &Vector<T>::__values[i*__shape.ny()*__shape.nz() + j*__shape.nz()]; 00059 } 00060 } 00061 }
| void Structured3DVector< T >::__clean | ( | ) | [inline, private] |
Cleans structured view
Definition at line 67 of file Structured3DVector.hpp.
Referenced by Structured3DVector< bool >::resize(), and Structured3DVector< bool >::~Structured3DVector().
00068 { 00069 for (size_t i=0; i<__shape.nx(); ++i) 00070 delete[] __structured3dView[i]; 00071 delete [] __structured3dView; 00072 }
| size_t Structured3DVector< T >::nx | ( | ) | const [inline] |
Number of values in direction x
Definition at line 80 of file Structured3DVector.hpp.
Referenced by MultiGrid::computeResidu(), MultiGrid::correct(), MultiGrid::FMV(), MultiGrid::multigrid(), MultiGrid::MultiGrid(), and MultiGrid::project().
| size_t Structured3DVector< T >::ny | ( | ) | const [inline] |
Number of values in direction y
Definition at line 90 of file Structured3DVector.hpp.
Referenced by MultiGrid::computeResidu(), MultiGrid::correct(), MultiGrid::FMV(), MultiGrid::multigrid(), MultiGrid::MultiGrid(), and MultiGrid::project().
| size_t Structured3DVector< T >::nz | ( | ) | const [inline] |
Number of values in direction z
Definition at line 100 of file Structured3DVector.hpp.
Referenced by MultiGrid::computeResidu(), MultiGrid::correct(), MultiGrid::FMV(), MultiGrid::multigrid(), MultiGrid::MultiGrid(), and MultiGrid::project().
| const Array3DShape& Structured3DVector< T >::shape | ( | ) | const [inline] |
Read only access to the shape of the array
Definition at line 110 of file Structured3DVector.hpp.
Referenced by MultiGrid::computeResidu(), MultiGrid::computes(), MultiGrid::FMV(), MultiGrid::multigrid(), MultiGrid::MultiGrid(), and MultiGrid::weightJacobi().
00111 { 00112 return __shape; 00113 }
| const T& Structured3DVector< T >::operator() | ( | const size_t & | i, | |
| const size_t & | j, | |||
| const size_t & | k | |||
| ) | const [inline] |
Read-only access to the
element of the vector
Definition at line 120 of file Structured3DVector.hpp.
00121 { 00122 ASSERT ((i<__shape.nx()) and (j<__shape.ny()) and (k<__shape.nz())); 00123 return __structured3dView[i][j][k]; 00124 }
| T& Structured3DVector< T >::operator() | ( | const size_t & | i, | |
| const size_t & | j, | |||
| const size_t & | k | |||
| ) | [inline] |
Access to the
element of the vector
Definition at line 131 of file Structured3DVector.hpp.
00132 { 00133 ASSERT ((i<__shape.nx()) and (j<__shape.ny()) and (k<__shape.nz())); 00134 return __structured3dView[i][j][k]; 00135 }
| Structured3DVector<T>& Structured3DVector< T >::operator= | ( | const T & | t | ) | [inline] |
Sets all values of the array to the value t
| t | given value |
Reimplemented from Vector< T >.
Definition at line 144 of file Structured3DVector.hpp.
00145 { 00146 this->Vector<T>::operator=(t); 00147 return *this; 00148 }
| Structured3DVector<T>& Structured3DVector< T >::operator= | ( | const Structured3DVector< T > & | v | ) | [inline] |
Copies a structured 3d vector
| v | given vector |
Definition at line 157 of file Structured3DVector.hpp.
00158 { 00159 ASSERT (__shape==v.__shape); 00160 this->Vector<T>::operator=(v); 00161 return *this; 00162 }
| const Structured3DVector<T>& Structured3DVector< T >::operator= | ( | const Vector< T > & | v | ) | [inline] |
Copies a vector
| v | given vector |
Reimplemented from Vector< T >.
Definition at line 171 of file Structured3DVector.hpp.
00172 { 00173 ASSERT (this->size() == v.size()); 00174 this->Vector<T>::operator=(v); 00175 return *this; 00176 }
| void Structured3DVector< T >::resize | ( | const Array3DShape & | shape | ) | [inline] |
Resizes the vector to a new shape
| shape | given new shape |
Definition at line 183 of file Structured3DVector.hpp.
Referenced by MultiGrid::MultiGrid().
00184 { 00185 this->__clean(); 00186 __shape = shape; 00187 this->Vector<T>::resize(shape.size()); 00188 this->__buildView(); 00189 }
| const size_t& Vector< T >::size | ( | ) | const [inline, inherited] |
Read-only access to the size of the vector.
Definition at line 61 of file Vector.hpp.
Referenced by DegreeOfFreedomSetBuilder::__buildCorrespondance(), SurfaceMesh::__computesFictitiousCells(), SurfaceMeshGenerator::Internals::__constructionFinalMesh(), SurfaceMeshGenerator::Internals::__constructionVerticesList(), WriterVTK::__fillCrossedComponent(), WriterMedit::__fillCrossedComponent(), ScalarFunctionBuilder::Simplifier::__getOperatorF1F2SimplifiedFunction(), SpectralFEMPreconditioner::Internal::__legendreToLagrange(), SpectralFEMPreconditioner::Internal::__legendreToLagrangeTransposed(), WriterMedit::__proceedData(), MeshFormatReader::__readHexahedra(), MeshFormatReader::__readQuadrilaterals(), MeshFormatReader::__readTetrahedra(), MeshReaderAM_FMTFormat::__readTriangles(), MeshFormatReader::__readTriangles(), MeshReaderAM_FMTFormat::__readTrianglesReferences(), OctreeMeshBuilder::buildMesh(), SpectralFEMPreconditioner::Internal::computes(), MultiGrid::computes(), IncompleteCholeskiFactorization::computes(), DiagPrecond::computes(), SpectralFEMPreconditioner::Internal::computesTransposed(), MultiGrid::copyDirichlet(), LagrangeBasis::degree(), DGFunction< MeshType, FiniteElementTraits >::DGFunction(), LagrangeBasis::dimension(), FEMFunction< MeshType, FiniteElementTraits >::FEMFunction(), FGMRES::FGMRES(), LegendreBasis::getDerivativeValues(), ScalarFunctionReaderVTK::getFunction(), LegendreBasis::getSecondDerivativeValues(), LegendreBasis::getValues(), LagrangeBasis::getValues(), GMRES::GMRES(), invertEndianess(), LagrangeBasis::LagrangeBasis(), ScalarDegreeOfFreedomPositionsSet::number(), Structured3DMesh::numberOfCells(), SpectralMesh::numberOfCells(), EdgesSet::numberOfEdges(), FacesSet< Triangle >::numberOfFaces(), GaussLobatto::numberOfPoints(), VerticesSet::numberOfVertices(), MultiGrid::DirichletPositions::operator()(), Structured3DVector< bool >::operator=(), FEMFunctionBase::operator=(), FEMFunction< MeshType, FiniteElementTraits >::operator=(), DGFunctionBase::operator=(), DGFunction< MeshType, FiniteElementTraits >::operator=(), MultiGrid::residuDirichlet(), ScalarFunctionBuilder::setUnaryMinus(), MultiGrid::DirichletPositions::size(), SpectralFunction::SpectralFunction(), SparseMatrix::transposedTimesX(), and MultiGrid::weightJacobi().
00062 { 00063 return __size; 00064 }
| size_t Vector< T >::number | ( | T const & | e | ) | const [inline, inherited] |
Finds the number of an element of the vector.
Definition at line 67 of file Vector.hpp.
Referenced by DegreeOfFreedomSetBuilder::__buildFEMFictitious(), Structured3DMesh::cellNumber(), SpectralMesh::cellNumber(), DegreeOfFreedomSet::DegreeOfFreedomSet(), VerticesSet::number(), FacesSet< Triangle >::number(), and EdgesSet::number().
00068 { 00069 ASSERT ((&e >= __values)&&(static_cast<size_t>(&e-__values) < __size)); 00070 return (&e-__values); 00071 }
| const T& Vector< T >::operator[] | ( | const size_t & | i | ) | const [inline, inherited] |
| T& Vector< T >::operator[] | ( | const size_t & | i | ) | [inline, inherited] |
| const T& Vector< T >::operator() | ( | const size_t & | i | ) | const [inline, inherited] |
Read-only access to the ith element of the vector. Used to provide a Blitz-like interface.
Definition at line 100 of file Vector.hpp.
| T& Vector< T >::operator() | ( | const size_t & | i | ) | [inline, inherited] |
Access to the ith element of the vector. Used to provide a Blitz-like interface.
Definition at line 110 of file Vector.hpp.
| void Vector< T >::resize | ( | const size_t & | newSize | ) | [inline, inherited] |
This function is to resize the vector. Used to provide a Blitz-like interface, the elements are lost if the size is changed.
Definition at line 121 of file Vector.hpp.
Referenced by ScalarDegreeOfFreedomPositionsSet::Builder::__buildFEM(), FictitiousDomainMethod::__computesDegreesOfFreedom(), SpectralLegendreDiscretizer::assembleSecondMember(), SparseMatrix::copyProfile(), FGMRES::FGMRES(), SpectralLegendreDiscretizer::getDiagonal(), BoundaryConditionDiscretizationSpectralConform::getDiagonal(), ScalarFunctionReaderVTK::getFunction(), SpectralLegendreDiscretizer::getMultiDiagonal(), GMRES::GMRES(), Structured3DVector< bool >::resize(), EdgesSet::setNumberOfEdges(), FacesSet< Triangle >::setNumberOfFaces(), VerticesSet::setNumberOfVertices(), BoundaryConditionDiscretizationSpectralConform::setSecondMember(), SpectralLegendreDiscretizer::timesX(), BoundaryConditionDiscretizationSpectralConform::timesX(), SpectralLegendreDiscretizer::transposedTimesX(), and BoundaryConditionDiscretizationSpectralConform::transposedTimesX().
00122 { 00123 ASSERT (newSize>=0); 00124 00125 if (newSize != __size) { 00126 if (__size!=0) { // Destroy previous vector 00127 delete [] __values; 00128 } 00129 __size = newSize; 00130 __values = new ValueType[__size]; 00131 } else { 00132 ; // else do nothing 00133 } 00134 }
operator* overloading. Returns t * this.
Definition at line 158 of file Vector.hpp.
00159 { 00160 Vector<T> prod(*this); 00161 TermToTermProduct<T> tttp; 00162 for (size_t i=0; i<__size; ++i) 00163 prod.__values[i] = tttp(__values[i],t); 00164 return prod; 00165 }
| const Vector<T>& Vector< T >::operator*= | ( | const T2 & | t | ) | [inline, inherited] |
operator*= overloading. The vector is multiplied by t.
Definition at line 185 of file Vector.hpp.
00186 { 00187 TermToTermProduct<T> tttp; 00188 for (size_t i=0; i<__size; ++i) 00189 __values[i] = tttp(__values[i],t); 00190 return *this; 00191 }
| Vector<T> Vector< T >::operator- | ( | const Vector< T > & | V | ) | const [inline, inherited] |
operator- overloading. Computes difference with V.
Definition at line 210 of file Vector.hpp.
00211 { 00212 ASSERT(__size==V.__size); 00213 00214 Vector<T> W(__size); 00215 for (size_t i=0; i<__size; ++i) { 00216 W.__values[i] = __values[i] - V.__values[i]; 00217 } 00218 00219 return W; 00220 }
operator+= overloading. Addes V to the vector.
Definition at line 235 of file Vector.hpp.
00236 { 00237 for (size_t i=0; i<__size; ++i) 00238 __values[i] += t; 00239 00240 return *this; 00241 }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Vector< T > & | V | |||
| ) | [friend, inherited] |
writes a vector in a stream.
Definition at line 74 of file Vector.hpp.
00075 { 00076 for (size_t i=0; i<V.size(); ++i) { 00077 os << V[i] << '\n'; 00078 } 00079 return os; 00080 }
operator* overloading (friend version). Returns t * this.
Definition at line 172 of file Vector.hpp.
00173 { 00174 Vector<T> sum(V.__size); 00175 TermToTermProduct<T> tttp; 00176 for (size_t i=0; i<V.__size; ++i) 00177 sum.__values[i] = tttp(V.__values[i],t); 00178 00179 return sum; 00180 }
| real_t Norm | ( | const Vector< T > & | v | ) | [friend, inherited] |
Computes the « norm » of a given vector v. The result is a T! If T is of scalar type it returns the usual norm.
Definition at line 272 of file Vector.hpp.
T*** Structured3DVector< T >::__structured3dView [private] |
allows access to the data using the structured organization.
Definition at line 42 of file Structured3DVector.hpp.
Referenced by Structured3DVector< bool >::__buildView(), Structured3DVector< bool >::__clean(), and Structured3DVector< bool >::operator()().
Array3DShape Structured3DVector< T >::__shape [private] |
The vector shape.
Definition at line 45 of file Structured3DVector.hpp.
Referenced by Structured3DVector< bool >::__buildView(), Structured3DVector< bool >::__clean(), Structured3DVector< bool >::nx(), Structured3DVector< bool >::ny(), Structured3DVector< bool >::nz(), Structured3DVector< bool >::operator()(), Structured3DVector< bool >::operator=(), Structured3DVector< bool >::resize(), and Structured3DVector< bool >::shape().
The number of elements of the vector.
Definition at line 54 of file Vector.hpp.
Referenced by Vector< Tetrahedron >::number(), Vector< Tetrahedron >::operator()(), Vector< Tetrahedron >::operator*(), Vector< Tetrahedron >::operator*=(), Vector< Tetrahedron >::operator+(), Vector< Tetrahedron >::operator+=(), Vector< Tetrahedron >::operator-(), Vector< Tetrahedron >::operator-=(), Vector< Tetrahedron >::operator=(), Vector< Tetrahedron >::operator[](), Vector< Tetrahedron >::resize(), Vector< Tetrahedron >::size(), Vector< Tetrahedron >::Vector(), and Vector< Tetrahedron >::~Vector().
The elements of the vector.
Definition at line 57 of file Vector.hpp.
Referenced by Vector< Tetrahedron >::number(), Vector< Tetrahedron >::operator()(), Vector< Tetrahedron >::operator*(), Vector< Tetrahedron >::operator*=(), Vector< Tetrahedron >::operator+(), Vector< Tetrahedron >::operator+=(), Vector< Tetrahedron >::operator-(), Vector< Tetrahedron >::operator-=(), Vector< Tetrahedron >::operator=(), Vector< Tetrahedron >::operator[](), Vector< Tetrahedron >::resize(), Vector< Tetrahedron >::Vector(), and Vector< Tetrahedron >::~Vector().
1.5.6