Skip to content
Snippets Groups Projects
Commit 0a48e964 authored by wenqing's avatar wenqing
Browse files

[LisVector] Added a member function to set several entries

parent 51dbd3b0
No related branches found
No related tags found
No related merge requests found
...@@ -89,13 +89,23 @@ public: ...@@ -89,13 +89,23 @@ public:
/// return a raw Lis vector object /// return a raw Lis vector object
LIS_VECTOR& getRawVector() { return vec_; } LIS_VECTOR& getRawVector() { return vec_; }
/// /// set entries
template <class T_SUBVEC>
void set(const std::vector<IndexType>& pos, const T_SUBVEC& sub_vec)
{
for (std::size_t i = 0; i < pos.size(); ++i)
{
set(pos[i], sub_vec[i]);
}
}
/// add entries
template <class T_SUBVEC> template <class T_SUBVEC>
void add(const std::vector<IndexType>& pos, const T_SUBVEC& sub_vec) void add(const std::vector<IndexType>& pos, const T_SUBVEC& sub_vec)
{ {
for (std::size_t i = 0; i < pos.size(); ++i) for (std::size_t i = 0; i < pos.size(); ++i)
{ {
this->add(pos[i], sub_vec[i]); add(pos[i], sub_vec[i]);
} }
} }
......
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