VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
PairInt.h
Go to the documentation of this file.
1/*--------------------------------*- VM2D -*-----------------*---------------*\
2| ## ## ## ## #### ##### | | Version 1.14 |
3| ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2026/03/06 |
4| ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------*
5| #### ## ## ## ## ## | Open Source Code |
6| ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D |
7| |
8| Copyright (C) 2017-2026 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova |
9*-----------------------------------------------------------------------------*
10| File name: PairInt.h |
11| Info: Source code of VM2D |
12| |
13| This file is part of VM2D. |
14| VM2D is free software: you can redistribute it and/or modify it |
15| under the terms of the GNU General Public License as published by |
16| the Free Software Foundation, either version 3 of the License, or |
17| (at your option) any later version. |
18| |
19| VM2D is distributed in the hope that it will be useful, but WITHOUT |
20| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22| for more details. |
23| |
24| You should have received a copy of the GNU General Public License |
25| along with VM2D. If not, see <http://www.gnu.org/licenses/>. |
26\*---------------------------------------------------------------------------*/
27
28
40#ifndef PAIRINT_H_
41#define PAIRINT_H_
42
43#include "numvector.h"
44
45namespace VMlib
46{
57 class PairInt : public numvector<int, 2>
58 {
59 public:
61 PairInt() { };
62
66 PairInt(const numvector<int, 2>& _r) { data[0] = _r[0];data[1] = _r[1]; };
67
71 PairInt(const PairInt& _r) { data[0] = _r[0];data[1] = _r[1]; };
72
73#if !defined(__CUDACC__)
78 PairInt(const std::initializer_list<int>& z) {
79 for (size_t i = 0; i < 2; ++i)
80 data[i] = *(z.begin() + i);
81 };
82#endif
83
85 ~PairInt() { };
86 };
87
88
89 inline std::pair<PairInt, PairInt>& operator+=(std::pair<PairInt, PairInt>& a, const std::pair<PairInt, PairInt>& b)
90 {
91 a.first += b.first;
92 a.second += b.second;
93 return a;
94 }//operator+=(...)
95
96}//namespace VMlib
97
98using VMlib::PairInt;
99
100#endif
101
Класс, опеделяющий пару целых чисел
Definition PairInt.h:58
~PairInt()
Деструктор
Definition PairInt.h:85
PairInt(const numvector< int, 2 > &_r)
Конструктор и приведение типа из numvector<int, 2>
Definition PairInt.h:66
PairInt(const PairInt &_r)
Конструктор копирования
Definition PairInt.h:71
PairInt(const std::initializer_list< int > &z)
Конструктор инициализации списком
Definition PairInt.h:78
PairInt()
Пустой конструктор
Definition PairInt.h:61
Шаблонный класс, определяющий вектор фиксированной длины Фактически представляет собой массив,...
Definition numvector.h:99
std::pair< numvector< T, n >, numvector< P, n > > & operator+=(std::pair< numvector< T, n >, numvector< P, n > > &a, const std::pair< numvector< R, n >, numvector< S, n > > &b)
Оператор прибавления "+=" для пар векторов
Definition numvector.h:895
Описание класса numvector.