Ipopt  3.11.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hsl_ma77d.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2011 The Science and Technology Facilities Council (STFC)
3  * All Rights Reserved.
4  * This code is published under the Eclipse Public License.
5  *
6  * Authors: Jonathan Hogg STFC 2011-05-18
7  */
8 
9 #ifndef HSL_MA77D_H
10 #define HSL_MA77D_H
11 
12 #ifndef ma77_default_control
13 #define ma77_control ma77_control_d
14 #define ma77_info ma77_info_d
15 #define ma77_default_control ma77_default_control_d
16 #define ma77_open_nelt ma77_open_nelt_d
17 #define ma77_open ma77_open_d
18 #define ma77_input_vars ma77_input_vars_d
19 #define ma77_input_reals ma77_input_reals_d
20 #define ma77_analyse ma77_analyse_d
21 #define ma77_factor ma77_factor_d
22 #define ma77_factor_solve ma77_factor_solve_d
23 #define ma77_solve ma77_solve_d
24 #define ma77_resid ma77_resid_d
25 #define ma77_scale ma77_scale_d
26 #define ma77_enquire_posdef ma77_enquire_posdef_d
27 #define ma77_enquire_indef ma77_enquire_indef_d
28 #define ma77_alter ma77_alter_d
29 #define ma77_restart ma77_restart_d
30 #define ma77_finalise ma77_finalise_d
31 #endif
32 
33 typedef double ma77pkgtype_d_;
34 
35 /* Data type for user controls */
37  /* Note: 0 is false, non-zero is true */
38 
39  /* C/Fortran interface related controls */
40  int f_arrays; /* Treat arrays as 1-based (Fortran) if true or 0-based (C) if
41  false. */
42 
43  /* Printing controls */
45  int unit_diagnostics; /* unit for diagnostic messages
46  Printing is suppressed if unit_diagnostics < 0. */
47  int unit_error; /* unit for error messages
48  Printing is suppressed if unit_error < 0. */
49  int unit_warning; /* unit for warning messages
50  Printing is suppressed if unit_warning < 0. */
51 
52  /* Controls used by MA77_open */
53  int bits;
54  int buffer_lpage[2];
55  int buffer_npage[2];
56  long int file_size;
57  long int maxstore;
58  long int storage[3];
59 
60  /* Controls used by MA77_analyse */
61  int nemin; /* Node amalgamation parameter. A child node is merged with its
62  parent if they both involve fewer than nemin eliminations.*/
63 
64  /* Controls used by MA77_scale */
65  int maxit;
66  int infnorm;
68 
69  /* Controls used by MA77_factor with posdef true */
70  int nb54;
71 
72  /* Controls used by MA77_factor with posdef false */
73  int action; /* Keep going even if matrix is singular if true, or abort
74  if false */
76  int nb64;
77  int nbi;
80  long int storage_indef;
81  ma77pkgtype_d_ u; /* Pivot tolerance*/
82  ma77pkgtype_d_ umin; /* Minimum pivot tolerance*/
83 };
84 
85 /***************************************************/
86 
87 /* data type for returning information to user.*/
88 struct ma77_info_d {
90  int detsign;
91  int flag;
92  int iostat;
96  int maxdepth;
97  int maxfront;
98  long int minstore;
99  int ndelay;
100  long int nfactor;
101  long int nflops;
102  int niter;
103  int nsup;
104  int num_neg;
107  int ntwo;
108  int stat;
109  int index[4];
110  long int nio_read[2];
111  long int nio_write[2];
112  long int nwd_read[2];
113  long int nwd_write[2];
114  int num_file[4];
115  long int storage[4];
118  int unused;
120 };
121 
122 /* Initialise control with default values */
123 void ma77_default_control(struct ma77_control_d *control);
124 void ma77_open_nelt(const int n, const char* fname1, const char* fname2,
125  const char *fname3, const char *fname4, void **keep,
126  const struct ma77_control_d *control, struct ma77_info_d *info,
127  const int nelt);
128 void ma77_open(const int n, const char* fname1, const char* fname2,
129  const char *fname3, const char *fname4, void **keep,
130  const struct ma77_control_d *control, struct ma77_info_d *info);
131 void ma77_input_vars(const int idx, const int nvar, const int list[],
132  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info);
133 void ma77_input_reals(const int idx, const int length,
134  const ma77pkgtype_d_ reals[], void **keep, const struct ma77_control_d *control,
135  struct ma77_info_d *info);
136 /* Analyse the sparsity pattern and prepare for factorization */
137 void ma77_analyse(const int order[], void **keep,
138  const struct ma77_control_d *control, struct ma77_info_d *info);
139 /* To factorize the matrix */
140 void ma77_factor(const int posdef, void **keep,
141  const struct ma77_control_d *control, struct ma77_info_d *info,
142  const ma77pkgtype_d_ *scale);
143 /* To factorize the matrix AND solve AX = B */
144 void ma77_factor_solve(const int posdef, void **keep,
145  const struct ma77_control_d *control, struct ma77_info_d *info,
146  const ma77pkgtype_d_ *scale, const int nrhs, const int lx,
147  ma77pkgtype_d_ rhs[]);
148 /* To solve AX = B using the computed factors */
149 void ma77_solve(const int job, const int nrhs, const int lx, ma77pkgtype_d_ x[],
150  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info,
151  const ma77pkgtype_d_ *scale);
152 void ma77_resid(const int nrhs, const int lx, const ma77pkgtype_d_ x[],
153  const int lresid, ma77pkgtype_d_ resid[], void **keep,
154  const struct ma77_control_d *control, struct ma77_info_d *info,
155  ma77pkgtype_d_ *anorm_bnd);
156 void ma77_scale(ma77pkgtype_d_ scale[], void **keep,
157  const struct ma77_control_d *control, struct ma77_info_d *info,
158  ma77pkgtype_d_ *anorm);
159 void ma77_enquire_posdef(ma77pkgtype_d_ d[], void **keep,
160  const struct ma77_control_d *control, struct ma77_info_d *info);
161 void ma77_enquire_indef(int piv_order[], ma77pkgtype_d_ d[], void **keep,
162  const struct ma77_control_d *control, struct ma77_info_d *info);
163 void ma77_alter(const ma77pkgtype_d_ d[], void **keep,
164  const struct ma77_control_d *control, struct ma77_info_d *info);
165 void ma77_restart(const char *restart_file, const char *fname1,
166  const char *fname2, const char *fname3, const char *fname4, void **keep,
167  const struct ma77_control_d *control, struct ma77_info_d *info);
168 /* To clean up memory in keep */
169 void ma77_finalise(void **keep, const struct ma77_control_d *control,
170  struct ma77_info_d *info);
171 
172 #endif