本文整理汇总了C++中Coordinates::begin方法的典型用法代码示例。如果您正苦于以下问题:C++ Coordinates::begin方法的具体用法?C++ Coordinates::begin怎么用?C++ Coordinates::begin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coordinates
的用法示例。
在下文中一共展示了Coordinates::begin方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QCOMPARE
void Coordinates_test::
t_iterator()
{
Coordinates c;
QCOMPARE(c.begin(), c.end());
// begin and end checked elsewhere
c << 1.0 << 3.0;
Coordinates::iterator i= c.begin();
QCOMPARE(*i, 1.0);
QCOMPARE(i[1], 3.0);
*i= -1.0;
QCOMPARE(*i, -1.0);
i[1]= -3.0;
QCOMPARE(i[1], -3.0);
*i= 1.0;
// operator-> is not applicable to double
QCOMPARE(*i++, 1.0);
QCOMPARE(*i, -3.0);
*i= 3.0;
QCOMPARE(*i--, 3.0);
QCOMPARE(*i, 1.0);
QCOMPARE(*(i+1), 3.0);
QCOMPARE(*++i, 3.0);
QCOMPARE(*(i-1), 1.0);
QCOMPARE(*--i, 1.0);
QVERIFY(i==c.begin());
QVERIFY(i==c.constBegin());
QVERIFY(i!=c.end());
QVERIFY(i!=c.constEnd());
QVERIFY(i<c.end());
QVERIFY(i>=c.begin());
QVERIFY(i+1<=c.end());
QVERIFY(i+1>c.begin());
}//t_iterator
示例2: result
Coordinates Coordinates::
operator+(const Coordinates &other) const
{
Coordinates result(*this);
std::copy(other.begin(), other.end(), std::back_inserter(result));
return result;
}//operator+
示例3: setPosition
bool AllVersionsChunkIterator::setPosition(Coordinates const& pos)
{
if (VersionID(pos[0]) != currVersion) {
return false;
}
return inputIterator->setPosition(Coordinates(pos.begin()+1, pos.end()));
}
示例4: decomposeOutCoordinates
void CrossJoinArray::decomposeOutCoordinates(Coordinates const& out, Coordinates& left, Coordinates& hashKey, Coordinates& rightLeftover) const
{
assert(out.size() == desc.getDimensions().size());
assert(left.size() == nLeftDims);
assert(rightLeftover.size() == nRightDims-nJoinDims);
assert(hashKey.size() == nJoinDims);
left.assign(out.begin(), out.begin()+nLeftDims);
rightLeftover.assign(out.begin()+nLeftDims, out.end());
for (size_t i =0; i<nLeftDims; i++)
{
if(leftJoinDims[i]!=-1)
{
hashKey[leftJoinDims[i]] = out[i];
}
}
}
示例5: mapped
bool
UnfoldBitmapChunkIter::setPosition(Coordinates const& pos)
{
// 'pos' will have N coordinates, according to the ArrayDesc returned
// from inferSchema. Set the position along the input chunks
// according to the first N-1 coordinates. The last coordinate is
// the attribute index which must be set independently.
Coordinates mapped(pos.begin(), pos.end()-1);
AttributeID visitingAttr = *(pos.end()-1);
if (visitingAttr < _nAttrs &&
inputIterator->setPosition(mapped)) {
_visitingAttribute = visitingAttr;
return true;
}
_visitingAttribute = 0;
return false;
}
示例6: addCoordinate
void addCoordinate(const Coordinates& coords){
_coords.insert(_coords.end(), coords.begin(), coords.end());
}
示例7: CoordinateSequence
CoordinateSequence(std::uint64_t id, const Coordinates &coordinates) :
id(id), coordinates(coordinates.begin(), coordinates.end()) {
}
示例8: getLeftPosition
Coordinates CrossJoinArray::getLeftPosition(Coordinates const& pos) const
{
return Coordinates(pos.begin(), pos.begin() + nLeftDims);
}