44 LisVector(std::size_t length,
double* data);
54 std::size_t
size()
const;
70 lis_vector_get_value(
vec_, rowId, &v);
77 lis_vector_set_value(LIS_INS_VALUE, rowId, v,
vec_);
83 lis_vector_set_value(LIS_ADD_VALUE, rowId, v,
vec_);
87 void write(
const std::string& filename)
const;
93 template <
class T_SUBVEC>
94 void add(
const std::vector<IndexType>& pos,
const T_SUBVEC& sub_vec)
96 for (std::size_t i = 0; i < pos.size(); ++i)
98 this->
add(pos[i], sub_vec[i]);
105 assert(u.size() ==
size());
106 lis_vector_get_values(
vec_, 0,
size(), u.data());
Lis vector wrapper class.
void add(IndexType rowId, double v)
add entry
LisVector(std::size_t length)
void add(const std::vector< IndexType > &pos, const T_SUBVEC &sub_vec)
void copyValues(std::vector< double > &u) const
Copy vector values.
std::size_t getRangeEnd() const
return an end index of the active data range
void write(const std::string &filename) const
printout this equation for debugging
void set(IndexType rowId, double v)
set entry
std::size_t size() const
return a vector length
double get(IndexType rowId) const
get entry
double operator[](IndexType rowId) const
access entry
LIS_VECTOR & getRawVector()
return a raw Lis vector object
std::size_t getRangeBegin() const
return a start index of the active data range