A vector. More...
#include <vector.hh>


Public Member Functions | |
| virtual Function< F > & | add (const Function< F > &fnc, F sc) |
Adds a times fnc to this function. | |
| template<class H > | |
| Vector< F > & | add (const Vector< H > &fnc, F sc, uint offset=0) |
| Adds a vector of possible different length and type with an offset. | |
| template<class H > | |
| Vector< F > & | add (const Vector< H > &fnc) |
| Adds a vector of possible different length and type. | |
| Vector< F > & | apply (F fnc(const F &)) |
| Application operator to each component, e.g. | |
| template<class G > | |
| Vector< F > & | assemble (const Space< G > &spc, LinearForm< F, G > &lf) |
Assembles the vector w.r.t. linear form lf and space spc. | |
| F * | data () const |
| uint | dim () const |
| Returns the dimension of the function. | |
| Real | l1 () const |
| l1 norm | |
| Real | l2 () const |
| l2 norm | |
| Real | l2_2 () const |
| l2 norm squared | |
| Real | max () const |
Maximum of the absolute values in the vector, ie. norm. | |
| uint | n () const |
| Elements in the vector. | |
| operator F * () const | |
| Conversion operator. | |
| virtual F & | operator() (uint i) |
| Index operator. | |
| virtual F | operator() (uint i) const |
| Index operator. | |
| Vector< F > | operator* (F c) const |
| F | operator* (const Vector< F > &fnc) const |
Inner product (v = this, w = ) | |
| virtual Function< F > & | operator*= (F sc) |
| Scaling operator. | |
| Vector< F > | operator+ (const Function< F > &fnc) const |
| Vector< F > | operator+ (F c) const |
| virtual Function< F > & | operator+= (F c) |
| Addition operator. | |
| virtual Function< F > & | operator+= (const Function< F > &fnc) |
| Addition operator. | |
| Vector< F > | operator- (const Function< F > &fnc) const |
| Vector< F > | operator- (F c) const |
| virtual Function< F > & | operator-= (const Function< F > &fnc) |
| Subtraction operator. | |
| virtual Function< F > & | operator-= (F c) |
| Subtraction operator. | |
| virtual Function< F > & | operator= (const Function< F > &fnc) |
| Assignment operator. | |
| template<class H > | |
| Function< F > & | operator= (const Function< H > &fnc) |
| Vector< F > & | operator= (F c) |
| Assignement operator. | |
| Vector< F > & | operator= (const Vector< F > &fnc) |
| Assignement operator. | |
| int | size () |
| void | storeMatlab (const char *filename, const char *name=0, bool append=false) const |
| Stores the vector in a Matlab sparse matrix. | |
| Vector (uint dim, F *data) | |
| template<class G > | |
| Vector (const Space< G > &spc) | |
| Constructor. | |
| template<class H > | |
| Vector (const Vector< H > &fnc, const Set< IndexRange > &indices) | |
| Constructor. | |
| template<class G > | |
| Vector (const Space< G > &spc, LinearForm< F, G > &lf) | |
| Constructor. | |
| Vector (const Vector< F > &f) | |
| Copy constructor. | |
| template<class G > | |
| Vector (const Space< G > &spc, F *data) | |
| Constructor. | |
| Vector (const Vector< typename Realtype< F >::type > &V_R, const Vector< typename Realtype< F >::type > &V_I) | |
| Constructor. | |
| template<class H > | |
| Vector (const Vector< H > &fncX, const F &fnc(const H &)) | |
| template<class G > | |
| Vector (const Space< G > &spc, const std::string &fname) | |
| File read constructor. | |
| template<class H > | |
| Vector (const Vector< H > &f) | |
| Copy constructor. | |
| template<class H > | |
| Vector (const Vector< H > &fncX, F fnc(const H &)) | |
| Constructor. | |
| Vector (const uint dim) | |
| Constructor. | |
| const Vector< F > & | write (const std::string &fname) const |
| Writes the vector to a file. | |
| virtual | ~Vector () |
Protected Member Functions | |
| template<class G > | |
| void | fillEntries_ (const Space< G > &spc, LinearForm< F, G > &lf) |
| virtual std::ostream & | info (std::ostream &os) const |
| Returns information in an output stream. | |
Protected Attributes | |
| Array< F > | data_ |
| Vector data. | |
| const uint | dim_ |
| Dimension of the function (or of the space the function is defined) | |
Private Attributes | |
| F * | v_ |
| Pointer to the vector data. | |
Static Private Attributes | |
| static uint | storeMatlabCounter_ |
| Counts number of Matlab outputs (used to uniquely name the vectors) | |
A vector.
The values of the function represented by this vector are stored elementwise in an array.
It is possible to write fast interfaces to other libraries since the array of values is under complete control of this class. An example is the interface to PETSc, where the vector data is not copied, but the data of PETSc is used.
| concepts::Vector< F >::Vector | ( | const Vector< F > & | f | ) |
Copy constructor.
| concepts::Vector< F >::Vector | ( | const Space< G > & | spc | ) | [inline] |
| concepts::Vector< F >::Vector | ( | const uint | dim | ) | [inline] |
| concepts::Vector< F >::Vector | ( | const Space< G > & | spc, |
| LinearForm< F, G > & | lf | ||
| ) |
| concepts::Vector< F >::Vector | ( | const Space< G > & | spc, |
| const std::string & | fname | ||
| ) |
File read constructor.
The vector is read from a file. This should be endian proof.
| spc | A space |
| fname | Filename |
| concepts::Vector< F >::Vector | ( | const Space< G > & | spc, |
| F * | data | ||
| ) | [inline] |
| concepts::Vector< F >::Vector | ( | uint | dim, |
| F * | data | ||
| ) | [inline] |
| concepts::Vector< F >::Vector | ( | const Vector< H > & | fncX, |
| F | fncconst H & | ||
| ) |
| concepts::Vector< F >::Vector | ( | const Vector< H > & | fncX, |
| const F & | fncconst H & | ||
| ) |
| concepts::Vector< F >::Vector | ( | const Vector< typename Realtype< F >::type > & | V_R, |
| const Vector< typename Realtype< F >::type > & | V_I | ||
| ) |
Constructor.
Use this constructor to build a vector of type F out of two vectors with entries of type Realtype<F>; works only for F = Cmplx, G = Real
| concepts::Vector< F >::Vector | ( | const Vector< H > & | fnc, |
| const Set< IndexRange > & | indices | ||
| ) |
| virtual concepts::Vector< F >::~Vector | ( | ) | [virtual] |
| virtual Function<F>& concepts::Vector< F >::add | ( | const Function< F > & | fnc, |
| F | a | ||
| ) | [virtual] |
Adds a times fnc to this function.
Reimplemented from concepts::Function< F >.
| Vector< F > & concepts::Vector< F >::add | ( | const Vector< H > & | fnc, |
| F | sc, | ||
| uint | offset = 0 |
||
| ) |
| Vector<F>& concepts::Vector< F >::add | ( | const Vector< H > & | fnc | ) | [inline] |
| Vector<F>& concepts::Vector< F >::apply | ( | F | fncconst F & | ) |
Application operator to each component, e.g.
std::sin or std::conj
| Vector<F>& concepts::Vector< F >::assemble | ( | const Space< G > & | spc, |
| LinearForm< F, G > & | lf | ||
| ) |
Assembles the vector w.r.t. linear form lf and space spc.
| F* concepts::Vector< F >::data | ( | ) | const [inline] |
| uint concepts::Function< F >::dim | ( | ) | const [inline, inherited] |
| void concepts::Vector< F >::fillEntries_ | ( | const Space< G > & | spc, |
| LinearForm< F, G > & | lf | ||
| ) | [protected] |
| virtual std::ostream& concepts::Vector< F >::info | ( | std::ostream & | os | ) | const [protected, virtual] |
Returns information in an output stream.
Reimplemented from concepts::Function< F >.
| Real concepts::Vector< F >::l1 | ( | ) | const |
l1 norm
| Real concepts::Vector< F >::l2 | ( | ) | const [inline] |
| Real concepts::Vector< F >::l2_2 | ( | ) | const |
l2 norm squared
| Real concepts::Vector< F >::max | ( | ) | const |
Maximum of the absolute values in the vector, ie.
norm.
| uint concepts::Vector< F >::n | ( | ) | const [inline] |
| concepts::Vector< F >::operator F * | ( | ) | const [inline] |
| virtual F& concepts::Vector< F >::operator() | ( | uint | i | ) | [inline, virtual] |
| virtual F concepts::Vector< F >::operator() | ( | uint | i | ) | const [inline, virtual] |
| F concepts::Vector< F >::operator* | ( | const Vector< F > & | fnc | ) | const |
Inner product (v = this, w = )
or
for complex vectors respectivly.
| Vector<F> concepts::Vector< F >::operator* | ( | F | c | ) | const |
| virtual Function<F>& concepts::Vector< F >::operator*= | ( | F | sc | ) | [virtual] |
Scaling operator.
Reimplemented from concepts::Function< F >.
| Vector<F> concepts::Vector< F >::operator+ | ( | const Function< F > & | fnc | ) | const |
| Vector<F> concepts::Vector< F >::operator+ | ( | F | c | ) | const |
| virtual Function<F>& concepts::Vector< F >::operator+= | ( | const Function< F > & | fnc | ) | [virtual] |
Addition operator.
Reimplemented from concepts::Function< F >.
| virtual Function<F>& concepts::Vector< F >::operator+= | ( | F | c | ) | [virtual] |
Addition operator.
Reimplemented from concepts::Function< F >.
| Vector<F> concepts::Vector< F >::operator- | ( | F | c | ) | const |
| Vector<F> concepts::Vector< F >::operator- | ( | const Function< F > & | fnc | ) | const |
| virtual Function<F>& concepts::Vector< F >::operator-= | ( | const Function< F > & | fnc | ) | [virtual] |
Subtraction operator.
Reimplemented from concepts::Function< F >.
| virtual Function<F>& concepts::Vector< F >::operator-= | ( | F | c | ) | [virtual] |
Subtraction operator.
Reimplemented from concepts::Function< F >.
| Function< F > & concepts::Vector< F >::operator= | ( | const Function< H > & | fnc | ) |
| Vector<F>& concepts::Vector< F >::operator= | ( | F | c | ) |
Assignement operator.
| Vector<F>& concepts::Vector< F >::operator= | ( | const Vector< F > & | fnc | ) |
Assignement operator.
| virtual Function<F>& concepts::Vector< F >::operator= | ( | const Function< F > & | fnc | ) | [virtual] |
Assignment operator.
Implements concepts::Function< F >.
| int concepts::Vector< F >::size | ( | ) | [inline] |
| void concepts::Vector< F >::storeMatlab | ( | const char * | filename, |
| const char * | name = 0, |
||
| bool | append = false |
||
| ) | const |
Stores the vector in a Matlab sparse matrix.
| const Vector<F>& concepts::Vector< F >::write | ( | const std::string & | fname | ) | const |
Writes the vector to a file.
This should be endian proof.
| fname | Filename |
Array<F> concepts::Vector< F >::data_ [protected] |
const uint concepts::Function< F >::dim_ [protected, inherited] |
uint concepts::Vector< F >::storeMatlabCounter_ [static, private] |
F* concepts::Vector< F >::v_ [private] |