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


C++ Tuple::toString方法代码示例

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


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

示例1: tuplesToString

string Relation::tuplesToString()
{
    string out;
    for(set<Tuple>::iterator it = tuples->begin(); it != tuples->end(); it++)
    {
        Tuple thisTuple = (*it);
        if(thisTuple.toString() != "")
        {
            out += "\n";
        }
        out += "  " + thisTuple.toString();
    }
    return out;
}
开发者ID:SchuylerGoodman,项目名称:RelationalDatabase,代码行数:14,代码来源:Relation.cpp

示例2: solvedQueryToString

string Relation::solvedQueryToString(vector<Token>& inputTokens)
{
    string out;
    vector<Token> noStrings = removeStrings(inputTokens);
    vector<std::pair<Token, vector<int> > > myMap;
    for(int i = 0; i < noStrings.size(); i++)
    {
        bool inserted = false;
        for(int j = 0; j < myMap.size(); j++)
        {
            if(myMap[j].first.getTokensValue() == noStrings[i].getTokensValue())
            {
                myMap[j].second.push_back(i);
                inserted = true;
            }
        }
        if(!inserted && noStrings[i].getTokenType() == ID)
        { 
            vector<int> newVec;
            newVec.push_back(i);
            myMap.push_back(pair<Token, vector<int> >(noStrings[i], newVec) );
        }
    }

    for(set<Tuple>::iterator it = tuples->begin(); it != tuples->end(); it++)
    {
        int firstInMapVector = 0;
        Tuple thisTuple = (*it);
        if(thisTuple.toString() != "")
        {
            out += "\n  ";
        }
        for(int i = 0; i < myMap.size(); i++)
        {
            if(myMap[i].first.getTokenType() == ID)
            {
                out += myMap[i].first.getTokensValue() + "=";
                out += thisTuple.getTokenFromPairAt(myMap[i].second[firstInMapVector]).getTokensValue();
                if(i + 1 != myMap.size())
                {
                    out += ", ";
                }
            }
        }
    }
    return out;
}
开发者ID:SchuylerGoodman,项目名称:RelationalDatabase,代码行数:47,代码来源:Relation.cpp

示例3: toString

string Relation::toString()
{
    string out = "";
    out += Id->getTokensValue();
    out += ":";
    out += schema->toString() + "\n";
    for(set<Tuple>::iterator it = tuples->begin(); it != tuples->end(); it++)
    {
        for(int i = 0; i < Id->getTokensValue().length(); i++)
        {
            out += " ";
        }
        Tuple thisTuple = (*it);
        out += "  " + thisTuple.toString() + "\n";
    }
    return out;
}
开发者ID:SchuylerGoodman,项目名称:RelationalDatabase,代码行数:17,代码来源:Relation.cpp

示例4: extractReducedOrderModelParams

RCP<EpetraExt::ModelEvaluator> ReducedOrderModelFactory::create(const RCP<EpetraExt::ModelEvaluator> &child)
{
  RCP<EpetraExt::ModelEvaluator> result = child;

  if (useReducedOrderModel()) {
    const RCP<ParameterList> romParams = extractReducedOrderModelParams(params_);

    const Tuple<std::string, 2> allowedProjectionTypes = tuple<std::string>("Galerkin Projection", "Minimum Residual");
    const std::string projectionType = romParams->get("System Reduction", allowedProjectionTypes[0]);
    TEUCHOS_TEST_FOR_EXCEPTION(!contains(allowedProjectionTypes, projectionType),
                               std::out_of_range,
                               projectionType + " not in " + allowedProjectionTypes.toString());

    const RCP<const ReducedSpace> reducedSpace = spaceFactory_->create(romParams);
    const RCP<const Epetra_MultiVector> basis = spaceFactory_->getBasis(romParams);

    if (projectionType == allowedProjectionTypes[0]) {
      const RCP<const Epetra_MultiVector> projector = spaceFactory_->getProjector(romParams);
      const RCP<ReducedOperatorFactory> opFactory(new PetrovGalerkinOperatorFactory(basis, projector));
      result = rcp(new ReducedOrderModelEvaluator(child, reducedSpace, opFactory));
    } else if (projectionType == allowedProjectionTypes[1]) {
      RCP<ReducedOperatorFactory> opFactory;

      const RCP<const Epetra_Operator> collocationOperator =
        spaceFactory_->getSamplingOperator(romParams, *child->get_x_map());
      if (nonnull(collocationOperator)) {
        opFactory = rcp(new GaussNewtonMetricOperatorFactory(basis, collocationOperator));
      } else {
        opFactory = rcp(new GaussNewtonOperatorFactory(basis));
      }

      result = rcp(new ReducedOrderModelEvaluator(child, reducedSpace, opFactory));
    } else {
      TEUCHOS_TEST_FOR_EXCEPT_MSG(true, "Should not happen");
    }
  }

  return result;
}
开发者ID:ImmutableLtd,项目名称:Albany,代码行数:39,代码来源:MOR_ReducedOrderModelFactory.cpp


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