1 #ifndef VIENNACL_LINALG_DETAIL_SPAI_SPARSE_VECTOR_HPP
2 #define VIENNACL_LINALG_DETAIL_SPAI_SPARSE_VECTOR_HPP
49 template<
typename NumericT>
53 typedef typename std::map<unsigned int, NumericT>::iterator
iterator;
54 typedef typename std::map<unsigned int, NumericT>::const_iterator
const_iterator;
67 const_iterator
find(
unsigned int var)
const {
return v_.find(var); }
68 iterator
find(
unsigned int var) {
return v_.find(var); }
70 const_iterator
begin()
const {
return v_.begin(); }
71 iterator
begin() {
return v_.begin(); }
72 const_iterator
end()
const {
return v_.end(); }
73 iterator
end() {
return v_.end(); }
77 std::map<unsigned int, NumericT> v_;
std::map< unsigned int, NumericT >::const_iterator const_iterator
std::map< unsigned int, NumericT >::iterator iterator
Main namespace in ViennaCL. Holds all the basic types such as vector, matrix, etc. and defines operations upon them.
NumericT & operator[](unsigned int ind)
Set the index of the vector in the original matrix.
const_iterator begin() const
iterator find(unsigned int var)
Represents a sparse vector based on std::map
const_iterator end() const
const_iterator find(unsigned int var) const