ОБ ОДНОМ АЛГОРИТМЕ НЕСТАНДАРТНОЙ ТРАНСФОРМАЦИИ ОДНОМЕРНОГО ЧИСЛОВОГО МАССИВА В ДВУМЕРНЫЙ МАССИВ

ON A NON-STANDARD TRANSFORMATION ALGORITHM OF ONE-MEASURED NUMERICAL SET OF LATTICE POINTS TO A TWO-DIMENSIONAL SET OF LATTICEPOINTS


Зарубин Михаил Михайлович – кандидат физико-математических наук, доцент кафедры прикладной математики и информатики Комсомольского-на-Амуре государственного технического университета (Россия, г. Комсомольск-на-Амуре). E-mail: zmm52@mail.ru.

Mr. Michael M. Zarubin – PhD in Physics and Mathematics, Associate Professor, Applied Mathematics and Informatics Department, Komsomolsk-on-Amur State Technical University (Russia, Komsomolsk-on-Amur). E-mail: zmm52@mail.ru.


Аннотация. Предложен алгоритм заполнения прямоугольной матрицы размеров элементами сформированного одномерного числового массива по заданной непрерывной кривой. В отличие от традиционных алгоритмов решения задачи для некоторых модельных случаев (например, при заполнении прямоугольной матрицы по спирали) предложенный алгоритм не требует громоздких математических расчетов и легко адаптируется под конкретную геометрию нестандартного заполнения матрицы («кривой заполнения»). Это достигается организацией «препятствий» в процессе заполнения матрицы последовательно поступающими элементами исходного одномерного массива и переключением направления «движения» в соответствии с заданной схемой («кривой заполнения»). Приводится описание алгоритма для одной из модельных постановок задачи (заполнение по спирали по часовой стрелке, начиная с «северо-западного угла» матрицы) и его реализация на языке PASCAL (исходный текст программы и соответствующие скриншоты). В качестве исходного одномерного массива используется массив последовательных простых чисел, сгенерированных методом «решета Эратосфена».

Summary. An algorithm is proposed for filling a rectangular matrix of elements of a formed one-dimensional numerical set of lattice points with a given continuous curve. Unlike traditional problem solving algorithms for some model cases (for example, when a rectangular matrix is spirally filled), the proposed algorithm does not require cumbersome mathematical calculations and is easily adapted to the specific geometry of non-standard matrix filling ("filling curve"). This is achieved by the organization of "obstacles" in the process of filling the matrix with consecutive incoming elements of the original one-dimensional set of lattice points and switching the direction of "motion", in accordance with the specified scheme ("filling curve"). The description of the algorithm for one of the model productions of the problem (filling in a clockwise spiral, starting from the "north-west corner" of the matrix) and its implementation in PASCAL (the source code of the program and the corresponding screenshots) is given. As the initial one-dimensional set of lattice points, set of lattice points of successive prime numbers generated by the "Eratosthenes» method is used.


Ключевые слова: алгоритм, матрица, нестандартное заполнение.

Key words: algorithm, matrix, non-standard filling.


«Ученые записки КнАГТУ». № II - 1(30) 2017 «Науки о природе и технике», с. 45 - 49

«Scholarly Notes of Komsomolsk-na-Amure State Technical University». Issue II - 1(30) 2017 «Engineering and Natural Sciences», p. 45 - 49


DOI 10.17084/2017.II-1(30).7


References


1. Brudno, A. L. Olimpiady po programmirovaniiu dlia shkolnikov / A. L. Brudno, L. I. Kaplan; pod red. B. N. Naumova. – M.: Nauka. Glavnaia redaktsiia fiziko-matematicheskoi literatury, 1985. – 96 s.

2. Nemnogin, S. A. Turbo Pascal / S. A. Nemnogin. – SPb.: Piter, 2003. – 492 s.


Ссылка на текст статьи

Текст статьи в журнале

Text of article in journal


© 2017 M. M. Zarubin . This is an Open Access article distributed under the terms of the Russian Index of Science Citation License http://www.uzknastu.ru/files/forautors/en/License%20Agreement.doc, allowing third parties to copy and redistribute the material in any medium or format and to remix, transform, and build upon the material for any purpose, even commercially, provided the original work is properly cited and states its license.


© 2017 Зарубин М. М. Данная статья находится в Открытом Доступе и распространяется на условиях лицензии Российского Индекса Научного цитирования http://www.uzknastu.ru/files/forautors/en/License%20Agreement.doc, в соответствии с которыми третьи лица имеют право копировать и повторно распространять этот материал на любых носителях и в любом формате, а также микшировать, изменять и использовать в качестве основы для любых целей, в том числе коммерческих, при условии, что на оригинальное произведение сделаны должным образом оформленные ссылки и что приведена информация о действующей в отношении него лицензии.


Лицензия Creative Commons

Произведение «ОБ ОДНОМ АЛГОРИТМЕ НЕСТАНДАРТНОЙ ТРАНСФОРМАЦИИ ОДНОМЕРНОГО ЧИСЛОВОГО МАССИВА В ДВУМЕРНЫЙ МАССИВ» созданное автором по имени Зарубин М. М., публикуется на условиях лицензии Creative Commons «Attribution» («Атрибуция») 4.0 Всемирная
Основано на произведении с http://www.uzknastu.ru/files/translit/2017/II-1(30)/7.htm