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


C++ Vertices::count方法代码示例

本文整理汇总了C++中Vertices::count方法的典型用法代码示例。如果您正苦于以下问题:C++ Vertices::count方法的具体用法?C++ Vertices::count怎么用?C++ Vertices::count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Vertices的用法示例。


在下文中一共展示了Vertices::count方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: cellValue

Value cellValue(Cell const v, Scalars const scalars, Vertices const vertices)
{
    Value val = scalars.get(vertices(v, 0));
    for (size_t i = 1; i < (size_t) vertices.count(v); ++i)
        val = std::max(val, scalars.get(vertices(v, i)));

    return val;
}
开发者ID:AppliedMathematicsANU,项目名称:diamorse,代码行数:8,代码来源:PersistencePairs.C

示例2: cellAverage

Value cellAverage(Cell const v, Scalars const scalars, Vertices const vertices)
{
    size_t const n = vertices.count(v);

    Value sum = 0;
    for (size_t i = 0; i < n; ++i)
        sum += scalars.get(vertices(v, i));

    return sum / n;
}
开发者ID:rachellevanger,项目名称:diamorse,代码行数:10,代码来源:VectorFieldGyulassy.C

示例3:

boolean Vertices::operator == (Vertices& ml) {
    if (count() == ml.count()) {
        for (int i = 0; i < count(); ++i) {
            if (x()[i] != ml.x()[i] || y()[i] != ml.y()[i]) {
                return false;
            }
        }
        return true;
    }
    return false;
}
开发者ID:jmzaleski,项目名称:ivtools-1.2,代码行数:11,代码来源:verts.c

示例4: setVertices

void RenderObject::setVertices( const Vertices& vertices )
{
    m_vertices.clear();
    for ( int i = 0; i < vertices.count(); ++i )
    {
        m_vertices.append( vertices.at( i ) );
    }
    if ( !m_vertexBuffer.isCreated() )
    {
        m_vertexBuffer.create();
    }
    m_vao.bind();
    m_vertexBuffer.bind();
    m_vertexBuffer.allocate( m_vertices.data(), m_vertices.count() * sizeof( Vertex ) );
    m_vao.release();
}
开发者ID:GromeTT,项目名称:KinectTracker,代码行数:16,代码来源:RenderObject.cpp

示例5: extract

    void extract(
        Cell const v,
        Facets const& cofacets,
        Vertices const& vertices,
        Scalars const& scalars)
    {
        Value value = scalars.get(v);

        cells_[0] = v;
        defined_[0] = false;
        weight_[0] = value;
        ranked_[0] = 0;
        incidence_counts_[0] = 0;
        size_ = 1;

        int mark = size_;
        int next = 0;
        while (next < size_)
        {
            Cell const cell = cells_[next];

            int const n = cofacets.count(cell);

            for (int i = n - 1; i >= 0; --i)
            {
                Cell const coface = cofacets(cell, i);
                int k;
                for (k = mark; k < size_; ++k)
                    if (coface == cells_[k])
                        break;
                if (k < size_)
                {
                    incidences_[k][incidence_counts_[k]] = next;
                    ++incidence_counts_[k];
                    continue;
                }

                int const m = vertices.count(coface);
                bool add = true;
                Value sum = 0.0;
                for (int j = 0; j < m; ++j)
                {
                    Cell const w = vertices(coface, j);
                    Value const d = scalars.get(w);
                    if (d > value or (d == value and w > v))
                    {
                        add = false;
                        break;
                    }
                    sum += d;
                }

                if (add)
                {
                    cells_[size_] = coface;
                    defined_[size_] = false;
                    weight_[size_] = sum;
                    ranked_[size_] = size_;
                    incidences_[size_][0] = next;
                    incidence_counts_[size_] = 1;
                    ++size_;

                    if (size_ > MAX_STAR)
                        throw starException;
                }
            }

            ++next;
            if (next == mark)
                mark = size_;
        }

        for (int i = 0; i < size_; ++i) {
            int j;
            Value x = weight_[i];
            for (j = i; j > 0 && x < weight_[j-1]; --j) {
                ranked_[j] = ranked_[j-1];
                weight_[j] = weight_[j-1];
            }
            ranked_[j] = i;
            weight_[j] = x;
        }
    }
开发者ID:lzs203511,项目名称:diamorse,代码行数:83,代码来源:vectorFieldExtraction.hpp


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