CXSC  A C++ Class Library for Extended Scientific Computing
2.5.4

A sparse complex interval vector. More...
#include <scivector.hpp>
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)  
scivector &  operator&= (const ivector &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const civector &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const ivector_slice &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const civector_slice &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const sivector &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const scivector &v) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const sivector_slice &) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
scivector &  operator&= (const scivector_slice &) 
Operator for elementwise intersection with another vector, result is assigned to the vector.  
const cinterval  operator() (const int i) const 
Returns a copy of the ith (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 ith to the jth (according to the currently used indexing) element.  
scivector &  operator*= (const real &s) 
Operator for multiplication with a scalar, result is assigned to the vector.  
scivector &  operator*= (const complex &s) 
Operator for multiplication with a scalar, result is assigned to the vector.  
scivector &  operator*= (const interval &s) 
Operator for multiplication with an interval, result is assigned to the vector.  
scivector &  operator*= (const cinterval &s) 
Operator for multiplication with an interval, result is assigned to the vector.  
scivector &  operator+= (const rvector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const cvector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const ivector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const civector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const rvector_slice &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const cvector_slice &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const ivector_slice &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const civector_slice &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const srvector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const scvector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const sivector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const scivector &v) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const srvector_slice &) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const scvector_slice &) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const sivector_slice &) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator+= (const scivector_slice &) 
Operator for elementwise addition with a vector, result is assigned to the vector.  
scivector &  operator= (const rvector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const cvector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const ivector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const civector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const rvector_slice &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const cvector_slice &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const ivector_slice &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const civector_slice &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const srvector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const scvector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const sivector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const scivector &v) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const srvector_slice &) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const scvector_slice &) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const sivector_slice &) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator= (const scivector_slice &) 
Operator for elementwise subtraction with a vector, result is assigned to the vector.  
scivector &  operator/= (const real &s) 
Operator for division of each element of the vector with a scalar, result is assigned to the vector.  
scivector &  operator/= (const complex &s) 
Operator for division of each element of the vector with a scalar, result is assigned to the vector.  
scivector &  operator/= (const interval &s) 
Operator for division of each element of the vector with an interval, result is assigned to the vector.  
scivector &  operator/= (const cinterval &s) 
Operator for division of each element of the vector with an interval, result is assigned to the vector.  
scivector &  operator= (const srvector &v) 
Assign a sparse real vector to a sparse complex interval vector.  
scivector &  operator= (const sivector &v) 
Assign a sparse interval vector to a sparse complex interval vector.  
scivector &  operator= (const scvector &v) 
Assign a sparse complex vector to a sparse complex interval vector.  
scivector &  operator= (const real &v) 
Assigns v to all elements of the vector (resulting in a dense vector!)  
scivector &  operator= (const complex &v) 
Assigns v to all elements of the vector (resulting in a dense vector!)  
scivector &  operator= (const interval &v) 
Assigns v to all elements of the vector (resulting in a dense vector!)  
scivector &  operator= (const cinterval &v) 
Assigns v to all elements of the vector (resulting in a dense vector!)  
scivector &  operator= (const rvector &v) 
Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const cvector &v) 
Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const ivector &v) 
Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const civector &v) 
Assign the dense vector v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const rvector_slice &v) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const cvector_slice &v) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const ivector_slice &v) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const civector_slice &v) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const srvector_slice &) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const scvector_slice &) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const sivector_slice &) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
scivector &  operator= (const scivector_slice &) 
Assign the dense vector slice v to a sparse vector. Only the non zero elements of v are used.  
cinterval &  operator[] (const int i) 
Returns a reference to the ith (according to the currently used indexing) element of the vector.  
cinterval  operator[] (const int i) const 
Returns a copy of the ith (according to the currently used indexing) element of the vector.  
scivector &  operator= (const rvector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const cvector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const ivector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const civector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const rvector_slice &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const cvector_slice &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const ivector_slice &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const civector_slice &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const srvector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const scvector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const sivector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const scivector &v) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const srvector_slice &) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const scvector_slice &) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const sivector_slice &) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
scivector &  operator= (const scivector_slice &) 
Operator for elementwise convex hull with another vector, result is assigned to the vector.  
std::vector< int > &  row_indices () 
Returns a reference to the STLvector storing the row indices of the non zero elements.  
const std::vector< int > &  row_indices () const 
Returns a reference to the STLvector 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 nonzero elements of v are stored explicitly.  
scivector (const cvector &v)  
Constructor for creating a sparse vector our of a dense vector v. Only the nonzero elements of v are stored explicitly.  
scivector (const rvector &v)  
Constructor for creating a sparse vector our of a dense vector v. Only the nonzero 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 STLvector storing the values of the non zero elements.  
const std::vector< cinterval > &  values () const 
Returns a reference to the STLvector storing the values of the non zero elements.  
Friends  
sivector  abs (const scivector &) 
Computes the componentwise absolute values as the interval hull of 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) 
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.
const cinterval cxsc::scivector::operator()  (  const int  i  )  const [inline] 
Returns a copy of the ith (according to the currently used indexing) element of the vector.
If the ith 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 readonly access to the elements of a sparse vector.
Definition at line 376 of file scivector.hpp.
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 jth element of the given sparse vector will be the ith element of the returned permuted vector.
Definition at line 394 of file scivector.hpp.
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 ith to the jth (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 ith (according to the currently used indexing) element of the vector.
If the ith 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 ith (according to the currently used indexing) element of the vector.
If the ith element is explicitly stored, a copy to the value is returned. If is not explicitly stored, zero will be returned. This is the constVersion 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 STLvector 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 ith element of the STLvector storing the indices refers to the ith element of the STLvector storing the values of the elements). Note that the stored indices are always 0based, independent of the starting index set in CXSC.
Definition at line 183 of file scivector.hpp.
const std::vector<int>& cxsc::scivector::row_indices  (  )  const [inline] 
Returns a reference to the STLvector 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 ith element of the STLvector storing the indices refers to the ith element of the STLvector storing the values of the elements). Note that the stored indices are always 0based, independent of the starting index set in CXSC.
Definition at line 202 of file scivector.hpp.
std::vector<cinterval>& cxsc::scivector::values  (  )  [inline] 
Returns a reference to the STLvector 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 ith element of the STLvector storing the indices refers to the ith element of the STLvector 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 STLvector 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 ith element of the STLvector storing the indices refers to the ith element of the STLvector storing the values of the elements).
Definition at line 211 of file scivector.hpp.
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 ibased.
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 (in+1)based.
Definition at line 826 of file scivector.hpp.