Since other classes, e.g., the class ABA_RO are derived from this class, all data members are protected in order to provide efficient access also in these derived classes.
#include <sparvec.h>
Inheritance diagram for ABA_SPARVEC::
|
A constructor with initialization of the support and coefficients of the sparse vector.
This constructor is equivalent to the previous one except that it is using C-style arrays for the initialization of the sparse vector.
The destructor.
The assignment operator requires that the left hand and the right hand side have the same length (otherwise use the function copy()).
A range check is performed if the function is compiled with -DABACUSSAFE.
A range check is performed if the function is compiled with -DABACUSSAFE.
Is very similar to the assignment operator, yet the size of the two vectors need not be equal and only the support, the coefficients, and the number of nonzeros is copied. A reallocation is performed if required.
This other version of realloc() reallocates the sparse vector to a given length.
Terminates the program with an error message if i is negative or greater or equal than the number of nonzero elements.
The maximal number of nonzero coefficients which can be stored without reallocation.
If a new element is inserted but the sparse vector is full, then its size is increased by reallocFac_ percent.
The output operator writes the elements of the support and their coefficients line by line on an output stream.
Since other classes, e.g., the class ABA_RO are derived from this class, all data members are protected in order to provide efficient access also in these derived classes.
Definition at line 50 of file sparvec.h.
The constructor for an empty sparse vector.
If no memory for support_ and coeff_ is allocated then an automatic allocation will be performed when the function insert() is called the first time.
A constructor with initialization of the support and coefficients of the sparse vector.
The minimum value of size and s.size is the number of nonzeros of the sparse vector.
If size is 0, then also no elements are copied in the for-loop since nnz_ will be also 0.
This constructor is equivalent to the previous one except that it is using C-style arrays for the initialization of the sparse vector.
The copy constructor.
The destructor.
The assignment operator requires that the left hand and the right hand side have the same length (otherwise use the function copy()).
A reference to the left hand side.
A range check is performed if the function is compiled with -DABACUSSAFE.
The support of the i-th nonzero element.
Definition at line 300 of file sparvec.h.
A range check is performed if the function is compiled with -DABACUSSAFE.
The coefficient of the i-th nonzero element.
Definition at line 308 of file sparvec.h.
The coefficient having support i.
Adds a new support/coefficient pair to the vector.
If necessary a reallocation of the member data is performed automatically.
Definition at line 316 of file sparvec.h.
Deletes the elements listed in a buffer from the sparse vector.
The numbers of indices in this buffer must be upward sorted. The elements before the first element in the buffer are unchanged. Then the elements which are not deleted are shifted left in the arrays.
Is very similar to the assignment operator, yet the size of the two vectors need not be equal and only the support, the coefficients, and the number of nonzeros is copied. A reallocation is performed if required.
Removes all nonzeros from the sparse vector.
Definition at line 327 of file sparvec.h.
Replaces the index of the support by new names.
The maximal length of the sparse vector.
Definition at line 332 of file sparvec.h.
The number of nonzero elements. This is not necessarily the correct number of nonzeros, yet the number of coefficient/support pairs, which are stored. Some of these pairs may have a zero coefficient.
Definition at line 337 of file sparvec.h.
The Euclidean norm of the sparse vector.
Increases the size of the sparse vector by reallocFac_ percent of the original size.
This function is called if an automatic reallocation takes place.
This other version of realloc() reallocates the sparse vector to a given length.
It is an error to decrease size below the current number of nonzeros.
Terminates the program with an error message if i is negative or greater or equal than the number of nonzero elements.
If the class ABA_SPARVEC is compiled with the flag -DABACUSSAFE, then before each access operation on element i of the sparse vector the function rangeCheck() is called.
The output operator writes the elements of the support and their coefficients line by line on an output stream.
A reference to the output stream.
A pointer to the corresponding global object.
Definition at line 273 of file sparvec.h.
The maximal number of nonzero coefficients which can be stored without reallocation.
Definition at line 278 of file sparvec.h.
The number of stored elements (“nonzeros”).
Definition at line 282 of file sparvec.h.
If a new element is inserted but the sparse vector is full, then its size is increased by reallocFac_ percent.
Definition at line 288 of file sparvec.h.
The array storing the nonzero variables.
Definition at line 292 of file sparvec.h.
The array storing the corresponding nonzero coefficients.
Definition at line 296 of file sparvec.h.
The documentation for this class was generated from the following file: