Ipopt Documentation  
hsl_ma77d.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2011 Science and Technology Facilities Council (STFC)
3  * Original date 18 May 2011
4  * All rights reserved
5  *
6  * Written by: Jonathan Hogg
7  *
8  * THIS FILE ONLY may be redistributed under the below modified BSD licence.
9  * All other files distributed as part of the HSL_MA77 package
10  * require a licence to be obtained from STFC and may NOT be redistributed
11  * without permission. Please refer to your licence for HSL_MA77 for full terms
12  * and conditions. STFC may be contacted via hsl(at)stfc.ac.uk.
13  *
14  * Modified BSD licence (this header file only):
15  *
16  * Redistribution and use in source and binary forms, with or without
17  * modification, are permitted provided that the following conditions are met:
18  * * Redistributions of source code must retain the above copyright
19  * notice, this list of conditions and the following disclaimer.
20  * * Redistributions in binary form must reproduce the above copyright
21  * notice, this list of conditions and the following disclaimer in the
22  * documentation and/or other materials provided with the distribution.
23  * * Neither the name of STFC nor the names of its contributors may be used
24  * to endorse or promote products derived from this software without
25  * specific prior written permission.
26  *
27  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED. IN NO EVENT SHALL STFC BE LIABLE FOR ANY DIRECT, INDIRECT,
31  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
33  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
36  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37  *
38  */
39 
40 #ifndef HSL_MA77D_H
41 #define HSL_MA77D_H
42 
43 #ifndef ma77_default_control
44 #define ma77_control ma77_control_d
45 #define ma77_info ma77_info_d
46 #define ma77_default_control ma77_default_control_d
47 #define ma77_open_nelt ma77_open_nelt_d
48 #define ma77_open ma77_open_d
49 #define ma77_input_vars ma77_input_vars_d
50 #define ma77_input_reals ma77_input_reals_d
51 #define ma77_analyse ma77_analyse_d
52 #define ma77_factor ma77_factor_d
53 #define ma77_factor_solve ma77_factor_solve_d
54 #define ma77_solve ma77_solve_d
55 #define ma77_resid ma77_resid_d
56 #define ma77_scale ma77_scale_d
57 #define ma77_enquire_posdef ma77_enquire_posdef_d
58 #define ma77_enquire_indef ma77_enquire_indef_d
59 #define ma77_alter ma77_alter_d
60 #define ma77_restart ma77_restart_d
61 #define ma77_finalise ma77_finalise_d
62 #define ma77_solve_fredholm ma77_solve_fredholm_d
63 #define ma77_lmultiply ma77_lmultiply_d
64 #endif
65 
66 typedef double ma77pkgtype_d_;
67 
68 /* Data type for user controls */
70  /* Note: 0 is false, non-zero is true */
71 
72  /* C/Fortran interface related controls */
73  int f_arrays; /* Treat arrays as 1-based (Fortran) if true or 0-based (C) if
74  false. */
75 
76  /* Printing controls */
78  int unit_diagnostics; /* unit for diagnostic messages
79  Printing is suppressed if unit_diagnostics < 0. */
80  int unit_error; /* unit for error messages
81  Printing is suppressed if unit_error < 0. */
82  int unit_warning; /* unit for warning messages
83  Printing is suppressed if unit_warning < 0. */
84 
85  /* Controls used by MA77_open */
86  int bits;
87  int buffer_lpage[2];
88  int buffer_npage[2];
89  long int file_size;
90  long int maxstore;
91  long int storage[3];
92 
93  /* Controls used by MA77_analyse */
94  int nemin; /* Node amalgamation parameter. A child node is merged with its
95  parent if they both involve fewer than nemin eliminations.*/
96 
97  /* Controls used by MA77_scale */
98  int maxit;
99  int infnorm;
101 
102  /* Controls used by MA77_factor with posdef true */
103  int nb54;
104 
105  /* Controls used by MA77_factor with posdef false */
106  int action; /* Keep going even if matrix is singular if true, or abort
107  if false */
109  int nb64;
110  int nbi;
113  long int storage_indef;
114  ma77pkgtype_d_ u; /* Pivot tolerance*/
115  ma77pkgtype_d_ umin; /* Minimum pivot tolerance*/
116 
117  /* Controls used by ma77_solve_fredholm */
118  ma77pkgtype_d_ consist_tol; /* Tolerance for consistent singular system */
119 
120  /* Pad data structure to allow for future growth */
121  int ispare[5]; long int lspare[5]; ma77pkgtype_d_ rspare[5];
122 };
123 
124 /***************************************************/
125 
126 /* data type for returning information to user.*/
127 struct ma77_info_d {
129  int detsign;
130  int flag;
131  int iostat;
135  int maxdepth;
136  int maxfront;
137  long int minstore;
138  int ndelay;
139  long int nfactor;
140  long int nflops;
141  int niter;
142  int nsup;
143  int num_neg;
146  int ntwo;
147  int stat;
148  int index[4];
149  long int nio_read[2];
150  long int nio_write[2];
151  long int nwd_read[2];
152  long int nwd_write[2];
153  int num_file[4];
154  long int storage[4];
157  int unused;
159 
160  /* Pad data structure to allow for future growth */
161  int ispare[5]; long int lspare[5]; ma77pkgtype_d_ rspare[5];
162 };
163 
164 /* Initialise control with default values */
165 void ma77_default_control_d(struct ma77_control_d *control);
166 void ma77_open_nelt(const int n, const char* fname1, const char* fname2,
167  const char *fname3, const char *fname4, void **keep,
168  const struct ma77_control_d *control, struct ma77_info_d *info,
169  const int nelt);
170 void ma77_open_d(const int n, const char* fname1, const char* fname2,
171  const char *fname3, const char *fname4, void **keep,
172  const struct ma77_control_d *control, struct ma77_info_d *info);
173 void ma77_input_vars(const int idx, const int nvar, const int list[],
174  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info);
175 void ma77_input_reals_d(const int idx, const int length,
176  const ma77pkgtype_d_ reals[], void **keep, const struct ma77_control_d *control,
177  struct ma77_info_d *info);
178 /* Analyse the sparsity pattern and prepare for factorization */
179 void ma77_analyse(const int order[], void **keep,
180  const struct ma77_control_d *control, struct ma77_info_d *info);
181 /* To factorize the matrix */
182 void ma77_factor_d(const int posdef, void **keep,
183  const struct ma77_control_d *control, struct ma77_info_d *info,
184  const ma77pkgtype_d_ *scale);
185 /* To factorize the matrix AND solve AX = B */
186 void ma77_factor_solve_d(const int posdef, void **keep,
187  const struct ma77_control_d *control, struct ma77_info_d *info,
188  const ma77pkgtype_d_ *scale, const int nrhs, const int lx,
189  ma77pkgtype_d_ rhs[]);
190 /* To solve AX = B using the computed factors */
191 void ma77_solve_d(const int job, const int nrhs, const int lx, ma77pkgtype_d_ x[],
192  void **keep, const struct ma77_control_d *control, struct ma77_info_d *info,
193  const ma77pkgtype_d_ *scale);
194 void ma77_resid_d(const int nrhs, const int lx, const ma77pkgtype_d_ x[],
195  const int lresid, ma77pkgtype_d_ resid[], void **keep,
196  const struct ma77_control_d *control, struct ma77_info_d *info,
197  ma77pkgtype_d_ *anorm_bnd);
198 void ma77_scale_d(ma77pkgtype_d_ scale[], void **keep,
199  const struct ma77_control_d *control, struct ma77_info_d *info,
200  ma77pkgtype_d_ *anorm);
201 void ma77_enquire_posdef_d(ma77pkgtype_d_ d[], void **keep,
202  const struct ma77_control_d *control, struct ma77_info_d *info);
203 void ma77_enquire_indef_d(int piv_order[], ma77pkgtype_d_ d[], void **keep,
204  const struct ma77_control_d *control, struct ma77_info_d *info);
205 void ma77_alter_d(const ma77pkgtype_d_ d[], void **keep,
206  const struct ma77_control_d *control, struct ma77_info_d *info);
207 void ma77_restart_d(const char *restart_file, const char *fname1,
208  const char *fname2, const char *fname3, const char *fname4, void **keep,
209  const struct ma77_control_d *control, struct ma77_info_d *info);
210 void ma77_solve_fredholm_d(int nrhs, int flag_out[], int lx, ma77pkgtype_d_ x[],
211  void **keep, const struct ma77_control_d *control,
212  struct ma77_info_d *info, const ma77pkgtype_d_ *scale);
213 void ma77_lmultiply_d(int trans, int k, int lx, ma77pkgtype_d_ x[], int ly,
214  ma77pkgtype_d_ y[], void **keep, const struct ma77_control_d *control,
215  struct ma77_info_d *info, const ma77pkgtype_d_ *scale);
216 /* To clean up memory in keep */
217 void ma77_finalise_d(void **keep, const struct ma77_control_d *control,
218  struct ma77_info_d *info);
219 
220 #endif
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)
double ma77pkgtype_d_
Definition: hsl_ma77d.h:66
long int nfactor
Definition: hsl_ma77d.h:139
int unit_restart
Definition: hsl_ma77d.h:156
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)
int num_nothresh
Definition: hsl_ma77d.h:144
ma77pkgtype_d_ consist_tol
Definition: hsl_ma77d.h:118
void ma77_finalise_d(void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
int maxdepth
Definition: hsl_ma77d.h:135
ma77pkgtype_d_ detlog
Definition: hsl_ma77d.h:128
long int nio_read[2]
Definition: hsl_ma77d.h:149
int matrix_dup
Definition: hsl_ma77d.h:132
void ma77_enquire_indef_d(int piv_order[], ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
void ma77_default_control_d(struct ma77_control_d *control)
#define ma77_input_vars
Definition: hsl_ma77d.h:49
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[])
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)
long int storage[3]
Definition: hsl_ma77d.h:91
long int nflops
Definition: hsl_ma77d.h:140
void ma77_enquire_posdef_d(ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77pkgtype_d_ u
Definition: hsl_ma77d.h:114
long int storage[4]
Definition: hsl_ma77d.h:154
#define ma77_open_nelt
Definition: hsl_ma77d.h:47
int buffer_lpage[2]
Definition: hsl_ma77d.h:87
ma77pkgtype_d_ umin
Definition: hsl_ma77d.h:115
long int storage_indef
Definition: hsl_ma77d.h:113
long int nwd_read[2]
Definition: hsl_ma77d.h:151
int buffer_npage[2]
Definition: hsl_ma77d.h:88
int tree_nodes
Definition: hsl_ma77d.h:155
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)
long int minstore
Definition: hsl_ma77d.h:137
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)
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)
ma77pkgtype_d_ rspare[5]
Definition: hsl_ma77d.h:121
int unit_warning
Definition: hsl_ma77d.h:82
int matrix_outrange
Definition: hsl_ma77d.h:134
int matrix_rank
Definition: hsl_ma77d.h:133
long int lspare[5]
Definition: hsl_ma77d.h:121
long int nio_write[2]
Definition: hsl_ma77d.h:150
void ma77_alter_d(const ma77pkgtype_d_ d[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info)
ma77pkgtype_d_ small
Definition: hsl_ma77d.h:111
ma77pkgtype_d_ multiplier
Definition: hsl_ma77d.h:108
void ma77_factor_d(const int posdef, void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, const ma77pkgtype_d_ *scale)
int unit_diagnostics
Definition: hsl_ma77d.h:78
int num_perturbed
Definition: hsl_ma77d.h:145
ma77pkgtype_d_ rspare[5]
Definition: hsl_ma77d.h:161
void ma77_scale_d(ma77pkgtype_d_ scale[], void **keep, const struct ma77_control_d *control, struct ma77_info_d *info, ma77pkgtype_d_ *anorm)
int num_file[4]
Definition: hsl_ma77d.h:153
ma77pkgtype_d_ static_
Definition: hsl_ma77d.h:112
int ispare[5]
Definition: hsl_ma77d.h:161
int maxfront
Definition: hsl_ma77d.h:136
#define ma77_analyse
Definition: hsl_ma77d.h:51
long int file_size
Definition: hsl_ma77d.h:89
ma77pkgtype_d_ thresh
Definition: hsl_ma77d.h:100
long int maxstore
Definition: hsl_ma77d.h:90
int index[4]
Definition: hsl_ma77d.h:148
ma77pkgtype_d_ usmall
Definition: hsl_ma77d.h:158
long int nwd_write[2]
Definition: hsl_ma77d.h:152
long int lspare[5]
Definition: hsl_ma77d.h:161
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)
int ispare[5]
Definition: hsl_ma77d.h:121