AbstractLinAlgPack_SpVectorOp.hpp File Reference

#include "AbstractLinAlgPack_SparseVectorSliceOp.hpp"
#include "AbstractLinAlgPack_SparseElement.hpp"

Include dependency graph for AbstractLinAlgPack_SpVectorOp.hpp:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  AbstractLinAlgPack

Functions

void add_elements (SpVector *sv_lhs, value_type alpha, const DVectorSlice &vs_rhs, size_type offset=0, bool add_zeros=true)
 Add elements from a dense vector to a sparse vector.
void add_elements (SpVector *sv_lhs, value_type alpha, const SpVectorSlice &sv_rhs, size_type offset=0, bool add_zeros=true)
 Add elements from a sparse vector to another sparse vector.
DVectorSlice dense_view (SpVectorSlice &sv_rhs)
 Create a dense representation of a sparse vector.
const DVectorSlice dense_view (const SpVectorSlice &sv_rhs)
 


Function Documentation

void AbstractLinAlgPack::add_elements SpVector sv_lhs,
value_type  alpha,
const DVectorSlice vs_rhs,
size_type  offset = 0,
bool  add_zeros = true
 

Add elements from a dense vector to a sparse vector.

Here sv_lhs is not resized and only elements are added. The purpose of this function is to add elements from a dense vector to a sparse vector.

Postconditions:{itemize} sv_lhs->nz() == vs_rhs->size() + sv_lhs_before->size() [sv_lhs_before->is_sorted() || sv_lhs_before->nz() == 0] sv_lhs->is_sorted() == true {itemize}

Definition at line 71 of file AbstractLinAlgPack_SpVectorOp.cpp.

void AbstractLinAlgPack::add_elements SpVector sv_lhs,
value_type  alpha,
const SpVectorSlice sv_rhs,
size_type  offset = 0,
bool  add_zeros = true
 

Add elements from a sparse vector to another sparse vector.

Here sv_lhs is not resized and only elements are added. The purpose of this function is to add elements from a sparse vector to a sparse vector.

Postconditions:{itemize} sv_lhs->nz() == sv_rhs->nz() + sv_lhs_before->size() [(sv_lhs_before->is_sorted() || sv_lhs_before->nz() == 0) && (sv_rhs.is_sorted() || sv_rhs.nz() == 0)] sv_lhs->is_sorted() == true {itemize}

Definition at line 90 of file AbstractLinAlgPack_SpVectorOp.cpp.

DenseLinAlgPack::DVectorSlice AbstractLinAlgPack::dense_view SpVectorSlice sv_rhs  )  [inline]
 

Create a dense representation of a sparse vector.

The primary use if the function is to create a DVectorSlice object that only represents the nonzero values of the sparse vector. This could have several different uses but one of the most significant examples is when you want to discard the indices when sv_rhs->size() == sv_rhs->nz() and sv_rhs->is_sorted() == true.

Definition at line 89 of file AbstractLinAlgPack_SpVectorOp.hpp.

const DenseLinAlgPack::DVectorSlice AbstractLinAlgPack::dense_view const SpVectorSlice sv_rhs  )  [inline]
 

Definition at line 98 of file AbstractLinAlgPack_SpVectorOp.hpp.


Generated on Thu Sep 18 12:35:30 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1