61 int main(
int argc,
char *argv[])
69 SparseMatrixTest(10, sparseness, 0,
false,
true,
true,
false);
70 SparseMatrixTest(25, sparseness, 0,
false,
true,
true,
false);
71 SparseMatrixTest(50, sparseness, 0,
false,
true,
true,
false);
72 SparseMatrixTest(100, sparseness, 0,
false,
true,
true,
false);
73 SparseMatrixTest(250, sparseness, 0,
false,
true,
true,
false);
74 SparseMatrixTest(500, sparseness, 0,
false,
true,
true,
false);
75 SparseMatrixTest(1000, sparseness, 0,
false,
true,
true,
false);
76 SparseMatrixTest(2500, sparseness, 0,
false,
true,
true,
false);
77 SparseMatrixTest(5000, sparseness, 0,
false,
true,
true,
false);
96 std::cerr << e.what();
138 assert(pDataModel != NULL);
142 size_t j, i, imax = Variables.
size();
145 for (i = 0; i < imax; i++)
149 Variables[i].value = pValue;
158 CCopasiRootContainer::getFnctionList()->loadedFunctions();
161 for (i = 0, imax = Functions.
size(); i < imax; i++)
163 pFunction =
dynamic_cast<CFunction *
>(Functions[i]);
166 for (j = 0; j < 100000; j++)
175 bool Validate =
false;
183 std::string ImportSBML;
188 std::cerr <<
"SBML Import File: " << ImportSBML << std::endl;
216 if (!pDataModel->
exportMathModel(ExportC, NULL,
"C Files (*.c)",
true))
218 std::cerr <<
"C File: " << ExportC << std::endl;
230 std::string ExportBerkeleyMadonna;
233 if (!pDataModel->
exportMathModel(ExportBerkeleyMadonna, NULL,
"Berkeley Madonna Files (*.mmd)",
true))
235 std::cerr <<
"Berkeley Madonna File: " << ExportBerkeleyMadonna << std::endl;
247 std::string ExportXPPAUT;
250 if (!pDataModel->
exportMathModel(ExportXPPAUT, NULL,
"XPPAUT (*.ode)",
true))
252 std::cerr <<
"XPPAUT File: " << ExportXPPAUT << std::endl;
267 if (!pDataModel->
saveModel(Save, NULL,
true))
270 std::cerr <<
"Save File: " << pDataModel->
getFileName() << std::endl;
280 COptions::nonOptionType::const_iterator it = Files.begin();
281 COptions::nonOptionType::const_iterator end = Files.end();
289 Argv[0] = strdup(Self.c_str());
290 Argv[1] = strdup(
"--help");
296 Parser.
parse(2, Argv);
305 std::cerr << e.what();
314 for (; it != end; ++it)
318 std::cerr <<
"File: " << *it << std::endl;
349 if (!pDataModel->
exportMathModel(ExportC, NULL,
"C Files (*.c)",
true))
351 std::cerr <<
"C File: " << ExportC << std::endl;
366 std::string ExportBerkeleyMadonna;
369 if (!pDataModel->
exportMathModel(ExportBerkeleyMadonna, NULL,
"Berkeley Madonna Files (*.mmd)",
true))
371 std::cerr <<
"Berkeley Madonna File: " << ExportBerkeleyMadonna << std::endl;
386 std::string ExportXPPAUT;
389 if (!pDataModel->
exportMathModel(ExportXPPAUT, NULL,
"XPPAUT (*.ode)",
true))
391 std::cerr <<
"XPPAUT File: " << ExportXPPAUT << std::endl;
403 size_t i, imax = TaskList.
size();
405 for (i = 0; i < imax; i++)
406 if (TaskList[i]->isScheduled())
408 TaskList[i]->getProblem()->setModel(pDataModel->
getModel());
409 TaskList[i]->setCallBack(pProcessReport);
420 (!TaskList[i]->isUpdateModel() ||
427 success &= TaskList[i]->process(
true);
435 TaskList[i]->restore();
439 std::cerr <<
"File: " << pDataModel->
getFileName() << std::endl;
440 std::cerr <<
"Task: " << TaskList[i]->
getObjectName() << std::endl;
446 if (pProcessReport != NULL)
451 TaskList[i]->setCallBack(NULL);
461 if (!pDataModel->
saveModel(Save, NULL,
true))
463 std::cerr <<
"Save File: " << Save << std::endl;
479 std::cerr <<
"Unhandled Exception:" << std::endl;
498 std::cout <<
"COPASI "
500 <<
"The use of this software indicates the acceptance of the attached license." << std::endl
501 <<
"To view the license please use the option: --license" << std::endl
514 size_t i, imax = TaskList.
size();
516 for (i = 0; i < imax; i++)
517 if (TaskList[i]->isScheduled())
520 TaskList[i]->getProblem()->setModel(pDataModel->
getModel());
530 (!TaskList[i]->isUpdateModel() ||
540 TaskList[i]->restore();
544 std::cerr <<
"File: " << pDataModel->
getFileName() << std::endl;
545 std::cerr <<
"Task: " << TaskList[i]->
getObjectName() << std::endl;
562 std::string ExportSBML;
617 std::cerr <<
"SBML Export File: " << ExportSBML << std::endl;
autothrow get_autothrow_id(void) const
const std::string & getObjectName() const
virtual C_FLOAT64 getRandomOO()
virtual size_t size() const
const std::string & getText() const
const CCopasiMessage & getMessage() const
static std::string getAllMessageText(const bool &chronological=true)
bool importSBML(const std::string &fileName, CProcessReport *pImportHandler=NULL, const bool &deleteOldData=true)
const CEvaluationTree::Type & getType() const
const char * get_help_comment(void) const
static std::string baseName(const std::string &path)
const std::string & getFileName() const
static const nonOptionType & getNonOptions()
static bool compareValue(const std::string &name, const CType &value)
static CRandom * createGenerator(CRandom::Type type=CRandom::mt19937, unsigned C_INT32 seed=0)
static const char * getLicenseTxt()
CCopasiVectorN< CCopasiTask > * getTaskList()
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
bool loadModel(std::istream &in, const std::string &pwd, CProcessReport *pProcessReport, const bool &deleteOldData=true)
bool saveModel(const std::string &fileName, CProcessReport *pProcessReport, bool overwriteFile=false, const bool &autoSave=false)
virtual const C_FLOAT64 & calcValue(const CCallParameters< C_FLOAT64 > &callParameters)
static void getValue(const std::string &name, CType &value)
static CCopasiDataModel * addDatamodel()
static bool checkForMessage(const size_t &number)
void parse(int argc, char *argv[], bool call_finalize=true)
parse the command line
int main(int argc, char *argv[])
The class for handling a chemical kinetic function.
bool exportMathModel(const std::string &fileName, CProcessReport *pProcessReport, const std::string &filter, bool overwriteFile=false)
static void init(int argc, char *argv[], const bool &withGui=false)
std::vector< std::string > nonOptionType
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const
const std::string & getVersion() const
static const CVersion VERSION