Ipopt  3.11.9
hsl_ma77d.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2011, 2013 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 #define ma77_solve_fredholm ma77_solve_fredholm_d
32 #define ma77_lmultiply ma77_lmultiply_d
33 #endif
34 
35 typedef double ma77pkgtype_d_;
36 
37 /* Data type for user controls */
39  /* Note: 0 is false, non-zero is true */
40 
41  /* C/Fortran interface related controls */
42  int f_arrays; /* Treat arrays as 1-based (Fortran) if true or 0-based (C) if
43  false. */
44 
45  /* Printing controls */
47  int unit_diagnostics; /* unit for diagnostic messages
48  Printing is suppressed if unit_diagnostics < 0. */
49  int unit_error; /* unit for error messages
50  Printing is suppressed if unit_error < 0. */
51  int unit_warning; /* unit for warning messages
52  Printing is suppressed if unit_warning < 0. */
53 
54  /* Controls used by MA77_open */
55  int bits;
56  int buffer_lpage[2];
57  int buffer_npage[2];
58  long int file_size;
59  long int maxstore;
60  long int storage[3];
61 
62  /* Controls used by MA77_analyse */
63  int nemin; /* Node amalgamation parameter. A child node is merged with its
64  parent if they both involve fewer than nemin eliminations.*/
65 
66  /* Controls used by MA77_scale */
67  int maxit;
68  int infnorm;
70 
71  /* Controls used by MA77_factor with posdef true */
72  int nb54;
73 
74  /* Controls used by MA77_factor with posdef false */
75  int action; /* Keep going even if matrix is singular if true, or abort
76  if false */
78  int nb64;
79  int nbi;
82  long int storage_indef;
83  ma77pkgtype_d_ u; /* Pivot tolerance*/
84  ma77pkgtype_d_ umin; /* Minimum pivot tolerance*/
85 
86 #if defined(COINHSL_HSL2013) || !defined(COINHSL_HAS_MA77)
87  /* Controls used by ma77_solve_fredholm */
88  ma77pkgtype_d_ consist_tol; /* Tolerance for consistent singular system */
89 
90  /* Pad data structure to allow for future growth */
91  int ispare[5]; long int lspare[5]; ma77pkgtype_d_ rspare[5];
92 #endif
93 };
94 
95 /***************************************************/
96 
97 /* data type for returning information to user.*/
98 struct ma77_info_d {
100  int detsign;
101  int flag;
102  int iostat;
106  int maxdepth;
107  int maxfront;
108  long int minstore;
109  int ndelay;
110  long int nfactor;
111  long int nflops;
112  int niter;
113  int nsup;
114  int num_neg;
117  int ntwo;
118  int stat;
119  int index[4];
120  long int nio_read[2];
121  long int nio_write[2];
122  long int nwd_read[2];
123  long int nwd_write[2];
124  int num_file[4];
125  long int storage[4];
128  int unused;
130 
131  /* if we do not have MA77, we assume its is loaded via the linear solver loader, for which we assume HSL 2013 */
132 #if defined(COINHSL_HSL2013) || !defined(COINHSL_HAS_MA77)
133  /* Pad data structure to allow for future growth */
134  int ispare[5]; long int lspare[5]; ma77pkgtype_d_ rspare[5];
135 #endif
136 };
137 
138 /* Initialise control with default values */
140 void ma77_open_nelt(const int n, const char* fname1, const char* fname2,
141  const char *fname3, const char *fname4, void **keep,
142  const struct ma77_control_d *control, struct ma77_info_d *info,
143  const int nelt);
144 void ma77_open_d(const int n, const char* fname1, const char* fname2,
145  const char *fname3, const char *fname4, void **keep,
146  const struct ma77_control_d *control, struct ma77_info_d *info);
147 void ma77_input_vars(const int idx, const int nvar, const int list[],
148  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info);
149 void ma77_input_reals_d(const int idx, const int length,
150  const ma77pkgtype_d_ reals[], void **keep, const struct ma77_control_d *control,
151  struct ma77_info_d *info);
152 /* Analyse the sparsity pattern and prepare for factorization */
153 void ma77_analyse(const int order[], void **keep,
154  const struct ma77_control_d *control, struct ma77_info_d *info);
155 /* To factorize the matrix */
156 void ma77_factor_d(const int posdef, void **keep,
157  const struct ma77_control_d *control, struct ma77_info_d *info,
158  const ma77pkgtype_d_ *scale);
159 /* To factorize the matrix AND solve AX = B */
160 void ma77_factor_solve_d(const int posdef, void **keep,
161  const struct ma77_control_d *control, struct ma77_info_d *info,
162  const ma77pkgtype_d_ *scale, const int nrhs, const int lx,
163  ma77pkgtype_d_ rhs[]);
164 /* To solve AX = B using the computed factors */
165 void ma77_solve_d(const int job, const int nrhs, const int lx, ma77pkgtype_d_ x[],
166  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info,
167  const ma77pkgtype_d_ *scale);
168 void ma77_resid_d(const int nrhs, const int lx, const ma77pkgtype_d_ x[],
169  const int lresid, ma77pkgtype_d_ resid[], void **keep,
170  const struct ma77_control_d *control, struct ma77_info_d *info,
171  ma77pkgtype_d_ *anorm_bnd);
172 void ma77_scale_d(ma77pkgtype_d_ scale[], void **keep,
173  const struct ma77_control_d *control, struct ma77_info_d *info,
174  ma77pkgtype_d_ *anorm);
175 void ma77_enquire_posdef_d(ma77pkgtype_d_ d[], void **keep,
176  const struct ma77_control_d *control, struct ma77_info_d *info);
177 void ma77_enquire_indef_d(int piv_order[], ma77pkgtype_d_ d[], void **keep,
178  const struct ma77_control_d *control, struct ma77_info_d *info);
179 void ma77_alter_d(const ma77pkgtype_d_ d[], void **keep,
180  const struct ma77_control_d *control, struct ma77_info_d *info);
181 void ma77_restart_d(const char *restart_file, const char *fname1,
182  const char *fname2, const char *fname3, const char *fname4, void **keep,
183  const struct ma77_control_d *control, struct ma77_info_d *info);
184 /* exists only for HSL 2013 */
185 void ma77_solve_fredholm_d(int nrhs, int flag_out[], int lx, ma77pkgtype_d_ x[],
186  void **keep, const struct ma77_control_d *control,
187  struct ma77_info_d *info, const ma77pkgtype_d_ *scale);
188 /* exists only for HSL 2013 */
189 void ma77_lmultiply_d(int trans, int k, int lx, ma77pkgtype_d_ x[], int ly,
190  ma77pkgtype_d_ y[], void **keep, const struct ma77_control_d *control,
191  struct ma77_info_d *info, const ma77pkgtype_d_ *scale);
192 /* To clean up memory in keep */
193 void ma77_finalise_d(void **keep, const struct ma77_control_d *control,
194  struct ma77_info_d *info);
195 
196 #endif
ma77_control_d::storage
long int storage[3]
Definition: hsl_ma77d.h:60
ma77_info_d::rspare
ma77pkgtype_d_ rspare[5]
Definition: hsl_ma77d.h:134
ma77_info_d::index
int index[4]
Definition: hsl_ma77d.h:119
ma77_info_d::num_neg
int num_neg
Definition: hsl_ma77d.h:114
ma77_control_d::file_size
long int file_size
Definition: hsl_ma77d.h:58
ma77_factor_d
void ma77_factor_d(const int posdef, void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale)
ma77_control_d::print_level
int print_level
Definition: hsl_ma77d.h:46
ma77_info_d::matrix_dup
int matrix_dup
Definition: hsl_ma77d.h:103
ma77_info_d::ntwo
int ntwo
Definition: hsl_ma77d.h:117
ma77_resid_d
void ma77_resid_d(const int nrhs, const int lx, const ma77pkgtype_d_ x[], const int lresid, ma77pkgtype_d_ resid[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, ma77pkgtype_d_ *anorm_bnd)
ma77_info_d::unused
int unused
Definition: hsl_ma77d.h:128
ma77_info_d::flag
int flag
Definition: hsl_ma77d.h:101
ma77_control_d::umin
ma77pkgtype_d_ umin
Definition: hsl_ma77d.h:84
ma77_enquire_indef_d
void ma77_enquire_indef_d(int piv_order[], ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_solve_d
void ma77_solve_d(const int job, const int nrhs, const int lx, ma77pkgtype_d_ x[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale)
ma77_enquire_posdef_d
void ma77_enquire_posdef_d(ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_info_d::ndelay
int ndelay
Definition: hsl_ma77d.h:109
ma77_info_d::nfactor
long int nfactor
Definition: hsl_ma77d.h:110
ma77_info_d::nio_read
long int nio_read[2]
Definition: hsl_ma77d.h:120
ma77_info_d::maxfront
int maxfront
Definition: hsl_ma77d.h:107
ma77_info_d::lspare
long int lspare[5]
Definition: hsl_ma77d.h:134
ma77_restart_d
void ma77_restart_d(const char *restart_file, const char *fname1, const char *fname2, const char *fname3, const char *fname4, void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_control_d::ispare
int ispare[5]
Definition: hsl_ma77d.h:91
ma77_control_d::consist_tol
ma77pkgtype_d_ consist_tol
Definition: hsl_ma77d.h:88
ma77_analyse
#define ma77_analyse
Definition: hsl_ma77d.h:20
ma77_control_d::rspare
ma77pkgtype_d_ rspare[5]
Definition: hsl_ma77d.h:91
ma77_info_d::matrix_rank
int matrix_rank
Definition: hsl_ma77d.h:104
ma77_info_d::usmall
ma77pkgtype_d_ usmall
Definition: hsl_ma77d.h:129
x
Number * x
Input: Starting point Output: Optimal solution.
Definition: IpStdCInterface.h:238
ma77_control_d::unit_error
int unit_error
Definition: hsl_ma77d.h:49
ma77_default_control_d
void ma77_default_control_d(struct ma77_control_d *control)
ma77_control_d::small
ma77pkgtype_d_ small
Definition: hsl_ma77d.h:80
ma77_info_d::matrix_outrange
int matrix_outrange
Definition: hsl_ma77d.h:105
ma77_info_d::detlog
ma77pkgtype_d_ detlog
Definition: hsl_ma77d.h:99
ma77_finalise_d
void ma77_finalise_d(void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_control_d::maxit
int maxit
Definition: hsl_ma77d.h:67
ma77_info_d::detsign
int detsign
Definition: hsl_ma77d.h:100
ma77_info_d::iostat
int iostat
Definition: hsl_ma77d.h:102
ma77_info_d::num_perturbed
int num_perturbed
Definition: hsl_ma77d.h:116
ma77_control_d::f_arrays
int f_arrays
Definition: hsl_ma77d.h:42
ma77_control_d::nemin
int nemin
Definition: hsl_ma77d.h:63
ma77_info_d::stat
int stat
Definition: hsl_ma77d.h:118
ma77_control_d::buffer_lpage
int buffer_lpage[2]
Definition: hsl_ma77d.h:56
ma77_control_d::bits
int bits
Definition: hsl_ma77d.h:55
ma77_info_d::nwd_write
long int nwd_write[2]
Definition: hsl_ma77d.h:123
ma77_lmultiply_d
void ma77_lmultiply_d(int trans, int k, int lx, ma77pkgtype_d_ x[], int ly, ma77pkgtype_d_ y[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale)
ma77_control_d::static_
ma77pkgtype_d_ static_
Definition: hsl_ma77d.h:81
ma77_info_d::num_nothresh
int num_nothresh
Definition: hsl_ma77d.h:115
ma77_control_d::u
ma77pkgtype_d_ u
Definition: hsl_ma77d.h:83
ma77_control_d::thresh
ma77pkgtype_d_ thresh
Definition: hsl_ma77d.h:69
ma77_info_d::storage
long int storage[4]
Definition: hsl_ma77d.h:125
ma77_info_d::tree_nodes
int tree_nodes
Definition: hsl_ma77d.h:126
ma77_info_d::unit_restart
int unit_restart
Definition: hsl_ma77d.h:127
ma77_control_d::unit_warning
int unit_warning
Definition: hsl_ma77d.h:51
ma77_control_d::storage_indef
long int storage_indef
Definition: hsl_ma77d.h:82
ma77_info_d::nwd_read
long int nwd_read[2]
Definition: hsl_ma77d.h:122
ma77_control_d::nbi
int nbi
Definition: hsl_ma77d.h:79
ma77_info_d
Definition: hsl_ma77d.h:98
ma77_control_d::nb64
int nb64
Definition: hsl_ma77d.h:78
ma77_control_d::buffer_npage
int buffer_npage[2]
Definition: hsl_ma77d.h:57
ma77_control_d::maxstore
long int maxstore
Definition: hsl_ma77d.h:59
ma77_open_d
void ma77_open_d(const int n, const char *fname1, const char *fname2, const char *fname3, const char *fname4, void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_info_d::minstore
long int minstore
Definition: hsl_ma77d.h:108
ma77pkgtype_d_
double ma77pkgtype_d_
Definition: hsl_ma77d.h:35
ma77_scale_d
void ma77_scale_d(ma77pkgtype_d_ scale[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, ma77pkgtype_d_ *anorm)
ma77_solve_fredholm_d
void ma77_solve_fredholm_d(int nrhs, int flag_out[], int lx, ma77pkgtype_d_ x[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale)
ma77_control_d::lspare
long int lspare[5]
Definition: hsl_ma77d.h:91
ma77_info_d::maxdepth
int maxdepth
Definition: hsl_ma77d.h:106
ma77_control_d::multiplier
ma77pkgtype_d_ multiplier
Definition: hsl_ma77d.h:77
ma77_factor_solve_d
void ma77_factor_solve_d(const int posdef, void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale, const int nrhs, const int lx, ma77pkgtype_d_ rhs[])
ma77_control_d
Definition: hsl_ma77d.h:38
ma77_control_d::action
int action
Definition: hsl_ma77d.h:75
ma77_info_d::num_file
int num_file[4]
Definition: hsl_ma77d.h:124
ma77_info_d::nflops
long int nflops
Definition: hsl_ma77d.h:111
ma77_info_d::niter
int niter
Definition: hsl_ma77d.h:112
ma77_info_d::ispare
int ispare[5]
Definition: hsl_ma77d.h:134
ma77_info_d::nio_write
long int nio_write[2]
Definition: hsl_ma77d.h:121
ma77_open_nelt
#define ma77_open_nelt
Definition: hsl_ma77d.h:16
ma77_info_d::nsup
int nsup
Definition: hsl_ma77d.h:113
ma77_alter_d
void ma77_alter_d(const ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_control_d::nb54
int nb54
Definition: hsl_ma77d.h:72
ma77_input_vars
#define ma77_input_vars
Definition: hsl_ma77d.h:18
ma77_input_reals_d
void ma77_input_reals_d(const int idx, const int length, const ma77pkgtype_d_ reals[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77_control_d::unit_diagnostics
int unit_diagnostics
Definition: hsl_ma77d.h:47
ma77_control_d::infnorm
int infnorm
Definition: hsl_ma77d.h:68