/home/coin/SVN-release/OS-2.4.0/Bcp/examples/MaxCut/Member/MC_cut.cpp

Go to the documentation of this file.
00001 // Copyright (C) 2000, International Business Machines
00002 // Corporation and others.  All Rights Reserved.
00003 #include "BCP_buffer.hpp"
00004 
00005 #include "MC_cut.hpp"
00006 
00007 static const int cycle_cut = 0;
00008 static const int explicit_dense_cut = 1;
00009 
00010 //#############################################################################
00011 
00012 void
00013 MC_cycle_cut::pack(BCP_buffer& buf) const
00014 {
00015   const MC_cut_t type = MC_cut_t__cycle;
00016   buf.pack(type).pack(pos_edges).pack(edges, cycle_len);
00017 }
00018 
00019 MC_cycle_cut::MC_cycle_cut(BCP_buffer& buf) :
00020   BCP_cut_algo(-BCP_DBL_MAX, 0.0), cycle_len(0), pos_edges(0), edges(0)
00021 {
00022   buf.unpack(pos_edges).unpack(edges, cycle_len);
00023   set_ub(pos_edges-1.0);
00024 }
00025 
00026 //#############################################################################
00027 
00028 void
00029 MC_explicit_dense_cut::pack(BCP_buffer& buf) const
00030 {
00031   const MC_cut_t type = MC_cut_t__explicit_dense;
00032   buf.pack(type).pack(rhs).pack(coeffs, varnum);
00033 }
00034 
00035 MC_explicit_dense_cut::MC_explicit_dense_cut(BCP_buffer& buf) :
00036   BCP_cut_algo(-BCP_DBL_MAX, 0.0), rhs(0.0), coeffs(0), varnum(0)
00037 {
00038   buf.unpack(rhs).unpack(coeffs, varnum);
00039 }
00040 
00041 //#############################################################################
00042 
00043 BCP_MemPool MC_cycle_cut::memPool(sizeof(MC_cycle_cut));
00044 BCP_MemPool MC_explicit_dense_cut::memPool(sizeof(MC_explicit_dense_cut));

Generated on Thu Sep 22 03:05:51 2011 by  doxygen 1.4.7