|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
63 double reallocFac = 10.0);
89 double reallocFac = 10.0);
113 double reallocFac = 10.0);
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
int nnz_
The number of stored elements ("nonzeros").
double origCoeff(int i) const
double norm()
Returns the Euclidean norm of the sparse vector.
void insert(int s, double c)
Adds a new support/coefficient pair to the vector.
~SparVec()
The destructor.
SparVec(AbacusGlobal *glob, int size, double reallocFac=10.0)
Creates an empty sparse vector.
AbacusGlobal * glob_
A pointer to the corresponding global object.
int * support_
The array storing the nonzero variables.
int nnz() const
Returns the number of nonzero elements.
double reallocFac_
If a new element is inserted but the sparse vector is full, then its size is increased by reallocFac_...
int size_
The maximal number of nonzero coefficients which can be stored without reallocation.
void rename(Array< int > &newName)
Replaces the index of the support by new names.
void copy(const SparVec &vec)
Copies vector vec.
double coeff(int i) const
double * coeff_
The array storing the corresponding nonzero coefficients.
void rangeCheck(int i) const
Checks whether i is a valid index.
Base class of all other classes of ABACUS.
The parameterized class Array implements dynamic arrays of type E.
int size() const
Returns the maximal length of the sparse vector.
friend std::ostream & operator<<(std::ostream &out, const SparVec &rhs)
The output operator.
SparVec & operator=(const SparVec &rhs)
The assignment operator.
void leftShift(ArrayBuffer< int > &del)
Deletes the elements listed in a buffer from the sparse vector.
void realloc()
Increases the size of the sparse vector by reallocFac_ percent of the original size.
Global data and functions.
void clear()
Removes all nonzeros from the sparse vector.