Wrapper-class for a dense TNT-Vector. More...
#include <uservector.h>
Public Member Functions | |
DenseVector (int n=0, const Type &v=Type()) | |
(Standard-)Constructor for optional dimension and initial value. | |
DenseVector (const DenseVector< Type > &v) | |
Copy-Constructor for a DenseVector. | |
DenseVector (const UserVector< Type > &v) | |
Copy-Constructor for a UserVector. | |
DenseVector (const UserVector< Type > &v, const int low, const int up) | |
Constructor for a part of a UserVector. | |
DenseVector (const UserVector< Type > &v, const UserVector< int > &block) | |
Constructor for a block of a UserVector. | |
DenseVector (const vector< DenseVector< Type > * > &v, const vector< DenseVector< int > > &block) | |
Constructor for a vector of pointer of UserVectors and a block-structure. | |
DenseVector (const vector< Pointer< UserVector< Type > > > &v, const vector< DenseVector< int > > &block) | |
DenseVector (const vector< Pointer< DenseVector< Type > > > &v, const vector< DenseVector< int > > &block) | |
DenseVector (const vector< DenseVector< Type > > &v, const vector< DenseVector< int > > &block) | |
Constructor for a vector of UserVectors and a block-structure. | |
DenseVector (const Type *v, const int n) | |
Constructor for an array of Type's. | |
DenseVector (const TNT::Vector< Type > &x_) | |
Copy-Constructor for a TNT-Vector. | |
Pointer< UserVector< Type > > | getemptycopy (int n) const |
Gives an empty UserVector of this type. | |
Pointer< UserVector< Type > > | getemptycopy () const |
Gives an empty UserVector of this type and dimension. | |
Pointer< UserVector< Type > > | getcopy () const |
Gives a copy of this UserVector. | |
Pointer< UserVector< Type > > | getcopy (const UserVector< int > &block) const |
Gives a Pointer to a copy of one block of this UserVector. | |
int | dim () const |
The dimension. | |
void | resize (const int n) |
Tests the new size. | |
Type & | operator[] (const int i) |
Gives a reference to one component of this UserVector. | |
Type | operator[] (const int i) const |
Gives one element of this UserVector. | |
Type | operator() (const int i) const |
Gives a copy of one component of this UserVector. | |
void | SetElement (const int i, const Type &v) |
Sets one element of this UserVector. | |
DenseVector< Type > | operator() (const UserVector< int > &block) const |
Gives a block form this UserVector as DenseVector. | |
DenseVector< Type > | operator() (const int low, const int up) const |
Gives one part of this UserVector as DenseVector. | |
DenseVector< Type > & | operator= (const DenseVector< Type > &v) |
Assign-Operator for a DenseVector. | |
DenseVector< Type > & | operator= (const UserVector< Type > &v) |
DenseVector< Type > & | operator= (const Type &v) |
Assign-Operator for a value from type Type. | |
virtual UserVector< Type > & | AddMult (Type a, const UserVector< Type > &v) |
DenseVector< Type > & | operator+= (const DenseVector< Type > &v) |
Adds a DenseVector to this one. | |
DenseVector< Type > & | operator+= (const UserVector< Type > &v) |
DenseVector< Type > & | operator-= (const DenseVector< Type > &v) |
Substract a DenseVector from this one. | |
DenseVector< Type > & | operator-= (const UserVector< Type > &v) |
DenseVector< Type > & | operator*= (const Type &v) |
Multiplies all components with a value from type Type. | |
DenseVector< Type > & | operator/= (const Type &v) |
Divides all components through a value from type Type. | |
DenseVector< Type > | operator* (const Type &v) const |
Computes the product of this UserVector and a value from type v. | |
Type | operator* (const DenseVector< Type > &v) const |
Computes the scalar product with a DenseVector. | |
DenseVector< Type > | operator+ (const DenseVector< Type > &v) const |
Computes the sum of this DenseVector and another one. | |
DenseVector< Type > | operator+ (const UserVector< Type > &v) const |
const UserVector< Type > & | operator+ () const |
Computes nothing. | |
DenseVector< Type > | operator- (const DenseVector< Type > &v) const |
Computes the difference between this DenseVector and another one. | |
DenseVector< Type > | operator- (const UserVector< Type > &v) const |
DenseVector< Type > | operator- () const |
Calculates this UserVector multiplied with -1. | |
DenseVector< Type > | diagmult (const DenseVector< Type > &v) const |
Computes the diagonal multiplication of with another DenseVector. | |
DenseVector< Type > | diagmult (const UserVector< Type > &v) const |
operator const Pointer< Type > () const | |
Returns a const Pointer to the elements of this DenseVector. | |
void | print (ostream &out) const |
Returns a Pointer to the elements of this DenseVector. | |
Static Public Member Functions | |
static Pointer< DenseVector < Type > > | random (const int n, const Type lb, const Type ub) |
Gives a random DenseVector. | |
static Pointer< DenseVector < Type > > | random (const int n, const Type lb, const Type ub, const double sparsity) |
Gives a random DenseVector with specified sparsity. | |
static Pointer< DenseVector < Type > > | random (const DenseVector< Type > low, const DenseVector< Type > up) |
Gives a random DenseVector. | |
Protected Attributes | |
TNT::Vector< Type > | x |
The TNT-vector to wrap. | |
Friends | |
DenseVector< Type > | operator* (const Type &v1, const DenseVector< Type > &v2) |
Compute the product of a Type and a DenseVector. |
Wrapper-class for a dense TNT-Vector.
Definition at line 450 of file uservector.h.
DenseVector< Type >::DenseVector | ( | int | n = 0 , |
|
const Type & | v = Type() | |||
) | [inline] |
(Standard-)Constructor for optional dimension and initial value.
n | The dimension, default is 0. | |
v | Initial value, default is Type(). |
Definition at line 495 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const DenseVector< Type > & | v | ) | [inline] |
Copy-Constructor for a DenseVector.
v | The DenseVector to copy. |
Definition at line 502 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const UserVector< Type > & | v | ) | [inline] |
Copy-Constructor for a UserVector.
v | The UserVector to copy. |
Definition at line 509 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const UserVector< Type > & | v, | |
const int | low, | |||
const int | up | |||
) | [inline] |
Constructor for a part of a UserVector.
Constructs DenseVector v[low]...v[up].
v | The UserVector, the elements should be taken from. | |
low | The lower index of the elements. | |
up | The upper index of the elements. |
Definition at line 520 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const UserVector< Type > & | v, | |
const UserVector< int > & | block | |||
) | [inline] |
Constructor for a block of a UserVector.
v | The UserVector, a block should be taken from. | |
block | The block description. |
Definition at line 529 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const vector< DenseVector< Type > * > & | v, | |
const vector< DenseVector< int > > & | block | |||
) | [inline] |
Constructor for a vector of pointer of UserVectors and a block-structure.
v | The vector of pointer of UserVectors. | |
block | The block-structure. |
Definition at line 538 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const vector< Pointer< UserVector< Type > > > & | v, | |
const vector< DenseVector< int > > & | block | |||
) | [inline] |
Definition at line 545 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const vector< Pointer< DenseVector< Type > > > & | v, | |
const vector< DenseVector< int > > & | block | |||
) | [inline] |
Definition at line 552 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const vector< DenseVector< Type > > & | v, | |
const vector< DenseVector< int > > & | block | |||
) | [inline] |
Constructor for a vector of UserVectors and a block-structure.
v | The vector of UserVectors. | |
block | The block-structure. |
Definition at line 563 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const Type * | v, | |
const int | n | |||
) | [inline] |
Constructor for an array of Type's.
v | The array of Type's. | |
n | The length of this array. |
Definition at line 574 of file uservector.h.
DenseVector< Type >::DenseVector | ( | const TNT::Vector< Type > & | x_ | ) | [inline] |
Copy-Constructor for a TNT-Vector.
x_ | The TNT-Vector to copy. |
Definition at line 581 of file uservector.h.
static Pointer<DenseVector<Type> > DenseVector< Type >::random | ( | const int | n, | |
const Type | lb, | |||
const Type | ub | |||
) | [inline, static] |
Gives a random DenseVector.
n | The dimension. | |
lb | The lower bound. | |
ub | The upper bound. |
Definition at line 457 of file uservector.h.
static Pointer<DenseVector<Type> > DenseVector< Type >::random | ( | const int | n, | |
const Type | lb, | |||
const Type | ub, | |||
const double | sparsity | |||
) | [inline, static] |
Gives a random DenseVector with specified sparsity.
n | The random DenseVector. | |
lb | The lower bound. | |
ub | The upper bound. | |
sparsity | The sparsity, between 0 and 1. |
Definition at line 469 of file uservector.h.
static Pointer<DenseVector<Type> > DenseVector< Type >::random | ( | const DenseVector< Type > | low, | |
const DenseVector< Type > | up | |||
) | [inline, static] |
Gives a random DenseVector.
low | The lower bound. | |
up | The upper bound. |
Definition at line 479 of file uservector.h.
Pointer<UserVector<Type> > DenseVector< Type >::getemptycopy | ( | int | n | ) | const [inline, virtual] |
Gives an empty UserVector of this type.
Abstract.
n | The size of the new UserVector. |
Implements UserVector< Type >.
Definition at line 585 of file uservector.h.
Pointer<UserVector<Type> > DenseVector< Type >::getemptycopy | ( | ) | const [inline, virtual] |
Gives an empty UserVector of this type and dimension.
Reimplemented from UserVector< Type >.
Definition at line 589 of file uservector.h.
Pointer<UserVector<Type> > DenseVector< Type >::getcopy | ( | ) | const [inline, virtual] |
Gives a copy of this UserVector.
Reimplemented from UserVector< Type >.
Definition at line 593 of file uservector.h.
Pointer<UserVector<Type> > DenseVector< Type >::getcopy | ( | const UserVector< int > & | block | ) | const [inline, virtual] |
Gives a Pointer to a copy of one block of this UserVector.
block | The block-describtion. |
Reimplemented from UserVector< Type >.
Definition at line 597 of file uservector.h.
int DenseVector< Type >::dim | ( | ) | const [inline, virtual] |
The dimension.
Abstract.
Implements UserVector< Type >.
Definition at line 601 of file uservector.h.
void DenseVector< Type >::resize | ( | const int | n | ) | [inline, virtual] |
Tests the new size.
n | The new size. |
Reimplemented from UserVector< Type >.
Definition at line 605 of file uservector.h.
Type& DenseVector< Type >::operator[] | ( | const int | i | ) | [inline, virtual] |
Gives a reference to one component of this UserVector.
Abstract. Use operator(int), when you want to read a component only!
i | The index of the element. |
Implements UserVector< Type >.
Definition at line 614 of file uservector.h.
Type DenseVector< Type >::operator[] | ( | const int | i | ) | const [inline, virtual] |
Gives one element of this UserVector.
i | The index of the element. |
Reimplemented from UserVector< Type >.
Definition at line 618 of file uservector.h.
Type DenseVector< Type >::operator() | ( | const int | i | ) | const [inline, virtual] |
Gives a copy of one component of this UserVector.
Use this one, when you want to read a component only! Abstract
i | The index of the element. |
Implements UserVector< Type >.
Definition at line 622 of file uservector.h.
void DenseVector< Type >::SetElement | ( | const int | i, | |
const Type & | v | |||
) | [inline, virtual] |
Sets one element of this UserVector.
i | The index of the element. | |
v | The value to set. |
Reimplemented from UserVector< Type >.
Definition at line 626 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator() | ( | const UserVector< int > & | block | ) | const [inline, virtual] |
Gives a block form this UserVector as DenseVector.
block | The block structure. |
Reimplemented from UserVector< Type >.
Definition at line 630 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator() | ( | const int | low, | |
const int | up | |||
) | const [inline, virtual] |
Gives one part of this UserVector as DenseVector.
low | The lower index. | |
up | The upper index. |
Reimplemented from UserVector< Type >.
Definition at line 634 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator= | ( | const DenseVector< Type > & | v | ) | [inline, virtual] |
Assign-Operator for a DenseVector.
v | The DenseVector to assign to this one. |
Implements UserVector< Type >.
Reimplemented in IntervalVector.
Definition at line 642 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator= | ( | const UserVector< Type > & | v | ) | [inline] |
Definition at line 647 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator= | ( | const Type & | v | ) | [inline, virtual] |
Assign-Operator for a value from type Type.
Abstract.
v | The value to assign to all elements of this vector. |
Implements UserVector< Type >.
Definition at line 653 of file uservector.h.
virtual UserVector<Type>& DenseVector< Type >::AddMult | ( | Type | a, | |
const UserVector< Type > & | v | |||
) | [inline, virtual] |
Definition at line 658 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator+= | ( | const DenseVector< Type > & | v | ) | [inline, virtual] |
Adds a DenseVector to this one.
v | The DenseVector to add. |
Implements UserVector< Type >.
Definition at line 668 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator+= | ( | const UserVector< Type > & | v | ) | [inline] |
Definition at line 673 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator-= | ( | const DenseVector< Type > & | v | ) | [inline, virtual] |
Substract a DenseVector from this one.
v | The DenseVector to substract. |
Implements UserVector< Type >.
Definition at line 683 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator-= | ( | const UserVector< Type > & | v | ) | [inline] |
Definition at line 688 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator*= | ( | const Type & | v | ) | [inline, virtual] |
Multiplies all components with a value from type Type.
Abstract.
v | The value to multiply with. |
Implements UserVector< Type >.
Definition at line 694 of file uservector.h.
DenseVector<Type>& DenseVector< Type >::operator/= | ( | const Type & | v | ) | [inline, virtual] |
Divides all components through a value from type Type.
Abstract.
v | The value to divide. |
Implements UserVector< Type >.
Definition at line 699 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator* | ( | const Type & | v | ) | const [inline, virtual] |
Computes the product of this UserVector and a value from type v.
v | The value to multiply with. |
Reimplemented from UserVector< Type >.
Definition at line 704 of file uservector.h.
Type DenseVector< Type >::operator* | ( | const DenseVector< Type > & | v | ) | const [inline, virtual] |
Computes the scalar product with a DenseVector.
v | The DenseVector to multiply with. | |
The | scalar-product x * v.x. |
Reimplemented from UserVector< Type >.
Definition at line 724 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator+ | ( | const DenseVector< Type > & | v | ) | const [inline, virtual] |
Computes the sum of this DenseVector and another one.
v | The DenseVector to add with this one. |
Reimplemented from UserVector< Type >.
Definition at line 733 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator+ | ( | const UserVector< Type > & | v | ) | const [inline] |
Definition at line 737 of file uservector.h.
const UserVector<Type>& DenseVector< Type >::operator+ | ( | ) | const [inline, virtual] |
Computes nothing.
Reimplemented from UserVector< Type >.
Definition at line 742 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator- | ( | const DenseVector< Type > & | v | ) | const [inline, virtual] |
Computes the difference between this DenseVector and another one.
v | The DenseVector to subtract. |
Reimplemented from UserVector< Type >.
Definition at line 751 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator- | ( | const UserVector< Type > & | v | ) | const [inline] |
Definition at line 755 of file uservector.h.
DenseVector<Type> DenseVector< Type >::operator- | ( | ) | const [inline, virtual] |
Calculates this UserVector multiplied with -1.
Abstract.
Reimplemented from UserVector< Type >.
Definition at line 760 of file uservector.h.
DenseVector<Type> DenseVector< Type >::diagmult | ( | const DenseVector< Type > & | v | ) | const [inline, virtual] |
Computes the diagonal multiplication of with another DenseVector.
v | The DenseVector to multiply diagonaly with. |
Reimplemented from UserVector< Type >.
Definition at line 770 of file uservector.h.
DenseVector<Type> DenseVector< Type >::diagmult | ( | const UserVector< Type > & | v | ) | const [inline] |
Definition at line 774 of file uservector.h.
DenseVector< Type >::operator const Pointer< Type > | ( | ) | const [inline, virtual] |
Returns a const Pointer to the elements of this DenseVector.
Implements UserVector< Type >.
Definition at line 783 of file uservector.h.
void DenseVector< Type >::print | ( | ostream & | out | ) | const [inline, virtual] |
Returns a Pointer to the elements of this DenseVector.
Prints this DenseVector. Prints each element, seperated by space and finished with a new line.
out | The ostream to print to. |
Reimplemented from UserVector< Type >.
Definition at line 797 of file uservector.h.
DenseVector<Type> operator* | ( | const Type & | v1, | |
const DenseVector< Type > & | v2 | |||
) | [friend] |
Compute the product of a Type and a DenseVector.
v1 | The first factor as Type. | |
v2 | The secont factor as DenseVector. |
Reimplemented from UserVector< Type >.
Definition at line 716 of file uservector.h.
TNT::Vector<Type> DenseVector< Type >::x [protected] |
The TNT-vector to wrap.
Definition at line 488 of file uservector.h.