~ubuntu-branches/ubuntu/vivid/gdis/vivid

« back to all changes in this revision

Viewing changes to dplex.h

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2006-11-18 23:41:00 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20061118234100-85eekne977b0eznj
Tags: 0.89-1ubuntu1
* Merge from Debian unstable. Ubuntu changes are as follows:
* Add desktop file.

Show diffs side-by-side

added added

removed removed

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