Ipopt Documentation  
hsl_ma86s.h
Go to the documentation of this file.
1 /*
2  * COPYRIGHT (c) 2011 Science and Technology Facilities Council (STFC)
3  * Original date 25 Feburary 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_MA86 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_MA86 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_MA86S_H
41 #define HSL_MA86S_H
42 
43 #ifndef ma86_default_control
44 #define ma86_control ma86_control_s
45 #define ma86_info ma86_info_s
46 #define ma86_default_control ma86_default_control_s
47 #define ma86_analyse ma86_analyse_s
48 #define ma86_factor ma86_factor_s
49 #define ma86_factor_solve ma86_factor_solve_s
50 #define ma86_solve ma86_solve_s
51 #define ma86_finalise ma86_finalise_s
52 #endif
53 
54 typedef float ma86pkgtype_s_;
55 typedef float ma86realtype_s_;
56 
57 /* Data type for user controls */
59  /* Note: 0 is false, non-zero is true */
60 
61  /* C/Fortran interface related controls */
62  int f_arrays; /* Treat arrays as 1-based (Fortran) if true or 0-based (C) if
63  false. */
64 
65  /* Printing controls */
66  int diagnostics_level; /* Controls diagnostic printing.*/
67  /* Possible values are:
68  < 0: no printing.
69  0: error and warning messages only.
70  1: as 0 plus basic diagnostic printing.
71  2: as 1 plus some more detailed diagnostic messages.
72  3: as 2 plus all entries of user-supplied arrays. */
73  int unit_diagnostics; /* unit for diagnostic messages
74  Printing is suppressed if unit_diagnostics < 0. */
75  int unit_error; /* unit for error messages
76  Printing is suppressed if unit_error < 0. */
77  int unit_warning; /* unit for warning messages
78  Printing is suppressed if unit_warning < 0. */
79 
80  /* Controls used by ma86_analyse */
81  int nemin; /* Node amalgamation parameter. A child node is merged with its
82  parent if they both involve fewer than nemin eliminations.*/
83  int nb; /* Controls the size of the blocks used within each node (used to
84  set nb within node_type)*/
85 
86  /* Controls used by ma86_factor and ma86_factor_solve */
87  int action; /* Keep going even if matrix is singular if true, or abort
88  if false */
89  int nbi; /* Inner block size for use with ma64*/
90  int pool_size; /* Size of task pool arrays*/
91  ma86realtype_s_ small_; /* Pivots less than small are treated as zero*/
92  ma86realtype_s_ static_;/* Control static pivoting*/
93  ma86realtype_s_ u; /* Pivot tolerance*/
94  ma86realtype_s_ umin; /* Minimum pivot tolerance*/
95  int scaling; /* Scaling algorithm to use */
96 };
97 
98 /***************************************************/
99 
100 /* data type for returning information to user.*/
101 struct ma86_info_s {
102  ma86realtype_s_ detlog; /* Holds logarithm of abs det A (or 0) */
103  int detsign; /* Holds sign of determinant (+/-1 or 0) */
104  int flag; /* Error return flag (0 on success) */
105  int matrix_rank; /* Rank of matrix */
106  int maxdepth; /* Maximum depth of the tree. */
107  int num_delay; /* Number of delayed pivots */
108  long num_factor; /* Number of entries in the factor. */
109  long num_flops; /* Number of flops for factor. */
110  int num_neg; /* Number of negative pivots */
111  int num_nodes; /* Number of nodes */
112  int num_nothresh; /* Number of pivots not satisfying u */
113  int num_perturbed; /* Number of perturbed pivots */
114  int num_two; /* Number of 2x2 pivots */
115  int pool_size; /* Maximum size of task pool used */
116  int stat; /* STAT value on error return -1. */
117  ma86realtype_s_ usmall; /* smallest threshold parameter used */
118 };
119 
120 /* Initialise control with default values */
121 void ma86_default_control_s(struct ma86_control_s *control);
122 /* Analyse the sparsity pattern and prepare for factorization */
123 void ma86_analyse_s(const int n, const int ptr[], const int row[], int order[],
124  void **keep, const struct ma86_control_s *control,
125  struct ma86_info_s *info);
126 /* To factorize the matrix */
127 void ma86_factor_s(const int n, const int ptr[], const int row[],
128  const ma86pkgtype_s_ val[], const int order[], void **keep,
129  const struct ma86_control_s *control, struct ma86_info_s *info,
130  const ma86realtype_s_ scale[]);
131 /* To factorize the matrix AND solve AX = B */
132 void ma86_factor_solve_s(const int n, const int ptr[], const int row[],
133  const ma86pkgtype_s_ val[], const int order[], void **keep,
134  const struct ma86_control_s *control, struct ma86_info_s *info,
135  const int nrhs, const int ldx, ma86pkgtype_s_ x[],
136  const ma86realtype_s_ scale[]);
137 /* To solve AX = B using the computed factors */
138 void ma86_solve_s(const int job, const int nrhs, const int ldx,
139  ma86pkgtype_s_ *x, const int order[], void **keep,
140  const struct ma86_control_s *control, struct ma86_info_s *info,
141  const ma86realtype_s_ scale[]);
142 /* To clean up memory in keep */
143 void ma86_finalise_s(void **keep, const struct ma86_control_s *control);
144 
145 #endif
ma86realtype_s_ small_
Definition: hsl_ma86s.h:91
int pool_size
Definition: hsl_ma86s.h:115
void ma86_solve_s(const int job, const int nrhs, const int ldx, ma86pkgtype_s_ *x, const int order[], void **keep, const struct ma86_control_s *control, struct ma86_info_s *info, const ma86realtype_s_ scale[])
void ma86_factor_solve_s(const int n, const int ptr[], const int row[], const ma86pkgtype_s_ val[], const int order[], void **keep, const struct ma86_control_s *control, struct ma86_info_s *info, const int nrhs, const int ldx, ma86pkgtype_s_ x[], const ma86realtype_s_ scale[])
float ma86realtype_s_
Definition: hsl_ma86s.h:55
int num_nodes
Definition: hsl_ma86s.h:111
int matrix_rank
Definition: hsl_ma86s.h:105
int unit_warning
Definition: hsl_ma86s.h:77
int num_perturbed
Definition: hsl_ma86s.h:113
float ma86pkgtype_s_
Definition: hsl_ma86s.h:54
int maxdepth
Definition: hsl_ma86s.h:106
void ma86_default_control_s(struct ma86_control_s *control)
int num_delay
Definition: hsl_ma86s.h:107
ma86realtype_s_ usmall
Definition: hsl_ma86s.h:117
int diagnostics_level
Definition: hsl_ma86s.h:66
ma86realtype_s_ static_
Definition: hsl_ma86s.h:92
ma86realtype_s_ umin
Definition: hsl_ma86s.h:94
ma86realtype_s_ detlog
Definition: hsl_ma86s.h:102
long num_flops
Definition: hsl_ma86s.h:109
ma86realtype_s_ u
Definition: hsl_ma86s.h:93
void ma86_factor_s(const int n, const int ptr[], const int row[], const ma86pkgtype_s_ val[], const int order[], void **keep, const struct ma86_control_s *control, struct ma86_info_s *info, const ma86realtype_s_ scale[])
int unit_diagnostics
Definition: hsl_ma86s.h:73
int num_nothresh
Definition: hsl_ma86s.h:112
long num_factor
Definition: hsl_ma86s.h:108
void ma86_analyse_s(const int n, const int ptr[], const int row[], int order[], void **keep, const struct ma86_control_s *control, struct ma86_info_s *info)
void ma86_finalise_s(void **keep, const struct ma86_control_s *control)