本文整理汇总了C++中optimizablegraph::Vertex类的典型用法代码示例。如果您正苦于以下问题:C++ Vertex类的具体用法?C++ Vertex怎么用?C++ Vertex使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Vertex类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: push
void OptimizableGraph::push()
{
for (OptimizableGraph::VertexIDMap::iterator it=_vertices.begin(); it!=_vertices.end(); ++it) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(it->second);
v->push();
}
}
示例2: discardTop
void OptimizableGraph::discardTop(HyperGraph::VertexSet& vset)
{
for (HyperGraph::VertexSet::iterator it=vset.begin(); it!=vset.end(); ++it) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(*it);
v->discardTop();
}
}
示例3: push
void OptimizableGraph::push(HyperGraph::VertexSet& vset) {
for (HyperGraph::VertexSet::iterator it = vset.begin(); it != vset.end();
it++) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(*it);
v->push();
}
}
示例4:
bool SparseOptimizer::buildIndexMapping
(SparseOptimizer::VertexContainer& vlist)
{
if (! vlist.size())
{
_ivMap.clear();
return false;
}
_ivMap.resize(vlist.size());
size_t i = 0;
// Recorre todos los vertices dandoles un indice.
// Si el vertice es fijo, su indice sera -1
// Para los vertices no fijos, les da un indice incremental.
// Primero se les da a los vertices no marginalizables y luego a los que si.
// Al final _ivMap contendra todos los vertices no fijos con los vertices
// no marginalizables en las primeras posiciones de _ivMap
for (int k=0; k<2; k++)
for (VertexContainer::iterator it=vlist.begin(); it!=vlist.end(); it++)
{
OptimizableGraph::Vertex* v = *it;
if (! v->fixed())
{
if (static_cast<int>(v->marginalized()) == k)
{
v->setTempIndex(i);
_ivMap[i]=v;
i++;
}
}else v->setTempIndex(-1);
}
_ivMap.resize(i);
return true;
}
示例5: findGauge
OptimizableGraph::Vertex* SparseOptimizer::findGauge(){
if (vertices().empty())
return 0;
int maxDim=0;
for (HyperGraph::VertexIDMap::iterator
it = vertices().begin();
it != vertices().end();
it++)
{
OptimizableGraph::Vertex* v =
static_cast<OptimizableGraph::Vertex*>(it->second);
maxDim = std::max(maxDim,v->dimension());
}
OptimizableGraph::Vertex* rut=0;
for (HyperGraph::VertexIDMap::iterator
it = vertices().begin();
it != vertices().end();
it++)
{
OptimizableGraph::Vertex* v =
static_cast<OptimizableGraph::Vertex*>(it->second);
if (v->dimension()==maxDim)
{
rut=v;
break;
}
}
return rut;
}
示例6: setFixed
void OptimizableGraph::setFixed(HyperGraph::VertexSet& vset, bool fixed)
{
for (HyperGraph::VertexSet::iterator it=vset.begin(); it!=vset.end(); ++it) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(*it);
v->setFixed(fixed);
}
}
示例7: buildIndexMapping
bool SparseOptimizer::buildIndexMapping(SparseOptimizer::VertexContainer& vlist){
if (! vlist.size()){
_ivMap.clear();
return false;
}
_ivMap.resize(vlist.size());
size_t i = 0;
for (int k=0; k<2; k++)
for (VertexContainer::iterator it=vlist.begin(); it!=vlist.end(); ++it){
OptimizableGraph::Vertex* v = *it;
if (! v->fixed()){
if (static_cast<int>(v->marginalized()) == k){
v->setHessianIndex(i);
_ivMap[i]=v;
i++;
}
}
else {
v->setHessianIndex(-1);
}
}
_ivMap.resize(i);
return true;
}
示例8: discardTop
void OptimizableGraph::discardTop() {
for (OptimizableGraph::VertexIDMap::iterator it = _vertices.begin();
it != _vertices.end(); it++) {
OptimizableGraph::Vertex* v =
static_cast<OptimizableGraph::Vertex*>(it->second);
v->discardTop();
}
}
示例9: edgeAllVertsSameDim
bool edgeAllVertsSameDim(OptimizableGraph::Edge* e, int dim)
{
for (size_t i = 0; i < e->vertices().size(); ++i) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(e->vertices()[i]);
if (v->dimension() != dim)
return false;
}
return true;
}
示例10:
bool G2oSlamInterface::fixNode(const std::vector<int>& nodes)
{
for (size_t i = 0; i < nodes.size(); ++i) {
OptimizableGraph::Vertex* v = _optimizer->vertex(nodes[i]);
if (v)
v->setFixed(true);
}
return true;
}
示例11: removeVertex
bool SparseOptimizer::removeVertex(HyperGraph::Vertex* v)
{
OptimizableGraph::Vertex* vv = static_cast<OptimizableGraph::Vertex*>(v);
if (vv->hessianIndex() >= 0) {
clearIndexMapping();
_ivMap.clear();
}
return HyperGraph::removeVertex(v);
}
示例12: assert
void BaseMultiEdge<D, E>::linearizeOplus(JacobianWorkspace& jacobianWorkspace)
{
for (size_t i = 0; i < _vertices.size(); ++i) {
OptimizableGraph::Vertex* v = static_cast<OptimizableGraph::Vertex*>(_vertices[i]);
assert(v->dimension() >= 0);
new (&_jacobianOplus[i]) JacobianType(jacobianWorkspace.workspaceForVertex(i), D, v->dimension());
}
linearizeOplus();
}
示例13: pop
void SparseOptimizer::pop(HyperGraph::VertexSet& vlist)
{
for (HyperGraph::VertexSet::iterator it = vlist.begin(); it != vlist.end(); ++it){
OptimizableGraph::Vertex* v = dynamic_cast<OptimizableGraph::Vertex*> (*it);
if (v)
v->pop();
else
cerr << "FATAL POP SET" << endl;
}
}
示例14: update
void SparseOptimizer::update(double* update)
{
// update the graph by calling oplus on the vertices
for (size_t i=0; i < _ivMap.size(); ++i)
{
OptimizableGraph::Vertex* v = _ivMap[i];
v->oplus(update);
update += v->dimension();
}
}
示例15: push
void SparseOptimizer::push(HyperGraph::VertexSet& vlist)
{
for (HyperGraph::VertexSet::iterator it = vlist.begin(); it != vlist.end(); ++it) {
OptimizableGraph::Vertex* v = dynamic_cast<OptimizableGraph::Vertex*>(*it);
if (v)
v->push();
else
cerr << __FUNCTION__ << ": FATAL PUSH SET" << endl;
}
}