Main Page | Class Hierarchy | File List

AAP_user_data.hpp

00001 // $Id: AAP_user_data.hpp,v 1.3 2003/12/03 01:52:30 magh Exp $
00002 
00003 /* ------------------------------------------------------------------------
00004  Author: Matthew Galati (magh@lehigh.edu)
00005 
00006  (c) Copyright 2003 Lehigh University. All Rights Reserved.
00007 
00008  This software is licensed under the Common Public License. Please see 
00009  accompanying file for terms.    
00010 ---------------------------------------------------------------------------*/
00011 
00012 #ifndef AAP_USER_DATA_H
00013 #define AAP_USER_DATA_H
00014 
00015 #include "BCP_USER.hpp"
00016 #include "BCP_buffer.hpp"
00017 
00018 #include <vector>
00019 using namespace std;
00020 
00021 /*---------------------------------------------------*/
00022 //Class to store extra information to be sent between 
00023 //nodes after branching. In this case, we just store 
00024 //the indices of the (original) variables that were 
00025 //branched on.
00026 
00027 class AAP_user_data : public BCP_user_data {
00028 public:
00029   vector<int> ones;
00030   vector<int> zeros;
00031 
00032 public:
00033   AAP_user_data() : BCP_user_data() {}
00034   
00035   AAP_user_data(vector<int> & ones_, vector<int> & zeros_)
00036     : BCP_user_data(), ones(ones_), zeros(zeros_) {}
00037   
00038   AAP_user_data(BCP_buffer & buf)
00039     : BCP_user_data(){
00040     unpack(buf);
00041   }
00042   
00043   AAP_user_data(const AAP_user_data & x)
00044     : BCP_user_data(), ones(x.ones), zeros(x.zeros) {}
00045 
00046   ~AAP_user_data() {}
00047 
00048 public:
00049   void pack(BCP_buffer & buf) const{
00050     //Pack the user data
00051     buf.pack(ones).pack(zeros);
00052   }
00053 
00054   void unpack(BCP_buffer & buf){
00055     //Unpack the user data
00056     buf.unpack(ones).unpack(zeros);
00057   }
00058 
00059 };
00060 
00061 #endif

Generated on Wed Dec 3 01:30:51 2003 for AAP_BP by doxygen 1.3.5