C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
cxsc::scivector Class Reference

A sparse complex interval vector. More...

#include <scivector.hpp>

List of all members.

Public Member Functions

real density () const
 Returns the density of the vector (the number of non zero elements divided by the number of elements)
void dropzeros ()
 Erases explicitly stored zeros from the data structure.
int get_nnz () const
 Returns the number of non zero elements of this vector (note that this includes explicitly stored zeros)
scivectoroperator&= (const ivector &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const civector &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const ivector_slice &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const civector_slice &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const sivector &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const scivector &v)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const sivector_slice &)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
scivectoroperator&= (const scivector_slice &)
 Operator for element-wise intersection with another vector, result is assigned to the vector.
const cinterval operator() (const int i) const
 Returns a copy of the i-th (according to the currently used indexing) element of the vector.
scivector operator() (const intvector &per)
 Returns a vector whose elemnts are rearranged according to a given permutation vector.
scivector operator() (const intmatrix &P)
 Returns a vector whose elemnts are rearranged according to a given permutation matrix.
scivector_slice operator() (const int, const int)
 Returns a slice of the vector from the i-th to the j-th (according to the currently used indexing) element.
scivectoroperator*= (const real &s)
 Operator for multiplication with a scalar, result is assigned to the vector.
scivectoroperator*= (const complex &s)
 Operator for multiplication with a scalar, result is assigned to the vector.
scivectoroperator*= (const interval &s)
 Operator for multiplication with an interval, result is assigned to the vector.
scivectoroperator*= (const cinterval &s)
 Operator for multiplication with an interval, result is assigned to the vector.
scivectoroperator+= (const rvector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const cvector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const ivector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const civector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const rvector_slice &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const cvector_slice &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const ivector_slice &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const civector_slice &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const srvector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const scvector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const sivector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const scivector &v)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const srvector_slice &)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const scvector_slice &)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const sivector_slice &)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator+= (const scivector_slice &)
 Operator for element-wise addition with a vector, result is assigned to the vector.
scivectoroperator-= (const rvector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const cvector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const ivector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const civector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const rvector_slice &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const cvector_slice &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const ivector_slice &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const civector_slice &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const srvector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const scvector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const sivector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const scivector &v)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const srvector_slice &)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const scvector_slice &)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const sivector_slice &)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator-= (const scivector_slice &)
 Operator for element-wise subtraction with a vector, result is assigned to the vector.
scivectoroperator/= (const real &s)
 Operator for division of each element of the vector with a scalar, result is assigned to the vector.
scivectoroperator/= (const complex &s)
 Operator for division of each element of the vector with a scalar, result is assigned to the vector.
scivectoroperator/= (const interval &s)
 Operator for division of each element of the vector with an interval, result is assigned to the vector.
scivectoroperator/= (const cinterval &s)
 Operator for division of each element of the vector with an interval, result is assigned to the vector.
scivectoroperator= (const srvector &v)
 Assign a sparse real vector to a sparse complex interval vector.
scivectoroperator= (const sivector &v)
 Assign a sparse interval vector to a sparse complex interval vector.
scivectoroperator= (const scvector &v)
 Assign a sparse complex vector to a sparse complex interval vector.
scivectoroperator= (const real &v)
 Assigns v to all elements of the vector (resulting in a dense vector!)
scivectoroperator= (const complex &v)
 Assigns v to all elements of the vector (resulting in a dense vector!)
scivectoroperator= (const interval &v)
 Assigns v to all elements of the vector (resulting in a dense vector!)
scivectoroperator= (const cinterval &v)
 Assigns v to all elements of the vector (resulting in a dense vector!)
scivectoroperator= (const rvector &v)
 Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const cvector &v)
 Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const ivector &v)
 Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const civector &v)
 Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const rvector_slice &v)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const cvector_slice &v)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const ivector_slice &v)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const civector_slice &v)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const srvector_slice &)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const scvector_slice &)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const sivector_slice &)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
scivectoroperator= (const scivector_slice &)
 Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.
cintervaloperator[] (const int i)
 Returns a reference to the i-th (according to the currently used indexing) element of the vector.
cinterval operator[] (const int i) const
 Returns a copy of the i-th (according to the currently used indexing) element of the vector.
scivectoroperator|= (const rvector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const cvector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const ivector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const civector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const rvector_slice &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const cvector_slice &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const ivector_slice &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const civector_slice &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const srvector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const scvector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const sivector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const scivector &v)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const srvector_slice &)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const scvector_slice &)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const sivector_slice &)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
scivectoroperator|= (const scivector_slice &)
 Operator for element-wise convex hull with another vector, result is assigned to the vector.
std::vector< int > & row_indices ()
 Returns a reference to the STL-vector storing the row indices of the non zero elements.
const std::vector< int > & row_indices () const
 Returns a reference to the STL-vector storing the row indices of the non zero elements.
 scivector ()
 Default constructor, creates an empty vector of size 0.
 scivector (const int s)
 Constructor for creating an empty vector of size s.
 scivector (const int s, const int b)
 Constructor for creating an empty vector of size s and reserving memory for b elements.
 scivector (const civector &v)
 Constructor for creating a sparse vector our of a dense vector v. Only the non-zero elements of v are stored explicitly.
 scivector (const cvector &v)
 Constructor for creating a sparse vector our of a dense vector v. Only the non-zero elements of v are stored explicitly.
 scivector (const rvector &v)
 Constructor for creating a sparse vector our of a dense vector v. Only the non-zero elements of v are stored explicitly.
 scivector (const int n, const int nnz, const intvector &index, const civector &values)
 Creates a sparse vector of dimension n with nnz non zeros, who are defined by the elements of index and values.
 scivector (const int n, const int nnz, const int *index, const cinterval *values)
 Creates a sparse vector of dimension n with nnz non zeros, who are defined by the elements of index and values.
 scivector (const srvector &v)
 Creates a sparse complex interval vector out of a sparse real vector.
 scivector (const scvector &v)
 Creates a sparse complex interval vector out of a sparse complex vector.
 scivector (const sivector &v)
 Creates a sparse complex interval vector out of a sparse interval vector.
 scivector (const srvector_slice &)
 Creates a sparse complex interval vector out of a sparse real vector slice.
 scivector (const scvector_slice &)
 Creates a sparse complex interval vector out of a sparse complex vector slice.
 scivector (const sivector_slice &)
 Creates a sparse complex interval vector out of a sparse real interval slice.
 scivector (const scivector_slice &)
 Creates a sparse complex interval vector out of a sparse complex interval vector slice.
 scivector (const srmatrix_subv &A)
 Creates a sparse complex interval vector out of a row or column of a sparse real matrix.
 scivector (const scmatrix_subv &A)
 Creates a sparse complex interval vector out of a row or column of a sparse complex matrix.
 scivector (const simatrix_subv &A)
 Creates a sparse complex interval vector out of a row or column of a sparse interval matrix.
 scivector (const scimatrix_subv &A)
 Creates a sparse complex interval vector out of a row or column of a sparse complex interval matrix.
std::vector< cinterval > & values ()
 Returns a reference to the STL-vector storing the values of the non zero elements.
const std::vector< cinterval > & values () const
 Returns a reference to the STL-vector storing the values of the non zero elements.

Friends

sivector abs (const scivector &)
 Computes the component-wise absolute values as the interval hull of $ \{ |v| \mid v \in [v] \} $ for a vector v.
scivector conj (const scivector &)
 Returns the complex conjugate of v.
scivector conj (const scivector_slice &)
 Returns the conjugate complex of v.
scvector diam (const scivector &)
 Computes the diameter of v.
sivector Im (const scivector &)
 Returns the imaginary part of the vector v.
scvector Inf (const scivector &)
 Returns the infimum of the complex interval vector as a new sparse point vector.
srvector InfIm (const scivector &)
 Returns the infimum of the imaginary part of the complex interval vector as a new sparse point vector.
srvector InfRe (const scivector &)
 Returns the infimum of the real part of the complex interval vector as a new sparse point vector.
int Lb (const scivector &)
 Returns the lower index bound of the vector v.
scvector mid (const scivector &)
 Compute the midpoint vector of v.
sivector Re (const scivector &)
 Returns the real part of the vector v.
void SetLb (scivector &, const int)
 Sets the lower index bound of the vector v to i.
void SetUb (scivector &, const int)
 Sets the upper index bound of the vector v to i.
scvector Sup (const scivector &)
 Returns the supremum of the complex interval vector as a new sparse point vector.
srvector SupIm (const scivector &)
 Returns the supremum of the imaginary part of the complex interval vector as a new sparse point vector.
srvector SupRe (const scivector &)
 Returns the supremum of the real part of the complex interval vector as a new sparse point vector.
int Ub (const scivector &)
 Returns the upper index bound of the vector v.
int VecLen (const scivector &)
 Returns the length of the vector (the dimension)

Detailed Description

A sparse complex interval vector.

This data type represents a sparse interval vector. Only the non zero elements are stored explicitly with their value and the respective index. All operators are overloaded to take advantage of the sparsity.

Definition at line 62 of file scivector.hpp.


Member Function Documentation

const cinterval cxsc::scivector::operator() ( const int  i) const [inline]

Returns a copy of the i-th (according to the currently used indexing) element of the vector.

If the i-th element is explicitly stored, a copy of this value is returned. Otherwise, 0.0 will be returned. Unlike with the []-operator, the data structure remains unchanged either way. Thus this operator should always be used for read-only access to the elements of a sparse vector.

Definition at line 376 of file scivector.hpp.

scivector cxsc::scivector::operator() ( const intvector per) [inline]

Returns a vector whose elemnts are rearranged according to a given permutation vector.

For a permutation vector p with p[Lb(p)+i]=j, the j-th element of the given sparse vector will be the i-th element of the returned permuted vector.

Definition at line 394 of file scivector.hpp.

scivector cxsc::scivector::operator() ( const intmatrix P) [inline]

Returns a vector whose elemnts are rearranged according to a given permutation matrix.

For a given sparse vector x and permutation matrix P, this operator return the result of P*x. This operator is more efficient than explicitly computing P*x, since P is transformed into a permutation vector and the permutation ist performed directly, without explicitly computing P*x.

Definition at line 417 of file scivector.hpp.

scivector_slice cxsc::scivector::operator() ( const int  i,
const int  j 
) [inline]

Returns a slice of the vector from the i-th to the j-th (according to the currently used indexing) element.

This operator can be used for read and write access to a slice of the sparse vector.

Definition at line 4753 of file scivector.hpp.

cinterval& cxsc::scivector::operator[] ( const int  i) [inline]

Returns a reference to the i-th (according to the currently used indexing) element of the vector.

If the i-th element is explicitly stored, a reference to the value is returned. If is not explicitly stored, it will be added to the data structure as a zero element. The returned reference then points to this new element. Hence ths []-operator should only be used for write access to the elements of a sparse vector. Use the ()-operator for read access.

Definition at line 342 of file scivector.hpp.

cinterval cxsc::scivector::operator[] ( const int  i) const [inline]

Returns a copy of the i-th (according to the currently used indexing) element of the vector.

If the i-th element is explicitly stored, a copy to the value is returned. If is not explicitly stored, zero will be returned. This is the const-Version of this operator, added for convenience. It is suggested to use thei ()-operator for read access.

Definition at line 364 of file scivector.hpp.

std::vector<int>& cxsc::scivector::row_indices ( ) [inline]

Returns a reference to the STL-vector storing the row indices of the non zero elements.

This function is provided to allow easy interfacing to other software interfaces and efficient implementation of sparse algorithms. The user has to take care that the data remains consistent (the i-th element of the STL-vector storing the indices refers to the i-th element of the STL-vector storing the values of the elements). Note that the stored indices are always 0-based, independent of the starting index set in C-XSC.

Definition at line 183 of file scivector.hpp.

const std::vector<int>& cxsc::scivector::row_indices ( ) const [inline]

Returns a reference to the STL-vector storing the row indices of the non zero elements.

This function is provided to allow easy interfacing to other software interfaces and efficient implementation of sparse algorithms. The user has to take care that the data remains consistent (the i-th element of the STL-vector storing the indices refers to the i-th element of the STL-vector storing the values of the elements). Note that the stored indices are always 0-based, independent of the starting index set in C-XSC.

Definition at line 202 of file scivector.hpp.

std::vector<cinterval>& cxsc::scivector::values ( ) [inline]

Returns a reference to the STL-vector storing the values of the non zero elements.

This function is provided to allow easy interfacing to other software interfaces and efficient implementation of sparse algorithms. The user has to take care that the data remains consistent (the i-th element of the STL-vector storing the indices refers to the i-th element of the STL-vector storing the values of the elements).

Definition at line 192 of file scivector.hpp.

const std::vector<cinterval>& cxsc::scivector::values ( ) const [inline]

Returns a reference to the STL-vector storing the values of the non zero elements.

This function is provided to allow easy interfacing to other software interfaces and efficient implementation of sparse algorithms. The user has to take care that the data remains consistent (the i-th element of the STL-vector storing the indices refers to the i-th element of the STL-vector storing the values of the elements).

Definition at line 211 of file scivector.hpp.


Friends And Related Function Documentation

void SetLb ( scivector v,
const int  i 
) [friend]

Sets the lower index bound of the vector v to i.

After setting the lower index bound to i, the indexing of the vector is i-based.

Definition at line 817 of file scivector.hpp.

void SetUb ( scivector v,
const int  j 
) [friend]

Sets the upper index bound of the vector v to i.

After setting the upper index bound to i, the indexing of the vector of dimension n is (i-n+1)-based.

Definition at line 826 of file scivector.hpp.


The documentation for this class was generated from the following files: