lemon/lp_base.h
changeset 1796 b6a58c8bea87
parent 1771 5faaa9880d4d
child 1810 474d093466a5
equal deleted inserted replaced
16:41137b2da369 17:b25acc46f542
    34   ///Internal data structure to convert floating id's to fix one's
    34   ///Internal data structure to convert floating id's to fix one's
    35     
    35     
    36   ///\todo This might be implemented to be also usable in other places.
    36   ///\todo This might be implemented to be also usable in other places.
    37   class _FixId 
    37   class _FixId 
    38   {
    38   {
       
    39   protected:
    39     std::vector<int> index;
    40     std::vector<int> index;
    40     std::vector<int> cross;
    41     std::vector<int> cross;
    41     int first_free;
    42     int first_free;
    42   public:
    43   public:
    43     _FixId() : first_free(-1) {};
    44     _FixId() : first_free(-1) {};
   590 //     virtual void _setObj(int length,
   591 //     virtual void _setObj(int length,
   591 //                          int  const * indices, 
   592 //                          int  const * indices, 
   592 //                          Value  const * values ) = 0;
   593 //                          Value  const * values ) = 0;
   593     virtual SolveExitStatus _solve() = 0;
   594     virtual SolveExitStatus _solve() = 0;
   594     virtual Value _getPrimal(int i) = 0;
   595     virtual Value _getPrimal(int i) = 0;
       
   596     virtual Value _getDual(int i) = 0;
   595     virtual Value _getPrimalValue() = 0;
   597     virtual Value _getPrimalValue() = 0;
   596     virtual SolutionStatus _getPrimalStatus() = 0;
   598     virtual SolutionStatus _getPrimalStatus() = 0;
   597     virtual SolutionStatus _getDualStatus() = 0;
   599     virtual SolutionStatus _getDualStatus() = 0;
   598     ///\todo This could be implemented here, too, using _getPrimalStatus() and
   600     ///\todo This could be implemented here, too, using _getPrimalStatus() and
   599     ///_getDualStatus()
   601     ///_getDualStatus()
   706       std::vector<Value> values;
   708       std::vector<Value> values;
   707       indices.push_back(0);
   709       indices.push_back(0);
   708       values.push_back(0);
   710       values.push_back(0);
   709       for(DualExpr::const_iterator i=e.begin(); i!=e.end(); ++i)
   711       for(DualExpr::const_iterator i=e.begin(); i!=e.end(); ++i)
   710 	if((*i).second!=0) { ///\bug EPSILON would be necessary here!!!
   712 	if((*i).second!=0) { ///\bug EPSILON would be necessary here!!!
   711 	  indices.push_back(cols.floatingId((*i).first.id));
   713 	  indices.push_back(rows.floatingId((*i).first.id));
   712 	  values.push_back((*i).second);
   714 	  values.push_back((*i).second);
   713 	}
   715 	}
   714       _setColCoeffs(cols.floatingId(c.id),indices.size()-1,
   716       _setColCoeffs(cols.floatingId(c.id),indices.size()-1,
   715 		    &indices[0],&values[0]);
   717 		    &indices[0],&values[0]);
   716     }
   718     }
   999 
  1001 
  1000     ///\e
  1002     ///\e
  1001     Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }
  1003     Value primal(Col c) { return _getPrimal(cols.floatingId(c.id)); }
  1002 
  1004 
  1003     ///\e
  1005     ///\e
       
  1006     Value dual(Row r) { return _getDual(rows.floatingId(r.id)); }
       
  1007 
       
  1008     ///\e
  1004 
  1009 
  1005     ///\return
  1010     ///\return
  1006     ///- \ref INF or -\ref INF means either infeasibility or unboundedness
  1011     ///- \ref INF or -\ref INF means either infeasibility or unboundedness
  1007     /// of the primal problem, depending on whether we minimize or maximize.
  1012     /// of the primal problem, depending on whether we minimize or maximize.
  1008     ///- \ref NaN if no primal solution is found.
  1013     ///- \ref NaN if no primal solution is found.