当前位置: 首页>>代码示例>>C++>>正文


C++ Coordinates::begin方法代码示例

本文整理汇总了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
开发者ID:jonaswitt,项目名称:nestk,代码行数:34,代码来源:Coordinates_test.cpp

示例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+
开发者ID:JunjieZhang,项目名称:qhull,代码行数:7,代码来源:Coordinates.cpp

示例3: setPosition

bool AllVersionsChunkIterator::setPosition(Coordinates const& pos)
{
    if (VersionID(pos[0]) != currVersion) {
        return false;
    }
    return inputIterator->setPosition(Coordinates(pos.begin()+1, pos.end()));
}
开发者ID:Goon83,项目名称:scidb,代码行数:7,代码来源:AllVersionsArray.cpp

示例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];
            }
        }
    }
开发者ID:hansmire,项目名称:scidb-osx-12.10-mountain-lion,代码行数:18,代码来源:CrossJoinArray.cpp

示例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;
 }
开发者ID:Goon83,项目名称:scidb,代码行数:17,代码来源:UnfoldArray.cpp

示例6: addCoordinate

 void addCoordinate(const Coordinates& coords){
     _coords.insert(_coords.end(), coords.begin(), coords.end());
 }
开发者ID:nogenem,项目名称:Computacao-Grafica-2015-2,代码行数:3,代码来源:Objects.hpp

示例7: CoordinateSequence

 CoordinateSequence(std::uint64_t id, const Coordinates &coordinates) :
     id(id), coordinates(coordinates.begin(), coordinates.end()) {
 }
开发者ID:reinterpretcat,项目名称:utymap,代码行数:3,代码来源:MultipolygonProcessor.cpp

示例8: getLeftPosition

 Coordinates CrossJoinArray::getLeftPosition(Coordinates const& pos) const
 {
     return Coordinates(pos.begin(), pos.begin() + nLeftDims);
 }
开发者ID:hansmire,项目名称:scidb-osx-12.10-mountain-lion,代码行数:4,代码来源:CrossJoinArray.cpp


注:本文中的Coordinates::begin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。