From 99a454677582f8ce2ad4b8c2ef5d3516c8a41ea4 Mon Sep 17 00:00:00 2001 From: Andrey Date: Fri, 22 Apr 2022 17:54:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=89=D1=91=20=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=B4=D0=BB=D1=8F=20PIVector=20=D0=B8=20PIDeque?= =?UTF-8?q?=20iterator=20=D0=B8=20=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D0=BE=D0=BA?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/main/containers/pideque.h | 123 +++++--------------------------- libs/main/containers/pivector.h | 123 +++++--------------------------- 2 files changed, 32 insertions(+), 214 deletions(-) diff --git a/libs/main/containers/pideque.h b/libs/main/containers/pideque.h index 1c667601..5724d1af 100644 --- a/libs/main/containers/pideque.h +++ b/libs/main/containers/pideque.h @@ -119,14 +119,12 @@ class PIDeque { public: typedef bool (*CompareFunc)(const T & , const T & ); - //! \~\brief //! \~english Constructs an empty array. //! \~russian Создает пустой массив. inline PIDeque(): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { PIINTROSPECTION_CONTAINER_NEW(T, sizeof(T)) } - //! \~\brief //! \~english Copy constructor. //! \~russian Копирующий конструктор. inline PIDeque(const PIDeque & other): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { @@ -135,7 +133,6 @@ public: newT(pid_data + pid_start, other.pid_data + other.pid_start, pid_size); } - //! \~\brief //! \~english Contructs array from //! [C++11 initializer list](https://en.cppreference.com/w/cpp/utility/initializer_list). //! \~russian Создает массив из @@ -151,7 +148,6 @@ public: newT(pid_data, init_list.begin(), init_list.size()); } - //! \~\brief //! \~english Contructs array from raw `data`. //! This constructor reserve `size` and copy from `data` pointer. //! \~russian Создает массив из указателя на данные `data` и размер `size`. @@ -162,7 +158,6 @@ public: newT(pid_data + pid_start, data, pid_size); } - //! \~\brief //! \~english Contructs array with size `size` filled elements `e`. //! \~russian Создает массив из `size` элементов заполненных `e`. inline PIDeque(size_t pid_size, const T & e = T()): pid_data(0), pid_size(0), pid_rsize(0), pid_start(0) { @@ -170,7 +165,6 @@ public: resize(pid_size, e); } - //! \~\brief //! \~english Contructs array with size `size` and elements created by function `f(size_t i)`. //! \~russian Создает массив из `size` элементов созданных функцией `f(size_t i)`. //! \~\details @@ -189,7 +183,6 @@ public: resize(piv_size, f); } - //! \~\brief //! \~english Move constructor. //! \~russian Перемещающий конструктор. inline PIDeque(PIDeque && other): pid_data(other.pid_data), pid_size(other.pid_size), pid_rsize(other.pid_rsize), pid_start(other.pid_start) { @@ -205,7 +198,6 @@ public: _reset(); } - //! \~\brief //! \~english Assign operator. //! \~russian Оператор присваивания. inline PIDeque & operator =(const PIDeque & other) { @@ -216,7 +208,6 @@ public: return *this; } - //! \~\brief //! \~english Assign move operator. //! \~russian Оператор перемещающего присваивания. inline PIDeque & operator =(PIDeque && other) { @@ -248,8 +239,8 @@ public: ++pos; return *this; } - inline iterator & operator ++(int) { - const auto tmp = *this; + inline iterator operator ++(int) { + auto tmp = *this; ++*this; return tmp; } @@ -257,8 +248,8 @@ public: --pos; return *this; } - inline iterator & operator --(int) { - const auto tmp = *this; + inline iterator operator --(int) { + auto tmp = *this; --*this; return tmp; } @@ -335,8 +326,8 @@ public: ++pos; return *this; } - inline const_iterator & operator ++(int) { - const auto tmp = *this; + inline const_iterator operator ++(int) { + auto tmp = *this; ++*this; return tmp; } @@ -344,8 +335,8 @@ public: --pos; return *this; } - inline const_iterator & operator --(int) { - const auto tmp = *this; + inline const_iterator operator --(int) { + auto tmp = *this; --*this; return tmp; } @@ -424,8 +415,8 @@ public: --pos; return *this; } - inline reverse_iterator & operator ++(int) { - const auto tmp = *this; + inline reverse_iterator operator ++(int) { + auto tmp = *this; --*this; return tmp; } @@ -433,8 +424,8 @@ public: ++pos; return *this; } - inline reverse_iterator & operator --(int) { - const auto tmp = *this; + inline reverse_iterator operator --(int) { + auto tmp = *this; ++*this; return tmp; } @@ -510,8 +501,8 @@ public: --pos; return *this; } - inline const_reverse_iterator & operator ++(int) { - const auto tmp = *this; + inline const_reverse_iterator operator ++(int) { + auto tmp = *this; --*this; return tmp; } @@ -519,8 +510,8 @@ public: ++pos; return *this; } - inline const_reverse_iterator & operator --(int) { - const auto tmp = *this; + inline const_reverse_iterator operator --(int) { + auto tmp = *this; ++*this; return tmp; } @@ -576,7 +567,6 @@ public: }; - //! \~\brief //! \~english Iterator to the first element. //! \~russian Итератор на первый элемент. //! \~\details ![begin, end](doc/images/pivector_begin.png) @@ -587,7 +577,6 @@ public: //! \~\sa \a end(), \a rbegin(), \a rend() inline iterator begin() {return iterator(this, 0);} - //! \~\brief //! \~english Iterator to the element following the last element. //! \~russian Итератор на элемент, следующий за последним элементом. //! \~\details ![begin, end](doc/images/pivector_begin.png) @@ -603,7 +592,6 @@ public: inline const_iterator begin() const {return const_iterator(this, 0); } inline const_iterator end() const {return const_iterator(this, pid_size);} - //! \~\brief //! \~english Returns a reverse iterator to the first element of the reversed array. //! \~russian Обратный итератор на первый элемент. //! \~\details ![rbegin, rend](doc/images/pivector_rbegin.png) @@ -617,7 +605,6 @@ public: //! \~\sa \a rend(), \a begin(), \a end() inline reverse_iterator rbegin() {return reverse_iterator(this, pid_size - 1);} - //! \~\brief //! \~english Returns a reverse iterator to the element //! following the last element of the reversed array. //! \~russian Обратный итератор на элемент, следующий за последним элементом. @@ -636,25 +623,21 @@ public: inline const_reverse_iterator rbegin() const {return const_reverse_iterator(this, pid_size - 1);} inline const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} - //! \~\brief //! \~english Number of elements in the container. //! \~russian Количество элементов массива. //! \~\sa \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline size_t size() const {return pid_size;} - //! \~\brief //! \~english Number of elements in the container as signed value. //! \~russian Количество элементов массива в виде знакового числа. //! \~\sa \a size(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline ssize_t size_s() const {return pid_size;} - //! \~\brief //! \~english Same as \a size(). //! \~russian Синоним \a size(). //! \~\sa \a size(), \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline size_t length() const {return pid_size;} - //! \~\brief //! \~english Number of elements that the container has currently allocated space for. //! \~russian Количество элементов, для которого сейчас выделена память контейнером. //! \~\details @@ -665,7 +648,6 @@ public: inline size_t _start() const {return pid_start;} - //! \~\brief //! \~english Checks if the container has no elements. //! \~russian Проверяет пуст ли контейнер. //! \~\return @@ -674,7 +656,6 @@ public: //! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline bool isEmpty() const {return (pid_size == 0);} - //! \~\brief //! \~english Checks if the container has elements. //! \~russian Проверяет не пуст ли контейнер. //! \~\return @@ -683,7 +664,6 @@ public: //! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline bool isNotEmpty() const {return (pid_size > 0);} - //! \~\brief //! \~english Tests whether at least one element in the array //! passes the test implemented by the provided function `test`. //! \~russian Проверяет, удовлетворяет ли какой-либо элемент массива условию, @@ -709,7 +689,6 @@ public: return false; } - //! \~\brief //! \~english Tests whether all elements in the array passes the test //! implemented by the provided function `test`. //! \~russian Проверяет, удовлетворяют ли все элементы массива условию, @@ -735,7 +714,6 @@ public: return true; } - //! \brief //! \~english Full access to element by `index`. //! \~russian Полный доступ к элементу по индексу `index`. //! \~\details @@ -755,7 +733,6 @@ public: inline T & operator [](size_t index) {return pid_data[pid_start + index];} inline const T & operator [](size_t index) const {return pid_data[pid_start + index];} - //! \brief //! \~english Read only access to element by `index`. //! \~russian Доступ исключительно на чтение к элементу по индексу `index`. //! \~\details @@ -767,7 +744,6 @@ public: //! Иначе это приведёт к неопределённому поведению программы и ошибкам памяти. inline const T & at(size_t index) const {return pid_data[pid_start + index];} - //! \brief //! \~english Last element. //! \~russian Последний элемент массива. //! \~\details @@ -780,7 +756,6 @@ public: inline T & back() {return pid_data[pid_start + pid_size - 1];} inline const T & back() const {return pid_data[pid_start + pid_size - 1];} - //! \brief //! \~english Last element. //! \~russian Первый элемент массива. //! \~\details @@ -793,7 +768,6 @@ public: inline T & front() {return pid_data[pid_start];} inline const T & front() const {return pid_data[pid_start];} - //! \brief //! \~english Compare operator with array `v`. //! \~russian Оператор сравнения с массивом `v`. inline bool operator ==(const PIDeque & v) const { @@ -804,12 +778,10 @@ public: return true; } - //! \brief //! \~english Compare operator with array `v`. //! \~russian Оператор сравнения с массивом `v`. inline bool operator !=(const PIDeque & v) const {return !(*this == v);} - //! \~\brief //! \~english Tests if element `e` exists in the array. //! \~russian Проверяет наличие элемента `e` в массиве. //! \~\details @@ -853,7 +825,6 @@ public: return false; } - //! \~\brief //! \~english Count elements equal `e` in the array. //! \~russian Подсчитывает количество элементов, совпадающих с элементом `e` в массиве. //! \~\details @@ -891,7 +862,6 @@ public: return ec; } - //! \~\brief //! \~english Count elements in the array passes the test implemented by the provided function `test`. //! \~russian Подсчитывает количество элементов в массиве, //! проходящих по условию, заданному в передаваемой функции `test`. @@ -926,7 +896,6 @@ public: return ec; } - //! \~\brief //! \~english Returns the first index at which a given element `e` //! can be found in the array, or `-1` if it is not present. //! \~russian Возвращает первый индекс, по которому данный элемент `e` @@ -969,7 +938,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the first index passes the test implemented by the provided function `test`, //! or `-1` if it is not present. //! can be found in the array, or `-1` if it is not present. @@ -1011,7 +979,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the last index at which a given element `e` //! can be found in the array, or `-1` if it is not present. //! \~russian Возвращает последний индекс, по которому данный элемент `e` @@ -1057,7 +1024,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the last index passes the test implemented by the provided function `test`, //! or `-1` if it is not present. //! \~russian Возвращает последний индекс элемента проходящего по условию, @@ -1094,7 +1060,6 @@ public: return -1; } - //! \~\brief //! \~english Pointer to array //! \~russian Указатель на память массива //! \~\details @@ -1110,7 +1075,6 @@ public: //! \endcode inline T * data(size_t index = 0) {return &(pid_data[pid_start + index]);} - //! \~\brief //! \~english Read only pointer to array //! \~russian Указатель на память массива только для чтения. //! \~\details @@ -1130,7 +1094,6 @@ public: //! \endcode inline const T * data(size_t index = 0) const {return &(pid_data[pid_start + index]);} - //! \~\brief //! \~english Creates sub-array of this array. //! \~russian Создает подмассив, то есть кусок из текущего массива. //! \~english @@ -1153,7 +1116,6 @@ public: return PIDeque(&(pid_data[pid_start + index]), count); } - //! \~\brief //! \~english Clear array, remove all elements. //! \~russian Очищает массив, удаляет все элементы. //! \~\details @@ -1178,7 +1140,6 @@ public: return *this; } - //! \~\brief //! \~english Assigns element 'e' to all items in the array. //! \~russian Заполняет весь массив копиями элемента 'e'. //! \~\details @@ -1197,7 +1158,6 @@ public: return *this; } - //! \~\brief //! \~english Assigns result of function 'f(size_t i)' to all items in the array. //! \~russian Заполняет весь массив результатом вызова функции 'f(size_t i)'. //! \~\details @@ -1216,13 +1176,11 @@ public: return *this; } - //! \~\brief //! \~english Same as \a fill(). //! \~russian Тоже самое что и \a fill(). //! \~\sa \a fill(), \a resize() inline PIDeque & assign(const T & e = T()) {return fill(e);} - //! \~\brief //! \~english First does `resize(new_size)` then `fill(e)`. //! \~russian Сначала делает `resize(new_size)`, затем `fill(e)`. //! \~\sa \a fill(), \a resize() @@ -1241,7 +1199,6 @@ public: return fill(e); } - //! \~\brief //! \~english Sets size of the array, new elements are copied from `e`. //! \~russian Устанавливает размер массива, новые элементы копируются из `e`. //! \~\details @@ -1272,7 +1229,6 @@ public: return *this; } - //! \~\brief //! \~english Sets size of the array, new elements created by function `f(size_t i)`. //! \~russian Устанавливает размер массива, новые элементы создаются функцией `f(size_t i)`. //! \~\details @@ -1321,7 +1277,6 @@ public: newT(dst, src, size); } - //! \~\brief //! \~english Attempts to allocate memory for at least `new_size` elements. //! \~russian Резервируется память под как минимум `new_size` элементов. //! \~\details @@ -1344,7 +1299,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts value `e` at `index` position in the array. //! \~russian Вставляет значение `e` в позицию `index` в массиве. //! \~\details @@ -1376,7 +1330,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts value `e` at `index` position in the array. //! \~russian Вставляет значение `e` в позицию `index` в массиве. //! \~\details @@ -1403,7 +1356,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts array `v` at `index` position in the array. //! \~russian Вставляет массив `v` в позицию `index` в массиве. //! \~\details @@ -1435,7 +1387,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts the given elements at `index` position in the array. //! \~russian Вставляет элементы в позицию `index` в массиве. //! \~\details @@ -1464,7 +1415,6 @@ public: return *this; } - //! \~\brief //! \~english Removes `count` elements from the middle of the array, starting at `index` position. //! \~russian Удаляет элементы из массива, начиная с позиции `index` в количестве `count`. //! \~\details @@ -1496,7 +1446,6 @@ public: return *this; } - //! \~\brief //! \~english Swaps array `v` other with this array. //! \~russian Меняет местами массив `v` с этим массивом. //! \~\details @@ -1509,7 +1458,6 @@ public: piSwap(pid_start, other.pid_start); } - //! \~\brief //! \~english Sorts the elements in non-descending order. //! \~russian Сортировка элементов в порядке возрастания. //! \~\details @@ -1532,7 +1480,6 @@ public: return *this; } - //! \~\brief //! \~english Sorts the elements in non-descending order. //! \~russian Сортировка элементов в порядке возрастания. //! \~\details @@ -1572,7 +1519,6 @@ public: } - //! \~\brief //! \~english Reverses this array. //! \~russian Обращает порядок следования элементов этого массива. //! \~\details @@ -1597,7 +1543,6 @@ public: return *this; } - //! \~\brief //! \~english Returns reversed array. //! \~russian Возвращает перевернутый массив. //! \~\details @@ -1611,7 +1556,6 @@ public: return ret.reverse(); } - //! \~\brief //! \~english Increases or decreases the size of the array by `add_size` elements. //! \~russian Увеличивает или уменьшает размер массива на `add_size` элементов. //! \~\details @@ -1629,7 +1573,6 @@ public: return *this; } - //! \brief //! \~english Remove no more than one element equal `e`. //! \~russian Удаляет первый элемент, который равен элементу `e`. //! \~\details @@ -1649,7 +1592,6 @@ public: return *this; } - //! \brief //! \~english Remove all elements equal `e`. //! \~russian Удаляет все элементы, равные элементу `e`. //! \~\details @@ -1669,7 +1611,6 @@ public: return *this; } - //! \brief //! \~english Remove all elements in the array //! passes the test implemented by the provided function `test`. //! \~russian Удаляет все элементы, удовлетворяющие условию, @@ -1691,7 +1632,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1723,7 +1663,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1737,7 +1676,6 @@ public: return *this; } - //! \brief //! \~english Appends the given elements to the end of the array. //! \~russian Добавляет элементы в конец массива. //! \~\details @@ -1755,7 +1693,6 @@ public: return *this; } - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1775,7 +1712,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1802,7 +1738,6 @@ public: //! \~\sa \a prepend(), \a push_front(), \a push_back(), \a insert() inline PIDeque & append(const T & e) {return push_back(e);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1811,7 +1746,6 @@ public: //! \~\sa \a append() inline PIDeque & append(T && e) {return push_back(std::move(e));} - //! \brief //! \~english Appends the given elements to the end of the array. //! \~russian Добавляет элементы в конец массива. //! \~\details @@ -1824,7 +1758,6 @@ public: //! \~\sa \a append() inline PIDeque & append(std::initializer_list init_list) {return push_back(init_list);} - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1838,7 +1771,6 @@ public: //! \~\sa \a append() inline PIDeque & append(const PIDeque & v) {return push_back(v);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1850,7 +1782,6 @@ public: //! \~\sa \a append() inline PIDeque & operator <<(const T & e) {return push_back(e);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1862,7 +1793,6 @@ public: //! \~\sa \a append() inline PIDeque & operator <<(T && e) {return push_back(std::move(e));} - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1874,7 +1804,6 @@ public: //! \~\sa \a append(), \a push_back() inline PIDeque & operator <<(const PIDeque & v) {return append(v);} - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1904,7 +1833,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1916,7 +1844,6 @@ public: return *this; } - //! \brief //! \~english Appends the given array `v` to the begin of the array. //! \~russian Добавляет массив `v` в начало массива. //! \~\details @@ -1933,7 +1860,6 @@ public: return *this; } - //! \brief //! \~english Appends the given elements to the begin of the array. //! \~russian Добавляет элементы в начало массива. //! \~\details @@ -1949,7 +1875,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1976,7 +1901,6 @@ public: //! \~\sa \a push_back(), \a append(), \a prepend(), \a insert() inline PIDeque & prepend(const T & e) {return push_front(e);} - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1985,7 +1909,6 @@ public: //! \~\sa \a prepend() inline PIDeque & prepend(T && e) {return push_front(std::move(e));} - //! \brief //! \~english Appends the given array `v` to the begin of the array. //! \~russian Добавляет массив `v` в начало массива. //! \~\details @@ -1999,7 +1922,6 @@ public: //! \~\sa \a prepend() inline PIDeque & prepend(const PIDeque & v) {return push_front(v);} - //! \brief //! \~english Appends the given elements to the begin of the array. //! \~russian Добавляет элементы в начало массива. //! \~\details @@ -2012,7 +1934,6 @@ public: //! \~\sa \a append() inline PIDeque & prepend(std::initializer_list init_list) {return prepend(init_list);} - //! \brief //! \~english Remove one element from the end of the array. //! \~russian Удаляет один элемент с конца массива. //! \~\details @@ -2032,7 +1953,6 @@ public: return *this; } - //! \brief //! \~english Remove one element from the begining of the array. //! \~russian Удаляет один элемент с начала массива. //! \~\details @@ -2054,7 +1974,6 @@ public: return *this; } - //! \brief //! \~english Remove one element from the end of the array and return it. //! \~russian Удаляет один элемент с начала массива и возвращает его. //! \~\details @@ -2070,7 +1989,6 @@ public: return e; } - //! \brief //! \~english Remove one element from the begining of the array and return it. //! \~russian Удаляет один элемент с конца массива и возвращает его. //! \~\details @@ -2086,7 +2004,6 @@ public: return e; } - //! \brief //! \~english Returns an array converted to another type. //! \~russian Возвращает конвертированный в другой тип массив. //! \~\details @@ -2105,7 +2022,6 @@ public: return ret; } - //! \brief //! \~english Returns a new array with all elements //! that pass the test implemented by the provided function `test`. //! \~russian Возвращает новый массив со всеми элементами, @@ -2125,7 +2041,6 @@ public: return ret; } - //! \brief //! \~english Execute function `void f(const T & e)` for every element in array. //! \~russian Выполняет функцию `void f(const T & e)` для каждого элемента массива. //! \~\details @@ -2146,7 +2061,6 @@ public: } } - //! \brief //! \~english Execute function `void f(T & e)` for every element in array. //! \~russian Выполняет функцию `void f(T & e)` для каждого элемента массива. //! \~\details @@ -2167,7 +2081,6 @@ public: return *this; } - //! \brief //! \~english Сreates a new array populated with the results //! of calling a provided function `ST f(const T & e)` on every element in the calling array. //! \~russian Создаёт новый массив с результатом вызова указанной функции @@ -2194,7 +2107,6 @@ public: return ret; } - //! \brief //! \~english Applies the function `ST f(const T & e, const ST & acc)` //! to each element of the array (from left to right), returns one value. //! \~russian Применяет функцию `ST f(const T & e, const ST & acc)` @@ -2245,7 +2157,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the array, creates a two-dimensional array from a one-dimensional array. //! \~russian Изменяет размерность массива, из одномерного массива создает двухмерный. //! \~\details @@ -2291,7 +2202,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the array, creates a one-dimensional array from a two-dimensional array. //! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный. //! \~\details @@ -2331,7 +2241,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the two-dimensional array. //! \~russian Изменяет размерность двухмерного массива. //! \~\details diff --git a/libs/main/containers/pivector.h b/libs/main/containers/pivector.h index 11631a44..bbfbc18c 100644 --- a/libs/main/containers/pivector.h +++ b/libs/main/containers/pivector.h @@ -119,14 +119,12 @@ class PIVector { public: typedef bool (*CompareFunc)(const T & , const T & ); - //! \~\brief //! \~english Constructs an empty array. //! \~russian Создает пустой массив. inline PIVector(): piv_data(0), piv_size(0), piv_rsize(0) { PIINTROSPECTION_CONTAINER_NEW(T, sizeof(T)) } - //! \~\brief //! \~english Contructs array from raw `data`. //! This constructor reserve `size` and copy from `data` pointer. //! \~russian Создает массив из указателя на данные `data` и размер `size`. @@ -137,7 +135,6 @@ public: newT(piv_data, data, piv_size); } - //! \~\brief //! \~english Copy constructor. //! \~russian Копирующий конструктор. inline PIVector(const PIVector & v): piv_data(0), piv_size(0), piv_rsize(0) { @@ -146,7 +143,6 @@ public: newT(piv_data, v.piv_data, piv_size); } - //! \~\brief //! \~english Contructs array from //! [C++11 initializer list](https://en.cppreference.com/w/cpp/utility/initializer_list). //! \~russian Создает массив из @@ -162,7 +158,6 @@ public: newT(piv_data, init_list.begin(), init_list.size()); } - //! \~\brief //! \~english Contructs array with size `size` filled elements `e`. //! \~russian Создает массив из `size` элементов заполненных `e`. inline PIVector(size_t size, const T & e = T()): piv_data(0), piv_size(0), piv_rsize(0) { @@ -170,7 +165,6 @@ public: resize(size, e); } - //! \~\brief //! \~english Contructs array with size `size` and elements created by function `f(size_t i)`. //! \~russian Создает массив из `size` элементов созданных функцией `f(size_t i)`. //! \~\details @@ -189,7 +183,6 @@ public: resize(size, f); } - //! \~\brief //! \~english Move constructor. //! \~russian Перемещающий конструктор. inline PIVector(PIVector && v): piv_data(v.piv_data), piv_size(v.piv_size), piv_rsize(v.piv_rsize) { @@ -205,7 +198,6 @@ public: _reset(); } - //! \~\brief //! \~english Assign operator. //! \~russian Оператор присваивания. inline PIVector & operator =(const PIVector & v) { @@ -217,7 +209,6 @@ public: return *this; } - //! \~\brief //! \~english Assign move operator. //! \~russian Оператор перемещающего присваивания. inline PIVector & operator =(PIVector && v) { @@ -249,8 +240,8 @@ public: ++pos; return *this; } - inline iterator & operator ++(int) { - const auto tmp = *this; + inline iterator operator ++(int) { + auto tmp = *this; ++*this; return tmp; } @@ -258,8 +249,8 @@ public: --pos; return *this; } - inline iterator & operator --(int) { - const auto tmp = *this; + inline iterator operator --(int) { + auto tmp = *this; --*this; return tmp; } @@ -336,8 +327,8 @@ public: ++pos; return *this; } - inline const_iterator & operator ++(int) { - const auto tmp = *this; + inline const_iterator operator ++(int) { + auto tmp = *this; ++*this; return tmp; } @@ -345,8 +336,8 @@ public: --pos; return *this; } - inline const_iterator & operator --(int) { - const auto tmp = *this; + inline const_iterator operator --(int) { + auto tmp = *this; --*this; return tmp; } @@ -425,8 +416,8 @@ public: --pos; return *this; } - inline reverse_iterator & operator ++(int) { - const auto tmp = *this; + inline reverse_iterator operator ++(int) { + auto tmp = *this; --*this; return tmp; } @@ -434,8 +425,8 @@ public: ++pos; return *this; } - inline reverse_iterator & operator --(int) { - const auto tmp = *this; + inline reverse_iterator operator --(int) { + auto tmp = *this; ++*this; return tmp; } @@ -511,8 +502,8 @@ public: --pos; return *this; } - inline const_reverse_iterator & operator ++(int) { - const auto tmp = *this; + inline const_reverse_iterator operator ++(int) { + auto tmp = *this; --*this; return tmp; } @@ -520,8 +511,8 @@ public: ++pos; return *this; } - inline const_reverse_iterator & operator --(int) { - const auto tmp = *this; + inline const_reverse_iterator operator --(int) { + auto tmp = *this; ++*this; return tmp; } @@ -576,7 +567,6 @@ public: } }; - //! \~\brief //! \~english Iterator to the first element. //! \~russian Итератор на первый элемент. //! \~\details ![begin, end](doc/images/pivector_begin.png) @@ -587,7 +577,6 @@ public: //! \~\sa \a end(), \a rbegin(), \a rend() inline iterator begin() {return iterator(this, 0);} - //! \~\brief //! \~english Iterator to the element following the last element. //! \~russian Итератор на элемент, следующий за последним элементом. //! \~\details ![begin, end](doc/images/pivector_begin.png) @@ -603,7 +592,6 @@ public: inline const_iterator begin() const {return const_iterator(this, 0);} inline const_iterator end() const {return const_iterator(this, piv_size);} - //! \~\brief //! \~english Returns a reverse iterator to the first element of the reversed array. //! \~russian Обратный итератор на первый элемент. //! \~\details ![rbegin, rend](doc/images/pivector_rbegin.png) @@ -617,7 +605,6 @@ public: //! \~\sa \a rend(), \a begin(), \a end() inline reverse_iterator rbegin() {return reverse_iterator(this, piv_size - 1);} - //! \~\brief //! \~english Returns a reverse iterator to the element //! following the last element of the reversed array. //! \~russian Обратный итератор на элемент, следующий за последним элементом. @@ -636,25 +623,21 @@ public: inline const_reverse_iterator rbegin() const {return const_reverse_iterator(this, piv_size - 1);} inline const_reverse_iterator rend() const {return const_reverse_iterator(this, -1);} - //! \~\brief //! \~english Number of elements in the container. //! \~russian Количество элементов массива. //! \~\sa \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline size_t size() const {return piv_size;} - //! \~\brief //! \~english Number of elements in the container as signed value. //! \~russian Количество элементов массива в виде знакового числа. //! \~\sa \a size(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline ssize_t size_s() const {return piv_size;} - //! \~\brief //! \~english Same as \a size(). //! \~russian Синоним \a size(). //! \~\sa \a size(), \a size_s(), \a capacity(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline size_t length() const {return piv_size;} - //! \~\brief //! \~english Number of elements that the container has currently allocated space for. //! \~russian Количество элементов, для которого сейчас выделена память контейнером. //! \~\details @@ -663,7 +646,6 @@ public: //! \~\sa \a reserve(), \a size(), \a size_s() inline size_t capacity() const {return piv_rsize;} - //! \~\brief //! \~english Checks if the container has no elements. //! \~russian Проверяет пуст ли контейнер. //! \~\return @@ -672,7 +654,6 @@ public: //! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline bool isEmpty() const {return (piv_size == 0);} - //! \~\brief //! \~english Checks if the container has elements. //! \~russian Проверяет не пуст ли контейнер. //! \~\return @@ -681,7 +662,6 @@ public: //! \~\sa \a size(), \a size_s(), \a isEmpty(), \a isNotEmpty(), \a resize(), \a reserve() inline bool isNotEmpty() const {return (piv_size > 0);} - //! \~\brief //! \~english Tests whether at least one element in the array //! passes the test implemented by the provided function `test`. //! \~russian Проверяет, удовлетворяет ли какой-либо элемент массива условию, @@ -707,7 +687,6 @@ public: return false; } - //! \~\brief //! \~english Tests whether all elements in the array passes the test //! implemented by the provided function `test`. //! \~russian Проверяет, удовлетворяют ли все элементы массива условию, @@ -733,7 +712,6 @@ public: return true; } - //! \brief //! \~english Full access to element by `index`. //! \~russian Полный доступ к элементу по индексу `index`. //! \~\details @@ -753,7 +731,6 @@ public: inline T & operator [](size_t index) {return piv_data[index];} inline const T & operator [](size_t index) const {return piv_data[index];} - //! \brief //! \~english Read only access to element by `index`. //! \~russian Доступ исключительно на чтение к элементу по индексу `index`. //! \~\details @@ -765,7 +742,6 @@ public: //! Иначе это приведёт к неопределённому поведению программы и ошибкам памяти. inline const T & at(size_t index) const {return piv_data[index];} - //! \brief //! \~english Last element. //! \~russian Последний элемент массива. //! \~\details @@ -778,7 +754,6 @@ public: inline T & back() {return piv_data[piv_size - 1];} inline const T & back() const {return piv_data[piv_size - 1];} - //! \brief //! \~english Last element. //! \~russian Первый элемент массива. //! \~\details @@ -791,7 +766,6 @@ public: inline T & front() {return piv_data[0];} inline const T & front() const {return piv_data[0];} - //! \brief //! \~english Compare operator with array `v`. //! \~russian Оператор сравнения с массивом `v`. inline bool operator ==(const PIVector & v) const { @@ -802,12 +776,10 @@ public: return true; } - //! \brief //! \~english Compare operator with array `v`. //! \~russian Оператор сравнения с массивом `v`. inline bool operator !=(const PIVector & v) const {return !(*this == v);} - //! \~\brief //! \~english Tests if element `e` exists in the array. //! \~russian Проверяет наличие элемента `e` в массиве. //! \~\details @@ -851,7 +823,6 @@ public: return false; } - //! \~\brief //! \~english Count elements equal `e` in the array. //! \~russian Подсчитывает количество элементов, совпадающих с элементом `e` в массиве. //! \~\details @@ -889,7 +860,6 @@ public: return ec; } - //! \~\brief //! \~english Count elements in the array passes the test implemented by the provided function `test`. //! \~russian Подсчитывает количество элементов в массиве, //! проходящих по условию, заданному в передаваемой функции `test`. @@ -924,7 +894,6 @@ public: return ec; } - //! \~\brief //! \~english Returns the first index at which a given element `e` //! can be found in the array, or `-1` if it is not present. //! \~russian Возвращает первый индекс, по которому данный элемент `e` @@ -965,7 +934,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the first index passes the test implemented by the provided function `test`, //! or `-1` if it is not present. //! can be found in the array, or `-1` if it is not present. @@ -1005,7 +973,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the last index at which a given element `e` //! can be found in the array, or `-1` if it is not present. //! \~russian Возвращает последний индекс, по которому данный элемент `e` @@ -1049,7 +1016,6 @@ public: return -1; } - //! \~\brief //! \~english Returns the last index passes the test implemented by the provided function `test`, //! or `-1` if it is not present. //! \~russian Возвращает последний индекс элемента проходящего по условию, @@ -1084,7 +1050,6 @@ public: return -1; } - //! \~\brief //! \~english Pointer to array //! \~russian Указатель на память массива //! \~\details @@ -1100,7 +1065,6 @@ public: //! \endcode inline T * data(size_t index = 0) {return &(piv_data[index]);} - //! \~\brief //! \~english Read only pointer to array //! \~russian Указатель на память массива только для чтения. //! \~\details @@ -1120,7 +1084,6 @@ public: //! \endcode inline const T * data(size_t index = 0) const {return &(piv_data[index]);} - //! \~\brief //! \~english Creates sub-array of this array. //! \~russian Создает подмассив, то есть кусок из текущего массива. //! \~english @@ -1143,7 +1106,6 @@ public: return PIVector(&(piv_data[index]), count); } - //! \~\brief //! \~english Clear array, remove all elements. //! \~russian Очищает массив, удаляет все элементы. //! \~\details @@ -1167,7 +1129,6 @@ public: return *this; } - //! \~\brief //! \~english Assigns element 'e' to all items in the array. //! \~russian Заполняет весь массив копиями элемента 'e'. //! \~\details @@ -1186,7 +1147,6 @@ public: return *this; } - //! \~\brief //! \~english Assigns result of function 'f(size_t i)' to all items in the array. //! \~russian Заполняет весь массив результатом вызова функции 'f(size_t i)'. //! \~\details @@ -1205,13 +1165,11 @@ public: return *this; } - //! \~\brief //! \~english Same as \a fill(). //! \~russian Тоже самое что и \a fill(). //! \~\sa \a fill(), \a resize() inline PIVector & assign(const T & e = T()) {return fill(e);} - //! \~\brief //! \~english First does `resize(new_size)` then `fill(e)`. //! \~russian Сначала делает `resize(new_size)`, затем `fill(e)`. //! \~\sa \a fill(), \a resize() @@ -1230,7 +1188,6 @@ public: return fill(f); } - //! \~\brief //! \~english Sets size of the array, new elements are copied from `e`. //! \~russian Устанавливает размер массива, новые элементы копируются из `e`. //! \~\details @@ -1259,7 +1216,6 @@ public: return *this; } - //! \~\brief //! \~english Sets size of the array, new elements created by function `f(size_t i)`. //! \~russian Устанавливает размер массива, новые элементы создаются функцией `f(size_t i)`. //! \~\details @@ -1306,7 +1262,6 @@ public: newT(dst, src, size); } - //! \~\brief //! \~english Attempts to allocate memory for at least `new_size` elements. //! \~russian Резервируется память под как минимум `new_size` элементов. //! \~\details @@ -1329,7 +1284,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts value `e` at `index` position in the array. //! \~russian Вставляет значение `e` в позицию `index` в массиве. //! \~\details @@ -1352,7 +1306,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts value `e` at `index` position in the array. //! \~russian Вставляет значение `e` в позицию `index` в массиве. //! \~\details @@ -1370,7 +1323,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts array `v` at `index` position in the array. //! \~russian Вставляет массив `v` в позицию `index` в массиве. //! \~\details @@ -1394,7 +1346,6 @@ public: return *this; } - //! \~\brief //! \~english Inserts the given elements at `index` position in the array. //! \~russian Вставляет элементы в позицию `index` в массиве. //! \~\details @@ -1415,7 +1366,6 @@ public: return *this; } - //! \~\brief //! \~english Removes `count` elements from the middle of the array, starting at `index` position. //! \~russian Удаляет элементы из массива, начиная с позиции `index` в количестве `count`. //! \~\details @@ -1438,7 +1388,6 @@ public: return *this; } - //! \~\brief //! \~english Swaps array `v` other with this array. //! \~russian Меняет местами массив `v` с этим массивом. //! \~\details @@ -1450,7 +1399,6 @@ public: piSwap(piv_rsize, v.piv_rsize); } - //! \~\brief //! \~english Sorts the elements in non-descending order. //! \~russian Сортировка элементов в порядке возрастания. //! \~\details @@ -1473,7 +1421,6 @@ public: return *this; } - //! \~\brief //! \~english Sorts the elements in non-descending order. //! \~russian Сортировка элементов в порядке возрастания. //! \~\details @@ -1512,7 +1459,6 @@ public: return *this; } - //! \~\brief //! \~english Reverses this array. //! \~russian Обращает порядок следования элементов этого массива. //! \~\details @@ -1537,7 +1483,6 @@ public: return *this; } - //! \~\brief //! \~english Returns reversed array. //! \~russian Возвращает перевернутый массив. //! \~\details @@ -1551,7 +1496,6 @@ public: return ret.reverse(); } - //! \~\brief //! \~english Increases or decreases the size of the array by `add_size` elements. //! \~russian Увеличивает или уменьшает размер массива на `add_size` элементов. //! \~\details @@ -1569,7 +1513,6 @@ public: return *this; } - //! \brief //! \~english Remove no more than one element equal `e`. //! \~russian Удаляет первый элемент, который равен элементу `e`. //! \~\details @@ -1589,7 +1532,6 @@ public: return *this; } - //! \brief //! \~english Remove all elements equal `e`. //! \~russian Удаляет все элементы, равные элементу `e`. //! \~\details @@ -1609,7 +1551,6 @@ public: return *this; } - //! \brief //! \~english Remove all elements in the array //! passes the test implemented by the provided function `test`. //! \~russian Удаляет все элементы, удовлетворяющие условию, @@ -1631,7 +1572,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1663,7 +1603,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1677,7 +1616,6 @@ public: return *this; } - //! \brief //! \~english Appends the given elements to the end of the array. //! \~russian Добавляет элементы в конец массива. //! \~\details @@ -1695,7 +1633,6 @@ public: return *this; } - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1715,7 +1652,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1743,7 +1679,6 @@ public: //! \~\sa \a prepend(), \a push_front(), \a push_back(), \a insert() inline PIVector & append(const T & e) {return push_back(e);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1752,7 +1687,6 @@ public: //! \~\sa \a append() inline PIVector & append(T && e) {return push_back(std::move(e));} - //! \brief //! \~english Appends the given elements to the end of the array. //! \~russian Добавляет элементы в конец массива. //! \~\details @@ -1765,7 +1699,6 @@ public: //! \~\sa \a append() inline PIVector & append(std::initializer_list init_list) {return push_back(init_list);} - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1779,7 +1712,6 @@ public: //! \~\sa \a append() inline PIVector & append(const PIVector & v) {return push_back(v);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1791,7 +1723,6 @@ public: //! \~\sa \a append() inline PIVector & operator <<(const T & e) {return push_back(e);} - //! \brief //! \~english Appends the given element `e` to the end of the array. //! \~russian Добавляет элемент `e` в конец массива. //! \~\details @@ -1803,7 +1734,6 @@ public: //! \~\sa \a append() inline PIVector & operator <<(T && e) {return push_back(std::move(e));} - //! \brief //! \~english Appends the given array `v` to the end of the array. //! \~russian Добавляет массив `v` в конец массива. //! \~\details @@ -1815,7 +1745,6 @@ public: //! \~\sa \a append() inline PIVector & operator <<(const PIVector & v) {return push_back(v);} - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1837,7 +1766,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1849,7 +1777,6 @@ public: return *this; } - //! \brief //! \~english Appends the given array `v` to the begin of the array. //! \~russian Добавляет массив `v` в начало массива. //! \~\details @@ -1866,7 +1793,6 @@ public: return *this; } - //! \brief //! \~english Appends the given elements to the begin of the array. //! \~russian Добавляет элементы в начало массива. //! \~\details @@ -1882,7 +1808,6 @@ public: return *this; } - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1901,7 +1826,6 @@ public: //! \~\sa \a append(), \a push_back(), \a push_front(), \a insert() inline PIVector & prepend(const T & e) {return push_front(e);} - //! \brief //! \~english Appends the given element `e` to the begin of the array. //! \~russian Добавляет элемент `e` в начало массива. //! \~\details @@ -1910,7 +1834,6 @@ public: //! \~\sa \a prepend() inline PIVector & prepend(T && e) {return push_front(std::move(e));} - //! \brief //! \~english Appends the given array `v` to the begin of the array. //! \~russian Добавляет массив `v` в начало массива. //! \~\details @@ -1924,7 +1847,6 @@ public: //! \~\sa \a prepend() inline PIVector & prepend(const PIVector & v) {return push_front(v);} - //! \brief //! \~english Appends the given elements to the begin of the array. //! \~russian Добавляет элементы в начало массива. //! \~\details @@ -1937,7 +1859,6 @@ public: //! \~\sa \a append() inline PIVector & prepend(std::initializer_list init_list) {return prepend(init_list);} - //! \brief //! \~english Remove one element from the end of the array. //! \~russian Удаляет один элемент с конца массива. //! \~\details @@ -1957,7 +1878,6 @@ public: return *this; } - //! \brief //! \~english Remove one element from the begining of the array. //! \~russian Удаляет один элемент с начала массива. //! \~\details @@ -1979,7 +1899,6 @@ public: return *this; } - //! \brief //! \~english Remove one element from the end of the array and return it. //! \~russian Удаляет один элемент с начала массива и возвращает его. //! \~\details @@ -1995,7 +1914,6 @@ public: return e; } - //! \brief //! \~english Remove one element from the begining of the array and return it. //! \~russian Удаляет один элемент с конца массива и возвращает его. //! \~\details @@ -2011,7 +1929,6 @@ public: return e; } - //! \brief //! \~english Returns an array converted to another type. //! \~russian Возвращает конвертированный в другой тип массив. //! \~\details @@ -2030,7 +1947,6 @@ public: return ret; } - //! \brief //! \~english Returns a new array with all elements //! that pass the test implemented by the provided function `test`. //! \~russian Возвращает новый массив со всеми элементами, @@ -2050,7 +1966,6 @@ public: return ret; } - //! \brief //! \~english Execute function `void f(const T & e)` for every element in array. //! \~russian Выполняет функцию `void f(const T & e)` для каждого элемента массива. //! \~\details @@ -2071,7 +1986,6 @@ public: } } - //! \brief //! \~english Execute function `void f(T & e)` for every element in array. //! \~russian Выполняет функцию `void f(T & e)` для каждого элемента массива. //! \~\details @@ -2092,7 +2006,6 @@ public: return *this; } - //! \brief //! \~english Сreates a new array populated with the results //! of calling a provided function `ST f(const T & e)` on every element in the calling array. //! \~russian Создаёт новый массив с результатом вызова указанной функции @@ -2119,7 +2032,6 @@ public: return ret; } - //! \brief //! \~english Applies the function `ST f(const T & e, const ST & acc)` //! to each element of the array (from left to right), returns one value. //! \~russian Применяет функцию `ST f(const T & e, const ST & acc)` @@ -2170,7 +2082,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the array, creates a two-dimensional array from a one-dimensional array. //! \~russian Изменяет размерность массива, из одномерного массива создает двухмерный. //! \~\details @@ -2216,7 +2127,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the array, creates a one-dimensional array from a two-dimensional array. //! \~russian Изменяет размерность массива, из двухмерный массива создает одномерный. //! \~\details @@ -2256,7 +2166,6 @@ public: return ret; } - //! \brief //! \~english Changes the dimension of the two-dimensional array. //! \~russian Изменяет размерность двухмерного массива. //! \~\details