DecompSolverResult.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the DIP Solver Framework.                            //
00003 //                                                                           //
00004 // DIP is distributed under the Eclipse Public License as part of the        //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com)       //
00008 //                                                                           //
00009 // Conceptual Design: Matthew Galati, SAS Institute Inc.                     //
00010 //                    Ted Ralphs, Lehigh University                          //
00011 //                                                                           //
00012 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, and Ted Ralphs//
00013 // All Rights Reserved.                                                      //
00014 //===========================================================================//
00015 
00016 
00017 //===========================================================================//
00018 #ifndef DecompSolverResult_h_
00019 #define DecompSolverResult_h_
00020 
00021 //===========================================================================//
00027 //===========================================================================//
00028 
00029 //===========================================================================//
00030 #include "Decomp.h"
00031 #include "DecompSolution.h"
00032 
00033 //===========================================================================//
00034 class DecompSolverResult {
00035 
00036    //----------------------------------------------------------------------//
00041    //----------------------------------------------------------------------//
00042 public :
00043    int       m_solStatus;
00044    int       m_solStatus2;
00045    double    m_objLB;
00046    double    m_objUB;
00047    bool      m_isOptimal;
00048    bool      m_isUnbounded;
00049    bool      m_isCutoff;
00050    int       m_nSolutions;
00051    std::vector< std::vector<double> > m_solution;
00056 public:
00057    const double* getSolution(const int solIndex) {
00058       std::vector<double>& solution = m_solution[solIndex];
00059       return &solution[0];
00060    }
00061 
00065    DecompSolverResult():
00066       m_solStatus (-1),
00067       m_solStatus2(-1),
00068       m_objLB     (-DecompInf),
00069       m_objUB     ( DecompInf),
00070       m_isOptimal (false),
00071       m_isUnbounded (false),
00072       m_isCutoff  (false),
00073       m_nSolutions(0) {
00074    }
00075 
00076    DecompSolverResult(const DecompSolution* solution):
00077       m_solStatus (-1),
00078       m_solStatus2(-1),
00079       m_objLB     (-DecompInf),
00080       m_objUB     ( DecompInf),
00081       m_isOptimal (false),
00082       m_isUnbounded (false),
00083       m_isCutoff  (false),
00084       m_nSolutions(0) {
00085       const double* values = solution->getValues();
00086 
00087       if (!values) {
00088          return;
00089       }
00090 
00091       m_nSolutions = 1;
00092       m_objUB      = solution->getQuality();
00093       std::vector<double> sol(values, values + solution->getSize());
00094       m_solution.push_back(sol);
00095    }
00096 
00100    ~DecompSolverResult() {
00101    }
00105 };
00106 
00107 #endif

Generated on 5 Apr 2015 for Dip-All by  doxygen 1.6.1