19 using std::ostringstream;
62 QCOMPARE(ps.
count(), 0);
63 QCOMPARE(ps.
size(), 0u);
65 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
70 QCOMPARE(ps2.
count(), 3);
71 QCOMPARE(ps2.
size(), 3u);
74 QCOMPARE(ps3.dimension(), 2);
75 QVERIFY(!ps3.isEmpty());
85 coordT c2[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
93 QCOMPARE(ps8.
count(), 0);
94 QCOMPARE(ps8.
size(), 0u);
96 coordT c3[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
100 QCOMPARE(ps9.
count(), 3);
111 QCOMPARE(ps9.
count(), 3);
123 QCOMPARE(ps.
count(), 0);
124 QCOMPARE(ps.
size(), 0u);
126 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
131 QCOMPARE(ps2.
count(), 3);
132 QCOMPARE(ps2.
size(), 3u);
135 QCOMPARE(ps3.dimension(), 2);
136 QVERIFY(!ps3.isEmpty());
145 QVERIFY(!(ps5!=ps4));
146 coordT c2[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
153 QCOMPARE(ps8.dimension(), 2);
154 QCOMPARE(ps8.count(), 0);
155 QCOMPARE(ps8.size(), 0u);
156 QCOMPARE(ps8.coordinateCount(), 0);
157 coordT c3[]= {10.0, 11.0, 12.0, 13.0, 14.0, 15.0};
159 QCOMPARE(ps9.dimension(), 2);
160 QCOMPARE(ps9.coordinateCount(), 6);
161 QCOMPARE(ps9.count(), 3);
162 QCOMPARE(ps9.coordinates(), c3);
164 QCOMPARE(ps9.dimension(), 2);
165 QCOMPARE(ps9.coordinateCount(), 6);
166 QCOMPARE(ps9.count(), 3);
167 QCOMPARE(ps9.coordinates(), c2);
175 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
178 QCOMPARE(ps.
size(), 2u);
186 QCOMPARE(vs.size(), 2u);
189 QList<QhullPoint> qs= ps.toQList();
190 QCOMPARE(qs.size(), 2);
192 QCOMPARE(p2[2], 5.0);
200 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
205 QCOMPARE(ps2.
count(), 2);
207 coordT c2[]= {-1.0, -2.0, -3.0, -4.0, -5.0, -6.0};
210 QCOMPARE(ps2.
count(), 2);
211 QCOMPARE(ps2.
size(), 2u);
222 QCOMPARE(ps2.
count(), 3);
223 QCOMPARE(ps2.
size(), 3u);
228 QCOMPARE(ps3.
count(), 1);
242 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
244 QCOMPARE(ps.
count(), 3);
247 QCOMPARE(ps.
at(1), ps[1]);
248 QCOMPARE(ps.
first(), p);
250 QCOMPARE(ps.
last(), ps.
at(2));
253 QCOMPARE(ps2.count(), 1);
255 QVERIFY(ps3.isEmpty());
257 QVERIFY(ps4.isEmpty());
259 QVERIFY(ps5.isEmpty());
261 QCOMPARE(ps6.count(), 1);
262 QCOMPARE(ps6[0], ps[1]);
264 QCOMPARE(ps7.
count(), 2);
265 QCOMPARE(ps7[1], ps[2]);
267 QCOMPARE(ps.
value(2), ps[2]);
268 QCOMPARE(ps.
value(-1), p8);
269 QCOMPARE(ps.
value(3), p8);
270 QCOMPARE(ps.
value(3, p), p);
271 QVERIFY(ps.
value(1, p)!=p);
274 QVERIFY(p9[0]==0.0 || p9[0]==2.0 || p9[0]==4.0);
300 QCOMPARE(p2[0], 2.0);
303 coordT c3[]= {0.0, -1.0, -2.0};
309 QCOMPARE((*i3)[0], 1.0);
311 QCOMPARE(i3[0][0], 1.0);
312 QCOMPARE(i3[0], ps[1]);
345 QCOMPARE(*i2, ps[1]);
348 QCOMPARE(i2, ps.
begin());
350 QCOMPARE(i2+=3, ps.
end());
351 QCOMPARE(i2-=3, ps.
begin());
352 QCOMPARE(i2+0, ps.
begin());
353 QCOMPARE(i2+3, ps.
end());
358 QCOMPARE(i, ps.
begin());
387 QCOMPARE(p2[0], 2.0);
390 coordT c3[]= {0.0, -1.0, -2.0};
396 QCOMPARE((*i3)[0], 1.0);
398 QCOMPARE(i3[0][0], 1.0);
399 QCOMPARE(i3[0][0], 1.0);
400 QCOMPARE(i3[0], ps[1]);
414 QCOMPARE(*i2, ps[1]);
438 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 0, 1};
458 QCOMPARE(ps.
count(p), 2);
459 QCOMPARE(ps.
count(p2), 2);
460 QCOMPARE(ps.
count(p3), 2);
461 QCOMPARE(ps.
count(p4), 0);
462 QCOMPARE(ps.
count(p6), 1);
463 QCOMPARE(ps.
indexOf(&ps[0][0]), 0);
466 QCOMPARE(ps.
indexOf(&ps[3][0]), 3);
479 QCOMPARE(ps3.indexOf(ps3.data()), -1);
481 QCOMPARE(ps3.indexOf(p), -1);
482 QCOMPARE(ps3.lastIndexOf(p), -1);
484 QCOMPARE(ps4.indexOf(p), -1);
485 QCOMPARE(ps4.lastIndexOf(p), -1);
501 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
529 QCOMPARE(i.
next(), p);
531 QCOMPARE(i.
next(), p3);
534 QCOMPARE(i.
next(), p);
543 os <<
"Empty QhullPoints\n" << ps << endl;
544 coordT c[]= {0.0, 1.0, 2.0, 3.0, 4.0, 5.0};
546 os <<
"QhullPoints from c[]\n" << ps2 << endl;
551 os <<
"QhullPoints\n" << ps3;
552 os << ps3.
print(
"message\n");
553 os << ps3.printWithIdentifier(
"w/ identifiers\n");
555 QString s= QString::fromStdString(os.str());
556 QCOMPARE(s.count(
"p"), 8+1);
561 #include "moc/QhullPoints_test.moc" const coordT * constData() const
void defineAs(int pointDimension, countT coordinatesCount, coordT *c)
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
POD type equivalent to qhT. No virtual members.
ConstIterator constEnd() const
coordT * extraCoordinates() const
void add_QhullPoints_test()
QhullPoints points() const
QhullPoint peekNext() const
countT lastIndexOf(const QhullPoint &t) const
QhullPoint peekPrevious() const
ConstIterator end() const
Interface to Qhull from C++.
PrintPoints print(const char *message) const
countT indexOf(const coordT *pointCoordinates) const
ConstIterator constBegin() const
countT coordinateCount() const
const coordT * data() const
countT extraCoordinatesCount() const
coordT * coordinates() const
bool includesCoordinates(const coordT *c) const
QhullPoints mid(countT idx, countT length=-1) const
Returns a subset of the points, not a copy.
QhullPoint value(countT idx) const
const QhullPoint last() const
void cleanup()
Executed after each test.
bool contains(const QhullPoint &t) const
ConstIterator begin() const
const QhullPoint at(countT idx) const
const QhullPoint front() const
std::vector< QhullPoint > toStdVector() const
const QhullPoint first() const
const coordT * coordinates() const
0 if undefined
const QhullPoint back() const