Esempio n. 1
0
string itsProblem::getInformations()
{
  // separator used to format output
  string sep = ":\t";
  
  // put all in the stream
  stringstream msg;
  msg << "Key" << sep << getKey() << endl;
  msg << "Name" << sep << getName() << endl;
  msg << "Description" << sep << getDescription() << endl;
  msg << "Formula" << sep << getFormula() << endl;
  msg << "Dimension" << sep << getDimension() << (isDimensionFixed()?" (fixed)":" (not fixed)") << endl;
  

  if ( getOptima().size() <= 0 ) {
      msg << "Optimum Unknown" << endl;
  } else {
      // print vectors of the optimums
      for(unsigned int i=0;i<getOptima().size();i++) {
          if(getOptima().size()>1) {
              msg << "Optimum " << i << sep;
          } else {
              msg << "Optimum " << sep;
          }
          msg << "<"
          << print(getOptima()[i].getValues()," ");
          msg << "> @ <"
          << print(getOptima()[i].getSolution()," ");
          msg << ">";
          msg << endl;
      }
  }

  // print vectors of bounds
  msg << "Bounds" << sep << "[";
  for(unsigned int i=0;i<getBounds().size();i++) {
      msg << "["
      << print(getBounds()[i]," ");
      msg << "]";
  }
  msg << "]" << endl;

  msg << "Reference" << sep << getCitation() << endl;

  // return only the string
  return msg.str();  
}
Esempio n. 2
0
string itsSetItem::getInformations()
{
    // a stream is easier to manipulate
    stringstream infos;

    // Separator used between key and value
    string sep = ":\t";

    infos << "\t" << "Key" << sep << getKey() << endl;
    infos << "\t" << "Family" << sep << getFamily() << endl;
    infos << "\t" << "Name" << sep << getName() << endl;
    infos << "\t" << "Accronym" << sep << getAccronym() << endl;
    infos << "\t" << "Description" << sep << getDescription() << endl;
    infos << "\t" << "Reference" << sep << getCitation() << endl;

    // get back the string only
    return infos.str();
}
Esempio n. 3
0
string itsSetItem::getInformations_XML()
{
    // a stream is easier to manipulate
    stringstream infos;

    infos << "<item>" << endl;

    infos << "<key>" << getKey() << "</key>" << endl;
    infos << "<family>" << getFamily() << "</family>" << endl;
    infos << "<name>" << getName() << "</name>" << endl;
    infos << "<accronym>" << getAccronym() << "</accronym>" << endl;
    infos << "<description>" << getDescription() << "</description>" << endl;
    infos << "<reference>" << getCitation() << "</reference>" << endl;

    infos << "</item>" << endl;

    // get back the string only
    return infos.str();
}
Esempio n. 4
0
string itsProblem::getInformations_XML()
{
  // put all in the stream
  stringstream msg;
  
  msg << "<problem>" << endl;

  msg << "<key>" << getKey() << "</key>" << endl;
  msg << "<name>" << getName() << "</name>" << endl;
  msg << "<description>" << getDescription() << "</description>" << endl;
  msg << "<formula>" << getFormula() << "</formula>" << endl;
  msg << "<dimension>" << getDimension() << "</dimension>" << endl;
  msg << "<accuracy>" << getAccuracy() << "</accuracy>" << endl;
  

  msg << "<optimums>" << endl;
  if ( getOptima().size() <= 0 ) {
      msg << "Unknown";
  } else {
      // print vectors of the optimums
      for(unsigned int i=0;i<getOptima().size();i++) { 
          if(getOptima().size()>1) {
              msg << "<point id=\"" << i << "\">" << "<values>";
          } else {
              msg << "<point>" << "<values>";
          }
          
          msg << print(getOptima()[i].getValues()," ");
          msg << "</values>" << "<solution>";
          msg << print(getOptima()[i].getSolution()," ");
          msg << "</solution>" << "</point>" << endl;
      
      }
  }
  msg << "</optimums>" << endl;

  // print vectors of bounds
  msg << "<bounds>" << endl;

  msg << "<minimums>";
    msg << "<point>" << "<solution>";
    msg << print( getBoundsMinima(), " ");
    msg << "</solution>" << "</point>";
  msg << "</minimums>" << endl;

  msg << "<maximums>";
    msg << "<point>" << "<solution>";
    msg << print( getBoundsMaxima(), " ");
    msg << "</solution>" << "</point>";
  msg << "</maximums>" << endl;

  msg << "</bounds>" << endl;

  // references
  msg << "<reference>" << getCitation() << "</reference>" << endl;


  msg << "</problem>" << endl;

  // return only the string
  return msg.str();  
}
Esempio n. 5
0
		void citation() { m->mothurOutEndLine(); m->mothurOut(getCitation()); m->mothurOutEndLine(); }