MeshKit
1.0
|
00001 // IADataBuilder.hpp 00002 // Interval Assignment Data for Meshkit 00003 // 00004 // Tool for building IAData, the definition of an interval assignment problem. 00005 // Only the IA family of classes should be using this. 00006 // 00007 00008 #ifndef MESHKIT_IA_IADATABUILDER_HP 00009 #define MESHKIT_IA_IADATABUILDER_HP 00010 00011 class IAData; 00012 #include "meshkit/IAData.hpp" 00013 00014 namespace MeshKit 00015 { 00016 00017 class IADataBuilder 00018 { 00019 public: 00021 IADataBuilder(IAData* ia_data_ptr) : ia_data( ia_data_ptr ) {} 00022 00024 virtual ~IADataBuilder() {} 00025 00026 // add a variable 00027 // return its id = index in I 00028 int add_variable( double goal ); 00029 00030 // index of variables that must sum to even 00031 void constrain_sum_even(const std::vector<int> &curve_indices, const int rhs=0); 00032 // index of variables that must add to the same values 00033 // here side_1 - side_2 = rhs, so fixed-size curves of side_1 subtract from rhs. rhs may be negative. 00034 void constrain_opposite_side_equal(const std::vector<int> &side_1, const std::vector<int> &side_2, 00035 const int rhs=0 ); 00036 00037 private: 00038 IAData *ia_data; 00039 00040 }; 00041 00042 } // namespace MeshKit 00043 00044 #endif