From d2c27a38e858a9dbb342d10a0519a7119f52c12d Mon Sep 17 00:00:00 2001 From: Andy Somogyi Date: Sun, 24 Aug 2014 14:34:18 -0400 Subject: [PATCH] removed dead code --- apps/rr-sbml-benchmark/main.cpp | 1 + examples/one_rr/main.cpp | 2 +- source/llvm_testing/src/ConfigurableTest.cpp | 3 + source/rrRoadRunner.cpp | 10 +-- source/rrRoadRunner.h | 14 ++- wrappers/C/rrc_cpp_support.cpp | 89 -------------------- wrappers/C/rrc_cpp_support.h | 6 -- 7 files changed, 12 insertions(+), 113 deletions(-) diff --git a/apps/rr-sbml-benchmark/main.cpp b/apps/rr-sbml-benchmark/main.cpp index 3525d77c34..c18a708d3e 100644 --- a/apps/rr-sbml-benchmark/main.cpp +++ b/apps/rr-sbml-benchmark/main.cpp @@ -22,6 +22,7 @@ #include using namespace rr; +using namespace std; // copasi test suite called like // ./sbml-testsuite ~/src/sbml_test/cases/semantic 00221 ~/tmp/copasi 2 4 diff --git a/examples/one_rr/main.cpp b/examples/one_rr/main.cpp index be89826577..8d2ba485a6 100644 --- a/examples/one_rr/main.cpp +++ b/examples/one_rr/main.cpp @@ -31,7 +31,7 @@ int main(int argc, char** argv) Log(lInfo)<<" ---------- SIMULATE ---------------------"; rr1.simulate(); - Log(lInfo)<<"Data:"<<*(rr1.getSimulationResult()); + Log(lInfo)<<"Data:"<<*(rr1.getSimulationData()); } catch(const Exception& ex) { diff --git a/source/llvm_testing/src/ConfigurableTest.cpp b/source/llvm_testing/src/ConfigurableTest.cpp index bd229a3035..989659e104 100644 --- a/source/llvm_testing/src/ConfigurableTest.cpp +++ b/source/llvm_testing/src/ConfigurableTest.cpp @@ -8,6 +8,9 @@ #include "ConfigurableTest.h" #include "rrRoadRunner.h" #include +#include +#include + using namespace std; diff --git a/source/rrRoadRunner.cpp b/source/rrRoadRunner.cpp index a970f62bc5..6af170fa43 100644 --- a/source/rrRoadRunner.cpp +++ b/source/rrRoadRunner.cpp @@ -500,7 +500,7 @@ string RoadRunner::getExtendedVersionInfo() -LibStructural* RoadRunner::getLibStruct() +ls::LibStructural* RoadRunner::getLibStruct() { Mutex::ScopedLock lock(roadRunnerMutex); @@ -665,14 +665,6 @@ void RoadRunner::updateIntegrator() } } -RoadRunnerData *RoadRunner::getSimulationResult() -{ - // set the data into the RoadRunnerData struct - populateResult(); - - return &impl->mRoadRunnerData; -} - double RoadRunner::getValue(const SelectionRecord& record) { diff --git a/source/rrRoadRunner.h b/source/rrRoadRunner.h index 35aedb1ece..c46c4491ed 100644 --- a/source/rrRoadRunner.h +++ b/source/rrRoadRunner.h @@ -4,7 +4,6 @@ #include "rrOSSpecifics.h" #include "rr-libstruct/lsMatrix.h" #include "rrSelectionRecord.h" -#include "rrRoadRunnerData.h" #include "rrRoadRunnerOptions.h" #include "Configurable.h" @@ -25,6 +24,11 @@ class SBMLModelSimulation; class ExecutableModel; class Integrator; +using ls::Matrix; +using ls::DoubleMatrix; +using ls::Complex; +using ls::ComplexMatrix; + /** * The main RoadRunner class. * @@ -163,12 +167,6 @@ class RR_DECLSPEC RoadRunner : public Configurable #ifndef SWIG // deprecated methods not SWIG'ed - /** - * Use getSimulationData() instead. - * Also, can use the RoadRunnerData::RoadRunnerData(const RoadRunner*) ctor - */ - RR_DEPRECATED(rr::RoadRunnerData *getSimulationResult()); - #endif void setSimulateOptions(const SimulateOptions& settings); @@ -834,7 +832,7 @@ class RR_DECLSPEC RoadRunner : public Configurable /** * the LibStruct is normally null, only created on demand here. */ - LibStructural* getLibStruct(); + ls::LibStructural* getLibStruct(); /** * If the specified integrator does not exist, create it, and point the diff --git a/wrappers/C/rrc_cpp_support.cpp b/wrappers/C/rrc_cpp_support.cpp index 1ef668553d..9698ee1abf 100644 --- a/wrappers/C/rrc_cpp_support.cpp +++ b/wrappers/C/rrc_cpp_support.cpp @@ -315,96 +315,7 @@ RRList* createArrayList(const rrc::ArrayList& aList) return theList; } -//RRParameterHandle createParameter(const rr::BaseParameter& para) -//{ -// if(para.getType() == "bool") -// { -// Parameter *thePara = dynamic_cast< Parameter* >(const_cast< BaseParameter* >(¶)); -// -// RRParameter* aPara = new RRParameter; -// aPara->ParaType = ptBool; -// aPara->data.bValue = thePara->getValue(); -// aPara->mName = rr::createText(thePara->getName()); -// aPara->mHint = rr::createText(thePara->getHint()); -// return aPara; -// } -// -// if(para.getType() == "integer") -// { -// Parameter *thePara = dynamic_cast< Parameter* >(const_cast< BaseParameter* >(¶)); -// -// RRParameter* aPara = new RRParameter; -// aPara->ParaType = ptInteger; -// aPara->data.iValue = thePara->getValue(); -// aPara->mName = rr::createText(thePara->getName()); -// aPara->mHint = rr::createText(thePara->getHint()); -// return aPara; -// } -// -// if(para.getType() == "double") -// { -// Parameter *thePara = dynamic_cast< Parameter* >(const_cast< BaseParameter* >(¶)); -// -// RRParameter* aPara = new RRParameter; -// aPara->ParaType = ptInteger; -// aPara->data.iValue = thePara->getValue(); -// aPara->mName = rr::createText(thePara->getName()); -// aPara->mHint = rr::createText(thePara->getHint()); -// return aPara; -// } -// -// if(para.getType() == "vector") -// { -// Parameter *thePara = dynamic_cast< Parameter* >(const_cast< BaseParameter* >(¶)); -// -// RRParameter* aPara = new RRParameter; -// aPara->ParaType = ptVector; -// aPara->data.vValue = thePara->getValue(); -// aPara->mName = rr::createText(thePara->getName()); -// aPara->mHint = rr::createText(thePara->getHint()); -// return aPara; -// } -// return NULL; -//} - - -RRCDataPtr createRRCData(const RoadRunnerData& result) -{ - RRCData* rrCData = new RRCData; - memset(rrCData, 0, sizeof(RRCData)); - - rrCData->ColumnHeaders = new char*[result.cSize()]; - for(int i = 0; i < result.cSize(); i++) - { - rrCData->ColumnHeaders[i] = rr::createText(result.getColumnNames()[i]); - } - rrCData->RSize = result.rSize(); - rrCData->CSize = result.cSize(); - int size = rrCData->RSize*rrCData->CSize; - rrCData->Data = new double[size]; - - if(result.hasWeights()) - { - rrCData->Weights = new double[size]; - } - - int index = 0; - //The data layout is simple row after row, in one single long row... - for(int row = 0; row < rrCData->RSize; row++) - { - for(int col = 0; col < rrCData->CSize; col++) - { - rrCData->Data[index] = result(row, col); - if(result.hasWeights()) - { - rrCData->Weights[index] = result.getWeight(row, col); - } - ++index; - } - } - return rrCData; -} RRCDataPtr createRRCData(const RoadRunner& tmp) { diff --git a/wrappers/C/rrc_cpp_support.h b/wrappers/C/rrc_cpp_support.h index 445487445c..91d0484c7e 100644 --- a/wrappers/C/rrc_cpp_support.h +++ b/wrappers/C/rrc_cpp_support.h @@ -153,12 +153,6 @@ C_DECL_SPEC RRStringArrayPtr createList(const rrc::StringList& lis */ C_DECL_SPEC RRListPtr createArrayList(const ArrayList& list); -/** - * @deprecated - * - * RoadRunnerData is going away. - */ -C_DECL_SPEC RRCDataPtr createRRCData(const rr::RoadRunnerData& data); /** * Creates an RRCDataPtr from the current state of a RoadRunner object.