LifeV
|
VectorContainer - LifeV vector composed by concatenating other vectors. More...
#include <VectorContainer.hpp>
Private Attributes | |
container_Type | M_container |
Constructors & Destructor | |
typedef VectorType | vector_Type |
typedef std::shared_ptr< vector_Type > | vectorPtr_Type |
typedef ContainerType | container_Type |
typedef container_Type::iterator | iterator_Type |
typedef container_Type::const_iterator | constIterator_Type |
VectorContainer () | |
Constructor. More... | |
VectorContainer (const VectorContainer &vectorContainer) | |
Copy constructor. More... | |
virtual | ~VectorContainer () |
Destructor. More... | |
Methods | |
Real | dot (const VectorContainer< vector_Type, container_Type > &vectorContainer) const |
Dot - Scalar product. More... | |
void | dot (const VectorContainer< vector_Type, container_Type > &vectorContainer, Real &scalarProduct) |
Dot - Scalar product. More... | |
void | abs () |
Abs. More... | |
void | abs (VectorContainer< vector_Type, container_Type > &vectorContainer) |
Real | weightNorm2 () |
Norm2. More... | |
VectorContainer & | push_back (const VectorContainer< vector_Type, container_Type > &vectorContainer) |
push_back More... | |
VectorContainer & | push_back (const vectorPtr_Type &vector_ptr) |
push_back More... | |
VectorContainer & | push_front (const VectorContainer< vector_Type, container_Type > &vectorContainer) |
push_front More... | |
VectorContainer & | push_front (const vectorPtr_Type &vector_ptr) |
push_front More... | |
void | replace (const vectorPtr_Type &vector_ptr, const UInt &id) |
Replace. More... | |
void | resize (const UInt &size) |
resize More... | |
void | clear () |
Clear. More... | |
void | showMe (std::ostream &output=std::cout) const |
ShowMe. More... | |
Get Methods | |
UInt | size () const |
Get the number of elements contained inside the VectorContainer object. More... | |
UInt | vectorsNumber () const |
Get the number of vectors contained inside the VectorContainer object. More... | |
VectorContainer - LifeV vector composed by concatenating other vectors.
The VectorContainer
class has the purpose to concatenate a certain number of different vectors providing also some general methods to perform common algebraic operations.
Type of compatible vectors
This class has been developed in order to work with:
VectorEpetra
boost::numeric::ublas::vector
Type of compatible containers
This class has been developed in order to work with:
std::vector
std::dequee
std::list
NOTES
VectorContainer
contains shared_ptr
to vectors: if you perform an operation (such as the element by element multiplication) among two containers which hold the same vectors (or at least one), the results can be different from what expected! VectorEpetra
. However the design should be more or less compatible also with boost::numeric::ublas::vector
. Definition at line 84 of file VectorContainer.hpp.
typedef VectorType vector_Type |
Definition at line 91 of file VectorContainer.hpp.
typedef std::shared_ptr< vector_Type > vectorPtr_Type |
Definition at line 92 of file VectorContainer.hpp.
typedef ContainerType container_Type |
Definition at line 93 of file VectorContainer.hpp.
typedef container_Type::iterator iterator_Type |
Definition at line 94 of file VectorContainer.hpp.
typedef container_Type::const_iterator constIterator_Type |
Definition at line 95 of file VectorContainer.hpp.
VectorContainer | ( | ) |
Constructor.
Definition at line 452 of file VectorContainer.hpp.
VectorContainer | ( | const VectorContainer< VectorType, ContainerType > & | vectorContainer | ) |
Copy constructor.
Makes a copy of all the objects contained in the shared_ptr(s).
VectorContainer | - VectorContainer |
Definition at line 463 of file VectorContainer.hpp.
|
inlinevirtual |
Destructor.
Definition at line 114 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator=.
Make a true copy of all the objects contained in the shared_ptr(s)
vectorContainer | - VectorContainer |
Definition at line 479 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator= | ( | const Real & | scalar | ) |
Operator=.
Set all the components of the vector equal to a scalar quantity. Cannot be done for an empty vector!
scalar | - Scalar value |
Definition at line 502 of file VectorContainer.hpp.
VectorContainer& operator&= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator&=.
Make a copy of the shared_ptr(s), without duplicates the objects contained in them.
vectorContainer | - VectorContainer |
Operator[].
The element access operator (by reference) has been implemented just for debugging or other special cases, because it is not efficient with this type of implementation.
id | - Element id |
Definition at line 536 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType >::vectorPtr_Type & operator() | ( | const UInt & | id | ) |
Operator()
Vector access operator (by shared_ptr).
id | - Vector id |
Definition at line 562 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator+= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator+=.
vectorContainer | - VectorContainer |
Definition at line 574 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator-= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator-=.
vectorContainer | - VectorContainer |
Definition at line 591 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator*= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator*=.
Multiplication element by element of two vectors.
vectorContainer | - VectorContainer |
Definition at line 608 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator/= | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Operator/=.
Division element by element of two vectors.
vectorContainer | - VectorContainer |
Definition at line 625 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator+ | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) | const |
Operator+.
vectorContainer | - VectorContainer |
Definition at line 642 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator- | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) | const |
Operator-.
vectorContainer | - VectorContainer |
Definition at line 658 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator* | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) | const |
Operator*.
Multiplication element by element of two vectors.
vectorContainer | - VectorContainer |
Definition at line 674 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator/ | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) | const |
Operator/.
Division element by element of two vectors.
vectorContainer | - VectorContainer |
Definition at line 690 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator+= | ( | const Real & | scalar | ) |
Operator+=.
Multiplication of the vector by a scalar.
scalar | - Scalar value |
Definition at line 706 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator-= | ( | const Real & | scalar | ) |
Operator-=.
Division of the vector by a scalar.
scalar | - Scalar value |
Definition at line 723 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator*= | ( | const Real & | scalar | ) |
Operator*=.
Multiplication of the vector by a scalar.
scalar | - Scalar value |
Definition at line 740 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & operator/= | ( | const Real & | scalar | ) |
Operator/=.
Division of the vector by a scalar.
scalar | - Scalar value |
Definition at line 757 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator+ | ( | const Real & | scalar | ) | const |
Operator*=.
Multiplication of the vector by a scalar.
scalar | - Scalar value |
Definition at line 771 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator- | ( | const Real & | scalar | ) | const |
Operator/=.
Division of the vector by a scalar.
scalar | - Scalar value |
Definition at line 787 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator* | ( | const Real & | scalar | ) | const |
Operator*=.
Multiplication of the vector by a scalar.
scalar | - Scalar value |
Definition at line 803 of file VectorContainer.hpp.
const VectorContainer< VectorType, ContainerType > operator/ | ( | const Real & | scalar | ) | const |
Operator/=.
Division of the vector by a scalar.
scalar | - Scalar value |
Definition at line 819 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator== | ( | const Real & | scalar | ) |
operator==
Return a VectorContainer containing 1 where vector elements are == scalar;
scalar | - Value for the comparison. |
Definition at line 851 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator!= | ( | const Real & | scalar | ) |
operator!=
Return a VectorContainer containing 1 where vector elements are != scalar;
scalar | - Value for the comparison. |
Definition at line 872 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator< | ( | const Real & | scalar | ) |
operator<
Return a VectorContainer containing 1 where vector elements are < scalar;
scalar | - Value for the comparison. |
Definition at line 914 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator> | ( | const Real & | scalar | ) |
operator>
Return a VectorContainer containing 1 where vector elements are > scalar;
scalar | - Value for the comparison. |
Definition at line 893 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator<= | ( | const Real & | scalar | ) |
operator<=
Return a VectorContainer containing 1 where vector elements are <= scalar;
scalar | - Value for the comparison. |
Definition at line 956 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator>= | ( | const Real & | scalar | ) |
operator>=
Return a VectorContainer containing 1 where vector elements are >= scalar;
scalar | - Value for the comparison. |
Definition at line 935 of file VectorContainer.hpp.
VectorContainer operator&& | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Logic operator&&.
Return a vector containing one where both the elements are different from zero;
vectorContainer | - VectorContainer |
VectorContainer< VectorType, ContainerType > operator|| | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Logic operator||.
Return a vector containing one if one of the two elements is different from zero;
vectorContainer | - VectorContainer |
Definition at line 999 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > operator! | ( | ) |
Logic operator!
Return a vector containing one where the elements are equal to zero;
Definition at line 1021 of file VectorContainer.hpp.
Real dot | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) | const |
Dot - Scalar product.
Scalar product of the vectors
vectorContainer | - VectorContainer |
Definition at line 1046 of file VectorContainer.hpp.
void dot | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer, |
Real & | scalarProduct | ||
) |
Dot - Scalar product.
Scalar product of the vectors
vectorContainer | - VectorContainer |
scalarProduct | - result |
Definition at line 1065 of file VectorContainer.hpp.
void abs | ( | ) |
Abs.
Replace all the elements in the vectorContainer with their abs.
Definition at line 1080 of file VectorContainer.hpp.
void abs | ( | VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
Compute the abs of the VectorContainer and return it in a new container.
vectorContainer | - The output vectorContainer containing the abs of the vector. |
Definition at line 1095 of file VectorContainer.hpp.
Real weightNorm2 | ( | ) |
VectorContainer< VectorType, ContainerType > & push_back | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
push_back
Concatenate a VectorContainer to another
vectorContainer | - VectorContainer |
Definition at line 1130 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & push_back | ( | const vectorPtr_Type & | vector_ptr | ) |
push_back
Add a vector at the end of the VectorContainer
vector_ptr | - Shared pointer to a vector |
Definition at line 1147 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & push_front | ( | const VectorContainer< vector_Type, container_Type > & | vectorContainer | ) |
push_front
Concatenate a VectorContainer to another inserting it at the beginning
vectorContainer | - VectorContainer |
Definition at line 1161 of file VectorContainer.hpp.
VectorContainer< VectorType, ContainerType > & push_front | ( | const vectorPtr_Type & | vector_ptr | ) |
push_front
Add a vector at the begin of the VectorContainer
vector_ptr | - Shared pointer to a vector |
Definition at line 1178 of file VectorContainer.hpp.
|
inline |
Replace.
vector_ptr | - Shared pointer to the new vector |
id | - id of the vector that has to be replaced |
Definition at line 403 of file VectorContainer.hpp.
|
inline |
resize
size | - New size of the container |
Definition at line 412 of file VectorContainer.hpp.
|
inline |
Clear.
Definition at line 418 of file VectorContainer.hpp.
void showMe | ( | std::ostream & | output = std::cout | ) | const |
ShowMe.
Definition at line 1192 of file VectorContainer.hpp.
UInt size | ( | ) | const |
Get the number of elements contained inside the VectorContainer object.
Definition at line 1217 of file VectorContainer.hpp.
|
inline |
Get the number of vectors contained inside the VectorContainer object.
Definition at line 436 of file VectorContainer.hpp.
|
private |
Definition at line 445 of file VectorContainer.hpp.