26 using std::ostringstream;
80 QVERIFY(h2.isValid());
81 QCOMPARE(h2.dimension(), 3);
98 QVERIFY(h2.isValid());
99 QCOMPARE(h2.dimension(), 3);
114 QCOMPARE(fs.size(), 4u);
115 double offset= fs.back();
117 QCOMPARE(offset, -0.5);
119 double squareNorm= inner_product(fs.begin(), fs.end(), fs.begin(), 0.0);
120 QCOMPARE(squareNorm, 1.0);
121 QList<double> qs= h.toQList();
122 QCOMPARE(qs.size(), 4);
123 double offset2= qs.takeLast();
124 QCOMPARE(offset2, -0.5);
125 double squareNorm2= std::inner_product(qs.begin(), qs.end(), qs.begin(), 0.0);
126 QCOMPARE(squareNorm2, 1.0);
141 cout <<
"h" <<
id << endl;
149 QCOMPARE(h.
offset(), -0.5);
152 double squareNorm= std::inner_product(h.
begin(), h.
end(), h.
begin(), 0.0);
153 QCOMPARE(squareNorm, 1.0);
203 QCOMPARE(dist, -1.0);
204 double norm= h.
norm();
207 cout <<
"angle " << angle << endl;
208 QCOMPARE(angle+1.0, 1.0);
222 QCOMPARE(c[k], h[k]);
227 QCOMPARE(h2[0], 10.0);
237 QCOMPARE(h.
count(), 3);
238 QCOMPARE(h.
size(), 3u);
257 QCOMPARE((*i3), h[1]);
292 QCOMPARE(i2, h.
begin());
294 QCOMPARE(i2 += 3, h.
end());
295 QCOMPARE(i2 -= 3, h.
begin());
296 QCOMPARE(i2+0, h.
begin());
297 QCOMPARE(i2+3, h.
end());
302 QCOMPARE(i, h.
begin());
336 QCOMPARE((*i3), h[1]);
375 QhullHyperplaneIterator i2(h);
377 QhullHyperplaneIterator i= h;
378 QVERIFY(i2.hasNext());
379 QVERIFY(!i2.hasPrevious());
380 QVERIFY(i.hasNext());
381 QVERIFY(!i.hasPrevious());
384 QVERIFY(!i2.hasNext());
385 QVERIFY(i2.hasPrevious());
386 QVERIFY(i.hasNext());
387 QVERIFY(!i.hasPrevious());
390 QCOMPARE(i.peekNext(), h[0]);
391 QCOMPARE(i2.peekPrevious(), h[2]);
392 QCOMPARE(i2.previous(), h[2]);
393 QCOMPARE(i2.previous(), h[1]);
394 QCOMPARE(i2.previous(), h[0]);
395 QVERIFY(!i2.hasPrevious());
396 QCOMPARE(i.peekNext(), h[0]);
398 QCOMPARE(i.next(), h[0]);
399 QCOMPARE(i.peekNext(), h[1]);
400 QCOMPARE(i.next(), h[1]);
401 QCOMPARE(i.next(), h[2]);
402 QVERIFY(!i.hasNext());
404 QCOMPARE(i.next(), h[0]);
415 os <<
"Hyperplane:\n";
417 os << h.
print(
"message");
418 os << h.print(
" and a message ",
" offset ");
420 QString s= QString::fromStdString(os.str());
421 QCOMPARE(s.count(
"1"), 3);
429 #include "moc/QhullHyperplane_test.moc"
QhullHyperplane hyperplane() const
QhullRidge – Qhull's ridge structure, ridgeT, as a C++ class.
A QhullFacet is the C++ equivalent to Qhull's facetT*.
QhullFacet firstFacet() const
PrintHyperplane print(const char *message) const
double distance(const QhullPoint &p) const
QhullFacetList facetList() const
const coordT * coordinates() const
void t_qhullHyperplane_iterator()
const_iterator constBegin() const
const_iterator constEnd() const
void setDimension(int hyperplaneDimension)
void add_QhullHyperplane_test()
QhullFacetSet neighborFacets() const
Interface to Qhull from C++.
std::vector< coordT > toStdVector() const
double hyperplaneAngle(const QhullHyperplane &other) const
QhullPoint origin()
non-const due to QhullPoint
void defineAs(int hyperplaneDimension, coordT *c, coordT hyperplaneOffset)
void setCoordinates(coordT *c)
void cleanup()
Executed after each test.
const T at(countT idx) const
int dimension() const
Dimension of input and result.
QhullHyperplane::iterator Iterator
const coordT * const_iterator
void setOffset(coordT hyperplaneOffset)
QhullHyperplane::const_iterator ConstIterator