# Changeset 281

Ignore:
Timestamp:
Sep 19, 2010 4:22:44 AM (3 years ago)
Message:

update data files

Location:
projects/ApplicationTemplates
Files:
15 edited

Unmodified
Removed
• ## projects/ApplicationTemplates/configure

 r274 if test $coin_vpath_config = yes; then coin_vpath_link_files="$coin_vpath_link_files osDip/OSDipFactoryInitializer.h" fi if test $coin_vpath_config = yes; then coin_vpath_link_files="$coin_vpath_link_files osDip/OSDipBlockSolverFactory.h" fi if test $coin_vpath_config = yes; then coin_vpath_link_files="$coin_vpath_link_files osDip/OSDipBlockSolverFactory.cpp" fi

• ## projects/ApplicationTemplates/data/spl1.osil

 r258 2 3 4 5 7 4 3 1 2 6 5 4 2 1 3 2 3 3 234574312654213233 0 5 1 6 2 7 3 8 4 9 0 10 1 11 2 12 3 13 4 14 0 15 1 19 5 15 6 16 7 17 8 18 9 19 10 15 11 16 12 17 13 18 14 19 0 1 2 3 4 5 6 7 13 14 15 16 17 18 19
• ## projects/ApplicationTemplates/data/spl1.osol

 r258 spl1 -- setup constraints are the blocks
• ## projects/ApplicationTemplates/osDip/Makefile.in

 r276 OBJS         += OSDipBlockSolver.@OBJEXT@ OBJS         += OSDipBlockCoinSolver.@OBJEXT@ OBJS         += OSDipBlockSolverFactory.@OBJEXT@ # CHANGEME: Additional libraries
• ## projects/ApplicationTemplates/osDip/OSDipApp.cpp

 r248 // variable indexes for a block m_blockVars = m_osInterface.getBlockVarIndexes(); //get the solver factory for each block m_blockFactories = m_osInterface.getBlockFactories(); //finally get an osinstance for each block m_blockOSInstances = m_osInterface.getBlockOSInstances(); //loop over the instances and generate a solver for each block std::vector::iterator vit1; std::string solverFactory; int kount = 0; OSDipBlockSolver *solver = NULL; for (vit1 = m_blockOSInstances.begin(); vit1 != m_blockOSInstances.end(); vit1++) { OSDipBlockSolverFactory::factories[ m_appParam.solverFactory]->osinstance = *vit1; solver = OSDipBlockSolverFactory::factories[ m_appParam.solverFactory]->create(); //kipp check for a valid name here -- if( m_blockFactories[ kount].size()  > 0){ solverFactory =  m_blockFactories[ kount]; }else{ solverFactory =  m_appParam.solverFactory; } kount++; OSDipBlockSolverFactory::factories[ solverFactory]->osinstance = *vit1; solver = OSDipBlockSolverFactory::factories[ solverFactory]->create(); m_osDipBlockSolver.push_back( solver);
• ## projects/ApplicationTemplates/osDip/OSDipApp.h

 r248 /** m_coreConstraintIndexes is the set core constraint indexes */ std::set  m_coreConstraintIndexes; std::set  m_coreConstraintIndexes; /** m_blockFactories is a vector solver factory for each block */ std::vector  m_blockFactories; /** Class id tag (for log / debugging). */
• ## projects/ApplicationTemplates/osDip/OSDipBlockCoinSolver.h

 r248 #include "OSCoinSolver.h" #include "OSrLReader.h" #include "OSDipBlockSolverFactory.h" // --------------------------------------------------------------------- // public: OSDipBlockSolver* create() {  return new OSDipBlockCoinSolver( osinstance); };
• ## projects/ApplicationTemplates/osDip/OSDipBlockSolver.cpp

 r248 */ #include "OSDipBlockSolver.h" #include "OSDipBlockSolverFactory.h" //OSDipBlockSolver* OSDipBlockSolver::classFactory(const std::string &type, OSInstance *osinstance) { //      if(type == "OSDipBlockCoinSolver") return new OSDipBlockCoinSolver( osinstance); //}//end factory std::map OSDipBlockSolverFactory::factories; OSDipBlockSolver* OSDipBlockSolverFactory::createOSDipBlockSolver(const string &solverName) throw(ErrorClass){ if( factories.find(solverName) != factories.end() ){ return factories[ solverName]->create(); }else{ throw ErrorClass( solverName + " is not a valid OSDipBlockSolver"); } }//end
• ## projects/ApplicationTemplates/osDip/OSDipBlockSolver.h

 r248 /* $Id: OSBlockSolver.h 3038 2009-11-07 11:43:44Z Gassmann$ */ /** @file OSBlockSolver.h /* $Id: OSDipBlockSolver.h 3038 2009-11-07 11:43:44Z Gassmann$ */ /** @file OSDipBlockSolver.h * * #include #include // --------------------------------------------------------------------- // /** * Solver Factory */ class OSDipBlockSolverFactory{ public: OSInstance *osinstance; virtual  OSDipBlockSolver* create() = 0; static  std::map factories; static  OSDipBlockSolver* createOSDipBlockSolver(const string &solverName) throw(ErrorClass); }; #endif
• ## projects/ApplicationTemplates/osDip/OSDipFactoryInitializer.h

 r248 #include "OSDipBlockCoinSolver.h" //#include "MyBlockSolver.h" #include "OSDipBlockSolverFactory.h" #include
• ## projects/ApplicationTemplates/osDip/OSDipInterface.cpp

 r248 std::vector OS_DipInterface::getBlockFactories() { //get the factory solver for each block in the model if(m_blockFactoriesProcessed == true) return m_blockFactories; try { if (m_osoption == NULL) throw ErrorClass("we have a null osoption"); std::vector otherVariableOptions; std::vector::iterator vit; if (m_osoption != NULL && m_osoption->getNumberOfOtherVariableOptions() > 0) { otherVariableOptions = m_osoption->getOtherVariableOptions("Dip"); //iterate over the vector of variable options for (vit = otherVariableOptions.begin(); vit != otherVariableOptions.end(); vit++) { // right now we assume blocks are ordered  -- we ignor value if ((*vit)->name.compare("variableBlockSet") == 0) { if( (*vit)->value.size() > 0){ m_blockFactories.push_back( (*vit)->value ); }else{ m_blockFactories.push_back( "" ); } } } } }//end try catch (const ErrorClass& eclass) { std::cout << eclass.errormsg << std::endl; throw ErrorClass(eclass.errormsg); } m_blockFactoriesProcessed = true; return m_blockFactories; }//end getBlockVarIndexes std::vector > OS_DipInterface::getBlockVarIndexes() { // right now we assume blocks are ordered  -- we ignor value if ((*vit)->name.compare("variableBlockSet") == 0) { // see if we have a set of block variables // if so we insert into our vector of sets m_coreConstraintIndexesProcessed( false), m_blockConstraintIndexesProcessed( false), m_blockOSInstancesProcessed( false) { m_blockFactoriesProcessed( false) { }
• ## projects/ApplicationTemplates/osDip/OSDipInterface.h

 r248 //get factory solver for each block in the model std::vector getBlockFactories(); std::vector m_blockFactories; bool m_blockFactoriesProcessed; //get the objective function coefficients double *getObjectiveFunctionCoeff();
• ## projects/ApplicationTemplates/osDip/osDip.tex

Note: See TracChangeset for help on using the changeset viewer.