Ipopt  trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
hsl_ma97d.h
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT (c) 2012 The Science and Technology Facilities Council (STFC)
00003  * All Rights Reserved.
00004  * This code is published under the Eclipse Public License.
00005  *
00006  * Authors:  Jonathan Hogg    STFC     2012-12-21
00007  */
00008 
00009 #ifndef HSL_MA97D_H
00010 #define HSL_MA97D_H
00011 
00012 #ifndef ma97_default_control
00013 #define ma97_control ma97_control_d
00014 #define ma97_info ma97_info_d
00015 #define ma97_default_control ma97_default_control_d
00016 #define ma97_analyse ma97_analyse_d
00017 #define ma97_analyse_coord ma97_analyse_coord_d
00018 #define ma97_factor ma97_factor_d
00019 #define ma97_factor_solve ma97_factor_solve_d
00020 #define ma97_solve ma97_solve_d
00021 #define ma97_free_akeep ma97_free_akeep_d
00022 #define ma97_free_fkeep ma97_free_fkeep_d
00023 #define ma97_finalise ma97_finalise_d
00024 #define ma97_enquire_posdef ma97_enquire_posdef_d
00025 #define ma97_enquire_indef ma97_enquire_indef_d
00026 #define ma97_alter ma97_alter_d
00027 #define ma97_solve_fredholm ma97_solve_fredholm_d
00028 #define ma97_lmultiply ma97_lmultiply_d
00029 #define ma97_sparse_fwd_solve ma97_sparse_fwd_solve_d
00030 #endif
00031 
00032 typedef double ma97pkgtype_d_;
00033 typedef double ma97realtype_d_;
00034 
00035 struct ma97_control_d {
00036     int f_arrays;             /* Use C or Fortran numbering */
00037     int action;               /* Continue on singularity if !=0 (true),
00038                                  otherwise abort */
00039     int nemin;                /* Supernode amalgamation if parent and child
00040                                  have fewer than nemin eliminations */
00041     ma97realtype_d_ multiplier;/* Amount of extra memory to allow for delays */
00042     int ordering;             /* Control scaling algorithm used:
00043                                  0 - user supplied order (order absent=identity)
00044                                  1 - AMD
00045                                  2 - MD (as in MA27)
00046                                  3 - METIS nested dissection
00047                                  4 - MA47
00048                                  5 - Automatic choice between 1 and 3 */
00049     int print_level;          /* <0 for no printing, 0 for basic, >1 for most */
00050     int scaling;              /* 0 user/none, 1 mc64, 2 mc77 */
00051     ma97realtype_d_ small;     /* Minimum value to count as non-zero */
00052     ma97realtype_d_ u;         /* Pivoting parameter */
00053     int unit_diagnostics;     /* Fortran unit for diagnostics (<0 disables) */
00054     int unit_error;           /* Fortran unit for error msgs (<0 disables) */
00055     int unit_warning;         /* Fortran unit for warning msgs (<0 disables) */
00056     long factor_min;          /* Min number of flops for parallel execution */
00057     int solve_blas3;          /* Use BLAS3 in solve in true, else BLAS2 */
00058     long solve_min;           /* Min number of entries for parallel exection */
00059     int solve_mf;             /* If true use m/f solve, else use s/n */
00060     ma97realtype_d_ consist_tol; /* Consistent equation tolerance */
00061 
00062     /* Reserve space for future interface changes */
00063     int ispare[5]; ma97realtype_d_ rspare[10];
00064 };
00065 
00066 struct ma97_info {
00067     int flag;                 /* <0 on error */
00068     int flag68;
00069     int flag77;
00070     int matrix_dup;           /* number duplicate entries in A */
00071     int matrix_rank;          /* matrix rank */
00072     int matrix_outrange;      /* number of out of range entries in A */
00073     int matrix_missing_diag;  /* number of zero diagonal entries in A */
00074     int maxdepth;             /* height of assembly tree */
00075     int maxfront;             /* maximum dimension of frontal matrix */
00076     int num_delay;            /* number of times a pivot was delayed */
00077     long num_factor;          /* number of entries in L */
00078     long num_flops;           /* number of floating point operations */
00079     int num_neg;              /* number of negative pivots */
00080     int num_sup;              /* number of supernodes in assembly tree */
00081     int num_two;              /* number of 2x2 pivots */
00082     int ordering;             /* ordering used (as per control.ordering) */
00083     int stat;                 /* error code from failed memory allocation */
00084 
00085     /* Reserve space for future interface changes */
00086     int ispare[5]; ma97realtype_d_ rspare[10];         
00087 };
00088 
00089 /* Set default values of control */
00090 void ma97_default_control_d(struct ma97_control_d *control);
00091 /* Perform symbolic analysis of matrix (sparse column entry) */
00092 void ma97_analyse_d(int check, int n, const int ptr[], const int row[],
00093       ma97pkgtype_d_ val[], void **akeep, const struct ma97_control_d *control,
00094       struct ma97_info_d *info, int order[]);
00095 /* Perform symbolic analysis of matrix (coordinate entry) */
00096 void ma97_analyse_coord_d(int n, int ne, const int row[], const int col[],
00097       ma97pkgtype_d_ val[], void **akeep, const struct ma97_control_d *control,
00098       struct ma97_info_d *info, int order[]);
00099 /* Perform numerical factorization, following call to ma97_analyse */
00100 void ma97_factor_d(int matrix_type, const int ptr[], const int row[],
00101       const ma97pkgtype_d_ val[], void **akeep, void **fkeep,
00102       const struct ma97_control_d *control, struct ma97_info_d *info,
00103       ma97realtype_d_ scale[]);
00104 /* Perform numerical factorization and solve, following call to ma97_analyse */
00105 void ma97_factor_solve_d(int matrix_type, const int ptr[], const int row[],
00106       const ma97pkgtype_d_ val[], int nrhs, ma97pkgtype_d_ x[], int ldx,
00107       void **akeep, void **fkeep, const struct ma97_control_d *control,
00108       struct ma97_info_d *info, ma97realtype_d_ scale[]);
00109 /* Perform forward and back substitutions, following call to ma97_factor */
00110 void ma97_solve_d(int job, int nrhs, ma97pkgtype_d_ x[], int ldx,
00111       void **akeep, void **fkeep, const struct ma97_control_d *control,
00112       struct ma97_info_d *info);
00113 /* Free memory in akeep */
00114 void ma97_free_akeep_d(void **akeep);
00115 /* Free memory in fkeep */
00116 void ma97_free_fkeep_d(void **fkeep);
00117 /* Free memory in akeep and fkeep */
00118 void ma97_finalise_d(void **akeep, void **fkeep);
00119 /* Return diagonal entries of L */
00120 void ma97_enquire_posdef_d(void **akeep, void **fkeep,
00121       const struct ma97_control *control, struct ma97_info *info,
00122       ma97realtype_d_ d[]);
00123 /* Return diagonal, subdiagonal and/or pivot order of D */
00124 void ma97_enquire_indef_d(void **akeep, void **fkeep,
00125       const struct ma97_control *control, struct ma97_info *info,
00126       int *piv_order, ma97pkgtype_d_ *d);
00127 /* Alter diagonal and subdiagonal of D */
00128 void ma97_alter_d(const ma97pkgtype_d_ d[], void **akeep, void **fkeep,
00129       const struct ma97_control *control, struct ma97_info *info);
00130 /* Fredholm alternative for singular systems */
00131 void ma97_solve_fredholm_d(int nrhs,  int flag_out[], ma97pkgtype_d_ x[],
00132       int ldx, void **akeep, void **fkeep, const struct ma97_control_d *control,
00133       struct ma97_info_d *info);
00134 /* Form (S^{-1}PL) X or (S^{-1}PL)^T X */
00135 void ma97_lmultiply_d(int trans, int k, const ma97pkgtype_d_ x[], int ldx,
00136       ma97pkgtype_d_ y[], int ldy, void **akeep, void **fkeep,
00137       const struct ma97_control_d *control, struct ma97_info_d *info);
00138 /* Perform a sparse forward solve */
00139 void ma97_sparse_fwd_solve_d(int nbi, const int bindex[],
00140       const ma97pkgtype_d_ b[], const int order[], int *nxi, int xindex[],
00141       ma97pkgtype_d_ x[], void **akeep, void **fkeep,
00142       const struct ma97_control_d *control, struct ma97_info_d *info);
00143 
00144 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines