COMISOSolver.hh 2.42 KB
Newer Older
David Bommes's avatar
David Bommes committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
//=============================================================================
//
//  CLASS COMISOSolver
//
//=============================================================================


#ifndef COMISO_COMISOSOLVER_HH
#define COMISO_COMISOSOLVER_HH


//== COMPILE-TIME PACKAGE REQUIREMENTS ========================================
#include <CoMISo/Config/config.hh>

//== INCLUDES =================================================================

#include <CoMISo/Config/CoMISoDefines.hh>
#include <CoMISo/Solver/ConstrainedSolver.hh>
#include <vector>
#include "NProblemInterface.hh"
#include "NConstraintInterface.hh"
#include "VariableType.hh"


//== FORWARDDECLARATIONS ======================================================

//== NAMESPACES ===============================================================

namespace COMISO {

//== CLASS DEFINITION =========================================================

	      

/** \class NewtonSolver GUROBISolver.hh

    Brief Description.
  
    A more elaborate description follows.
*/
class COMISODLLEXPORT COMISOSolver
{
public:
   
  typedef std::pair<unsigned int, VariableType> PairUiV;

  /// Default constructor
  COMISOSolver() {}
 
  /// Destructor
  ~COMISOSolver() {}

  // ********** SOLVE **************** //
  void solve(NProblemInterface*                  _problem,                      // problem instance
             std::vector<NConstraintInterface*>& _constraints,                  // linear constraints
             std::vector<PairUiV>&               _discrete_constraints,         // discrete constraint
             double                              _reg_factor = 0.0,             // reguluarization factor
David Bommes's avatar
David Bommes committed
58
             bool                                _show_miso_settings = false,    // show settings dialog
David Bommes's avatar
David Bommes committed
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
             bool                                _show_timings = true        ); // show timings


  // get reference to ConstrainedSolver to manipulate parameters
  ConstrainedSolver& solver() { return cs_;}

protected:
  double* P(std::vector<double>& _v)
  {
    if( !_v.empty())
      return ((double*)&_v[0]);
    else
      return 0;
  }

private:
  ConstrainedSolver cs_;
};



//=============================================================================
} // namespace COMISO
//=============================================================================
#endif // ACG_GUROBISOLVER_HH defined
//=============================================================================