vector and maitrix foreach
This commit is contained in:
@@ -274,6 +274,20 @@ public:
|
||||
mat.clear();
|
||||
}
|
||||
|
||||
const PIVector2D<T> & forEach(std::function<void(const T &)> f) const {
|
||||
mat.forEach(f);
|
||||
return *this;
|
||||
}
|
||||
PIVector2D<T> copyForEach(std::function<T(const T &)> f) const {
|
||||
PIVector2D<T> ret(*this);
|
||||
ret.mat = mat.copyForEach(f);
|
||||
return ret;
|
||||
}
|
||||
PIVector2D<T> & forEachInplace(std::function<T(const T &)> f) {
|
||||
mat.forEachInplace(f);
|
||||
return *this;
|
||||
}
|
||||
|
||||
protected:
|
||||
size_t rows_, cols_;
|
||||
PIVector<T> mat;
|
||||
|
||||
Reference in New Issue
Block a user