-
Notifications
You must be signed in to change notification settings - Fork 1
/
fix_Array_windows.patch
215 lines (189 loc) · 6.07 KB
/
fix_Array_windows.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
Index: include/ogdf/basic/Array2D.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/include/ogdf/basic/Array2D.h b/include/ogdf/basic/Array2D.h
--- a/include/ogdf/basic/Array2D.h (revision a4546cc009a133e174dceea02bca6eb45126e35a)
+++ b/include/ogdf/basic/Array2D.h (date 1700144964118)
@@ -201,9 +201,11 @@
void copy(const Array2D<E>& array2);
};
+}
+
//! Constructs the array with index set [\p a, ..., \p b]*[\p c, ..., \p d].
template<class E>
-void Array2D<E>::construct(int a, int b, int c, int d) {
+void ogdf::Array2D<E>::construct(int a, int b, int c, int d) {
m_a = a;
m_b = b;
m_c = c;
@@ -229,7 +231,7 @@
//! Initializes the array with default constructor of \a E.
template<class E>
-void Array2D<E>::initialize() {
+void ogdf::Array2D<E>::initialize() {
E* pDest = m_pStart;
try {
for (; pDest < m_pStop; pDest++) {
@@ -246,7 +248,7 @@
//! Initializes the array with \p x.
template<class E>
-void Array2D<E>::initialize(const E& x) {
+void ogdf::Array2D<E>::initialize(const E& x) {
E* pDest = m_pStart;
try {
for (; pDest < m_pStop; pDest++) {
@@ -263,7 +265,7 @@
//! Call destructor of all elements.
template<class E>
-void Array2D<E>::deconstruct() {
+void ogdf::Array2D<E>::deconstruct() {
if (!std::is_trivially_destructible<E>::value) {
for (E* pDest = m_pStart; pDest < m_pStop; pDest++) {
pDest->~E();
@@ -274,7 +276,7 @@
//! Copy \p array2.
template<class E>
-void Array2D<E>::copy(const Array2D<E>& array2) {
+void ogdf::Array2D<E>::copy(const ogdf::Array2D<E>& array2) {
construct(array2.m_a, array2.m_b, array2.m_c, array2.m_d);
if (m_pStart != 0) {
@@ -288,7 +290,7 @@
//! Computes the determinant via row expansion.
template<class E>
-float Array2D<E>::det() const {
+float ogdf::Array2D<E>::det() const {
// matrix must be quadratic
OGDF_ASSERT(size1() == size2());
@@ -315,7 +317,7 @@
// Expanding along the first row (Laplace's Formula)
default:
- Array2D<E> remMatrix(0, n - 2, 0, n - 2); // the remaining matrix
+ ogdf::Array2D<E> remMatrix(0, n - 2, 0, n - 2); // the remaining matrix
for (column = c; column <= d; column++) {
int rem_i = 0;
int rem_j = 0;
@@ -339,4 +341,3 @@
return determinant;
}
-}
Index: include/ogdf/basic/Array.h
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/include/ogdf/basic/Array.h b/include/ogdf/basic/Array.h
--- a/include/ogdf/basic/Array.h (revision a4546cc009a133e174dceea02bca6eb45126e35a)
+++ b/include/ogdf/basic/Array.h (date 1700145012037)
@@ -800,9 +800,11 @@
OGDF_NEW_DELETE
};
+}
+
// enlarges storage for array and moves old entries
template<class E, class INDEX>
-void Array<E, INDEX>::expandArray(INDEX add) {
+void ogdf::Array<E, INDEX>::expandArray(INDEX add) {
INDEX sOld = size(), sNew = sOld + add;
// expand allocated memory block
@@ -822,7 +824,7 @@
// enlarges array by add elements and sets new elements to x
template<class E, class INDEX>
-void Array<E, INDEX>::grow(INDEX add, const E& x) {
+void ogdf::Array<E, INDEX>::grow(INDEX add, const E& x) {
if (add == 0) {
return;
}
@@ -838,7 +840,7 @@
// enlarges array by add elements (initialized with default constructor)
template<class E, class INDEX>
-void Array<E, INDEX>::grow(INDEX add) {
+void ogdf::Array<E, INDEX>::grow(INDEX add) {
if (add == 0) {
return;
}
@@ -853,7 +855,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::construct(INDEX a, INDEX b) {
+void ogdf::Array<E, INDEX>::construct(INDEX a, INDEX b) {
m_low = a;
m_high = b;
INDEX s = b - a + 1;
@@ -873,7 +875,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::initialize() {
+void ogdf::Array<E, INDEX>::initialize() {
E* pDest = m_pStart;
try {
for (; pDest < m_pStop; pDest++) {
@@ -889,7 +891,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::initialize(const E& x) {
+void ogdf::Array<E, INDEX>::initialize(const E& x) {
E* pDest = m_pStart;
try {
for (; pDest < m_pStop; pDest++) {
@@ -905,7 +907,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::initialize(std::initializer_list<E> initList) {
+void ogdf::Array<E, INDEX>::initialize(std::initializer_list<E> initList) {
E* pDest = m_pStart;
try {
for (const E& x : initList) {
@@ -921,7 +923,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::deconstruct() {
+void ogdf::Array<E, INDEX>::deconstruct() {
if (!std::is_trivially_destructible<E>::value) {
for (E* pDest = m_pStart; pDest < m_pStop; pDest++) {
pDest->~E();
@@ -931,7 +933,7 @@
}
template<class E, class INDEX>
-void Array<E, INDEX>::copy(const Array<E, INDEX>& array2) {
+void ogdf::Array<E, INDEX>::copy(const ogdf::Array<E, INDEX>& array2) {
construct(array2.m_low, array2.m_high);
if (m_pStart != nullptr) {
@@ -948,7 +950,7 @@
// permutes array a from a[l] to a[r] randomly
template<class E, class INDEX>
template<class RNG>
-void Array<E, INDEX>::permute(INDEX l, INDEX r, RNG& rng) {
+void ogdf::Array<E, INDEX>::permute(INDEX l, INDEX r, RNG& rng) {
OGDF_ASSERT(low() <= l);
OGDF_ASSERT(l <= high());
OGDF_ASSERT(low() <= r);
@@ -962,6 +964,8 @@
}
}
+namespace ogdf {
+
//! Prints array \p a to output stream \p os using delimiter \p delim.
template<class E, class INDEX>
void print(std::ostream& os, const Array<E, INDEX>& a, char delim = ' ') {
@@ -984,11 +988,10 @@
#include <ogdf/basic/ArrayBuffer.h>
-namespace ogdf {
//! shift all items up to the last element of \p ind to the left
template<class E, class INDEX>
-void Array<E, INDEX>::leftShift(ArrayBuffer<INDEX, INDEX>& ind) {
+void ogdf::Array<E, INDEX>::leftShift(ogdf::ArrayBuffer<INDEX, INDEX>& ind) {
const INDEX nInd = ind.size();
if (nInd == 0) {
return;
@@ -1015,9 +1018,7 @@
}
template<class E, class INDEX>
-Array<E, INDEX>::Array(const ArrayBuffer<E, INDEX>& A) {
+ogdf::Array<E, INDEX>::Array(const ogdf::ArrayBuffer<E, INDEX>& A) {
construct(0, -1);
A.compactCopy(*this);
}
-
-}