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


C++ NodeVector::size方法代码示例

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


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

示例1:

template<class NodeVector> void FileSystem::debugPrintNodes(NodeVector nodes) {
    if( debug) {
        unsigned int ix;
        NodeInfo* node;

        for (ix = 0; ix < nodes.size(); ++ix) {
            node = nodes.at(ix);

            cout << "Node: " << node->getName()
                << "\t\tSize: " << node->getSize()
                << "\tModify: " << node->getModifyTime()
                << "\tPath: " << node->getPath()
                << "\tSimilars: ";
        
            vector<NodeInfo*>::iterator it;
            vector<NodeInfo*> nodes = node->getSimilar();
            for(it=nodes.begin(); it != nodes.end(); ++it) {
                cout << (*it)->getPath() << ", ";
            }

            cout << endl;
        }
    }

}
开发者ID:ruskiyos,项目名称:duplocator,代码行数:25,代码来源:FileSystem.cpp

示例2:

boost::optional<ParentObject> SetpointManagerMixedAir_Impl::parent() const {
  NodeVector nodes = getObject<ModelObject>().getModelObjectSources<Node>();
  if (nodes.size() == 1u) {
    return nodes[0];
  }
  return boost::none;
}
开发者ID:CraigCasey,项目名称:OpenStudio,代码行数:7,代码来源:SetpointManagerMixedAir.cpp

示例3: mergeVectors

void mergeVectors(NodeVector* some, NodeVector more) { // bool keep destination unmodified=TRUE
//	return std::set_union(some,&more);
	for (int i=0; i < more.size(); i++) {
		if (!contains(*some, (Node*) more[i], false))
//		if (std::find(some->begin(), some->end(), more[i]) == some->end())// NOT contains x yet
            some->push_back(more[i]);
	}
}
开发者ID:nagyistoce,项目名称:netbase,代码行数:8,代码来源:util.cpp

示例4: ngraph_error

shared_ptr<Node> op::Constant::copy_with_new_args(const NodeVector& new_args) const
{
    if (new_args.size() != 0)
    {
        throw ngraph_error("Incorrect number of new arguments");
    }
    return make_shared<Constant>(m_element_type, m_shape, m_data);
}
开发者ID:okhat,项目名称:ngraph,代码行数:8,代码来源:constant.cpp

示例5: ngraph_error

shared_ptr<Node> op::Cos::copy_with_new_args(const NodeVector& new_args) const
{
    if (new_args.size() != 1)
    {
        throw ngraph_error("Incorrect number of new arguments");
    }
    return make_shared<Cos>(new_args.at(0));
}
开发者ID:okhat,项目名称:ngraph,代码行数:8,代码来源:cos.cpp

示例6: ngraph_error

shared_ptr<Node> op::OneHot::copy_with_new_args(const NodeVector& new_args) const
{
    if (new_args.size() != 1)
    {
        throw ngraph_error("Incorrect number of new arguments");
    }
    return make_shared<OneHot>(new_args.at(0), m_shape, m_one_hot_axis);
}
开发者ID:okhat,项目名称:ngraph,代码行数:8,代码来源:one_hot.cpp

示例7: ngraph_error

shared_ptr<Node> op::Min::copy_with_new_args(const NodeVector& new_args) const
{
    if (new_args.size() != 1)
    {
        throw ngraph_error("Incorrect number of new arguments");
    }
    return make_shared<Min>(new_args.at(0), m_reduction_axes);
}
开发者ID:okhat,项目名称:ngraph,代码行数:8,代码来源:min.cpp

示例8: ngraph_error

shared_ptr<Node> op::GetOutputElement::copy_with_new_args(const NodeVector& new_args) const
{
    if (new_args.size() != 1)
    {
        throw ngraph_error("Incorrect number of new arguments");
    }
    return make_shared<GetOutputElement>(new_args.at(0), m_n);
}
开发者ID:okhat,项目名称:ngraph,代码行数:8,代码来源:get_output_element.cpp

示例9: contains

bool contains(NodeVector& all, Node& node, bool fuzzy) {
//	if(!fuzzy)
//		return contains2(all,&node);
	for (int i=0; i < all.size(); i++) {
		if ((Node*) all[i] == &node) return true;
		if (fuzzy && eq(all[i], &node)) return true;
	}
	return false;
}
开发者ID:nagyistoce,项目名称:netbase,代码行数:9,代码来源:util.cpp

示例10: depthFirstMap

vector<Algorithm*> Network::innerVisibleAlgorithms(Algorithm* algo) {
  NetworkNode* visibleNetworkRoot = visibleNetwork<NetworkNode>(algo);

  vector<Algorithm*> algos = depthFirstMap(visibleNetworkRoot, returnAlgorithm);

  NodeVector nodes = depthFirstSearch(visibleNetworkRoot);
  for (int i=0; i<(int)nodes.size(); i++) delete nodes[i];

  return algos;
}
开发者ID:spherepeer,项目名称:essentia,代码行数:10,代码来源:network.cpp

示例11: equal

/**
 * Returns true if both qualified types %a and %b are equivalent, i.e. have the
 * same members, interfaces, ranges and native type equivalents.
 */
bool equal(const QualifiedType::Ptr& a, const QualifiedType::Ptr& b)
{
	// Treat the trivial cases where the number of fields does not match.
	const NodeVector& membersA = a->getMembers(), membersB = b->getMembers();
	if (membersA.size() != membersB.size()) return false;
	const NodeVector& funcsA = a->getFuncs(), funcsB = b->getFuncs();
	if (funcsA.size() != funcsB.size()) return false;

	// Check each member separately.
	for (NodeVector::const_iterator ia = membersA.begin(), ib = membersB.begin(); ia != membersA.end() && ib != membersB.end(); ia++, ib++) {
		const QualifiedTypeMember::Ptr& memberA = QualifiedTypeMember::needFrom(*ia), memberB = QualifiedTypeMember::needFrom(*ib);
		if (memberA->getName() != memberB->getName())
			return false;
		if (!equal(memberA->getType(), memberB->getType()))
			return false;
	}

	// TODO: do the same for interface stuff.
	return true;
}
开发者ID:fabianschuiki,项目名称:Maxwell,代码行数:24,代码来源:type.cpp

示例12: snapshotItem

Node* XPathResult::snapshotItem(unsigned long index, ExceptionCode& ec)
{
    if (resultType() != UNORDERED_NODE_SNAPSHOT_TYPE && resultType() != ORDERED_NODE_SNAPSHOT_TYPE) {
        ec = TYPE_ERR;
        return 0;
    }
    
    NodeVector nodes = m_value.toNodeVector();
    if (index >= nodes.size())
        return 0;
    
    return nodes[index].get();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:13,代码来源:XPathResult.cpp

示例13: singleNodeValue

Node* XPathResult::singleNodeValue(ExceptionCode& ec) const
{
    if (resultType() != ANY_UNORDERED_NODE_TYPE && resultType() != FIRST_ORDERED_NODE_TYPE) {
        ec = TYPE_ERR;
        return 0;
    }
  
    NodeVector nodes = m_value.toNodeVector();
    if (nodes.size () == 0)
        return 0;

    return nodes[0].get();
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:13,代码来源:XPathResult.cpp

示例14: simplify

/**
 * Simplifies the given TypeSet by removing duplicate types. If the resulting
 * TypeSet contains only one type, that type is returned instead of the set.
 */
NodePtr simplify(const TypeSet::Ptr& input)
{
	// Remove duplicate types.
	NodeVector newTypes;
	copyUnique(input->getTypes(), newTypes);

	// Return either the new set or the only type left in the set, if there's one.
	if (newTypes.size() == 1) {
		return newTypes.front();
	}
	TypeSet::Ptr ts(new TypeSet);
	ts->setTypes(newTypes);
	return ts;
}
开发者ID:fabianschuiki,项目名称:Maxwell,代码行数:18,代码来源:type.cpp

示例15: findAlgorithm

Algorithm* Network::findAlgorithm(const std::string& name) {
  NodeVector nodes = depthFirstSearch(_visibleNetworkRoot);
  for (NodeVector::iterator node = nodes.begin(); node != nodes.end(); ++node) {
    if ((*node)->algorithm()->name() == name) return (*node)->algorithm();
  }

  ostringstream msg;
  msg << "Could not find algorithm with name '" << name << "'. Known algorithms are: ";
  if (!nodes.empty()) msg << '\'' << nodes[0]->algorithm()->name() << '\'';
  for (int i=1; i<(int)nodes.size(); i++) {
    msg << ", '" << nodes[i]->algorithm()->name() << '\'';
  }
  throw EssentiaException(msg);
}
开发者ID:spherepeer,项目名称:essentia,代码行数:14,代码来源:network.cpp


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