Dip  0.92.4
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 // Authors: Matthew Galati, SAS Institute Inc. (matthew.galati@sas.com) //
8 // Ted Ralphs, Lehigh University (ted@lehigh.edu) //
9 // Jiadong Wang, Lehigh University (jiw408@lehigh.edu) //
10 // //
11 // Copyright (C) 2002-2019, Lehigh University, Matthew Galati, Ted Ralphs //
12 // All Rights Reserved. //
13 //===========================================================================//
14 
15 #ifndef UTIL_KNAPSACK_INCLUDED
16 #define UTIL_KNAPSACK_INCLUDED
17 
18 
19 /*==========================================================================*/
20 /* SOR_IntDblArr */
21 /*==========================================================================*/
22 
23 typedef struct SOR_IntDblT {
24  int i;
25  double x;
26 } SOR_IntDbl;
27 
28 typedef struct SOR_IntDblArrT {
30  int len;
31  int size;
33 
36 
38  int* pstatus);
40  SOR_IntDbl* B);
41 void SOR_IntDblArrPrint(const SOR_IntDblArr* A);
43 
44 
45 void KnapsackSortRatioOut(const int n,
46  const double* p,
47  const double* w,
48  double* psort,
49  double* wsort,
50  SOR_IntDbl* ratio);
51 int KnapsackOptimizeHS(const int n,
52  const double c,
53  double* p,
54  double* w,
55  int* x,
56  double* z,
57  int* pstatus);
58 
59 
60 
61 #endif
void SOR_IntDblArrFree(SOR_IntDblArrPtr *A)
struct SOR_IntDblArrT SOR_IntDblArr
Definition: UtilKnapsack.h:34
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:35
SOR_IntDbl * arr
Definition: UtilKnapsack.h:29