<commit_before>/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/model/CModel.cpp,v $
   $Revision: 1.152 $
   $Name:  $
   $Author: shoops $ 
   $Date: 2003/12/12 22:20:54 $
   End CVS Header */

/////////////////////////////////////////////////////////////////////////////
// CModel
// model.cpp : interface of the CModel class
//
/////////////////////////////////////////////////////////////////////////////
#include "copasi.h"

#include <string>
#include <vector>
#include <limits.h>
#include <cmath>
#include <algorithm>

#ifndef DBL_MAX
#define DBL_MAX 1.7976931348623158e+308
#endif //DBL_MAX

// #define DEBUG_MATRIX

#define  COPASI_TRACE_CONSTRUCTION
#include "CCompartment.h"
#include "CMetab.h"
#include "CModel.h"
#include "CState.h"
#include "function/CFunctionDB.h"
#include "report/CCopasiObjectReference.h"
#include "report/CKeyFactory.h"
#include "utilities/CCopasiException.h"
#include "utilities/CCopasiMessage.h"
#include "utilities/CCopasiVector.h"
#include "utilities/CGlobals.h"
#include "utilities/CVector.h"
#include "utilities/CluX.h"
#include "utilities/utility.h"

#include "clapackwrap.h"

const char * CModel::VolumeUnitName[] =
  {"l", "ml", "l", "nl", "pl", "fl", NULL};

const char * CModel::TimeUnitName[] =
  {"s", "m", "h", "d", NULL};

const char * CModel::QuantityUnitName[] =
  {"Mol", "mMol", "Mol", "nMol", "pMol", "fMol", "#", NULL};

CModel::CModel():
    CCopasiContainer("NoName", &RootContainer, "Model"),
    mKey(CKeyFactory::add("Model", this)),
    mComments(),
    mVolumeUnit("ml"),
    mTimeUnit("s"),
    mQuantityUnit("mMol"),
    mCompartments("Compartments", this),
    mMetabolites("Metabolites", this),
    mMetabolitesX("Reduced Model Metabolites", this),
    mMetabolitesInd("Independent Metabolites", this),
    mMetabolitesDep("Dependent Metabolites", this),
    mSteps("Reactions", this),
    mStepsX("Reduced Model Reactions", this),
    mStepsInd("Independent Reactions", this),
    mFluxes(),
    mFluxesX(),
    mScaledFluxes(),
    mScaledFluxesX(),
    mInitialTime(0),
    mTime(0),
    mTransitionTime(0),
    mMoieties("Moieties", this),
    mStoi(),
    mRedStoi(),
    mL(),
    mLView(mL, mMetabolitesInd),
    mQuantity2NumberFactor(1.0),
    mNumber2QuantityFactor(1.0),
    mStateTemplate()
{
  initObjects();

  unsigned C_INT32 i, imax = mSteps.size();

  for (i = 0; i < imax; i++)
    mSteps[i]->compile(mCompartments);

  initializeMetabolites();

  compile();

  CONSTRUCTOR_TRACE;
}

CModel::CModel(const CModel & src):
    CCopasiContainer(src),<commit_msg>fix the bug due to failure to initialize the   setQuantityUnit(mQuantityUnit); // set the factors   setVolumeUnit(mVolumeUnit); // set the factors<commit_after>/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/model/CModel.cpp,v $
   $Revision: 1.153 $
   $Name:  $
   $Author: lixu1 $ 
   $Date: 2003/12/16 02:59:58 $
   End CVS Header */

/////////////////////////////////////////////////////////////////////////////
// CModel
// model.cpp : interface of the CModel class
//
/////////////////////////////////////////////////////////////////////////////
#include "copasi.h"

#include <string>
#include <vector>
#include <limits.h>
#include <cmath>
#include <algorithm>

#ifndef DBL_MAX
#define DBL_MAX 1.7976931348623158e+308
#endif //DBL_MAX

// #define DEBUG_MATRIX

#define  COPASI_TRACE_CONSTRUCTION
#include "CCompartment.h"
#include "CMetab.h"
#include "CModel.h"
#include "CState.h"
#include "function/CFunctionDB.h"
#include "report/CCopasiObjectReference.h"
#include "report/CKeyFactory.h"
#include "utilities/CCopasiException.h"
#include "utilities/CCopasiMessage.h"
#include "utilities/CCopasiVector.h"
#include "utilities/CGlobals.h"
#include "utilities/CVector.h"
#include "utilities/CluX.h"
#include "utilities/utility.h"

#include "clapackwrap.h"

const char * CModel::VolumeUnitName[] =
  {"l", "ml", "l", "nl", "pl", "fl", NULL};

const char * CModel::TimeUnitName[] =
  {"s", "m", "h", "d", NULL};

const char * CModel::QuantityUnitName[] =
  {"Mol", "mMol", "Mol", "nMol", "pMol", "fMol", "#", NULL};

CModel::CModel():
    CCopasiContainer("NoName", &RootContainer, "Model"),
    mKey(CKeyFactory::add("Model", this)),
    mComments(),
    mVolumeUnit("ml"),
    mTimeUnit("s"),
    mQuantityUnit("mMol"),
    mCompartments("Compartments", this),
    mMetabolites("Metabolites", this),
    mMetabolitesX("Reduced Model Metabolites", this),
    mMetabolitesInd("Independent Metabolites", this),
    mMetabolitesDep("Dependent Metabolites", this),
    mSteps("Reactions", this),
    mStepsX("Reduced Model Reactions", this),
    mStepsInd("Independent Reactions", this),
    mFluxes(),
    mFluxesX(),
    mScaledFluxes(),
    mScaledFluxesX(),
    mInitialTime(0),
    mTime(0),
    mTransitionTime(0),
    mMoieties("Moieties", this),
    mStoi(),
    mRedStoi(),
    mL(),
    mLView(mL, mMetabolitesInd),
    mQuantity2NumberFactor(1.0),
    mNumber2QuantityFactor(1.0),
    mStateTemplate()
{
  initObjects();

  unsigned C_INT32 i, imax = mSteps.size();

  for (i = 0; i < imax; i++)
    mSteps[i]->compile(mCompartments);

  initializeMetabolites();

  compile();

  /* This following 2 lines added by <NAME>
  Becaues of the failure to initialize the parameter when creating a new models
  */
  setQuantityUnit(mQuantityUnit); // set the factors
  setVolumeUnit(mVolumeUnit); // set the factors

  CONSTRUCTOR_TRACE;
}

CModel::CModel(const CModel & src):
    CCopasiContainer(src),
{'fraction_non_alphanumeric': 0.2088469905728789, 'fraction_numerical': 0.01849166062364032, 'mean_word_length': 3.3855325914149446, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2450661', 'n_tokens_mistral': 2053, 'n_tokens_neox': 1943, 'n_words': 393}