本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}