本文整理汇总了C++中Vertices::getNumVertices方法的典型用法代码示例。如果您正苦于以下问题:C++ Vertices::getNumVertices方法的具体用法?C++ Vertices::getNumVertices怎么用?C++ Vertices::getNumVertices使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertices
的用法示例。
在下文中一共展示了Vertices::getNumVertices方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exp
CoordType SpatialModelMaximalRepulsion3D<CoordType>::getEnergy3(const Vertices<CoordType>& vertices)
{
CoordType energy;
int numPoints = vertices.getNumVertices();
T beta = _hardcoreDistances.mean()/(_nucleusVolume/numPoints);
for ( int i = 0; i < numPoints; ++i )
for ( int j = 0; j < numPoints; ++j )
if ( j!= i)
energy += exp(-(pow(vertices[i].distance(vertices[j]),2))/(2*pow(beta,2)));
return energy;
}
示例2: EVAL
CoordType SpatialModelMaximalRepulsion3D<CoordType>::getEnergy1(const Vertices<CoordType>& vertices)
{
const int numPoints = vertices.getNumVertices();
CoordType s = 0.0;
for (int i = 0; i < numPoints; ++i)
for (int j = i+1; j < numPoints; ++j)
s += vertices[i].distance(vertices[j]);
EVAL( s );
EVAL( 1/s );
return 1.0/s;
//return numPoints/distBetweenComp;
}
示例3:
bool SpatialModelMaximalRepulsion3D<CoordType>::checkHardcoreDistances(
const Vector<CoordType>& vertex,
const int v,
const Vertices<CoordType>& vertices) const
{
const Vector<CoordType>& hardcoreDistances = this->getHardcoreDistances();
Vector<CoordType> triMeshVertex;
if ( this->getTriMeshQuery().closestPoint(vertex,triMeshVertex) < hardcoreDistances[v] )
return false;
for (int i = 0; i < vertices.getNumVertices(); ++i)
if ( i != v && vertices[i].distance(vertex) < hardcoreDistances[i] + hardcoreDistances[v] )
return false;
return true;
}