Ravelin
|
A sparse vector represented in 'CSR' format. More...
#include <SparseVectorN.h>
Public Member Functions | |
SPARSEVECTORN (unsigned n, const std::map< unsigned, REAL > &values) | |
SPARSEVECTORN (unsigned n, unsigned nnz, boost::shared_array< unsigned > indices, boost::shared_array< REAL > data) | |
SPARSEVECTORN (const VECTORN &v) | |
Creates a sparse vector from a dense vector. | |
REAL | dot (const VECTORN &x) const |
Computes the dot product between a sparse vector and a dense vector. | |
REAL | square () const |
Computes the dot product between a sparse vector and itself. | |
unsigned | size () const |
unsigned | num_elements () const |
unsigned * | get_indices () |
REAL * | get_data () |
const unsigned * | get_indices () const |
const REAL * | get_data () const |
VECTORN & | to_dense (VECTORN &result) const |
Gets the dense version of the vector. | |
SPARSEVECTORN & | negate () |
Negates this sparse vector in place. | |
SPARSEVECTORN & | operator*= (REAL scalar) |
Multiplies this sparse vector by a scalar (in place) | |
SPARSEVECTORN & | mult (REAL scalar, SPARSEVECTORN &result) const |
Multiplies this sparse vector by a scalar and returns the result in a new vector. | |
Protected Attributes | |
boost::shared_array< unsigned > | _indices |
boost::shared_array< REAL > | _data |
unsigned | _size |
unsigned | _nelm |
A sparse vector represented in 'CSR' format.