#include <Vector.hpp>


Public Types | |
| typedef T | ValueType |
| T ValueType Used to be able to access to T using typename. | |
Public Member Functions | |
| 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) |
| const Vector< T > & | operator= (const T &t) |
operator= overloading. Initializes every element to the value t. | |
| const Vector< T > & | operator= (const Vector< T > &V) |
operator= overloading. Copies the vector V. | |
| Vector< T > | operator* (const T &t) const |
| 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. | |
| real_t | operator* (const Vector< T > &V) const |
operator* overloading. Scalar product. | |
| Vector () | |
| Default constructor initializes a dimension 0 vector. | |
| Vector (size_t size) | |
| Vector (const Vector< T > &V) | |
| Copy constructor. | |
| ~Vector () | |
| Destructor. | |
Protected Attributes | |
| size_t | __size |
| The number of elements of the vector. | |
| T *__restrict | __values |
| The elements of the vector. | |
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 46 of file Vector.hpp.
T ValueType Used to be able to access to T using typename.
Definition at line 51 of file Vector.hpp.
Default constructor initializes a dimension 0 vector.
Definition at line 279 of file Vector.hpp.
00280 : __size(0) 00281 { 00282 ; 00283 }
| const size_t& Vector< T >::size | ( | ) | const [inline] |
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] |
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] |
| T& Vector< T >::operator[] | ( | const size_t & | i | ) | [inline] |
| const T& Vector< T >::operator() | ( | const size_t & | i | ) | const [inline] |
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] |
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] |
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. Initializes every element to the value t.
Reimplemented in Structured3DVector< T >, and Structured3DVector< bool >.
Definition at line 137 of file Vector.hpp.
Referenced by Structured3DVector< bool >::operator=().
operator= overloading. Copies the vector V.
Reimplemented in Structured3DVector< T >, and Structured3DVector< bool >.
Definition at line 145 of file Vector.hpp.
00146 { 00147 ASSERT (__size == V.__size); 00148 ZoneCopy(__values, V.__values, __size); 00149 00150 return (*this); 00151 }
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] |
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 }
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] |
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] |
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.
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