UtilKnapsack.h

Go to the documentation of this file.
00001 //===========================================================================//
00002 // This file is part of the DIP Solver Framework.                            //
00003 //                                                                           //
00004 // DIP is distributed under the Eclipse Public License as part of the        //
00005 // COIN-OR repository (http://www.coin-or.org).                              //
00006 //                                                                           //
00007 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com)       //
00008 //                                                                           //
00009 // Conceptual Design: Matthew Galati, SAS Institute Inc.                     //
00010 //                    Ted Ralphs, Lehigh University                          //
00011 //                                                                           //
00012 // Copyright (C) 2002-2013, Lehigh University, Matthew Galati, Ted Ralphs    //
00013 // All Rights Reserved.                                                      //
00014 //===========================================================================//
00015 
00016 #ifndef UTIL_KNAPSACK_INCLUDED
00017 #define UTIL_KNAPSACK_INCLUDED
00018 
00019 
00020 /*==========================================================================*/
00021 /*                           SOR_IntDblArr                                  */
00022 /*==========================================================================*/
00023 
00024 typedef struct SOR_IntDblT {
00025    int    i;
00026    double x;
00027 } SOR_IntDbl;
00028 
00029 typedef struct SOR_IntDblArrT {
00030    SOR_IntDbl* arr;
00031    int          len;
00032    int          size;
00033 } SOR_IntDblArr;
00034 
00035 typedef SOR_IntDblArr   SOR_IntDblArr;
00036 typedef SOR_IntDblArr* SOR_IntDblArrPtr;
00037 
00038 SOR_IntDblArrPtr SOR_IntDblArrNew (int    size,
00039                                    int*   pstatus);
00040 void SOR_IntDblSwap(SOR_IntDbl* A,
00041                     SOR_IntDbl* B);
00042 void SOR_IntDblArrPrint(const SOR_IntDblArr* A);
00043 void SOR_IntDblArrFree(SOR_IntDblArrPtr* A);
00044 
00045 
00046 void KnapsackSortRatioOut(const int       n,
00047                           const double*   p,
00048                           const double*   w,
00049                           double*         psort,
00050                           double*         wsort,
00051                           SOR_IntDbl*     ratio);
00052 int KnapsackOptimizeHS(const int      n,
00053                        const double   c,
00054                        double*        p,
00055                        double*        w,
00056                        int*           x,
00057                        double*        z,
00058                        int*           pstatus);
00059 
00060 
00061 
00062 #endif

Generated on 12 Feb 2015 for Dip-All by  doxygen 1.6.1