//void CILDMModifiedMethod::setAnnotationM(int step)
bool CILDMModifiedMethod::setAnnotationM(size_t step)
{
  if (step == 0) return false;

  if (mVec_mVslow.size() == 0) return false;

  //if (step > mVec_mVslow.size()) return false;

  if (step > mVec_SlowModes.size()) return false;

  step -= 1;
  double timeScale;
  std::string str;
  std::stringstream sstr;
  sstr.str("");
  sstr.clear();
  int i;

  mVslowPrint.resize(mData.dim, mData.dim);
  mVslowPrint = mVec_mVslow[step];
  pVslowPrintAnn->resize();
  pVslowPrintAnn->setCopasiVector(1, &mpModel->getMetabolitesX());

  for (i = 0; i < mData.dim; i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pVslowPrintAnn->setAnnotationString(0, i, str);
      sstr.str("");
      sstr.clear();
    }

  mVslowMetabPrint.resize(mData.dim, mData.dim);
  mVslowMetabPrint = mVec_mVslowMetab[step];
  pVslowMetabPrintAnn->resize();
  pVslowMetabPrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());

  for (i = 0; i < mData.dim; i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pVslowMetabPrintAnn->setAnnotationString(1, i, str);
      sstr.str("");
      sstr.clear();
    }

  sstr << mVec_SlowModes[step];
  // if (mVec_SlowModes[step] > 1)
  // sstr << " slow modes";
  //else
  // sstr << " slow mode";
  sstr << " slow; ";

  C_INT dim = mData.dim;
  sstr << dim - mVec_SlowModes[step];
  sstr << " fast";

  str = sstr.str();
  mVslowSpacePrint.resize(mData.dim, 1);

  for (i = 0; i < mData.dim; i++)
    mVslowSpacePrint(i, 0) = mVec_mVslowSpace[step][i];

  pVslowSpacePrintAnn->resize();
  pVslowSpacePrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());
  pVslowSpacePrintAnn->setAnnotationString(1, 0, str);

  mVfastSpacePrint.resize(mData.dim, 1);

  for (i = 0; i < mData.dim; i++)
    mVfastSpacePrint(i, 0) = mVec_mVfastSpace[step][i];

  pVfastSpacePrintAnn->resize();
  pVfastSpacePrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());
  pVfastSpacePrintAnn->setAnnotationString(1, 0, str);

  return true;

}
示例#2
0
//void CILDMMethod::setAnnotationM(int step)
bool CILDMMethod::setAnnotationM(int step)
{
  if (step == 0) return false;

  if (mVec_mVslow.size() == 0) return false;

  step -= 1;
  double timeScale;
  std::string str;
  std::stringstream sstr;
  sstr.str("");
  sstr.clear();
  C_INT32 i;

  mVslowPrint.resize(mData.dim, mData.dim);
  mVslowPrint = mVec_mVslow[step];
  pVslowPrintAnn->resize();
  pVslowPrintAnn->setCopasiVector(1, &mpModel->getMetabolitesX());

  for (i = 0; i < mData.dim; i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pVslowPrintAnn->setAnnotationString(0, i, str);
      sstr.str("");
      sstr.clear();
    }

  mVslowMetabPrint.resize(mData.dim, mData.dim);
  mVslowMetabPrint = mVec_mVslowMetab[step];
  pVslowMetabPrintAnn->resize();
  pVslowMetabPrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());

  for (i = 0; i < mData.dim; i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pVslowMetabPrintAnn->setAnnotationString(1, i, str);
      sstr.str("");
      sstr.clear();
    }

  sstr << mVec_SlowModes[step];
  // if (mVec_SlowModes[step] > 1)
  // sstr << " slow modes";
  //else
  // sstr << " slow mode";
  sstr << " slow; ";

  C_INT dim = mData.dim;
  sstr << dim - mVec_SlowModes[step];
  sstr << " fast";

  str = sstr.str();
  mVslowSpacePrint.resize(mData.dim, 1);

  for (i = 0; i < mData.dim; i++)
    mVslowSpacePrint(i, 0) = mVec_mVslowSpace[step][i];

  pVslowSpacePrintAnn->resize();
  pVslowSpacePrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());
  pVslowSpacePrintAnn->setAnnotationString(1, 0, str);

  mVfastSpacePrint.resize(mData.dim, 1);

  for (i = 0; i < mData.dim; i++)
    mVfastSpacePrint(i, 0) = mVec_mVfastSpace[step][i];

  pVfastSpacePrintAnn->resize();
  pVfastSpacePrintAnn->setCopasiVector(0, &mpModel->getMetabolitesX());
  pVfastSpacePrintAnn->setAnnotationString(1, 0, str);

  //sstr.clear();
  sstr.str("");
  str = sstr.str();

  mReacSlowSpacePrint.resize(mReacSlowSpace.size(), 1);

  for (i = 0; i < (C_INT32) mReacSlowSpace.size(); i++)
    mReacSlowSpacePrint(i, 0) = mVec_mReacSlowSpace[step][i];

  pReacSlowSpacePrintAnn->resize();
  pReacSlowSpacePrintAnn->setCopasiVector(0, &mpModel->getReactions());
  pReacSlowSpacePrintAnn->setAnnotationString(1, 0, str);

  sstr.str("");
  str = sstr.str();

  /* temporary tabs */

  C_INT reacs_size = mpModel->getReactions().size();

  mTMP1Print.resize(reacs_size, mData.dim);
  mTMP1Print = mVec_mTMP1[step];

  pTMP1PrintAnn->resize();

  for (i = 0; i < (C_INT) mVec_mTMP1[step].numCols(); i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < (C_INT) mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pTMP1PrintAnn->setAnnotationString(1, i, str);
      sstr.str("");
      sstr.clear();
    }

  pTMP1PrintAnn->setCopasiVector(0, &mpModel->getReactions());

  mTMP2Print.resize(reacs_size, mData.dim);
  mTMP2Print = mVec_mTMP2[step];

  pTMP2PrintAnn->resize();

  for (i = 0; i < (C_INT) mVec_mTMP2[step].numCols(); i++)
    {
      timeScale = mVec_TimeScale[step][i];

      if (i < (C_INT) mVec_SlowModes[step])
        sstr << "Slow: ";
      else
        sstr << "Fast: ";

      sstr << timeScale;
      str = sstr.str();
      pTMP2PrintAnn->setAnnotationString(1, i, str);
      sstr.str("");
      sstr.clear();
    }

  pTMP2PrintAnn->setCopasiVector(0, &mpModel->getReactions());

  mTMP3Print.resize(reacs_size, 1);
  mTMP3Print = mVec_mTMP3[step];
  pTMP3PrintAnn->resize();
  pTMP3PrintAnn->setCopasiVector(0, &mpModel->getReactions());
  pTMP3PrintAnn->setAnnotationString(1, 0, str);

  return true;
}