PIVector2D - add funcs, optimize, tests, fixes, doxygen #194

Merged
andrey merged 29 commits from vibecoding_pivector2d into master 2026-02-27 23:58:45 +03:00
Showing only changes of commit 39c1be6bc0 - Show all commits

View File

@@ -1668,16 +1668,12 @@ public:
return result;
}
//! \~english Returns a new 2D array (as a single row) containing only the elements that pass the test.
//! \~russian Возвращает новый двумерный массив (в виде одной строки), содержащий только элементы, прошедшие проверку.
//! \~english Returns a new plain array containing only the elements that pass the test.
//! \~russian Возвращает новый одноменый массив, содержащий только элементы, прошедшие проверку.
//! \param test Predicate taking a const T&.
//! \return A 1xN 2D array with the filtered elements (or empty).
//! \return PIVector<T> with the filtered elements (or empty).
//! \sa PIVector::filter()
inline PIVector2D<T> filterElements(std::function<bool(const T &)> test) const {
PIVector<T> filtered = mat.filter(test);
if (filtered.isEmpty()) return PIVector2D<T>();
return PIVector2D<T>(1, filtered.size(), filtered);
}
inline PIVector<T> filterElements(std::function<bool(const T &)> test) const { return mat.filter(test); }
protected:
size_t rows_, cols_;