CMoietiesTask::CMoietiesTask(const CMoietiesTask & src, const CDataContainer * pParent): CCopasiTask(src, pParent) { mpProblem = new CMoietiesProblem(* static_cast< CMoietiesProblem * >(src.mpProblem), this); mpMethod = createMethod(src.mpMethod->getSubType()); }
CTrajectoryTask::CTrajectoryTask(const CTrajectoryTask & src, const CCopasiContainer * pParent): CCopasiTask(src, pParent), mTimeSeriesRequested(src.mTimeSeriesRequested), mTimeSeries(), mpTrajectoryProblem(NULL), mpTrajectoryMethod(NULL), mUpdateMoieties(false), mpCurrentState(NULL), mpCurrentTime(NULL), mOutputStartTime(0.0), mpLessOrEqual(src.mpLessOrEqual), mpLess(src.mpLess) { mpProblem = new CTrajectoryProblem(*static_cast< CTrajectoryProblem * >(src.mpProblem), this); mpMethod = createMethod(src.mpMethod->getSubType()); * mpMethod = * src.mpMethod; mpMethod->elevateChildren(); this->add(mpMethod, true); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = *pParameter->getValue().pBOOL; else mUpdateMoieties = false; }
CTrajectoryTask::CTrajectoryTask(const CCopasiContainer * pParent): CCopasiTask(CCopasiTask::timeCourse, pParent), mTimeSeriesRequested(true), mTimeSeries(), mpTrajectoryProblem(NULL), mpSteadyState(NULL), mpTrajectoryMethod(NULL), mUpdateMoieties(false), mpCurrentState(NULL), mpCurrentTime(NULL), mOutputStartTime(0.0), mpLessOrEqual(&fle), mpLess(&fl) { mpProblem = new CTrajectoryProblem(this); mpMethod = createMethod(CCopasiMethod::deterministic); this->add(mpMethod, true); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = *pParameter->getValue().pBOOL; else mUpdateMoieties = false; }
CTSSATask::CTSSATask(const CTSSATask & src, const CCopasiContainer * pParent): CCopasiTask(src, pParent), mTimeSeriesRequested(src.mTimeSeriesRequested), mTimeSeries(), mpTSSAProblem(NULL), mpTSSAMethod(NULL), mContainerState(), mpContainerStateTime(NULL) { mpProblem = new CTSSAProblem(*static_cast< CTSSAProblem * >(src.mpProblem), this); mpMethod = createMethod(src.mpMethod->getSubType()); * mpMethod = * src.mpMethod; mpMethod->elevateChildren(); this->add(mpMethod, true); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = pParameter->getValue< bool >(); else mUpdateMoieties = false; }
CSensTask::CSensTask(const CCopasiContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type) { mpProblem = new CSensProblem(this); mpMethod = createMethod(CTaskEnum::sensMethod); }
CMoietiesTask::CMoietiesTask(const CDataContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type) { mpProblem = new CMoietiesProblem(type, this); mpMethod = createMethod(CTaskEnum::Method::Householder); this->add(mpMethod, true); }
CMCATask::CMCATask(const CCopasiContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type) { mpProblem = new CMCAProblem(this); mpMethod = createMethod(CTaskEnum::mcaMethodReder); }
CSensTask::CSensTask(const CCopasiContainer * pParent): CCopasiTask(CCopasiTask::sens, pParent) { mpProblem = new CSensProblem(this); mpMethod = createMethod(CCopasiMethod::sensMethod); this->add(mpMethod, true); }
CMCATask::CMCATask(const CMCATask & src, const CCopasiContainer * pParent): CCopasiTask(src, pParent) { mpProblem = new CMCAProblem(*(CMCAProblem *) src.mpProblem, this); mpMethod = createMethod(src.mpMethod->getSubType()); this->add(mpMethod, true); }
CFitTask::CFitTask(const CDataContainer * pParent, const CTaskEnum::Task & type): COptTask(pParent, type) { pdelete(mpProblem); mpProblem = new CFitProblem(type, this); pdelete(mpMethod); mpMethod = createMethod(CTaskEnum::Method::EvolutionaryProgram); ((COptMethod *) mpMethod)->setProblem((COptProblem *) mpProblem); }
CFitTask::CFitTask(const CFitTask & src, const CDataContainer * pParent): COptTask(src, pParent) { pdelete(mpProblem); mpProblem = new CFitProblem(*(CFitProblem *) src.mpProblem, this); pdelete(mpMethod); mpMethod = createMethod(src.mpMethod->getSubType()); this->add(mpMethod, true); ((COptMethod *) mpMethod)->setProblem((COptProblem *) mpProblem); }
CScanTask::CScanTask(const CCopasiContainer * pParent): CCopasiTask(CCopasiTask::scan, pParent), mProgress(0), mhProgress(C_INVALID_INDEX), mpSubtask(NULL), mOutputInSubtask(false), mUseInitialValues(true) { mpProblem = new CScanProblem(this); mpMethod = createMethod(CCopasiMethod::scanMethod); this->add(mpMethod, true); static_cast< CScanMethod * >(mpMethod)->setProblem(static_cast< CScanProblem * >(mpProblem)); }
bool COptTask::setMethodType(const int & type) { CCopasiMethod::SubType Type = (CCopasiMethod::SubType) type; if (mpMethod->getSubType() == Type) return true; pdelete(mpMethod); mpMethod = createMethod(Type); this->add(mpMethod, true); return true; }
CScanTask::CScanTask(const CScanTask & src, const CDataContainer * pParent): CCopasiTask(src, pParent), mProgress(0), mhProgress(C_INVALID_INDEX), mpSubtask(NULL), mOutputInSubtask(false), mUseInitialValues(true) { mpProblem = new CScanProblem(*(CScanProblem *) src.mpProblem, this); mpMethod = createMethod(CTaskEnum::Method::scanMethod); static_cast< CScanMethod * >(mpMethod)->setProblem(static_cast< CScanProblem * >(mpProblem)); }
bool CTSSATask::setMethodType(const int & type) { CCopasiMethod::SubType Type = (CCopasiMethod::SubType) type; if (!isValidMethod(Type, ValidMethods)) return false; if (mpMethod->getSubType() == Type) return true; pdelete(mpMethod); mpMethod = createMethod(Type); this->add(mpMethod, true); //mpMethod->setObjectParent(this); return true; }
// virtual bool CCopasiTask::setMethodType(const int & type) { CTaskEnum::Method Type = (CTaskEnum::Method) type; if (!isValidMethod(Type, getValidMethods())) return false; if (mpMethod->getSubType() == Type) return true; pdelete(mpMethod); mpMethod = createMethod(Type); signalMethodChanged(); return true; }
CSteadyStateTask::CSteadyStateTask(const CCopasiContainer * pParent): CCopasiTask(CCopasiTask::steadyState, pParent), mpSteadyState(NULL), mJacobian(), mJacobianX(), mpJacobianAnn(NULL), mpJacobianXAnn(NULL), mEigenValues("Eigenvalues of Jacobian", this), mEigenValuesX("Eigenvalues of reduced system Jacobian", this) { mpProblem = new CSteadyStateProblem(this); mpMethod = createMethod(CCopasiMethod::Newton); this->add(mpMethod, true); initObjects(); }
CSteadyStateTask::CSteadyStateTask(const CCopasiContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type), mSteadyState(), mJacobian(), mJacobianReduced(), mpJacobianAnn(NULL), mpJacobianXAnn(NULL), mEigenValues("Eigenvalues of Jacobian", this), mEigenValuesX("Eigenvalues of reduced system Jacobian", this) { mpProblem = new CSteadyStateProblem(this); mpMethod = createMethod(CTaskEnum::Newton); initObjects(); }
CCrossSectionTask::CCrossSectionTask(const CCrossSectionTask & src, const CCopasiContainer * pParent): CCopasiTask(src, pParent), mTimeSeriesRequested(src.mTimeSeriesRequested), mTimeSeries(), mpCrossSectionProblem(NULL), mpTrajectoryMethod(NULL), mUpdateMoieties(false), mpCurrentState(NULL), mpCurrentTime(NULL), mOutputStartTime(0.0), mStartTime(0.0), mNumCrossings(0), mOutputStartNumCrossings(0), mMaxNumCrossings(std::numeric_limits< size_t >::max()), mhProgress(C_INVALID_INDEX), mProgressMax(1), mProgressValue(0), mProgressFactor(1), mpEvent(NULL), mState(CCrossSectionTask::TRANSIENT), mStatesRing(), mStatesRingCounter(0), mPreviousCrossingTime(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mAveragePeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mLastPeriod(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mPeriodicity(-1), mLastFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()), mAverageFreq(std::numeric_limits< C_FLOAT64 >::quiet_NaN()) { initObjects(); mpProblem = new CCrossSectionProblem(*static_cast< CCrossSectionProblem * >(src.mpProblem), this); mpMethod = createMethod(src.mpMethod->getSubType()); * mpMethod = * src.mpMethod; mpMethod->elevateChildren(); this->add(mpMethod, true); }
CSteadyStateTask::CSteadyStateTask(const CSteadyStateTask & src, const CCopasiContainer * pParent): CCopasiTask(src, pParent), mpSteadyState(src.mpSteadyState), mJacobian(src.mJacobian), mJacobianX(src.mJacobianX), mpJacobianAnn(NULL), mpJacobianXAnn(NULL), mEigenValues(src.mEigenValues, this), mEigenValuesX(src.mEigenValuesX, this) { mpProblem = new CSteadyStateProblem(*(CSteadyStateProblem *) src.mpProblem, this); mpMethod = createMethod(src.mpMethod->getSubType()); this->add(mpMethod, true); initObjects(); }
CTSSATask::CTSSATask(const CCopasiContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type), mTimeSeriesRequested(true), mTimeSeries(), mpTSSAProblem(NULL), mpTSSAMethod(NULL), mContainerState(), mpContainerStateTime(NULL) { mpProblem = new CTSSAProblem(this); mpMethod = createMethod(CTaskEnum::tssILDM); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = pParameter->getValue< bool >(); else mUpdateMoieties = false; }
CTSSATask::CTSSATask(const CCopasiContainer * pParent): CCopasiTask(CCopasiTask::tssAnalysis, pParent), mTimeSeriesRequested(true), mTimeSeries(), mpTSSAProblem(NULL), mpTSSAMethod(NULL), mpCurrentState(NULL), mpCurrentTime(NULL) { mpProblem = new CTSSAProblem(this); mpMethod = createMethod(CCopasiMethod::tssILDM); this->add(mpMethod, true); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = *pParameter->getValue().pBOOL; else mUpdateMoieties = false; }
int main(int argc, char* argv[]) { double a = 0; double b = 2; if (argc != 3 && argc != 5) { printHelp(argv); return 1; } if (strlen(argv[1]) > 1) { printHelp(argv); return 2; } char method = argv[1][0]; int functionIndex = atoi(argv[2]); if (functionIndex == 0) { printHelp(argv); return 3; } if (argc == 5) { a = atof(argv[3]); b = atof(argv[4]); if (b <= a) { printHelp(argv); return 4; } } fptr func = chooseFunc(functionIndex); QuadratureRule* integrator = createMethod(method, func, a, b); printf("performing integration\n"); integrator->integrate(); printf("result of integrating function %d in interval [%5.3lf, %5.3lf] = %5.3lf\n", functionIndex, a, b, integrator->getResult()); return 0; }
bool CCrossSectionTask::setMethodType(const int & type) { CCopasiMethod::SubType Type = (CCopasiMethod::SubType) type; if (!isValidMethod(Type, ValidMethods)) return false; if (mpMethod->getSubType() == Type) return true; pdelete(mpMethod); mpMethod = createMethod(Type); this->add(mpMethod, true); CCopasiParameter * pParameter = mpMethod->getParameter("Integrate Reduced Model"); if (pParameter != NULL) mUpdateMoieties = *pParameter->getValue().pBOOL; else mUpdateMoieties = false; return true; }
CLyapTask::CLyapTask(const CCopasiContainer * pParent, const CTaskEnum::Task & type): CCopasiTask(pParent, type), mpLyapProblem(NULL), mpLyapMethod(NULL), mLocalExponents(), mExponents(), mSumOfExponents(0.0), mSumOfLocalExponents(0.0), mIntervalDivergence(0.0), mAverageDivergence(0.0), mResultAvailable(false), mResultHasDivergence(false), mModelVariablesInResult(0) { mpProblem = new CLyapProblem(this); mpMethod = createMethod(CTaskEnum::lyapWolf); this->add(mpMethod, true); initObjects(); }