Dip 0.95.0
Loading...
Searching...
No Matches
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
23typedef struct SOR_IntDblT {
24 int i;
25 double x;
27
28typedef struct SOR_IntDblArrT {
30 int len;
31 int size;
33
36
38 int* pstatus);
40 SOR_IntDbl* B);
43
44
45void KnapsackSortRatioOut(const int n,
46 const double* p,
47 const double* w,
48 double* psort,
49 double* wsort,
50 SOR_IntDbl* ratio);
51int 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)
void KnapsackSortRatioOut(const int n, const double *p, const double *w, double *psort, double *wsort, SOR_IntDbl *ratio)
SOR_IntDblArr * SOR_IntDblArrPtr
Definition: UtilKnapsack.h:35
struct SOR_IntDblArrT SOR_IntDblArr
Definition: UtilKnapsack.h:34
void SOR_IntDblArrPrint(const SOR_IntDblArr *A)
void SOR_IntDblSwap(SOR_IntDbl *A, SOR_IntDbl *B)
SOR_IntDblArrPtr SOR_IntDblArrNew(int size, int *pstatus)
struct SOR_IntDblT SOR_IntDbl
int KnapsackOptimizeHS(const int n, const double c, double *p, double *w, int *x, double *z, int *pstatus)
SOR_IntDbl * arr
Definition: UtilKnapsack.h:29