Dip-All  0.91.0
UtilKnapsack.h
Go to the documentation of this file.
1 //===========================================================================//
2 // This file is part of the DIP Solver Framework. //
3 // //
4 // DIP is distributed under the Eclipse Public License as part of the //
5 // COIN-OR repository (http://www.coin-or.org). //
6 // //
7 // Author: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // //
9 // Conceptual Design: Matthew Galati, SAS Institute Inc. //
10 // Ted Ralphs, Lehigh University //
11 // //
12 // Copyright (C) 2002-2015, Lehigh University, Matthew Galati, Ted Ralphs //
13 // All Rights Reserved. //
14 //===========================================================================//
15 
16 #ifndef UTIL_KNAPSACK_INCLUDED
17 #define UTIL_KNAPSACK_INCLUDED
18 
19 
20 /*==========================================================================*/
21 /* SOR_IntDblArr */
22 /*==========================================================================*/
23 
24 typedef struct SOR_IntDblT {
25  int i;
26  double x;
27 } SOR_IntDbl;
28 
29 typedef struct SOR_IntDblArrT {
31  int len;
32  int size;
34 
37 
39  int* pstatus);
41  SOR_IntDbl* B);
42 void SOR_IntDblArrPrint(const SOR_IntDblArr* A);
44 
45 
46 void KnapsackSortRatioOut(const int n,
47  const double* p,
48  const double* w,
49  double* psort,
50  double* wsort,
51  SOR_IntDbl* ratio);
52 int KnapsackOptimizeHS(const int n,
53  const double c,
54  double* p,
55  double* w,
56  int* x,
57  double* z,
58  int* pstatus);
59 
60 
61 
62 #endif
void SOR_IntDblArrFree(SOR_IntDblArrPtr *A)
struct SOR_IntDblArrT SOR_IntDblArr
Definition: UtilKnapsack.h:35
void KnapsackSortRatioOut(const int n, const double *p, const double *w, double *psort, double *wsort, SOR_IntDbl *ratio)
int KnapsackOptimizeHS(const int n, const double c, double *p, double *w, int *x, double *z, int *pstatus)
struct SOR_IntDblT SOR_IntDbl
void SOR_IntDblArrPrint(const SOR_IntDblArr *A)
void SOR_IntDblSwap(SOR_IntDbl *A, SOR_IntDbl *B)
SOR_IntDblArrPtr SOR_IntDblArrNew(int size, int *pstatus)
SOR_IntDblArr * SOR_IntDblArrPtr
Definition: UtilKnapsack.h:36
SOR_IntDbl * arr
Definition: UtilKnapsack.h:30