-
Notifications
You must be signed in to change notification settings - Fork 2
/
dplex.h
83 lines (64 loc) · 2.5 KB
/
dplex.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* dplex.h: Header file for dplex.c
written by Komei Fukuda, [email protected]
Version 0.61, December 1, 1997
*/
/* dplex.c : C-Implementation of the dual simplex method for
solving an LP: max/min c^T x subject to x in P, where
P= {x : b - A x >= 0}.
Please read COPYING (GNU General Public Licence) and
the manual cddman.tex for detail.
*/
#include <time.h>
#include "dplexdef.h"
typedef long rowrange;
typedef long colrange;
typedef set_type rowset; /* set_type defined in setoper.h */
typedef set_type colset;
typedef long *rowindex;
/* rowindex should be intialized to be an array of [mm+1] components */
typedef long colindex[dp_NMAX+1];
typedef double *Amatrix[dp_MMAX];
typedef double Arow[dp_NMAX];
typedef double *Bmatrix[dp_NMAX];
typedef char dp_FilenameType[dp_filenamelen];
typedef enum {
dp_DimensionTooLarge, dp_LowColumnRank, dp_ImproperInputFormat,
dp_FileNotFound, dp_None
} dp_ErrorType;
typedef enum {
dp_Real, dp_Rational, dp_Integer, dp_Unknown
} dp_NumberType;
typedef enum {
dp_LPmax, dp_LPmin
} dp_LPConversionType;
typedef enum {
dp_CrissCross, dp_DualSimplex
} dp_LPSolverType;
typedef enum {
dp_LPSundecided, dp_Optimal, dp_Inconsistent, dp_DualInconsistent,
dp_StrucInconsistent, dp_StrucDualInconsistent,
dp_Unbounded, dp_DualUnbounded
} dp_LPStatusType;
void dp_LPInput(FILE **f, dp_FilenameType, rowrange *m, colrange *n, Amatrix A,
dp_LPConversionType *Conversion, rowrange *objrow, colrange *rhscol,
dp_ErrorType *err);
void dp_InitializeBmatrix(colrange n_size, Bmatrix T);
void dp_LPSolve(dp_LPConversionType, dp_LPSolverType,
rowrange, colrange, Amatrix, Bmatrix BasisInverse,
rowrange OBJrow, colrange RHScol, int UsePrevBasis, dp_LPStatusType *LPS,
double *optvalue, Arow sol, Arow dsol, colindex NBIndex,
rowrange *re, colrange *se, long *iter, dp_ErrorType *);
void dp_FindInteriorPoint(dp_LPSolverType,
rowrange, colrange, Amatrix, rowrange, colrange, dp_LPStatusType *,
double *, Arow, long *, dp_ErrorType *); /* new function of the version 061. */
void dp_WriteLPResult(FILE *, dp_LPConversionType, dp_LPSolverType,
rowrange m_size, colrange n_size, Amatrix A, rowrange objrow, colrange rhscol,
dp_LPStatusType, double, Arow, Arow, colindex, rowrange, colrange, long, dp_ErrorType);
void dp_WriteErrorMessages(FILE *, dp_ErrorType);
int dp_Nonnegative(double);
int dp_Nonpositive(double);
int dp_Positive(double);
int dp_Negative(double);
int dp_Zero(double);
int dp_Nonzero(double);
/* end of dplex.h */