/build/buildd/coinor-ipopt-3.10.1/Ipopt/src/Algorithm/LinearSolvers/hsl_ma86d.h
Go to the documentation of this file.
00001 /*
00002  * COPYRIGHT (c) 2011 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     2011-02-25
00007  */
00008 
00009 #ifndef HSL_MA86D_H
00010 #define HSL_MA86D_H
00011 
00012 #ifndef ma86_default_control
00013 #define ma86_control ma86_control_d
00014 #define ma86_info ma86_info_d
00015 #define ma86_default_control ma86_default_control_d
00016 #define ma86_analyse ma86_analyse_d
00017 #define ma86_factor ma86_factor_d
00018 #define ma86_factor_solve ma86_factor_solve_d
00019 #define ma86_solve ma86_solve_d
00020 #define ma86_finalise ma86_finalise_d
00021 #endif
00022 
00023 typedef double ma86pkgtype_d_;
00024 typedef double ma86realtype_d_;
00025 
00026 /* Data type for user controls */
00027 struct ma86_control_d {
00028    /* Note: 0 is false, non-zero is true */
00029 
00030    /* C/Fortran interface related controls */
00031    int f_arrays; /* Treat arrays as 1-based (Fortran) if true or 0-based (C) if
00032                     false. */
00033 
00034    /* Printing controls */
00035    int diagnostics_level; /* Controls diagnostic printing.*/
00036                /* Possible values are:
00037                    < 0: no printing.
00038                      0: error and warning messages only.
00039                      1: as 0 plus basic diagnostic printing.
00040                      2: as 1 plus some more detailed diagnostic messages.
00041                      3: as 2 plus all entries of user-supplied arrays.       */
00042    int unit_diagnostics;   /* unit for diagnostic messages
00043                               Printing is suppressed if unit_diagnostics < 0. */
00044    int unit_error;         /* unit for error messages
00045                               Printing is suppressed if unit_error  <  0.     */
00046    int unit_warning;       /* unit for warning messages
00047                               Printing is suppressed if unit_warning  <  0.   */
00048 
00049    /* Controls used by ma86_analyse */
00050    int nemin;  /* Node amalgamation parameter. A child node is merged with its
00051                   parent if they both involve fewer than nemin eliminations.*/
00052    int nb;     /* Controls the size of the blocks used within each node (used to
00053                   set nb within node_type)*/
00054 
00055    /* Controls used by ma86_factor and ma86_factor_solve */
00056    int action; /* Keep going even if matrix is singular if true, or abort
00057                   if false */
00058    int nbi;    /* Inner block size for use with ma64*/
00059    int pool_size; /* Size of task pool arrays*/
00060    ma86realtype_d_ small_; /* Pivots less than small are treated as zero*/
00061    ma86realtype_d_ static_;/* Control static pivoting*/
00062    ma86realtype_d_ u;      /* Pivot tolerance*/
00063    ma86realtype_d_ umin;   /* Minimum pivot tolerance*/
00064 };
00065 
00066 /***************************************************/
00067 
00068 /* data type for returning information to user.*/
00069 struct ma86_info_d {
00070    ma86realtype_d_ detlog;       /* Holds logarithm of abs det A (or 0) */
00071    int detsign;         /* Holds sign of determinant (+/-1 or 0) */
00072    int flag;            /* Error return flag (0 on success) */
00073    int matrix_rank;     /* Rank of matrix */
00074    int maxdepth;        /* Maximum depth of the tree. */
00075    int num_delay;       /* Number of delayed pivots */
00076    long num_factor;     /* Number of entries in the factor. */
00077    long num_flops;      /* Number of flops for factor. */
00078    int num_neg;         /* Number of negative pivots */
00079    int num_nodes;       /* Number of nodes */
00080    int num_nothresh;    /* Number of pivots not satisfying u */
00081    int num_perturbed;   /* Number of perturbed pivots */
00082    int num_two;         /* Number of 2x2 pivots */
00083    int pool_size;       /* Maximum size of task pool used */
00084    int stat;            /* STAT value on error return -1. */
00085    ma86realtype_d_ usmall;       /* smallest threshold parameter used */
00086 };
00087 
00088 /* Initialise control with default values */
00089 void ma86_default_control_d(struct ma86_control_d *control);
00090 /* Analyse the sparsity pattern and prepare for factorization */
00091 void ma86_analyse_d(const int n, const int ptr[], const int row[], int order[],
00092       void **keep, const struct ma86_control_d *control,
00093       struct ma86_info_d *info);
00094 /* To factorize the matrix */
00095 void ma86_factor_d(const int n, const int ptr[], const int row[],
00096       const ma86pkgtype_d_ val[], const int order[], void **keep,
00097       const struct ma86_control_d *control, struct ma86_info_d *info,
00098       const ma86realtype_d_ scale[]);
00099 /* To factorize the matrix AND solve AX = B */
00100 void ma86_factor_solve_d(const int n, const int ptr[], const int row[],
00101       const ma86pkgtype_d_ val[], const int order[], void **keep,
00102       const struct ma86_control_d *control, struct ma86_info_d *info,
00103       const int nrhs, const int ldx, ma86pkgtype_d_ x[],
00104       const ma86realtype_d_ scale[]);
00105 /* To solve AX = B using the computed factors */
00106 void ma86_solve_d(const int job, const int nrhs, const int ldx,
00107       ma86pkgtype_d_ *x, const int order[], void **keep,
00108       const struct ma86_control_d *control, struct ma86_info_d *info,
00109       const ma86realtype_d_ scale[]);
00110 /* To clean up memory in keep */
00111 void ma86_finalise_d(void **keep, const struct ma86_control_d *control);
00112 
00113 #endif