MeshKit  1.0
IPData.cpp
Go to the documentation of this file.
00001 // IPData.cpp
00002 // Interval Assignment Data for Meshkit
00003 // Integer Program - making intervals into integer values 
00004 //
00005 
00006 #include "meshkit/IPData.hpp"
00007 
00008 namespace MeshKit {
00009 
00010 void IPData::initialize(const std::vector<double> &relaxed_solution)
00011 {
00012   const std::size_t num_variables = relaxed_solution.size();
00013   // fill varIntegerBound and oldBound with zeros
00014   varIntegerBound.clear();
00015   varIntegerBound.resize(num_variables,0);
00016   oldBound.clear();
00017   oldBound.resize(num_variables,0);
00018   relaxedSolution = relaxed_solution; // vector copy
00019 }
00020 
00021  
00022 void IPData::constrain_integer(const int i_nonint, const int x_bound)
00023 {
00024   oldBound[i_nonint] = varIntegerBound[i_nonint];;
00025   varIntegerBound[i_nonint] = (double) x_bound;
00026 }
00027 
00028 } // namespace MeshKit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines