Skip to content
Snippets Groups Projects
Commit 89021f7e authored by wenqing's avatar wenqing
Browse files

[EigenVector] Added a member function to set several entries

parent 0a48e964
No related branches found
No related tags found
No related merge requests found
......@@ -78,6 +78,17 @@ public:
/// add entry
void add(IndexType rowId, double v) { vec_[rowId] += v; }
/// set entries
template <class T_SUBVEC>
void set(const std::vector<IndexType>& pos, const T_SUBVEC& sub_vec)
{
auto const length = pos.size();
for (std::size_t i = 0; i < length; ++i)
{
set(pos[i], sub_vec[i]);
}
}
/// add entries
template <class T_SUBVEC>
void add(const std::vector<IndexType>& pos, const T_SUBVEC& sub_vec)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment