This commit is contained in:
2022-04-22 23:24:34 +03:00
3 changed files with 10 additions and 10 deletions

View File

@@ -58,7 +58,7 @@
//! This number is called the item's index. //! This number is called the item's index.
//! So the first item has index 0, the last has index `size() - 1`. //! So the first item has index 0, the last has index `size() - 1`.
//! A set of various convenient functions is also available for the array, //! A set of various convenient functions is also available for the array,
//! for example: \a indexOf, \a contains(), \a entries(), \a isEmpty(), \a isNotEmpty(), //! for example: \a indexOf(), \a contains(), \a entries(), \a isEmpty(), \a isNotEmpty(),
//! \a every(), \a any(), \a forEach(), \a indexWhere(), \a getRange(), \a sort(), //! \a every(), \a any(), \a forEach(), \a indexWhere(), \a getRange(), \a sort(),
//! \a map(), \a reduce(), \a filter(), \a flatten(), \a reshape() and others. //! \a map(), \a reduce(), \a filter(), \a flatten(), \a reshape() and others.
//! //!
@@ -687,7 +687,7 @@ public:
//! piCout << v.any([](int e){return e % 2 == 0;}); // true //! piCout << v.any([](int e){return e % 2 == 0;}); // true
//! piCout << v.any([](int e){return e == 3;}); // false //! piCout << v.any([](int e){return e == 3;}); // false
//! \endcode //! \endcode
//! \~\sa \a every(), \a contains(), \a etries(), \a forEach() //! \~\sa \a every(), \a contains(), \a entries(), \a forEach()
inline bool any(std::function<bool(const T & e)> test) const { inline bool any(std::function<bool(const T & e)> test) const {
for (ssize_t i = pid_start; i < pid_start + (ssize_t)pid_size; ++i) { for (ssize_t i = pid_start; i < pid_start + (ssize_t)pid_size; ++i) {
if (test(pid_data[i])) return true; if (test(pid_data[i])) return true;
@@ -819,7 +819,7 @@ public:
//! otherwise it returns **false**. //! otherwise it returns **false**.
//! \~russian **true** если элемент `e` присутствует в массиве, //! \~russian **true** если элемент `e` присутствует в массиве,
//! в остальных случаях **false**. //! в остальных случаях **false**.
//! \~\sa \a every(), \a any(), \a etries(), \a forEach() //! \~\sa \a every(), \a any(), \a entries(), \a forEach()
inline bool contains(const T & e, ssize_t start = 0) const { inline bool contains(const T & e, ssize_t start = 0) const {
if (start < 0) { if (start < 0) {
start = pid_size + start; start = pid_size + start;
@@ -856,7 +856,7 @@ public:
//! piCout << v.entries(2, -4); // 2 //! piCout << v.entries(2, -4); // 2
//! \endcode //! \endcode
//! \~\sa \a every(), \a any(), \a contains(), \a forEach(), \a indexOf() //! \~\sa \a every(), \a any(), \a contains(), \a forEach(), \a indexOf()
inline int etries(const T & e, size_t start = 0) const { inline int entries(const T & e, size_t start = 0) const {
int ec = 0; int ec = 0;
if (start < 0) { if (start < 0) {
start = pid_size + start; start = pid_size + start;
@@ -890,7 +890,7 @@ public:
//! Обратите внимание: если индекс отрицателен, массив всё равно просматривается от начала к концу. //! Обратите внимание: если индекс отрицателен, массив всё равно просматривается от начала к концу.
//! Значение по умолчанию равно 0, что означает, что просматривается весь массив. //! Значение по умолчанию равно 0, что означает, что просматривается весь массив.
//! \~\sa \a every(), \a any(), \a contains(), \a forEach(), \a indexWhere() //! \~\sa \a every(), \a any(), \a contains(), \a forEach(), \a indexWhere()
inline int etries(std::function<bool(const T & e)> test, size_t start = 0) const { inline int entries(std::function<bool(const T & e)> test, size_t start = 0) const {
int ec = 0; int ec = 0;
if (start < 0) { if (start < 0) {
start = pid_size + start; start = pid_size + start;

View File

@@ -1,4 +1,4 @@
/*! \file pideque.h /*! \file piqueue.h
* \brief Queue container * \brief Queue container
* *
* This file declare PIQueue * This file declare PIQueue

View File

@@ -58,7 +58,7 @@
//! This number is called the item's index. //! This number is called the item's index.
//! So the first item has index 0, the last has index `size() - 1`. //! So the first item has index 0, the last has index `size() - 1`.
//! A set of various convenient functions is also available for the array, //! A set of various convenient functions is also available for the array,
//! for example: \a indexOf, \a contains(), \a entries(), \a isEmpty(), \a isNotEmpty(), //! for example: \a indexOf(), \a contains(), \a entries(), \a isEmpty(), \a isNotEmpty(),
//! \a every(), \a any(), \a forEach(), \a indexWhere(), \a getRange(), \a sort(), //! \a every(), \a any(), \a forEach(), \a indexWhere(), \a getRange(), \a sort(),
//! \a map(), \a reduce(), \a filter(), \a flatten(), \a reshape() and others. //! \a map(), \a reduce(), \a filter(), \a flatten(), \a reshape() and others.
//! //!
@@ -113,7 +113,7 @@
//! - Вставка и удаление элементов в конце — амортизированная постоянная 𝓞(1) //! - Вставка и удаление элементов в конце — амортизированная постоянная 𝓞(1)
//! - Вставка и удаление элементов — линейная по расстоянию до конца массива 𝓞(n) //! - Вставка и удаление элементов — линейная по расстоянию до конца массива 𝓞(n)
//! //!
//! \~\sa \a PIDeueue, \a PIMap //! \~\sa \a PIDeque, \a PIMap
template <typename T> template <typename T>
class PIVector { class PIVector {
public: public:
@@ -685,7 +685,7 @@ public:
//! piCout << v.any([](int e){return e % 2 == 0;}); // true //! piCout << v.any([](int e){return e % 2 == 0;}); // true
//! piCout << v.any([](int e){return e == 3;}); // false //! piCout << v.any([](int e){return e == 3;}); // false
//! \endcode //! \endcode
//! \~\sa \a every(), \a contains(), \a etries(), \a forEach() //! \~\sa \a every(), \a contains(), \a entries(), \a forEach()
inline bool any(std::function<bool(const T & e)> test) const { inline bool any(std::function<bool(const T & e)> test) const {
for (size_t i = 0; i < piv_size; ++i) { for (size_t i = 0; i < piv_size; ++i) {
if (test(piv_data[i])) return true; if (test(piv_data[i])) return true;
@@ -817,7 +817,7 @@ public:
//! otherwise it returns **false**. //! otherwise it returns **false**.
//! \~russian **true** если элемент `e` присутствует в массиве, //! \~russian **true** если элемент `e` присутствует в массиве,
//! в остальных случаях **false**. //! в остальных случаях **false**.
//! \~\sa \a every(), \a any(), \a etries(), \a forEach() //! \~\sa \a every(), \a any(), \a entries(), \a forEach()
inline bool contains(const T & e, ssize_t start = 0) const { inline bool contains(const T & e, ssize_t start = 0) const {
if (start < 0) { if (start < 0) {
start = piv_size + start; start = piv_size + start;