lp_solve_5.5/ 40777 0 0 0 10763107543 11450 5ustar usergrouplp_solve_5.5/colamd/ 40777 0 0 0 11141443440 12675 5ustar usergrouplp_solve_5.5/colamd/colamd.c100666 0 0 311201 11141443437 14441 0ustar usergroup/* ========================================================================== */ /* === colamd/symamd - a sparse matrix column ordering algorithm ============ */ /* ========================================================================== */ /* colamd: an approximate minimum degree column ordering algorithm, for LU factorization of symmetric or unsymmetric matrices, QR factorization, least squares, interior point methods for linear programming problems, and other related problems. symamd: an approximate minimum degree ordering algorithm for Cholesky factorization of symmetric matrices. Purpose: Colamd computes a permutation Q such that the Cholesky factorization of (AQ)'(AQ) has less fill-in and requires fewer floating point operations than A'A. This also provides a good ordering for sparse partial pivoting methods, P(AQ) = LU, where Q is computed prior to numerical factorization, and P is computed during numerical factorization via conventional partial pivoting with row interchanges. Colamd is the column ordering method used in SuperLU, part of the ScaLAPACK library. It is also available as built-in function in Matlab Version 6, available from MathWorks, Inc. (http://www.mathworks.com). This routine can be used in place of colmmd in Matlab. By default, the \ and / operators in Matlab perform a column ordering (using colmmd or colamd) prior to LU factorization using sparse partial pivoting, in the built-in Matlab lu(A) routine. Symamd computes a permutation P of a symmetric matrix A such that the Cholesky factorization of PAP' has less fill-in and requires fewer floating point operations than A. Symamd constructs a matrix M such that M'M has the same nonzero pattern of A, and then orders the columns of M using colmmd. The column ordering of M is then returned as the row and column ordering P of A. Authors: The authors of the code itself are Stefan I. Larimore and Timothy A. Davis (davis@cise.ufl.edu), University of Florida. The algorithm was developed in collaboration with John Gilbert, Xerox PARC, and Esmond Ng, Oak Ridge National Laboratory. Date: May 4, 2001. Version 2.1. Acknowledgements: This work was supported by the National Science Foundation, under grants DMS-9504974 and DMS-9803599. Notice: Copyright (c) 1998-2001 by the University of Florida. All Rights Reserved. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. Permission is hereby granted to use or copy this program for any purpose, provided the above notices are retained on all copies. User documentation of any code that uses this code must cite the Authors, the Copyright, and "Used by permission." If this code is accessible from within Matlab, then typing "help colamd" and "help symamd" must cite the Authors. Permission to modify the code and to distribute modified code is granted, provided the above notices are retained, and a notice that the code was modified is included with the above copyright notice. You must also retain the Availability information below, of the original version. This software is provided free of charge. Availability: The colamd/symamd library is available at http://www.cise.ufl.edu/research/sparse/colamd/ This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.c file. It requires the colamd.h file. It is required by the colamdmex.c and symamdmex.c files, for the Matlab interface to colamd and symamd. Changes to the colamd library since Version 1.0 and 1.1: No bugs were found in version 1.1. These changes merely add new functionality. * added the COLAMD_RECOMMENDED (nnz, n_row, n_col) macro. * moved the output statistics, from A, to a separate output argument. The arguments changed for the C-callable routines. * added colamd_report and symamd_report. * added a C-callable symamd routine. Formerly, symamd was only available as a mexFunction from Matlab. * added error-checking to symamd. Formerly, it assumed its input was error-free. * added the optional stats and knobs arguments to the symamd mexFunction * deleted colamd_help. A help message is still available from "help colamd" and "help symamd" in Matlab. * deleted colamdtree.m and symamdtree.m. Now, colamd.m and symamd.m also do the elimination tree post-ordering. The Version 1.1 colamd and symamd mexFunctions, which do not do the post- ordering, are now visible as colamdmex and symamdmex from Matlab. Essentialy, the post-ordering is now the default behavior of colamd.m and symamd.m, to match the behavior of colmmd and symmmd. The post-ordering is only available in the Matlab interface, not the C-callable interface. * made a slight change to the dense row/column detection in symamd, to match the stated specifications. Changes from Version 2.0 to 2.1: * TRUE and FALSE are predefined on some systems, so they are defined here only if not already defined. * web site changed * UNIX Makefile modified, to handle the case if "." is not in your path. */ /* ========================================================================== */ /* === Description of user-callable routines ================================ */ /* ========================================================================== */ /* ---------------------------------------------------------------------------- colamd_recommended: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" int colamd_recommended (int nnz, int n_row, int n_col) ; or as a C macro #include "colamd.h" Alen = COLAMD_RECOMMENDED (int nnz, int n_row, int n_col) ; Purpose: Returns recommended value of Alen for use by colamd. Returns -1 if any input argument is negative. The use of this routine or macro is optional. Note that the macro uses its arguments more than once, so be careful for side effects, if you pass expressions as arguments to COLAMD_RECOMMENDED. Not needed for symamd, which dynamically allocates its own memory. Arguments (all input arguments): int nnz ; Number of nonzeros in the matrix A. This must be the same value as p [n_col] in the call to colamd - otherwise you will get a wrong value of the recommended memory to use. int n_row ; Number of rows in the matrix A. int n_col ; Number of columns in the matrix A. ---------------------------------------------------------------------------- colamd_set_defaults: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" colamd_set_defaults (int knobs [COLAMD_KNOBS]) ; Purpose: Sets the default parameters. The use of this routine is optional. Arguments: double knobs [COLAMD_KNOBS] ; Output only. Colamd: rows with more than (knobs [COLAMD_DENSE_ROW] * n_col) entries are removed prior to ordering. Columns with more than (knobs [COLAMD_DENSE_COL] * n_row) entries are removed prior to ordering, and placed last in the output column ordering. Symamd: uses only knobs [COLAMD_DENSE_ROW], which is knobs [0]. Rows and columns with more than (knobs [COLAMD_DENSE_ROW] * n) entries are removed prior to ordering, and placed last in the output ordering. COLAMD_DENSE_ROW and COLAMD_DENSE_COL are defined as 0 and 1, respectively, in colamd.h. Default values of these two knobs are both 0.5. Currently, only knobs [0] and knobs [1] are used, but future versions may use more knobs. If so, they will be properly set to their defaults by the future version of colamd_set_defaults, so that the code that calls colamd will not need to change, assuming that you either use colamd_set_defaults, or pass a (double *) NULL pointer as the knobs array to colamd or symamd. ---------------------------------------------------------------------------- colamd: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" int colamd (int n_row, int n_col, int Alen, int *A, int *p, double knobs [COLAMD_KNOBS], int stats [COLAMD_STATS]) ; Purpose: Computes a column ordering (Q) of A such that P(AQ)=LU or (AQ)'AQ=LL' have less fill-in and require fewer floating point operations than factorizing the unpermuted matrix A or A'A, respectively. Returns: TRUE (1) if successful, FALSE (0) otherwise. Arguments: int n_row ; Input argument. Number of rows in the matrix A. Restriction: n_row >= 0. Colamd returns FALSE if n_row is negative. int n_col ; Input argument. Number of columns in the matrix A. Restriction: n_col >= 0. Colamd returns FALSE if n_col is negative. int Alen ; Input argument. Restriction (see note): Alen >= 2*nnz + 6*(n_col+1) + 4*(n_row+1) + n_col Colamd returns FALSE if these conditions are not met. Note: this restriction makes an modest assumption regarding the size of the two typedef's structures in colamd.h. We do, however, guarantee that Alen >= colamd_recommended (nnz, n_row, n_col) or equivalently as a C preprocessor macro: Alen >= COLAMD_RECOMMENDED (nnz, n_row, n_col) will be sufficient. int A [Alen] ; Input argument, undefined on output. A is an integer array of size Alen. Alen must be at least as large as the bare minimum value given above, but this is very low, and can result in excessive run time. For best performance, we recommend that Alen be greater than or equal to colamd_recommended (nnz, n_row, n_col), which adds nnz/5 to the bare minimum value given above. On input, the row indices of the entries in column c of the matrix are held in A [(p [c]) ... (p [c+1]-1)]. The row indices in a given column c need not be in ascending order, and duplicate row indices may be be present. However, colamd will work a little faster if both of these conditions are met (Colamd puts the matrix into this format, if it finds that the the conditions are not met). The matrix is 0-based. That is, rows are in the range 0 to n_row-1, and columns are in the range 0 to n_col-1. Colamd returns FALSE if any row index is out of range. The contents of A are modified during ordering, and are undefined on output. int p [n_col+1] ; Both input and output argument. p is an integer array of size n_col+1. On input, it holds the "pointers" for the column form of the matrix A. Column c of the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first entry, p [0], must be zero, and p [c] <= p [c+1] must hold for all c in the range 0 to n_col-1. The value p [n_col] is thus the total number of entries in the pattern of the matrix A. Colamd returns FALSE if these conditions are not met. On output, if colamd returns TRUE, the array p holds the column permutation (Q, for P(AQ)=LU or (AQ)'(AQ)=LL'), where p [0] is the first column index in the new ordering, and p [n_col-1] is the last. That is, p [k] = j means that column j of A is the kth pivot column, in AQ, where k is in the range 0 to n_col-1 (p [0] = j means that column j of A is the first column in AQ). If colamd returns FALSE, then no permutation is returned, and p is undefined on output. double knobs [COLAMD_KNOBS] ; Input argument. See colamd_set_defaults for a description. int stats [COLAMD_STATS] ; Output argument. Statistics on the ordering, and error status. See colamd.h for related definitions. Colamd returns FALSE if stats is not present. stats [0]: number of dense or empty rows ignored. stats [1]: number of dense or empty columns ignored (and ordered last in the output permutation p) Note that a row can become "empty" if it contains only "dense" and/or "empty" columns, and similarly a column can become "empty" if it only contains "dense" and/or "empty" rows. stats [2]: number of garbage collections performed. This can be excessively high if Alen is close to the minimum required value. stats [3]: status code. < 0 is an error code. > 1 is a warning or notice. 0 OK. Each column of the input matrix contained row indices in increasing order, with no duplicates. 1 OK, but columns of input matrix were jumbled (unsorted columns or duplicate entries). Colamd had to do some extra work to sort the matrix first and remove duplicate entries, but it still was able to return a valid permutation (return value of colamd was TRUE). stats [4]: highest numbered column that is unsorted or has duplicate entries. stats [5]: last seen duplicate or unsorted row index. stats [6]: number of duplicate or unsorted row indices. -1 A is a null pointer -2 p is a null pointer -3 n_row is negative stats [4]: n_row -4 n_col is negative stats [4]: n_col -5 number of nonzeros in matrix is negative stats [4]: number of nonzeros, p [n_col] -6 p [0] is nonzero stats [4]: p [0] -7 A is too small stats [4]: required size stats [5]: actual size (Alen) -8 a column has a negative number of entries stats [4]: column with < 0 entries stats [5]: number of entries in col -9 a row index is out of bounds stats [4]: column with bad row index stats [5]: bad row index stats [6]: n_row, # of rows of matrx -10 (unused; see symamd.c) -999 (unused; see symamd.c) Future versions may return more statistics in the stats array. Example: See http://www.cise.ufl.edu/research/sparse/colamd/example.c for a complete example. To order the columns of a 5-by-4 matrix with 11 nonzero entries in the following nonzero pattern x 0 x 0 x 0 x x 0 x x 0 0 0 x x x x 0 0 with default knobs and no output statistics, do the following: #include "colamd.h" #define ALEN COLAMD_RECOMMENDED (11, 5, 4) int A [ALEN] = {1, 2, 5, 3, 5, 1, 2, 3, 4, 2, 4} ; int p [ ] = {0, 3, 5, 9, 11} ; int stats [COLAMD_STATS] ; colamd (5, 4, ALEN, A, p, (double *) NULL, stats) ; The permutation is returned in the array p, and A is destroyed. ---------------------------------------------------------------------------- symamd: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" int symamd (int n, int *A, int *p, int *perm, int knobs [COLAMD_KNOBS], int stats [COLAMD_STATS], void (*allocate) (size_t, size_t), void (*release) (void *)) ; Purpose: The symamd routine computes an ordering P of a symmetric sparse matrix A such that the Cholesky factorization PAP' = LL' remains sparse. It is based on a column ordering of a matrix M constructed so that the nonzero pattern of M'M is the same as A. The matrix A is assumed to be symmetric; only the strictly lower triangular part is accessed. You must pass your selected memory allocator (usually calloc/free or mxCalloc/mxFree) to symamd, for it to allocate memory for the temporary matrix M. Returns: TRUE (1) if successful, FALSE (0) otherwise. Arguments: int n ; Input argument. Number of rows and columns in the symmetrix matrix A. Restriction: n >= 0. Symamd returns FALSE if n is negative. int A [nnz] ; Input argument. A is an integer array of size nnz, where nnz = p [n]. The row indices of the entries in column c of the matrix are held in A [(p [c]) ... (p [c+1]-1)]. The row indices in a given column c need not be in ascending order, and duplicate row indices may be present. However, symamd will run faster if the columns are in sorted order with no duplicate entries. The matrix is 0-based. That is, rows are in the range 0 to n-1, and columns are in the range 0 to n-1. Symamd returns FALSE if any row index is out of range. The contents of A are not modified. int p [n+1] ; Input argument. p is an integer array of size n+1. On input, it holds the "pointers" for the column form of the matrix A. Column c of the matrix A is held in A [(p [c]) ... (p [c+1]-1)]. The first entry, p [0], must be zero, and p [c] <= p [c+1] must hold for all c in the range 0 to n-1. The value p [n] is thus the total number of entries in the pattern of the matrix A. Symamd returns FALSE if these conditions are not met. The contents of p are not modified. int perm [n+1] ; Output argument. On output, if symamd returns TRUE, the array perm holds the permutation P, where perm [0] is the first index in the new ordering, and perm [n-1] is the last. That is, perm [k] = j means that row and column j of A is the kth column in PAP', where k is in the range 0 to n-1 (perm [0] = j means that row and column j of A are the first row and column in PAP'). The array is used as a workspace during the ordering, which is why it must be of length n+1, not just n. double knobs [COLAMD_KNOBS] ; Input argument. See colamd_set_defaults for a description. int stats [COLAMD_STATS] ; Output argument. Statistics on the ordering, and error status. See colamd.h for related definitions. Symamd returns FALSE if stats is not present. stats [0]: number of dense or empty row and columns ignored (and ordered last in the output permutation perm). Note that a row/column can become "empty" if it contains only "dense" and/or "empty" columns/rows. stats [1]: (same as stats [0]) stats [2]: number of garbage collections performed. stats [3]: status code. < 0 is an error code. > 1 is a warning or notice. 0 OK. Each column of the input matrix contained row indices in increasing order, with no duplicates. 1 OK, but columns of input matrix were jumbled (unsorted columns or duplicate entries). Symamd had to do some extra work to sort the matrix first and remove duplicate entries, but it still was able to return a valid permutation (return value of symamd was TRUE). stats [4]: highest numbered column that is unsorted or has duplicate entries. stats [5]: last seen duplicate or unsorted row index. stats [6]: number of duplicate or unsorted row indices. -1 A is a null pointer -2 p is a null pointer -3 (unused, see colamd.c) -4 n is negative stats [4]: n -5 number of nonzeros in matrix is negative stats [4]: # of nonzeros (p [n]). -6 p [0] is nonzero stats [4]: p [0] -7 (unused) -8 a column has a negative number of entries stats [4]: column with < 0 entries stats [5]: number of entries in col -9 a row index is out of bounds stats [4]: column with bad row index stats [5]: bad row index stats [6]: n_row, # of rows of matrx -10 out of memory (unable to allocate temporary workspace for M or count arrays using the "allocate" routine passed into symamd). -999 internal error. colamd failed to order the matrix M, when it should have succeeded. This indicates a bug. If this (and *only* this) error code occurs, please contact the authors. Don't contact the authors if you get any other error code. Future versions may return more statistics in the stats array. void * (*allocate) (size_t, size_t) A pointer to a function providing memory allocation. The allocated memory must be returned initialized to zero. For a C application, this argument should normally be a pointer to calloc. For a Matlab mexFunction, the routine mxCalloc is passed instead. void (*release) (size_t, size_t) A pointer to a function that frees memory allocated by the memory allocation routine above. For a C application, this argument should normally be a pointer to free. For a Matlab mexFunction, the routine mxFree is passed instead. ---------------------------------------------------------------------------- colamd_report: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" colamd_report (int stats [COLAMD_STATS]) ; Purpose: Prints the error status and statistics recorded in the stats array on the standard error output (for a standard C routine) or on the Matlab output (for a mexFunction). Arguments: int stats [COLAMD_STATS] ; Input only. Statistics from colamd. ---------------------------------------------------------------------------- symamd_report: ---------------------------------------------------------------------------- C syntax: #include "colamd.h" symamd_report (int stats [COLAMD_STATS]) ; Purpose: Prints the error status and statistics recorded in the stats array on the standard error output (for a standard C routine) or on the Matlab output (for a mexFunction). Arguments: int stats [COLAMD_STATS] ; Input only. Statistics from symamd. */ /* ========================================================================== */ /* === Scaffolding code definitions ======================================== */ /* ========================================================================== */ /* Ensure that debugging is turned off: */ #ifndef NDEBUG #define NDEBUG #endif /* NDEBUG */ /* Our "scaffolding code" philosophy: In our opinion, well-written library code should keep its "debugging" code, and just normally have it turned off by the compiler so as not to interfere with performance. This serves several purposes: (1) assertions act as comments to the reader, telling you what the code expects at that point. All assertions will always be true (unless there really is a bug, of course). (2) leaving in the scaffolding code assists anyone who would like to modify the code, or understand the algorithm (by reading the debugging output, one can get a glimpse into what the code is doing). (3) (gasp!) for actually finding bugs. This code has been heavily tested and "should" be fully functional and bug-free ... but you never know... To enable debugging, comment out the "#define NDEBUG" above. For a Matlab mexFunction, you will also need to modify mexopts.sh to remove the -DNDEBUG definition. The code will become outrageously slow when debugging is enabled. To control the level of debugging output, set an environment variable D to 0 (little), 1 (some), 2, 3, or 4 (lots). When debugging, you should see the following message on the standard output: colamd: debug version, D = 1 (THIS WILL BE SLOW!) or a similar message for symamd. If you don't, then debugging has not been enabled. */ /* ========================================================================== */ /* === Include files ======================================================== */ /* ========================================================================== */ #include "colamd.h" #include #ifdef MATLAB_MEX_FILE #include "mex.h" #include "matrix.h" #else #include #include #endif /* MATLAB_MEX_FILE */ #ifdef FORTIFY # include "lp_fortify.h" #endif /* ========================================================================== */ /* === Definitions ========================================================== */ /* ========================================================================== */ /* Routines are either PUBLIC (user-callable) or PRIVATE (not user-callable) */ #define PUBLIC #define PRIVATE static #define MAX(a,b) (((a) > (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define ONES_COMPLEMENT(r) (-(r)-1) /* -------------------------------------------------------------------------- */ /* Change for version 2.1: define TRUE and FALSE only if not yet defined */ /* -------------------------------------------------------------------------- */ #ifndef TRUE #define TRUE (1) #endif #ifndef FALSE #define FALSE (0) #endif /* -------------------------------------------------------------------------- */ #define EMPTY (-1) /* Row and column status */ #define ALIVE (0) #define DEAD (-1) /* Column status */ #define DEAD_PRINCIPAL (-1) #define DEAD_NON_PRINCIPAL (-2) /* Macros for row and column status update and checking. */ #define ROW_IS_DEAD(r) ROW_IS_MARKED_DEAD (Row[r].shared2.mark) #define ROW_IS_MARKED_DEAD(row_mark) (row_mark < ALIVE) #define ROW_IS_ALIVE(r) (Row [r].shared2.mark >= ALIVE) #define COL_IS_DEAD(c) (Col [c].start < ALIVE) #define COL_IS_ALIVE(c) (Col [c].start >= ALIVE) #define COL_IS_DEAD_PRINCIPAL(c) (Col [c].start == DEAD_PRINCIPAL) #define KILL_ROW(r) { Row [r].shared2.mark = DEAD ; } #define KILL_PRINCIPAL_COL(c) { Col [c].start = DEAD_PRINCIPAL ; } #define KILL_NON_PRINCIPAL_COL(c) { Col [c].start = DEAD_NON_PRINCIPAL ; } /* ========================================================================== */ /* === Colamd reporting mechanism =========================================== */ /* ========================================================================== */ #ifdef MATLAB_MEX_FILE /* use mexPrintf in a Matlab mexFunction, for debugging and statistics output */ #define PRINTF mexPrintf /* In Matlab, matrices are 1-based to the user, but 0-based internally */ #define INDEX(i) ((i)+1) #else /* Use printf in standard C environment, for debugging and statistics output. */ /* Output is generated only if debugging is enabled at compile time, or if */ /* the caller explicitly calls colamd_report or symamd_report. */ #define PRINTF printf /* In C, matrices are 0-based and indices are reported as such in *_report */ #define INDEX(i) (i) #endif /* MATLAB_MEX_FILE */ /* ========================================================================== */ /* === Prototypes of PRIVATE routines ======================================= */ /* ========================================================================== */ PRIVATE int init_rows_cols ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [], int p [], int stats [COLAMD_STATS] ) ; PRIVATE void init_scoring ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [], int head [], double knobs [COLAMD_KNOBS], int *p_n_row2, int *p_n_col2, int *p_max_deg ) ; PRIVATE int find_ordering ( int n_row, int n_col, int Alen, Colamd_Row Row [], Colamd_Col Col [], int A [], int head [], int n_col2, int max_deg, int pfree ) ; PRIVATE void order_children ( int n_col, Colamd_Col Col [], int p [] ) ; PRIVATE void detect_super_cols ( #ifndef NDEBUG int n_col, Colamd_Row Row [], #endif /* NDEBUG */ Colamd_Col Col [], int A [], int head [], int row_start, int row_length ) ; PRIVATE int garbage_collection ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [], int *pfree ) ; PRIVATE int clear_mark ( int n_row, Colamd_Row Row [] ) ; PRIVATE void print_report ( char *method, int stats [COLAMD_STATS] ) ; /* ========================================================================== */ /* === Debugging prototypes and definitions ================================= */ /* ========================================================================== */ #ifndef NDEBUG /* colamd_debug is the *ONLY* global variable, and is only */ /* present when debugging */ PRIVATE int colamd_debug ; /* debug print level */ #define DEBUG0(params) { (void) PRINTF params ; } #define DEBUG1(params) { if (colamd_debug >= 1) (void) PRINTF params ; } #define DEBUG2(params) { if (colamd_debug >= 2) (void) PRINTF params ; } #define DEBUG3(params) { if (colamd_debug >= 3) (void) PRINTF params ; } #define DEBUG4(params) { if (colamd_debug >= 4) (void) PRINTF params ; } #ifdef MATLAB_MEX_FILE #define ASSERT(expression) (mxAssert ((expression), "")) #else #define ASSERT(expression) (assert (expression)) #endif /* MATLAB_MEX_FILE */ PRIVATE void colamd_get_debug /* gets the debug print level from getenv */ ( char *method ) ; PRIVATE void debug_deg_lists ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int head [], int min_score, int should, int max_deg ) ; PRIVATE void debug_mark ( int n_row, Colamd_Row Row [], int tag_mark, int max_mark ) ; PRIVATE void debug_matrix ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [] ) ; PRIVATE void debug_structures ( int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [], int n_col2 ) ; #else /* NDEBUG */ /* === No debugging ========================================================= */ #define DEBUG0(params) ; #define DEBUG1(params) ; #define DEBUG2(params) ; #define DEBUG3(params) ; #define DEBUG4(params) ; #define ASSERT(expression) ((void) 0) #endif /* NDEBUG */ /* ========================================================================== */ /* ========================================================================== */ /* === USER-CALLABLE ROUTINES: ============================================== */ /* ========================================================================== */ /* ========================================================================== */ /* === colamd_recommended =================================================== */ /* ========================================================================== */ /* The colamd_recommended routine returns the suggested size for Alen. This value has been determined to provide good balance between the number of garbage collections and the memory requirements for colamd. If any argument is negative, a -1 is returned as an error condition. This function is also available as a macro defined in colamd.h, so that you can use it for a statically-allocated array size. */ PUBLIC int colamd_recommended /* returns recommended value of Alen. */ ( /* === Parameters ======================================================= */ int nnz, /* number of nonzeros in A */ int n_row, /* number of rows in A */ int n_col /* number of columns in A */ ) { return (COLAMD_RECOMMENDED (nnz, n_row, n_col)) ; } /* ========================================================================== */ /* === colamd_set_defaults ================================================== */ /* ========================================================================== */ /* The colamd_set_defaults routine sets the default values of the user- controllable parameters for colamd: knobs [0] rows with knobs[0]*n_col entries or more are removed prior to ordering in colamd. Rows and columns with knobs[0]*n_col entries or more are removed prior to ordering in symamd and placed last in the output ordering. knobs [1] columns with knobs[1]*n_row entries or more are removed prior to ordering in colamd, and placed last in the column permutation. Symamd ignores this knob. knobs [2..19] unused, but future versions might use this */ PUBLIC void colamd_set_defaults ( /* === Parameters ======================================================= */ double knobs [COLAMD_KNOBS] /* knob array */ ) { /* === Local variables ================================================== */ int i ; if (!knobs) { return ; /* no knobs to initialize */ } for (i = 0 ; i < COLAMD_KNOBS ; i++) { knobs [i] = 0 ; } knobs [COLAMD_DENSE_ROW] = 0.5 ; /* ignore rows over 50% dense */ knobs [COLAMD_DENSE_COL] = 0.5 ; /* ignore columns over 50% dense */ } /* ========================================================================== */ /* === symamd =============================================================== */ /* ========================================================================== */ PUBLIC int symamd /* return TRUE if OK, FALSE otherwise */ ( /* === Parameters ======================================================= */ int n, /* number of rows and columns of A */ int A [], /* row indices of A */ int p [], /* column pointers of A */ int perm [], /* output permutation, size n+1 */ double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ int stats [COLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for Matlab mexFunction) */ void (*release) (void *) /* pointer to free (ANSI C) or */ /* mxFree (for Matlab mexFunction) */ ) { /* === Local variables ================================================== */ int *count ; /* length of each column of M, and col pointer*/ int *mark ; /* mark array for finding duplicate entries */ int *M ; /* row indices of matrix M */ int Mlen ; /* length of M */ int n_row ; /* number of rows in M */ int nnz ; /* number of entries in A */ int i ; /* row index of A */ int j ; /* column index of A */ int k ; /* row index of M */ int mnz ; /* number of nonzeros in M */ int pp ; /* index into a column of A */ int last_row ; /* last row seen in the current column */ int length ; /* number of nonzeros in a column */ double cknobs [COLAMD_KNOBS] ; /* knobs for colamd */ double default_knobs [COLAMD_KNOBS] ; /* default knobs for colamd */ int cstats [COLAMD_STATS] ; /* colamd stats */ #ifndef NDEBUG colamd_get_debug ("symamd") ; #endif /* NDEBUG */ /* === Check the input arguments ======================================== */ if (!stats) { DEBUG0 (("symamd: stats not present\n")) ; return (FALSE) ; } for (i = 0 ; i < COLAMD_STATS ; i++) { stats [i] = 0 ; } stats [COLAMD_STATUS] = COLAMD_OK ; stats [COLAMD_INFO1] = -1 ; stats [COLAMD_INFO2] = -1 ; if (!A) { stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; DEBUG0 (("symamd: A not present\n")) ; return (FALSE) ; } if (!p) /* p is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; DEBUG0 (("symamd: p not present\n")) ; return (FALSE) ; } if (n < 0) /* n must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; stats [COLAMD_INFO1] = n ; DEBUG0 (("symamd: n negative %d\n", n)) ; return (FALSE) ; } nnz = p [n] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; stats [COLAMD_INFO1] = nnz ; DEBUG0 (("symamd: number of entries negative %d\n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; stats [COLAMD_INFO1] = p [0] ; DEBUG0 (("symamd: p[0] not zero %d\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { colamd_set_defaults (default_knobs) ; knobs = default_knobs ; } /* === Allocate count and mark ========================================== */ count = (int *) ((*allocate) (n+1, sizeof (int))) ; if (!count) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; DEBUG0 (("symamd: allocate count (size %d) failed\n", n+1)) ; return (FALSE) ; } mark = (int *) ((*allocate) (n+1, sizeof (int))) ; if (!mark) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; DEBUG0 (("symamd: allocate mark (size %d) failed\n", n+1)) ; return (FALSE) ; } /* === Compute column counts of M, check if A is valid ================== */ stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { last_row = -1 ; length = p [j+1] - p [j] ; if (length < 0) { /* column pointers must be non-decreasing */ stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = length ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: col %d negative length %d\n", j, length)) ; return (FALSE) ; } for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; if (i < 0 || i >= n) { /* row index i, in column j, is out of bounds */ stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = i ; stats [COLAMD_INFO3] = n ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: row %d col %d out of bounds\n", i, j)) ; return (FALSE) ; } if (i <= last_row || mark [i] == j) { /* row index is unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; stats [COLAMD_INFO1] = j ; stats [COLAMD_INFO2] = i ; (stats [COLAMD_INFO3]) ++ ; DEBUG1 (("symamd: row %d col %d unsorted/duplicate\n", i, j)) ; } if (i > j && mark [i] != j) { /* row k of M will contain column indices i and j */ count [i]++ ; count [j]++ ; } /* mark the row as having been seen in this column */ mark [i] = j ; last_row = i ; } } if (stats [COLAMD_STATUS] == COLAMD_OK) { /* if there are no duplicate entries, then mark is no longer needed */ (*release) ((void *) mark) ; } /* === Compute column pointers of M ===================================== */ /* use output permutation, perm, for column pointers of M */ perm [0] = 0 ; for (j = 1 ; j <= n ; j++) { perm [j] = perm [j-1] + count [j-1] ; } for (j = 0 ; j < n ; j++) { count [j] = perm [j] ; } /* === Construct M ====================================================== */ mnz = perm [n] ; n_row = mnz / 2 ; Mlen = colamd_recommended (mnz, n_row, n) ; M = (int *) ((*allocate) (Mlen, sizeof (int))) ; DEBUG0 (("symamd: M is %d-by-%d with %d entries, Mlen = %d\n", n_row, n, mnz, Mlen)) ; if (!M) { stats [COLAMD_STATUS] = COLAMD_ERROR_out_of_memory ; (*release) ((void *) count) ; (*release) ((void *) mark) ; DEBUG0 (("symamd: allocate M (size %d) failed\n", Mlen)) ; return (FALSE) ; } k = 0 ; if (stats [COLAMD_STATUS] == COLAMD_OK) { /* Matrix is OK */ for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if (i > j) { /* row k of M contains column indices i and j */ M [count [i]++] = k ; M [count [j]++] = k ; k++ ; } } } } else { /* Matrix is jumbled. Do not add duplicates to M. Unsorted cols OK. */ DEBUG0 (("symamd: Duplicates in A.\n")) ; for (i = 0 ; i < n ; i++) { mark [i] = -1 ; } for (j = 0 ; j < n ; j++) { ASSERT (p [j+1] - p [j] >= 0) ; for (pp = p [j] ; pp < p [j+1] ; pp++) { i = A [pp] ; ASSERT (i >= 0 && i < n) ; if (i > j && mark [i] != j) { /* row k of M contains column indices i and j */ M [count [i]++] = k ; M [count [j]++] = k ; k++ ; mark [i] = j ; } } } (*release) ((void *) mark) ; } /* count and mark no longer needed */ (*release) ((void *) count) ; ASSERT (k == n_row) ; /* === Adjust the knobs for M =========================================== */ for (i = 0 ; i < COLAMD_KNOBS ; i++) { cknobs [i] = knobs [i] ; } /* there are no dense rows in M */ cknobs [COLAMD_DENSE_ROW] = 1.0 ; if (n_row != 0 && n < n_row) { /* On input, the knob is a fraction of 1..n, the number of rows of A. */ /* Convert it to a fraction of 1..n_row, of the number of rows of M. */ cknobs [COLAMD_DENSE_COL] = (knobs [COLAMD_DENSE_ROW] * n) / n_row ; } else { /* no dense columns in M */ cknobs [COLAMD_DENSE_COL] = 1.0 ; } DEBUG0 (("symamd: dense col knob for M: %g\n", cknobs [COLAMD_DENSE_COL])) ; /* === Order the columns of M =========================================== */ if (!colamd (n_row, n, Mlen, M, perm, cknobs, cstats)) { /* This "cannot" happen, unless there is a bug in the code. */ stats [COLAMD_STATUS] = COLAMD_ERROR_internal_error ; (*release) ((void *) M) ; DEBUG0 (("symamd: internal error!\n")) ; return (FALSE) ; } /* Note that the output permutation is now in perm */ /* === get the statistics for symamd from colamd ======================== */ /* note that a dense column in colamd means a dense row and col in symamd */ stats [COLAMD_DENSE_ROW] = cstats [COLAMD_DENSE_COL] ; stats [COLAMD_DENSE_COL] = cstats [COLAMD_DENSE_COL] ; stats [COLAMD_DEFRAG_COUNT] = cstats [COLAMD_DEFRAG_COUNT] ; /* === Free M =========================================================== */ (*release) ((void *) M) ; DEBUG0 (("symamd: done.\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === colamd =============================================================== */ /* ========================================================================== */ /* The colamd routine computes a column ordering Q of a sparse matrix A such that the LU factorization P(AQ) = LU remains sparse, where P is selected via partial pivoting. The routine can also be viewed as providing a permutation Q such that the Cholesky factorization (AQ)'(AQ) = LL' remains sparse. */ PUBLIC int colamd /* returns TRUE if successful, FALSE otherwise*/ ( /* === Parameters ======================================================= */ int n_row, /* number of rows in A */ int n_col, /* number of columns in A */ int Alen, /* length of A */ int A [], /* row indices of A */ int p [], /* pointers to columns in A */ double knobs [COLAMD_KNOBS],/* parameters (uses defaults if NULL) */ int stats [COLAMD_STATS] /* output statistics and error codes */ ) { /* === Local variables ================================================== */ int i ; /* loop index */ int nnz ; /* nonzeros in A */ int Row_size ; /* size of Row [], in integers */ int Col_size ; /* size of Col [], in integers */ int need ; /* minimum required length of A */ Colamd_Row *Row ; /* pointer into A of Row [0..n_row] array */ Colamd_Col *Col ; /* pointer into A of Col [0..n_col] array */ int n_col2 ; /* number of non-dense, non-empty columns */ int n_row2 ; /* number of non-dense, non-empty rows */ int ngarbage ; /* number of garbage collections performed */ int max_deg ; /* maximum row degree */ double default_knobs [COLAMD_KNOBS] ; /* default knobs array */ #ifndef NDEBUG colamd_get_debug ("colamd") ; #endif /* NDEBUG */ /* === Check the input arguments ======================================== */ if (!stats) { DEBUG0 (("colamd: stats not present\n")) ; return (FALSE) ; } for (i = 0 ; i < COLAMD_STATS ; i++) { stats [i] = 0 ; } stats [COLAMD_STATUS] = COLAMD_OK ; stats [COLAMD_INFO1] = -1 ; stats [COLAMD_INFO2] = -1 ; if (!A) /* A is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_A_not_present ; DEBUG0 (("colamd: A not present\n")) ; return (FALSE) ; } if (!p) /* p is not present */ { stats [COLAMD_STATUS] = COLAMD_ERROR_p_not_present ; DEBUG0 (("colamd: p not present\n")) ; return (FALSE) ; } if (n_row < 0) /* n_row must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nrow_negative ; stats [COLAMD_INFO1] = n_row ; DEBUG0 (("colamd: nrow negative %d\n", n_row)) ; return (FALSE) ; } if (n_col < 0) /* n_col must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_ncol_negative ; stats [COLAMD_INFO1] = n_col ; DEBUG0 (("colamd: ncol negative %d\n", n_col)) ; return (FALSE) ; } nnz = p [n_col] ; if (nnz < 0) /* nnz must be >= 0 */ { stats [COLAMD_STATUS] = COLAMD_ERROR_nnz_negative ; stats [COLAMD_INFO1] = nnz ; DEBUG0 (("colamd: number of entries negative %d\n", nnz)) ; return (FALSE) ; } if (p [0] != 0) { stats [COLAMD_STATUS] = COLAMD_ERROR_p0_nonzero ; stats [COLAMD_INFO1] = p [0] ; DEBUG0 (("colamd: p[0] not zero %d\n", p [0])) ; return (FALSE) ; } /* === If no knobs, set default knobs =================================== */ if (!knobs) { colamd_set_defaults (default_knobs) ; knobs = default_knobs ; } /* === Allocate the Row and Col arrays from array A ===================== */ Col_size = COLAMD_C (n_col) ; Row_size = COLAMD_R (n_row) ; need = 2*nnz + n_col + Col_size + Row_size ; if (need > Alen) { /* not enough space in array A to perform the ordering */ stats [COLAMD_STATUS] = COLAMD_ERROR_A_too_small ; stats [COLAMD_INFO1] = need ; stats [COLAMD_INFO2] = Alen ; DEBUG0 (("colamd: Need Alen >= %d, given only Alen = %d\n", need,Alen)); return (FALSE) ; } Alen -= Col_size + Row_size ; Col = (Colamd_Col *) &A [Alen] ; Row = (Colamd_Row *) &A [Alen + Col_size] ; /* === Construct the row and column data structures ===================== */ if (!init_rows_cols (n_row, n_col, Row, Col, A, p, stats)) { /* input matrix is invalid */ DEBUG0 (("colamd: Matrix invalid\n")) ; return (FALSE) ; } /* === Initialize scores, kill dense rows/columns ======================= */ init_scoring (n_row, n_col, Row, Col, A, p, knobs, &n_row2, &n_col2, &max_deg) ; /* === Order the supercolumns =========================================== */ ngarbage = find_ordering (n_row, n_col, Alen, Row, Col, A, p, n_col2, max_deg, 2*nnz) ; /* === Order the non-principal columns ================================== */ order_children (n_col, Col, p) ; /* === Return statistics in stats ======================================= */ stats [COLAMD_DENSE_ROW] = n_row - n_row2 ; stats [COLAMD_DENSE_COL] = n_col - n_col2 ; stats [COLAMD_DEFRAG_COUNT] = ngarbage ; DEBUG0 (("colamd: done.\n")) ; return (TRUE) ; } /* ========================================================================== */ /* === colamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void colamd_report ( int stats [COLAMD_STATS] ) { print_report ("colamd", stats) ; } /* ========================================================================== */ /* === symamd_report ======================================================== */ /* ========================================================================== */ PUBLIC void symamd_report ( int stats [COLAMD_STATS] ) { print_report ("symamd", stats) ; } /* ========================================================================== */ /* === NON-USER-CALLABLE ROUTINES: ========================================== */ /* ========================================================================== */ /* There are no user-callable routines beyond this point in the file */ /* ========================================================================== */ /* === init_rows_cols ======================================================= */ /* ========================================================================== */ /* Takes the column form of the matrix in A and creates the row form of the matrix. Also, row and column attributes are stored in the Col and Row structs. If the columns are un-sorted or contain duplicate row indices, this routine will also sort and remove duplicate row indices from the column form of the matrix. Returns FALSE if the matrix is invalid, TRUE otherwise. Not user-callable. */ PRIVATE int init_rows_cols /* returns TRUE if OK, or FALSE otherwise */ ( /* === Parameters ======================================================= */ int n_row, /* number of rows of A */ int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ int A [], /* row indices of A, of size Alen */ int p [], /* pointers to columns in A, of size n_col+1 */ int stats [COLAMD_STATS] /* colamd statistics */ ) { /* === Local variables ================================================== */ int col ; /* a column index */ int row ; /* a row index */ int *cp ; /* a column pointer */ int *cp_end ; /* a pointer to the end of a column */ int *rp ; /* a row pointer */ int *rp_end ; /* a pointer to the end of a row */ int last_row ; /* previous row */ /* === Initialize columns, and check column pointers ==================== */ for (col = 0 ; col < n_col ; col++) { Col [col].start = p [col] ; Col [col].length = p [col+1] - p [col] ; if (Col [col].length < 0) { /* column pointers must be non-decreasing */ stats [COLAMD_STATUS] = COLAMD_ERROR_col_length_negative ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = Col [col].length ; DEBUG0 (("colamd: col %d length %d < 0\n", col, Col [col].length)) ; return (FALSE) ; } Col [col].shared1.thickness = 1 ; Col [col].shared2.score = 0 ; Col [col].shared3.prev = EMPTY ; Col [col].shared4.degree_next = EMPTY ; } /* p [0..n_col] no longer needed, used as "head" in subsequent routines */ /* === Scan columns, compute row degrees, and check row indices ========= */ stats [COLAMD_INFO3] = 0 ; /* number of duplicate or unsorted row indices*/ for (row = 0 ; row < n_row ; row++) { Row [row].length = 0 ; Row [row].shared2.mark = -1 ; } for (col = 0 ; col < n_col ; col++) { last_row = -1 ; cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; /* make sure row indices within range */ if (row < 0 || row >= n_row) { stats [COLAMD_STATUS] = COLAMD_ERROR_row_index_out_of_bounds ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = row ; stats [COLAMD_INFO3] = n_row ; DEBUG0 (("colamd: row %d col %d out of bounds\n", row, col)) ; return (FALSE) ; } if (row <= last_row || Row [row].shared2.mark == col) { /* row index are unsorted or repeated (or both), thus col */ /* is jumbled. This is a notice, not an error condition. */ stats [COLAMD_STATUS] = COLAMD_OK_BUT_JUMBLED ; stats [COLAMD_INFO1] = col ; stats [COLAMD_INFO2] = row ; (stats [COLAMD_INFO3]) ++ ; DEBUG1 (("colamd: row %d col %d unsorted/duplicate\n",row,col)); } if (Row [row].shared2.mark != col) { Row [row].length++ ; } else { /* this is a repeated entry in the column, */ /* it will be removed */ Col [col].length-- ; } /* mark the row as having been seen in this column */ Row [row].shared2.mark = col ; last_row = row ; } } /* === Compute row pointers ============================================= */ /* row form of the matrix starts directly after the column */ /* form of matrix in A */ Row [0].start = p [n_col] ; Row [0].shared1.p = Row [0].start ; Row [0].shared2.mark = -1 ; for (row = 1 ; row < n_row ; row++) { Row [row].start = Row [row-1].start + Row [row-1].length ; Row [row].shared1.p = Row [row].start ; Row [row].shared2.mark = -1 ; } /* === Create row form ================================================== */ if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) { /* if cols jumbled, watch for repeated row indices */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { row = *cp++ ; if (Row [row].shared2.mark != col) { A [(Row [row].shared1.p)++] = col ; Row [row].shared2.mark = col ; } } } } else { /* if cols not jumbled, we don't need the mark (this is faster) */ for (col = 0 ; col < n_col ; col++) { cp = &A [p [col]] ; cp_end = &A [p [col+1]] ; while (cp < cp_end) { A [(Row [*cp++].shared1.p)++] = col ; } } } /* === Clear the row marks and set row degrees ========================== */ for (row = 0 ; row < n_row ; row++) { Row [row].shared2.mark = 0 ; Row [row].shared1.degree = Row [row].length ; } /* === See if we need to re-create columns ============================== */ if (stats [COLAMD_STATUS] == COLAMD_OK_BUT_JUMBLED) { DEBUG0 (("colamd: reconstructing column form, matrix jumbled\n")) ; #ifndef NDEBUG /* make sure column lengths are correct */ for (col = 0 ; col < n_col ; col++) { p [col] = Col [col].length ; } for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { p [*rp++]-- ; } } for (col = 0 ; col < n_col ; col++) { ASSERT (p [col] == 0) ; } /* now p is all zero (different than when debugging is turned off) */ #endif /* NDEBUG */ /* === Compute col pointers ========================================= */ /* col form of the matrix starts at A [0]. */ /* Note, we may have a gap between the col form and the row */ /* form if there were duplicate entries, if so, it will be */ /* removed upon the first garbage collection */ Col [0].start = 0 ; p [0] = Col [0].start ; for (col = 1 ; col < n_col ; col++) { /* note that the lengths here are for pruned columns, i.e. */ /* no duplicate row indices will exist for these columns */ Col [col].start = Col [col-1].start + Col [col-1].length ; p [col] = Col [col].start ; } /* === Re-create col form =========================================== */ for (row = 0 ; row < n_row ; row++) { rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { A [(p [*rp++])++] = row ; } } } /* === Done. Matrix is not (or no longer) jumbled ====================== */ return (TRUE) ; } /* ========================================================================== */ /* === init_scoring ========================================================= */ /* ========================================================================== */ /* Kills dense or empty columns and rows, calculates an initial score for each column, and places all columns in the degree lists. Not user-callable. */ PRIVATE void init_scoring ( /* === Parameters ======================================================= */ int n_row, /* number of rows of A */ int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ int A [], /* column form and row form of A */ int head [], /* of size n_col+1 */ double knobs [COLAMD_KNOBS],/* parameters */ int *p_n_row2, /* number of non-dense, non-empty rows */ int *p_n_col2, /* number of non-dense, non-empty columns */ int *p_max_deg /* maximum row degree */ ) { /* === Local variables ================================================== */ int c ; /* a column index */ int r, row ; /* a row index */ int *cp ; /* a column pointer */ int deg ; /* degree of a row or column */ int *cp_end ; /* a pointer to the end of a column */ int *new_cp ; /* new column pointer */ int col_length ; /* length of pruned column */ int score ; /* current column score */ int n_col2 ; /* number of non-dense, non-empty columns */ int n_row2 ; /* number of non-dense, non-empty rows */ int dense_row_count ; /* remove rows with more entries than this */ int dense_col_count ; /* remove cols with more entries than this */ int min_score ; /* smallest column score */ int max_deg ; /* maximum row degree */ int next_col ; /* Used to add to degree list.*/ #ifndef NDEBUG int debug_count ; /* debug only. */ #endif /* NDEBUG */ /* === Extract knobs ==================================================== */ dense_row_count = (int) MAX (0, MIN (knobs [COLAMD_DENSE_ROW] * n_col, n_col)) ; dense_col_count = (int) MAX (0, MIN (knobs [COLAMD_DENSE_COL] * n_row, n_row)) ; DEBUG1 (("colamd: densecount: %d %d\n", dense_row_count, dense_col_count)) ; max_deg = 0 ; n_col2 = n_col ; n_row2 = n_row ; /* === Kill empty columns =============================================== */ /* Put the empty columns at the end in their natural order, so that LU */ /* factorization can proceed as far as possible. */ for (c = n_col-1 ; c >= 0 ; c--) { deg = Col [c].length ; if (deg == 0) { /* this is a empty column, kill and order it last */ Col [c].shared2.order = --n_col2 ; KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("colamd: null columns killed: %d\n", n_col - n_col2)) ; /* === Kill dense columns =============================================== */ /* Put the dense columns at the end, in their natural order */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip any dead columns */ if (COL_IS_DEAD (c)) { continue ; } deg = Col [c].length ; if (deg > dense_col_count) { /* this is a dense column, kill and order it last */ Col [c].shared2.order = --n_col2 ; /* decrement the row degrees */ cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { Row [*cp++].shared1.degree-- ; } KILL_PRINCIPAL_COL (c) ; } } DEBUG1 (("colamd: Dense and null columns killed: %d\n", n_col - n_col2)) ; /* === Kill dense and empty rows ======================================== */ for (r = 0 ; r < n_row ; r++) { deg = Row [r].shared1.degree ; ASSERT (deg >= 0 && deg <= n_col) ; if (deg > dense_row_count || deg == 0) { /* kill a dense or empty row */ KILL_ROW (r) ; --n_row2 ; } else { /* keep track of max degree of remaining rows */ max_deg = MAX (max_deg, deg) ; } } DEBUG1 (("colamd: Dense and null rows killed: %d\n", n_row - n_row2)) ; /* === Compute initial column scores ==================================== */ /* At this point the row degrees are accurate. They reflect the number */ /* of "live" (non-dense) columns in each row. No empty rows exist. */ /* Some "live" columns may contain only dead rows, however. These are */ /* pruned in the code below. */ /* now find the initial matlab score for each column */ for (c = n_col-1 ; c >= 0 ; c--) { /* skip dead column */ if (COL_IS_DEAD (c)) { continue ; } score = 0 ; cp = &A [Col [c].start] ; new_cp = cp ; cp_end = cp + Col [c].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; /* skip if dead */ if (ROW_IS_DEAD (row)) { continue ; } /* compact the column */ *new_cp++ = row ; /* add row's external degree */ score += Row [row].shared1.degree - 1 ; /* guard against integer overflow */ score = MIN (score, n_col) ; } /* determine pruned column length */ col_length = (int) (new_cp - &A [Col [c].start]) ; if (col_length == 0) { /* a newly-made null column (all rows in this col are "dense" */ /* and have already been killed) */ DEBUG2 (("Newly null killed: %d\n", c)) ; Col [c].shared2.order = --n_col2 ; KILL_PRINCIPAL_COL (c) ; } else { /* set column length and set score */ ASSERT (score >= 0) ; ASSERT (score <= n_col) ; Col [c].length = col_length ; Col [c].shared2.score = score ; } } DEBUG1 (("colamd: Dense, null, and newly-null columns killed: %d\n", n_col-n_col2)) ; /* At this point, all empty rows and columns are dead. All live columns */ /* are "clean" (containing no dead rows) and simplicial (no supercolumns */ /* yet). Rows may contain dead columns, but all live rows contain at */ /* least one live column. */ #ifndef NDEBUG debug_structures (n_row, n_col, Row, Col, A, n_col2) ; #endif /* NDEBUG */ /* === Initialize degree lists ========================================== */ #ifndef NDEBUG debug_count = 0 ; #endif /* NDEBUG */ /* clear the hash buckets */ for (c = 0 ; c <= n_col ; c++) { head [c] = EMPTY ; } min_score = n_col ; /* place in reverse order, so low column indices are at the front */ /* of the lists. This is to encourage natural tie-breaking */ for (c = n_col-1 ; c >= 0 ; c--) { /* only add principal columns to degree lists */ if (COL_IS_ALIVE (c)) { DEBUG4 (("place %d score %d minscore %d ncol %d\n", c, Col [c].shared2.score, min_score, n_col)) ; /* === Add columns score to DList =============================== */ score = Col [c].shared2.score ; ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (score >= 0) ; ASSERT (score <= n_col) ; ASSERT (head [score] >= EMPTY) ; /* now add this column to dList at proper score location */ next_col = head [score] ; Col [c].shared3.prev = EMPTY ; Col [c].shared4.degree_next = next_col ; /* if there already was a column with the same score, set its */ /* previous pointer to this new column */ if (next_col != EMPTY) { Col [next_col].shared3.prev = c ; } head [score] = c ; /* see if this score is less than current min */ min_score = MIN (min_score, score) ; #ifndef NDEBUG debug_count++ ; #endif /* NDEBUG */ } } #ifndef NDEBUG DEBUG1 (("colamd: Live cols %d out of %d, non-princ: %d\n", debug_count, n_col, n_col-debug_count)) ; ASSERT (debug_count == n_col2) ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2, max_deg) ; #endif /* NDEBUG */ /* === Return number of remaining columns, and max row degree =========== */ *p_n_col2 = n_col2 ; *p_n_row2 = n_row2 ; *p_max_deg = max_deg ; } /* ========================================================================== */ /* === find_ordering ======================================================== */ /* ========================================================================== */ /* Order the principal columns of the supercolumn form of the matrix (no supercolumns on input). Uses a minimum approximate column minimum degree ordering method. Not user-callable. */ PRIVATE int find_ordering /* return the number of garbage collections */ ( /* === Parameters ======================================================= */ int n_row, /* number of rows of A */ int n_col, /* number of columns of A */ int Alen, /* size of A, 2*nnz + n_col or larger */ Colamd_Row Row [], /* of size n_row+1 */ Colamd_Col Col [], /* of size n_col+1 */ int A [], /* column form and row form of A */ int head [], /* of size n_col+1 */ int n_col2, /* Remaining columns to order */ int max_deg, /* Maximum row degree */ int pfree /* index of first free slot (2*nnz on entry) */ ) { /* === Local variables ================================================== */ int k ; /* current pivot ordering step */ int pivot_col ; /* current pivot column */ int *cp ; /* a column pointer */ int *rp ; /* a row pointer */ int pivot_row ; /* current pivot row */ int *new_cp ; /* modified column pointer */ int *new_rp ; /* modified row pointer */ int pivot_row_start ; /* pointer to start of pivot row */ int pivot_row_degree ; /* number of columns in pivot row */ int pivot_row_length ; /* number of supercolumns in pivot row */ int pivot_col_score ; /* score of pivot column */ int needed_memory ; /* free space needed for pivot row */ int *cp_end ; /* pointer to the end of a column */ int *rp_end ; /* pointer to the end of a row */ int row ; /* a row index */ int col ; /* a column index */ int max_score ; /* maximum possible score */ int cur_score ; /* score of current column */ unsigned int hash ; /* hash value for supernode detection */ int head_column ; /* head of hash bucket */ int first_col ; /* first column in hash bucket */ int tag_mark ; /* marker value for mark array */ int row_mark ; /* Row [row].shared2.mark */ int set_difference ; /* set difference size of row with pivot row */ int min_score ; /* smallest column score */ int col_thickness ; /* "thickness" (no. of columns in a supercol) */ int max_mark ; /* maximum value of tag_mark */ int pivot_col_thickness ; /* number of columns represented by pivot col */ int prev_col ; /* Used by Dlist operations. */ int next_col ; /* Used by Dlist operations. */ int ngarbage ; /* number of garbage collections performed */ #ifndef NDEBUG int debug_d ; /* debug loop counter */ int debug_step = 0 ; /* debug loop counter */ #endif /* NDEBUG */ /* === Initialization and clear mark ==================================== */ max_mark = INT_MAX - n_col ; /* INT_MAX defined in */ tag_mark = clear_mark (n_row, Row) ; min_score = 0 ; ngarbage = 0 ; DEBUG1 (("colamd: Ordering, n_col2=%d\n", n_col2)) ; /* === Order the columns ================================================ */ for (k = 0 ; k < n_col2 ; /* 'k' is incremented below */) { #ifndef NDEBUG if (debug_step % 100 == 0) { DEBUG2 (("\n... Step k: %d out of n_col2: %d\n", k, n_col2)) ; } else { DEBUG3 (("\n----------Step k: %d out of n_col2: %d\n", k, n_col2)) ; } debug_step++ ; debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k, max_deg) ; debug_matrix (n_row, n_col, Row, Col, A) ; #endif /* NDEBUG */ /* === Select pivot column, and order it ============================ */ /* make sure degree list isn't empty */ ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (head [min_score] >= EMPTY) ; #ifndef NDEBUG for (debug_d = 0 ; debug_d < min_score ; debug_d++) { ASSERT (head [debug_d] == EMPTY) ; } #endif /* NDEBUG */ /* get pivot column from head of minimum degree list */ while (head [min_score] == EMPTY && min_score < n_col) { min_score++ ; } pivot_col = head [min_score] ; ASSERT (pivot_col >= 0 && pivot_col <= n_col) ; next_col = Col [pivot_col].shared4.degree_next ; head [min_score] = next_col ; if (next_col != EMPTY) { Col [next_col].shared3.prev = EMPTY ; } ASSERT (COL_IS_ALIVE (pivot_col)) ; DEBUG3 (("Pivot col: %d\n", pivot_col)) ; /* remember score for defrag check */ pivot_col_score = Col [pivot_col].shared2.score ; /* the pivot column is the kth column in the pivot order */ Col [pivot_col].shared2.order = k ; /* increment order count by column thickness */ pivot_col_thickness = Col [pivot_col].shared1.thickness ; k += pivot_col_thickness ; ASSERT (pivot_col_thickness > 0) ; /* === Garbage_collection, if necessary ============================= */ needed_memory = MIN (pivot_col_score, n_col - k) ; if (pfree + needed_memory >= Alen) { pfree = garbage_collection (n_row, n_col, Row, Col, A, &A [pfree]) ; ngarbage++ ; /* after garbage collection we will have enough */ ASSERT (pfree + needed_memory < Alen) ; /* garbage collection has wiped out the Row[].shared2.mark array */ tag_mark = clear_mark (n_row, Row) ; #ifndef NDEBUG debug_matrix (n_row, n_col, Row, Col, A) ; #endif /* NDEBUG */ } /* === Compute pivot row pattern ==================================== */ /* get starting location for this new merged row */ pivot_row_start = pfree ; /* initialize new row counts to zero */ pivot_row_degree = 0 ; /* tag pivot column as having been visited so it isn't included */ /* in merged pivot row */ Col [pivot_col].shared1.thickness = -pivot_col_thickness ; /* pivot row is the union of all rows in the pivot column pattern */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; DEBUG4 (("Pivot col pattern %d %d\n", ROW_IS_ALIVE (row), row)) ; /* skip if row is dead */ if (ROW_IS_DEAD (row)) { continue ; } rp = &A [Row [row].start] ; rp_end = rp + Row [row].length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; /* add the column, if alive and untagged */ col_thickness = Col [col].shared1.thickness ; if (col_thickness > 0 && COL_IS_ALIVE (col)) { /* tag column in pivot row */ Col [col].shared1.thickness = -col_thickness ; ASSERT (pfree < Alen) ; /* place column in pivot row */ A [pfree++] = col ; pivot_row_degree += col_thickness ; } } } /* clear tag on pivot column */ Col [pivot_col].shared1.thickness = pivot_col_thickness ; max_deg = MAX (max_deg, pivot_row_degree) ; #ifndef NDEBUG DEBUG3 (("check2\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* NDEBUG */ /* === Kill all rows used to construct pivot row ==================== */ /* also kill pivot row, temporarily */ cp = &A [Col [pivot_col].start] ; cp_end = cp + Col [pivot_col].length ; while (cp < cp_end) { /* may be killing an already dead row */ row = *cp++ ; DEBUG3 (("Kill row in pivot col: %d\n", row)) ; KILL_ROW (row) ; } /* === Select a row index to use as the new pivot row =============== */ pivot_row_length = pfree - pivot_row_start ; if (pivot_row_length > 0) { /* pick the "pivot" row arbitrarily (first row in col) */ pivot_row = A [Col [pivot_col].start] ; DEBUG3 (("Pivotal row is %d\n", pivot_row)) ; } else { /* there is no pivot row, since it is of zero length */ pivot_row = EMPTY ; ASSERT (pivot_row_length == 0) ; } ASSERT (Col [pivot_col].length > 0 || pivot_row_length == 0) ; /* === Approximate degree computation =============================== */ /* Here begins the computation of the approximate degree. The column */ /* score is the sum of the pivot row "length", plus the size of the */ /* set differences of each row in the column minus the pattern of the */ /* pivot row itself. The column ("thickness") itself is also */ /* excluded from the column score (we thus use an approximate */ /* external degree). */ /* The time taken by the following code (compute set differences, and */ /* add them up) is proportional to the size of the data structure */ /* being scanned - that is, the sum of the sizes of each column in */ /* the pivot row. Thus, the amortized time to compute a column score */ /* is proportional to the size of that column (where size, in this */ /* context, is the column "length", or the number of row indices */ /* in that column). The number of row indices in a column is */ /* monotonically non-decreasing, from the length of the original */ /* column on input to colamd. */ /* === Compute set differences ====================================== */ DEBUG3 (("** Computing set differences phase. **\n")) ; /* pivot row is currently dead - it will be revived later. */ DEBUG3 (("Pivot row: ")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; DEBUG3 (("Col: %d\n", col)) ; /* clear tags used to construct pivot row pattern */ col_thickness = -Col [col].shared1.thickness ; ASSERT (col_thickness > 0) ; Col [col].shared1.thickness = col_thickness ; /* === Remove column from degree list =========================== */ cur_score = Col [col].shared2.score ; prev_col = Col [col].shared3.prev ; next_col = Col [col].shared4.degree_next ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (cur_score >= EMPTY) ; if (prev_col == EMPTY) { head [cur_score] = next_col ; } else { Col [prev_col].shared4.degree_next = next_col ; } if (next_col != EMPTY) { Col [next_col].shared3.prev = prev_col ; } /* === Scan the column ========================================== */ cp = &A [Col [col].start] ; cp_end = cp + Col [col].length ; while (cp < cp_end) { /* get a row */ row = *cp++ ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { continue ; } ASSERT (row != pivot_row) ; set_difference = row_mark - tag_mark ; /* check if the row has been seen yet */ if (set_difference < 0) { ASSERT (Row [row].shared1.degree <= max_deg) ; set_difference = Row [row].shared1.degree ; } /* subtract column thickness from this row's set difference */ set_difference -= col_thickness ; ASSERT (set_difference >= 0) ; /* absorb this row if the set difference becomes zero */ if (set_difference == 0) { DEBUG3 (("aggressive absorption. Row: %d\n", row)) ; KILL_ROW (row) ; } else { /* save the new mark */ Row [row].shared2.mark = set_difference + tag_mark ; } } } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k-pivot_row_degree, max_deg) ; #endif /* NDEBUG */ /* === Add up set differences for each column ======================= */ DEBUG3 (("** Adding set differences phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { /* get a column */ col = *rp++ ; ASSERT (COL_IS_ALIVE (col) && col != pivot_col) ; hash = 0 ; cur_score = 0 ; cp = &A [Col [col].start] ; /* compact the column */ new_cp = cp ; cp_end = cp + Col [col].length ; DEBUG4 (("Adding set diffs for Col: %d.\n", col)) ; while (cp < cp_end) { /* get a row */ row = *cp++ ; ASSERT(row >= 0 && row < n_row) ; row_mark = Row [row].shared2.mark ; /* skip if dead */ if (ROW_IS_MARKED_DEAD (row_mark)) { continue ; } ASSERT (row_mark > tag_mark) ; /* compact the column */ *new_cp++ = row ; /* compute hash function */ hash += row ; /* add set difference */ cur_score += row_mark - tag_mark ; /* integer overflow... */ cur_score = MIN (cur_score, n_col) ; } /* recompute the column's length */ Col [col].length = (int) (new_cp - &A [Col [col].start]) ; /* === Further mass elimination ================================= */ if (Col [col].length == 0) { DEBUG4 (("further mass elimination. Col: %d\n", col)) ; /* nothing left but the pivot row in this column */ KILL_PRINCIPAL_COL (col) ; pivot_row_degree -= Col [col].shared1.thickness ; ASSERT (pivot_row_degree >= 0) ; /* order it */ Col [col].shared2.order = k ; /* increment order count by column thickness */ k += Col [col].shared1.thickness ; } else { /* === Prepare for supercolumn detection ==================== */ DEBUG4 (("Preparing supercol detection for Col: %d.\n", col)) ; /* save score so far */ Col [col].shared2.score = cur_score ; /* add column to hash table, for supercolumn detection */ hash %= n_col + 1 ; DEBUG4 ((" Hash = %d, n_col = %d.\n", hash, n_col)) ; ASSERT (hash <= n_col) ; head_column = head [hash] ; if (head_column > EMPTY) { /* degree list "hash" is non-empty, use prev (shared3) of */ /* first column in degree list as head of hash bucket */ first_col = Col [head_column].shared3.headhash ; Col [head_column].shared3.headhash = col ; } else { /* degree list "hash" is empty, use head as hash bucket */ first_col = - (head_column + 2) ; head [hash] = - (col + 2) ; } Col [col].shared4.hash_next = first_col ; /* save hash function in Col [col].shared3.hash */ Col [col].shared3.hash = (int) hash ; ASSERT (COL_IS_ALIVE (col)) ; } } /* The approximate external column degree is now computed. */ /* === Supercolumn detection ======================================== */ DEBUG3 (("** Supercolumn detection phase. **\n")) ; detect_super_cols ( #ifndef NDEBUG n_col, Row, #endif /* NDEBUG */ Col, A, head, pivot_row_start, pivot_row_length) ; /* === Kill the pivotal column ====================================== */ KILL_PRINCIPAL_COL (pivot_col) ; /* === Clear mark =================================================== */ tag_mark += (max_deg + 1) ; if (tag_mark >= max_mark) { DEBUG2 (("clearing tag_mark\n")) ; tag_mark = clear_mark (n_row, Row) ; } #ifndef NDEBUG DEBUG3 (("check3\n")) ; debug_mark (n_row, Row, tag_mark, max_mark) ; #endif /* NDEBUG */ /* === Finalize the new pivot row, and column scores ================ */ DEBUG3 (("** Finalize scores phase. **\n")) ; /* for each column in pivot row */ rp = &A [pivot_row_start] ; /* compact the pivot row */ new_rp = rp ; rp_end = rp + pivot_row_length ; while (rp < rp_end) { col = *rp++ ; /* skip dead columns */ if (COL_IS_DEAD (col)) { continue ; } *new_rp++ = col ; /* add new pivot row to column */ A [Col [col].start + (Col [col].length++)] = pivot_row ; /* retrieve score so far and add on pivot row's degree. */ /* (we wait until here for this in case the pivot */ /* row's degree was reduced due to mass elimination). */ cur_score = Col [col].shared2.score + pivot_row_degree ; /* calculate the max possible score as the number of */ /* external columns minus the 'k' value minus the */ /* columns thickness */ max_score = n_col - k - Col [col].shared1.thickness ; /* make the score the external degree of the union-of-rows */ cur_score -= Col [col].shared1.thickness ; /* make sure score is less or equal than the max score */ cur_score = MIN (cur_score, max_score) ; ASSERT (cur_score >= 0) ; /* store updated score */ Col [col].shared2.score = cur_score ; /* === Place column back in degree list ========================= */ ASSERT (min_score >= 0) ; ASSERT (min_score <= n_col) ; ASSERT (cur_score >= 0) ; ASSERT (cur_score <= n_col) ; ASSERT (head [cur_score] >= EMPTY) ; next_col = head [cur_score] ; Col [col].shared4.degree_next = next_col ; Col [col].shared3.prev = EMPTY ; if (next_col != EMPTY) { Col [next_col].shared3.prev = col ; } head [cur_score] = col ; /* see if this score is less than current min */ min_score = MIN (min_score, cur_score) ; } #ifndef NDEBUG debug_deg_lists (n_row, n_col, Row, Col, head, min_score, n_col2-k, max_deg) ; #endif /* NDEBUG */ /* === Resurrect the new pivot row ================================== */ if (pivot_row_degree > 0) { /* update pivot row length to reflect any cols that were killed */ /* during super-col detection and mass elimination */ Row [pivot_row].start = pivot_row_start ; Row [pivot_row].length = (int) (new_rp - &A[pivot_row_start]) ; Row [pivot_row].shared1.degree = pivot_row_degree ; Row [pivot_row].shared2.mark = 0 ; /* pivot row is no longer dead */ } } /* === All principal columns have now been ordered ====================== */ return (ngarbage) ; } /* ========================================================================== */ /* === order_children ======================================================= */ /* ========================================================================== */ /* The find_ordering routine has ordered all of the principal columns (the representatives of the supercolumns). The non-principal columns have not yet been ordered. This routine orders those columns by walking up the parent tree (a column is a child of the column which absorbed it). The final permutation vector is then placed in p [0 ... n_col-1], with p [0] being the first column, and p [n_col-1] being the last. It doesn't look like it at first glance, but be assured that this routine takes time linear in the number of columns. Although not immediately obvious, the time taken by this routine is O (n_col), that is, linear in the number of columns. Not user-callable. */ PRIVATE void order_children ( /* === Parameters ======================================================= */ int n_col, /* number of columns of A */ Colamd_Col Col [], /* of size n_col+1 */ int p [] /* p [0 ... n_col-1] is the column permutation*/ ) { /* === Local variables ================================================== */ int i ; /* loop counter for all columns */ int c ; /* column index */ int parent ; /* index of column's parent */ int order ; /* column's order */ /* === Order each non-principal column ================================== */ for (i = 0 ; i < n_col ; i++) { /* find an un-ordered non-principal column */ ASSERT (COL_IS_DEAD (i)) ; if (!COL_IS_DEAD_PRINCIPAL (i) && Col [i].shared2.order == EMPTY) { parent = i ; /* once found, find its principal parent */ do { parent = Col [parent].shared1.parent ; } while (!COL_IS_DEAD_PRINCIPAL (parent)) ; /* now, order all un-ordered non-principal columns along path */ /* to this parent. collapse tree at the same time */ c = i ; /* get order of parent */ order = Col [parent].shared2.order ; do { ASSERT (Col [c].shared2.order == EMPTY) ; /* order this column */ Col [c].shared2.order = order++ ; /* collaps tree */ Col [c].shared1.parent = parent ; /* get immediate parent of this column */ c = Col [c].shared1.parent ; /* continue until we hit an ordered column. There are */ /* guarranteed not to be anymore unordered columns */ /* above an ordered column */ } while (Col [c].shared2.order == EMPTY) ; /* re-order the super_col parent to largest order for this group */ Col [parent].shared2.order = order ; } } /* === Generate the permutation ========================================= */ for (c = 0 ; c < n_col ; c++) { p [Col [c].shared2.order] = c ; } } /* ========================================================================== */ /* === detect_super_cols ==================================================== */ /* ========================================================================== */ /* Detects supercolumns by finding matches between columns in the hash buckets. Check amongst columns in the set A [row_start ... row_start + row_length-1]. The columns under consideration are currently *not* in the degree lists, and have already been placed in the hash buckets. The hash bucket for columns whose hash function is equal to h is stored as follows: if head [h] is >= 0, then head [h] contains a degree list, so: head [h] is the first column in degree bucket h. Col [head [h]].headhash gives the first column in hash bucket h. otherwise, the degree list is empty, and: -(head [h] + 2) is the first column in hash bucket h. For a column c in a hash bucket, Col [c].shared3.prev is NOT a "previous column" pointer. Col [c].shared3.hash is used instead as the hash number for that column. The value of Col [c].shared4.hash_next is the next column in the same hash bucket. Assuming no, or "few" hash collisions, the time taken by this routine is linear in the sum of the sizes (lengths) of each column whose score has just been computed in the approximate degree computation. Not user-callable. */ PRIVATE void detect_super_cols ( /* === Parameters ======================================================= */ #ifndef NDEBUG /* these two parameters are only needed when debugging is enabled: */ int n_col, /* number of columns of A */ Colamd_Row Row [], /* of size n_row+1 */ #endif /* NDEBUG */ Colamd_Col Col [], /* of size n_col+1 */ int A [], /* row indices of A */ int head [], /* head of degree lists and hash buckets */ int row_start, /* pointer to set of columns to check */ int row_length /* number of columns to check */ ) { /* === Local variables ================================================== */ int hash ; /* hash value for a column */ int *rp ; /* pointer to a row */ int c ; /* a column index */ int super_c ; /* column index of the column to absorb into */ int *cp1 ; /* column pointer for column super_c */ int *cp2 ; /* column pointer for column c */ int length ; /* length of column super_c */ int prev_c ; /* column preceding c in hash bucket */ int i ; /* loop counter */ int *rp_end ; /* pointer to the end of the row */ int col ; /* a column index in the row to check */ int head_column ; /* first column in hash bucket or degree list */ int first_col ; /* first column in hash bucket */ /* === Consider each column in the row ================================== */ rp = &A [row_start] ; rp_end = rp + row_length ; while (rp < rp_end) { col = *rp++ ; if (COL_IS_DEAD (col)) { continue ; } /* get hash number for this column */ hash = Col [col].shared3.hash ; ASSERT (hash <= n_col) ; /* === Get the first column in this hash bucket ===================== */ head_column = head [hash] ; if (head_column > EMPTY) { first_col = Col [head_column].shared3.headhash ; } else { first_col = - (head_column + 2) ; } /* === Consider each column in the hash bucket ====================== */ for (super_c = first_col ; super_c != EMPTY ; super_c = Col [super_c].shared4.hash_next) { ASSERT (COL_IS_ALIVE (super_c)) ; ASSERT (Col [super_c].shared3.hash == hash) ; length = Col [super_c].length ; /* prev_c is the column preceding column c in the hash bucket */ prev_c = super_c ; /* === Compare super_c with all columns after it ================ */ for (c = Col [super_c].shared4.hash_next ; c != EMPTY ; c = Col [c].shared4.hash_next) { ASSERT (c != super_c) ; ASSERT (COL_IS_ALIVE (c)) ; ASSERT (Col [c].shared3.hash == hash) ; /* not identical if lengths or scores are different */ if (Col [c].length != length || Col [c].shared2.score != Col [super_c].shared2.score) { prev_c = c ; continue ; } /* compare the two columns */ cp1 = &A [Col [super_c].start] ; cp2 = &A [Col [c].start] ; for (i = 0 ; i < length ; i++) { /* the columns are "clean" (no dead rows) */ ASSERT (ROW_IS_ALIVE (*cp1)) ; ASSERT (ROW_IS_ALIVE (*cp2)) ; /* row indices will same order for both supercols, */ /* no gather scatter nessasary */ if (*cp1++ != *cp2++) { break ; } } /* the two columns are different if the for-loop "broke" */ if (i != length) { prev_c = c ; continue ; } /* === Got it! two columns are identical =================== */ ASSERT (Col [c].shared2.score == Col [super_c].shared2.score) ; Col [super_c].shared1.thickness += Col [c].shared1.thickness ; Col [c].shared1.parent = super_c ; KILL_NON_PRINCIPAL_COL (c) ; /* order c later, in order_children() */ Col [c].shared2.order = EMPTY ; /* remove c from hash bucket */ Col [prev_c].shared4.hash_next = Col [c].shared4.hash_next ; } } /* === Empty this hash bucket ======================================= */ if (head_column > EMPTY) { /* corresponding degree list "hash" is not empty */ Col [head_column].shared3.headhash = EMPTY ; } else { /* corresponding degree list "hash" is empty */ head [hash] = EMPTY ; } } } /* ========================================================================== */ /* === garbage_collection =================================================== */ /* ========================================================================== */ /* Defragments and compacts columns and rows in the workspace A. Used when all avaliable memory has been used while performing row merging. Returns the index of the first free position in A, after garbage collection. The time taken by this routine is linear is the size of the array A, which is itself linear in the number of nonzeros in the input matrix. Not user-callable. */ PRIVATE int garbage_collection /* returns the new value of pfree */ ( /* === Parameters ======================================================= */ int n_row, /* number of rows */ int n_col, /* number of columns */ Colamd_Row Row [], /* row info */ Colamd_Col Col [], /* column info */ int A [], /* A [0 ... Alen-1] holds the matrix */ int *pfree /* &A [0] ... pfree is in use */ ) { /* === Local variables ================================================== */ int *psrc ; /* source pointer */ int *pdest ; /* destination pointer */ int j ; /* counter */ int r ; /* a row index */ int c ; /* a column index */ int length ; /* length of a row or column */ #ifndef NDEBUG int debug_rows ; DEBUG2 (("Defrag..\n")) ; for (psrc = &A[0] ; psrc < pfree ; psrc++) ASSERT (*psrc >= 0) ; debug_rows = 0 ; #endif /* NDEBUG */ /* === Defragment the columns =========================================== */ pdest = &A[0] ; for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { psrc = &A [Col [c].start] ; /* move and compact the column */ ASSERT (pdest <= psrc) ; Col [c].start = (int) (pdest - &A [0]) ; length = Col [c].length ; for (j = 0 ; j < length ; j++) { r = *psrc++ ; if (ROW_IS_ALIVE (r)) { *pdest++ = r ; } } Col [c].length = (int) (pdest - &A [Col [c].start]) ; } } /* === Prepare to defragment the rows =================================== */ for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { if (Row [r].length == 0) { /* this row is of zero length. cannot compact it, so kill it */ DEBUG3 (("Defrag row kill\n")) ; KILL_ROW (r) ; } else { /* save first column index in Row [r].shared2.first_column */ psrc = &A [Row [r].start] ; Row [r].shared2.first_column = *psrc ; ASSERT (ROW_IS_ALIVE (r)) ; /* flag the start of the row with the one's complement of row */ *psrc = ONES_COMPLEMENT (r) ; #ifndef NDEBUG debug_rows++ ; #endif /* NDEBUG */ } } } /* === Defragment the rows ============================================== */ psrc = pdest ; while (psrc < pfree) { /* find a negative number ... the start of a row */ if (*psrc++ < 0) { psrc-- ; /* get the row index */ r = ONES_COMPLEMENT (*psrc) ; ASSERT (r >= 0 && r < n_row) ; /* restore first column index */ *psrc = Row [r].shared2.first_column ; ASSERT (ROW_IS_ALIVE (r)) ; /* move and compact the row */ ASSERT (pdest <= psrc) ; Row [r].start = (int) (pdest - &A [0]) ; length = Row [r].length ; for (j = 0 ; j < length ; j++) { c = *psrc++ ; if (COL_IS_ALIVE (c)) { *pdest++ = c ; } } Row [r].length = (int) (pdest - &A [Row [r].start]) ; #ifndef NDEBUG debug_rows-- ; #endif /* NDEBUG */ } } /* ensure we found all the rows */ ASSERT (debug_rows == 0) ; /* === Return the new value of pfree ==================================== */ return ((int) (pdest - &A [0])) ; } /* ========================================================================== */ /* === clear_mark =========================================================== */ /* ========================================================================== */ /* Clears the Row [].shared2.mark array, and returns the new tag_mark. Return value is the new tag_mark. Not user-callable. */ PRIVATE int clear_mark /* return the new value for tag_mark */ ( /* === Parameters ======================================================= */ int n_row, /* number of rows in A */ Colamd_Row Row [] /* Row [0 ... n_row-1].shared2.mark is set to zero */ ) { /* === Local variables ================================================== */ int r ; for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { Row [r].shared2.mark = 0 ; } } return (1) ; } /* ========================================================================== */ /* === print_report ========================================================= */ /* ========================================================================== */ PRIVATE void print_report ( char *method, int stats [COLAMD_STATS] ) { int i1, i2, i3 ; if (!stats) { PRINTF ("%s: No statistics available.\n", method) ; return ; } i1 = stats [COLAMD_INFO1] ; i2 = stats [COLAMD_INFO2] ; i3 = stats [COLAMD_INFO3] ; if (stats [COLAMD_STATUS] >= 0) { PRINTF ("%s: OK. ", method) ; } else { PRINTF ("%s: ERROR. ", method) ; } switch (stats [COLAMD_STATUS]) { case COLAMD_OK_BUT_JUMBLED: PRINTF ("Matrix has unsorted or duplicate row indices.\n") ; PRINTF ("%s: number of duplicate or out-of-order row indices: %d\n", method, i3) ; PRINTF ("%s: last seen duplicate or out-of-order row index: %d\n", method, INDEX (i2)) ; PRINTF ("%s: last seen in column: %d", method, INDEX (i1)) ; /* no break - fall through to next case instead */ case COLAMD_OK: PRINTF ("\n") ; PRINTF ("%s: number of dense or empty rows ignored: %d\n", method, stats [COLAMD_DENSE_ROW]) ; PRINTF ("%s: number of dense or empty columns ignored: %d\n", method, stats [COLAMD_DENSE_COL]) ; PRINTF ("%s: number of garbage collections performed: %d\n", method, stats [COLAMD_DEFRAG_COUNT]) ; break ; case COLAMD_ERROR_A_not_present: PRINTF ("Array A (row indices of matrix) not present.\n") ; break ; case COLAMD_ERROR_p_not_present: PRINTF ("Array p (column pointers for matrix) not present.\n") ; break ; case COLAMD_ERROR_nrow_negative: PRINTF ("Invalid number of rows (%d).\n", i1) ; break ; case COLAMD_ERROR_ncol_negative: PRINTF ("Invalid number of columns (%d).\n", i1) ; break ; case COLAMD_ERROR_nnz_negative: PRINTF ("Invalid number of nonzero entries (%d).\n", i1) ; break ; case COLAMD_ERROR_p0_nonzero: PRINTF ("Invalid column pointer, p [0] = %d, must be zero.\n", i1) ; break ; case COLAMD_ERROR_A_too_small: PRINTF ("Array A too small.\n") ; PRINTF (" Need Alen >= %d, but given only Alen = %d.\n", i1, i2) ; break ; case COLAMD_ERROR_col_length_negative: PRINTF ("Column %d has a negative number of nonzero entries (%d).\n", INDEX (i1), i2) ; break ; case COLAMD_ERROR_row_index_out_of_bounds: PRINTF ("Row index (row %d) out of bounds (%d to %d) in column %d.\n", INDEX (i2), INDEX (0), INDEX (i3-1), INDEX (i1)) ; break ; case COLAMD_ERROR_out_of_memory: PRINTF ("Out of memory.\n") ; break ; case COLAMD_ERROR_internal_error: /* if this happens, there is a bug in the code */ PRINTF ("Internal error! Please contact authors (davis@cise.ufl.edu).\n") ; break ; } } /* ========================================================================== */ /* === colamd debugging routines ============================================ */ /* ========================================================================== */ /* When debugging is disabled, the remainder of this file is ignored. */ #ifndef NDEBUG /* ========================================================================== */ /* === debug_structures ===================================================== */ /* ========================================================================== */ /* At this point, all empty rows and columns are dead. All live columns are "clean" (containing no dead rows) and simplicial (no supercolumns yet). Rows may contain dead columns, but all live rows contain at least one live column. */ PRIVATE void debug_structures ( /* === Parameters ======================================================= */ int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [], int n_col2 ) { /* === Local variables ================================================== */ int i ; int c ; int *cp ; int *cp_end ; int len ; int score ; int r ; int *rp ; int *rp_end ; int deg ; /* === Check A, Row, and Col ============================================ */ for (c = 0 ; c < n_col ; c++) { if (COL_IS_ALIVE (c)) { len = Col [c].length ; score = Col [c].shared2.score ; DEBUG4 (("initial live col %5d %5d %5d\n", c, len, score)) ; ASSERT (len > 0) ; ASSERT (score >= 0) ; ASSERT (Col [c].shared1.thickness == 1) ; cp = &A [Col [c].start] ; cp_end = cp + len ; while (cp < cp_end) { r = *cp++ ; ASSERT (ROW_IS_ALIVE (r)) ; } } else { i = Col [c].shared2.order ; ASSERT (i >= n_col2 && i < n_col) ; } } for (r = 0 ; r < n_row ; r++) { if (ROW_IS_ALIVE (r)) { i = 0 ; len = Row [r].length ; deg = Row [r].shared1.degree ; ASSERT (len > 0) ; ASSERT (deg > 0) ; rp = &A [Row [r].start] ; rp_end = rp + len ; while (rp < rp_end) { c = *rp++ ; if (COL_IS_ALIVE (c)) { i++ ; } } ASSERT (i > 0) ; } } } /* ========================================================================== */ /* === debug_deg_lists ====================================================== */ /* ========================================================================== */ /* Prints the contents of the degree lists. Counts the number of columns in the degree list and compares it to the total it should have. Also checks the row degrees. */ PRIVATE void debug_deg_lists ( /* === Parameters ======================================================= */ int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int head [], int min_score, int should, int max_deg ) { /* === Local variables ================================================== */ int deg ; int col ; int have ; int row ; /* === Check the degree lists =========================================== */ if (n_col > 10000 && colamd_debug <= 0) { return ; } have = 0 ; DEBUG4 (("Degree lists: %d\n", min_score)) ; for (deg = 0 ; deg <= n_col ; deg++) { col = head [deg] ; if (col == EMPTY) { continue ; } DEBUG4 (("%d:", deg)) ; while (col != EMPTY) { DEBUG4 ((" %d", col)) ; have += Col [col].shared1.thickness ; ASSERT (COL_IS_ALIVE (col)) ; col = Col [col].shared4.degree_next ; } DEBUG4 (("\n")) ; } DEBUG4 (("should %d have %d\n", should, have)) ; ASSERT (should == have) ; /* === Check the row degrees ============================================ */ if (n_row > 10000 && colamd_debug <= 0) { return ; } for (row = 0 ; row < n_row ; row++) { if (ROW_IS_ALIVE (row)) { ASSERT (Row [row].shared1.degree <= max_deg) ; } } } /* ========================================================================== */ /* === debug_mark =========================================================== */ /* ========================================================================== */ /* Ensures that the tag_mark is less that the maximum and also ensures that each entry in the mark array is less than the tag mark. */ PRIVATE void debug_mark ( /* === Parameters ======================================================= */ int n_row, Colamd_Row Row [], int tag_mark, int max_mark ) { /* === Local variables ================================================== */ int r ; /* === Check the Row marks ============================================== */ ASSERT (tag_mark > 0 && tag_mark <= max_mark) ; if (n_row > 10000 && colamd_debug <= 0) { return ; } for (r = 0 ; r < n_row ; r++) { ASSERT (Row [r].shared2.mark < tag_mark) ; } } /* ========================================================================== */ /* === debug_matrix ========================================================= */ /* ========================================================================== */ /* Prints out the contents of the columns and the rows. */ PRIVATE void debug_matrix ( /* === Parameters ======================================================= */ int n_row, int n_col, Colamd_Row Row [], Colamd_Col Col [], int A [] ) { /* === Local variables ================================================== */ int r ; int c ; int *rp ; int *rp_end ; int *cp ; int *cp_end ; /* === Dump the rows and columns of the matrix ========================== */ if (colamd_debug < 3) { return ; } DEBUG3 (("DUMP MATRIX:\n")) ; for (r = 0 ; r < n_row ; r++) { DEBUG3 (("Row %d alive? %d\n", r, ROW_IS_ALIVE (r))) ; if (ROW_IS_DEAD (r)) { continue ; } DEBUG3 (("start %d length %d degree %d\n", Row [r].start, Row [r].length, Row [r].shared1.degree)) ; rp = &A [Row [r].start] ; rp_end = rp + Row [r].length ; while (rp < rp_end) { c = *rp++ ; DEBUG4 ((" %d col %d\n", COL_IS_ALIVE (c), c)) ; } } for (c = 0 ; c < n_col ; c++) { DEBUG3 (("Col %d alive? %d\n", c, COL_IS_ALIVE (c))) ; if (COL_IS_DEAD (c)) { continue ; } DEBUG3 (("start %d length %d shared1 %d shared2 %d\n", Col [c].start, Col [c].length, Col [c].shared1.thickness, Col [c].shared2.score)) ; cp = &A [Col [c].start] ; cp_end = cp + Col [c].length ; while (cp < cp_end) { r = *cp++ ; DEBUG4 ((" %d row %d\n", ROW_IS_ALIVE (r), r)) ; } } } PRIVATE void colamd_get_debug ( char *method ) { colamd_debug = 0 ; /* no debug printing */ /* get "D" environment variable, which gives the debug printing level */ if (getenv ("D")) { colamd_debug = atoi (getenv ("D")) ; } DEBUG0 (("%s: debug version, D = %d (THIS WILL BE SLOW!)\n", method, colamd_debug)) ; } #endif /* NDEBUG */ lp_solve_5.5/colamd/colamd.h100666 0 0 23122 11141443440 14422 0ustar usergroup/* ========================================================================== */ /* === colamd/symamd prototypes and definitions ============================= */ /* ========================================================================== */ /* You must include this file (colamd.h) in any routine that uses colamd, symamd, or the related macros and definitions. Authors: The authors of the code itself are Stefan I. Larimore and Timothy A. Davis (davis@cise.ufl.edu), University of Florida. The algorithm was developed in collaboration with John Gilbert, Xerox PARC, and Esmond Ng, Oak Ridge National Laboratory. Date: May 4, 2001. Version 2.1. Acknowledgements: This work was supported by the National Science Foundation, under grants DMS-9504974 and DMS-9803599. Notice: Copyright (c) 1998-2001 by the University of Florida. All Rights Reserved. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED OR IMPLIED. ANY USE IS AT YOUR OWN RISK. Permission is hereby granted to use or copy this program for any purpose, provided the above notices are retained on all copies. User documentation of any code that uses this code must cite the Authors, the Copyright, and "Used by permission." If this code is accessible from within Matlab, then typing "help colamd" and "help symamd" must cite the Authors. Permission to modify the code and to distribute modified code is granted, provided the above notices are retained, and a notice that the code was modified is included with the above copyright notice. You must also retain the Availability information below, of the original version. This software is provided free of charge. Availability: The colamd/symamd library is available at http://www.cise.ufl.edu/research/sparse/colamd This is the http://www.cise.ufl.edu/research/sparse/colamd/colamd.h file. It is required by the colamd.c, colamdmex.c, and symamdmex.c files, and by any C code that calls the routines whose prototypes are listed below, or that uses the colamd/symamd definitions listed below. */ #ifndef COLAMD_H #define COLAMD_H /* ========================================================================== */ /* === Include files ======================================================== */ /* ========================================================================== */ #include /* ========================================================================== */ /* === Knob and statistics definitions ====================================== */ /* ========================================================================== */ /* size of the knobs [ ] array. Only knobs [0..1] are currently used. */ #define COLAMD_KNOBS 20 /* number of output statistics. Only stats [0..6] are currently used. */ #define COLAMD_STATS 20 /* knobs [0] and stats [0]: dense row knob and output statistic. */ #define COLAMD_DENSE_ROW 0 /* knobs [1] and stats [1]: dense column knob and output statistic. */ #define COLAMD_DENSE_COL 1 /* stats [2]: memory defragmentation count output statistic */ #define COLAMD_DEFRAG_COUNT 2 /* stats [3]: colamd status: zero OK, > 0 warning or notice, < 0 error */ #define COLAMD_STATUS 3 /* stats [4..6]: error info, or info on jumbled columns */ #define COLAMD_INFO1 4 #define COLAMD_INFO2 5 #define COLAMD_INFO3 6 /* error codes returned in stats [3]: */ #define COLAMD_OK (0) #define COLAMD_OK_BUT_JUMBLED (1) #define COLAMD_ERROR_A_not_present (-1) #define COLAMD_ERROR_p_not_present (-2) #define COLAMD_ERROR_nrow_negative (-3) #define COLAMD_ERROR_ncol_negative (-4) #define COLAMD_ERROR_nnz_negative (-5) #define COLAMD_ERROR_p0_nonzero (-6) #define COLAMD_ERROR_A_too_small (-7) #define COLAMD_ERROR_col_length_negative (-8) #define COLAMD_ERROR_row_index_out_of_bounds (-9) #define COLAMD_ERROR_out_of_memory (-10) #define COLAMD_ERROR_internal_error (-999) /* ========================================================================== */ /* === Row and Column structures ============================================ */ /* ========================================================================== */ /* User code that makes use of the colamd/symamd routines need not directly */ /* reference these structures. They are used only for the COLAMD_RECOMMENDED */ /* macro. */ typedef struct Colamd_Col_struct { int start ; /* index for A of first row in this column, or DEAD */ /* if column is dead */ int length ; /* number of rows in this column */ union { int thickness ; /* number of original columns represented by this */ /* col, if the column is alive */ int parent ; /* parent in parent tree super-column structure, if */ /* the column is dead */ } shared1 ; union { int score ; /* the score used to maintain heap, if col is alive */ int order ; /* pivot ordering of this column, if col is dead */ } shared2 ; union { int headhash ; /* head of a hash bucket, if col is at the head of */ /* a degree list */ int hash ; /* hash value, if col is not in a degree list */ int prev ; /* previous column in degree list, if col is in a */ /* degree list (but not at the head of a degree list) */ } shared3 ; union { int degree_next ; /* next column, if col is in a degree list */ int hash_next ; /* next column, if col is in a hash list */ } shared4 ; } Colamd_Col ; typedef struct Colamd_Row_struct { int start ; /* index for A of first col in this row */ int length ; /* number of principal columns in this row */ union { int degree ; /* number of principal & non-principal columns in row */ int p ; /* used as a row pointer in init_rows_cols () */ } shared1 ; union { int mark ; /* for computing set differences and marking dead rows*/ int first_column ;/* first column in row (used in garbage collection) */ } shared2 ; } Colamd_Row ; /* ========================================================================== */ /* === Colamd recommended memory size ======================================= */ /* ========================================================================== */ /* The recommended length Alen of the array A passed to colamd is given by the COLAMD_RECOMMENDED (nnz, n_row, n_col) macro. It returns -1 if any argument is negative. 2*nnz space is required for the row and column indices of the matrix. COLAMD_C (n_col) + COLAMD_R (n_row) space is required for the Col and Row arrays, respectively, which are internal to colamd. An additional n_col space is the minimal amount of "elbow room", and nnz/5 more space is recommended for run time efficiency. This macro is not needed when using symamd. */ #define COLAMD_C(n_col) (((n_col) + 1) * sizeof (Colamd_Col) / sizeof (int)) #define COLAMD_R(n_row) (((n_row) + 1) * sizeof (Colamd_Row) / sizeof (int)) #define COLAMD_RECOMMENDED(nnz, n_row, n_col) \ ( \ ((nnz) < 0 || (n_row) < 0 || (n_col) < 0) \ ? \ (-1) \ : \ (int) (2 * (nnz) + COLAMD_C (n_col) + COLAMD_R (n_row) + (n_col) + ((nnz) / 5)) \ ) /* ========================================================================== */ /* === Prototypes of user-callable routines ================================= */ /* ========================================================================== */ /* #ifdef __cplusplus #define __EXTERN_C extern "C" #else #define __EXTERN_C #endif */ #ifndef __BORLANDC__ #ifdef __cplusplus #define __EXTERN_C extern "C" #else #define __EXTERN_C #endif #else /* Otherwise set up for the Borland compiler */ #define __EXTERN_C extern "C" #endif #ifdef __cplusplus __EXTERN_C { #endif int colamd_recommended /* returns recommended value of Alen, */ /* or (-1) if input arguments are erroneous */ ( int nnz, /* nonzeros in A */ int n_row, /* number of rows in A */ int n_col /* number of columns in A */ ) ; void colamd_set_defaults /* sets default parameters */ ( /* knobs argument is modified on output */ double knobs [COLAMD_KNOBS] /* parameter settings for colamd */ ) ; int colamd /* returns (1) if successful, (0) otherwise*/ ( /* A and p arguments are modified on output */ int n_row, /* number of rows in A */ int n_col, /* number of columns in A */ int Alen, /* size of the array A */ int A [], /* row indices of A, of size Alen */ int p [], /* column pointers of A, of size n_col+1 */ double knobs [COLAMD_KNOBS],/* parameter settings for colamd */ int stats [COLAMD_STATS] /* colamd output statistics and error codes */ ) ; int symamd /* return (1) if OK, (0) otherwise */ ( int n, /* number of rows and columns of A */ int A [], /* row indices of A */ int p [], /* column pointers of A */ int perm [], /* output permutation, size n_col+1 */ double knobs [COLAMD_KNOBS], /* parameters (uses defaults if NULL) */ int stats [COLAMD_STATS], /* output statistics and error codes */ void * (*allocate) (size_t, size_t), /* pointer to calloc (ANSI C) or */ /* mxCalloc (for Matlab mexFunction) */ void (*release) (void *) /* pointer to free (ANSI C) or */ /* mxFree (for Matlab mexFunction) */ ) ; void colamd_report ( int stats [COLAMD_STATS] ) ; void symamd_report ( int stats [COLAMD_STATS] ) ; #endif /* COLAMD_H */ #ifdef __cplusplus } #endif lp_solve_5.5/configure100666 0 0 303536 11236132302 13506 0ustar usergroup#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59 for lpsolve 5.5.0.15. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='lpsolve' PACKAGE_TARNAME='lpsolve' PACKAGE_VERSION='5.5.0.15' PACKAGE_STRING='lpsolve 5.5.0.15' PACKAGE_BUGREPORT='' ac_unique_file="lp_simplex.c" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os SO CCSHARED DEF SHARED_LIB CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures lpsolve 5.5.0.15 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of lpsolve 5.5.0.15:";; esac cat <<\_ACEOF Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF lpsolve configure 5.5.0.15 generated by GNU Autoconf 2.59 Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by lpsolve $as_me 5.5.0.15, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` SHARED_LIB=liblpsolve55.so SO=.so case $host_os in hp*|HP*) DEF=-ldld case `uname -m` in ia64) SO=.so;; *) SO=.sl;; esac if test "$GCC" = yes; then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; CYGWIN*) SO=.dll;; linux) CCSHARED="-fPIC";; apple-darwin) DEF=-ldl -idirafter /usr/include/sys -DINTEGERTIME -Wno-long-double ;; OpenUNIX*|UnixWare*) DEF='-dy -DNOLONGLONG' if test "$GCC" = "yes" then CCSHARED="-fPIC" else CCSHARED="-K PIC" fi;; SCO_SV*) DEF='-dy -DNOLONGLONG' if test "$GCC" = "yes" then CCSHARED="-fPIC" else CCSHARED="-Kpic -belf" fi;; *) esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$GCC" != "xyes" then echo "*** non GNU CC compiler detected." echo "*** This package has not been tested very well with non GNU compilers" fi # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' ac_config_files="$ac_config_files Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then we branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. cat >confdef2opt.sed <<\_ACEOF t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g t quote s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g t quote d : quote s,[ `~#$^&*(){}\\|;'"<>?],\\&,g s,\[,\\&,g s,\],\\&,g s,\$,$$,g p _ACEOF # We use echo to avoid assuming a particular line-breaking character. # The extra dot is to prevent the shell from consuming trailing # line-breaks from the sub-command output. A line-break within # single-quotes doesn't work because, if this script is created in a # platform that uses two characters for line-breaks (e.g., DOS), tr # would break. ac_LF_and_DOT=`echo; echo .` DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` rm -f confdef2opt.sed ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by lpsolve $as_me 5.5.0.15, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ lpsolve config.status 5.5.0.15 configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF # # CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h if test -n "\$CONFIG_FILES"; then # Protect against being on the right side of a sed subst in config.status. sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF s,@SHELL@,$SHELL,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t s,@exec_prefix@,$exec_prefix,;t t s,@prefix@,$prefix,;t t s,@program_transform_name@,$program_transform_name,;t t s,@bindir@,$bindir,;t t s,@sbindir@,$sbindir,;t t s,@libexecdir@,$libexecdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@libdir@,$libdir,;t t s,@includedir@,$includedir,;t t s,@oldincludedir@,$oldincludedir,;t t s,@infodir@,$infodir,;t t s,@mandir@,$mandir,;t t s,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@DEFS@,$DEFS,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@SO@,$SO,;t t s,@CCSHARED@,$CCSHARED,;t t s,@DEF@,$DEF,;t t s,@SHARED_LIB@,$SHARED_LIB,;t t s,@CC@,$CC,;t t s,@CFLAGS@,$CFLAGS,;t t s,@LDFLAGS@,$LDFLAGS,;t t s,@CPPFLAGS@,$CPPFLAGS,;t t s,@ac_ct_CC@,$ac_ct_CC,;t t s,@EXEEXT@,$EXEEXT,;t t s,@OBJEXT@,$OBJEXT,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_lines=48 ac_sed_frag=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_lines # Line after last line for current file. ac_more_lines=: ac_sed_cmds= while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag else sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag fi if test ! -s $tmp/subs.frag; then ac_more_lines=false else # The purpose of the label and of the branching condition is to # speed up the sed processing (if there are no `@' at all, there # is no need to browse any of the substitutions). # These are the two extra sed commands mentioned above. (echo ':t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" else ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" fi ac_sed_frag=`expr $ac_sed_frag + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_lines` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi fi # test -n "$CONFIG_FILES" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then configure_input= else configure_input="$ac_file. " fi configure_input=$configure_input"Generated from `echo $ac_file_in | sed 's,.*/,,'` by configure." # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@abs_srcdir@,$ac_abs_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t s,@builddir@,$ac_builddir,;t t s,@abs_builddir@,$ac_abs_builddir,;t t s,@top_builddir@,$ac_top_builddir,;t t s,@abs_top_builddir@,$ac_abs_top_builddir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out rm -f $tmp/stdin if test x"$ac_file" != x-; then mv $tmp/out $ac_file else cat $tmp/out rm -f $tmp/out fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi lp_solve_5.5/configure.ac100666 0 0 2067 11127454706 14041 0ustar usergroupAC_PREREQ(2.52) AC_INIT([lpsolve],5.5.0.14,[], []) AC_CONFIG_SRCDIR(lp_simplex.c) AC_CANONICAL_HOST SHARED_LIB=liblpsolve55.so SO=.so case $host_os in hp*|HP*) DEF=-ldld case `uname -m` in ia64) SO=.so;; *) SO=.sl;; esac if test "$GCC" = yes; then CCSHARED="-fPIC"; else CCSHARED="+z"; fi;; CYGWIN*) SO=.dll;; linux) CCSHARED="-fPIC";; apple-darwin) DEF=-ldl -idirafter /usr/include/sys -DINTEGERTIME -Wno-long-double ;; OpenUNIX*|UnixWare*) DEF='-dy -DNOLONGLONG' if test "$GCC" = "yes" then CCSHARED="-fPIC" else CCSHARED="-K PIC" fi;; SCO_SV*) DEF='-dy -DNOLONGLONG' if test "$GCC" = "yes" then CCSHARED="-fPIC" else CCSHARED="-Kpic -belf" fi;; *) esac AC_SUBST(SO) AC_SUBST(CCSHARED) AC_SUBST(DEF) AC_SUBST(SHARED_LIB) AC_PROG_CC if test "x$GCC" != "xyes" then echo "*** non GNU CC compiler detected." echo "*** This package has not been tested very well with non GNU compilers" fi AC_PROG_INSTALL AC_CONFIG_FILES([ \ Makefile \ ]) AC_OUTPUT lp_solve_5.5/declare.h100666 0 0 605 11141443440 13264 0ustar usergroup#ifndef __DECLARE_H__ #define __DECLARE_H__ #if !defined ANSI_PROTOTYPES # if defined MSDOS || defined __BORLANDC__ || defined __HIGHC__ || defined SCO_UNIX || defined AViiON # define ANSI_PROTOTYPES 1 # endif #endif #if ANSI_PROTOTYPES!=0 # define __OF(args) args #else # define __OF(args) () #endif #if defined __HIGHC__ # define VARARG ... #else # define VARARG #endif #endif lp_solve_5.5/demo/ 40777 0 0 0 11170643432 12367 5ustar usergrouplp_solve_5.5/demo/cbcc32.bat100777 0 0 1616 11137721060 14217 0ustar usergroup@echo off REM This batch file compiles the demo program with the Borland C++ 5.5 compiler for Windows set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c set c=bcc32 -w-8004 -w-8057 set PLATFORM=win32 if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -a8 -DWIN32 -DYY_NEVER_INTERACTIVE=1 -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c -ebin\%PLATFORM%\demo.exe %src% if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/demo/ccc100666 0 0 1373 10256611344 13144 0ustar usergroupsrc='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc math=-lm def= if [ "$PLATFORM" = "SCO_UNIX" ] then def='-dy -K PIC -DNOLONGLONG' dl=-lc else dl=-ldl fi opts='-O3' $c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c $src -o demo $math $dl lp_solve_5.5/demo/ccc.osx100666 0 0 1300 10252644500 13736 0ustar usergroupsrc='../bfp/lp_MDO.c ../commonlib.c ../myblas.c ../colamd/colamd.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_etaPFI/lp_etaPFI.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c demo.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc math=-lm def= if [ "$PLATFORM" = "SCO_UNIX" ] then def='-DLoadInverseLib=0 -DLoadLanguageLib=0 -D__HYPER=long' else dl=-ldl fi opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' $c -I.. -I../bfp -I../bfp/bfp_etaPFI -I../colamd $opts $def -DYY_NEVER_INTERACTIVE -DPARSER_LP $src -o demo $math $dl lp_solve_5.5/demo/cgcc.bat100777 0 0 2551 11137106102 14050 0ustar usergroup@echo off REM This batch file compiles the demo program with the gnu gcc compiler under DOS/Windows REM There are two ways to do that: use the lpsolve code directly or use that static library. set c=gcc REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% platform.c -o platform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% rem link lpsolve code with application set src=../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c rem statically link lpsolve library rem set src=../lpsolve55/bin/%PLATFORM%/liblpsolve55.a %c% -DINLINE=static -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -O3 -DBFP_CALLMODEL=__stdcall -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c %src% -o bin\%PLATFORM%\demo.exe if exist *.o del *.o set PLATFORM= lp_solve_5.5/demo/cvc6.bat100777 0 0 2555 11136663167 14040 0ustar usergroup@echo off REM This batch file compiles the demo program with the Microsoft Visual C/C++ compiler under Windows set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if "%PLATFORM%" == "win32" goto ok1 echo. echo This batch file is entended for 32 bit compilation with MS Visual C 6 echo For newer versions use cvc8*.bat goto done :ok1 if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O2 /Zp8 /Gd -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine demo.c %src% -o bin\%PLATFORM%\demo.exe if exist *.obj del *.obj :done set PLATFORM= lp_solve_5.5/demo/cvc8.bat100777 0 0 2353 11136663775 14043 0ustar usergroup@echo off REM This batch file compiles the demo program with the Microsoft Visual C/C++ compiler under Windows set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O2 /Zp8 /Gd -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE demo.c %src% /Febin\%PLATFORM%\demo.exe if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/demo/demo.c100666 0 0 15701 11170642062 13576 0ustar usergroup/* This program is originally made by by Jeroen J. Dirks (jeroend@tor.numetrix.com) Adapted by Peter Notebaert (lpsolve@peno.be) */ #include #include "lp_lib.h" #if defined FORTIFY #include "lp_fortify.h" int EndOfPgr(int i) { exit(i); } #endif void press_ret(void) { #if !defined NORETURN printf("[return]"); getchar(); #endif } int main(void) { # if defined ERROR # undef ERROR # endif # define ERROR() { fprintf(stderr, "Error\n"); exit(1); } lprec *lp; int majorversion, minorversion, release, build; #if defined FORTIFY Fortify_EnterScope(); #endif lp_solve_version(&majorversion, &minorversion, &release, &build); printf("lp_solve %d.%d.%d.%d demo\n\n", majorversion, minorversion, release, build); printf("This demo will show most of the features of lp_solve %d.%d.%d.%d\n", majorversion, minorversion, release, build); press_ret(); printf("\nWe start by creating a new problem with 4 variables and 0 constraints\n"); printf("We use: lp=make_lp(0,4);\n"); if ((lp = make_lp(0,4)) == NULL) ERROR(); press_ret(); printf("We can show the current problem with print_lp(lp)\n"); print_lp(lp); press_ret(); printf("Now we add some constraints\n"); printf("add_constraint(lp, {0, 3, 2, 2, 1}, LE, 4)\n"); { double row[] = {0, 3, 2, 2, 1}; if (!add_constraint(lp, row, LE, 4)) ERROR(); } print_lp(lp); press_ret(); printf("add_constraintex is now used to add a row. Only the npn-zero values must be specfied with this call.\n"); printf("add_constraintex(lp, 3, {4, 3, 1}, {2, 3, 4}, GE, 3)\n"); { int colno[] = {2, 3, 4}; double row[] = {4, 3, 1}; if (!add_constraintex(lp, sizeof(colno) / sizeof(*colno), row, colno, GE, 3)) ERROR(); } print_lp(lp); press_ret(); printf("Set the objective function\n"); printf("set_obj_fn(lp, {0, 2, 3, -2, 3})\n"); { double row[] = {0, 2, 3, -2, 3}; if (!set_obj_fn(lp, row)) ERROR(); } print_lp(lp); press_ret(); printf("Now solve the problem with printf(solve(lp));\n"); printf("%d",solve(lp)); press_ret(); printf("The value is 0, this means we found an optimal solution\n"); printf("We can display this solution with print_objective(lp) and print_solution(lp)\n"); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); printf("The dual variables of the solution are printed with\n"); printf("print_duals(lp);\n"); print_duals(lp); press_ret(); printf("We can change a single element in the matrix with\n"); printf("set_mat(lp,2,1,0.5)\n"); if (!set_mat(lp,2,1,0.5)) ERROR(); print_lp(lp); press_ret(); printf("If we want to maximize the objective function use set_maxim(lp);\n"); set_maxim(lp); print_lp(lp); press_ret(); printf("after solving this gives us:\n"); solve(lp); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); print_duals(lp); press_ret(); printf("Change the value of a rhs element with set_rh(lp,1,7.45)\n"); set_rh(lp,1,7.45); print_lp(lp); solve(lp); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); printf("We change %s to the integer type with\n", get_col_name(lp, 4)); printf("set_int(lp, 4, TRUE)\n"); set_int(lp, 4, TRUE); print_lp(lp); printf("We set branch & bound debugging on with set_debug(lp, TRUE)\n"); set_debug(lp, TRUE); printf("and solve...\n"); press_ret(); solve(lp); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); printf("We can set bounds on the variables with\n"); printf("set_lowbo(lp,2,2); & set_upbo(lp,4,5.3)\n"); set_lowbo(lp,2,2); set_upbo(lp,4,5.3); print_lp(lp); press_ret(); solve(lp); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); printf("Now remove a constraint with del_constraint(lp, 1)\n"); del_constraint(lp,1); print_lp(lp); printf("Add an equality constraint\n"); { double row[] = {0, 1, 2, 1, 4}; if (!add_constraint(lp, row, EQ, 8)) ERROR(); } print_lp(lp); press_ret(); printf("A column can be added with:\n"); printf("add_column(lp,{3, 2, 2});\n"); { double col[] = {3, 2, 2}; if (!add_column(lp, col)) ERROR(); } print_lp(lp); press_ret(); printf("A column can be removed with:\n"); printf("del_column(lp,3);\n"); del_column(lp,3); print_lp(lp); press_ret(); printf("We can use automatic scaling with:\n"); printf("set_scaling(lp, SCALE_MEAN);\n"); set_scaling(lp, SCALE_MEAN); print_lp(lp); press_ret(); printf("The function get_mat(lprec *lp, int row, int column) returns a single\n"); printf("matrix element\n"); printf("%s get_mat(lp,2,3), get_mat(lp,1,1); gives\n","printf(\"%f %f\\n\","); printf("%f %f\n", (double)get_mat(lp,2,3), (double)get_mat(lp,1,1)); printf("Notice that get_mat returns the value of the original unscaled problem\n"); press_ret(); printf("If there are any integer type variables, then only the rows are scaled\n"); printf("set_scaling(lp, SCALE_MEAN);\n"); set_scaling(lp, SCALE_MEAN); printf("set_int(lp,3,FALSE);\n"); set_int(lp,3,FALSE); print_lp(lp); press_ret(); solve(lp); printf("print_objective, print_solution gives the solution to the original problem\n"); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); printf("Scaling is turned off with unscale(lp);\n"); unscale(lp); print_lp(lp); press_ret(); printf("Now turn B&B debugging off and simplex tracing on with\n"); printf("set_debug(lp, FALSE), set_trace(lp, TRUE) and solve(lp)\n"); set_debug(lp, FALSE); set_trace(lp, TRUE); press_ret(); solve(lp); printf("Where possible, lp_solve will start at the last found basis\n"); printf("We can reset the problem to the initial basis with\n"); printf("default_basis(lp). Now solve it again...\n"); press_ret(); default_basis(lp); solve(lp); printf("It is possible to give variables and constraints names\n"); printf("set_row_name(lp,1,\"speed\"); & set_col_name(lp,2,\"money\")\n"); if (!set_row_name(lp,1,"speed")) ERROR(); if (!set_col_name(lp,2,"money")) ERROR(); print_lp(lp); printf("As you can see, all column and rows are assigned default names\n"); printf("If a column or constraint is deleted, the names shift place also:\n"); press_ret(); printf("del_column(lp,1);\n"); del_column(lp,1); print_lp(lp); press_ret(); write_lp(lp, "lp.lp"); delete_lp(lp); printf("An lp structure can be created and read from a .lp file\n"); printf("lp = read_lp(\"lp.lp\", TRUE);\n"); printf("The verbose option is used\n"); if ((lp = read_LP("lp.lp", TRUE, "test")) == NULL) ERROR(); press_ret(); printf("lp is now:\n"); print_lp(lp); press_ret(); printf("solution:\n"); set_debug(lp, TRUE); solve(lp); set_debug(lp, FALSE); print_objective(lp); print_solution(lp, 1); print_constraints(lp, 1); press_ret(); delete_lp(lp); #if defined FORTIFY Fortify_LeaveScope(); #endif return(0); } lp_solve_5.5/demo/demo.sln100666 0 0 2306 11130765423 14130 0ustar usergroupMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demo.vcproj", "{CED6B89F-02F2-4DB1-8610-4F12A6D02F54}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|Win32.ActiveCfg = Debug|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|Win32.Build.0 = Debug|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|x64.ActiveCfg = Debug|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|x64.Build.0 = Debug|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|Win32.ActiveCfg = Release|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|Win32.Build.0 = Release|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|x64.ActiveCfg = Release|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal lp_solve_5.5/demo/demo.vcproj100666 0 0 27216 11141356367 14673 0ustar usergroup lp_solve_5.5/demo/demolib.sln100666 0 0 2311 11141360155 14606 0ustar usergroupMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demolib.vcproj", "{CED6B89F-02F2-4DB1-8610-4F12A6D02F54}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|Win32.ActiveCfg = Debug|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|Win32.Build.0 = Debug|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|x64.ActiveCfg = Debug|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Debug|x64.Build.0 = Debug|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|Win32.ActiveCfg = Release|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|Win32.Build.0 = Release|Win32 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|x64.ActiveCfg = Release|x64 {CED6B89F-02F2-4DB1-8610-4F12A6D02F54}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal lp_solve_5.5/demo/demolib.vcproj100666 0 0 24161 11141360236 15344 0ustar usergroup lp_solve_5.5/demo/readme.txt100666 0 0 533 11141374614 14444 0ustar usergroupThis directory contains the files to build a demo program To build the program under Windows with the Visual C/C++ compiler, use cvc6.bat (also works for VS.NET) To build the program under DOS/Windows with the gcc compiler, use cgcc.bat To build the program under Linux/Unix, use sh ccc To build the program under Mac OS X 10.3.5, use sh ccc.osx lp_solve_5.5/fortify.c100666 0 0 171351 11164512462 13437 0ustar usergroup/* * FILE: * fortify.c * * DESCRIPTION: * A fortified shell for malloc, realloc, calloc, strdup, getcwd, tempnam * and free. * To use Fortify, each source file will need to #include "fortify.h". To * enable Fortify, define the symbol FORTIFY. If FORTIFY is not defined, it * will compile away to nothing. If you do not have stderr available, you may * wish to set an alternate output function. See _Fortify_SetOutputFunc(), * below. * You will also need to link in fortify.o * * None of the functions in this file should really be called * directly; they really should be called through the macros * defined in fortify.h * */ #if defined FORTIFY #include #include #include #include #if defined MSDOS || defined __BORLANDC__ || defined WIN32 || defined __HIGHC__ # include #endif extern int EndOfPgr(int); #define __FORTIFY_C__ /* So fortify.h knows to not define the fortify macros */ #include "fortify.h" #include "ufortify.h" /* the user's options */ char *_Fortify_file=NULL; int _Fortify_line=0; #ifndef FORTIFY_TRANSPARENT #include #include #include #include #if defined MSDOS || defined __BORLANDC__ || defined WIN32 || defined __HIGHC__ # if !defined WIN32 # undef MSDOS # define MSDOS # endif # include #else # include # include # define getch() getchar() #endif #if defined _WINDOWS # include "windows.h" # if !defined WIN32 # include "toolhelp.h" # endif #endif #if defined LONGNAME # include "longname.h" #endif #if !defined MIN # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif struct Header { char *File; /* The sourcefile of the caller */ unsigned short Line; /* The sourceline of the caller */ size_t Size; /* The size of the malloc'd block */ struct Header *Prev, /* List pointers */ *Next; int Checksum; /* For validating the Header structure; see ChecksumHeader() */ unsigned char Scope; }; #if defined AViiON || defined __GNUC__ || defined _MSC_VER # define _static static #else # define _static #endif _static char *address __OF((void *addr)); _static int TimeToCheck __OF((void)); _static int CheckBlock __OF((struct Header *h, char *file, unsigned long line)); _static int CheckPointer __OF((unsigned char *ptr, unsigned long size, char *file, unsigned long line)); _static int CheckFortification __OF((unsigned char *ptr, unsigned char value, size_t size)); _static void SetFortification __OF((unsigned char *ptr, unsigned char value, size_t size)); _static void OutputFortification __OF((unsigned char *ptr, unsigned char value, size_t size)); _static int IsHeaderValid __OF((struct Header *h)); _static void MakeHeaderValid __OF((struct Header *h)); _static int ChecksumHeader __OF((struct Header *h)); _static int IsOnList __OF((struct Header *h)); _static void OutputHeader __OF((struct Header *h)); _static void OutputMemory __OF((struct Header *h)); _static void st_DefaultOutput __OF((char *String)); _static void WaitIfstdOutput __OF((void)); static char stdOutput = 0; /* If true, did some stderr output */ static OutputFuncPtr st_Output = st_DefaultOutput; /* Output function for errors */ #if !defined MSDOS && !defined WIN32 static int strnicmp(s1,s2,maxlen) char *s1,*s2; size_t maxlen; { while ((maxlen) && (*s1) && (*s2) && (toupper(*s1)==toupper(*s2))) { maxlen--; s1++; s2++; } return((maxlen) ? toupper(*s1)-toupper(*s2) : 0); } static int stricmp(s1,s2) char *s1,*s2; { return(strnicmp(s1,s2,strlen(s1)+1)); } #endif static char *address(void *addr) { static char str[80]; #if defined KNOWS_POINTER_TYPE sprintf(str,"%p",addr); #else sprintf(str,"%lx",(unsigned long) addr); #endif return(str); } #ifdef FORTIFY_CheckInterval int TimeToCheck() { static time_t lastcheck=0L; time_t t; int ret = 0; time(&t); if ((lastcheck==0L) || (t-lastcheck>=FORTIFY_CheckInterval)) { lastcheck = t; ret = 1; } return(ret); } #endif static FILE *gfile=NULL; static int Nchars=0,Nlines=0; static char flag=0; static void _Fortify_NoOutput() { } static void st_DefaultOutput(char *String) { static FILE *file; static char first=1; if (first) { file=stderr; first=0; } if (stdOutput==0) { Nchars=Nlines=0; if (gfile!=NULL) rewind(gfile); } if (flag==0) { char *ptr; file=stderr; flag = 1; if ((ptr=getenv("FORTIFY_OUTPUT"))!=NULL) { if ((stricmp(ptr,"null")==0) || (stricmp(ptr,"nul")==0)) file=NULL; else if (stricmp(ptr,"stderr")==0) file=stderr; else if (stricmp(ptr,"stdout")==0) file=stdout; #if defined MSDOS && !defined _WINDOWS && !defined WIN32 else if (stricmp(ptr,"stdprn")==0) file=stdprn; #endif else if ((file=fopen(ptr,"w"))==NULL) { #if !defined _WINDOWS fprintf(stderr,"\r\nFortify: Unable to create logfile %s\r\n",ptr); EndOfPgr(4); #else { char str[255]; sprintf(str,"Unable to create logfile\n \"%s\"",ptr); MessageBox((HWND) NULL,(LPCSTR) str,(LPCSTR) "Fortify",(UINT) MB_ICONSTOP); #if 0 #if defined WIN32 /* TerminateProcess(GetCurrentProcess(),65535); */ ExitProcess(65535); #else TerminateApp((HTASK) NULL,(WORD) NO_UAE_BOX); #endif #else EndOfPgr(1); #endif } #endif } } if ((file!=NULL) && (file!=stderr) && (file!=stdout)) { time_t t; time(&t); fprintf(file,"Generated on: %s%s\n", ctime(&t), (file==stdout) || (file==stderr) ? "\r" : "" ); } } if (file!=NULL) { #if defined _WINDOWS if ((file==stdout) || (file==stderr)) { #if defined LINE_BY_LINE if (MessageBox((HWND) NULL,(LPCSTR) String,(LPCSTR) "Fortify",(UINT) MB_OKCANCEL /* |MB_ICONINFORMATION */)==IDCANCEL) #if 0 #if defined WIN32 /* TerminateProcess(GetCurrentProcess(),65535); */ ExitProcess(65535); #else TerminateApp((HTASK) NULL,(WORD) NO_UAE_BOX); #endif #else EndOfPgr(1); #endif #else { char *ptr; ptr="fortify.tmp"; if ((ptr==NULL) || ((file=gfile=fopen(ptr,"w+"))==NULL)) { char str[255]; sprintf(str,"Unable to create temporary file\n \"%s\"",(ptr==NULL) ? "(NULL)" : ptr); MessageBox((HWND) NULL,(LPCSTR) str,(LPCSTR) "Fortify",(UINT) MB_ICONSTOP); #if 0 #if defined WIN32 /* TerminateProcess(GetCurrentProcess(),65535); */ ExitProcess(65535); #else TerminateApp((HTASK) NULL,(WORD) NO_UAE_BOX); #endif #else EndOfPgr(1); #endif } } #endif } if ((file!=stdout) && (file!=stderr)) #endif { int i,ch=-1; for (i=0;(String[i]) && (Nlines<30);i++) if (String[i]=='\n') Nlines++; if ((String[i]) && (String[i+1])) { ch=String[i+1]; String[i+1]=0; } if ((file==stdout) || (file==stderr)) { char *ptr=String; int i; do { for (i=0;(ptr[i]) && (ptr[i]!='\r') && (ptr[i]!='\n');i++); Nchars+=fprintf(file,"%-*.*s%s", i,i, ptr, (ptr[i]) ? "\r\n" : "" ); ptr+=i; if (ptr[0]=='\r') ptr++; if (ptr[0]=='\n') ptr++; } while (*ptr); } else Nchars+=fprintf(file,String); if (ch>=0) String[i+1]=(char)ch; if (Nlines>=30) { WaitIfstdOutput(); Nchars=Nlines=0; stdOutput = 0; if ((String[i]) && (String[i+1])) { if ((file==stderr) || (file==stdout) || ((gfile!=NULL) && (Nchars))) stdOutput = 1; st_DefaultOutput(String+i); } } } if ((file==stderr) || (file==stdout) || ((gfile!=NULL) && (Nchars))) stdOutput = 1; } } static void WaitIfstdOutput() { #if !defined _WINDOWS if((stdOutput) && (st_Output != (OutputFuncPtr) _Fortify_NoOutput)) { #ifdef FORTIFY_WAIT_FOR_KEY static signed char wait_on_key=-1; if(wait_on_key<0) { char *ptr; if (((ptr=getenv("FORTIFY_WAIT_FOR_KEY"))!=NULL) && (tolower(*ptr)=='n')) wait_on_key = 0; else wait_on_key = 1; } if(wait_on_key) { char c; #if !defined MSDOS && !defined WIN32 struct termio tio,tiobak; char flag; if ((flag=ioctl(0,TCGETA,&tio))==0) /* handle 0 is stdin */ { tiobak=tio; tio.c_lflag&=~ICANON; tio.c_lflag&=~ECHO; tio.c_cc[VMIN]=1; ioctl(0,TCSETA,&tio); } #endif /* !MSDOS */ c = (char)getch(); #if !defined MSDOS && !defined WIN32 if (flag==0) ioctl(0,TCSETA,&tiobak); #endif /* !MSDOS */ if ((c == 3) || (c == 0x1b)) EndOfPgr(3); } #endif /* FORTIFY_WAIT_FOR_KEY */ } #else # if !defined LINE_BY_LINE if ((stdOutput) && (gfile!=NULL) && (Nchars)) { char *ptr; ptr=(char *) malloc(Nchars+1); if (ptr!=NULL) { int n=0,l=0; rewind(gfile); while ((n 0) { if(rand() % 100 < st_MallocFailRate) { #ifdef WARN_ON_FALSE_FAIL sprintf(st_Buffer, "\nFortify: %s.%ld\n malloc(%ld) \"false\" failed\n", file, line, (unsigned long)size); st_Output(st_Buffer); #endif FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } } /* * malloc the memory, including the space for the header and fortification * buffers */ #ifdef WARN_ON_SIZE_T_OVERFLOW { size_t private_size = sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size + FORTIFY_AFTER_SIZE; if(private_size < size) /* Check to see if the added baggage is larger than size_t */ { sprintf(st_Buffer, "\nFortify: %s.%ld\n malloc(%ld) has overflowed size_t.\n", file, line, (unsigned long)size); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } } #endif ptr = (unsigned char *) malloc(sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size + FORTIFY_AFTER_SIZE); if(!ptr) { #ifdef WARN_ON_MALLOC_FAIL sprintf(st_Buffer, "\nFortify: %s.%ld\n malloc(%ld) failed\n", file, line, (unsigned long)size); st_Output(st_Buffer); #endif FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } /* * Initialize and validate the header */ h = (struct Header *)ptr; h->Size = size; h->File = file; h->Line = (unsigned short) line; h->Next = st_Head; h->Prev = 0; h->Scope = st_Scope; if(st_Head) { st_Head->Prev = h; MakeHeaderValid(st_Head); } st_Head = h; MakeHeaderValid(h); /* * Initialize the fortifications */ SetFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE); SetFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE); #ifdef FILL_ON_MALLOC /* * Fill the actual user memory */ SetFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, FILL_ON_MALLOC_VALUE, size); #endif /* * We return the address of the user's memory, not the start of the block, * which points to our magic cookies */ FORTIFY_UNLOCK(); WaitIfstdOutput(); return((void *) (ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE)); } /* * _Fortify_free() - This free must be used for all memory allocated with * _Fortify_malloc(). * * Features: * + Pointers are validated before attempting a free - the pointer * must point to a valid malloc'd bit of memory. * + Detects attempts at freeing the same block of memory twice * + Can clear out memory as it is free'd, to prevent code from using * the memory after it's been freed. * + Checks the sentinals of the memory being freed. * + Can check the sentinals of all memory. */ void FORTIFY_STORAGE _Fortify_free(void *uptr,char *file,unsigned long line) { unsigned char *ptr; struct Header *h; if(uptr == NULL) return; ptr = (unsigned char *)uptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE; h = (struct Header *)ptr; stdOutput = 0; FORTIFY_LOCK(); if(st_Disabled) { free(uptr); FORTIFY_UNLOCK(); WaitIfstdOutput(); return; } #ifdef CHECK_ALL_MEMORY_ON_FREE #ifdef FORTIFY_CheckInterval if (TimeToCheck()) #endif _Fortify_CheckAllMemory(file, line); #endif #ifdef PARANOID_FREE if(!IsOnList(h)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Invalid pointer, corrupted header, or possible free twice\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); goto fail; } #endif if(!CheckBlock(h, file, line)) goto fail; /* * Remove the block from the list */ if(h->Prev) { if(!CheckBlock(h->Prev, file, line)) goto fail; h->Prev->Next = h->Next; MakeHeaderValid(h->Prev); } else st_Head = h->Next; if(h->Next) { if(!CheckBlock(h->Next, file, line)) goto fail; h->Next->Prev = h->Prev; MakeHeaderValid(h->Next); } #ifdef FILL_ON_FREE /* * Nuke out all memory that is about to be freed */ SetFortification(ptr, FILL_ON_FREE_VALUE, sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size + FORTIFY_AFTER_SIZE); #endif /* * And do the actual free */ free(ptr); FORTIFY_UNLOCK(); WaitIfstdOutput(); return; fail: sprintf(st_Buffer, " free(%s) failed\n", address(uptr)); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); } /* * _Fortify_realloc() - Uses _Fortify_malloc() and _Fortify_free() to implement * realloc(). * * Features: * + The realloc'd block is ALWAYS moved. * + The pointer passed to realloc() is verified in the same way that * _Fortify_free() verifies pointers before it frees them. * + All the _Fortify_malloc() and _Fortify_free() protection */ void *FORTIFY_STORAGE _Fortify_realloc(void *ptr,size_t new_size,char *file,unsigned long line) { void *new_ptr; struct Header *h; if(new_size == 0) { _Fortify_free(ptr,file,line); return(NULL); } h = (struct Header *)((unsigned char *)ptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE); stdOutput = 0; if(st_Disabled) { FORTIFY_LOCK(); new_ptr = (void *) realloc(ptr, new_size); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(new_ptr); } if(!ptr) { void *FORTIFY_STORAGE ret = _Fortify_malloc(new_size, file, line); WaitIfstdOutput(); return(ret); } FORTIFY_LOCK(); if(!IsOnList(h)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Invalid pointer or corrupted header passed to realloc\n", file, line); st_Output(st_Buffer); goto fail; } if(!CheckBlock(h, file, line)) goto fail; new_ptr = _Fortify_malloc(new_size, file, line); if(!new_ptr) { FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } if(h->Size < new_size) memcpy(new_ptr, ptr, h->Size); else memcpy(new_ptr, ptr, new_size); _Fortify_free(ptr, file, line); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(new_ptr); fail: sprintf(st_Buffer, " realloc(%s, %ld) failed\n", address(ptr), (unsigned long)new_size); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } /* * __Fortify_CheckPointer() - Returns true if the uptr points to a valid * piece of _Fortify_malloc()'d memory. The memory must be on the malloc'd * list, and it's sentinals must be in tact. * If anything is wrong, an error message is issued. * * (Note - if fortify is disabled, this function always returns true). */ static int FORTIFY_STORAGE __Fortify_CheckPointer(void *uptr,char OnlyStart,unsigned long size,char *file,unsigned long line) { unsigned char *ptr = (unsigned char *)uptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE; int r = 1, StartPointer; stdOutput = 0; if(st_Disabled) { WaitIfstdOutput(); return(1); } FORTIFY_LOCK(); StartPointer = IsOnList((struct Header *)ptr); if((OnlyStart) && (!StartPointer)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Invalid pointer or corrupted header detected (%s)\n", file, line, address(uptr)); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } if((OnlyStart) || (StartPointer)) r = CheckBlock((struct Header *)ptr, file, line); if(!OnlyStart) r = CheckPointer((unsigned char *)uptr, size, file, line); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(r); } int FORTIFY_STORAGE _Fortify_CheckPointer(void *uptr,char *file,unsigned long line) { return(__Fortify_CheckPointer(uptr,1,0,file,line)); } /* * Fortify_SetOutputFunc(OutputFuncPtr Output) - Sets the function used to * output all error and diagnostic messages by fortify. The output function * takes a single unsigned char * argument, and must be able to handle newlines. * The function returns the old pointer. */ Fortify_OutputFuncPtr FORTIFY_STORAGE _Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output) { OutputFuncPtr Old = st_Output; st_Output = (OutputFuncPtr) Output; return((Fortify_OutputFuncPtr FORTIFY_STORAGE) Old); } /* * _Fortify_SetMallocFailRate(int Percent) - _Fortify_malloc() will make the * malloc attempt fail this Percent of the time, even if the memory is * available. Useful to "stress-test" an application. Returns the old * value. The fail rate defaults to 0. */ int FORTIFY_STORAGE _Fortify_SetMallocFailRate(int Percent) { int Old = st_MallocFailRate; st_MallocFailRate = Percent; return(Old); } /* * _Fortify_CheckAllMemory() - Checks the sentinals of all malloc'd memory. * Returns the number of blocks that failed. * * (If Fortify is disabled, this function always returns 0). */ int FORTIFY_STORAGE _Fortify_CheckAllMemory(char *file,unsigned long line) { struct Header *curr = st_Head; int count = 0; stdOutput = 0; if(st_Disabled) { WaitIfstdOutput(); return(0); } FORTIFY_LOCK(); while(curr) { if(!CheckBlock(curr, file, line)) count++; curr = curr->Next; } if(file) { st_LastVerifiedFile = file; st_LastVerifiedLine = (short) line; } FORTIFY_UNLOCK(); WaitIfstdOutput(); return(count); } /* _Fortify_EnterScope - enters a new Fortify scope level. * returns the new scope level. */ int FORTIFY_STORAGE _Fortify_EnterScope(char *file,unsigned long line) { return((int) ++st_Scope); } /* _Fortify_LeaveScope - leaves a Fortify scope level, * also prints a memory dump of all non-freed memory that was allocated * during the scope being exited. */ int FORTIFY_STORAGE _Fortify_LeaveScope(char *file,unsigned long line) { struct Header *curr = st_Head; int count = 0; size_t size = 0; stdOutput = 0; if(st_Disabled) { WaitIfstdOutput(); return(0); } FORTIFY_LOCK(); st_Scope--; while(curr) { if(curr->Scope > st_Scope) { if(count == 0) { sprintf(st_Buffer, "\nFortify: Memory Dump at %s.%ld\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); } OutputHeader(curr); count++; size += curr->Size; } curr = curr->Next; } if(count) { sprintf(st_Buffer, "%11s %8ld bytes overhead\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); WaitIfstdOutput(); return(count); } /* * _Fortify_OutputAllMemory() - Outputs the entire list of currently * malloc'd memory. For each malloc'd block is output it's Address, * Size, and the SourceFile and Line that allocated it. * * If there is no memory on the list, this function outputs nothing. * * It returns the number of blocks on the list, unless fortify has been * disabled, in which case it always returns 0. */ int FORTIFY_STORAGE _Fortify_OutputAllMemory(char *file,unsigned long line) { struct Header *curr = st_Head; int count = 0; size_t size = 0; stdOutput = 0; if(st_Disabled) { WaitIfstdOutput(); return(0); } FORTIFY_LOCK(); if(curr) { sprintf(st_Buffer, "\nFortify: Memory Dump at %s.%ld\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); while(curr) { OutputHeader(curr); count++; size += curr->Size; curr = curr->Next; } sprintf(st_Buffer, "%11s %8ld bytes overhead\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); WaitIfstdOutput(); return(count); } /* _Fortify_DumpAllMemory(Scope) - Outputs the entire list of currently * new'd memory within the specified scope. For each new'd block is output * it's Address, Size, the SourceFile and Line that allocated it, a hex dump * of the contents of the memory and an ascii dump of printable characters. * * If there is no memory on the list, this function outputs nothing. * * It returns the number of blocks on the list, unless Fortify has been * disabled, in which case it always returns 0. */ int FORTIFY_STORAGE _Fortify_DumpAllMemory(int scope,char *file,unsigned long line) { struct Header *curr = st_Head; int count = 0; size_t size = 0; stdOutput = 0; if(st_Disabled) { WaitIfstdOutput(); return(0); } FORTIFY_LOCK(); while(curr) { if(curr->Scope >= scope) { if(count == 0) { sprintf(st_Buffer, "\nFortify: Memory Dump at %s.%ld\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); } OutputHeader(curr); OutputMemory(curr); st_Output("\n"); count++; size += curr->Size; } curr = curr->Next; } if(count) { sprintf(st_Buffer, "%11s %8ld bytes overhead\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); WaitIfstdOutput(); return(count); } /* * _Fortify_Disable() - This function provides a mechanism to disable Fortify * without recompiling all the sourcecode. * If 'how' is zero then it can only be called when there is no memory on the * Fortify malloc'd list. (Ideally, at the start of the program before any * memory has been allocated). If you call this function when there IS * memory on the Fortify malloc'd list, it will issue an error, and fortify * will not be disabled. * If 'how' is nonzero then output will only be disabled. This can always be * done. */ int FORTIFY_STORAGE _Fortify_Disable(char *file,unsigned long line,int how) { int result; if (how <= 0) { stdOutput = 0; FORTIFY_LOCK(); if((st_Head) && (how == 0)) { sprintf(st_Buffer, "Fortify: %s.%d\n", file, line); st_Output(st_Buffer); st_Output(" Fortify_Disable failed\n"); st_Output(" (because there is memory on the Fortify memory list)\n"); _Fortify_OutputAllMemory(file, line); result = 0; } else { st_Disabled = (how >= -1 ? 1 : 0); result = 1; } FORTIFY_UNLOCK(); WaitIfstdOutput(); } else { _Fortify_SetOutputFunc((Fortify_OutputFuncPtr) _Fortify_NoOutput); result = 1; } return(result); } /* * Check a block's header and fortifications. */ static int CheckBlock(struct Header *h,char *file,unsigned long line) { unsigned char *ptr = (unsigned char *)h; int result = 1; stdOutput = 0; if(!IsHeaderValid(h)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Invalid pointer or corrupted header detected (%s)\n", file, line, address(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE)); st_Output(st_Buffer); OutputLastVerifiedPoint(); WaitIfstdOutput(); return(0); } if(!CheckFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Memory overrun detected before block\n", file, line); st_Output(st_Buffer); sprintf(st_Buffer," (%s,%ld,%s.%u)\n", address(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE), (unsigned long)h->Size, h->File, h->Line); st_Output(st_Buffer); OutputFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE); OutputLastVerifiedPoint(); result = 0; } if(!CheckFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Memory overrun detected after block\n", file, line); st_Output(st_Buffer); sprintf(st_Buffer," (%s,%ld,%s.%u)\n", address(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE), (unsigned long)h->Size, h->File, h->Line); st_Output(st_Buffer); OutputFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE); OutputLastVerifiedPoint(); result = 0; } WaitIfstdOutput(); return(result); } static int CheckPointer(unsigned char *ptr,unsigned long size,char *file,unsigned long line) { struct Header *curr; unsigned char *ptr1; curr = st_Head; while(curr) { ptr1 = (unsigned char *)curr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE; if(ptr + size <= (unsigned char *)curr) ; else if(ptr >= ptr1) ; else { sprintf(st_Buffer, "\nFortify: %s.%ld\n Memory access detected before block\n", file, line); st_Output(st_Buffer); sprintf(st_Buffer," (%s,%ld,%s.%u)\n", address(ptr1), (unsigned long)curr->Size, curr->File, curr->Line); st_Output(st_Buffer); WaitIfstdOutput(); return(0); } if(ptr + size <= ptr1 + curr->Size) ; else if(ptr >= ptr1 + curr->Size + FORTIFY_AFTER_SIZE) ; else { sprintf(st_Buffer, "\nFortify: %s.%ld\n Memory access detected after block\n", file, line); st_Output(st_Buffer); sprintf(st_Buffer," (%s,%ld,%s.%u)\n", address(ptr1), (unsigned long)curr->Size, curr->File, curr->Line); st_Output(st_Buffer); WaitIfstdOutput(); return(0); } if((ptr >= ptr1) && (ptr < ptr1 + curr->Size) && (ptr + size > ptr1 + curr->Size)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n Memory access detected after block\n", file, line); st_Output(st_Buffer); sprintf(st_Buffer," (%s,%ld,%s.%u)\n", address(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE), (unsigned long)curr->Size, curr->File, curr->Line); st_Output(st_Buffer); WaitIfstdOutput(); return(0); } curr = curr->Next; } return(1); } /* * Checks if the _size_ bytes from _ptr_ are all set to _value_ */ static int CheckFortification(unsigned char *ptr,unsigned char value,size_t size) { while(size--) if(*ptr++ != value) return(0); return(1); } /* * Set the _size_ bytes from _ptr_ to _value_. */ static void SetFortification(unsigned char *ptr,unsigned char value,size_t size) { memset(ptr, value, size); } /* * Output the corrupted section of the fortification */ /* Output the corrupted section of the fortification */ static void OutputFortification(unsigned char *ptr,unsigned char value,size_t size) { unsigned long offset, column; char ascii[17]; st_Output("Address Offset Data"); offset = 0; column = 0; while(offset < size) { if(column == 0) { sprintf(st_Buffer, "\n%8s %8d ", address(ptr), offset); st_Output(st_Buffer); } sprintf(st_Buffer, "%02x ", *ptr); st_Output(st_Buffer); ascii[ (int) column ] = isprint( *ptr ) ? (char)(*ptr) : (char)(' '); ascii[ (int) (column + 1) ] = '\0'; ptr++; offset++; column++; if(column == 16) { st_Output( " \"" ); st_Output( ascii ); st_Output( "\"" ); column = 0; } } if ( column != 0 ) { while ( column ++ < 16 ) { st_Output( " " ); } st_Output( " \"" ); st_Output( ascii ); st_Output( "\"" ); } st_Output("\n"); } /* * Returns true if the supplied pointer does indeed point to a real Header */ static int IsHeaderValid(struct Header *h) { return(!ChecksumHeader(h)); } /* * Updates the checksum to make the header valid */ static void MakeHeaderValid(struct Header *h) { h->Checksum = 0; h->Checksum = -ChecksumHeader(h); } /* * Calculate (and return) the checksum of the header. (Including the Checksum * variable itself. If all is well, the checksum returned by this function should * be 0. */ static int ChecksumHeader(struct Header *h) { register int c, checksum, *p; for(c = 0, checksum = 0, p = (int *)h; c < sizeof(struct Header)/sizeof(int); c++) checksum += *p++; return(checksum); } /* * Examines the malloc'd list to see if the given header is on it. */ static int IsOnList(struct Header *h) { struct Header *curr; curr = st_Head; while(curr) { if(curr == h) return(1); curr = curr->Next; } return(0); } /* * Hex and ascii dump the memory */ static void OutputMemory(struct Header *h) { OutputFortification((unsigned char*)h + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, 0, h->Size); } /* * Output the header... */ static void OutputHeader(struct Header *h) { sprintf(st_Buffer, "%11s %8ld %s.%u (%d)\n", address((unsigned char*)h + sizeof(struct Header) + FORTIFY_BEFORE_SIZE), (unsigned long)h->Size, h->File, h->Line, (int) h->Scope); st_Output(st_Buffer); } static void OutputLastVerifiedPoint() { sprintf(st_Buffer, "\nLast Verified point: %s.%u\n", st_LastVerifiedFile, st_LastVerifiedLine); st_Output(st_Buffer); } #else /* FORTIFY_TRANSPARENT */ void *FORTIFY_STORAGE _Fortify_malloc(size,file,line) size_t size; char *file; unsigned long line; { return(malloc(size)); } void FORTIFY_STORAGE _Fortify_free(uptr,file,line) void *uptr; char *file; unsigned long line; { free(uptr); } void *FORTIFY_STORAGE _Fortify_realloc(ptr,new_size,file,line) void *ptr; size_t new_size; char *file; unsigned long line; { return(realloc(ptr, new_size)); } int FORTIFY_STORAGE _Fortify_CheckPointer(uptr,file,line) void *uptr; char *file; unsigned long line; { return(1); } Fortify_OutputFuncPtr FORTIFY_STORAGE _Fortify_SetOutputFunc(Output) Fortify_OutputFuncPtr Output; { return(0); } int FORTIFY_STORAGE _Fortify_SetMallocFailRate(Percent) int Percent; { return(0); } int FORTIFY_STORAGE _Fortify_CheckAllMemory(file,line) char *file; unsigned long line; { return(0); } int FORTIFY_STORAGE _Fortify_EnterScope(file,line) char *file; unsigned long line; { return(0); } int FORTIFY_STORAGE _Fortify_LeaveScope(file,line) char *file; unsigned long line; { return(0); } int FORTIFY_STORAGE _Fortify_OutputAllMemory(file,line) char *file; unsigned long line; { return(0); } int FORTIFY_STORAGE _Fortify_DumpAllMemory(scope,file,line) int scope; char *file; unsigned long line; { return(0); } int FORTIFY_STORAGE _Fortify_Disable(file,line) char *file; unsigned long line; { return(1); } #endif /* !FORTIFY_TRANSPARENT */ /* function that use _Fortify_malloc(), _Fortify_realloc(), _Fortify_free() */ /* * Fortifty_calloc() - Uses _Fortify_malloc() to implement calloc(). Much * the same protection as _Fortify_malloc(). */ void *FORTIFY_STORAGE _Fortify_calloc(size_t nitems,size_t size,char *file,unsigned long line) { void *ptr; ptr = _Fortify_malloc(nitems * size, file, line); if(ptr) memset(ptr, 0, nitems * size); return(ptr); } /* * Fortifty_strdup() - Uses _Fortify_malloc() to implement strdup(). Much * the same protection as _Fortify_malloc(). * The library function is not used because it is not certain that getpwd * uses the library malloc function (if linked with an alternate library) * and if the memory is freed then strange things can happen */ char *FORTIFY_STORAGE _Fortify_strdup(char *str,char *file,unsigned long line) { char *ptr; unsigned long l; if(str == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "strdup pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } l = (int) strlen(str) + 1; __Fortify_CheckPointer(str,0,l,file,line); ptr = (char *) _Fortify_malloc(l, file, line); if(ptr) strcpy(ptr, str); return(ptr); } /* * Fortifty_getpwd() - Uses _Fortify_malloc() to implement getpwd(). Much * the same protection as _Fortify_malloc(). * Memory is not allocated bu getcwd but by our routine for the same reason * as for strdup */ char *FORTIFY_STORAGE _Fortify_getcwd(char *buf,int size,char *file,unsigned long line) { char *ptr; if(buf!=NULL) ptr = buf; else ptr = (char *) _Fortify_malloc(size + 1, file, line); if(ptr) ptr = getcwd(ptr, size); return(ptr); } /* * Fortifty_tempnam() - Uses _Fortify_strdup() to implement tempnam(). Much * the same protection as _Fortify_malloc(). */ char *FORTIFY_STORAGE _Fortify_tempnam(char *dir,char *pfx,char *file,unsigned long line) { char *ptr1, *ptr2; ptr1 = tempnam(dir,pfx); if(ptr1) { ptr2=_Fortify_strdup(ptr1,file,line); free(ptr1); ptr1=ptr2; } return(ptr1); } /* * Fortify_memcpy() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ void *FORTIFY_STORAGE _Fortify_memcpy(void *to,void *from,size_t size,char *file,unsigned long line) { if((from == NULL) || (to == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(from == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "memcpy from pointer is NULL", file, line); if(to == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (from == NULL) ? "" : " and ", "memcpy to pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(to,0,size,file,line); __Fortify_CheckPointer(from,0,size,file,line); return(memcpy(to,from,size)); } /* * Fortify_memmove() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ void *FORTIFY_STORAGE _Fortify_memmove(void *to,void *from,size_t size,char *file,unsigned long line) { if((from == NULL) || (to == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(from == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "memmove from pointer is NULL", file, line); if(to == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (from == NULL) ? "" : " and ", "memmove to pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(to,0,size,file,line); __Fortify_CheckPointer(from,0,size,file,line); return(memmove(to,from,size)); } /* * Fortify_memccpy() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ void *FORTIFY_STORAGE _Fortify_memccpy(void *to,void *from,int c,size_t size,char *file,unsigned long line) { if((from == NULL) || (to == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(from == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "memccpy from pointer is NULL", file, line); if(to == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (from == NULL) ? "" : " and ", "memccpy to pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(to,0,size,file,line); __Fortify_CheckPointer(from,0,size,file,line); return(memccpy(to,from,c,size)); } /* * Fortify_memset() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ void *FORTIFY_STORAGE _Fortify_memset(void *buffer,int c,size_t size,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n memset pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,size,file,line); return(memset(buffer,c,size)); } /* * Fortify_memchr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ void *FORTIFY_STORAGE _Fortify_memchr(void *buffer,int c,size_t size,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n memchr pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,size,file,line); return(memchr(buffer,c,size)); } /* * Fortify_memcmp() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_memcmp(void *buffer1,void *buffer2,size_t size,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "memcmp first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "memcmp second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,size,file,line); __Fortify_CheckPointer(buffer2,0,size,file,line); return(memcmp(buffer1,buffer2,size)); } /* * Fortify_memicmp() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_memicmp(void *buffer1,void *buffer2,size_t size,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "memicmp first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "memicmp second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,size,file,line); __Fortify_CheckPointer(buffer2,0,size,file,line); return(memicmp(buffer1,buffer2,size)); } /* * Fortify_strcoll() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_strcoll(char *buffer1,char *buffer2,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strcoll first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strcoll second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,strlen(buffer2)+1,file,line); return(strcoll(buffer1,buffer2)); } /* * Fortify_strcspn() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ size_t FORTIFY_STORAGE _Fortify_strcspn(char *buffer1,char *buffer2,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strcspn first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strcspn second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,strlen(buffer2)+1,file,line); return(strcspn(buffer1,buffer2)); } /* * Fortify_strcmp() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_strcmp(char *buffer1,char *buffer2,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strcmp first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strcmp second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,strlen(buffer2)+1,file,line); return(strcmp(buffer1,buffer2)); } /* * Fortify_strcmpi() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_strcmpi(char *buffer1,char *buffer2,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strcmpi first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strcmpi second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,strlen(buffer2)+1,file,line); return(strcmpi(buffer1,buffer2)); } /* * Fortify_strncmp() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_strncmp(char *buffer1,char *buffer2,size_t size,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strncmp first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strncmp second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,MIN(strlen(buffer1)+1,size),file,line); __Fortify_CheckPointer(buffer2,0,MIN(strlen(buffer2)+1,size),file,line); return(strncmp(buffer1,buffer2,size)); } /* * Fortify_strnicmp() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_strnicmp(char *buffer1,char *buffer2,size_t size,char *file,unsigned long line) { if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strnicmp first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strnicmp second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,MIN(strlen(buffer1)+1,size),file,line); __Fortify_CheckPointer(buffer2,0,MIN(strlen(buffer2)+1,size),file,line); return(strnicmp(buffer1,buffer2,size)); } /* * Fortify_strchr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strchr(char *buffer,int c,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strchr pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strchr(buffer,c)); } /* * Fortify_strrchr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strrchr(char *buffer,int c,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strchr pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strrchr(buffer,c)); } /* * Fortify_strlwr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strlwr(char *buffer,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strlwr pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strlwr(buffer)); } /* * Fortify_strlwr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strupr(char *buffer,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strupr pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strupr(buffer)); } /* * Fortify_strrev() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strrev(char *buffer,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strrev pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strrev(buffer)); } /* * Fortify_strlen() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ size_t FORTIFY_STORAGE _Fortify_strlen(char *buffer,char *file,unsigned long line) { unsigned long l; if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strlen pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } l = strlen(buffer); __Fortify_CheckPointer(buffer,0,l+1,file,line); return(l); } /* * Fortify_strcat() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strcat(char *buffer1,char *buffer2,char *file,unsigned long line) { unsigned long l; if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strcat first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strcat second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } l = strlen(buffer2)+1; __Fortify_CheckPointer(buffer1,0,l,file,line); __Fortify_CheckPointer(buffer2,0,l,file,line); return(strcat(buffer1,buffer2)); } /* * Fortify_strpbrk() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strpbrk(char *buffer1,char *buffer2,char *file,unsigned long line) { unsigned long l; if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strpbrk first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strpbrk second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } l = strlen(buffer2)+1; __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,l,file,line); return(strpbrk(buffer1,buffer2)); } /* * Fortify_strstr() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strstr(char *buffer1,char *buffer2,char *file,unsigned long line) { unsigned long l; if((buffer1 == NULL) || (buffer2 == NULL)) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); if(buffer1 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s", "strstr first pointer is NULL", file, line); if(buffer2 == NULL) sprintf(st_Buffer + strlen(st_Buffer), "%s%s", (buffer2 == NULL) ? "" : " and ", "strstr second pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } l = strlen(buffer2)+1; __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); __Fortify_CheckPointer(buffer2,0,l,file,line); return(strstr(buffer1,buffer2)); } /* * Fortify_strtol() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ long FORTIFY_STORAGE _Fortify_strtol(char *buffer1,char **buffer2,int n,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "strtol first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(strtol(buffer1,buffer2,n)); } /* * Fortify_atoi() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ int FORTIFY_STORAGE _Fortify_atoi(char *buffer1,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "atoi first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(atoi(buffer1)); } /* * Fortify_atol() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ long FORTIFY_STORAGE _Fortify_atol(char *buffer1,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "atol first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(atol(buffer1)); } /* * Fortify_atod() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ double FORTIFY_STORAGE _Fortify_atof(char *buffer1,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "atod first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(atof(buffer1)); } /* * Fortify_strtoul() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ unsigned long FORTIFY_STORAGE _Fortify_strtoul(char *buffer1,char **buffer2,int n,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "strtoul first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(strtoul(buffer1,buffer2,n)); } /* * Fortify_strtod() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ double FORTIFY_STORAGE _Fortify_strtod(char *buffer1,char **buffer2,char *file,unsigned long line) { if(buffer1 == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n ", file, line); sprintf(st_Buffer + strlen(st_Buffer), "%s", "strtod first pointer is NULL", file, line); strcat(st_Buffer, "\n"); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(0); } __Fortify_CheckPointer(buffer1,0,strlen(buffer1)+1,file,line); return(strtod(buffer1,buffer2)); } /* * Fortify_strset() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strset(char *buffer,int c,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strset pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strset(buffer,c)); } /* * Fortify_strnset() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strnset(char *buffer,int c,size_t size,char *file,unsigned long line) { if(buffer == NULL) { sprintf(st_Buffer, "\nFortify: %s.%ld\n strnset pointer is NULL\n", file, line); st_Output(st_Buffer); FORTIFY_UNLOCK(); WaitIfstdOutput(); return(NULL); } __Fortify_CheckPointer(buffer,0,strlen(buffer)+1,file,line); return(strnset(buffer,c,size)); } /* * Fortify_strncpy() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ static char *FORTIFY_STORAGE __Fortify_strncpy(char *to,char *from,size_t size,int usesize,char *file,unsigned long line) { size_t size1; size1 = strlen(from) + 1; if(usesize) { if(size < size1) size1 = size; } return((char *) _Fortify_memcpy(to,from,size1,file,line)); } /* * Fortify_strncpy() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strncpy(char *to,char *from,size_t size,char *file,unsigned long line) { return(__Fortify_strncpy(to,from,size,1,file,line)); } /* * Fortify_strncpy() - check if from/to is in allocated space and if so, then check if start/end is not outside allocated space. */ char *FORTIFY_STORAGE _Fortify_strcpy(char *to,char *from,char *file,unsigned long line) { return(__Fortify_strncpy(to,from,0,0,file,line)); } #endif /* FORTIFY */ lp_solve_5.5/fortify.h100666 0 0 30275 11141374241 13417 0ustar usergroup#ifndef __FORTIFY_H__ #define __FORTIFY_H__ /* * FILE: * fortify.h * * DESCRIPTION: * Header file for fortify.c - A fortified shell for malloc, realloc, * calloc, strdup, getcwd, tempnam & free * * WRITTEN: * spb 29/4/94 * * VERSION: * 1.0 29/4/94 */ #include #include "declare.h" #if defined HP9000 || defined AViiON || defined ALPHA || defined SIGNED_UNKNOWN # define signed #endif #ifdef __cplusplus extern "C" { #endif #ifdef FORTIFY typedef void (*OutputFuncPtr) __OF((char *)); extern char *_Fortify_file; extern int _Fortify_line; #define Fortify_FILE(file) _Fortify_file=file #define Fortify_LINE(line) _Fortify_line=line #define _Fortify_FILE (_Fortify_file==(char *) 0 ? __FILE__ : _Fortify_file) #define _Fortify_LINE (_Fortify_line==0 ? __LINE__ : _Fortify_line) void _Fortify_Init __OF((char *file, unsigned long line)); void *_Fortify_malloc __OF((size_t size, char *file, unsigned long line)); void *_Fortify_realloc __OF((void *ptr, size_t new_size, char *file, unsigned long line)); void *_Fortify_calloc __OF((size_t nitems, size_t size, char *file, unsigned long line)); char *_Fortify_strdup __OF((char *str, char *file, unsigned long line)); void *_Fortify_memcpy __OF((void *to, void *from, size_t size, char *file, unsigned long line)); void *_Fortify_memmove __OF((void *to, void *from, size_t size, char *file, unsigned long line)); void *_Fortify_memccpy __OF((void *to, void *from, int c, size_t size, char *file, unsigned long line)); void *_Fortify_memset __OF((void *buffer, int c, size_t size, char *file, unsigned long line)); void *_Fortify_memchr __OF((void *buffer, int c, size_t size, char *file, unsigned long line)); int _Fortify_memcmp __OF((void *buffer1, void *buffer2, size_t size, char *file, unsigned long line)); int _Fortify_memicmp __OF((void *buffer1, void *buffer2, size_t size, char *file, unsigned long line)); char *_Fortify_strchr __OF((char *buffer, int c, char *file, unsigned long line)); char *_Fortify_strrchr __OF((char *buffer, int c, char *file, unsigned long line)); char *_Fortify_strlwr __OF((char *buffer, char *file, unsigned long line)); char *_Fortify_strupr __OF((char *buffer, char *file, unsigned long line)); char *_Fortify_strrev __OF((char *buffer, char *file, unsigned long line)); char *_Fortify_strset __OF((char *buffer, int c, char *file, unsigned long line)); char *_Fortify_strnset __OF((char *buffer, int c, size_t size, char *file, unsigned long line)); char *_Fortify_strstr __OF((char *to, char *from, char *file, unsigned long line)); char *_Fortify_strcpy __OF((char *to, char *from, char *file, unsigned long line)); char *_Fortify_strncpy __OF((char *to, char *from, size_t size, char *file, unsigned long line)); int _Fortify_strcmp __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); double _Fortify_strtod __OF((char *buffer1, char **buffer2, char *file, unsigned long line)); long _Fortify_strtol __OF((char *buffer1, char **buffer2, int n, char *file, unsigned long line)); int _Fortify_atoi __OF((char *buffer1, char *file, unsigned long line)); long _Fortify_atol __OF((char *buffer1, char *file, unsigned long line)); double _Fortify_atof __OF((char *buffer1, char *file, unsigned long line)); unsigned long _Fortify_strtoul __OF((char *buffer1, char **buffer2, int n, char *file, unsigned long line)); size_t _Fortify_strcspn __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); int _Fortify_strcoll __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); int _Fortify_strcmpi __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); int _Fortify_strncmp __OF((char *buffer1, char *buffer2, size_t size, char *file, unsigned long line)); int _Fortify_strnicmp __OF((char *buffer1, char *buffer2, size_t size, char *file, unsigned long line)); char *_Fortify_strcat __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); char *_Fortify_strpbrk __OF((char *buffer1, char *buffer2, char *file, unsigned long line)); size_t _Fortify_strlen __OF((char *buffer, char *file, unsigned long line)); char *_Fortify_getcwd __OF((char *buf, int size, char *file, unsigned long line)); char *_Fortify_tempnam __OF((char *dir, char *pfx, char *file, unsigned long line)); void _Fortify_free __OF((void *uptr, char *file, unsigned long line)); int _Fortify_OutputAllMemory __OF((char *file, unsigned long line)); int _Fortify_CheckAllMemory __OF((char *file, unsigned long line)); int _Fortify_CheckPointer __OF((void *uptr, char *file, unsigned long line)); int _Fortify_Disable __OF((char *file, unsigned long line, int how)); int _Fortify_SetMallocFailRate __OF((int Percent)); int _Fortify_EnterScope __OF((char *file, unsigned long line)); int _Fortify_LeaveScope __OF((char *file, unsigned long line)); int _Fortify_DumpAllMemory __OF((int scope, char *file, unsigned long line)); typedef void (*Fortify_OutputFuncPtr) __OF((/* const */ char *)); Fortify_OutputFuncPtr _Fortify_SetOutputFunc __OF((Fortify_OutputFuncPtr Output)); #endif /* FORTIFY */ #ifdef __cplusplus } #endif #ifndef __FORTIFY_C__ /* Only define the macros if we're NOT in fortify.c */ #ifdef FORTIFY /* Add file and line information to the fortify calls */ #if defined malloc # undef malloc #endif #if defined realloc # undef realloc #endif #if defined calloc # undef calloc #endif #if defined strdup # undef strdup #endif #if defined memcpy # undef memcpy #endif #if defined memmove # undef memmove #endif #if defined memccpy # undef memccpy #endif #if defined memset # undef memset #endif #if defined memchr # undef memchr #endif #if defined memcmp # undef memcmp #endif #if defined memicmp # undef memicmp #endif #if defined strcoll # undef strcoll #endif #if defined strcspn # undef strcspn #endif #if defined strcmp # undef strcmp #endif #if defined strcmpi # undef strcmpi #endif #if defined stricmp # undef stricmp #endif #if defined strncmp # undef strncmp #endif #if defined strnicmp # undef strnicmp #endif #if defined strlwr # undef strlwr #endif #if defined strupr # undef strupr #endif #if defined strrev # undef strrev #endif #if defined strchr # undef strchr #endif #if defined strrchr # undef strrchr #endif #if defined strcat # undef strcat #endif #if defined strpbrk # undef strpbrk #endif #if defined strcpy # undef strcpy #endif #if defined atoi # undef atoi #endif #if defined atol # undef atol #endif #if defined atof # undef atof #endif #if defined strtol # undef strtol #endif #if defined strtoul # undef strtoul #endif #if defined strtod # undef strtod #endif #if defined strstr # undef strstr #endif #if defined strncpy # undef strncpy #endif #if defined strset # undef strset #endif #if defined strnset # undef strnset #endif #if defined strlen # undef strlen #endif #if defined getcwd # undef getcwd #endif #if defined tempnam # undef tempnam #endif #if defined free # undef free #endif #define malloc(size) _Fortify_malloc(size, _Fortify_FILE, _Fortify_LINE) #define realloc(ptr,new_size) _Fortify_realloc(ptr, new_size, _Fortify_FILE, _Fortify_LINE) #define calloc(num,size) _Fortify_calloc(num, size, _Fortify_FILE, _Fortify_LINE) #define strdup(str) _Fortify_strdup(str, _Fortify_FILE, _Fortify_LINE) #define memcpy(to,from,size) _Fortify_memcpy((void *)(to),(void *)(from),size, _Fortify_FILE, _Fortify_LINE) #define memmove(to,from,size) _Fortify_memmove((void *)(to),(void *)(from),size, _Fortify_FILE, _Fortify_LINE) #define memccpy(to,from,c,size) _Fortify_memccpy((void *)(to),(void *)(from),c,size, _Fortify_FILE, _Fortify_LINE) #define memset(buffer,c,size) _Fortify_memset(buffer,c,size, _Fortify_FILE, _Fortify_LINE) #define memchr(buffer,c,size) _Fortify_memchr(buffer,c,size, _Fortify_FILE, _Fortify_LINE) #define memcmp(buffer1,buffer2,size) _Fortify_memcmp((void *)buffer1,(void *)buffer2,size, _Fortify_FILE, _Fortify_LINE) #define memicmp(buffer1,buffer2,size) _Fortify_memicmp((void *)buffer1,(void *)buffer2,size, _Fortify_FILE, _Fortify_LINE) #define strlwr(buffer) _Fortify_strlwr(buffer, _Fortify_FILE, _Fortify_LINE) #define strupr(buffer) _Fortify_strupr(buffer, _Fortify_FILE, _Fortify_LINE) #define strrev(buffer) _Fortify_strrev(buffer, _Fortify_FILE, _Fortify_LINE) #define strchr(buffer,c) _Fortify_strchr(buffer,c, _Fortify_FILE, _Fortify_LINE) #define strrchr(buffer,c) _Fortify_strrchr(buffer,c, _Fortify_FILE, _Fortify_LINE) #define strset(buffer,c) _Fortify_strset(buffer,c, _Fortify_FILE, _Fortify_LINE) #define strnset(buffer,c) _Fortify_strnset(buffer,c, _Fortify_FILE, _Fortify_LINE) #define strstr(buffer1,buffer2) _Fortify_strstr(buffer1,buffer2, _Fortify_FILE, _Fortify_LINE) #define atoi(buffer) _Fortify_atoi(buffer, _Fortify_FILE, _Fortify_LINE) #define atol(buffer) _Fortify_atol(buffer, _Fortify_FILE, _Fortify_LINE) #define atof(buffer) _Fortify_atof(buffer, _Fortify_FILE, _Fortify_LINE) #define strtol(buffer1,buffer2,n) _Fortify_strtol(buffer1,buffer2,n, _Fortify_FILE, _Fortify_LINE) #define strtoul(buffer1,buffer2,n) _Fortify_strtoul(buffer1,buffer2,n, _Fortify_FILE, _Fortify_LINE) #define strtod(buffer1,buffer2) _Fortify_strtod(buffer1,buffer2, _Fortify_FILE, _Fortify_LINE) #define strcpy(to,from) _Fortify_strcpy((char *)(to),(char *)(from), _Fortify_FILE, _Fortify_LINE) #define strncpy(to,from,size) _Fortify_strncpy((char *)(to),(char *)(from),size, _Fortify_FILE, _Fortify_LINE) #define strcoll(buffer1,buffer2) _Fortify_strcoll((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strcspn(buffer1,buffer2) _Fortify_strcspn((char*)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strcmp(buffer1,buffer2) _Fortify_strcmp((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strcmpi(buffer1,buffer2) _Fortify_strcmpi((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define stricmp(buffer1,buffer2) _Fortify_strcmpi((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strncmp(buffer1,buffer2,size) _Fortify_strncmp((char *)(buffer1),(char *)(buffer2),size, _Fortify_FILE, _Fortify_LINE) #define strnicmp(buffer1,buffer2,size) _Fortify_strnicmp((char *)(buffer1),(char *)(buffer2),size, _Fortify_FILE, _Fortify_LINE) #define strcat(buffer1,buffer2) _Fortify_strcat((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strpbrk(buffer1,buffer2) _Fortify_strpbrk((char *)(buffer1),(char *)(buffer2), _Fortify_FILE, _Fortify_LINE) #define strlen(buffer) _Fortify_strlen((char*)(buffer), _Fortify_FILE, _Fortify_LINE) #define getcwd(buf,size) _Fortify_getcwd(buf, size, _Fortify_FILE, _Fortify_LINE) #define tempnam(dir,pfx) _Fortify_tempnam(dir, pfx, _Fortify_FILE, _Fortify_LINE) #define free(ptr) _Fortify_free(ptr, _Fortify_FILE, _Fortify_LINE) #define Fortify_Init() _Fortify_Init(_Fortify_FILE, _Fortify_LINE) #define Fortify_OutputAllMemory() _Fortify_OutputAllMemory(_Fortify_FILE, _Fortify_LINE) #define Fortify_CheckAllMemory() _Fortify_CheckAllMemory(_Fortify_FILE, _Fortify_LINE) #define Fortify_CheckPointer(ptr) _Fortify_CheckPointer(ptr, _Fortify_FILE, _Fortify_LINE) #define Fortify_Disable(how) _Fortify_Disable(_Fortify_FILE, _Fortify_LINE,how) #define Fortify_EnterScope() _Fortify_EnterScope(_Fortify_FILE, _Fortify_LINE) #define Fortify_LeaveScope() _Fortify_LeaveScope(_Fortify_FILE, _Fortify_LINE) #define Fortify_DumpAllMemory(s) _Fortify_DumpAllMemory(s,_Fortify_FILE, _Fortify_LINE) #else /* FORTIFY Define the special fortify functions away to nothing */ #define Fortify_FILE(file) #define Fortify_LINE(line) #define Fortify_Init() #define Fortify_OutputAllMemory() 0 #define Fortify_CheckAllMemory() 0 #define Fortify_CheckPointer(ptr) 1 #define Fortify_Disable(how) 1 #define Fortify_SetOutputFunc() 0 #define Fortify_SetMallocFailRate(p) 0 #define Fortify_EnterScope() 0 #define Fortify_LeaveScope() 0 #define Fortify_DumpAllMemory(s) 0 #endif /* FORTIFY */ #endif /* __FORTIFY_C__ */ #endif /* __FORTIFY_H__ */ lp_solve_5.5/ini.c100666 0 0 2273 11141374241 12464 0ustar usergroup#include #include #include #include "lp_lib.h" #include "ini.h" FILE *ini_create(char *filename) { FILE *fp; fp = fopen(filename, "w"); return(fp); } FILE *ini_open(char *filename) { FILE *fp; fp = fopen(filename, "r"); return(fp); } void ini_writecomment(FILE *fp, char *comment) { fprintf(fp, "; %s\n", comment); } void ini_writeheader(FILE *fp, char *header, int addnewline) { if((addnewline) && (ftell(fp) > 0)) fputs("\n", fp); fprintf(fp, "[%s]\n", header); } void ini_writedata(FILE *fp, char *name, char *data) { if(name != NULL) fprintf(fp, "%s=%s\n", name, data); else fprintf(fp, "%s\n", data); } int ini_readdata(FILE *fp, char *data, int szdata, int withcomment) { int l; char *ptr; if(fgets(data, szdata, fp) == NULL) return(0); if(!withcomment) { ptr = strchr(data, ';'); if(ptr != NULL) *ptr = 0; } l = (int) strlen(data); while((l > 0) && (isspace(data[l - 1]))) l--; data[l] = 0; if((l >= 2) && (data[0] == '[') && (data[l - 1] == ']')) { memcpy(data, data + 1, l - 2); data[l - 2] = 0; return(1); } return(2); } void ini_close(FILE *fp) { fclose(fp); } lp_solve_5.5/ini.h100666 0 0 717 11141374241 12452 0ustar usergroup#include #ifdef __cplusplus __EXTERN_C { #endif extern FILE *ini_create(char *filename); extern FILE *ini_open(char *filename); extern void ini_writecomment(FILE *fp, char *comment); extern void ini_writeheader(FILE *fp, char *header, int addnewline); extern void ini_writedata(FILE *fp, char *name, char *data); extern int ini_readdata(FILE *fp, char *data, int szdata, int withcomment); extern void ini_close(FILE *fp); #ifdef __cplusplus } #endif lp_solve_5.5/lpkit.h100666 0 0 2260 11141374241 13031 0ustar usergroup#include "lp_lib.h" #include "lp_report.h" #define MALLOC(ptr, nr, type)\ ((((nr) == 0) || ((ptr = (type *) malloc((size_t)((nr) * sizeof(*ptr)))) == NULL)) ? \ report(NULL, CRITICAL, "malloc of %d bytes failed on line %d of file %s\n",\ (nr) * sizeof(*ptr), __LINE__, __FILE__), (ptr = NULL /* (void *) 0 */) : \ ptr\ ) #define CALLOC(ptr, nr, type)\ ((((nr) == 0) || ((ptr = (type *) calloc((size_t)(nr), sizeof(*ptr))) == NULL)) ? \ report(NULL, CRITICAL, "calloc of %d bytes failed on line %d of file %s\n",\ (nr) * sizeof(*ptr), __LINE__, __FILE__), (ptr = NULL /* (void *) 0 */) : \ ptr\ ) #define REALLOC(ptr, nr, type)\ ((((nr) == 0) || ((ptr = (type *) realloc(ptr, (size_t)((nr) * sizeof(*ptr)))) == NULL)) ? \ report(NULL, CRITICAL, "realloc of %d bytes failed on line %d of file %s\n",\ (nr) * sizeof(*ptr), __LINE__, __FILE__), (ptr = NULL /* (void *) 0 */) : \ ptr\ ) #if defined FREE # undef FREE #endif #define FREE(ptr) if (ptr != NULL) {free(ptr), ptr = NULL;} else #define MALLOCCPY(nptr, optr, nr, type)\ (MALLOC(nptr, nr, type), (nptr != NULL) ? memcpy(nptr, optr, (size_t)((nr) * sizeof(*optr))) : 0, nptr) lp_solve_5.5/lpsolve.h100666 0 0 1412 11141374242 13371 0ustar usergroup// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_) #define AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Insert your headers here #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_) lp_solve_5.5/lpsolve55/ 40777 0 0 0 11254510565 13304 5ustar usergrouplp_solve_5.5/lpsolve55/ccc100666 0 0 3760 11162275146 14063 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= so= if [ "$PLATFORM" = "SCO_UNIX" ] then def='-dy -K PIC -DNOLONGLONG' dl=-lc else dl=-ldl so=y fi opts='-O3' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ranlib bin/$PLATFORM/liblpsolve55.a if [ "$so" != "" ] then $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $c -shared -Wl,-Bsymbolic -Wl,-soname,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/ccc.aix100666 0 0 4044 11153276677 14651 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' type xlc >/dev/null 2>&1 if [ $? = 0 ] then c=xlc else c=cc fi #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= dl=-ldl so=y opts='-O2' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ranlib bin/$PLATFORM/liblpsolve55.a if [ "$so" != "" ] then $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src tr -d '\r' <../lp_solve.def | sed -e "s/^EXPORTS$//g" >liblpsolve55.exp rm liblpsolve55.so 2>/dev/null $c -bM:SRE -bE:liblpsolve55.exp -bnoentry -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/ccc.hp-ux100666 0 0 3523 11153276715 15123 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= dl=-ldld so=y opts='-O3' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ranlib bin/$PLATFORM/liblpsolve55.a if [ "$so" != "" ] then $c -O +Z -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ld -b -o bin/$PLATFORM/liblpsolve55.sl *.o fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/ccc.osx100666 0 0 3745 11237566363 14705 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= dl=-ldl so=y opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src libtool -static -o bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` if [ "$so" != "" ] then $c -fPIC -fno-common -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $c -dynamiclib bin/$PLATFORM/liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o bin/$PLATFORM/liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/ccc.solaris100666 0 0 3605 11153276671 15540 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= dl=-ldl so=y opts='-O3' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src ar rv bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ranlib bin/$PLATFORM/liblpsolve55.a if [ "$so" != "" ] then $c -fpic -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $c -G -R,-Bsymbolic -Wl,-h,liblpsolve55.so -o bin/$PLATFORM/liblpsolve55.so `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc -lm -ldl fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/cccLUSOL.osx100666 0 0 3777 11137130772 15517 0ustar usergroupsrc='../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../bfp/bfp_LUSOL/lusol.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= so= dl=-ldl so=y opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' $c -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src libtool -static -o bin/$PLATFORM/liblpsolve55.a `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` if [ "$so" != "" ] then $c -fPIC -fno-common -s -c -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I. $opts $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src $c -dynamiclib bin/$PLATFORM/liblpsolve55.a -compatibility_version 5.5.0 -current_version 5.5.0 -o bin/$PLATFORM/liblpsolve55.dylib `echo $src|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` -lc fi rm *.o 2>/dev/null lp_solve_5.5/lpsolve55/cg++.bat100777 0 0 3000 11136442426 14603 0ustar usergroup@echo off REM This batch file compiles the lpsolve libraries with the GNU gcc compiler under Windows set c=g++ set PLATFORM=win32 set src=../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% rem rc lpsolve.rc %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% ..\lp_solve.def -o bin\%PLATFORM%\lpsolve55.dll %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o bin\%PLATFORM%\liblpsolve55.so if exist *.o del *.o %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -c -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% ar rv bin\%PLATFORM%\liblpsolve55.a *.o if exist *.o del *.o set PLATFORM= lp_solve_5.5/lpsolve55/cgcc.bat100777 0 0 3351 11137106025 14765 0ustar usergroup@echo off REM This batch file compiles the lpsolve libraries with the GNU gcc compiler under Windows set c=gcc REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% platform.c -o platform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c rem rc lpsolve.rc %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -mno-cygwin -enable-stdcall-fixup -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% ..\lp_solve.def -o bin\%PLATFORM%\lpsolve55.dll %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -shared -D_USRDLL -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o bin\%PLATFORM%\liblpsolve55.so if exist *.o del *.o %c% -DINLINE=static -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -s -O3 -c -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% ar rv bin\%PLATFORM%\liblpsolve55.a *.o if exist *.o del *.o set PLATFORM= lp_solve_5.5/lpsolve55/cvc6.bat100777 0 0 4276 11136446033 14743 0ustar usergroup@echo off REM This batch file compiles the lpsolve libraries with the Microsoft Visual C/C++ compiler under Windows set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if "%PLATFORM%" == "win32" goto ok1 echo. echo This batch file is intended for 32 bit compilation with MS Visual C 6 echo For newer versions use cvc8*.bat goto done :ok1 if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c rc lpsolve.rc %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MD /O2 /Zp8 /Gz -D"LP_MAXLINELEN=0" -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res ..\lp_solve.def -o bin\%PLATFORM%\lpsolve55.dll rem /link /LINK50COMPAT if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MT /O2 /Zp8 /Gd /c -D"LP_MAXLINELEN=0" -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55.lib if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MTd /O2 /Zp8 /Gd /c -D"LP_MAXLINELEN=0" -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55d.lib if exist *.obj del *.obj :done set PLATFORM= lp_solve_5.5/lpsolve55/cvc8msvcrt.bat100777 0 0 6206 11136446046 16203 0ustar usergroup@echo off REM This batch file compiles the lpsolve libraries with the Microsoft Visual C/C++ compiler under Windows REM Microsoft Visual C++ 2005 or 2008 Redistributable Package must be installed at the client for this to work: REM 32-bit: REM http://www.microsoft.com/downloads/details.aspx?FamilyId=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en REM http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en REM http://www.microsoft.com/downloads/details.aspx?familyid=A5C84275-3B97-4AB7-A40D-3802B2AF5FC2&displaylang=en REM 64-bit: REM http://www.microsoft.com/downloads/details.aspx?familyid=BA9257CA-337F-4B40-8C14-157CFDFFEE4E&displaylang=en REM See also REM http://channel9.msdn.com/ShowPost.aspx?PostID=23261 REM http://msdn2.microsoft.com/en-us/library/ms235291.aspx (How to: Deploy using XCopy) REM http://msdn2.microsoft.com/en-us/library/ms235299.aspx (Redistributing Visual C++ Files) set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% rc lpsolve.rc %c% -W1 -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MD /O2 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res /Febin\%PLATFORM%\lpsolve55.dll editbin /LARGEADDRESSAWARE bin\%PLATFORM%\lpsolve55.dll rem http://msdn2.microsoft.com/en-us/library/ms235229.aspx rem for vs2005 need to embed manifest in dll with manifest tool - #2 on the next line does this. mt /outputresource:"bin\%PLATFORM%\lpsolve55.dll;#2" /manifest "bin\%PLATFORM%\lpsolve55.dll.manifest" rem pause if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MT /O2 /Zp8 /Gd /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55.lib if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MTd /Od /Zp8 /Gd /RTC1 /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55d.lib if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/lpsolve55/cvc8NOmsvcrt.bat100777 0 0 4535 11136446054 16442 0ustar usergroup@echo off REM This batch file compiles the lpsolve libraries with the Microsoft Visual C/C++ compiler under Windows set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../lp_MDO.c ../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../colamd/colamd.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c rc lpsolve.rc rem use /MT to remove dependence on msvcrt*.dll calls kernel libs directly about 200K larger dll. %c% -W1 -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /LD /MT /O2 /Zp8 /Gz -D_WINDLL -D_USRDLL -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lpsolve.res /Febin\%PLATFORM%\lpsolve55.dll editbin /LARGEADDRESSAWARE bin\%PLATFORM%\lpsolve55.dll rem http://msdn2.microsoft.com/en-us/library/ms235229.aspx rem for vs2005 need to embed manifest in dll with manifest tool - #2 on the next line does this. rem mt /outputresource:"bin\%PLATFORM%\lpsolve55.dll;#2" /manifest "bin\%PLATFORM%\lpsolve55.dll.manifest" rem pause if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MT /O2 /Zp8 /Gd /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55.lib if exist *.obj del *.obj %c% -I.. -I../shared -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd /MTd /Od /Zp8 /Gd /RTC1 /c -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% lib *.obj /OUT:bin\%PLATFORM%\liblpsolve55d.lib if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/lpsolve55/dll.sln100666 0 0 3214 11141362066 14666 0ustar usergroupMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lpsolve55", "dll.vcproj", "{C97E3E84-BCC5-4CCB-9675-5833C056E702}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug fortify|Win32 = Debug fortify|Win32 Debug fortify|x64 = Debug fortify|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug fortify|Win32.ActiveCfg = Debug fortify|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug fortify|Win32.Build.0 = Debug fortify|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug fortify|x64.ActiveCfg = Debug fortify|x64 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug fortify|x64.Build.0 = Debug fortify|x64 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug|Win32.ActiveCfg = Debug|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug|Win32.Build.0 = Debug|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug|x64.ActiveCfg = Debug|x64 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Debug|x64.Build.0 = Debug|x64 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Release|Win32.ActiveCfg = Release|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Release|Win32.Build.0 = Release|Win32 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Release|x64.ActiveCfg = Release|x64 {C97E3E84-BCC5-4CCB-9675-5833C056E702}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal lp_solve_5.5/lpsolve55/dll.vcproj100666 0 0 46103 11141362066 15421 0ustar usergroup lp_solve_5.5/lpsolve55/lib.sln100666 0 0 3217 11141362160 14657 0ustar usergroupMicrosoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "liblpsolve55", "lib.vcproj", "{AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug fortify|Win32 = Debug fortify|Win32 Debug fortify|x64 = Debug fortify|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug fortify|Win32.ActiveCfg = Debug fortify|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug fortify|Win32.Build.0 = Debug fortify|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug fortify|x64.ActiveCfg = Debug fortify|x64 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug fortify|x64.Build.0 = Debug fortify|x64 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug|Win32.ActiveCfg = Debug|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug|Win32.Build.0 = Debug|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug|x64.ActiveCfg = Debug|x64 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Debug|x64.Build.0 = Debug|x64 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Release|Win32.ActiveCfg = Release|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Release|Win32.Build.0 = Release|Win32 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Release|x64.ActiveCfg = Release|x64 {AEDD8A5B-DFA6-4995-9E9E-EB381C34CEAF}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal lp_solve_5.5/lpsolve55/lib.vcproj100666 0 0 36124 11141362160 15411 0ustar usergroup lp_solve_5.5/lpsolve55/lpsolve.rc100666 0 0 4613 11236132412 15406 0ustar usergroup// Microsoft Visual C++ generated resource script. // #include "resource.h" #define APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 2 resource. // #include "afxres.h" ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS ///////////////////////////////////////////////////////////////////////////// // Dutch (Belgium) resources #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NLB) #ifdef _WIN32 LANGUAGE LANG_DUTCH, SUBLANG_DUTCH_BELGIAN #pragma code_page(1252) #endif //_WIN32 ///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 5,5,0,15 PRODUCTVERSION 5,5,0,15 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x40004L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "Mixed Integer Lineair Program Solver" VALUE "CompanyName", "Free Software Foundation, Inc." VALUE "FileDescription", "lpsolve" VALUE "FileVersion", "5, 5, 0, 15" VALUE "InternalName", "lpsolve" VALUE "LegalCopyright", "Copyright © 1991, 2009 Free Software Foundation, Inc." VALUE "OriginalFilename", "lpsolve55.dll" VALUE "ProductName", "lpsolve" VALUE "ProductVersion", "5, 5, 0, 15" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // TEXTINCLUDE // 1 TEXTINCLUDE BEGIN "resource.h\0" END 2 TEXTINCLUDE BEGIN "#include ""afxres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN "\r\n" "\0" END #endif // APSTUDIO_INVOKED #endif // Dutch (Belgium) resources ///////////////////////////////////////////////////////////////////////////// #ifndef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // // Generated from the TEXTINCLUDE 3 resource. // ///////////////////////////////////////////////////////////////////////////// #endif // not APSTUDIO_INVOKED lp_solve_5.5/lpsolve55/readme.txt100666 0 0 614 11141374643 15360 0ustar usergroupThis directory contains the files to build the Windows lpsolve55.dll dll / /linux/Unix lpsolve55.a library To build the program under Windows with the Visual C/C++ compiler, use cvc6.bat (also works for VS.NET) To build the program under DOS/Windows with the gcc compiler, use cgcc.bat To build the program under Linux/Unix, use sh ccc To build the program under Mac OS X 10.3.5, use sh ccc.osx lp_solve_5.5/lpsolve55/resource.h100666 0 0 614 11141374243 15356 0ustar usergroup//{{NO_DEPENDENCIES}} // Microsoft Developer Studio generated include file. // Used by lpsolve.rc // // Next default values for new objects // #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 101 #define _APS_NEXT_COMMAND_VALUE 40001 #define _APS_NEXT_CONTROL_VALUE 1000 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif lp_solve_5.5/lp_bit.h100666 0 0 711 11245562131 13140 0ustar usergroup#include "lp_types.h" #if defined INLINE # define MYINLINE INLINE #else # define MYINLINE static #endif MYINLINE void set_biton(MYBOOL *bitarray, int item) { bitarray[item / 8] |= (1 << (item % 8)); } MYINLINE void set_bitoff(MYBOOL *bitarray, int item) { bitarray[item / 8] &= ~(1 << (item % 8)); } MYINLINE MYBOOL is_biton(MYBOOL *bitarray, int item) { return( (MYBOOL) ((bitarray[item / 8] & (1 << (item % 8))) != 0) ); } lp_solve_5.5/lp_crash.c100666 0 0 61333 11210025161 13511 0ustar usergroup /* ---------------------------------------------------------------------------------- Crash management routines in lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h, lp_utils.h, lp_matrix.h Release notes: v1.0.0 1 April 2004 First version. v1.1.0 20 July 2004 Reworked with flexible matrix storage model. ---------------------------------------------------------------------------------- */ #include #include "commonlib.h" #include "lp_lib.h" #include "lp_scale.h" #include "lp_utils.h" #include "lp_report.h" #include "lp_matrix.h" #include "lp_crash.h" #ifdef FORTIFY # include "lp_fortify.h" #endif MYBOOL crash_basis(lprec *lp) { int i; MATrec *mat = lp->matA; MYBOOL ok = TRUE; /* Initialize basis indicators */ if(lp->basis_valid) lp->var_basic[0] = FALSE; else default_basis(lp); /* Set initial partial pricing blocks */ if(lp->rowblocks != NULL) lp->rowblocks->blocknow = 1; if(lp->colblocks != NULL) lp->colblocks->blocknow = ((lp->crashmode == CRASH_NONE) || (lp->colblocks->blockcount == 1) ? 1 : 2); /* Construct a basis that is in some measure the "most feasible" */ if((lp->crashmode == CRASH_MOSTFEASIBLE) && mat_validate(mat)) { /* The logic here follows Maros */ LLrec *rowLL = NULL, *colLL = NULL; int ii, rx, cx, ix, nz; REAL wx, tx, *rowMAX = NULL, *colMAX = NULL; int *rowNZ = NULL, *colNZ = NULL, *rowWT = NULL, *colWT = NULL; REAL *value; int *rownr, *colnr; report(lp, NORMAL, "crash_basis: 'Most feasible' basis crashing selected\n"); /* Tally row and column non-zero counts */ ok = allocINT(lp, &rowNZ, lp->rows+1, TRUE) && allocINT(lp, &colNZ, lp->columns+1, TRUE) && allocREAL(lp, &rowMAX, lp->rows+1, FALSE) && allocREAL(lp, &colMAX, lp->columns+1, FALSE); if(!ok) goto Finish; nz = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); colnr = &COL_MAT_COLNR(0); value = &COL_MAT_VALUE(0); for(i = 0; i < nz; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) { rx = *rownr; cx = *colnr; wx = fabs(*value); rowNZ[rx]++; colNZ[cx]++; if(i == 0) { rowMAX[rx] = wx; colMAX[cx] = wx; colMAX[0] = wx; } else { SETMAX(rowMAX[rx], wx); SETMAX(colMAX[cx], wx); SETMAX(colMAX[0], wx); } } /* Reduce counts for small magnitude to preserve stability */ rownr = &COL_MAT_ROWNR(0); colnr = &COL_MAT_COLNR(0); value = &COL_MAT_VALUE(0); for(i = 0; i < nz; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) { rx = *rownr; cx = *colnr; wx = fabs(*value); #ifdef CRASH_SIMPLESCALE if(wx < CRASH_THRESHOLD * colMAX[0]) { rowNZ[rx]--; colNZ[cx]--; } #else if(wx < CRASH_THRESHOLD * rowMAX[rx]) rowNZ[rx]--; if(wx < CRASH_THRESHOLD * colMAX[cx]) colNZ[cx]--; #endif } /* Set up priority tables */ ok = allocINT(lp, &rowWT, lp->rows+1, TRUE); createLink(lp->rows, &rowLL, NULL); ok &= (rowLL != NULL); if(!ok) goto Finish; for(i = 1; i <= lp->rows; i++) { if(get_constr_type(lp, i)==EQ) ii = 3; else if(lp->upbo[i] < lp->infinite) ii = 2; else if(fabs(lp->rhs[i]) < lp->infinite) ii = 1; else ii = 0; rowWT[i] = ii; if(ii > 0) appendLink(rowLL, i); } ok = allocINT(lp, &colWT, lp->columns+1, TRUE); createLink(lp->columns, &colLL, NULL); ok &= (colLL != NULL); if(!ok) goto Finish; for(i = 1; i <= lp->columns; i++) { ix = lp->rows+i; if(is_unbounded(lp, i)) ii = 3; else if(lp->upbo[ix] >= lp->infinite) ii = 2; else if(fabs(lp->upbo[ix]-lp->lowbo[ix]) > lp->epsmachine) ii = 1; else ii = 0; colWT[i] = ii; if(ii > 0) appendLink(colLL, i); } /* Loop over all basis variables */ for(i = 1; i <= lp->rows; i++) { /* Select row */ rx = 0; wx = -lp->infinite; for(ii = firstActiveLink(rowLL); ii > 0; ii = nextActiveLink(rowLL, ii)) { tx = rowWT[ii] - CRASH_SPACER*rowNZ[ii]; if(tx > wx) { rx = ii; wx = tx; } } if(rx == 0) break; removeLink(rowLL, rx); /* Select column */ cx = 0; wx = -lp->infinite; for(ii = mat->row_end[rx-1]; ii < mat->row_end[rx]; ii++) { /* Update NZ column counts for row selected above */ tx = fabs(ROW_MAT_VALUE(ii)); ix = ROW_MAT_COLNR(ii); #ifdef CRASH_SIMPLESCALE if(tx >= CRASH_THRESHOLD * colMAX[0]) #else if(tx >= CRASH_THRESHOLD * colMAX[ix]) #endif colNZ[ix]--; if(!isActiveLink(colLL, ix) || (tx < CRASH_THRESHOLD * rowMAX[rx])) continue; /* Now do the test for best pivot */ tx = my_sign(lp->orig_obj[ix]) - my_sign(ROW_MAT_VALUE(ii)); tx = colWT[ix] + CRASH_WEIGHT*tx - CRASH_SPACER*colNZ[ix]; if(tx > wx) { cx = ix; wx = tx; } } if(cx == 0) break; removeLink(colLL, cx); /* Update row NZ counts */ ii = mat->col_end[cx-1]; rownr = &COL_MAT_ROWNR(ii); value = &COL_MAT_VALUE(ii); for(; ii < mat->col_end[cx]; ii++, rownr += matRowColStep, value += matValueStep) { wx = fabs(*value); ix = *rownr; #ifdef CRASH_SIMPLESCALE if(wx >= CRASH_THRESHOLD * colMAX[0]) #else if(wx >= CRASH_THRESHOLD * rowMAX[ix]) #endif rowNZ[ix]--; } /* Set new basis variable */ set_basisvar(lp, rx, lp->rows+cx); } /* Clean up */ Finish: FREE(rowNZ); FREE(colNZ); FREE(rowMAX); FREE(colMAX); FREE(rowWT); FREE(colWT); freeLink(&rowLL); freeLink(&colLL); } /* Construct a basis that is in some measure the "least degenerate" */ else if((lp->crashmode == CRASH_LEASTDEGENERATE) && mat_validate(mat)) { /* The logic here follows Maros */ LLrec *rowLL = NULL, *colLL = NULL; int ii, rx, cx, ix, nz, *merit = NULL; REAL *value, wx, hold, *rhs = NULL, *eta = NULL; int *rownr, *colnr; report(lp, NORMAL, "crash_basis: 'Least degenerate' basis crashing selected\n"); /* Create temporary arrays */ ok = allocINT(lp, &merit, lp->columns + 1, FALSE) && allocREAL(lp, &eta, lp->rows + 1, FALSE) && allocREAL(lp, &rhs, lp->rows + 1, FALSE); createLink(lp->columns, &colLL, NULL); createLink(lp->rows, &rowLL, NULL); ok &= (colLL != NULL) && (rowLL != NULL); if(!ok) goto FinishLD; MEMCOPY(rhs, lp->orig_rhs, lp->rows + 1); for(i = 1; i <= lp->columns; i++) appendLink(colLL, i); for(i = 1; i <= lp->rows; i++) appendLink(rowLL, i); /* Loop until we have found enough new bases */ while(colLL->count > 0) { /* Tally non-zeros matching in RHS and each active column */ nz = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); colnr = &COL_MAT_COLNR(0); ii = 0; MEMCLEAR(merit, lp->columns + 1); for(i = 0; i < nz; i++, rownr += matRowColStep, colnr += matRowColStep) { rx = *rownr; cx = *colnr; if(isActiveLink(colLL, cx) && (rhs[rx] != 0)) { merit[cx]++; ii++; } } if(ii == 0) break; /* Find maximal match; break ties with column length */ i = firstActiveLink(colLL); cx = i; for(i = nextActiveLink(colLL, i); i != 0; i = nextActiveLink(colLL, i)) { if(merit[i] >= merit[cx]) { if((merit[i] > merit[cx]) || (mat_collength(mat, i) > mat_collength(mat, cx))) cx = i; } } /* Determine the best pivot row */ i = mat->col_end[cx-1]; nz = mat->col_end[cx]; rownr = &COL_MAT_ROWNR(i); value = &COL_MAT_VALUE(i); rx = 0; wx = 0; MEMCLEAR(eta, lp->rows + 1); for(; i < nz; i++, rownr += matRowColStep, value += matValueStep) { ix = *rownr; hold = *value; eta[ix] = rhs[ix] / hold; hold = fabs(hold); if(isActiveLink(rowLL, ix) && (hold > wx)) { wx = hold; rx = ix; } } /* Set new basis variable */ if(rx > 0) { /* We have to update the rhs vector for the implied transformation in order to be able to find the new RHS non-zero pattern */ for(i = 1; i <= lp->rows; i++) rhs[i] -= wx * eta[i]; rhs[rx] = wx; /* Do the exchange */ set_basisvar(lp, rx, lp->rows+cx); removeLink(rowLL, rx); } removeLink(colLL, cx); } /* Clean up */ FinishLD: FREE(merit); FREE(rhs); freeLink(&rowLL); freeLink(&colLL); } return( ok ); } #if 0 MYBOOL __WINAPI guess_basis(lprec *lp, REAL *guessvector, int *basisvector) { MYBOOL status = FALSE; REAL *values = NULL, *violation = NULL, *value, error, upB, loB, sortorder = 1.0; int i, n, *rownr, *colnr; MATrec *mat = lp->matA; if(!mat_validate(lp->matA)) return( status ); /* Create helper arrays */ if(!allocREAL(lp, &values, lp->sum+1, TRUE) || !allocREAL(lp, &violation, lp->sum+1, TRUE)) goto Finish; /* Compute values of slack variables for given guess vector */ i = 0; n = get_nonzeros(lp); rownr = &COL_MAT_ROWNR(i); colnr = &COL_MAT_COLNR(i); value = &COL_MAT_VALUE(i); for(; i < n; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) values[*rownr] += unscaled_mat(lp, my_chsign(is_chsign(lp, *rownr), *value), *rownr, *colnr) * guessvector[*colnr]; MEMMOVE(values+lp->rows+1, guessvector+1, lp->columns); /* Initialize constraint bound violation measures */ for(i = 1; i <= lp->rows; i++) { upB = get_rh_upper(lp, i); loB = get_rh_lower(lp, i); error = values[i] - upB; if(error > lp->epsprimal) violation[i] = sortorder*error; else { error = loB - values[i]; if(error > lp->epsprimal) violation[i] = sortorder*error; else if(is_infinite(lp, loB) && is_infinite(lp, upB)) ; else if(is_infinite(lp, upB)) violation[i] = sortorder*(loB - values[i]); else if(is_infinite(lp, loB)) violation[i] = sortorder*(values[i] - upB); else violation[i] = - sortorder*MAX(upB - values[i], values[i] - loB); } basisvector[i] = i; } /* Initialize user variable bound violation measures */ for(i = 1; i <= lp->columns; i++) { n = lp->rows+i; upB = get_upbo(lp, i); loB = get_lowbo(lp, i); error = guessvector[i] - upB; if(error > lp->epsprimal) violation[n] = sortorder*error; else { error = loB - values[n]; if(error > lp->epsprimal) violation[n] = sortorder*error; else if(is_infinite(lp, loB) && is_infinite(lp, upB)) ; else if(is_infinite(lp, upB)) violation[n] = sortorder*(loB - values[n]); else if(is_infinite(lp, loB)) violation[n] = sortorder*(values[n] - upB); else violation[n] = - sortorder*MAX(upB - values[n], values[n] - loB); } basisvector[n] = n; } /* Sort decending by violation; this means that variables with the largest violations will be designated as basic */ sortByREAL(basisvector, violation, lp->sum, 1, FALSE); /* Adjust the non-basic indeces for the (proximal) bound state */ error = lp->epsprimal; for(i = lp->rows+1, rownr = basisvector+i; i <= lp->sum; i++, rownr++) { if(*rownr <= lp->rows) { if(values[*rownr] <= get_rh_lower(lp, *rownr)+error) *rownr = -(*rownr); } else if(values[i] <= get_lowbo(lp, (*rownr)-lp->rows)+error) *rownr = -(*rownr); } /* Clean up and return status */ status = (MYBOOL) (violation[1] == 0); Finish: FREE(values); FREE(violation); return( status ); } #endif #if 0 MYBOOL __WINAPI guess_basis(lprec *lp, REAL *guessvector, int *basisvector) { MYBOOL *isnz, status = FALSE; REAL *values = NULL, *violation = NULL, eps = lp->epsprimal, *value, error, upB, loB, sortorder = 1.0; int i, j, n, *rownr, *colnr, *slkpos, nrows = lp->rows, ncols = lp->columns; MATrec *mat = lp->matA; if(!mat_validate(mat)) return( status ); /* Create helper arrays */ if(!allocREAL(lp, &values, lp->sum+1, TRUE) || !allocREAL(lp, &violation, lp->sum+1, TRUE)) goto Finish; /* Compute values of slack variables for given guess vector */ i = 0; n = get_nonzeros(lp); rownr = &COL_MAT_ROWNR(i); colnr = &COL_MAT_COLNR(i); value = &COL_MAT_VALUE(i); for(; i < n; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) values[*rownr] += unscaled_mat(lp, my_chsign(is_chsign(lp, *rownr), *value), *rownr, *colnr) * guessvector[*colnr]; MEMMOVE(values+nrows+1, guessvector+1, ncols); /* Initialize constraint bound violation measures (expressed as positive values) */ for(i = 1; i <= nrows; i++) { upB = get_rh_upper(lp, i); loB = get_rh_lower(lp, i); error = values[i] - upB; if(error > eps) violation[i] = sortorder*error; else { error = loB - values[i]; if(error > eps) violation[i] = sortorder*error; else if(my_infinite(lp, loB) && my_infinite(lp, upB)) ; else if(my_infinite(lp, upB)) violation[i] = sortorder*(loB - values[i]); else if(my_infinite(lp, loB)) violation[i] = sortorder*(values[i] - upB); else violation[i] = -sortorder*MAX(upB - values[i], values[i] - loB); } basisvector[i] = i; } /* Initialize user variable bound violation measures (expressed as positive values) */ for(i = 1; i <= ncols; i++) { n = nrows+i; upB = get_upbo(lp, i); loB = get_lowbo(lp, i); error = guessvector[i] - upB; if(error > eps) violation[n] = sortorder*error; else { error = loB - values[n]; if(error > eps) violation[n] = sortorder*error; else if(my_infinite(lp, loB) && my_infinite(lp, upB)) ; else if(my_infinite(lp, upB)) violation[n] = sortorder*(loB - values[n]); else if(my_infinite(lp, loB)) violation[n] = sortorder*(values[n] - upB); else violation[n] = -sortorder*MAX(upB - values[n], values[n] - loB); } basisvector[n] = n; } /* Sort decending by violation; this means that variables with the largest violations will be designated as basic */ sortByREAL(basisvector, violation, lp->sum, 1, FALSE); error = violation[1]; /* Adjust the non-basic indeces for the (proximal) bound state */ for(i = nrows+1, rownr = basisvector+i; i <= lp->sum; i++, rownr++) { if(*rownr <= nrows) { if(values[*rownr] <= get_rh_lower(lp, *rownr)+eps) *rownr = -(*rownr); } else if(values[i] <= get_lowbo(lp, (*rownr)-nrows)+eps) *rownr = -(*rownr); } #if 1 /* Let us check for obvious row singularities and try to fix these; First assemble necessary basis statistics... */ isnz = (MYBOOL *) values; MEMCLEAR(isnz, nrows+1); slkpos = (int *) violation; MEMCLEAR(slkpos, nrows+1); for(i = 1; i <= nrows; i++) { j = abs(basisvector[i]); if(j <= nrows) { isnz[j] = TRUE; slkpos[j] = i; } else { j-= nrows; j = mat->col_end[j-1]; isnz[COL_MAT_ROWNR(j)] = TRUE; /*isnz[COL_MAT_ROWNR(j+1)] = TRUE;*/ } } for(; i <= lp->sum; i++) { j = abs(basisvector[i]); if(j <= nrows) slkpos[j] = i; } /* ...then set the corresponding slacks basic for row rank deficient positions */ for(j = 1; j <= nrows; j++) { #ifdef Paranoia if(slkpos[j] == 0) report(lp, SEVERE, "guess_basis: Internal error"); #endif if(!isnz[j]) { isnz[j] = TRUE; i = slkpos[j]; swapINT(&basisvector[i], &basisvector[j]); basisvector[j] = abs(basisvector[j]); } } #endif /* Clean up and return status */ status = (MYBOOL) (error <= eps); Finish: FREE(values); FREE(violation); return( status ); } #endif #if 0 MYBOOL __WINAPI guess_basis(lprec *lp, REAL *guessvector, int *basisvector) { MYBOOL *isnz, status = FALSE; REAL *values = NULL, *violation = NULL, eps = lp->epsprimal, *value, error, upB, loB, sortorder = 1.0; int i, j, jj, n, *rownr, *colnr, *slkpos, nrows = lp->rows, ncols = lp->columns; MATrec *mat = lp->matA; if(!mat_validate(mat)) return( status ); /* Create helper arrays */ if(!allocREAL(lp, &values, lp->sum+1, TRUE) || !allocREAL(lp, &violation, lp->sum+1, TRUE)) goto Finish; /* Compute values of slack variables for given guess vector */ i = 0; n = get_nonzeros(lp); rownr = &COL_MAT_ROWNR(i); colnr = &COL_MAT_COLNR(i); value = &COL_MAT_VALUE(i); for(; i < n; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) values[*rownr] += unscaled_mat(lp, my_chsign(is_chsign(lp, *rownr), *value), *rownr, *colnr) * guessvector[*colnr]; MEMMOVE(values+nrows+1, guessvector+1, ncols); /* Initialize constraint bound violation measures (expressed as positive values) */ for(i = 1; i <= nrows; i++) { upB = get_rh_upper(lp, i); loB = get_rh_lower(lp, i); error = values[i] - upB; if(error > -eps) violation[i] = sortorder*MAX(0,error); else { error = loB - values[i]; if(error > -eps) violation[i] = sortorder*MAX(0,error); else if(my_infinite(lp, loB) && my_infinite(lp, upB)) ; else if(my_infinite(lp, upB)) violation[i] = sortorder*(loB - values[i]); else if(my_infinite(lp, loB)) violation[i] = sortorder*(values[i] - upB); else violation[i] = -sortorder*MAX(upB - values[i], values[i] - loB); } basisvector[i] = i; } /* Initialize user variable bound violation measures (expressed as positive values) */ for(i = 1; i <= ncols; i++) { n = nrows+i; upB = get_upbo(lp, i); loB = get_lowbo(lp, i); error = guessvector[i] - upB; if(error > -eps) violation[n] = sortorder*MAX(0,error); else { error = loB - values[n]; if(error > -eps) violation[n] = sortorder*MAX(0,error); else if(my_infinite(lp, loB) && my_infinite(lp, upB)) ; else if(my_infinite(lp, upB)) violation[n] = sortorder*(loB - values[n]); else if(my_infinite(lp, loB)) violation[n] = sortorder*(values[n] - upB); else violation[n] = -sortorder*MAX(upB - values[n], values[n] - loB); } basisvector[n] = n; } /* Sort decending by violation; this means that variables with the largest violations will be designated as basic */ sortByREAL(basisvector, violation, lp->sum, 1, FALSE); error = violation[1]; /* Adjust the non-basic indeces for the (proximal) bound state */ for(i = nrows+1, rownr = basisvector+i; i <= lp->sum; i++, rownr++) { if(*rownr <= nrows) { values[*rownr] -= lp->orig_rhs[*rownr]; if(values[*rownr] <= eps) *rownr = -(*rownr); } else if(values[i] <= get_lowbo(lp, (*rownr)-nrows)+eps) *rownr = -(*rownr); } /* Let us check for obvious row singularities and try to fix these; First assemble necessary basis statistics... */ isnz = (MYBOOL *) values; MEMCLEAR(isnz, nrows+1); slkpos = (int *) violation; MEMCLEAR(slkpos, nrows+1); for(i = 1; i <= nrows; i++) { j = abs(basisvector[i]); if(j <= nrows) { isnz[j] = TRUE; slkpos[j] = i; } else { j-= nrows; jj = mat->col_end[j-1]; isnz[COL_MAT_ROWNR(jj)] = TRUE; /* if(++jj < mat->col_end[j]) isnz[COL_MAT_ROWNR(jj)] = TRUE; */ } } for(; i <= lp->sum; i++) { j = abs(basisvector[i]); if(j <= nrows) slkpos[j] = i; } /* ...then set the corresponding slacks basic for row rank deficient positions */ for(j = 1; j <= nrows; j++) { #ifdef Paranoia if(slkpos[j] == 0) report(lp, SEVERE, "guess_basis: Internal error"); #endif if(!isnz[j]) { isnz[j] = TRUE; i = slkpos[j]; swapINT(&basisvector[i], &basisvector[j]); basisvector[j] = abs(basisvector[j]); } } /* Lastly normalize all basic variables to be coded as lower-bounded */ for(i = 1; i <= nrows; i++) basisvector[i] = -abs(basisvector[i]); /* Clean up and return status */ status = (MYBOOL) (error <= eps); Finish: FREE(values); FREE(violation); return( status ); } #endif MYBOOL __WINAPI guess_basis(lprec *lp, REAL *guessvector, int *basisvector) { MYBOOL *isnz = NULL, status = FALSE; REAL *values = NULL, *violation = NULL, eps = lp->epsprimal, *value, error, upB, loB, sortorder = -1.0; int i, j, jj, n, *rownr, *colnr, *slkpos = NULL, nrows = lp->rows, ncols = lp->columns, nsum = lp->sum; int *basisnr; MATrec *mat = lp->matA; if(!mat_validate(mat)) return( status ); /* Create helper arrays, providing for multiple use of the violation array */ if(!allocREAL(lp, &values, nsum+1, TRUE) || !allocREAL(lp, &violation, nsum+1, TRUE)) goto Finish; /* Compute the values of the constraints for the given guess vector */ i = 0; n = get_nonzeros(lp); rownr = &COL_MAT_ROWNR(i); colnr = &COL_MAT_COLNR(i); value = &COL_MAT_VALUE(i); for(; i < n; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) values[*rownr] += unscaled_mat(lp, my_chsign(is_chsign(lp, *rownr), *value), *rownr, *colnr) * guessvector[*colnr]; MEMMOVE(values+nrows+1, guessvector+1, ncols); /* Initialize bound "violation" or primal non-degeneracy measures, expressed as the absolute value of the differences from the closest bound. */ for(i = 1; i <= nsum; i++) { if(i <= nrows) { loB = get_rh_lower(lp, i); upB = get_rh_upper(lp, i); } else { loB = get_lowbo(lp, i-nrows); upB = get_upbo(lp, i-nrows); } /* Free constraints/variables */ if(my_infinite(lp, loB) && my_infinite(lp, upB)) error = 0; /* Violated constraints/variable bounds */ else if(values[i]+eps < loB) error = loB-values[i]; else if(values[i]-eps > upB) error = values[i]-upB; /* Non-violated constraints/variables bounds */ else if(my_infinite(lp, upB)) error = MAX(0, values[i]-loB); else if(my_infinite(lp, loB)) error = MAX(0, upB-values[i]); else error = MIN(upB-values[i], values[i]-loB); /* MAX(upB-values[i], values[i]-loB); */ if(error != 0) violation[i] = sortorder*error; basisvector[i] = i; } /* Sort decending , meaning that variables with the largest "violations" will be designated basic. Effectively, we are performing a greedy type algorithm, but start at the "least interesting" end. */ sortByREAL(basisvector, violation, nsum, 1, FALSE); error = violation[1]; /* Used for setting the return value */ /* Let us check for obvious row singularities and try to fix these. Note that we reuse the memory allocated to the violation array. First assemble necessary basis statistics... */ slkpos = (int *) violation; n = nrows+1; MEMCLEAR(slkpos, n); isnz = (MYBOOL *) (slkpos+n+1); MEMCLEAR(isnz, n); for(i = 1; i <= nrows; i++) { j = abs(basisvector[i]); if(j <= nrows) { isnz[j] = TRUE; slkpos[j] = i; } else { j-= nrows; jj = mat->col_end[j-1]; jj = COL_MAT_ROWNR(jj); isnz[jj] = TRUE; } } for(; i <= nsum; i++) { j = abs(basisvector[i]); if(j <= nrows) slkpos[j] = i; } /* ...then set the corresponding slacks basic for row rank deficient positions */ for(j = 1; j <= nrows; j++) { if(slkpos[j] == 0) report(lp, SEVERE, "guess_basis: Internal error"); if(!isnz[j]) { isnz[j] = TRUE; i = slkpos[j]; swapINT(&basisvector[i], &basisvector[j]); basisvector[j] = abs(basisvector[j]); } } /* Adjust the non-basic indeces for the (proximal) bound state */ for(i = nrows+1, basisnr = basisvector+i; i <= nsum; i++, basisnr++) { n = *basisnr; if(n <= nrows) { values[n] -= get_rh_lower(lp, n); if(values[n] <= eps) *basisnr = -(*basisnr); } else if(values[n]-eps <= get_lowbo(lp, n-nrows)) *basisnr = -(*basisnr); } /* Lastly normalize all basic variables to be coded as lower-bounded, or effectively zero-based in the case of free variables. */ for(i = 1; i <= nrows; i++) basisvector[i] = -abs(basisvector[i]); /* Clean up and return status */ status = (MYBOOL) (error <= eps); Finish: FREE(values); FREE(violation); return( status ); } lp_solve_5.5/lp_crash.h100666 0 0 630 11141374243 13462 0ustar usergroup #ifndef HEADER_lp_crash #define HEADER_lp_crash #include "lp_types.h" #define CRASH_SIMPLESCALE /* Specify if we should use a simple absolute scaling threshold */ #define CRASH_THRESHOLD 0.167 #define CRASH_SPACER 10 #define CRASH_WEIGHT 0.500 #ifdef __cplusplus __EXTERN_C { #endif STATIC MYBOOL crash_basis(lprec *lp); #ifdef __cplusplus } #endif #endif /* HEADER_lp_crash */ lp_solve_5.5/lp_explicit.h100666 0 0 145477 11244000030 14266 0ustar usergroup#define HEADER_lp_report #include "lp_lib.h" #if defined LPSOLVEAPIFROMLPRECDEF # define LPSOLVEAPIFROMLPREC # define LPSOLVEAPIDEF #endif #if defined LPSOLVEAPIFROMLIBDEF # define LPSOLVEAPIFROMLIB # define LPSOLVEAPIDEF #endif #if !defined LPSOLVEAPIDEF # define LPSOLVEAPIDEF extern #endif /* entries for lp structure */ LPSOLVEAPIDEF add_column_func *_add_column; LPSOLVEAPIDEF add_columnex_func *_add_columnex; LPSOLVEAPIDEF add_constraint_func *_add_constraint; LPSOLVEAPIDEF add_constraintex_func *_add_constraintex; LPSOLVEAPIDEF add_lag_con_func *_add_lag_con; LPSOLVEAPIDEF add_SOS_func *_add_SOS; LPSOLVEAPIDEF column_in_lp_func *_column_in_lp; LPSOLVEAPIDEF copy_lp_func *_copy_lp; LPSOLVEAPIDEF default_basis_func *_default_basis; LPSOLVEAPIDEF del_column_func *_del_column; LPSOLVEAPIDEF del_constraint_func *_del_constraint; LPSOLVEAPIDEF delete_lp_func *_delete_lp; LPSOLVEAPIDEF dualize_lp_func *_dualize_lp; LPSOLVEAPIDEF free_lp_func *_free_lp; LPSOLVEAPIDEF get_anti_degen_func *_get_anti_degen; LPSOLVEAPIDEF get_basis_func *_get_basis; LPSOLVEAPIDEF get_basiscrash_func *_get_basiscrash; LPSOLVEAPIDEF get_bb_depthlimit_func *_get_bb_depthlimit; LPSOLVEAPIDEF get_bb_floorfirst_func *_get_bb_floorfirst; LPSOLVEAPIDEF get_bb_rule_func *_get_bb_rule; LPSOLVEAPIDEF get_bounds_tighter_func *_get_bounds_tighter; LPSOLVEAPIDEF get_break_at_value_func *_get_break_at_value; LPSOLVEAPIDEF get_col_name_func *_get_col_name; LPSOLVEAPIDEF get_column_func *_get_column; LPSOLVEAPIDEF get_columnex_func *_get_columnex; LPSOLVEAPIDEF get_constr_type_func *_get_constr_type; LPSOLVEAPIDEF get_constr_value_func *_get_constr_value; LPSOLVEAPIDEF get_constraints_func *_get_constraints; LPSOLVEAPIDEF get_dual_solution_func *_get_dual_solution; LPSOLVEAPIDEF get_epsb_func *_get_epsb; LPSOLVEAPIDEF get_epsd_func *_get_epsd; LPSOLVEAPIDEF get_epsel_func *_get_epsel; LPSOLVEAPIDEF get_epsint_func *_get_epsint; LPSOLVEAPIDEF get_epsperturb_func *_get_epsperturb; LPSOLVEAPIDEF get_epspivot_func *_get_epspivot; LPSOLVEAPIDEF get_improve_func *_get_improve; LPSOLVEAPIDEF get_infinite_func *_get_infinite; LPSOLVEAPIDEF get_lambda_func *_get_lambda; LPSOLVEAPIDEF get_lowbo_func *_get_lowbo; LPSOLVEAPIDEF get_lp_index_func *_get_lp_index; LPSOLVEAPIDEF get_lp_name_func *_get_lp_name; LPSOLVEAPIDEF get_Lrows_func *_get_Lrows; LPSOLVEAPIDEF get_mat_func *_get_mat; LPSOLVEAPIDEF get_mat_byindex_func *_get_mat_byindex; LPSOLVEAPIDEF get_max_level_func *_get_max_level; LPSOLVEAPIDEF get_maxpivot_func *_get_maxpivot; LPSOLVEAPIDEF get_mip_gap_func *_get_mip_gap; LPSOLVEAPIDEF get_multiprice_func *_get_multiprice; LPSOLVEAPIDEF get_nameindex_func *_get_nameindex; LPSOLVEAPIDEF get_Ncolumns_func *_get_Ncolumns; LPSOLVEAPIDEF get_negrange_func *_get_negrange; LPSOLVEAPIDEF get_nz_func *_get_nonzeros; LPSOLVEAPIDEF get_Norig_columns_func *_get_Norig_columns; LPSOLVEAPIDEF get_Norig_rows_func *_get_Norig_rows; LPSOLVEAPIDEF get_Nrows_func *_get_Nrows; LPSOLVEAPIDEF get_obj_bound_func *_get_obj_bound; LPSOLVEAPIDEF get_objective_func *_get_objective; LPSOLVEAPIDEF get_orig_index_func *_get_orig_index; LPSOLVEAPIDEF get_origcol_name_func *_get_origcol_name; LPSOLVEAPIDEF get_origrow_name_func *_get_origrow_name; LPSOLVEAPIDEF get_partialprice_func *_get_partialprice; LPSOLVEAPIDEF get_pivoting_func *_get_pivoting; LPSOLVEAPIDEF get_presolve_func *_get_presolve; LPSOLVEAPIDEF get_presolveloops_func *_get_presolveloops; LPSOLVEAPIDEF get_primal_solution_func *_get_primal_solution; LPSOLVEAPIDEF get_print_sol_func *_get_print_sol; LPSOLVEAPIDEF get_pseudocosts_func *_get_pseudocosts; LPSOLVEAPIDEF get_ptr_constraints_func *_get_ptr_constraints; LPSOLVEAPIDEF get_ptr_dual_solution_func *_get_ptr_dual_solution; LPSOLVEAPIDEF get_ptr_lambda_func *_get_ptr_lambda; LPSOLVEAPIDEF get_ptr_primal_solution_func *_get_ptr_primal_solution; LPSOLVEAPIDEF get_ptr_sensitivity_obj_func *_get_ptr_sensitivity_obj; LPSOLVEAPIDEF get_ptr_sensitivity_objex_func *_get_ptr_sensitivity_objex; LPSOLVEAPIDEF get_ptr_sensitivity_rhs_func *_get_ptr_sensitivity_rhs; LPSOLVEAPIDEF get_ptr_variables_func *_get_ptr_variables; LPSOLVEAPIDEF get_rh_func *_get_rh; LPSOLVEAPIDEF get_rh_range_func *_get_rh_range; LPSOLVEAPIDEF get_row_func *_get_row; LPSOLVEAPIDEF get_rowex_func *_get_rowex; LPSOLVEAPIDEF get_row_name_func *_get_row_name; LPSOLVEAPIDEF get_scalelimit_func *_get_scalelimit; LPSOLVEAPIDEF get_scaling_func *_get_scaling; LPSOLVEAPIDEF get_sensitivity_obj_func *_get_sensitivity_obj; LPSOLVEAPIDEF get_sensitivity_objex_func *_get_sensitivity_objex; LPSOLVEAPIDEF get_sensitivity_rhs_func *_get_sensitivity_rhs; LPSOLVEAPIDEF get_simplextype_func *_get_simplextype; LPSOLVEAPIDEF get_solutioncount_func *_get_solutioncount; LPSOLVEAPIDEF get_solutionlimit_func *_get_solutionlimit; LPSOLVEAPIDEF get_status_func *_get_status; LPSOLVEAPIDEF get_statustext_func *_get_statustext; LPSOLVEAPIDEF get_timeout_func *_get_timeout; LPSOLVEAPIDEF get_total_iter_func *_get_total_iter; LPSOLVEAPIDEF get_total_nodes_func *_get_total_nodes; LPSOLVEAPIDEF get_upbo_func *_get_upbo; LPSOLVEAPIDEF get_var_branch_func *_get_var_branch; LPSOLVEAPIDEF get_var_dualresult_func *_get_var_dualresult; LPSOLVEAPIDEF get_var_primalresult_func *_get_var_primalresult; LPSOLVEAPIDEF get_var_priority_func *_get_var_priority; LPSOLVEAPIDEF get_variables_func *_get_variables; LPSOLVEAPIDEF get_verbose_func *_get_verbose; LPSOLVEAPIDEF get_working_objective_func *_get_working_objective; LPSOLVEAPIDEF guess_basis_func *_guess_basis; LPSOLVEAPIDEF has_BFP_func *_has_BFP; LPSOLVEAPIDEF has_XLI_func *_has_XLI; LPSOLVEAPIDEF is_add_rowmode_func *_is_add_rowmode; LPSOLVEAPIDEF is_anti_degen_func *_is_anti_degen; LPSOLVEAPIDEF is_binary_func *_is_binary; LPSOLVEAPIDEF is_break_at_first_func *_is_break_at_first; LPSOLVEAPIDEF is_constr_type_func *_is_constr_type; LPSOLVEAPIDEF is_debug_func *_is_debug; LPSOLVEAPIDEF is_feasible_func *_is_feasible; LPSOLVEAPIDEF is_unbounded_func *_is_unbounded; LPSOLVEAPIDEF is_infinite_func *_is_infinite; LPSOLVEAPIDEF is_int_func *_is_int; LPSOLVEAPIDEF is_integerscaling_func *_is_integerscaling; LPSOLVEAPIDEF is_lag_trace_func *_is_lag_trace; LPSOLVEAPIDEF is_maxim_func *_is_maxim; LPSOLVEAPIDEF is_nativeBFP_func *_is_nativeBFP; LPSOLVEAPIDEF is_nativeXLI_func *_is_nativeXLI; LPSOLVEAPIDEF is_negative_func *_is_negative; LPSOLVEAPIDEF is_piv_mode_func *_is_piv_mode; LPSOLVEAPIDEF is_piv_rule_func *_is_piv_rule; LPSOLVEAPIDEF is_presolve_func *_is_presolve; LPSOLVEAPIDEF is_scalemode_func *_is_scalemode; LPSOLVEAPIDEF is_scaletype_func *_is_scaletype; LPSOLVEAPIDEF is_semicont_func *_is_semicont; LPSOLVEAPIDEF is_SOS_var_func *_is_SOS_var; LPSOLVEAPIDEF is_trace_func *_is_trace; LPSOLVEAPIDEF is_use_names_func *_is_use_names; LPSOLVEAPIDEF lp_solve_version_func *_lp_solve_version; LPSOLVEAPIDEF make_lp_func *_make_lp; LPSOLVEAPIDEF print_constraints_func *_print_constraints; LPSOLVEAPIDEF print_debugdump_func *_print_debugdump; LPSOLVEAPIDEF print_duals_func *_print_duals; LPSOLVEAPIDEF print_lp_func *_print_lp; LPSOLVEAPIDEF print_objective_func *_print_objective; LPSOLVEAPIDEF print_scales_func *_print_scales; LPSOLVEAPIDEF print_solution_func *_print_solution; LPSOLVEAPIDEF print_str_func *_print_str; LPSOLVEAPIDEF print_tableau_func *_print_tableau; LPSOLVEAPIDEF put_abortfunc_func *_put_abortfunc; LPSOLVEAPIDEF put_bb_nodefunc_func *_put_bb_nodefunc; LPSOLVEAPIDEF put_bb_branchfunc_func *_put_bb_branchfunc; LPSOLVEAPIDEF put_logfunc_func *_put_logfunc; LPSOLVEAPIDEF put_msgfunc_func *_put_msgfunc; LPSOLVEAPIDEF read_LP_func *_read_LP; LPSOLVEAPIDEF read_MPS_func *_read_MPS; LPSOLVEAPIDEF read_XLI_func *_read_XLI; LPSOLVEAPIDEF read_params_func *_read_params; LPSOLVEAPIDEF read_basis_func *_read_basis; LPSOLVEAPIDEF reset_basis_func *_reset_basis; LPSOLVEAPIDEF reset_params_func *_reset_params; LPSOLVEAPIDEF reportfunc *_report; LPSOLVEAPIDEF resize_lp_func *_resize_lp; LPSOLVEAPIDEF set_add_rowmode_func *_set_add_rowmode; LPSOLVEAPIDEF set_anti_degen_func *_set_anti_degen; LPSOLVEAPIDEF set_basisvar_func *_set_basisvar; LPSOLVEAPIDEF set_basis_func *_set_basis; LPSOLVEAPIDEF set_basiscrash_func *_set_basiscrash; LPSOLVEAPIDEF set_bb_depthlimit_func *_set_bb_depthlimit; LPSOLVEAPIDEF set_bb_floorfirst_func *_set_bb_floorfirst; LPSOLVEAPIDEF set_bb_rule_func *_set_bb_rule; LPSOLVEAPIDEF set_BFP_func *_set_BFP; LPSOLVEAPIDEF set_binary_func *_set_binary; LPSOLVEAPIDEF set_bounds_func *_set_bounds; LPSOLVEAPIDEF set_bounds_tighter_func *_set_bounds_tighter; LPSOLVEAPIDEF set_break_at_first_func *_set_break_at_first; LPSOLVEAPIDEF set_break_at_value_func *_set_break_at_value; LPSOLVEAPIDEF set_column_func *_set_column; LPSOLVEAPIDEF set_columnex_func *_set_columnex; LPSOLVEAPIDEF set_col_name_func *_set_col_name; LPSOLVEAPIDEF set_constr_type_func *_set_constr_type; LPSOLVEAPIDEF set_debug_func *_set_debug; LPSOLVEAPIDEF set_epsb_func *_set_epsb; LPSOLVEAPIDEF set_epsd_func *_set_epsd; LPSOLVEAPIDEF set_epsel_func *_set_epsel; LPSOLVEAPIDEF set_epsint_func *_set_epsint; LPSOLVEAPIDEF set_epslevel_func *_set_epslevel; LPSOLVEAPIDEF set_epsperturb_func *_set_epsperturb; LPSOLVEAPIDEF set_epspivot_func *_set_epspivot; LPSOLVEAPIDEF set_unbounded_func *_set_unbounded; LPSOLVEAPIDEF set_improve_func *_set_improve; LPSOLVEAPIDEF set_infinite_func *_set_infinite; LPSOLVEAPIDEF set_int_func *_set_int; LPSOLVEAPIDEF set_lag_trace_func *_set_lag_trace; LPSOLVEAPIDEF set_lowbo_func *_set_lowbo; LPSOLVEAPIDEF set_lp_name_func *_set_lp_name; LPSOLVEAPIDEF set_mat_func *_set_mat; LPSOLVEAPIDEF set_maxim_func *_set_maxim; LPSOLVEAPIDEF set_maxpivot_func *_set_maxpivot; LPSOLVEAPIDEF set_minim_func *_set_minim; LPSOLVEAPIDEF set_mip_gap_func *_set_mip_gap; LPSOLVEAPIDEF set_multiprice_func *_set_multiprice; LPSOLVEAPIDEF set_negrange_func *_set_negrange; LPSOLVEAPIDEF set_obj_bound_func *_set_obj_bound; LPSOLVEAPIDEF set_obj_fn_func *_set_obj_fn; LPSOLVEAPIDEF set_obj_fnex_func *_set_obj_fnex; LPSOLVEAPIDEF set_obj_func *_set_obj; LPSOLVEAPIDEF set_outputfile_func *_set_outputfile; LPSOLVEAPIDEF set_outputstream_func *_set_outputstream; LPSOLVEAPIDEF set_partialprice_func *_set_partialprice; LPSOLVEAPIDEF set_pivoting_func *_set_pivoting; LPSOLVEAPIDEF set_preferdual_func *_set_preferdual; LPSOLVEAPIDEF set_presolve_func *_set_presolve; LPSOLVEAPIDEF set_print_sol_func *_set_print_sol; LPSOLVEAPIDEF set_pseudocosts_func *_set_pseudocosts; LPSOLVEAPIDEF set_rh_func *_set_rh; LPSOLVEAPIDEF set_rh_range_func *_set_rh_range; LPSOLVEAPIDEF set_rh_vec_func *_set_rh_vec; LPSOLVEAPIDEF set_row_func *_set_row; LPSOLVEAPIDEF set_rowex_func *_set_rowex; LPSOLVEAPIDEF set_row_name_func *_set_row_name; LPSOLVEAPIDEF set_scalelimit_func *_set_scalelimit; LPSOLVEAPIDEF set_scaling_func *_set_scaling; LPSOLVEAPIDEF set_semicont_func *_set_semicont; LPSOLVEAPIDEF set_sense_func *_set_sense; LPSOLVEAPIDEF set_simplextype_func *_set_simplextype; LPSOLVEAPIDEF set_solutionlimit_func *_set_solutionlimit; LPSOLVEAPIDEF set_timeout_func *_set_timeout; LPSOLVEAPIDEF set_trace_func *_set_trace; LPSOLVEAPIDEF set_upbo_func *_set_upbo; LPSOLVEAPIDEF set_var_branch_func *_set_var_branch; LPSOLVEAPIDEF set_var_weights_func *_set_var_weights; LPSOLVEAPIDEF set_verbose_func *_set_verbose; LPSOLVEAPIDEF set_XLI_func *_set_XLI; LPSOLVEAPIDEF solve_func *_solve; LPSOLVEAPIDEF str_add_column_func *_str_add_column; LPSOLVEAPIDEF str_add_constraint_func *_str_add_constraint; LPSOLVEAPIDEF str_add_lag_con_func *_str_add_lag_con; LPSOLVEAPIDEF str_set_obj_fn_func *_str_set_obj_fn; LPSOLVEAPIDEF str_set_rh_vec_func *_str_set_rh_vec; LPSOLVEAPIDEF time_elapsed_func *_time_elapsed; LPSOLVEAPIDEF unscale_func *_unscale; LPSOLVEAPIDEF write_lp_func *_write_lp; LPSOLVEAPIDEF write_LP_func *_write_LP; LPSOLVEAPIDEF write_mps_func *_write_mps; LPSOLVEAPIDEF write_MPS_func *_write_MPS; LPSOLVEAPIDEF write_freemps_func *_write_freemps; LPSOLVEAPIDEF write_freeMPS_func *_write_freeMPS; LPSOLVEAPIDEF write_XLI_func *_write_XLI; LPSOLVEAPIDEF write_basis_func *_write_basis; LPSOLVEAPIDEF write_params_func *_write_params; #if defined LPSOLVEAPIFROMLPREC static int init_lpsolve(lprec *lp) { _add_column = lp->add_column; _add_columnex = lp->add_columnex; _add_constraint = lp->add_constraint; _add_constraintex = lp->add_constraintex; _add_lag_con = lp->add_lag_con; _add_SOS = lp->add_SOS; _column_in_lp = lp->column_in_lp; _copy_lp = lp->copy_lp; _default_basis = lp->default_basis; _del_column = lp->del_column; _del_constraint = lp->del_constraint; _delete_lp = lp->delete_lp; _dualize_lp = lp->dualize_lp; _free_lp = lp->free_lp; _get_anti_degen = lp->get_anti_degen; _get_basis = lp->get_basis; _get_basiscrash = lp->get_basiscrash; _get_bb_depthlimit = lp->get_bb_depthlimit; _get_bb_floorfirst = lp->get_bb_floorfirst; _get_bb_rule = lp->get_bb_rule; _get_bounds_tighter = lp->get_bounds_tighter; _get_break_at_value = lp->get_break_at_value; _get_col_name = lp->get_col_name; _get_columnex = lp->get_columnex; _get_constr_type = lp->get_constr_type; _get_constr_value = lp->get_constr_value; _get_constraints = lp->get_constraints; _get_dual_solution = lp->get_dual_solution; _get_epsb = lp->get_epsb; _get_epsd = lp->get_epsd; _get_epsel = lp->get_epsel; _get_epsint = lp->get_epsint; _get_epsperturb = lp->get_epsperturb; _get_epspivot = lp->get_epspivot; _get_improve = lp->get_improve; _get_infinite = lp->get_infinite; _get_lambda = lp->get_lambda; _get_lowbo = lp->get_lowbo; _get_lp_index = lp->get_lp_index; _get_lp_name = lp->get_lp_name; _get_Lrows = lp->get_Lrows; _get_mat = lp->get_mat; _get_mat_byindex = lp->get_mat_byindex; _get_max_level = lp->get_max_level; _get_maxpivot = lp->get_maxpivot; _get_mip_gap = lp->get_mip_gap; _get_multiprice = lp->get_multiprice; _get_nameindex = lp->get_nameindex; _get_Ncolumns = lp->get_Ncolumns; _get_negrange = lp->get_negrange; _get_nonzeros = lp->get_nonzeros; _get_Norig_columns = lp->get_Norig_columns; _get_Norig_rows = lp->get_Norig_rows; _get_Nrows = lp->get_Nrows; _get_obj_bound = lp->get_obj_bound; _get_objective = lp->get_objective; _get_orig_index = lp->get_orig_index; _get_origcol_name = lp->get_origcol_name; _get_origrow_name = lp->get_origrow_name; _get_partialprice = lp->get_partialprice; _get_pivoting = lp->get_pivoting; _get_presolve = lp->get_presolve; _get_presolveloops = lp->get_presolveloops; _get_primal_solution = lp->get_primal_solution; _get_print_sol = lp->get_print_sol; _get_pseudocosts = lp->get_pseudocosts; _get_ptr_constraints = lp->get_ptr_constraints; _get_ptr_dual_solution = lp->get_ptr_dual_solution; _get_ptr_lambda = lp->get_ptr_lambda; _get_ptr_primal_solution = lp->get_ptr_primal_solution; _get_ptr_sensitivity_obj = lp->get_ptr_sensitivity_obj; _get_ptr_sensitivity_objex = lp->get_ptr_sensitivity_objex; _get_ptr_sensitivity_rhs = lp->get_ptr_sensitivity_rhs; _get_ptr_variables = lp->get_ptr_variables; _get_rh = lp->get_rh; _get_rh_range = lp->get_rh_range; _get_row = lp->get_row; _get_rowex = lp->get_rowex; _get_row_name = lp->get_row_name; _get_scalelimit = lp->get_scalelimit; _get_scaling = lp->get_scaling; _get_sensitivity_obj = lp->get_sensitivity_obj; _get_sensitivity_objex = lp->get_sensitivity_objex; _get_sensitivity_rhs = lp->get_sensitivity_rhs; _get_simplextype = lp->get_simplextype; _get_solutioncount = lp->get_solutioncount; _get_solutionlimit = lp->get_solutionlimit; _get_status = lp->get_status; _get_statustext = lp->get_statustext; _get_timeout = lp->get_timeout; _get_total_iter = lp->get_total_iter; _get_total_nodes = lp->get_total_nodes; _get_upbo = lp->get_upbo; _get_var_branch = lp->get_var_branch; _get_var_dualresult = lp->get_var_dualresult; _get_var_primalresult = lp->get_var_primalresult; _get_var_priority = lp->get_var_priority; _get_variables = lp->get_variables; _get_verbose = lp->get_verbose; _get_working_objective = lp->get_working_objective; _has_BFP = lp->has_BFP; _has_XLI = lp->has_XLI; _is_add_rowmode = lp->is_add_rowmode; _is_anti_degen = lp->is_anti_degen; _is_binary = lp->is_binary; _is_break_at_first = lp->is_break_at_first; _is_constr_type = lp->is_constr_type; _is_debug = lp->is_debug; _is_feasible = lp->is_feasible; _is_unbounded = lp->is_unbounded; _is_infinite = lp->is_infinite; _is_int = lp->is_int; _is_integerscaling = lp->is_integerscaling; _is_lag_trace = lp->is_lag_trace; _is_maxim = lp->is_maxim; _is_nativeBFP = lp->is_nativeBFP; _is_nativeXLI = lp->is_nativeXLI; _is_negative = lp->is_negative; _is_piv_mode = lp->is_piv_mode; _is_piv_rule = lp->is_piv_rule; _is_presolve = lp->is_presolve; _is_scalemode = lp->is_scalemode; _is_scaletype = lp->is_scaletype; _is_semicont = lp->is_semicont; _is_SOS_var = lp->is_SOS_var; _is_trace = lp->is_trace; _is_use_names = lp->is_use_names; _lp_solve_version = lp->lp_solve_version; _make_lp = lp->make_lp; _print_constraints = lp->print_constraints; _print_debugdump = lp->print_debugdump; _print_duals = lp->print_duals; _print_lp = lp->print_lp; _print_objective = lp->print_objective; _print_scales = lp->print_scales; _print_solution = lp->print_solution; _print_str = lp->print_str; _print_tableau = lp->print_tableau; _put_abortfunc = lp->put_abortfunc; _put_bb_nodefunc = lp->put_bb_nodefunc; _put_bb_branchfunc = lp->put_bb_branchfunc; _put_logfunc = lp->put_logfunc; _put_msgfunc = lp->put_msgfunc; _read_LP = lp->read_LP; _read_MPS = lp->read_MPS; _read_XLI = lp->read_XLI; _read_params = lp->read_params; _read_basis = lp->read_basis; _reset_basis = lp->reset_basis; _reset_params = lp->reset_params; _report = lp->report; _resize_lp = lp->resize_lp; _set_add_rowmode = lp->set_add_rowmode; _set_anti_degen = lp->set_anti_degen; _set_basisvar = lp->set_basisvar; _set_basis = lp->set_basis; _set_basiscrash = lp->set_basiscrash; _set_bb_depthlimit = lp->set_bb_depthlimit; _set_bb_floorfirst = lp->set_bb_floorfirst; _set_bb_rule = lp->set_bb_rule; _set_BFP = lp->set_BFP; _set_binary = lp->set_binary; _set_bounds = lp->set_bounds; _set_bounds_tighter = lp->set_bounds_tighter; _set_break_at_first = lp->set_break_at_first; _set_break_at_value = lp->set_break_at_value; _set_column = lp->set_column; _set_columnex = lp->set_columnex; _set_col_name = lp->set_col_name; _set_constr_type = lp->set_constr_type; _set_debug = lp->set_debug; _set_epsb = lp->set_epsb; _set_epsd = lp->set_epsd; _set_epsel = lp->set_epsel; _set_epsint = lp->set_epsint; _set_epslevel = lp->set_epslevel; _set_epsperturb = lp->set_epsperturb; _set_epspivot = lp->set_epspivot; _set_unbounded = lp->set_unbounded; _set_improve = lp->set_improve; _set_infinite = lp->set_infinite; _set_int = lp->set_int; _set_lag_trace = lp->set_lag_trace; _set_lowbo = lp->set_lowbo; _set_lp_name = lp->set_lp_name; _set_mat = lp->set_mat; _set_maxim = lp->set_maxim; _set_maxpivot = lp->set_maxpivot; _set_minim = lp->set_minim; _set_mip_gap = lp->set_mip_gap; _set_multiprice = lp->set_multiprice; _set_negrange = lp->set_negrange; _set_obj_bound = lp->set_obj_bound; _set_obj_fn = lp->set_obj_fn; _set_obj_fnex = lp->set_obj_fnex; _set_obj = lp->set_obj; _set_outputfile = lp->set_outputfile; _set_outputstream = lp->set_outputstream; _set_partialprice = lp->set_partialprice; _set_pivoting = lp->set_pivoting; _set_preferdual = lp->set_preferdual; _set_presolve = lp->set_presolve; _set_print_sol = lp->set_print_sol; _set_pseudocosts = lp->set_pseudocosts; _set_rh = lp->set_rh; _set_rh_range = lp->set_rh_range; _set_rh_vec = lp->set_rh_vec; _set_row = lp->set_row; _set_rowex = lp->set_rowex; _set_row_name = lp->set_row_name; _set_scalelimit = lp->set_scalelimit; _set_scaling = lp->set_scaling; _set_semicont = lp->set_semicont; _set_sense = lp->set_sense; _set_simplextype = lp->set_simplextype; _set_solutionlimit = lp->set_solutionlimit; _set_timeout = lp->set_timeout; _set_trace = lp->set_trace; _set_upbo = lp->set_upbo; _set_var_branch = lp->set_var_branch; _set_var_weights = lp->set_var_weights; _set_verbose = lp->set_verbose; _set_XLI = lp->set_XLI; _solve = lp->solve; _str_add_column = lp->str_add_column; _str_add_constraint = lp->str_add_constraint; _str_add_lag_con = lp->str_add_lag_con; _str_set_obj_fn = lp->str_set_obj_fn; _str_set_rh_vec = lp->str_set_rh_vec; _time_elapsed = lp->time_elapsed; _unscale = lp->unscale; _write_lp = lp->write_lp; _write_LP = lp->write_LP; _write_mps = lp->write_mps; _write_MPS = lp->write_MPS; _write_freemps = lp->write_freemps; _write_freeMPS = lp->write_freeMPS; _write_XLI = lp->write_XLI; _write_basis = lp->write_basis; _write_params = lp->write_params; return(TRUE); } #elif defined LPSOLVEAPIFROMLIB #ifdef WIN32 # include #else # include #endif #if defined WIN32 # define hlpsolve HINSTANCE #else # define hlpsolve void * #endif static hlpsolve open_lpsolve_lib(char *filename) { hlpsolve lpsolve; # if defined WIN32 /* Get a handle to the Windows DLL module. */ lpsolve = LoadLibrary("lpsolve55.dll"); # else lpsolve = dlopen("liblpsolve55.so", RTLD_LAZY);; # endif return(lpsolve); } static int close_lpsolve_lib(hlpsolve lpsolve) { #ifdef WIN32 FreeLibrary(lpsolve); #else dlclose(lpsolve); #endif return(TRUE); } static int init_lpsolve(hlpsolve lpsolve) { # if defined WIN32 # define AddressOf GetProcAddress # else # define AddressOf dlsym # endif /* assign API functions to lp structure */ _add_column = (add_column_func *) AddressOf(lpsolve, "add_column"); _add_columnex = (add_columnex_func *) AddressOf(lpsolve, "add_columnex"); _add_constraint = (add_constraint_func *) AddressOf(lpsolve, "add_constraint"); _add_constraintex = (add_constraintex_func *) AddressOf(lpsolve, "add_constraintex"); _add_lag_con = (add_lag_con_func *) AddressOf(lpsolve, "add_lag_con"); _add_SOS = (add_SOS_func *) AddressOf(lpsolve, "add_SOS"); _column_in_lp = (column_in_lp_func *) AddressOf(lpsolve, "column_in_lp"); _copy_lp = (copy_lp_func *) AddressOf(lpsolve, "copy_lp"); _default_basis = (default_basis_func *) AddressOf(lpsolve, "default_basis"); _del_column = (del_column_func *) AddressOf(lpsolve, "del_column"); _del_constraint = (del_constraint_func *) AddressOf(lpsolve, "del_constraint"); _delete_lp = (delete_lp_func *) AddressOf(lpsolve, "delete_lp"); _dualize_lp = (dualize_lp_func *) AddressOf(lpsolve, "dualize_lp"); _free_lp = (free_lp_func *) AddressOf(lpsolve, "free_lp"); _get_anti_degen = (get_anti_degen_func *) AddressOf(lpsolve, "get_anti_degen"); _get_basis = (get_basis_func *) AddressOf(lpsolve, "get_basis"); _get_basiscrash = (get_basiscrash_func *) AddressOf(lpsolve, "get_basiscrash"); _get_bb_depthlimit = (get_bb_depthlimit_func *) AddressOf(lpsolve, "get_bb_depthlimit"); _get_bb_floorfirst = (get_bb_floorfirst_func *) AddressOf(lpsolve, "get_bb_floorfirst"); _get_bb_rule = (get_bb_rule_func *) AddressOf(lpsolve, "get_bb_rule"); _get_bounds_tighter = (get_bounds_tighter_func *) AddressOf(lpsolve, "get_bounds_tighter"); _get_break_at_value = (get_break_at_value_func *) AddressOf(lpsolve, "get_break_at_value"); _get_col_name = (get_col_name_func *) AddressOf(lpsolve, "get_col_name"); _get_column = (get_column_func *) AddressOf(lpsolve, "get_column"); _get_columnex = (get_columnex_func *) AddressOf(lpsolve, "get_columnex"); _get_constr_type = (get_constr_type_func *) AddressOf(lpsolve, "get_constr_type"); _get_constr_value = (get_constr_value_func *) AddressOf(lpsolve, "get_constr_value"); _get_constraints = (get_constraints_func *) AddressOf(lpsolve, "get_constraints"); _get_dual_solution = (get_dual_solution_func *) AddressOf(lpsolve, "get_dual_solution"); _get_epsb = (get_epsb_func *) AddressOf(lpsolve, "get_epsb"); _get_epsd = (get_epsd_func *) AddressOf(lpsolve, "get_epsd"); _get_epsel = (get_epsel_func *) AddressOf(lpsolve, "get_epsel"); _get_epsint = (get_epsint_func *) AddressOf(lpsolve, "get_epsint"); _get_epsperturb = (get_epsperturb_func *) AddressOf(lpsolve, "get_epsperturb"); _get_epspivot = (get_epspivot_func *) AddressOf(lpsolve, "get_epspivot"); _get_improve = (get_improve_func *) AddressOf(lpsolve, "get_improve"); _get_infinite = (get_infinite_func *) AddressOf(lpsolve, "get_infinite"); _get_lambda = (get_lambda_func *) AddressOf(lpsolve, "get_lambda"); _get_lowbo = (get_lowbo_func *) AddressOf(lpsolve, "get_lowbo"); _get_lp_index = (get_lp_index_func *) AddressOf(lpsolve, "get_lp_index"); _get_lp_name = (get_lp_name_func *) AddressOf(lpsolve, "get_lp_name"); _get_Lrows = (get_Lrows_func *) AddressOf(lpsolve, "get_Lrows"); _get_mat = (get_mat_func *) AddressOf(lpsolve, "get_mat"); _get_mat_byindex = (get_mat_byindex_func *) AddressOf(lpsolve, "get_mat_byindex"); _get_max_level = (get_max_level_func *) AddressOf(lpsolve, "get_max_level"); _get_maxpivot = (get_maxpivot_func *) AddressOf(lpsolve, "get_maxpivot"); _get_mip_gap = (get_mip_gap_func *) AddressOf(lpsolve, "get_mip_gap"); _get_multiprice = (get_multiprice_func *) AddressOf(lpsolve, "get_multiprice"); _get_nameindex = (get_nameindex_func *) AddressOf(lpsolve, "get_nameindex"); _get_Ncolumns = (get_Ncolumns_func *) AddressOf(lpsolve, "get_Ncolumns"); _get_negrange = (get_negrange_func *) AddressOf(lpsolve, "get_negrange"); _get_nonzeros = (get_nz_func *) AddressOf(lpsolve, "get_nonzeros"); _get_Norig_columns = (get_Norig_columns_func *) AddressOf(lpsolve, "get_Norig_columns"); _get_Norig_rows = (get_Norig_rows_func *) AddressOf(lpsolve, "get_Norig_rows"); _get_Nrows = (get_Nrows_func *) AddressOf(lpsolve, "get_Nrows"); _get_obj_bound = (get_obj_bound_func *) AddressOf(lpsolve, "get_obj_bound"); _get_objective = (get_objective_func *) AddressOf(lpsolve, "get_objective"); _get_orig_index = (get_orig_index_func *) AddressOf(lpsolve, "get_orig_index"); _get_origcol_name = (get_origcol_name_func *) AddressOf(lpsolve, "get_origcol_name"); _get_origrow_name = (get_origrow_name_func *) AddressOf(lpsolve, "get_origrow_name"); _get_partialprice = (get_partialprice_func *) AddressOf(lpsolve, "get_partialprice"); _get_pivoting = (get_pivoting_func *) AddressOf(lpsolve, "get_pivoting"); _get_presolve = (get_presolve_func *) AddressOf(lpsolve, "get_presolve"); _get_presolveloops = (get_presolveloops_func *) AddressOf(lpsolve, "get_presolveloops"); _get_primal_solution = (get_primal_solution_func *) AddressOf(lpsolve, "get_primal_solution"); _get_print_sol = (get_print_sol_func *) AddressOf(lpsolve, "get_print_sol"); _get_pseudocosts = (get_pseudocosts_func *) AddressOf(lpsolve, "get_pseudocosts"); _get_ptr_constraints = (get_ptr_constraints_func *) AddressOf(lpsolve, "get_ptr_constraints"); _get_ptr_dual_solution = (get_ptr_dual_solution_func *) AddressOf(lpsolve, "get_ptr_dual_solution"); _get_ptr_lambda = (get_ptr_lambda_func *) AddressOf(lpsolve, "get_ptr_lambda"); _get_ptr_primal_solution = (get_ptr_primal_solution_func *) AddressOf(lpsolve, "get_ptr_primal_solution"); _get_ptr_sensitivity_obj = (get_ptr_sensitivity_obj_func *) AddressOf(lpsolve, "get_ptr_sensitivity_obj"); _get_ptr_sensitivity_objex = (get_ptr_sensitivity_objex_func *) AddressOf(lpsolve, "get_ptr_sensitivity_objex"); _get_ptr_sensitivity_rhs = (get_ptr_sensitivity_rhs_func *) AddressOf(lpsolve, "get_ptr_sensitivity_rhs"); _get_ptr_variables = (get_ptr_variables_func *) AddressOf(lpsolve, "get_ptr_variables"); _get_rh = (get_rh_func *) AddressOf(lpsolve, "get_rh"); _get_rh_range = (get_rh_range_func *) AddressOf(lpsolve, "get_rh_range"); _get_row = (get_row_func *) AddressOf(lpsolve, "get_row"); _get_rowex = (get_rowex_func *) AddressOf(lpsolve, "get_rowex"); _get_row_name = (get_row_name_func *) AddressOf(lpsolve, "get_row_name"); _get_scalelimit = (get_scalelimit_func *) AddressOf(lpsolve, "get_scalelimit"); _get_scaling = (get_scaling_func *) AddressOf(lpsolve, "get_scaling"); _get_sensitivity_obj = (get_sensitivity_obj_func *) AddressOf(lpsolve, "get_sensitivity_obj"); _get_sensitivity_objex = (get_sensitivity_objex_func *) AddressOf(lpsolve, "get_sensitivity_objex"); _get_sensitivity_rhs = (get_sensitivity_rhs_func *) AddressOf(lpsolve, "get_sensitivity_rhs"); _get_simplextype = (get_simplextype_func *) AddressOf(lpsolve, "get_simplextype"); _get_solutioncount = (get_solutioncount_func *) AddressOf(lpsolve, "get_solutioncount"); _get_solutionlimit = (get_solutionlimit_func *) AddressOf(lpsolve, "get_solutionlimit"); _get_status = (get_status_func *) AddressOf(lpsolve, "get_status"); _get_statustext = (get_statustext_func *) AddressOf(lpsolve, "get_statustext"); _get_timeout = (get_timeout_func *) AddressOf(lpsolve, "get_timeout"); _get_total_iter = (get_total_iter_func *) AddressOf(lpsolve, "get_total_iter"); _get_total_nodes = (get_total_nodes_func *) AddressOf(lpsolve, "get_total_nodes"); _get_upbo = (get_upbo_func *) AddressOf(lpsolve, "get_upbo"); _get_var_branch = (get_var_branch_func *) AddressOf(lpsolve, "get_var_branch"); _get_var_dualresult = (get_var_dualresult_func *) AddressOf(lpsolve, "get_var_dualresult"); _get_var_primalresult = (get_var_primalresult_func *) AddressOf(lpsolve, "get_var_primalresult"); _get_var_priority = (get_var_priority_func *) AddressOf(lpsolve, "get_var_priority"); _get_variables = (get_variables_func *) AddressOf(lpsolve, "get_variables"); _get_verbose = (get_verbose_func *) AddressOf(lpsolve, "get_verbose"); _get_working_objective = (get_working_objective_func *) AddressOf(lpsolve, "get_working_objective"); _guess_basis = (guess_basis_func *) AddressOf(lpsolve, "guess_basis"); _has_BFP = (has_BFP_func *) AddressOf(lpsolve, "has_BFP"); _has_XLI = (has_XLI_func *) AddressOf(lpsolve, "has_XLI"); _is_add_rowmode = (is_add_rowmode_func *) AddressOf(lpsolve, "is_add_rowmode"); _is_anti_degen = (is_anti_degen_func *) AddressOf(lpsolve, "is_anti_degen"); _is_binary = (is_binary_func *) AddressOf(lpsolve, "is_binary"); _is_break_at_first = (is_break_at_first_func *) AddressOf(lpsolve, "is_break_at_first"); _is_constr_type = (is_constr_type_func *) AddressOf(lpsolve, "is_constr_type"); _is_debug = (is_debug_func *) AddressOf(lpsolve, "is_debug"); _is_feasible = (is_feasible_func *) AddressOf(lpsolve, "is_feasible"); _is_unbounded = (is_unbounded_func *) AddressOf(lpsolve, "is_unbounded"); _is_infinite = (is_infinite_func *) AddressOf(lpsolve, "is_infinite"); _is_int = (is_int_func *) AddressOf(lpsolve, "is_int"); _is_integerscaling = (is_integerscaling_func *) AddressOf(lpsolve, "is_integerscaling"); _is_lag_trace = (is_lag_trace_func *) AddressOf(lpsolve, "is_lag_trace"); _is_maxim = (is_maxim_func *) AddressOf(lpsolve, "is_maxim"); _is_nativeBFP = (is_nativeBFP_func *) AddressOf(lpsolve, "is_nativeBFP"); _is_nativeXLI = (is_nativeXLI_func *) AddressOf(lpsolve, "is_nativeXLI"); _is_negative = (is_negative_func *) AddressOf(lpsolve, "is_negative"); _is_piv_mode = (is_piv_mode_func *) AddressOf(lpsolve, "is_piv_mode"); _is_piv_rule = (is_piv_rule_func *) AddressOf(lpsolve, "is_piv_rule"); _is_presolve = (is_presolve_func *) AddressOf(lpsolve, "is_presolve"); _is_scalemode = (is_scalemode_func *) AddressOf(lpsolve, "is_scalemode"); _is_scaletype = (is_scaletype_func *) AddressOf(lpsolve, "is_scaletype"); _is_semicont = (is_semicont_func *) AddressOf(lpsolve, "is_semicont"); _is_SOS_var = (is_SOS_var_func *) AddressOf(lpsolve, "is_SOS_var"); _is_trace = (is_trace_func *) AddressOf(lpsolve, "is_trace"); _is_use_names = (is_use_names_func *) AddressOf(lpsolve, "is_use_names"); _lp_solve_version = (lp_solve_version_func *) AddressOf(lpsolve, "lp_solve_version"); _make_lp = (make_lp_func *) AddressOf(lpsolve, "make_lp"); _print_constraints = (print_constraints_func *) AddressOf(lpsolve, "print_constraints"); _print_debugdump = (print_debugdump_func *) AddressOf(lpsolve, "print_debugdump"); _print_duals = (print_duals_func *) AddressOf(lpsolve, "print_duals"); _print_lp = (print_lp_func *) AddressOf(lpsolve, "print_lp"); _print_objective = (print_objective_func *) AddressOf(lpsolve, "print_objective"); _print_scales = (print_scales_func *) AddressOf(lpsolve, "print_scales"); _print_solution = (print_solution_func *) AddressOf(lpsolve, "print_solution"); _print_str = (print_str_func *) AddressOf(lpsolve, "print_str"); _print_tableau = (print_tableau_func *) AddressOf(lpsolve, "print_tableau"); _put_abortfunc = (put_abortfunc_func *) AddressOf(lpsolve, "put_abortfunc"); _put_bb_nodefunc = (put_bb_nodefunc_func *) AddressOf(lpsolve, "put_bb_nodefunc"); _put_bb_branchfunc = (put_bb_branchfunc_func *) AddressOf(lpsolve, "put_bb_branchfunc"); _put_logfunc = (put_logfunc_func *) AddressOf(lpsolve, "put_logfunc"); _put_msgfunc = (put_msgfunc_func *) AddressOf(lpsolve, "put_msgfunc"); _read_LP = (read_LP_func *) AddressOf(lpsolve, "read_LP"); _read_MPS = (read_MPS_func *) AddressOf(lpsolve, "read_MPS"); _read_XLI = (read_XLI_func *) AddressOf(lpsolve, "read_XLI"); _read_params = (read_params_func *) AddressOf(lpsolve, "read_params"); _read_basis = (read_basis_func *) AddressOf(lpsolve, "read_basis"); _reset_basis = (reset_basis_func *) AddressOf(lpsolve, "reset_basis"); _reset_params = (reset_params_func *) AddressOf(lpsolve, "reset_params"); _report = (reportfunc *) AddressOf(lpsolve, "report"); _resize_lp = (resize_lp_func *) AddressOf(lpsolve, "resize_lp"); _set_add_rowmode = (set_add_rowmode_func *) AddressOf(lpsolve, "set_add_rowmode"); _set_anti_degen = (set_anti_degen_func *) AddressOf(lpsolve, "set_anti_degen"); _set_basisvar = (set_basisvar_func *) AddressOf(lpsolve, "set_basisvar"); _set_basis = (set_basis_func *) AddressOf(lpsolve, "set_basis"); _set_basiscrash = (set_basiscrash_func *) AddressOf(lpsolve, "set_basiscrash"); _set_bb_depthlimit = (set_bb_depthlimit_func *) AddressOf(lpsolve, "set_bb_depthlimit"); _set_bb_floorfirst = (set_bb_floorfirst_func *) AddressOf(lpsolve, "set_bb_floorfirst"); _set_bb_rule = (set_bb_rule_func *) AddressOf(lpsolve, "set_bb_rule"); _set_BFP = (set_BFP_func *) AddressOf(lpsolve, "set_BFP"); _set_binary = (set_binary_func *) AddressOf(lpsolve, "set_binary"); _set_bounds = (set_bounds_func *) AddressOf(lpsolve, "set_bounds"); _set_bounds_tighter = (set_bounds_tighter_func *) AddressOf(lpsolve, "set_bounds_tighter"); _set_break_at_first = (set_break_at_first_func *) AddressOf(lpsolve, "set_break_at_first"); _set_break_at_value = (set_break_at_value_func *) AddressOf(lpsolve, "set_break_at_value"); _set_column = (set_column_func *) AddressOf(lpsolve, "set_column"); _set_columnex = (set_columnex_func *) AddressOf(lpsolve, "set_columnex"); _set_col_name = (set_col_name_func *) AddressOf(lpsolve, "set_col_name"); _set_constr_type = (set_constr_type_func *) AddressOf(lpsolve, "set_constr_type"); _set_debug = (set_debug_func *) AddressOf(lpsolve, "set_debug"); _set_epsb = (set_epsb_func *) AddressOf(lpsolve, "set_epsb"); _set_epsd = (set_epsd_func *) AddressOf(lpsolve, "set_epsd"); _set_epsel = (set_epsel_func *) AddressOf(lpsolve, "set_epsel"); _set_epsint = (set_epsint_func *) AddressOf(lpsolve, "set_epsint"); _set_epslevel = (set_epslevel_func *) AddressOf(lpsolve, "set_epslevel"); _set_epsperturb = (set_epsperturb_func *) AddressOf(lpsolve, "set_epsperturb"); _set_epspivot = (set_epspivot_func *) AddressOf(lpsolve, "set_epspivot"); _set_unbounded = (set_unbounded_func *) AddressOf(lpsolve, "set_unbounded"); _set_improve = (set_improve_func *) AddressOf(lpsolve, "set_improve"); _set_infinite = (set_infinite_func *) AddressOf(lpsolve, "set_infinite"); _set_int = (set_int_func *) AddressOf(lpsolve, "set_int"); _set_lag_trace = (set_lag_trace_func *) AddressOf(lpsolve, "set_lag_trace"); _set_lowbo = (set_lowbo_func *) AddressOf(lpsolve, "set_lowbo"); _set_lp_name = (set_lp_name_func *) AddressOf(lpsolve, "set_lp_name"); _set_mat = (set_mat_func *) AddressOf(lpsolve, "set_mat"); _set_maxim = (set_maxim_func *) AddressOf(lpsolve, "set_maxim"); _set_maxpivot = (set_maxpivot_func *) AddressOf(lpsolve, "set_maxpivot"); _set_minim = (set_minim_func *) AddressOf(lpsolve, "set_minim"); _set_mip_gap = (set_mip_gap_func *) AddressOf(lpsolve, "set_mip_gap"); _set_multiprice = (set_multiprice_func *) AddressOf(lpsolve, "set_multiprice"); _set_negrange = (set_negrange_func *) AddressOf(lpsolve, "set_negrange"); _set_obj_bound = (set_obj_bound_func *) AddressOf(lpsolve, "set_obj_bound"); _set_obj_fn = (set_obj_fn_func *) AddressOf(lpsolve, "set_obj_fn"); _set_obj_fnex = (set_obj_fnex_func *) AddressOf(lpsolve, "set_obj_fnex"); _set_obj = (set_obj_func *) AddressOf(lpsolve, "set_obj"); _set_outputfile = (set_outputfile_func *) AddressOf(lpsolve, "set_outputfile"); _set_outputstream = (set_outputstream_func *) AddressOf(lpsolve, "set_outputstream"); _set_partialprice = (set_partialprice_func *) AddressOf(lpsolve, "set_partialprice"); _set_pivoting = (set_pivoting_func *) AddressOf(lpsolve, "set_pivoting"); _set_preferdual = (set_preferdual_func *) AddressOf(lpsolve, "set_preferdual"); _set_presolve = (set_presolve_func *) AddressOf(lpsolve, "set_presolve"); _set_print_sol = (set_print_sol_func *) AddressOf(lpsolve, "set_print_sol"); _set_pseudocosts = (set_pseudocosts_func *) AddressOf(lpsolve, "set_pseudocosts"); _set_rh = (set_rh_func *) AddressOf(lpsolve, "set_rh"); _set_rh_range = (set_rh_range_func *) AddressOf(lpsolve, "set_rh_range"); _set_rh_vec = (set_rh_vec_func *) AddressOf(lpsolve, "set_rh_vec"); _set_row = (set_row_func *) AddressOf(lpsolve, "set_row"); _set_rowex = (set_rowex_func *) AddressOf(lpsolve, "set_rowex"); _set_row_name = (set_row_name_func *) AddressOf(lpsolve, "set_row_name"); _set_scalelimit = (set_scalelimit_func *) AddressOf(lpsolve, "set_scalelimit"); _set_scaling = (set_scaling_func *) AddressOf(lpsolve, "set_scaling"); _set_semicont = (set_semicont_func *) AddressOf(lpsolve, "set_semicont"); _set_sense = (set_sense_func *) AddressOf(lpsolve, "set_sense"); _set_simplextype = (set_simplextype_func *) AddressOf(lpsolve, "set_simplextype"); _set_solutionlimit = (set_solutionlimit_func *) AddressOf(lpsolve, "set_solutionlimit"); _set_timeout = (set_timeout_func *) AddressOf(lpsolve, "set_timeout"); _set_trace = (set_trace_func *) AddressOf(lpsolve, "set_trace"); _set_upbo = (set_upbo_func *) AddressOf(lpsolve, "set_upbo"); _set_var_branch = (set_var_branch_func *) AddressOf(lpsolve, "set_var_branch"); _set_var_weights = (set_var_weights_func *) AddressOf(lpsolve, "set_var_weights"); _set_verbose = (set_verbose_func *) AddressOf(lpsolve, "set_verbose"); _set_XLI = (set_XLI_func *) AddressOf(lpsolve, "set_XLI"); _solve = (solve_func *) AddressOf(lpsolve, "solve"); _str_add_column = (str_add_column_func *) AddressOf(lpsolve, "str_add_column"); _str_add_constraint = (str_add_constraint_func *) AddressOf(lpsolve, "str_add_constraint"); _str_add_lag_con = (str_add_lag_con_func *) AddressOf(lpsolve, "str_add_lag_con"); _str_set_obj_fn = (str_set_obj_fn_func *) AddressOf(lpsolve, "str_set_obj_fn"); _str_set_rh_vec = (str_set_rh_vec_func *) AddressOf(lpsolve, "str_set_rh_vec"); _time_elapsed = (time_elapsed_func *) AddressOf(lpsolve, "time_elapsed"); _unscale = (unscale_func *) AddressOf(lpsolve, "unscale"); _write_lp = (write_lp_func *) AddressOf(lpsolve, "write_lp"); _write_LP = (write_LP_func *) AddressOf(lpsolve, "write_LP"); _write_mps = (write_mps_func *) AddressOf(lpsolve, "write_mps"); _write_MPS = (write_MPS_func *) AddressOf(lpsolve, "write_MPS"); _write_freemps = (write_freemps_func *) AddressOf(lpsolve, "write_freemps"); _write_freeMPS = (write_freeMPS_func *) AddressOf(lpsolve, "write_freeMPS"); _write_XLI = (write_XLI_func *) AddressOf(lpsolve, "write_XLI"); _write_basis = (write_basis_func *) AddressOf(lpsolve, "write_basis"); _write_params = (write_params_func *) AddressOf(lpsolve, "write_params"); return(TRUE); # undef AddressOf } #else # error Either LPSOLVEAPIFROMLPREC or LPSOLVEAPIFROMLIB must be defined #endif #define add_column _add_column #define add_columnex _add_columnex #define add_constraint _add_constraint #define add_constraintex _add_constraintex #define add_lag_con _add_lag_con #define add_SOS _add_SOS #define column_in_lp _column_in_lp #define copy_lp _copy_lp #define default_basis _default_basis #define del_column _del_column #define del_constraint _del_constraint #define delete_lp _delete_lp #define dualize_lp _dualize_lp #define free_lp _free_lp #define get_anti_degen _get_anti_degen #define get_basis _get_basis #define get_basiscrash _get_basiscrash #define get_bb_depthlimit _get_bb_depthlimit #define get_bb_floorfirst _get_bb_floorfirst #define get_bb_rule _get_bb_rule #define get_bounds_tighter _get_bounds_tighter #define get_break_at_value _get_break_at_value #define get_col_name _get_col_name #define get_column _get_column #define get_columnex _get_columnex #define get_constr_type _get_constr_type #define get_constr_value _get_constr_value #define get_constraints _get_constraints #define get_dual_solution _get_dual_solution #define get_epsb _get_epsb #define get_epsd _get_epsd #define get_epsel _get_epsel #define get_epsint _get_epsint #define get_epsperturb _get_epsperturb #define get_epspivot _get_epspivot #define get_improve _get_improve #define get_infinite _get_infinite #define get_lambda _get_lambda #define get_lowbo _get_lowbo #define get_lp_index _get_lp_index #define get_lp_name _get_lp_name #define get_Lrows _get_Lrows #define get_mat _get_mat #define get_mat_byindex _get_mat_byindex #define get_max_level _get_max_level #define get_maxpivot _get_maxpivot #define get_mip_gap _get_mip_gap #define get_multiprice _get_multiprice #define get_nameindex _get_nameindex #define get_Ncolumns _get_Ncolumns #define get_negrange _get_negrange #define get_nonzeros _get_nonzeros #define get_Norig_columns _get_Norig_columns #define get_Norig_rows _get_Norig_rows #define get_Nrows _get_Nrows #define get_obj_bound _get_obj_bound #define get_objective _get_objective #define get_orig_index _get_orig_index #define get_origcol_name _get_origcol_name #define get_origrow_name _get_origrow_name #define get_partialprice _get_partialprice #define get_pivoting _get_pivoting #define get_presolve _get_presolve #define get_presolveloops _get_presolveloops #define get_primal_solution _get_primal_solution #define get_print_sol _get_print_sol #define get_pseudocosts _get_pseudocosts #define get_ptr_constraints _get_ptr_constraints #define get_ptr_dual_solution _get_ptr_dual_solution #define get_ptr_lambda _get_ptr_lambda #define get_ptr_primal_solution _get_ptr_primal_solution #define get_ptr_sensitivity_obj _get_ptr_sensitivity_obj #define get_ptr_sensitivity_objex _get_ptr_sensitivity_objex #define get_ptr_sensitivity_rhs _get_ptr_sensitivity_rhs #define get_ptr_variables _get_ptr_variables #define get_rh _get_rh #define get_rh_range _get_rh_range #define get_row _get_row #define get_rowex _get_rowex #define get_row_name _get_row_name #define get_scalelimit _get_scalelimit #define get_scaling _get_scaling #define get_sensitivity_obj _get_sensitivity_obj #define get_sensitivity_objex _get_sensitivity_objex #define get_sensitivity_rhs _get_sensitivity_rhs #define get_simplextype _get_simplextype #define get_solutioncount _get_solutioncount #define get_solutionlimit _get_solutionlimit #define get_status _get_status #define get_statustext _get_statustext #define get_timeout _get_timeout #define get_total_iter _get_total_iter #define get_total_nodes _get_total_nodes #define get_upbo _get_upbo #define get_var_branch _get_var_branch #define get_var_dualresult _get_var_dualresult #define get_var_primalresult _get_var_primalresult #define get_var_priority _get_var_priority #define get_variables _get_variables #define get_verbose _get_verbose #define get_working_objective _get_working_objective #define guess_basis _guess_basis #define has_BFP _has_BFP #define has_XLI _has_XLI #define is_add_rowmode _is_add_rowmode #define is_anti_degen _is_anti_degen #define is_binary _is_binary #define is_break_at_first _is_break_at_first #define is_constr_type _is_constr_type #define is_debug _is_debug #define is_feasible _is_feasible #define is_unbounded _is_unbounded #define is_infinite _is_infinite #define is_int _is_int #define is_integerscaling _is_integerscaling #define is_lag_trace _is_lag_trace #define is_maxim _is_maxim #define is_nativeBFP _is_nativeBFP #define is_nativeXLI _is_nativeXLI #define is_negative _is_negative #define is_piv_mode _is_piv_mode #define is_piv_rule _is_piv_rule #define is_presolve _is_presolve #define is_scalemode _is_scalemode #define is_scaletype _is_scaletype #define is_semicont _is_semicont #define is_SOS_var _is_SOS_var #define is_trace _is_trace #define is_use_names _is_use_names #define lp_solve_version _lp_solve_version #define make_lp _make_lp #define print_constraints _print_constraints #define print_debugdump _print_debugdump #define print_duals _print_duals #define print_lp _print_lp #define print_objective _print_objective #define print_scales _print_scales #define print_solution _print_solution #define print_str _print_str #define print_tableau _print_tableau #define put_abortfunc _put_abortfunc #define put_bb_nodefunc _put_bb_nodefunc #define put_bb_branchfunc _put_bb_branchfunc #define put_logfunc _put_logfunc #define put_msgfunc _put_msgfunc #define read_LP _read_LP #define read_MPS _read_MPS #define read_XLI _read_XLI #define read_params _read_params #define read_basis _read_basis #define reset_basis _reset_basis #define reset_params _reset_params #define report _report #define resize_lp _resize_lp #define set_add_rowmode _set_add_rowmode #define set_anti_degen _set_anti_degen #define set_basisvar _set_basisvar #define set_basis _set_basis #define set_basiscrash _set_basiscrash #define set_bb_depthlimit _set_bb_depthlimit #define set_bb_floorfirst _set_bb_floorfirst #define set_bb_rule _set_bb_rule #define set_BFP _set_BFP #define set_binary _set_binary #define set_bounds _set_bounds #define set_bounds_tighter _set_bounds_tighter #define set_break_at_first _set_break_at_first #define set_break_at_value _set_break_at_value #define set_column _set_column #define set_columnex _set_columnex #define set_col_name _set_col_name #define set_constr_type _set_constr_type #define set_debug _set_debug #define set_epsb _set_epsb #define set_epsd _set_epsd #define set_epsel _set_epsel #define set_epsint _set_epsint #define set_epslevel _set_epslevel #define set_epsperturb _set_epsperturb #define set_epspivot _set_epspivot #define set_unbounded _set_unbounded #define set_improve _set_improve #define set_infinite _set_infinite #define set_int _set_int #define set_lag_trace _set_lag_trace #define set_lowbo _set_lowbo #define set_lp_name _set_lp_name #define set_mat _set_mat #define set_maxim _set_maxim #define set_maxpivot _set_maxpivot #define set_minim _set_minim #define set_mip_gap _set_mip_gap #define set_multiprice _set_multiprice #define set_negrange _set_negrange #define set_obj_bound _set_obj_bound #define set_obj_fn _set_obj_fn #define set_obj_fnex _set_obj_fnex #define set_obj _set_obj #define set_outputfile _set_outputfile #define set_outputstream _set_outputstream #define set_partialprice _set_partialprice #define set_pivoting _set_pivoting #define set_preferdual _set_preferdual #define set_presolve _set_presolve #define set_print_sol _set_print_sol #define set_pseudocosts _set_pseudocosts #define set_rh _set_rh #define set_rh_range _set_rh_range #define set_rh_vec _set_rh_vec #define set_row _set_row #define set_rowex _set_rowex #define set_row_name _set_row_name #define set_scalelimit _set_scalelimit #define set_scaling _set_scaling #define set_semicont _set_semicont #define set_sense _set_sense #define set_simplextype _set_simplextype #define set_solutionlimit _set_solutionlimit #define set_timeout _set_timeout #define set_trace _set_trace #define set_upbo _set_upbo #define set_var_branch _set_var_branch #define set_var_weights _set_var_weights #define set_verbose _set_verbose #define set_XLI _set_XLI #define solve _solve #define str_add_column _str_add_column #define str_add_constraint _str_add_constraint #define str_add_lag_con _str_add_lag_con #define str_set_obj_fn _str_set_obj_fn #define str_set_rh_vec _str_set_rh_vec #define time_elapsed _time_elapsed #define unscale _unscale #define write_lp _write_lp #define write_LP _write_LP #define write_mps _write_mps #define write_MPS _write_MPS #define write_freemps _write_freemps #define write_freeMPS _write_freeMPS #define write_XLI _write_XLI #define write_basis _write_basis #define write_params _write_params lp_solve_5.5/lp_fortify.h100666 0 0 55 11141374243 14025 0ustar usergroup#ifdef FORTIFY #include "fortify.h" #endif lp_solve_5.5/lp_Hash.c100666 0 0 12674 11141374244 13314 0ustar usergroup #include #include #include "lp_lib.h" #include "lp_utils.h" #include "lp_report.h" #include "lp_Hash.h" #ifdef FORTIFY # include "lp_fortify.h" #endif #define HASH_START_SIZE 5000 /* Hash table size for row and column name storage */ #define NUMHASHPRIMES 45 STATIC hashtable *create_hash_table(int size, int base) { int i; int HashPrimes[ ] = { 29, 229, 883, 1671, 2791, 4801, 8629, 10007, 15289, 25303, 34843, 65269, 99709, 129403, 147673, 166669, 201403, 222163, 242729, 261431, 303491, 320237, 402761, 501131, 602309, 701507, 800999, 900551, 1000619, 1100837, 1200359, 1300021, 1400017, 1500007, 1750009, 2000003, 2500009, 3000017, 4000037, 5000011, 6000011, 7000003, 8000009, 9000011, 9999991}; hashtable *ht; /* Find a good size for the hash table */ if(size < HASH_START_SIZE) size = HASH_START_SIZE; for(i = 0; i < NUMHASHPRIMES-1; i++) if(HashPrimes[i] > size) break; size = HashPrimes[i]; /* Then allocate and initialize memory */ ht = (hashtable *) calloc(1 , sizeof(*ht)); ht->table = (hashelem **) calloc(size, sizeof(*(ht->table))); ht->size = size; ht->base = base; ht->count = base-1; return(ht); } STATIC void free_hash_item(hashelem **hp) { free((*hp)->name); free(*hp); *hp = NULL; } STATIC void free_hash_table(hashtable *ht) { hashelem *hp, *thp; hp = ht->first; while(hp != NULL) { thp = hp; hp = hp->nextelem; free_hash_item(&thp); } free(ht->table); free(ht); } /* make a good hash function for any int size */ /* inspired by Aho, Sethi and Ullman, Compilers ..., p436 */ #define HASH_1 sizeof(unsigned int) #define HASH_2 (sizeof(unsigned int) * 6) #define HASH_3 (((unsigned int)0xF0) << ((sizeof(unsigned int) - 1) * CHAR_BIT)) STATIC int hashval(const char *string, int size) { unsigned int result = 0, tmp; for(; *string; string++) { result = (result << HASH_1) + *string; if((tmp = result & HASH_3) != 0) { /* if any of the most significant bits is on */ result ^= tmp >> HASH_2; /* xor them in in a less significant part */ result ^= tmp; /* and reset the most significant bits to 0 */ } } return(result % size); } /* hashval */ STATIC hashelem *findhash(const char *name, hashtable *ht) { hashelem *h_tab_p; for(h_tab_p = ht->table[hashval(name, ht->size)]; h_tab_p != NULL; h_tab_p = h_tab_p->next) if(strcmp(name, h_tab_p->name) == 0) /* got it! */ break; return(h_tab_p); } /* findhash */ STATIC hashelem *puthash(const char *name, int index, hashelem **list, hashtable *ht) { hashelem *hp = NULL; int hashindex; if(list != NULL) { hp = list[index]; if(hp != NULL) list[index] = NULL; } if((hp = findhash(name, ht)) == NULL) { hashindex = hashval(name, ht->size); hp = (hashelem *) calloc(1, sizeof(*hp)); allocCHAR(NULL, &hp->name, (int) (strlen(name) + 1), FALSE); strcpy(hp->name, name); hp->index = index; ht->count++; if(list != NULL) list[index] = hp; hp->next = ht->table[hashindex]; ht->table[hashindex] = hp; if(ht->first == NULL) ht->first = hp; if(ht->last != NULL) ht->last->nextelem = hp; ht->last = hp; } return(hp); } STATIC void drophash(const char *name, hashelem **list, hashtable *ht) { hashelem *hp, *hp1, *hp2; int hashindex; if((hp = findhash(name, ht)) != NULL) { hashindex = hashval(name, ht->size); if((hp1 = ht->table[hashindex]) != NULL) { hp2 = NULL; while((hp1 != NULL) && (hp1 != hp)) { hp2 = hp1; hp1 = hp1->next; } if(hp1 == hp) { if(hp2 != NULL) hp2->next = hp->next; else ht->table[hashindex] = hp->next; } hp1 = ht->first; hp2 = NULL; while((hp1 != NULL) && (hp1 != hp)) { hp2 = hp1; hp1 = hp1->nextelem; } if(hp1 == hp) { if(hp2 != NULL) hp2->nextelem = hp->nextelem; else { ht->first = hp->nextelem; if (ht->first == NULL) ht->last = NULL; } } if(list != NULL) list[hp->index] = NULL; free_hash_item(&hp); ht->count--; } } } STATIC hashtable *copy_hash_table(hashtable *ht, hashelem **list, int newsize) { hashtable *copy; hashelem *elem, *new_elem; if(newsize < ht->size) newsize = ht->size; copy = create_hash_table(newsize, ht->base); if (copy != NULL) { elem = ht->first; while (elem != NULL) { if((new_elem = puthash(elem->name, elem->index, list, copy)) == NULL) { free_hash_table(copy); return(NULL); } elem = elem ->nextelem; } } return(copy); } STATIC int find_row(lprec *lp, char *name, MYBOOL Unconstrained_rows_found) { hashelem *hp; if (lp->rowname_hashtab != NULL) hp = findhash(name, lp->rowname_hashtab); else hp = NULL; if (hp == NULL) { if(Unconstrained_rows_found) { /* just ignore them in this case */ return(-1); } else { return(-1); } } return(hp->index); } STATIC int find_var(lprec *lp, char *name, MYBOOL verbose) { hashelem *hp; if (lp->colname_hashtab != NULL) hp = findhash(name, lp->colname_hashtab); else hp = NULL; if (hp == NULL) { if(verbose) report(lp, SEVERE, "find_var: Unknown variable name '%s'\n", name); return(-1); } return(hp->index); } lp_solve_5.5/lp_Hash.h100666 0 0 2165 11141374244 13273 0ustar usergroup#ifndef HEADER_lp_hash #define HEADER_lp_hash /* For row and column name hash tables */ typedef struct _hashelem { char *name; int index; struct _hashelem *next; struct _hashelem *nextelem; } hashelem; typedef struct /* _hashtable */ { hashelem **table; int size; int base; int count; struct _hashelem *first; struct _hashelem *last; } hashtable; #ifdef __cplusplus extern "C" { #endif STATIC hashtable *create_hash_table(int size, int base); STATIC void free_hash_table(hashtable *ht); STATIC hashelem *findhash(const char *name, hashtable *ht); STATIC hashelem *puthash(const char *name, int index, hashelem **list, hashtable *ht); STATIC void drophash(const char *name, hashelem **list, hashtable *ht); STATIC void free_hash_item(hashelem **hp); STATIC hashtable *copy_hash_table(hashtable *ht, hashelem **list, int newsize); STATIC int find_var(lprec *lp, char *name, MYBOOL verbose); STATIC int find_row(lprec *lp, char *name, MYBOOL Unconstrained_rows_found); #ifdef __cplusplus } #endif #endif /* HEADER_lp_hash */ lp_solve_5.5/lp_lib.c100666 0 0 1075411 11252265156 13242 0ustar usergroup /* ---------------------------------------------------------------------------------- Main library of routines for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Michel Berkelaar (to v3.2) Kjell Eikland (v4.0 and forward) Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: (see below) Release notes: v5.0.0 1 January 2004 First integrated and repackaged version. v5.0.1 8 May 2004 Cumulative update since initial release; overall functionality scope maintained. v5.1.0 20 July 2004 Reworked lp_solve throughout to fit new flexible matrix storage model. ---------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------- */ /* Main library of routines for lp_solve */ /*----------------------------------------------------------------------------------- */ #include #include #include #include #if LoadInverseLib == TRUE #ifdef WIN32 #include #else #include #endif #endif /* ---------------------------------------------------------------------------------- */ /* Include core and support modules via headers */ /* ---------------------------------------------------------------------------------- */ #include "lp_lib.h" #include "commonlib.h" #include "lp_utils.h" #include "lp_matrix.h" #include "lp_SOS.h" #include "lp_Hash.h" #include "lp_MPS.h" #include "lp_wlp.h" #include "lp_presolve.h" #include "lp_scale.h" #include "lp_simplex.h" #include "lp_mipbb.h" #include "lp_report.h" #include "lp_MDO.h" #include "lp_bit.h" #if INVERSE_ACTIVE==INVERSE_LUMOD #include "lp_LUMOD.h" #elif INVERSE_ACTIVE==INVERSE_LUSOL #include "lp_LUSOL.h" #elif INVERSE_ACTIVE==INVERSE_GLPKLU #include "lp_glpkLU.h" #elif INVERSE_ACTIVE==INVERSE_ETAPFI #include "lp_etaPFI.h" #elif INVERSE_ACTIVE==INVERSE_LEGACY #include "lp_etaPFI.h" #endif #if libBLAS > 0 #include "myblas.h" #endif #ifdef __BORLANDC__ #pragma hdrstop #pragma package(smart_init) #endif /* ---------------------------------------------------------------------------------- */ /* Include selected basis inverse routines and price norm scalars */ /* ---------------------------------------------------------------------------------- */ #include "lp_price.h" #include "lp_pricePSE.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Return lp_solve version information */ void __WINAPI lp_solve_version(int *majorversion, int *minorversion, int *release, int *build) { if(majorversion != NULL) (*majorversion) = MAJORVERSION; if(minorversion != NULL) (*minorversion) = MINORVERSION; if(release != NULL) (*release) = RELEASE; if(build != NULL) (*build) = BUILD; } /* ---------------------------------------------------------------------------------- */ /* Various interaction elements */ /* ---------------------------------------------------------------------------------- */ MYBOOL __WINAPI userabort(lprec *lp, int message) { MYBOOL abort; int spx_save; spx_save = lp->spx_status; lp->spx_status = RUNNING; if(yieldformessages(lp) != 0) { lp->spx_status = USERABORT; if(lp->bb_level > 0) lp->bb_break = TRUE; } if((message > 0) && (lp->usermessage != NULL) && (lp->msgmask & message)) lp->usermessage(lp, lp->msghandle, message); abort = (MYBOOL) (lp->spx_status != RUNNING); if(!abort) lp->spx_status = spx_save; return( abort ); } STATIC int yieldformessages(lprec *lp) { if((lp->sectimeout > 0) && ((timeNow()-lp->timestart)-(REAL)lp->sectimeout>0)) lp->spx_status = TIMEOUT; if(lp->ctrlc != NULL) { int retcode = lp->ctrlc(lp, lp->ctrlchandle); /* Check for command to restart the B&B */ if((retcode == ACTION_RESTART) && (lp->bb_level > 1)) { lp->bb_break = AUTOMATIC; retcode = 0; } return(retcode); } else return(0); } void __WINAPI set_outputstream(lprec *lp, FILE *stream) { if((lp->outstream != NULL) && (lp->outstream != stdout)) { if(lp->streamowned) fclose(lp->outstream); else fflush(lp->outstream); } if(stream == NULL) lp->outstream = stdout; else lp->outstream = stream; lp->streamowned = FALSE; } MYBOOL __WINAPI set_outputfile(lprec *lp, char *filename) { MYBOOL ok; FILE *output = stdout; ok = (MYBOOL) ((filename == NULL) || (*filename == 0) || ((output = fopen(filename,"w")) != NULL)); if(ok) { set_outputstream(lp, output); lp->streamowned = (MYBOOL) ((filename != NULL) && (*filename != 0)); #if 1 if((filename != NULL) && (*filename == 0)) lp->outstream = NULL; #endif } return(ok); } REAL __WINAPI time_elapsed(lprec *lp) { if(lp->timeend > 0) return(lp->timeend - lp->timestart); else return(timeNow() - lp->timestart); } void __WINAPI put_bb_nodefunc(lprec *lp, lphandleint_intfunc newnode, void *bbnodehandle) { lp->bb_usenode = newnode; lp->bb_nodehandle = bbnodehandle; /* User-specified "owner process ID" */ } void __WINAPI put_bb_branchfunc(lprec *lp, lphandleint_intfunc newbranch, void *bbbranchhandle) { lp->bb_usebranch = newbranch; lp->bb_branchhandle = bbbranchhandle; /* User-specified "owner process ID" */ } void __WINAPI put_abortfunc(lprec *lp, lphandle_intfunc newctrlc, void *ctrlchandle) { lp->ctrlc = newctrlc; lp->ctrlchandle = ctrlchandle; /* User-specified "owner process ID" */ } void __WINAPI put_logfunc(lprec *lp, lphandlestr_func newlog, void *loghandle) { lp->writelog = newlog; lp->loghandle = loghandle; /* User-specified "owner process ID" */ } void __WINAPI put_msgfunc(lprec *lp, lphandleint_func newmsg, void *msghandle, int mask) { lp->usermessage = newmsg; lp->msghandle = msghandle; /* User-specified "owner process ID" */ lp->msgmask = mask; } /* ---------------------------------------------------------------------------------- */ /* DLL exported function */ /* ---------------------------------------------------------------------------------- */ lprec * __WINAPI read_MPS(char *filename, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; if ((typeMPS & (MPSFIXED|MPSFREE)) == 0) typeMPS |= MPSFIXED; if(MPS_readfile(&lp, filename, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } lprec * __WINAPI read_mps(FILE *filename, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; if ((typeMPS & (MPSFIXED|MPSFREE)) == 0) typeMPS |= MPSFIXED; if(MPS_readhandle(&lp, filename, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } /* #if defined develop */ lprec * __WINAPI read_mpsex(void *userhandle, read_modeldata_func read_modeldata, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; if ((typeMPS & (MPSFIXED|MPSFREE)) == 0) typeMPS |= MPSFIXED; if(MPS_readex(&lp, userhandle, read_modeldata, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } /* #endif */ lprec * __WINAPI read_freeMPS(char *filename, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; typeMPS &= ~MPSFIXED; typeMPS |= MPSFREE; if(MPS_readfile(&lp, filename, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } lprec * __WINAPI read_freemps(FILE *filename, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; typeMPS &= ~MPSFIXED; typeMPS |= MPSFREE; if(MPS_readhandle(&lp, filename, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } /* #if defined develop */ lprec * __WINAPI read_freempsex(void *userhandle, read_modeldata_func read_modeldata, int options) { lprec *lp = NULL; int typeMPS; typeMPS = (options & ~0x07) >> 2; typeMPS &= ~MPSFIXED; typeMPS |= MPSFREE; if(MPS_readex(&lp, userhandle, read_modeldata, typeMPS, options & 0x07)) return( lp ); else return( NULL ); } /* #endif */ MYBOOL __WINAPI write_mps(lprec *lp, char *filename) { return(MPS_writefile(lp, MPSFIXED, filename)); } MYBOOL __WINAPI write_MPS(lprec *lp, FILE *output) { return(MPS_writehandle(lp, MPSFIXED, output)); } MYBOOL __WINAPI write_freemps(lprec *lp, char *filename) { return(MPS_writefile(lp, MPSFREE, filename)); } MYBOOL __WINAPI write_freeMPS(lprec *lp, FILE *output) { return(MPS_writehandle(lp, MPSFREE, output)); } MYBOOL __WINAPI write_lp(lprec *lp, char *filename) { return(LP_writefile(lp, filename)); } MYBOOL __WINAPI write_LP(lprec *lp, FILE *output) { return(LP_writehandle(lp, output)); } #ifndef PARSER_LP MYBOOL __WINAPI LP_readhandle(lprec **lp, FILE *filename, int verbose, char *lp_name) { return(FALSE); } lprec * __WINAPI read_lp(FILE *filename, int verbose, char *lp_name) { return(NULL); } lprec * __WINAPI read_LP(char *filename, int verbose, char *lp_name) { return(NULL); } #endif MYBOOL __WINAPI write_basis(lprec *lp, char *filename) { int typeMPS = MPSFIXED; return( MPS_writeBAS(lp, typeMPS, filename) ); } MYBOOL __WINAPI read_basis(lprec *lp, char *filename, char *info) { int typeMPS = MPSFIXED; typeMPS = MPS_readBAS(lp, typeMPS, filename, info); /* Code basis */ if(typeMPS) { set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); lp->basis_valid = TRUE; /* Do not re-initialize basis on entering Solve */ lp->var_basic[0] = FALSE; /* Set to signal that this is a non-default basis */ } return( (MYBOOL) typeMPS ); } /* Write and read lp_solve parameters (placeholders) - see lp_params.c */ void __WINAPI reset_params(lprec *lp) { int mode; lp->epsmachine = DEF_EPSMACHINE; lp->epsperturb = DEF_PERTURB; lp->lag_accept = DEF_LAGACCEPT; set_epslevel(lp, EPS_DEFAULT); lp->tighten_on_set = FALSE; lp->negrange = DEF_NEGRANGE; #if 0 lp->do_presolve = PRESOLVE_ROWS | PRESOLVE_COLS | PRESOLVE_MERGEROWS | PRESOLVE_REDUCEGCD | PRESOLVE_ROWDOMINATE; #else lp->do_presolve = PRESOLVE_NONE; #endif lp->presolveloops = DEF_MAXPRESOLVELOOPS; lp->scalelimit = DEF_SCALINGLIMIT; lp->scalemode = SCALE_INTEGERS | #if 0 SCALE_POWER2 | SCALE_LOGARITHMIC | SCALE_MEAN; #else SCALE_LINEAR | SCALE_GEOMETRIC | SCALE_EQUILIBRATE; #endif lp->crashmode = CRASH_NONE; lp->max_pivots = 0; lp->simplex_strategy = SIMPLEX_DUAL_PRIMAL; #define PricerDefaultOpt 1 #if PricerDefaultOpt == 1 mode = PRICER_DEVEX; #elif PricerDefaultOpt == 2 mode = PRICER_STEEPESTEDGE; mode |= PRICE_TRUENORMINIT; #else mode = PRICER_STEEPESTEDGE | PRICE_PRIMALFALLBACK; #endif mode |= PRICE_ADAPTIVE; #ifdef EnableRandomizedPricing mode |= PRICE_RANDOMIZE; #endif set_pivoting(lp, mode); lp->improve = IMPROVE_DEFAULT; lp->anti_degen = ANTIDEGEN_DEFAULT; lp->bb_floorfirst = BRANCH_AUTOMATIC; lp->bb_rule = NODE_DYNAMICMODE | NODE_GREEDYMODE | NODE_GAPSELECT | #if 1 NODE_PSEUDOCOSTSELECT | #else NODE_PSEUDOFEASSELECT | #endif NODE_RCOSTFIXING; lp->bb_limitlevel = DEF_BB_LIMITLEVEL; lp->bb_PseudoUpdates = DEF_PSEUDOCOSTUPDATES; lp->bb_heuristicOF = my_chsign(is_maxim(lp), MAX(DEF_INFINITE, lp->infinite)); lp->bb_breakOF = -lp->bb_heuristicOF; lp->sectimeout = 0; lp->solutionlimit = 1; set_outputstream(lp, NULL); /* Set to default output stream */ lp->verbose = NORMAL; lp->print_sol = FALSE; /* Can be FALSE, TRUE, AUTOMATIC (only non-zeros printed) */ lp->spx_trace = FALSE; lp->lag_trace = FALSE; lp->bb_trace = FALSE; } void __WINAPI unscale(lprec *lp) { undoscale(lp); } int __WINAPI solve(lprec *lp) { #if defined FPUexception catchFPU(_EM_INVALID | _EM_ZERODIVIDE | _EM_OVERFLOW | _EM_UNDERFLOW); #endif if(has_BFP(lp)) { lp->solvecount++; if(is_add_rowmode(lp)) set_add_rowmode(lp, FALSE); return(lin_solve(lp)); } else return( NOBFP ); } void __WINAPI print_lp(lprec *lp) { REPORT_lp(lp); } void __WINAPI print_tableau(lprec *lp) { REPORT_tableau(lp); } void __WINAPI print_objective(lprec *lp) { REPORT_objective(lp); } void __WINAPI print_solution(lprec *lp, int columns) { REPORT_solution(lp, columns); } void __WINAPI print_constraints(lprec *lp, int columns) { REPORT_constraints(lp, columns); } void __WINAPI print_duals(lprec *lp) { REPORT_duals(lp); } void __WINAPI print_scales(lprec *lp) { REPORT_scales(lp); } MYBOOL __WINAPI print_debugdump(lprec *lp, char *filename) { return(REPORT_debugdump(lp, filename, (MYBOOL) (get_total_iter(lp) > 0))); } void __WINAPI print_str(lprec *lp, char *str) { report(lp, lp->verbose, "%s", str); } /* ---------------------------------------------------------------------------------- */ /* Parameter setting and retrieval functions */ /* ---------------------------------------------------------------------------------- */ void __WINAPI set_timeout(lprec *lp, long sectimeout) { lp->sectimeout = sectimeout; } long __WINAPI get_timeout(lprec *lp) { return(lp->sectimeout); } void __WINAPI set_verbose(lprec *lp, int verbose) { lp->verbose = verbose; } int __WINAPI get_verbose(lprec *lp) { return(lp->verbose); } void __WINAPI set_print_sol(lprec *lp, int print_sol) { lp->print_sol = print_sol; } int __WINAPI get_print_sol(lprec *lp) { return(lp->print_sol); } void __WINAPI set_debug(lprec *lp, MYBOOL debug) { lp->bb_trace = debug; } MYBOOL __WINAPI is_debug(lprec *lp) { return(lp->bb_trace); } void __WINAPI set_trace(lprec *lp, MYBOOL trace) { lp->spx_trace = trace; } MYBOOL __WINAPI is_trace(lprec *lp) { return(lp->spx_trace); } void __WINAPI set_anti_degen(lprec *lp, int anti_degen) { lp->anti_degen = anti_degen; } int __WINAPI get_anti_degen(lprec *lp) { return(lp->anti_degen); } MYBOOL __WINAPI is_anti_degen(lprec *lp, int testmask) { return((MYBOOL) ((lp->anti_degen == testmask) || ((lp->anti_degen & testmask) != 0))); } void __WINAPI set_presolve(lprec *lp, int presolvemode, int maxloops) { presolvemode &= ~PRESOLVE_REDUCEMIP; /* disable PRESOLVE_REDUCEMIP since it is very rare that this is effective, and also that it adds code complications and delayed presolve effects that are not captured properly. */ lp->do_presolve = presolvemode; lp->presolveloops = maxloops; } int __WINAPI get_presolve(lprec *lp) { return(lp->do_presolve); } int __WINAPI get_presolveloops(lprec *lp) { if(lp->presolveloops < 0) return(DEF_MAXPRESOLVELOOPS); else if(lp->presolveloops == 0) return(MAXINT32); else return(lp->presolveloops); } MYBOOL __WINAPI is_presolve(lprec *lp, int testmask) { return((MYBOOL) ((lp->do_presolve == testmask) || ((lp->do_presolve & testmask) != 0))); } void __WINAPI set_maxpivot(lprec *lp, int maxpivot) { lp->max_pivots = maxpivot; } int __WINAPI get_maxpivot(lprec *lp) { return( lp->bfp_pivotmax(lp) ); } void __WINAPI set_bb_rule(lprec *lp, int bb_rule) { lp->bb_rule = bb_rule; } int __WINAPI get_bb_rule(lprec *lp) { return(lp->bb_rule); } /* INLINE */ MYBOOL is_bb_rule(lprec *lp, int bb_rule) { return( (MYBOOL) ((lp->bb_rule & NODE_STRATEGYMASK) == bb_rule) ); } /* INLINE */ MYBOOL is_bb_mode(lprec *lp, int bb_mask) { return( (MYBOOL) ((lp->bb_rule & bb_mask) > 0) ); } void __WINAPI set_action(int *actionvar, int actionmask) { *actionvar |= actionmask; } void __WINAPI clear_action(int *actionvar, int actionmask) { *actionvar &= ~actionmask; } MYBOOL __WINAPI is_action(int actionvar, int testmask) { return( (MYBOOL) ((actionvar & testmask) != 0) ); } void __WINAPI set_bb_depthlimit(lprec *lp, int bb_maxlevel) { lp->bb_limitlevel = bb_maxlevel; } int __WINAPI get_bb_depthlimit(lprec *lp) { return(lp->bb_limitlevel); } void __WINAPI set_obj_bound(lprec *lp, REAL bb_heuristicOF) { lp->bb_heuristicOF = bb_heuristicOF; } REAL __WINAPI get_obj_bound(lprec *lp) { return(lp->bb_heuristicOF); } void __WINAPI set_mip_gap(lprec *lp, MYBOOL absolute, REAL mip_gap) { if(absolute) lp->mip_absgap = mip_gap; else lp->mip_relgap = mip_gap; } REAL __WINAPI get_mip_gap(lprec *lp, MYBOOL absolute) { if(absolute) return(lp->mip_absgap); else return(lp->mip_relgap); } MYBOOL __WINAPI set_var_branch(lprec *lp, int colnr, int branch_mode) { if(colnr > lp->columns || colnr < 1) { report(lp, IMPORTANT, "set_var_branch: Column %d out of range\n", colnr); return( FALSE ); } if(lp->bb_varbranch == NULL) { int i; if(branch_mode == BRANCH_DEFAULT) return( TRUE ); allocMYBOOL(lp, &lp->bb_varbranch, lp->columns_alloc, FALSE); for(i = 0; i < lp->columns; i++) lp->bb_varbranch[i] = BRANCH_DEFAULT; } lp->bb_varbranch[colnr - 1] = (MYBOOL) branch_mode; return( TRUE ); } int __WINAPI get_var_branch(lprec *lp, int colnr) { if(colnr > lp->columns || colnr < 1) { report(lp, IMPORTANT, "get_var_branch: Column %d out of range\n", colnr); return(lp->bb_floorfirst); } if(lp->bb_varbranch == NULL) return(lp->bb_floorfirst); if(lp->bb_varbranch[colnr - 1] == BRANCH_DEFAULT) return(lp->bb_floorfirst); else return(lp->bb_varbranch[colnr - 1]); } static void set_infiniteex(lprec *lp, REAL infinite, MYBOOL init) { int i; infinite = fabs(infinite); if((init) || is_infinite(lp, lp->bb_heuristicOF)) lp->bb_heuristicOF = my_chsign(is_maxim(lp), infinite); if((init) || is_infinite(lp, lp->bb_breakOF)) lp->bb_breakOF = my_chsign(is_maxim(lp), -infinite); for(i = 0; i <= lp->sum; i++) { if((!init) && is_infinite(lp, lp->orig_lowbo[i])) lp->orig_lowbo[i] = -infinite; if((init) || is_infinite(lp, lp->orig_upbo[i])) lp->orig_upbo[i] = infinite; } lp->infinite = infinite; } MYBOOL __WINAPI is_infinite(lprec *lp, REAL value) { #if 1 return( (MYBOOL) (fabs(value) >= lp->infinite) ); #else if(fabs(value) >= lp->infinite) return( TRUE ); else return( FALSE ); #endif } void __WINAPI set_infinite(lprec *lp, REAL infinite) { set_infiniteex(lp, infinite, FALSE); } REAL __WINAPI get_infinite(lprec *lp) { return(lp->infinite); } void __WINAPI set_epsperturb(lprec *lp, REAL epsperturb) { lp->epsperturb = epsperturb; } REAL __WINAPI get_epsperturb(lprec *lp) { return(lp->epsperturb); } void __WINAPI set_epspivot(lprec *lp, REAL epspivot) { lp->epspivot = epspivot; } REAL __WINAPI get_epspivot(lprec *lp) { return(lp->epspivot); } void __WINAPI set_epsint(lprec *lp, REAL epsint) { lp->epsint = epsint; } REAL __WINAPI get_epsint(lprec *lp) { return(lp->epsint); } void __WINAPI set_epsb(lprec *lp, REAL epsb) { lp->epsprimal = MAX(epsb, lp->epsmachine); } REAL __WINAPI get_epsb(lprec *lp) { return(lp->epsprimal); } void __WINAPI set_epsd(lprec *lp, REAL epsd) { lp->epsdual = MAX(epsd, lp->epsmachine); /* Mainly used as tolerance for reduced cost */ } REAL __WINAPI get_epsd(lprec *lp) { return(lp->epsdual); } void __WINAPI set_epsel(lprec *lp, REAL epsel) { lp->epsvalue = MAX(epsel, lp->epsmachine); } REAL __WINAPI get_epsel(lprec *lp) { return(lp->epsvalue); } MYBOOL __WINAPI set_epslevel(lprec *lp, int epslevel) { REAL SPX_RELAX, MIP_RELAX; switch(epslevel) { case EPS_TIGHT: SPX_RELAX = 1; MIP_RELAX = 1; break; case EPS_MEDIUM: SPX_RELAX = 10; MIP_RELAX = 1; break; case EPS_LOOSE: SPX_RELAX = 100; MIP_RELAX = 10; break; case EPS_BAGGY: SPX_RELAX = 1000; MIP_RELAX = 100; break; default: return( FALSE ); } lp->epsvalue = SPX_RELAX*DEF_EPSVALUE; lp->epsprimal = SPX_RELAX*DEF_EPSPRIMAL; lp->epsdual = SPX_RELAX*DEF_EPSDUAL; lp->epspivot = SPX_RELAX*DEF_EPSPIVOT; lp->epssolution= MIP_RELAX*DEF_EPSSOLUTION; lp->epsint = MIP_RELAX*DEF_EPSINT; lp->mip_absgap = MIP_RELAX*DEF_MIP_GAP; lp->mip_relgap = MIP_RELAX*DEF_MIP_GAP; return( TRUE ); } void __WINAPI set_scaling(lprec *lp, int scalemode) { lp->scalemode = scalemode; } int __WINAPI get_scaling(lprec *lp) { return(lp->scalemode); } MYBOOL __WINAPI is_scalemode(lprec *lp, int testmask) { return((MYBOOL) ((lp->scalemode & testmask) != 0)); } MYBOOL __WINAPI is_scaletype(lprec *lp, int scaletype) { int testtype; testtype = lp->scalemode & SCALE_MAXTYPE; return((MYBOOL) (scaletype == testtype)); } void __WINAPI set_scalelimit(lprec *lp, REAL scalelimit) /* Set the relative scaling convergence criterion for the active scaling mode; the integer part specifies the maximum number of iterations (default = 5). */ { lp->scalelimit = fabs(scalelimit); } REAL __WINAPI get_scalelimit(lprec *lp) { return(lp->scalelimit); } MYBOOL __WINAPI is_integerscaling(lprec *lp) { return(is_scalemode(lp, SCALE_INTEGERS)); } void __WINAPI set_improve(lprec *lp, int improve) { lp->improve = improve; } int __WINAPI get_improve(lprec *lp) { return(lp->improve); } void __WINAPI set_lag_trace(lprec *lp, MYBOOL lag_trace) { lp->lag_trace = lag_trace; } MYBOOL __WINAPI is_lag_trace(lprec *lp) { return(lp->lag_trace); } void __WINAPI set_pivoting(lprec *lp, int pivoting) { /* Set new pivoting strategy */ lp->piv_strategy = pivoting; report(lp, DETAILED, "set_pivoting: Pricing strategy set to '%s'\n", get_str_piv_rule(get_piv_rule(lp))); } int __WINAPI get_pivoting(lprec *lp) { return( lp->piv_strategy ); } /* INLINE */ int get_piv_rule(lprec *lp) { return( (lp->piv_strategy | PRICE_STRATEGYMASK) ^ PRICE_STRATEGYMASK ); } STATIC char *get_str_piv_rule(int rule) { static char *pivotText[PRICER_LASTOPTION+1] = {"Bland first index", "Dantzig", "Devex", "Steepest Edge"}; return( pivotText[rule] ); } MYBOOL __WINAPI is_piv_rule(lprec *lp, int rule) { return( (MYBOOL) (get_piv_rule(lp) == rule) ); } MYBOOL __WINAPI is_piv_mode(lprec *lp, int testmask) { return((MYBOOL) (((testmask & PRICE_STRATEGYMASK) != 0) && ((lp->piv_strategy & testmask) != 0))); } void __WINAPI set_break_at_first(lprec *lp, MYBOOL break_at_first) { lp->bb_breakfirst = break_at_first; } MYBOOL __WINAPI is_break_at_first(lprec *lp) { return(lp->bb_breakfirst); } void __WINAPI set_bb_floorfirst(lprec *lp, int bb_floorfirst) { lp->bb_floorfirst = (MYBOOL) bb_floorfirst; } int __WINAPI get_bb_floorfirst(lprec *lp) { return(lp->bb_floorfirst); } void __WINAPI set_break_at_value(lprec *lp, REAL break_at_value) { lp->bb_breakOF = break_at_value; } REAL __WINAPI get_break_at_value(lprec *lp) { return(lp->bb_breakOF); } void __WINAPI set_negrange(lprec *lp, REAL negrange) { if(negrange <= 0) lp->negrange = negrange; else lp->negrange = 0.0; } REAL __WINAPI get_negrange(lprec *lp) { return(lp->negrange); } int __WINAPI get_max_level(lprec *lp) { return(lp->bb_maxlevel); } COUNTER __WINAPI get_total_nodes(lprec *lp) { return(lp->bb_totalnodes); } COUNTER __WINAPI get_total_iter(lprec *lp) { return(lp->total_iter + lp->current_iter); } REAL __WINAPI get_objective(lprec *lp) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_objective: Not a valid basis\n"); return(0.0); } return( lp->best_solution[0] ); } int __WINAPI get_nonzeros(lprec *lp) { return( mat_nonzeros(lp->matA) ); } MYBOOL __WINAPI set_mat(lprec *lp, int rownr, int colnr, REAL value) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "set_mat: Row %d out of range\n", rownr); return( FALSE ); } if((colnr < 1) || (colnr > lp->columns)) { report(lp, IMPORTANT, "set_mat: Column %d out of range\n", colnr); return( FALSE ); } #ifdef DoMatrixRounding if(rownr == 0) value = roundToPrecision(value, lp->matA->epsvalue); #endif value = scaled_mat(lp, value, rownr, colnr); if(rownr == 0) { lp->orig_obj[colnr] = my_chsign(is_chsign(lp, rownr), value); return( TRUE ); } else return( mat_setvalue(lp->matA, rownr, colnr, value, FALSE) ); } REAL __WINAPI get_working_objective(lprec *lp) { REAL value = 0.0; if(!lp->basis_valid) report(lp, CRITICAL, "get_working_objective: Not a valid basis\n"); else if((lp->spx_status == RUNNING) && (lp->solutioncount == 0)) value = my_chsign(!is_maxim(lp), lp->rhs[0]); else value = lp->solution[0]; return(value); } REAL __WINAPI get_var_primalresult(lprec *lp, int index) { if((index < 0) || (index > lp->presolve_undo->orig_sum)) { report(lp, IMPORTANT, "get_var_primalresult: Index %d out of range\n", index); return( 0.0 ); } if((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE) return( lp->full_solution[index] ); else return( lp->best_solution[index] ); } REAL __WINAPI get_var_dualresult(lprec *lp, int index) { REAL *duals; if((index < 0) || (index > lp->presolve_undo->orig_sum)) { report(lp, IMPORTANT, "get_var_dualresult: Index %d out of range\n", index); return( 0.0 ); } if(index == 0) return( lp->best_solution[0] ); /* Make sure we actually have dual information available */ if(!get_ptr_sensitivity_rhs(lp, &duals, NULL, NULL)) return( 0.0 ); else duals = ((lp->full_duals == NULL) ? lp->duals : lp->full_duals); return( duals[index] ); } MYBOOL __WINAPI get_variables(lprec *lp, REAL *var) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_variables: Not a valid basis\n"); return(FALSE); } MEMCOPY(var, lp->best_solution + (1 + lp->rows), lp->columns); return(TRUE); } MYBOOL __WINAPI get_ptr_variables(lprec *lp, REAL **var) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_ptr_variables: Not a valid basis\n"); return(FALSE); } if(var != NULL) *var = lp->best_solution + (1 + lp->rows); return(TRUE); } MYBOOL __WINAPI get_constraints(lprec *lp, REAL *constr) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_constraints: Not a valid basis\n"); return(FALSE); } MEMCOPY(constr, lp->best_solution + 1, lp->rows); return(TRUE); } MYBOOL __WINAPI get_ptr_constraints(lprec *lp, REAL **constr) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_ptr_constraints: Not a valid basis\n"); return(FALSE); } if(constr != NULL) *constr = lp->best_solution + 1; return(TRUE); } MYBOOL __WINAPI get_sensitivity_rhs(lprec *lp, REAL *duals, REAL *dualsfrom, REAL *dualstill) { REAL *duals0, *dualsfrom0, *dualstill0; if(!lp->basis_valid) { report(lp, CRITICAL, "get_sensitivity_rhs: Not a valid basis\n"); return(FALSE); } if(!get_ptr_sensitivity_rhs(lp, (duals != NULL) ? &duals0 : NULL, (dualsfrom != NULL) ? &dualsfrom0 : NULL, (dualstill != NULL) ? &dualstill0 : NULL)) return(FALSE); if(duals != NULL) MEMCOPY(duals, duals0, lp->sum); if(dualsfrom != NULL) MEMCOPY(dualsfrom, dualsfrom0, lp->sum); if(dualstill != NULL) MEMCOPY(dualstill, dualstill0, lp->sum); return(TRUE); } MYBOOL __WINAPI get_ptr_sensitivity_rhs(lprec *lp, REAL **duals, REAL **dualsfrom, REAL **dualstill) { if(!lp->basis_valid) { report(lp, CRITICAL, "get_ptr_sensitivity_rhs: Not a valid basis\n"); return(FALSE); } if(duals != NULL) { if(lp->duals == NULL) { if((MIP_count(lp) > 0) && (lp->bb_totalnodes > 0)) { report(lp, CRITICAL, "get_ptr_sensitivity_rhs: Sensitivity unknown\n"); return(FALSE); } if(!construct_duals(lp)) return(FALSE); } *duals = lp->duals + 1; } if((dualsfrom != NULL) || (dualstill != NULL)) { if((lp->dualsfrom == NULL) || (lp->dualstill == NULL)) { if((MIP_count(lp) > 0) && (lp->bb_totalnodes > 0)) { report(lp, CRITICAL, "get_ptr_sensitivity_rhs: Sensitivity unknown\n"); return(FALSE); } construct_sensitivity_duals(lp); if((lp->dualsfrom == NULL) || (lp->dualstill == NULL)) return(FALSE); } if(dualsfrom != NULL) *dualsfrom = lp->dualsfrom + 1; if(dualstill != NULL) *dualstill = lp->dualstill + 1; } return(TRUE); } MYBOOL __WINAPI get_sensitivity_objex(lprec *lp, REAL *objfrom, REAL *objtill, REAL *objfromvalue, REAL *objtillvalue) { REAL *objfrom0, *objtill0, *objfromvalue0, *objtillvalue0; if(!lp->basis_valid) { report(lp, CRITICAL, "get_sensitivity_objex: Not a valid basis\n"); return(FALSE); } if(!get_ptr_sensitivity_objex(lp, (objfrom != NULL) ? &objfrom0 : NULL, (objtill != NULL) ? &objtill0 : NULL, (objfromvalue != NULL) ? &objfromvalue0 : NULL, (objtillvalue != NULL) ? &objtillvalue0 : NULL)) return(FALSE); if((objfrom != NULL) && (objfrom0 != NULL)) MEMCOPY(objfrom, objfrom0, lp->columns); if((objtill != NULL) && (objtill0 != NULL)) MEMCOPY(objtill, objtill0, lp->columns); if((objfromvalue != NULL) && (objfromvalue0 != NULL)) MEMCOPY(objfromvalue, objfromvalue0, lp->columns); if((objtillvalue != NULL) && (objtillvalue0 != NULL)) MEMCOPY(objtillvalue, objtillvalue0, lp->columns); return(TRUE); } MYBOOL __WINAPI get_sensitivity_obj(lprec *lp, REAL *objfrom, REAL *objtill) { return(get_sensitivity_objex(lp, objfrom, objtill, NULL, NULL)); } MYBOOL __WINAPI get_ptr_sensitivity_objex(lprec *lp, REAL **objfrom, REAL **objtill, REAL **objfromvalue, REAL **objtillvalue) { if(!lp->basis_valid) { report(lp, CRITICAL, "get_ptr_sensitivity_objex: Not a valid basis\n"); return(FALSE); } if((objfrom != NULL) || (objtill != NULL)) { if((lp->objfrom == NULL) || (lp->objtill == NULL)) { if((MIP_count(lp) > 0) && (lp->bb_totalnodes > 0)) { report(lp, CRITICAL, "get_ptr_sensitivity_objex: Sensitivity unknown\n"); return(FALSE); } construct_sensitivity_obj(lp); if((lp->objfrom == NULL) || (lp->objtill == NULL)) return(FALSE); } if(objfrom != NULL) *objfrom = lp->objfrom + 1; if(objtill != NULL) *objtill = lp->objtill + 1; } if((objfromvalue != NULL) /* || (objtillvalue != NULL) */) { if((lp->objfromvalue == NULL) /* || (lp->objtillvalue == NULL) */) { if((MIP_count(lp) > 0) && (lp->bb_totalnodes > 0)) { report(lp, CRITICAL, "get_ptr_sensitivity_objex: Sensitivity unknown\n"); return(FALSE); } construct_sensitivity_duals(lp); if((lp->objfromvalue == NULL) /* || (lp->objtillvalue == NULL) */) return(FALSE); } } if(objfromvalue != NULL) *objfromvalue = lp->objfromvalue + 1; if(objtillvalue != NULL) *objtillvalue = NULL /* lp->objtillvalue + 1 */; return(TRUE); } MYBOOL __WINAPI get_ptr_sensitivity_obj(lprec *lp, REAL **objfrom, REAL **objtill) { return(get_ptr_sensitivity_objex(lp, objfrom, objtill, NULL, NULL)); } void __WINAPI set_solutionlimit(lprec *lp, int limit) { lp->solutionlimit = limit; } int __WINAPI get_solutionlimit(lprec *lp) { return(lp->solutionlimit); } int __WINAPI get_solutioncount(lprec *lp) { return(lp->solutioncount); } int __WINAPI get_Nrows(lprec *lp) { return(lp->rows); } int __WINAPI get_Norig_rows(lprec *lp) { if(lp->varmap_locked) return(lp->presolve_undo->orig_rows); else return(lp->rows); } int __WINAPI get_Lrows(lprec *lp) { if(lp->matL == NULL) return( 0 ); else return( lp->matL->rows ); } int __WINAPI get_Ncolumns(lprec *lp) { return(lp->columns); } int __WINAPI get_Norig_columns(lprec *lp) { if(lp->varmap_locked) return(lp->presolve_undo->orig_columns); else return(lp->columns); } /* ---------------------------------------------------------------------------------- */ /* Core routines for lp_solve */ /* ---------------------------------------------------------------------------------- */ int __WINAPI get_status(lprec *lp) { return(lp->spx_status); } char * __WINAPI get_statustext(lprec *lp, int statuscode) { if (statuscode == NOBFP) return("No basis factorization package"); else if (statuscode == DATAIGNORED) return("Invalid input data provided"); else if (statuscode == NOMEMORY) return("Not enough memory available"); else if (statuscode == NOTRUN) return("Model has not been optimized"); else if (statuscode == OPTIMAL) return("OPTIMAL solution"); else if (statuscode == SUBOPTIMAL) return("SUB-OPTIMAL solution"); else if (statuscode == INFEASIBLE) return("Model is primal INFEASIBLE"); else if (statuscode == UNBOUNDED) return("Model is primal UNBOUNDED"); else if (statuscode == RUNNING) return("lp_solve is currently running"); else if (statuscode == NUMFAILURE) return("NUMERIC FAILURE encountered"); else if (statuscode == DEGENERATE) return("DEGENERATE situation"); else if (statuscode == USERABORT) return("User-requested termination"); else if (statuscode == TIMEOUT) return("Termination due to timeout"); else if (statuscode == PRESOLVED) return("Model solved by presolve"); else if (statuscode == PROCFAIL) return("B&B routine failed"); else if (statuscode == PROCBREAK) return("B&B routine terminated"); else if (statuscode == FEASFOUND) return("Feasible B&B solution found"); else if (statuscode == NOFEASFOUND) return("No feasible B&B solution found"); else if (statuscode == FATHOMED) return("Fathomed/pruned branch"); else return("Undefined internal error"); } MYBOOL __WINAPI is_obj_in_basis(lprec *lp) { return( lp->obj_in_basis ); } void __WINAPI set_obj_in_basis(lprec *lp, MYBOOL obj_in_basis) { lp->obj_in_basis = (MYBOOL) (obj_in_basis == TRUE); } lprec * __WINAPI make_lp(int rows, int columns) { lprec *lp; # if defined FORTIFY /* Fortify_EnterScope(); */ # endif if(rows < 0 || columns < 0) return(NULL); lp = (lprec*) calloc(1, sizeof(*lp)); if(!lp) return(NULL); set_lp_name(lp, NULL); lp->names_used = FALSE; lp->use_row_names = TRUE; lp->use_col_names = TRUE; lp->rowcol_name = NULL; /* Do standard initializations ------------------------------------------------------------ */ #if 1 lp->obj_in_basis = DEF_OBJINBASIS; #else lp->obj_in_basis = FALSE; #endif lp->verbose = NORMAL; set_callbacks(lp); set_BFP(lp, NULL); set_XLI(lp, NULL); #if libBLAS > 0 init_BLAS(); #if libBLAS > 1 if(is_nativeBLAS() && !load_BLAS(libnameBLAS)) /*report(lp, "make_lp: Could not load external BLAS library '%s'.\n", libnameBLAS)*/; #endif #endif /* Define the defaults for key user-settable values --------------------------------------- */ reset_params(lp); /* Do other initializations --------------------------------------------------------------- */ lp->source_is_file = FALSE; lp->model_is_pure = TRUE; lp->model_is_valid = FALSE; lp->spx_status = NOTRUN; lp->lag_status = NOTRUN; lp->workarrays = mempool_create(lp); lp->wasPreprocessed = FALSE; lp->wasPresolved = FALSE; presolve_createUndo(lp); lp->bb_varactive = NULL; lp->bb_varbranch = NULL; lp->var_priority = NULL; lp->rhsmax = 0.0; lp->bigM = 0.0; lp->bb_deltaOF = 0.0; lp->equalities = 0; lp->fixedvars = 0; lp->int_vars = 0; lp->sc_vars = 0; lp->sos_ints = 0; lp->sos_vars = 0; lp->sos_priority = NULL; lp->rows_alloc = 0; lp->columns_alloc = 0; lp->sum_alloc = 0; lp->rows = rows; lp->columns = columns; lp->sum = rows + columns; varmap_clear(lp); lp->matA = mat_create(lp, rows, columns, lp->epsvalue); lp->matL = NULL; lp->invB = NULL; lp->duals = NULL; lp->dualsfrom = NULL; lp->dualstill = NULL; lp->objfromvalue = NULL; lp->objfrom = NULL; lp->objtill = NULL; inc_col_space(lp, columns + 1); inc_row_space(lp, rows + 1); /* Avoid bound-checker uninitialized variable error */ lp->orig_lowbo[0] = 0; lp->rootbounds = NULL; lp->bb_bounds = NULL; lp->bb_basis = NULL; lp->basis_valid = FALSE; lp->simplex_mode = SIMPLEX_DYNAMIC; lp->scaling_used = FALSE; lp->columns_scaled = FALSE; lp->P1extraDim = 0; lp->P1extraVal = 0.0; lp->bb_strongbranches = 0; lp->current_iter = 0; lp->total_iter = 0; lp->current_bswap = 0; lp->total_bswap = 0; lp->solutioncount = 0; lp->solvecount = 0; allocINT(lp, &lp->rejectpivot, DEF_MAXPIVOTRETRY + 1, TRUE); set_minim(lp); set_infiniteex(lp, DEF_INFINITE, TRUE); initPricer(lp); /* Call-back routines by KE */ lp->ctrlc = NULL; lp->ctrlchandle = NULL; lp->writelog = NULL; lp->loghandle = NULL; lp->debuginfo = NULL; lp->usermessage = NULL; lp->msgmask = MSG_NONE; lp->msghandle = NULL; lp->timecreate = timeNow(); return(lp); } MYBOOL __WINAPI resize_lp(lprec *lp, int rows, int columns) { MYBOOL status = TRUE; if(columns > lp->columns) status = inc_col_space(lp, columns - lp->columns); else while(status && (lp->columns > columns)) { status = del_column(lp, lp->columns); } if(status && (rows > lp->rows)) status = inc_row_space(lp, rows - lp->rows); else while(status && (lp->rows > rows)) { status = del_constraint(lp, lp->rows); } return( status ); } void __WINAPI free_lp(lprec **plp) { if(plp != NULL) { lprec *lp = *plp; if(lp != NULL) delete_lp(lp); *plp = NULL; } } void __WINAPI delete_lp(lprec *lp) { if(lp == NULL) return; FREE(lp->rowcol_name); FREE(lp->lp_name); FREE(lp->ex_status); if(lp->names_used) { FREE(lp->row_name); FREE(lp->col_name); free_hash_table(lp->rowname_hashtab); free_hash_table(lp->colname_hashtab); } mat_free(&lp->matA); lp->bfp_free(lp); #if LoadInverseLib == TRUE if(lp->hBFP != NULL) set_BFP(lp, NULL); #endif #if LoadLanguageLib == TRUE if(lp->hXLI != NULL) set_XLI(lp, NULL); #endif unset_OF_p1extra(lp); FREE(lp->orig_obj); FREE(lp->orig_rhs); FREE(lp->rhs); FREE(lp->var_type); set_var_weights(lp, NULL); FREE(lp->bb_varbranch); FREE(lp->sc_lobound); FREE(lp->var_is_free); FREE(lp->orig_upbo); FREE(lp->orig_lowbo); FREE(lp->upbo); FREE(lp->lowbo); FREE(lp->var_basic); FREE(lp->is_basic); FREE(lp->is_lower); if(lp->bb_PseudoCost != NULL) { /* report(lp, SEVERE, "delete_lp: The B&B pseudo-cost array was not cleared on delete\n"); */ free_pseudocost(lp); } if(lp->bb_bounds != NULL) { report(lp, SEVERE, "delete_lp: The stack of B&B levels was not empty (failed at %.0f nodes)\n", (double) lp->bb_totalnodes); unload_BB(lp); } if(lp->bb_basis != NULL) { /* report(lp, SEVERE, "delete_lp: The stack of saved bases was not empty on delete\n"); */ unload_basis(lp, FALSE); } FREE(lp->rejectpivot); partial_freeBlocks(&(lp->rowblocks)); partial_freeBlocks(&(lp->colblocks)); multi_free(&(lp->multivars)); multi_free(&(lp->longsteps)); FREE(lp->solution); FREE(lp->best_solution); FREE(lp->full_solution); presolve_freeUndo(lp); mempool_free(&(lp->workarrays)); freePricer(lp); FREE(lp->drow); FREE(lp->nzdrow); FREE(lp->duals); FREE(lp->full_duals); FREE(lp->dualsfrom); FREE(lp->dualstill); FREE(lp->objfromvalue); FREE(lp->objfrom); FREE(lp->objtill); FREE(lp->row_type); if(lp->sos_vars > 0) FREE(lp->sos_priority); free_SOSgroup(&(lp->SOS)); free_SOSgroup(&(lp->GUB)); freecuts_BB(lp); if(lp->scaling_used) FREE(lp->scalars); if(lp->matL != NULL) { FREE(lp->lag_rhs); FREE(lp->lambda); FREE(lp->lag_con_type); mat_free(&lp->matL); } if(lp->streamowned) set_outputstream(lp, NULL); #if libBLAS > 0 if(!is_nativeBLAS()) unload_BLAS(); #endif FREE(lp); # if defined FORTIFY /* Fortify_LeaveScope(); */ # endif } static MYBOOL get_SOS(lprec *lp, int index, char *name, int *sostype, int *priority, int *count, int *sosvars, REAL *weights) { SOSrec *SOS; if((index < 1) || (index > SOS_count(lp))) return( FALSE ); SOS = lp->SOS->sos_list[index-1]; if(name != NULL) strcpy(name, SOS->name); if(sostype != NULL) *sostype = SOS->type; if(priority != NULL) *priority = SOS->priority; if(count != NULL) { *count = SOS->size; if(sosvars != NULL) { int i; for(i = 1; i <= *count; i++) { sosvars[i-1] = SOS->members[i]; if(weights != NULL) weights[i-1] = SOS->weights[i]; } } } return( TRUE ); } /* Make a copy of the existing model using (mostly) high-level construction routines to simplify future maintainance. */ lprec* __WINAPI copy_lp(lprec *lp) { int i, n, *idx = NULL; REAL hold, *val = NULL, infinite; lprec *newlp = NULL; char buf[256], ok = FALSE; int sostype, priority, count, *sosvars, rows, columns; REAL *weights; #if 0 if(lp->wasPresolved) return( newlp ); #endif rows = get_Nrows(lp); columns = get_Ncolumns(lp); if(!allocINT(lp, &idx, rows+1, FALSE) || !allocREAL(lp, &val, rows+1, FALSE)) goto Finish; /* Create the new object */ newlp = make_lp(rows, 0); if(newlp == NULL) goto Finish; if(!resize_lp(newlp, rows, columns)) goto Finish; set_sense(newlp, is_maxim(lp)); set_use_names(newlp, FALSE, is_use_names(lp, FALSE)); set_use_names(newlp, TRUE, is_use_names(lp, TRUE)); if(!set_lp_name(newlp, get_lp_name(lp))) goto Finish; /* set_algopt(newlp, get_algopt(lp)); */ /* v6 */ set_verbose(newlp, get_verbose(lp)); /* Transfer standard simplex parameters */ set_epspivot(newlp, get_epspivot(lp)); set_epsel(newlp, get_epsel(lp)); set_epsb(newlp, get_epsb(lp)); set_epsd(newlp, get_epsd(lp)); set_pivoting(newlp, get_pivoting(lp)); set_negrange(newlp, lp->negrange); set_infinite(newlp, get_infinite(lp)); set_presolve(newlp, get_presolve(lp), get_presolveloops(lp)); set_scaling(newlp, get_scaling(lp)); set_scalelimit(newlp, get_scalelimit(lp)); set_simplextype(newlp, get_simplextype(lp)); set_epsperturb(newlp, get_epsperturb(lp)); set_anti_degen(newlp, get_anti_degen(lp)); set_improve(newlp, get_improve(lp)); set_basiscrash(newlp, get_basiscrash(lp)); set_maxpivot(newlp, get_maxpivot(lp)); set_timeout(newlp, get_timeout(lp)); /* Transfer MILP parameters */ set_epsint(newlp, get_epsint(lp)); set_bb_rule(newlp, get_bb_rule(lp)); set_bb_depthlimit(newlp, get_bb_depthlimit(lp)); set_bb_floorfirst(newlp, get_bb_floorfirst(lp)); set_mip_gap(newlp, TRUE, get_mip_gap(lp, TRUE)); set_mip_gap(newlp, FALSE, get_mip_gap(lp, FALSE)); set_break_at_first(newlp, is_break_at_first(lp)); set_break_at_value(newlp, get_break_at_value(lp)); /* Set RHS and range */ infinite = get_infinite(lp); for(i = 0; i <= rows; i++) { if(i > 0) if(!set_constr_type(newlp, i, get_constr_type(lp, i))) goto Finish; if(!set_rh(newlp, i, get_rh(lp, i))) goto Finish; if((i > 0) && ((hold = get_rh_range(lp, i)) < infinite)) if(!set_rh_range(newlp, i, hold)) goto Finish; if(lp->names_used && lp->use_row_names && (lp->row_name[i] != NULL) && (lp->row_name[i]->name != NULL)) if(!set_row_name(newlp, i, get_row_name(lp, i))) goto Finish; } /* Load the constraint matrix and variable definitions */ for(i = 1; i <= columns; i++) { n = get_columnex(lp, i, val, idx); if ((n < 0) || (!add_columnex(newlp, n, val, idx))) goto Finish; if(is_binary(lp, i)) { if (!set_binary(newlp, i, TRUE)) goto Finish; } else { if(is_int(lp, i)) if(!set_int(newlp, i, TRUE)) goto Finish; if((hold = get_lowbo(lp, i)) != 0) if(!set_lowbo(newlp, i, hold)) goto Finish; if((hold = get_upbo(lp, i)) < infinite) if(!set_upbo(newlp, i, hold)) goto Finish; } if(is_semicont(lp, i)) if(!set_semicont(newlp, i, TRUE)) goto Finish; if(lp->names_used && lp->use_col_names && (lp->col_name[i] != NULL) && (lp->col_name[i]->name != NULL)) if(!set_col_name(newlp, i, get_col_name(lp, i))) goto Finish; } /* copy SOS data */ for(i = 1; get_SOS(lp, i, buf, &sostype, &priority, &count, NULL, NULL); i++) if (count) { if(!allocINT(lp, &sosvars, count, FALSE) || !allocREAL(lp, &weights, count, FALSE)) n = 0; else { get_SOS(lp, i, buf, &sostype, &priority, &count, sosvars, weights); n = add_SOS(newlp, buf, sostype, priority, count, sosvars, weights); } FREE(weights); FREE(sosvars); if(n == 0) goto Finish; } #if 0 /* Other parameters set if the source model was previously solved */ if(lp->solvecount > 0) { MEMCOPY(newlp->scalars, lp->scalars, lp->sum+1); MEMCOPY(newlp->var_basic, lp->var_basic, rows+1); MEMCOPY(newlp->is_basic, lp->is_basic, lp->sum+1); MEMCOPY(newlp->is_lower, lp->is_lower, lp->sum+1); MEMCOPY(newlp->solution, lp->solution, lp->sum+1); if(lp->duals != NULL) { allocREAL(newlp, &newlp->duals, newlp->sum_alloc+1, FALSE); MEMCOPY(newlp->duals, lp->duals, lp->sum+1); } newlp->solutioncount = lp->solutioncount; newlp->solvecount = lp->solvecount; } #endif ok = TRUE; /* Clean up before returning */ Finish: if(!ok) free_lp(&newlp); FREE(val); FREE(idx); return( newlp ); } MYBOOL __WINAPI dualize_lp(lprec *lp) { int i, n; MATrec *mat = lp->matA; REAL *item; /* Are we allowed to perform the operation? */ if((MIP_count(lp) > 0) || (lp->solvecount > 0)) return( FALSE ); /* Modify sense */ set_sense(lp, (MYBOOL) !is_maxim(lp)); /* Transpose matrix and reverse signs */ n = mat_nonzeros(mat); mat_transpose(mat); item = &COL_MAT_VALUE(0); for(i = 0; i < n; i++, item += matValueStep) *item *= -1; /* Row-column swap other vectors */ swapINT(&lp->rows, &lp->columns); swapINT(&lp->rows_alloc, &lp->columns_alloc); swapREAL(lp->orig_rhs, lp->orig_obj); if ((lp->rhs != NULL) && (lp->obj != NULL)) swapREAL(lp->rhs, lp->obj); /* Reallocate storage */ /* var_type sc_bound solution best_solution full_solution duals */ /* Shift variable bounds */ /* is_basic orig_upbo orig_lowbo scalars */ return( TRUE ); } /* Optimize memory usage */ STATIC MYBOOL memopt_lp(lprec *lp, int rowextra, int colextra, int nzextra) { MYBOOL status = FALSE; if(lp == NULL) return( status ); status = mat_memopt(lp->matA, rowextra, colextra, nzextra) && (++rowextra > 0) && (++colextra > 0) && (++nzextra > 0); #if 0 /* inc_ routines not well-tested for reduction in size allocation */ if(status) { int colalloc = lp->columns_alloc - MIN(lp->columns_alloc, lp->columns + colextra), rowalloc = lp->rows_alloc - MIN(lp->rows_alloc, lp->rows + rowextra); status = inc_lag_space(lp, rowalloc, FALSE) && inc_row_space(lp, rowalloc) && inc_col_space(lp, colalloc); } #endif return( status ); } /* Utility routine group for constraint and column deletion/insertion mapping in relation to the original set of constraints and columns */ STATIC void varmap_lock(lprec *lp) { presolve_fillUndo(lp, lp->rows, lp->columns, TRUE); lp->varmap_locked = TRUE; } STATIC void varmap_clear(lprec *lp) { presolve_setOrig(lp, 0, 0); lp->varmap_locked = FALSE; } STATIC MYBOOL varmap_canunlock(lprec *lp) { /* Don't do anything if variables aren't locked yet */ if(lp->varmap_locked) { int i; presolveundorec *psundo = lp->presolve_undo; /* Check for the obvious */ if(/*lp->names_used || (psundo->orig_columns != lp->columns) || (psundo->orig_rows != lp->rows)) */ (psundo->orig_columns > lp->columns) || (psundo->orig_rows > lp->rows)) return( FALSE ); /* Check for deletions */ for(i = psundo->orig_rows + psundo->orig_columns; i > 0; i--) if(psundo->orig_to_var[i] == 0) return( FALSE ); /* Check for insertions */ for(i = lp->sum; i > 0; i--) if(psundo->var_to_orig[i] == 0) return( FALSE ); } return( TRUE ); } STATIC void varmap_add(lprec *lp, int base, int delta) { int i, ii; presolveundorec *psundo = lp->presolve_undo; /* Don't do anything if variables aren't locked yet */ if(!lp->varmap_locked) return; /* Set new constraints/columns to have an "undefined" mapping to original constraints/columns (assumes that counters have NOT yet been updated) */ for(i = lp->sum; i >= base; i--) { ii = i + delta; psundo->var_to_orig[ii] = psundo->var_to_orig[i]; } /* Initialize map of added rows/columns */ for(i = 0; i < delta; i++) { ii = base + i; psundo->var_to_orig[ii] = 0; } } STATIC void varmap_delete(lprec *lp, int base, int delta, LLrec *varmap) { int i, ii, j; MYBOOL preparecompact = (MYBOOL) (varmap != NULL); presolveundorec *psundo = lp->presolve_undo; /* Set the model "dirty" if we are deleting row of constraint */ lp->model_is_pure &= (MYBOOL) ((lp->solutioncount == 0) && !preparecompact); /* Don't do anything if 1) variables aren't locked yet, or 2) the constraint was added after the variables were locked */ if(!lp->varmap_locked) { #if 0 if(lp->names_used) varmap_lock(lp); else return; #else if(!lp->model_is_pure && lp->names_used) varmap_lock(lp); #endif } /* Do mass deletion via a linked list */ preparecompact = (MYBOOL) (varmap != NULL); if(preparecompact) { preparecompact = (MYBOOL) (base > lp->rows); /* Set TRUE for columns */ for(j = firstInactiveLink(varmap); j != 0; j = nextInactiveLink(varmap, j)) { i = j; if(preparecompact) { #ifdef Paranoia if(SOS_is_member(lp->SOS, 0, j)) report(lp, SEVERE, "varmap_delete: Deleting variable %d, which is in a SOS!\n", j); #endif i += lp->rows; } ii = psundo->var_to_orig[i]; if(ii > 0) /* It was an original variable; reverse sign of index to flag deletion */ psundo->var_to_orig[i] = -ii; else /* It was a non-original variable; add special code for deletion */ psundo->var_to_orig[i] = -(psundo->orig_rows+psundo->orig_columns+i); } return; } /* Do legacy simplified version if we are doing batch delete operations */ preparecompact = (MYBOOL) (base < 0); if(preparecompact) { base = -base; if(base > lp->rows) base += (psundo->orig_rows - lp->rows); for(i = base; i < base-delta; i++) { ii = psundo->var_to_orig[i]; if(ii > 0) /* It was an original variable; reverse sign of index to flag deletion */ psundo->var_to_orig[i] = -ii; else /* It was a non-original variable; add special code for deletion */ psundo->var_to_orig[i] = -(psundo->orig_rows+psundo->orig_columns+i); } return; } /* We are deleting an original constraint/column; 1) clear mapping of original to deleted 2) shift the deleted variable to original mappings left 3) decrement all subsequent original-to-current pointers */ if(varmap_canunlock(lp)) lp->varmap_locked = FALSE; for(i = base; i < base-delta; i++) { ii = psundo->var_to_orig[i]; if(ii > 0) psundo->orig_to_var[ii] = 0; } for(i = base; i <= lp->sum+delta; i++) { ii = i - delta; psundo->var_to_orig[i] = psundo->var_to_orig[ii]; } i = 1; j = psundo->orig_rows; if(base > lp->rows) { i += j; j += psundo->orig_columns; } ii = base-delta; for(; i <= j; i++) { if(psundo->orig_to_var[i] >= ii) psundo->orig_to_var[i] += delta; } } STATIC MYBOOL varmap_validate(lprec *lp, int varno) { MYBOOL success = TRUE; int i, ii, ix, ie, n_rows = lp->rows, orig_sum = lp->presolve_undo->orig_sum, orig_rows = lp->presolve_undo->orig_rows; if(varno <= 0) { varno = 1; ie = orig_sum; } else ie = varno; for(i = varno; success && (i <= ie); i++) { ix = lp->presolve_undo->orig_to_var[i]; if((ix > 0) && (i > orig_rows)) ix += n_rows; /* Check for index out of range due to presolve */ success = (MYBOOL) (ix <= orig_sum); if(!success) report(lp, SEVERE, "varmap_validate: Invalid new mapping found for variable %d\n", i); else if(ix != 0) { ii = lp->presolve_undo->var_to_orig[ix]; if(ix > n_rows) ii += orig_rows; success = (MYBOOL) (ii == i); if(!success) report(lp, SEVERE, "varmap_validate: Invalid old mapping found for variable %d (%d)\n", i, ii); } } return( success ); } STATIC void varmap_compact(lprec *lp, int prev_rows, int prev_cols) { presolveundorec *psundo = lp->presolve_undo; int i, ii, n_sum, n_rows, orig_rows = psundo->orig_rows, prev_sum = prev_rows + prev_cols; /* Nothing to do if the model is not "dirty" or the variable map is not locked */ if(lp->model_is_pure || !lp->varmap_locked) return; /* We are deleting an original constraint/column; 1) clear mapping of original to deleted 2) shift the deleted variable to original mappings left 3) decrement all subsequent original-to-current pointers */ n_sum = 0; n_rows = 0; for(i = 1; i <= prev_sum; i++) { ii = psundo->var_to_orig[i]; /* Process variable if it was deleted in the previous round */ if(ii < 0) { ii = -ii; /* Update map back if we have an original variable, otherwise just skip */ if(i <= prev_rows) psundo->orig_to_var[ii] = 0; else psundo->orig_to_var[orig_rows+ii] = 0; } /* Otherwise shift and update map back */ else { n_sum++; /* Shift only if necessary */ if(n_sum < i) psundo->var_to_orig[n_sum] = ii; /* Update map back if we have an original variable */ if(ii > 0) { if(i <= prev_rows) { psundo->orig_to_var[ii] = n_sum; n_rows = n_sum; } else psundo->orig_to_var[orig_rows+ii] = n_sum-n_rows; } } } #ifdef xxParanoia if(!varmap_validate(lp, 0)) report(lp, SEVERE, "varmap_compact: Internal presolve mapping error at exit\n"); #endif } /* Utility group for shifting row and column data */ STATIC MYBOOL shift_rowcoldata(lprec *lp, int base, int delta, LLrec *usedmap, MYBOOL isrow) /* Note: Assumes that "lp->sum" and "lp->rows" HAVE NOT been updated to the new counts */ { int i, ii; REAL lodefault; /* Shift data right/down (insert), and set default values in positive delta-gap */ if(delta > 0) { /* Determine if we can take the easy way out */ MYBOOL easyout = (MYBOOL) ((lp->solvecount == 0) && (base > lp->rows)); /* Shift the row/column data */ MEMMOVE(lp->orig_upbo + base + delta, lp->orig_upbo + base, lp->sum - base + 1); MEMMOVE(lp->orig_lowbo + base + delta, lp->orig_lowbo + base, lp->sum - base + 1); if(!easyout) { MEMMOVE(lp->upbo + base + delta, lp->upbo + base, lp->sum - base + 1); MEMMOVE(lp->lowbo + base + delta, lp->lowbo + base, lp->sum - base + 1); if(lp->model_is_valid) { MEMMOVE(lp->solution + base + delta, lp->solution + base, lp->sum - base + 1); MEMMOVE(lp->best_solution + base + delta, lp->best_solution + base, lp->sum - base + 1); } MEMMOVE(lp->is_lower + base + delta, lp->is_lower + base, lp->sum - base + 1); } /* Deal with scalars; the vector can be NULL */ if(lp->scalars != NULL) { if(!easyout) for(ii = lp->sum; ii >= base; ii--) { i = ii + delta; lp->scalars[i] = lp->scalars[ii]; } for(ii = base; ii < base + delta; ii++) lp->scalars[ii] = 1; } /* Set defaults */ #ifdef SlackInitMinusInf if(isrow) lodefault = -lp->infinite; else #endif lodefault = 0; for(i = 0; i < delta; i++) { ii = base + i; lp->orig_upbo[ii] = lp->infinite; lp->orig_lowbo[ii] = lodefault; if(!easyout) { lp->upbo[ii] = lp->orig_upbo[ii]; lp->lowbo[ii] = lp->orig_lowbo[ii]; lp->is_lower[ii] = TRUE; } } } /* Shift data left/up (delete) */ else if(usedmap != NULL) { int k, offset = 0; if(!isrow) offset += lp->rows; i = offset + 1; for(k = firstActiveLink(usedmap); k != 0; i++, k = nextActiveLink(usedmap, k)) { ii = k + offset; if(ii == i) continue; lp->upbo[i] = lp->upbo[ii]; lp->orig_upbo[i] = lp->orig_upbo[ii]; lp->lowbo[i] = lp->lowbo[ii]; lp->orig_lowbo[i] = lp->orig_lowbo[ii]; lp->solution[i] = lp->solution[ii]; lp->best_solution[i] = lp->best_solution[ii]; lp->is_lower[i] = lp->is_lower[ii]; if(lp->scalars != NULL) lp->scalars[i] = lp->scalars[ii]; } if(isrow) { base = lp->rows + 1; MEMMOVE(lp->upbo + i, lp->upbo + base, lp->columns); MEMMOVE(lp->orig_upbo + i, lp->orig_upbo + base, lp->columns); MEMMOVE(lp->lowbo + i, lp->lowbo + base, lp->columns); MEMMOVE(lp->orig_lowbo + i, lp->orig_lowbo + base, lp->columns); if(lp->model_is_valid) { MEMMOVE(lp->solution + i, lp->solution + base, lp->columns); MEMMOVE(lp->best_solution + i, lp->best_solution + base, lp->columns); } MEMMOVE(lp->is_lower + i, lp->is_lower + base, lp->columns); if(lp->scalars != NULL) MEMMOVE(lp->scalars + i, lp->scalars + base, lp->columns); } } else if(delta < 0) { /* First make sure we don't cross the sum count border */ if(base-delta-1 > lp->sum) delta = base - lp->sum - 1; /* Shift the data*/ for(i = base; i <= lp->sum + delta; i++) { ii = i - delta; lp->upbo[i] = lp->upbo[ii]; lp->orig_upbo[i] = lp->orig_upbo[ii]; lp->lowbo[i] = lp->lowbo[ii]; lp->orig_lowbo[i] = lp->orig_lowbo[ii]; lp->solution[i] = lp->solution[ii]; lp->best_solution[i] = lp->best_solution[ii]; lp->is_lower[i] = lp->is_lower[ii]; if(lp->scalars != NULL) lp->scalars[i] = lp->scalars[ii]; } } lp->sum += delta; lp->matA->row_end_valid = FALSE; return(TRUE); } STATIC MYBOOL shift_basis(lprec *lp, int base, int delta, LLrec *usedmap, MYBOOL isrow) /* Note: Assumes that "lp->sum" and "lp->rows" HAVE NOT been updated to the new counts */ { int i, ii; MYBOOL Ok = TRUE; /* Don't bother to shift the basis if it is not yet ready */ if(!is_BasisReady(lp)) return( Ok ); /* Basis adjustments due to insertions (after actual row/column insertions) */ if(delta > 0) { /* Determine if the basis becomes invalidated */ if(isrow) set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT); /* Shift and fix invalid basis references (increment higher order basic variable index) */ if(base <= lp->sum) MEMMOVE(lp->is_basic + base + delta, lp->is_basic + base, lp->sum - base + 1); /* Prevent CPU-expensive basis updating if this is the initial model creation */ if(!lp->model_is_pure || (lp->solvecount > 0)) for(i = 1; i <= lp->rows; i++) { ii = lp->var_basic[i]; if(ii >= base) lp->var_basic[i] += delta; } /* Update the basis (shift and extend) */ for(i = 0; i < delta; i++) { ii = base + i; lp->is_basic[ii] = isrow; if(isrow) lp->var_basic[lp->rows+1+i] = ii; } } /* Basis adjustments due to deletions (after actual row/column deletions) */ else { int j,k; /* Fix invalid basis references (decrement high basic slack variable indexes), but reset the entire basis if a deleted variable is found in the basis */ k = 0; for(i = 1; i <= lp->rows; i++) { ii = lp->var_basic[i]; lp->is_basic[ii] = FALSE; if(ii >= base) { /* Skip to next basis variable if this one is to be deleted */ if(ii < base-delta) { set_action(&lp->spx_action, ACTION_REBASE); continue; } /* Otherwise, update the index of the basic variable for deleted variables */ ii += delta; } k++; lp->var_basic[k] = ii; } /* Set the new basis indicators */ i = k; if(isrow) i = MIN(k, lp->rows+delta); for(; i > 0; i--) { j = lp->var_basic[i]; lp->is_basic[j] = TRUE; } /* If a column was deleted from the basis then simply add back a non-basic slack variable; do two scans, if necessary to avoid adding equality slacks */ if(!isrow && (k < lp->rows)) { for(j = 0; j <= 1; j++) for(i = 1; (i <= lp->rows) && (k < lp->rows); i++) if(!lp->is_basic[i]) { if(!is_constr_type(lp, i, EQ) || (j == 1)) { k++; lp->var_basic[k] = i; lp->is_basic[i] = TRUE; } } k = 0; } /* We are left with "k" indexes; if no basis variable was deleted, k=rows and the inverse is still valid, if k+delta < 0 we do not have a valid basis and must create one (in most usage modes this should not happen, unless there is a bug) */ if(k+delta < 0) Ok = FALSE; if(isrow || (k != lp->rows)) set_action(&lp->spx_action, ACTION_REINVERT); } return(Ok); } STATIC MYBOOL shift_rowdata(lprec *lp, int base, int delta, LLrec *usedmap) /* Note: Assumes that "lp->rows" HAS NOT been updated to the new count */ { int i, ii; /* Shift sparse matrix row data */ if(lp->matA->is_roworder) mat_shiftcols(lp->matA, &base, delta, usedmap); else mat_shiftrows(lp->matA, &base, delta, usedmap); /* Shift data down (insert row), and set default values in positive delta-gap */ if(delta > 0) { /* Shift row data */ for(ii = lp->rows; ii >= base; ii--) { i = ii + delta; lp->orig_rhs[i] = lp->orig_rhs[ii]; lp->rhs[i] = lp->rhs[ii]; lp->row_type[i] = lp->row_type[ii]; } /* Set defaults (actual basis set in separate procedure) */ for(i = 0; i < delta; i++) { ii = base + i; lp->orig_rhs[ii] = 0; lp->rhs[ii] = 0; lp->row_type[ii] = ROWTYPE_EMPTY; } } /* Shift data up (delete row) */ else if(usedmap != NULL) { for(i = 1, ii = firstActiveLink(usedmap); ii != 0; i++, ii = nextActiveLink(usedmap, ii)) { if(i == ii) continue; lp->orig_rhs[i] = lp->orig_rhs[ii]; lp->rhs[i] = lp->rhs[ii]; lp->row_type[i] = lp->row_type[ii]; } delta = i - lp->rows - 1; } else if(delta < 0) { /* First make sure we don't cross the row count border */ if(base-delta-1 > lp->rows) delta = base - lp->rows - 1; /* Shift row data (don't shift basis indexes here; done in next step) */ for(i = base; i <= lp->rows + delta; i++) { ii = i - delta; lp->orig_rhs[i] = lp->orig_rhs[ii]; lp->rhs[i] = lp->rhs[ii]; lp->row_type[i] = lp->row_type[ii]; } } shift_basis(lp, base, delta, usedmap, TRUE); shift_rowcoldata(lp, base, delta, usedmap, TRUE); inc_rows(lp, delta); return(TRUE); } STATIC MYBOOL shift_coldata(lprec *lp, int base, int delta, LLrec *usedmap) /* Note: Assumes that "lp->columns" has NOT been updated to the new count */ { int i, ii; free_duals(lp); /* Shift A matrix data */ if(lp->matA->is_roworder) mat_shiftrows(lp->matA, &base, delta, usedmap); else mat_shiftcols(lp->matA, &base, delta, usedmap); /* Shift data right (insert), and set default values in positive delta-gap */ if(delta > 0) { /* Fix variable priority data */ if((lp->var_priority != NULL) && (base <= lp->columns)) { for(i = 0; i < lp->columns; i++) if(lp->var_priority[i] >= base) lp->var_priority[i] += delta; } if((lp->sos_priority != NULL) && (base <= lp->columns)) { for(i = 0; i < lp->sos_vars; i++) if(lp->sos_priority[i] >= base) lp->sos_priority[i] += delta; } /* Fix invalid split variable data */ if((lp->var_is_free != NULL) && (base <= lp->columns)) { for(i = 1; i <= lp->columns; i++) if(abs(lp->var_is_free[i]) >= base) lp->var_is_free[i] += my_chsign(lp->var_is_free[i] < 0, delta); } /* Shift column data right */ for(ii = lp->columns; ii >= base; ii--) { i = ii + delta; lp->var_type[i] = lp->var_type[ii]; lp->sc_lobound[i] = lp->sc_lobound[ii]; lp->orig_obj[i] = lp->orig_obj[ii]; if(lp->obj != NULL) lp->obj[i] = lp->obj[ii]; /* if(lp->objfromvalue != NULL) lp->objfromvalue[i] = lp->objfromvalue[ii]; if(lp->objfrom != NULL) lp->objfrom[i] = lp->objfrom[ii]; if(lp->objtill != NULL) lp->objtill[i] = lp->objtill[ii]; */ if(lp->var_priority != NULL) lp->var_priority[i-1] = lp->var_priority[ii-1]; if(lp->bb_varbranch != NULL) lp->bb_varbranch[i-1] = lp->bb_varbranch[ii-1]; if(lp->var_is_free != NULL) lp->var_is_free[i] = lp->var_is_free[ii]; if(lp->best_solution != NULL) lp->best_solution[lp->rows + i] = lp->best_solution[lp->rows + ii]; } /* Set defaults */ for(i = 0; i < delta; i++) { ii = base + i; lp->var_type[ii] = ISREAL; lp->sc_lobound[ii] = 0; lp->orig_obj[ii] = 0; if(lp->obj != NULL) lp->obj[ii] = 0; /* if(lp->objfromvalue != NULL) lp->objfromvalue[ii] = 0; if(lp->objfrom != NULL) lp->objfrom[ii] = 0; if(lp->objtill != NULL) lp->objtill[ii] = 0; */ if(lp->var_priority != NULL) lp->var_priority[ii-1] = ii; if(lp->bb_varbranch != NULL) lp->bb_varbranch[ii-1] = BRANCH_DEFAULT; if(lp->var_is_free != NULL) lp->var_is_free[ii] = 0; if(lp->best_solution != NULL) lp->best_solution[lp->rows + ii] = 0; } } /* Shift data left (delete) */ else if(usedmap != NULL) { /* Assume there is no need to handle split columns, since we are doing this only from presolve, which comes before splitting of columns. */ /* First update counts */ if(lp->int_vars + lp->sc_vars > 0) for(ii = firstInactiveLink(usedmap); ii != 0; ii = nextInactiveLink(usedmap, ii)) { if(is_int(lp, ii)) { lp->int_vars--; if(SOS_is_member(lp->SOS, 0, ii)) lp->sos_ints--; } if(is_semicont(lp, ii)) lp->sc_vars--; } /* Shift array members */ for(i = 1, ii = firstActiveLink(usedmap); ii != 0; i++, ii = nextActiveLink(usedmap, ii)) { if(i == ii) continue; lp->var_type[i] = lp->var_type[ii]; lp->sc_lobound[i] = lp->sc_lobound[ii]; lp->orig_obj[i] = lp->orig_obj[ii]; if(lp->obj != NULL) lp->obj[i] = lp->obj[ii]; /* if(lp->objfromvalue != NULL) lp->objfromvalue[i] = lp->objfromvalue[ii]; if(lp->objfrom != NULL) lp->objfrom[i] = lp->objfrom[ii]; if(lp->objtill != NULL) lp->objtill[i] = lp->objtill[ii]; */ if(lp->bb_varbranch != NULL) lp->bb_varbranch[i-1] = lp->bb_varbranch[ii-1]; if(lp->var_is_free != NULL) lp->var_is_free[i] = lp->var_is_free[ii]; if(lp->best_solution != NULL) lp->best_solution[lp->rows + i] = lp->best_solution[lp->rows + ii]; } /* Shift variable priority data */ if((lp->var_priority != NULL) || (lp->sos_priority != NULL)) { int *colmap = NULL, k; allocINT(lp, &colmap, lp->columns + 1, TRUE); for(i = 1, ii = 0; i <= lp->columns; i++) { if(isActiveLink(usedmap, i)) { ii++; colmap[i] = ii; } } if(lp->var_priority != NULL) { for(i = 0, ii = 0; i < lp->columns; i++) { k = colmap[lp->var_priority[i]]; if(k > 0) { lp->var_priority[ii] = k; ii++; } } } if(lp->sos_priority != NULL) { for(i = 0, ii = 0; i < lp->sos_vars; i++) { k = colmap[lp->sos_priority[i]]; if(k > 0) { lp->sos_priority[ii] = k; ii++; } } lp->sos_vars = ii; } FREE(colmap); } delta = i - lp->columns - 1; } else if(delta < 0) { /* Fix invalid split variable data */ if(lp->var_is_free != NULL) { for(i = 1; i <= lp->columns; i++) if(abs(lp->var_is_free[i]) >= base) lp->var_is_free[i] -= my_chsign(lp->var_is_free[i] < 0, delta); } /* Shift column data (excluding the basis) */ for(i = base; i < base-delta; i++) { if(is_int(lp, i)) { lp->int_vars--; if(SOS_is_member(lp->SOS, 0, i)) lp->sos_ints--; } if(is_semicont(lp, i)) lp->sc_vars--; } for(i = base; i <= lp->columns + delta; i++) { ii = i - delta; lp->var_type[i] = lp->var_type[ii]; lp->sc_lobound[i] = lp->sc_lobound[ii]; lp->orig_obj[i] = lp->orig_obj[ii]; if(lp->obj != NULL) lp->obj[i] = lp->obj[ii]; /* if(lp->objfromvalue != NULL) lp->objfromvalue[i] = lp->objfromvalue[ii]; if(lp->objfrom != NULL) lp->objfrom[i] = lp->objfrom[ii]; if(lp->objtill != NULL) lp->objtill[i] = lp->objtill[ii]; */ if(lp->var_priority != NULL) lp->var_priority[i-1] = lp->var_priority[ii-1]; if(lp->bb_varbranch != NULL) lp->bb_varbranch[i-1] = lp->bb_varbranch[ii-1]; if(lp->var_is_free != NULL) lp->var_is_free[i] = lp->var_is_free[ii]; if(lp->best_solution != NULL) lp->best_solution[lp->rows + i] = lp->best_solution[lp->rows + ii]; } /* Fix invalid variable priority data */ if(lp->var_priority != NULL) { for(i = 0, ii = 0; i < lp->columns; i++) if(lp->var_priority[i] > base - delta) lp->var_priority[ii++] = lp->var_priority[i] + delta; else if(lp->var_priority[i] < base) lp->var_priority[ii++] = lp->var_priority[i]; } if(lp->sos_priority != NULL) { for(i = 0, ii = 0; i < lp->sos_vars; i++) { if(lp->sos_priority[i] > base - delta) lp->sos_priority[ii++] = lp->sos_priority[i] + delta; else if(lp->sos_priority[i] < base) lp->sos_priority[ii++] = lp->sos_priority[i]; } lp->sos_vars = ii; } } shift_basis(lp, lp->rows+base, delta, usedmap, FALSE); if(SOS_count(lp) > 0) SOS_shift_col(lp->SOS, 0, base, delta, usedmap, FALSE); shift_rowcoldata(lp, lp->rows+base, delta, usedmap, FALSE); inc_columns(lp, delta); return( TRUE ); } /* Utility group for incrementing row and column vector storage space */ STATIC void inc_rows(lprec *lp, int delta) { int i; if(lp->names_used && (lp->row_name != NULL)) for(i = lp->rows + delta; i > lp->rows; i--) lp->row_name[i] = NULL; lp->rows += delta; if(lp->matA->is_roworder) lp->matA->columns += delta; else lp->matA->rows += delta; } STATIC void inc_columns(lprec *lp, int delta) { int i; if(lp->names_used && (lp->col_name != NULL)) for(i = lp->columns + delta; i > lp->columns; i--) lp->col_name[i] = NULL; lp->columns += delta; if(lp->matA->is_roworder) lp->matA->rows += delta; else lp->matA->columns += delta; if(get_Lrows(lp) > 0) lp->matL->columns += delta; } STATIC MYBOOL inc_rowcol_space(lprec *lp, int delta, MYBOOL isrows) { int i, oldrowcolalloc, rowcolsum; /* Get rid of dual arrays */ if(lp->solvecount > 0) free_duals(lp); /* Set constants */ oldrowcolalloc = lp->sum_alloc; lp->sum_alloc += delta; rowcolsum = lp->sum_alloc + 1; /* Reallocate lp memory */ if(!allocREAL(lp, &lp->upbo, rowcolsum, AUTOMATIC) || !allocREAL(lp, &lp->orig_upbo, rowcolsum, AUTOMATIC) || !allocREAL(lp, &lp->lowbo, rowcolsum, AUTOMATIC) || !allocREAL(lp, &lp->orig_lowbo, rowcolsum, AUTOMATIC) || !allocREAL(lp, &lp->solution, rowcolsum, AUTOMATIC) || !allocREAL(lp, &lp->best_solution, rowcolsum, AUTOMATIC) || !allocMYBOOL(lp, &lp->is_basic, rowcolsum, AUTOMATIC) || !allocMYBOOL(lp, &lp->is_lower, rowcolsum, AUTOMATIC) || ((lp->scalars != NULL) && !allocREAL(lp, &lp->scalars, rowcolsum, AUTOMATIC))) return( FALSE ); /* Fill in default values, where appropriate */ for(i = oldrowcolalloc+1; i < rowcolsum; i++) { lp->upbo[i] = lp->infinite; lp->orig_upbo[i] = lp->upbo[i]; lp->lowbo[i] = 0; lp->orig_lowbo[i] = lp->lowbo[i]; lp->is_basic[i] = FALSE; lp->is_lower[i] = TRUE; } /* Deal with scalars; the vector can be NULL and also contains Lagrangean information */ if(lp->scalars != NULL) { for(i = oldrowcolalloc+1; i < rowcolsum; i++) lp->scalars[i] = 1; if(oldrowcolalloc == 0) lp->scalars[0] = 1; } return( inc_presolve_space(lp, delta, isrows) && resizePricer(lp) ); } STATIC MYBOOL inc_lag_space(lprec *lp, int deltarows, MYBOOL ignoreMAT) { int newsize; if(deltarows > 0) { newsize = get_Lrows(lp) + deltarows; /* Reallocate arrays */ if(!allocREAL(lp, &lp->lag_rhs, newsize+1, AUTOMATIC) || !allocREAL(lp, &lp->lambda, newsize+1, AUTOMATIC) || !allocINT(lp, &lp->lag_con_type, newsize+1, AUTOMATIC)) return( FALSE ); /* Reallocate the matrix (note that the row scalars are stored at index 0) */ if(!ignoreMAT) { if(lp->matL == NULL) lp->matL = mat_create(lp, newsize, lp->columns, lp->epsvalue); else inc_matrow_space(lp->matL, deltarows); } lp->matL->rows += deltarows; } /* Handle column count expansion as special case */ else if(!ignoreMAT) { inc_matcol_space(lp->matL, lp->columns_alloc-lp->matL->columns_alloc+1); } return( TRUE ); } STATIC MYBOOL inc_row_space(lprec *lp, int deltarows) { int i, rowsum, oldrowsalloc; MYBOOL ok = TRUE; /* Adjust lp row structures */ i = lp->rows_alloc+deltarows; if(lp->matA->is_roworder) { i -= lp->matA->columns_alloc; SETMIN(i, deltarows); if(i > 0) inc_matcol_space(lp->matA, i); rowsum = lp->matA->columns_alloc; } else { #if 0 if((lp->rows_alloc > 0) && (lp->rows + deltarows > lp->rows_alloc)) i = deltarows; /* peno 25/12/06 */ else #endif i -= lp->matA->rows_alloc; SETMIN(i, deltarows); if(i > 0) inc_matrow_space(lp->matA, i); rowsum = lp->matA->rows_alloc; } if(lp->rows+deltarows > lp->rows_alloc) { rowsum++; oldrowsalloc = lp->rows_alloc; lp->rows_alloc = rowsum; deltarows = rowsum - oldrowsalloc; rowsum++; if(!allocREAL(lp, &lp->orig_rhs, rowsum, AUTOMATIC) || !allocLREAL(lp, &lp->rhs, rowsum, AUTOMATIC) || !allocINT(lp, &lp->row_type, rowsum, AUTOMATIC) || !allocINT(lp, &lp->var_basic, rowsum, AUTOMATIC)) return( FALSE ); if(oldrowsalloc == 0) { lp->var_basic[0] = AUTOMATIC; /*TRUE;*/ /* Indicates default basis */ lp->orig_rhs[0] = 0; lp->row_type[0] = ROWTYPE_OFMIN; } for(i = oldrowsalloc+1; i < rowsum; i++) { lp->orig_rhs[i] = 0; lp->rhs[i] = 0; lp->row_type[i] = ROWTYPE_EMPTY; lp->var_basic[i] = i; } /* Adjust hash name structures */ if(lp->names_used && (lp->row_name != NULL)) { /* First check the hash table */ if(lp->rowname_hashtab->size < lp->rows_alloc) { hashtable *ht; ht = copy_hash_table(lp->rowname_hashtab, lp->row_name, lp->rows_alloc + 1); if(ht == NULL) { lp->spx_status = NOMEMORY; return( FALSE ); } free_hash_table(lp->rowname_hashtab); lp->rowname_hashtab = ht; } /* Then the string storage (i.e. pointer to the item's hash structure) */ lp->row_name = (hashelem **) realloc(lp->row_name, (rowsum) * sizeof(*lp->row_name)); if(lp->row_name == NULL) { lp->spx_status = NOMEMORY; return( FALSE ); } for(i = oldrowsalloc + 1; i < rowsum; i++) lp->row_name[i] = NULL; } ok = inc_rowcol_space(lp, deltarows, TRUE); } return(ok); } STATIC MYBOOL inc_col_space(lprec *lp, int deltacols) { int i,colsum, oldcolsalloc; i = lp->columns_alloc+deltacols; if(lp->matA->is_roworder) { i -= lp->matA->rows_alloc; SETMIN(i, deltacols); if(i > 0) inc_matrow_space(lp->matA, i); colsum = lp->matA->rows_alloc; } else { i -= lp->matA->columns_alloc; SETMIN(i, deltacols); if(i > 0) inc_matcol_space(lp->matA, i); colsum = lp->matA->columns_alloc; } if(lp->columns+deltacols >= lp->columns_alloc) { colsum++; oldcolsalloc = lp->columns_alloc; lp->columns_alloc = colsum; deltacols = colsum - oldcolsalloc; colsum++; /* Adjust hash name structures */ if(lp->names_used && (lp->col_name != NULL)) { /* First check the hash table */ if(lp->colname_hashtab->size < lp->columns_alloc) { hashtable *ht; ht = copy_hash_table(lp->colname_hashtab, lp->col_name, lp->columns_alloc + 1); if(ht != NULL) { free_hash_table(lp->colname_hashtab); lp->colname_hashtab = ht; } } /* Then the string storage (i.e. pointer to the item's hash structure) */ lp->col_name = (hashelem **) realloc(lp->col_name, (colsum) * sizeof(*lp->col_name)); for(i = oldcolsalloc+1; i < colsum; i++) lp->col_name[i] = NULL; } if(!allocREAL(lp, &lp->orig_obj, colsum, AUTOMATIC) || !allocMYBOOL(lp, &lp->var_type, colsum, AUTOMATIC) || !allocREAL(lp, &lp->sc_lobound, colsum, AUTOMATIC) || ((lp->obj != NULL) && !allocREAL(lp, &lp->obj, colsum, AUTOMATIC)) || ((lp->var_priority != NULL) && !allocINT(lp, &lp->var_priority, colsum-1, AUTOMATIC)) || ((lp->var_is_free != NULL) && !allocINT(lp, &lp->var_is_free, colsum, AUTOMATIC)) || ((lp->bb_varbranch != NULL) && !allocMYBOOL(lp, &lp->bb_varbranch, colsum-1, AUTOMATIC))) return( FALSE ); /* Make sure that Lagrangean constraints have the same number of columns */ if(get_Lrows(lp) > 0) inc_lag_space(lp, 0, FALSE); /* Update column pointers */ for(i = MIN(oldcolsalloc, lp->columns) + 1; i < colsum; i++) { lp->orig_obj[i] = 0; if(lp->obj != NULL) lp->obj[i] = 0; lp->var_type[i] = ISREAL; lp->sc_lobound[i] = 0; if(lp->var_priority != NULL) lp->var_priority[i-1] = i; } if(lp->var_is_free != NULL) { for(i = oldcolsalloc+1; i < colsum; i++) lp->var_is_free[i] = 0; } if(lp->bb_varbranch != NULL) { for(i = oldcolsalloc; i < colsum-1; i++) lp->bb_varbranch[i] = BRANCH_DEFAULT; } inc_rowcol_space(lp, deltacols, FALSE); } return(TRUE); } /* Problem manipulation routines */ MYBOOL __WINAPI set_obj(lprec *lp, int colnr, REAL value) { if(colnr <= 0) colnr = set_rh(lp, 0, value); else colnr = set_mat(lp, 0, colnr, value); return((MYBOOL) colnr); } MYBOOL __WINAPI set_obj_fnex(lprec *lp, int count, REAL *row, int *colno) { MYBOOL chsgn = is_maxim(lp); int i, ix; REAL value; if(row == NULL) return( FALSE ); else if(colno == NULL) { if(count <= 0) count = lp->columns; for(i = 1; i <= count; i++) { value = row[i]; #ifdef DoMatrixRounding value = roundToPrecision(value, lp->matA->epsvalue); #endif lp->orig_obj[i] = my_chsign(chsgn, scaled_mat(lp, value, 0, i)); } } else { MEMCLEAR(lp->orig_obj, lp->columns+1); for(i = 0; i < count; i++) { ix = colno[i]; value = row[i]; #ifdef DoMatrixRounding value = roundToPrecision(value, lp->matA->epsvalue); #endif lp->orig_obj[ix] = my_chsign(chsgn, scaled_mat(lp, value, 0, ix)); } } return(TRUE); } MYBOOL __WINAPI set_obj_fn(lprec *lp, REAL *row) { return( set_obj_fnex(lp, 0, row, NULL) ); } MYBOOL __WINAPI str_set_obj_fn(lprec *lp, char *row_string) { int i; MYBOOL ret = TRUE; REAL *arow; char *p, *newp; allocREAL(lp, &arow, lp->columns + 1, FALSE); p = row_string; for(i = 1; i <= lp->columns; i++) { arow[i] = (REAL) strtod(p, &newp); if(p == newp) { report(lp, IMPORTANT, "str_set_obj_fn: Bad string %s\n", p); lp->spx_status = DATAIGNORED; ret = FALSE; break; } else p = newp; } if(lp->spx_status != DATAIGNORED) ret = set_obj_fn(lp, arow); FREE(arow); return( ret ); } STATIC MYBOOL append_columns(lprec *lp, int deltacolumns) { if(!inc_col_space(lp, deltacolumns)) return( FALSE ); varmap_add(lp, lp->sum+1, deltacolumns); shift_coldata(lp, lp->columns+1, deltacolumns, NULL); return( TRUE ); } STATIC MYBOOL append_rows(lprec *lp, int deltarows) { if(!inc_row_space(lp, deltarows)) return( FALSE ); varmap_add(lp, lp->rows+1, deltarows); shift_rowdata(lp, lp->rows+1, deltarows, NULL); return( TRUE ); } MYBOOL __WINAPI set_add_rowmode(lprec *lp, MYBOOL turnon) { if((lp->solvecount == 0) && (turnon ^ lp->matA->is_roworder)) return( mat_transpose(lp->matA) ); else return( FALSE ); } MYBOOL __WINAPI is_add_rowmode(lprec *lp) { return(lp->matA->is_roworder); } MYBOOL __WINAPI set_row(lprec *lp, int rownr, REAL *row) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "set_row: Row %d out of range\n", rownr); return( FALSE ); } if(rownr == 0) return( set_obj_fn(lp, row) ); else return( mat_setrow(lp->matA, rownr, lp->columns, row, NULL, TRUE, TRUE) ); } MYBOOL __WINAPI set_rowex(lprec *lp, int rownr, int count, REAL *row, int *colno) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "set_rowex: Row %d out of range\n", rownr); return( FALSE ); } if(rownr == 0) return( set_obj_fnex(lp, count, row, colno) ); else return( mat_setrow(lp->matA, rownr, count, row, colno, TRUE, TRUE) ); } MYBOOL __WINAPI add_constraintex(lprec *lp, int count, REAL *row, int *colno, int constr_type, REAL rh) { int n; MYBOOL status = FALSE; if(!(constr_type == LE || constr_type == GE || constr_type == EQ)) { report(lp, IMPORTANT, "add_constraintex: Invalid %d constraint type\n", constr_type); return( status ); } /* Prepare for a new row */ if(!append_rows(lp, 1)) return( status ); /* Set constraint parameters, fix the slack */ if((constr_type & ROWTYPE_CONSTRAINT) == EQ) { lp->equalities++; lp->orig_upbo[lp->rows] = 0; lp->upbo[lp->rows] = 0; } lp->row_type[lp->rows] = constr_type; if(is_chsign(lp, lp->rows) && (rh != 0)) lp->orig_rhs[lp->rows] = -rh; else lp->orig_rhs[lp->rows] = rh; /* Insert the non-zero constraint values */ if(colno == NULL && row != NULL) n = lp->columns; else n = count; mat_appendrow(lp->matA, n, row, colno, my_chsign(is_chsign(lp, lp->rows), 1.0), TRUE); if(!lp->varmap_locked) presolve_setOrig(lp, lp->rows, lp->columns); #ifdef Paranoia if(lp->matA->is_roworder) n = lp->matA->columns; else n = lp->matA->rows; if(lp->rows != n) { report(lp, SEVERE, "add_constraintex: Row count mismatch %d vs %d\n", lp->rows, n); } else if(is_BasisReady(lp) && !verify_basis(lp)) report(lp, SEVERE, "add_constraintex: Invalid basis detected for row %d\n", lp->rows); else #endif status = TRUE; return( status ); } MYBOOL __WINAPI add_constraint(lprec *lp, REAL *row, int constr_type, REAL rh) { return( add_constraintex(lp, 0, row, NULL, constr_type, rh) ); } MYBOOL __WINAPI str_add_constraint(lprec *lp, char *row_string, int constr_type, REAL rh) { int i; char *p, *newp; REAL *aRow; MYBOOL status = FALSE; allocREAL(lp, &aRow, lp->columns + 1, FALSE); p = row_string; for(i = 1; i <= lp->columns; i++) { aRow[i] = (REAL) strtod(p, &newp); if(p == newp) { report(lp, IMPORTANT, "str_add_constraint: Bad string '%s'\n", p); lp->spx_status = DATAIGNORED; break; } else p = newp; } if(lp->spx_status != DATAIGNORED) status = add_constraint(lp, aRow, constr_type, rh); FREE(aRow); return(status); } STATIC MYBOOL del_constraintex(lprec *lp, LLrec *rowmap) { int i; if(lp->equalities > 0) for(i = firstInactiveLink(rowmap); i != 0; i = nextInactiveLink(rowmap, i)) { if(is_constr_type(lp, i, EQ)) { #ifdef Paranoia if(lp->equalities == 0) report(lp, SEVERE, "del_constraintex: Invalid count of equality constraints\n"); #endif lp->equalities--; } } varmap_delete(lp, 1, -1, rowmap); shift_rowdata(lp, 1, -1, rowmap); if(!lp->varmap_locked) { presolve_setOrig(lp, lp->rows, lp->columns); if(lp->names_used) del_varnameex(lp, lp->row_name, lp->rows, lp->rowname_hashtab, 0, rowmap); } #ifdef Paranoia if(is_BasisReady(lp) && !verify_basis(lp)) report(lp, SEVERE, "del_constraintex: Invalid basis detected\n"); #endif return(TRUE); } MYBOOL __WINAPI del_constraint(lprec *lp, int rownr) { MYBOOL preparecompact = (MYBOOL) (rownr < 0); if(preparecompact) rownr = -rownr; if((rownr < 1) || (rownr > lp->rows)) { report(lp, IMPORTANT, "del_constraint: Attempt to delete non-existing constraint %d\n", rownr); return(FALSE); } /* if(lp->matA->is_roworder) { report(lp, IMPORTANT, "del_constraint: Cannot delete constraint while in row entry mode.\n"); return(FALSE); } */ if(is_constr_type(lp, rownr, EQ) && (lp->equalities > 0)) lp->equalities--; varmap_delete(lp, my_chsign(preparecompact, rownr), -1, NULL); shift_rowdata(lp, my_chsign(preparecompact, rownr), -1, NULL); /* peno 04.10.07 Fixes a problem with del_constraint. Constraints names were not shifted and reported variable result was incorrect. See UnitTest1, UnitTest2 min: -2 x3; c1: +x2 -x1 <= 10; c: 0 x3 <= 0; c2: +x3 +x2 +x1 <= 20; 2 <= x3 <= 3; x1 <= 30; // del_constraint(lp, 2); // See write_LP and print_solution result // To fix, commented if(!lp->varmap_locked) */ if(!lp->varmap_locked) { presolve_setOrig(lp, lp->rows, lp->columns); if(lp->names_used) del_varnameex(lp, lp->row_name, lp->rows, lp->rowname_hashtab, rownr, NULL); } #ifdef Paranoia if(is_BasisReady(lp) && !verify_basis(lp)) report(lp, SEVERE, "del_constraint: Invalid basis detected at row %d\n", rownr); #endif return(TRUE); } MYBOOL __WINAPI add_lag_con(lprec *lp, REAL *row, int con_type, REAL rhs) { int k; REAL sign; if(con_type == LE || con_type == EQ) sign = 1; else if(con_type == GE) sign = -1; else { report(lp, IMPORTANT, "add_lag_con: Constraint type %d not implemented\n", con_type); return(FALSE); } inc_lag_space(lp, 1, FALSE); k = get_Lrows(lp); lp->lag_rhs[k] = rhs * sign; mat_appendrow(lp->matL, lp->columns, row, NULL, sign, TRUE); lp->lambda[k] = 0; lp->lag_con_type[k] = con_type; return(TRUE); } MYBOOL __WINAPI str_add_lag_con(lprec *lp, char *row_string, int con_type, REAL rhs) { int i; MYBOOL ret = TRUE; REAL *a_row; char *p, *new_p; allocREAL(lp, &a_row, lp->columns + 1, FALSE); p = row_string; for(i = 1; i <= lp->columns; i++) { a_row[i] = (REAL) strtod(p, &new_p); if(p == new_p) { report(lp, IMPORTANT, "str_add_lag_con: Bad string '%s'\n", p); lp->spx_status = DATAIGNORED; ret = FALSE; break; } else p = new_p; } if(lp->spx_status != DATAIGNORED) ret = add_lag_con(lp, a_row, con_type, rhs); FREE(a_row); return( ret ); } /* INLINE */ MYBOOL is_splitvar(lprec *lp, int colnr) /* Two cases handled by var_is_free: 1) LB:-Inf / UB:var_is_free != NULL) && (lp->var_is_free[colnr] < 0) && (-lp->var_is_free[colnr] != colnr))); } void del_splitvars(lprec *lp) { int j, jj, i; if(lp->var_is_free != NULL) { for(j = lp->columns; j >= 1; j--) if(is_splitvar(lp, j)) { /* Check if we need to modify the basis */ jj = lp->rows+abs(lp->var_is_free[j]); i = lp->rows+j; if(lp->is_basic[i] && !lp->is_basic[jj]) { i = findBasisPos(lp, i, NULL); set_basisvar(lp, i, jj); } /* Delete the helper column */ del_column(lp, j); } FREE(lp->var_is_free); } } MYBOOL __WINAPI set_column(lprec *lp, int colnr, REAL *column) { return( mat_setcol(lp->matA, colnr, lp->rows, column, NULL, TRUE, TRUE) ); } MYBOOL __WINAPI set_columnex(lprec *lp, int colnr, int count, REAL *column, int *rowno) { return( mat_setcol(lp->matA, colnr, count, column, rowno, TRUE, TRUE) ); } MYBOOL __WINAPI add_columnex(lprec *lp, int count, REAL *column, int *rowno) /* This function adds a data column to the current model; three cases handled: 1: Prepare for column data by setting column = NULL 2: Dense vector indicated by (rowno == NULL) over 0..count+get_Lrows() elements 3: Sparse vector set over row vectors rowno, over 0..count-1 elements. NB! If the column has only one entry, this should be handled as a bound, but this currently is not the case */ { MYBOOL status = FALSE; /* Prepare and shift column vectors */ if(!append_columns(lp, 1)) return( status ); /* Append sparse regular constraint values */ if(mat_appendcol(lp->matA, count, column, rowno, 1.0, TRUE) < 0) report(lp, SEVERE, "add_columnex: Data column %d supplied in non-ascending row index order.\n", lp->columns); else #ifdef Paranoia if(lp->columns != (lp->matA->is_roworder ? lp->matA->rows : lp->matA->columns)) { report(lp, SEVERE, "add_columnex: Column count mismatch %d vs %d\n", lp->columns, (lp->matA->is_roworder ? lp->matA->rows : lp->matA->columns)); } else if(is_BasisReady(lp) && (lp->P1extraDim == 0) && !verify_basis(lp)) report(lp, SEVERE, "add_columnex: Invalid basis detected for column %d\n", lp->columns); else #endif status = TRUE; if(!lp->varmap_locked) presolve_setOrig(lp, lp->rows, lp->columns); return( status ); } MYBOOL __WINAPI add_column(lprec *lp, REAL *column) { del_splitvars(lp); return(add_columnex(lp, lp->rows, column, NULL)); } MYBOOL __WINAPI str_add_column(lprec *lp, char *col_string) { int i; MYBOOL ret = TRUE; REAL *aCol; char *p, *newp; allocREAL(lp, &aCol, lp->rows + 1, FALSE); p = col_string; for(i = 0; i <= lp->rows; i++) { aCol[i] = (REAL) strtod(p, &newp); if(p == newp) { report(lp, IMPORTANT, "str_add_column: Bad string '%s'\n", p); lp->spx_status = DATAIGNORED; ret = FALSE; break; } else p = newp; } if(lp->spx_status != DATAIGNORED) ret = add_column(lp, aCol); FREE(aCol); return( ret ); } STATIC MYBOOL del_varnameex(lprec *lp, hashelem **namelist, int items, hashtable *ht, int varnr, LLrec *varmap) { int i, n; /* First drop hash table entries of the deleted variables */ if(varmap != NULL) i = firstInactiveLink(varmap); else i = varnr; while(i > 0) { if(namelist[i] != NULL) { if(namelist[i]->name != NULL) drophash(namelist[i]->name, namelist, ht); } if(varmap != NULL) i = nextInactiveLink(varmap, i); else i = 0; } /* Then compress the name list */ if(varmap != NULL) { i = firstInactiveLink(varmap); n = nextActiveLink(varmap, i); varnr = i; } else { i = varnr; n = i + 1; } while(n != 0) { namelist[i] = namelist[n]; if((namelist[i] != NULL) && (namelist[i]->index > varnr)) namelist[i]->index -= n - i; i++; if(varmap != NULL) n = nextActiveLink(varmap, i); else if(n <= items) /* items has been updated for the new count */ n++; else n = 0; } return( TRUE ); } STATIC MYBOOL del_columnex(lprec *lp, LLrec *colmap) { varmap_delete(lp, lp->rows+1, -1, colmap); shift_coldata(lp, 1, -1, colmap); if(!lp->varmap_locked) { presolve_setOrig(lp, lp->rows, lp->columns); if(lp->names_used) del_varnameex(lp, lp->col_name, lp->columns, lp->colname_hashtab, 0, colmap); } #ifdef Paranoia if(is_BasisReady(lp) && (lp->P1extraDim == 0) && !verify_basis(lp)) report(lp, SEVERE, "del_columnex: Invalid basis detected\n"); #endif return(TRUE); } MYBOOL __WINAPI del_column(lprec *lp, int colnr) { MYBOOL preparecompact = (MYBOOL) (colnr < 0); if(preparecompact) colnr = -colnr; if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "del_column: Column %d out of range\n", colnr); return(FALSE); } /* if(lp->matA->is_roworder) { report(lp, IMPORTANT, "del_column: Cannot delete column while in row entry mode.\n"); return(FALSE); } */ if((lp->var_is_free != NULL) && (lp->var_is_free[colnr] > 0)) del_column(lp, lp->var_is_free[colnr]); /* delete corresponding split column (is always after this column) */ varmap_delete(lp, my_chsign(preparecompact, lp->rows+colnr), -1, NULL); shift_coldata(lp, my_chsign(preparecompact, colnr), -1, NULL); if(!lp->varmap_locked) { presolve_setOrig(lp, lp->rows, lp->columns); if(lp->names_used) del_varnameex(lp, lp->col_name, lp->columns, lp->colname_hashtab, colnr, NULL); } #ifdef Paranoia if(is_BasisReady(lp) && (lp->P1extraDim == 0) && !verify_basis(lp)) report(lp, SEVERE, "del_column: Invalid basis detected at column %d (%d)\n", colnr, lp->columns); #endif return(TRUE); } void __WINAPI set_simplextype(lprec *lp, int simplextype) { lp->simplex_strategy = simplextype; } int __WINAPI get_simplextype(lprec *lp) { return(lp->simplex_strategy); } void __WINAPI set_preferdual(lprec *lp, MYBOOL dodual) { if(dodual & TRUE) lp->simplex_strategy = SIMPLEX_DUAL_DUAL; else lp->simplex_strategy = SIMPLEX_PRIMAL_PRIMAL; } void __WINAPI set_bounds_tighter(lprec *lp, MYBOOL tighten) { lp->tighten_on_set = tighten; } MYBOOL __WINAPI get_bounds_tighter(lprec *lp) { return(lp->tighten_on_set); } MYBOOL __WINAPI set_upbo(lprec *lp, int colnr, REAL value) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_upbo: Column %d out of range\n", colnr); return(FALSE); } #ifdef DoBorderRounding if(fabs(value) < lp->infinite) value = my_avoidtiny(value, lp->matA->epsvalue); #endif value = scaled_value(lp, value, lp->rows + colnr); if(lp->tighten_on_set) { if(value < lp->orig_lowbo[lp->rows + colnr]) { report(lp, IMPORTANT, "set_upbo: Upperbound must be >= lowerbound\n"); return(FALSE); } if(value < lp->orig_upbo[lp->rows + colnr]) { set_action(&lp->spx_action, ACTION_REBASE); lp->orig_upbo[lp->rows + colnr] = value; } } else { set_action(&lp->spx_action, ACTION_REBASE); if(value > lp->infinite) value = lp->infinite; lp->orig_upbo[lp->rows + colnr] = value; } return(TRUE); } REAL __WINAPI get_upbo(lprec *lp, int colnr) { REAL value; if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "get_upbo: Column %d out of range\n", colnr); return(0); } value = lp->orig_upbo[lp->rows + colnr]; value = unscaled_value(lp, value, lp->rows + colnr); return(value); } MYBOOL __WINAPI set_lowbo(lprec *lp, int colnr, REAL value) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_lowbo: Column %d out of range\n", colnr); return(FALSE); } #ifdef DoBorderRounding if(fabs(value) < lp->infinite) value = my_avoidtiny(value, lp->matA->epsvalue); #endif value = scaled_value(lp, value, lp->rows + colnr); if(lp->tighten_on_set) { if(value > lp->orig_upbo[lp->rows + colnr]) { report(lp, IMPORTANT, "set_lowbo: Upper bound must be >= lower bound\n"); return(FALSE); } if((value < 0) || (value > lp->orig_lowbo[lp->rows + colnr])) { set_action(&lp->spx_action, ACTION_REBASE); lp->orig_lowbo[lp->rows + colnr] = value; } } else { set_action(&lp->spx_action, ACTION_REBASE); if(value < -lp->infinite) value = -lp->infinite; lp->orig_lowbo[lp->rows + colnr] = value; } return(TRUE); } REAL __WINAPI get_lowbo(lprec *lp, int colnr) { REAL value; if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "get_lowbo: Column %d out of range\n", colnr); return(0); } value = lp->orig_lowbo[lp->rows + colnr]; value = unscaled_value(lp, value, lp->rows + colnr); return(value); } MYBOOL __WINAPI set_bounds(lprec *lp, int colnr, REAL lower, REAL upper) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_bounds: Column %d out of range\n", colnr); return(FALSE); } if(fabs(upper - lower) < lp->epsvalue) { if(lower < 0) lower = upper; else upper = lower; } else if(lower > upper) { report(lp, IMPORTANT, "set_bounds: Column %d upper bound must be >= lower bound\n", colnr); return( FALSE ); } colnr += lp->rows; if(lower < -lp->infinite) lower = -lp->infinite; else if(lp->scaling_used) { lower = scaled_value(lp, lower, colnr); #ifdef DoBorderRounding lower = my_avoidtiny(lower, lp->matA->epsvalue); #endif } if(upper > lp->infinite) upper = lp->infinite; else if(lp->scaling_used) { upper = scaled_value(lp, upper, colnr); #ifdef DoBorderRounding upper = my_avoidtiny(upper, lp->matA->epsvalue); #endif } lp->orig_lowbo[colnr] = lower; lp->orig_upbo[colnr] = upper; set_action(&lp->spx_action, ACTION_REBASE); return(TRUE); } MYBOOL get_bounds(lprec *lp, int column, REAL *lower, REAL *upper) { if((column > lp->columns) || (column < 1)) { report(lp, IMPORTANT, "get_bounds: Column %d out of range", column); return(FALSE); } if(lower != NULL) *lower = get_lowbo(lp, column); if(upper != NULL) *upper = get_upbo(lp, column); return(TRUE); } MYBOOL __WINAPI set_int(lprec *lp, int colnr, MYBOOL var_type) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_int: Column %d out of range\n", colnr); return(FALSE); } if((lp->var_type[colnr] & ISINTEGER) != 0) { lp->int_vars--; lp->var_type[colnr] &= ~ISINTEGER; } if(var_type) { lp->var_type[colnr] |= ISINTEGER; lp->int_vars++; if(lp->columns_scaled && !is_integerscaling(lp)) unscale_columns(lp); } return(TRUE); } MYBOOL __WINAPI is_int(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_int: Column %d out of range\n", colnr); return(FALSE); } return((lp->var_type[colnr] & ISINTEGER) != 0); } MYBOOL __WINAPI is_SOS_var(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_SOS_var: Column %d out of range\n", colnr); return(FALSE); } return((lp->var_type[colnr] & ISSOS) != 0); } int __WINAPI add_SOS(lprec *lp, char *name, int sostype, int priority, int count, int *sosvars, REAL *weights) { SOSrec *SOS; int k; if((sostype < 1) || (count < 0)) { report(lp, IMPORTANT, "add_SOS: Invalid SOS type definition %d\n", sostype); return( 0 ); } /* Make sure SOSes of order 3 and higher are properly defined */ if(sostype > 2) { int j; for(k = 1; k <= count; k++) { j = sosvars[k]; if(!is_int(lp, j) || !is_semicont(lp, j)) { report(lp, IMPORTANT, "add_SOS: SOS3+ members all have to be integer or semi-continuous.\n"); return( 0 ); } } } /* Make size in the list to handle another SOS record */ if(lp->SOS == NULL) lp->SOS = create_SOSgroup(lp); /* Create and append SOS to list */ SOS = create_SOSrec(lp->SOS, name, sostype, priority, count, sosvars, weights); k = append_SOSgroup(lp->SOS, SOS); return(k); } STATIC int add_GUB(lprec *lp, char *name, int priority, int count, int *gubvars) { SOSrec *GUB; int k; #ifdef Paranoia if(count < 0) { report(lp, IMPORTANT, "add_GUB: Invalid GUB member count %d\n", count); return(FALSE); } #endif /* Make size in the list to handle another GUB record */ if(lp->GUB == NULL) lp->GUB = create_SOSgroup(lp); /* Create and append GUB to list */ GUB = create_SOSrec(lp->GUB, name, 1, priority, count, gubvars, NULL); GUB->isGUB = TRUE; k = append_SOSgroup(lp->GUB, GUB); return(k); } MYBOOL __WINAPI set_binary(lprec *lp, int colnr, MYBOOL must_be_bin) { MYBOOL status = FALSE; if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_binary: Column %d out of range\n", colnr); return( status ); } status = set_int(lp, colnr, must_be_bin); if(status && must_be_bin) status = set_bounds(lp, colnr, 0, 1); return( status ); } MYBOOL __WINAPI is_binary(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_binary: Column %d out of range\n", colnr); return(FALSE); } return((MYBOOL) (((lp->var_type[colnr] & ISINTEGER) != 0) && (get_lowbo(lp, colnr) == 0) && (fabs(get_upbo(lp, colnr) - 1) < lp->epsprimal))); } MYBOOL __WINAPI set_unbounded(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_unbounded: Column %d out of range\n", colnr); return( FALSE ); } return( set_bounds(lp, colnr, -lp->infinite, lp->infinite) ); } MYBOOL __WINAPI is_unbounded(lprec *lp, int colnr) { MYBOOL test; if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_unbounded: Column %d out of range\n", colnr); return(FALSE); } test = is_splitvar(lp, colnr); if(!test) { colnr += lp->rows; test = (MYBOOL) ((lp->orig_lowbo[colnr] <= -lp->infinite) && (lp->orig_upbo[colnr] >= lp->infinite)); } return( test ); } MYBOOL __WINAPI is_negative(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_negative: Column %d out of range\n", colnr); return( FALSE ); } colnr += lp->rows; return( (MYBOOL) ((lp->orig_upbo[colnr] <= 0) && (lp->orig_lowbo[colnr] < 0)) ); } MYBOOL __WINAPI set_var_weights(lprec *lp, REAL *weights) { if(lp->var_priority != NULL) { FREE(lp->var_priority); } if(weights != NULL) { int n; allocINT(lp, &lp->var_priority, lp->columns_alloc, FALSE); for(n = 0; n < lp->columns; n++) { lp->var_priority[n] = n+1; } n = sortByREAL(lp->var_priority, weights, lp->columns, 0, FALSE); } return(TRUE); } MYBOOL __WINAPI set_var_priority(lprec *lp) /* Experimental automatic variable ordering/priority setting */ { MYBOOL status = FALSE; if(is_bb_mode(lp, NODE_AUTOORDER) && (lp->var_priority == NULL) && (SOS_count(lp) == 0)) { REAL *rcost = NULL; int i, j, *colorder = NULL; allocINT(lp, &colorder, lp->columns+1, FALSE); /* Create an "optimal" B&B variable ordering; this MDO-based routine returns column indeces in an increasing order of co-dependency. It can be argued that arranging the columns in right-to-left MDO order should tend to minimize the consequences of choosing the wrong variable by reducing the average B&B depth. */ colorder[0] = lp->columns; for(j = 1; j <= lp->columns; j++) colorder[j] = lp->rows+j; i = getMDO(lp, NULL, colorder, NULL, FALSE); /* Map to variable weight */ allocREAL(lp, &rcost, lp->columns+1, FALSE); for(j = lp->columns; j > 0; j--) { i = colorder[j]-lp->rows; rcost[i] = -j; } /* Establish the MIP variable priorities */ set_var_weights(lp, rcost+1); FREE(rcost); FREE(colorder); status = TRUE; } return( status ); } int __WINAPI get_var_priority(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "get_var_priority: Column %d out of range\n", colnr); return(FALSE); } if(lp->var_priority == NULL) return(colnr); else return(lp->var_priority[colnr - 1]); } MYBOOL __WINAPI set_semicont(lprec *lp, int colnr, MYBOOL must_be_sc) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "set_semicont: Column %d out of range\n", colnr); return(FALSE); } if(lp->sc_lobound[colnr] != 0) { lp->sc_vars--; lp->var_type[colnr] &= ~ISSEMI; } lp->sc_lobound[colnr] = must_be_sc; if(must_be_sc) { lp->var_type[colnr] |= ISSEMI; lp->sc_vars++; } return(TRUE); } MYBOOL __WINAPI is_semicont(lprec *lp, int colnr) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "is_semicont: Column %d out of range\n", colnr); return(FALSE); } return((lp->var_type[colnr] & ISSEMI) != 0); } MYBOOL __WINAPI set_rh(lprec *lp, int rownr, REAL value) { if((rownr > lp->rows) || (rownr < 0)) { report(lp, IMPORTANT, "set_rh: Row %d out of range\n", rownr); return(FALSE); } if(((rownr == 0) && (!is_maxim(lp))) || ((rownr > 0) && is_chsign(lp, rownr))) /* setting of RHS of OF IS meaningful */ value = my_flipsign(value); if(fabs(value) > lp->infinite) { if(value < 0) value = -lp->infinite; else value = lp->infinite; } #ifdef DoBorderRounding else value = my_avoidtiny(value, lp->matA->epsvalue); #endif value = scaled_value(lp, value, rownr); lp->orig_rhs[rownr] = value; set_action(&lp->spx_action, ACTION_RECOMPUTE); return(TRUE); } REAL __WINAPI get_rh(lprec *lp, int rownr) { REAL value; if((rownr > lp->rows) || (rownr < 0)) { report(lp, IMPORTANT, "get_rh: Row %d out of range", rownr); return( 0.0 ); } value = lp->orig_rhs[rownr]; if (((rownr == 0) && !is_maxim(lp)) || ((rownr > 0) && is_chsign(lp, rownr))) /* setting of RHS of OF IS meaningful */ value = my_flipsign(value); value = unscaled_value(lp, value, rownr); return(value); } REAL get_rh_upper(lprec *lp, int rownr) { REAL value, valueR; value = lp->orig_rhs[rownr]; if(is_chsign(lp, rownr)) { valueR = lp->orig_upbo[rownr]; if(is_infinite(lp, valueR)) return(lp->infinite); value = my_flipsign(value); value += valueR; } value = unscaled_value(lp, value, rownr); return(value); } REAL get_rh_lower(lprec *lp, int rownr) { REAL value, valueR; value = lp->orig_rhs[rownr]; if(is_chsign(lp, rownr)) value = my_flipsign(value); else { valueR = lp->orig_upbo[rownr]; if(is_infinite(lp, valueR)) return(-lp->infinite); value -= valueR; } value = unscaled_value(lp, value, rownr); return(value); } MYBOOL set_rh_upper(lprec *lp, int rownr, REAL value) { if(rownr > lp->rows || rownr < 1) { report(lp, IMPORTANT, "set_rh_upper: Row %d out of range", rownr); return(FALSE); } /* First scale the value */ value = scaled_value(lp, value, rownr); /* orig_rhs stores the upper bound assuming a < constraint; If we have a > constraint, we must adjust the range instead */ if(is_chsign(lp, rownr)) { if(is_infinite(lp, value)) lp->orig_upbo[rownr] = lp->infinite; else { #ifdef Paranoia if(value + lp->orig_rhs[rownr] < 0) { report(lp, SEVERE, "set_rh_upper: Invalid negative range in row %d\n", rownr); return(FALSE); } #endif #ifdef DoBorderRounding lp->orig_upbo[rownr] = my_avoidtiny(value + lp->orig_rhs[rownr], lp->epsvalue); #else lp->orig_upbo[rownr] = value + lp->orig_rhs[rownr]; #endif } } else { /* If there is a constraint range, then this has to be adjusted also */ if(!is_infinite(lp, lp->orig_upbo[rownr])) { lp->orig_upbo[rownr] -= lp->orig_rhs[rownr] - value; my_roundzero(lp->orig_upbo[rownr], lp->epsvalue); if(lp->orig_upbo[rownr] < 0) { report(lp, IMPORTANT, "set_rh_upper: Negative bound set for constraint %d made 0\n", rownr); lp->orig_upbo[rownr] = 0; } } lp->orig_rhs[rownr] = value; } return(TRUE); } MYBOOL set_rh_lower(lprec *lp, int rownr, REAL value) { if(rownr > lp->rows || rownr < 1) { report(lp, IMPORTANT, "set_rh_lower: Row %d out of range", rownr); return(FALSE); } /* First scale the value */ value = scaled_value(lp, value, rownr); /* orig_rhs stores the upper bound assuming a < constraint; If we have a < constraint, we must adjust the range instead */ if(!is_chsign(lp, rownr)) { if(is_infinite(lp, value)) lp->orig_upbo[rownr] = lp->infinite; else { #ifdef Paranoia if(lp->orig_rhs[rownr] - value < 0) { report(lp, SEVERE, "set_rh_lower: Invalid negative range in row %d\n", rownr); return(FALSE); } #endif #ifdef DoBorderRounding lp->orig_upbo[rownr] = my_avoidtiny(lp->orig_rhs[rownr] - value, lp->epsvalue); #else lp->orig_upbo[rownr] = lp->orig_rhs[rownr] - value; #endif } } else { value = my_flipsign(value); /* If there is a constraint range, then this has to be adjusted also */ if(!is_infinite(lp, lp->orig_upbo[rownr])) { lp->orig_upbo[rownr] -= lp->orig_rhs[rownr] - value; my_roundzero(lp->orig_upbo[rownr], lp->epsvalue); if(lp->orig_upbo[rownr] < 0) { report(lp, IMPORTANT, "set_rh_lower: Negative bound set for constraint %d made 0\n", rownr); lp->orig_upbo[rownr] = 0; } } lp->orig_rhs[rownr] = value; } return(TRUE); } MYBOOL __WINAPI set_rh_range(lprec *lp, int rownr, REAL deltavalue) { if((rownr > lp->rows) || (rownr < 1)) { report(lp, IMPORTANT, "set_rh_range: Row %d out of range", rownr); return(FALSE); } deltavalue = scaled_value(lp, deltavalue, rownr); if(deltavalue > lp->infinite) deltavalue = lp->infinite; else if(deltavalue < -lp->infinite) deltavalue = -lp->infinite; #ifdef DoBorderRounding else deltavalue = my_avoidtiny(deltavalue, lp->matA->epsvalue); #endif if(fabs(deltavalue) < lp->epsprimal) { /* Conversion to EQ */ set_constr_type(lp, rownr, EQ); } else if(is_constr_type(lp, rownr, EQ)) { /* EQ with a non-zero range */ if(deltavalue > 0) set_constr_type(lp, rownr, GE); else set_constr_type(lp, rownr, LE); lp->orig_upbo[rownr] = fabs(deltavalue); } else { /* Modify GE/LE ranges */ lp->orig_upbo[rownr] = fabs(deltavalue); } return(TRUE); } REAL __WINAPI get_rh_range(lprec *lp, int rownr) { if((rownr > lp->rows) || (rownr < 0)) { report(lp, IMPORTANT, "get_rh_range: row %d out of range\n", rownr); return(FALSE); } if(lp->orig_upbo[rownr] >= lp->infinite) return(lp->orig_upbo[rownr]); else return(unscaled_value(lp, lp->orig_upbo[rownr], rownr)); } void __WINAPI set_rh_vec(lprec *lp, REAL *rh) { int i; REAL rhi; for(i = 1; i <= lp->rows; i++) { rhi = rh[i]; #ifdef DoBorderRounding rhi = my_avoidtiny(rhi, lp->matA->epsvalue); #endif lp->orig_rhs[i] = my_chsign(is_chsign(lp, i), scaled_value(lp, rhi, i)); } set_action(&lp->spx_action, ACTION_RECOMPUTE); } MYBOOL __WINAPI str_set_rh_vec(lprec *lp, char *rh_string) { int i; MYBOOL ret = TRUE; REAL *newrh; char *p, *newp; allocREAL(lp, &newrh, lp->rows + 1, TRUE); p = rh_string; for(i = 1; i <= lp->rows; i++) { newrh[i] = (REAL) strtod(p, &newp); if(p == newp) { report(lp, IMPORTANT, "str_set_rh_vec: Bad string %s\n", p); lp->spx_status = DATAIGNORED; ret = FALSE; break; } else p = newp; } if(!(lp->spx_status == DATAIGNORED)) set_rh_vec(lp, newrh); FREE(newrh); return( ret ); } void __WINAPI set_sense(lprec *lp, MYBOOL maximize) { maximize = (MYBOOL) (maximize != FALSE); if(is_maxim(lp) != maximize) { int i; if(is_infinite(lp, lp->bb_heuristicOF)) lp->bb_heuristicOF = my_chsign(maximize, lp->infinite); if(is_infinite(lp, lp->bb_breakOF)) lp->bb_breakOF = my_chsign(maximize, -lp->infinite); lp->orig_rhs[0] = my_flipsign(lp->orig_rhs[0]); for(i = 1; i <= lp->columns; i++) lp->orig_obj[i] = my_flipsign(lp->orig_obj[i]); set_action(&lp->spx_action, ACTION_REINVERT | ACTION_RECOMPUTE); } if(maximize) lp->row_type[0] = ROWTYPE_OFMAX; else lp->row_type[0] = ROWTYPE_OFMIN; } void __WINAPI set_maxim(lprec *lp) { set_sense(lp, TRUE); } void __WINAPI set_minim(lprec *lp) { set_sense(lp, FALSE); } MYBOOL __WINAPI is_maxim(lprec *lp) { return( (MYBOOL) ((lp->row_type != NULL) && ((lp->row_type[0] & ROWTYPE_CHSIGN) == ROWTYPE_GE)) ); } MYBOOL __WINAPI set_constr_type(lprec *lp, int rownr, int con_type) { MYBOOL oldchsign; if(rownr > lp->rows+1 || rownr < 1) { report(lp, IMPORTANT, "set_constr_type: Row %d out of range\n", rownr); return( FALSE ); } /* Prepare for a new row */ if((rownr > lp->rows) && !append_rows(lp, rownr-lp->rows)) return( FALSE ); /* Update the constraint type data */ if(is_constr_type(lp, rownr, EQ)) lp->equalities--; if((con_type & ROWTYPE_CONSTRAINT) == EQ) { lp->equalities++; lp->orig_upbo[rownr] = 0; } else if(((con_type & LE) > 0) || ((con_type & GE) > 0) || (con_type == FR)) lp->orig_upbo[rownr] = lp->infinite; else { report(lp, IMPORTANT, "set_constr_type: Constraint type %d not implemented (row %d)\n", con_type, rownr); return( FALSE ); } /* Change the signs of the row, if necessary */ oldchsign = is_chsign(lp, rownr); if(con_type == FR) lp->row_type[rownr] = LE; else lp->row_type[rownr] = con_type; if(oldchsign != is_chsign(lp, rownr)) { MATrec *mat = lp->matA; if(mat->is_roworder) mat_multcol(mat, rownr, -1, FALSE); else mat_multrow(mat, rownr, -1); if(lp->orig_rhs[rownr] != 0) lp->orig_rhs[rownr] *= -1; set_action(&lp->spx_action, ACTION_RECOMPUTE); } if(con_type == FR) lp->orig_rhs[rownr] = lp->infinite; set_action(&lp->spx_action, ACTION_REINVERT); lp->basis_valid = FALSE; return( TRUE ); } /* INLINE */ MYBOOL is_chsign(lprec *lp, int rownr) { return( (MYBOOL) ((lp->row_type[rownr] & ROWTYPE_CONSTRAINT) == ROWTYPE_CHSIGN) ); } MYBOOL __WINAPI is_constr_type(lprec *lp, int rownr, int mask) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "is_constr_type: Row %d out of range\n", rownr); return( FALSE ); } return( (MYBOOL) ((lp->row_type[rownr] & ROWTYPE_CONSTRAINT) == mask)); } int __WINAPI get_constr_type(lprec *lp, int rownr) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "get_constr_type: Row %d out of range\n", rownr); return(-1); } return( lp->row_type[rownr] ); } REAL __WINAPI get_constr_value(lprec *lp, int rownr, int count, REAL *primsolution, int *nzindex) { int i; REAL value = 0.0; MATrec *mat = lp->matA; if((rownr < 0) || (rownr > get_Nrows(lp))) return( value ); /* First do validation and initialization of applicable primal solution */ if(!mat_validate(mat) || ((primsolution == NULL) && (lp->solvecount == 0))) return( value ); i = get_Ncolumns(lp); if((primsolution != NULL) && (nzindex == NULL) && ((count <= 0) || (count > i))) count = i; if(primsolution == NULL) { get_ptr_variables(lp, &primsolution); primsolution--; nzindex = NULL; count = i; } /* Do objective or constraint, as specified */ if(rownr == 0) { value += get_rh(lp, 0); if(nzindex != NULL) for(i = 0; i < count; i++) value += get_mat(lp, 0, nzindex[i]) * primsolution[i]; else for(i = 1; i <= count; i++) value += get_mat(lp, 0, i) * primsolution[i]; } else { if(nzindex != NULL) { for(i = 0; i < count; i++) value += get_mat(lp, rownr, nzindex[i]) * primsolution[i]; } else { int j; for(i = mat->row_end[rownr-1]; i < mat->row_end[rownr]; i++) { j = ROW_MAT_COLNR(i); value += unscaled_mat(lp, ROW_MAT_VALUE(i), rownr, j) * primsolution[j]; } value = my_chsign(is_chsign(lp, rownr), value); } } return( value ); } STATIC char *get_str_constr_class(lprec *lp, int con_class) { switch(con_class) { case ROWCLASS_Unknown: return("Unknown"); case ROWCLASS_Objective: return("Objective"); case ROWCLASS_GeneralREAL: return("General REAL"); case ROWCLASS_GeneralMIP: return("General MIP"); case ROWCLASS_GeneralINT: return("General INT"); case ROWCLASS_GeneralBIN: return("General BIN"); case ROWCLASS_KnapsackINT: return("Knapsack INT"); case ROWCLASS_KnapsackBIN: return("Knapsack BIN"); case ROWCLASS_SetPacking: return("Set packing"); case ROWCLASS_SetCover: return("Set cover"); case ROWCLASS_GUB: return("GUB"); default: return("Error"); } } STATIC char *get_str_constr_type(lprec *lp, int con_type) { switch(con_type) { case FR: return("FR"); case LE: return("LE"); case GE: return("GE"); case EQ: return("EQ"); default: return("Error"); } } STATIC int get_constr_class(lprec *lp, int rownr) { int aBIN = 0, aINT = 0, aREAL = 0, xBIN = 0, xINT = 0, xREAL = 0; int j, elmnr, elmend, nelm; MYBOOL chsign; REAL a; MATrec *mat = lp->matA; if((rownr < 1) || (rownr > lp->rows)) { report(lp, IMPORTANT, "get_constr_class: Row %d out of range\n", rownr); return( ROWCLASS_Unknown ); } mat_validate(mat); /* Tally counts of constraint variable types and coefficients */ if(rownr == 0) { elmnr = 1; elmend = lp->columns; nelm = 0; } else { elmnr = mat->row_end[rownr - 1]; elmend = mat->row_end[rownr]; nelm = elmend - elmnr; } chsign = is_chsign(lp, rownr); for(; elmnr < elmend; elmnr++) { if(rownr == 0) { a = lp->orig_obj[elmnr]; if(a == 0) continue; j = elmnr; } else { j = ROW_MAT_COLNR(elmnr); a = ROW_MAT_VALUE(elmnr); } a = unscaled_mat(lp, my_chsign(chsign, a), rownr, j); if(is_binary(lp, j)) xBIN++; else if((get_lowbo(lp, j) >= 0) && is_int(lp, j)) xINT++; else xREAL++; /* Includes integer variables with negative lower bound */ if(fabs(a-1.0) < lp->epsvalue) aBIN++; else if((a > 0) && (fabs(floor(a+lp->epsvalue)-a) < lp->epsvalue)) aINT++; else aREAL++; /* Includes negative integer-valued coefficients */ } /* Get the constraint type and the RHS */ if(rownr == 0) return( ROWCLASS_Objective ); j = get_constr_type(lp, rownr); a = get_rh(lp, rownr); /* Determine the constraint class */ if((aBIN == nelm) && (xBIN == nelm) && (a >= 1)) { if(a > 1) j = ROWCLASS_KnapsackBIN; else if(j == EQ) j = ROWCLASS_GUB; else if(j == LE) j = ROWCLASS_SetCover; else j = ROWCLASS_SetPacking; } else if((aINT == nelm) && (xINT == nelm) && (a >= 1)) j = ROWCLASS_KnapsackINT; else if(xBIN == nelm) j = ROWCLASS_GeneralBIN; else if(xINT == nelm) j = ROWCLASS_GeneralINT; else if((xREAL > 0) && (xINT+xBIN > 0)) j = ROWCLASS_GeneralMIP; else j = ROWCLASS_GeneralREAL; return( j ); } REAL __WINAPI get_mat(lprec *lp, int rownr, int colnr) { REAL value; int elmnr; int colnr1 = colnr, rownr1 = rownr; if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "get_mat: Row %d out of range", rownr); return(0); } if((colnr < 1) || (colnr > lp->columns)) { report(lp, IMPORTANT, "get_mat: Column %d out of range", colnr); return(0); } if(rownr == 0) { value = lp->orig_obj[colnr]; value = my_chsign(is_chsign(lp, rownr), value); value = unscaled_mat(lp, value, rownr, colnr); } else { if(lp->matA->is_roworder) swapINT(&colnr1, &rownr1); elmnr = mat_findelm(lp->matA, rownr1, colnr1); if(elmnr >= 0) { MATrec *mat = lp->matA; value = my_chsign(is_chsign(lp, rownr), COL_MAT_VALUE(elmnr)); value = unscaled_mat(lp, value, rownr, colnr); } else value = 0; } return(value); } REAL __WINAPI get_mat_byindex(lprec *lp, int matindex, MYBOOL isrow, MYBOOL adjustsign) /* Note that this function does not adjust for sign-changed GT constraints! */ { int *rownr, *colnr; REAL *value, result; mat_get_data(lp, matindex, isrow, &rownr, &colnr, &value); if(adjustsign) result = (*value) * (is_chsign(lp, *rownr) ? -1 : 1); else result = *value; if(lp->scaling_used) return( unscaled_mat(lp, result, *rownr, *colnr) ); else return( result ); } static int mat_getrow(lprec *lp, int rownr, REAL *row, int *colno) { MYBOOL isnz; int j, countnz = 0; REAL a; if((rownr == 0) || !mat_validate(lp->matA)) { for(j = 1; j <= lp->columns; j++) { a = get_mat(lp,rownr,j); isnz = (a != 0); if(colno == NULL) row[j] = a; else if(isnz) { row[countnz] = a; colno[countnz] = j; } if(isnz) countnz++; } } else { MYBOOL chsign = FALSE; int ie, i; MATrec *mat = lp->matA; if(colno == NULL) MEMCLEAR(row, lp->columns+1); if(mat->is_roworder) { /* Add the objective function */ a = get_mat(lp, 0, rownr); if(colno == NULL) { row[countnz] = a; if(a != 0) countnz++; } else if(a != 0) { row[countnz] = a; colno[countnz] = 0; countnz++; } } i = mat->row_end[rownr-1]; ie = mat->row_end[rownr]; if(!lp->matA->is_roworder) chsign = is_chsign(lp, rownr); for(; i < ie; i++) { j = ROW_MAT_COLNR(i); a = get_mat_byindex(lp, i, TRUE, FALSE); if(lp->matA->is_roworder) chsign = is_chsign(lp, j); a = my_chsign(chsign, a); if(colno == NULL) row[j] = a; else { row[countnz] = a; colno[countnz] = j; } countnz++; } } return( countnz ); } static int mat_getcolumn(lprec *lp, int colnr, REAL *column, int *nzrow) { int n = 0, i, ii, ie, *rownr; REAL hold, *value; MATrec *mat = lp->matA; if(nzrow == NULL) MEMCLEAR(column, lp->rows + 1); if(!mat->is_roworder) { /* Add the objective function */ hold = get_mat(lp, 0, colnr); if(nzrow == NULL) { column[n] = hold; if(hold != 0) n++; } else if(hold != 0) { column[n] = hold; nzrow[n] = 0; n++; } } i = lp->matA->col_end[colnr - 1]; ie = lp->matA->col_end[colnr]; if(nzrow == NULL) n += ie - i; rownr = &COL_MAT_ROWNR(i); value = &COL_MAT_VALUE(i); for(; i < ie; i++, rownr += matRowColStep, value += matValueStep) { ii = *rownr; hold = my_chsign(is_chsign(lp, (mat->is_roworder) ? colnr : ii), *value); hold = unscaled_mat(lp, hold, ii, colnr); if(nzrow == NULL) column[ii] = hold; else if(hold != 0) { column[n] = hold; nzrow[n] = ii; n++; } } return( n ); } int __WINAPI get_columnex(lprec *lp, int colnr, REAL *column, int *nzrow) { if((colnr > lp->columns) || (colnr < 1)) { report(lp, IMPORTANT, "get_columnex: Column %d out of range\n", colnr); return( -1 ); } if(lp->matA->is_roworder) return(mat_getrow(lp, colnr, column, nzrow)); else return(mat_getcolumn(lp, colnr, column, nzrow)); } MYBOOL __WINAPI get_column(lprec *lp, int colnr, REAL *column) { return( (MYBOOL) (get_columnex(lp, colnr, column, NULL) >= 0) ); } int __WINAPI get_rowex(lprec *lp, int rownr, REAL *row, int *colno) { if((rownr < 0) || (rownr > lp->rows)) { report(lp, IMPORTANT, "get_rowex: Row %d out of range\n", rownr); return( -1 ); } if(rownr != 0 && lp->matA->is_roworder) return(mat_getcolumn(lp, rownr, row, colno)); else return(mat_getrow(lp, rownr, row, colno)); } MYBOOL __WINAPI get_row(lprec *lp, int rownr, REAL *row) { return((MYBOOL) (get_rowex(lp, rownr, row, NULL) >= 0) ); } STATIC void set_OF_override(lprec *lp, REAL *ofVector) /* The purpose of this function is to set, or clear if NULL, the ofVector[0..columns] as the active objective function instead of the one stored in the A-matrix. See also lag_solve().*/ { lp->obj = ofVector; } MYBOOL modifyOF1(lprec *lp, int index, REAL *ofValue, REAL mult) /* Adjust objective function values for primal/dual phase 1, if appropriate */ { MYBOOL accept = TRUE; /* Primal simplex: Set user variables to zero or BigM-scaled */ if(((lp->simplex_mode & SIMPLEX_Phase1_PRIMAL) != 0) && (abs(lp->P1extraDim) > 0)) { #ifndef Phase1EliminateRedundant if(lp->P1extraDim < 0) { if(index > lp->sum + lp->P1extraDim) accept = FALSE; } else #endif if((index <= lp->sum - lp->P1extraDim) || (mult == 0)) { if((mult == 0) || (lp->bigM == 0)) accept = FALSE; else (*ofValue) /= lp->bigM; } } /* Dual simplex: Subtract P1extraVal from objective function values */ else if(((lp->simplex_mode & SIMPLEX_Phase1_DUAL) != 0) && (index > lp->rows)) { #if 1 /* This may help increase sparsity of the (extended) basis matrix; Can it introduce degeneracy in some cases? */ if((lp->P1extraVal != 0) && (lp->orig_obj[index - lp->rows] > 0)) *ofValue = 0; else #endif { *ofValue -= lp->P1extraVal; #if 0 if(is_action(lp->anti_degen, ANTIDEGEN_RHSPERTURB)) *ofValue -= rand_uniform(lp, lp->epsperturb); #endif } } /* Do scaling and test for zero */ if(accept) { (*ofValue) *= mult; if(fabs(*ofValue) < lp->epsmachine) { (*ofValue) = 0; accept = FALSE; } } else (*ofValue) = 0; return( accept ); } STATIC void set_OF_p1extra(lprec *lp, REAL p1extra) { int i; REAL *value; if(lp->spx_trace) report(lp, DETAILED, "set_OF_p1extra: Set dual objective offset to %g at iter %.0f.\n", p1extra, (double) get_total_iter(lp)); lp->P1extraVal = p1extra; if(lp->obj == NULL) allocREAL(lp, &lp->obj, lp->columns_alloc+1, TRUE); for(i = 1, value = lp->obj+1; i <= lp->columns; i++, value++) { *value = lp->orig_obj[i]; modifyOF1(lp, lp->rows + i, value, 1.0); } } STATIC void unset_OF_p1extra(lprec *lp) { lp->P1extraVal = 0; FREE(lp->obj); } REAL __WINAPI get_OF_active(lprec *lp, int varnr, REAL mult) { int colnr = varnr - lp->rows; REAL holdOF = 0; #ifdef Paranoia if((colnr <= 0) || (colnr > lp->columns)) { report(lp, SEVERE, "get_OF_active: Invalid column index %d supplied\n", colnr); } else #endif if(lp->obj == NULL) { if(colnr > 0) holdOF = lp->orig_obj[colnr]; modifyOF1(lp, varnr, &holdOF, mult); } else if(colnr > 0) holdOF = lp->obj[colnr] * mult; return( holdOF ); } STATIC MYBOOL is_OF_nz(lprec *lp, int colnr) { return( (MYBOOL) (lp->orig_obj[colnr] != 0) ); } STATIC int singleton_column(lprec *lp, int row_nr, REAL *column, int *nzlist, REAL value, int *maxabs) { int nz = 1; if(nzlist == NULL) { MEMCLEAR(column, lp->rows + 1); column[row_nr] = value; } else { column[nz] = value; nzlist[nz] = row_nr; } if(maxabs != NULL) *maxabs = row_nr; return( nz ); } STATIC int expand_column(lprec *lp, int col_nr, REAL *column, int *nzlist, REAL mult, int *maxabs) { int i, ie, j, maxidx, nzcount; REAL value, maxval; MATrec *mat = lp->matA; REAL *matValue; int *matRownr; /* Retrieve a column from the user data matrix A */ maxval = 0; maxidx = -1; if(nzlist == NULL) { MEMCLEAR(column, lp->rows + 1); i = mat->col_end[col_nr - 1]; ie = mat->col_end[col_nr]; matRownr = &COL_MAT_ROWNR(i); matValue = &COL_MAT_VALUE(i); nzcount = i; for(; i < ie; i++, matRownr += matRowColStep, matValue += matValueStep) { j = *matRownr; value = *matValue; if(j > 0) { value *= mult; if(fabs(value) > maxval) { maxval = fabs(value); maxidx = j; } } column[j] = value; } nzcount = i - nzcount; /* Get the objective as row 0, optionally adjusting the objective for phase 1 */ if(lp->obj_in_basis) { column[0] = get_OF_active(lp, lp->rows+col_nr, mult); if(column[0] != 0) nzcount++; } } else { nzcount = 0; /* Get the objective as row 0, optionally adjusting the objective for phase 1 */ if(lp->obj_in_basis) { value = get_OF_active(lp, lp->rows+col_nr, mult); if(value != 0) { nzcount++; nzlist[nzcount] = 0; column[nzcount] = value; } } /* Loop over the non-zero column entries */ i = mat->col_end[col_nr - 1]; ie = mat->col_end[col_nr]; matRownr = &COL_MAT_ROWNR(i); matValue = &COL_MAT_VALUE(i); for(; i < ie; i++, matRownr += matRowColStep, matValue += matValueStep) { j = *matRownr; value = (*matValue) * mult; nzcount++; nzlist[nzcount] = j; column[nzcount] = value; if(fabs(value) > maxval) { maxval = fabs(value); maxidx = nzcount; } } } if(maxabs != NULL) *maxabs = maxidx; return( nzcount ); } /* Retrieve a column vector from the data matrix [1..rows, rows+1..rows+columns]; needs __WINAPI call model since it may be called from BFPs */ int __WINAPI obtain_column(lprec *lp, int varin, REAL *pcol, int *nzlist, int *maxabs) { REAL value = my_chsign(lp->is_lower[varin], -1); if(varin > lp->rows) { varin -= lp->rows; varin = expand_column(lp, varin, pcol, nzlist, value, maxabs); } else if(lp->obj_in_basis || (varin > 0)) varin = singleton_column(lp, varin, pcol, nzlist, value, maxabs); else varin = get_basisOF(lp, NULL, pcol, nzlist); return(varin); } /* GENERAL INVARIANT CALLBACK FUNCTIONS */ MYBOOL set_callbacks(lprec *lp) { /* Assign API functions to lp structure (mainly for XLIs) */ lp->add_column = add_column; lp->add_columnex = add_columnex; lp->add_constraint = add_constraint; lp->add_constraintex = add_constraintex; lp->add_lag_con = add_lag_con; lp->add_SOS = add_SOS; lp->column_in_lp = column_in_lp; lp->copy_lp = copy_lp; lp->default_basis = default_basis; lp->del_column = del_column; lp->del_constraint = del_constraint; lp->delete_lp = delete_lp; lp->dualize_lp = dualize_lp; lp->free_lp = free_lp; lp->get_anti_degen = get_anti_degen; lp->get_basis = get_basis; lp->get_basiscrash = get_basiscrash; lp->get_bb_depthlimit = get_bb_depthlimit; lp->get_bb_floorfirst = get_bb_floorfirst; lp->get_bb_rule = get_bb_rule; lp->get_bounds_tighter = get_bounds_tighter; lp->get_break_at_value = get_break_at_value; lp->get_col_name = get_col_name; lp->get_columnex = get_columnex; lp->get_constr_type = get_constr_type; lp->get_constr_value = get_constr_value; lp->get_constraints = get_constraints; lp->get_dual_solution = get_dual_solution; lp->get_epsb = get_epsb; lp->get_epsd = get_epsd; lp->get_epsel = get_epsel; lp->get_epsint = get_epsint; lp->get_epsperturb = get_epsperturb; lp->get_epspivot = get_epspivot; lp->get_improve = get_improve; lp->get_infinite = get_infinite; lp->get_lambda = get_lambda; lp->get_lowbo = get_lowbo; lp->get_lp_index = get_lp_index; lp->get_lp_name = get_lp_name; lp->get_Lrows = get_Lrows; lp->get_mat = get_mat; lp->get_mat_byindex = get_mat_byindex; lp->get_max_level = get_max_level; lp->get_maxpivot = get_maxpivot; lp->get_mip_gap = get_mip_gap; lp->get_multiprice = get_multiprice; lp->get_nameindex = get_nameindex; lp->get_Ncolumns = get_Ncolumns; lp->get_negrange = get_negrange; lp->get_nonzeros = get_nonzeros; lp->get_Norig_columns = get_Norig_columns; lp->get_Norig_rows = get_Norig_rows; lp->get_Nrows = get_Nrows; lp->get_obj_bound = get_obj_bound; lp->get_objective = get_objective; lp->get_orig_index = get_orig_index; lp->get_origcol_name = get_origcol_name; lp->get_origrow_name = get_origrow_name; lp->get_partialprice = get_partialprice; lp->get_pivoting = get_pivoting; lp->get_presolve = get_presolve; lp->get_presolveloops = get_presolveloops; lp->get_primal_solution = get_primal_solution; lp->get_print_sol = get_print_sol; lp->get_pseudocosts = get_pseudocosts; lp->get_ptr_constraints = get_ptr_constraints; lp->get_ptr_dual_solution = get_ptr_dual_solution; lp->get_ptr_lambda = get_ptr_lambda; lp->get_ptr_primal_solution = get_ptr_primal_solution; lp->get_ptr_sensitivity_obj = get_ptr_sensitivity_obj; lp->get_ptr_sensitivity_objex = get_ptr_sensitivity_objex; lp->get_ptr_sensitivity_rhs = get_ptr_sensitivity_rhs; lp->get_ptr_variables = get_ptr_variables; lp->get_rh = get_rh; lp->get_rh_range = get_rh_range; lp->get_row = get_row; lp->get_rowex = get_rowex; lp->get_row_name = get_row_name; lp->get_scalelimit = get_scalelimit; lp->get_scaling = get_scaling; lp->get_sensitivity_obj = get_sensitivity_obj; lp->get_sensitivity_objex = get_sensitivity_objex; lp->get_sensitivity_rhs = get_sensitivity_rhs; lp->get_simplextype = get_simplextype; lp->get_solutioncount = get_solutioncount; lp->get_solutionlimit = get_solutionlimit; lp->get_status = get_status; lp->get_statustext = get_statustext; lp->get_timeout = get_timeout; lp->get_total_iter = get_total_iter; lp->get_total_nodes = get_total_nodes; lp->get_upbo = get_upbo; lp->get_var_branch = get_var_branch; lp->get_var_dualresult = get_var_dualresult; lp->get_var_primalresult = get_var_primalresult; lp->get_var_priority = get_var_priority; lp->get_variables = get_variables; lp->get_verbose = get_verbose; lp->get_working_objective = get_working_objective; lp->has_BFP = has_BFP; lp->has_XLI = has_XLI; lp->is_add_rowmode = is_add_rowmode; lp->is_anti_degen = is_anti_degen; lp->is_binary = is_binary; lp->is_break_at_first = is_break_at_first; lp->is_constr_type = is_constr_type; lp->is_debug = is_debug; lp->is_feasible = is_feasible; lp->is_unbounded = is_unbounded; lp->is_infinite = is_infinite; lp->is_int = is_int; lp->is_integerscaling = is_integerscaling; lp->is_lag_trace = is_lag_trace; lp->is_maxim = is_maxim; lp->is_nativeBFP = is_nativeBFP; lp->is_nativeXLI = is_nativeXLI; lp->is_negative = is_negative; lp->is_obj_in_basis = is_obj_in_basis; lp->is_piv_mode = is_piv_mode; lp->is_piv_rule = is_piv_rule; lp->is_presolve = is_presolve; lp->is_scalemode = is_scalemode; lp->is_scaletype = is_scaletype; lp->is_semicont = is_semicont; lp->is_SOS_var = is_SOS_var; lp->is_trace = is_trace; lp->lp_solve_version = lp_solve_version; lp->make_lp = make_lp; lp->print_constraints = print_constraints; lp->print_debugdump = print_debugdump; lp->print_duals = print_duals; lp->print_lp = print_lp; lp->print_objective = print_objective; lp->print_scales = print_scales; lp->print_solution = print_solution; lp->print_str = print_str; lp->print_tableau = print_tableau; lp->put_abortfunc = put_abortfunc; lp->put_bb_nodefunc = put_bb_nodefunc; lp->put_bb_branchfunc = put_bb_branchfunc; lp->put_logfunc = put_logfunc; lp->put_msgfunc = put_msgfunc; lp->read_LP = read_LP; lp->read_MPS = read_MPS; lp->read_XLI = read_XLI; lp->read_basis = read_basis; lp->reset_basis = reset_basis; lp->read_params = read_params; lp->reset_params = reset_params; lp->resize_lp = resize_lp; lp->set_action = set_action; lp->set_add_rowmode = set_add_rowmode; lp->set_anti_degen = set_anti_degen; lp->set_basisvar = set_basisvar; lp->set_basis = set_basis; lp->set_basiscrash = set_basiscrash; lp->set_bb_depthlimit = set_bb_depthlimit; lp->set_bb_floorfirst = set_bb_floorfirst; lp->set_bb_rule = set_bb_rule; lp->set_BFP = set_BFP; lp->set_binary = set_binary; lp->set_bounds = set_bounds; lp->set_bounds_tighter = set_bounds_tighter; lp->set_break_at_first = set_break_at_first; lp->set_break_at_value = set_break_at_value; lp->set_col_name = set_col_name; lp->set_constr_type = set_constr_type; lp->set_debug = set_debug; lp->set_epsb = set_epsb; lp->set_epsd = set_epsd; lp->set_epsel = set_epsel; lp->set_epsint = set_epsint; lp->set_epslevel = set_epslevel; lp->set_epsperturb = set_epsperturb; lp->set_epspivot = set_epspivot; lp->set_unbounded = set_unbounded; lp->set_improve = set_improve; lp->set_infinite = set_infinite; lp->set_int = set_int; lp->set_lag_trace = set_lag_trace; lp->set_lowbo = set_lowbo; lp->set_lp_name = set_lp_name; lp->set_mat = set_mat; lp->set_maxim = set_maxim; lp->set_maxpivot = set_maxpivot; lp->set_minim = set_minim; lp->set_mip_gap = set_mip_gap; lp->set_multiprice = set_multiprice; lp->set_negrange = set_negrange; lp->set_obj = set_obj; lp->set_obj_bound = set_obj_bound; lp->set_obj_fn = set_obj_fn; lp->set_obj_fnex = set_obj_fnex; lp->set_obj_in_basis = set_obj_in_basis; lp->set_outputfile = set_outputfile; lp->set_outputstream = set_outputstream; lp->set_partialprice = set_partialprice; lp->set_pivoting = set_pivoting; lp->set_preferdual = set_preferdual; lp->set_presolve = set_presolve; lp->set_print_sol = set_print_sol; lp->set_pseudocosts = set_pseudocosts; lp->set_rh = set_rh; lp->set_rh_range = set_rh_range; lp->set_rh_vec = set_rh_vec; lp->set_row = set_row; lp->set_rowex = set_rowex; lp->set_row_name = set_row_name; lp->set_scalelimit = set_scalelimit; lp->set_scaling = set_scaling; lp->set_semicont = set_semicont; lp->set_sense = set_sense; lp->set_simplextype = set_simplextype; lp->set_solutionlimit = set_solutionlimit; lp->set_timeout = set_timeout; lp->set_trace = set_trace; lp->set_upbo = set_upbo; lp->set_var_branch = set_var_branch; lp->set_var_weights = set_var_weights; lp->set_verbose = set_verbose; lp->set_XLI = set_XLI; lp->solve = solve; lp->str_add_column = str_add_column; lp->str_add_constraint = str_add_constraint; lp->str_add_lag_con = str_add_lag_con; lp->str_set_obj_fn = str_set_obj_fn; lp->str_set_rh_vec = str_set_rh_vec; lp->time_elapsed = time_elapsed; lp->unscale = unscale; lp->write_lp = write_lp; lp->write_LP = write_LP; lp->write_mps = write_mps; lp->write_freemps = write_freemps; lp->write_MPS = write_MPS; lp->write_freeMPS = write_freeMPS; lp->write_XLI = write_XLI; lp->write_basis = write_basis; lp->write_params = write_params; /* Utility functions (mainly for BFPs) */ lp->userabort = userabort; lp->report = report; lp->explain = explain; lp->set_basisvar = set_basisvar; lp->get_lpcolumn = obtain_column; lp->get_basiscolumn = get_basiscolumn; lp->get_OF_active = get_OF_active; lp->getMDO = getMDO; lp->invert = invert; lp->set_action = set_action; lp->clear_action = clear_action; lp->is_action = is_action; return( TRUE ); } /* SUPPORT FUNCTION FOR BASIS FACTORIZATION PACKAGES */ MYBOOL __WINAPI has_BFP(lprec *lp) { return( is_nativeBFP(lp) #if LoadInverseLib == TRUE || (MYBOOL) (lp->hBFP != NULL) #endif ); } MYBOOL __WINAPI is_nativeBFP(lprec *lp) { #ifdef ExcludeNativeInverse return( FALSE ); #elif LoadInverseLib == TRUE return( (MYBOOL) (lp->hBFP == NULL) ); #else return( TRUE ); #endif } MYBOOL __WINAPI set_BFP(lprec *lp, char *filename) /* (Re)mapping of basis factorization variant methods is done here */ { int result = LIB_LOADED; /* Release the BFP and basis if we are active */ if(lp->invB != NULL) bfp_free(lp); #if LoadInverseLib == TRUE if(lp->hBFP != NULL) { #ifdef WIN32 FreeLibrary(lp->hBFP); #else dlclose(lp->hBFP); #endif lp->hBFP = NULL; } #endif if(filename == NULL) { if(!is_nativeBFP(lp)) return( FALSE ); #ifndef ExcludeNativeInverse lp->bfp_name = bfp_name; lp->bfp_compatible = bfp_compatible; lp->bfp_free = bfp_free; lp->bfp_resize = bfp_resize; lp->bfp_nonzeros = bfp_nonzeros; lp->bfp_memallocated = bfp_memallocated; lp->bfp_restart = bfp_restart; lp->bfp_mustrefactorize = bfp_mustrefactorize; lp->bfp_preparefactorization = bfp_preparefactorization; lp->bfp_factorize = bfp_factorize; lp->bfp_finishupdate = bfp_finishupdate; lp->bfp_ftran_normal = bfp_ftran_normal; lp->bfp_ftran_prepare = bfp_ftran_prepare; lp->bfp_btran_normal = bfp_btran_normal; lp->bfp_status = bfp_status; lp->bfp_implicitslack = bfp_implicitslack; lp->bfp_indexbase = bfp_indexbase; lp->bfp_rowoffset = bfp_rowoffset; lp->bfp_pivotmax = bfp_pivotmax; lp->bfp_init = bfp_init; lp->bfp_pivotalloc = bfp_pivotalloc; lp->bfp_colcount = bfp_colcount; lp->bfp_canresetbasis = bfp_canresetbasis; lp->bfp_finishfactorization = bfp_finishfactorization; lp->bfp_updaterefactstats = bfp_updaterefactstats; lp->bfp_prepareupdate = bfp_prepareupdate; lp->bfp_pivotRHS = bfp_pivotRHS; lp->bfp_btran_double = bfp_btran_double; lp->bfp_efficiency = bfp_efficiency; lp->bfp_pivotvector = bfp_pivotvector; lp->bfp_pivotcount = bfp_pivotcount; lp->bfp_refactcount = bfp_refactcount; lp->bfp_isSetI = bfp_isSetI; lp->bfp_findredundant = bfp_findredundant; #endif } else { #if LoadInverseLib == TRUE #ifdef WIN32 /* Get a handle to the Windows DLL module. */ lp->hBFP = LoadLibrary(filename); /* If the handle is valid, try to get the function addresses. */ if(lp->hBFP != NULL) { lp->bfp_compatible = (BFPbool_lpintintint *) GetProcAddress(lp->hBFP, "bfp_compatible"); if(lp->bfp_compatible == NULL) result = LIB_NOINFO; else if(lp->bfp_compatible(lp, BFPVERSION, MAJORVERSION, sizeof(REAL))) { lp->bfp_name = (BFPchar *) GetProcAddress(lp->hBFP, "bfp_name"); lp->bfp_free = (BFP_lp *) GetProcAddress(lp->hBFP, "bfp_free"); lp->bfp_resize = (BFPbool_lpint *) GetProcAddress(lp->hBFP, "bfp_resize"); lp->bfp_nonzeros = (BFPint_lpbool *) GetProcAddress(lp->hBFP, "bfp_nonzeros"); lp->bfp_memallocated = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_memallocated"); lp->bfp_restart = (BFPbool_lp *) GetProcAddress(lp->hBFP, "bfp_restart"); lp->bfp_mustrefactorize = (BFPbool_lp *) GetProcAddress(lp->hBFP, "bfp_mustrefactorize"); lp->bfp_preparefactorization = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_preparefactorization"); lp->bfp_factorize = (BFPint_lpintintboolbool *) GetProcAddress(lp->hBFP, "bfp_factorize"); lp->bfp_finishupdate = (BFPbool_lpbool *) GetProcAddress(lp->hBFP, "bfp_finishupdate"); lp->bfp_ftran_normal = (BFP_lprealint *) GetProcAddress(lp->hBFP, "bfp_ftran_normal"); lp->bfp_ftran_prepare = (BFP_lprealint *) GetProcAddress(lp->hBFP, "bfp_ftran_prepare"); lp->bfp_btran_normal = (BFP_lprealint *) GetProcAddress(lp->hBFP, "bfp_btran_normal"); lp->bfp_status = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_status"); lp->bfp_implicitslack = (BFPbool_lp *) GetProcAddress(lp->hBFP, "bfp_implicitslack"); lp->bfp_indexbase = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_indexbase"); lp->bfp_rowoffset = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_rowoffset"); lp->bfp_pivotmax = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_pivotmax"); lp->bfp_init = (BFPbool_lpintintchar *) GetProcAddress(lp->hBFP, "bfp_init"); lp->bfp_pivotalloc = (BFPbool_lpint *) GetProcAddress(lp->hBFP, "bfp_pivotalloc"); lp->bfp_colcount = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_colcount"); lp->bfp_canresetbasis = (BFPbool_lp *) GetProcAddress(lp->hBFP, "bfp_canresetbasis"); lp->bfp_finishfactorization = (BFP_lp *) GetProcAddress(lp->hBFP, "bfp_finishfactorization"); lp->bfp_updaterefactstats = (BFP_lp *) GetProcAddress(lp->hBFP, "bfp_updaterefactstats"); lp->bfp_prepareupdate = (BFPlreal_lpintintreal *) GetProcAddress(lp->hBFP, "bfp_prepareupdate"); lp->bfp_pivotRHS = (BFPreal_lplrealreal *) GetProcAddress(lp->hBFP, "bfp_pivotRHS"); lp->bfp_btran_double = (BFP_lprealintrealint *) GetProcAddress(lp->hBFP, "bfp_btran_double"); lp->bfp_efficiency = (BFPreal_lp *) GetProcAddress(lp->hBFP, "bfp_efficiency"); lp->bfp_pivotvector = (BFPrealp_lp *) GetProcAddress(lp->hBFP, "bfp_pivotvector"); lp->bfp_pivotcount = (BFPint_lp *) GetProcAddress(lp->hBFP, "bfp_pivotcount"); lp->bfp_refactcount = (BFPint_lpint *) GetProcAddress(lp->hBFP, "bfp_refactcount"); lp->bfp_isSetI = (BFPbool_lp *) GetProcAddress(lp->hBFP, "bfp_isSetI"); lp->bfp_findredundant = (BFPint_lpintrealcbintint *) GetProcAddress(lp->hBFP, "bfp_findredundant"); } else result = LIB_VERINVALID; } #else /* First standardize UNIX .SO library name format. */ char bfpname[260], *ptr; strcpy(bfpname, filename); if((ptr = strrchr(filename, '/')) == NULL) ptr = filename; else ptr++; bfpname[(int) (ptr - filename)] = 0; if(strncmp(ptr, "lib", 3)) strcat(bfpname, "lib"); strcat(bfpname, ptr); if(strcmp(bfpname + strlen(bfpname) - 3, ".so")) strcat(bfpname, ".so"); /* Get a handle to the module. */ lp->hBFP = dlopen(bfpname, RTLD_LAZY); /* If the handle is valid, try to get the function addresses. */ if(lp->hBFP != NULL) { lp->bfp_compatible = (BFPbool_lpintintint *) dlsym(lp->hBFP, "bfp_compatible"); if(lp->bfp_compatible == NULL) result = LIB_NOINFO; else if(lp->bfp_compatible(lp, BFPVERSION, MAJORVERSION, sizeof(REAL))) { lp->bfp_name = (BFPchar *) dlsym(lp->hBFP, "bfp_name"); lp->bfp_free = (BFP_lp *) dlsym(lp->hBFP, "bfp_free"); lp->bfp_resize = (BFPbool_lpint *) dlsym(lp->hBFP, "bfp_resize"); lp->bfp_nonzeros = (BFPint_lpbool *) dlsym(lp->hBFP, "bfp_nonzeros"); lp->bfp_memallocated = (BFPint_lp *) dlsym(lp->hBFP, "bfp_memallocated"); lp->bfp_restart = (BFPbool_lp *) dlsym(lp->hBFP, "bfp_restart"); lp->bfp_mustrefactorize = (BFPbool_lp *) dlsym(lp->hBFP, "bfp_mustrefactorize"); lp->bfp_preparefactorization = (BFPint_lp *) dlsym(lp->hBFP, "bfp_preparefactorization"); lp->bfp_factorize = (BFPint_lpintintboolbool *) dlsym(lp->hBFP, "bfp_factorize"); lp->bfp_finishupdate = (BFPbool_lpbool *) dlsym(lp->hBFP, "bfp_finishupdate"); lp->bfp_ftran_normal = (BFP_lprealint *) dlsym(lp->hBFP, "bfp_ftran_normal"); lp->bfp_ftran_prepare = (BFP_lprealint *) dlsym(lp->hBFP, "bfp_ftran_prepare"); lp->bfp_btran_normal = (BFP_lprealint *) dlsym(lp->hBFP, "bfp_btran_normal"); lp->bfp_status = (BFPint_lp *) dlsym(lp->hBFP, "bfp_status"); lp->bfp_implicitslack = (BFPbool_lp *) dlsym(lp->hBFP, "bfp_implicitslack"); lp->bfp_indexbase = (BFPint_lp *) dlsym(lp->hBFP, "bfp_indexbase"); lp->bfp_rowoffset = (BFPint_lp *) dlsym(lp->hBFP, "bfp_rowoffset"); lp->bfp_pivotmax = (BFPint_lp *) dlsym(lp->hBFP, "bfp_pivotmax"); lp->bfp_init = (BFPbool_lpintintchar *) dlsym(lp->hBFP, "bfp_init"); lp->bfp_pivotalloc = (BFPbool_lpint *) dlsym(lp->hBFP, "bfp_pivotalloc"); lp->bfp_colcount = (BFPint_lp *) dlsym(lp->hBFP, "bfp_colcount"); lp->bfp_canresetbasis = (BFPbool_lp *) dlsym(lp->hBFP, "bfp_canresetbasis"); lp->bfp_finishfactorization = (BFP_lp *) dlsym(lp->hBFP, "bfp_finishfactorization"); lp->bfp_updaterefactstats = (BFP_lp *) dlsym(lp->hBFP, "bfp_updaterefactstats"); lp->bfp_prepareupdate = (BFPlreal_lpintintreal *) dlsym(lp->hBFP, "bfp_prepareupdate"); lp->bfp_pivotRHS = (BFPreal_lplrealreal *) dlsym(lp->hBFP, "bfp_pivotRHS"); lp->bfp_btran_double = (BFP_lprealintrealint *) dlsym(lp->hBFP, "bfp_btran_double"); lp->bfp_efficiency = (BFPreal_lp *) dlsym(lp->hBFP, "bfp_efficiency"); lp->bfp_pivotvector = (BFPrealp_lp *) dlsym(lp->hBFP, "bfp_pivotvector"); lp->bfp_pivotcount = (BFPint_lp *) dlsym(lp->hBFP, "bfp_pivotcount"); lp->bfp_refactcount = (BFPint_lpint *) dlsym(lp->hBFP, "bfp_refactcount"); lp->bfp_isSetI = (BFPbool_lp *) dlsym(lp->hBFP, "bfp_isSetI"); lp->bfp_findredundant = (BFPint_lpintrealcbintint *) dlsym(lp->hBFP, "bfp_findredundant"); } else result = LIB_VERINVALID; } #endif else result = LIB_NOTFOUND; #endif /* Do validation */ if((result != LIB_LOADED) || ((lp->bfp_name == NULL) || (lp->bfp_compatible == NULL) || (lp->bfp_free == NULL) || (lp->bfp_resize == NULL) || (lp->bfp_nonzeros == NULL) || (lp->bfp_memallocated == NULL) || (lp->bfp_restart == NULL) || (lp->bfp_mustrefactorize == NULL) || (lp->bfp_preparefactorization == NULL) || (lp->bfp_factorize == NULL) || (lp->bfp_finishupdate == NULL) || (lp->bfp_ftran_normal == NULL) || (lp->bfp_ftran_prepare == NULL) || (lp->bfp_btran_normal == NULL) || (lp->bfp_status == NULL) || (lp->bfp_implicitslack == NULL) || (lp->bfp_indexbase == NULL) || (lp->bfp_rowoffset == NULL) || (lp->bfp_pivotmax == NULL) || (lp->bfp_init == NULL) || (lp->bfp_pivotalloc == NULL) || (lp->bfp_colcount == NULL) || (lp->bfp_canresetbasis == NULL) || (lp->bfp_finishfactorization == NULL) || (lp->bfp_updaterefactstats == NULL) || (lp->bfp_prepareupdate == NULL) || (lp->bfp_pivotRHS == NULL) || (lp->bfp_btran_double == NULL) || (lp->bfp_efficiency == NULL) || (lp->bfp_pivotvector == NULL) || (lp->bfp_pivotcount == NULL) || (lp->bfp_refactcount == NULL) || (lp->bfp_isSetI == NULL) || (lp->bfp_findredundant == NULL) )) { set_BFP(lp, NULL); if(result == LIB_LOADED) result = LIB_NOFUNCTION; } } if(filename != NULL) { char info[LIB_STR_MAXLEN+1]; switch(result) { case LIB_NOTFOUND: strcpy(info, LIB_STR_NOTFOUND); break; case LIB_NOINFO: strcpy(info, LIB_STR_NOINFO); break; case LIB_NOFUNCTION: strcpy(info, LIB_STR_NOFUNCTION); break; case LIB_VERINVALID: strcpy(info, LIB_STR_VERINVALID); break; default: strcpy(info, LIB_STR_LOADED); } report(lp, IMPORTANT, "set_BFP: %s '%s'\n", info, filename); } return( (MYBOOL) (result == LIB_LOADED)); } /* External language interface routines */ /* DON'T MODIFY */ lprec * __WINAPI read_XLI(char *xliname, char *modelname, char *dataname, char *options, int verbose) { lprec *lp; lp = make_lp(0, 0); if(lp != NULL) { lp->source_is_file = TRUE; lp->verbose = verbose; if(!set_XLI(lp, xliname)) { free_lp(&lp); printf("read_XLI: No valid XLI package selected or available.\n"); } else { if(!lp->xli_readmodel(lp, modelname, (dataname != NULL) && (*dataname != 0) ? dataname : NULL, options, verbose)) free_lp(&lp); } } return( lp ); } MYBOOL __WINAPI write_XLI(lprec *lp, char *filename, char *options, MYBOOL results) { return( has_XLI(lp) && mat_validate(lp->matA) && lp->xli_writemodel(lp, filename, options, results) ); } MYBOOL __WINAPI has_XLI(lprec *lp) { return( is_nativeXLI(lp) #if LoadLanguageLib == TRUE || (MYBOOL) (lp->hXLI != NULL) #endif ); } MYBOOL __WINAPI is_nativeXLI(lprec *lp) { #ifdef ExcludeNativeLanguage return( FALSE ); #elif LoadLanguageLib == TRUE return( (MYBOOL) (lp->hXLI == NULL) ); #else return( TRUE ); #endif } MYBOOL __WINAPI set_XLI(lprec *lp, char *filename) /* (Re)mapping of external language interface variant methods is done here */ { int result = LIB_LOADED; #if LoadLanguageLib == TRUE if(lp->hXLI != NULL) { #ifdef WIN32 FreeLibrary(lp->hXLI); #else dlclose(lp->hXLI); #endif lp->hXLI = NULL; } #endif if(filename == NULL) { if(!is_nativeXLI(lp)) return( FALSE ); #ifndef ExcludeNativeLanguage lp->xli_name = xli_name; lp->xli_compatible = xli_compatible; lp->xli_readmodel = xli_readmodel; lp->xli_writemodel = xli_writemodel; #endif } else { #if LoadLanguageLib == TRUE #ifdef WIN32 /* Get a handle to the Windows DLL module. */ lp->hXLI = LoadLibrary(filename); /* If the handle is valid, try to get the function addresses. */ if(lp->hXLI != NULL) { lp->xli_compatible = (XLIbool_lpintintint *) GetProcAddress(lp->hXLI, "xli_compatible"); if(lp->xli_compatible == NULL) result = LIB_NOINFO; else if(lp->xli_compatible(lp, XLIVERSION, MAJORVERSION, sizeof(REAL))) { lp->xli_name = (XLIchar *) GetProcAddress(lp->hXLI, "xli_name"); lp->xli_readmodel = (XLIbool_lpcharcharcharint *) GetProcAddress(lp->hXLI, "xli_readmodel"); lp->xli_writemodel = (XLIbool_lpcharcharbool *) GetProcAddress(lp->hXLI, "xli_writemodel"); } else result = LIB_VERINVALID; } #else /* First standardize UNIX .SO library name format. */ char xliname[260], *ptr; strcpy(xliname, filename); if((ptr = strrchr(filename, '/')) == NULL) ptr = filename; else ptr++; xliname[(int) (ptr - filename)] = 0; if(strncmp(ptr, "lib", 3)) strcat(xliname, "lib"); strcat(xliname, ptr); if(strcmp(xliname + strlen(xliname) - 3, ".so")) strcat(xliname, ".so"); /* Get a handle to the module. */ lp->hXLI = dlopen(xliname, RTLD_LAZY); /* If the handle is valid, try to get the function addresses. */ if(lp->hXLI != NULL) { lp->xli_compatible = (XLIbool_lpintintint *) dlsym(lp->hXLI, "xli_compatible"); if(lp->xli_compatible == NULL) result = LIB_NOINFO; else if(lp->xli_compatible(lp, XLIVERSION, MAJORVERSION, sizeof(REAL))) { lp->xli_name = (XLIchar *) dlsym(lp->hXLI, "xli_name"); lp->xli_readmodel = (XLIbool_lpcharcharcharint *) dlsym(lp->hXLI, "xli_readmodel"); lp->xli_writemodel = (XLIbool_lpcharcharbool *) dlsym(lp->hXLI, "xli_writemodel"); } else result = LIB_VERINVALID; } #endif else result = LIB_NOTFOUND; #endif /* Do validation */ if((result != LIB_LOADED) || ((lp->xli_name == NULL) || (lp->xli_compatible == NULL) || (lp->xli_readmodel == NULL) || (lp->xli_writemodel == NULL) )) { set_XLI(lp, NULL); if(result == LIB_LOADED) result = LIB_NOFUNCTION; } } if(filename != NULL) { char info[LIB_STR_MAXLEN+1]; switch(result) { case LIB_NOTFOUND: strcpy(info, LIB_STR_NOTFOUND); break; case LIB_NOINFO: strcpy(info, LIB_STR_NOINFO); break; case LIB_NOFUNCTION: strcpy(info, LIB_STR_NOFUNCTION); break; case LIB_VERINVALID: strcpy(info, LIB_STR_VERINVALID); break; default: strcpy(info, LIB_STR_LOADED); } report(lp, IMPORTANT, "set_XLI: %s '%s'\n", info, filename); } return( (MYBOOL) (result == LIB_LOADED)); } STATIC int get_basisOF(lprec *lp, int coltarget[], REAL crow[], int colno[]) /* Fill vector of basic OF values or subtract incoming values from these. This function is called twice during reduced cost updates when the basis does not contain the basic OF vector as the top row. The colno[] array is filled with the count of non-zero values and the index to those. */ { int i, n = lp->rows, nz = 0; REAL *obj = lp->obj; register REAL epsvalue = lp->epsvalue; /* Compute offset over the specified objective indeces (step 2) */ if(coltarget != NULL) { register int ix, m = coltarget[0]; register REAL value; for(i = 1, coltarget++; i <= m; i++, coltarget++) { ix = *coltarget; /* Finalize the computation of the reduced costs, based on the format that duals are computed as negatives, ref description for step 1 above */ value = crow[ix]; if(ix > n) value += obj[ix - n]; /* if(value != 0) { */ if(fabs(value) > epsvalue) { nz++; if(colno != NULL) colno[nz] = ix; } else value = 0.0; crow[ix] = value; } } /* Get the basic objective function values (step 1) */ else { register int *basvar = lp->var_basic; for(i = 1, crow++, basvar++; i <= n; i++, crow++, basvar++) { /* Load the objective value of the active basic variable; note that we change the sign of the value to maintain computational compatibility with the calculation of duals using in-basis storage of the basic OF values */ if(*basvar <= n) *crow = 0; else *crow = -obj[(*basvar) - n]; if((*crow) != 0) { /* if(fabs(*crow) > epsvalue) { */ nz++; if(colno != NULL) colno[nz] = i; } } } if(colno != NULL) colno[0] = nz; return( nz ); } int __WINAPI get_basiscolumn(lprec *lp, int j, int rn[], double bj[]) /* This routine returns sparse vectors for all basis columns, including the OF dummy (index 0) and slack columns. NOTE that the index usage is nonstandard for lp_solve, since the array offset is 1, not 0. */ { int k = lp->bfp_rowoffset(lp), matbase = lp->bfp_indexbase(lp); /* Do target index adjustment (etaPFI with matbase==0 is special case) */ if(matbase > 0) matbase += k - 1; /* Convert index of slack and user columns */ j -= k; if((j > 0) && !lp->bfp_isSetI(lp)) j = lp->var_basic[j]; /* Process OF dummy and slack columns (always at lower bound) */ if(j <= lp->rows) { rn[1] = j + matbase; bj[1] = 1.0; k = 1; } /* Process user columns (negated if at lower bound) */ else { k = obtain_column(lp, j, bj, rn, NULL); if(matbase != 0) for(j = 1; j <= k; j++) rn[j] += matbase; } return( k ); } MYBOOL __WINAPI get_primal_solution(lprec *lp, REAL *pv) { if(lp->spx_status == OPTIMAL) ; else if(!lp->basis_valid) { report(lp, CRITICAL, "get_primal_solution: Not a valid basis"); return(FALSE); } MEMCOPY(pv, lp->best_solution, lp->sum + 1); return(TRUE); } MYBOOL __WINAPI get_ptr_primal_solution(lprec *lp, REAL **pv) { *pv = lp->best_solution; return(TRUE); } MYBOOL __WINAPI get_dual_solution(lprec *lp, REAL *rc) { REAL *duals; MYBOOL ret; if(!lp->basis_valid) { report(lp, CRITICAL, "get_dual_solution: Not a valid basis"); return(FALSE); } ret = get_ptr_sensitivity_rhs(lp, &duals, NULL, NULL); if(ret) MEMCOPY(rc, duals - 1, lp->sum + 1); return(ret); } MYBOOL __WINAPI get_ptr_dual_solution(lprec *lp, REAL **rc) { MYBOOL ret = lp->basis_valid; /* Just return availability of dual information if rc is NULL */ if(rc == NULL) return( ret && ((MIP_count(lp) == 0) || (lp->bb_totalnodes > 0)) ); if(!ret) { report(lp, CRITICAL, "get_ptr_dual_solution: Not a valid basis"); return(ret); } /* Otherwise, get the pointer to the dual information (and optionally produce it) */ ret = get_ptr_sensitivity_rhs(lp, rc, NULL, NULL); if(ret) (*rc)--; return(ret); } MYBOOL __WINAPI get_lambda(lprec *lp, REAL *lambda) { if(!lp->basis_valid || (get_Lrows(lp) == 0)) { report(lp, CRITICAL, "get_lambda: Not a valid basis"); return(FALSE); } MEMCOPY(lambda, lp->lambda+1, get_Lrows(lp)); return(TRUE); } MYBOOL __WINAPI get_ptr_lambda(lprec *lp, REAL **lambda) { *lambda = lp->lambda; return(TRUE); } int __WINAPI get_orig_index(lprec *lp, int lp_index) { if(lp->varmap_locked) return(lp->presolve_undo->var_to_orig[lp_index]); else if(lp_index <= lp->presolve_undo->orig_rows) return(lp_index); else return(lp_index-lp->presolve_undo->orig_rows); } int __WINAPI get_lp_index(lprec *lp, int orig_index) { if(lp->varmap_locked) return(lp->presolve_undo->orig_to_var[orig_index]); else if(orig_index <= lp->presolve_undo->orig_rows) return(orig_index); else return(orig_index-lp->presolve_undo->orig_rows); } MYBOOL __WINAPI is_feasible(lprec *lp, REAL *values, REAL threshold) /* Recommend to use threshold = lp->epspivot */ { int i, j, elmnr, ie; REAL *this_rhs, dist; REAL *value; int *rownr; MATrec *mat = lp->matA; for(i = lp->rows + 1; i <= lp->sum; i++) { if(values[i - lp->rows] < unscaled_value(lp, lp->orig_lowbo[i], i) || values[i - lp->rows] > unscaled_value(lp, lp->orig_upbo[i], i)) { if(!((lp->sc_lobound[i - lp->rows]>0) && (values[i - lp->rows]==0))) return(FALSE); } } this_rhs = (REAL *) mempool_obtainVector(lp->workarrays, lp->rows+1, sizeof(*this_rhs)); /* allocREAL(lp, &this_rhs, lp->rows + 1, TRUE); */ for(j = 1; j <= lp->columns; j++) { elmnr = mat->col_end[j - 1]; ie = mat->col_end[j]; rownr = &COL_MAT_ROWNR(elmnr); value = &COL_MAT_VALUE(elmnr); for(; elmnr < ie; elmnr++, rownr += matRowColStep, value += matValueStep) { this_rhs[*rownr] += unscaled_mat(lp, *value, *rownr, j); } } for(i = 1; i <= lp->rows; i++) { dist = lp->orig_rhs[i] - this_rhs[i]; my_roundzero(dist, threshold); if((lp->orig_upbo[i] == 0 && dist != 0) ||( dist < 0)) { FREE(this_rhs); return(FALSE); } } mempool_releaseVector(lp->workarrays, (char *) this_rhs, FALSE); /* FREE(this_rhs); */ return(TRUE); } int __WINAPI column_in_lp(lprec *lp, REAL *testcolumn) { int i, j, je, colnr = 0; int nz, ident = 1; MATrec *mat = lp->matA; int *matRownr; REAL value, *matValue; for(nz = 0, i = 1; i <= lp->rows; i++) if(fabs(testcolumn[i]) > lp->epsvalue) nz++; for(i = 1; (i <= lp->columns) && (ident); i++) { ident = nz; value = fabs(get_mat(lp, 0, i)-testcolumn[0]); if(value > lp->epsvalue) continue; j = mat->col_end[i - 1]; je = mat->col_end[i]; matRownr = &COL_MAT_ROWNR(j); matValue = &COL_MAT_VALUE(j); for(; (j < je) && (ident >= 0); j++, ident--, matRownr += matRowColStep, matValue += matValueStep) { value = *matValue; if(is_chsign(lp, *matRownr)) value = my_flipsign(value); value = unscaled_mat(lp, value, *matRownr, i); value -= testcolumn[*matRownr]; if(fabs(value) > lp->epsvalue) break; } if(ident == 0) colnr = i; } return( colnr ); } MYBOOL __WINAPI set_lp_name(lprec *lp, char *name) { if (name == NULL) { FREE(lp->lp_name); lp->lp_name = NULL; } else { allocCHAR(lp, &lp->lp_name, (int) (strlen(name) + 1), AUTOMATIC); strcpy(lp->lp_name, name); } return(TRUE); } char * __WINAPI get_lp_name(lprec *lp) { return((lp->lp_name != NULL) ? lp->lp_name : (char *) ""); } STATIC MYBOOL init_rowcol_names(lprec *lp) { if(!lp->names_used) { lp->row_name = (hashelem **) calloc(lp->rows_alloc + 1, sizeof(*lp->row_name)); lp->col_name = (hashelem **) calloc(lp->columns_alloc + 1, sizeof(*lp->col_name)); lp->rowname_hashtab = create_hash_table(lp->rows_alloc + 1, 0); lp->colname_hashtab = create_hash_table(lp->columns_alloc + 1, 1); lp->names_used = TRUE; } return(TRUE); } MYBOOL rename_var(lprec *lp, int varindex, char *new_name, hashelem **list, hashtable **ht) { hashelem *hp; MYBOOL newitem; hp = list[varindex]; newitem = (MYBOOL) (hp == NULL); if(newitem) hp = puthash(new_name, varindex, list, *ht); else if((strlen(hp->name) != strlen(new_name)) || (strcmp(hp->name, new_name) != 0)) { hashtable *newht, *oldht; allocCHAR(lp, &hp->name, (int) (strlen(new_name) + 1), AUTOMATIC); strcpy(hp->name, new_name); oldht = *ht; newht = copy_hash_table(oldht, list, oldht->size); *ht = newht; free_hash_table(oldht); } return(newitem); } MYBOOL __WINAPI is_use_names(lprec *lp, MYBOOL isrow) { if(isrow) return( lp->use_row_names ); else return( lp->use_col_names ); } void __WINAPI set_use_names(lprec *lp, MYBOOL isrow, MYBOOL use_names) { if(isrow) lp->use_row_names = use_names; else lp->use_col_names = use_names; } int __WINAPI get_nameindex(lprec *lp, char *varname, MYBOOL isrow) { if(isrow) return( find_row(lp, varname, FALSE) ); else return( find_var(lp, varname, FALSE) ); } MYBOOL __WINAPI set_row_name(lprec *lp, int rownr, char *new_name) { if((rownr < 0) || (rownr > lp->rows+1)) { report(lp, IMPORTANT, "set_row_name: Row %d out of range", rownr); return(FALSE); } /* Prepare for a new row */ if((rownr > lp->rows) && !append_rows(lp, rownr-lp->rows)) return( FALSE ); if(!lp->names_used) { if(!init_rowcol_names(lp)) return(FALSE); } rename_var(lp, rownr, new_name, lp->row_name, &lp->rowname_hashtab); return(TRUE); } char * __WINAPI get_row_name(lprec *lp, int rownr) { if((rownr < 0) || (rownr > lp->rows+1)) { report(lp, IMPORTANT, "get_row_name: Row %d out of range", rownr); return(NULL); } if((lp->presolve_undo->var_to_orig != NULL) && lp->wasPresolved) { if(lp->presolve_undo->var_to_orig[rownr] == 0) rownr = -rownr; else rownr = lp->presolve_undo->var_to_orig[rownr]; } return( get_origrow_name(lp, rownr) ); } char * __WINAPI get_origrow_name(lprec *lp, int rownr) { MYBOOL newrow; char *ptr; newrow = (MYBOOL) (rownr < 0); rownr = abs(rownr); #ifdef Paranoia if(((lp->presolve_undo->var_to_orig == NULL) && newrow) || (rownr > MAX(lp->rows, lp->presolve_undo->orig_rows))) { report(lp, IMPORTANT, "get_origrow_name: Row %d out of range", rownr); return(NULL); } #endif if(lp->names_used && lp->use_row_names && (lp->row_name[rownr] != NULL) && (lp->row_name[rownr]->name != NULL)) { #ifdef Paranoia if(lp->row_name[rownr]->index != rownr) report(lp, SEVERE, "get_origrow_name: Inconsistent row ordinal %d vs %d\n", rownr, lp->row_name[rownr]->index); #endif ptr = lp->row_name[rownr]->name; } else { if(lp->rowcol_name == NULL) if (!allocCHAR(lp, &lp->rowcol_name, 20, FALSE)) return(NULL); ptr = lp->rowcol_name; if(newrow) sprintf(ptr, ROWNAMEMASK2, rownr); else sprintf(ptr, ROWNAMEMASK, rownr); } return(ptr); } MYBOOL __WINAPI set_col_name(lprec *lp, int colnr, char *new_name) { if((colnr > lp->columns+1) || (colnr < 1)) { report(lp, IMPORTANT, "set_col_name: Column %d out of range", colnr); } if((colnr > lp->columns) && !append_columns(lp, colnr-lp->columns)) return(FALSE); if(!lp->names_used) init_rowcol_names(lp); rename_var(lp, colnr, new_name, lp->col_name, &lp->colname_hashtab); return(TRUE); } char * __WINAPI get_col_name(lprec *lp, int colnr) { if((colnr > lp->columns+1) || (colnr < 1)) { report(lp, IMPORTANT, "get_col_name: Column %d out of range", colnr); return(NULL); } if((lp->presolve_undo->var_to_orig != NULL) && lp->wasPresolved) { if(lp->presolve_undo->var_to_orig[lp->rows + colnr] == 0) colnr = -colnr; else colnr = lp->presolve_undo->var_to_orig[lp->rows + colnr]; } return( get_origcol_name(lp, colnr) ); } char * __WINAPI get_origcol_name(lprec *lp, int colnr) { MYBOOL newcol; char *ptr; newcol = (MYBOOL) (colnr < 0); colnr = abs(colnr); #ifdef Paranoia if(((lp->presolve_undo->var_to_orig == NULL) && newcol) || (colnr > MAX(lp->columns, lp->presolve_undo->orig_columns))) { report(lp, IMPORTANT, "get_origcol_name: Column %d out of range", colnr); return(NULL); } #endif if(lp->names_used && lp->use_col_names && (lp->col_name[colnr] != NULL) && (lp->col_name[colnr]->name != NULL)) { #ifdef Paranoia if(lp->col_name[colnr]->index != colnr) report(lp, SEVERE, "get_origcol_name: Inconsistent column ordinal %d vs %d\n", colnr, lp->col_name[colnr]->index); #endif ptr = lp->col_name[colnr]->name; } else { if(lp->rowcol_name == NULL) if (!allocCHAR(lp, &lp->rowcol_name, 20, FALSE)) return(NULL); ptr = lp->rowcol_name; if(newcol) sprintf(ptr, COLNAMEMASK2, colnr); else sprintf(ptr, COLNAMEMASK, colnr); } return(ptr); } STATIC int MIP_count(lprec *lp) { return( lp->int_vars+lp->sc_vars+SOS_count(lp) ); } STATIC int bin_count(lprec *lp, MYBOOL working) { int i, n = 0; if(working) { for(i = lp->rows+1; i <= lp->sum; i++) if(fabs(unscaled_value(lp, lp->upbo[i], i) - 1) < lp->epsvalue) n++; } else { for(i = 1; i <= lp->columns; i++) if((fabs(get_upbo(lp, i) - 1) < lp->epsvalue) && (fabs(get_lowbo(lp, i) - 0) < lp->epsvalue)) n++; } return( n ); } STATIC int SOS_count(lprec *lp) { if(lp->SOS == NULL) return( 0 ); else return( lp->SOS->sos_count ); } STATIC int GUB_count(lprec *lp) { if(lp->GUB == NULL) return( 0 ); else return( lp->GUB->sos_count ); } STATIC REAL compute_violation(lprec *lp, int row_nr) /* Returns the bound violation of a given basic variable; the return value is negative if it is below is lower bound, it is positive if it is greater than the upper bound, and zero otherwise. */ { REAL value, test; value = lp->rhs[row_nr]; row_nr = lp->var_basic[row_nr]; test = value - my_lowbound(lp->lowbo[row_nr]); my_roundzero(test, lp->epsprimal); if(test > 0) { test = value - lp->upbo[row_nr]; my_roundzero(test, lp->epsprimal); if(test < 0) test = 0; } return( test ); } STATIC REAL feasibilityOffset(lprec *lp, MYBOOL isdual) { int i, j; REAL f, Extra; Extra = 0; if(isdual) { /* This section computes a OF offset to ensure that the dual phase 1 is feasible. It is used to compute a primal feasible base that can be passed to the primal simplex in phase 2. */ #if 0 /* This is the legacy (v3.2-) P1extraVal logic that sets Extra to be the smallest negative reduced cost. Note that the reduced costs are the values of the dual slacks, which are [0..Inf> for feasibility. If we have negative reduced costs for bounded non-basic variables, we can simply switch the bound to obtain feasibility and possibly avoid having to set Extra. */ if(!isDualFeasible(lp, lp->epsprimal, NULL, NULL, &f) Extra = f; #else /* Find the most negative of the objective coefficients. We will subtract this value from every element of the objective row, making it non-negative and the problem therefore dual feasible. */ for(i = 1; i <= lp->columns; i++) { f = lp->orig_obj[i]; if(f < Extra) Extra = f; } #endif } else { /* Set Extra to be the index of the most negative of the net RHS coefficients; this approach can be used in the primal phase 1 followed by the dual phase 2 and when there are no ranged constraints. When there are ranged constraints, additional artificial variables must be introduced. */ Extra = 0; j = 0; Extra = lp->infinite; for(i = 1; i <= lp->rows; i++) { f = lp->rhs[i]; if(f < Extra) { Extra = f; j = i; } } Extra = j; } return(Extra); } STATIC REAL compute_dualslacks(lprec *lp, int target, REAL **dvalues, int **nzdvalues, MYBOOL dosum) /* Note that this function is similar to the compute_reducedcosts function in lp_price.c */ { int i, varnr, *coltarget, **nzduals, *nzvtemp = NULL; REAL d, g = 0, **duals, *vtemp = NULL; MYBOOL localREAL = (MYBOOL) (dvalues == NULL), localINT = (MYBOOL) (nzdvalues == NULL); if(is_action(lp->spx_action, ACTION_REBASE) || is_action(lp->spx_action, ACTION_REINVERT) || !lp->basis_valid) return( g ); /* Initialize */ if(!localREAL) { duals = dvalues; nzduals = nzdvalues; } else { duals = &vtemp; nzduals = &nzvtemp; } if(localINT || (*nzduals == NULL)) allocINT(lp, nzduals, lp->columns + 1, AUTOMATIC); if(localREAL || (*duals == NULL)) allocREAL(lp, duals, lp->sum + 1, AUTOMATIC); if(target == 0) target = SCAN_ALLVARS+ USE_NONBASICVARS; /* Define variable target list and compute the reduced costs */ coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->columns+1, sizeof(*coltarget)); if(!get_colIndexA(lp, target, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } bsolve(lp, 0, *duals, NULL, lp->epsmachine*DOUBLEROUND, 1.0); prod_xA(lp, coltarget, *duals, NULL, lp->epsmachine, 1.0, *duals, *nzduals, MAT_ROUNDDEFAULT | MAT_ROUNDRC); mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); /* Compute sum or maximum infeasibility as specified */ for(i = 1; i <= (*nzduals)[0]; i++) { varnr = (*nzduals)[i]; d = my_chsign(!lp->is_lower[varnr], (*duals)[varnr]); if(d < 0) { if(dosum) g += -d; /* Compute sum as a positive number */ else { SETMIN(g, d); /* Compute gap as a negative number */ } } } /* Clean up */ if(localREAL) FREE(*duals); if(localINT) FREE(*nzduals); return( g ); } STATIC REAL compute_feasibilitygap(lprec *lp, MYBOOL isdual, MYBOOL dosum) { REAL f = 0; /* This computes the primal feasibility gap (for use with the dual simplex phase 1) */ if(isdual) { int i; REAL g; for(i = 1; i <= lp->rows; i++) { if(lp->rhs[i] < 0) g = lp->rhs[i]; else if(lp->rhs[i] > lp->upbo[lp->var_basic[i]]) g = lp->rhs[i] - lp->upbo[lp->var_basic[i]]; else g = 0; if(dosum) f += g; else { SETMAX(f, g); } } } /* This computes the dual feasibility gap (for use with the primal simplex phase 1) */ else f = compute_dualslacks(lp, SCAN_USERVARS+USE_ALLVARS, NULL, NULL, dosum); return( f ); } /* Find the smallest fractional value in a given row of the OF/constraint matrix */ STATIC int row_decimals(lprec *lp, int rownr, MYBOOL intsonly, REAL *intscalar) { int basi, i, j, ncols = lp->columns; REAL f, /* g, */ epsvalue = lp->epsprimal; basi = 0; for(j = 1; j <= ncols; j++) { if(intsonly && !is_int(lp, j)) { if(intsonly == TRUE) break; else continue; } f = fabs(get_mat(lp, rownr, j)); /* f = fmod(f, 1); */ f -= floor (f + epsvalue); /* if(f <= epsvalue) continue; g = f; */ for(i = 0; (i <= MAX_FRACSCALE) && (/* g */ f > epsvalue); i++) { f *= 10; /* g = fmod(f, 1); */ f -= floor (f + epsvalue); } if(i > MAX_FRACSCALE) /* i = MAX_FRACSCALE */ break; SETMAX(basi, i); } if(j > ncols) *intscalar = pow(10.0, basi); else { basi = -1; *intscalar = 1; } return( basi ); } STATIC int row_intstats(lprec *lp, int rownr, int pivcolnr, int *maxndec, int *plucount, int *intcount, int *intval, REAL *valGCD, REAL *pivcolval) { int jb, je, jj, nn = 0, multA, multB, intGCD = 0; REAL rowval, inthold, intfrac; MATrec *mat = lp->matA; /* Do we have a valid matrix? */ if(mat_validate(mat)) { /* Get smallest fractional row value */ *maxndec = row_decimals(lp, rownr, AUTOMATIC, &intfrac); /* Get OF row starting and ending positions, as well as the first column index */ if(rownr == 0) { jb = 1; je = lp->columns+1; } else { jb = mat->row_end[rownr-1]; je = mat->row_end[rownr]; } nn = je - jb; *pivcolval = 1.0; *plucount = 0; *intcount = 0; *intval = 0; for(; jb < je; jb++) { if(rownr == 0) { if(lp->orig_obj[jb] == 0) { nn--; continue; } jj = jb; } else jj = ROW_MAT_COLNR(jb); /* Pick up the value of the pivot column and continue */ if(jj == pivcolnr) { if(rownr == 0) *pivcolval = unscaled_mat(lp, lp->orig_obj[jb], 0, jb); else *pivcolval = get_mat_byindex(lp, jb, TRUE, FALSE); continue; } if(!is_int(lp, jj)) continue; /* Update the count of integer columns */ (*intcount)++; /* Update the count of positive parameter values */ if(rownr == 0) rowval = unscaled_mat(lp, lp->orig_obj[jb], 0, jb); else rowval = get_mat_byindex(lp, jb, TRUE, FALSE); if(rowval > 0) (*plucount)++; /* Check if the parameter value is integer and update the row's GCD */ rowval = fabs(rowval) * intfrac; rowval += rowval*lp->epsmachine; rowval = modf(rowval, &inthold); if(rowval < lp->epsprimal) { (*intval)++; if(*intval == 1) intGCD = (int) inthold; else intGCD = gcd(intGCD, (LLONG) inthold, &multA, &multB); } } *valGCD = intGCD; *valGCD /= intfrac; } return(nn); } REAL MIP_stepOF(lprec *lp) /* This function tries to find a non-zero minimum improvement if the OF contains all integer variables (logic only applies if we are looking for a single solution, not possibly several equal-valued ones). */ { MYBOOL OFgcd; int colnr, rownr, n, ib, ie, maxndec, pluscount, intcount, intval; REAL value, valOF, divOF, valGCD; MATrec *mat = lp->matA; value = 0; if((lp->int_vars > 0) && (lp->solutionlimit == 1) && mat_validate(mat)) { /* Get statistics for integer OF variables and compute base stepsize */ n = row_intstats(lp, 0, -1, &maxndec, &pluscount, &intcount, &intval, &valGCD, &divOF); if((n == 0) || (maxndec < 0)) return( value ); OFgcd = (MYBOOL) (intval > 0); if(OFgcd) value = valGCD; /* Check non-ints in the OF to see if we can get more info */ if(n - intcount > 0) { int nrv = 0; /* See if we have equality constraints */ ie = lp->rows; for(ib = 1; ib <= ie; ib++) { if(is_constr_type(lp, ib, EQ)) break; } /* If so, there may be a chance to find an improved stepsize */ if(ib < ie) for(colnr = 1; colnr <= lp->columns; colnr++) { /* Go directly to the next variable if this is an integer or there is no row candidate to explore for hidden bounds for real-valued variables (limit scan to one row!) */ if(is_int(lp, colnr)) continue; nrv++; /* Scan equality constraints */ ib = mat->col_end[colnr-1]; ie = mat->col_end[colnr]; while(ib < ie) { if(is_constr_type(lp, (rownr = COL_MAT_ROWNR(ib)), EQ)) { /* Get "child" row statistics, but break out if we don't find enough information, i.e. no integers with coefficients of proper type */ n = row_intstats(lp, rownr, colnr, &maxndec, &pluscount, &intcount, &intval, &valGCD, &divOF); if((intval < n - 1) || (maxndec < 0)) { value = 0; break; } /* We can update */ valOF = unscaled_mat(lp, lp->orig_obj[colnr], 0, colnr); valOF = fabs( valOF * (valGCD / divOF) ); if(OFgcd) { SETMIN(value, valOF); } else { OFgcd = TRUE; value = valOF; } } ib++; } /* No point in continuing scan if we failed in current column */ if(value == 0) break; } /* Check if we found information for any real-valued variable; if not, then we must set the iprovement delta to 0 */ if(nrv == 0) value = 0; } } return( value ); } STATIC MYBOOL isPrimalSimplex(lprec *lp) { return((MYBOOL) (((lp->simplex_mode & SIMPLEX_Phase1_PRIMAL) != 0) || ((lp->simplex_mode & SIMPLEX_Phase2_PRIMAL) != 0))); } STATIC MYBOOL isPhase1(lprec *lp) { return((MYBOOL) (((lp->simplex_mode & SIMPLEX_Phase1_PRIMAL) != 0) || ((lp->simplex_mode & SIMPLEX_Phase1_DUAL) != 0))); } STATIC MYBOOL isP1extra(lprec *lp) { return((MYBOOL) ((lp->P1extraDim > 0) || (lp->P1extraVal != 0))); } STATIC MYBOOL feasiblePhase1(lprec *lp, REAL epsvalue) { REAL gap; MYBOOL test; gap = fabs(lp->rhs[0] - lp->orig_rhs[0]); test = (MYBOOL) (gap < epsvalue); return( test) ; } STATIC MYBOOL isDegenerateBasis(lprec *lp, int basisvar) { int varindex; varindex = lp->var_basic[basisvar]; if((fabs(lp->rhs[basisvar]) < lp->epsprimal) || (fabs(lp->upbo[varindex]-lp->rhs[basisvar]) < lp->epsprimal)) return( TRUE ); else return( FALSE ); } STATIC int findBasicFixedvar(lprec *lp, int afternr, MYBOOL slacksonly) { int varnr, delta = 1; if(afternr < 0) { delta = -1; afternr = -afternr; } afternr += delta; if((afternr < 1) || (afternr > lp->rows)) return( 0 ); for(; (afternr > 0) && (afternr <= lp->rows); afternr += delta) { varnr = lp->var_basic[afternr]; if(((varnr <= lp->rows) && is_constr_type(lp, varnr, EQ)) || (!slacksonly && (varnr > lp->rows) && is_fixedvar(lp, varnr))) break; } if(afternr > lp->rows) afternr = 0; return( afternr ); } STATIC MYBOOL isBasisVarFeasible(lprec *lp, REAL tol, int basis_row) { int col; REAL x; MYBOOL Ok = TRUE; MYBOOL doSC = FALSE; col = lp->var_basic[basis_row]; x = lp->rhs[basis_row]; /* The current solution of basic variables stored here! */ if((x < -tol) || (x > lp->upbo[col]+tol)) Ok = FALSE; else if(doSC && (col > lp->rows) && (fabs(lp->sc_lobound[col - lp->rows]) > 0)) { if((x > tol) && (x < fabs(lp->sc_lobound[col - lp->rows])-tol)) Ok = FALSE; } return( Ok ); } STATIC MYBOOL isPrimalFeasible(lprec *lp, REAL tol, int infeasibles[], REAL *feasibilitygap) { int i; MYBOOL feasible = TRUE; /* This is a short-hand call to rowdual() to check for primal infeasibility */ #if 0 /* Traditional indexing style */ for(i = 1; i <= lp->rows; i++) { feasible = isBasisVarFeasible(lp, tol, i); #else /* Fast array pointer style */ LREAL *rhsptr; int *idxptr; if(infeasibles != NULL) infeasibles[0] = 0; for(i = 1, rhsptr = lp->rhs+1, idxptr = lp->var_basic+1; (i <= lp->rows); i++, rhsptr++, idxptr++) { feasible = TRUE; /* if(((*rhsptr) < lp->lowbo[*idxptr]-tol) || ((*rhsptr) > lp->upbo[*idxptr]+tol)) */ if(((*rhsptr) < -tol) || ((*rhsptr) > lp->upbo[*idxptr]+tol)) feasible = FALSE; #endif if(!feasible) { if(infeasibles == NULL) break; infeasibles[0]++; infeasibles[infeasibles[0]] = i; } } /* Compute feasibility gap (could actually do this calculation above) */ if(feasibilitygap != NULL) { if(feasible) *feasibilitygap = 0.0; else *feasibilitygap = feasibilityOffset(lp, FALSE); } return(feasible); } STATIC MYBOOL isDualFeasible(lprec *lp, REAL tol, int *boundflipcount, int infeasibles[], REAL *feasibilitygap) { int i, varnr, n = 0, /* Number of infeasible duals corrected with bound-swaps */ m = 0, target = SCAN_ALLVARS+USE_NONBASICVARS; REAL f = 0; MYBOOL feasible, islower; /* The reduced costs are the values of the dual slacks, which are [0..Inf> for feasibility. If we have negative reduced costs for bounded non-basic variables, we can simply switch the bound of bounded variables to obtain dual feasibility and possibly avoid having to use dual simplex phase 1. */ if((infeasibles != NULL) || (boundflipcount != NULL)) { int *nzdcol = NULL; REAL d, *dcol = NULL; f = compute_dualslacks(lp, target, &dcol, &nzdcol, FALSE); if(nzdcol != NULL) for(i = 1; i <= nzdcol[0]; i++) { varnr = nzdcol[i]; islower = lp->is_lower[varnr]; d = my_chsign(!islower, dcol[varnr]); /* Don't bother with uninteresting non-basic variables */ if((d > -tol) || /* Positive reduced costs with a tolerance */ my_unbounded(lp, varnr) || /* Free variables cannot change bound */ is_fixedvar(lp, varnr)) /* Equality slack or a fixed variable ("type 3") */ continue; /* Check if we have non-flippable bounds, i.e. an unbounded variable (types 2+4), or bounded variables (type 3), and if the counter is NULL. */ if( (boundflipcount == NULL) || ((lp->bb_level <= 1) && (my_rangebo(lp, varnr) > fabs(lp->negrange))) || (islower && my_infinite(lp, lp->upbo[varnr])) || (!islower && my_infinite(lp, my_lowbo(lp, varnr))) ) { m++; if(infeasibles != NULL) infeasibles[m] = varnr; } /* Only do bound flips if the user-provided counter is non-NULL */ else { lp->is_lower[varnr] = !islower; n++; } } if(infeasibles != NULL) infeasibles[0] = m; FREE(dcol); FREE(nzdcol); if(n > 0) { set_action(&lp->spx_action, ACTION_RECOMPUTE); if(m == 0) f = 0; } } else f = compute_dualslacks(lp, target, NULL, NULL, FALSE); /* f = feasibilityOffset(lp, TRUE); */ /* Safe legacy mode */ /* Do an extra scan to see if there are bounded variables in the OF not present in any constraint; Most typically, presolve fixes such cases, so this is rarely encountered. */ varnr = lp->rows + 1; for(i = 1; i <= lp->columns; i++, varnr++) { islower = lp->is_lower[varnr]; if((my_chsign(islower, lp->orig_obj[i]) > 0) && (mat_collength(lp->matA, i) == 0) && !SOS_is_member(lp->SOS, 0, i)) { lp->is_lower[varnr] = !islower; if((islower && my_infinite(lp, lp->upbo[varnr])) || (!islower && my_infinite(lp, my_lowbo(lp, varnr)))) { lp->spx_status = UNBOUNDED; break; } n++; } } /* Return status */ if(boundflipcount != NULL) *boundflipcount = n; if(feasibilitygap != NULL) { my_roundzero(f, tol); *feasibilitygap = f; } feasible = (MYBOOL) ((f == 0) && (m == 0)); return(feasible); } void __WINAPI default_basis(lprec *lp) { int i; /* Set the slack variables to be basic; note that the is_basic[] array is a helper array filled in presolve() to match var_basic[]. */ for(i = 1; i <= lp->rows; i++) { lp->var_basic[i] = i; lp->is_basic[i] = TRUE; lp->is_lower[i] = TRUE; } lp->var_basic[0] = TRUE; /* Set to signal that this is the default basis */ /* Set user variables at their lower bound, including the dummy slack for the objective "constraint" */ for(; i <= lp->sum; i++) { lp->is_basic[i] = FALSE; lp->is_lower[i] = TRUE; } lp->is_lower[0] = TRUE; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); lp->basis_valid = TRUE; /* Do not re-initialize basis on entering Solve */ } int __WINAPI get_basiscrash(lprec *lp) { return(lp->crashmode); } void __WINAPI set_basiscrash(lprec *lp, int mode) { lp->crashmode = mode; } MYBOOL __WINAPI set_basis(lprec *lp, int *bascolumn, MYBOOL nonbasic) /* Added by KE */ { int i,s,k,n; /* Make sure we are consistent */ if(lp->wasPresolved && ((lp->rows != lp->presolve_undo->orig_rows) || (lp->columns != lp->presolve_undo->orig_columns))) return( FALSE ); /* Initialize (lp->is_basic is set in preprocess); Note that as of v5 and before it is an lp_solve convention that basic variables are at their lower bounds! This routine provides for the a possible future case that basic variables can be upper-bounded. */ lp->is_lower[0] = TRUE; for(i = 1; i <= lp->sum; i++) { lp->is_lower[i] = TRUE; lp->is_basic[i] = FALSE; } for(i = 1; i <= lp->rows; i++) lp->var_basic[i] = FALSE; /* Set basic and optionally non-basic variables; negative index means at lower bound, positive at upper bound */ if(nonbasic) n = lp->sum; else n = lp->rows; for(i = 1; i <= n; i++) { s = bascolumn[i]; k = abs(s); if(k <= 0 || k > lp->sum) return( FALSE ); if(i <= lp->rows) { lp->var_basic[i] = k; lp->is_basic[k] = TRUE; } else /* Remove this test if basic variables can be upper-bounded */ if(s > 0) lp->is_lower[k] = FALSE; } if(!verify_basis(lp)) return( FALSE ); /* Invalidate basis */ set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); lp->basis_valid = TRUE; /* Do not re-initialize basis on entering Solve */ lp->var_basic[0] = FALSE; /* Set to signal that this is a non-default basis */ return( TRUE ); } void __WINAPI reset_basis(lprec *lp) { lp->basis_valid = FALSE; /* Causes reinversion at next opportunity */ } MYBOOL __WINAPI get_basis(lprec *lp, int *bascolumn, MYBOOL nonbasic) { int k, i; if(!lp->basis_valid || (lp->rows != lp->presolve_undo->orig_rows) || (lp->columns != lp->presolve_undo->orig_columns)) return( FALSE ); *bascolumn = 0; /* First save basic variable indexes */ for(i = 1; i <= lp->rows; i++) { k = lp->var_basic[i]; bascolumn[i] = my_chsign(lp->is_lower[k], k); } /* Then optionally save non-basic variable indeces */ if(nonbasic) { for(k = 1; (k <= lp->sum) && (i <= lp->sum); k++) { if(lp->is_basic[k]) continue; bascolumn[i] = my_chsign(lp->is_lower[k], k); i++; } } return( TRUE ); } STATIC MYBOOL is_BasisReady(lprec *lp) { return( (MYBOOL) (lp->var_basic[0] != AUTOMATIC) ); } STATIC MYBOOL is_slackbasis(lprec *lp) { int n = 0, err = 0; if(lp->basis_valid) { int i, k; MYBOOL *used = NULL; allocMYBOOL(lp, &used, lp->rows+1, TRUE); for(i = 1; i <= lp->rows; i++) { k = lp->var_basic[i]; if(k <= lp->rows) { if(used[k]) err++; else used[k] = TRUE; n++; } } FREE(used); if(err > 0) report(lp, SEVERE, "is_slackbasis: %d inconsistencies found in slack basis\n", err); } return( (MYBOOL) (n == lp->rows) ); } STATIC MYBOOL verify_basis(lprec *lp) { int i, ii, k = 0; MYBOOL result = FALSE; for(i = 1; i <= lp->rows; i++) { ii = lp->var_basic[i]; if((ii < 1) || (ii > lp->sum) || !lp->is_basic[ii]) { k = i; ii = 0; goto Done; } } ii = lp->rows; for(i = 1; i <= lp->sum; i++) { if(lp->is_basic[i]) ii--; } result = (MYBOOL) (ii == 0); Done: #if 0 /* For testing */ if(!result) ii = 0; #endif return(result); } int __WINAPI set_basisvar(lprec *lp, int basisPos, int enteringCol) { int leavingCol; leavingCol = lp->var_basic[basisPos]; #ifdef Paranoia if((basisPos < 1) || (basisPos > lp->rows)) report(lp, SEVERE, "set_basisvar: Invalid leaving basis position %d specified at iter %.0f\n", basisPos, (double) get_total_iter(lp)); if((leavingCol < 1) || (leavingCol > lp->sum)) report(lp, SEVERE, "set_basisvar: Invalid leaving column %d referenced at iter %.0f\n", leavingCol, (double) get_total_iter(lp)); if((enteringCol < 1) || (enteringCol > lp->sum)) report(lp, SEVERE, "set_basisvar: Invalid entering column %d specified at iter %.0f\n", enteringCol, (double) get_total_iter(lp)); #endif #ifdef ParanoiaXY if(!lp->is_basic[leavingCol]) report(lp, IMPORTANT, "set_basisvar: Leaving variable %d is not basic at iter %.0f\n", leavingCol, (double) get_total_iter(lp)); if(enteringCol > lp->rows && lp->is_basic[enteringCol]) report(lp, IMPORTANT, "set_basisvar: Entering variable %d is already basic at iter %.0f\n", enteringCol, (double) get_total_iter(lp)); #endif lp->var_basic[0] = FALSE; /* Set to signal that this is a non-default basis */ lp->var_basic[basisPos] = enteringCol; lp->is_basic[leavingCol] = FALSE; lp->is_basic[enteringCol] = TRUE; if(lp->bb_basis != NULL) lp->bb_basis->pivots++; return(leavingCol); } /* Bounds updating and unloading routines; requires that the current values for upbo and lowbo are in the original base. */ STATIC int perturb_bounds(lprec *lp, BBrec *perturbed, MYBOOL doRows, MYBOOL doCols, MYBOOL includeFIXED) { int i, ii, n = 0; REAL new_lb, new_ub, *upbo, *lowbo; if(perturbed == NULL) return( n ); /* Map reference bounds to previous state, i.e. cumulate perturbations in case of persistent problems */ upbo = perturbed->upbo; lowbo = perturbed->lowbo; /* Set appropriate target variable range */ i = 1; ii = lp->rows; if(!doRows) i += ii; if(!doCols) ii = lp->sum; /* Perturb (expand) finite variable bounds randomly */ for(; i <= ii; i++) { /* Don't perturb regular slack variables */ if((i <= lp->rows) && (lowbo[i] == 0) && (upbo[i] >= lp->infinite)) continue; new_lb = lowbo[i]; new_ub = upbo[i]; /* Don't perturb fixed variables if not specified */ if(!includeFIXED && (new_ub == new_lb)) continue; /* Lower bound for variables (consider implementing RHS here w/contentmode== AUTOMATIC) */ if((i > lp->rows) && (new_lb < lp->infinite)) { new_lb = rand_uniform(lp, RANDSCALE) + 1; new_lb *= lp->epsperturb; lowbo[i] -= new_lb; n++; } /* Upper bound */ if(new_ub < lp->infinite) { new_ub = rand_uniform(lp, RANDSCALE) + 1; new_ub *= lp->epsperturb; upbo[i] += new_ub; n++; } } /* Make sure we start from scratch */ set_action(&lp->spx_action, ACTION_REBASE); return( n ); } STATIC MYBOOL impose_bounds(lprec *lp, REAL *upbo, REAL *lowbo) /* Explicitly set working bounds to given vectors without pushing or popping */ { MYBOOL ok; ok = (MYBOOL) ((upbo != NULL) || (lowbo != NULL)); if(ok) { if((upbo != NULL) && (upbo != lp->upbo)) MEMCOPY(lp->upbo, upbo, lp->sum + 1); if((lowbo != NULL) && (lowbo != lp->lowbo)) MEMCOPY(lp->lowbo, lowbo, lp->sum + 1); if(lp->bb_bounds != NULL) lp->bb_bounds->UBzerobased = FALSE; set_action(&lp->spx_action, ACTION_REBASE); } set_action(&lp->spx_action, ACTION_RECOMPUTE); return( ok ); } STATIC MYBOOL validate_bounds(lprec *lp, REAL *upbo, REAL *lowbo) /* Check if all bounds are Explicitly set working bounds to given vectors without pushing or popping */ { MYBOOL ok; int i; ok = (MYBOOL) ((upbo != NULL) || (lowbo != NULL)); if(ok) { for(i = 1; i <= lp->sum; i++) if((lowbo[i] > upbo[i]) || (lowbo[i] < lp->orig_lowbo[i]) || (upbo[i] > lp->orig_upbo[i])) break; ok = (MYBOOL) (i > lp->sum); } return( ok ); } STATIC int unload_BB(lprec *lp) { int levelsunloaded = 0; if(lp->bb_bounds != NULL) while(pop_BB(lp->bb_bounds)) levelsunloaded++; return( levelsunloaded ); } #define LowerStorageModel 1 #define BasisStorageModel 1 STATIC basisrec *push_basis(lprec *lp, int *basisvar, MYBOOL *isbasic, MYBOOL *islower) /* Save the ingoing basis and push it onto the stack */ { int sum = lp->sum + 1; basisrec *newbasis = NULL; newbasis = (basisrec *) calloc(sizeof(*newbasis), 1); if((newbasis != NULL) && #if LowerStorageModel == 0 allocMYBOOL(lp, &newbasis->is_lower, sum, FALSE) && #else allocMYBOOL(lp, &newbasis->is_lower, (sum + 8) / 8, TRUE) && #endif #if BasisStorageModel == 0 allocMYBOOL(lp, &newbasis->is_basic, sum, FALSE) && #endif allocINT(lp, &newbasis->var_basic, lp->rows + 1, FALSE)) { if(islower == NULL) islower = lp->is_lower; if(isbasic == NULL) isbasic = lp->is_basic; if(basisvar == NULL) basisvar = lp->var_basic; #if LowerStorageModel == 0 MEMCOPY(newbasis->is_lower, islower, sum); #else for(sum = 1; sum <= lp->sum; sum++) if(islower[sum]) set_biton(newbasis->is_lower, sum); #endif #if BasisStorageModel == 0 MEMCOPY(newbasis->is_basic, isbasic, lp->sum + 1); #endif MEMCOPY(newbasis->var_basic, basisvar, lp->rows + 1); newbasis->previous = lp->bb_basis; if(lp->bb_basis == NULL) newbasis->level = 0; else newbasis->level = lp->bb_basis->level + 1; newbasis->pivots = 0; lp->bb_basis = newbasis; } return( newbasis ); } STATIC MYBOOL compare_basis(lprec *lp) /* Compares the last pushed basis with the currently active basis */ { int i, j; MYBOOL same_basis = TRUE; if(lp->bb_basis == NULL) return( FALSE ); /* Loop over basis variables until a mismatch (order can be different) */ i = 1; while(same_basis && (i <= lp->rows)) { j = 1; while(same_basis && (j <= lp->rows)) { same_basis = (MYBOOL) (lp->bb_basis->var_basic[i] != lp->var_basic[j]); j++; } same_basis = !same_basis; i++; } /* Loop over bound status indicators until a mismatch */ i = 1; while(same_basis && (i <= lp->sum)) { same_basis = (lp->bb_basis->is_lower[i] && lp->is_lower[i]); i++; } return( same_basis ); } STATIC MYBOOL restore_basis(lprec *lp) /* Restore values from the previously pushed / saved basis without popping it */ { MYBOOL ok; int i; ok = (MYBOOL) (lp->bb_basis != NULL); if(ok) { MEMCOPY(lp->var_basic, lp->bb_basis->var_basic, lp->rows + 1); #if BasisStorageModel == 0 MEMCOPY(lp->is_basic, lp->bb_basis->is_basic, lp->sum + 1); #else MEMCLEAR(lp->is_basic, lp->sum + 1); for(i = 1; i <= lp->rows; i++) lp->is_basic[lp->var_basic[i]] = TRUE; #endif #if LowerStorageModel == 0 MEMCOPY(lp->is_lower, lp->bb_basis->is_lower, lp->sum + 1); #else for(i = 1; i <= lp->sum; i++) lp->is_lower[i] = is_biton(lp->bb_basis->is_lower, i); #endif set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT); } return( ok ); } STATIC MYBOOL pop_basis(lprec *lp, MYBOOL restore) /* Pop / free, and optionally restore the previously "pushed" / saved basis */ { MYBOOL ok; basisrec *oldbasis; ok = (MYBOOL) (lp->bb_basis != NULL); if(ok) { oldbasis = lp->bb_basis; if(oldbasis != NULL) { lp->bb_basis = oldbasis->previous; FREE(oldbasis->var_basic); #if BasisStorageModel == 0 FREE(oldbasis->is_basic); #endif FREE(oldbasis->is_lower); FREE(oldbasis); } if(restore && (lp->bb_basis != NULL)) restore_basis(lp); } return( ok ); } STATIC int unload_basis(lprec *lp, MYBOOL restorelast) { int levelsunloaded = 0; if(lp->bb_basis != NULL) while(pop_basis(lp, restorelast)) levelsunloaded++; return( levelsunloaded ); } STATIC REAL scaled_floor(lprec *lp, int colnr, REAL value, REAL epsscale) { value = floor(value); if(value != 0) if(lp->columns_scaled && is_integerscaling(lp)) { value = scaled_value(lp, value, colnr); if(epsscale != 0) value += epsscale*lp->epsmachine; /* value += epsscale*lp->epsprimal; */ /* value = restoreINT(value, lp->epsint); */ } return(value); } STATIC REAL scaled_ceil(lprec *lp, int colnr, REAL value, REAL epsscale) { value = ceil(value); if(value != 0) if(lp->columns_scaled && is_integerscaling(lp)) { value = scaled_value(lp, value, colnr); if(epsscale != 0) value -= epsscale*lp->epsmachine; /* value -= epsscale*lp->epsprimal; */ /* value = restoreINT(value, lp->epsint); */ } return(value); } /* Branch and bound variable selection functions */ STATIC MYBOOL is_sc_violated(lprec *lp, int column) { int varno; REAL tmpreal; varno = lp->rows+column; tmpreal = unscaled_value(lp, lp->sc_lobound[column], varno); return( (MYBOOL) ((tmpreal > 0) && /* it is an (inactive) SC variable... */ (lp->solution[varno] < tmpreal) && /* ...and the NZ lower bound is violated */ (lp->solution[varno] > 0)) ); /* ...and the Z lowerbound is violated */ } STATIC int find_sc_bbvar(lprec *lp, int *count) { int i, ii, n, bestvar; int firstsc, lastsc; REAL hold, holdINT, bestval, OFval, randval, scval; MYBOOL reversemode, greedymode, randomizemode, pseudocostmode, pseudocostsel; bestvar = 0; if((lp->sc_vars == 0) || (*count > 0)) return(bestvar); reversemode = is_bb_mode(lp, NODE_WEIGHTREVERSEMODE); greedymode = is_bb_mode(lp, NODE_GREEDYMODE); randomizemode = is_bb_mode(lp, NODE_RANDOMIZEMODE); pseudocostmode = is_bb_mode(lp, NODE_PSEUDOCOSTMODE); pseudocostsel = is_bb_rule(lp, NODE_PSEUDOCOSTSELECT) || is_bb_rule(lp, NODE_PSEUDONONINTSELECT) || is_bb_rule(lp, NODE_PSEUDORATIOSELECT); bestvar = 0; bestval = -lp->infinite; hold = 0; randval = 1; firstsc = 0; lastsc = lp->columns; for(n = 1; n <= lp->columns; n++) { ii = get_var_priority(lp, n); i = lp->rows + ii; if(!lp->bb_varactive[ii] && is_sc_violated(lp, ii) && !SOS_is_marked(lp->SOS, 0, ii)) { /* Do tallies */ (*count)++; lastsc = i; if(firstsc <= 0) firstsc = i; scval = get_pseudorange(lp->bb_PseudoCost, ii, BB_SC); /* Select default pricing/weighting mode */ if(pseudocostmode) OFval = get_pseudonodecost(lp->bb_PseudoCost, ii, BB_SC, lp->solution[i]); else OFval = my_chsign(is_maxim(lp), get_mat(lp, 0, ii)); if(randomizemode) randval = exp(rand_uniform(lp, 1.0)); /* Find the maximum pseudo-cost of a variable (don't apply pseudocostmode here) */ if(pseudocostsel) { if(pseudocostmode) hold = OFval; else hold = get_pseudonodecost(lp->bb_PseudoCost, ii, BB_SC, lp->solution[i]); hold *= randval; if(greedymode) { if(pseudocostmode) /* Override! */ OFval = my_chsign(is_maxim(lp), get_mat(lp, 0, ii)); hold *= OFval; } hold = my_chsign(reversemode, hold); } else /* Find the variable with the largest sc gap (closest to the sc mean) */ if(is_bb_rule(lp, NODE_FRACTIONSELECT)) { hold = modf(lp->solution[i]/scval, &holdINT); holdINT = hold-1; if(fabs(holdINT) > hold) hold = holdINT; if(greedymode) hold *= OFval; hold = my_chsign(reversemode, hold)*scval*randval; } else /* Do first or last violated sc index selection (default) */ /* if(is_bb_rule(lp, NODE_FIRSTSELECT)) */ { if(reversemode) continue; else { bestvar = i; break; } } /* Select better, check for ties, and split by proximity to 0.5*sc_lobound */ if(hold > bestval) { if( (bestvar == 0) || (hold > bestval+lp->epsprimal) || (fabs(modf(lp->solution[i]/scval, &holdINT) - 0.5) < fabs(modf(lp->solution[bestvar]/ get_pseudorange(lp->bb_PseudoCost, bestvar-lp->rows, BB_SC), &holdINT) - 0.5)) ) { bestval = hold; bestvar = i; } } } } if(is_bb_rule(lp, NODE_FIRSTSELECT) && reversemode) bestvar = lastsc; return(bestvar); } STATIC int find_sos_bbvar(lprec *lp, int *count, MYBOOL intsos) { int k, i, j, var; var = 0; if((lp->SOS == NULL) || (*count > 0)) return(var); /* Check if the SOS'es happen to already be satisified */ i = SOS_is_satisfied(lp->SOS, 0, lp->solution); if((i == SOS_COMPLETE) || (i == SOS_INCOMPLETE)) return(-1); /* Otherwise identify a SOS variable to enter B&B */ for(k = 0; k < lp->sos_vars; k++) { i = lp->sos_priority[k]; #ifdef Paranoia if((i < 1) || (i > lp->columns)) report(lp, SEVERE, "find_sos_bbvar: Invalid SOS variable map %d at %d\n", i, k); #endif j = lp->rows + i; if(!SOS_is_marked(lp->SOS, 0, i) && !SOS_is_full(lp->SOS, 0, i, FALSE)) { /* if(!SOS_is_marked(lp->SOS, 0, i) && !SOS_is_full(lp->SOS, 0, i, TRUE)) { */ if(!intsos || is_int(lp, i)) { (*count)++; if(var == 0) { var = j; break; } } } } #ifdef Paranoia if((var > 0) && !SOS_is_member(lp->SOS, 0, var-lp->rows)) report(lp, SEVERE, "find_sos_bbvar: Found variable %d, which is not a SOS!\n", var); #endif return(var); } STATIC int find_int_bbvar(lprec *lp, int *count, BBrec *BB, MYBOOL *isfeasible) { int i, ii, n, k, bestvar, depthmax, *nonint = NULL; REAL hold, holdINT, bestval, OFval, randval, *lowbo = BB->lowbo, *upbo = BB->upbo; MYBOOL reversemode, greedymode, depthfirstmode, breadthfirstmode, randomizemode, rcostmode, pseudocostmode, pseudocostsel, pseudostrong, isINT, valINT; if((lp->int_vars == 0) || (*count > 0)) return( 0 ); if(lp->bb_usenode != NULL) { i = lp->bb_usenode(lp, lp->bb_nodehandle, BB_INT); if(i >= 0) { if(i > 0) (*count)++; return( i ); } } reversemode = is_bb_mode(lp, NODE_WEIGHTREVERSEMODE); greedymode = is_bb_mode(lp, NODE_GREEDYMODE); randomizemode = is_bb_mode(lp, NODE_RANDOMIZEMODE); depthfirstmode = is_bb_mode(lp, NODE_DEPTHFIRSTMODE); breadthfirstmode = is_bb_mode(lp, NODE_BREADTHFIRSTMODE) && (MYBOOL) (lp->bb_level <= lp->int_vars); rcostmode = (MYBOOL) /* FALSE */ (BB->lp->solutioncount > 0) && is_bb_mode(lp, NODE_RCOSTFIXING) ; /* 5/2/08 peno disabled NODE_RCOSTFIXING because it results in non-optimal solutions with some models */ /* 15/2/8 peno enabled NODE_RCOSTFIXING again because a fix is found. See lp_simplex.c NODE__RCOSTFIXING fix */ pseudocostmode = is_bb_mode(lp, NODE_PSEUDOCOSTMODE); pseudocostsel = is_bb_rule(lp, NODE_PSEUDOCOSTSELECT) || is_bb_rule(lp, NODE_PSEUDONONINTSELECT) || is_bb_rule(lp, NODE_PSEUDORATIOSELECT); pseudostrong = FALSE && pseudocostsel && !rcostmode && is_bb_mode(lp, NODE_STRONGINIT); /* Fill list of non-ints */ allocINT(lp, &nonint, lp->columns + 1, FALSE); n = 0; depthmax = -1; if(isfeasible != NULL) *isfeasible = TRUE; BB->lastrcf = 0; for(k = 1; (k <= lp->columns); k++) { ii = get_var_priority(lp, k); isINT = is_int(lp,ii); i = lp->rows + ii; /* Tally reduced cost fixing opportunities for ranged non-basic nonINTs */ if(!isINT) { #ifdef UseMilpExpandedRCF if(rcostmode) { bestvar = rcfbound_BB(BB, i, isINT, NULL, isfeasible); if(bestvar != FR) BB->lastrcf++; } #endif } else { valINT = solution_is_int(lp, i, FALSE); /* Skip already fixed variables */ if(lowbo[i] == upbo[i]) { /* Check for validity */ #ifdef Paranoia if(!valINT) { report(lp, IMPORTANT, "find_int_bbvar: INT var %d was fixed at %d, but computed as %g at node %.0f\n", ii, (int) lowbo[i], lp->solution[i], (double) lp->bb_totalnodes); lp->bb_break = TRUE; lp->spx_status = UNKNOWNERROR; bestvar = 0; goto Done; } #endif } /* The variable has not yet been fixed */ else { /* Tally reduced cost fixing opportunities (also when the variables are integer-valued at the current relaxation) */ if(rcostmode) { bestvar = rcfbound_BB(BB, i, isINT, NULL, isfeasible); if(bestvar != FR) BB->lastrcf++; } else bestvar = FR; /* Only qualify variable as branching node if it is non-integer and it will not be subsequently fixed via reduced cost fixing logic */ if(!valINT && (bestvar >= FR)) { n++; nonint[n] = ii; SETMAX(depthmax, lp->bb_varactive[ii]); } } } } #ifdef UseMilpSlacksRCF /* Optionally also tally slacks */ if(rcostmode) { for(i = 1; (i <= lp->rows) && (BB->lastrcf == 0); i++) { /* Skip already fixed slacks (equalities) */ if(lowbo[i] < upbo[i]) { bestvar = rcfbound_BB(BB, i, FALSE, NULL, isfeasible); if(bestvar != FR) BB->lastrcf++; } } } #endif nonint[0] = n; *count = n; bestvar = 0; if(n == 0) /* No non-integers found */ goto Done; bestval = -lp->infinite; hold = 0; randval = 1; /* Sort non-ints by depth in case we have breadthfirst or depthfirst modes */ if((lp->bb_level > 1) && (depthmax > 0) && (depthfirstmode || breadthfirstmode)) { int *depths = NULL; /* Fill attribute array and make sure ordinal order breaks ties during sort */ allocINT(lp, &depths, n + 1, FALSE); for(i = 1; i <= n; i++) depths[i] = (depthfirstmode ? n+1-i : i) + (n+1)*lp->bb_varactive[nonint[i]]; hpsortex(depths, n, 1, sizeof(*nonint), depthfirstmode, compareINT, nonint); FREE(depths); } /* Do simple firstselect handling */ if(is_bb_rule(lp, NODE_FIRSTSELECT)) { if(reversemode) bestvar = lp->rows + nonint[nonint[0]]; else bestvar = lp->rows + nonint[1]; } else for(n = 1; n <= nonint[0]; n++) { ii = nonint[n]; i = lp->rows + ii; /* Do the naive detection */ if(n == 1) bestvar = i; /* Should we do a "strong" pseudo-cost initialization or an incremental update? */ if(pseudostrong && (MAX(lp->bb_PseudoCost->LOcost[ii].rownr, lp->bb_PseudoCost->UPcost[ii].rownr) < lp->bb_PseudoCost->updatelimit) && (MAX(lp->bb_PseudoCost->LOcost[ii].colnr, lp->bb_PseudoCost->UPcost[ii].colnr) < 5*lp->bb_PseudoCost->updatelimit)) { strongbranch_BB(lp, BB, ii, BB_INT, nonint[0]); } /* Select default pricing/weighting mode */ if(pseudocostmode) OFval = get_pseudonodecost(lp->bb_PseudoCost, ii, BB_INT, lp->solution[i]); else OFval = my_chsign(is_maxim(lp), get_mat(lp, 0, ii)); if(randomizemode) randval = exp(rand_uniform(lp, 1.0)); /* Find the maximum pseudo-cost of a variable (don't apply pseudocostmode here) */ if(pseudocostsel) { if(pseudocostmode) hold = OFval; else hold = get_pseudonodecost(lp->bb_PseudoCost, ii, BB_INT, lp->solution[i]); hold *= randval; if(greedymode) { if(pseudocostmode) /* Override! */ OFval = my_chsign(is_maxim(lp), get_mat(lp, 0, ii)); hold *= OFval; } hold = my_chsign(reversemode, hold); } else /* Find the variable with the largest gap to its bounds (distance from being fixed) */ if(is_bb_rule(lp, NODE_GAPSELECT)) { hold = lp->solution[i]; holdINT = hold-unscaled_value(lp, upbo[i], i); hold -= unscaled_value(lp, lowbo[i], i); if(fabs(holdINT) > hold) hold = holdINT; if(greedymode) hold *= OFval; hold = my_chsign(reversemode, hold)*randval; } else /* Find the variable with the largest integer gap (closest to 0.5) */ if(is_bb_rule(lp, NODE_FRACTIONSELECT)) { hold = modf(lp->solution[i], &holdINT); holdINT = hold-1; if(fabs(holdINT) > hold) hold = holdINT; if(greedymode) hold *= OFval; hold = my_chsign(reversemode, hold)*randval; } else /* Find the "range", most flexible variable */ if(is_bb_rule(lp, NODE_RANGESELECT)) { hold = unscaled_value(lp, upbo[i]-lowbo[i], i); if(greedymode) hold *= OFval; hold = my_chsign(reversemode, hold)*randval; } /* Select better, check for ties, and split by proximity to 0.5 */ if(hold > bestval) { if( (hold > bestval+lp->epsprimal) || (fabs(modf(lp->solution[i], &holdINT) - 0.5) < fabs(modf(lp->solution[bestvar], &holdINT) - 0.5)) ) { bestval = hold; bestvar = i; } } } Done: FREE(nonint); return(bestvar); } STATIC BBPSrec *init_pseudocost(lprec *lp, int pseudotype) { int i; REAL PSinitUP, PSinitLO; BBPSrec *newitem; MYBOOL isPSCount; /* Allocate memory */ newitem = (BBPSrec*) malloc(sizeof(*newitem)); newitem->lp = lp; newitem->LOcost = (MATitem*) malloc((lp->columns+1) * sizeof(*newitem->LOcost)); newitem->UPcost = (MATitem*) malloc((lp->columns+1) * sizeof(*newitem->UPcost)); newitem->secondary = NULL; /* Initialize with OF values */ newitem->pseodotype = (pseudotype & NODE_STRATEGYMASK); isPSCount = ((pseudotype & NODE_PSEUDONONINTSELECT) != 0); for(i = 1; i <= lp->columns; i++) { newitem->LOcost[i].rownr = 1; /* Actual updates */ newitem->LOcost[i].colnr = 1; /* Attempted updates */ newitem->UPcost[i].rownr = 1; newitem->UPcost[i].colnr = 1; /* Initialize with the plain OF value as conventional usage suggests, or override in case of pseudo-nonint count strategy */ PSinitUP = my_chsign(is_maxim(lp), get_mat(lp, 0, i)); PSinitLO = -PSinitUP; if(isPSCount) { /* Set default assumed reduction in the number of non-ints by choosing this variable; KE changed from 0 on 30 June 2004 and made two-sided selectable. Note that the typical value range is <0..1>, with a positive bias for an "a priori" assumed fast-converging (low "MIP-complexity") model. Very hard models may require negative initialized values for one or both. */ PSinitUP = 0.1*0; #if 0 PSinitUP = my_chsign(PSinitUP < 0, PSinitUP); PSinitLO = -PSinitUP; #else PSinitLO = PSinitUP; #endif } newitem->UPcost[i].value = PSinitUP; newitem->LOcost[i].value = PSinitLO; } newitem->updatelimit = lp->bb_PseudoUpdates; newitem->updatesfinished = 0; newitem->restartlimit = DEF_PSEUDOCOSTRESTART; /* Let the user get an opportunity to initialize pseudocosts */ if(userabort(lp, MSG_INITPSEUDOCOST)) lp->spx_status = USERABORT; return( newitem ); } STATIC MYBOOL free_pseudoclass(BBPSrec **PseudoClass) { BBPSrec *target = *PseudoClass; FREE(target->LOcost); FREE(target->UPcost); target = target->secondary; FREE(*PseudoClass); *PseudoClass = target; return( (MYBOOL) (target != NULL) ); } STATIC void free_pseudocost(lprec *lp) { if((lp != NULL) && (lp->bb_PseudoCost != NULL)) { while(free_pseudoclass(&(lp->bb_PseudoCost)) ); } } MYBOOL __WINAPI set_pseudocosts(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit) { int i; if((lp->bb_PseudoCost == NULL) || ((clower == NULL) && (cupper == NULL))) return(FALSE); for(i = 1; i <= lp->columns; i++) { if(clower != NULL) lp->bb_PseudoCost->LOcost[i].value = clower[i]; if(cupper != NULL) lp->bb_PseudoCost->UPcost[i].value = cupper[i]; } if(updatelimit != NULL) lp->bb_PseudoCost->updatelimit = *updatelimit; return(TRUE); } MYBOOL __WINAPI get_pseudocosts(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit) { int i; if((lp->bb_PseudoCost == NULL) || ((clower == NULL) && (cupper == NULL))) return(FALSE); for(i = 1; i <= lp->columns; i++) { if(clower != NULL) clower[i] = lp->bb_PseudoCost->LOcost[i].value; if(cupper != NULL) cupper[i] = lp->bb_PseudoCost->UPcost[i].value; } if(updatelimit != NULL) *updatelimit = lp->bb_PseudoCost->updatelimit; return(TRUE); } STATIC REAL get_pseudorange(BBPSrec *pc, int mipvar, int varcode) { if(varcode == BB_SC) return( unscaled_value(pc->lp, pc->lp->sc_lobound[mipvar], pc->lp->rows+mipvar) ); else return( 1.0 ); } STATIC void update_pseudocost(BBPSrec *pc, int mipvar, int varcode, MYBOOL capupper, REAL varsol) { REAL OFsol, uplim; MATitem *PS; MYBOOL nonIntSelect = is_bb_rule(pc->lp, NODE_PSEUDONONINTSELECT); /* Establish input values; Note: The pseudocosts are normalized to the 0-1 range! */ uplim = get_pseudorange(pc, mipvar, varcode); varsol = modf(varsol/uplim, &OFsol); /* Set reference value according to pseudocost mode */ if(nonIntSelect) OFsol = pc->lp->bb_bounds->lastvarcus; /* The count of MIP infeasibilities */ else OFsol = pc->lp->solution[0]; /* The problem's objective function value */ if(isnan(varsol)) { pc->lp->bb_parentOF = OFsol; return; } /* Point to the applicable (lower or upper) bound and increment attempted update count */ if(capupper) { PS = &pc->LOcost[mipvar]; } else { PS = &pc->UPcost[mipvar]; varsol = 1-varsol; } PS->colnr++; /* Make adjustment to divisor if we are using the ratio pseudo-cost approach */ if(is_bb_rule(pc->lp, NODE_PSEUDORATIOSELECT)) varsol *= capupper; /* Compute the update (consider weighting in favor of most recent) */ mipvar = pc->updatelimit; if(((mipvar <= 0) || (PS->rownr < mipvar)) && (fabs(varsol) > pc->lp->epspivot)) { /* We are interested in the change in the MIP measure (contribution to increase or decrease, as the case may be) and not its last value alone. */ PS->value = PS->value*PS->rownr + (pc->lp->bb_parentOF-OFsol) / (varsol*uplim); PS->rownr++; PS->value /= PS->rownr; /* Check if we have enough information to restart */ if(PS->rownr == mipvar) { pc->updatesfinished++; if(is_bb_mode(pc->lp, NODE_RESTARTMODE) && (pc->updatesfinished/(2.0*pc->lp->int_vars) > pc->restartlimit)) { pc->lp->bb_break = AUTOMATIC; pc->restartlimit *= 2.681; /* KE: Who can figure this one out? */ if(pc->restartlimit > 1) pc->lp->bb_rule -= NODE_RESTARTMODE; report(pc->lp, NORMAL, "update_pseudocost: Restarting with updated pseudocosts\n"); } } } pc->lp->bb_parentOF = OFsol; } STATIC REAL get_pseudobranchcost(BBPSrec *pc, int mipvar, MYBOOL dofloor) { if(dofloor) return( pc->LOcost[mipvar].value ); else return( pc->UPcost[mipvar].value ); } STATIC REAL get_pseudonodecost(BBPSrec *pc, int mipvar, int vartype, REAL varsol) { REAL hold, uplim; uplim = get_pseudorange(pc, mipvar, vartype); varsol = modf(varsol/uplim, &hold); if(isnan(varsol)) varsol = 0; hold = pc->LOcost[mipvar].value*varsol + pc->UPcost[mipvar].value*(1-varsol); return( hold*uplim ); } STATIC int compute_theta(lprec *lp, int rownr, LREAL *theta, int isupbound, REAL HarrisScalar, MYBOOL primal) /* The purpose of this routine is to compute the non-basic bound state / value of the leaving variable. Note that the incoming theta is "d" in Chvatal-terminology */ { int colnr = lp->var_basic[rownr]; register LREAL x = lp->rhs[rownr]; REAL lb = 0, /* Put lower bound here when the fully bounded version is implemented */ ub = lp->upbo[colnr], eps = lp->epsprimal; /* Primal feasibility tolerance */ /* Compute theta for the primal simplex */ HarrisScalar *= eps; if(primal) { if(*theta > 0) x -= lb - HarrisScalar; /* A positive number */ else if(ub < lp->infinite) x -= ub + HarrisScalar; /* A negative number */ else { *theta = -lp->infinite; return( colnr ); } } /* Compute theta for the dual simplex */ else { if(isupbound) *theta = -(*theta); /* Current value is below or equal to its lower bound */ if(x < lb+eps) x -= lb - HarrisScalar; /* Current value is above or equal to its upper bound */ else if(x > ub-eps) { if(ub >= lp->infinite) { *theta = lp->infinite * my_sign(*theta); return( colnr ); } else x -= ub + HarrisScalar; } } my_roundzero(x, lp->epsmachine); *theta = x / *theta; #ifdef EnforcePositiveTheta /* Check if we have negative theta due to rounding or an internal error */ if(*theta < 0) { if(primal && (ub == lb)) lp->rhs[rownr] = lb; else #ifdef Paranoia if(*theta < -eps) { report(lp, DETAILED, "compute_theta: Negative theta (%g) not allowed in base-0 version of lp_solve\n", *theta); } #endif *theta = 0; } #endif return( colnr ); } STATIC MYBOOL check_degeneracy(lprec *lp, REAL *pcol, int *degencount) /* Check if the entering column Pi=Inv(B)*a is likely to produce improvement; (cfr. Istvan Maros: CTOTSM p. 233) */ { int i, ndegen; REAL *rhs, sdegen, epsmargin = lp->epsprimal; sdegen = 0; ndegen = 0; rhs = lp->rhs; for(i = 1; i <= lp->rows; i++) { rhs++; pcol++; if(fabs(*rhs) < epsmargin) { sdegen += *pcol; ndegen++; } else if(fabs((*rhs)-lp->upbo[lp->var_basic[i]]) < epsmargin) { sdegen -= *pcol; ndegen++; } } if(degencount != NULL) *degencount = ndegen; /* sdegen += epsmargin*ndegen; */ return( (MYBOOL) (sdegen <= 0) ); } STATIC MYBOOL performiteration(lprec *lp, int rownr, int varin, LREAL theta, MYBOOL primal, MYBOOL allowminit, REAL *prow, int *nzprow, REAL *pcol, int *nzpcol, int *boundswaps) { int varout; REAL pivot, epsmargin, leavingValue, leavingUB, enteringUB; MYBOOL leavingToUB = FALSE, enteringFromUB, enteringIsFixed, leavingIsFixed; MYBOOL *islower = &(lp->is_lower[varin]); MYBOOL minitNow = FALSE, minitStatus = ITERATE_MAJORMAJOR; LREAL deltatheta = theta; if(userabort(lp, MSG_ITERATION)) return( minitNow ); #ifdef Paranoia if(rownr > lp->rows) { if (lp->spx_trace) report(lp, IMPORTANT, "performiteration: Numeric instability encountered!\n"); lp->spx_status = NUMFAILURE; return( FALSE ); } #endif varout = lp->var_basic[rownr]; #ifdef Paranoia if(!lp->is_lower[varout]) report(lp, SEVERE, "performiteration: Leaving variable %d was at its upper bound at iter %.0f\n", varout, (double) get_total_iter(lp)); #endif /* Theta is the largest change possible (strictest constraint) for the entering variable (Theta is Chvatal's "t", ref. Linear Programming, pages 124 and 156) */ lp->current_iter++; /* Test if it is possible to do a cheap "minor iteration"; i.e. set entering variable to its opposite bound, without entering the basis - which is obviously not possible for fixed variables! */ epsmargin = lp->epsprimal; enteringFromUB = !(*islower); enteringUB = lp->upbo[varin]; leavingUB = lp->upbo[varout]; enteringIsFixed = (MYBOOL) (fabs(enteringUB) < epsmargin); leavingIsFixed = (MYBOOL) (fabs(leavingUB) < epsmargin); #if defined _PRICE_NOBOUNDFLIP allowminit &= !ISMASKSET(lp->piv_strategy, PRICE_NOBOUNDFLIP); #endif #ifdef Paranoia if(enteringUB < 0) report(lp, SEVERE, "performiteration: Negative range for entering variable %d at iter %.0f\n", varin, (double) get_total_iter(lp)); if(leavingUB < 0) report(lp, SEVERE, "performiteration: Negative range for leaving variable %d at iter %.0f\n", varout, (double) get_total_iter(lp)); #endif /* Handle batch bound swaps with the dual long-step algorithm; Loop over specified bound swaps; update RHS and Theta for bound swaps */ if((boundswaps != NULL) && (boundswaps[0] > 0)) { int i, boundvar; REAL *hold; /* Allocate and initialize accumulation array */ allocREAL(lp, &hold, lp->rows + 1, TRUE); /* Accumulate effective bound swaps and update flag */ for(i = 1; i <= boundswaps[0]; i++) { boundvar = boundswaps[i]; deltatheta = my_chsign(!lp->is_lower[boundvar], lp->upbo[boundvar]); mat_multadd(lp->matA, hold, boundvar, deltatheta); lp->is_lower[boundvar] = !lp->is_lower[boundvar]; } lp->current_bswap += boundswaps[0]; lp->current_iter += boundswaps[0]; /* Solve for bound flip update vector (note that this does not overwrite the stored update vector for the entering variable) */ ftran(lp, hold, NULL, lp->epsmachine); if(!lp->obj_in_basis) hold[0] = 0; /* The correct reduced cost goes here (adjusted for bound state) ****** */ /* Update the RHS / basic variable values and set revised thetas */ pivot = lp->bfp_pivotRHS(lp, 1, hold); deltatheta = multi_enteringtheta(lp->longsteps); theta = deltatheta; FREE(hold); } /* Otherwise to traditional check for single bound swap */ else if(allowminit && !enteringIsFixed) { /* pivot = epsmargin; */ pivot = lp->epsdual; /* #define v51mode */ /* Enable this for v5.1 operation mode */ #ifdef v51mode if(((lp->simplex_mode & SIMPLEX_Phase1_DUAL) == 0) || !is_constr_type(lp, rownr, EQ)) /* *** DEBUG CODE KE */ #endif if(enteringUB - theta < -pivot) { #ifndef v51mode if(fabs(enteringUB - theta) < pivot) minitStatus = ITERATE_MINORMAJOR; else #endif minitStatus = ITERATE_MINORRETRY; minitNow = (MYBOOL) (minitStatus != ITERATE_MAJORMAJOR); } } /* Process for traditional style single minor iteration */ if(minitNow) { /* Set the new values (note that theta is set to always be positive) */ theta = MIN(fabs(theta), enteringUB); /* Update the RHS / variable values and do bound-swap */ pivot = lp->bfp_pivotRHS(lp, theta, NULL); *islower = !(*islower); lp->current_bswap++; } /* Process for major iteration */ else { /* Update the active pricer for the current pivot */ updatePricer(lp, rownr, varin, lp->bfp_pivotvector(lp), prow, nzprow); /* Update the current basic variable values */ pivot = lp->bfp_pivotRHS(lp, theta, NULL); /* See if the leaving variable goes directly to its upper bound. */ leavingValue = lp->rhs[rownr]; leavingToUB = (MYBOOL) (leavingValue > 0.5*leavingUB); lp->is_lower[varout] = leavingIsFixed || !leavingToUB; /* Set the value of the entering varible (theta always set to be positive) */ if(enteringFromUB) { lp->rhs[rownr] = enteringUB - deltatheta; *islower = TRUE; } else lp->rhs[rownr] = deltatheta; my_roundzero(lp->rhs[rownr], epsmargin); /* Update basis indeces */ varout = set_basisvar(lp, rownr, varin); /* Finalize the update in preparation for next major iteration */ lp->bfp_finishupdate(lp, enteringFromUB); } /* Show pivot tracking information, if specified */ if((lp->verbose > NORMAL) && (MIP_count(lp) == 0) && ((lp->current_iter % MAX(2, lp->rows / 10)) == 0)) report(lp, NORMAL, "Objective value " RESULTVALUEMASK " at iter %10.0f.\n", lp->rhs[0], (double) get_total_iter(lp)); #if 0 if(verify_solution(lp, FALSE, my_if(minitNow, "MINOR", "MAJOR")) >= 0) { if(minitNow) pivot = get_obj_active(lp, varin); else pivot = get_obj_active(lp, varout); } #endif #if 0 if((lp->longsteps != NULL) && (boundswaps[0] > 0) && lp->longsteps->objcheck && ((pivot = fabs(my_reldiff(lp->rhs[0], lp->longsteps->obj_last))) > lp->epssolution)) { report(lp, IMPORTANT, "performiteration: Objective value gap %8.6f found at iter %6.0f (%d bound flips, %d)\n", pivot, (double) get_total_iter(lp), boundswaps[0], enteringFromUB); } #endif if(lp->spx_trace) { if(minitNow) report(lp, NORMAL, "I:%5.0f - minor - %5d ignored, %5d flips from %s with THETA=%g and OBJ=%g\n", (double) get_total_iter(lp), varout, varin, (enteringFromUB ? "UPPER" : "LOWER"), theta, lp->rhs[0]); else report(lp, NORMAL, "I:%5.0f - MAJOR - %5d leaves to %s, %5d enters from %s with THETA=%g and OBJ=%g\n", (double) get_total_iter(lp), varout, (leavingToUB ? "UPPER" : "LOWER"), varin, (enteringFromUB ? "UPPER" : "LOWER"), theta, lp->rhs[0]); if(minitNow) { if(!lp->is_lower[varin]) report(lp, DETAILED, "performiteration: Variable %d changed to its lower bound at iter %.0f (from %g)\n", varin, (double) get_total_iter(lp), enteringUB); else report(lp, DETAILED, "performiteration: Variable %d changed to its upper bound at iter %.0f (to %g)\n", varin, (double) get_total_iter(lp), enteringUB); } else report(lp, NORMAL, "performiteration: Variable %d entered basis at iter %.0f at " RESULTVALUEMASK "\n", varin, (double) get_total_iter(lp), lp->rhs[rownr]); if(!primal) { pivot = compute_feasibilitygap(lp, (MYBOOL)!primal, TRUE); report(lp, NORMAL, "performiteration: Feasibility gap at iter %.0f is " RESULTVALUEMASK "\n", (double) get_total_iter(lp), pivot); } else report(lp, NORMAL, "performiteration: Current objective function value at iter %.0f is " RESULTVALUEMASK "\n", (double) get_total_iter(lp), lp->rhs[0]); } return( minitStatus ); } /* performiteration */ STATIC REAL get_refactfrequency(lprec *lp, MYBOOL final) { COUNTER iters; int refacts; /* Get numerator and divisor information */ iters = (lp->total_iter+lp->current_iter) - (lp->total_bswap+lp->current_bswap); refacts = lp->bfp_refactcount(lp, BFP_STAT_REFACT_TOTAL); /* Return frequency for different cases: 1) Actual frequency in case final statistic is desired 2) Dummy if we are in a B&B process 3) Frequency with added initialization offsets which are diluted in course of the solution process */ if(final) return( (REAL) (iters) / MAX(1,refacts) ); else if(lp->bb_totalnodes > 0) return( (REAL) lp->bfp_pivotmax(lp) ); else return( (REAL) (lp->bfp_pivotmax(lp)+iters) / (1+refacts) ); } #if 0 /* INLINE */ MYBOOL is_fixedvar(lprec *lp, int variable) { if((lp->bb_bounds != NULL && lp->bb_bounds->UBzerobased) || (variable <= lp->rows)) return( (MYBOOL) (lp->upbo[variable] < lp->epsprimal) ); else return( (MYBOOL) (lp->upbo[variable]-lp->lowbo[variable] < lp->epsprimal) ); } /* is_fixedvar */ #else MYBOOL is_fixedvar(lprec *lp, int varnr) { if(lp->bb_bounds == NULL) { if(varnr <= lp->rows) return( (MYBOOL) (lp->orig_upbo[varnr] < lp->epsmachine) ); else return( (MYBOOL) (lp->orig_upbo[varnr]-lp->orig_lowbo[varnr] < lp->epsmachine) ); } else if((varnr <= lp->rows) || (lp->bb_bounds->UBzerobased == TRUE)) return( (MYBOOL) (lp->upbo[varnr] < lp->epsvalue) ); else return( (MYBOOL) (lp->upbo[varnr]-lp->lowbo[varnr] < lp->epsvalue) ); } #endif STATIC MYBOOL solution_is_int(lprec *lp, int index, MYBOOL checkfixed) { #if 1 return( (MYBOOL) (isINT(lp, lp->solution[index]) && (!checkfixed || is_fixedvar(lp, index))) ); #else if(isINT(lp, lp->solution[index])) { if(checkfixed) return(is_fixedvar(lp, index)); else return(TRUE); } return(FALSE); #endif } /* solution_is_int */ MYBOOL __WINAPI set_multiprice(lprec *lp, int multiblockdiv) { /* See if we are resetting multiply priced column structures */ if(multiblockdiv != lp->multiblockdiv) { if(multiblockdiv < 1) multiblockdiv = 1; lp->multiblockdiv = multiblockdiv; multi_free(&(lp->multivars)); } return( TRUE ); } int __WINAPI get_multiprice(lprec *lp, MYBOOL getabssize) { if((lp->multivars == NULL) || (lp->multivars->used == 0)) return( 0 ); if(getabssize) return( lp->multivars->size ); else return( lp->multiblockdiv ); } MYBOOL __WINAPI set_partialprice(lprec *lp, int blockcount, int *blockstart, MYBOOL isrow) { int ne, i, items; partialrec **blockdata; /* Determine partial target (rows or columns) */ if(isrow) blockdata = &(lp->rowblocks); else blockdata = &(lp->colblocks); /* See if we are resetting partial blocks */ ne = 0; items = IF(isrow, lp->rows, lp->columns); if(blockcount == 1) partial_freeBlocks(blockdata); /* Set a default block count if this was not specified */ else if(blockcount <= 0) { blockstart = NULL; if(items < DEF_PARTIALBLOCKS*DEF_PARTIALBLOCKS) blockcount = items / DEF_PARTIALBLOCKS + 1; else blockcount = DEF_PARTIALBLOCKS; ne = items / blockcount; if(ne * blockcount < items) ne++; } /* Fill partial block arrays; Note: These will be modified during preprocess to reflect presolved columns and the handling of slack variables. */ if(blockcount > 1) { MYBOOL isNew = (MYBOOL) (*blockdata == NULL); /* Provide for extra block with slack variables in the column mode */ i = 0; if(!isrow) i++; /* (Re)-allocate memory */ if(isNew) *blockdata = partial_createBlocks(lp, isrow); allocINT(lp, &((*blockdata)->blockend), blockcount+i+1, AUTOMATIC); allocINT(lp, &((*blockdata)->blockpos), blockcount+i+1, AUTOMATIC); /* Copy the user-provided block start positions */ if(blockstart != NULL) { MEMCOPY((*blockdata)->blockend+i, blockstart, blockcount+i+1); if(!isrow) { blockcount++; (*blockdata)->blockend[0] = 1; for(i = 1; i < blockcount; i++) (*blockdata)->blockend[i] += lp->rows; } } /* Fill the block ending positions if they were not specified */ else { (*blockdata)->blockend[0] = 1; (*blockdata)->blockpos[0] = 1; if(ne == 0) { ne = items / blockcount; /* Increase the block size if we have a fractional value */ while(ne * blockcount < items) ne++; } i = 1; if(!isrow) { (*blockdata)->blockend[i] = (*blockdata)->blockend[i-1]+lp->rows; blockcount++; i++; items += lp->rows; } for(; i < blockcount; i++) (*blockdata)->blockend[i] = (*blockdata)->blockend[i-1]+ne; /* Let the last block handle the "residual" */ (*blockdata)->blockend[blockcount] = items+1; } /* Fill starting positions (used in multiple partial pricing) */ for(i = 1; i <= blockcount; i++) (*blockdata)->blockpos[i] = (*blockdata)->blockend[i-1]; } /* Update block count */ (*blockdata)->blockcount = blockcount; return( TRUE ); } /* set_partialprice */ void __WINAPI get_partialprice(lprec *lp, int *blockcount, int *blockstart, MYBOOL isrow) { partialrec *blockdata; /* Determine partial target (rows or columns) */ if(isrow) blockdata = lp->rowblocks; else blockdata = lp->colblocks; *blockcount = partial_countBlocks(lp, isrow); if((blockdata != NULL) && (blockstart != NULL)) { int i = 0, k = *blockcount; if(!isrow) i++; MEMCOPY(blockstart, blockdata->blockend + i, k - i); if(!isrow) { k -= i; for(i = 0; i < k; i++) blockstart[i] -= lp->rows; } } } /* Solution-related functions */ STATIC MYBOOL bb_better(lprec *lp, int target, int mode) /* Must handle four modes (logic assumes Min!): -----|--.--|-----> 1 ++++++----------- LHS exclusive test point is better 2 +++++++++-------- LHS inclusive 3 ++++++-----++++++ LHS+RHS exclusive 4 --------+++++++++ RHS inclusive 5 -----------++++++ RHS exclusive */ { REAL epsvalue, offset = lp->epsprimal, refvalue = lp->infinite, testvalue = lp->solution[0]; MYBOOL ismax = is_maxim(lp), relgap = is_action(mode, OF_TEST_RELGAP), fcast = is_action(target, OF_PROJECTED), delta = is_action(target, OF_DELTA); if(relgap) { epsvalue = lp->mip_relgap; clear_action(&mode, OF_TEST_RELGAP); } else epsvalue = lp->mip_absgap; if(delta) clear_action(&target, OF_DELTA); if(fcast) clear_action(&target, OF_PROJECTED); #ifdef Paranoia if((mode < OF_TEST_BT) || (mode > OF_TEST_WT)) report(lp, SEVERE, "bb_better: Passed invalid mode '%d'\n", mode); #endif switch(target) { case OF_RELAXED: refvalue = lp->real_solution; break; case OF_INCUMBENT: refvalue = lp->best_solution[0]; break; case OF_WORKING: refvalue = my_chsign(!ismax, lp->bb_workOF /* unscaled_value(lp, lp->bb_workOF, 0) */ ); if(fcast) testvalue = my_chsign(!ismax, lp->longsteps->obj_last) - epsvalue; else testvalue = my_chsign(!ismax, lp->rhs[0] /* unscaled_value(lp, lp->rhs[0], 0) */); break; case OF_USERBREAK: refvalue = lp->bb_breakOF; break; case OF_HEURISTIC: refvalue = lp->bb_heuristicOF; break; case OF_DUALLIMIT: refvalue = lp->bb_limitOF; break; default : report(lp, SEVERE, "bb_better: Passed invalid test target '%d'\n", target); return( FALSE ); } /* Adjust the test value for the desired acceptability window */ if(delta) { SETMAX(epsvalue, lp->bb_deltaOF - epsvalue); } else epsvalue = my_chsign(target >= OF_USERBREAK, epsvalue); /* *** This seems Ok, but should be verified */ testvalue += my_chsign(ismax, epsvalue); /* Compute the raw test value */ if(relgap) testvalue = my_reldiff(testvalue, refvalue); else testvalue -= refvalue; /* Make test value adjustment based on the selected option */ if(mode == OF_TEST_NE) relgap = (MYBOOL) (fabs(testvalue) >= offset); else { testvalue = my_chsign(mode > OF_TEST_NE, testvalue); testvalue = my_chsign(ismax, testvalue); relgap = (MYBOOL) (testvalue < offset); } return( relgap ); } STATIC void construct_solution(lprec *lp, REAL *target) { int i, j, basi; REAL f, epsvalue = lp->epsprimal; REAL *solution; REAL *value; int *rownr; MATrec *mat = lp->matA; if(target == NULL) solution = lp->solution; else solution = target; /* Initialize OF and slack variables. */ for(i = 0; i <= lp->rows; i++) { #ifdef LegacySlackDefinition if(i == 0) f = unscaled_value(lp, -lp->orig_rhs[i], i); else { j = lp->presolve_undo->var_to_orig[i]; if(j > 0) { f = lp->presolve_undo->fixed_rhs[j]; f = unscaled_value(lp, f, i); } else f = 0; } #else f = lp->orig_rhs[i]; if((i > 0) && !lp->is_basic[i] && !lp->is_lower[i]) #ifdef SlackInitMinusInf f -= my_chsign(is_chsign(lp, i), fabs(lp->upbo[i])); #else f -= my_chsign(is_chsign(lp, i), fabs(lp->lowbo[i] + lp->upbo[i])); #endif f = unscaled_value(lp, -f, i); #endif solution[i] = f; } /* Initialize user variables to their lower bounds. */ for(i = lp->rows+1; i <= lp->sum; i++) solution[i] = lp->lowbo[i]; /* Add values of user basic variables. */ for(i = 1; i <= lp->rows; i++) { basi = lp->var_basic[i]; if(basi > lp->rows) { solution[basi] += lp->rhs[i]; } } /* 1. Adjust non-basic variables at their upper bounds, 2. Unscale all user variables, 3. Optionally do precision management. */ for(i = lp->rows + 1; i <= lp->sum; i++) { if(!lp->is_basic[i] && !lp->is_lower[i]) solution[i] += lp->upbo[i]; solution[i] = unscaled_value(lp, solution[i], i); #ifdef xImproveSolutionPrecision if(is_int(lp, i-lp->rows)) solution[i] = restoreINT(solution[i], lp->epsint); else solution[i] = restoreINT(solution[i], lp->epsprimal); #endif } /* Compute the OF and slack values "in extentio" */ for(j = 1; j <= lp->columns; j++) { f = solution[lp->rows + j]; if(f != 0) { solution[0] += f * unscaled_mat(lp, lp->orig_obj[j], 0, j); i = mat->col_end[j-1]; basi = mat->col_end[j]; rownr = &COL_MAT_ROWNR(i); value = &COL_MAT_VALUE(i); for(; i < basi; i++, rownr += matRowColStep, value += matValueStep) solution[*rownr] += f * unscaled_mat(lp, *value, *rownr, j); } } /* Do slack precision management and sign reversal if necessary */ for(i = 0; i <= lp->rows; i++) { #ifdef ImproveSolutionPrecision my_roundzero(solution[i], epsvalue); #endif if(is_chsign(lp, i)) solution[i] = my_flipsign(solution[i]); } /* Record the best real-valued solution and compute a simple MIP solution limit */ if(target == NULL) { if(is_infinite(lp, lp->real_solution)) { lp->bb_workOF = lp->rhs[0]; lp->real_solution = solution[0]; if(is_infinite(lp, lp->bb_limitOF)) lp->bb_limitOF = lp->real_solution; else { if(is_maxim(lp)) { SETMIN(lp->bb_limitOF, lp->real_solution); } else { SETMAX(lp->bb_limitOF, lp->real_solution); } } /* Do MIP-related tests and computations */ if((lp->int_vars > 0) && mat_validate(lp->matA) /* && !lp->wasPresolved */) { /* && !lp->wasPresolved uncommented by findings of William H. Patton. The code was never executed when the test was there. The code has effect in an integer model with all integer objective coeff. to cut-off optimization and thus make it faster */ REAL fixedOF = unscaled_value(lp, lp->orig_rhs[0], 0); /* Check if we have an all-integer OF */ basi = lp->columns; for(j = 1; j <= basi; j++) { f = fabs(get_mat(lp, 0, j)) + lp->epsint / 2; if(f > lp->epsint) { /* If coefficient is 0 then it doesn't influence OF, even it variable is not integer */ if(!is_int(lp, j) || (fmod(f, 1) > lp->epsint)) break; } } /* If so, we can round up the fractional OF */ if(j > basi) { f = my_chsign(is_maxim(lp), lp->real_solution) + fixedOF; f = floor(f+(1-epsvalue)); f = my_chsign(is_maxim(lp), f - fixedOF); if(is_infinite(lp, lp->bb_limitOF)) lp->bb_limitOF = f; else if(is_maxim(lp)) { SETMIN(lp->bb_limitOF, f); } else { SETMAX(lp->bb_limitOF, f); } } } /* Check that a user limit on the OF is feasible */ if((lp->int_vars > 0) && (my_chsign(is_maxim(lp), my_reldiff(lp->best_solution[0],lp->bb_limitOF)) < -epsvalue)) { lp->spx_status = INFEASIBLE; lp->bb_break = TRUE; } } } } /* construct_solution */ STATIC int check_solution(lprec *lp, int lastcolumn, REAL *solution, REAL *upbo, REAL *lowbo, REAL tolerance) { /*#define UseMaxValueInCheck*/ MYBOOL isSC; REAL test, value, hold, diff, maxdiff = 0.0, maxerr = 0.0, *matValue, #ifdef UseMaxValueInCheck *maxvalue = NULL, #else *plusum = NULL, *negsum = NULL; #endif int i,j,n, errlevel = IMPORTANT, errlimit = 10, *matRownr, *matColnr; MATrec *mat = lp->matA; report(lp, NORMAL, " \n"); if(MIP_count(lp) > 0) report(lp, NORMAL, "%s solution " RESULTVALUEMASK " after %10.0f iter, %9.0f nodes (gap %.1f%%).\n", my_if(lp->bb_break && !bb_better(lp, OF_DUALLIMIT, OF_TEST_BE) && bb_better(lp, OF_RELAXED, OF_TEST_NE), "Subopt.", "Optimal"), solution[0], (double) lp->total_iter, (double) lp->bb_totalnodes, 100.0*fabs(my_reldiff(lp->solution[0], lp->bb_limitOF))); else report(lp, NORMAL, "Optimal solution " RESULTVALUEMASK " after %10.0f iter.\n", solution[0], (double) lp->total_iter); /* Find the signed sums and the largest absolute product in the matrix (exclude the OF for speed) */ #ifdef UseMaxValueInCheck allocREAL(lp, &maxvalue, lp->rows + 1, FALSE); for(i = 0; i <= lp->rows; i++) maxvalue[i] = fabs(get_rh(lp, i)); #else allocREAL(lp, &plusum, lp->rows + 1, TRUE); allocREAL(lp, &negsum, lp->rows + 1, TRUE); #endif n = get_nonzeros(lp); matRownr = &COL_MAT_ROWNR(0); matColnr = &COL_MAT_COLNR(0); matValue = &COL_MAT_VALUE(0); for(i = 0; i < n; i++, matRownr += matRowColStep, matColnr += matRowColStep, matValue += matValueStep) { test = unscaled_mat(lp, *matValue, *matRownr, *matColnr); test *= solution[lp->rows + (*matColnr)]; #ifdef UseMaxValueInCheck test = fabs(test); if(test > maxvalue[*matRownr]) maxvalue[*matRownr] = test; #else if(test > 0) plusum[*matRownr] += test; else negsum[*matRownr] += test; #endif } /* Check if solution values are within the bounds; allowing a margin for numeric errors */ n = 0; for(i = lp->rows + 1; i <= lp->rows+lastcolumn; i++) { value = solution[i]; /* Check for case where we are testing an intermediate solution (variables shifted to the origin) */ if(lowbo == NULL) test = 0; else test = unscaled_value(lp, lowbo[i], i); isSC = is_semicont(lp, i - lp->rows); diff = my_reldiff(value, test); if(diff < 0) { if(isSC && (value < test/2)) test = 0; SETMAX(maxerr, fabs(value-test)); SETMAX(maxdiff, fabs(diff)); } if((diff < -tolerance) && !isSC) { if(n < errlimit) report(lp, errlevel, "check_solution: Variable %s = " RESULTVALUEMASK " is below its lower bound " RESULTVALUEMASK "\n", get_col_name(lp, i-lp->rows), value, test); n++; } test = unscaled_value(lp, upbo[i], i); diff = my_reldiff(value, test); if(diff > 0) { SETMAX(maxerr, fabs(value-test)); SETMAX(maxdiff, fabs(diff)); } if(diff > tolerance) { if(n < errlimit) report(lp, errlevel, "check_solution: Variable %s = " RESULTVALUEMASK " is above its upper bound " RESULTVALUEMASK "\n", get_col_name(lp, i-lp->rows), value, test); n++; } } /* Check if constraint values are within the bounds; allowing a margin for numeric errors */ for(i = 1; i <= lp->rows; i++) { test = lp->orig_rhs[i]; if(is_infinite(lp, test)) continue; #ifdef LegacySlackDefinition j = lp->presolve_undo->var_to_orig[i]; if(j != 0) { if(is_infinite(lp, lp->presolve_undo->fixed_rhs[j])) continue; test += lp->presolve_undo->fixed_rhs[j]; } #endif if(is_chsign(lp, i)) { test = my_flipsign(test); test += fabs(upbo[i]); } value = solution[i]; test = unscaled_value(lp, test, i); #ifndef LegacySlackDefinition value += test; #endif /* diff = my_reldiff(value, test); */ #ifdef UseMaxValueInCheck hold = maxvalue[i]; #else hold = plusum[i] - negsum[i]; #endif if(hold < lp->epsvalue) hold = 1; diff = my_reldiff((value+1)/hold, (test+1)/hold); if(diff > 0) { SETMAX(maxerr, fabs(value-test)); SETMAX(maxdiff, fabs(diff)); } if(diff > tolerance) { if(n < errlimit) report(lp, errlevel, "check_solution: Constraint %s = " RESULTVALUEMASK " is above its %s " RESULTVALUEMASK "\n", get_row_name(lp, i), value, (is_constr_type(lp, i, EQ) ? "equality of" : "upper bound"), test); n++; } test = lp->orig_rhs[i]; #ifdef LegacySlackDefinition j = lp->presolve_undo->var_to_orig[i]; if(j != 0) { if(is_infinite(lp, lp->presolve_undo->fixed_rhs[j])) continue; test += lp->presolve_undo->fixed_rhs[j]; } #endif value = solution[i]; if(is_chsign(lp, i)) test = my_flipsign(test); else { if(is_infinite(lp, upbo[i])) continue; test -= fabs(upbo[i]); #ifndef LegacySlackDefinition value = fabs(upbo[i]) - value; #endif } test = unscaled_value(lp, test, i); #ifndef LegacySlackDefinition value += test; #endif /* diff = my_reldiff(value, test); */ #ifdef UseMaxValueInCheck hold = maxvalue[i]; #else hold = plusum[i] - negsum[i]; #endif if(hold < lp->epsvalue) hold = 1; diff = my_reldiff((value+1)/hold, (test+1)/hold); if(diff < 0) { SETMAX(maxerr, fabs(value-test)); SETMAX(maxdiff, fabs(diff)); } if(diff < -tolerance) { if(n < errlimit) report(lp, errlevel, "check_solution: Constraint %s = " RESULTVALUEMASK " is below its %s " RESULTVALUEMASK "\n", get_row_name(lp, i), value, (is_constr_type(lp, i, EQ) ? "equality of" : "lower bound"), test); n++; } } #ifdef UseMaxValueInCheck FREE(maxvalue); #else FREE(plusum); FREE(negsum); #endif if(n > 0) { report(lp, IMPORTANT, "\nSeriously low accuracy found ||*|| = %g (rel. error %g)\n", maxerr, maxdiff); return(NUMFAILURE); } else { if(maxerr > 1.0e-7) report(lp, NORMAL, "\nMarginal numeric accuracy ||*|| = %g (rel. error %g)\n", maxerr, maxdiff); else if(maxerr > 1.0e-9) report(lp, NORMAL, "\nReasonable numeric accuracy ||*|| = %g (rel. error %g)\n", maxerr, maxdiff); else if(maxerr > 1.0e11) report(lp, NORMAL, "\nVery good numeric accuracy ||*|| = %g\n", maxerr); else report(lp, NORMAL, "\nExcellent numeric accuracy ||*|| = %g\n", maxerr); return(OPTIMAL); } } /* check_solution */ STATIC void transfer_solution_var(lprec *lp, int uservar) { if(lp->varmap_locked && (MYBOOL) ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE)) { uservar += lp->rows; lp->full_solution[lp->presolve_undo->orig_rows + lp->presolve_undo->var_to_orig[uservar]] = lp->best_solution[uservar]; } } STATIC void transfer_solution(lprec *lp, MYBOOL dofinal) { int i, ii; MEMCOPY(lp->best_solution, lp->solution, lp->sum + 1); /* Round integer solution values to actual integers */ if(is_integerscaling(lp) && (lp->int_vars > 0)) for(i = 1; i <= lp->columns; i++) { if(is_int(lp, i)) { ii = lp->rows + i; lp->best_solution[ii] = floor(lp->best_solution[ii] + 0.5); } } /* Transfer to full solution vector in the case of presolved eliminations */ if(dofinal && lp->varmap_locked && (MYBOOL) ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE)) { presolveundorec *psundo = lp->presolve_undo; lp->full_solution[0] = lp->best_solution[0]; for(i = 1; i <= lp->rows; i++) { ii = psundo->var_to_orig[i]; #ifdef Paranoia if((ii < 0) || (ii > lp->presolve_undo->orig_rows)) report(lp, SEVERE, "transfer_solution: Invalid mapping of row index %d to original index '%d'\n", i, ii); #endif lp->full_solution[ii] = lp->best_solution[i]; } for(i = 1; i <= lp->columns; i++) { ii = psundo->var_to_orig[lp->rows+i]; #ifdef Paranoia if((ii < 0) || (ii > lp->presolve_undo->orig_columns)) report(lp, SEVERE, "transfer_solution: Invalid mapping of column index %d to original index '%d'\n", i, ii); #endif lp->full_solution[psundo->orig_rows+ii] = lp->best_solution[lp->rows+i]; } } } STATIC MYBOOL construct_duals(lprec *lp) { int i, n, *coltarget; REAL scale0, value, dualOF; if(lp->duals != NULL) free_duals(lp); if(is_action(lp->spx_action, ACTION_REBASE) || is_action(lp->spx_action, ACTION_REINVERT) || (!lp->basis_valid) || !allocREAL(lp, &(lp->duals), lp->sum + 1, AUTOMATIC)) return(FALSE); /* Initialize */ coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->columns+1, sizeof(*coltarget)); if(!get_colIndexA(lp, SCAN_USERVARS+USE_NONBASICVARS, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } bsolve(lp, 0, lp->duals, NULL, lp->epsmachine*DOUBLEROUND, 1.0); prod_xA(lp, coltarget, lp->duals, NULL, lp->epsmachine, 1.0, lp->duals, NULL, MAT_ROUNDDEFAULT | MAT_ROUNDRC); mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); /* The (Lagrangean) dual values are the reduced costs of the primal slacks; when the slack is at its upper bound, change the sign. */ n = lp->rows; for(i = 1; i <= n; i++) { if(lp->is_basic[i]) lp->duals[i] = 0; /* Added a test if variable is different from 0 because sometime you get -0 and this is different from 0 on for example INTEL processors (ie 0 != -0 on INTEL !) PN */ else if((is_chsign(lp, 0) == is_chsign(lp, i)) && lp->duals[i]) lp->duals[i] = my_flipsign(lp->duals[i]); } if(is_maxim(lp)) { n = lp->sum; for(i = lp->rows + 1; i <= n; i++) lp->duals[i] = my_flipsign(lp->duals[i]); } /* If we presolved, then reconstruct the duals */ n = lp->presolve_undo->orig_sum; if(((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE) && allocREAL(lp, &(lp->full_duals), n + 1, TRUE)) { int ix, ii = lp->presolve_undo->orig_rows; n = lp->sum; for(ix = 1; ix <= n; ix++) { i = lp->presolve_undo->var_to_orig[ix]; if(ix > lp->rows) i += ii; #ifdef Paranoia /* Check for index out of range due to presolve */ if(i > lp->presolve_undo->orig_sum) report(lp, SEVERE, "construct_duals: Invalid presolve variable mapping found\n"); #endif lp->full_duals[i] = lp->duals[ix]; } presolve_rebuildUndo(lp, FALSE); } /* Calculate the dual OF and do scaling adjustments to the duals */ if(lp->scaling_used) scale0 = lp->scalars[0]; else scale0 = 1; dualOF = my_chsign(is_maxim(lp), lp->orig_rhs[0]) / scale0; for(i = 1; i <= lp->sum; i++) { value = scaled_value(lp, lp->duals[i] / scale0, i); my_roundzero(value, lp->epsprimal); lp->duals[i] = value; if(i <= lp->rows) dualOF += value * lp->solution[i]; } #if 0 /* See if we can make use of the dual OF; note that we do not currently adjust properly for presolve */ if(lp->rows == lp->presolve_undo->orig_rows) if(MIP_count(lp) > 0) { if(is_maxim(lp)) { SETMIN(lp->bb_limitOF, dualOF); } else { SETMAX(lp->bb_limitOF, dualOF); } } else if(fabs(my_reldiff(dualOF, lp->solution[0])) > lp->epssolution) report(lp, IMPORTANT, "calculate_duals: Check for possible suboptimal solution!\n"); #endif return(TRUE); } /* construct_duals */ /* Calculate sensitivity duals */ STATIC MYBOOL construct_sensitivity_duals(lprec *lp) { int k,varnr, ok = TRUE; int *workINT = NULL; REAL *pcol,a,infinite,epsvalue,from,till,objfromvalue; /* one column of the matrix */ FREE(lp->objfromvalue); FREE(lp->dualsfrom); FREE(lp->dualstill); if(!allocREAL(lp, &pcol, lp->rows + 1, TRUE) || !allocREAL(lp, &lp->objfromvalue, lp->columns + 1, AUTOMATIC) || !allocREAL(lp, &lp->dualsfrom, lp->sum + 1, AUTOMATIC) || !allocREAL(lp, &lp->dualstill, lp->sum + 1, AUTOMATIC)) { FREE(pcol); FREE(lp->objfromvalue); FREE(lp->dualsfrom); FREE(lp->dualstill); ok = FALSE; } else { infinite=lp->infinite; epsvalue=lp->epsmachine; for(varnr=1; varnr<=lp->sum; varnr++) { from=infinite; till=infinite; objfromvalue=infinite; if (!lp->is_basic[varnr]) { if (!fsolve(lp, varnr, pcol, workINT, epsvalue, 1.0, FALSE)) { /* construct one column of the tableau */ ok = FALSE; break; } /* Search for the rows(s) which first result in further iterations */ for (k=1; k<=lp->rows; k++) { if (fabs(pcol[k])>epsvalue) { a = lp->rhs[k]/pcol[k]; if((varnr > lp->rows) && (fabs(lp->solution[varnr]) <= epsvalue) && (a < objfromvalue) && (a >= lp->lowbo[varnr])) objfromvalue = a; if ((a<=0.0) && (pcol[k]<0.0) && (-a=0.0) && (pcol[k]>0.0) && ( aupbo[lp->var_basic[k]] < infinite) { a = (REAL) ((lp->rhs[k]-lp->upbo[lp->var_basic[k]])/pcol[k]); if((varnr > lp->rows) && (fabs(lp->solution[varnr]) <= epsvalue) && (a < objfromvalue) && (a >= lp->lowbo[varnr])) objfromvalue = a; if ((a<=0.0) && (pcol[k]>0.0) && (-a=0.0) && (pcol[k]<0.0) && ( ais_lower[varnr]) { a=from; from=till; till=a; } if ((varnr<=lp->rows) && (!is_chsign(lp, varnr))) { a=from; from=till; till=a; } } if (from!=infinite) lp->dualsfrom[varnr]=lp->solution[varnr]-unscaled_value(lp, from, varnr); else lp->dualsfrom[varnr]=-infinite; if (till!=infinite) lp->dualstill[varnr]=lp->solution[varnr]+unscaled_value(lp, till, varnr); else lp->dualstill[varnr]=infinite; if (varnr > lp->rows) { if (objfromvalue != infinite) { if (!lp->is_lower[varnr]) objfromvalue = lp->upbo[varnr] - objfromvalue; if ((lp->upbo[varnr] < infinite) && (objfromvalue > lp->upbo[varnr])) objfromvalue = lp->upbo[varnr]; objfromvalue += lp->lowbo[varnr]; objfromvalue = unscaled_value(lp, objfromvalue, varnr); } else objfromvalue = -infinite; lp->objfromvalue[varnr - lp->rows] = objfromvalue; } } FREE(pcol); } return((MYBOOL) ok); } /* construct_sensitivity_duals */ /* Calculate sensitivity objective function */ STATIC MYBOOL construct_sensitivity_obj(lprec *lp) { int i, l, varnr, row_nr, ok = TRUE; REAL *OrigObj = NULL, *drow = NULL, *prow = NULL, sign, a, min1, min2, infinite, epsvalue, from, till; /* objective function */ FREE(lp->objfrom); FREE(lp->objtill); if(!allocREAL(lp, &drow, lp->sum + 1, TRUE) || !allocREAL(lp, &OrigObj, lp->columns + 1, FALSE) || !allocREAL(lp, &prow, lp->sum + 1, TRUE) || !allocREAL(lp, &lp->objfrom, lp->columns + 1, AUTOMATIC) || !allocREAL(lp, &lp->objtill, lp->columns + 1, AUTOMATIC)) { Abandon: FREE(drow); FREE(OrigObj); FREE(prow); FREE(lp->objfrom); FREE(lp->objtill); ok = FALSE; } else { int *coltarget; infinite=lp->infinite; epsvalue=lp->epsmachine; coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->columns+1, sizeof(*coltarget)); if(!get_colIndexA(lp, SCAN_USERVARS+USE_NONBASICVARS, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); goto Abandon; } bsolve(lp, 0, drow, NULL, epsvalue*DOUBLEROUND, 1.0); prod_xA(lp, coltarget, drow, NULL, epsvalue, 1.0, drow, NULL, MAT_ROUNDDEFAULT | MAT_ROUNDRC); /* original (unscaled) objective function */ get_row(lp, 0, OrigObj); for(i = 1; i <= lp->columns; i++) { from=-infinite; till= infinite; varnr = lp->rows + i; if(!lp->is_basic[varnr]) { /* only the coeff of the objective function of column i changes. */ a = unscaled_mat(lp, drow[varnr], 0, i); if(is_maxim(lp)) a = -a; if (lp->upbo[varnr] == 0.0) /* ignore, because this case doesn't results in further iterations */ ; else if((lp->is_lower[varnr] != 0) == (is_maxim(lp) == FALSE)) from = OrigObj[i] - a; /* less than this value gives further iterations */ else till = OrigObj[i] - a; /* bigger than this value gives further iterations */ } else { /* all the coeff of the objective function change. Search the minimal change needed for further iterations */ for(row_nr=1; (row_nr<=lp->rows) && (lp->var_basic[row_nr]!=varnr); row_nr++) /* Search on which row the variable exists in the basis */ ; if(row_nr<=lp->rows) { /* safety test; should always be found ... */ /* Construct one row of the tableau */ bsolve(lp, row_nr, prow, NULL, epsvalue*DOUBLEROUND, 1.0); prod_xA(lp, coltarget, prow, NULL, epsvalue, 1.0, prow, NULL, MAT_ROUNDDEFAULT); /* sign = my_chsign(is_chsign(lp, row_nr), -1); */ sign = my_chsign(lp->is_lower[row_nr], -1); min1=infinite; min2=infinite; for(l=1; l<=lp->sum; l++) /* search for the column(s) which first results in further iterations */ if ((!lp->is_basic[l]) && (lp->upbo[l]>0.0) && (fabs(prow[l])>epsvalue) && (drow[l]*(lp->is_lower[l] ? -1 : 1)is_lower[l] ? 1 : -1) < 0.0) { if(a < min1) min1 = a; } else { if(a < min2) min2 = a; } } if ((lp->is_lower[varnr] == 0) == (is_maxim(lp) == FALSE)) { a = min1; min1 = min2; min2 = a; } if (min1solution[varnr]; if (is_maxim(lp)) { if (a - lp->lowbo[varnr] < epsvalue) from = -infinite; /* if variable is at lower bound then decrementing objective coefficient will not result in extra iterations because it would only extra decrease the value, but since it is at its lower bound ... */ else if (lp->lowbo[varnr] + lp->upbo[varnr] - a < epsvalue) till = infinite; /* if variable is at upper bound then incrementing objective coefficient will not result in extra iterations because it would only extra increase the value, but since it is at its upper bound ... */ } else { if (a - lp->lowbo[varnr] < epsvalue) till = infinite; /* if variable is at lower bound then incrementing objective coefficient will not result in extra iterations because it would only extra decrease the value, but since it is at its lower bound ... */ else if (lp->lowbo[varnr] + lp->upbo[varnr] - a < epsvalue) from = -infinite; /* if variable is at upper bound then decrementing objective coefficient will not result in extra iterations because it would only extra increase the value, but since it is at its upper bound ... */ } } } lp->objfrom[i]=from; lp->objtill[i]=till; } mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); } FREE(prow); FREE(OrigObj); FREE(drow); return((MYBOOL) ok); } /* construct_sensitivity_obj */ STATIC MYBOOL refactRecent(lprec *lp) { int pivcount = lp->bfp_pivotcount(lp); if(pivcount == 0) return( AUTOMATIC ); else if (pivcount < 2*DEF_MAXPIVOTRETRY) return( TRUE ); else return( FALSE ); } STATIC MYBOOL check_if_less(lprec *lp, REAL x, REAL y, int variable) { if(y < x-scaled_value(lp, lp->epsint, variable)) { if(lp->bb_trace) report(lp, NORMAL, "check_if_less: Invalid new bound %g should be < %g for %s\n", x, y, get_col_name(lp, variable)); return(FALSE); } else return(TRUE); } /* Various basis utility routines */ STATIC int findNonBasicSlack(lprec *lp, MYBOOL *is_basic) { int i; for(i = lp->rows; i > 0; i--) if(!is_basic[i]) break; return( i ); } STATIC int findBasisPos(lprec *lp, int notint, int *var_basic) { int i; if(var_basic == NULL) var_basic = lp->var_basic; for(i = lp->rows; i > 0; i--) if(var_basic[i] == notint) break; return( i ); } STATIC void replaceBasisVar(lprec *lp, int rownr, int var, int *var_basic, MYBOOL *is_basic) { int out; out = var_basic[rownr]; var_basic[rownr] = var; is_basic[out] = FALSE; is_basic[var] = TRUE; } STATIC void free_duals(lprec *lp) { FREE(lp->duals); FREE(lp->full_duals); FREE(lp->dualsfrom); FREE(lp->dualstill); FREE(lp->objfromvalue); FREE(lp->objfrom); FREE(lp->objtill); } /* Transform RHS by adjusting for the bound state of variables; optionally rebase upper bound, and account for this in later calls */ STATIC void initialize_solution(lprec *lp, MYBOOL shiftbounds) { int i, k1, k2, *matRownr, colnr; LREAL theta; REAL value, *matValue, loB, upB; MATrec *mat = lp->matA; /* Set bounding status indicators */ if(lp->bb_bounds != NULL) { if(shiftbounds == INITSOL_SHIFTZERO) { if(lp->bb_bounds->UBzerobased) report(lp, SEVERE, "initialize_solution: The upper bounds are already zero-based at refactorization %d\n", lp->bfp_refactcount(lp, BFP_STAT_REFACT_TOTAL)); lp->bb_bounds->UBzerobased = TRUE; } else if(!lp->bb_bounds->UBzerobased) report(lp, SEVERE, "initialize_solution: The upper bounds are not zero-based at refactorization %d\n", lp->bfp_refactcount(lp, BFP_STAT_REFACT_TOTAL)); } /* Initialize the working RHS/basic variable solution vector */ i = is_action(lp->anti_degen, ANTIDEGEN_RHSPERTURB) && (lp->monitor != NULL) && lp->monitor->active; if(sizeof(*lp->rhs) == sizeof(*lp->orig_rhs) && !i) { MEMCOPY(lp->rhs, lp->orig_rhs, lp->rows+1); } else if(i) { lp->rhs[0] = lp->orig_rhs[0]; for(i = 1; i <= lp->rows; i++) { if(is_constr_type(lp, i, EQ)) theta = rand_uniform(lp, lp->epsvalue); else { theta = rand_uniform(lp, lp->epsperturb); /* if(lp->orig_upbo[i] < lp->infinite) lp->orig_upbo[i] += theta; */ } lp->rhs[i] = lp->orig_rhs[i] + theta; } } else for(i = 0; i <= lp->rows; i++) lp->rhs[i] = lp->orig_rhs[i]; /* Adjust active RHS for variables at their active upper/lower bounds */ for(i = 1; i <= lp->sum; i++) { upB = lp->upbo[i]; loB = lp->lowbo[i]; /* Shift to "ranged" upper bound, tantamount to defining zero-based variables */ if(shiftbounds == INITSOL_SHIFTZERO) { if((loB > -lp->infinite) && (upB < lp->infinite)) lp->upbo[i] -= loB; if(lp->upbo[i] < 0) report(lp, SEVERE, "initialize_solution: Invalid rebounding; variable %d at refact %d, iter %.0f\n", i, lp->bfp_refactcount(lp, BFP_STAT_REFACT_TOTAL), (double) get_total_iter(lp)); } /* Use "ranged" upper bounds */ else if(shiftbounds == INITSOL_USEZERO) { if((loB > -lp->infinite) && (upB < lp->infinite)) upB += loB; } /* Shift upper bound back to original value */ else if(shiftbounds == INITSOL_ORIGINAL) { if((loB > -lp->infinite) && (upB < lp->infinite)) { lp->upbo[i] += loB; upB += loB; } continue; } else report(lp, SEVERE, "initialize_solution: Invalid option value '%d'\n", shiftbounds); /* Set the applicable adjustment */ if(lp->is_lower[i]) theta = loB; else theta = upB; /* Check if we need to pass through the matrix; remember that basis variables are always lower-bounded */ if(theta == 0) continue; /* Do user and artificial variables */ if(i > lp->rows) { /* Get starting and ending indeces in the NZ vector */ colnr = i - lp->rows; k1 = mat->col_end[colnr - 1]; k2 = mat->col_end[colnr]; matRownr = &COL_MAT_ROWNR(k1); matValue = &COL_MAT_VALUE(k1); /* Get the objective as row 0, optionally adjusting the objective for phase 1 */ value = get_OF_active(lp, i, theta); lp->rhs[0] -= value; /* Do the normal case */ for(; k1 < k2; k1++, matRownr += matRowColStep, matValue += matValueStep) { lp->rhs[*matRownr] -= theta * (*matValue); } } /* Do slack variables (constraint "bounds")*/ else { lp->rhs[i] -= theta; } } /* Do final pass to get the maximum value */ i = idamax(lp->rows /* +1 */, lp->rhs, 1); lp->rhsmax = fabs(lp->rhs[i]); if(shiftbounds == INITSOL_SHIFTZERO) clear_action(&lp->spx_action, ACTION_REBASE); } /* This routine recomputes the basic variables using the full inverse */ STATIC void recompute_solution(lprec *lp, MYBOOL shiftbounds) { /* Compute RHS = b - A(n)*x(n) */ initialize_solution(lp, shiftbounds); /* Compute x(b) = Inv(B)*RHS (Ref. lp_solve inverse logic and Chvatal p. 121) */ lp->bfp_ftran_normal(lp, lp->rhs, NULL); if(!lp->obj_in_basis) { int i, ib, n = lp->rows; for(i = 1; i <= n; i++) { ib = lp->var_basic[i]; if(ib > n) lp->rhs[0] -= get_OF_active(lp, ib, lp->rhs[i]); } } /* Round the values (should not be greater than the factor used in bfp_pivotRHS) */ roundVector(lp->rhs, lp->rows, lp->epsvalue); clear_action(&lp->spx_action, ACTION_RECOMPUTE); } /* This routine compares an existing basic solution to a recomputed one; Note that the routine must provide for the possibility that the order of the basis variables can be changed by the inversion engine. */ STATIC int verify_solution(lprec *lp, MYBOOL reinvert, char *info) { int i, ii, n, *oldmap, *newmap, *refmap = NULL; REAL *oldrhs, err, errmax; allocINT(lp, &oldmap, lp->rows+1, FALSE); allocINT(lp, &newmap, lp->rows+1, FALSE); allocREAL(lp, &oldrhs, lp->rows+1, FALSE); /* Get sorted mapping of the old basis */ for(i = 0; i <= lp->rows; i++) oldmap[i] = i; if(reinvert) { allocINT(lp, &refmap, lp->rows+1, FALSE); MEMCOPY(refmap, lp->var_basic, lp->rows+1); sortByINT(oldmap, refmap, lp->rows, 1, TRUE); } /* Save old and calculate the new RHS vector */ MEMCOPY(oldrhs, lp->rhs, lp->rows+1); if(reinvert) invert(lp, INITSOL_USEZERO, FALSE); else recompute_solution(lp, INITSOL_USEZERO); /* Get sorted mapping of the new basis */ for(i = 0; i <= lp->rows; i++) newmap[i] = i; if(reinvert) { MEMCOPY(refmap, lp->var_basic, lp->rows+1); sortByINT(newmap, refmap, lp->rows, 1, TRUE); } /* Identify any gap */ errmax = 0; ii = -1; n = 0; for(i = lp->rows; i > 0; i--) { err = fabs(my_reldiff(oldrhs[oldmap[i]], lp->rhs[newmap[i]])); if(err > lp->epsprimal) { n++; if(err > errmax) { ii = i; errmax = err; } } } err = fabs(my_reldiff(oldrhs[i], lp->rhs[i])); if(err < lp->epspivot) { i--; err = 0; } else { n++; if(ii < 0) { ii = 0; errmax = err; } } if(n > 0) { report(lp, IMPORTANT, "verify_solution: Iter %.0f %s - %d errors; OF %g, Max @row %d %g\n", (double) get_total_iter(lp), my_if(info == NULL, "", info), n, err, newmap[ii], errmax); } /* Copy old results back (not possible for inversion) */ if(!reinvert) MEMCOPY(lp->rhs, oldrhs, lp->rows+1); FREE(oldmap); FREE(newmap); FREE(oldrhs); if(reinvert) FREE(refmap); return( ii ); } /* Preprocessing and postprocessing functions */ STATIC int identify_GUB(lprec *lp, MYBOOL mark) { int i, j, jb, je, k, knint, srh; REAL rh, mv, tv, bv; MATrec *mat = lp->matA; if((lp->equalities == 0) || !mat_validate(mat)) return( 0 ); k = 0; for(i = 1; i <= lp->rows; i++) { /* Check if it is an equality constraint */ if(!is_constr_type(lp, i, EQ)) continue; rh = get_rh(lp, i); srh = my_sign(rh); knint = 0; je = mat->row_end[i]; for(jb = mat->row_end[i-1]; jb < je; jb++) { j = ROW_MAT_COLNR(jb); /* Check for validity of the equation elements */ if(!is_int(lp, j)) knint++; if(knint > 1) break; mv = get_mat_byindex(lp, jb, TRUE, FALSE); if(fabs(my_reldiff(mv, rh)) > lp->epsprimal) break; tv = mv*get_upbo(lp, j); bv = get_lowbo(lp, j); #if 0 /* Requires 1 as upper bound */ if((fabs(my_reldiff(tv, rh)) > lp->epsprimal) || (bv != 0)) #else /* Can handle any upper bound >= 1 */ if((srh*(tv-rh) < -lp->epsprimal) || (bv != 0)) #endif break; } /* Update GUB count and optionally mark the GUB */ if(jb == je) { k++; if(mark == TRUE) lp->row_type[i] |= ROWTYPE_GUB; else if(mark == AUTOMATIC) break; } } return( k ); } STATIC int prepare_GUB(lprec *lp) { int i, j, jb, je, k, *members = NULL; REAL rh; char GUBname[16]; MATrec *mat = lp->matA; if((lp->equalities == 0) || !allocINT(lp, &members, lp->columns+1, TRUE) || !mat_validate(mat)) return( 0 ); for(i = 1; i <= lp->rows; i++) { /* Check if it has been marked as a GUB */ if(!(lp->row_type[i] & ROWTYPE_GUB)) continue; /* Pick up the GUB column indeces */ k = 0; je = mat->row_end[i]; for(jb = mat->row_end[i-1], k = 0; jb < je; jb++) { members[k] = ROW_MAT_COLNR(jb); k++; } /* Add the GUB */ j = GUB_count(lp) + 1; sprintf(GUBname, "GUB_%d", i); add_GUB(lp, GUBname, j, k, members); /* Unmark the GUBs */ clear_action(&(lp->row_type[i]), ROWTYPE_GUB); /* Standardize coefficients to 1 if necessary */ rh = get_rh(lp, i); if(fabs(my_reldiff(rh, 1)) > lp->epsprimal) { set_rh(lp, i, 1); for(jb = mat->row_end[i-1]; jb < je; jb++) { j = ROW_MAT_COLNR(jb); set_mat(lp, i,j, 1); } } } FREE(members); return(GUB_count(lp)); } /* Pre- and post processing functions, i.a. splitting free variables */ STATIC MYBOOL pre_MIPOBJ(lprec *lp) { #ifdef MIPboundWithOF if(MIP_count(lp) > 0) { int i = 1; while((i <= lp->rows) && !mat_equalRows(lp->matA, 0, i) && !is_constr_type(lp, i, EQ)) i++; if(i <= lp->rows) lp->constraintOF = i; } #endif lp->bb_deltaOF = MIP_stepOF(lp); return( TRUE ); } STATIC MYBOOL post_MIPOBJ(lprec *lp) { #ifdef MIPboundWithOF /* if(lp->constraintOF) { del_constraint(lp, lp->rows); if(is_BasisReady(lp) && !verify_basis(lp)) return( FALSE ); } */ #endif return( TRUE ); } int preprocess(lprec *lp) { int i, j, k, ok = TRUE, *new_index = NULL; REAL hold, *new_column = NULL; MYBOOL scaled, primal1, primal2; /* do not process if already preprocessed */ if(lp->wasPreprocessed) return( ok ); /* Write model statistics and optionally initialize partial pricing structures */ if(lp->lag_status != RUNNING) { MYBOOL doPP; /* Extract the user-specified simplex strategy choices */ primal1 = (MYBOOL) (lp->simplex_strategy & SIMPLEX_Phase1_PRIMAL); primal2 = (MYBOOL) (lp->simplex_strategy & SIMPLEX_Phase2_PRIMAL); /* Initialize partial pricing structures */ doPP = is_piv_mode(lp, PRICE_PARTIAL | PRICE_AUTOPARTIAL); /* doPP &= (MYBOOL) (lp->columns / 2 > lp->rows); */ if(doPP) { i = partial_findBlocks(lp, FALSE, FALSE); if(i < 4) i = (int) (5 * log((REAL) lp->columns / lp->rows)); report(lp, NORMAL, "The model is %s to have %d column blocks/stages.\n", (i > 1 ? "estimated" : "set"), i); set_partialprice(lp, i, NULL, FALSE); } /* doPP &= (MYBOOL) (lp->rows / 4 > lp->columns); */ if(doPP) { i = partial_findBlocks(lp, FALSE, TRUE); if(i < 4) i = (int) (5 * log((REAL) lp->rows / lp->columns)); report(lp, NORMAL, "The model is %s to have %d row blocks/stages.\n", (i > 1 ? "estimated" : "set"), i); set_partialprice(lp, i, NULL, TRUE); } /* Check for presence of valid pricing blocks if partial pricing is defined, but not autopartial is not set */ if(!doPP && is_piv_mode(lp, PRICE_PARTIAL)) { if((lp->rowblocks == NULL) || (lp->colblocks == NULL)) { report(lp, IMPORTANT, "Ignoring partial pricing, since block structures are not defined.\n"); clear_action(&lp->piv_strategy, PRICE_PARTIAL); } } /* Initialize multiple pricing block divisor */ #if 0 if(primal1 || primal2) lp->piv_strategy |= PRICE_MULTIPLE | PRICE_AUTOMULTIPLE; #endif if(is_piv_mode(lp, PRICE_MULTIPLE) && (primal1 || primal2)) { doPP = is_piv_mode(lp, PRICE_AUTOMULTIPLE); if(doPP) { i = (int) (2.5*log((REAL) lp->sum)); SETMAX( i, 1); set_multiprice(lp, i); } if(lp->multiblockdiv > 1) report(lp, NORMAL, "Using %d-candidate primal simplex multiple pricing block.\n", lp->columns / lp->multiblockdiv); } else set_multiprice(lp, 1); report(lp, NORMAL, "Using %s simplex for phase 1 and %s simplex for phase 2.\n", my_if(primal1, "PRIMAL", "DUAL"), my_if(primal2, "PRIMAL", "DUAL")); i = get_piv_rule(lp); if((i == PRICER_STEEPESTEDGE) && is_piv_mode(lp, PRICE_PRIMALFALLBACK)) report(lp, NORMAL, "The pricing strategy is set to '%s' for the dual and '%s' for the primal.\n", get_str_piv_rule(i), get_str_piv_rule(i-1)); else report(lp, NORMAL, "The primal and dual simplex pricing strategy set to '%s'.\n", get_str_piv_rule(i)); report(lp, NORMAL, " \n"); } /* Compute a minimum step improvement step requirement */ pre_MIPOBJ(lp); /* First create extra columns for FR variables or flip MI variables */ for (j = 1; j <= lp->columns; j++) { #ifdef Paranoia if((lp->rows != lp->matA->rows) || (lp->columns != lp->matA->columns)) report(lp, SEVERE, "preprocess: Inconsistent variable counts found\n"); #endif /* First handle sign-flipping of variables: 1) ... with a finite upper bound and a negative Inf-bound (since basis variables are lower-bounded) 2) ... with bound assymetry within negrange limits (for stability reasons) */ i = lp->rows + j; hold = lp->orig_upbo[i]; /* if((hold <= 0) || (!is_infinite(lp, lp->negrange) && (hold < -lp->negrange) && (lp->orig_lowbo[i] <= lp->negrange)) ) { */ #define fullybounded FALSE if( ((hold < lp->infinite) && my_infinite(lp, lp->orig_lowbo[i])) || (!fullybounded && !my_infinite(lp, lp->negrange) && (hold < -lp->negrange) && (lp->orig_lowbo[i] <= lp->negrange)) ) { /* Delete split sibling variable if one existed from before */ if((lp->var_is_free != NULL) && (lp->var_is_free[j] > 0)) del_column(lp, lp->var_is_free[j]); /* Negate the column / flip to the positive range */ mat_multcol(lp->matA, j, -1, TRUE); if(lp->var_is_free == NULL) { if(!allocINT(lp, &lp->var_is_free, MAX(lp->columns, lp->columns_alloc) + 1, TRUE)) return(FALSE); } lp->var_is_free[j] = -j; /* Indicator UB and LB are switched, with no helper variable added */ lp->orig_upbo[i] = my_flipsign(lp->orig_lowbo[i]); lp->orig_lowbo[i] = my_flipsign(hold); /* Check for presence of negative ranged SC variable */ if(lp->sc_lobound[j] > 0) { lp->sc_lobound[j] = lp->orig_lowbo[i]; lp->orig_lowbo[i] = 0; } } /* Then deal with -+, full-range/FREE variables by creating a helper variable */ else if((lp->orig_lowbo[i] <= lp->negrange) && (hold >= -lp->negrange)) { if(lp->var_is_free == NULL) { if(!allocINT(lp, &lp->var_is_free, MAX(lp->columns,lp->columns_alloc) + 1, TRUE)) return(FALSE); } if(lp->var_is_free[j] <= 0) { /* If this variable wasn't split yet ... */ if(SOS_is_member(lp->SOS, 0, i - lp->rows)) { /* Added */ report(lp, IMPORTANT, "preprocess: Converted negative bound for SOS variable %d to zero", i - lp->rows); lp->orig_lowbo[i] = 0; continue; } if(new_column == NULL) { if(!allocREAL(lp, &new_column, lp->rows + 1, FALSE) || !allocINT(lp, &new_index, lp->rows + 1, FALSE)) { ok = FALSE; break; } } /* Avoid precision loss by turning off unscaling and rescaling */ /* in get_column and add_column operations; also make sure that */ /* full scaling information is preserved */ scaled = lp->scaling_used; lp->scaling_used = FALSE; k = get_columnex(lp, j, new_column, new_index); if(!add_columnex(lp, k, new_column, new_index)) { ok = FALSE; break; } mat_multcol(lp->matA, lp->columns, -1, TRUE); if(scaled) lp->scalars[lp->rows+lp->columns] = lp->scalars[i]; lp->scaling_used = (MYBOOL) scaled; /* Only create name if we are not clearing a pre-used item, since this variable could have been deleted by presolve but the name is required for solution reconstruction. */ if(lp->names_used && (lp->col_name[j] == NULL)) { char fieldn[50]; sprintf(fieldn, "__AntiBodyOf(%d)__", j); if(!set_col_name(lp, lp->columns, fieldn)) { /* if (!set_col_name(lp, lp->columns, get_col_name(lp, j))) { */ ok = FALSE; break; } } /* Set (positive) index to the original column's split / helper and back */ lp->var_is_free[j] = lp->columns; } lp->orig_upbo[lp->rows + lp->var_is_free[j]] = my_flipsign(lp->orig_lowbo[i]); lp->orig_lowbo[i] = 0; /* Negative index indicates x is split var and -var_is_free[x] is index of orig var */ lp->var_is_free[lp->var_is_free[j]] = -j; lp->var_type[lp->var_is_free[j]] = lp->var_type[j]; } /* Check for positive ranged SC variables */ else if(lp->sc_lobound[j] > 0) { lp->sc_lobound[j] = lp->orig_lowbo[i]; lp->orig_lowbo[i] = 0; } /* Tally integer variables in SOS'es */ if(SOS_is_member(lp->SOS, 0, j) && is_int(lp, j)) lp->sos_ints++; } FREE(new_column); FREE(new_index); /* Fill lists of GUB constraints, if appropriate */ if((MIP_count(lp) > 0) && is_bb_mode(lp, NODE_GUBMODE) && (identify_GUB(lp, AUTOMATIC) > 0)) prepare_GUB(lp); /* (Re)allocate reduced cost arrays */ ok = allocREAL(lp, &(lp->drow), lp->sum+1, AUTOMATIC) && allocINT(lp, &(lp->nzdrow), lp->sum+1, AUTOMATIC); if(ok) lp->nzdrow[0] = 0; /* Minimize memory usage */ memopt_lp(lp, 0, 0, 0); lp->wasPreprocessed = TRUE; return(ok); } void postprocess(lprec *lp) { int i,ii,j; REAL hold; /* Check if the problem actually was preprocessed */ if(!lp->wasPreprocessed) return; /* Must compute duals here in case we have free variables; note that in this case sensitivity analysis is not possible unless done here */ if((MIP_count(lp) == 0) && (is_presolve(lp, PRESOLVE_DUALS) || (lp->var_is_free != NULL))) construct_duals(lp); if(is_presolve(lp, PRESOLVE_SENSDUALS)) { if(!construct_sensitivity_duals(lp) || !construct_sensitivity_obj(lp)) report(lp, IMPORTANT, "postprocess: Unable to allocate working memory for duals.\n"); } /* Loop over all columns */ for (j = 1; j <= lp->columns; j++) { i = lp->rows + j; /* Reconstruct strictly negative values */ if((lp->var_is_free != NULL) && (lp->var_is_free[j] < 0)) { /* Check if we have the simple case where the UP and LB are negated and switched */ if(-lp->var_is_free[j] == j) { mat_multcol(lp->matA, j, -1, TRUE); hold = lp->orig_upbo[i]; lp->orig_upbo[i] = my_flipsign(lp->orig_lowbo[i]); lp->orig_lowbo[i] = my_flipsign(hold); lp->best_solution[i] = my_flipsign(lp->best_solution[i]); transfer_solution_var(lp, j); /* hold = lp->objfrom[j]; lp->objfrom[j] = my_flipsign(lp->objtill[j]); lp->objtill[j] = my_flipsign(hold); */ /* under investigation */ /* lp->duals[i] = my_flipsign(lp->duals[i]); hold = lp->dualsfrom[i]; lp->dualsfrom[i] = my_flipsign(lp->dualstill[i]); lp->dualstill[i] = my_flipsign(hold); */ /* under investigation */ /* Bound switch undone, so clear the status */ lp->var_is_free[j] = 0; /* Adjust negative ranged SC */ if(lp->sc_lobound[j] > 0) lp->orig_lowbo[lp->rows + j] = -lp->sc_lobound[j]; } /* Ignore the split / helper columns (will be deleted later) */ } /* Condense values of extra columns of quasi-free variables split in two */ else if((lp->var_is_free != NULL) && (lp->var_is_free[j] > 0)) { ii = lp->var_is_free[j]; /* Index of the split helper var */ /* if(lp->objfrom[j] == -lp->infinite) lp->objfrom[j] = -lp->objtill[ii]; lp->objtill[ii] = lp->infinite; if(lp->objtill[j] == lp->infinite) lp->objtill[j] = my_flipsign(lp->objfrom[ii]); lp->objfrom[ii] = -lp->infinite; */ /* under investigation */ ii += lp->rows; lp->best_solution[i] -= lp->best_solution[ii]; /* join the solution again */ transfer_solution_var(lp, j); lp->best_solution[ii] = 0; /* if(lp->duals[i] == 0) lp->duals[i] = my_flipsign(lp->duals[ii]); lp->duals[ii] = 0; if(lp->dualsfrom[i] == -lp->infinite) lp->dualsfrom[i] = my_flipsign(lp->dualstill[ii]); lp->dualstill[ii] = lp->infinite; if(lp->dualstill[i] == lp->infinite) lp->dualstill[i] = my_flipsign(lp->dualsfrom[ii]); lp->dualsfrom[ii] = -lp->infinite; */ /* under investigation */ /* Reset to original bound */ lp->orig_lowbo[i] = my_flipsign(lp->orig_upbo[ii]); } /* Adjust for semi-continuous variables */ else if(lp->sc_lobound[j] > 0) { lp->orig_lowbo[i] = lp->sc_lobound[j]; } } /* Remove any split column helper variables */ del_splitvars(lp); post_MIPOBJ(lp); /* Do extended reporting, if specified */ if(lp->verbose > NORMAL) { REPORT_extended(lp); } lp->wasPreprocessed = FALSE; } lp_solve_5.5/lp_lib.h100666 0 0 351140 11245551461 13221 0ustar usergroup #ifndef HEADER_lp_lib #define HEADER_lp_lib /* -------------------------------------------------------------------------- This is the main library header file for the lp_solve v5.0 release Starting at version 3.0, LP_Solve is released under the LGPL license. For full information, see the enclosed file LGPL.txt. Original developer: Michel Berkelaar - michel@ics.ele.tue.nl Most changes 1.5-2.0: Jeroen Dirks - jeroend@tor.numetrix.com Changes 3.2-4.0: Kjell Eikland - kjell.eikland@broadpark.no (Simplex code, SOS, SC, code optimization) Peter Notebaert - lpsolve@peno.be (Sensitivity analysis, documentation) Changes 5.0+: Kjell Eikland - kjell.eikland@broadpark.no (BFP, XLI, simplex, B&B, code modularization) Peter Notebaert - lpsolve@peno.be (Sensitivity analysis, New lp parser, LINDO (XLI) parser, VB/.NET interface, documentation) Release notes: Version 4.0 enhances version 3.2 in terms of internal program/simplex architecture, call level interfaces, data layout, features and contains several bug fixes. There is now complete support for semi-continuous variables and SOS constructions. In the process, a complete API was added. The MPS parser has been amended to support this. Sensitivity analysis and variouse bug fixes was provided by Peter Notebaert in 4.0 sub-releases. Peter also wrote a complete documentation of the API and contributed a VB interface, both of which significantly enhanced the accessibility of lp_solve. Version 5.0 is a major rewrite and code cleanup. The main additions that drove forward this cleanup were the modular inversion logic with optimal column ordering, addition of primal phase 1 and dual phase 2 logic for full flexibility in the selection of primal and dual simplex modes, DEVEX and steepest edge pivot selection, along with dynamic cycling detection and prevention. This cleanup made it possible to harmonize the internal rounding principles, contributing to increased numerical stability. Version 5.1 rearranges the matrix storage model by enabling both legacy element record-based storage and split vector storage. In addition the lprec structure is optimized and additional routines are added, mainly for sparse vector additions and enhanced XLI functionality. Support for XML- based models was added on the basis of the LPFML schema via xli_LPFML. Version 5.2 removes the objective function from the constraint matrix, adds a number of presolve options and speed them up. Degeneracy handling is significantly improved. Support for XLI_ZIMPL was added. Multiple and partial pricing has been enhanced and activated. -------------------------------------------------------------------------- */ /* Define user program feature option switches */ /* ------------------------------------------------------------------------- */ # if defined _WIN32 && !defined __GNUC__ # define isnan _isnan # endif #if defined NOISNAN # define isnan(x) FALSE #endif #define SETMASK(variable, mask) variable |= mask #define CLEARMASK(variable, mask) variable &= ~(mask) #define TOGGLEMASK(variable, mask) variable ^= mask #define ISMASKSET(variable, mask) (MYBOOL) (((variable) & (mask)) != 0) /* Utility/system settings */ /* ------------------------------------------------------------------------- */ /*#define INTEGERTIME */ /* Set use of lower-resolution timer */ /* New v5.0+ simplex/optimization features and settings */ /* ------------------------------------------------------------------------- */ /*#define NoRowScaleOF */ /* Optionally skip row-scaling of the OF */ #define DoMatrixRounding /* Round A matrix elements to precision */ #define DoBorderRounding /* Round RHS, bounds and ranges to precision */ #define Phase1EliminateRedundant /* Remove rows of redundant artificials */ #define FixViolatedOptimal #define ImproveSolutionPrecision /* Round optimal solution values */ /*#define IncreasePivotOnReducedAccuracy */ /* Increase epspivot on instability */ /*#define FixInaccurateDualMinit */ /* Reinvert on inaccuracy in dual minits */ /*#define EnforcePositiveTheta */ /* Ensure that the theta range is valid */ #define ResetMinitOnReinvert /*#define UsePrimalReducedCostUpdate */ /* Not tested */ /*#define UseDualReducedCostUpdate */ /* Seems Ok, but slower than expected */ /*#ifdef UseLegacyExtrad */ /* Use v3.2- style Extrad method */ #define UseMilpExpandedRCF /* Non-ints in reduced cost bound tightening */ /*#define UseMilpSlacksRCF */ /* Slacks in reduced cost bound tightening (degen prone); requires !SlackInitMinusInf */ #define LegacySlackDefinition /* Slack as the "value of the constraint" */ /* Development features (change at own risk) */ /* ------------------------------------------------------------------------- */ /*#define MIPboundWithOF */ /* Enable to detect OF constraint for use during B&B */ /*#define SlackInitMinusInf */ /* Slacks have 0 LB if this is not defined */ #define FULLYBOUNDEDSIMPLEX FALSE /* WARNING: Activate at your own risk! */ /* Specify use of the basic linear algebra subroutine library */ /* ------------------------------------------------------------------------- */ #define libBLAS 2 /* 0: No, 1: Internal, 2: External */ #define libnameBLAS "myBLAS" /* Active inverse logic (default is optimized original etaPFI) */ /* ------------------------------------------------------------------------- */ #if !defined LoadInverseLib # define LoadInverseLib TRUE /* Enable alternate inverse libraries */ #endif /*#define ExcludeNativeInverse */ /* Disable INVERSE_ACTIVE inverse engine */ #define DEF_OBJINBASIS TRUE /* Additional rows inserted at the top (1 => OF) */ #define INVERSE_NONE -1 #define INVERSE_LEGACY 0 #define INVERSE_ETAPFI 1 #define INVERSE_LUMOD 2 #define INVERSE_LUSOL 3 #define INVERSE_GLPKLU 4 #ifndef RoleIsExternalInvEngine /* Defined in inverse DLL drivers */ #ifdef ExcludeNativeInverse #define INVERSE_ACTIVE INVERSE_NONE /* Disable native engine */ #else #define INVERSE_ACTIVE INVERSE_LEGACY /* User or DLL-selected */ #endif #endif /* Active external language interface logic (default is none) */ /* ------------------------------------------------------------------------- */ #if !defined LoadLanguageLib # define LoadLanguageLib TRUE /* Enable alternate language libraries */ #endif #define ExcludeNativeLanguage /* Disable LANGUAGE_ACTIVE XLI */ #define LANGUAGE_NONE -1 #define LANGUAGE_LEGACYLP 0 #define LANGUAGE_CPLEXLP 1 #define LANGUAGE_MPSX 2 #define LANGUAGE_LPFML 3 #define LANGUAGE_MATHPROG 4 #define LANGUAGE_AMPL 5 #define LANGUAGE_GAMS 6 #define LANGUAGE_ZIMPL 7 #define LANGUAGE_S 8 #define LANGUAGE_R 9 #define LANGUAGE_MATLAB 10 #define LANGUAGE_OMATRIX 11 #define LANGUAGE_SCILAB 12 #define LANGUAGE_OCTAVE 13 #define LANGUAGE_EMPS 14 #ifndef RoleIsExternalLanguageEngine /* Defined in XLI driver libraries */ #ifdef ExcludeNativeLanguage #define LANGUAGE_ACTIVE LANGUAGE_NONE /* Disable native engine */ #else #define LANGUAGE_ACTIVE LANGUAGE_CPLEXLP /* User or DLL-selected */ #endif #endif /* Default parameters and tolerances */ /* ------------------------------------------------------------------------- */ #define OriginalPARAM 0 #define ProductionPARAM 1 #define ChvatalPARAM 2 #define LoosePARAM 3 #if 1 #define ActivePARAM ProductionPARAM #else #define ActivePARAM LoosePARAM #endif /* Miscellaneous settings */ /* ------------------------------------------------------------------------- */ #ifndef Paranoia #ifdef _DEBUG #define Paranoia #endif #endif /* Program version data */ /* ------------------------------------------------------------------------- */ #define MAJORVERSION 5 #define MINORVERSION 5 #define RELEASE 0 #define BUILD 15 #define BFPVERSION 12 /* Checked against bfp_compatible() */ #define XLIVERSION 12 /* Checked against xli_compatible() */ /* Note that both BFPVERSION and XLIVERSION typically have to be incremented in the case that the lprec structure changes. */ /* Include/header files */ /* ------------------------------------------------------------------------- */ #include #include #include #include #include #include "lp_types.h" #include "lp_utils.h" #if (LoadInverseLib == TRUE) || (LoadLanguageLib == TRUE) #ifdef WIN32 #include #else #include #endif #endif #ifndef BFP_CALLMODEL #ifdef WIN32 #define BFP_CALLMODEL __stdcall /* "Standard" call model */ #else #define BFP_CALLMODEL #endif #endif #ifndef XLI_CALLMODEL #define XLI_CALLMODEL BFP_CALLMODEL #endif #define REGISTER register /* Speed up certain operations */ /* Definition of program constrants */ /* ------------------------------------------------------------------------- */ #define SIMPLEX_UNDEFINED 0 #define SIMPLEX_Phase1_PRIMAL 1 #define SIMPLEX_Phase1_DUAL 2 #define SIMPLEX_Phase2_PRIMAL 4 #define SIMPLEX_Phase2_DUAL 8 #define SIMPLEX_DYNAMIC 16 #define SIMPLEX_AUTODUALIZE 32 #define SIMPLEX_PRIMAL_PRIMAL (SIMPLEX_Phase1_PRIMAL + SIMPLEX_Phase2_PRIMAL) #define SIMPLEX_DUAL_PRIMAL (SIMPLEX_Phase1_DUAL + SIMPLEX_Phase2_PRIMAL) #define SIMPLEX_PRIMAL_DUAL (SIMPLEX_Phase1_PRIMAL + SIMPLEX_Phase2_DUAL) #define SIMPLEX_DUAL_DUAL (SIMPLEX_Phase1_DUAL + SIMPLEX_Phase2_DUAL) #define SIMPLEX_DEFAULT (SIMPLEX_DUAL_PRIMAL) /* Variable codes (internal) */ #define ISREAL 0 #define ISINTEGER 1 #define ISSEMI 2 #define ISSOS 4 #define ISSOSTEMPINT 8 #define ISGUB 16 /* Presolve defines */ #define PRESOLVE_NONE 0 #define PRESOLVE_ROWS 1 #define PRESOLVE_COLS 2 #define PRESOLVE_LINDEP 4 #define PRESOLVE_AGGREGATE 8 /* Not implemented */ #define PRESOLVE_SPARSER 16 /* Not implemented */ #define PRESOLVE_SOS 32 #define PRESOLVE_REDUCEMIP 64 #define PRESOLVE_KNAPSACK 128 /* Implementation not tested completely */ #define PRESOLVE_ELIMEQ2 256 #define PRESOLVE_IMPLIEDFREE 512 #define PRESOLVE_REDUCEGCD 1024 #define PRESOLVE_PROBEFIX 2048 #define PRESOLVE_PROBEREDUCE 4096 #define PRESOLVE_ROWDOMINATE 8192 #define PRESOLVE_COLDOMINATE 16384 /* Reduced functionality, should be expanded */ #define PRESOLVE_MERGEROWS 32768 #define PRESOLVE_IMPLIEDSLK 65536 #define PRESOLVE_COLFIXDUAL 131072 #define PRESOLVE_BOUNDS 262144 #define PRESOLVE_LASTMASKMODE (PRESOLVE_DUALS - 1) #define PRESOLVE_DUALS 524288 #define PRESOLVE_SENSDUALS 1048576 /* Basis crash options */ #define CRASH_NONE 0 #define CRASH_NONBASICBOUNDS 1 #define CRASH_MOSTFEASIBLE 2 #define CRASH_LEASTDEGENERATE 3 /* Solution recomputation options (internal) */ #define INITSOL_SHIFTZERO 0 #define INITSOL_USEZERO 1 #define INITSOL_ORIGINAL 2 /* Strategy codes to avoid or recover from degenerate pivots, infeasibility or numeric errors via randomized bound relaxation */ #define ANTIDEGEN_NONE 0 #define ANTIDEGEN_FIXEDVARS 1 #define ANTIDEGEN_COLUMNCHECK 2 #define ANTIDEGEN_STALLING 4 #define ANTIDEGEN_NUMFAILURE 8 #define ANTIDEGEN_LOSTFEAS 16 #define ANTIDEGEN_INFEASIBLE 32 #define ANTIDEGEN_DYNAMIC 64 #define ANTIDEGEN_DURINGBB 128 #define ANTIDEGEN_RHSPERTURB 256 #define ANTIDEGEN_BOUNDFLIP 512 #define ANTIDEGEN_DEFAULT (ANTIDEGEN_FIXEDVARS | ANTIDEGEN_STALLING /* | ANTIDEGEN_INFEASIBLE */) /* REPORT defines */ #define NEUTRAL 0 #define CRITICAL 1 #define SEVERE 2 #define IMPORTANT 3 #define NORMAL 4 #define DETAILED 5 #define FULL 6 /* MESSAGE defines */ #define MSG_NONE 0 #define MSG_PRESOLVE 1 #define MSG_ITERATION 2 #define MSG_INVERT 4 #define MSG_LPFEASIBLE 8 #define MSG_LPOPTIMAL 16 #define MSG_LPEQUAL 32 #define MSG_LPBETTER 64 #define MSG_MILPFEASIBLE 128 #define MSG_MILPEQUAL 256 #define MSG_MILPBETTER 512 #define MSG_MILPSTRATEGY 1024 #define MSG_MILPOPTIMAL 2048 #define MSG_PERFORMANCE 4096 #define MSG_INITPSEUDOCOST 8192 /* MPS file types */ #define MPSFIXED 1 #define MPSFREE 2 #define MPSIBM 4 #define MPSNEGOBJCONST 8 #define MPS_FREE (MPSFREE<<2) #define MPS_IBM (MPSIBM<<2) #define MPS_NEGOBJCONST (MPSNEGOBJCONST<<2) /* MPS defines (internal) */ #define MPSUNDEF -4 #define MPSNAME -3 #define MPSOBJSENSE -2 #define MPSOBJNAME -1 #define MPSROWS 0 #define MPSCOLUMNS 1 #define MPSRHS 2 #define MPSBOUNDS 3 #define MPSRANGES 4 #define MPSSOS 5 #define MPSVARMASK "%-8s" #define MPSVALUEMASK "%12g" /* Constraint type codes (internal) */ #define ROWTYPE_EMPTY 0 #define ROWTYPE_LE 1 #define ROWTYPE_GE 2 #define ROWTYPE_EQ 3 #define ROWTYPE_CONSTRAINT ROWTYPE_EQ /* This is the mask for modes */ #define ROWTYPE_OF 4 #define ROWTYPE_INACTIVE 8 #define ROWTYPE_RELAX 16 #define ROWTYPE_GUB 32 #define ROWTYPE_OFMAX (ROWTYPE_OF + ROWTYPE_GE) #define ROWTYPE_OFMIN (ROWTYPE_OF + ROWTYPE_LE) #define ROWTYPE_CHSIGN ROWTYPE_GE /* Public constraint codes */ #define FR ROWTYPE_EMPTY #define LE ROWTYPE_LE #define GE ROWTYPE_GE #define EQ ROWTYPE_EQ #define OF ROWTYPE_OF /* MIP constraint classes */ #define ROWCLASS_Unknown 0 /* Undefined/unknown */ #define ROWCLASS_Objective 1 /* The objective function */ #define ROWCLASS_GeneralREAL 2 /* General real-values constraint */ #define ROWCLASS_GeneralMIP 3 /* General mixed integer/binary and real valued constraint */ #define ROWCLASS_GeneralINT 4 /* General integer-only constraint */ #define ROWCLASS_GeneralBIN 5 /* General binary-only constraint */ #define ROWCLASS_KnapsackINT 6 /* Sum of positive integer times integer variables <= positive integer */ #define ROWCLASS_KnapsackBIN 7 /* Sum of positive integer times binary variables <= positive integer */ #define ROWCLASS_SetPacking 8 /* Sum of binary variables >= 1 */ #define ROWCLASS_SetCover 9 /* Sum of binary variables <= 1 */ #define ROWCLASS_GUB 10 /* Sum of binary variables = 1 */ #define ROWCLASS_MAX ROWCLASS_GUB /* Column subsets (internal) */ #define SCAN_USERVARS 1 #define SCAN_SLACKVARS 2 #define SCAN_ARTIFICIALVARS 4 #define SCAN_PARTIALBLOCK 8 #define USE_BASICVARS 16 #define USE_NONBASICVARS 32 #define SCAN_NORMALVARS (SCAN_USERVARS + SCAN_ARTIFICIALVARS) #define SCAN_ALLVARS (SCAN_SLACKVARS + SCAN_USERVARS + SCAN_ARTIFICIALVARS) #define USE_ALLVARS (USE_BASICVARS + USE_NONBASICVARS) #define OMIT_FIXED 64 #define OMIT_NONFIXED 128 /* Improvement defines */ #define IMPROVE_NONE 0 #define IMPROVE_SOLUTION 1 #define IMPROVE_DUALFEAS 2 #define IMPROVE_THETAGAP 4 #define IMPROVE_BBSIMPLEX 8 #define IMPROVE_DEFAULT (IMPROVE_DUALFEAS + IMPROVE_THETAGAP) #define IMPROVE_INVERSE (IMPROVE_SOLUTION + IMPROVE_THETAGAP) /* Scaling types */ #define SCALE_NONE 0 #define SCALE_EXTREME 1 #define SCALE_RANGE 2 #define SCALE_MEAN 3 #define SCALE_GEOMETRIC 4 #define SCALE_FUTURE1 5 #define SCALE_FUTURE2 6 #define SCALE_CURTISREID 7 /* Override to Curtis-Reid "optimal" scaling */ /* Alternative scaling weights */ #define SCALE_LINEAR 0 #define SCALE_QUADRATIC 8 #define SCALE_LOGARITHMIC 16 #define SCALE_USERWEIGHT 31 #define SCALE_MAXTYPE (SCALE_QUADRATIC-1) /* Scaling modes */ #define SCALE_POWER2 32 /* As is or rounded to power of 2 */ #define SCALE_EQUILIBRATE 64 /* Make sure that no scaled number is above 1 */ #define SCALE_INTEGERS 128 /* Apply to integer columns/variables */ #define SCALE_DYNUPDATE 256 /* Apply incrementally every solve() */ #define SCALE_ROWSONLY 512 /* Override any scaling to only scale the rows */ #define SCALE_COLSONLY 1024 /* Override any scaling to only scale the rows */ /* Standard defines for typical scaling models (no Lagrangeans) */ #define SCALEMODEL_EQUILIBRATED (SCALE_LINEAR+SCALE_EXTREME+SCALE_INTEGERS) #define SCALEMODEL_GEOMETRIC (SCALE_LINEAR+SCALE_GEOMETRIC+SCALE_INTEGERS) #define SCALEMODEL_ARITHMETIC (SCALE_LINEAR+SCALE_MEAN+SCALE_INTEGERS) #define SCALEMODEL_DYNAMIC (SCALEMODEL_GEOMETRIC+SCALE_EQUILIBRATE) #define SCALEMODEL_CURTISREID (SCALE_CURTISREID+SCALE_INTEGERS+SCALE_POWER2) /* Iteration status and strategies (internal) */ #define ITERATE_MAJORMAJOR 0 #define ITERATE_MINORMAJOR 1 #define ITERATE_MINORRETRY 2 /* Pricing methods */ #define PRICER_FIRSTINDEX 0 #define PRICER_DANTZIG 1 #define PRICER_DEVEX 2 #define PRICER_STEEPESTEDGE 3 #define PRICER_LASTOPTION PRICER_STEEPESTEDGE /* Additional settings for pricers (internal) */ #define PRICER_RANDFACT 0.1 #define DEVEX_RESTARTLIMIT 1.0e+09 /* Reset the norms if any value exceeds this limit */ #define DEVEX_MINVALUE 0.000 /* Minimum weight [0..1] for entering variable, consider 0.01 */ /* Pricing strategies */ #define PRICE_PRIMALFALLBACK 4 /* In case of Steepest Edge, fall back to DEVEX in primal */ #define PRICE_MULTIPLE 8 /* Enable multiple pricing (primal simplex) */ #define PRICE_PARTIAL 16 /* Enable partial pricing */ #define PRICE_ADAPTIVE 32 /* Temporarily use alternative strategy if cycling is detected */ #define PRICE_HYBRID 64 /* NOT IMPLEMENTED */ #define PRICE_RANDOMIZE 128 /* Adds a small randomization effect to the selected pricer */ #define PRICE_AUTOPARTIAL 256 /* Detect and use data on the block structure of the model (primal) */ #define PRICE_AUTOMULTIPLE 512 /* Automatically select multiple pricing (primal simplex) */ #define PRICE_LOOPLEFT 1024 /* Scan entering/leaving columns left rather than right */ #define PRICE_LOOPALTERNATE 2048 /* Scan entering/leaving columns alternatingly left/right */ #define PRICE_HARRISTWOPASS 4096 /* Use Harris' primal pivot logic rather than the default */ #define PRICE_FORCEFULL 8192 /* Non-user option to force full pricing */ #define PRICE_TRUENORMINIT 16384 /* Use true norms for Devex and Steepest Edge initializations */ /*#define _PRICE_NOBOUNDFLIP*/ #if defined _PRICE_NOBOUNDFLIP #define PRICE_NOBOUNDFLIP 65536 /* Disallow automatic bound-flip during pivot */ #endif #define PRICE_STRATEGYMASK (PRICE_PRIMALFALLBACK + \ PRICE_MULTIPLE + PRICE_PARTIAL + \ PRICE_ADAPTIVE + PRICE_HYBRID + \ PRICE_RANDOMIZE + PRICE_AUTOPARTIAL + PRICE_AUTOMULTIPLE + \ PRICE_LOOPLEFT + PRICE_LOOPALTERNATE + \ PRICE_HARRISTWOPASS + \ PRICE_FORCEFULL + PRICE_TRUENORMINIT) /* B&B active variable codes (internal) */ #define BB_REAL 0 #define BB_INT 1 #define BB_SC 2 #define BB_SOS 3 #define BB_GUB 4 /* B&B strategies */ #define NODE_FIRSTSELECT 0 #define NODE_GAPSELECT 1 #define NODE_RANGESELECT 2 #define NODE_FRACTIONSELECT 3 #define NODE_PSEUDOCOSTSELECT 4 #define NODE_PSEUDONONINTSELECT 5 /* Kjell Eikland #1 - Minimize B&B depth */ #define NODE_PSEUDOFEASSELECT (NODE_PSEUDONONINTSELECT+NODE_WEIGHTREVERSEMODE) #define NODE_PSEUDORATIOSELECT 6 /* Kjell Eikland #2 - Minimize a "cost/benefit" ratio */ #define NODE_USERSELECT 7 #define NODE_STRATEGYMASK (NODE_WEIGHTREVERSEMODE-1) /* Mask for B&B strategies */ #define NODE_WEIGHTREVERSEMODE 8 #define NODE_BRANCHREVERSEMODE 16 #define NODE_GREEDYMODE 32 #define NODE_PSEUDOCOSTMODE 64 #define NODE_DEPTHFIRSTMODE 128 #define NODE_RANDOMIZEMODE 256 #define NODE_GUBMODE 512 #define NODE_DYNAMICMODE 1024 #define NODE_RESTARTMODE 2048 #define NODE_BREADTHFIRSTMODE 4096 #define NODE_AUTOORDER 8192 #define NODE_RCOSTFIXING 16384 #define NODE_STRONGINIT 32768 #define BRANCH_CEILING 0 #define BRANCH_FLOOR 1 #define BRANCH_AUTOMATIC 2 #define BRANCH_DEFAULT 3 /* Action constants for simplex and B&B (internal) */ #define ACTION_NONE 0 #define ACTION_ACTIVE 1 #define ACTION_REBASE 2 #define ACTION_RECOMPUTE 4 #define ACTION_REPRICE 8 #define ACTION_REINVERT 16 #define ACTION_TIMEDREINVERT 32 #define ACTION_ITERATE 64 #define ACTION_RESTART 255 /* Solver status values */ #define UNKNOWNERROR -5 #define DATAIGNORED -4 #define NOBFP -3 #define NOMEMORY -2 #define NOTRUN -1 #define OPTIMAL 0 #define SUBOPTIMAL 1 #define INFEASIBLE 2 #define UNBOUNDED 3 #define DEGENERATE 4 #define NUMFAILURE 5 #define USERABORT 6 #define TIMEOUT 7 #define RUNNING 8 #define PRESOLVED 9 /* Branch & Bound and Lagrangean extra status values (internal) */ #define PROCFAIL 10 #define PROCBREAK 11 #define FEASFOUND 12 #define NOFEASFOUND 13 #define FATHOMED 14 /* Status values internal to the solver (internal) */ #define SWITCH_TO_PRIMAL 20 #define SWITCH_TO_DUAL 21 #define SINGULAR_BASIS 22 #define LOSTFEAS 23 #define MATRIXERROR 24 /* Objective testing options for "bb_better" (internal) */ #define OF_RELAXED 0 #define OF_INCUMBENT 1 #define OF_WORKING 2 #define OF_USERBREAK 3 #define OF_HEURISTIC 4 #define OF_DUALLIMIT 5 #define OF_DELTA 8 /* Mode */ #define OF_PROJECTED 16 /* Mode - future, not active */ #define OF_TEST_BT 1 #define OF_TEST_BE 2 #define OF_TEST_NE 3 #define OF_TEST_WE 4 #define OF_TEST_WT 5 #define OF_TEST_RELGAP 8 /* Mode */ /* Name list and sparse matrix storage parameters (internal) */ #define MAT_START_SIZE 10000 #define DELTACOLALLOC 100 #define DELTAROWALLOC 100 #define RESIZEFACTOR 4 /* Fractional increase in selected memory allocations */ /* Default solver parameters and tolerances (internal) */ #define DEF_PARTIALBLOCKS 10 /* The default number of blocks for partial pricing */ #define DEF_MAXRELAX 7 /* Maximum number of non-BB relaxations in MILP */ #define DEF_MAXPIVOTRETRY 10 /* Maximum number of times to retry a div-0 situation */ #define DEF_MAXSINGULARITIES 10 /* Maximum number of singularities in refactorization */ #define MAX_MINITUPDATES 60 /* Maximum number of bound swaps between refactorizations without recomputing the whole vector - contain errors */ #define MIN_REFACTFREQUENCY 5 /* Refactorization frequency indicating an inherent numerical instability of the basis */ #define LAG_SINGULARLIMIT 5 /* Number of times the objective does not change before it is assumed that the Lagrangean constraints are non-binding, and therefore impossible to converge; upper iteration limit is divided by this threshold */ #define MIN_TIMEPIVOT 5.0e-02 /* Minimum time per pivot for reinversion optimization purposes; use active monitoring only if a pivot takes more than MINTIMEPIVOT seconds. 5.0e-2 is roughly suitable for a 1GHz system. */ #define MAX_STALLCOUNT 12 /* The absolute upper limit to the number of stalling or cycling iterations before switching rule */ #define MAX_RULESWITCH 5 /* The maximum number of times to try an alternate pricing rule to recover from stalling; set negative for no limit. */ #define DEF_TIMEDREFACT AUTOMATIC /* Default for timed refactorization in BFPs; can be FALSE, TRUE or AUTOMATIC (dynamic) */ #define DEF_SCALINGLIMIT 5 /* The default maximum number of scaling iterations */ #define DEF_NEGRANGE -1.0e+06 /* Downward limit for expanded variable range before the variable is split into positive and negative components */ #define DEF_BB_LIMITLEVEL -50 /* Relative B&B limit to protect against very deep, memory-consuming trees */ #define MAX_FRACSCALE 6 /* The maximum decimal scan range for simulated integers */ #define RANDSCALE 100 /* Randomization scaling range */ #define DOUBLEROUND 0.0e-02 /* Extra rounding scalar used in btran/ftran calculations; the rationale for 0.0 is that prod_xA() uses rounding as well */ #define DEF_EPSMACHINE 2.22e-16 /* Machine relative precision (doubles) */ #define MIN_STABLEPIVOT 5.0 /* Minimum pivot magnitude assumed to be numerically stable */ /* Precision macros */ /* -------------------------------------------------------------------------------------- */ #define PREC_REDUCEDCOST lp->epsvalue #define PREC_IMPROVEGAP lp->epsdual #define PREC_SUBSTFEASGAP lp->epsprimal #if 1 #define PREC_BASICSOLUTION lp->epsvalue /* Zero-rounding of RHS/basic solution vector */ #else #define PREC_BASICSOLUTION lp->epsmachine /* Zero-rounding of RHS/basic solution vector */ #endif #define LIMIT_ABS_REL 10.0 /* Limit for testing using relative metric */ /* Parameters constants for short-cut setting of tolerances */ /* -------------------------------------------------------------------------------------- */ #define EPS_TIGHT 0 #define EPS_MEDIUM 1 #define EPS_LOOSE 2 #define EPS_BAGGY 3 #define EPS_DEFAULT EPS_TIGHT #if ActivePARAM==ProductionPARAM /* PARAMETER SET FOR PRODUCTION */ /* -------------------------------------------------------------------------------------- */ #define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */ #define DEF_EPSVALUE 1.0e-12 /* High accuracy and feasibility preserving tolerance */ #define DEF_EPSPRIMAL 1.0e-10 /* For rounding primal/RHS values to 0 */ #define DEF_EPSDUAL 1.0e-09 /* For rounding reduced costs to 0 */ #define DEF_EPSPIVOT 2.0e-07 /* Pivot reject threshold */ #define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems; must at least be RANDSCALE greater than EPSPRIMAL */ #define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */ #define DEF_EPSINT 1.0e-07 /* Accuracy for considering a float value as integer */ #elif ActivePARAM==OriginalPARAM /* PARAMETER SET FOR LEGACY VERSIONS */ /* -------------------------------------------------------------------------------------- */ #define DEF_INFINITE 1.0e+24 /* Limit for dynamic range */ #define DEF_EPSVALUE 1.0e-08 /* High accuracy and feasibility preserving tolerance */ #define DEF_EPSPRIMAL 5.01e-07 /* For rounding primal/RHS values to 0, infeasibility */ #define DEF_EPSDUAL 1.0e-06 /* For rounding reduced costs to 0 */ #define DEF_EPSPIVOT 1.0e-04 /* Pivot reject threshold */ #define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems; must at least be RANDSCALE greater than EPSPRIMAL */ #define DEF_EPSSOLUTION 1.0e-02 /* Margin of error for solution bounds */ #define DEF_EPSINT 1.0e-03 /* Accuracy for considering a float value as integer */ #elif ActivePARAM==ChvatalPARAM /* PARAMETER SET EXAMPLES FROM Vacek Chvatal */ /* -------------------------------------------------------------------------------------- */ #define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */ #define DEF_EPSVALUE 1.0e-10 /* High accuracy and feasibility preserving tolerance */ #define DEF_EPSPRIMAL 10e-07 /* For rounding primal/RHS values to 0 */ #define DEF_EPSDUAL 10e-05 /* For rounding reduced costs to 0 */ #define DEF_EPSPIVOT 10e-05 /* Pivot reject threshold */ #define DEF_PERTURB 10e-03 /* Perturbation scalar for degenerate problems; must at least be RANDSCALE greater than EPSPRIMAL */ #define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */ #define DEF_EPSINT 5.0e-03 /* Accuracy for considering a float value as integer */ #elif ActivePARAM==LoosePARAM /* PARAMETER SET FOR LOOSE TOLERANCES */ /* -------------------------------------------------------------------------------------- */ #define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */ #define DEF_EPSVALUE 1.0e-10 /* High accuracy and feasibility preserving tolerance */ #define DEF_EPSPRIMAL 5.01e-08 /* For rounding primal/RHS values to 0 */ #define DEF_EPSDUAL 1.0e-07 /* For rounding reduced costs to 0 */ #define DEF_EPSPIVOT 1.0e-05 /* Pivot reject threshold */ #define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems; must at least be RANDSCALE greater than EPSPRIMAL */ #define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */ #define DEF_EPSINT 1.0e-04 /* Accuracy for considering a float value as integer */ #endif #define DEF_MIP_GAP 1.0e-11 /* The default absolute and relative MIP gap */ #define SCALEDINTFIXRANGE 1.6 /* Epsilon range multiplier < 2 for collapsing bounds to fix */ #define MIN_SCALAR 1.0e-10 /* Smallest allowed scaling adjustment */ #define MAX_SCALAR 1.0e+10 /* Largest allowed scaling adjustment */ #define DEF_SCALINGEPS 1.0e-02 /* Relative scaling convergence criterion for auto_scale */ #define DEF_LAGACCEPT 1.0e-03 /* Default Lagrangean convergence acceptance criterion */ #define DEF_LAGCONTRACT 0.90 /* The contraction parameter for Lagrangean iterations */ #define DEF_LAGMAXITERATIONS 100 /* The maximum number of Lagrangean iterations */ #define DEF_PSEUDOCOSTUPDATES 7 /* The default number of times pseudo-costs are recalculated; experiments indicate that costs tend to stabilize */ #define DEF_PSEUDOCOSTRESTART 0.15 /* The fraction of price updates required for B&B restart when the mode is NODE_RESTARTMODE */ #define DEF_MAXPRESOLVELOOPS 0 /* Upper limit to the number of loops during presolve, <= 0 for no limit. */ /* Hashing prototypes and function headers */ /* ------------------------------------------------------------------------- */ #include "lp_Hash.h" /* Sparse matrix prototypes */ /* ------------------------------------------------------------------------- */ #include "lp_matrix.h" /* Basis storage (mainly for B&B) */ typedef struct _basisrec { int level; int *var_basic; MYBOOL *is_basic; MYBOOL *is_lower; int pivots; struct _basisrec *previous; } basisrec; /* Presolve undo data storage */ typedef struct _presolveundorec { lprec *lp; int orig_rows; int orig_columns; int orig_sum; int *var_to_orig; /* sum_alloc+1 : Mapping of variables from solution to best_solution to account for removed variables and rows during presolve; a non-positive value indicates that the constraint or variable was removed */ int *orig_to_var; /* sum_alloc+1 : Mapping from original variable index to current / working index number */ REAL *fixed_rhs; /* rows_alloc+1 : Storage of values of presolved fixed colums */ REAL *fixed_obj; /* columns_alloc+1: Storage of values of presolved fixed rows */ DeltaVrec *deletedA; /* A matrix of eliminated data from matA */ DeltaVrec *primalundo; /* Affine translation vectors for eliminated primal variables */ DeltaVrec *dualundo; /* Affine translation vectors for eliminated dual variables */ MYBOOL OFcolsdeleted; } presolveundorec; /* Pseudo-cost arrays used during B&B */ typedef struct _BBPSrec { lprec *lp; int pseodotype; int updatelimit; int updatesfinished; REAL restartlimit; MATitem *UPcost; MATitem *LOcost; struct _BBPSrec *secondary; } BBPSrec; #include "lp_mipbb.h" /* Partial pricing block data */ typedef struct _partialrec { lprec *lp; int blockcount; /* ## The number of logical blocks or stages in the model */ int blocknow; /* The currently active block */ int *blockend; /* Array of column indeces giving the start of each block */ int *blockpos; /* Array of column indeces giving the start scan position */ MYBOOL isrow; } partialrec; /* Specially Ordered Sets (SOS) prototypes and settings */ /* ------------------------------------------------------------------------- */ /* SOS storage structure (LINEARSEARCH is typically in the 0-10 range) */ #ifndef LINEARSEARCH #define LINEARSEARCH 0 #endif #include "lp_SOS.h" /* Prototypes for user call-back functions */ /* ------------------------------------------------------------------------- */ typedef int (__WINAPI lphandle_intfunc)(lprec *lp, void *userhandle); typedef void (__WINAPI lphandlestr_func)(lprec *lp, void *userhandle, char *buf); typedef void (__WINAPI lphandleint_func)(lprec *lp, void *userhandle, int message); typedef int (__WINAPI lphandleint_intfunc)(lprec *lp, void *userhandle, int message); /* API typedef definitions */ /* ------------------------------------------------------------------------- */ typedef MYBOOL (__WINAPI add_column_func)(lprec *lp, REAL *column); typedef MYBOOL (__WINAPI add_columnex_func)(lprec *lp, int count, REAL *column, int *rowno); typedef MYBOOL (__WINAPI add_constraint_func)(lprec *lp, REAL *row, int constr_type, REAL rh); typedef MYBOOL (__WINAPI add_constraintex_func)(lprec *lp, int count, REAL *row, int *colno, int constr_type, REAL rh); typedef MYBOOL (__WINAPI add_lag_con_func)(lprec *lp, REAL *row, int con_type, REAL rhs); typedef int (__WINAPI add_SOS_func)(lprec *lp, char *name, int sostype, int priority, int count, int *sosvars, REAL *weights); typedef int (__WINAPI column_in_lp_func)(lprec *lp, REAL *column); typedef lprec * (__WINAPI copy_lp_func)(lprec *lp); typedef void (__WINAPI default_basis_func)(lprec *lp); typedef MYBOOL (__WINAPI del_column_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI del_constraint_func)(lprec *lp, int rownr); typedef void (__WINAPI delete_lp_func)(lprec *lp); typedef MYBOOL (__WINAPI dualize_lp_func)(lprec *lp); typedef void (__WINAPI free_lp_func)(lprec **plp); typedef int (__WINAPI get_anti_degen_func)(lprec *lp); typedef MYBOOL (__WINAPI get_basis_func)(lprec *lp, int *bascolumn, MYBOOL nonbasic); typedef int (__WINAPI get_basiscrash_func)(lprec *lp); typedef int (__WINAPI get_bb_depthlimit_func)(lprec *lp); typedef int (__WINAPI get_bb_floorfirst_func)(lprec *lp); typedef int (__WINAPI get_bb_rule_func)(lprec *lp); typedef MYBOOL (__WINAPI get_bounds_tighter_func)(lprec *lp); typedef REAL (__WINAPI get_break_at_value_func)(lprec *lp); typedef char * (__WINAPI get_col_name_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI get_column_func)(lprec *lp, int colnr, REAL *column); typedef int (__WINAPI get_columnex_func)(lprec *lp, int colnr, REAL *column, int *nzrow); typedef int (__WINAPI get_constr_type_func)(lprec *lp, int rownr); typedef REAL (__WINAPI get_constr_value_func)(lprec *lp, int rownr, int count, REAL *primsolution, int *nzindex); typedef MYBOOL (__WINAPI get_constraints_func)(lprec *lp, REAL *constr); typedef MYBOOL (__WINAPI get_dual_solution_func)(lprec *lp, REAL *rc); typedef REAL (__WINAPI get_epsb_func)(lprec *lp); typedef REAL (__WINAPI get_epsd_func)(lprec *lp); typedef REAL (__WINAPI get_epsel_func)(lprec *lp); typedef REAL (__WINAPI get_epsint_func)(lprec *lp); typedef REAL (__WINAPI get_epsperturb_func)(lprec *lp); typedef REAL (__WINAPI get_epspivot_func)(lprec *lp); typedef int (__WINAPI get_improve_func)(lprec *lp); typedef REAL (__WINAPI get_infinite_func)(lprec *lp); typedef MYBOOL (__WINAPI get_lambda_func)(lprec *lp, REAL *lambda); typedef REAL (__WINAPI get_lowbo_func)(lprec *lp, int colnr); typedef int (__WINAPI get_lp_index_func)(lprec *lp, int orig_index); typedef char * (__WINAPI get_lp_name_func)(lprec *lp); typedef int (__WINAPI get_Lrows_func)(lprec *lp); typedef REAL (__WINAPI get_mat_func)(lprec *lp, int rownr, int colnr); typedef REAL (__WINAPI get_mat_byindex_func)(lprec *lp, int matindex, MYBOOL isrow, MYBOOL adjustsign); typedef int (__WINAPI get_max_level_func)(lprec *lp); typedef int (__WINAPI get_maxpivot_func)(lprec *lp); typedef REAL (__WINAPI get_mip_gap_func)(lprec *lp, MYBOOL absolute); typedef int (__WINAPI get_multiprice_func)(lprec *lp, MYBOOL getabssize); typedef MYBOOL (__WINAPI is_use_names_func)(lprec *lp, MYBOOL isrow); typedef void (__WINAPI set_use_names_func)(lprec *lp, MYBOOL isrow, MYBOOL use_names); typedef int (__WINAPI get_nameindex_func)(lprec *lp, char *varname, MYBOOL isrow); typedef int (__WINAPI get_Ncolumns_func)(lprec *lp); typedef REAL (__WINAPI get_negrange_func)(lprec *lp); typedef int (__WINAPI get_nz_func)(lprec *lp); typedef int (__WINAPI get_Norig_columns_func)(lprec *lp); typedef int (__WINAPI get_Norig_rows_func)(lprec *lp); typedef int (__WINAPI get_Nrows_func)(lprec *lp); typedef REAL (__WINAPI get_obj_bound_func)(lprec *lp); typedef REAL (__WINAPI get_objective_func)(lprec *lp); typedef int (__WINAPI get_orig_index_func)(lprec *lp, int lp_index); typedef char * (__WINAPI get_origcol_name_func)(lprec *lp, int colnr); typedef char * (__WINAPI get_origrow_name_func)(lprec *lp, int rownr); typedef void (__WINAPI get_partialprice_func)(lprec *lp, int *blockcount, int *blockstart, MYBOOL isrow); typedef int (__WINAPI get_pivoting_func)(lprec *lp); typedef int (__WINAPI get_presolve_func)(lprec *lp); typedef int (__WINAPI get_presolveloops_func)(lprec *lp); typedef MYBOOL (__WINAPI get_primal_solution_func)(lprec *lp, REAL *pv); typedef int (__WINAPI get_print_sol_func)(lprec *lp); typedef MYBOOL (__WINAPI get_pseudocosts_func)(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit); typedef MYBOOL (__WINAPI get_ptr_constraints_func)(lprec *lp, REAL **constr); typedef MYBOOL (__WINAPI get_ptr_dual_solution_func)(lprec *lp, REAL **rc); typedef MYBOOL (__WINAPI get_ptr_lambda_func)(lprec *lp, REAL **lambda); typedef MYBOOL (__WINAPI get_ptr_primal_solution_func)(lprec *lp, REAL **pv); typedef MYBOOL (__WINAPI get_ptr_sensitivity_obj_func)(lprec *lp, REAL **objfrom, REAL **objtill); typedef MYBOOL (__WINAPI get_ptr_sensitivity_objex_func)(lprec *lp, REAL **objfrom, REAL **objtill, REAL **objfromvalue, REAL **objtillvalue); typedef MYBOOL (__WINAPI get_ptr_sensitivity_rhs_func)(lprec *lp, REAL **duals, REAL **dualsfrom, REAL **dualstill); typedef MYBOOL (__WINAPI get_ptr_variables_func)(lprec *lp, REAL **var); typedef REAL (__WINAPI get_rh_func)(lprec *lp, int rownr); typedef REAL (__WINAPI get_rh_range_func)(lprec *lp, int rownr); typedef int (__WINAPI get_rowex_func)(lprec *lp, int rownr, REAL *row, int *colno); typedef MYBOOL (__WINAPI get_row_func)(lprec *lp, int rownr, REAL *row); typedef char * (__WINAPI get_row_name_func)(lprec *lp, int rownr); typedef REAL (__WINAPI get_scalelimit_func)(lprec *lp); typedef int (__WINAPI get_scaling_func)(lprec *lp); typedef MYBOOL (__WINAPI get_sensitivity_obj_func)(lprec *lp, REAL *objfrom, REAL *objtill); typedef MYBOOL (__WINAPI get_sensitivity_objex_func)(lprec *lp, REAL *objfrom, REAL *objtill, REAL *objfromvalue, REAL *objtillvalue); typedef MYBOOL (__WINAPI get_sensitivity_rhs_func)(lprec *lp, REAL *duals, REAL *dualsfrom, REAL *dualstill); typedef int (__WINAPI get_simplextype_func)(lprec *lp); typedef int (__WINAPI get_solutioncount_func)(lprec *lp); typedef int (__WINAPI get_solutionlimit_func)(lprec *lp); typedef int (__WINAPI get_status_func)(lprec *lp); typedef char * (__WINAPI get_statustext_func)(lprec *lp, int statuscode); typedef long (__WINAPI get_timeout_func)(lprec *lp); typedef COUNTER (__WINAPI get_total_iter_func)(lprec *lp); typedef COUNTER (__WINAPI get_total_nodes_func)(lprec *lp); typedef REAL (__WINAPI get_upbo_func)(lprec *lp, int colnr); typedef int (__WINAPI get_var_branch_func)(lprec *lp, int colnr); typedef REAL (__WINAPI get_var_dualresult_func)(lprec *lp, int index); typedef REAL (__WINAPI get_var_primalresult_func)(lprec *lp, int index); typedef int (__WINAPI get_var_priority_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI get_variables_func)(lprec *lp, REAL *var); typedef int (__WINAPI get_verbose_func)(lprec *lp); typedef MYBOOL (__WINAPI guess_basis_func)(lprec *lp, REAL *guessvector, int *basisvector); typedef REAL (__WINAPI get_working_objective_func)(lprec *lp); typedef MYBOOL (__WINAPI has_BFP_func)(lprec *lp); typedef MYBOOL (__WINAPI has_XLI_func)(lprec *lp); typedef MYBOOL (__WINAPI is_add_rowmode_func)(lprec *lp); typedef MYBOOL (__WINAPI is_anti_degen_func)(lprec *lp, int testmask); typedef MYBOOL (__WINAPI is_binary_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI is_break_at_first_func)(lprec *lp); typedef MYBOOL (__WINAPI is_constr_type_func)(lprec *lp, int rownr, int mask); typedef MYBOOL (__WINAPI is_debug_func)(lprec *lp); typedef MYBOOL (__WINAPI is_feasible_func)(lprec *lp, REAL *values, REAL threshold); typedef MYBOOL (__WINAPI is_unbounded_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI is_infinite_func)(lprec *lp, REAL value); typedef MYBOOL (__WINAPI is_int_func)(lprec *lp, int column); typedef MYBOOL (__WINAPI is_integerscaling_func)(lprec *lp); typedef MYBOOL (__WINAPI is_lag_trace_func)(lprec *lp); typedef MYBOOL (__WINAPI is_maxim_func)(lprec *lp); typedef MYBOOL (__WINAPI is_nativeBFP_func)(lprec *lp); typedef MYBOOL (__WINAPI is_nativeXLI_func)(lprec *lp); typedef MYBOOL (__WINAPI is_negative_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI is_obj_in_basis_func)(lprec *lp); typedef MYBOOL (__WINAPI is_piv_mode_func)(lprec *lp, int testmask); typedef MYBOOL (__WINAPI is_piv_rule_func)(lprec *lp, int rule); typedef MYBOOL (__WINAPI is_presolve_func)(lprec *lp, int testmask); typedef MYBOOL (__WINAPI is_scalemode_func)(lprec *lp, int testmask); typedef MYBOOL (__WINAPI is_scaletype_func)(lprec *lp, int scaletype); typedef MYBOOL (__WINAPI is_semicont_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI is_SOS_var_func)(lprec *lp, int colnr); typedef MYBOOL (__WINAPI is_trace_func)(lprec *lp); typedef void (__WINAPI lp_solve_version_func)(int *majorversion, int *minorversion, int *release, int *build); typedef lprec * (__WINAPI make_lp_func)(int rows, int columns); typedef void (__WINAPI print_constraints_func)(lprec *lp, int columns); typedef MYBOOL (__WINAPI print_debugdump_func)(lprec *lp, char *filename); typedef void (__WINAPI print_duals_func)(lprec *lp); typedef void (__WINAPI print_lp_func)(lprec *lp); typedef void (__WINAPI print_objective_func)(lprec *lp); typedef void (__WINAPI print_scales_func)(lprec *lp); typedef void (__WINAPI print_solution_func)(lprec *lp, int columns); typedef void (__WINAPI print_str_func)(lprec *lp, char *str); typedef void (__WINAPI print_tableau_func)(lprec *lp); typedef void (__WINAPI put_abortfunc_func)(lprec *lp, lphandle_intfunc newctrlc, void *ctrlchandle); typedef void (__WINAPI put_bb_nodefunc_func)(lprec *lp, lphandleint_intfunc newnode, void *bbnodehandle); typedef void (__WINAPI put_bb_branchfunc_func)(lprec *lp, lphandleint_intfunc newbranch, void *bbbranchhandle); typedef void (__WINAPI put_logfunc_func)(lprec *lp, lphandlestr_func newlog, void *loghandle); typedef void (__WINAPI put_msgfunc_func)(lprec *lp, lphandleint_func newmsg, void *msghandle, int mask); typedef lprec * (__WINAPI read_LP_func)(char *filename, int verbose, char *lp_name); typedef lprec * (__WINAPI read_MPS_func)(char *filename, int options); typedef lprec * (__WINAPI read_XLI_func)(char *xliname, char *modelname, char *dataname, char *options, int verbose); typedef MYBOOL (__WINAPI read_basis_func)(lprec *lp, char *filename, char *info); typedef void (__WINAPI reset_basis_func)(lprec *lp); typedef MYBOOL (__WINAPI read_params_func)(lprec *lp, char *filename, char *options); typedef void (__WINAPI reset_params_func)(lprec *lp); typedef MYBOOL (__WINAPI resize_lp_func)(lprec *lp, int rows, int columns); typedef MYBOOL (__WINAPI set_add_rowmode_func)(lprec *lp, MYBOOL turnon); typedef void (__WINAPI set_anti_degen_func)(lprec *lp, int anti_degen); typedef int (__WINAPI set_basisvar_func)(lprec *lp, int basisPos, int enteringCol); typedef MYBOOL (__WINAPI set_basis_func)(lprec *lp, int *bascolumn, MYBOOL nonbasic); typedef void (__WINAPI set_basiscrash_func)(lprec *lp, int mode); typedef void (__WINAPI set_bb_depthlimit_func)(lprec *lp, int bb_maxlevel); typedef void (__WINAPI set_bb_floorfirst_func)(lprec *lp, int bb_floorfirst); typedef void (__WINAPI set_bb_rule_func)(lprec *lp, int bb_rule); typedef MYBOOL (__WINAPI set_BFP_func)(lprec *lp, char *filename); typedef MYBOOL (__WINAPI set_binary_func)(lprec *lp, int colnr, MYBOOL must_be_bin); typedef MYBOOL (__WINAPI set_bounds_func)(lprec *lp, int colnr, REAL lower, REAL upper); typedef void (__WINAPI set_bounds_tighter_func)(lprec *lp, MYBOOL tighten); typedef void (__WINAPI set_break_at_first_func)(lprec *lp, MYBOOL break_at_first); typedef void (__WINAPI set_break_at_value_func)(lprec *lp, REAL break_at_value); typedef MYBOOL (__WINAPI set_column_func)(lprec *lp, int colnr, REAL *column); typedef MYBOOL (__WINAPI set_columnex_func)(lprec *lp, int colnr, int count, REAL *column, int *rowno); typedef MYBOOL (__WINAPI set_col_name_func)(lprec *lp, int colnr, char *new_name); typedef MYBOOL (__WINAPI set_constr_type_func)(lprec *lp, int rownr, int con_type); typedef void (__WINAPI set_debug_func)(lprec *lp, MYBOOL debug); typedef void (__WINAPI set_epsb_func)(lprec *lp, REAL epsb); typedef void (__WINAPI set_epsd_func)(lprec *lp, REAL epsd); typedef void (__WINAPI set_epsel_func)(lprec *lp, REAL epsel); typedef void (__WINAPI set_epsint_func)(lprec *lp, REAL epsint); typedef MYBOOL (__WINAPI set_epslevel_func)(lprec *lp, int epslevel); typedef void (__WINAPI set_epsperturb_func)(lprec *lp, REAL epsperturb); typedef void (__WINAPI set_epspivot_func)(lprec *lp, REAL epspivot); typedef MYBOOL (__WINAPI set_unbounded_func)(lprec *lp, int colnr); typedef void (__WINAPI set_improve_func)(lprec *lp, int improve); typedef void (__WINAPI set_infinite_func)(lprec *lp, REAL infinite); typedef MYBOOL (__WINAPI set_int_func)(lprec *lp, int colnr, MYBOOL must_be_int); typedef void (__WINAPI set_lag_trace_func)(lprec *lp, MYBOOL lag_trace); typedef MYBOOL (__WINAPI set_lowbo_func)(lprec *lp, int colnr, REAL value); typedef MYBOOL (__WINAPI set_lp_name_func)(lprec *lp, char *lpname); typedef MYBOOL (__WINAPI set_mat_func)(lprec *lp, int row, int column, REAL value); typedef void (__WINAPI set_maxim_func)(lprec *lp); typedef void (__WINAPI set_maxpivot_func)(lprec *lp, int max_num_inv); typedef void (__WINAPI set_minim_func)(lprec *lp); typedef void (__WINAPI set_mip_gap_func)(lprec *lp, MYBOOL absolute, REAL mip_gap); typedef MYBOOL (__WINAPI set_multiprice_func)(lprec *lp, int multiblockdiv); typedef void (__WINAPI set_negrange_func)(lprec *lp, REAL negrange); typedef MYBOOL (__WINAPI set_obj_func)(lprec *lp, int colnr, REAL value); typedef void (__WINAPI set_obj_bound_func)(lprec *lp, REAL obj_bound); typedef MYBOOL (__WINAPI set_obj_fn_func)(lprec *lp, REAL *row); typedef MYBOOL (__WINAPI set_obj_fnex_func)(lprec *lp, int count, REAL *row, int *colno); typedef void (__WINAPI set_obj_in_basis_func)(lprec *lp, MYBOOL obj_in_basis); typedef MYBOOL (__WINAPI set_outputfile_func)(lprec *lp, char *filename); typedef void (__WINAPI set_outputstream_func)(lprec *lp, FILE *stream); typedef MYBOOL (__WINAPI set_partialprice_func)(lprec *lp, int blockcount, int *blockstart, MYBOOL isrow); typedef void (__WINAPI set_pivoting_func)(lprec *lp, int piv_rule); typedef void (__WINAPI set_preferdual_func)(lprec *lp, MYBOOL dodual); typedef void (__WINAPI set_presolve_func)(lprec *lp, int presolvemode, int maxloops); typedef void (__WINAPI set_print_sol_func)(lprec *lp, int print_sol); typedef MYBOOL (__WINAPI set_pseudocosts_func)(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit); typedef MYBOOL (__WINAPI set_rh_func)(lprec *lp, int rownr, REAL value); typedef MYBOOL (__WINAPI set_rh_range_func)(lprec *lp, int rownr, REAL deltavalue); typedef void (__WINAPI set_rh_vec_func)(lprec *lp, REAL *rh); typedef MYBOOL (__WINAPI set_row_func)(lprec *lp, int rownr, REAL *row); typedef MYBOOL (__WINAPI set_rowex_func)(lprec *lp, int rownr, int count, REAL *row, int *colno); typedef MYBOOL (__WINAPI set_row_name_func)(lprec *lp, int rownr, char *new_name); typedef void (__WINAPI set_scalelimit_func)(lprec *lp, REAL scalelimit); typedef void (__WINAPI set_scaling_func)(lprec *lp, int scalemode); typedef MYBOOL (__WINAPI set_semicont_func)(lprec *lp, int colnr, MYBOOL must_be_sc); typedef void (__WINAPI set_sense_func)(lprec *lp, MYBOOL maximize); typedef void (__WINAPI set_simplextype_func)(lprec *lp, int simplextype); typedef void (__WINAPI set_solutionlimit_func)(lprec *lp, int limit); typedef void (__WINAPI set_timeout_func)(lprec *lp, long sectimeout); typedef void (__WINAPI set_trace_func)(lprec *lp, MYBOOL trace); typedef MYBOOL (__WINAPI set_upbo_func)(lprec *lp, int colnr, REAL value); typedef MYBOOL (__WINAPI set_var_branch_func)(lprec *lp, int colnr, int branch_mode); typedef MYBOOL (__WINAPI set_var_weights_func)(lprec *lp, REAL *weights); typedef void (__WINAPI set_verbose_func)(lprec *lp, int verbose); typedef MYBOOL (__WINAPI set_XLI_func)(lprec *lp, char *filename); typedef int (__WINAPI solve_func)(lprec *lp); typedef MYBOOL (__WINAPI str_add_column_func)(lprec *lp, char *col_string); typedef MYBOOL (__WINAPI str_add_constraint_func)(lprec *lp, char *row_string ,int constr_type, REAL rh); typedef MYBOOL (__WINAPI str_add_lag_con_func)(lprec *lp, char *row_string, int con_type, REAL rhs); typedef MYBOOL (__WINAPI str_set_obj_fn_func)(lprec *lp, char *row_string); typedef MYBOOL (__WINAPI str_set_rh_vec_func)(lprec *lp, char *rh_string); typedef REAL (__WINAPI time_elapsed_func)(lprec *lp); typedef void (__WINAPI unscale_func)(lprec *lp); typedef MYBOOL (__WINAPI write_lp_func)(lprec *lp, char *filename); typedef MYBOOL (__WINAPI write_LP_func)(lprec *lp, FILE *output); typedef MYBOOL (__WINAPI write_mps_func)(lprec *lp, char *filename); typedef MYBOOL (__WINAPI write_MPS_func)(lprec *lp, FILE *output); typedef MYBOOL (__WINAPI write_freemps_func)(lprec *lp, char *filename); typedef MYBOOL (__WINAPI write_freeMPS_func)(lprec *lp, FILE *output); typedef MYBOOL (__WINAPI write_XLI_func)(lprec *lp, char *filename, char *options, MYBOOL results); typedef MYBOOL (__WINAPI write_basis_func)(lprec *lp, char *filename); typedef MYBOOL (__WINAPI write_params_func)(lprec *lp, char *filename, char *options); /* Prototypes for callbacks from basis inverse/factorization libraries */ /* ------------------------------------------------------------------------- */ typedef MYBOOL (__WINAPI userabortfunc)(lprec *lp, int level); typedef void (__VACALL reportfunc)(lprec *lp, int level, char *format, ...); typedef char * (__VACALL explainfunc)(lprec *lp, char *format, ...); typedef int (__WINAPI getvectorfunc)(lprec *lp, int varin, REAL *pcol, int *nzlist, int *maxabs); typedef int (__WINAPI getpackedfunc)(lprec *lp, int j, int rn[], double bj[]); typedef REAL (__WINAPI get_OF_activefunc)(lprec *lp, int varnr, REAL mult); typedef int (__WINAPI getMDOfunc)(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL symmetric); typedef MYBOOL (__WINAPI invertfunc)(lprec *lp, MYBOOL shiftbounds, MYBOOL final); typedef void (__WINAPI set_actionfunc)(int *actionvar, int actionmask); typedef MYBOOL (__WINAPI is_actionfunc)(int actionvar, int testmask); typedef void (__WINAPI clear_actionfunc)(int *actionvar, int actionmask); /* Prototypes for basis inverse/factorization libraries */ /* ------------------------------------------------------------------------- */ typedef char *(BFP_CALLMODEL BFPchar)(void); typedef void (BFP_CALLMODEL BFP_lp)(lprec *lp); typedef void (BFP_CALLMODEL BFP_lpint)(lprec *lp, int newsize); typedef int (BFP_CALLMODEL BFPint_lp)(lprec *lp); typedef int (BFP_CALLMODEL BFPint_lpint)(lprec *lp, int kind); typedef REAL (BFP_CALLMODEL BFPreal_lp)(lprec *lp); typedef REAL *(BFP_CALLMODEL BFPrealp_lp)(lprec *lp); typedef void (BFP_CALLMODEL BFP_lpbool)(lprec *lp, MYBOOL maximum); typedef int (BFP_CALLMODEL BFPint_lpbool)(lprec *lp, MYBOOL maximum); typedef int (BFP_CALLMODEL BFPint_lpintintboolbool)(lprec *lp, int uservars, int Bsize, MYBOOL *usedpos, MYBOOL final); typedef void (BFP_CALLMODEL BFP_lprealint)(lprec *lp, REAL *pcol, int *nzidx); typedef void (BFP_CALLMODEL BFP_lprealintrealint)(lprec *lp, REAL *prow, int *pnzidx, REAL *drow, int *dnzidx); typedef MYBOOL (BFP_CALLMODEL BFPbool_lp)(lprec *lp); typedef MYBOOL (BFP_CALLMODEL BFPbool_lpbool)(lprec *lp, MYBOOL changesign); typedef MYBOOL (BFP_CALLMODEL BFPbool_lpint)(lprec *lp, int size); typedef MYBOOL (BFP_CALLMODEL BFPbool_lpintintchar)(lprec *lp, int size, int deltasize, char *options); typedef MYBOOL (BFP_CALLMODEL BFPbool_lpintintint)(lprec *lp, int size, int deltasize, int sizeofvar); typedef LREAL (BFP_CALLMODEL BFPlreal_lpintintreal)(lprec *lp, int row_nr, int col_nr, REAL *pcol); typedef REAL (BFP_CALLMODEL BFPreal_lplrealreal)(lprec *lp, LREAL theta, REAL *pcol); typedef int (BFP_CALLMODEL getcolumnex_func)(lprec *lp, int colnr, REAL *nzvalues, int *nzrows, int *mapin); typedef int (BFP_CALLMODEL BFPint_lpintrealcbintint)(lprec *lp, int items, getcolumnex_func cb, int *maprow, int*mapcol); /* Prototypes for external language libraries */ /* ------------------------------------------------------------------------- */ typedef char *(XLI_CALLMODEL XLIchar)(void); typedef MYBOOL (XLI_CALLMODEL XLIbool_lpintintint)(lprec* lp, int size, int deltasize, int sizevar); typedef MYBOOL (XLI_CALLMODEL XLIbool_lpcharcharcharint)(lprec *lp, char *modelname, char *dataname, char *options, int verbose); typedef MYBOOL (XLI_CALLMODEL XLIbool_lpcharcharbool)(lprec *lp, char *filename, char *options, MYBOOL results); /* Main lp_solve prototypes and function definitions */ /* ------------------------------------------------------------------------- */ struct _lprec { /* Full list of exported functions made available in a quasi object-oriented fashion */ add_column_func *add_column; add_columnex_func *add_columnex; add_constraint_func *add_constraint; add_constraintex_func *add_constraintex; add_lag_con_func *add_lag_con; add_SOS_func *add_SOS; column_in_lp_func *column_in_lp; copy_lp_func *copy_lp; default_basis_func *default_basis; del_column_func *del_column; del_constraint_func *del_constraint; delete_lp_func *delete_lp; dualize_lp_func *dualize_lp; free_lp_func *free_lp; get_anti_degen_func *get_anti_degen; get_basis_func *get_basis; get_basiscrash_func *get_basiscrash; get_bb_depthlimit_func *get_bb_depthlimit; get_bb_floorfirst_func *get_bb_floorfirst; get_bb_rule_func *get_bb_rule; get_bounds_tighter_func *get_bounds_tighter; get_break_at_value_func *get_break_at_value; get_col_name_func *get_col_name; get_columnex_func *get_columnex; get_constr_type_func *get_constr_type; get_constr_value_func *get_constr_value; get_constraints_func *get_constraints; get_dual_solution_func *get_dual_solution; get_epsb_func *get_epsb; get_epsd_func *get_epsd; get_epsel_func *get_epsel; get_epsint_func *get_epsint; get_epsperturb_func *get_epsperturb; get_epspivot_func *get_epspivot; get_improve_func *get_improve; get_infinite_func *get_infinite; get_lambda_func *get_lambda; get_lowbo_func *get_lowbo; get_lp_index_func *get_lp_index; get_lp_name_func *get_lp_name; get_Lrows_func *get_Lrows; get_mat_func *get_mat; get_mat_byindex_func *get_mat_byindex; get_max_level_func *get_max_level; get_maxpivot_func *get_maxpivot; get_mip_gap_func *get_mip_gap; get_multiprice_func *get_multiprice; get_nameindex_func *get_nameindex; get_Ncolumns_func *get_Ncolumns; get_negrange_func *get_negrange; get_nz_func *get_nonzeros; get_Norig_columns_func *get_Norig_columns; get_Norig_rows_func *get_Norig_rows; get_Nrows_func *get_Nrows; get_obj_bound_func *get_obj_bound; get_objective_func *get_objective; get_orig_index_func *get_orig_index; get_origcol_name_func *get_origcol_name; get_origrow_name_func *get_origrow_name; get_partialprice_func *get_partialprice; get_pivoting_func *get_pivoting; get_presolve_func *get_presolve; get_presolveloops_func *get_presolveloops; get_primal_solution_func *get_primal_solution; get_print_sol_func *get_print_sol; get_pseudocosts_func *get_pseudocosts; get_ptr_constraints_func *get_ptr_constraints; get_ptr_dual_solution_func *get_ptr_dual_solution; get_ptr_lambda_func *get_ptr_lambda; get_ptr_primal_solution_func *get_ptr_primal_solution; get_ptr_sensitivity_obj_func *get_ptr_sensitivity_obj; get_ptr_sensitivity_objex_func *get_ptr_sensitivity_objex; get_ptr_sensitivity_rhs_func *get_ptr_sensitivity_rhs; get_ptr_variables_func *get_ptr_variables; get_rh_func *get_rh; get_rh_range_func *get_rh_range; get_row_func *get_row; get_rowex_func *get_rowex; get_row_name_func *get_row_name; get_scalelimit_func *get_scalelimit; get_scaling_func *get_scaling; get_sensitivity_obj_func *get_sensitivity_obj; get_sensitivity_objex_func *get_sensitivity_objex; get_sensitivity_rhs_func *get_sensitivity_rhs; get_simplextype_func *get_simplextype; get_solutioncount_func *get_solutioncount; get_solutionlimit_func *get_solutionlimit; get_status_func *get_status; get_statustext_func *get_statustext; get_timeout_func *get_timeout; get_total_iter_func *get_total_iter; get_total_nodes_func *get_total_nodes; get_upbo_func *get_upbo; get_var_branch_func *get_var_branch; get_var_dualresult_func *get_var_dualresult; get_var_primalresult_func *get_var_primalresult; get_var_priority_func *get_var_priority; get_variables_func *get_variables; get_verbose_func *get_verbose; get_working_objective_func *get_working_objective; has_BFP_func *has_BFP; has_XLI_func *has_XLI; is_add_rowmode_func *is_add_rowmode; is_anti_degen_func *is_anti_degen; is_binary_func *is_binary; is_break_at_first_func *is_break_at_first; is_constr_type_func *is_constr_type; is_debug_func *is_debug; is_feasible_func *is_feasible; is_infinite_func *is_infinite; is_int_func *is_int; is_integerscaling_func *is_integerscaling; is_lag_trace_func *is_lag_trace; is_maxim_func *is_maxim; is_nativeBFP_func *is_nativeBFP; is_nativeXLI_func *is_nativeXLI; is_negative_func *is_negative; is_obj_in_basis_func *is_obj_in_basis; is_piv_mode_func *is_piv_mode; is_piv_rule_func *is_piv_rule; is_presolve_func *is_presolve; is_scalemode_func *is_scalemode; is_scaletype_func *is_scaletype; is_semicont_func *is_semicont; is_SOS_var_func *is_SOS_var; is_trace_func *is_trace; is_unbounded_func *is_unbounded; is_use_names_func *is_use_names; lp_solve_version_func *lp_solve_version; make_lp_func *make_lp; print_constraints_func *print_constraints; print_debugdump_func *print_debugdump; print_duals_func *print_duals; print_lp_func *print_lp; print_objective_func *print_objective; print_scales_func *print_scales; print_solution_func *print_solution; print_str_func *print_str; print_tableau_func *print_tableau; put_abortfunc_func *put_abortfunc; put_bb_nodefunc_func *put_bb_nodefunc; put_bb_branchfunc_func *put_bb_branchfunc; put_logfunc_func *put_logfunc; put_msgfunc_func *put_msgfunc; read_LP_func *read_LP; read_MPS_func *read_MPS; read_XLI_func *read_XLI; read_params_func *read_params; read_basis_func *read_basis; reset_basis_func *reset_basis; reset_params_func *reset_params; resize_lp_func *resize_lp; set_add_rowmode_func *set_add_rowmode; set_anti_degen_func *set_anti_degen; set_basisvar_func *set_basisvar; set_basis_func *set_basis; set_basiscrash_func *set_basiscrash; set_bb_depthlimit_func *set_bb_depthlimit; set_bb_floorfirst_func *set_bb_floorfirst; set_bb_rule_func *set_bb_rule; set_BFP_func *set_BFP; set_binary_func *set_binary; set_bounds_func *set_bounds; set_bounds_tighter_func *set_bounds_tighter; set_break_at_first_func *set_break_at_first; set_break_at_value_func *set_break_at_value; set_column_func *set_column; set_columnex_func *set_columnex; set_col_name_func *set_col_name; set_constr_type_func *set_constr_type; set_debug_func *set_debug; set_epsb_func *set_epsb; set_epsd_func *set_epsd; set_epsel_func *set_epsel; set_epsint_func *set_epsint; set_epslevel_func *set_epslevel; set_epsperturb_func *set_epsperturb; set_epspivot_func *set_epspivot; set_unbounded_func *set_unbounded; set_improve_func *set_improve; set_infinite_func *set_infinite; set_int_func *set_int; set_lag_trace_func *set_lag_trace; set_lowbo_func *set_lowbo; set_lp_name_func *set_lp_name; set_mat_func *set_mat; set_maxim_func *set_maxim; set_maxpivot_func *set_maxpivot; set_minim_func *set_minim; set_mip_gap_func *set_mip_gap; set_multiprice_func *set_multiprice; set_negrange_func *set_negrange; set_obj_bound_func *set_obj_bound; set_obj_fn_func *set_obj_fn; set_obj_fnex_func *set_obj_fnex; set_obj_func *set_obj; set_obj_in_basis_func *set_obj_in_basis; set_outputfile_func *set_outputfile; set_outputstream_func *set_outputstream; set_partialprice_func *set_partialprice; set_pivoting_func *set_pivoting; set_preferdual_func *set_preferdual; set_presolve_func *set_presolve; set_print_sol_func *set_print_sol; set_pseudocosts_func *set_pseudocosts; set_rh_func *set_rh; set_rh_range_func *set_rh_range; set_rh_vec_func *set_rh_vec; set_row_func *set_row; set_rowex_func *set_rowex; set_row_name_func *set_row_name; set_scalelimit_func *set_scalelimit; set_scaling_func *set_scaling; set_semicont_func *set_semicont; set_sense_func *set_sense; set_simplextype_func *set_simplextype; set_solutionlimit_func *set_solutionlimit; set_timeout_func *set_timeout; set_trace_func *set_trace; set_upbo_func *set_upbo; set_use_names_func *set_use_names; set_var_branch_func *set_var_branch; set_var_weights_func *set_var_weights; set_verbose_func *set_verbose; set_XLI_func *set_XLI; solve_func *solve; str_add_column_func *str_add_column; str_add_constraint_func *str_add_constraint; str_add_lag_con_func *str_add_lag_con; str_set_obj_fn_func *str_set_obj_fn; str_set_rh_vec_func *str_set_rh_vec; time_elapsed_func *time_elapsed; unscale_func *unscale; write_lp_func *write_lp; write_LP_func *write_LP; write_mps_func *write_mps; write_MPS_func *write_MPS; write_freemps_func *write_freemps; write_freeMPS_func *write_freeMPS; write_XLI_func *write_XLI; write_basis_func *write_basis; write_params_func *write_params; /* Spacer */ int *alignmentspacer; /* Problem description */ char *lp_name; /* The name of the model */ /* Problem sizes */ int sum; /* The total number of variables, including slacks */ int rows; int columns; int equalities; /* No of non-Lagrangean equality constraints in the problem */ int boundedvars; /* Count of bounded variables */ int INTfuture1; /* Memory allocation sizes */ int sum_alloc; /* The allocated memory for row+column-sized data */ int rows_alloc; /* The allocated memory for row-sized data */ int columns_alloc; /* The allocated memory for column-sized data */ /* Model status and solver result variables */ MYBOOL source_is_file; /* The base model was read from a file */ MYBOOL model_is_pure; /* The model has been built entirely from row and column additions */ MYBOOL model_is_valid; /* Has this lp pased the 'test' */ MYBOOL tighten_on_set; /* Specify if bounds will be tightened or overriden at bound setting */ MYBOOL names_used; /* Flag to indicate if names for rows and columns are used */ MYBOOL use_row_names; /* Flag to indicate if names for rows are used */ MYBOOL use_col_names; /* Flag to indicate if names for columns are used */ MYBOOL lag_trace; /* Print information on Lagrange progression */ MYBOOL spx_trace; /* Print information on simplex progression */ MYBOOL bb_trace; /* TRUE to print extra debug information */ MYBOOL streamowned; /* TRUE if the handle should be closed at delete_lp() */ MYBOOL obj_in_basis; /* TRUE if the objective function is in the basis matrix */ int spx_status; /* Simplex solver feasibility/mode code */ int lag_status; /* Extra status variable for lag_solve */ int solutioncount; /* number of equal-valued solutions found (up to solutionlimit) */ int solutionlimit; /* upper number of equal-valued solutions kept track of */ REAL real_solution; /* Optimal non-MIP solution base */ REAL *solution; /* sum_alloc+1 : Solution array of the next to optimal LP, Index 0 : Objective function value, Indeces 1..rows : Slack variable values, Indeced rows+1..sum : Variable values */ REAL *best_solution; /* sum_alloc+1 : Solution array of optimal 'Integer' LP, structured as the solution array above */ REAL *full_solution; /* sum_alloc+1 : Final solution array expanded for deleted variables */ REAL *edgeVector; /* Array of reduced cost scaling norms (DEVEX and Steepest Edge) */ REAL *drow; /* sum+1: Reduced costs of the last simplex */ int *nzdrow; /* sum+1: Indeces of non-zero reduced costs of the last simplex */ REAL *duals; /* rows_alloc+1 : The dual variables of the last LP */ REAL *full_duals; /* sum_alloc+1: Final duals array expanded for deleted variables */ REAL *dualsfrom; /* sum_alloc+1 :The sensitivity on dual variables/reduced costs of the last LP */ REAL *dualstill; /* sum_alloc+1 :The sensitivity on dual variables/reduced costs of the last LP */ REAL *objfrom; /* columns_alloc+1 :The sensitivity on objective function of the last LP */ REAL *objtill; /* columns_alloc+1 :The sensitivity on objective function of the last LP */ REAL *objfromvalue; /* columns_alloc+1 :The value of the variables when objective value is at its from value of the last LP */ REAL *orig_obj; /* Unused pointer - Placeholder for OF not part of B */ REAL *obj; /* Special vector used to temporarily change the OF vector */ COUNTER current_iter; /* Number of iterations in the current/last simplex */ COUNTER total_iter; /* Number of iterations over all B&B steps */ COUNTER current_bswap; /* Number of bound swaps in the current/last simplex */ COUNTER total_bswap; /* Number of bount swaps over all B&B steps */ int solvecount; /* The number of solve() performed in this model */ int max_pivots; /* Number of pivots between refactorizations of the basis */ /* Various execution parameters */ int simplex_strategy; /* Set desired combination of primal and dual simplex algorithms */ int simplex_mode; /* Specifies the current simplex mode during solve; see simplex_strategy */ int verbose; /* Set amount of run-time messages and results */ int print_sol; /* TRUE to print optimal solution; AUTOMATIC skips zeros */ FILE *outstream; /* Output stream, initialized to STDOUT */ /* Main Branch and Bound settings */ MYBOOL *bb_varbranch; /* Determines branching strategy at the individual variable level; the setting here overrides the bb_floorfirst setting */ int piv_strategy; /* Strategy for selecting row and column entering/leaving */ int _piv_rule_; /* Internal working rule-part of piv_strategy above */ int bb_rule; /* Rule for selecting B&B variables */ MYBOOL bb_floorfirst; /* Set BRANCH_FLOOR for B&B to set variables to floor bound first; conversely with BRANCH_CEILING, the ceiling value is set first */ MYBOOL bb_breakfirst; /* TRUE to stop at first feasible solution */ MYBOOL _piv_left_; /* Internal variable indicating active pricing loop order */ MYBOOL BOOLfuture1; REAL scalelimit; /* Relative convergence criterion for iterated scaling */ int scalemode; /* OR-ed codes for data scaling */ int improve; /* Set to non-zero for iterative improvement */ int anti_degen; /* Anti-degen strategy (or none) TRUE to avoid cycling */ int do_presolve; /* PRESOLVE_ parameters for LP presolving */ int presolveloops; /* Maximum number of presolve loops */ int perturb_count; /* The number of bound relaxation retries performed */ /* Row and column names storage variables */ hashelem **row_name; /* rows_alloc+1 */ hashelem **col_name; /* columns_alloc+1 */ hashtable *rowname_hashtab; /* hash table to store row names */ hashtable *colname_hashtab; /* hash table to store column names */ /* Optionally specify continuous rows/column blocks for partial pricing */ partialrec *rowblocks; partialrec *colblocks; /* Row and column type codes */ MYBOOL *var_type; /* sum_alloc+1 : TRUE if variable must be integer */ /* Data for multiple pricing */ multirec *multivars; int multiblockdiv; /* The divisor used to set or augment pricing block */ /* Variable (column) parameters */ int fixedvars; /* The current number of basic fixed variables in the model */ int int_vars; /* Number of variables required to be integer */ int sc_vars; /* Number of semi-continuous variables */ REAL *sc_lobound; /* sum_columns+1 : TRUE if variable is semi-continuous; value replaced by conventional lower bound during solve */ int *var_is_free; /* columns+1: Index of twin variable if variable is free */ int *var_priority; /* columns: Priority-mapping of variables */ SOSgroup *GUB; /* Pointer to record containing GUBs */ int sos_vars; /* Number of variables in the sos_priority list */ int sos_ints; /* Number of integers in SOS'es above */ SOSgroup *SOS; /* Pointer to record containing all SOS'es */ int *sos_priority; /* Priority-sorted list of variables (no duplicates) */ /* Optionally specify list of active rows/columns used in multiple pricing */ REAL *bsolveVal; /* rows+1: bsolved solution vector for reduced costs */ int *bsolveIdx; /* rows+1: Non-zero indeces of bsolveVal */ /* RHS storage */ REAL *orig_rhs; /* rows_alloc+1 : The RHS after scaling and sign changing, but before 'Bound transformation' */ LREAL *rhs; /* rows_alloc+1 : The RHS of the current simplex tableau */ /* Row (constraint) parameters */ int *row_type; /* rows_alloc+1 : Row/constraint type coding */ /* Optionally specify data for dual long-step */ multirec *longsteps; /* Original and working row and variable bounds */ REAL *orig_upbo; /* sum_alloc+1 : Bound before transformations */ REAL *upbo; /* " " : Upper bound after transformation and B&B work */ REAL *orig_lowbo; /* " " */ REAL *lowbo; /* " " : Lower bound after transformation and B&B work */ /* User data and basis factorization matrices (ETA or LU, product form) */ MATrec *matA; INVrec *invB; /* Basis and bounds */ BBrec *bb_bounds; /* The linked list of B&B bounds */ BBrec *rootbounds; /* The bounds at the lowest B&B level */ basisrec *bb_basis; /* The linked list of B&B bases */ basisrec *rootbasis; OBJmonrec *monitor; /* Objective monitoring record for stalling/degeneracy handling */ /* Scaling parameters */ REAL *scalars; /* sum_alloc+1:0..Rows the scaling of the rows, Rows+1..Sum the scaling of the columns */ MYBOOL scaling_used; /* TRUE if scaling is used */ MYBOOL columns_scaled; /* TRUE if the columns are scaled too */ MYBOOL varmap_locked; /* Determines whether the var_to_orig and orig_to_var are fixed */ /* Variable state information */ MYBOOL basis_valid; /* TRUE is the basis is still valid */ int crashmode; /* Basis crashing mode (or none) */ int *var_basic; /* rows_alloc+1: The list of columns in the basis */ REAL *val_nonbasic; /* Array to store current values of non-basic variables */ MYBOOL *is_basic; /* sum_alloc+1: TRUE if the column is in the basis */ MYBOOL *is_lower; /* " " : TRUE if the variable is at its lower bound (or in the basis), FALSE otherwise */ /* Simplex basis indicators */ int *rejectpivot; /* List of unacceptable pivot choices due to division-by-zero */ BBPSrec *bb_PseudoCost; /* Data structure for costing of node branchings */ int bb_PseudoUpdates; /* Maximum number of updates for pseudo-costs */ int bb_strongbranches; /* The number of strong B&B branches performed */ int is_strongbranch; /* Are we currently in a strong branch mode? */ int bb_improvements; /* The number of discrete B&B objective improvement steps */ /* Solver working variables */ REAL rhsmax; /* The maximum |value| of the rhs vector at any iteration */ REAL suminfeas; /* The working sum of primal and dual infeasibilities */ REAL bigM; /* Original objective weighting in primal phase 1 */ REAL P1extraVal; /* Phase 1 OF/RHS offset for feasibility */ int P1extraDim; /* Phase 1 additional columns/rows for feasibility */ int spx_action; /* ACTION_ variables for the simplex routine */ MYBOOL spx_perturbed; /* The variable bounds were relaxed/perturbed into this simplex */ MYBOOL bb_break; /* Solver working variable; signals break of the B&B */ MYBOOL wasPreprocessed; /* The solve preprocessing was performed */ MYBOOL wasPresolved; /* The solve presolver was invoked */ int INTfuture2; /* Lagragean solver storage and parameters */ MATrec *matL; REAL *lag_rhs; /* Array of Lagrangean rhs vector */ int *lag_con_type; /* Array of GT, LT or EQ */ REAL *lambda; /* Lambda values (Lagrangean multipliers) */ REAL lag_bound; /* The Lagrangian lower OF bound */ REAL lag_accept; /* The Lagrangian convergence criterion */ /* Solver thresholds */ REAL infinite; /* Limit for dynamic range */ REAL negrange; /* Limit for negative variable range */ REAL epsmachine; /* Default machine accuracy */ REAL epsvalue; /* Input data precision / rounding of data values to 0 */ REAL epsprimal; /* For rounding RHS values to 0/infeasibility */ REAL epsdual; /* For rounding reduced costs to zero */ REAL epspivot; /* Pivot reject tolerance */ REAL epsperturb; /* Perturbation scalar */ REAL epssolution; /* The solution tolerance for final validation */ /* Branch & Bound working parameters */ int bb_status; /* Indicator that the last solvelp() gave an improved B&B solution */ int bb_level; /* Solver B&B working variable (recursion depth) */ int bb_maxlevel; /* The deepest B&B level of the last solution */ int bb_limitlevel; /* The maximum B&B level allowed */ COUNTER bb_totalnodes; /* Total number of nodes processed in B&B */ int bb_solutionlevel; /* The B&B level of the last / best solution */ int bb_cutpoolsize; /* Size of the B&B cut pool */ int bb_cutpoolused; /* Currently used cut pool */ int bb_constraintOF; /* General purpose B&B parameter (typically for testing) */ int *bb_cuttype; /* The type of the currently used cuts */ int *bb_varactive; /* The B&B state of the variable; 0 means inactive */ DeltaVrec *bb_upperchange; /* Changes to upper bounds during the B&B phase */ DeltaVrec *bb_lowerchange; /* Changes to lower bounds during the B&B phase */ REAL bb_deltaOF; /* Minimum OF step value; computed at beginning of solve() */ REAL bb_breakOF; /* User-settable value for the objective function deemed to be sufficiently good in an integer problem */ REAL bb_limitOF; /* "Dual" bound / limit to final optimal MIP solution */ REAL bb_heuristicOF; /* Set initial "at least better than" guess for objective function (can significantly speed up B&B iterations) */ REAL bb_parentOF; /* The OF value of the previous BB simplex */ REAL bb_workOF; /* The unadjusted OF value for the current best solution */ /* Internal work arrays allocated as required */ presolveundorec *presolve_undo; workarraysrec *workarrays; /* MIP parameters */ REAL epsint; /* Margin of error in determining if a float value is integer */ REAL mip_absgap; /* Absolute MIP gap */ REAL mip_relgap; /* Relative MIP gap */ /* Time/timer variables and extended status text */ double timecreate; double timestart; double timeheuristic; double timepresolved; double timeend; long sectimeout; /* Extended status message text set via explain() */ char *ex_status; /* Refactorization engine interface routines (for dynamic DLL/SO BFPs) */ #if LoadInverseLib == TRUE #ifdef WIN32 HINSTANCE hBFP; #else void *hBFP; #endif #endif BFPchar *bfp_name; BFPbool_lpintintint *bfp_compatible; BFPbool_lpintintchar *bfp_init; BFP_lp *bfp_free; BFPbool_lpint *bfp_resize; BFPint_lp *bfp_memallocated; BFPbool_lp *bfp_restart; BFPbool_lp *bfp_mustrefactorize; BFPint_lp *bfp_preparefactorization; BFPint_lpintintboolbool *bfp_factorize; BFP_lp *bfp_finishfactorization; BFP_lp *bfp_updaterefactstats; BFPlreal_lpintintreal *bfp_prepareupdate; BFPreal_lplrealreal *bfp_pivotRHS; BFPbool_lpbool *bfp_finishupdate; BFP_lprealint *bfp_ftran_prepare; BFP_lprealint *bfp_ftran_normal; BFP_lprealint *bfp_btran_normal; BFP_lprealintrealint *bfp_btran_double; BFPint_lp *bfp_status; BFPint_lpbool *bfp_nonzeros; BFPbool_lp *bfp_implicitslack; BFPint_lp *bfp_indexbase; BFPint_lp *bfp_rowoffset; BFPint_lp *bfp_pivotmax; BFPbool_lpint *bfp_pivotalloc; BFPint_lp *bfp_colcount; BFPbool_lp *bfp_canresetbasis; BFPreal_lp *bfp_efficiency; BFPrealp_lp *bfp_pivotvector; BFPint_lp *bfp_pivotcount; BFPint_lpint *bfp_refactcount; BFPbool_lp *bfp_isSetI; BFPint_lpintrealcbintint *bfp_findredundant; /* External language interface routines (for dynamic DLL/SO XLIs) */ #if LoadLanguageLib == TRUE #ifdef WIN32 HINSTANCE hXLI; #else void *hXLI; #endif #endif XLIchar *xli_name; XLIbool_lpintintint *xli_compatible; XLIbool_lpcharcharcharint *xli_readmodel; XLIbool_lpcharcharbool *xli_writemodel; /* Miscellaneous internal functions made available externally */ userabortfunc *userabort; reportfunc *report; explainfunc *explain; getvectorfunc *get_lpcolumn; getpackedfunc *get_basiscolumn; get_OF_activefunc *get_OF_active; getMDOfunc *getMDO; invertfunc *invert; set_actionfunc *set_action; is_actionfunc *is_action; clear_actionfunc *clear_action; /* User program interface callbacks */ lphandle_intfunc *ctrlc; void *ctrlchandle; /* User-specified "owner process ID" */ lphandlestr_func *writelog; void *loghandle; /* User-specified "owner process ID" */ lphandlestr_func *debuginfo; lphandleint_func *usermessage; int msgmask; void *msghandle; /* User-specified "owner process ID" */ lphandleint_intfunc *bb_usenode; void *bb_nodehandle; /* User-specified "owner process ID" */ lphandleint_intfunc *bb_usebranch; void *bb_branchhandle; /* User-specified "owner process ID" */ /* replacement of static variables */ char *rowcol_name; /* The name of a row/column */ }; #ifdef __cplusplus __EXTERN_C { #endif /* User and system function interfaces */ /* ------------------------------------------------------------------------- */ void __EXPORT_TYPE __WINAPI lp_solve_version(int *majorversion, int *minorversion, int *release, int *build); lprec __EXPORT_TYPE * __WINAPI make_lp(int rows, int columns); MYBOOL __EXPORT_TYPE __WINAPI resize_lp(lprec *lp, int rows, int columns); int __EXPORT_TYPE __WINAPI get_status(lprec *lp); char __EXPORT_TYPE * __WINAPI get_statustext(lprec *lp, int statuscode); MYBOOL __EXPORT_TYPE __WINAPI is_obj_in_basis(lprec *lp); void __EXPORT_TYPE __WINAPI set_obj_in_basis(lprec *lp, MYBOOL obj_in_basis); /* Create and initialise a lprec structure defaults */ lprec __EXPORT_TYPE * __WINAPI copy_lp(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI dualize_lp(lprec *lp); STATIC MYBOOL memopt_lp(lprec *lp, int rowextra, int colextra, int nzextra); /* Copy or dualize the lp */ void __EXPORT_TYPE __WINAPI delete_lp(lprec *lp); void __EXPORT_TYPE __WINAPI free_lp(lprec **plp); /* Remove problem from memory */ MYBOOL __EXPORT_TYPE __WINAPI set_lp_name(lprec *lp, char *lpname); char __EXPORT_TYPE * __WINAPI get_lp_name(lprec *lp); /* Set and get the problem name */ MYBOOL __EXPORT_TYPE __WINAPI has_BFP(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_nativeBFP(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_BFP(lprec *lp, char *filename); /* Set basis factorization engine */ lprec __EXPORT_TYPE * __WINAPI read_XLI(char *xliname, char *modelname, char *dataname, char *options, int verbose); MYBOOL __EXPORT_TYPE __WINAPI write_XLI(lprec *lp, char *filename, char *options, MYBOOL results); MYBOOL __EXPORT_TYPE __WINAPI has_XLI(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_nativeXLI(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_XLI(lprec *lp, char *filename); /* Set external language interface */ MYBOOL __EXPORT_TYPE __WINAPI set_obj(lprec *lp, int colnr, REAL value); MYBOOL __EXPORT_TYPE __WINAPI set_obj_fn(lprec *lp, REAL *row); MYBOOL __EXPORT_TYPE __WINAPI set_obj_fnex(lprec *lp, int count, REAL *row, int *colno); /* set the objective function (Row 0) of the matrix */ MYBOOL __EXPORT_TYPE __WINAPI str_set_obj_fn(lprec *lp, char *row_string); /* The same, but with string input */ void __EXPORT_TYPE __WINAPI set_sense(lprec *lp, MYBOOL maximize); void __EXPORT_TYPE __WINAPI set_maxim(lprec *lp); void __EXPORT_TYPE __WINAPI set_minim(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_maxim(lprec *lp); /* Set optimization direction for the objective function */ MYBOOL __EXPORT_TYPE __WINAPI add_constraint(lprec *lp, REAL *row, int constr_type, REAL rh); MYBOOL __EXPORT_TYPE __WINAPI add_constraintex(lprec *lp, int count, REAL *row, int *colno, int constr_type, REAL rh); MYBOOL __EXPORT_TYPE __WINAPI set_add_rowmode(lprec *lp, MYBOOL turnon); MYBOOL __EXPORT_TYPE __WINAPI is_add_rowmode(lprec *lp); /* Add a constraint to the problem, row is the constraint row, rh is the right hand side, constr_type is the type of constraint (LE (<=), GE(>=), EQ(=)) */ MYBOOL __EXPORT_TYPE __WINAPI str_add_constraint(lprec *lp, char *row_string, int constr_type, REAL rh); /* The same, but with string input */ MYBOOL __EXPORT_TYPE __WINAPI set_row(lprec *lp, int rownr, REAL *row); MYBOOL __EXPORT_TYPE __WINAPI set_rowex(lprec *lp, int rownr, int count, REAL *row, int *colno); MYBOOL __EXPORT_TYPE __WINAPI get_row(lprec *lp, int rownr, REAL *row); int __EXPORT_TYPE __WINAPI get_rowex(lprec *lp, int rownr, REAL *row, int *colno); /* Fill row with the row row_nr from the problem */ MYBOOL __EXPORT_TYPE __WINAPI del_constraint(lprec *lp, int rownr); STATIC MYBOOL del_constraintex(lprec *lp, LLrec *rowmap); /* Remove constrain nr del_row from the problem */ MYBOOL __EXPORT_TYPE __WINAPI add_lag_con(lprec *lp, REAL *row, int con_type, REAL rhs); /* add a Lagrangian constraint of form Row' x contype Rhs */ MYBOOL __EXPORT_TYPE __WINAPI str_add_lag_con(lprec *lp, char *row_string, int con_type, REAL rhs); /* The same, but with string input */ void __EXPORT_TYPE __WINAPI set_lag_trace(lprec *lp, MYBOOL lag_trace); MYBOOL __EXPORT_TYPE __WINAPI is_lag_trace(lprec *lp); /* Set debugging/tracing mode of the Lagrangean solver */ MYBOOL __EXPORT_TYPE __WINAPI set_constr_type(lprec *lp, int rownr, int con_type); int __EXPORT_TYPE __WINAPI get_constr_type(lprec *lp, int rownr); REAL __EXPORT_TYPE __WINAPI get_constr_value(lprec *lp, int rownr, int count, REAL *primsolution, int *nzindex); MYBOOL __EXPORT_TYPE __WINAPI is_constr_type(lprec *lp, int rownr, int mask); STATIC char *get_str_constr_type(lprec *lp, int con_type); STATIC int get_constr_class(lprec *lp, int rownr); STATIC char *get_str_constr_class(lprec *lp, int con_class); /* Set the type of constraint in row Row (LE, GE, EQ) */ MYBOOL __EXPORT_TYPE __WINAPI set_rh(lprec *lp, int rownr, REAL value); REAL __EXPORT_TYPE __WINAPI get_rh(lprec *lp, int rownr); /* Set and get the right hand side of a constraint row */ MYBOOL __EXPORT_TYPE __WINAPI set_rh_range(lprec *lp, int rownr, REAL deltavalue); REAL __EXPORT_TYPE __WINAPI get_rh_range(lprec *lp, int rownr); /* Set the RHS range; i.e. the lower and upper bounds of a constraint row */ void __EXPORT_TYPE __WINAPI set_rh_vec(lprec *lp, REAL *rh); /* Set the right hand side vector */ MYBOOL __EXPORT_TYPE __WINAPI str_set_rh_vec(lprec *lp, char *rh_string); /* The same, but with string input */ MYBOOL __EXPORT_TYPE __WINAPI add_column(lprec *lp, REAL *column); MYBOOL __EXPORT_TYPE __WINAPI add_columnex(lprec *lp, int count, REAL *column, int *rowno); MYBOOL __EXPORT_TYPE __WINAPI str_add_column(lprec *lp, char *col_string); /* Add a column to the problem */ MYBOOL __EXPORT_TYPE __WINAPI set_column(lprec *lp, int colnr, REAL *column); MYBOOL __EXPORT_TYPE __WINAPI set_columnex(lprec *lp, int colnr, int count, REAL *column, int *rowno); /* Overwrite existing column data */ int __EXPORT_TYPE __WINAPI column_in_lp(lprec *lp, REAL *column); /* Returns the column index if column is already present in lp, otherwise 0. (Does not look at bounds and types, only looks at matrix values */ int __EXPORT_TYPE __WINAPI get_columnex(lprec *lp, int colnr, REAL *column, int *nzrow); MYBOOL __EXPORT_TYPE __WINAPI get_column(lprec *lp, int colnr, REAL *column); /* Fill column with the column col_nr from the problem */ MYBOOL __EXPORT_TYPE __WINAPI del_column(lprec *lp, int colnr); STATIC MYBOOL del_columnex(lprec *lp, LLrec *colmap); /* Delete a column */ MYBOOL __EXPORT_TYPE __WINAPI set_mat(lprec *lp, int rownr, int colnr, REAL value); /* Fill in element (Row,Column) of the matrix Row in [0..Rows] and Column in [1..Columns] */ REAL __EXPORT_TYPE __WINAPI get_mat(lprec *lp, int rownr, int colnr); REAL __EXPORT_TYPE __WINAPI get_mat_byindex(lprec *lp, int matindex, MYBOOL isrow, MYBOOL adjustsign); int __EXPORT_TYPE __WINAPI get_nonzeros(lprec *lp); /* get a single element from the matrix */ /* Name changed from "mat_elm" by KE */ void __EXPORT_TYPE __WINAPI set_bounds_tighter(lprec *lp, MYBOOL tighten); MYBOOL get_bounds(lprec *lp, int column, REAL *lower, REAL *upper); MYBOOL __EXPORT_TYPE __WINAPI get_bounds_tighter(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_upbo(lprec *lp, int colnr, REAL value); REAL __EXPORT_TYPE __WINAPI get_upbo(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI set_lowbo(lprec *lp, int colnr, REAL value); REAL __EXPORT_TYPE __WINAPI get_lowbo(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI set_bounds(lprec *lp, int colnr, REAL lower, REAL upper); MYBOOL __EXPORT_TYPE __WINAPI set_unbounded(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI is_unbounded(lprec *lp, int colnr); /* Set the upper and lower bounds of a variable */ MYBOOL __EXPORT_TYPE __WINAPI set_int(lprec *lp, int colnr, MYBOOL must_be_int); MYBOOL __EXPORT_TYPE __WINAPI is_int(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI set_binary(lprec *lp, int colnr, MYBOOL must_be_bin); MYBOOL __EXPORT_TYPE __WINAPI is_binary(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI set_semicont(lprec *lp, int colnr, MYBOOL must_be_sc); MYBOOL __EXPORT_TYPE __WINAPI is_semicont(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI is_negative(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI set_var_weights(lprec *lp, REAL *weights); int __EXPORT_TYPE __WINAPI get_var_priority(lprec *lp, int colnr); /* Set the type of variable */ MYBOOL __EXPORT_TYPE __WINAPI set_pseudocosts(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit); MYBOOL __EXPORT_TYPE __WINAPI get_pseudocosts(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit); /* Set initial values for, or get computed pseudocost vectors; note that setting of pseudocosts can only happen in response to a call-back function optionally requesting this */ int __EXPORT_TYPE __WINAPI add_SOS(lprec *lp, char *name, int sostype, int priority, int count, int *sosvars, REAL *weights); MYBOOL __EXPORT_TYPE __WINAPI is_SOS_var(lprec *lp, int colnr); /* Add SOS constraints */ MYBOOL __EXPORT_TYPE __WINAPI set_row_name(lprec *lp, int rownr, char *new_name); char __EXPORT_TYPE * __WINAPI get_row_name(lprec *lp, int rownr); char __EXPORT_TYPE * __WINAPI get_origrow_name(lprec *lp, int rownr); /* Set/Get the name of a constraint row */ /* Get added by KE */ MYBOOL __EXPORT_TYPE __WINAPI set_col_name(lprec *lp, int colnr, char *new_name); char __EXPORT_TYPE * __WINAPI get_col_name(lprec *lp, int colnr); char __EXPORT_TYPE * __WINAPI get_origcol_name(lprec *lp, int colnr); /* Set/Get the name of a variable column */ /* Get added by KE */ void __EXPORT_TYPE __WINAPI unscale(lprec *lp); /* Undo previous scaling of the problem */ void __EXPORT_TYPE __WINAPI set_preferdual(lprec *lp, MYBOOL dodual); void __EXPORT_TYPE __WINAPI set_simplextype(lprec *lp, int simplextype); int __EXPORT_TYPE __WINAPI get_simplextype(lprec *lp); /* Set/Get if lp_solve should prefer the dual simplex over the primal -- added by KE */ void __EXPORT_TYPE __WINAPI default_basis(lprec *lp); void __EXPORT_TYPE __WINAPI set_basiscrash(lprec *lp, int mode); int __EXPORT_TYPE __WINAPI get_basiscrash(lprec *lp); int __EXPORT_TYPE __WINAPI set_basisvar(lprec *lp, int basisPos, int enteringCol); MYBOOL __EXPORT_TYPE __WINAPI set_basis(lprec *lp, int *bascolumn, MYBOOL nonbasic); MYBOOL __EXPORT_TYPE __WINAPI get_basis(lprec *lp, int *bascolumn, MYBOOL nonbasic); void __EXPORT_TYPE __WINAPI reset_basis(lprec *lp); /* Set/Get basis for a re-solved system */ /* Added by KE */ MYBOOL __EXPORT_TYPE __WINAPI guess_basis(lprec *lp, REAL *guessvector, int *basisvector); MYBOOL __EXPORT_TYPE __WINAPI is_feasible(lprec *lp, REAL *values, REAL threshold); /* returns TRUE if the vector in values is a feasible solution to the lp */ int __EXPORT_TYPE __WINAPI solve(lprec *lp); /* Solve the problem */ REAL __EXPORT_TYPE __WINAPI time_elapsed(lprec *lp); /* Return the number of seconds since start of solution process */ void __EXPORT_TYPE __WINAPI put_bb_nodefunc(lprec *lp, lphandleint_intfunc newnode, void *bbnodehandle); void __EXPORT_TYPE __WINAPI put_bb_branchfunc(lprec *lp, lphandleint_intfunc newbranch, void *bbbranchhandle); /* Allow the user to override B&B node and branching decisions */ void __EXPORT_TYPE __WINAPI put_abortfunc(lprec *lp, lphandle_intfunc newctrlc, void *ctrlchandle); /* Allow the user to define an interruption callback function */ void __EXPORT_TYPE __WINAPI put_logfunc(lprec *lp, lphandlestr_func newlog, void *loghandle); /* Allow the user to define a logging function */ void __EXPORT_TYPE __WINAPI put_msgfunc(lprec *lp, lphandleint_func newmsg, void *msghandle, int mask); /* Allow the user to define an event-driven message/reporting */ MYBOOL __EXPORT_TYPE __WINAPI get_primal_solution(lprec *lp, REAL *pv); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_primal_solution(lprec *lp, REAL **pv); MYBOOL __EXPORT_TYPE __WINAPI get_dual_solution(lprec *lp, REAL *rc); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_dual_solution(lprec *lp, REAL **rc); MYBOOL __EXPORT_TYPE __WINAPI get_lambda(lprec *lp, REAL *lambda); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_lambda(lprec *lp, REAL **lambda); /* Get the primal, dual/reduced costs and Lambda vectors */ /* Read an MPS file */ lprec __EXPORT_TYPE * __WINAPI read_MPS(char *filename, int options); lprec __EXPORT_TYPE * __WINAPI read_mps(FILE *filename, int options); lprec __EXPORT_TYPE * __WINAPI read_freeMPS(char *filename, int options); lprec __EXPORT_TYPE * __WINAPI read_freemps(FILE *filename, int options); /* Write a MPS file to output */ MYBOOL __EXPORT_TYPE __WINAPI write_mps(lprec *lp, char *filename); MYBOOL __EXPORT_TYPE __WINAPI write_MPS(lprec *lp, FILE *output); MYBOOL __EXPORT_TYPE __WINAPI write_freemps(lprec *lp, char *filename); MYBOOL __EXPORT_TYPE __WINAPI write_freeMPS(lprec *lp, FILE *output); MYBOOL __EXPORT_TYPE __WINAPI write_lp(lprec *lp, char *filename); MYBOOL __EXPORT_TYPE __WINAPI write_LP(lprec *lp, FILE *output); /* Write a LP file to output */ MYBOOL __WINAPI LP_readhandle(lprec **lp, FILE *filename, int verbose, char *lp_name); lprec __EXPORT_TYPE * __WINAPI read_lp(FILE *filename, int verbose, char *lp_name); lprec __EXPORT_TYPE * __WINAPI read_LP(char *filename, int verbose, char *lp_name); /* Old-style lp format file parser */ MYBOOL __EXPORT_TYPE __WINAPI write_basis(lprec *lp, char *filename); MYBOOL __EXPORT_TYPE __WINAPI read_basis(lprec *lp, char *filename, char *info); /* Read and write basis from/to file in CPLEX BAS format */ MYBOOL __EXPORT_TYPE __WINAPI write_params(lprec *lp, char *filename, char *options); MYBOOL __EXPORT_TYPE __WINAPI read_params(lprec *lp, char *filename, char *options); void __EXPORT_TYPE __WINAPI reset_params(lprec *lp); /* Read and write parameter file */ void __EXPORT_TYPE __WINAPI print_lp(lprec *lp); void __EXPORT_TYPE __WINAPI print_tableau(lprec *lp); /* Print the current problem, only useful in very small (test) problems */ void __EXPORT_TYPE __WINAPI print_objective(lprec *lp); void __EXPORT_TYPE __WINAPI print_solution(lprec *lp, int columns); void __EXPORT_TYPE __WINAPI print_constraints(lprec *lp, int columns); /* Print the solution to stdout */ void __EXPORT_TYPE __WINAPI print_duals(lprec *lp); /* Print the dual variables of the solution */ void __EXPORT_TYPE __WINAPI print_scales(lprec *lp); /* If scaling is used, print the scaling factors */ void __EXPORT_TYPE __WINAPI print_str(lprec *lp, char *str); void __EXPORT_TYPE __WINAPI set_outputstream(lprec *lp, FILE *stream); MYBOOL __EXPORT_TYPE __WINAPI set_outputfile(lprec *lp, char *filename); void __EXPORT_TYPE __WINAPI set_verbose(lprec *lp, int verbose); int __EXPORT_TYPE __WINAPI get_verbose(lprec *lp); void __EXPORT_TYPE __WINAPI set_timeout(lprec *lp, long sectimeout); long __EXPORT_TYPE __WINAPI get_timeout(lprec *lp); void __EXPORT_TYPE __WINAPI set_print_sol(lprec *lp, int print_sol); int __EXPORT_TYPE __WINAPI get_print_sol(lprec *lp); void __EXPORT_TYPE __WINAPI set_debug(lprec *lp, MYBOOL debug); MYBOOL __EXPORT_TYPE __WINAPI is_debug(lprec *lp); void __EXPORT_TYPE __WINAPI set_trace(lprec *lp, MYBOOL trace); MYBOOL __EXPORT_TYPE __WINAPI is_trace(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI print_debugdump(lprec *lp, char *filename); void __EXPORT_TYPE __WINAPI set_anti_degen(lprec *lp, int anti_degen); int __EXPORT_TYPE __WINAPI get_anti_degen(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_anti_degen(lprec *lp, int testmask); void __EXPORT_TYPE __WINAPI set_presolve(lprec *lp, int presolvemode, int maxloops); int __EXPORT_TYPE __WINAPI get_presolve(lprec *lp); int __EXPORT_TYPE __WINAPI get_presolveloops(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_presolve(lprec *lp, int testmask); int __EXPORT_TYPE __WINAPI get_orig_index(lprec *lp, int lp_index); int __EXPORT_TYPE __WINAPI get_lp_index(lprec *lp, int orig_index); void __EXPORT_TYPE __WINAPI set_maxpivot(lprec *lp, int max_num_inv); int __EXPORT_TYPE __WINAPI get_maxpivot(lprec *lp); void __EXPORT_TYPE __WINAPI set_obj_bound(lprec *lp, REAL obj_bound); REAL __EXPORT_TYPE __WINAPI get_obj_bound(lprec *lp); void __EXPORT_TYPE __WINAPI set_mip_gap(lprec *lp, MYBOOL absolute, REAL mip_gap); REAL __EXPORT_TYPE __WINAPI get_mip_gap(lprec *lp, MYBOOL absolute); void __EXPORT_TYPE __WINAPI set_bb_rule(lprec *lp, int bb_rule); int __EXPORT_TYPE __WINAPI get_bb_rule(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_var_branch(lprec *lp, int colnr, int branch_mode); int __EXPORT_TYPE __WINAPI get_var_branch(lprec *lp, int colnr); MYBOOL __EXPORT_TYPE __WINAPI is_infinite(lprec *lp, REAL value); void __EXPORT_TYPE __WINAPI set_infinite(lprec *lp, REAL infinite); REAL __EXPORT_TYPE __WINAPI get_infinite(lprec *lp); void __EXPORT_TYPE __WINAPI set_epsint(lprec *lp, REAL epsint); REAL __EXPORT_TYPE __WINAPI get_epsint(lprec *lp); void __EXPORT_TYPE __WINAPI set_epsb(lprec *lp, REAL epsb); REAL __EXPORT_TYPE __WINAPI get_epsb(lprec *lp); void __EXPORT_TYPE __WINAPI set_epsd(lprec *lp, REAL epsd); REAL __EXPORT_TYPE __WINAPI get_epsd(lprec *lp); void __EXPORT_TYPE __WINAPI set_epsel(lprec *lp, REAL epsel); REAL __EXPORT_TYPE __WINAPI get_epsel(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_epslevel(lprec *lp, int epslevel); void __EXPORT_TYPE __WINAPI set_scaling(lprec *lp, int scalemode); int __EXPORT_TYPE __WINAPI get_scaling(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI is_scalemode(lprec *lp, int testmask); MYBOOL __EXPORT_TYPE __WINAPI is_scaletype(lprec *lp, int scaletype); MYBOOL __EXPORT_TYPE __WINAPI is_integerscaling(lprec *lp); void __EXPORT_TYPE __WINAPI set_scalelimit(lprec *lp, REAL scalelimit); REAL __EXPORT_TYPE __WINAPI get_scalelimit(lprec *lp); void __EXPORT_TYPE __WINAPI set_improve(lprec *lp, int improve); int __EXPORT_TYPE __WINAPI get_improve(lprec *lp); void __EXPORT_TYPE __WINAPI set_pivoting(lprec *lp, int piv_rule); int __EXPORT_TYPE __WINAPI get_pivoting(lprec *lp); MYBOOL __EXPORT_TYPE __WINAPI set_partialprice(lprec *lp, int blockcount, int *blockstart, MYBOOL isrow); void __EXPORT_TYPE __WINAPI get_partialprice(lprec *lp, int *blockcount, int *blockstart, MYBOOL isrow); MYBOOL __EXPORT_TYPE __WINAPI set_multiprice(lprec *lp, int multiblockdiv); int __EXPORT_TYPE __WINAPI get_multiprice(lprec *lp, MYBOOL getabssize); MYBOOL __EXPORT_TYPE __WINAPI is_use_names(lprec *lp, MYBOOL isrow); void __EXPORT_TYPE __WINAPI set_use_names(lprec *lp, MYBOOL isrow, MYBOOL use_names); int __EXPORT_TYPE __WINAPI get_nameindex(lprec *lp, char *varname, MYBOOL isrow); MYBOOL __EXPORT_TYPE __WINAPI is_piv_mode(lprec *lp, int testmask); MYBOOL __EXPORT_TYPE __WINAPI is_piv_rule(lprec *lp, int rule); void __EXPORT_TYPE __WINAPI set_break_at_first(lprec *lp, MYBOOL break_at_first); MYBOOL __EXPORT_TYPE __WINAPI is_break_at_first(lprec *lp); void __EXPORT_TYPE __WINAPI set_bb_floorfirst(lprec *lp, int bb_floorfirst); int __EXPORT_TYPE __WINAPI get_bb_floorfirst(lprec *lp); void __EXPORT_TYPE __WINAPI set_bb_depthlimit(lprec *lp, int bb_maxlevel); int __EXPORT_TYPE __WINAPI get_bb_depthlimit(lprec *lp); void __EXPORT_TYPE __WINAPI set_break_at_value(lprec *lp, REAL break_at_value); REAL __EXPORT_TYPE __WINAPI get_break_at_value(lprec *lp); void __EXPORT_TYPE __WINAPI set_negrange(lprec *lp, REAL negrange); REAL __EXPORT_TYPE __WINAPI get_negrange(lprec *lp); void __EXPORT_TYPE __WINAPI set_epsperturb(lprec *lp, REAL epsperturb); REAL __EXPORT_TYPE __WINAPI get_epsperturb(lprec *lp); void __EXPORT_TYPE __WINAPI set_epspivot(lprec *lp, REAL epspivot); REAL __EXPORT_TYPE __WINAPI get_epspivot(lprec *lp); int __EXPORT_TYPE __WINAPI get_max_level(lprec *lp); COUNTER __EXPORT_TYPE __WINAPI get_total_nodes(lprec *lp); COUNTER __EXPORT_TYPE __WINAPI get_total_iter(lprec *lp); REAL __EXPORT_TYPE __WINAPI get_objective(lprec *lp); REAL __EXPORT_TYPE __WINAPI get_working_objective(lprec *lp); REAL __EXPORT_TYPE __WINAPI get_var_primalresult(lprec *lp, int index); REAL __EXPORT_TYPE __WINAPI get_var_dualresult(lprec *lp, int index); MYBOOL __EXPORT_TYPE __WINAPI get_variables(lprec *lp, REAL *var); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_variables(lprec *lp, REAL **var); MYBOOL __EXPORT_TYPE __WINAPI get_constraints(lprec *lp, REAL *constr); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_constraints(lprec *lp, REAL **constr); MYBOOL __EXPORT_TYPE __WINAPI get_sensitivity_rhs(lprec *lp, REAL *duals, REAL *dualsfrom, REAL *dualstill); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_sensitivity_rhs(lprec *lp, REAL **duals, REAL **dualsfrom, REAL **dualstill); MYBOOL __EXPORT_TYPE __WINAPI get_sensitivity_obj(lprec *lp, REAL *objfrom, REAL *objtill); MYBOOL __EXPORT_TYPE __WINAPI get_sensitivity_objex(lprec *lp, REAL *objfrom, REAL *objtill, REAL *objfromvalue, REAL *objtillvalue); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_sensitivity_obj(lprec *lp, REAL **objfrom, REAL **objtill); MYBOOL __EXPORT_TYPE __WINAPI get_ptr_sensitivity_objex(lprec *lp, REAL **objfrom, REAL **objtill, REAL **objfromvalue, REAL **objtillvalue); void __EXPORT_TYPE __WINAPI set_solutionlimit(lprec *lp, int limit); int __EXPORT_TYPE __WINAPI get_solutionlimit(lprec *lp); int __EXPORT_TYPE __WINAPI get_solutioncount(lprec *lp); int __EXPORT_TYPE __WINAPI get_Norig_rows(lprec *lp); int __EXPORT_TYPE __WINAPI get_Nrows(lprec *lp); int __EXPORT_TYPE __WINAPI get_Lrows(lprec *lp); int __EXPORT_TYPE __WINAPI get_Norig_columns(lprec *lp); int __EXPORT_TYPE __WINAPI get_Ncolumns(lprec *lp); typedef int (__WINAPI read_modeldata_func)(void *userhandle, char *buf, int max_size); typedef int (__WINAPI write_modeldata_func)(void *userhandle, char *buf); MYBOOL __WINAPI MPS_readex(lprec **newlp, void *userhandle, read_modeldata_func read_modeldata, int typeMPS, int options); /* #if defined develop */ lprec __EXPORT_TYPE * __WINAPI read_lpex(void *userhandle, read_modeldata_func read_modeldata, int verbose, char *lp_name); MYBOOL __EXPORT_TYPE __WINAPI write_lpex(lprec *lp, void *userhandle, write_modeldata_func write_modeldata); lprec __EXPORT_TYPE * __WINAPI read_mpsex(void *userhandle, read_modeldata_func read_modeldata, int options); lprec __EXPORT_TYPE * __WINAPI read_freempsex(void *userhandle, read_modeldata_func read_modeldata, int options); MYBOOL __EXPORT_TYPE __WINAPI MPS_writefileex(lprec *lp, int typeMPS, void *userhandle, write_modeldata_func write_modeldata); /* #endif */ #ifdef __cplusplus } #endif /* Forward definitions of functions used internaly by the lp toolkit */ MYBOOL set_callbacks(lprec *lp); STATIC int yieldformessages(lprec *lp); MYBOOL __WINAPI userabort(lprec *lp, int message); /*char * __VACALL explain(lprec *lp, char *format, ...); void __VACALL report(lprec *lp, int level, char *format, ...);*/ /* Memory management routines */ STATIC MYBOOL append_rows(lprec *lp, int deltarows); STATIC MYBOOL append_columns(lprec *lp, int deltacolumns); STATIC void inc_rows(lprec *lp, int delta); STATIC void inc_columns(lprec *lp, int delta); STATIC MYBOOL init_rowcol_names(lprec *lp); STATIC MYBOOL inc_row_space(lprec *lp, int deltarows); STATIC MYBOOL inc_col_space(lprec *lp, int deltacols); STATIC MYBOOL shift_rowcoldata(lprec *lp, int base, int delta, LLrec *usedmap, MYBOOL isrow); STATIC MYBOOL shift_basis(lprec *lp, int base, int delta, LLrec *usedmap, MYBOOL isrow); STATIC MYBOOL shift_rowdata(lprec *lp, int base, int delta, LLrec *usedmap); STATIC MYBOOL shift_coldata(lprec *lp, int base, int delta, LLrec *usedmap); /* INLINE */ MYBOOL is_chsign(lprec *lp, int rownr); STATIC MYBOOL inc_lag_space(lprec *lp, int deltarows, MYBOOL ignoreMAT); lprec *make_lag(lprec *server); REAL get_rh_upper(lprec *lp, int rownr); REAL get_rh_lower(lprec *lp, int rownr); MYBOOL set_rh_upper(lprec *lp, int rownr, REAL value); MYBOOL set_rh_lower(lprec *lp, int rownr, REAL value); STATIC int bin_count(lprec *lp, MYBOOL working); STATIC int MIP_count(lprec *lp); STATIC int SOS_count(lprec *lp); STATIC int GUB_count(lprec *lp); STATIC int identify_GUB(lprec *lp, MYBOOL mark); STATIC int prepare_GUB(lprec *lp); STATIC MYBOOL refactRecent(lprec *lp); STATIC MYBOOL check_if_less(lprec *lp, REAL x, REAL y, int variable); STATIC MYBOOL feasiblePhase1(lprec *lp, REAL epsvalue); STATIC void free_duals(lprec *lp); STATIC void initialize_solution(lprec *lp, MYBOOL shiftbounds); STATIC void recompute_solution(lprec *lp, MYBOOL shiftbounds); STATIC int verify_solution(lprec *lp, MYBOOL reinvert, char *info); STATIC int check_solution(lprec *lp, int lastcolumn, REAL *solution, REAL *upbo, REAL *lowbo, REAL tolerance); /* INLINE */ MYBOOL is_fixedvar(lprec *lp, int variable); /* INLINE */ MYBOOL is_splitvar(lprec *lp, int colnr); void __WINAPI set_action(int *actionvar, int actionmask); void __WINAPI clear_action(int *actionvar, int actionmask); MYBOOL __WINAPI is_action(int actionvar, int testmask); /* INLINE */ MYBOOL is_bb_rule(lprec *lp, int bb_rule); /* INLINE */ MYBOOL is_bb_mode(lprec *lp, int bb_mask); /* INLINE */ int get_piv_rule(lprec *lp); STATIC char *get_str_piv_rule(int rule); STATIC MYBOOL __WINAPI set_var_priority(lprec *lp); STATIC int find_sc_bbvar(lprec *lp, int *count); STATIC int find_sos_bbvar(lprec *lp, int *count, MYBOOL intsos); STATIC int find_int_bbvar(lprec *lp, int *count, BBrec *BB, MYBOOL *isfeasible); /* Solution-related functions */ STATIC REAL compute_dualslacks(lprec *lp, int target, REAL **dvalues, int **nzdvalues, MYBOOL dosum); STATIC MYBOOL solution_is_int(lprec *lp, int index, MYBOOL checkfixed); STATIC MYBOOL bb_better(lprec *lp, int target, int mode); STATIC void construct_solution(lprec *lp, REAL *target); STATIC void transfer_solution_var(lprec *lp, int uservar); STATIC MYBOOL construct_duals(lprec *lp); STATIC MYBOOL construct_sensitivity_duals(lprec *lp); STATIC MYBOOL construct_sensitivity_obj(lprec *lp); STATIC int add_GUB(lprec *lp, char *name, int priority, int count, int *sosvars); STATIC basisrec *push_basis(lprec *lp, int *basisvar, MYBOOL *isbasic, MYBOOL *islower); STATIC MYBOOL compare_basis(lprec *lp); STATIC MYBOOL restore_basis(lprec *lp); STATIC MYBOOL pop_basis(lprec *lp, MYBOOL restore); STATIC MYBOOL is_BasisReady(lprec *lp); STATIC MYBOOL is_slackbasis(lprec *lp); STATIC MYBOOL verify_basis(lprec *lp); STATIC int unload_basis(lprec *lp, MYBOOL restorelast); STATIC int perturb_bounds(lprec *lp, BBrec *perturbed, MYBOOL doRows, MYBOOL doCols, MYBOOL includeFIXED); STATIC MYBOOL validate_bounds(lprec *lp, REAL *upbo, REAL *lowbo); STATIC MYBOOL impose_bounds(lprec *lp, REAL * upbo, REAL *lowbo); STATIC int unload_BB(lprec *lp); STATIC REAL feasibilityOffset(lprec *lp, MYBOOL isdual); STATIC MYBOOL isP1extra(lprec *lp); STATIC REAL get_refactfrequency(lprec *lp, MYBOOL final); STATIC int findBasicFixedvar(lprec *lp, int afternr, MYBOOL slacksonly); STATIC MYBOOL isBasisVarFeasible(lprec *lp, REAL tol, int basis_row); STATIC MYBOOL isPrimalFeasible(lprec *lp, REAL tol, int infeasibles[], REAL *feasibilitygap); STATIC MYBOOL isDualFeasible(lprec *lp, REAL tol, int *boundflips, int infeasibles[], REAL *feasibilitygap); /* Main simplex driver routines */ STATIC int preprocess(lprec *lp); STATIC void postprocess(lprec *lp); STATIC MYBOOL performiteration(lprec *lp, int rownr, int varin, LREAL theta, MYBOOL primal, MYBOOL allowminit, REAL *prow, int *nzprow, REAL *pcol, int *nzpcol, int *boundswaps); STATIC void transfer_solution_var(lprec *lp, int uservar); STATIC void transfer_solution(lprec *lp, MYBOOL dofinal); /* Scaling utilities */ STATIC REAL scaled_floor(lprec *lp, int colnr, REAL value, REAL epsscale); STATIC REAL scaled_ceil(lprec *lp, int colnr, REAL value, REAL epsscale); /* Variable mapping utility routines */ STATIC void varmap_lock(lprec *lp); STATIC void varmap_clear(lprec *lp); STATIC MYBOOL varmap_canunlock(lprec *lp); STATIC void varmap_addconstraint(lprec *lp); STATIC void varmap_addcolumn(lprec *lp); STATIC void varmap_delete(lprec *lp, int base, int delta, LLrec *varmap); STATIC void varmap_compact(lprec *lp, int prev_rows, int prev_cols); STATIC MYBOOL varmap_validate(lprec *lp, int varno); /* STATIC MYBOOL del_varnameex(lprec *lp, hashelem **namelist, hashtable *ht, int varnr, LLrec *varmap); */ STATIC MYBOOL del_varnameex(lprec *lp, hashelem **namelist, int items, hashtable *ht, int varnr, LLrec *varmap); /* Pseudo-cost routines (internal) */ STATIC BBPSrec *init_pseudocost(lprec *lp, int pseudotype); STATIC void free_pseudocost(lprec *lp); STATIC REAL get_pseudorange(BBPSrec *pc, int mipvar, int varcode); STATIC void update_pseudocost(BBPSrec *pc, int mipvar, int varcode, MYBOOL capupper, REAL varsol); STATIC REAL get_pseudobranchcost(BBPSrec *pc, int mipvar, MYBOOL dofloor); STATIC REAL get_pseudonodecost(BBPSrec *pc, int mipvar, int vartype, REAL varsol); /* Matrix access and equation solving routines */ STATIC void set_OF_override(lprec *lp, REAL *ofVector); STATIC void set_OF_p1extra(lprec *lp, REAL p1extra); STATIC void unset_OF_p1extra(lprec *lp); MYBOOL modifyOF1(lprec *lp, int index, REAL *ofValue, REAL mult); REAL __WINAPI get_OF_active(lprec *lp, int varnr, REAL mult); STATIC MYBOOL is_OF_nz(lprec *lp, int colnr); STATIC int get_basisOF(lprec *lp, int coltarget[], REAL crow[], int colno[]); int __WINAPI get_basiscolumn(lprec *lp, int j, int rn[], double bj[]); int __WINAPI obtain_column(lprec *lp, int varin, REAL *pcol, int *nzlist, int *maxabs); STATIC int compute_theta(lprec *lp, int rownr, LREAL *theta, int isupbound, REAL HarrisScalar, MYBOOL primal); /* Pivot utility routines */ STATIC int findBasisPos(lprec *lp, int notint, int *var_basic); STATIC MYBOOL check_degeneracy(lprec *lp, REAL *pcol, int *degencount); #endif /* HEADER_lp_lib */ lp_solve_5.5/lp_matrix.c100666 0 0 321572 11250514513 13751 0ustar usergroup #include #include "commonlib.h" #include "lp_lib.h" #include "lp_scale.h" #include "lp_report.h" #include "lp_price.h" #include "lp_pricePSE.h" #include "lp_matrix.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* ------------------------------------------------------------------------- Basic matrix routines in lp_solve v5.0+ ------------------------------------------------------------------------- Author: Michel Berkelaar (to lp_solve v3.2), Kjell Eikland (v4.0 and forward) Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h, lp_pricerPSE.h, lp_matrix.h Release notes: v5.0.0 1 January 2004 First integrated and repackaged version. v5.0.1 7 May 2004 Added matrix transpose function. v5.1.0 20 July 2004 Reworked with flexible matrix storage model. v5.2.0 10 January 2005 Added fast deletion methods. Added data extraction to matrix method. Changed to explicit OF storage mode. ------------------------------------------------------------------------- */ STATIC MATrec *mat_create(lprec *lp, int rows, int columns, REAL epsvalue) { MATrec *newmat; newmat = (MATrec *) calloc(1, sizeof(*newmat)); newmat->lp = lp; newmat->rows_alloc = 0; newmat->columns_alloc = 0; newmat->mat_alloc = 0; inc_matrow_space(newmat, rows); newmat->rows = rows; inc_matcol_space(newmat, columns); newmat->columns = columns; inc_mat_space(newmat, 0); newmat->epsvalue = epsvalue; return( newmat ); } STATIC void mat_free(MATrec **matrix) { if((matrix == NULL) || (*matrix == NULL)) return; #if MatrixColAccess==CAM_Record FREE((*matrix)->col_mat); #else /*if MatrixColAccess==CAM_Vector*/ FREE((*matrix)->col_mat_colnr); FREE((*matrix)->col_mat_rownr); FREE((*matrix)->col_mat_value); #endif FREE((*matrix)->col_end); FREE((*matrix)->col_tag); #if MatrixRowAccess==RAM_Index FREE((*matrix)->row_mat); #elif MatrixColAccess==CAM_Record FREE((*matrix)->row_mat); #else /*if MatrixRowAccess==COL_Vector*/ FREE((*matrix)->row_mat_colnr); FREE((*matrix)->row_mat_rownr); FREE((*matrix)->row_mat_value); #endif FREE((*matrix)->row_end); FREE((*matrix)->row_tag); FREE((*matrix)->colmax); FREE((*matrix)->rowmax); FREE(*matrix); } STATIC MYBOOL mat_memopt(MATrec *mat, int rowextra, int colextra, int nzextra) { MYBOOL status = TRUE; int matalloc, colalloc, rowalloc; if((mat == NULL) || #if 0 (++rowextra < 1) || (++colextra < 1) || (++nzextra < 1)) #else (rowextra < 0) || (colextra < 0) || (nzextra < 0)) #endif return( FALSE ); mat->rows_alloc = MIN(mat->rows_alloc, mat->rows + rowextra); mat->columns_alloc = MIN(mat->columns_alloc, mat->columns + colextra); mat->mat_alloc = MIN(mat->mat_alloc, mat->col_end[mat->columns] + nzextra); #if 0 rowalloc = mat->rows_alloc; colalloc = mat->columns_alloc; matalloc = mat->mat_alloc; #else rowalloc = mat->rows_alloc + 1; colalloc = mat->columns_alloc + 1; matalloc = mat->mat_alloc + 1; #endif #if MatrixColAccess==CAM_Record mat->col_mat = (MATitem *) realloc(mat->col_mat, matalloc * sizeof(*(mat->col_mat))); status &= (mat->col_mat != NULL); #else /*if MatrixColAccess==CAM_Vector*/ status &= allocINT(mat->lp, &(mat->col_mat_colnr), matalloc, AUTOMATIC) && allocINT(mat->lp, &(mat->col_mat_rownr), matalloc, AUTOMATIC) && allocREAL(mat->lp, &(mat->col_mat_value), matalloc, AUTOMATIC); #endif status &= allocINT(mat->lp, &mat->col_end, colalloc, AUTOMATIC); if(mat->col_tag != NULL) status &= allocINT(mat->lp, &mat->col_tag, colalloc, AUTOMATIC); #if MatrixRowAccess==RAM_Index status &= allocINT(mat->lp, &(mat->row_mat), matalloc, AUTOMATIC); #elif MatrixColAccess==CAM_Record mat->row_mat = (MATitem *) realloc(mat->row_mat, matalloc * sizeof(*(mat->row_mat))); status &= (mat->row_mat != NULL); #else /*if MatrixRowAccess==COL_Vector*/ status &= allocINT(mat->lp, &(mat->row_mat_colnr), matalloc, AUTOMATIC) && allocINT(mat->lp, &(mat->row_mat_rownr), matalloc, AUTOMATIC) && allocREAL(mat->lp, &(mat->row_mat_value), matalloc, AUTOMATIC); #endif status &= allocINT(mat->lp, &mat->row_end, rowalloc, AUTOMATIC); if(mat->row_tag != NULL) status &= allocINT(mat->lp, &mat->row_tag, rowalloc, AUTOMATIC); if(mat->colmax != NULL) status &= allocREAL(mat->lp, &(mat->colmax), colalloc, AUTOMATIC); if(mat->rowmax != NULL) status &= allocREAL(mat->lp, &(mat->rowmax), rowalloc, AUTOMATIC); return( status ); } STATIC MYBOOL inc_mat_space(MATrec *mat, int mindelta) { int spaceneeded, nz = mat_nonzeros(mat); if(mindelta <= 0) mindelta = MAX(mat->rows, mat->columns) + 1; spaceneeded = DELTA_SIZE(mindelta, nz); SETMAX(mindelta, spaceneeded); if(mat->mat_alloc == 0) spaceneeded = mindelta; else spaceneeded = nz + mindelta; if(spaceneeded >= mat->mat_alloc) { /* Let's allocate at least MAT_START_SIZE entries */ if(mat->mat_alloc < MAT_START_SIZE) mat->mat_alloc = MAT_START_SIZE; /* Increase the size by RESIZEFACTOR each time it becomes too small */ while(spaceneeded >= mat->mat_alloc) mat->mat_alloc += mat->mat_alloc / RESIZEFACTOR; #if MatrixColAccess==CAM_Record mat->col_mat = (MATitem *) realloc(mat->col_mat, (mat->mat_alloc) * sizeof(*(mat->col_mat))); #else /*if MatrixColAccess==CAM_Vector*/ allocINT(mat->lp, &(mat->col_mat_colnr), mat->mat_alloc, AUTOMATIC); allocINT(mat->lp, &(mat->col_mat_rownr), mat->mat_alloc, AUTOMATIC); allocREAL(mat->lp, &(mat->col_mat_value), mat->mat_alloc, AUTOMATIC); #endif #if MatrixRowAccess==RAM_Index allocINT(mat->lp, &(mat->row_mat), mat->mat_alloc, AUTOMATIC); #elif MatrixColAccess==CAM_Record mat->row_mat = (MATitem *) realloc(mat->row_mat, (mat->mat_alloc) * sizeof(*(mat->row_mat))); #else /*if MatrixColAccess==CAM_Vector*/ allocINT(mat->lp, &(mat->row_mat_colnr), mat->mat_alloc, AUTOMATIC); allocINT(mat->lp, &(mat->row_mat_rownr), mat->mat_alloc, AUTOMATIC); allocREAL(mat->lp, &(mat->row_mat_value), mat->mat_alloc, AUTOMATIC); #endif } return(TRUE); } STATIC MYBOOL inc_matrow_space(MATrec *mat, int deltarows) { int rowsum, oldrowsalloc; MYBOOL status = TRUE; /* Adjust lp row structures */ if(mat->rows+deltarows >= mat->rows_alloc) { /* Update memory allocation and sizes */ oldrowsalloc = mat->rows_alloc; deltarows = DELTA_SIZE(deltarows, mat->rows); SETMAX(deltarows, DELTAROWALLOC); mat->rows_alloc += deltarows; rowsum = mat->rows_alloc + 1; /* Update row pointers */ status = allocINT(mat->lp, &mat->row_end, rowsum, AUTOMATIC); mat->row_end_valid = FALSE; } return( status ); } STATIC MYBOOL inc_matcol_space(MATrec *mat, int deltacols) { int i, colsum, oldcolsalloc; MYBOOL status = TRUE; /* Adjust lp column structures */ if(mat->columns+deltacols >= mat->columns_alloc) { /* Update memory allocation and sizes */ oldcolsalloc = mat->columns_alloc; deltacols = DELTA_SIZE(deltacols, mat->columns); SETMAX(deltacols, DELTACOLALLOC); mat->columns_alloc += deltacols; colsum = mat->columns_alloc + 1; status = allocINT(mat->lp, &mat->col_end, colsum, AUTOMATIC); /* Update column pointers */ if(oldcolsalloc == 0) mat->col_end[0] = 0; for(i = MIN(oldcolsalloc, mat->columns) + 1; i < colsum; i++) mat->col_end[i] = mat->col_end[i-1]; mat->row_end_valid = FALSE; } return( status ); } STATIC int mat_collength(MATrec *mat, int colnr) { return( mat->col_end[colnr] - mat->col_end[colnr-1] ); } STATIC int mat_rowlength(MATrec *mat, int rownr) { if(mat_validate(mat)) { if(rownr <= 0) return( mat->row_end[0] ); else return( mat->row_end[rownr] - mat->row_end[rownr-1] ); } else return( 0 ); } STATIC int mat_nonzeros(MATrec *mat) { return( mat->col_end[mat->columns] ); } STATIC MYBOOL mat_indexrange(MATrec *mat, int index, MYBOOL isrow, int *startpos, int *endpos) { #ifdef Paranoia if(isrow && ((index < 0) || (index > mat->rows))) return( FALSE ); else if(!isrow && ((index < 1) || (index > mat->columns))) return( FALSE ); #endif if(isrow && mat_validate(mat)) { if(index == 0) *startpos = 0; else *startpos = mat->row_end[index-1]; *endpos = mat->row_end[index]; } else { *startpos = mat->col_end[index-1]; *endpos = mat->col_end[index]; } return( TRUE ); } STATIC int mat_shiftrows(MATrec *mat, int *bbase, int delta, LLrec *varmap) { int j, k, i, ii, thisrow, *colend, base; MYBOOL preparecompact = FALSE; int *rownr; if(delta == 0) return( 0 ); base = abs(*bbase); if(delta > 0) { /* Insert row by simply incrementing existing row indeces */ if(base <= mat->rows) { k = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); for(ii = 0; ii < k; ii++, rownr += matRowColStep) { if(*rownr >= base) *rownr += delta; } } /* Set defaults (actual basis set in separate procedure) */ for(i = 0; i < delta; i++) { ii = base + i; mat->row_end[ii] = 0; } } else if(base <= mat->rows) { /* Check for preparation of mass-deletion of rows */ preparecompact = (MYBOOL) (varmap != NULL); if(preparecompact) { /* Create the offset array */ int *newrowidx = NULL; allocINT(mat->lp, &newrowidx, mat->rows+1, FALSE); newrowidx[0] = 0; delta = 0; for(j = 1; j <= mat->rows; j++) { if(isActiveLink(varmap, j)) { delta++; newrowidx[j] = delta; } else newrowidx[j] = -1; } k = 0; delta = 0; base = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); for(i = 0; i < base; i++, rownr += matRowColStep) { thisrow = newrowidx[*rownr]; if(thisrow < 0) { *rownr = -1; delta++; } else *rownr = thisrow; } FREE(newrowidx); return(delta); } /* Check if we should prepare for compacting later (this is in order to speed up multiple row deletions) */ preparecompact = (MYBOOL) (*bbase < 0); if(preparecompact) *bbase = my_flipsign((*bbase)); /* First make sure we don't cross the row count border */ if(base-delta-1 > mat->rows) delta = base - mat->rows - 1; /* Then scan over all entries shifting and updating rows indeces */ if(preparecompact) { k = 0; for(j = 1, colend = mat->col_end + 1; j <= mat->columns; j++, colend++) { i = k; k = *colend; rownr = &COL_MAT_ROWNR(i); for(; i < k; i++, rownr += matRowColStep) { thisrow = *rownr; if(thisrow < base) continue; else if(thisrow >= base-delta) *rownr += delta; else *rownr = -1; } } } else { k = 0; ii = 0; for(j = 1, colend = mat->col_end + 1; j <= mat->columns; j++, colend++) { i = k; k = *colend; rownr = &COL_MAT_ROWNR(i); for(; i < k; i++, rownr += matRowColStep) { thisrow = *rownr; if(thisrow >= base) { if(thisrow >= base-delta) *rownr += delta; else continue; } if(ii != i) { COL_MAT_COPY(ii, i); } ii++; } *colend = ii; } } } return( 0 ); } /* Map-based compacting+insertion of matrix elements without changing row and column indeces. When mat2 is NULL, a simple compacting of non-deleted rows and columns is done. */ STATIC int mat_mapreplace(MATrec *mat, LLrec *rowmap, LLrec *colmap, MATrec *mat2) { lprec *lp = mat->lp; int i, ib, ie, ii, j, jj, jb, je, nz, *colend, *rownr, *rownr2, *indirect = NULL; REAL *value, *value2; /* Check if there is something to insert */ if((mat2 != NULL) && ((mat2->col_tag == NULL) || (mat2->col_tag[0] <= 0) || (mat_nonzeros(mat2) == 0))) return( 0 ); /* Create map and sort by increasing index in "mat" */ if(mat2 != NULL) { jj = mat2->col_tag[0]; allocINT(lp, &indirect, jj+1, FALSE); indirect[0] = jj; for(i = 1; i <= jj; i++) indirect[i] = i; hpsortex(mat2->col_tag, jj, 1, sizeof(*indirect), FALSE, compareINT, indirect); } /* Do the compacting */ mat->row_end_valid = FALSE; nz = mat->col_end[mat->columns]; ie = 0; ii = 0; if((mat2 == NULL) || (indirect[0] == 0)) { je = mat->columns + 1; jj = 1; jb = 0; } else { je = indirect[0]; jj = 0; do { jj++; jb = mat2->col_tag[jj]; } while(jb <= 0); } for(j = 1, colend = mat->col_end + 1; j <= mat->columns; j++, colend++) { ib = ie; ie = *colend; /* Always skip (condense) replacement columns */ if(j == jb) { jj++; if(jj <= je) jb = mat2->col_tag[jj]; else jb = mat->columns + 1; } /* Only include active columns */ else if(isActiveLink(colmap, j)) { rownr = &COL_MAT_ROWNR(ib); for(; ib < ie; ib++, rownr += matRowColStep) { /* Also make sure the row is active */ if(isActiveLink(rowmap, *rownr)) { if(ii != ib) { COL_MAT_COPY(ii, ib); } ii++; } } } *colend = ii; } if(mat2 == NULL) goto Finish; /* Tally non-zero insertions */ i = 0; for(j = 1; j <= mat2->col_tag[0]; j++) { jj = mat2->col_tag[j]; if((jj > 0) && isActiveLink(colmap, jj)) { jj = indirect[j]; je = mat2->col_end[jj]; jb = mat2->col_end[jj-1]; rownr2 = &COL_MAT2_ROWNR(jb); for(; jb < je; jb++, rownr2 += matRowColStep) { if((*rownr2 > 0) && isActiveLink(rowmap, *rownr2)) i++; } } } /* Make sure we have enough matrix space */ ii = mat->col_end[mat->columns] + i; if(mat->mat_alloc <= ii) inc_mat_space(mat, i); /* Do shifting and insertion - loop from the end going forward */ jj = indirect[0]; jj = mat2->col_tag[jj]; for(j = mat->columns, colend = mat->col_end + mat->columns, ib = *colend; j > 0; j--) { /* Update indeces for this loop */ ie = ib; *colend = ii; colend--; ib = *colend; /* Insert new values */ if(j == jj) { /* Only include an active column */ if(isActiveLink(colmap, j)) { jj = indirect[0]; jj = indirect[jj]; rownr = &COL_MAT_ROWNR(ii-1); value = &COL_MAT_VALUE(ii-1); jb = mat2->col_end[jj-1]; je = mat2->col_end[jj] - 1; rownr2 = &COL_MAT2_ROWNR(je); value2 = &COL_MAT2_VALUE(je); /* Process constraint coefficients */ for(; je >= jb; je--, rownr2 -= matRowColStep, value2 -= matValueStep) { i = *rownr2; if(i == 0) { i = -1; break; } else if(isActiveLink(rowmap, i)) { ii--; *rownr = i; rownr -= matRowColStep; *value = my_chsign(is_chsign(lp, i), *value2); value -= matValueStep; } } /* Then handle the objective */ if(i == -1) { lp->orig_obj[j] = my_chsign(is_maxim(lp), *value2); rownr2 -= matRowColStep; value2 -= matValueStep; } else lp->orig_obj[j] = 0; } /* Update replacement column index or break if no more candidates */ jj = --indirect[0]; if(jj == 0) break; jj = mat2->col_tag[jj]; if(jj <= 0) break; } /* Shift existing values down */ else { if(isActiveLink(colmap, j)) while(ie > ib) { ii--; ie--; if(ie != ii) { COL_MAT_COPY(ii, ie); } } } } /* Return the delta number of non-zero elements */ Finish: nz -= mat->col_end[mat->columns]; FREE(indirect); return( nz ); } /* Routines to compact rows in matrix based on precoded entries */ STATIC int mat_zerocompact(MATrec *mat) { return( mat_rowcompact(mat, TRUE) ); } STATIC int mat_rowcompact(MATrec *mat, MYBOOL dozeros) { int i, ie, ii, j, nn, *colend, *rownr; REAL *value; nn = 0; ie = 0; ii = 0; for(j = 1, colend = mat->col_end + 1; j <= mat->columns; j++, colend++) { i = ie; ie = *colend; rownr = &COL_MAT_ROWNR(i); value = &COL_MAT_VALUE(i); for(; i < ie; i++, rownr += matRowColStep, value += matValueStep) { if((*rownr < 0) || (dozeros && (fabs(*value) < mat->epsvalue))) { nn++; continue; } if(ii != i) { COL_MAT_COPY(ii, i); } ii++; } *colend = ii; } return( nn ); } /* Routines to compact columns and their indeces based on precoded entries */ STATIC int mat_colcompact(MATrec *mat, int prev_rows, int prev_cols) { int i, ii, j, k, n_del, n_sum, *colend, *newcolend, *colnr, newcolnr; MYBOOL deleted; lprec *lp = mat->lp; presolveundorec *lpundo = lp->presolve_undo; n_sum = 0; k = 0; ii = 0; newcolnr = 1; for(j = 1, colend = newcolend = mat->col_end + 1; j <= prev_cols; j++, colend++) { n_del = 0; i = k; k = *colend; for(colnr = &COL_MAT_COLNR(i); i < k; i++, colnr += matRowColStep) { if(*colnr < 0) { n_del++; n_sum++; continue; } if(ii < i) { COL_MAT_COPY(ii, i); } if(newcolnr < j) { COL_MAT_COLNR(ii) = newcolnr; } ii++; } *newcolend = ii; deleted = (MYBOOL) (n_del > 0); #if 1 /* Do hoops in case there was an empty column */ deleted |= (MYBOOL) (!lp->wasPresolved && (lpundo->var_to_orig[prev_rows+j] < 0)); #endif /* Increment column variables if current column was not deleted */ if(!deleted) { newcolend++; newcolnr++; } } return(n_sum); } STATIC int mat_shiftcols(MATrec *mat, int *bbase, int delta, LLrec *varmap) { int i, ii, k, n, base; k = 0; if(delta == 0) return( k ); base = abs(*bbase); if(delta > 0) { /* Shift pointers right */ for(ii = mat->columns; ii > base; ii--) { i = ii + delta; mat->col_end[i] = mat->col_end[ii]; } /* Set defaults */ for(i = 0; i < delta; i++) { ii = base + i; mat->col_end[ii] = mat->col_end[ii-1]; } } else { /* Check for preparation of mass-deletion of columns */ MYBOOL preparecompact = (MYBOOL) (varmap != NULL); if(preparecompact) { /* Create the offset array */ int j, *colnr, *colend; n = 0; k = 0; base = 0; for(j = 1, colend = mat->col_end + 1; j <= mat->columns; j++, colend++) { i = k; k = *colend; if(isActiveLink(varmap, j)) { base++; ii = base; } else ii = -1; if(ii < 0) n += k - i; colnr = &COL_MAT_COLNR(i); for(; i < k; i++, colnr += matRowColStep) *colnr = ii; } return(n); } /* Check if we should prepare for compacting later (this is in order to speed up multiple column deletions) */ preparecompact = (MYBOOL) (*bbase < 0); if(preparecompact) *bbase = my_flipsign((*bbase)); /* First make sure we don't cross the column count border */ if(base-delta-1 > mat->columns) delta = base - mat->columns - 1; /* Then scan over all entries shifting and updating column indeces */ if(preparecompact) { int *colnr; n = 0; i = mat->col_end[base-1]; k = mat->col_end[base-delta-1]; for(colnr = &COL_MAT_COLNR(i); i < k; i++, colnr += matRowColStep) { n++; *colnr = -1; } k = n; } else { /* Delete sparse matrix data, if required */ if(base <= mat->columns) { i = mat->col_end[base-1]; /* Beginning of data to be deleted */ ii = mat->col_end[base-delta-1]; /* Beginning of data to be shifted left */ n = mat_nonzeros(mat); /* Total number of non-zeros */ k = ii-i; /* Number of entries to be deleted */ if((k > 0) && (n > i)) { n -= ii; COL_MAT_MOVE(i, ii, n); } /* Update indexes */ for(i = base; i <= mat->columns + delta; i++) { ii = i - delta; mat->col_end[i] = mat->col_end[ii] - k; } } } } return( k ); } STATIC MATrec *mat_extractmat(MATrec *mat, LLrec *rowmap, LLrec *colmap, MYBOOL negated) { int *rownr, *colnr, xa, na; REAL *value; MATrec *newmat = mat_create(mat->lp, mat->rows, mat->columns, mat->epsvalue); /* Initialize */ na = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); colnr = &COL_MAT_COLNR(0); value = &COL_MAT_VALUE(0); /* Loop over the indeces, picking out values in qualifying rows and colums (note that the loop could be speeded up for dense matrices by making an outer loop for columns and inner loop for rows) */ for(xa = 0; xa < na; xa++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) { if((isActiveLink(colmap, *colnr) ^ negated) && (isActiveLink(rowmap, *rownr) ^ negated)) mat_setvalue(newmat, *rownr, *colnr, *value, FALSE); } /* Return the populated new matrix */ return( newmat ); } STATIC MYBOOL mat_setcol(MATrec *mat, int colno, int count, REAL *column, int *rowno, MYBOOL doscale, MYBOOL checkrowmode) { int i, jj = 0, elmnr, orignr, newnr, firstrow; MYBOOL *addto = NULL, isA, isNZ; REAL value, saved = 0; lprec *lp = mat->lp; /* Check if we are in row order mode and should add as row instead; the matrix will be transposed at a later stage */ if(checkrowmode && mat->is_roworder) return( mat_setrow(mat, colno, count, column, rowno, doscale, FALSE) ); /* Initialize and validate */ isA = (MYBOOL) (mat == mat->lp->matA); isNZ = (MYBOOL) (rowno != NULL); if(!isNZ) count = mat->lp->rows; else if((count < 0) || (count > mat->rows+((mat->is_roworder) ? 0 : 1))) return( FALSE ); if(isNZ && (count > 0)) { if(count > 1) sortREALByINT(column, rowno, count, 0, TRUE); if((rowno[0] < 0) || (rowno[count-1] > mat->rows)) return( FALSE ); } /* Capture OF definition in column mode */ if(isA && !mat->is_roworder) { if(isNZ && (count > 0) && (rowno[0] == 0)) { value = column[0]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif if(doscale) value = scaled_mat(lp, value, 0, colno); value = my_chsign(is_maxim(lp), value); lp->orig_obj[colno] = value; count--; column++; rowno++; } else if(!isNZ && (column[0] != 0)) { value = saved = column[0]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif if(doscale) value = scaled_mat(lp, value, 0, colno); value = my_chsign(is_maxim(lp), value); lp->orig_obj[colno] = value; column[0] = 0; } else lp->orig_obj[colno] = 0; } /* Optionally tally and map the new non-zero values */ firstrow = mat->rows + 1; if(isNZ) { newnr = count; if(newnr) { firstrow = rowno[0]; jj = rowno[newnr - 1]; } } else { newnr = 0; if(!allocMYBOOL(lp, &addto, mat->rows + 1, TRUE)) { return( FALSE ); } for(i = mat->rows; i >= 0; i--) { if(fabs(column[i]) > mat->epsvalue) { addto[i] = TRUE; firstrow = i; newnr++; } } } /* Make sure we have enough matrix space */ if(!inc_mat_space(mat, newnr)) { newnr = 0; goto Done; } /* Shift existing column data and adjust position indeces */ orignr = mat_collength(mat, colno); elmnr = newnr - orignr; i = mat_nonzeros(mat) - mat->col_end[colno]; if((elmnr != 0) && (i > 0)) { COL_MAT_MOVE(mat->col_end[colno] + elmnr, mat->col_end[colno], i); } if(elmnr != 0) for(i = colno; i <= mat->columns; i++) mat->col_end[i] += elmnr; /* We are now ready to copy the new data */ jj = mat->col_end[colno-1]; if(isNZ) { for(i = 0; i < count; jj++, i++) { value = column[i]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif if(mat->is_roworder) { /* Fix following Ingmar Stein bug report 12.10.2006 */ if(isA && doscale) value = scaled_mat(lp, value, colno, rowno[i]); if(isA) value = my_chsign(is_chsign(lp, colno), value); } else { if(isA && doscale) value = scaled_mat(lp, value, rowno[i], colno); if(isA) value = my_chsign(is_chsign(lp, rowno[i]), value); } SET_MAT_ijA(jj, rowno[i], colno, value); } } else { for(i = firstrow; i <= mat->rows; i++) { if(!addto[i]) continue; value = column[i]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif if(mat->is_roworder) { /* Fix following Ingmar Stein bug report 12.10.2006 */ if(isA && doscale) value = scaled_mat(lp, value, colno, i); if(isA) value = my_chsign(is_chsign(lp, colno), value); } else { if(isA && doscale) value = scaled_mat(lp, value, i, colno); if(isA) value = my_chsign(is_chsign(lp, i), value); } SET_MAT_ijA(jj, i, colno, value); jj++; } } mat->row_end_valid = FALSE; /* Finish and return */ Done: if(saved != 0) column[0] = saved; FREE(addto); return( TRUE ); } STATIC MYBOOL mat_mergemat(MATrec *target, MATrec *source, MYBOOL usecolmap) { lprec *lp = target->lp; int i, ix, iy, n, *colmap = NULL; REAL *colvalue = NULL; if((target->rows < source->rows) || !allocREAL(lp, &colvalue, target->rows+1, FALSE)) return( FALSE ); if(usecolmap) { n = source->col_tag[0]; allocINT(lp, &colmap, n+1, FALSE); for(i = 1; i <= n; i++) colmap[i] = i; hpsortex(source->col_tag, n, 1, sizeof(*colmap), FALSE, compareINT, colmap); } else n = source->columns; for(i = 1; i <= n; i++) { if(!usecolmap && (mat_collength(source, i) == 0)) continue; if(usecolmap) { ix = colmap[i]; if(ix <= 0) continue; iy = source->col_tag[i]; if(iy <= 0) continue; } else ix = iy = i; mat_expandcolumn(source, ix, colvalue, NULL, FALSE); mat_setcol(target, iy, 0, colvalue, NULL, FALSE, FALSE); } FREE( colvalue ); FREE( colmap ); return( TRUE ); } STATIC int mat_nz_unused(MATrec *mat) { return( mat->mat_alloc - mat->col_end[mat->columns] ); } #if 0 STATIC MYBOOL mat_setrow(MATrec *mat, int rowno, int count, REAL *row, int *colno, MYBOOL doscale, MYBOOL checkrowmode) { lprec *lp = mat->lp; int delta; int k, kk, i, ii, j, jj = 0, jj_j, elmnr, orignr, newnr, firstcol, rownr, colnr, matz = 0; MYBOOL *addto = NULL, isA, isNZ; REAL value = 0.0, saved = 0; /* Check if we are in row order mode and should add as column instead; the matrix will be transposed at a later stage */ if(checkrowmode && mat->is_roworder) return( mat_setcol(mat, rowno, count, row, colno, doscale, FALSE) ); /* Do initialization and validation */ if(!mat_validate(mat)) return( FALSE ); isA = (MYBOOL) (mat == lp->matA); isNZ = (MYBOOL) (colno != NULL); if(!isNZ) count = mat->columns; else if((count < 0) || (count > mat->columns)) return( FALSE ); if(isNZ && (count > 0)) { if(count > 1) sortREALByINT(row, (int *) colno, count, 0, TRUE); if((colno[0] < 1) || (colno[count-1] > mat->columns)) return( FALSE ); } /* Capture OF definition in row mode */ if(isA && mat->is_roworder) { lp->orig_obj[rowno] = 0; if(isNZ && (count > 0) && (colno[0] == 0)) { value = row[0]; if(doscale) value = scaled_mat(lp, value, 0, rowno); value = my_chsign(is_maxim(lp), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif lp->orig_obj[rowno] = value; count--; row++; colno++; } else if(!isNZ && (row[0] != 0)) { value = saved = row[0]; if(doscale) value = scaled_mat(lp, value, 0, rowno); value = my_chsign(is_maxim(lp), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif lp->orig_obj[rowno] = value; row[0] = 0; } else { lp->orig_obj[rowno] = 0; value = 0; } } /* Optionally tally and map the new non-zero values */ i = mat->row_end[rowno-1]; ii = mat->row_end[rowno]; // ****** KE 20070106 - was "-1" firstcol = mat->columns + 1; if(isNZ) { /* See if we can do fast in-place replacements of leading items */ colnr = 1; /* initialise in case of an empty row */ while((i < ii) /* && (count > 0) */ && ((colnr = ROW_MAT_COLNR(i)) == *colno) && (count > 0)) { value = *row; // ****** KE 20080111 - Added line if(mat->is_roworder) { if(isA && doscale) value = scaled_mat(lp, value, colnr, rowno); if(isA) value = my_chsign(is_chsign(lp, colnr), value); } else { if(isA && doscale) value = scaled_mat(lp, value, rowno, colnr); if(isA) value = my_chsign(is_chsign(lp, rowno), value); } #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); if(value == 0) matz++; #endif ROW_MAT_VALUE(i) = value; i++; count--; row++; colno++; } if(i >= ii) colnr = 0; /* Proceed with remaining entries */ newnr = count; if(newnr > 0) firstcol = colno[0]; } else { newnr = 0; kk = mat->columns; if(i < ii) colnr = ROW_MAT_COLNR(i); else colnr = 0; for(k = 1; k <= kk; k++) { value = row[k]; // ****** KE 20080111 - Added line if(fabs(value) > mat->epsvalue) { /* See if we can do fast in-place replacements of leading items */ if((addto == NULL) && (i < ii) && (colnr == k)) { if(mat->is_roworder) { if(isA && doscale) value = scaled_mat(lp, value, colnr, rowno); if(isA) value = my_chsign(is_chsign(lp, colnr), value); } else { if(isA && doscale) value = scaled_mat(lp, value, rowno, colnr); if(isA) value = my_chsign(is_chsign(lp, rowno), value); } #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); if(value == 0) matz++; #endif ROW_MAT_VALUE(i) = value; i++; if(i < ii) colnr = ROW_MAT_COLNR(i); else colnr = 0; } /* Otherwise update addto-list */ else { if(addto == NULL) { if(!allocMYBOOL(lp, &addto, mat->columns + 1, TRUE)) return( FALSE ); firstcol = k; } addto[k] = TRUE; newnr++; } } } } if(newnr == 0) if (FALSE) return( TRUE ); /* Make sure we have enough matrix space */ if((newnr > 0) && (mat_nz_unused(mat) <= newnr) && !inc_mat_space(mat, newnr)) { newnr = 0; goto Done; } /* Pack initial entries if existing row data has a lower column start index than the first index of the new vector */ orignr = mat_nonzeros(mat); /* delta = newnr - mat_rowlength(mat, rowno);*/ kk = 0; if(rowno == 0) ii = 0; else ii = mat->row_end[rowno-1]; if((orignr == 0) || (ii >= orignr)) j = firstcol; else if(isNZ||TRUE) j = colnr; else j = ROW_MAT_COLNR(ii); /* first column with a value on that row */ jj = mat->col_end[firstcol-1]; /* Set the index of the insertion point for the first new value */ if(jj >= orignr) colnr = firstcol; else colnr = COL_MAT_COLNR(jj); /* first column with a value starting from firstcol */ if((j > 0) && (j < colnr)) { jj = elmnr = mat->col_end[j-1]; for( ; j < colnr; j++) { /* Shift entries in current column */ k = mat->col_end[j]; for( ; jj < k; jj++) { if(COL_MAT_ROWNR(jj) != rowno) { COL_MAT_COPY(elmnr, jj); elmnr++; } } /* Update next column start index */ mat->col_end[j] = elmnr; } delta = elmnr - jj; /* The shrinkage count */ } else { delta = 0; /* Adjust for case where we simply append values - jj is initially the first column item */ if((mat->col_end[firstcol] == orignr) && 0) jj = orignr; } /* Make sure we have sufficient space for any additional entries and move existing data down; this ensures that we only have to relocate matrix elements up in the next stage */ jj_j = MAX(0, newnr + delta); if(jj_j > 0) { if(!inc_mat_space(mat, jj_j)) { FREE(addto); return( FALSE ); } if(orignr-jj > 0) { COL_MAT_MOVE(jj+jj_j, jj, orignr-jj); } jj += jj_j; } /* Handle case where the matrix was empty before (or we can simply append) */ if((delta >= 0) && (mat->col_end[firstcol] == orignr) && 0) { if(isNZ) elmnr = count; else elmnr = mat->columns; jj_j = mat->col_end[firstcol]; for(newnr = 0; newnr < elmnr; newnr++) { if(isNZ) colnr = colno[newnr]; else colnr = newnr + 1; /* Update column start position if we have crossed a column */ while(colnr > firstcol) { mat->col_end[firstcol] = jj_j; firstcol++; } if(isNZ || ((addto != NULL) && addto[colnr])) { if(isNZ) value = row[newnr]; else value = row[colnr]; if(isA && doscale) value = scaled_mat(lp, value, rowno, colnr); if(isA) value = my_chsign(is_chsign(lp, rowno), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); if(value == 0) matz++; #endif SET_MAT_ijA(jj_j, rowno, colnr, value); jj_j++; /* Update last column start position */ mat->col_end[firstcol] = jj_j; firstcol++; } } /* Make sure we update tail empty column offsets */ while(firstcol <= mat->columns) { mat->col_end[firstcol] = jj_j; firstcol++; } jj_j = 0; } /* Start from the top of the first non-zero column of the new row */ elmnr = orignr + jj_j; if(jj <= elmnr) { if(isNZ) newnr = 0; else newnr = firstcol - 1; j = jj - mat->col_end[firstcol-1]; colnr = firstcol; while((jj < elmnr) || (newnr < count)) { /* Update column start position if we have crossed a column */ while(colnr > firstcol) { mat->col_end[firstcol] = kk; firstcol++; } /* See if we have a row equal to or greater than the target row */ jj_j = jj - j; if(jj < elmnr) { rownr = COL_MAT_ROWNR(jj); colnr = COL_MAT_COLNR(jj); } else { rownr = rowno; if(!isNZ) /* KE added this conditional on 13.9.2006 */ colnr = firstcol + 1; else colnr = mat->columns + 1; } if(isNZ) { if(newnr < count) kk = colno[newnr]; else kk = mat->columns + 1; } else kk = newnr + 1; /* Test if there is an available new item ... */ if((isNZ && (kk > colnr)) || /* If this is not the case */ (!isNZ && ((kk > colnr) || (!addto[kk])))) { /* DELETE if there is an existing value */ if(!isNZ && (kk <= colnr)) newnr++; if(rownr == rowno) { kk = jj_j; j++; jj++; continue; } /* KEEP otherwise and move entry up */ if(!isNZ && (colnr > kk)) { colnr = kk; kk = jj_j; continue; } } else if((colnr > kk) || /* Existing column index > new => INSERT */ ((colnr == kk) && (rownr >= rowno)) ) { /* Same column index, existing row >= target row => INSERT/REPLACE */ if(isNZ) value = row[newnr]; else value = row[newnr+1]; newnr++; if(isA && doscale) value = scaled_mat(lp, value, rowno, kk); if(isA) value = my_chsign(is_chsign(lp, rowno), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); if(value == 0) matz++; #endif SET_MAT_ijA(jj_j, rowno, kk, value); /* Adjust if we have inserted an element */ if((colnr > kk) || (rownr > rowno)) { j--; jj--; } colnr = kk; kk = jj_j; jj++; continue; } /* Shift the matrix element up by the active difference */ if(jj_j != jj) { COL_MAT_COPY(jj_j, jj); } kk = jj_j; jj++; } /* Update pending / incomplete column start position */ while(colnr > firstcol) { mat->col_end[firstcol] = kk; firstcol++; } /* Make sure we update tail column offsets */ jj_j = jj - j; while(firstcol <= mat->columns) { mat->col_end[firstcol] = jj_j; firstcol++; } } /* Compact in the case that we added zeros and set flag for row index update */ if(matz > 0) mat_zerocompact(mat); mat->row_end_valid = FALSE; Done: if(saved != 0) row[0] = saved; FREE(addto); return( (MYBOOL) (newnr > 0) ); } #else STATIC MYBOOL mat_setrow(MATrec *mat, int rowno, int count, REAL *row, int *colno, MYBOOL doscale, MYBOOL checkrowmode) { lprec *lp = mat->lp; int delta; int k, i, ii, j, jj_j, lendense, origidx = 0, newidx, orignz, newnz, rownr, colnr, colnr1; MYBOOL isA, isNZ; REAL value = 0.0; /* Check if we are in row order mode and should add as column instead; the matrix will be transposed at a later stage */ if(checkrowmode && mat->is_roworder) return( mat_setcol(mat, rowno, count, row, colno, doscale, FALSE) ); /* Do initialization and validation */ if(!mat_validate(mat)) return( FALSE ); isA = (MYBOOL) (mat == lp->matA); if(doscale && isA && !lp->scaling_used) doscale = FALSE; isNZ = (MYBOOL) (colno != NULL); lendense = (mat->is_roworder ? lp->rows : lp->columns); if((count < 0) || (count > lendense)) return( FALSE ); colnr1 = lendense + 1; /* Capture OF definition in row mode */ if(isA && mat->is_roworder) { lp->orig_obj[rowno] = 0; if((count > 0) && (colno[0] == 0)) { value = row[0]; if(doscale) value = scaled_mat(lp, value, 0, rowno); value = my_chsign(is_maxim(lp), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif lp->orig_obj[rowno] = value; if(isNZ) { colno++; row++; count--; } } else { lp->orig_obj[rowno] = 0; value = 0; } } /* Make local working data copies */ if(!isNZ) { REAL *tmprow = NULL; if(!allocINT(lp, &colno, lendense+1, FALSE)) return( FALSE ); newnz = 0; for(i = 1; i <= lendense; i++) if((value = row[i]) != 0) { if((tmprow == NULL) && !allocREAL(lp, &tmprow, lendense-i+1, FALSE)) { FREE(colno); return( FALSE ); } tmprow[newnz] = value; colno[newnz++] = i; } count = newnz; row = tmprow; } else { int *tmpcolno = NULL; if(!allocINT(lp, &tmpcolno, lendense, FALSE)) return( FALSE ); newnz = count; MEMCOPY(tmpcolno, colno, newnz); colno = tmpcolno; if(newnz > 1) sortREALByINT(row, (int *) colno, newnz, 0, TRUE); if((newnz > 0) && ((colno[0] < 0) || (colno[newnz-1] > lendense))) { FREE(colno); newnz = 0; return( FALSE ); } } /* Make sure we have enough matrix space */ i = mat->row_end[rowno-1]; ii = mat->row_end[rowno]; delta = count - (ii-i); if((delta > 0) && (mat_nz_unused(mat) <= delta) && !inc_mat_space(mat, delta)) { newnz = 0; goto Done; } colnr1 = (newnz > 0 ? colno[0] : lendense+1); /* Pack initial entries if existing row data has a lower column start index than the first index of the new vector */ orignz = mat_nonzeros(mat); j = (i >= orignz ? colnr1 : ROW_MAT_COLNR(i)); /* Index of the column-top insertion point for the first new value */ origidx = mat->col_end[colnr1-1]; colnr = (origidx >= orignz ? colnr1 : COL_MAT_COLNR(origidx)); if(j < colnr) { origidx = newidx = mat->col_end[j-1]; for( ; j < colnr; j++) { /* Shift entries in current column */ jj_j = mat->col_end[j]; for( ; origidx < jj_j; origidx++) { if(COL_MAT_ROWNR(origidx) != rowno) { if(newidx != origidx) { COL_MAT_COPY(newidx, origidx); } newidx++; } } /* Update next column start index */ mat->col_end[j] = newidx; } delta = newidx - origidx; /* The first stage element shrinkage count */ } else { delta = 0; newidx = origidx; } /* Make sure we have sufficient space for any additional entries and move existing data down; this ensures that we only have to relocate matrix elements up in the next stage */ jj_j = MAX(0, (int) newnz + delta); if((jj_j > 0) && (orignz-origidx > 0)) { COL_MAT_MOVE(origidx+jj_j, origidx, orignz-origidx); origidx += jj_j; orignz += jj_j; } /* Start from the top of the first non-zero column of the new row */ newnz = 0; j = origidx - mat->col_end[colnr1-1]; k = colnr1; /* Last column for which col_end is valid/updated */ while((colnr1 <= lendense) || (origidx < orignz)) { /* Get the column index of the active update item */ if(newnz < count) colnr1 = colno[newnz]; else colnr1 = lendense + 1; /* Get coordinate of active existing matrix entries */ if(origidx < orignz) { rownr = COL_MAT_ROWNR(origidx); colnr = COL_MAT_COLNR(origidx); } else { if(colnr1 > lendense) break; rownr = rowno; colnr = lendense + 1; } /* Update column start position if we just crossed into a column */ jj_j = origidx - j; i = MIN(colnr, colnr1); for(; k < i; k++) mat->col_end[k] = jj_j; /* Test if there is an available new item ... */ if(colnr1 > colnr) { /* If this is not the case */ /* DELETE if there is an existing value */ if(rownr == rowno) { ForceDelete: j++; delta--; origidx++; continue; } } else if((colnr > colnr1) || /* Existing column index > new => INSERT */ ((colnr == colnr1) && (rownr >= rowno)) ) { /* Same column index, existing row >= target row => INSERT/REPLACE */ value = row[newnz]; newnz++; if(isA && doscale) value = scaled_mat(lp, value, rowno, colnr1); if(isA) value = my_chsign(is_chsign(lp, rowno), value); #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); if(value == 0) { if((colnr > colnr1) || (rownr > rowno)) ; else goto ForceDelete; } #endif SET_MAT_ijA(jj_j, rowno, colnr1, value); /* Adjust if we have inserted an element */ if((colnr > colnr1) || (rownr > rowno)) { j--; origidx--; jj_j++; delta++; } origidx++; continue; } /* Shift the matrix element up by the active difference */ if(jj_j != origidx) { COL_MAT_COPY(jj_j, origidx); } origidx++; } /* Update pending / incomplete column start position */ jj_j = origidx - j; for(; k <= lendense; k++) mat->col_end[k] = jj_j; mat->row_end_valid = FALSE; Done: if(!isNZ) FREE(row); FREE(colno); return( (MYBOOL) (newnz > 0) ); } /* mat_setrow */ #endif STATIC int mat_appendrow(MATrec *mat, int count, REAL *row, int *colno, REAL mult, MYBOOL checkrowmode) { int i, j, jj = 0, stcol, elmnr, orignr, newnr, firstcol; MYBOOL *addto = NULL, isA, isNZ; REAL value, saved = 0; lprec *lp = mat->lp; /* Check if we are in row order mode and should add as column instead; the matrix will be transposed at a later stage */ if(checkrowmode && mat->is_roworder) return( mat_appendcol(mat, count, row, colno, mult, FALSE) ); /* Do initialization and validation */ isA = (MYBOOL) (mat == lp->matA); isNZ = (MYBOOL) (colno != NULL); if(isNZ && (count > 0)) { if(count > 1) sortREALByINT(row, colno, count, 0, TRUE); if((colno[0] < 1) || (colno[count-1] > mat->columns)) return( 0 ); } /* else if((row != NULL) && !mat->is_roworder) */ else if(!isNZ && (row != NULL) && !mat->is_roworder) row[0] = 0; /* Capture OF definition in row mode */ if(isA && mat->is_roworder) { if(isNZ && (colno[0] == 0)) { value = row[0]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif value = scaled_mat(lp, value, 0, lp->columns); value = my_chsign(is_maxim(lp), value); lp->orig_obj[lp->columns] = value; count--; row++; colno++; } else if(!isNZ && (row != NULL) && (row[0] != 0)) { value = saved = row[0]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif value = scaled_mat(lp, value, 0, lp->columns); value = my_chsign(is_maxim(lp), value); lp->orig_obj[lp->columns] = value; row[0] = 0; } else lp->orig_obj[lp->columns] = 0; } /* Optionally tally and map the new non-zero values */ firstcol = mat->columns + 1; if(isNZ) { newnr = count; if(newnr) { firstcol = colno[0]; jj = colno[newnr - 1]; } } else { newnr = 0; if(row != NULL) { if(!allocMYBOOL(lp, &addto, mat->columns + 1, TRUE)) { return( newnr ); } for(i = mat->columns; i >= 1; i--) { if(fabs(row[i]) > mat->epsvalue) { addto[i] = TRUE; firstcol = i; newnr++; } } } } /* Make sure we have sufficient space */ if(!inc_mat_space(mat, newnr)) { newnr = 0; goto Done; } /* Insert the non-zero constraint values */ orignr = mat_nonzeros(mat) - 1; elmnr = orignr + newnr; for(j = mat->columns; j >= firstcol; j--) { stcol = mat->col_end[j] - 1; mat->col_end[j] = elmnr + 1; /* Add a new non-zero entry */ if(((isNZ) && (j == jj)) || ((addto != NULL) && (addto[j]))) { newnr--; if(isNZ) { value = row[newnr]; if(newnr) jj = colno[newnr - 1]; else jj = 0; } else value = row[j]; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif value *= mult; if(isA) { if(mat->is_roworder) value = my_chsign(is_chsign(lp, j), value); value = scaled_mat(lp, value, mat->rows, j); } SET_MAT_ijA(elmnr, mat->rows, j, value); elmnr--; } /* Shift previous column entries down */ i = stcol - mat->col_end[j-1] + 1; if(i > 0) { orignr -= i; elmnr -= i; COL_MAT_MOVE(elmnr+1, orignr+1, i); } } Done: if(saved != 0) row[0] = saved; FREE(addto); return( newnr ); } STATIC int mat_appendcol(MATrec *mat, int count, REAL *column, int *rowno, REAL mult, MYBOOL checkrowmode) { int i, row, elmnr, lastnr; REAL value; MYBOOL isA, isNZ; lprec *lp = mat->lp; /* Check if we are in row order mode and should add as row instead; the matrix will be transposed at a later stage */ if(checkrowmode && mat->is_roworder) return( mat_appendrow(mat, count, column, rowno, mult, FALSE) ); /* Make sure we have enough space */ /* if(!inc_mat_space(mat, mat->rows+1)) return( 0 ); */ if(column == NULL) i = 0; else if(rowno != NULL) i = count; else { int nrows = mat->rows; elmnr = 0; for(i = 1; i <= nrows; i++) if(column[i] != 0) elmnr++; i = elmnr; } if((mat_nz_unused(mat) <= i) && !inc_mat_space(mat, i)) return( 0 ); /* Do initialization and validation */ isA = (MYBOOL) (mat == lp->matA); isNZ = (MYBOOL) (column == NULL || rowno != NULL); if(isNZ && (count > 0)) { if(count > 1) sortREALByINT(column, rowno, count, 0, TRUE); if((rowno[0] < 0)) return( 0 ); } if(rowno != NULL) count--; /* Append sparse regular constraint values */ elmnr = mat->col_end[mat->columns - 1]; if(column != NULL) { row = -1; for(i = ((isNZ || !mat->is_roworder) ? 0 : 1); i <= count ; i++) { value = column[i]; if(fabs(value) > mat->epsvalue) { if(isNZ) { lastnr = row; row = rowno[i]; /* Check if we have come to the Lagrangean constraints */ if(row > mat->rows) break; if(row <= lastnr) return( -1 ); } else row = i; #ifdef DoMatrixRounding value = roundToPrecision(value, mat->epsvalue); #endif if(mat->is_roworder) value *= mult; else if(isA) { value = my_chsign(is_chsign(lp, row), value); value = scaled_mat(lp, value, row, mat->columns); if(!mat->is_roworder && (row == 0)) { lp->orig_obj[mat->columns] = value; continue; } } /* Store the item and update counters */ SET_MAT_ijA(elmnr, row, mat->columns, value); elmnr++; } } /* Fill dense Lagrangean constraints */ if(get_Lrows(lp) > 0) mat_appendcol(lp->matL, get_Lrows(lp), column+mat->rows, NULL, mult, checkrowmode); } /* Set end of data */ mat->col_end[mat->columns] = elmnr; return( mat->col_end[mat->columns] - mat->col_end[mat->columns-1] ); } STATIC int mat_checkcounts(MATrec *mat, int *rownum, int *colnum, MYBOOL freeonexit) { int i, j, n; int *rownr; if(rownum == NULL) allocINT(mat->lp, &rownum, mat->rows + 1, TRUE); if(colnum == NULL) allocINT(mat->lp, &colnum, mat->columns + 1, TRUE); for(i = 1 ; i <= mat->columns; i++) { j = mat->col_end[i - 1]; n = mat->col_end[i]; rownr = &COL_MAT_ROWNR(j); for(; j < n; j++, rownr += matRowColStep) { colnum[i]++; rownum[*rownr]++; } } n = 0; if((mat->lp->do_presolve != PRESOLVE_NONE) && (mat->lp->spx_trace || (mat->lp->verbose > NORMAL))) { for(j = 1; j <= mat->columns; j++) if(colnum[j] == 0) { n++; report(mat->lp, FULL, "mat_checkcounts: Variable %s is not used in any constraints\n", get_col_name(mat->lp, j)); } for(i = 0; i <= mat->rows; i++) if(rownum[i] == 0) { n++; report(mat->lp, FULL, "mat_checkcounts: Constraint %s empty\n", get_row_name(mat->lp, i)); } } if(freeonexit) { FREE(rownum); FREE(colnum); } return( n ); } STATIC MYBOOL mat_validate(MATrec *mat) /* Routine to make sure that row mapping arrays are valid */ { int i, j, je, *rownum; int *rownr, *colnr; if(!mat->row_end_valid) { MEMCLEAR(mat->row_end, mat->rows + 1); allocINT(mat->lp, &rownum, mat->rows + 1, TRUE); /* First tally row counts and then cumulate them */ j = mat_nonzeros(mat); rownr = &COL_MAT_ROWNR(0); for(i = 0; i < j; i++, rownr += matRowColStep) mat->row_end[*rownr]++; for(i = 1; i <= mat->rows; i++) mat->row_end[i] += mat->row_end[i - 1]; /* Calculate the column index for every non-zero */ for(i = 1; i <= mat->columns; i++) { j = mat->col_end[i - 1]; je = mat->col_end[i]; rownr = &COL_MAT_ROWNR(j); colnr = &COL_MAT_COLNR(j); for(; j < je; j++, rownr += matRowColStep, colnr += matRowColStep) { #ifdef Paranoia if(/*(*colnr < 0) || (*colnr > mat->columns) || (Normally violated in primal phase 1) */ (*rownr < 0) || (*rownr > mat->rows)) { report(mat->lp, SEVERE, "mat_validate: Matrix value storage error row %d [0..%d], column %d [1..%d]\n", *rownr, mat->rows, *colnr, mat->columns); mat->lp->spx_status = UNKNOWNERROR; return(FALSE); } #endif *colnr = i; if(*rownr == 0) mat_set_rowmap(mat, rownum[*rownr], *rownr, i, j); else mat_set_rowmap(mat, mat->row_end[*rownr - 1] + rownum[*rownr], *rownr, i, j); rownum[*rownr]++; } } FREE(rownum); mat->row_end_valid = TRUE; } if(mat == mat->lp->matA) mat->lp->model_is_valid = TRUE; return( TRUE ); } MYBOOL mat_get_data(lprec *lp, int matindex, MYBOOL isrow, int **rownr, int **colnr, REAL **value) { MATrec *mat = lp->matA; #if MatrixRowAccess == RAM_Index if(isrow) matindex = mat->row_mat[matindex]; if(rownr != NULL) *rownr = &COL_MAT_ROWNR(matindex); if(colnr != NULL) *colnr = &COL_MAT_COLNR(matindex); if(value != NULL) *value = &COL_MAT_VALUE(matindex); #else if(isrow) { if(rownr != NULL) *rownr = &ROW_MAT_ROWNR(matindex); if(colnr != NULL) *colnr = &ROW_MAT_COLNR(matindex); if(value != NULL) *value = &ROW_MAT_VALUE(matindex); } else { if(rownr != NULL) *rownr = &COL_MAT_ROWNR(matindex); if(colnr != NULL) *colnr = &COL_MAT_COLNR(matindex); if(value != NULL) *value = &COL_MAT_VALUE(matindex); } #endif return( TRUE ); } MYBOOL mat_set_rowmap(MATrec *mat, int row_mat_index, int rownr, int colnr, int col_mat_index) { #if MatrixRowAccess == RAM_Index mat->row_mat[row_mat_index] = col_mat_index; #elif MatrixColAccess==CAM_Record mat->row_mat[row_mat_index].rownr = rownr; mat->row_mat[row_mat_index].colnr = colnr; mat->row_mat[row_mat_index].value = COL_MAT_VALUE(col_mat_index); #else /* if MatrixColAccess==CAM_Vector */ mat->row_mat_rownr[row_mat_index] = rownr; mat->row_mat_colnr[row_mat_index] = colnr; mat->row_mat_value[row_mat_index] = COL_MAT_VALUE(col_mat_index); #endif return( TRUE ); } /* Implement combined binary/linear sub-search for matrix look-up */ int mat_findelm(MATrec *mat, int row, int column) { int low, high, mid, item; #if 0 if(mat->row_end_valid && (row > 0) && (ROW_MAT_COLNR(mat->row_mat[(low = mat->row_end[row-1])]) == column)) return(low); #endif if((column < 1) || (column > mat->columns)) { report(mat->lp, IMPORTANT, "mat_findelm: Column %d out of range\n", column); return( -1 ); } if((row < 0) || (row > mat->rows)) { report(mat->lp, IMPORTANT, "mat_findelm: Row %d out of range\n", row); return( -1 ); } low = mat->col_end[column - 1]; high = mat->col_end[column] - 1; if(low > high) return( -2 ); /* Do binary search logic */ mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); while(high - low > LINEARSEARCH) { if(item < row) { low = mid + 1; mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); } else if(item > row) { high = mid - 1; mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); } else { low = mid; high = mid; } } /* Do linear scan search logic */ if((high > low) && (high - low <= LINEARSEARCH)) { item = COL_MAT_ROWNR(low); while((low < high) && (item < row)) { low++; item = COL_MAT_ROWNR(low); } if(item == row) high = low; } if((low == high) && (row == item)) return( low ); else return( -2 ); } int mat_findins(MATrec *mat, int row, int column, int *insertpos, MYBOOL validate) { int low, high, mid, item, exitvalue, insvalue; #if 0 if(mat->row_end_valid && (row > 0) && (ROW_MAT_COLNR(mat->row_mat[(low = mat->row_end[row-1])]) == column)) { insvalue = low; exitvalue = low; goto Done; } #endif insvalue = -1; if((column < 1) || (column > mat->columns)) { if((column > 0) && !validate) { insvalue = mat->col_end[mat->columns]; exitvalue = -2; goto Done; } report(mat->lp, IMPORTANT, "mat_findins: Column %d out of range\n", column); exitvalue = -1; goto Done; } if((row < 0) || (row > mat->rows)) { if((row >= 0) && !validate) { insvalue = mat->col_end[column]; exitvalue = -2; goto Done; } report(mat->lp, IMPORTANT, "mat_findins: Row %d out of range\n", row); exitvalue = -1; goto Done; } low = mat->col_end[column - 1]; insvalue = low; high = mat->col_end[column] - 1; if(low > high) { exitvalue = -2; goto Done; } /* Do binary search logic */ mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); while(high - low > LINEARSEARCH) { if(item < row) { low = mid + 1; mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); } else if(item > row) { high = mid - 1; mid = (low+high) / 2; item = COL_MAT_ROWNR(mid); } else { low = mid; high = mid; } } /* Do linear scan search logic */ if((high > low) && (high - low <= LINEARSEARCH)) { item = COL_MAT_ROWNR(low); while((low < high) && (item < row)) { low++; item = COL_MAT_ROWNR(low); } if(item == row) high = low; } insvalue = low; if((low == high) && (row == item)) exitvalue = low; else { if((low < mat->col_end[column]) && (COL_MAT_ROWNR(low) < row)) insvalue++; exitvalue = -2; } Done: if(insertpos != NULL) (*insertpos) = insvalue; return( exitvalue ); } STATIC REAL mat_getitem(MATrec *mat, int row, int column) { int elmnr; #ifdef DirectOverrideOF if((row == 0) && (mat == mat->lp->matA) && (mat->lp->OF_override != NULL)) return( mat->lp->OF_override[column] ); else #endif { elmnr = mat_findelm(mat, row, column); if(elmnr >= 0) return( COL_MAT_VALUE(elmnr) ); else return( 0 ); } } STATIC MYBOOL mat_additem(MATrec *mat, int row, int column, REAL delta) { int elmnr; #ifdef DirectOverrideOF if((row == 0) && (mat == mat->lp->matA) && (mat->lp->OF_override != NULL)) return( mat->lp->OF_override[column] ); else #endif { elmnr = mat_findelm(mat, row, column); if(elmnr >= 0) { COL_MAT_VALUE(elmnr) += delta; return( TRUE ); } else { mat_setitem(mat, row, column, delta); return( FALSE ); } } } STATIC MYBOOL mat_setitem(MATrec *mat, int row, int column, REAL value) { return( mat_setvalue(mat, row, column, value, FALSE) ); } STATIC void mat_multrow(MATrec *mat, int row_nr, REAL mult) { int i, k1, k2; #if 0 if(row_nr == 0) { k2 = mat->col_end[0]; for(i = 1; i <= mat->columns; i++) { k1 = k2; k2 = mat->col_end[i]; if((k1 < k2) && (COL_MAT_ROWNR(k1) == row_nr)) COL_MAT_VALUE(k1) *= mult; } } else if(mat_validate(mat)) { if(row_nr == 0) k1 = 0; else #else if(mat_validate(mat)) { if(row_nr == 0) k1 = 0; else #endif k1 = mat->row_end[row_nr-1]; k2 = mat->row_end[row_nr]; for(i = k1; i < k2; i++) ROW_MAT_VALUE(i) *= mult; } } STATIC void mat_multcol(MATrec *mat, int col_nr, REAL mult, MYBOOL DoObj) { int i, ie; MYBOOL isA; #ifdef Paranoia if((col_nr < 1) || (col_nr > mat->columns)) { report(mat->lp, IMPORTANT, "mult_column: Column %d out of range\n", col_nr); return; } #endif if(mult == 1.0) return; isA = (MYBOOL) (mat == mat->lp->matA); ie = mat->col_end[col_nr]; for(i = mat->col_end[col_nr - 1]; i < ie; i++) COL_MAT_VALUE(i) *= mult; if(isA) { if(DoObj) mat->lp->orig_obj[col_nr] *= mult; if(get_Lrows(mat->lp) > 0) mat_multcol(mat->lp->matL, col_nr, mult, DoObj); } } STATIC void mat_multadd(MATrec *mat, REAL *lhsvector, int varnr, REAL mult) { int colnr; register int ib, ie, *matRownr; register REAL *matValue; /* Handle case of a slack variable */ if(varnr <= mat->lp->rows) { lhsvector[varnr] += mult; return; } /* Do operation on the objective */ if(mat->lp->matA == mat) lhsvector[0] += get_OF_active(mat->lp, varnr, mult); /* Scan the constraint matrix target columns */ colnr = varnr - mat->lp->rows; ib = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; if(ib < ie) { /* Initialize pointers */ matRownr = &COL_MAT_ROWNR(ib); matValue = &COL_MAT_VALUE(ib); /* Then loop over all regular rows */ for(; ib < ie; ib++, matValue += matValueStep, matRownr += matRowColStep) { lhsvector[*matRownr] += mult * (*matValue); } } } STATIC MYBOOL mat_setvalue(MATrec *mat, int Row, int Column, REAL Value, MYBOOL doscale) { int elmnr, lastelm, i, RowA = Row, ColumnA = Column; MYBOOL isA; /* This function is inefficient if used to add new matrix entries in other places than at the end of the matrix. OK for replacing existing a non-zero value with another non-zero value */ isA = (MYBOOL) (mat == mat->lp->matA); if(mat->is_roworder) swapINT(&Row, &Column); /* Set small numbers to zero */ if(fabs(Value) < mat->epsvalue) Value = 0; #ifdef DoMatrixRounding else Value = roundToPrecision(Value, mat->epsvalue); #endif /* Check if we need to update column space */ if(Column > mat->columns) { if(isA) inc_col_space(mat->lp, ColumnA - mat->columns); else inc_matcol_space(mat, Column - mat->columns); } /* Find out if we already have such an entry, or return insertion point */ i = mat_findins(mat, Row, Column, &elmnr, FALSE); if(i == -1) return(FALSE); if(isA) set_action(&mat->lp->spx_action, ACTION_REBASE | ACTION_RECOMPUTE | ACTION_REINVERT); if(i >= 0) { /* there is an existing entry */ if(fabs(Value) > mat->epsvalue) { /* we replace it by something non-zero */ if(isA) { Value = my_chsign(is_chsign(mat->lp, RowA), Value); if(doscale && mat->lp->scaling_used) Value = scaled_mat(mat->lp, Value, RowA, ColumnA); } COL_MAT_VALUE(elmnr) = Value; } else { /* setting existing non-zero entry to zero. Remove the entry */ /* This might remove an entire column, or leave just a bound. No nice solution for that yet */ /* Shift up tail end of the matrix */ lastelm = mat_nonzeros(mat); #if 0 for(i = elmnr; i < lastelm ; i++) { COL_MAT_COPY(i, i + 1); } #else lastelm -= elmnr; COL_MAT_MOVE(elmnr, elmnr + 1, lastelm); #endif for(i = Column; i <= mat->columns; i++) mat->col_end[i]--; mat->row_end_valid = FALSE; } } else if(fabs(Value) > mat->epsvalue) { /* no existing entry. make new one only if not nearly zero */ /* check if more space is needed for matrix */ if(!inc_mat_space(mat, 1)) return(FALSE); if(Column > mat->columns) { i = mat->columns + 1; if(isA) shift_coldata(mat->lp, i, ColumnA - mat->columns, NULL); else mat_shiftcols(mat, &i, Column - mat->columns, NULL); } /* Shift down tail end of the matrix by one */ lastelm = mat_nonzeros(mat); #if 1 /* Does compiler optimization work better here? */ for(i = lastelm; i > elmnr ; i--) { COL_MAT_COPY(i, i - 1); } #else lastelm -= elmnr - 1; COL_MAT_MOVE(elmnr + 1, elmnr, lastelm); #endif /* Set new element */ if(isA) { Value = my_chsign(is_chsign(mat->lp, RowA), Value); if(doscale) Value = scaled_mat(mat->lp, Value, RowA, ColumnA); } SET_MAT_ijA(elmnr, Row, Column, Value); /* Update column indexes */ for(i = Column; i <= mat->columns; i++) mat->col_end[i]++; mat->row_end_valid = FALSE; } if(isA && (mat->lp->var_is_free != NULL) && (mat->lp->var_is_free[ColumnA] > 0)) return( mat_setvalue(mat, RowA, mat->lp->var_is_free[ColumnA], -Value, doscale) ); return(TRUE); } STATIC MYBOOL mat_appendvalue(MATrec *mat, int Row, REAL Value) { int *elmnr, Column = mat->columns; /* Set small numbers to zero */ if(fabs(Value) < mat->epsvalue) Value = 0; #ifdef DoMatrixRounding else Value = roundToPrecision(Value, mat->epsvalue); #endif /* Check if more space is needed for matrix */ if(!inc_mat_space(mat, 1)) return(FALSE); #ifdef Paranoia /* Check valid indeces */ if((Row < 0) || (Row > mat->rows)) { report(mat->lp, SEVERE, "mat_appendvalue: Invalid row index %d specified\n", Row); return(FALSE); } #endif /* Get insertion point and set value */ elmnr = mat->col_end + Column; SET_MAT_ijA((*elmnr), Row, Column, Value); /* Update column count */ (*elmnr)++; mat->row_end_valid = FALSE; return(TRUE); } STATIC MYBOOL mat_equalRows(MATrec *mat, int baserow, int comprow) { MYBOOL status = FALSE; if(mat_validate(mat)) { int bj1 = 0, ej1, bj2 = 0, ej2; /* Get starting and ending positions */ if(baserow >= 0) bj1 = mat->row_end[baserow-1]; ej1 = mat->row_end[baserow]; if(comprow >= 0) bj2 = mat->row_end[comprow-1]; ej2 = mat->row_end[comprow]; /* Fail if row lengths are unequal */ if((ej1-bj1) != (ej2-bj2)) return( status ); /* Compare column index and value, element by element */ for(; bj1 < ej1; bj1++, bj2++) { if(COL_MAT_COLNR(bj1) != COL_MAT_COLNR(bj2)) break; #if 1 if(fabs(get_mat_byindex(mat->lp, bj1, TRUE, FALSE)-get_mat_byindex(mat->lp, bj2, TRUE, FALSE)) > mat->lp->epsprimal) #else if(fabs(COL_MAT_VALUE(bj1)-COL_MAT_VALUE(bj2)) > mat->lp->epsprimal) #endif break; } status = (MYBOOL) (bj1 == ej1); } return( status ); } STATIC int mat_findcolumn(MATrec *mat, int matindex) { int j; for(j = 1; j <= mat->columns; j++) { if(matindex < mat->col_end[j]) break; } return(j); } STATIC int mat_expandcolumn(MATrec *mat, int colnr, REAL *column, int *nzlist, MYBOOL signedA) { MYBOOL isA = (MYBOOL) (mat->lp->matA == mat); int i, ie, j, nzcount = 0; REAL *matValue; int *matRownr; signedA &= isA; /* Retrieve a column from the user data matrix A */ MEMCLEAR(column, mat->rows + 1); if(isA) { column[0] = mat->lp->orig_obj[colnr]; if(signedA && is_chsign(mat->lp, 0)) column[0] = -column[0]; } i = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; matRownr = &COL_MAT_ROWNR(i); matValue = &COL_MAT_VALUE(i); for(; i < ie; i++, matRownr += matRowColStep, matValue += matValueStep) { j = *matRownr; column[j] = *matValue; if(signedA && is_chsign(mat->lp, j)) column[j] = -column[j]; nzcount++; if(nzlist != NULL) nzlist[nzcount] = j; } if(nzlist != NULL) nzlist[0] = nzcount; return( nzcount ); } STATIC MYBOOL mat_computemax(MATrec *mat) { int *rownr = &COL_MAT_ROWNR(0), *colnr = &COL_MAT_COLNR(0), i = 0, ie = mat->col_end[mat->columns], ez = 0; REAL *value = &COL_MAT_VALUE(0), epsmachine = mat->lp->epsmachine, absvalue; /* Prepare arrays */ if(!allocREAL(mat->lp, &mat->colmax, mat->columns_alloc+1, AUTOMATIC) || !allocREAL(mat->lp, &mat->rowmax, mat->rows_alloc+1, AUTOMATIC)) return( FALSE ); MEMCLEAR(mat->colmax, mat->columns+1); MEMCLEAR(mat->rowmax, mat->rows+1); /* Obtain the row and column maxima in one sweep */ mat->dynrange = mat->lp->infinite; for(; i < ie; i++, rownr += matRowColStep, colnr += matRowColStep, value += matValueStep) { absvalue = fabs(*value); SETMAX(mat->colmax[*colnr], absvalue); SETMAX(mat->rowmax[*rownr], absvalue); SETMIN(mat->dynrange, absvalue); if(absvalue < epsmachine) ez++; } /* Lastly, compute the global maximum and get the dynamic range */ for(i = 1; i <= mat->rows; i++) SETMAX(mat->rowmax[0], mat->rowmax[i]); mat->infnorm = mat->colmax[0] = mat->rowmax[0]; if(mat->dynrange == 0) { report(mat->lp, SEVERE, "%d matrix contains zero-valued coefficients.\n", ez); mat->dynrange = mat->lp->infinite; } else { mat->dynrange = mat->infnorm / mat->dynrange; if(ez > 0) report(mat->lp, IMPORTANT, "%d matrix coefficients below machine precision were found.\n", ez); } return( TRUE ); } STATIC MYBOOL mat_transpose(MATrec *mat) { int i, j, nz, k; MYBOOL status; status = mat_validate(mat); if(status) { /* Create a column-ordered sparse element list; "column" index must be shifted */ nz = mat_nonzeros(mat); if(nz > 0) { #if MatrixColAccess==CAM_Record MATitem *newmat; newmat = (MATitem *) malloc((mat->mat_alloc) * sizeof(*(mat->col_mat))); j = mat->row_end[0]; for(i = nz-1; i >= j ; i--) { k = i-j; newmat[k] = mat->col_mat[mat->row_mat[i]]; newmat[k].row_nr = newmat[k].col_nr; } for(i = j-1; i >= 0 ; i--) { k = nz-j+i; newmat[k] = mat->col_mat[mat->row_mat[i]]; newmat[k].row_nr = newmat[k].col_nr; } swapPTR((void **) &mat->col_mat, (void **) &newmat); FREE(newmat); #else /*if MatrixColAccess==CAM_Vector*/ REAL *newValue = NULL; int *newRownr = NULL; allocREAL(mat->lp, &newValue, mat->mat_alloc, FALSE); allocINT(mat->lp, &newRownr, mat->mat_alloc, FALSE); j = mat->row_end[0]; for(i = nz-1; i >= j ; i--) { k = i-j; newValue[k] = ROW_MAT_VALUE(i); newRownr[k] = ROW_MAT_COLNR(i); } for(i = j-1; i >= 0 ; i--) { k = nz-j+i; newValue[k] = ROW_MAT_VALUE(i); newRownr[k] = ROW_MAT_COLNR(i); } swapPTR((void **) &mat->col_mat_rownr, (void **) &newRownr); swapPTR((void **) &mat->col_mat_value, (void **) &newValue); FREE(newValue); FREE(newRownr); #endif } /* Transfer row start to column start position; must adjust for different offsets */ if(mat->rows == mat->rows_alloc) inc_matcol_space(mat, 1); j = mat->row_end[0]; for(i = mat->rows; i >= 1; i--) mat->row_end[i] -= j; mat->row_end[mat->rows] = nz; swapPTR((void **) &mat->row_end, (void **) &mat->col_end); /* Swap arrays of maximum values */ swapPTR((void **) &mat->rowmax, (void **) &mat->colmax); /* Swap array sizes */ swapINT(&mat->rows, &mat->columns); swapINT(&mat->rows_alloc, &mat->columns_alloc); /* Finally set current storage mode */ mat->is_roworder = (MYBOOL) !mat->is_roworder; mat->row_end_valid = FALSE; } return(status); } /* ---------------------------------------------------------------------------------- */ /* Change-tracking routines */ /* ---------------------------------------------------------------------------------- */ STATIC DeltaVrec *createUndoLadder(lprec *lp, int levelitems, int maxlevels) { DeltaVrec *hold; hold = (DeltaVrec *) malloc(sizeof(*hold)); hold->lp = lp; hold->activelevel = 0; hold->tracker = mat_create(lp, levelitems, 0, 0.0); inc_matcol_space(hold->tracker, maxlevels); return( hold ); } STATIC int incrementUndoLadder(DeltaVrec *DV) { DV->activelevel++; inc_matcol_space(DV->tracker, 1); mat_shiftcols(DV->tracker, &(DV->activelevel), 1, NULL); DV->tracker->columns++; return(DV->activelevel); } STATIC MYBOOL modifyUndoLadder(DeltaVrec *DV, int itemno, REAL target[], REAL newvalue) { MYBOOL status; int varindex = itemno; REAL oldvalue = target[itemno]; #ifndef UseMilpSlacksRCF /* Check if we should include ranged constraints */ varindex -= DV->lp->rows; #endif status = mat_appendvalue(DV->tracker, varindex, oldvalue); target[itemno] = newvalue; return(status); } STATIC int countsUndoLadder(DeltaVrec *DV) { if(DV->activelevel > 0) return( mat_collength(DV->tracker, DV->activelevel) ); else return( 0 ); } STATIC int restoreUndoLadder(DeltaVrec *DV, REAL target[]) { int iD = 0; if(DV->activelevel > 0) { MATrec *mat = DV->tracker; int iB = mat->col_end[DV->activelevel-1], iE = mat->col_end[DV->activelevel], *matRownr = &COL_MAT_ROWNR(iB); REAL *matValue = &COL_MAT_VALUE(iB), oldvalue; /* Restore the values */ iD = iE-iB; for(; iB < iE; iB++, matValue += matValueStep, matRownr += matRowColStep) { oldvalue = *matValue; #ifdef UseMilpSlacksRCF /* Check if we should include ranged constraints */ target[(*matRownr)] = oldvalue; #else target[DV->lp->rows+(*matRownr)] = oldvalue; #endif } /* Get rid of the changes */ mat_shiftcols(DV->tracker, &(DV->activelevel), -1, NULL); } return(iD); } STATIC int decrementUndoLadder(DeltaVrec *DV) { int deleted = 0; if(DV->activelevel > 0) { deleted = mat_shiftcols(DV->tracker, &(DV->activelevel), -1, NULL); DV->activelevel--; DV->tracker->columns--; } return(deleted); } STATIC MYBOOL freeUndoLadder(DeltaVrec **DV) { if((DV == NULL) || (*DV == NULL)) return(FALSE); mat_free(&((*DV)->tracker)); FREE(*DV); return(TRUE); } STATIC MYBOOL appendUndoPresolve(lprec *lp, MYBOOL isprimal, REAL beta, int colnrDep) { MATrec *mat; /* Point to correct undo structure */ if(isprimal) mat = lp->presolve_undo->primalundo->tracker; else mat = lp->presolve_undo->dualundo->tracker; /* Append the data */ if((colnrDep > 0) && (beta != 0) && (mat != NULL) && (mat->col_tag[0] > 0)) { int ix = mat->col_tag[0]; #if 0 report(lp, NORMAL, "appendUndoPresolve: %s %g * x%d\n", ( beta < 0 ? "-" : "+"), fabs(beta), colnrDep); #endif /* Do normal user variable case */ if(colnrDep <= lp->columns) mat_setvalue(mat, colnrDep, ix, beta, FALSE); /* Handle case where a slack variable is referenced */ else { int ipos, jx = mat->col_tag[ix]; mat_setvalue(mat, jx, ix, beta, FALSE); jx = mat_findins(mat, jx, ix, &ipos, FALSE); COL_MAT_ROWNR(ipos) = colnrDep; } return( TRUE ); } else return( FALSE ); } STATIC MYBOOL addUndoPresolve(lprec *lp, MYBOOL isprimal, int colnrElim, REAL alpha, REAL beta, int colnrDep) { int ix; DeltaVrec **DV; MATrec *mat; presolveundorec *psdata = lp->presolve_undo; /* Point to and initialize undo structure at first call */ if(isprimal) { DV = &(psdata->primalundo); if(*DV == NULL) { *DV = createUndoLadder(lp, lp->columns+1, lp->columns); mat = (*DV)->tracker; mat->epsvalue = lp->matA->epsvalue; allocINT(lp, &(mat->col_tag), lp->columns+1, FALSE); mat->col_tag[0] = 0; } } else { DV = &(psdata->dualundo); if(*DV == NULL) { *DV = createUndoLadder(lp, lp->rows+1, lp->rows); mat = (*DV)->tracker; mat->epsvalue = lp->matA->epsvalue; allocINT(lp, &(mat->col_tag), lp->rows+1, FALSE); mat->col_tag[0] = 0; } } mat = (*DV)->tracker; #if 0 report(lp, NORMAL, "addUndoPresolve: x%d = %g %s %g * x%d\n", colnrElim, alpha, ( beta < 0 ? "-" : "+"), fabs(beta), colnrDep); #endif /* Add the data */ ix = mat->col_tag[0] = incrementUndoLadder(*DV); mat->col_tag[ix] = colnrElim; if(alpha != 0) mat_setvalue(mat, 0, ix, alpha, FALSE); /* mat_appendvalue(*mat, 0, alpha);*/ if((colnrDep > 0) && (beta != 0)) { if(colnrDep > lp->columns) return( appendUndoPresolve(lp, isprimal, beta, colnrDep) ); else mat_setvalue(mat, colnrDep, ix, beta, FALSE); } return( TRUE ); } /* ---------------------------------------------------------------------------------- */ /* High level matrix inverse and product routines in lp_solve */ /* ---------------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------------- */ /* A brief description of the basis inverse and factorization logic in lp_solve */ /* ---------------------------------------------------------------------------------- */ /* In order to better understand the legacy code for operating with the basis and its factorization in lp_solve I (KE) will briefly explain the conventions and associated matrix algebra. Note that with lp_solve version 5.5, it is also possible to direct lp_solve to use the traditional (textbook) format by setting the obj_in_B parameter to FALSE. The matrix description of a linear program (as represented by lp_solve) goes like this: maximize c'x subject to r <= Ax <= b where l <= x <= u The matrix A is partitioned into two column sets [B|N], where B is a square matrix of "basis" variables containing non-fixed variables of the linear program at any given stage and N is the submatrix of corresponding non-basic, fixed variables. The variables (columns) in N may be fixed at their lower or upper levels. Similarly, the c vector is partitioned into the basic and non-basic parts [z|n]. While lp_solve stores the objective vector c in a dense format, and the constraint matrix A in a (fairly standard) sparse format, the column vectors passed to the factorization routine include the objective coefficient at row index 0. (In versions of lp_solve before v5.2, c was actually explicitly stored as the 0-th row of A). The expanded matrix may be called the "A~" form and looks like this: A~ = [ c ] [ A ] Linear programming involves solving linear equations based on the square basis matrix B, which includes is a subset of columns from A~. The implications of the common storage of c and A (e.g. A~) vs. the inverse / factorization of B for the operations and updates performed by the simplex routine therefore needs to be understood. As a consquence of A~, in lp_solve B is stored in an expanded, bordered format using the following (non-singular) representation: B~ = [ 1 z ] [ 0 B ] Any basis inversion / factorization engine used by lp_solve must therefore explicitly represent and handle the implications of this structure for associated matrix operations. The standard matrix formula for computing the inverse of a bordered matrix shows what the inversion of B~ actually produces: Inv(B~) = [ 1 -z*Inv(B) ] [ 0 Inv(B) ] The A~ and B~ representations require awareness by the developer of the side effects of the presence of the top row when doing product operations such as b'N, btran and ftran. Note in particular z*Inv(B) in the top row of Inv(B~), which is actually the dual solution vector of the given basis. This fact makes a very common update in the simplex algorithm (reduced costs) returnable as a vector simply by setting 1 at the top of a vector being pre-multiplied with Inv(B~). However, if the objective vector (c) is changed, the expanded representation requires that B / B~ be refactorized. Also, when doing FTRAN, BTRAN and x'A-type operations, you will patently get the incorrect result if you simply copy the operations given in textbooks. First I'll show the results of an FTRAN operation: Bx = a ==> x = FTRAN(a) In lp_solve, this operation solves: [ 1 z ] [y] = [d] [ 0 B ] [x] [a] Using the Inv(B~) expression earlier, the FTRAN result is therefore: [y] = [ 1 -z*Inv(B) ] [d] = [ d - z*Inv(B)*a ] [x] [ 0 Inv(B) ] [a] [ Inv(B)*a ] As an example, the value of the dual objective can be returned at the 0-th index by passing the active RHS vector with 0 at the 0-th position. Similarily, doing the left solve - performing the BTRAN calculation: [x y] [ 1 z ] = [d a'] [ 0 B ] ... will produce the following result in lp_solve: [x y] = [d a'] [ 1 -z*Inv(B) ] = [ d | -d*z*Inv(B) + a'*Inv(B) ] [ 0 Inv(B) ] So, if you thought you were simply computing "a'*Inv(B)", look again. In order to produce the desired result, you have to set d to 0 before the BTRAN operation. On the other hand, if you set d to 1 and a to 0, then you are very conveniently on your way to obtain the reduced costs (needs a further matrix premultiplication with non-basic variables). Incidentally, the BTRAN with [1 0] that yields [ 1 | -z*Inv(B) ] can also be used as a fast way of checking the accuracy of the current factorization. Equipped with this understanding, I hope that you see that the approach in lp_solve is actually pretty convenient. It also becomes easier to extend functionality in lp_solve by drawing on formulas and expressions from LP literature that otherwise assume the non-bordered syntax and representation. Kjell Eikland -- November 2003 KE update -- April 2005 KE update -- June 2005 */ STATIC MYBOOL __WINAPI invert(lprec *lp, MYBOOL shiftbounds, MYBOOL final) { MYBOOL *usedpos, resetbasis; REAL test; int k, i, j; int singularities, usercolB; /* Make sure the tags are correct */ if(!mat_validate(lp->matA)) { lp->spx_status = INFEASIBLE; return(FALSE); } /* Create the inverse management object at the first call to invert() */ if(lp->invB == NULL) lp->bfp_init(lp, lp->rows, 0, NULL); else lp->bfp_preparefactorization(lp); singularities = 0; /* Must save spx_status since it is used to carry information about the presence and handling of singular columns in the matrix */ if(userabort(lp, MSG_INVERT)) return(FALSE); #ifdef Paranoia if(lp->spx_trace) report(lp, DETAILED, "invert: Iter %10g, fact-length %7d, OF " RESULTVALUEMASK ".\n", (double) get_total_iter(lp), lp->bfp_colcount(lp), (double) -lp->rhs[0]); #endif /* Store state of pre-existing basis, and at the same time check if the basis is I; in this case take the easy way out */ if(!allocMYBOOL(lp, &usedpos, lp->sum + 1, TRUE)) { lp->bb_break = TRUE; return(FALSE); } usedpos[0] = TRUE; usercolB = 0; for(i = 1; i <= lp->rows; i++) { k = lp->var_basic[i]; if(k > lp->rows) usercolB++; usedpos[k] = TRUE; } #ifdef Paranoia if(!verify_basis(lp)) report(lp, SEVERE, "invert: Invalid basis detected (iter %g).\n", (double) get_total_iter(lp)); #endif /* Tally matrix nz-counts and check if we should reset basis indicators to all slacks */ resetbasis = (MYBOOL) ((usercolB > 0) && lp->bfp_canresetbasis(lp)); k = 0; for(i = 1; i <= lp->rows; i++) { if(lp->var_basic[i] > lp->rows) k += mat_collength(lp->matA, lp->var_basic[i] - lp->rows) + (is_OF_nz(lp,lp->var_basic[i] - lp->rows) ? 1 : 0); if(resetbasis) { j = lp->var_basic[i]; if(j > lp->rows) lp->is_basic[j] = FALSE; lp->var_basic[i] = i; lp->is_basic[i] = TRUE; } } /* Now do the refactorization */ singularities = lp->bfp_factorize(lp, usercolB, k, usedpos, final); /* Do user reporting */ if(userabort(lp, MSG_INVERT)) goto Cleanup; /* Finalize factorization/inversion */ lp->bfp_finishfactorization(lp); /* Recompute the RHS ( Ref. lp_solve inverse logic and Chvatal p. 121 ) */ #ifdef DebugInv blockWriteLREAL(stdout, "RHS-values pre invert", lp->rhs, 0, lp->rows); #endif recompute_solution(lp, shiftbounds); restartPricer(lp, AUTOMATIC); #ifdef DebugInv blockWriteLREAL(stdout, "RHS-values post invert", lp->rhs, 0, lp->rows); #endif Cleanup: /* Check for numerical instability indicated by frequent refactorizations */ test = get_refactfrequency(lp, FALSE); if(test < MIN_REFACTFREQUENCY) { test = get_refactfrequency(lp, TRUE); report(lp, NORMAL, "invert: Refactorization frequency %.1g indicates numeric instability.\n", test); lp->spx_status = NUMFAILURE; } FREE(usedpos); return((MYBOOL) (singularities <= 0)); } /* invert */ STATIC MYBOOL fimprove(lprec *lp, REAL *pcol, int *nzidx, REAL roundzero) { REAL *errors, sdp; int j; MYBOOL Ok = TRUE; allocREAL(lp, &errors, lp->rows + 1, FALSE); if(errors == NULL) { Ok = FALSE; return(Ok); } MEMCOPY(errors, pcol, lp->rows + 1); lp->bfp_ftran_normal(lp, pcol, nzidx); prod_Ax(lp, NULL, pcol, NULL, 0.0, -1, errors, NULL, MAT_ROUNDDEFAULT); lp->bfp_ftran_normal(lp, errors, NULL); sdp = 0; for(j = 1; j <= lp->rows; j++) if(fabs(errors[j])>sdp) sdp = fabs(errors[j]); if(sdp > lp->epsmachine) { report(lp, DETAILED, "Iterative FTRAN correction metric %g", sdp); for(j = 1; j <= lp->rows; j++) { pcol[j] += errors[j]; my_roundzero(pcol[j], roundzero); } } FREE(errors); return(Ok); } STATIC MYBOOL bimprove(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero) { int j; REAL *errors, err, maxerr; MYBOOL Ok = TRUE; allocREAL(lp, &errors, lp->sum + 1, FALSE); if(errors == NULL) { Ok = FALSE; return(Ok); } MEMCOPY(errors, rhsvector, lp->sum + 1); /* Solve Ax=b for x, compute b back */ lp->bfp_btran_normal(lp, errors, nzidx); prod_xA(lp, NULL, errors, NULL, 0.0, 1.0, errors, NULL, MAT_ROUNDDEFAULT); /* Take difference with ingoing values, while shifting the column values to the rows section and zeroing the columns again */ for(j = 1; j <= lp->rows; j++) errors[j] = errors[lp->rows+lp->var_basic[j]] - rhsvector[j]; for(j = lp->rows; j <= lp->sum; j++) errors[j] = 0; /* Solve the b errors for the iterative x adjustment */ lp->bfp_btran_normal(lp, errors, NULL); /* Generate the adjustments and compute statistic */ maxerr = 0; for(j = 1; j <= lp->rows; j++) { if(lp->var_basic[j]<=lp->rows) continue; err = errors[lp->rows+lp->var_basic[j]]; if(fabs(err)>maxerr) maxerr = fabs(err); } if(maxerr > lp->epsmachine) { report(lp, DETAILED, "Iterative BTRAN correction metric %g", maxerr); for(j = 1; j <= lp->rows; j++) { if(lp->var_basic[j]<=lp->rows) continue; rhsvector[j] += errors[lp->rows+lp->var_basic[j]]; my_roundzero(rhsvector[j], roundzero); } } FREE(errors); return(Ok); } STATIC void ftran(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero) { #if 0 if(is_action(lp->improve, IMPROVE_SOLUTION) && lp->bfp_pivotcount(lp)) fimprove(lp, rhsvector, nzidx, roundzero); else #endif lp->bfp_ftran_normal(lp, rhsvector, nzidx); } STATIC void btran(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero) { #if 0 if(is_action(lp->improve, IMPROVE_SOLUTION) && lp->bfp_pivotcount(lp)) bimprove(lp, rhsvector, nzidx, roundzero); else #endif lp->bfp_btran_normal(lp, rhsvector, nzidx); } STATIC MYBOOL fsolve(lprec *lp, int varin, REAL *pcol, int *nzidx, REAL roundzero, REAL ofscalar, MYBOOL prepareupdate) /* Was setpivcol in versions earlier than 4.0.1.8 - KE */ { MYBOOL ok = TRUE; if(varin > 0) obtain_column(lp, varin, pcol, nzidx, NULL); /* Solve, adjusted for objective function scalar */ pcol[0] *= ofscalar; if(prepareupdate) lp->bfp_ftran_prepare(lp, pcol, nzidx); else ftran(lp, pcol, nzidx, roundzero); return(ok); } /* fsolve */ STATIC MYBOOL bsolve(lprec *lp, int row_nr, REAL *rhsvector, int *nzidx, REAL roundzero, REAL ofscalar) { MYBOOL ok = TRUE; if(row_nr >= 0) /* Note that row_nr == 0 returns the [1, 0...0 ] vector */ row_nr = obtain_column(lp, row_nr, rhsvector, nzidx, NULL); /* Solve, adjusted for objective function scalar */ rhsvector[0] *= ofscalar; btran(lp, rhsvector, nzidx, roundzero); return(ok); } /* bsolve */ /* Vector compression and expansion routines */ STATIC MYBOOL vec_compress(REAL *densevector, int startpos, int endpos, REAL epsilon, REAL *nzvector, int *nzindex) { int n; if((densevector == NULL) || (nzindex == NULL) || (startpos > endpos)) return( FALSE ); n = 0; densevector += startpos; while(startpos <= endpos) { if(fabs(*densevector) > epsilon) { /* Apply zero-threshold */ if(nzvector != NULL) /* Only produce index if no nzvector is given */ nzvector[n] = *densevector; n++; nzindex[n] = startpos; } startpos++; densevector++; } nzindex[0] = n; return( TRUE ); } STATIC MYBOOL vec_expand(REAL *nzvector, int *nzindex, REAL *densevector, int startpos, int endpos) { int i, n; n = nzindex[0]; i = nzindex[n]; densevector += endpos; while(endpos >= startpos) { /* Loop from behind to allow densevector == nzvector */ if(endpos == i) { n--; *densevector = nzvector[n]; i = nzindex[n]; } else *densevector = 0; endpos--; densevector--; } return( TRUE ); } /* ----------------------------------------------------------------------- */ /* Sparse matrix product routines and utility */ /* ----------------------------------------------------------------------- */ STATIC MYBOOL get_colIndexA(lprec *lp, int varset, int *colindex, MYBOOL append) { int i, varnr, P1extraDim, vb, ve, n, nrows = lp->rows, nsum = lp->sum; MYBOOL omitfixed, omitnonfixed; REAL v; /* Find what variable range to scan - default is {SCAN_USERVARS} */ /* First determine the starting position; add from the top, going down */ P1extraDim = abs(lp->P1extraDim); vb = nrows + 1; if(varset & SCAN_ARTIFICIALVARS) vb = nsum - P1extraDim + 1; if(varset & SCAN_USERVARS) vb = nrows + 1; if(varset & SCAN_SLACKVARS) vb = 1; /* Then determine the ending position, add from the bottom, going up */ ve = nsum; if(varset & SCAN_SLACKVARS) ve = nrows; if(varset & SCAN_USERVARS) ve = nsum - P1extraDim; if(varset & SCAN_ARTIFICIALVARS) ve = nsum; /* Adjust for partial pricing */ if(varset & SCAN_PARTIALBLOCK) { SETMAX(vb, partial_blockStart(lp, FALSE)); SETMIN(ve, partial_blockEnd(lp, FALSE)); } /* Determine exclusion columns */ omitfixed = (MYBOOL) ((varset & OMIT_FIXED) != 0); omitnonfixed = (MYBOOL) ((varset & OMIT_NONFIXED) != 0); if(omitfixed && omitnonfixed) return(FALSE); /* Scan the target colums */ if(append) n = colindex[0]; else n = 0; for(varnr = vb; varnr <= ve; varnr++) { /* Skip gap in the specified column scan range (possibly user variables) */ if(varnr > nrows) { if((varnr <= nsum-P1extraDim) && !(varset & SCAN_USERVARS)) continue; #if 1 /* Skip empty columns */ if(/*(lp->P1extraVal == 0) &&*/ (mat_collength(lp->matA, varnr-nrows) == 0)) continue; #endif } /* Find if the variable is in the scope - default is {Ø} */ i = lp->is_basic[varnr]; if((varset & USE_BASICVARS) > 0 && (i)) ; else if((varset & USE_NONBASICVARS) > 0 && (!i)) ; else continue; v = lp->upbo[varnr]; if((omitfixed && (v == 0)) || (omitnonfixed && (v != 0))) continue; /* Append to list */ n++; colindex[n] = varnr; } colindex[0] = n; return(TRUE); } STATIC int prod_Ax(lprec *lp, int *coltarget, REAL *input, int *nzinput, REAL roundzero, REAL ofscalar, REAL *output, int *nzoutput, int roundmode) /* prod_Ax is only used in fimprove; note that it is NOT VALIDATED/verified as of 20030801 - KE */ { int j, colnr, ib, ie, vb, ve; MYBOOL localset, localnz = FALSE, isRC; MATrec *mat = lp->matA; REAL sdp; REAL *value; int *rownr; /* Find what variable range to scan - default is {SCAN_USERVARS} */ /* Define default column target if none was provided */ isRC = (MYBOOL) ((roundmode & MAT_ROUNDRC) != 0); localset = (MYBOOL) (coltarget == NULL); if(localset) { int varset = SCAN_SLACKVARS | SCAN_USERVARS | USE_BASICVARS | OMIT_FIXED; if(isRC && is_piv_mode(lp, PRICE_PARTIAL) && !is_piv_mode(lp, PRICE_FORCEFULL)) varset |= SCAN_PARTIALBLOCK; coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->sum+1, sizeof(*coltarget)); if(!get_colIndexA(lp, varset, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } } localnz = (MYBOOL) (nzinput == NULL); if(localnz) { nzinput = (int *) mempool_obtainVector(lp->workarrays, lp->rows+1, sizeof(*nzinput)); vec_compress(input, 0, lp->rows, lp->matA->epsvalue, NULL, nzinput); } /* Scan the columns */ vb = 1; ve = coltarget[0]; for(vb = 1; vb <= coltarget[0]; vb++) { colnr = coltarget[vb]; j = lp->is_basic[colnr]; /* Perform the multiplication */ sdp = ofscalar*input[j]; if(colnr <= lp->rows) /* A slack variable is in the basis */ output[colnr] += sdp; else { /* A normal variable is in the basis */ colnr -= lp->rows; ib = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(ib); value = &COL_MAT_VALUE(ib); for(; ib < ie; ib++, rownr += matRowColStep, value += matValueStep) { output[*rownr] += (*value)*sdp; } } } roundVector(output+1, lp->rows-1, roundzero); /* Clean up and return */ if(localset) mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); if(localnz) mempool_releaseVector(lp->workarrays, (char *) nzinput, FALSE); return(TRUE); } STATIC int prod_xA(lprec *lp, int *coltarget, REAL *input, int *nzinput, REAL roundzero, REAL ofscalar, REAL *output, int *nzoutput, int roundmode) /* Note that the dot product xa is stored at the active column index of A, i.e. of a. This means that if the basis only contains non-slack variables, output may point to the same vector as input, without overwriting the [0..rows] elements. */ { int colnr, rownr, varnr, ib, ie, vb, ve, nrows = lp->rows; MYBOOL localset, localnz = FALSE, includeOF, isRC; REALXP vmax; register REALXP v; int inz, *rowin, countNZ = 0; MATrec *mat = lp->matA; register REAL *matValue; register int *matRownr; /* Clean output area (only necessary if we are returning the full vector) */ isRC = (MYBOOL) ((roundmode & MAT_ROUNDRC) != 0); if(nzoutput == NULL) { if(input == output) MEMCLEAR(output+nrows+1, lp->columns); else MEMCLEAR(output, lp->sum+1); } /* Find what variable range to scan - default is {SCAN_USERVARS} */ /* Define default column target if none was provided */ localset = (MYBOOL) (coltarget == NULL); if(localset) { int varset = SCAN_SLACKVARS | SCAN_USERVARS | USE_NONBASICVARS | OMIT_FIXED; if(isRC && is_piv_mode(lp, PRICE_PARTIAL) && !is_piv_mode(lp, PRICE_FORCEFULL)) varset |= SCAN_PARTIALBLOCK; coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->sum+1, sizeof(*coltarget)); if(!get_colIndexA(lp, varset, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } } /*#define UseLocalNZ*/ #ifdef UseLocalNZ localnz = (MYBOOL) (nzinput == NULL); if(localnz) { nzinput = (int *) mempool_obtainVector(lp->workarrays, nrows+1, sizeof(*nzinput)); vec_compress(input, 0, nrows, lp->matA->epsvalue, NULL, nzinput); } #endif includeOF = (MYBOOL) (((nzinput == NULL) || (nzinput[1] == 0)) && (input[0] != 0) && lp->obj_in_basis); /* Scan the target colums */ vmax = 0; ve = coltarget[0]; for(vb = 1; vb <= ve; vb++) { varnr = coltarget[vb]; if(varnr <= nrows) { v = input[varnr]; } else { colnr = varnr - nrows; v = 0; ib = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; if(ib < ie) { /* Do dense input vector version */ #ifdef UseLocalNZ if(localnz || (nzinput == NULL)) { #else if(nzinput == NULL) { #endif /* Do the OF */ if(includeOF) #ifdef DirectArrayOF v += input[0] * lp->obj[colnr] * ofscalar; #else v += input[0] * get_OF_active(lp, varnr, ofscalar); #endif /* Initialize pointers */ matRownr = &COL_MAT_ROWNR(ib); matValue = &COL_MAT_VALUE(ib); /* Do extra loop optimization based on target window overlaps */ #ifdef UseLocalNZ if((ib < ie) && (colnr <= *nzinput) && (COL_MAT_ROWNR(ie-1) >= nzinput[colnr]) && (*matRownr <= nzinput[*nzinput]) ) #endif #ifdef NoLoopUnroll /* Then loop over all regular rows */ for(; ib < ie; ib++) { v += input[*matRownr] * (*matValue); matValue += matValueStep; matRownr += matRowColStep; } #else /* Prepare for simple loop unrolling */ if(((ie-ib) % 2) == 1) { v += input[*matRownr] * (*matValue); ib++; matValue += matValueStep; matRownr += matRowColStep; } /* Then loop over remaining pairs of regular rows */ while(ib < ie) { v += input[*matRownr] * (*matValue); v += input[*(matRownr+matRowColStep)] * (*(matValue+matValueStep)); ib += 2; matValue += 2*matValueStep; matRownr += 2*matRowColStep; } #endif } /* Do sparse input vector version */ else { /* Do the OF */ if(includeOF) #ifdef DirectArrayOF v += input[0] * lp->obj[colnr] * ofscalar; #else v += input[0] * get_OF_active(lp, varnr, ofscalar); #endif /* Initialize pointers */ inz = 1; rowin = nzinput+inz; matRownr = &COL_MAT_ROWNR(ib); matValue = &COL_MAT_VALUE(ib); ie--; /* Then loop over all non-OF rows */ while((inz <= *nzinput) && (ib <= ie)) { /* Try to synchronize at right */ while((*rowin > *matRownr) && (ib < ie)) { ib++; matValue += matValueStep; matRownr += matRowColStep; } /* Try to synchronize at left */ while((*rowin < *matRownr) && (inz < *nzinput)) { inz++; rowin++; } /* Perform dot product operation if there was a match */ if(*rowin == *matRownr) { v += input[*rowin] * (*matValue); /* Step forward at left */ inz++; rowin++; } } } } if((roundmode & MAT_ROUNDABS) != 0) { my_roundzero(v, roundzero); } } /* Special handling of small reduced cost values */ if(!isRC || (my_chsign(lp->is_lower[varnr], v) < 0)) { SETMAX(vmax, fabs((REAL) v)); } if(v != 0) { countNZ++; if(nzoutput != NULL) nzoutput[countNZ] = varnr; } output[varnr] = (REAL) v; } /* Compute reduced cost if this option is active */ if(isRC && !lp->obj_in_basis) countNZ = get_basisOF(lp, coltarget, output, nzoutput); /* Check if we should do relative rounding */ if((roundmode & MAT_ROUNDREL) != 0) { if((roundzero > 0) && (nzoutput != NULL)) { ie = 0; if(isRC) { SETMAX(vmax, MAT_ROUNDRCMIN); /* Make sure we don't use very small values */ } vmax *= roundzero; for(ib = 1; ib <= countNZ; ib++) { rownr = nzoutput[ib]; if(fabs(output[rownr]) < vmax) output[rownr] = 0; else { ie++; nzoutput[ie] = rownr; } } countNZ = ie; } } /* Clean up and return */ if(localset) mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); if(localnz) mempool_releaseVector(lp->workarrays, (char *) nzinput, FALSE); if(nzoutput != NULL) *nzoutput = countNZ; return(countNZ); } STATIC MYBOOL prod_xA2(lprec *lp, int *coltarget, REAL *prow, REAL proundzero, int *nzprow, REAL *drow, REAL droundzero, int *nzdrow, REAL ofscalar, int roundmode) { int varnr, colnr, ib, ie, vb, ve, nrows = lp->rows; MYBOOL includeOF, isRC; REALXP dmax, pmax; register REALXP d, p; MATrec *mat = lp->matA; REAL value; register REAL *matValue; register int *matRownr; MYBOOL localset; /* Find what variable range to scan - default is {SCAN_USERVARS} */ /* First determine the starting position; add from the top, going down */ localset = (MYBOOL) (coltarget == NULL); if(localset) { int varset = SCAN_SLACKVARS + SCAN_USERVARS + /*SCAN_ALLVARS +*/ /*SCAN_PARTIALBLOCK+*/ USE_NONBASICVARS+OMIT_FIXED; coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->sum+1, sizeof(*coltarget)); if(!get_colIndexA(lp, varset, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } } /* Initialize variables */ isRC = (MYBOOL) ((roundmode & MAT_ROUNDRC) != 0); pmax = 0; dmax = 0; if(nzprow != NULL) *nzprow = 0; if(nzdrow != NULL) *nzdrow = 0; includeOF = (MYBOOL) (((prow[0] != 0) || (drow[0] != 0)) && lp->obj_in_basis); /* Scan the target colums */ ve = coltarget[0]; for(vb = 1; vb <= ve; vb++) { varnr = coltarget[vb]; if(varnr <= nrows) { p = prow[varnr]; d = drow[varnr]; } else { colnr = varnr - nrows; p = 0; d = 0; ib = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; if(ib < ie) { /* Do the OF */ if(includeOF) { #ifdef DirectArrayOF value = lp->obj[colnr] * ofscalar; #else value = get_OF_active(lp, varnr, ofscalar); #endif p += prow[0] * value; d += drow[0] * value; } /* Then loop over all regular rows */ matRownr = &COL_MAT_ROWNR(ib); matValue = &COL_MAT_VALUE(ib); #ifdef NoLoopUnroll for( ; ib < ie; ib++) { p += prow[*matRownr] * (*matValue); d += drow[*matRownr] * (*matValue); matValue += matValueStep; matRownr += matRowColStep; } #else /* Prepare for simple loop unrolling */ if(((ie-ib) % 2) == 1) { p += prow[*matRownr] * (*matValue); d += drow[*matRownr] * (*matValue); ib++; matValue += matValueStep; matRownr += matRowColStep; } /* Then loop over remaining pairs of regular rows */ while(ib < ie) { p += prow[*matRownr] * (*matValue); p += prow[*(matRownr+matRowColStep)] * (*(matValue+matValueStep)); d += drow[*matRownr] * (*matValue); d += drow[*(matRownr+matRowColStep)] * (*(matValue+matValueStep)); ib += 2; matValue += 2*matValueStep; matRownr += 2*matRowColStep; } #endif } if((roundmode & MAT_ROUNDABS) != 0) { my_roundzero(p, proundzero); my_roundzero(d, droundzero); } } SETMAX(pmax, fabs((REAL) p)); prow[varnr] = (REAL) p; if((nzprow != NULL) && (p != 0)) { (*nzprow)++; nzprow[*nzprow] = varnr; } /* Special handling of reduced cost rounding */ if(!isRC || (my_chsign(lp->is_lower[varnr], d) < 0)) { SETMAX(dmax, fabs((REAL) d)); } drow[varnr] = (REAL) d; if((nzdrow != NULL) && (d != 0)) { (*nzdrow)++; nzdrow[*nzdrow] = varnr; } } /* Compute reduced cost here if this option is active */ if((drow != 0) && !lp->obj_in_basis) get_basisOF(lp, coltarget, drow, nzdrow); /* Check if we should do relative rounding */ if((roundmode & MAT_ROUNDREL) != 0) { if((proundzero > 0) && (nzprow != NULL)) { ie = 0; pmax *= proundzero; for(ib = 1; ib <= *nzprow; ib++) { varnr = nzprow[ib]; if(fabs(prow[varnr]) < pmax) prow[varnr] = 0; else { ie++; nzprow[ie] = varnr; } } *nzprow = ie; } if((droundzero > 0) && (nzdrow != NULL)) { ie = 0; if(isRC) { SETMAX(dmax, MAT_ROUNDRCMIN); /* Make sure we don't use very small values */ } dmax *= droundzero; for(ib = 1; ib <= *nzdrow; ib++) { varnr = nzdrow[ib]; if(fabs(drow[varnr]) < dmax) drow[varnr] = 0; else { ie++; nzdrow[ie] = varnr; } } *nzdrow = ie; } } /* Clean up and return */ if(localset) mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return( TRUE ); } STATIC void bsolve_xA2(lprec *lp, int* coltarget, int row_nr1, REAL *vector1, REAL roundzero1, int *nzvector1, int row_nr2, REAL *vector2, REAL roundzero2, int *nzvector2, int roundmode) { REAL ofscalar = 1.0; /* Clear and initialize first vector */ if(nzvector1 == NULL) MEMCLEAR(vector1, lp->sum + 1); else MEMCLEAR(vector1, lp->rows + 1); vector1[row_nr1] = 1; /* workINT[0] = 1; workINT[1] = row_nr1; */ if(vector2 == NULL) { lp->bfp_btran_normal(lp, vector1, NULL); prod_xA(lp, coltarget, vector1, NULL, roundzero1, ofscalar*0, vector1, nzvector1, roundmode); } else { /* Clear and initialize second vector */ if(nzvector2 == NULL) MEMCLEAR(vector2, lp->sum + 1); else MEMCLEAR(vector2, lp->rows + 1); if(lp->obj_in_basis || (row_nr2 > 0)) { vector2[row_nr2] = 1; /* workINT[2] = 1; workINT[3] = row_nr2; */ } else get_basisOF(lp, NULL, vector2, nzvector2); /* A double BTRAN equation solver process is implemented "in-line" below in order to save time and to implement different rounding for the two */ lp->bfp_btran_double(lp, vector1, NULL, vector2, NULL); /* Multiply solution vectors with matrix values */ prod_xA2(lp, coltarget, vector1, roundzero1, nzvector1, vector2, roundzero2, nzvector2, ofscalar, roundmode); } } lp_solve_5.5/lp_matrix.h100666 0 0 27646 11141374245 13750 0ustar usergroup#ifndef HEADER_lp_matrix #define HEADER_lp_matrix #include "lp_types.h" #include "lp_utils.h" /* Sparse matrix element (ordered columnwise) */ typedef struct _MATitem { int rownr; int colnr; REAL value; } MATitem; /* Constants for matrix product rounding options */ #define MAT_ROUNDNONE 0 #define MAT_ROUNDABS 1 #define MAT_ROUNDREL 2 #define MAT_ROUNDABSREL (MAT_ROUNDABS + MAT_ROUNDREL) #define MAT_ROUNDRC 4 #define MAT_ROUNDRCMIN 1.0 /* lp->epspivot */ #if 1 #define MAT_ROUNDDEFAULT MAT_ROUNDREL /* Typically increases performance */ #else #define MAT_ROUNDDEFAULT MAT_ROUNDABS /* Probably gives more precision */ #endif /* Compiler option development features */ /*#define DebugInv*/ /* Report array values at factorization/inversion */ #define NoLoopUnroll /* Do not do loop unrolling */ #define DirectArrayOF /* Reference lp->obj[] array instead of function call */ /* Matrix column access macros to be able to easily change storage model */ #define CAM_Record 0 #define CAM_Vector 1 #if 0 #define MatrixColAccess CAM_Record #else #define MatrixColAccess CAM_Vector #endif #if MatrixColAccess==CAM_Record #define SET_MAT_ijA(item,i,j,A) mat->col_mat[item].rownr = i; \ mat->col_mat[item].colnr = j; \ mat->col_mat[item].value = A #define COL_MAT_COLNR(item) (mat->col_mat[item].colnr) #define COL_MAT_ROWNR(item) (mat->col_mat[item].rownr) #define COL_MAT_VALUE(item) (mat->col_mat[item].value) #define COL_MAT_COPY(left,right) mat->col_mat[left] = mat->col_mat[right] #define COL_MAT_MOVE(to,from,rec) MEMMOVE(&(mat->col_mat[to]),&(mat->col_mat[from]),rec) #define COL_MAT2_COLNR(item) (mat2->col_mat[item].colnr) #define COL_MAT2_ROWNR(item) (mat2->col_mat[item].rownr) #define COL_MAT2_VALUE(item) (mat2->col_mat[item].value) #define matRowColStep (sizeof(MATitem)/sizeof(int)) #define matValueStep (sizeof(MATitem)/sizeof(REAL)) #else /* if MatrixColAccess==CAM_Vector */ #define SET_MAT_ijA(item,i,j,A) mat->col_mat_rownr[item] = i; \ mat->col_mat_colnr[item] = j; \ mat->col_mat_value[item] = A #define COL_MAT_COLNR(item) (mat->col_mat_colnr[item]) #define COL_MAT_ROWNR(item) (mat->col_mat_rownr[item]) #define COL_MAT_VALUE(item) (mat->col_mat_value[item]) #define COL_MAT_COPY(left,right) COL_MAT_COLNR(left) = COL_MAT_COLNR(right); \ COL_MAT_ROWNR(left) = COL_MAT_ROWNR(right); \ COL_MAT_VALUE(left) = COL_MAT_VALUE(right) #define COL_MAT_MOVE(to,from,rec) MEMMOVE(&COL_MAT_COLNR(to),&COL_MAT_COLNR(from),rec); \ MEMMOVE(&COL_MAT_ROWNR(to),&COL_MAT_ROWNR(from),rec); \ MEMMOVE(&COL_MAT_VALUE(to),&COL_MAT_VALUE(from),rec) #define COL_MAT2_COLNR(item) (mat2->col_mat_colnr[item]) #define COL_MAT2_ROWNR(item) (mat2->col_mat_rownr[item]) #define COL_MAT2_VALUE(item) (mat2->col_mat_value[item]) #define matRowColStep 1 #define matValueStep 1 #endif /* Matrix row access macros to be able to easily change storage model */ #define RAM_Index 0 #define RAM_FullCopy 1 #define MatrixRowAccess RAM_Index #if MatrixRowAccess==RAM_Index #define ROW_MAT_COLNR(item) COL_MAT_COLNR(mat->row_mat[item]) #define ROW_MAT_ROWNR(item) COL_MAT_ROWNR(mat->row_mat[item]) #define ROW_MAT_VALUE(item) COL_MAT_VALUE(mat->row_mat[item]) #elif MatrixColAccess==CAM_Record #define ROW_MAT_COLNR(item) (mat->row_mat[item].colnr) #define ROW_MAT_ROWNR(item) (mat->row_mat[item].rownr) #define ROW_MAT_VALUE(item) (mat->row_mat[item].value) #else /* if MatrixColAccess==CAM_Vector */ #define ROW_MAT_COLNR(item) (mat->row_mat_colnr[item]) #define ROW_MAT_ROWNR(item) (mat->row_mat_rownr[item]) #define ROW_MAT_VALUE(item) (mat->row_mat_value[item]) #endif typedef struct _MATrec { /* Owner reference */ lprec *lp; /* Active dimensions */ int rows; int columns; /* Allocated memory */ int rows_alloc; int columns_alloc; int mat_alloc; /* The allocated size for matrix sized structures */ /* Sparse problem matrix storage */ #if MatrixColAccess==CAM_Record MATitem *col_mat; /* mat_alloc : The sparse data storage */ #else /*MatrixColAccess==CAM_Vector*/ int *col_mat_colnr; int *col_mat_rownr; REAL *col_mat_value; #endif int *col_end; /* columns_alloc+1 : col_end[i] is the index of the first element after column i; column[i] is stored in elements col_end[i-1] to col_end[i]-1 */ int *col_tag; /* user-definable tag associated with each column */ #if MatrixRowAccess==RAM_Index int *row_mat; /* mat_alloc : From index 0, row_mat contains the row-ordered index of the elements of col_mat */ #elif MatrixColAccess==CAM_Record MATitem *row_mat; /* mat_alloc : From index 0, row_mat contains the row-ordered copy of the elements in col_mat */ #else /*if MatrixColAccess==CAM_Vector*/ int *row_mat_colnr; int *row_mat_rownr; REAL *row_mat_value; #endif int *row_end; /* rows_alloc+1 : row_end[i] is the index of the first element in row_mat after row i */ int *row_tag; /* user-definable tag associated with each row */ REAL *colmax; /* Array of maximum values of each column */ REAL *rowmax; /* Array of maximum values of each row */ REAL epsvalue; /* Zero element rejection threshold */ REAL infnorm; /* The largest absolute value in the matrix */ REAL dynrange; MYBOOL row_end_valid; /* TRUE if row_end & row_mat are valid */ MYBOOL is_roworder; /* TRUE if the current (temporary) matrix order is row-wise */ } MATrec; typedef struct _DeltaVrec { lprec *lp; int activelevel; MATrec *tracker; } DeltaVrec; #ifdef __cplusplus __EXTERN_C { #endif /* Sparse matrix routines */ STATIC MATrec *mat_create(lprec *lp, int rows, int columns, REAL epsvalue); STATIC MYBOOL mat_memopt(MATrec *mat, int rowextra, int colextra, int nzextra); STATIC void mat_free(MATrec **matrix); STATIC MYBOOL inc_matrow_space(MATrec *mat, int deltarows); STATIC int mat_mapreplace(MATrec *mat, LLrec *rowmap, LLrec *colmap, MATrec *insmat); STATIC int mat_matinsert(MATrec *mat, MATrec *insmat); STATIC int mat_zerocompact(MATrec *mat); STATIC int mat_rowcompact(MATrec *mat, MYBOOL dozeros); STATIC int mat_colcompact(MATrec *mat, int prev_rows, int prev_cols); STATIC MYBOOL inc_matcol_space(MATrec *mat, int deltacols); STATIC MYBOOL inc_mat_space(MATrec *mat, int mindelta); STATIC int mat_shiftrows(MATrec *mat, int *bbase, int delta, LLrec *varmap); STATIC int mat_shiftcols(MATrec *mat, int *bbase, int delta, LLrec *varmap); STATIC MATrec *mat_extractmat(MATrec *mat, LLrec *rowmap, LLrec *colmap, MYBOOL negated); STATIC int mat_appendrow(MATrec *mat, int count, REAL *row, int *colno, REAL mult, MYBOOL checkrowmode); STATIC int mat_appendcol(MATrec *mat, int count, REAL *column, int *rowno, REAL mult, MYBOOL checkrowmode); MYBOOL mat_get_data(lprec *lp, int matindex, MYBOOL isrow, int **rownr, int **colnr, REAL **value); MYBOOL mat_set_rowmap(MATrec *mat, int row_mat_index, int rownr, int colnr, int col_mat_index); STATIC MYBOOL mat_indexrange(MATrec *mat, int index, MYBOOL isrow, int *startpos, int *endpos); STATIC MYBOOL mat_validate(MATrec *mat); STATIC MYBOOL mat_equalRows(MATrec *mat, int baserow, int comprow); STATIC int mat_findelm(MATrec *mat, int row, int column); STATIC int mat_findins(MATrec *mat, int row, int column, int *insertpos, MYBOOL validate); STATIC void mat_multcol(MATrec *mat, int col_nr, REAL mult, MYBOOL DoObj); STATIC REAL mat_getitem(MATrec *mat, int row, int column); STATIC MYBOOL mat_setitem(MATrec *mat, int row, int column, REAL value); STATIC MYBOOL mat_additem(MATrec *mat, int row, int column, REAL delta); STATIC MYBOOL mat_setvalue(MATrec *mat, int Row, int Column, REAL Value, MYBOOL doscale); STATIC int mat_nonzeros(MATrec *mat); STATIC int mat_collength(MATrec *mat, int colnr); STATIC int mat_rowlength(MATrec *mat, int rownr); STATIC void mat_multrow(MATrec *mat, int row_nr, REAL mult); STATIC void mat_multadd(MATrec *mat, REAL *lhsvector, int varnr, REAL mult); STATIC MYBOOL mat_setrow(MATrec *mat, int rowno, int count, REAL *row, int *colno, MYBOOL doscale, MYBOOL checkrowmode); STATIC MYBOOL mat_setcol(MATrec *mat, int colno, int count, REAL *column, int *rowno, MYBOOL doscale, MYBOOL checkrowmode); STATIC MYBOOL mat_mergemat(MATrec *target, MATrec *source, MYBOOL usecolmap); STATIC int mat_checkcounts(MATrec *mat, int *rownum, int *colnum, MYBOOL freeonexit); STATIC int mat_expandcolumn(MATrec *mat, int colnr, REAL *column, int *nzlist, MYBOOL signedA); STATIC MYBOOL mat_computemax(MATrec *mat); STATIC MYBOOL mat_transpose(MATrec *mat); /* Refactorization and recomputation routine */ MYBOOL __WINAPI invert(lprec *lp, MYBOOL shiftbounds, MYBOOL final); /* Vector compression and expansion routines */ STATIC MYBOOL vec_compress(REAL *densevector, int startpos, int endpos, REAL epsilon, REAL *nzvector, int *nzindex); STATIC MYBOOL vec_expand(REAL *nzvector, int *nzindex, REAL *densevector, int startpos, int endpos); /* Sparse matrix products */ STATIC MYBOOL get_colIndexA(lprec *lp, int varset, int *colindex, MYBOOL append); STATIC int prod_Ax(lprec *lp, int *coltarget, REAL *input, int *nzinput, REAL roundzero, REAL ofscalar, REAL *output, int *nzoutput, int roundmode); STATIC int prod_xA(lprec *lp, int *coltarget, REAL *input, int *nzinput, REAL roundzero, REAL ofscalar, REAL *output, int *nzoutput, int roundmode); STATIC MYBOOL prod_xA2(lprec *lp, int *coltarget, REAL *prow, REAL proundzero, int *pnzprow, REAL *drow, REAL droundzero, int *dnzdrow, REAL ofscalar, int roundmode); /* Equation solution */ STATIC MYBOOL fimprove(lprec *lp, REAL *pcol, int *nzidx, REAL roundzero); STATIC void ftran(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero); STATIC MYBOOL bimprove(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero); STATIC void btran(lprec *lp, REAL *rhsvector, int *nzidx, REAL roundzero); /* Combined equation solution and matrix product for simplex operations */ STATIC MYBOOL fsolve(lprec *lp, int varin, REAL *pcol, int *nzidx, REAL roundzero, REAL ofscalar, MYBOOL prepareupdate); STATIC MYBOOL bsolve(lprec *lp, int row_nr, REAL *rhsvector, int *nzidx, REAL roundzero, REAL ofscalar); STATIC void bsolve_xA2(lprec *lp, int* coltarget, int row_nr1, REAL *vector1, REAL roundzero1, int *nzvector1, int row_nr2, REAL *vector2, REAL roundzero2, int *nzvector2, int roundmode); /* Change-tracking routines (primarily for B&B and presolve) */ STATIC DeltaVrec *createUndoLadder(lprec *lp, int levelitems, int maxlevels); STATIC int incrementUndoLadder(DeltaVrec *DV); STATIC MYBOOL modifyUndoLadder(DeltaVrec *DV, int itemno, REAL target[], REAL newvalue); STATIC int countsUndoLadder(DeltaVrec *DV); STATIC int restoreUndoLadder(DeltaVrec *DV, REAL target[]); STATIC int decrementUndoLadder(DeltaVrec *DV); STATIC MYBOOL freeUndoLadder(DeltaVrec **DV); /* Specialized presolve undo functions */ STATIC MYBOOL appendUndoPresolve(lprec *lp, MYBOOL isprimal, REAL beta, int colnrDep); STATIC MYBOOL addUndoPresolve(lprec *lp, MYBOOL isprimal, int colnrElim, REAL alpha, REAL beta, int colnrDep); #ifdef __cplusplus } #endif #endif /* HEADER_lp_matrix */ lp_solve_5.5/lp_MDO.c100666 0 0 15512 11141374245 13043 0ustar usergroup/* Minimum matrix inverse fill-in modules - interface for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: string.h, colamd.h, lp_lib.h Release notes: v1.0 1 September 2003 Preprocessing routines for minimum fill-in column ordering for inverse factorization using the open source COLAMD library. Suitable for the dense parts of both the product form and LU factorization inverse methods. v1.1 1 July 2004 Renamed from lp_colamdMDO to lp_MDO. ---------------------------------------------------------------------------------- */ #include #include "commonlib.h" #include "lp_lib.h" #include "colamd.h" #include "lp_MDO.h" #ifdef FORTIFY # include "lp_fortify.h" #endif STATIC MYBOOL includeMDO(MYBOOL *usedpos, int item) { /* Legend: TRUE => A basic slack variable already in the basis FALSE => A column free for being pivoted in AUTOMATIC+TRUE => A row-singleton user column pivoted into the basis AUTOMATIC+FALSE => A column-singleton user column pivoted into the basis */ /* Handle case where we are processing all columns */ if(usedpos == NULL) return( TRUE ); else { /* Otherwise do the selective case */ MYBOOL test = usedpos[item]; #if 1 return( test != TRUE ); #else test = test & TRUE; return( test == FALSE ); #endif } } STATIC int prepareMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *data, int *rowmap) /* This routine prepares data structures for colamd(). It is called twice, the first time to count applicable non-zero elements by column, and the second time to fill in the row indexes of the non-zero values from the first call. Note that the colamd() row index base is 0 (which suits lp_solve fine). */ { int i, ii, j, k, kk; int nrows = lp->rows+1, ncols = colorder[0]; int offset = 0, Bnz = 0, Tnz; MYBOOL dotally = (MYBOOL) (rowmap == NULL); MATrec *mat = lp->matA; REAL hold; REAL *value; int *rownr; if(dotally) data[0] = 0; Tnz = nrows - ncols; for(j = 1; j <= ncols; j++) { kk = colorder[j]; /* Process slacks */ if(kk <= lp->rows) { if(includeMDO(usedpos, kk)) { if(!dotally) data[Bnz] = rowmap[kk]+offset; Bnz++; } Tnz++; } /* Process user columns */ else { k = kk - lp->rows; i = mat->col_end[k-1]; ii= mat->col_end[k]; Tnz += ii-i; #ifdef Paranoia if(i >= ii) lp->report(lp, SEVERE, "prepareMDO: Encountered empty basic column %d\n", k); #endif /* Detect if we need to do phase 1 adjustments of zero-valued OF variable */ rownr = &COL_MAT_ROWNR(i); value = &COL_MAT_VALUE(i); hold = 0; if((*rownr > 0) && includeMDO(usedpos, 0) && modifyOF1(lp, kk, &hold, 1.0)) { if(!dotally) data[Bnz] = offset; Bnz++; } /* Loop over all NZ-variables */ for(; i < ii; i++, value += matValueStep, rownr += matRowColStep) { if(!includeMDO(usedpos, *rownr)) continue; /* See if we need to change phase 1 OF value */ if(*rownr == 0) { hold = *value; if(!modifyOF1(lp, kk, &hold, 1.0)) continue; } /* Tally uneliminated constraint row values */ if(!dotally) data[Bnz] = rowmap[*rownr]+offset; Bnz++; } } if(dotally) data[j] = Bnz; } return( Tnz ); } STATIC MYBOOL verifyMDO(lprec *lp, int *col_end, int *row_nr, int rowmax, int colmax) { int i, j, n, err = 0; for(i = 1; i <= colmax; i++) { n = 0; for(j = col_end[i-1]; (j < col_end[i]) && (err == 0); j++, n++) { if(row_nr[j] < 0 || row_nr[j] > rowmax) err = 1; if(n > 0 && row_nr[j] <= row_nr[j-1]) err = 2; n++; } } if(err != 0) lp->report(lp, SEVERE, "verifyMDO: Invalid MDO input structure generated (error %d)\n", err); return( (MYBOOL) (err == 0) ); } void *mdo_calloc(size_t size, size_t count) { return ( calloc(size, count) ); } void mdo_free(void *mem) { free( mem ); } int __WINAPI getMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL symmetric) { int error = FALSE; int nrows = lp->rows+1, ncols = colorder[0]; int i, j, kk, n; int *col_end, *row_map = NULL; int Bnz, Blen, *Brows = NULL; int stats[COLAMD_STATS]; double knobs[COLAMD_KNOBS]; /* Tally the non-zero counts of the unused columns/rows of the basis matrix and store corresponding "net" starting positions */ allocINT(lp, &col_end, ncols+1, FALSE); n = prepareMDO(lp, usedpos, colorder, col_end, NULL); Bnz = col_end[ncols]; /* Check that we have unused basic columns, otherwise skip analysis */ if(ncols == 0 || Bnz == 0) goto Transfer; /* Get net number of rows and fill mapper */ allocINT(lp, &row_map, nrows, FALSE); nrows = 0; for(i = 0; i <= lp->rows; i++) { row_map[i] = i-nrows; /* Increment eliminated row counter if necessary */ if(!includeMDO(usedpos, i)) nrows++; } nrows = lp->rows+1 - nrows; /* Store row indeces of non-zero values in the basic columns */ Blen = colamd_recommended(Bnz, nrows, ncols); allocINT(lp, &Brows, Blen, FALSE); prepareMDO(lp, usedpos, colorder, Brows, row_map); #ifdef Paranoia verifyMDO(lp, col_end, Brows, nrows, ncols); #endif /* Compute the MDO */ #if 1 colamd_set_defaults(knobs); knobs [COLAMD_DENSE_ROW] = 0.2+0.2 ; /* default changed for UMFPACK */ knobs [COLAMD_DENSE_COL] = knobs [COLAMD_DENSE_ROW]; if(symmetric && (nrows == ncols)) { MEMCOPY(colorder, Brows, ncols + 1); error = !symamd(nrows, colorder, col_end, Brows, knobs, stats, mdo_calloc, mdo_free); } else error = !colamd(nrows, ncols, Blen, Brows, col_end, knobs, stats); #else if(symmetric && (nrows == ncols)) { MEMCOPY(colorder, Brows, ncols + 1); error = !symamd(nrows, colorder, col_end, Brows, knobs, stats, mdo_calloc, mdo_free); } else error = !colamd(nrows, ncols, Blen, Brows, col_end, (double *) NULL, stats); #endif /* Transfer the estimated optimal ordering, adjusting for index offsets */ Transfer: if(error) error = stats[COLAMD_STATUS]; else { MEMCOPY(Brows, colorder, ncols + 1); for(j = 0; j < ncols; j++) { kk = col_end[j]; n = Brows[kk+1]; colorder[j+1] = n; } } /* Free temporary vectors */ FREE(col_end); if(row_map != NULL) FREE(row_map); if(Brows != NULL) FREE(Brows); if(size != NULL) *size = ncols; return( error ); } lp_solve_5.5/lp_MDO.h100666 0 0 374 11141374245 13010 0ustar usergroup#ifndef HEADER_MDO #define HEADER_MDO #include "lp_types.h" #ifdef __cplusplus extern "C" { #endif int __WINAPI getMDO(lprec *lp, MYBOOL *usedpos, int *colorder, int *size, MYBOOL symmetric); #ifdef __cplusplus } #endif #endif /* HEADER_MDO */ lp_solve_5.5/lp_mipbb.c100666 0 0 137472 11250516633 13547 0ustar usergroup /* Mixed integer programming optimization drivers for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Michel Berkelaar (to lp_solve v3.2) Kjell Eikland (v4.0 and forward) Contact: License terms: LGPL. Requires: string.h, float.h, commonlib.h, lp_lib.h, lp_report.h, lp_simplex.h Release notes: v5.0.0 31 January 2004 New unit isolating B&B routines. v5.0.1 01 February 2004 Complete rewrite into non-recursive version. v5.0.2 05 April 2004 Expanded pseudocosting with options for MIP fraction counts and "cost/benefit" ratio (KE special!). Added GUB functionality based on SOS structures. v5.0.3 1 May 2004 Changed routine names to be more intuitive. v5.0.4 15 May 2004 Added functinality to pack bounds in order to conserve memory in B&B-processing large MIP models. v5.1.0 25 July 2004 Added functions for dynamic cut generation. v5.2.0 15 December 2004 Added functions for reduced cost variable fixing and converted to delta-model of B&B bound storage. ---------------------------------------------------------------------------------- */ #include #include #include "commonlib.h" #include "lp_lib.h" #include "lp_scale.h" #include "lp_report.h" #include "lp_simplex.h" #include "lp_mipbb.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Allocation routine for the BB record structure */ STATIC BBrec *create_BB(lprec *lp, BBrec *parentBB, MYBOOL dofullcopy) { BBrec *newBB; newBB = (BBrec *) calloc(1, sizeof(*newBB)); if(newBB != NULL) { if(parentBB == NULL) { allocREAL(lp, &newBB->upbo, lp->sum + 1, FALSE); allocREAL(lp, &newBB->lowbo, lp->sum + 1, FALSE); MEMCOPY(newBB->upbo, lp->orig_upbo, lp->sum + 1); MEMCOPY(newBB->lowbo, lp->orig_lowbo, lp->sum + 1); } else if(dofullcopy) { allocREAL(lp, &newBB->upbo, lp->sum + 1, FALSE); allocREAL(lp, &newBB->lowbo, lp->sum + 1, FALSE); MEMCOPY(newBB->upbo, parentBB->upbo, lp->sum + 1); MEMCOPY(newBB->lowbo, parentBB->lowbo, lp->sum + 1); } else { newBB->upbo = parentBB->upbo; newBB->lowbo = parentBB->lowbo; } newBB->contentmode = dofullcopy; newBB->lp = lp; /* Set parent by default, but not child */ newBB->parent = parentBB; } return( newBB ); } /* Pushing and popping routines for the B&B structure */ STATIC BBrec *push_BB(lprec *lp, BBrec *parentBB, int varno, int vartype, int varcus) /* Push ingoing bounds and B&B data onto the stack */ { BBrec *newBB; /* Do initialization and updates */ if(parentBB == NULL) parentBB = lp->bb_bounds; newBB = create_BB(lp, parentBB, FALSE); if(newBB != NULL) { newBB->varno = varno; newBB->vartype = vartype; newBB->lastvarcus = varcus; incrementUndoLadder(lp->bb_lowerchange); newBB->LBtrack++; incrementUndoLadder(lp->bb_upperchange); newBB->UBtrack++; /* Adjust variable fixing/bound tightening based on the last reduced cost */ if((parentBB != NULL) && (parentBB->lastrcf > 0)) { MYBOOL isINT; int k, ii, nfixed = 0, ntighten = 0; REAL deltaUL; for(k = 1; k <= lp->nzdrow[0]; k++) { ii = lp->nzdrow[k]; #ifdef UseMilpSlacksRCF /* Check if we should include ranged constraints */ isINT = FALSE; #else if(ii <= lp->rows) continue; isINT = is_int(lp, ii-lp->rows); #endif #ifndef UseMilpExpandedRCF /* Don't include non-integers if it is not defined */ if(!isINT) continue; #endif switch(abs(rcfbound_BB(newBB, ii, isINT, &deltaUL, NULL))) { case LE: SETMIN(deltaUL, newBB->upbo[ii]); SETMAX(deltaUL, newBB->lowbo[ii]); modifyUndoLadder(lp->bb_upperchange, ii, newBB->upbo, deltaUL); break; case GE: SETMAX(deltaUL, newBB->lowbo[ii]); SETMIN(deltaUL, newBB->upbo[ii]); modifyUndoLadder(lp->bb_lowerchange, ii, newBB->lowbo, deltaUL); break; default: continue; } if(newBB->upbo[ii] == newBB->lowbo[ii]) nfixed++; else ntighten++; } if(lp->bb_trace) { report(lp, DETAILED, "push_BB: Used reduced cost to fix %d variables and tighten %d bounds\n", nfixed, ntighten); } } /* Handle case where we are pushing at the end */ if(parentBB == lp->bb_bounds) lp->bb_bounds = newBB; /* Handle case where we are pushing in the middle */ else newBB->child = parentBB->child; if(parentBB != NULL) parentBB->child = newBB; lp->bb_level++; if(lp->bb_level > lp->bb_maxlevel) lp->bb_maxlevel = lp->bb_level; if(!initbranches_BB(newBB)) newBB = pop_BB(newBB); else if(MIP_count(lp) > 0) { if( (lp->bb_level <= 1) && (lp->bb_varactive == NULL) && (!allocINT(lp, &lp->bb_varactive, lp->columns+1, TRUE) || !initcuts_BB(lp)) ) newBB = pop_BB(newBB); if(varno > 0) { lp->bb_varactive[varno-lp->rows]++; } } } return( newBB ); } STATIC MYBOOL free_BB(BBrec **BB) { MYBOOL parentreturned = FALSE; if((BB != NULL) && (*BB != NULL)) { BBrec *parent = (*BB)->parent; if((parent == NULL) || (*BB)->contentmode) { FREE((*BB)->upbo); FREE((*BB)->lowbo); } FREE((*BB)->varmanaged); FREE(*BB); parentreturned = (MYBOOL) (parent != NULL); if(parentreturned) *BB = parent; } return( parentreturned ); } STATIC BBrec *pop_BB(BBrec *BB) /* Pop / free the previously "pushed" / saved bounds */ { int k; BBrec *parentBB; lprec *lp = BB->lp; if(BB == NULL) return( BB ); /* Handle case where we are popping the end of the chain */ parentBB = BB->parent; if(BB == lp->bb_bounds) { lp->bb_bounds = parentBB; if(parentBB != NULL) parentBB->child = NULL; } /* Handle case where we are popping inside or at the beginning of the chain */ else { if(parentBB != NULL) parentBB->child = BB->child; if(BB->child != NULL) BB->child->parent = parentBB; } /* Unwind other variables */ if(lp->bb_upperchange != NULL) { restoreUndoLadder(lp->bb_upperchange, BB->upbo); for(; BB->UBtrack > 0; BB->UBtrack--) { decrementUndoLadder(lp->bb_upperchange); restoreUndoLadder(lp->bb_upperchange, BB->upbo); } } if(lp->bb_lowerchange != NULL) { restoreUndoLadder(lp->bb_lowerchange, BB->lowbo); for(; BB->LBtrack > 0; BB->LBtrack--) { decrementUndoLadder(lp->bb_lowerchange); restoreUndoLadder(lp->bb_lowerchange, BB->lowbo); } } lp->bb_level--; k = BB->varno - lp->rows; if(lp->bb_level == 0) { if(lp->bb_varactive != NULL) { FREE(lp->bb_varactive); freecuts_BB(lp); } if(lp->int_vars+lp->sc_vars > 0) free_pseudocost(lp); pop_basis(lp, FALSE); lp->rootbounds = NULL; } else lp->bb_varactive[k]--; /* Undo SOS/GUB markers */ if(BB->isSOS && (BB->vartype != BB_INT)) SOS_unmark(lp->SOS, 0, k); else if(BB->isGUB) SOS_unmark(lp->GUB, 0, k); /* Undo the SC marker */ if(BB->sc_canset) lp->sc_lobound[k] *= -1; /* Pop the associated basis */ #if 1 /* Original version that does not restore previous basis */ pop_basis(lp, FALSE); #else /* Experimental version that restores previous basis */ pop_basis(lp, BB->isSOS); #endif /* Finally free the B&B object */ free_BB(&BB); /* Return the parent BB */ return( parentBB ); } /* Here are heuristic routines to see if we need bother with branching further 1. A probing routine to see of the best OF can be better than incumbent 2. A presolve routine to fix other variables and detect infeasibility THIS IS INACTIVE CODE, PLACEHOLDERS FOR FUTURE DEVELOPMENT!!! */ STATIC REAL probe_BB(BBrec *BB) { int i, ii; REAL coefOF, sum = 0; lprec *lp = BB->lp; /* Loop over all ints to see if the best possible solution stands any chance of being better than the incumbent solution */ if(lp->solutioncount == 0) return( lp->infinite ); for(i = 1; i <= lp->columns; i++) { if(!is_int(lp, i)) continue; ii = lp->rows + i; coefOF = lp->obj[i]; if(coefOF < 0) { if(is_infinite(lp, BB->lowbo[ii])) return( lp->infinite ); sum += coefOF * (lp->solution[ii]-BB->lowbo[ii]); } else { if(is_infinite(lp, BB->upbo[ii])) return( lp->infinite ); sum += coefOF * (BB->upbo[ii] - lp->solution[ii]); } } return( sum ); } STATIC REAL presolve_BB(BBrec *BB) { return( 0 ); } /* Node and branch management routines */ STATIC MYBOOL initbranches_BB(BBrec *BB) { REAL new_bound, temp; int k; lprec *lp = BB->lp; /* Create and initialize local bounds and basis */ BB->nodestatus = NOTRUN; BB->noderesult = lp->infinite; push_basis(lp, NULL, NULL, NULL); /* Set default number of branches at the current B&B branch */ if(BB->vartype == BB_REAL) BB->nodesleft = 1; else { /* The default is a binary up-low branching */ BB->nodesleft = 2; /* Initialize the MIP status code pair and set reference values */ k = BB->varno - lp->rows; BB->lastsolution = lp->solution[BB->varno]; /* Determine if we must process in the B&B SOS mode */ BB->isSOS = (MYBOOL) ((BB->vartype == BB_SOS) || SOS_is_member(lp->SOS, 0, k)); #ifdef Paranoia if((BB->vartype == BB_SOS) && !SOS_is_member(lp->SOS, 0, k)) report(lp, SEVERE, "initbranches_BB: Inconsistent identification of SOS variable %s (%d)\n", get_col_name(lp, k), k); #endif /* Check if we have a GUB-member variable that needs a triple-branch */ BB->isGUB = (MYBOOL) ((BB->vartype == BB_INT) && SOS_can_activate(lp->GUB, 0, k)); if(BB->isGUB) { /* Obtain variable index list from applicable GUB - now the first GUB is used, but we could also consider selecting the longest */ BB->varmanaged = SOS_get_candidates(lp->GUB, -1, k, TRUE, BB->upbo, BB->lowbo); BB->nodesleft++; } /* Set local pruning info, automatic, or user-defined strategy */ if(BB->vartype == BB_SOS) { if(!SOS_can_activate(lp->SOS, 0, k)) { BB->nodesleft--; BB->isfloor = TRUE; } else BB->isfloor = (MYBOOL) (BB->lastsolution == 0); } /* First check if the user wishes to select the branching direction */ else if(lp->bb_usebranch != NULL) BB->isfloor = (MYBOOL) lp->bb_usebranch(lp, lp->bb_branchhandle, k); /* Otherwise check if we should do automatic branching */ else if(get_var_branch(lp, k) == BRANCH_AUTOMATIC) { new_bound = modf(BB->lastsolution/get_pseudorange(lp->bb_PseudoCost, k, BB->vartype), &temp); if(isnan(new_bound)) new_bound = 0; else if(new_bound < 0) new_bound += 1.0; BB->isfloor = (MYBOOL) (new_bound <= 0.5); /* Set direction by OF value; note that a zero-value in the OF gives priority to floor_first = TRUE */ if(is_bb_mode(lp, NODE_GREEDYMODE)) { if(is_bb_mode(lp, NODE_PSEUDOCOSTMODE)) BB->sc_bound = get_pseudonodecost(lp->bb_PseudoCost, k, BB->vartype, BB->lastsolution); else BB->sc_bound = mat_getitem(lp->matA, 0, k); new_bound -= 0.5; BB->sc_bound *= new_bound; BB->isfloor = (MYBOOL) (BB->sc_bound > 0); } /* Set direction by pseudocost (normally used in tandem with NODE_PSEUDOxxxSELECT) */ else if(is_bb_mode(lp, NODE_PSEUDOCOSTMODE)) { BB->isfloor = (MYBOOL) (get_pseudobranchcost(lp->bb_PseudoCost, k, TRUE) > get_pseudobranchcost(lp->bb_PseudoCost, k, FALSE)); if(is_maxim(lp)) BB->isfloor = !BB->isfloor; } /* Check for reversal */ if(is_bb_mode(lp, NODE_BRANCHREVERSEMODE)) BB->isfloor = !BB->isfloor; } else BB->isfloor = (MYBOOL) (get_var_branch(lp, k) == BRANCH_FLOOR); /* SC logic: If the current SC variable value is in the [0..NZLOBOUND> range, then UP: Set lower bound to NZLOBOUND, upper bound is the original LO: Fix the variable by setting upper/lower bound to zero ... indicate that the variable is B&B-active by reversing sign of sc_lobound[]. */ new_bound = fabs(lp->sc_lobound[k]); BB->sc_bound = new_bound; BB->sc_canset = (MYBOOL) (new_bound != 0); /* Must make sure that we handle fractional lower bounds properly; also to ensure that we do a full binary tree search */ new_bound = unscaled_value(lp, new_bound, BB->varno); if(is_int(lp, k) && ((new_bound > 0) && (BB->lastsolution > floor(new_bound)))) { if(BB->lastsolution < ceil(new_bound)) BB->lastsolution += 1; modifyUndoLadder(lp->bb_lowerchange, BB->varno, BB->lowbo, scaled_floor(lp, BB->varno, BB->lastsolution, 1)); } } /* Now initialize the brances and set to first */ return( fillbranches_BB(BB) ); } STATIC MYBOOL fillbranches_BB(BBrec *BB) { int K, k; REAL ult_upbo, ult_lowbo; REAL new_bound, SC_bound, intmargin = BB->lp->epsprimal; lprec *lp = BB->lp; MYBOOL OKstatus = FALSE; if(lp->bb_break || userabort(lp, MSG_MILPSTRATEGY)) return( OKstatus ); K = BB->varno; if(K > 0) { /* Shortcut variables */ k = BB->varno - lp->rows; ult_upbo = lp->orig_upbo[K]; ult_lowbo = lp->orig_lowbo[K]; SC_bound = unscaled_value(lp, BB->sc_bound, K); /* First, establish the upper bound to be applied (when isfloor == TRUE) --------------------------------------------------------------------- */ /*SetUB:*/ BB->UPbound = lp->infinite; /* Handle SC-variables for the [0-LoBound> range */ if((SC_bound > 0) && (fabs(BB->lastsolution) < SC_bound-intmargin)) { new_bound = 0; } /* Handle pure integers (non-SOS, non-SC) */ else if(BB->vartype == BB_INT) { #if 1 if(((ult_lowbo >= 0) && ((floor(BB->lastsolution) < /* Skip cases where the lower bound becomes violated */ unscaled_value(lp, MAX(ult_lowbo, fabs(lp->sc_lobound[k])), K)-intmargin))) || ((ult_upbo <= 0) && /* Was ((ult_lowbo < 0) && */ ((floor(BB->lastsolution) > /* Skip cases where the upper bound becomes violated */ unscaled_value(lp, MIN(ult_upbo, -fabs(lp->sc_lobound[k])), K)-intmargin)))) { #else if((floor(BB->lastsolution) < /* Skip cases where the lower bound becomes violated */ unscaled_value(lp, MAX(ult_lowbo, fabs(lp->sc_lobound[k])), K)-intmargin)) { #endif BB->nodesleft--; goto SetLB; } new_bound = scaled_floor(lp, K, BB->lastsolution, 1); } else if(BB->isSOS) { /* Handle all SOS variants */ new_bound = ult_lowbo; if(is_int(lp, k)) new_bound = scaled_ceil(lp, K, unscaled_value(lp, new_bound, K), -1); } else /* Handle all other variable incarnations */ new_bound = BB->sc_bound; /* Check if the new bound might conflict and possibly make adjustments */ if(new_bound < BB->lowbo[K]) new_bound = BB->lowbo[K] - my_avoidtiny(new_bound-BB->lowbo[K], intmargin); if(new_bound < BB->lowbo[K]) { #ifdef Paranoia debug_print(lp, "fillbranches_BB: New upper bound value %g conflicts with old lower bound %g\n", new_bound, BB->lowbo[K]); #endif BB->nodesleft--; goto SetLB; } #ifdef Paranoia /* Do additional consistency checking */ else if(!check_if_less(lp, new_bound, BB->upbo[K], K)) { BB->nodesleft--; goto SetLB; } #endif /* Bound (at least near) feasible */ else { /* Makes a difference with models like QUEEN (note consistent use of epsint for scaled integer variables) */ if(fabs(new_bound - BB->lowbo[K]) < intmargin*SCALEDINTFIXRANGE) new_bound = BB->lowbo[K]; } BB->UPbound = new_bound; /* Next, establish the lower bound to be applied (when isfloor == FALSE) --------------------------------------------------------------------- */ SetLB: BB->LObound = -lp->infinite; /* Handle SC-variables for the [0-LoBound> range */ if((SC_bound > 0) && (fabs(BB->lastsolution) < SC_bound)) { if(is_int(lp, k)) new_bound = scaled_ceil(lp, K, SC_bound, 1); else new_bound = BB->sc_bound; } /* Handle pure integers (non-SOS, non-SC, but Ok for GUB!) */ else if((BB->vartype == BB_INT)) { if(((ceil(BB->lastsolution) == BB->lastsolution)) || /* Skip branch 0 if the current solution is integer */ (ceil(BB->lastsolution) > /* Skip cases where the upper bound becomes violated */ unscaled_value(lp, ult_upbo, K)+intmargin) || (BB->isSOS && (BB->lastsolution == 0))) { /* Don't branch 0 since this is handled in SOS logic */ BB->nodesleft--; goto Finish; } new_bound = scaled_ceil(lp, K, BB->lastsolution, 1); } else if(BB->isSOS) { /* Handle all SOS variants */ if(SOS_is_member_of_type(lp->SOS, k, SOS3)) new_bound = scaled_floor(lp, K, 1, 1); else { new_bound = ult_lowbo; if(is_int(lp, k)) new_bound = scaled_floor(lp, K, unscaled_value(lp, new_bound, K), 1); /* If we have a high-order SOS (SOS3+) and this variable is "intermediate" between members previously lower-bounded at a non-zero level, then we should set this and similar neighbouring variables at non-zero lowbo-values (remember that SOS3+ members are all either integers or semi-continuous). Flag this situation and prune tree, since we cannot lower-bound. */ if((lp->SOS->maxorder > 2) && (BB->lastsolution == 0) && SOS_is_member_of_type(lp->SOS, k, SOSn)) { BB->isSOS = AUTOMATIC; } } } else /* Handle all other variable incarnations */ new_bound = BB->sc_bound; /* Check if the new bound might conflict and possibly make adjustments */ if(new_bound > BB->upbo[K]) new_bound = BB->upbo[K] + my_avoidtiny(new_bound-BB->upbo[K], intmargin); if(new_bound > BB->upbo[K]) { #ifdef Paranoia debug_print(lp, "fillbranches_BB: New lower bound value %g conflicts with old upper bound %g\n", new_bound, BB->upbo[K]); #endif BB->nodesleft--; goto Finish; } #ifdef Paranoia /* Do additional consistency checking */ else if(!check_if_less(lp, BB->lowbo[K], new_bound, K)) { BB->nodesleft--; goto Finish; } #endif /* Bound (at least near-)feasible */ else { /* Makes a difference with models like QUEEN (note consistent use of lp->epsprimal for scaled integer variables) */ if(fabs(BB->upbo[K]-new_bound) < intmargin*SCALEDINTFIXRANGE) new_bound = BB->upbo[K]; } BB->LObound = new_bound; /* Prepare for the first branch by making sure we are pointing correctly */ Finish: if(BB->nodesleft > 0) { /* Make sure the change tracker levels are "clean" for the B&B */ if(countsUndoLadder(lp->bb_upperchange) > 0) { incrementUndoLadder(lp->bb_upperchange); BB->UBtrack++; } if(countsUndoLadder(lp->bb_lowerchange) > 0) { incrementUndoLadder(lp->bb_lowerchange); BB->LBtrack++; } /* Do adjustments */ if((BB->vartype != BB_SOS) && (fabs(BB->LObound-BB->UPbound) < intmargin)) { BB->nodesleft--; if(fabs(BB->lowbo[K]-BB->LObound) < intmargin) BB->isfloor = FALSE; else if(fabs(BB->upbo[K]-BB->UPbound) < intmargin) BB->isfloor = TRUE; else report(BB->lp, IMPORTANT, "fillbranches_BB: Inconsistent equal-valued bounds for %s\n", get_col_name(BB->lp, k)); } if((BB->nodesleft == 1) && ((BB->isfloor && (BB->UPbound >= lp->infinite)) || (!BB->isfloor && (BB->LObound <= -lp->infinite)))) BB->isfloor = !BB->isfloor; /* Header initialization */ BB->isfloor = !BB->isfloor; while(!OKstatus && /* !userabort(lp, -1) */ lp->spx_status != TIMEOUT && !lp->bb_break && (BB->nodesleft > 0)) OKstatus = nextbranch_BB( BB ); } /* Set an SC variable active, if necessary */ if(BB->sc_canset) lp->sc_lobound[k] *= -1; } else { BB->nodesleft--; OKstatus = TRUE; } return( OKstatus ); } STATIC MYBOOL nextbranch_BB(BBrec *BB) { int k; lprec *lp = BB->lp; MYBOOL OKstatus = FALSE; /* Undo the most recently imposed B&B bounds using the data in the last level of change tracker; this code handles changes to both upper and lower bounds */ if(BB->nodessolved > 0) { restoreUndoLadder(lp->bb_upperchange, BB->upbo); restoreUndoLadder(lp->bb_lowerchange, BB->lowbo); } if(lp->bb_break || userabort(lp, MSG_MILPSTRATEGY)) { /* Handle the special case of B&B restart; (typically used with the restart after pseudocost initialization) */ if((lp->bb_level == 1) && (lp->bb_break == AUTOMATIC)) { lp->bb_break = FALSE; OKstatus = TRUE; } return( OKstatus ); } if(BB->nodesleft > 0) { /* Step and update remaining branch count */ k = BB->varno - lp->rows; BB->isfloor = !BB->isfloor; BB->nodesleft--; /* Special SOS handling: 1) Undo and set new marker for k, 2) In case that previous branch was ceiling restore upper bounds of the non-k variables outside of the SOS window set to 0 */ if(BB->isSOS && (BB->vartype != BB_INT)) { /* First undo previous marker */ if((BB->nodessolved > 0) || ((BB->nodessolved == 0) && (BB->nodesleft == 0))) { if(BB->isfloor) { if((BB->nodesleft == 0) && (lp->orig_lowbo[BB->varno] != 0)) return( OKstatus ); } SOS_unmark(lp->SOS, 0, k); } /* Set new SOS marker */ if(BB->isfloor) { SOS_set_marked(lp->SOS, 0, k, (MYBOOL) (BB->UPbound != 0)); /* Do case of high-order SOS where intervening variables need to be set */ if(BB->isSOS == AUTOMATIC) { /* SOS_fix_list(lp->SOS, 0, k, BB->lowbo, NULL, AUTOMATIC, lp->bb_lowerchange); */ } } else { SOS_set_marked(lp->SOS, 0, k, TRUE); if(SOS_fix_unmarked(lp->SOS, 0, k, BB->upbo, 0, TRUE, NULL, lp->bb_upperchange) < 0) return( OKstatus ); } } /* Special GUB handling (three branches): 1) Undo and set new marker for k, 2) Restore upper bounds of the left/right/all non-k variables set to 0 in the previous branch 3) Set new upper bounds for the non-k variables (k is set later) */ else if(BB->isGUB) { /* First undo previous marker */ if(BB->nodessolved > 0) SOS_unmark(lp->GUB, 0, k); /* Make sure we take floor bound twice */ if((BB->nodesleft == 0) && !BB->isfloor) BB->isfloor = !BB->isfloor; /* Handle two floor instances; (selected variable and left/right halves of non-selected variables at 0) */ SOS_set_marked(lp->GUB, 0, k, (MYBOOL) !BB->isfloor); if(BB->isfloor) { if(SOS_fix_list(lp->GUB, 0, k, BB->upbo, BB->varmanaged, (MYBOOL) (BB->nodesleft > 0), lp->bb_upperchange) < 0) return( OKstatus ); } /* Handle one ceil instance; (selected variable at 1, all other at 0) */ else { if(SOS_fix_unmarked(lp->GUB, 0, k, BB->upbo, 0, TRUE, NULL, lp->bb_upperchange) < 0) return( OKstatus ); } } OKstatus = TRUE; } /* Initialize simplex status variables */ if(OKstatus) { lp->bb_totalnodes++; BB->nodestatus = NOTRUN; BB->noderesult = lp->infinite; } return( OKstatus ); } /* Cut generation and management routines */ STATIC MYBOOL initcuts_BB(lprec *lp) { return( TRUE ); } STATIC int updatecuts_BB(lprec *lp) { return( 0 ); } STATIC MYBOOL freecuts_BB(lprec *lp) { if(lp->bb_cuttype != NULL) FREE(lp->bb_cuttype); return( TRUE ); } /* B&B solver routines */ STATIC int solve_LP(lprec *lp, BBrec *BB) { int tilted, restored, status; REAL testOF, *upbo = BB->upbo, *lowbo = BB->lowbo; BBrec *perturbed = NULL; if(lp->bb_break) return(PROCBREAK); #ifdef Paranoia debug_print(lp, "solve_LP: Starting solve for iter %.0f, B&B node level %d.\n", (double) lp->total_iter, lp->bb_level); if(lp->bb_trace && !validate_bounds(lp, upbo, lowbo)) report(lp, SEVERE, "solve_LP: Inconsistent bounds at iter %.0f, B&B node level %d.\n", (double) lp->total_iter, lp->bb_level); #endif /* Copy user-specified entering bounds into lp_solve working bounds */ impose_bounds(lp, upbo, lowbo); /* Restore previously pushed / saved basis for this level if we are in the B&B mode and it is not the first call of the binary tree */ if(BB->nodessolved > 1) restore_basis(lp); /* Solve and possibly handle degeneracy cases via bound relaxations */ status = RUNNING; tilted = 0; restored = 0; while(status == RUNNING) { /* Copy user-specified entering bounds into lp_solve working bounds and run */ status = spx_run(lp, (MYBOOL) (tilted+restored > 0)); lp->bb_status = status; lp->spx_perturbed = FALSE; if(tilted < 0) break; else if((status == OPTIMAL) && (tilted > 0)) { if(lp->spx_trace) report(lp, DETAILED, "solve_LP: Restoring relaxed bounds at level %d.\n", tilted); /* Restore original pre-perturbed problem bounds, and solve again using the basis found for the perturbed problem; also make sure we rebase and recompute. */ free_BB(&perturbed); if((perturbed == NULL) || (perturbed == BB)) { perturbed = NULL; impose_bounds(lp, upbo, lowbo); } else impose_bounds(lp, perturbed->upbo, perturbed->lowbo); set_action(&lp->spx_action, ACTION_REBASE | ACTION_RECOMPUTE); BB->UBzerobased = FALSE; if(lp->bb_totalnodes == 0) lp->real_solution = lp->infinite; status = RUNNING; tilted--; restored++; lp->spx_perturbed = TRUE; } else if(((lp->bb_level <= 1) || is_anti_degen(lp, ANTIDEGEN_DURINGBB)) && (((status == LOSTFEAS) && is_anti_degen(lp, ANTIDEGEN_LOSTFEAS)) || ((status == INFEASIBLE) && is_anti_degen(lp, ANTIDEGEN_INFEASIBLE)) || ((status == NUMFAILURE) && is_anti_degen(lp, ANTIDEGEN_NUMFAILURE)) || ((status == DEGENERATE) && is_anti_degen(lp, ANTIDEGEN_STALLING)))) { /* Allow up to .. consecutive relaxations for non-B&B phases */ if((tilted <= DEF_MAXRELAX) && /* Conventional recovery case,... */ !((tilted == 0) && (restored > DEF_MAXRELAX))) { /* but not iterating infeasibility */ /* Create working copy of ingoing bounds if this is the first perturbation */ if(tilted == 0) perturbed = BB; perturbed = create_BB(lp, perturbed, TRUE); /* Perturb/shift variable bounds; also make sure we rebase and recompute (no refactorization is necessary, since the basis is unchanged) */ #if 1 perturb_bounds(lp, perturbed, TRUE, TRUE, TRUE); #else perturb_bounds(lp, perturbed, TRUE, TRUE, FALSE); #endif impose_bounds(lp, perturbed->upbo, perturbed->lowbo); set_action(&lp->spx_action, ACTION_REBASE | ACTION_RECOMPUTE); BB->UBzerobased = FALSE; status = RUNNING; tilted++; lp->perturb_count++; lp->spx_perturbed = TRUE; if(lp->spx_trace) report(lp, DETAILED, "solve_LP: Starting bound relaxation #%d ('%s')\n", tilted, get_statustext(lp, status)); } else { if(lp->spx_trace) report(lp, DETAILED, "solve_LP: Relaxation limit exceeded in resolving infeasibility\n"); while((perturbed != NULL) && (perturbed != BB)) free_BB(&perturbed); perturbed = NULL; } } } /* Handle the different simplex outcomes */ if(status != OPTIMAL) { if(lp->bb_level <= 1) lp->bb_parentOF = lp->infinite; if((status == USERABORT) || (status == TIMEOUT)) { /* Construct the last feasible solution, if available */ if((lp->solutioncount == 0) && /* 30/01/08 added MIP_count test because in following situation thing were wrong: - The model contains integers - A break at first is set - A timeout is set - The timeout occurs before a first integer solution is found - When the timeout occurs, the simplex algorithm is in phase 2 and has a feasible (but non-integer) solution, but not optimal yet. If above situation occurs then a (sub-optimal) solution was returned while no integer solution isn't found yet at this time */ (MIP_count(lp) == 0) && ((lp->simplex_mode & (SIMPLEX_Phase2_PRIMAL | SIMPLEX_Phase2_DUAL)) > 0)) { lp->solutioncount++; construct_solution(lp, NULL); transfer_solution(lp, TRUE); } /* Return messages */ report(lp, NORMAL, "\nlp_solve optimization was stopped %s.\n", ((status == USERABORT) ? "by the user" : "due to time-out")); } else if(BB->varno == 0) report(lp, NORMAL, "The model %s\n", (status == UNBOUNDED) ? "is UNBOUNDED" : ((status == INFEASIBLE) ? "is INFEASIBLE" : "FAILED")); else { #ifdef Paranoia if((status != FATHOMED) && (status != INFEASIBLE)) report(lp, SEVERE, "spx_solve: Invalid return code %d during B&B\n", status); #endif /* If we fathomed a node due to an inferior OF having been detected, return infeasible */ if(status == FATHOMED) lp->spx_status = INFEASIBLE; } } else { /* ... there is a good solution */ construct_solution(lp, NULL); if((lp->bb_level <= 1) && (restored > 0)) report(lp, DETAILED, "%s numerics encountered; validate accuracy\n", (restored == 1) ? "Difficult" : "Severe"); /* Handle case where a user bound on the OF was found to have been set too aggressively, giving an infeasible model */ if(lp->spx_status != OPTIMAL) status = lp->spx_status; else if((lp->bb_totalnodes == 0) && (MIP_count(lp) > 0)) { if(lp->lag_status != RUNNING) { report(lp, NORMAL, "\nRelaxed solution " RESULTVALUEMASK " after %10.0f iter is B&B base.\n", lp->solution[0], (double) lp->total_iter); report(lp, NORMAL, " \n"); } if((lp->usermessage != NULL) && (lp->msgmask & MSG_LPOPTIMAL)) { REAL *best_solution = lp->best_solution; /* transfer_solution(lp, TRUE); */ lp->best_solution = lp->solution; lp->usermessage(lp, lp->msghandle, MSG_LPOPTIMAL); lp->best_solution = best_solution; } set_var_priority(lp); } /* Check if we have a numeric problem (an earlier version of this code used the absolute difference, but it is not robust for large-valued OFs) */ testOF = my_chsign(is_maxim(lp), my_reldiff(lp->solution[0], lp->real_solution)); if(testOF < -lp->epsprimal) { report(lp, DETAILED, "solve_LP: A MIP subproblem returned a value better than the base.\n"); status = INFEASIBLE; lp->spx_status = status; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); } else if(testOF < 0) /* Avoid problems later (could undo integer roundings, but usually Ok) */ lp->solution[0] = lp->real_solution; } /* status can have the following values: OPTIMAL, SUBOPTIMAL, TIMEOUT, USERABORT, PROCFAIL, UNBOUNDED and INFEASIBLE. */ return( status ); } /* solve_LP */ STATIC BBrec *findself_BB(BBrec *BB) { int varno = BB->varno, vartype = BB->vartype; BB = BB->parent; while((BB != NULL) && (BB->vartype != vartype) && (BB->varno != varno)) BB = BB->parent; return( BB ); } /* Function to determine the opportunity for variable fixing and bound tightening based on a previous best MILP solution and a variable's reduced cost at the current relaxation - inspired by Wolsley */ STATIC int rcfbound_BB(BBrec *BB, int varno, MYBOOL isINT, REAL *newbound, MYBOOL *isfeasible) { int i = FR; lprec *lp = BB->lp; REAL deltaRC, rangeLU, deltaOF, lowbo, upbo; /* Make sure we only accept non-basic variables */ if(lp->is_basic[varno]) return( i ); /* Make sure we only accept non-fixed variables */ lowbo = BB->lowbo[varno]; upbo = BB->upbo[varno]; rangeLU = upbo - lowbo; if(rangeLU > lp->epsprimal) { #if 1 /* v5.5 problematic - Gap between current node and the current best bound */ deltaOF = lp->rhs[0] - lp->bb_workOF; #elif 0 /* v6 less aggressive - Gap between current best bound and the relaxed problem */ deltaOF = my_chsign(is_maxim(lp), lp->real_solution) - lp->bb_workOF; #else /* v6 more aggressive - Gap between current node and the relaxed problem */ deltaOF = my_chsign(is_maxim(lp), lp->real_solution) - lp->rhs[0]; #endif deltaRC = my_chsign(!lp->is_lower[varno], lp->drow[varno]); /* Protect against divisions with tiny numbers and stray sign reversals of the reduced cost */ if(deltaRC < lp->epspivot) return( i ); deltaRC = deltaOF / deltaRC; /* Should always be a positive number! */ #ifdef Paranoia if(deltaRC <= 0) report(lp, SEVERE, "rcfbound_BB: A negative bound fixing level was encountered after node %.0f\n", (double) lp->bb_totalnodes); #endif /* Check if bound implied by the reduced cost is less than existing range */ if(deltaRC < rangeLU + lp->epsint) { if(lp->is_lower[varno]) { if(isINT) deltaRC = scaled_floor(lp, varno, unscaled_value(lp, deltaRC, varno)+lp->epsprimal, 1); upbo = lowbo + deltaRC; deltaRC = upbo; i = LE; /* Sets the upper bound */ } else { if(isINT) deltaRC = scaled_ceil(lp, varno, unscaled_value(lp, deltaRC, varno)+lp->epsprimal, 1); lowbo = upbo - deltaRC; deltaRC = lowbo; i = GE; /* Sets the lower bound */ } /* Check and set feasibility status */ if((isfeasible != NULL) && (upbo - lowbo < -lp->epsprimal)) *isfeasible = FALSE; /* Flag that we can fix the variable by returning the relation code negated */ else if(fabs(upbo - lowbo) < lp->epsprimal) i = -i; if(newbound != NULL) { my_roundzero(deltaRC, lp->epsprimal); *newbound = deltaRC; } } } return( i ); } STATIC MYBOOL findnode_BB(BBrec *BB, int *varno, int *vartype, int *varcus) { int countsossc, countnint, k, reasonmsg = MSG_NONE; REAL varsol; MYBOOL is_better = FALSE, is_equal = FALSE, is_feasible = TRUE; lprec *lp = BB->lp; /* Initialize result and return variables */ *varno = 0; *vartype = BB_REAL; *varcus = 0; countnint = 0; BB->nodestatus = lp->spx_status; BB->noderesult = lp->solution[0]; /* If this solution is worse than the best so far, this branch dies. If we can only have integer OF values, and we only need the first solution then the OF must be at least (unscaled) 1 better than the best so far */ if((lp->bb_limitlevel != 1) && (MIP_count(lp) > 0)) { /* Check that we don't have a limit on the recursion level; two versions supported: 1) Absolute B&B level (bb_limitlevel > 0), and 2) B&B level relative to the "B&B order" (bb_limitlevel < 0). */ countsossc = lp->sos_vars + lp->sc_vars; if((lp->bb_limitlevel > 0) && (lp->bb_level > lp->bb_limitlevel+countsossc)) return( FALSE ); else if((lp->bb_limitlevel < 0) && (lp->bb_level > 2*(lp->int_vars+countsossc)*abs(lp->bb_limitlevel))) { if(lp->bb_limitlevel == DEF_BB_LIMITLEVEL) report(lp, IMPORTANT, "findnode_BB: Default B&B limit reached at %d; optionally change strategy or limit.\n\n", lp->bb_level); return( FALSE ); } /* First initialize or update pseudo-costs from previous optimal solution */ if(BB->varno == 0) { varsol = lp->infinite; if((lp->int_vars+lp->sc_vars > 0) && (lp->bb_PseudoCost == NULL)) lp->bb_PseudoCost = init_pseudocost(lp, get_bb_rule(lp)); } else { varsol = lp->solution[BB->varno]; if( ((lp->int_vars > 0) && (BB->vartype == BB_INT)) || ((lp->sc_vars > 0) && (BB->vartype == BB_SC) && !is_int(lp, BB->varno-lp->rows)) ) update_pseudocost(lp->bb_PseudoCost, BB->varno-lp->rows, BB->vartype, BB->isfloor, varsol); } /* Make sure we don't have numeric problems (typically due to integer scaling) */ if((lp->bb_totalnodes > 0) && !bb_better(lp, OF_RELAXED, OF_TEST_WE)) { if(lp->bb_trace) report(lp, IMPORTANT, "findnode_BB: Simplex failure due to loss of numeric accuracy\n"); lp->spx_status = NUMFAILURE; return( FALSE ); } /* Abandon this branch if the solution is "worse" than a heuristically determined limit or the previous best MIP solution */ if(((lp->solutioncount == 0) && !bb_better(lp, OF_HEURISTIC, OF_TEST_BE)) || ((lp->solutioncount > 0) && (!bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BE | OF_TEST_RELGAP) || !bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BE)))) { return( FALSE ); } /* Collect violated SC variables (since they can also be real-valued); the approach is to get them out of the way, since a 0-value is assumed to be "cheap" */ if(lp->sc_vars > 0) { *varno = find_sc_bbvar(lp, &countnint); if(*varno > 0) *vartype = BB_SC; } /* Look among SOS variables if no SC candidate was found */ if((SOS_count(lp) > 0) && (*varno == 0)) { *varno = find_sos_bbvar(lp, &countnint, FALSE); if(*varno < 0) *varno = 0; else if(*varno > 0) *vartype = BB_SOS; } /* Then collect INTS that are not integer valued, and verify bounds */ if((lp->int_vars > 0) && (*varno == 0)) { *varno = find_int_bbvar(lp, &countnint, BB, &is_feasible); if(*varno > 0) { *vartype = BB_INT; if((countnint == 1) && !is_feasible) { BB->lastrcf = 0; return( FALSE ); } } } #if 1 /* peno */ /* Check if we have reached the depth limit for any individual variable (protects against infinite recursions of mainly integer variables) */ k = *varno-lp->rows; if((*varno > 0) && (lp->bb_limitlevel != 0) && (lp->bb_varactive[k] >= abs(lp->bb_limitlevel) /* abs(DEF_BB_LIMITLEVEL) */)) { /* if(!is_action(lp->nomessage, NOMSG_BBLIMIT)) {*/ /* report(lp, IMPORTANT, "findnode_BB: Reached B&B depth limit %d for variable %d; will not dive further.\n\n", lp->bb_varactive[k], k); */ /* set_action(&lp->nomessage, NOMSG_BBLIMIT); */ /* } */ return( FALSE ); } #endif /* Check if the current MIP solution is optimal; equal or better */ if(*varno == 0) { is_better = (MYBOOL) (lp->solutioncount == 0) || bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BT); #if 1 is_better &= bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BT | OF_TEST_RELGAP); #else /* Check if we can determine clear improvement */ is_better = (MYBOOL) (lp->solutioncount == 0) || (MYBOOL) ((lp->bb_deltaOF > 0) && (my_chsign(is_maxim(lp), lp->solution[0]-lp->best_solution[0]) < 0)); /* Apply gap-based improvement testing if the current solution is not clearly better */ if(!is_better) { is_better = bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BT); is_better |= bb_better(lp, OF_INCUMBENT | OF_DELTA, OF_TEST_BT | OF_TEST_RELGAP); } #endif is_equal = !is_better; if(is_equal) { if((lp->solutionlimit <= 0) || (lp->solutioncount < lp->solutionlimit)) { lp->solutioncount++; SETMIN(lp->bb_solutionlevel, lp->bb_level); reasonmsg = MSG_MILPEQUAL; } } /* Current solution is better */ else if(is_better) { /* Update grand total solution count and check if we should go from depth-first to best-first variable selection mode */ if(lp->bb_varactive != NULL) { lp->bb_varactive[0]++; if((lp->bb_varactive[0] == 1) && is_bb_mode(lp, NODE_DEPTHFIRSTMODE) && is_bb_mode(lp, NODE_DYNAMICMODE)) lp->bb_rule &= !NODE_DEPTHFIRSTMODE; } if(lp->bb_trace || ((lp->verbose >= NORMAL) && (lp->print_sol == FALSE) && (lp->lag_status != RUNNING))) { report(lp, IMPORTANT, "%s solution " RESULTVALUEMASK " after %10.0f iter, %9.0f nodes (gap %.1f%%)\n", (lp->bb_improvements == 0) ? "Feasible" : "Improved", lp->solution[0], (double) lp->total_iter, (double) lp->bb_totalnodes, 100.0*fabs(my_reldiff(lp->solution[0], lp->bb_limitOF))); } if(MIP_count(lp) > 0) { if(lp->bb_improvements == 0) reasonmsg = MSG_MILPFEASIBLE; else reasonmsg = MSG_MILPBETTER; } lp->bb_status = FEASFOUND; lp->bb_solutionlevel = lp->bb_level; lp->solutioncount = 1; lp->bb_improvements++; lp->bb_workOF = lp->rhs[0]; if(lp->bb_breakfirst || (!is_infinite(lp, lp->bb_breakOF) && bb_better(lp, OF_USERBREAK, OF_TEST_BE))) lp->bb_break = TRUE; } } } else { is_better = TRUE; lp->solutioncount = 1; } /* Transfer the successful solution vector */ if(is_better || is_equal) { #ifdef ParanoiaMIP if((lp->bb_level > 0) && (check_solution(lp, lp->columns, lp->solution, lp->orig_upbo, lp->orig_lowbo, lp->epssolution) != OPTIMAL)) { lp->solutioncount = 0; lp->spx_status = NUMFAILURE; lp->bb_status = lp->spx_status; lp->bb_break = TRUE; return( FALSE ); } #endif transfer_solution(lp, (MYBOOL) ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE)); if((MIP_count(lp) > 0) && (lp->bb_totalnodes > 0)) { if ((!construct_duals(lp)) || (is_presolve(lp, PRESOLVE_SENSDUALS) && (!construct_sensitivity_duals(lp) || !construct_sensitivity_obj(lp)) ) ) { } } if((reasonmsg != MSG_NONE) && (lp->msgmask & reasonmsg) && (lp->usermessage != NULL)) lp->usermessage(lp, lp->msghandle, reasonmsg); if(lp->print_sol != FALSE) { print_objective(lp); print_solution(lp, 1); } } /* Do tracing and determine if we have arrived at the estimated lower MIP limit */ *varcus = countnint; if(MIP_count(lp) > 0) { if((countnint == 0) && (lp->solutioncount == 1) && (lp->solutionlimit == 1) && (bb_better(lp, OF_DUALLIMIT, OF_TEST_BE) || bb_better(lp, OF_USERBREAK, OF_TEST_BE | OF_TEST_RELGAP))) { lp->bb_break = (MYBOOL) (countnint == 0); return( FALSE ); } else if(lp->bb_level > 0) { #ifdef MIPboundWithOF if((lp->constraintOF > 0) && (countnint == 0)) set_rh(lp, lp->constraintOF, lp->solution[0] + my_chsign(!is_maxim(lp), lp->bb_deltaOF)); #endif if(lp->spx_trace) report(lp, DETAILED, "B&B level %5d OPT %16s value " RESULTVALUEMASK "\n", lp->bb_level, (*varno) ? " " : "INT", lp->solution[0]); } return( (MYBOOL) (*varno > 0)); } else return( FALSE ); } STATIC int solve_BB(BBrec *BB) { int K, status; lprec *lp = BB->lp; /* Protect against infinite recursions do to integer rounding effects */ status = PROCFAIL; /* Shortcut variables, set default bounds */ K = BB->varno; /* Load simple MIP bounds */ if(K > 0) { /* Update cuts, if specified */ updatecuts_BB(lp); /* BRANCH_FLOOR: Force the variable to be smaller than the B&B upper bound */ if(BB->isfloor) modifyUndoLadder(lp->bb_upperchange, K, BB->upbo, BB->UPbound); /* BRANCH_CEILING: Force the variable to be greater than the B&B lower bound */ else modifyUndoLadder(lp->bb_lowerchange, K, BB->lowbo, BB->LObound); /* Update MIP node count */ BB->nodessolved++; } /* Solve! */ status = solve_LP(lp, BB); /* Do special feasibility assessment of high order SOS'es */ #if 1 if((status == OPTIMAL) && (BB->vartype == BB_SOS) && !SOS_is_feasible(lp->SOS, 0, lp->solution)) status = INFEASIBLE; #endif return( status ); } /* Routine to compute a "strong" pseudo-cost update for a node */ STATIC MYBOOL strongbranch_BB(lprec *lp, BBrec *BB, int varno, int vartype, int varcus) { MYBOOL success = FALSE; int i; BBrec *strongBB; /* Create new B&B level and solve each of the branches */ lp->is_strongbranch = TRUE; push_basis(lp, lp->var_basic, lp->is_basic, lp->is_lower); strongBB = push_BB(lp, BB, lp->rows+varno, vartype, varcus); if(strongBB == BB) return( success ); do { /* Solve incremental problem to local optimality */ lp->bb_strongbranches++; /* set_action(&lp->spx_action, ACTION_REBASE | ACTION_RECOMPUTE); */ if(solve_BB(strongBB) == OPTIMAL) { /* Update result indicator*/ success |= 1 << strongBB->isfloor; /* Compute new count of non-ints */ strongBB->lastvarcus = 0; for(i = 1; i <= lp->columns; i++) { if(is_int(lp, i) && !solution_is_int(lp, lp->rows+i, FALSE)) strongBB->lastvarcus++; } /* Perform the pseudo-cost update */ update_pseudocost(lp->bb_PseudoCost, varno, strongBB->vartype, strongBB->isfloor, lp->solution[strongBB->varno]); } } while(nextbranch_BB(strongBB)); strongBB = pop_BB(strongBB); if(strongBB != BB) report(lp, SEVERE, "strongbranch_BB: Invalid bound settings restored for variable %d\n", varno); pop_basis(lp, TRUE); set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); lp->is_strongbranch = FALSE; return( success ); } /* Future functions */ STATIC MYBOOL pre_BB(lprec *lp) { return( TRUE ); } STATIC MYBOOL post_BB(lprec *lp) { return( TRUE ); } /* This is the non-recursive B&B driver routine - beautifully simple, yet so subtle! */ STATIC int run_BB(lprec *lp) { BBrec *currentBB; int varno, vartype, varcus, prevsolutions; int status = NOTRUN; /* Initialize */ pre_BB(lp); prevsolutions = lp->solutioncount; #ifdef UseMilpSlacksRCF /* Check if we should include ranged constraints */ varno = lp->sum; #else varno = lp->columns; #endif lp->bb_upperchange = createUndoLadder(lp, varno, 2*MIP_count(lp)); lp->bb_lowerchange = createUndoLadder(lp, varno, 2*MIP_count(lp)); lp->rootbounds = currentBB = push_BB(lp, NULL, 0, BB_REAL, 0); /* Perform the branch & bound loop */ while(lp->bb_level > 0) { status = solve_BB(currentBB); #if 0 if((lp->bb_level == 1) && (MIP_count(lp) > 0)) { if(status == RUNNING) ; /* Check if there was an integer solution of an aborted model */ else if((status == SUBOPTIMAL) && (lp->solutioncount == 1) && findnode_BB(currentBB, &varno, &vartype, &varcus)) status = USERABORT; } #endif if((status == OPTIMAL) && findnode_BB(currentBB, &varno, &vartype, &varcus)) currentBB = push_BB(lp, currentBB, varno, vartype, varcus); else while((lp->bb_level > 0) && !nextbranch_BB(currentBB)) currentBB = pop_BB(currentBB); } /* Finalize */ freeUndoLadder(&(lp->bb_upperchange)); freeUndoLadder(&(lp->bb_lowerchange)); /* Check if we should adjust status */ if(lp->solutioncount > prevsolutions) { if((status == PROCBREAK) || (status == USERABORT) || (status == TIMEOUT) || userabort(lp, -1)) status = SUBOPTIMAL; else status = OPTIMAL; if(lp->bb_totalnodes > 0) lp->spx_status = OPTIMAL; } post_BB(lp); return( status ); } lp_solve_5.5/lp_mipbb.h100666 0 0 4120 11141374246 13474 0ustar usergroup#ifndef HEADER_lp_mipbb #define HEADER_lp_mipbb #include "lp_types.h" #include "lp_utils.h" /* Bounds storage for B&B routines */ typedef struct _BBrec { struct _BBrec *parent; struct _BBrec *child; lprec *lp; int varno; int vartype; int lastvarcus; /* Count of non-int variables of the previous branch */ int lastrcf; int nodesleft; int nodessolved; int nodestatus; REAL noderesult; REAL lastsolution; /* Optimal solution of the previous branch */ REAL sc_bound; REAL *upbo, *lowbo; REAL UPbound, LObound; int UBtrack, LBtrack; /* Signals that incoming bounds were changed */ MYBOOL contentmode; /* Flag indicating if we "own" the bound vectors */ MYBOOL sc_canset; MYBOOL isSOS; MYBOOL isGUB; int *varmanaged; /* Extended list of variables managed by this B&B level */ MYBOOL isfloor; /* State variable indicating the active B&B bound */ MYBOOL UBzerobased; /* State variable indicating if bounds have been rebased */ } BBrec; #ifdef __cplusplus extern "C" { #endif STATIC BBrec *create_BB(lprec *lp, BBrec *parentBB, MYBOOL dofullcopy); STATIC BBrec *push_BB(lprec *lp, BBrec *parentBB, int varno, int vartype, int varcus); STATIC MYBOOL initbranches_BB(BBrec *BB); STATIC MYBOOL fillbranches_BB(BBrec *BB); STATIC MYBOOL nextbranch_BB(BBrec *BB); STATIC MYBOOL strongbranch_BB(lprec *lp, BBrec *BB, int varno, int vartype, int varcus); STATIC MYBOOL initcuts_BB(lprec *lp); STATIC int updatecuts_BB(lprec *lp); STATIC MYBOOL freecuts_BB(lprec *lp); STATIC BBrec *findself_BB(BBrec *BB); STATIC int solve_LP(lprec *lp, BBrec *BB); STATIC int rcfbound_BB(BBrec *BB, int varno, MYBOOL isINT, REAL *newbound, MYBOOL *isfeasible); STATIC MYBOOL findnode_BB(BBrec *BB, int *varno, int *vartype, int *varcus); STATIC int solve_BB(BBrec *BB); STATIC MYBOOL free_BB(BBrec **BB); STATIC BBrec *pop_BB(BBrec *BB); STATIC int run_BB(lprec *lp); #ifdef __cplusplus } #endif #endif /* HEADER_lp_mipbb */ lp_solve_5.5/lp_MPS.c100666 0 0 163770 11250514734 13115 0ustar usergroup #include #include #include #include "commonlib.h" #include "lp_lib.h" #include "lp_scale.h" #include "lp_report.h" #include "lp_MPS.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Define buffer-size controled function mapping */ # if defined _MSC_VER # define vsnprintf _vsnprintf # endif /* MPS file input and output routines for lp_solve */ /* ------------------------------------------------------------------------- */ /* A: MPS format was named after an early IBM LP product and has emerged as a de facto standard ASCII medium among most of the commercial LP codes. Essentially all commercial LP codes accept this format, but if you are using public domain software and have MPS files, you may need to write your own reader routine for this. It's not too hard. The main things to know about MPS format are that it is column oriented (as opposed to entering the model as equations), and everything (variables, rows, etc.) gets a name. MPS format is described in more detail in Murtagh's book, referenced in another section. Also, ftp://softlib.cs.rice.edu/pub/miplib/mps_format is a nice short introduction. exports MPS is an old format, so it is set up as though you were using punch cards, and is not free format. Fields start in column 1, 5, 15, 25, 40 and 50. Sections of an MPS file are marked by so-called header cards, which are distinguished by their starting in column 1. Although it is typical to use upper-case throughout the file (like I said, MPS has long historical roots), many MPS-readers will accept mixed-case for anything except the header cards, and some allow mixed-case anywhere. The names that you choose for the individual entities (constraints or variables) are not important to the solver; you should pick names that are meaningful to you, or will be easy for a post-processing code to read. Here is a little sample model written in MPS format (explained in more detail below): NAME TESTPROB ROWS N COST L LIM1 G LIM2 E MYEQN COLUMNS XONE COST 1 LIM1 1 XONE LIM2 1 YTWO COST 4 LIM1 1 YTWO MYEQN -1 ZTHREE COST 9 LIM2 1 ZTHREE MYEQN 1 RHS RHS1 LIM1 5 LIM2 10 RHS1 MYEQN 7 BOUNDS UP BND1 XONE 4 LO BND1 YTWO -1 UP BND1 YTWO 1 ENDATA means: Optimize COST: XONE + 4 YTWO + 9 ZTHREE Subject To LIM1: XONE + YTWO <= 5 LIM2: XONE + ZTHREE >= 10 MYEQN: - YTWO + ZTHREE = 7 Bounds 0 <= XONE <= 4 -1 <= YTWO <= 1 End */ /* copy a MPS name, only trailing spaces are removed. In MPS, names can have embedded spaces! */ STATIC void namecpy(char *into, char *from) { int i; /* copy at most 8 characters of from, stop at end of string or newline */ for(i = 0; (from[i] != '\0') && (from[i] != '\n') && (from[i] != '\r') && (i < 8); i++) into[i] = from[i]; /* end with end of string */ into[i] = '\0'; /* remove trailing spaces, if any */ for(i--; (i >= 0) && (into[i] == ' '); i--) into[i] = '\0'; } /* scan an MPS line, and pick up the information in the fields that are present */ /* scan_line for fixed MPS format */ STATIC int scan_lineFIXED(lprec *lp, int section, char* line, char *field1, char *field2, char *field3, double *field4, char *field5, double *field6) { int items = 0, line_len; char buf[16], *ptr1, *ptr2; line_len = (int) strlen(line); while ((line_len) && ((line[line_len-1] == '\n') || (line[line_len-1] == '\r') || (line[line_len-1] == ' '))) line_len--; if(line_len >= 1) { /* spaces or N/L/G/E or UP/LO */ strncpy(buf, line, 4); buf[4] = '\0'; sscanf(buf, "%s", field1); items++; } else field1[0] = '\0'; line += 4; if(line_len >= 5) { /* name */ if (line[-1] != ' ') { report(lp, IMPORTANT, "MPS_readfile: invalid data card; column 4 must be blank\n"); return(-1); } namecpy(field2, line); items++; } else field2[0] = '\0'; line += 10; if(line_len >= 14) { /* name */ if (line[-1] != ' ' || line[-2] != ' ') { report(lp, IMPORTANT, "MPS_readfile: invalid data card; columns 13-14 must be blank\n"); return(-1); } namecpy(field3, line); items++; } else field3[0] = '\0'; line += 10; if(line_len >= 25) { /* number */ if (line[-1] != ' ' || line[-2] != ' ') { report(lp, IMPORTANT, "MPS_readfile: invalid data card; columns 23-24 must be blank\n"); return(-1); } strncpy(buf, line, 15); buf[15] = '\0'; for(ptr1 = ptr2 = buf; ; ptr1++) if(!isspace((unsigned char) *ptr1)) if((*(ptr2++) = *ptr1) == 0) break; /* *field4 = atof(buf); */ *field4 = strtod(buf, &ptr1); if(*ptr1) { report(lp, IMPORTANT, "MPS_readfile: invalid number in columns 25-36 \n"); return(-1); } items++; } else *field4 = 0; line += 15; if(line_len >= 40) { /* name */ if (line[-1] != ' ' || line[-2] != ' ' || line[-3] != ' ') { report(lp, IMPORTANT, "MPS_readfile: invalid data card; columns 37-39 must be blank\n"); return(-1); } namecpy(field5, line); items++; } else field5[0] = '\0'; line += 10; if(line_len >= 50) { /* number */ if (line[-1] != ' ' || line[-2] != ' ') { report(lp, IMPORTANT, "MPS_readfile: invalid data card; columns 48-49 must be blank\n"); return(-1); } strncpy(buf, line, 15); buf[15] = '\0'; for(ptr1 = ptr2 = buf; ; ptr1++) if(!isspace((unsigned char) *ptr1)) if((*(ptr2++) = *ptr1) == 0) break; /* *field6 = atof(buf); */ *field6 = strtod(buf, &ptr1); if(*ptr1) { report(lp, IMPORTANT, "MPS_readfile: invalid number in columns 50-61 \n"); return(-1); } items++; } else *field6 = 0; return(items); } STATIC int spaces(char *line, int line_len) { int l; char *line1 = line; while (*line1 == ' ') line1++; l = (int) (line1 - line); if (line_len < l) l = line_len; return(l); } STATIC int lenfield(char *line, int line_len) { int l; char *line1 = line; while ((*line1) && (*line1 != ' ')) line1++; l = (int) (line1 - line); if (line_len < l) l = line_len; return(l); } /* scan_line for fixed MPS format */ STATIC int scan_lineFREE(lprec *lp, int section, char* line, char *field1, char *field2, char *field3, double *field4, char *field5, double *field6) { int items = 0, line_len, len; char buf[256], *ptr1, *ptr2; line_len = (int) strlen(line); while ((line_len) && ((line[line_len-1] == '\n') || (line[line_len-1] == '\r') || (line[line_len-1] == ' '))) line_len--; len = spaces(line, line_len); line += len; line_len -= len; if ((section == MPSCOLUMNS) || (section == MPSRHS) || (section == MPSRANGES)) { field1[0] = '\0'; items++; } else { len = lenfield(line, line_len); if(line_len >= 1) { /* spaces or N/L/G/E or UP/LO */ strncpy(buf, line, len); buf[len] = '\0'; sscanf(buf, "%s", field1); if(section == MPSBOUNDS) { for(ptr1 = field1; *ptr1; ptr1++) *ptr1=(char)toupper(*ptr1); } items++; } else field1[0] = '\0'; line += len; line_len -= len; len = spaces(line, line_len); line += len; line_len -= len; } len = lenfield(line, line_len); if(line_len >= 1) { /* name */ strncpy(field2, line, len); field2[len] = '\0'; items++; } else field2[0] = '\0'; line += len; line_len -= len; len = spaces(line, line_len); line += len; line_len -= len; len = lenfield(line, line_len); if(line_len >= 1) { /* name */ strncpy(field3, line, len); field3[len] = '\0'; items++; } else field3[0] = '\0'; line += len; line_len -= len; len = spaces(line, line_len); line += len; line_len -= len; if (*field3) { if((section == MPSCOLUMNS) && (strcmp(field3, "'MARKER'") == 0)) { *field4 = 0; items++; ptr1 = field3; } else if((section == MPSBOUNDS) && ((strcmp(field1, "FR") == 0) || (strcmp(field1, "MI") == 0) || (strcmp(field1, "PL") == 0) || (strcmp(field1, "BV") == 0))) /* field3 *is* the variable name */; else { /* Some free MPS formats allow that field 2 is not provided after the first time. The fieldname is then the same as the the defined field the line before. In that case field2 shifts to field3, field1 shifts to field 2. This situation is tested by checking if field3 is numerical AND there are an even number of fields after. */ char *line1 = line; int line_len1 = line_len; int items1 = 0; while (line_len1 > 0) { len = lenfield(line1, line_len1); if (len > 0) { line1 += len; line_len1 -= len; items1++; } len = spaces(line1, line_len1); line1 += len; line_len1 -= len; } if ((items1 % 2) == 0) { *field4 = strtod(field3, &ptr1); if(*ptr1 == 0) { strcpy(field3, field2); if ((section == MPSROWS) || (section == MPSBOUNDS) /* || (section == MPSSOS) */) *field2 = 0; else { strcpy(field2, field1); *field1 = 0; } items++; } else ptr1 = NULL; } else ptr1 = NULL; } } else { ptr1 = NULL; if((section == MPSBOUNDS) && ((strcmp(field1, "FR") == 0) || (strcmp(field1, "MI") == 0) || (strcmp(field1, "PL") == 0) || (strcmp(field1, "BV") == 0))) { strcpy(field3, field2); *field2 = 0; items++; } } if(ptr1 == NULL) { len = lenfield(line, line_len); if(line_len >= 1) { /* number */ strncpy(buf, line, len); buf[len] = '\0'; for(ptr1 = ptr2 = buf; ; ptr1++) if(!isspace((unsigned char) *ptr1)) if((*(ptr2++) = *ptr1) == 0) break; /* *field4 = atof(buf); */ *field4 = strtod(buf, &ptr1); if(*ptr1) return(-1); items++; } else *field4 = 0; line += len; line_len -= len; len = spaces(line, line_len); line += len; line_len -= len; } len = lenfield(line, line_len); if(line_len >= 1) { /* name */ strncpy(field5, line, len); field5[len] = '\0'; items++; } else field5[0] = '\0'; line += len; line_len -= len; len = spaces(line, line_len); line += len; line_len -= len; len = lenfield(line, line_len); if(line_len >= 1) { /* number */ strncpy(buf, line, len); buf[len] = '\0'; for(ptr1 = ptr2 = buf; ; ptr1++) if(!isspace((unsigned char) *ptr1)) if((*(ptr2++) = *ptr1) == 0) break; /* *field6 = atof(buf); */ *field6 = strtod(buf, &ptr1); if(*ptr1) return(-1); items++; } else *field6 = 0; if((section == MPSSOS) && (items == 2)) { strcpy(field3, field2); strcpy(field2, field1); *field1 = 0; } if((section != MPSOBJNAME) && (section != MPSBOUNDS)) { for(ptr1 = field1; *ptr1; ptr1++) *ptr1=(char)toupper(*ptr1); } return(items); } STATIC int addmpscolumn(lprec *lp, MYBOOL Int_section, int typeMPS, MYBOOL *Column_ready, int *count, REAL *Last_column, int *Last_columnno, char *Last_col_name) { int ok = TRUE; if (*Column_ready) { ok = add_columnex(lp, *count, Last_column, Last_columnno); if (ok) { ok = set_col_name(lp, lp->columns, Last_col_name); } if (ok) { set_int(lp, lp->columns, Int_section); if ((Int_section) && (typeMPS & MPSIBM)) set_bounds(lp, lp->columns, 10.0 / DEF_INFINITE, DEF_INFINITE / 10.0); } } *Column_ready = FALSE; *count = 0; return(ok); } #if 0 STATIC MYBOOL appendmpsitem(int *count, int rowIndex[], REAL rowValue[]) { int i = *count; if(rowValue[i] == 0) return( FALSE ); while((i > 0) && (rowIndex[i] < rowIndex[i-1])) { swapINT (rowIndex+i, rowIndex+i-1); swapREAL(rowValue+i, rowValue+i-1); i--; } (*count)++; return( TRUE ); } #endif STATIC MYBOOL appendmpsitem(int *count, int rowIndex[], REAL rowValue[]) { int i = *count; /* Check for non-negativity of the index */ if(rowIndex[i] < 0) return( FALSE ); /* Move the element so that the index list is sorted ascending */ while((i > 0) && (rowIndex[i] < rowIndex[i-1])) { swapINT (rowIndex+i, rowIndex+i-1); swapREAL(rowValue+i, rowValue+i-1); i--; } /* Add same-indexed items (which is rarely encountered), and shorten the list */ if((i < *count) && (rowIndex[i] == rowIndex[i+1])) { int ii = i + 1; rowValue[i] += rowValue[ii]; (*count)--; while(ii < *count) { rowIndex[ii] = rowIndex[ii+1]; rowValue[ii] = rowValue[ii+1]; ii++; } } /* Update the count and return */ (*count)++; return( TRUE ); } MYBOOL MPS_readfile(lprec **newlp, char *filename, int typeMPS, int verbose) { MYBOOL status = FALSE; FILE *fpin; fpin = fopen(filename, "r"); if(fpin != NULL) { status = MPS_readhandle(newlp, fpin, typeMPS, verbose); fclose(fpin); } return( status ); } static int __WINAPI MPS_input(void *fpin, char *buf, int max_size) { return(fgets(buf, max_size, (FILE *) fpin) != NULL); } MYBOOL __WINAPI MPS_readhandle(lprec **newlp, FILE *filehandle, int typeMPS, int verbose) { return(MPS_readex(newlp, (void *) filehandle, MPS_input, typeMPS, verbose)); } MYBOOL __WINAPI MPS_readex(lprec **newlp, void *userhandle, read_modeldata_func read_modeldata, int typeMPS, int verbose) { char field1[BUFSIZ], field2[BUFSIZ], field3[BUFSIZ], field5[BUFSIZ], line[BUFSIZ], tmp[BUFSIZ], Last_col_name[BUFSIZ], probname[BUFSIZ], OBJNAME[BUFSIZ], *ptr; int items, row, Lineno, var, section = MPSUNDEF, variant = 0, NZ = 0, SOS = 0; MYBOOL Int_section, Column_ready, Column_ready1, Unconstrained_rows_found = FALSE, OF_found = FALSE, CompleteStatus = FALSE; double field4, field6; REAL *Last_column = NULL; int count = 0, *Last_columnno = NULL; int OBJSENSE = ROWTYPE_EMPTY; lprec *lp; int (*scan_line)(lprec *lp, int section, char* line, char *field1, char *field2, char *field3, double *field4, char *field5, double *field6); if(newlp == NULL) return( CompleteStatus ); else if(*newlp == NULL) lp = make_lp(0, 0); else lp = *newlp; if((typeMPS & MPSFIXED) == MPSFIXED) scan_line = scan_lineFIXED; else if((typeMPS & MPSFREE) == MPSFREE) scan_line = scan_lineFREE; else { report(lp, IMPORTANT, "MPS_readfile: Unrecognized MPS line type.\n"); if (*newlp == NULL) delete_lp(lp); return( CompleteStatus ); } if (lp != NULL) { lp->source_is_file = TRUE; lp->verbose = verbose; strcpy(Last_col_name, ""); strcpy(OBJNAME, ""); Int_section = FALSE; Column_ready = FALSE; Lineno = 0; /* let's initialize line to all zero's */ MEMCLEAR(line, BUFSIZ); while(read_modeldata(userhandle, line, BUFSIZ - 1)) { Lineno++; for(ptr = line; (*ptr) && (isspace((unsigned char) *ptr)); ptr++); /* skip lines which start with "*", they are comment */ if((line[0] == '*') || (*ptr == 0) || (*ptr == '\n') || (*ptr == '\r')) { report(lp, FULL, "Comment on line %d: %s", Lineno, line); continue; } report(lp, FULL, "Line %6d: %s", Lineno, line); /* first check for "special" lines: NAME, ROWS, BOUNDS .... */ /* this must start in the first position of line */ if(line[0] != ' ') { sscanf(line, "%s", tmp); if(strcmp(tmp, "NAME") == 0) { section = MPSNAME; *probname = 0; sscanf(line, "NAME %s", probname); if (!set_lp_name(lp, probname)) break; } else if(((typeMPS & MPSFREE) == MPSFREE) && (strcmp(tmp, "OBJSENSE") == 0)) { section = MPSOBJSENSE; report(lp, FULL, "Switching to OBJSENSE section\n"); } else if(((typeMPS & MPSFREE) == MPSFREE) && (strcmp(tmp, "OBJNAME") == 0)) { section = MPSOBJNAME; report(lp, FULL, "Switching to OBJNAME section\n"); } else if(strcmp(tmp, "ROWS") == 0) { section = MPSROWS; report(lp, FULL, "Switching to ROWS section\n"); } else if(strcmp(tmp, "COLUMNS") == 0) { allocREAL(lp, &Last_column, lp->rows + 1, TRUE); allocINT(lp, &Last_columnno, lp->rows + 1, TRUE); count = 0; if ((Last_column == NULL) || (Last_columnno == NULL)) break; section = MPSCOLUMNS; report(lp, FULL, "Switching to COLUMNS section\n"); } else if(strcmp(tmp, "RHS") == 0) { if (!addmpscolumn(lp, Int_section, typeMPS, &Column_ready, &count, Last_column, Last_columnno, Last_col_name)) break; section = MPSRHS; report(lp, FULL, "Switching to RHS section\n"); } else if(strcmp(tmp, "BOUNDS") == 0) { section = MPSBOUNDS; report(lp, FULL, "Switching to BOUNDS section\n"); } else if(strcmp(tmp, "RANGES") == 0) { section = MPSRANGES; report(lp, FULL, "Switching to RANGES section\n"); } else if((strcmp(tmp, "SOS") == 0) || (strcmp(tmp, "SETS") == 0)) { section = MPSSOS; if(strcmp(tmp, "SOS") == 0) variant = 0; else variant = 1; report(lp, FULL, "Switching to %s section\n", tmp); } else if(strcmp(tmp, "ENDATA") == 0) { report(lp, FULL, "Finished reading MPS file\n"); CompleteStatus = TRUE; break; } else { /* line does not start with space and does not match above */ report(lp, IMPORTANT, "Unrecognized MPS line %d: %s\n", Lineno, line); break; } } else { /* normal line, process */ items = scan_line(lp, section, line, field1, field2, field3, &field4, field5, &field6); if(items < 0){ report(lp, IMPORTANT, "Syntax error on line %d: %s\n", Lineno, line); break; } switch(section) { case MPSNAME: report(lp, IMPORTANT, "Error, extra line under NAME line\n"); break; case MPSOBJSENSE: if(OBJSENSE != ROWTYPE_EMPTY) { report(lp, IMPORTANT, "Error, extra line under OBJSENSE line\n"); break; } if((strcmp(field1, "MAXIMIZE") == 0) || (strcmp(field1, "MAX") == 0)) { OBJSENSE = ROWTYPE_OFMAX; set_maxim(lp); } else if((strcmp(field1, "MINIMIZE") == 0) || (strcmp(field1, "MIN") == 0)) { OBJSENSE = ROWTYPE_OFMIN; set_minim(lp); } else { report(lp, SEVERE, "Unknown OBJSENSE direction '%s' on line %d\n", field1, Lineno); break; } continue; case MPSOBJNAME: if(*OBJNAME) { report(lp, IMPORTANT, "Error, extra line under OBJNAME line\n"); break; } strcpy(OBJNAME, field1); continue; /* Process entries in the ROWS section */ case MPSROWS: /* field1: rel. operator; field2: name of constraint */ report(lp, FULL, "Row %5d: %s %s\n", lp->rows + 1, field1, field2); if(strcmp(field1, "N") == 0) { if((*OBJNAME) && (strcmp(field2, OBJNAME))) /* Ignore this objective name since it is not equal to the OBJNAME name */; else if(!OF_found) { /* take the first N row as OF, ignore others */ if (!set_row_name(lp, 0, field2)) break; OF_found = TRUE; } else if(!Unconstrained_rows_found) { report(lp, IMPORTANT, "Unconstrained row %s ignored\n", field2); report(lp, IMPORTANT, "Further messages of this kind will be suppressed\n"); Unconstrained_rows_found = TRUE; } } else if(strcmp(field1, "L") == 0) { if ((!str_add_constraint(lp, "" ,LE ,0)) || (!set_row_name(lp, lp->rows, field2))) break; } else if(strcmp(field1, "G") == 0) { if ((!str_add_constraint(lp, "" ,GE ,0)) || (!set_row_name(lp, lp->rows, field2))) break; } else if(strcmp(field1, "E") == 0) { if ((!str_add_constraint(lp, "",EQ ,0)) || (!set_row_name(lp, lp->rows, field2))) break; } else { report(lp, SEVERE, "Unknown relation code '%s' on line %d\n", field1, Lineno); break; } continue; /* Process entries in the COLUMNS section */ case MPSCOLUMNS: /* field2: variable; field3: constraint; field4: coef */ /* optional: field5: constraint; field6: coef */ report(lp, FULL, "Column %4d: %s %s %g %s %g\n", lp->columns + 1, field2, field3, field4, field5, field6); if((items == 4) || (items == 5) || (items == 6)) { if (NZ == 0) strcpy(Last_col_name, field2); else if(*field2) { Column_ready1 = (MYBOOL) (strcmp(field2, Last_col_name) != 0); if(Column_ready1) { if (find_var(lp, field2, FALSE) >= 0) { report(lp, SEVERE, "Variable name (%s) is already used!\n", field2); break; } if(Column_ready) { /* Added ability to handle non-standard "same as above" column name */ if (addmpscolumn(lp, Int_section, typeMPS, &Column_ready, &count, Last_column, Last_columnno, Last_col_name)) { strcpy(Last_col_name, field2); NZ = 0; } else break; } } } if(items == 5) { /* there might be an INTEND or INTORG marker */ /* look for " 'MARKER' 'INTORG'" or " 'MARKER' 'INTEND'" */ if(strcmp(field3, "'MARKER'") != 0) break; if(strcmp(field5, "'INTORG'") == 0) { Int_section = TRUE; report(lp, FULL, "Switching to integer section\n"); } else if(strcmp(field5, "'INTEND'") == 0) { Int_section = FALSE; report(lp, FULL, "Switching to non-integer section\n"); } else report(lp, IMPORTANT, "Unknown marker (ignored) at line %d: %s\n", Lineno, field5); } else if((row = find_row(lp, field3, Unconstrained_rows_found)) >= 0) { if(row > lp->rows) report(lp, CRITICAL, "Invalid row %s encountered in the MPS file\n", field3); Last_columnno[count] = row; Last_column[count] = (REAL)field4; if(appendmpsitem(&count, Last_columnno, Last_column)) { NZ++; Column_ready = TRUE; } } } if(items == 6) { if((row = find_row(lp, field5, Unconstrained_rows_found)) >= 0) { if(row > lp->rows) report(lp, CRITICAL, "Invalid row %s encountered in the MPS file\n", field5); Last_columnno[count] = row; Last_column[count] = (REAL)field6; if(appendmpsitem(&count, Last_columnno, Last_column)) { NZ++; Column_ready = TRUE; } } } if((items < 4) || (items > 6)) { /* Wrong! */ report(lp, CRITICAL, "Wrong number of items (%d) in COLUMNS section (line %d)\n", items, Lineno); break; } continue; /* Process entries in the RHS section */ /* field2: uninteresting name; field3: constraint name */ /* field4: value */ /* optional: field5: constraint name; field6: value */ case MPSRHS: report(lp, FULL, "RHS line: %s %s %g %s %g\n", field2, field3, field4, field5, field6); if((items != 4) && (items != 6)) { report(lp, CRITICAL, "Wrong number of items (%d) in RHS section line %d\n", items, Lineno); break; } if((row = find_row(lp, field3, Unconstrained_rows_found)) >= 0) { if ((row == 0) && ((typeMPS & MPSNEGOBJCONST) == MPSNEGOBJCONST)) field4 = -field4; set_rh(lp, row, (REAL)field4); } if(items == 6) { if((row = find_row(lp, field5, Unconstrained_rows_found)) >= 0) { if ((row == 0) && ((typeMPS & MPSNEGOBJCONST) == MPSNEGOBJCONST)) field6 = -field6; set_rh(lp, row, (REAL)field6); } } continue; /* Process entries in the BOUNDS section */ /* field1: bound type; field2: uninteresting name; */ /* field3: variable name; field4: value */ case MPSBOUNDS: report(lp, FULL, "BOUNDS line: %s %s %s %g\n", field1, field2, field3, field4); var = find_var(lp, field3, FALSE); if(var < 0){ /* bound on undefined var in COLUMNS section ... */ Column_ready = TRUE; if (!addmpscolumn(lp, FALSE, typeMPS, &Column_ready, &count, Last_column, Last_columnno, field3)) break; Column_ready = TRUE; var = find_var(lp, field3, TRUE); } if(var < 0) /* undefined var and could add ... */; else if(strcmp(field1, "UP") == 0) { /* upper bound */ /* if(!set_bounds(lp, var, get_lowbo(lp, var), field4)) */ if(!set_upbo(lp, var, field4)) break; } else if(strcmp(field1, "SC") == 0) { /* upper bound */ if(field4 == 0) field4 = lp->infinite; /* if(!set_bounds(lp, var, get_lowbo(lp, var), field4)) */ if(!set_upbo(lp, var, field4)) break; set_semicont(lp, var, TRUE); } else if(strcmp(field1, "SI") == 0) { /* upper bound */ if(field4 == 0) field4 = lp->infinite; /* if(!set_bounds(lp, var, get_lowbo(lp, var), field4)) */ if(!set_upbo(lp, var, field4)) break; set_int(lp, var, TRUE); set_semicont(lp, var, TRUE); } else if(strcmp(field1, "LO") == 0) { /* lower bound */ /* if(!set_bounds(lp, var, field4, get_upbo(lp, var))) */ if(!set_lowbo(lp, var, field4)) break; } else if(strcmp(field1, "PL") == 0) { /* plus-ranged variable */ /* if(!set_bounds(lp, var, get_lowbo(lp, var), lp->infinite)) */ if(!set_upbo(lp, var, lp->infinite)) break; } else if(strcmp(field1, "MI") == 0) { /* minus-ranged variable */ /* if(!set_bounds(lp, var, -lp->infinite, get_upbo(lp, var))) */ if(!set_lowbo(lp, var, -lp->infinite)) break; } else if(strcmp(field1, "FR") == 0) { /* free variable */ set_unbounded(lp, var); } else if(strcmp(field1, "FX") == 0) { /* fixed, upper _and_ lower */ if(!set_bounds(lp, var, field4, field4)) break; } else if(strcmp(field1, "BV") == 0) { /* binary variable */ set_binary(lp, var, TRUE); } /* AMPL bounds type UI and LI added by E.Imamura (CRIEPI) */ else if(strcmp(field1, "UI") == 0) { /* upper bound for integer variable */ /* if(!set_bounds(lp, var, get_lowbo(lp, var), field4)) */ if(!set_upbo(lp, var, field4)) break; set_int(lp, var, TRUE); } else if(strcmp(field1, "LI") == 0) { /* lower bound for integer variable - corrected by KE */ /* if(!set_bounds(lp, var, field4, get_upbo(lp, var))) */ if(!set_lowbo(lp, var, field4)) break; set_int(lp, var, TRUE); } else { report(lp, CRITICAL, "BOUND type %s on line %d is not supported", field1, Lineno); break; } continue; /* Process entries in the BOUNDS section */ /* We have to implement the following semantics: D. The RANGES section is for constraints of the form: h <= constraint <= u . The range of the constraint is r = u - h . The value of r is specified in the RANGES section, and the value of u or h is specified in the RHS section. If b is the value entered in the RHS section, and r is the value entered in the RANGES section, then u and h are thus defined: row type sign of r h u ---------------------------------------------- G + or - b b + |r| L + or - b - |r| b E + b b + |r| E - b - |r| b */ /* field2: uninteresting name; field3: constraint name */ /* field4: value */ /* optional: field5: constraint name; field6: value */ case MPSRANGES: report(lp, FULL, "RANGES line: %s %s %g %s %g", field2, field3, field4, field5, field6); if((items != 4) && (items != 6)) { report(lp, CRITICAL, "Wrong number of items (%d) in RANGES section line %d", items, Lineno); break; } if((row = find_row(lp, field3, Unconstrained_rows_found)) >= 0) { /* Determine constraint type */ if(fabs(field4) >= lp->infinite) { report(lp, IMPORTANT, "Warning, Range for row %s >= infinity (value %g) on line %d, ignored", field3, field4, Lineno); } else if(field4 == 0) { /* Change of a GE or LE to EQ */ if(lp->orig_upbo[row] != 0) set_constr_type(lp, row, EQ); } else if(is_chsign(lp, row)) { /* GE */ lp->orig_upbo[row] = fabs(field4); } else if((lp->orig_upbo[row] == 0) && (field4 >= 0)) { /* EQ with positive sign of r value */ set_constr_type(lp, row, GE); lp->orig_upbo[row] = field4; } else if(lp->orig_upbo[row] == lp->infinite) { /* LE */ lp->orig_upbo[row] = fabs(field4); } else if((lp->orig_upbo[row] == 0) && (field4 < 0)) { /* EQ with negative sign of r value */ set_constr_type(lp, row, LE); lp->orig_upbo[row] = my_flipsign(field4); } else { /* let's be paranoid */ report(lp, IMPORTANT, "Cannot figure out row type, row = %d, is_chsign = %d, upbo = %g on line %d", row, is_chsign(lp, row), (double)lp->orig_upbo[row], Lineno); } } if(items == 6) { if((row = find_row(lp, field5, Unconstrained_rows_found)) >= 0) { /* Determine constraint type */ if(fabs(field6) >= lp->infinite) { report(lp, IMPORTANT, "Warning, Range for row %s >= infinity (value %g) on line %d, ignored", field5, field6, Lineno); } else if(field6 == 0) { /* Change of a GE or LE to EQ */ if(lp->orig_upbo[row] != 0) set_constr_type(lp, row, EQ); } else if(is_chsign(lp, row)) { /* GE */ lp->orig_upbo[row] = fabs(field6); } else if(lp->orig_upbo[row] == 0 && field6 >= 0) { /* EQ with positive sign of r value */ set_constr_type(lp, row, GE); lp->orig_upbo[row] = field6; } else if(lp->orig_upbo[row] == lp->infinite) { /* LE */ lp->orig_upbo[row] = fabs(field6); } else if((lp->orig_upbo[row] == 0) && (field6 < 0)) { /* EQ with negative sign of r value */ set_constr_type(lp, row, LE); lp->orig_upbo[row] = my_flipsign(field6); } else { /* let's be paranoid */ report(lp, IMPORTANT, "Cannot figure out row type, row = %d, is_chsign = %d, upbo = %g on line %d", row, is_chsign(lp,row), (double) lp->orig_upbo[row], Lineno); } } } continue; /* Process entries in the SOS section */ /* We have to implement the following semantics: E. The SOS section is for ordered variable sets of the form: x1, x2, x3 ... xn where only a given number of consequtive variables may be non-zero. Each set definition is prefaced by type, name and priority data. Each set member has an optional weight that determines its order. There are two forms supported; a full format and a reduced CPLEX-like format. */ case MPSSOS: report(lp, FULL, "SOS line: %s %s %g %s %g", field2, field3, field4, field5, field6); if((items == 0) || (items > 4)) { report(lp, IMPORTANT, "Invalid number of items (%d) in SOS section line %d\n", items, Lineno); break; } if(strlen(field1) == 0) items--; /* fix scanline anomoly! */ /* Check if this is the start of a new SOS */ if(items == 1 || items == 4) { row = (int) (field1[1] - '0'); if((row <= 0) || (row > 9)) { report(lp, IMPORTANT, "Error: Invalid SOS type %s line %d\n", field1, Lineno); break; } field1[0] = '\0'; /* fix scanline anomoly! */ /* lp_solve needs a name for the SOS */ if(variant == 0) { if(strlen(field3) == 0) /* CPLEX format does not provide a SOS name; create one */ sprintf(field3, "SOS_%d", SOS_count(lp) + 1); } else { /* Remap XPRESS format name */ strcpy(field3, field1); } /* Obtain the SOS priority */ if(items == 4) SOS = (int) field4; else SOS = 1; /* Define a new SOS instance */ SOS = add_SOS(lp, field3, (int) row, SOS, 0, NULL, NULL); } /* Otherwise, add set members to the active SOS */ else { char *field = (items == 3) ? field3 /* Native lp_solve and XPRESS formats */ : field2 /* CPLEX format */; var = find_var(lp, field, FALSE); /* Native lp_solve and XPRESS formats */ if(var < 0){ /* SOS on undefined var in COLUMNS section ... */ Column_ready = TRUE; if (!addmpscolumn(lp, FALSE, typeMPS, &Column_ready, &count, Last_column, Last_columnno, field)) break; Column_ready = TRUE; var = find_var(lp, field, TRUE); } if((var < 0) || (SOS < 1)) /* undefined var and could add ... */; else append_SOSrec(lp->SOS->sos_list[SOS-1], 1, &var, &field4); } continue; } /* If we got here there was an error "upstream" */ report(lp, IMPORTANT, "Error: Cannot handle line %d\n", Lineno); break; } } if((*OBJNAME) && (!OF_found)) { report(lp, IMPORTANT, "Error: Objective function specified by OBJNAME card not found\n"); CompleteStatus = FALSE; } if(CompleteStatus == FALSE) { if (*newlp == NULL) delete_lp(lp); } else { if (typeMPS & MPSIBM) { REAL lower, upper; for (var = 1; var <= lp->columns; var++) if (is_int(lp, var)) { lower = get_lowbo(lp, var); upper = get_upbo(lp, var); if ((lower == 10.0 / DEF_INFINITE) && (upper == DEF_INFINITE / 10.0)) upper = 1.0; if (lower == 10.0 / DEF_INFINITE) lower = 0.0; if (upper == DEF_INFINITE / 10.0) upper = lp->infinite; set_bounds(lp, var, lower, upper); } } *newlp = lp; } if(Last_column != NULL) FREE(Last_column); if(Last_columnno != NULL) FREE(Last_columnno); } return( CompleteStatus ); } static void number(char *str,REAL value) { char __str[80], *_str; int i; /* sprintf(_str,"%12.6G",value); */ _str=__str+2; if (value>=0.0) if ((value!=0.0) && ((value>0.99999999e12) || (value<0.0001))) { int n=15; do { n--; i=sprintf(_str,"%*.*E",n,n-6,(double) value); if (i>12) { char *ptr=strchr(_str,'E'); if (ptr!=NULL) { if (*(++ptr)=='-') ptr++; while ((i>12) && ((*ptr=='+') || (*ptr=='0'))) { strcpy(ptr,ptr+1); i--; } } } } while (i>12); } else if (value>=1.0e10) { int n=13; do { i=sprintf(_str,"%*.0f",--n,(double) value); } while (i>12); } else { if (((i=sprintf(_str,"%12.10f",(double) value))>12) && (_str[12]>='5')) { for (i=11;i>=0;i--) if (_str[i]!='.') { if (++_str[i]>'9') _str[i]='0'; else break; } if (i<0) { *(--_str)='1'; *(--_str)=' '; } } } else if ((value<-0.99999999e11) || (value>-0.0001)) { int n=15; do { n--; i=sprintf(_str,"%*.*E",n,n-7,(double) value); if (i>12) { char *ptr=strchr(_str,'E'); if (ptr!=NULL) { if (*(++ptr)=='-') ptr++; while ((i>12) && ((*ptr=='+') || (*ptr=='0'))) { strcpy(ptr,ptr+1); i--; } } } } while (i>12); } else if (value<=-1.0e9) { int n=13; do { i=sprintf(_str,"%*.0f",--n,(double) value); } while (i>12); } else if (((i=sprintf(_str,"%12.9f",(double) value))>12) && (_str[12]>='5')) { for (i=11;i>=1;i--) if (_str[i]!='.') { if (++_str[i]>'9') _str[i]='0'; else break; } if (i<1) { *_str='1'; *(--_str)='-'; *(--_str)=' '; } } strncpy(str,_str,12); } static char *formatnumber12(char *numberbuffer, double a) { #if 0 return(sprintf(numberbuffer, "%12g", a)); #else number(numberbuffer, a); return(numberbuffer); #endif } STATIC char *MPSnameFIXED(char *name0, char *name) { sprintf(name0, "%-8.8s", name); return(name0); } STATIC char *MPSnameFREE(char *name0, char *name) { if(strlen(name) < 8) return(MPSnameFIXED(name0, name)); else return(name); } static void write_data(void *userhandle, write_modeldata_func write_modeldata, char *format, ...) { char buff[DEF_STRBUFSIZE+1]; va_list ap; va_start(ap, format); vsnprintf(buff, DEF_STRBUFSIZE, format, ap); va_end(ap); write_modeldata(userhandle, buff); } MYBOOL __WINAPI MPS_writefileex(lprec *lp, int typeMPS, void *userhandle, write_modeldata_func write_modeldata) { int i, j, jj, je, k, marker, putheader, ChangeSignObj = FALSE, *idx, *idx1; MYBOOL ok = TRUE, names_used; REAL a, *val, *val1; char * (*MPSname)(char *name0, char *name); char numberbuffer[15]; char name0[9]; if((typeMPS & MPSFIXED) == MPSFIXED) { MPSname = MPSnameFIXED; ChangeSignObj = is_maxim(lp); } else if((typeMPS & MPSFREE) == MPSFREE) { MPSname = MPSnameFREE; } else { report(lp, IMPORTANT, "MPS_writefile: unrecognized MPS name type.\n"); return(FALSE); } names_used = lp->names_used; if((typeMPS & MPSFIXED) == MPSFIXED) { /* Check if there is no variable name where the first 8 charachters are equal to the first 8 characters of anothe variable */ if(names_used) for(i = 1; (i <= lp->columns) && (ok); i++) if((lp->col_name[i] != NULL) && (lp->col_name[i]->name != NULL) && (!is_splitvar(lp, i)) && (strlen(lp->col_name[i]->name) > 8)) for(j = 1; (j < i) && (ok); j++) if((lp->col_name[j] != NULL) && (lp->col_name[j]->name != NULL) && (!is_splitvar(lp, j))) if(strncmp(lp->col_name[i]->name, lp->col_name[j]->name, 8) == 0) ok = FALSE; } if(!ok) { lp->names_used = FALSE; ok = TRUE; } memset(numberbuffer, 0, sizeof(numberbuffer)); marker = 0; /* First write metadata in structured comment form (lp_solve style) */ write_data(userhandle, write_modeldata, "*\n", (int) MAJORVERSION, (int) MINORVERSION); write_data(userhandle, write_modeldata, "*\n", lp->rows); write_data(userhandle, write_modeldata, "*\n", lp->columns); write_data(userhandle, write_modeldata, "*\n", lp->equalities); if(SOS_count(lp) > 0) write_data(userhandle, write_modeldata, "*\n", SOS_count(lp)); write_data(userhandle, write_modeldata, "*\n", lp->int_vars); if(lp->sc_vars > 0) write_data(userhandle, write_modeldata, "*\n", lp->sc_vars); write_data(userhandle, write_modeldata, "*\n", (is_maxim(lp) ? "MAX" : "MIN")); write_data(userhandle, write_modeldata, "*\n"); /* Write the MPS content */ write_data(userhandle, write_modeldata, "NAME %s\n", MPSname(name0, get_lp_name(lp))); if(((typeMPS & MPSFREE) == MPSFREE) && (is_maxim(lp))) write_data(userhandle, write_modeldata, "OBJSENSE\n MAX\n"); write_data(userhandle, write_modeldata, "ROWS\n"); for(i = 0; i <= lp->rows; i++) { if(i == 0) write_data(userhandle, write_modeldata, " N "); else if(lp->orig_upbo[i] != 0) { if(is_chsign(lp,i)) write_data(userhandle, write_modeldata, " G "); else write_data(userhandle, write_modeldata, " L "); } else write_data(userhandle, write_modeldata, " E "); write_data(userhandle, write_modeldata, "%s\n", MPSname(name0, get_row_name(lp, i))); } allocREAL(lp, &val, 1 + lp->rows, TRUE); allocINT(lp, &idx, 1 + lp->rows, TRUE); write_data(userhandle, write_modeldata, "COLUMNS\n"); for(i = 1; i <= lp->columns; i++) { if(!is_splitvar(lp, i)) { if(is_int(lp,i) && (marker % 2) == 0) { write_data(userhandle, write_modeldata, " MARK%04d 'MARKER' 'INTORG'\n", marker); marker++; } if(!is_int(lp,i) && (marker % 2) == 1) { write_data(userhandle, write_modeldata, " MARK%04d 'MARKER' 'INTEND'\n", marker); marker++; } /* Loop over non-zero column entries */ je = get_columnex(lp, i, val, idx); for(k = 1, val1 = val, idx1 = idx, jj = 0; jj < je; jj++) { k = 1 - k; j = *(idx1++); a = *(val1++); if (k == 0) { write_data(userhandle, write_modeldata, " %s", MPSname(name0, get_col_name(lp, i))); write_data(userhandle, write_modeldata, " %s %s", MPSname(name0, get_row_name(lp, j)), /* formatnumber12(numberbuffer, (double) a)); */ formatnumber12(numberbuffer, (double) (a * (j == 0 && ChangeSignObj ? -1 : 1)))); } else write_data(userhandle, write_modeldata, " %s %s\n", MPSname(name0, get_row_name(lp, j)), formatnumber12(numberbuffer, (double) (a * (j == 0 && ChangeSignObj ? -1 : 1)))); /* formatnumber12(numberbuffer, (double) a)); */ } if(k == 0) write_data(userhandle, write_modeldata, "\n"); } } if((marker % 2) == 1) { write_data(userhandle, write_modeldata, " MARK%04d 'MARKER' 'INTEND'\n", marker); /* marker++; */ /* marker not used after this */ } FREE(idx); FREE(val); write_data(userhandle, write_modeldata, "RHS\n"); for(k = 1, i = 0; i <= lp->rows; i++) { a = lp->orig_rhs[i]; if(a) { a = unscaled_value(lp, a, i); if ((i == 0) && ((typeMPS & MPSNEGOBJCONST) == MPSNEGOBJCONST)) a = -a; if((i == 0) || is_chsign(lp, i)) a = my_flipsign(a); k = 1 - k; if(k == 0) write_data(userhandle, write_modeldata, " RHS %s %s", MPSname(name0, get_row_name(lp, i)), formatnumber12(numberbuffer, (double)a)); else write_data(userhandle, write_modeldata, " %s %s\n", MPSname(name0, get_row_name(lp, i)), formatnumber12(numberbuffer, (double)a)); } } if(k == 0) write_data(userhandle, write_modeldata, "\n"); putheader = TRUE; for(k = 1, i = 1; i <= lp->rows; i++){ a = 0; if((lp->orig_upbo[i] < lp->infinite) && (lp->orig_upbo[i] != 0.0)) a = lp->orig_upbo[i]; if(a) { if(putheader) { write_data(userhandle, write_modeldata, "RANGES\n"); putheader = FALSE; } a = unscaled_value(lp, a, i); k = 1 - k; if(k == 0) write_data(userhandle, write_modeldata, " RGS %s %s", MPSname(name0, get_row_name(lp, i)), formatnumber12(numberbuffer, (double)a)); else write_data(userhandle, write_modeldata, " %s %s\n", MPSname(name0, get_row_name(lp, i)), formatnumber12(numberbuffer, (double)a)); } } if(k == 0) write_data(userhandle, write_modeldata, "\n"); putheader = TRUE; for(i = lp->rows + 1; i <= lp->sum; i++) if(!is_splitvar(lp, i - lp->rows)) { j = i - lp->rows; if((lp->orig_lowbo[i] != 0) && (lp->orig_upbo[i] < lp->infinite) && (lp->orig_lowbo[i] == lp->orig_upbo[i])) { a = lp->orig_upbo[i]; a = unscaled_value(lp, a, i); if(putheader) { write_data(userhandle, write_modeldata, "BOUNDS\n"); putheader = FALSE; } write_data(userhandle, write_modeldata, " FX BND %s %s\n", MPSname(name0, get_col_name(lp, j)), formatnumber12(numberbuffer, (double)a)); } else if(is_binary(lp, j)) { if(putheader) { write_data(userhandle, write_modeldata, "BOUNDS\n"); putheader = FALSE; } write_data(userhandle, write_modeldata, " BV BND %s\n", MPSname(name0, get_col_name(lp, j))); } else if(is_unbounded(lp, j)) { if(putheader) { write_data(userhandle, write_modeldata, "BOUNDS\n"); putheader = FALSE; } write_data(userhandle, write_modeldata, " FR BND %s\n", MPSname(name0, get_col_name(lp, j))); } else { if((lp->orig_lowbo[i] != 0) || (is_int(lp, j))) { /* Some solvers like CPLEX need to have a bound on a variable if it is integer, but not binary else it is interpreted as binary which is not ment */ a = lp->orig_lowbo[i]; a = unscaled_value(lp, a, i); if(putheader) { write_data(userhandle, write_modeldata, "BOUNDS\n"); putheader = FALSE; } if(lp->orig_lowbo[i] != -lp->infinite) write_data(userhandle, write_modeldata, " LO BND %s %s\n", MPSname(name0, get_col_name(lp, j)), formatnumber12(numberbuffer, (double)a)); else write_data(userhandle, write_modeldata, " MI BND %s\n", MPSname(name0, get_col_name(lp, j))); } if((lp->orig_upbo[i] < lp->infinite) || (is_semicont(lp, j))) { a = lp->orig_upbo[i]; if(a < lp->infinite) a = unscaled_value(lp, a, i); if(putheader) { write_data(userhandle, write_modeldata, "BOUNDS\n"); putheader = FALSE; } if(is_semicont(lp, j)) { if(is_int(lp, j)) write_data(userhandle, write_modeldata, " SI BND %s %s\n", MPSname(name0, get_col_name(lp, j)), (a < lp->infinite) ? formatnumber12(numberbuffer, (double)a) : " "); else write_data(userhandle, write_modeldata, " SC BND %s %s\n", MPSname(name0, get_col_name(lp, j)), (a < lp->infinite) ? formatnumber12(numberbuffer, (double)a) : " "); } else write_data(userhandle, write_modeldata, " UP BND %s %s\n", MPSname(name0, get_col_name(lp, j)), formatnumber12(numberbuffer, (double)a)); } } } /* Write optional SOS section */ putheader = TRUE; for(i = 0; i < SOS_count(lp); i++) { SOSgroup *SOS = lp->SOS; if(putheader) { write_data(userhandle, write_modeldata, "SOS\n"); putheader = FALSE; } write_data(userhandle, write_modeldata, " S%1d SOS %s %s\n", SOS->sos_list[i]->type, MPSname(name0, SOS->sos_list[i]->name), formatnumber12(numberbuffer, (double) SOS->sos_list[i]->priority)); for(j = 1; j <= SOS->sos_list[i]->size; j++) { write_data(userhandle, write_modeldata, " SOS %s %s\n", MPSname(name0, get_col_name(lp, SOS->sos_list[i]->members[j])), formatnumber12(numberbuffer, (double) SOS->sos_list[i]->weights[j])); } } write_data(userhandle, write_modeldata, "ENDATA\n"); lp->names_used = names_used; return(ok); } static int __WINAPI write_lpdata(void *userhandle, char *buf) { fputs(buf, (FILE *) userhandle); return(TRUE); } MYBOOL MPS_writefile(lprec *lp, int typeMPS, char *filename) { FILE *output = stdout; MYBOOL ok; if (filename != NULL) { ok = ((output = fopen(filename, "w")) != NULL); if(!ok) return(ok); } else output = lp->outstream; ok = MPS_writefileex(lp, typeMPS, (void *) output, write_lpdata); if (filename != NULL) fclose(output); return(ok); } MYBOOL MPS_writehandle(lprec *lp, int typeMPS, FILE *output) { MYBOOL ok; if (output != NULL) set_outputstream(lp, output); output = lp->outstream; ok = MPS_writefileex(lp, typeMPS, (void *) output, write_lpdata); return(ok); } /* Read and write BAS files */ /* #define OldNameMatch */ #ifdef OldNameMatch static int MPS_getnameidx(lprec *lp, char *varname, MYBOOL isrow) { int in = -1; in = get_nameindex(lp, varname, isrow); if((in < 0) && (strncmp(varname, (isrow ? ROWNAMEMASK : COLNAMEMASK), 1) == 0)) { if(sscanf(varname + 1, "%d", &in) != 1) in = -1; } return( in ); } #else static int MPS_getnameidx(lprec *lp, char *varname, MYBOOL tryrowfirst) { int in = -1; /* Have we defined our own variable names? */ if(lp->names_used) { /* First check the primary name list */ in = get_nameindex(lp, varname, tryrowfirst); if((in > 0) && !tryrowfirst) in += lp->rows; /* If we were unsuccessful, try the secondary name list */ else if(in < 0) { in = get_nameindex(lp, varname, (MYBOOL) !tryrowfirst); if((in > 0) && tryrowfirst) in += lp->rows; } } /* If not, see if we can match the standard name mask */ if(in == -1) { if(strncmp(varname, (tryrowfirst ? ROWNAMEMASK : COLNAMEMASK), 1) == 0) { /* Fail if we did not successfully scan as a valid integer */ if((sscanf(varname + 1, "%d", &in) != 1) || (in < (tryrowfirst ? 0 : 1)) || (in > (tryrowfirst ? lp->rows : lp->columns))) in = -1; } else if(strncmp(varname, (!tryrowfirst ? ROWNAMEMASK : COLNAMEMASK), 1) == 0) { /* Fail if we did not successfully scan as a valid integer */ if((sscanf(varname + 1, "%d", &in) != 1) || (in < (tryrowfirst ? 0 : 1)) || (in > (tryrowfirst ? lp->rows : lp->columns))) in = -1; } } return( in ); } #endif MYBOOL MPS_readBAS(lprec *lp, int typeMPS, char *filename, char *info) { char field1[BUFSIZ], field2[BUFSIZ], field3[BUFSIZ], field5[BUFSIZ], line[BUFSIZ], tmp[BUFSIZ], *ptr; double field4, field6; int ib, in, items, Lineno = 0; MYBOOL ok; FILE *input = stdin; int (*scan_line)(lprec *lp, int section, char* line, char *field1, char *field2, char *field3, double *field4, char *field5, double *field6); if((typeMPS & MPSFIXED) == MPSFIXED) scan_line = scan_lineFIXED; else if((typeMPS & MPSFREE) == MPSFREE) scan_line = scan_lineFREE; else { report(lp, IMPORTANT, "MPS_readBAS: unrecognized MPS line type.\n"); return(FALSE); } ok = (MYBOOL) ((filename != NULL) && ((input = fopen(filename,"r")) != NULL)); if(!ok) return(ok); default_basis(lp); /* Let's initialize line to all zero's */ MEMCLEAR(line, BUFSIZ); ok = FALSE; while(fgets(line, BUFSIZ - 1, input)) { Lineno++; for(ptr = line; (*ptr) && (isspace((unsigned char) *ptr)); ptr++); /* skip lines which start with "*", they are comment */ if((line[0] == '*') || (*ptr == 0) || (*ptr == '\n') || (*ptr == '\r')) { report(lp, FULL, "Comment on line %d: %s", Lineno, line); continue; } report(lp, FULL, "Line %6d: %s", Lineno, line); /* first check for "special" lines: in our case only NAME and ENDATA, ...this must start in the first position of line */ if(line[0] != ' ') { sscanf(line, "%s", tmp); if(strcmp(tmp, "NAME") == 0) { if(info != NULL) { *info = 0; for(ptr = line + 4; (*ptr) && (isspace((unsigned char) *ptr)); ptr++); in = (int) strlen(ptr); while ((in > 0) && ((ptr[in - 1] == '\r') || (ptr[in - 1] == '\n') || isspace(ptr[in - 1]))) in--; ptr[in] = 0; strcpy(info, ptr); } } else if(strcmp(tmp, "ENDATA") == 0) { report(lp, FULL, "Finished reading BAS file\n"); ok = TRUE; break; } else { /* line does not start with space and does not match above */ report(lp, IMPORTANT, "Unrecognized BAS line %d: %s\n", Lineno, line); break; } } else { /* normal line, process */ items = scan_line(lp, /* MPSRHS */ MPSBOUNDS, line, field1, field2, field3, &field4, field5, &field6); if(items < 0){ report(lp, IMPORTANT, "Syntax error on line %d: %s\n", Lineno, line); break; } /* find first variable index value */ in = MPS_getnameidx(lp, field2, FALSE); #ifdef OldNameMatch if(in < 0) in = MPS_getnameidx(lp, field2, TRUE); else in += lp->rows; #endif if(in < 0) break; /* check if we have the basic/non-basic variable format */ if(field1[0] == 'X') { /* find second variable index value */ ib = in; in = MPS_getnameidx(lp, field3, FALSE); #ifdef OldNameMatch if(in < 0) in = MPS_getnameidx(lp, field3, TRUE); else in += lp->rows; #endif if(in < 0) break; lp->is_lower[in] = (MYBOOL) (field1[1] == 'L'); lp->is_basic[ib] = TRUE; } else lp->is_lower[in] = (MYBOOL) (field1[0] == 'L'); lp->is_basic[in] = FALSE; } } /* Update the basis index-to-variable array */ ib = 0; items = lp->sum; for(in = 1; in <= items; in++) if(lp->is_basic[in]) { ib++; lp->var_basic[ib] = in; } fclose(input); return( ok ); } MYBOOL MPS_writeBAS(lprec *lp, int typeMPS, char *filename) { int ib, in; MYBOOL ok; char name1[100], name2[100]; FILE *output = stdout; char * (*MPSname)(char *name0, char *name); char name0[9]; /* Set name formatter */ if((typeMPS & MPSFIXED) == MPSFIXED) MPSname = MPSnameFIXED; else if((typeMPS & MPSFREE) == MPSFREE) MPSname = MPSnameFREE; else { report(lp, IMPORTANT, "MPS_writeBAS: unrecognized MPS name type.\n"); return(FALSE); } /* Open the file for writing */ ok = (MYBOOL) ((filename == NULL) || ((output = fopen(filename,"w")) != NULL)); if(!ok) return(ok); if(filename == NULL && lp->outstream != NULL) output = lp->outstream; fprintf(output, "NAME %s Rows %d Cols %d Iters %.0f\n", get_lp_name(lp), lp->rows, lp->columns, (double) get_total_iter(lp)); ib = lp->rows; in = 0; while ((ib < lp->sum) || (in < lp->sum)) { /* Find next basic variable (skip slacks) */ ib++; while((ib <= lp->sum) && !lp->is_basic[ib]) ib++; /* Find next non-basic variable (skip lower-bounded structural variables) */ in++; while((in <= lp->sum) && (lp->is_basic[in] || ((in > lp->rows) && lp->is_lower[in]))) in++; /* Check if we have a basic/non-basic variable pair */ if((ib <= lp->sum) && (in <= lp->sum)) { strcpy(name1, MPSname(name0, (ib <= lp->rows ? get_row_name(lp, ib) : get_col_name(lp, ib-lp->rows)))); strcpy(name2, MPSname(name0, (in <= lp->rows ? get_row_name(lp, in) : get_col_name(lp, in-lp->rows)))); fprintf(output, " %2s %s %s\n", (lp->is_lower[in] ? "XL" : "XU"), name1, name2); } /* Otherwise just write the bound state of the non-basic variable */ else if(in <= lp->sum) { strcpy(name1, MPSname(name0, (in <= lp->rows ? get_row_name(lp, in) : get_col_name(lp, in-lp->rows)))); fprintf(output, " %2s %s\n", (lp->is_lower[in] ? "LL" : "UL"), name1); } } fprintf(output, "ENDATA\n"); if(filename != NULL) fclose(output); return( ok ); } lp_solve_5.5/lp_MPS.h100666 0 0 1536 11141374246 13052 0ustar usergroup#ifndef HEADER_lp_MPS #define HEADER_lp_MPS #include "lp_types.h" /* For MPS file reading and writing */ #define ROWNAMEMASK "R%d" #define ROWNAMEMASK2 "r%d" #define COLNAMEMASK "C%d" #define COLNAMEMASK2 "c%d" #ifdef __cplusplus extern "C" { #endif /* Read an MPS file */ MYBOOL MPS_readfile(lprec **newlp, char *filename, int typeMPS, int verbose); MYBOOL __WINAPI MPS_readhandle(lprec **newlp, FILE *filehandle, int typeMPS, int verbose); /* Write a MPS file to output */ MYBOOL MPS_writefile(lprec *lp, int typeMPS, char *filename); MYBOOL MPS_writehandle(lprec *lp, int typeMPS, FILE *output); /* Read and write BAS files */ MYBOOL MPS_readBAS(lprec *lp, int typeMPS, char *filename, char *info); MYBOOL MPS_writeBAS(lprec *lp, int typeMPS, char *filename); #ifdef __cplusplus } #endif #endif /* HEADER_lp_MPS */ lp_solve_5.5/lp_params.c100666 0 0 55721 11250514763 13717 0ustar usergroup#include #include #include #include #include "commonlib.h" #include "lp_lib.h" #include "lp_report.h" #include "ini.h" typedef int (__WINAPI fn_int_get_function)(lprec *lp); typedef long (__WINAPI fn_long_get_function)(lprec *lp); typedef MYBOOL (__WINAPI fn_MYBOOL_get_function)(lprec *lp); typedef REAL (__WINAPI fn_REAL_get_function)(lprec *lp); typedef void (__WINAPI fn_int_set_function)(lprec *lp, int value); typedef void (__WINAPI fn_long_set_function)(lprec *lp, long value); typedef void (__WINAPI fn_MYBOOL_set_function)(lprec *lp, MYBOOL value); typedef void (__WINAPI fn_REAL_set_function)(lprec *lp, REAL value); #define intfunction 1 #define longfunction 2 #define MYBOOLfunction 3 #define REALfunction 4 #define setvalues(values, basemask) values, sizeof(values) / sizeof(*values), basemask #define setNULLvalues NULL, 0, 0 #define setvalue(value) value, #value #define setintfunction(get_function, set_function) { get_function }, { set_function }, intfunction #define setlongfunction(get_function, set_function) { (fn_int_get_function *) get_function }, {(fn_int_set_function *) set_function }, longfunction #define setMYBOOLfunction(get_function, set_function) { (fn_int_get_function *) get_function }, { (fn_int_set_function *) set_function }, MYBOOLfunction #define setREALfunction(get_function, set_function) {(fn_int_get_function *) get_function }, { (fn_int_set_function *) set_function }, REALfunction #define WRITE_COMMENTED 0 #define WRITE_ACTIVE 1 struct _values { int value; char *svalue; }; struct _functions { char *par; /* name of parameter in ini file */ union { fn_int_get_function *int_get_function; /* set via setintfunction */ fn_long_get_function *long_get_function; /* set via setlongfunction */ fn_MYBOOL_get_function *MYBOOL_get_function; /* set via setMYBOOLfunction */ fn_REAL_get_function *REAL_get_function; /* set via setREALfunction */ } get_function; union { fn_int_set_function *int_set_function; /* set via setintfunction */ fn_long_set_function *long_set_function; /* set via setlongfunction */ fn_MYBOOL_set_function *MYBOOL_set_function; /* set via setMYBOOLfunction */ fn_REAL_set_function *REAL_set_function; /* set via setREALfunction */ } set_function; int type; /* set via set*function */ struct _values *values; /* set via setvalues to a structure of _values */ int elements; /* or via setNULLvalues if the value is shown as is */ unsigned int basemask; int mask; /* WRITE_ACTIVE or WRITE_COMMENTED */ }; static struct _values anti_degen[] = { { setvalue(ANTIDEGEN_NONE) }, { setvalue(ANTIDEGEN_FIXEDVARS) }, { setvalue(ANTIDEGEN_COLUMNCHECK) }, { setvalue(ANTIDEGEN_STALLING) }, { setvalue(ANTIDEGEN_NUMFAILURE) }, { setvalue(ANTIDEGEN_LOSTFEAS) }, { setvalue(ANTIDEGEN_INFEASIBLE) }, { setvalue(ANTIDEGEN_DYNAMIC) }, { setvalue(ANTIDEGEN_DURINGBB) }, { setvalue(ANTIDEGEN_RHSPERTURB) }, { setvalue(ANTIDEGEN_BOUNDFLIP) }, }; static struct _values basiscrash[] = { { setvalue(CRASH_NONE) }, /* { setvalue(CRASH_NONBASICBOUNDS) }, */ /* not yet implemented */ { setvalue(CRASH_MOSTFEASIBLE) }, { setvalue(CRASH_LEASTDEGENERATE) }, }; static struct _values bb_floorfirst[] = { { setvalue(BRANCH_CEILING) }, { setvalue(BRANCH_FLOOR) }, { setvalue(BRANCH_AUTOMATIC) }, }; static struct _values bb_rule[] = { { setvalue(NODE_FIRSTSELECT) }, { setvalue(NODE_GAPSELECT) }, { setvalue(NODE_RANGESELECT) }, { setvalue(NODE_FRACTIONSELECT) }, { setvalue(NODE_PSEUDOCOSTSELECT) }, { setvalue(NODE_PSEUDONONINTSELECT) }, { setvalue(NODE_PSEUDORATIOSELECT) }, { setvalue(NODE_USERSELECT) }, { setvalue(NODE_WEIGHTREVERSEMODE) }, { setvalue(NODE_BRANCHREVERSEMODE) }, { setvalue(NODE_GREEDYMODE) }, { setvalue(NODE_PSEUDOCOSTMODE) }, { setvalue(NODE_DEPTHFIRSTMODE) }, { setvalue(NODE_RANDOMIZEMODE) }, { setvalue(NODE_GUBMODE) }, { setvalue(NODE_DYNAMICMODE) }, { setvalue(NODE_RESTARTMODE) }, { setvalue(NODE_BREADTHFIRSTMODE) }, { setvalue(NODE_AUTOORDER) }, { setvalue(NODE_RCOSTFIXING) }, { setvalue(NODE_STRONGINIT) }, }; static struct _values improve[] = { { setvalue(IMPROVE_NONE) }, { setvalue(IMPROVE_SOLUTION) }, { setvalue(IMPROVE_DUALFEAS) }, { setvalue(IMPROVE_THETAGAP) }, { setvalue(IMPROVE_BBSIMPLEX) }, }; static REAL __WINAPI get_mip_gap_abs(lprec *lp) { return(get_mip_gap(lp, TRUE)); } static REAL __WINAPI get_mip_gap_rel(lprec *lp) { return(get_mip_gap(lp, FALSE)); } static void __WINAPI set_mip_gap_abs(lprec *lp, REAL mip_gap) { set_mip_gap(lp, TRUE, mip_gap); } static void __WINAPI set_mip_gap_rel(lprec *lp, REAL mip_gap) { set_mip_gap(lp, FALSE, mip_gap); } static struct _values pivoting[] = { { setvalue(PRICER_FIRSTINDEX) }, { setvalue(PRICER_DANTZIG) }, { setvalue(PRICER_DEVEX) }, { setvalue(PRICER_STEEPESTEDGE) }, { setvalue(PRICE_PRIMALFALLBACK) }, { setvalue(PRICE_MULTIPLE) }, { setvalue(PRICE_PARTIAL) }, { setvalue(PRICE_ADAPTIVE) }, { setvalue(PRICE_RANDOMIZE) }, { setvalue(PRICE_AUTOPARTIAL) }, { setvalue(PRICE_LOOPLEFT) }, { setvalue(PRICE_LOOPALTERNATE) }, { setvalue(PRICE_HARRISTWOPASS) }, { setvalue(PRICE_TRUENORMINIT) }, }; static struct _values presolving[] = { { setvalue(PRESOLVE_NONE) }, { setvalue(PRESOLVE_ROWS) }, { setvalue(PRESOLVE_COLS) }, { setvalue(PRESOLVE_LINDEP) }, { setvalue(PRESOLVE_AGGREGATE) }, { setvalue(PRESOLVE_SPARSER) }, { setvalue(PRESOLVE_SOS) }, { setvalue(PRESOLVE_REDUCEMIP) }, { setvalue(PRESOLVE_KNAPSACK) }, { setvalue(PRESOLVE_ELIMEQ2) }, { setvalue(PRESOLVE_IMPLIEDFREE) }, { setvalue(PRESOLVE_REDUCEGCD) }, { setvalue(PRESOLVE_PROBEFIX) }, { setvalue(PRESOLVE_PROBEREDUCE) }, { setvalue(PRESOLVE_ROWDOMINATE) }, { setvalue(PRESOLVE_COLDOMINATE) }, { setvalue(PRESOLVE_MERGEROWS) }, { setvalue(PRESOLVE_IMPLIEDSLK) }, { setvalue(PRESOLVE_COLFIXDUAL) }, { setvalue(PRESOLVE_BOUNDS) }, { setvalue(PRESOLVE_DUALS) }, { setvalue(PRESOLVE_SENSDUALS) }, }; static char *STRLWR(char *str) { char *ptr; for(ptr = str; *ptr; ptr++) *ptr = (char) tolower((unsigned char) *ptr); return(str); } static char *STRUPR(char *str) { char *ptr; for(ptr = str; *ptr; ptr++) *ptr = (char) toupper((unsigned char) *ptr); return(str); } static void __WINAPI set_presolve1(lprec *lp, int do_presolve) { set_presolve(lp, do_presolve, get_presolveloops(lp)); } static void __WINAPI set_presolve2(lprec *lp, int maxloops) { set_presolve(lp, get_presolve(lp), maxloops); } static struct _values print_sol[] = { { FALSE, "0" }, { TRUE, "1" }, { setvalue(AUTOMATIC) }, }; static struct _values scaling[] = { { setvalue(SCALE_NONE) }, { setvalue(SCALE_EXTREME) }, { setvalue(SCALE_RANGE) }, { setvalue(SCALE_MEAN) }, { setvalue(SCALE_GEOMETRIC) }, { setvalue(SCALE_CURTISREID) }, { setvalue(SCALE_QUADRATIC) }, { setvalue(SCALE_LOGARITHMIC) }, { setvalue(SCALE_USERWEIGHT) }, { setvalue(SCALE_POWER2) }, { setvalue(SCALE_EQUILIBRATE) }, { setvalue(SCALE_INTEGERS) }, { setvalue(SCALE_DYNUPDATE) }, { setvalue(SCALE_ROWSONLY) }, { setvalue(SCALE_COLSONLY) }, }; static struct _values simplextype[] = { { setvalue(SIMPLEX_PRIMAL_PRIMAL) }, { setvalue(SIMPLEX_DUAL_PRIMAL) }, { setvalue(SIMPLEX_PRIMAL_DUAL) }, { setvalue(SIMPLEX_DUAL_DUAL) }, }; static struct _values verbose[] = { { setvalue(NEUTRAL) }, { setvalue(CRITICAL) }, { setvalue(SEVERE) }, { setvalue(IMPORTANT) }, { setvalue(NORMAL) }, { setvalue(DETAILED) }, { setvalue(FULL) }, }; static struct _functions functions[] = { /* solve options */ { "ANTI_DEGEN", setintfunction(get_anti_degen, set_anti_degen), setvalues(anti_degen, ~0), WRITE_ACTIVE }, { "BASISCRASH", setintfunction(get_basiscrash, set_basiscrash), setvalues(basiscrash, ~0), WRITE_ACTIVE }, { "IMPROVE", setintfunction(get_improve, set_improve), setvalues(improve, ~0), WRITE_ACTIVE }, { "MAXPIVOT", setintfunction(get_maxpivot, set_maxpivot), setNULLvalues, WRITE_ACTIVE }, { "NEGRANGE", setREALfunction(get_negrange, set_negrange), setNULLvalues, WRITE_ACTIVE }, { "PIVOTING", setintfunction(get_pivoting, set_pivoting), setvalues(pivoting, PRICER_LASTOPTION), WRITE_ACTIVE }, { "PRESOLVE", setintfunction(get_presolve, set_presolve1), setvalues(presolving, ~0), WRITE_ACTIVE }, { "PRESOLVELOOPS", setintfunction(get_presolveloops, set_presolve2), setNULLvalues, WRITE_ACTIVE }, { "SCALELIMIT", setREALfunction(get_scalelimit, set_scalelimit), setNULLvalues, WRITE_ACTIVE }, { "SCALING", setintfunction(get_scaling, set_scaling), setvalues(scaling, SCALE_CURTISREID), WRITE_ACTIVE }, { "SIMPLEXTYPE", setintfunction(get_simplextype, set_simplextype), setvalues(simplextype, ~0), WRITE_ACTIVE }, { "OBJ_IN_BASIS", setMYBOOLfunction(is_obj_in_basis, set_obj_in_basis), setNULLvalues, WRITE_COMMENTED }, /* B&B options */ { "BB_DEPTHLIMIT", setintfunction(get_bb_depthlimit, set_bb_depthlimit), setNULLvalues, WRITE_ACTIVE }, { "BB_FLOORFIRST", setintfunction(get_bb_floorfirst, set_bb_floorfirst), setvalues(bb_floorfirst, ~0), WRITE_ACTIVE }, { "BB_RULE", setintfunction(get_bb_rule, set_bb_rule), setvalues(bb_rule, NODE_STRATEGYMASK), WRITE_ACTIVE }, { "BREAK_AT_FIRST", setMYBOOLfunction(is_break_at_first, set_break_at_first), setNULLvalues, WRITE_COMMENTED }, { "BREAK_AT_VALUE", setREALfunction(get_break_at_value, set_break_at_value), setNULLvalues, WRITE_COMMENTED }, { "MIP_GAP_ABS", setREALfunction(get_mip_gap_abs, set_mip_gap_abs), setNULLvalues, WRITE_ACTIVE }, { "MIP_GAP_REL", setREALfunction(get_mip_gap_rel, set_mip_gap_rel), setNULLvalues, WRITE_ACTIVE }, { "EPSINT", setREALfunction(get_epsint, set_epsint), setNULLvalues, WRITE_ACTIVE }, /* tolerances, values */ { "EPSB", setREALfunction(get_epsb, set_epsb), setNULLvalues, WRITE_ACTIVE }, { "EPSD", setREALfunction(get_epsd, set_epsd), setNULLvalues, WRITE_ACTIVE }, { "EPSEL", setREALfunction(get_epsel, set_epsel), setNULLvalues, WRITE_ACTIVE }, { "EPSPERTURB", setREALfunction(get_epsperturb, set_epsperturb), setNULLvalues, WRITE_ACTIVE }, { "EPSPIVOT", setREALfunction(get_epspivot, set_epspivot), setNULLvalues, WRITE_ACTIVE }, { "INFINITE", setREALfunction(get_infinite, set_infinite), setNULLvalues, WRITE_ACTIVE }, /* read-only options */ { "DEBUG", setMYBOOLfunction(is_debug, set_debug), setNULLvalues, WRITE_COMMENTED }, { "OBJ_BOUND", setREALfunction(get_obj_bound, set_obj_bound), setNULLvalues, WRITE_COMMENTED }, { "PRINT_SOL", setintfunction(get_print_sol, set_print_sol), setvalues(print_sol, ~0), WRITE_COMMENTED }, { "TIMEOUT", setlongfunction(get_timeout, set_timeout), setNULLvalues, WRITE_COMMENTED }, { "TRACE", setMYBOOLfunction(is_trace, set_trace), setNULLvalues, WRITE_COMMENTED }, { "VERBOSE", setintfunction(get_verbose, set_verbose), setvalues(verbose, ~0), WRITE_COMMENTED }, }; static void write_params1(lprec *lp, FILE *fp, char *header, int newline) { int ret = 0, ret2, i, j, k, value, value2, elements, majorversion, minorversion, release, build; unsigned int basemask; REAL a = 0; char buf[4096], par[20]; ini_writeheader(fp, header, newline); lp_solve_version(&majorversion, &minorversion, &release, &build); sprintf(buf, "lp_solve version %d.%d settings\n", majorversion, minorversion); ini_writecomment(fp, buf); for(i = 0; i < sizeof(functions) / sizeof(*functions); i++) { switch(functions[i].type) { case intfunction: if(functions[i].get_function.int_get_function == NULL) continue; ret = functions[i].get_function.int_get_function(lp); break; case longfunction: if(functions[i].get_function.long_get_function == NULL) continue; ret = functions[i].get_function.long_get_function(lp); break; case MYBOOLfunction: if(functions[i].get_function.MYBOOL_get_function == NULL) continue; ret = (int) functions[i].get_function.MYBOOL_get_function(lp); break; case REALfunction: if(functions[i].get_function.REAL_get_function == NULL) continue; a = functions[i].get_function.REAL_get_function(lp); break; } buf[0] = 0; if(functions[i].values == NULL) { switch(functions[i].type) { case intfunction: case longfunction: case MYBOOLfunction: sprintf(buf, "%d", ret); break; case REALfunction: sprintf(buf, "%g", a); break; } } else { elements = functions[i].elements; basemask = functions[i].basemask; for(j = 0; j < elements; j++) { value = functions[i].values[j].value; ret2 = ret; if(((unsigned int) value) < basemask) ret2 &= basemask; if(value == 0) { if(ret2 == 0) { if(*buf) strcat(buf, " + "); strcat(buf, functions[i].values[j].svalue); } } else if((ret2 & value) == value) { for(k = 0; k < elements; k++) { value2 = functions[i].values[k].value; if((k != j) && (value2 > value) && ((value2 & value) == value) && ((ret2 & value2) == value2)) break; } if(k == elements) { if(*buf) strcat(buf, " + "); strcat(buf, functions[i].values[j].svalue); } } } } if(functions[i].mask & WRITE_ACTIVE) par[0] = 0; else strcpy(par, ";"); strcat(par, functions[i].par); ini_writedata(fp, STRLWR(par), buf); } } static void readoptions(char *options, char **header) { char *ptr1, *ptr2; if(options != NULL) { ptr1 = options; while(*ptr1) { ptr2 = strchr(ptr1, '-'); if(ptr2 == NULL) break; ptr2++; if(tolower((unsigned char) *ptr2) == 'h') { for(++ptr2; (*ptr2) && (isspace(*ptr2)); ptr2++); for(ptr1 = ptr2; (*ptr1) && (!isspace(*ptr1)); ptr1++); *header = (char *) calloc(1 + (int) (ptr1 - ptr2), 1); memcpy(*header, ptr2, (int) (ptr1 - ptr2)); } } } if(*header == NULL) *header = strdup("Default"); } MYBOOL __WINAPI write_params(lprec *lp, char *filename, char *options) { int k, ret, params_written; FILE *fp, *fp0; int state = 0, looping, newline; char buf[4096], *filename0, *ptr1, *ptr2, *header = NULL; readoptions(options, &header); k = (int) strlen(filename); filename0 = (char *) malloc(k + 1 + 1); strcpy(filename0, filename); ptr1 = strrchr(filename0, '.'); ptr2 = strrchr(filename0, '\\'); if((ptr1 == NULL) || ((ptr2 != NULL) && (ptr1 < ptr2))) ptr1 = filename0 + k; memmove(ptr1 + 1, ptr1, k + 1 - (int) (ptr1 - filename0)); ptr1[0] = '_'; if(rename(filename, filename0)) { switch(errno) { case ENOENT: /* File or path specified by oldname not found */ FREE(filename0); filename0 = NULL; break; case EACCES: /* File or directory specified by newname already exists or could not be created (invalid path); or oldname is a directory and newname specifies a different path. */ FREE(filename0); FREE(header); return(FALSE); break; } } if((fp = ini_create(filename)) == NULL) ret = FALSE; else { params_written = FALSE; newline = TRUE; if(filename0 != NULL) { fp0 = ini_open(filename0); if(fp0 == NULL) { rename(filename0, filename); FREE(filename0); FREE(header); return(FALSE); } looping = TRUE; while(looping) { switch(ini_readdata(fp0, buf, sizeof(buf), TRUE)) { case 0: /* End of file */ looping = FALSE; break; case 1: /* header */ ptr1 = strdup(buf); STRUPR(buf); ptr2 = strdup(header); STRUPR(ptr2); if(strcmp(buf, ptr2) == 0) { write_params1(lp, fp, ptr1, newline); params_written = TRUE; newline = TRUE; state = 1; } else { state = 0; ini_writeheader(fp, ptr1, newline); newline = TRUE; } FREE(ptr2); FREE(ptr1); break; case 2: /* data */ if(state == 0) { ini_writedata(fp, NULL, buf); newline = (*buf != 0); } break; } } ini_close(fp0); } if(!params_written) write_params1(lp, fp, header, newline); ini_close(fp); ret = TRUE; } if(filename0 != NULL) { remove(filename0); FREE(filename0); } FREE(header); return( (MYBOOL) ret ); } MYBOOL __WINAPI read_params(lprec *lp, char *filename, char *options) { int ret, looping, line; FILE *fp; hashtable *hashfunctions, *hashparameters; hashelem *hp; int i, j, elements, n, intvalue, state = 0; REAL REALvalue; char buf[4096], *header = NULL, *ptr, *ptr1, *ptr2; if((fp = ini_open(filename)) == NULL) ret = FALSE; else { /* create hashtable of all callable commands to find them quickly */ hashfunctions = create_hash_table(sizeof(functions) / sizeof(*functions), 0); for (n = 0, i = 0; i < (int) (sizeof(functions)/sizeof(*functions)); i++) { puthash(functions[i].par, i, NULL, hashfunctions); if(functions[i].values != NULL) n += functions[i].elements; } /* create hashtable of all arguments to find them quickly */ hashparameters = create_hash_table(n, 0); for (n = 0, i = 0; i < (int) (sizeof(functions)/sizeof(*functions)); i++) { if(functions[i].values != NULL) { elements = functions[i].elements; for(j = 0; j < elements; j++) if((strcmp(functions[i].values[j].svalue, "0") != 0) && (strcmp(functions[i].values[j].svalue, "1") != 0)) puthash(functions[i].values[j].svalue, j, NULL, hashparameters); } } readoptions(options, &header); STRUPR(header); ret = looping = TRUE; line = 0; while((ret) && (looping)) { line++; switch(ini_readdata(fp, buf, sizeof(buf), FALSE)) { case 0: /* End of file */ looping = FALSE; break; case 1: /* header */ switch(state) { case 0: STRUPR(buf); if(strcmp(buf, header) == 0) state = 1; break; case 1: looping = FALSE; break; } break; case 2: /* data */ if(state == 1) { for(ptr = buf; (*ptr) && (isspace(*ptr)); ptr++); } else ptr = NULL; if((ptr != NULL) && (*ptr)) { STRUPR(buf); ptr = strchr(buf, '='); if(ptr == NULL) { report(lp, IMPORTANT, "read_params: No equal sign on line %d\n", line); ret = FALSE; } else { *ptr = 0; for(ptr1 = buf; isspace(*ptr1); ptr1++); for(ptr2 = ptr - 1; (ptr2 >= ptr1) && (isspace(*ptr2)); ptr2--); if(ptr2 <= ptr1) { report(lp, IMPORTANT, "read_params: No parameter name before equal sign on line %d\n", line); ret = FALSE; } else { ptr2[1] = 0; hp = findhash(ptr1, hashfunctions); if(hp == NULL) { report(lp, IMPORTANT, "read_params: Unknown parameter name (%s) before equal sign on line %d\n", ptr1, line); ret = FALSE; } else { i = hp->index; ptr1 = ++ptr; intvalue = 0; REALvalue = 0; if(functions[i].values == NULL) { switch(functions[i].type) { case intfunction: case longfunction: case MYBOOLfunction: intvalue = strtol(ptr1, &ptr2, 10); while((*ptr2) && (isspace(*ptr2))) ptr2++; if(*ptr2) { report(lp, IMPORTANT, "read_params: Invalid integer value on line %d\n", line); ret = FALSE; } break; case REALfunction: REALvalue = strtod(ptr1, &ptr2); while((*ptr2) && (isspace(*ptr2))) ptr2++; if(*ptr2) { report(lp, IMPORTANT, "read_params: Invalid real value on line %d\n", line); ret = FALSE; } break; } } else { while(ret) { ptr = strchr(ptr1, '+'); if(ptr == NULL) ptr = ptr1 + strlen(ptr1); for(; isspace(*ptr1); ptr1++); for(ptr2 = ptr - 1; (ptr2 >= ptr1) && (isspace(*ptr2)); ptr2--); if(ptr2 <= ptr1) break; else { ptr2[1] = 0; hp = findhash(ptr1, hashparameters); if (hp == NULL) { report(lp, IMPORTANT, "read_params: Invalid parameter name (%s) on line %d\n", ptr1, line); ret = FALSE; } else { j = hp->index; if((j >= functions[i].elements) || (strcmp(functions[i].values[j].svalue, ptr1))) { report(lp, IMPORTANT, "read_params: Inappropriate parameter name (%s) on line %d\n", ptr1, line); ret = FALSE; } else { intvalue += functions[i].values[j].value; } } ptr1 = ptr + 1; } } } if(ret) { switch(functions[i].type) { case intfunction: functions[i].set_function.int_set_function(lp, intvalue); break; case longfunction: functions[i].set_function.long_set_function(lp, intvalue); break; case MYBOOLfunction: functions[i].set_function.MYBOOL_set_function(lp, (MYBOOL) intvalue); break; case REALfunction: functions[i].set_function.REAL_set_function(lp, REALvalue); break; } } } } } } break; } } FREE(header); free_hash_table(hashfunctions); free_hash_table(hashparameters); ini_close(fp); } return( (MYBOOL) ret ); } lp_solve_5.5/lp_presolve.c100666 0 0 571767 11250515044 14321 0ustar usergroup /* ------------------------------------------------------------------------- Presolve routines for lp_solve v5.0+ ------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h, lp_presolve, lp_crash.h, lp_scale.h, lp_report.h Release notes: v1.0.0 1 January 2003 Initial crude version used with lp_solve v4. v5.0.0 1 January 2004 Significantly expanded and repackaged presolve routines for lp_solve v5 release. v5.0.1 1 April 2004 Added reference to new crash module v5.1.0 20 August 2004 Reworked infeasibility detection. Added encapsulation of presolve undo logic. v5.1.1 10 September 2004 Added variable bound tightening based on full-constraint information, as well as variable fixing by duality. v5.2.0 1 January 2005 Fixes to bound fixing handling. Added fast batch compression after presolve. Restructured calls by adding presolve wrapper. Major optimization of identification logic along with bug fixes. Enabled storage of eliminated matrix data. Added function to report on constraint classes. v5.5.0 1 June 2005 Added implied slack presolve, restructured looping logic to be more modular, and made active row/column selection logic faster. v5.5.1 18 June 2005 Finished sparsity-enhancing logic and added initial version of column aggregation code. ------------------------------------------------------------------------- */ #include #include "commonlib.h" #include "lp_lib.h" #include "lp_presolve.h" #include "lp_crash.h" #include "lp_scale.h" #include "lp_report.h" #ifdef FORTIFY # include "lp_fortify.h" #endif #define presolve_setstatus(one, two) presolve_setstatusex(one, two, __LINE__, __FILE__) STATIC int presolve_setstatusex(presolverec *psdata, int status, int lineno, char *filename) { if((status == INFEASIBLE) || (status == UNBOUNDED)) { report(psdata->lp, #ifdef Paranoia NORMAL, #else DETAILED, #endif "presolve_setstatus: Status set to '%s' on code line %d, file '%s'\n", (status == INFEASIBLE ? "INFEASIBLE" : "UNBOUNDED"), lineno, (filename == NULL ? "Unknown" : filename)); } return( status ); } STATIC MYBOOL presolve_statuscheck(presolverec *psdata, int *status) { if(*status == RUNNING) { lprec *lp = psdata->lp; if(!mat_validate(lp->matA)) *status = MATRIXERROR; else if(userabort(lp, -1)) *status = lp->spx_status; } return( (MYBOOL) (*status == RUNNING) ); } STATIC MYBOOL presolve_createUndo(lprec *lp) { if(lp->presolve_undo != NULL) presolve_freeUndo(lp); lp->presolve_undo = (presolveundorec *) calloc(1, sizeof(presolveundorec)); lp->presolve_undo->lp = lp; if(lp->presolve_undo == NULL) return( FALSE ); return( TRUE ); } STATIC MYBOOL inc_presolve_space(lprec *lp, int delta, MYBOOL isrows) { int i, ii, oldrowcolalloc, rowcolsum, oldrowalloc, oldcolalloc; presolveundorec *psundo = lp->presolve_undo; if(psundo == NULL) { presolve_createUndo(lp); psundo = lp->presolve_undo; } /* Set constants */ oldrowalloc = lp->rows_alloc-delta; oldcolalloc = lp->columns_alloc-delta; oldrowcolalloc = lp->sum_alloc-delta; rowcolsum = lp->sum_alloc + 1; /* Reallocate lp memory */ if(isrows) allocREAL(lp, &psundo->fixed_rhs, lp->rows_alloc+1, AUTOMATIC); else allocREAL(lp, &psundo->fixed_obj, lp->columns_alloc+1, AUTOMATIC); allocINT(lp, &psundo->var_to_orig, rowcolsum, AUTOMATIC); allocINT(lp, &psundo->orig_to_var, rowcolsum, AUTOMATIC); /* Fill in default values, where appropriate */ if(isrows) ii = oldrowalloc+1; else ii = oldcolalloc+1; for(i = oldrowcolalloc+1; i < rowcolsum; i++, ii++) { psundo->var_to_orig[i] = 0; psundo->orig_to_var[i] = 0; if(isrows) psundo->fixed_rhs[ii] = 0; else psundo->fixed_obj[ii] = 0; } return(TRUE); } STATIC MYBOOL presolve_setOrig(lprec *lp, int orig_rows, int orig_cols) { presolveundorec *psundo = lp->presolve_undo; if(psundo == NULL) return( FALSE ); psundo->orig_rows = orig_rows; psundo->orig_columns = orig_cols; psundo->orig_sum = orig_rows + orig_cols; if(lp->wasPresolved) presolve_fillUndo(lp, orig_rows, orig_cols, FALSE); return( TRUE ); } STATIC MYBOOL presolve_fillUndo(lprec *lp, int orig_rows, int orig_cols, MYBOOL setOrig) { int i; presolveundorec *psundo = lp->presolve_undo; for(i = 0; i <= orig_rows; i++) { psundo->var_to_orig[i] = i; psundo->orig_to_var[i] = i; psundo->fixed_rhs[i] = 0; } for(i = 1; i <= orig_cols; i++) { psundo->var_to_orig[orig_rows + i] = i; psundo->orig_to_var[orig_rows + i] = i; psundo->fixed_obj[i] = 0; } if(setOrig) presolve_setOrig(lp, orig_rows, orig_cols); return( TRUE ); } STATIC MYBOOL presolve_rebuildUndo(lprec *lp, MYBOOL isprimal) { int ik, ie, ix, j, k, *colnrDep; REAL hold, *value, *solution, *slacks; presolveundorec *psdata = lp->presolve_undo; MATrec *mat = NULL; /* Point to and initialize undo structure at first call */ if(isprimal) { if(psdata->primalundo != NULL) mat = psdata->primalundo->tracker; solution = lp->full_solution + lp->presolve_undo->orig_rows; slacks = lp->full_solution; } else { if(psdata->dualundo != NULL) mat = psdata->dualundo->tracker; solution = lp->full_duals; slacks = lp->full_duals + lp->presolve_undo->orig_rows; } if(mat == NULL) return( FALSE ); /* Loop backward over the undo chain */ for(j = mat->col_tag[0]; j > 0; j--) { ix = mat->col_tag[j]; ik = mat->col_end[j-1]; ie = mat->col_end[j]; colnrDep = &COL_MAT_ROWNR(ik); value = &COL_MAT_VALUE(ik); hold = 0; k = 0; for(; ik < ie; ik++, colnrDep += matRowColStep, value += matValueStep) { /* Constant term */ if(*colnrDep == 0) hold += *value; /* Special case with dependence on a slack variable */ else if(isprimal && (*colnrDep > lp->presolve_undo->orig_columns)) { k = (*colnrDep) - lp->presolve_undo->orig_columns; hold -= (*value) * slacks[k]; slacks[k] = 0; } else if(!isprimal && (*colnrDep > lp->presolve_undo->orig_rows)) { k = (*colnrDep) - lp->presolve_undo->orig_rows; hold -= (*value) * slacks[k]; slacks[k] = 0; } /* Dependence on other user variable */ else hold -= (*value) * solution[*colnrDep]; *value = 0; } if(fabs(hold) > lp->epsvalue) solution[ix] = hold; } return( TRUE ); } STATIC MYBOOL presolve_freeUndo(lprec *lp) { presolveundorec *psundo = lp->presolve_undo; if(psundo == NULL) return( FALSE ); FREE(psundo->orig_to_var); FREE(psundo->var_to_orig); FREE(psundo->fixed_rhs); FREE(psundo->fixed_obj); if(psundo->deletedA != NULL) freeUndoLadder(&(psundo->deletedA)); if(psundo->primalundo != NULL) freeUndoLadder(&(psundo->primalundo)); if(psundo->dualundo != NULL) freeUndoLadder(&(psundo->dualundo)); FREE(lp->presolve_undo); return( TRUE ); } STATIC void presolve_storeDualUndo(presolverec *psdata, int rownr, int colnr) { lprec *lp = psdata->lp; MYBOOL firstdone = FALSE; int ix, iix, item; REAL Aij = get_mat(lp, rownr, colnr); MATrec *mat = lp->matA; if(presolve_collength(psdata, colnr) == 0) return; /* Add undo information for the dual of the deleted constraint */ item = 0; for(ix = presolve_nextrow(psdata, colnr, &item); ix >= 0; ix = presolve_nextrow(psdata, colnr, &item)) { iix = COL_MAT_ROWNR(ix); if(iix == rownr) continue; if(!firstdone) firstdone = addUndoPresolve(lp, FALSE, rownr, get_mat(lp, 0, colnr)/Aij, get_mat_byindex(lp, ix, FALSE, TRUE)/Aij, iix); else appendUndoPresolve(lp, FALSE, get_mat_byindex(lp, ix, FALSE, TRUE)/Aij, iix); } } /* ----------------------------------------------------------------------------- */ /* Presolve debugging routines */ /* ----------------------------------------------------------------------------- */ STATIC MYBOOL presolve_SOScheck(presolverec *psdata) { MYBOOL status = TRUE; lprec *lp = psdata->lp; int *list, i, j, n, k, nk, colnr, nSOS = SOS_count(lp), nerr = 0; SOSrec *SOS; if(nSOS == 0) return( status ); /* For each SOS and each member check validity */ for(i = 1; i<= nSOS; i++) { SOS = lp->SOS->sos_list[i-1]; list = SOS->members; n = list[0]; for(j = 1; j<= n; j++) { colnr = list[j]; /* Check valid range */ if((colnr < 1) || (colnr > lp->columns)) { nerr++; report(lp, IMPORTANT, "presolve_SOScheck: A - Column index %d is outside of valid range\n", colnr); } /* Check for deletion */ if(!isActiveLink(psdata->cols->varmap, colnr)) { nerr++; report(lp, IMPORTANT, "presolve_SOScheck: B - Column index %d has been marked for deletion\n", colnr); } /* Check if sorted member array is Ok */ if(SOS_member_index(lp->SOS, i, colnr) != j) { nerr++; report(lp, IMPORTANT, "presolve_SOScheck: C - Column index %d not found in fast search array\n", colnr); } /* Check for variable membership in this SOS record of the sparse storage */ k = lp->SOS->memberpos[colnr-1]; nk = lp->SOS->memberpos[colnr]; while((k < nk) && (lp->SOS->membership[k] != i)) k++; if(k >= nk) { nerr++; report(lp, IMPORTANT, "presolve_SOScheck: D - Column index %d was not found in sparse array\n", colnr); } } } /* Check that all members in the sparse array can be validated as SOS members */ for(colnr = 1; colnr <= lp->columns; colnr++) { k = lp->SOS->memberpos[colnr-1]; nk = lp->SOS->memberpos[colnr]; for(; k < nk; k++) { if(!SOS_is_member(lp->SOS, lp->SOS->membership[k], colnr)) { nerr++; report(lp, IMPORTANT, "presolve_SOScheck: E - Sparse array did not indicate column index %d as member of SOS %d\n", colnr, lp->SOS->membership[k]); } } } status = (MYBOOL) (nerr == 0); if(!status) report(lp, IMPORTANT, "presolve_SOScheck: There were %d errors\n", nerr); return( status ); } /* ----------------------------------------------------------------------------- */ /* Presolve routines for tightening the model */ /* ----------------------------------------------------------------------------- */ INLINE REAL presolve_roundrhs(lprec *lp, REAL value, MYBOOL isGE) { #ifdef DoPresolveRounding REAL eps = PRESOLVE_EPSVALUE*1000, /* REAL eps = PRESOLVE_EPSVALUE*pow(10.0,MAX(0,log10(1+fabs(value)))), */ testout = my_precision(value, eps); #if 1 if(my_chsign(isGE, value-testout) < 0) value = testout; #elif 0 if(my_chsign(isGE, value-testout) < 0) value = testout; else if(value != testout) value += my_chsign(isGE, (value-testout)/2); /* value = testout + my_chsign(isGE, (value-testout)/2); */ #else if(testout != value) value += my_chsign(isGE, eps*1000); /* BASE OPTION */ #endif #endif return( value ); } INLINE REAL presolve_roundval(lprec *lp, REAL value) { #ifdef DoPresolveRounding /* value = my_precision(value, PRESOLVE_EPSVALUE*MAX(1,log10(1+fabs(value)))); */ value = my_precision(value, PRESOLVE_EPSVALUE); /* BASE OPTION */ #endif return( value ); } INLINE MYBOOL presolve_mustupdate(lprec *lp, int colnr) { #if 0 return( my_infinite(lp, get_lowbo(lp, colnr)) || my_infinite(lp, get_upbo(lp, colnr)) ); #else return( my_infinite(lp, lp->orig_lowbo[lp->rows+colnr]) || my_infinite(lp, lp->orig_upbo[lp->rows+colnr]) ); #endif } INLINE REAL presolve_sumplumin(lprec *lp, int item, psrec *ps, MYBOOL doUpper) { REAL *plu = (doUpper ? ps->pluupper : ps->plulower), *neg = (doUpper ? ps->negupper : ps->neglower); if(fabs(plu[item]) >= lp->infinite) return( plu[item] ); else if(fabs(neg[item]) >= lp->infinite) return( neg[item] ); else return( plu[item]+neg[item] ); } INLINE void presolve_range(lprec *lp, int rownr, psrec *ps, REAL *loValue, REAL *hiValue) { *loValue = presolve_sumplumin(lp, rownr, ps, FALSE); *hiValue = presolve_sumplumin(lp, rownr, ps, TRUE); } STATIC void presolve_rangeorig(lprec *lp, int rownr, psrec *ps, REAL *loValue, REAL *hiValue, REAL delta) { delta = my_chsign(is_chsign(lp, rownr), lp->presolve_undo->fixed_rhs[rownr] + delta); *loValue = presolve_sumplumin(lp, rownr, ps, FALSE) + delta; *hiValue = presolve_sumplumin(lp, rownr, ps, TRUE) + delta; } STATIC MYBOOL presolve_rowfeasible(presolverec *psdata, int rownr, MYBOOL userowmap) { lprec *lp = psdata->lp; MYBOOL status = TRUE; int contype, origrownr = rownr; REAL LHS, RHS, value; /* Optionally loop across all active rows in the provided map (debugging) */ if(userowmap) rownr = firstActiveLink(psdata->rows->varmap); /* Now do once for ingoing rownr or loop across rowmap */ while((status == TRUE) && (rownr != 0)) { /* Check the lower bound */ value = presolve_sumplumin(lp, rownr, psdata->rows, TRUE); LHS = get_rh_lower(lp, rownr); if(value < LHS-lp->epssolution) { contype = get_constr_type(lp, rownr); report(lp, NORMAL, "presolve_rowfeasible: Lower bound infeasibility in %s row %s (%g << %g)\n", get_str_constr_type(lp, contype), get_row_name(lp, rownr), value, LHS); if(rownr != origrownr) report(lp, NORMAL, " ... Input row base used for testing was %s\n", get_row_name(lp, origrownr)); status = FALSE; } /* Check the upper bound */ value = presolve_sumplumin(lp, rownr, psdata->rows, FALSE); RHS = get_rh_upper(lp, rownr); if(value > RHS+lp->epssolution) { contype = get_constr_type(lp, rownr); report(lp, NORMAL, "presolve_rowfeasible: Upper bound infeasibility in %s row %s (%g >> %g)\n", get_str_constr_type(lp, contype), get_row_name(lp, rownr), value, RHS); status = FALSE; } if(userowmap) rownr = nextActiveLink(psdata->rows->varmap, rownr); else rownr = 0; } return( status ); } STATIC MYBOOL presolve_debugmap(presolverec *psdata, char *caption) { lprec *lp = psdata->lp; MATrec *mat = lp->matA; int colnr, ix, ie, nx, jx, je, *cols, *rows, n; int nz = mat->col_end[lp->columns] - 1; MYBOOL status = FALSE; for(colnr = 1; colnr <= lp->columns; colnr++) { rows = psdata->cols->next[colnr]; if(!isActiveLink(psdata->cols->varmap, colnr)) { if(rows != NULL) { report(lp, SEVERE, "presolve_debugmap: Inactive column %d is non-empty\n", colnr); goto Done; } else continue; } if(rows == NULL) report(lp, SEVERE, "presolve_debugmap: Active column %d is empty\n", colnr); je = *rows; rows++; for(jx = 1; jx <= je; jx++, rows++) { if((*rows < 0) || (*rows > nz)) { report(lp, SEVERE, "presolve_debugmap: NZ index %d for column %d out of range (index %d<=%d)\n", *rows, colnr, jx, je); goto Done; } cols = psdata->rows->next[COL_MAT_ROWNR(*rows)]; ie = cols[0]; n = 0; for(ix = 1; ix <= ie; ix++) { nx = cols[ix]; if((nx < 0) || (nx > nz)) { report(lp, SEVERE, "presolve_debugmap: NZ index %d for column %d to row %d out of range\n", nx, colnr, jx); goto Done; } } } } status = TRUE; Done: if(!status && (caption != NULL)) report(lp, SEVERE, "...caller was '%s'\n", caption); return( status ); } STATIC MYBOOL presolve_validate(presolverec *psdata, MYBOOL forceupdate) { int i, ie, j, je, k, rownr, *items; REAL upbound, lobound, value; lprec *lp = psdata->lp; MATrec *mat = lp->matA; MYBOOL status = mat->row_end_valid && !forceupdate; if(status) return( status ); else if(!mat->row_end_valid) status = mat_validate(mat); else status = forceupdate; if(status) { /* First update rows... */ for(i = 1; i <= lp->rows; i++) { psdata->rows->plucount[i] = 0; psdata->rows->negcount[i] = 0; psdata->rows->pluneg[i] = 0; if(!isActiveLink(psdata->rows->varmap, i)) { FREE(psdata->rows->next[i]); } else { /* Create next column pointers by row */ k = mat_rowlength(mat, i); allocINT(lp, &(psdata->rows->next[i]), k+1, AUTOMATIC); items = psdata->rows->next[i]; je = mat->row_end[i]; k = 0; for(j = mat->row_end[i-1]; j < je; j++) if(isActiveLink(psdata->cols->varmap, ROW_MAT_COLNR(j))) { k++; items[k] = j; } items[0] = k; } } /* ...then update columns */ for(j = 1; j <= lp->columns; j++) { psdata->cols->plucount[j] = 0; psdata->cols->negcount[j] = 0; psdata->cols->pluneg[j] = 0; if(!isActiveLink(psdata->cols->varmap, j)) { FREE(psdata->cols->next[j]); } else { upbound = get_upbo(lp, j); lobound = get_lowbo(lp, j); if(is_semicont(lp, j) && (upbound > lobound)) { if(lobound > 0) lobound = 0; else if(upbound < 0) upbound = 0; } /* Create next row pointers by column */ k = mat_collength(mat, j); allocINT(lp, &(psdata->cols->next[j]), k+1, AUTOMATIC); items = psdata->cols->next[j]; ie = mat->col_end[j]; k = 0; for(i = mat->col_end[j-1]; i < ie; i++) { rownr = COL_MAT_ROWNR(i); if(isActiveLink(psdata->rows->varmap, rownr)) { k++; items[k] = i; /* Cumulate counts */ value = COL_MAT_VALUE(i); if(my_chsign(is_chsign(lp, rownr), value) > 0) { psdata->rows->plucount[rownr]++; psdata->cols->plucount[j]++; } else { psdata->rows->negcount[rownr]++; psdata->cols->negcount[j]++; } if((lobound < 0) && (upbound >= 0)) { psdata->rows->pluneg[rownr]++; psdata->cols->pluneg[j]++; } } } items[0] = k; } } #ifdef Paranoia presolve_debugmap(psdata, "presolve_validate"); #endif } return( status ); } STATIC MYBOOL presolve_rowtallies(presolverec *psdata, int rownr, int *plu, int *neg, int *pluneg) { REAL value; lprec *lp = psdata->lp; MATrec *mat = lp->matA; int ix, jx, ib = 0; MYBOOL chsign = is_chsign(lp, rownr); /* Initialize */ *plu = 0; *neg = 0; *pluneg = 0; /* Loop over still active row members */ for(ix = presolve_nextcol(psdata, rownr, &ib); ix >= 0; ix = presolve_nextcol(psdata, rownr, &ib)) { /* Get matrix column and value */ jx = ROW_MAT_COLNR(ix); value = ROW_MAT_VALUE(ix); /* Cumulate counts */ if(my_chsign(chsign, value) > 0) (*plu)++; else (*neg)++; if((get_lowbo(lp, jx) < 0) && (get_upbo(lp, jx) >= 0)) (*pluneg)++; } return( TRUE ); } STATIC MYBOOL presolve_debugrowtallies(presolverec *psdata) { lprec *lp = psdata->lp; int i, plu, neg, pluneg, nerr = 0; for(i = 1; i <= lp->rows; i++) if(isActiveLink(psdata->rows->varmap, i) && presolve_rowtallies(psdata, i, &plu, &neg, &pluneg)) { if((psdata->rows->plucount[i] != plu) || (psdata->rows->negcount[i] != neg) || (psdata->rows->pluneg[i] != pluneg)) { nerr++; report(lp, SEVERE, "presolve_debugrowtallies: Detected inconsistent count for row %d\n", i); } } return( (MYBOOL) (nerr == 0) ); } STATIC int presolve_debugcheck(lprec *lp, LLrec *rowmap, LLrec *colmap) { int i, j, errc = 0; /* Validate constraint bounds */ for(i = 1; i < lp->rows; i++) { if((rowmap != NULL) && !isActiveLink(rowmap, i)) continue; /* Check if we have a negative range */ if(lp->orig_upbo[i] < 0) { errc++; report(lp, SEVERE, "presolve_debugcheck: Detected negative range %g for row %d\n", lp->orig_upbo[i], i); } } /* Validate variables */ for(j = 1; j < lp->columns; j++) { if((colmap != NULL) && !isActiveLink(colmap, j)) continue; i = lp->rows+j; /* Check if we have infeasible bounds */ if(lp->orig_lowbo[i] > lp->orig_upbo[i]) { errc++; report(lp, SEVERE, "presolve_debugcheck: Detected UB < LB for column %d\n", j); } } /* Return total number of errors */ return( errc ); } STATIC MYBOOL presolve_candeletevar(presolverec *psdata, int colnr) { lprec *lp = psdata->lp; int usecount = SOS_memberships(lp->SOS, colnr); return( (MYBOOL) ((lp->SOS == NULL) || (usecount == 0) || (/*is_presolve(lp, PRESOLVE_SOS) &&*/ (((lp->SOS->sos1_count == lp->SOS->sos_count)) || (usecount == SOS_is_member_of_type(lp->SOS, colnr, SOS1))))) ); } STATIC int presolve_rowlengthex(presolverec *psdata, int rownr) { int j1 = psdata->rows->plucount[rownr] + psdata->rows->negcount[rownr]; #ifdef Paranoia int j2 = presolve_rowlength(psdata, rownr); if(j1 != j2) { report(psdata->lp, SEVERE, "presolve_rowlengthex: Expected row length %d, but found %d in row %s\n", j2, j1, get_row_name(psdata->lp, rownr)); j1 = -j1; } #endif return( j1 ); } STATIC int presolve_rowlengthdebug(presolverec *psdata) { int rownr, n = 0; for(rownr = firstActiveLink(psdata->rows->varmap); rownr != 0; rownr = nextActiveLink(psdata->rows->varmap, rownr)) n += presolve_rowlengthex(psdata, rownr); return( n ); } INLINE int presolve_nextrecord(psrec *ps, int recnr, int *previtem) { int *nzlist = ps->next[recnr], nzcount = nzlist[0], status = -1; /* Check if we simply wish the last active column */ if(previtem == NULL) { if(nzlist != NULL) status = nzlist[*nzlist]; return( status ); } /* Step to next */ #ifdef Paranoia else if((*previtem < 0) || (*previtem > nzcount)) return( status ); #endif (*previtem)++; /* Set the return values */ if(*previtem > nzcount) (*previtem) = 0; else status = nzlist[*previtem]; return( status ); } INLINE int presolve_nextcol(presolverec *psdata, int rownr, int *previtem) /* Find the first active (non-eliminated) nonzero column in rownr after prevcol */ { return( presolve_nextrecord(psdata->rows, rownr, previtem) ); } INLINE int presolve_lastcol(presolverec *psdata, int rownr) { return( presolve_nextrecord(psdata->rows, rownr, NULL) ); } INLINE int presolve_nextrow(presolverec *psdata, int colnr, int *previtem) /* Find the first active (non-eliminated) nonzero row in colnr after prevrow */ { return( presolve_nextrecord(psdata->cols, colnr, previtem) ); } INLINE int presolve_lastrow(presolverec *psdata, int colnr) { return( presolve_nextrecord(psdata->cols, colnr, NULL) ); } INLINE void presolve_adjustrhs(presolverec *psdata, int rownr, REAL fixdelta, REAL epsvalue) { lprec *lp = psdata->lp; lp->orig_rhs[rownr] -= fixdelta; if(epsvalue > 0) #if 1 my_roundzero(lp->orig_rhs[rownr], epsvalue); #else lp->orig_rhs[rownr] = presolve_roundrhs(lp, lp->orig_rhs[rownr], FALSE); #endif lp->presolve_undo->fixed_rhs[rownr] += fixdelta; } STATIC int presolve_shrink(presolverec *psdata, int *nConRemove, int *nVarRemove) { SOSgroup *SOS = psdata->lp->SOS; int status = RUNNING, countR = 0, countC = 0, i, ix, n, *list; REAL fixValue; /* Remove empty rows */ list = psdata->rows->empty; if(list != NULL) { n = list[0]; for(i = 1; i <= n; i++) if(isActiveLink(psdata->rows->varmap, list[i])) { presolve_rowremove(psdata, list[i], FALSE); countR++; } if(nConRemove != NULL) (*nConRemove) += countR; list[0] = 0; } /* Fix and remove empty columns (unless they are in a SOS) */ list = psdata->cols->empty; if(list != NULL) { n = list[0]; for(i = 1; i <= n; i++) { ix = list[i]; if(isActiveLink(psdata->cols->varmap, ix)) { if(presolve_colfixdual(psdata, ix, &fixValue, &status)) { if(!presolve_colfix(psdata, ix, fixValue, TRUE, nVarRemove)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } presolve_colremove(psdata, ix, FALSE); countC++; } else if(SOS_is_member(SOS, 0, ix)) report(psdata->lp, DETAILED, "presolve_shrink: Empty column %d is member of a SOS\n", ix); } } list[0] = 0; } return( status ); } STATIC void presolve_rowremove(presolverec *psdata, int rownr, MYBOOL allowcoldelete) { lprec *lp = psdata->lp; MATrec *mat = lp->matA; int ix, ie, nx, jx, je, *cols, *rows, n, colnr; #ifdef Paranoia if((rownr < 1) || (rownr > lp->rows)) report(lp, SEVERE, "presolve_rowremove: Row %d out of range\n", rownr); #endif /* Remove this row for each column that is active in the row */ cols = psdata->rows->next[rownr]; ie = *cols; cols++; for(ix = 1; ix <= ie; ix++, cols++) { n = 0; colnr = ROW_MAT_COLNR(*cols); rows = psdata->cols->next[colnr]; je = rows[0]; /* See if we can narrow the search window */ jx = je / 2; if((jx > 5) && (rownr >= COL_MAT_ROWNR(rows[jx]))) n = jx-1; else jx = 1; /* Do the compression loop */ for(; jx <= je; jx++) { nx = rows[jx]; if(COL_MAT_ROWNR(nx) != rownr) { n++; rows[n] = nx; } } rows[0] = n; /* Make sure we delete columns that have become empty */ #if 1 if((n == 0) && allowcoldelete) { int *list = psdata->cols->empty; n = ++list[0]; list[n] = colnr; } #endif } FREE(psdata->rows->next[rownr]); removeLink(psdata->rows->varmap, rownr); switch(get_constr_type(lp, rownr)) { case LE: removeLink(psdata->LTmap, rownr); break; case EQ: removeLink(psdata->EQmap, rownr); break; } if(isActiveLink(psdata->INTmap, rownr)) removeLink(psdata->INTmap, rownr); } STATIC int presolve_colremove(presolverec *psdata, int colnr, MYBOOL allowrowdelete) { lprec *lp = psdata->lp; #ifdef Paranoia if((colnr < 1) || (colnr > lp->columns)) report(lp, SEVERE, "presolve_colremove: Column %d out of range\n", colnr); if(!isActiveLink(psdata->cols->varmap, colnr) || !presolve_candeletevar(psdata, colnr)) colnr = -1; else #endif { MATrec *mat = lp->matA; int ix, ie, nx, jx, je, *cols, *rows, n, rownr; /* Remove this column for each row that is active in the column */ rows = psdata->cols->next[colnr]; je = *rows; rows++; for(jx = 1; jx <= je; jx++, rows++) { n = 0; rownr = COL_MAT_ROWNR(*rows); cols = psdata->rows->next[rownr]; ie = cols[0]; /* See if we can narrow the search window */ ix = ie / 2; if((ix > 5) && (colnr >= ROW_MAT_COLNR(cols[ix]))) n = ix-1; else ix = 1; /* Do the compression loop */ for(; ix <= ie; ix++) { nx = cols[ix]; if(ROW_MAT_COLNR(nx) != colnr) { n++; cols[n] = nx; } } cols[0] = n; /* Make sure we delete rows that become empty */ #if 1 if((n == 0) && allowrowdelete) { int *list = psdata->rows->empty; n = ++list[0]; list[n] = rownr; } #endif } FREE(psdata->cols->next[colnr]); /* Update other counts */ if(SOS_is_member(lp->SOS, 0, colnr)) { if(lp->sos_priority != NULL) { lp->sos_vars--; if(is_int(lp, colnr)) lp->sos_ints--; } SOS_member_delete(lp->SOS, 0, colnr); clean_SOSgroup(lp->SOS, TRUE); if(SOS_count(lp) == 0) free_SOSgroup(&(lp->SOS)); } /* Finally remove the column from the active column list */ colnr = removeLink(psdata->cols->varmap, colnr); } return( colnr ); } STATIC int presolve_redundantSOS(presolverec *psdata, int *nb, int *nSum) { lprec *lp = psdata->lp; int i, ii, k, kk, j, nrows = lp->rows, *fixed = NULL, iBoundTighten = 0, status = RUNNING; SOSrec *SOS; /* Is there anything to do? */ i = ii = SOS_count(lp); if(ii == 0) return( status ); /* Allocate working member list */ if(!allocINT(lp, &fixed, lp->columns+1, FALSE) ) return( lp->spx_status ); /* Check if we have SOS'es that are already satisfied or fixable/satisfiable */ while(i > 0) { SOS = lp->SOS->sos_list[i-1]; kk = SOS->members[0]; fixed[0] = 0; for(k = 1; k <= kk; k++) { j = SOS->members[k]; if((get_lowbo(lp, j) > 0) && !is_semicont(lp, j)) { fixed[++fixed[0]] = k; /* Abort if we have identified SOS infeasibility */ if(fixed[0] > SOS->type) { status = presolve_setstatus(psdata, INFEASIBLE); goto Done; } } } /* If there were an exact number of non-zero SOS members, check their sequentiality */ if(fixed[0] == SOS->type) { /* Check sequentiality of members with non-zero lower bounds */ for(k = 2; k <= fixed[0]; k++) { if(fixed[k] != fixed[k-1]+1) { status = presolve_setstatus(psdata, INFEASIBLE); goto Done; } } /* Fix other member variables to zero, if necessary */ for(k = kk; k > 0; k--) { j = SOS->members[k]; if((get_lowbo(lp, j) > 0) && !is_semicont(lp, j)) continue; if(!presolve_colfix(psdata, j, 0.0, AUTOMATIC, &iBoundTighten)) { status = presolve_setstatus(psdata, INFEASIBLE); goto Done; } } /* Remove the SOS */ delete_SOSrec(lp->SOS, i /* , FALSE */); } /* Otherwise, try to fix variables outside the SOS type window */ else if(fixed[0] > 0) { for(k = kk; k > 0; k--) { if((k > fixed[fixed[0]]-SOS->type) && /* After leading entries */ (k < fixed[1]+SOS->type)) /* Before trailing entries */ continue; j = SOS->members[k]; SOS_member_delete(lp->SOS, i, j); /* if(get_upbo(lp, j) - get_lowbo(lp, j) < lp->epsprimal) */ if(is_fixedvar(lp, nrows+j)) continue; if(!presolve_colfix(psdata, j, 0.0, AUTOMATIC, &iBoundTighten)) { status = presolve_setstatus(psdata, INFEASIBLE); goto Done; } } } i--; } /* Update the sparse member map if there were SOS deletions; Remember that delete_SOSrec() above specified deferred updating! */ i = SOS_count(lp); if((i < ii) || (iBoundTighten > 0)) { SOS_member_updatemap(lp->SOS); } /* Update tag orders */ for(; i > 0; i--) lp->SOS->sos_list[i-1]->tagorder = i; Done: FREE(fixed); (*nb) += iBoundTighten; (*nSum) += iBoundTighten; return( status ); } STATIC MYBOOL presolve_fixSOS1(presolverec *psdata, int colnr, REAL fixvalue, int *nr, int *nv) { lprec *lp = psdata->lp; int i, k, j; SOSrec *SOS; REAL newvalue; MYBOOL *fixed = NULL, status = FALSE; /* Allocate working member list */ if(!allocMYBOOL(lp, &fixed, lp->columns+1, TRUE) ) return(FALSE); /* Fix variables in SOS's where colnr is a member */ i = SOS_count(lp); while(i > 0) { /* Set next SOS target (note that colnr has been tested earlier as not being a member of a higher order SOS) */ SOS = lp->SOS->sos_list[i-1]; if(SOS_is_member(lp->SOS, i, colnr)) { for(k = SOS->members[0]; k > 0; k--) { j = SOS->members[k]; if(fixed[j]) continue; if(j == colnr) { fixed[j] = TRUE; newvalue = fixvalue; } else { fixed[j] = AUTOMATIC; newvalue = 0.0; } /* If it is a member of a higher order SOS then just change bounds */ if(!presolve_candeletevar(psdata, j)) { set_bounds(lp, j, newvalue, newvalue); fixed[j] = TRUE | AUTOMATIC; psdata->forceupdate = TRUE; } /* Otherwise fix it in preparation for removal */ else if(!presolve_colfix(psdata, j, newvalue, TRUE, nv)) goto Done; } } i--; } /* Delete SOS'es or SOS member variables where we can */ k = i = SOS_count(lp); while(i > 0) { /* Set next SOS target */ SOS = lp->SOS->sos_list[i-1]; if(SOS_is_member(lp->SOS, i, colnr)) { /* Always delete SOS1's */ if(SOS->type == SOS1) delete_SOSrec(lp->SOS, i /* , FALSE */); /* Only delete leading or trailing SOS members in higher-order SOS'es that are fixed at 0; (note that this section of the code will never be called in the current setup) */ else { /* First the leading entries... */ for(j = 1; j <= SOS->members[0]; j++) { if(fixed[SOS->members[j]] == AUTOMATIC) SOS_member_delete(lp->SOS, i, SOS->members[j]); } /* ...then trailing entries */ for(j = SOS->members[0]; j > 0; j--) { if(fixed[SOS->members[j]] == AUTOMATIC) SOS_member_delete(lp->SOS, i, SOS->members[j]); } } } i--; } /* Update the sparse member map if there were SOS deletions; delete_SOSrec() above specified deferred updating */ i = SOS_count(lp); if(i < k) SOS_member_updatemap(lp->SOS); /* Delete the variables that have been fixed */ k = 0; for(j = lp->columns; j > 0; j--) { if((fixed[j] == TRUE) || (fixed[j] == AUTOMATIC)) { presolve_colremove(psdata, j, TRUE); k++; } } /* Update tag orders */ i = SOS_count(lp); for(; i > 0; i--) lp->SOS->sos_list[i-1]->tagorder = i; status = TRUE; Done: FREE(fixed); return( status ); } STATIC void presolve_setEQ(presolverec *psdata, int rownr) { lprec *lp = psdata->lp; if(is_constr_type(lp, rownr, LE)) removeLink(psdata->LTmap, rownr); setLink(psdata->EQmap, rownr); set_constr_type(lp, rownr, EQ); psdata->dv_lobo[rownr] = -lp->infinite; psdata->dv_upbo[rownr] = lp->infinite; } STATIC MYBOOL presolve_singletonbounds(presolverec *psdata, int rownr, int colnr, REAL *lobound, REAL *upbound, REAL *aval) { lprec *lp = psdata->lp; REAL coeff_a, epsvalue = psdata->epsvalue; MYBOOL isneg; /* Compute row singleton variable range */ if(is_constr_type(lp, rownr, EQ) && (fabs(*lobound) < epsvalue)) *lobound = *upbound = 0; else { if(aval == NULL) coeff_a = get_mat(lp, rownr, colnr); else coeff_a = *aval; isneg = (MYBOOL) (coeff_a < 0); if(*lobound > -lp->infinite) *lobound /= coeff_a; else if(isneg) *lobound = -(*lobound); if(*upbound < lp->infinite) *upbound /= coeff_a; else if(isneg) *upbound = -(*upbound); if(isneg) swapREAL(lobound, upbound); } /* Check against bound - handle SC variables specially */ if(is_semicont(lp, colnr)) { coeff_a = get_lowbo(lp, colnr); if(coeff_a > 0) { SETMAX(*lobound, 0.0); SETMIN(*upbound, get_upbo(lp, colnr)); } else { coeff_a = get_upbo(lp, colnr); if(coeff_a > 0) { SETMAX(*lobound, get_lowbo(lp, colnr)); SETMIN(*upbound, 0.0); } } } else { SETMAX(*lobound, get_lowbo(lp, colnr)); SETMIN(*upbound, get_upbo(lp, colnr)); } /* Return with consistency status */ #ifdef DoPresolveRelativeTest isneg = (MYBOOL) (my_reldiff(*upbound, *lobound) >= - epsvalue); #else isneg = (MYBOOL) (*upbound >= *lobound - epsvalue); #endif if(!isneg) { /* Attempt bound-related error correction */ if(fabs(my_reldiff(*lobound, get_upbo(lp, colnr))) < PRESOLVE_BOUNDSLACK*epsvalue) *lobound = get_upbo(lp, colnr); else if(fabs(my_reldiff(*upbound, get_lowbo(lp, colnr))) < PRESOLVE_BOUNDSLACK*epsvalue) *upbound = get_lowbo(lp, colnr); #ifdef DoPresolveRelativeTest isneg = (MYBOOL) (my_reldiff(*upbound, *lobound) >= - epsvalue); #else isneg = (MYBOOL) (*upbound >= *lobound - epsvalue); #endif if(!isneg) report(lp, NORMAL, "presolve_singletonbounds: Singleton variable %s in row %s infeasibility (%g << %g)\n", get_col_name(lp, colnr), get_row_name(lp, rownr), *lobound, *upbound); } return( isneg ); } STATIC MYBOOL presolve_altsingletonvalid(presolverec *psdata, int rownr, int colnr, REAL reflotest, REAL refuptest) { lprec *lp = psdata->lp; REAL coeff_bl, coeff_bu, epsvalue = psdata->epsvalue; coeff_bl = get_rh_lower(lp, rownr); coeff_bu = get_rh_upper(lp, rownr); /* Check base data validity */ #ifdef DoPresolveRelativeTest if((my_reldiff(refuptest, reflotest) < -epsvalue) || #else if((reflotest > refuptest + epsvalue) || #endif !presolve_singletonbounds(psdata, rownr, colnr, &coeff_bl, &coeff_bu, NULL)) return( FALSE ); /* Base data is Ok, now check against against each other */ epsvalue = MAX(reflotest-coeff_bu, coeff_bl-refuptest) / epsvalue; if(epsvalue > PRESOLVE_BOUNDSLACK) { report(lp, NORMAL, "presolve_altsingletonvalid: Singleton variable %s in row %s infeasible (%g)\n", get_col_name(lp, colnr), get_row_name(lp, rownr), MAX(reflotest-coeff_bu, coeff_bl-refuptest)); return( FALSE ); } else return( TRUE ); } STATIC MYBOOL presolve_multibounds(presolverec *psdata, int rownr, int colnr, REAL *lobound, REAL *upbound, REAL *aval, MYBOOL *rowbinds) { lprec *lp = psdata->lp; MYBOOL rowbindsvar = FALSE, status = FALSE; REAL coeff_a, LHS, RHS, netX, Xupper, Xlower, epsvalue = psdata->epsvalue; /* Get variable bounds for netting */ LHS = *lobound; RHS = *upbound; Xlower = get_lowbo(lp, colnr); Xupper = get_upbo(lp, colnr); /* Identify opportunity for bound tightening */ if(aval == NULL) coeff_a = get_mat(lp, rownr, colnr); else coeff_a = *aval; netX = presolve_sumplumin(lp, rownr, psdata->rows, TRUE); if(!my_infinite(lp, LHS) && !my_infinite(lp, netX)) { if(coeff_a > 0) { LHS -= netX-coeff_a*Xupper; LHS /= coeff_a; if(LHS > Xlower + epsvalue) { Xlower = presolve_roundrhs(lp, LHS, TRUE); status = TRUE; } else if(LHS > Xlower - epsvalue) rowbindsvar = TRUE; } else { LHS -= netX-coeff_a*Xlower; LHS /= coeff_a; if(LHS < Xupper - epsvalue) { Xupper = presolve_roundrhs(lp, LHS, FALSE); status = AUTOMATIC; } else if(LHS < Xupper + epsvalue) rowbindsvar = AUTOMATIC; } } netX = presolve_sumplumin(lp, rownr, psdata->rows, FALSE); if(!my_infinite(lp, RHS) && !my_infinite(lp, netX)) { if(coeff_a < 0) { if(!my_infinite(lp, Xupper)) { RHS -= netX-coeff_a*Xupper; RHS /= coeff_a; if(RHS > Xlower + epsvalue) { Xlower = presolve_roundrhs(lp, RHS, TRUE); status |= TRUE; } else if(RHS > Xlower - epsvalue) rowbindsvar |= TRUE; } } else if(!my_infinite(lp, Xlower)) { RHS -= netX-coeff_a*Xlower; RHS /= coeff_a; if(RHS < Xupper - epsvalue) { Xupper = presolve_roundrhs(lp, RHS, FALSE); status |= AUTOMATIC; } else if(RHS < Xupper + epsvalue) rowbindsvar |= AUTOMATIC; } } *lobound = Xlower; *upbound = Xupper; if(rowbinds != NULL) *rowbinds = rowbindsvar; return(status); } STATIC MYBOOL isnz_origobj(lprec *lp, int colnr) { return( (MYBOOL) (lp->orig_obj[colnr] != 0) ); } STATIC MYBOOL presolve_testrow(presolverec *psdata, int lastrow) { if(psdata->forceupdate) { presolve_updatesums(psdata); psdata->forceupdate = FALSE; } if(!presolve_rowfeasible(psdata, 0, TRUE)) return( FALSE ); else return( TRUE ); } STATIC MYBOOL presolve_coltighten(presolverec *psdata, int colnr, REAL LOnew, REAL UPnew, int *count) { lprec *lp = psdata->lp; int elmnr, elmend, k, oldcount = 0, newcount = 0, deltainf; REAL LOold, UPold, Value, margin = psdata->epsvalue; MATrec *mat = lp->matA; REAL *value; int *rownr; /* Attempt correction of marginally equal, but inconsistent input values */ Value = UPnew - LOnew; if((Value <= -margin) && (Value > -lp->epsprimal)) { if(fabs(fmod(UPnew, 1.0)) < margin) LOnew = UPnew; else UPnew = LOnew; } /* Check if there is anything to do */ LOold = get_lowbo(lp, colnr); UPold = get_upbo(lp, colnr); #ifdef Paranoia if(((LOold > LOnew) && !is_semicont(lp, colnr)) || (UPold < UPnew)) { report(lp, SEVERE, "presolve_coltighten: Inconsistent new bounds requested for column %d\n", colnr); return( FALSE ); } #endif if(count != NULL) newcount = *count; oldcount = newcount; /* Modify inf-count */ deltainf = 0; if((UPold < lp->infinite) || (LOold > -lp->infinite)) deltainf -= 1; if((UPnew < lp->infinite) || (LOnew > -lp->infinite)) deltainf += 1; if(isnz_origobj(lp, colnr)) psdata->rows->infcount[0] += deltainf; elmnr = mat->col_end[colnr-1]; elmend = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(elmnr); for(; elmnr < elmend; elmnr++, rownr += matRowColStep) { k = *rownr; if(isActiveLink(psdata->rows->varmap, k)) psdata->rows->infcount[k] += deltainf; } /* Look for opportunity to tighten upper variable bound */ if((UPnew < lp->infinite) && (UPnew+margin < UPold)) { if(is_int(lp, colnr)) UPnew = floor(UPnew+margin); if(UPold < lp->infinite) { /* First do OF */ k = 0; Value = my_chsign(is_chsign(lp, k), lp->orig_obj[colnr]); if((Value > 0) && (psdata->rows->pluupper[k] < lp->infinite)) psdata->rows->pluupper[k] += (UPnew-UPold)*Value; else if((Value < 0) && (psdata->rows->negupper[k] < lp->infinite)) psdata->rows->negupper[k] += (LOnew-LOold)*Value; psdata->rows->infcount[k] += deltainf; /* Then scan the constraint rows */ elmnr = mat->col_end[colnr-1]; elmend = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(elmnr); value = &COL_MAT_VALUE(elmnr); for(; elmnr < elmend; elmnr++, rownr += matRowColStep, value += matValueStep) { k = *rownr; if(!isActiveLink(psdata->rows->varmap, k)) continue; Value = my_chsign(is_chsign(lp, k), *value); if((Value > 0) && (psdata->rows->pluupper[k] < lp->infinite)) psdata->rows->pluupper[k] += (UPnew-UPold)*Value; else if((Value < 0) && (psdata->rows->negupper[k] < lp->infinite)) psdata->rows->negupper[k] += (LOnew-LOold)*Value; } } else psdata->forceupdate = TRUE; if(UPnew < UPold) { UPold = UPnew; newcount++; } } /* Look for opportunity to tighten lower variable bound */ if((LOnew > -lp->infinite) && (LOnew-margin > LOold)) { if(is_int(lp, colnr)) LOnew = ceil(LOnew-margin); if(LOold > -lp->infinite) { /* First do OF */ k = 0; Value = my_chsign(is_chsign(lp, k), lp->orig_obj[colnr]); if((Value > 0) && (psdata->rows->plulower[k] > -lp->infinite)) psdata->rows->plulower[k] += (LOnew-LOold)*Value; else if((Value < 0) && (psdata->rows->neglower[k] > -lp->infinite)) psdata->rows->neglower[k] += (UPnew-UPold)*Value; /* Then scan the constraint rows */ elmnr = mat->col_end[colnr-1]; elmend = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(elmnr); value = &COL_MAT_VALUE(elmnr); for(; elmnr < elmend; elmnr++, rownr += matRowColStep, value += matValueStep) { k = *rownr; if(!isActiveLink(psdata->rows->varmap, k)) continue; Value = my_chsign(is_chsign(lp, k), *value); if((Value > 0) && (psdata->rows->plulower[k] > -lp->infinite)) psdata->rows->plulower[k] += (LOnew-LOold)*Value; else if((Value < 0) && (psdata->rows->neglower[k] > -lp->infinite)) psdata->rows->neglower[k] += (UPnew-UPold)*Value; } } else psdata->forceupdate = TRUE; if(LOnew > LOold) { LOold = LOnew; newcount++; } } /* Now set the new variable bounds, if they are tighter */ if(newcount > oldcount) { UPnew = presolve_roundval(lp, UPnew); LOnew = presolve_roundval(lp, LOnew); if(LOnew > UPnew) { if(LOnew-UPnew < margin) { LOnew = UPnew; } else { report(lp, NORMAL, "presolve_coltighten: Found column %s with LB %g > UB %g\n", get_col_name(lp, colnr), LOnew, UPnew); return( FALSE ); } } if(lp->spx_trace || (lp->verbose > DETAILED)) report(lp, NORMAL, "presolve_coltighten: Replaced bounds on column %s to [%g ... %g]\n", get_col_name(lp, colnr), LOnew, UPnew); set_bounds(lp, colnr, LOnew, UPnew); } if(count != NULL) *count = newcount; return( TRUE ); } STATIC int presolve_rowtighten(presolverec *psdata, int rownr, int *tally, MYBOOL intsonly) { lprec *lp = psdata->lp; MYBOOL rowbinds; int item = 0, jx, jjx, ix, idxn = 0, *idxbound = NULL, status = RUNNING; REAL *newbound = NULL, RHlo = get_rh_lower(lp, rownr), RHup = get_rh_upper(lp, rownr), VARlo, VARup, Aval; MATrec *mat = lp->matA; jx = presolve_rowlength(psdata, rownr); allocREAL(lp, &newbound, 2*jx, TRUE); allocINT (lp, &idxbound, 2*jx, TRUE); /* Identify bound tightening for each active variable in the constraint */ for(jx = presolve_nextcol(psdata, rownr, &item); jx >= 0; jx = presolve_nextcol(psdata, rownr, &item)) { jjx = ROW_MAT_COLNR(jx); Aval = ROW_MAT_VALUE(jx); Aval = my_chsign(rownr, Aval); VARlo = RHlo; VARup = RHup; presolve_multibounds(psdata, rownr,jjx, &VARlo, &VARup, &Aval, &rowbinds); if(rowbinds & TRUE) { idxbound[idxn] = -jjx; newbound[idxn] = VARlo; idxn++; } if(rowbinds & AUTOMATIC) { idxbound[idxn] = jjx; newbound[idxn] = VARup; idxn++; } } /* Loop over the bounds identified for tightening and perform update */ ix = 0; while(ix < idxn) { jjx = idxbound[ix]; jx = abs(jjx); /* Skip free variables and non-ints, if specified */ if(is_unbounded(lp, jx) || (intsonly && !is_int(lp, jx))) continue; VARlo = get_lowbo(lp, jx); VARup = get_upbo(lp, jx); /* while((ix < idxn) && (jx == abs(jjx))) { */ while((ix < idxn) && (jx == abs((jjx = idxbound[ix])))) { if(jjx < 0) VARlo = newbound[ix]; else VARup = newbound[ix]; ix++; } if(!presolve_coltighten(psdata, jx, VARlo, VARup, tally)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } } FREE(newbound); FREE(idxbound); return(status); } STATIC void set_dv_bounds(presolverec *psdata, int rownr, REAL lowbo, REAL upbo) { psdata->dv_lobo[rownr] = lowbo; psdata->dv_upbo[rownr] = upbo; } STATIC REAL get_dv_lower(presolverec *psdata, int rownr) { return( psdata->dv_lobo[rownr] ); } STATIC REAL get_dv_upper(presolverec *psdata, int rownr) { return( psdata->dv_upbo[rownr] ); } STATIC MYBOOL presolve_rowfix(presolverec *psdata, int rownr, REAL newvalue, MYBOOL remove, int *tally) { lprec *lp = psdata->lp; int i, ix, ie; MYBOOL isneg, lofinite, upfinite, doupdate = FALSE, chsign = is_chsign(lp, rownr); REAL lobound, upbound, lovalue, upvalue, Value, fixvalue, fixprod, mult; MATrec *mat = lp->matA; psrec *ps = psdata->cols; /* Set "fixed" value in case we are deleting a variable */ upbound = get_dv_upper(psdata, rownr); lobound = get_dv_lower(psdata, rownr); if(remove) { if(upbound-lobound < psdata->epsvalue) { if((newvalue > lobound) && (newvalue < upbound)) fixvalue = newvalue; else fixvalue = lobound; } else { if(my_infinite(lp, newvalue) && (get_rh(lp, rownr) == 0)) fixvalue = ((lobound <= 0) && (upbound >= 0) ? 0 : MIN(upbound, lobound)); else fixvalue = newvalue; } set_dv_bounds(psdata, rownr, fixvalue, fixvalue); if(fixvalue != 0) addUndoPresolve(lp, FALSE, rownr, fixvalue, 0, 0); mult = -1; } else { mult = 1; fixvalue = 0; } /* Loop over rows to update statistics */ ix = mat->row_end[rownr - 1]; ie = mat->row_end[rownr]; for(; ix < ie; ix++) { /* Retrieve row data and adjust RHS if we are deleting a variable */ i = ROW_MAT_COLNR(ix); Value = ROW_MAT_VALUE(ix); if(Value == 0) continue; if(remove && (fixvalue != 0)) { fixprod = Value*fixvalue; lp->orig_obj[i] -= fixprod; my_roundzero(lp->orig_obj[i], psdata->epsvalue); lp->presolve_undo->fixed_obj[i] += fixprod; } /* Prepare for further processing */ Value = my_chsign(chsign, Value); isneg = (MYBOOL) (Value < 0); /* Reduce row variable counts if we are removing the variable */ if(!isActiveLink(ps->varmap, i)) continue; if(remove) { if(isneg) { ps->negcount[i]--; } else { ps->plucount[i]--; } if((lobound < 0) && (upbound >= 0)) { ps->pluneg[i]--; } } /* Compute associated constraint contribution values */ upfinite = (MYBOOL) (upbound < lp->infinite); lofinite = (MYBOOL) (lobound > -lp->infinite); if(upfinite || lofinite) { if(remove) ps->infcount[i]--; else ps->infcount[i]++; } upvalue = my_if(upfinite, Value*upbound, my_chsign(isneg, lp->infinite)); lovalue = my_if(lofinite, Value*lobound, my_chsign(isneg, -lp->infinite)); /* Cumulate effective upper column bound (only bother with non-finite bound) */ if(isneg) { if((ps->negupper[i] < lp->infinite) && lofinite) { ps->negupper[i] += mult*lovalue; ps->negupper[i] = presolve_roundrhs(lp, ps->negupper[i], FALSE); } else if(remove && !lofinite) doupdate = TRUE; else ps->negupper[i] = lp->infinite; } else { if((ps->pluupper[i] < lp->infinite) && upfinite) { ps->pluupper[i] += mult*upvalue; ps->pluupper[i] = presolve_roundrhs(lp, ps->pluupper[i], FALSE); } else if(remove && !upfinite) doupdate = TRUE; else ps->pluupper[i] = lp->infinite; } /* Cumulate effective lower column bound (only bother with non-finite bound) */ if(isneg) { if((ps->neglower[i] > -lp->infinite) && upfinite) { ps->neglower[i] += mult*upvalue; ps->neglower[i] = presolve_roundrhs(lp, ps->neglower[i], TRUE); } else if(remove && !upfinite) doupdate = TRUE; else ps->neglower[i] = -lp->infinite; } else { if((ps->plulower[i] > -lp->infinite) && lofinite) { ps->plulower[i] += mult*lovalue; ps->plulower[i] = presolve_roundrhs(lp, ps->plulower[i], TRUE); } else if(remove && !lofinite) doupdate = TRUE; else ps->plulower[i] = -lp->infinite; } /* Validate consistency of eliminated singleton */ if(remove && ((i == 0) || (ps->next[i][0] == 1)) && !psdata->forceupdate) { presolve_range(lp, i, ps, &lovalue, &upvalue); Value = get_mat(lp, 0, i); if((upvalue < Value) || (lovalue > Value)) { report(lp, IMPORTANT, "presolve: Row %s (%g << %g) infeasibility in column %s (OF=%g)\n", get_row_name(lp, rownr), lovalue, upvalue, get_col_name(lp, i), Value); return( FALSE ); } } } if(remove) { psdata->forceupdate |= doupdate; if(tally != NULL) (*tally)++; } return( TRUE ); } STATIC int presolve_colsingleton(presolverec *psdata, int i, int j, int *count) { lprec *lp = psdata->lp; REAL RHlow, RHup, LObound, UPbound, Value; #ifdef Paranoia if(!isActiveLink(psdata->cols->varmap, j)) report(lp, SEVERE, "presolve_colsingleton: Nothing to do, column %d was eliminated earlier\n", j); #endif Value = get_mat(lp,i,j); if(Value == 0) return( RUNNING ); /* Initialize and identify semicontinuous variable */ LObound = get_lowbo(lp, j); UPbound = get_upbo(lp, j); if(is_semicont(lp, j) && (UPbound > LObound)) { if(LObound > 0) LObound = 0; else if(UPbound < 0) UPbound = 0; } /* Get singleton variable bounds */ RHlow = get_rh_lower(lp, i); RHup = get_rh_upper(lp, i); if(!presolve_singletonbounds(psdata, i,j, &RHlow, &RHup, &Value)) return( presolve_setstatus(psdata, INFEASIBLE) ); if(presolve_coltighten(psdata, j, RHlow, RHup, count)) return( RUNNING ); else return( presolve_setstatus(psdata, INFEASIBLE) ); } STATIC MYBOOL presolve_colfix(presolverec *psdata, int colnr, REAL newvalue, MYBOOL remove, int *tally) { lprec *lp = psdata->lp; int i, ix, ie; MYBOOL isneg, lofinite, upfinite, doupdate = FALSE, doOF = TRUE; REAL lobound, upbound, lovalue, upvalue, Value, fixvalue, mult; MATrec *mat = lp->matA; psrec *ps = psdata->rows; REAL *value; int *rownr; /* Set "fixed" value in case we are deleting a variable */ upbound = get_upbo(lp, colnr); lobound = get_lowbo(lp, colnr); if(remove) { if(upbound-lobound < psdata->epsvalue) { if((newvalue > lobound) && (newvalue < upbound)) fixvalue = newvalue; else fixvalue = lobound; } else { if(my_infinite(lp, newvalue) && (get_mat(lp, 0, colnr) == 0)) fixvalue = ((lobound <= 0) && (upbound >= 0) ? 0 : MIN(upbound, lobound)); else fixvalue = newvalue; } #if 1 /* Fast normal version */ set_bounds(lp, colnr, fixvalue, fixvalue); #else /* Slower version that can be used for debugging/control purposes */ presolve_coltighten(psdata, colnr, fixvalue, fixvalue, NULL); lobound = fixvalue; upbound = fixvalue; #endif if(fixvalue != 0) addUndoPresolve(lp, TRUE, colnr, fixvalue, 0, 0); mult = -1; } else { mult = 1; fixvalue = 0; } /* Adjust semi-continuous variable bounds to zero-base */ if(is_semicont(lp, colnr) && (upbound > lobound)) { if(lobound > 0) lobound = 0; else if(upbound < 0) upbound = 0; } /* Loop over rows to update statistics */ ix = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(ix); value = &COL_MAT_VALUE(ix); for(; doOF || (ix < ie); ix++, rownr += matRowColStep, value += matValueStep) { /* Retrieve row data and adjust RHS if we are deleting a variable */ Restart: if(doOF) { i = 0; Value = lp->orig_obj[colnr]; } else { i = *rownr; Value = *value; if(!isActiveLink(ps->varmap, i)) continue; } if(Value == 0) goto BlockEnd; if(remove && (fixvalue != 0)) presolve_adjustrhs(psdata, i, Value*fixvalue, psdata->epsvalue); /* Prepare for further processing */ Value = my_chsign(is_chsign(lp, i), Value); isneg = (MYBOOL) (Value < 0); /* Reduce row variable counts if we are removing the variable */ if(remove == TRUE) { if(isneg) { ps->negcount[i]--; } else { ps->plucount[i]--; } if((lobound < 0) && (upbound >= 0)) { ps->pluneg[i]--; } } /* Compute associated constraint contribution values */ upfinite = (MYBOOL) (upbound < lp->infinite); lofinite = (MYBOOL) (lobound > -lp->infinite); if(upfinite || lofinite) { if(remove) ps->infcount[i]--; else ps->infcount[i]++; } upvalue = my_if(upfinite, Value*upbound, my_chsign(isneg, lp->infinite)); lovalue = my_if(lofinite, Value*lobound, my_chsign(isneg, -lp->infinite)); /* Cumulate effective upper row bound (only bother with non-finite bound) */ if(isneg) { if((ps->negupper[i] < lp->infinite) && lofinite) { ps->negupper[i] += mult*lovalue; ps->negupper[i] = presolve_roundrhs(lp, ps->negupper[i], FALSE); } else if(remove && !lofinite) doupdate = TRUE; else ps->negupper[i] = lp->infinite; } else { if((ps->pluupper[i] < lp->infinite) && upfinite) { ps->pluupper[i] += mult*upvalue; ps->pluupper[i] = presolve_roundrhs(lp, ps->pluupper[i], FALSE); } else if(remove && !upfinite) doupdate = TRUE; else ps->pluupper[i] = lp->infinite; } /* Cumulate effective lower row bound (only bother with non-finite bound) */ if(isneg) { if((ps->neglower[i] > -lp->infinite) && upfinite) { ps->neglower[i] += mult*upvalue; ps->neglower[i] = presolve_roundrhs(lp, ps->neglower[i], TRUE); } else if(remove && !upfinite) doupdate = TRUE; else ps->neglower[i] = -lp->infinite; } else { if((ps->plulower[i] > -lp->infinite) && lofinite) { ps->plulower[i] += mult*lovalue; ps->plulower[i] = presolve_roundrhs(lp, ps->plulower[i], TRUE); } else if(remove && !lofinite) doupdate = TRUE; else ps->plulower[i] = -lp->infinite; } /* Validate consistency of eliminated singleton */ if(remove && ((i == 0) || (ps->next[i][0] == 1)) && !psdata->forceupdate) { if(i == 0) { lovalue = get_rh_lower(lp, i); upvalue = get_rh_upper(lp, i); report(lp, DETAILED, "presolve_colfix: Objective determined by presolve as %18g\n", (is_maxim(lp) ? upvalue : lovalue)); } else { presolve_range(lp, i, ps, &lovalue, &upvalue); #if 1 Value = 0; #else Value = MAX(fabs(upvalue), fabs(lovalue)); Value = psdata->epsvalue * MAX(1, Value); #endif if((upvalue < get_rh_lower(lp, i)-Value) || (lovalue > get_rh_upper(lp, i)+Value)) { report(lp, NORMAL, "presolve_colfix: Variable %s (%g << %g) infeasibility in row %s (%g << %g)\n", get_col_name(lp, colnr), lovalue, upvalue, get_row_name(lp, i), get_rh_lower(lp,i), get_rh_upper(lp, i)); return( FALSE ); } } } BlockEnd: if(doOF) { doOF = FALSE; if(ix < ie) goto Restart; } } if(remove) { psdata->forceupdate |= doupdate; if(tally != NULL) (*tally)++; } return( TRUE ); } /* Delete the columns of the specified row, but make sure we don't delete SOS variables. Note that we cannot use presolve_nextcol() here, since the variables are deleted. */ STATIC int presolve_rowfixzero(presolverec *psdata, int rownr, int *nv) { lprec *lp = psdata->lp; MATrec *mat = lp->matA; int ix, jx, ib = mat->row_end[rownr-1]; for(ix = mat->row_end[rownr]-1; ix >= ib; ix--) { jx = ROW_MAT_COLNR(ix); if(isActiveLink(psdata->cols->varmap, jx)) { if(!presolve_colfix(psdata, jx, 0.0, TRUE, nv)) return( presolve_setstatus(psdata, INFEASIBLE) ); if(presolve_candeletevar(psdata, jx)) presolve_colremove(psdata, jx, TRUE); } } #ifdef xxParanoia if(!presolve_debugrowtallies(psdata)) return( INFEASIBLE ); #endif return( RUNNING ); } /* Function to find if a variable can be fixed based on considering the dual */ STATIC MYBOOL presolve_colfixdual(presolverec *psdata, int colnr, REAL *fixValue, int *status) { lprec *lp = psdata->lp; MYBOOL hasOF, isMI, isDualFREE = TRUE; int i, ix, ie, *rownr, signOF; REAL *value, loX, upX, eps = psdata->epsvalue; MATrec *mat = lp->matA; /* First check basic variable range */ loX = get_lowbo(lp, colnr); upX = get_upbo(lp, colnr); if(((loX < 0) && (upX > 0)) || (fabs(upX-loX) < lp->epsvalue) || SOS_is_member_of_type(lp->SOS, colnr, SOSn)) return( FALSE ); isMI = (MYBOOL) (upX <= 0); /* Retrieve OF (standard form assuming maximization) */ ix = mat->col_end[colnr - 1]; ie = mat->col_end[colnr]; rownr = &COL_MAT_ROWNR(ix); value = &COL_MAT_VALUE(ix); hasOF = isnz_origobj(lp, colnr); if(hasOF) signOF = my_sign(lp->orig_obj[colnr]); else signOF = 0; /* Loop over all constraints involving active variable (standard form with LE constraints)*/ for(; (ix < ie) && isDualFREE; ix++, rownr += matRowColStep, value += matValueStep) { i = *rownr; if(!isActiveLink(psdata->rows->varmap, i)) continue; if(presolve_rowlength(psdata, i) == 1) { REAL val = my_chsign(is_chsign(lp, i), *value), loR = get_rh_lower(lp, i), upR = get_rh_upper(lp, i); if(!presolve_singletonbounds(psdata, i, colnr, &loR, &upR, &val)) { *status = presolve_setstatus(psdata, INFEASIBLE); return( FALSE ); } if(loR > loX + psdata->epsvalue) loX = presolve_roundrhs(lp, loR, TRUE); if(upR < upX - psdata->epsvalue) upX = presolve_roundrhs(lp, upR, FALSE); continue; } else isDualFREE = my_infinite(lp, get_rh_range(lp, i)) || /* Explicitly free */ ((presolve_sumplumin(lp, i, psdata->rows, TRUE)-eps <= get_rh_upper(lp, i)) && /* Implicitly free */ (presolve_sumplumin(lp, i, psdata->rows, FALSE)+eps >= get_rh_lower(lp, i))); if(isDualFREE) { if(signOF == 0) /* Test on the basis of identical signs in the constraints */ signOF = my_sign(*value); else /* Test on the basis of constraint sign equal to OF sign */ isDualFREE = (MYBOOL) (signOF == my_sign(*value)); } } /* Set fixing value if we were successful */ if(isDualFREE) { if(signOF == 0) { SETMAX(loX, 0); *fixValue = MIN(loX, upX); } else if(signOF > 0) { if(my_infinite(lp, loX)) isDualFREE = FALSE; else { if(is_int(lp, colnr)) *fixValue = ceil(loX-PRESOLVE_EPSVALUE); else *fixValue = loX; } } else { if(my_infinite(lp, upX)) isDualFREE = FALSE; else { if(is_int(lp, colnr) && (upX != 0)) *fixValue = floor(upX+PRESOLVE_EPSVALUE); else *fixValue = upX; } } if((*fixValue != 0) && SOS_is_member(lp->SOS, 0, colnr)) return( FALSE ); } return( isDualFREE ); } #if 0 STATIC MYBOOL presolve_probefix01(presolverec *psdata, int colnr, REAL *fixvalue) { lprec *lp = psdata->lp; int i, ix, item; REAL loLim, absvalue, epsvalue = psdata->epsvalue; MATrec *mat = lp->matA; MYBOOL chsign, canfix = FALSE; if(!is_binary(lp, colnr)) return( canfix ); /* Loop over all active rows to search for fixing opportunity */ item = 0; for(ix = presolve_nextrow(psdata, colnr, &item); (ix >= 0) && !canfix; ix = presolve_nextrow(psdata, colnr, &item)) { i = COL_MAT_ROWNR(ix); *fixvalue = COL_MAT_VALUE(ix); chsign = is_chsign(lp, i); /* First check the lower bound of the normalized constraint */ loLim = presolve_sumplumin(lp, i, psdata->rows, chsign); loLim = my_chsign(chsign, loLim); absvalue = fabs(*fixvalue); canfix = (MYBOOL) ((loLim + absvalue > lp->orig_rhs[i]+epsvalue*MAX(1, absvalue))); /* If we were unsuccessful in fixing above, try the upper bound of the normalized constraint - if it is finite */ if(!canfix && !my_infinite(lp, get_rh_range(lp, i))) { loLim = presolve_sumplumin(lp, i, psdata->rows, (MYBOOL) !chsign); loLim = my_chsign(!chsign, loLim); *fixvalue = -(*fixvalue); canfix = (MYBOOL) ((loLim + absvalue > get_rh_range(lp, i)-lp->orig_rhs[i]+epsvalue*MAX(1, absvalue))); } } /* Check if we were successful in identifying fixing opportunity */ if(canfix) { if(*fixvalue < 0) *fixvalue = 1; else *fixvalue = 0; } return( canfix ); } #else STATIC MYBOOL presolve_probefix01(presolverec *psdata, int colnr, REAL *fixvalue) { lprec *lp = psdata->lp; int i, ix, item; REAL loLim, upLim, range, absvalue, epsvalue = psdata->epsvalue, tolgap; MATrec *mat = lp->matA; MYBOOL chsign, status = FALSE; if(!is_binary(lp, colnr)) return( status ); /* Loop over all active rows to search for fixing opportunity. The logic is that if a constraint gets violated by setting a variable at one of its bounds, then it can be fixed at its opposite bound. */ item = 0; for(ix = presolve_nextrow(psdata, colnr, &item); (ix >= 0); ix = presolve_nextrow(psdata, colnr, &item)) { i = COL_MAT_ROWNR(ix); *fixvalue = COL_MAT_VALUE(ix); absvalue = fabs(*fixvalue); SETMIN(absvalue, 100); tolgap = epsvalue*MAX(1, absvalue); chsign = is_chsign(lp, i); /* Get the constraint value limits based on variable bounds, normalized to LE constraint */ loLim = presolve_sumplumin(lp, i, psdata->rows, FALSE); upLim = presolve_sumplumin(lp, i, psdata->rows, TRUE); if(chsign) { loLim = my_chsign(chsign, loLim); upLim = my_chsign(chsign, upLim); swapREAL(&loLim, &upLim); } /* Check the upper constraint bound for possible violation if the value were to be fixed at 1 */ if(loLim + *fixvalue > lp->orig_rhs[i]+tolgap) { if(*fixvalue < 0) presolve_setstatus(psdata, INFEASIBLE); *fixvalue = 0; break; } /* Check the lower constraint bound for possible violation if the value were to be fixed at 1 */ range = get_rh_range(lp, i); if(!my_infinite(lp, range) && (upLim + *fixvalue < lp->orig_rhs[i]-range-tolgap)) { if(*fixvalue > 0) presolve_setstatus(psdata, INFEASIBLE); *fixvalue = 0; break; } /* Check if we have to fix the value at 1 to avoid constraint infeasibility */ if(psdata->rows->infcount[i] >= 1) continue; if(((*fixvalue < 0) && (upLim + *fixvalue >= loLim-tolgap) && (upLim > lp->orig_rhs[i]+tolgap)) || ((*fixvalue > 0) && (loLim + *fixvalue <= upLim+tolgap) && (loLim < lp->orig_rhs[i]-range-tolgap) && !my_infinite(lp, range))) { *fixvalue = 1; break; } } status = (MYBOOL) (ix >= 0); /* Returns TRUE if fixing opportunity was identified */ return( status ); } #endif STATIC int presolve_probetighten01(presolverec *psdata, int colnr) { lprec *lp = psdata->lp; MYBOOL chsign; int i, ix, item, n = 0; REAL upLim, value, absvalue, epsvalue = psdata->epsvalue; MATrec *mat = lp->matA; #if 0 /* Handled in calling routine */ if(!is_binary(lp, colnr)) return( n ); #endif /* Loop over all active rows and do coefficient tightening for qualifying constraints */ item = 0; for(ix = presolve_nextrow(psdata, colnr, &item); ix >= 0; ix = presolve_nextrow(psdata, colnr, &item)) { i = COL_MAT_ROWNR(ix); value = COL_MAT_VALUE(ix); chsign = is_chsign(lp, i); upLim = presolve_sumplumin(lp, i, psdata->rows, (MYBOOL) !chsign); upLim = my_chsign(chsign, upLim); /* Does this constraint qualify for coefficient tightening? */ absvalue = fabs(value); if(upLim - absvalue < lp->orig_rhs[i]-epsvalue*MAX(1, absvalue)) { REAL delta = lp->orig_rhs[i] - upLim; lp->orig_rhs[i] = upLim; upLim = value - my_chsign(value < 0, delta); COL_MAT_VALUE(ix) = upLim; if(my_sign(value) != my_sign(upLim)) { if(chsign) { psdata->rows->negcount[i]--; psdata->rows->plucount[i]++; } else { psdata->rows->negcount[i]++; psdata->rows->plucount[i]--; } } n++; } } return( n ); } STATIC int presolve_mergerows(presolverec *psdata, int *nRows, int *nSum) { lprec *lp = psdata->lp; MYBOOL candelete; int status = RUNNING, item1, item2, firstix, RT1, RT2, i, ix, iix, j, jjx, n = 0; REAL Value1, Value2, bound; MATrec *mat = lp->matA; for(i = lastActiveLink(psdata->rows->varmap); (i > 0) && (status == RUNNING); ) { /* First scan for rows with identical row lengths */ ix = prevActiveLink(psdata->rows->varmap, i); if(ix == 0) break; /* Don't bother about empty rows or row singletons, since they are handled by PRESOLVE_ROWS */ j = presolve_rowlength(psdata, i); if(j <= 1) { i = ix; continue; } #if 0 /* Enable this to scan all rows back */ RT2 = lp->rows; /* Check abort since this section can be pretty "expensive" */ if(!presolve_statuscheck(psdata, &status)) return( status ); #else RT2 = 2+1; #endif firstix = ix; for(RT1 = 0; (ix > 0) && (RT1 < RT2) && (status == RUNNING); ix = prevActiveLink(psdata->rows->varmap, ix), RT1++) { candelete = FALSE; if(presolve_rowlength(psdata, ix) != j) continue; /* Check if the beginning columns are identical; if not, continue */ item1 = 0; iix = presolve_nextcol(psdata, ix, &item1); item2 = 0; jjx = presolve_nextcol(psdata, i, &item2); if(ROW_MAT_COLNR(iix) != ROW_MAT_COLNR(jjx)) continue; /* We have a candidate row; check if the entries have a fixed non-zero ratio */ Value1 = get_mat_byindex(lp, iix, TRUE, FALSE); Value2 = get_mat_byindex(lp, jjx, TRUE, FALSE); bound = Value1 / Value2; Value1 = bound; /* Loop over remaining entries */ jjx = presolve_nextcol(psdata, i, &item2); for(; (jjx >= 0) && (Value1 == bound); jjx = presolve_nextcol(psdata, i, &item2)) { iix = presolve_nextcol(psdata, ix, &item1); if(ROW_MAT_COLNR(iix) != ROW_MAT_COLNR(jjx)) break; Value1 = get_mat_byindex(lp, iix, TRUE, FALSE); Value2 = get_mat_byindex(lp, jjx, TRUE, FALSE); /* If the ratio is different from the reference value we have a mismatch */ Value1 = Value1 / Value2; if(bound == lp->infinite) bound = Value1; else if(fabs(Value1 - bound) > psdata->epsvalue) break; } /* Check if we found a match (we traversed all active columns without a break) */ if(jjx < 0) { /* Get main reference values */ Value1 = lp->orig_rhs[ix]; Value2 = lp->orig_rhs[i] * bound; /* First check for inconsistent equalities */ if((fabs(Value1 - Value2) > psdata->epsvalue) && ((get_constr_type(lp, ix) == EQ) && (get_constr_type(lp, i) == EQ))) { report(lp, NORMAL, "presolve_mergerows: Inconsistent equalities %d and %d found\n", ix, i); status = presolve_setstatus(psdata, INFEASIBLE); } else { /* Update lower and upper bounds */ if(is_chsign(lp, i) != is_chsign(lp, ix)) bound = -bound; Value1 = get_rh_lower(lp, i); if(Value1 <= -lp->infinite) Value1 *= my_sign(bound); else Value1 *= bound; my_roundzero(Value1, lp->epsdual); /* Extra rounding tolerance *** */ Value2 = get_rh_upper(lp, i); if(Value2 >= lp->infinite) Value2 *= my_sign(bound); else Value2 *= bound; my_roundzero(Value2, lp->epsdual); /* Extra rounding tolerance *** */ if((bound < 0)) swapREAL(&Value1, &Value2); bound = get_rh_lower(lp, ix); if(Value1 > bound + psdata->epsvalue) set_rh_lower(lp, ix, Value1); else Value1 = bound; bound = get_rh_upper(lp, ix); if(Value2 < bound - psdata->epsvalue) set_rh_upper(lp, ix, Value2); else Value2 = bound; /* Check results and make equality if appropriate */ if(fabs(Value2-Value1) < psdata->epsvalue) presolve_setEQ(psdata, ix); else if(Value2 < Value1) { status = presolve_setstatus(psdata, INFEASIBLE); } /* Verify if we can continue */ candelete = (MYBOOL) (status == RUNNING); if(!candelete) { report(lp, NORMAL, "presolve: Range infeasibility found involving rows %s and %s\n", get_row_name(lp, ix), get_row_name(lp, i)); } } } /* Perform i-row deletion if authorized */ if(candelete) { presolve_rowremove(psdata, i, TRUE); n++; break; } } i = firstix; } (*nRows) += n; (*nSum) += n; return( status ); } STATIC MYBOOL presolve_reduceGCD(presolverec *psdata, int *nn, int *nb, int *nsum) { lprec *lp = psdata->lp; MYBOOL status = TRUE; int i, jx, je, in = 0, ib = 0; LLONG GCDvalue; REAL *Avalue, Rvalue, epsvalue = psdata->epsvalue; MATrec *mat = lp->matA; for(i = firstActiveLink(psdata->INTmap); i != 0; i = nextActiveLink(psdata->INTmap, i)) { /* Obtain the row GCD */ jx = mat->row_end[i - 1]; je = mat->row_end[i]; Rvalue = ROW_MAT_VALUE(jx); GCDvalue = abs((int) Rvalue); jx++; if(jx < je) for(; (jx < je) && (GCDvalue > 1); jx++) { Rvalue = fabs(ROW_MAT_VALUE(jx)); GCDvalue = gcd((LLONG) Rvalue, GCDvalue, NULL, NULL); } /* Reduce the coefficients, if possible */ if(GCDvalue > 1) { jx = mat->row_end[i - 1]; je = mat->row_end[i]; for(; jx < je; jx++) { Avalue = &ROW_MAT_VALUE(jx); *Avalue /= GCDvalue; in++; } Rvalue = (lp->orig_rhs[i] / GCDvalue) + epsvalue; lp->orig_rhs[i] = floor(Rvalue); Rvalue = fabs(lp->orig_rhs[i]-Rvalue); if(is_constr_type(lp, i, EQ) && (Rvalue > epsvalue)) { report(lp, NORMAL, "presolve_reduceGCD: Infeasible equality constraint %d\n", i); status = FALSE; break; } if(!my_infinite(lp, lp->orig_upbo[i])) lp->orig_upbo[i] = floor(lp->orig_upbo[i] / GCDvalue); ib++; } } if(status && (in > 0)) report(lp, DETAILED, "presolve_reduceGCD: Did %d constraint coefficient reductions.\n", in); (*nn) += in; (*nb) += ib; (*nsum) += in + ib; return( status ); } STATIC int presolve_knapsack(presolverec *psdata, int *nn) { lprec *lp = psdata->lp; int m, n, i, ix, j, jx, colnr, *rownr = NULL, status = RUNNING; REAL *colOF = lp->orig_obj, value, *ratio = NULL; LLrec *map = psdata->EQmap; MATrec *mat = lp->matA; /* Check if it is worth trying */ m = mat->row_end[0]; if((map->count == 0) || (m < 2)) return( status ); /* Get the OF row */ allocINT(lp, &rownr, map->count+1, FALSE); allocREAL(lp, &ratio, map->count+1, FALSE); /* Loop over each row trying to find equal entries in the OF */ rownr[0] = 0; for(i = firstActiveLink(map); i != 0; i = nextActiveLink(map, i)) { if(get_rh(lp, i) <= 0) continue; jx = mat->row_end[i]; n = 0; for(j = mat->row_end[i-1]; j < jx; j++, n++) { colnr = ROW_MAT_COLNR(j); value = ROW_MAT_VALUE(j); if(colOF[colnr] == 0) break; if(n == 0) { ratio[0] = colOF[colnr] / value; } else if(fabs(value * ratio[0] - colOF[colnr]) > psdata->epsvalue) { n = -1; break; } } /* Register row if we were successful (and row long enough) */ if(n >= 2) { ix = ++rownr[0]; rownr[ix] = i; ratio[ix] = ratio[0]; } } n = rownr[0]; if(n == 0) goto Finish; /* Process the identified rows, eliminating the OF value */ for(ix = 1; ix <= n; ix++) { i = rownr[ix]; jx = mat->row_end[i]; for(j = mat->row_end[i-1]; j < jx; j++) { colnr = ROW_MAT_COLNR(j); colOF[colnr] = 0; } } /* Update key mapper structures */ j = lp->columns; psdata->cols->varmap = cloneLink(psdata->cols->varmap, j+n, TRUE); psdata->forceupdate = TRUE; /* Finally, add helper columns */ for(ix = 1; ix <= n; ix++) { i = rownr[ix]; rownr[0] = 0; colOF[0] = my_chsign(is_maxim(lp), ratio[ix]); rownr[1] = i; colOF[1] = -1; value = get_rh(lp, i); /* j = get_constr_type(lp, i); */ add_columnex(lp, 2, colOF, rownr); set_bounds(lp, lp->columns, value, value); /* presolve_setEQ(psdata, i); */ set_rh(lp, i, 0); appendLink(psdata->cols->varmap, j+ix); } presolve_validate(psdata, TRUE); /* Clean up before returning */ Finish: FREE(rownr); FREE(ratio); (*nn) += n; return( status ); } STATIC MYBOOL presolve_invalideq2(lprec *lp, presolverec *psdata) { int jx, jjx, i = 0, item; MATrec *mat = lp->matA; MYBOOL error = FALSE; do { if(i == 0) i = firstActiveLink(psdata->EQmap); else i = nextActiveLink(psdata->EQmap, i); if(i == 0) return( error ); /* Get the row index of the first 2-element equality */ for(; i > 0; i = nextActiveLink(psdata->EQmap, i)) if(presolve_rowlength(psdata, i) == 2) break; if(i == 0) return( error ); /* Get the first column */ item = 0; jx = presolve_nextcol(psdata, i, &item); if(jx < 0) error = TRUE; jx = ROW_MAT_COLNR(jx); /* Get the second column */ jjx = presolve_nextcol(psdata, i, &item); if(jjx < 0) error = AUTOMATIC; } while(!error); return( error ); } /* Callback to obtain the non-zero rows of equality constraints */ int BFP_CALLMODEL presolve_getcolumnEQ(lprec *lp, int colnr, REAL nzvalues[], int nzrows[], int mapin[]) { int i, ib, ie, nn = 0; MATrec *mat = lp->matA; ib = mat->col_end[colnr-1]; ie = mat->col_end[colnr]; for(; ib < ie; ib++) { i = COL_MAT_ROWNR(ib); if(!is_constr_type(lp, i, EQ) || /* It has to be an equality constraint */ (mapin[i] == 0)) /* And it should not already have been deleted */ continue; if(nzvalues != NULL) { nzrows[nn] = mapin[i]; nzvalues[nn] = COL_MAT_VALUE(ib); } nn++; } return( nn ); } STATIC int presolve_singularities(presolverec *psdata, int *nn, int *nr, int *nv, int *nSum) { lprec *lp = psdata->lp; int i, j, n, *rmapin = NULL, *rmapout = NULL, *cmapout = NULL; if(lp->bfp_findredundant(lp, 0, NULL, NULL, NULL) == 0) return( 0 ); /* Create condensed row map */ allocINT(lp, &rmapin, lp->rows+1, TRUE); allocINT(lp, &rmapout, psdata->EQmap->count+1, FALSE); allocINT(lp, &cmapout, lp->columns+1, FALSE); n = 0; for(i = firstActiveLink(psdata->EQmap); i != 0; i = nextActiveLink(psdata->EQmap, i)) { n++; rmapout[n] = i; rmapin[i] = n; } rmapout[0] = n; n = 0; for(i = firstActiveLink(psdata->cols->varmap); i != 0; i = nextActiveLink(psdata->cols->varmap, i)) { n++; cmapout[n] = i; } cmapout[0] = n; /* Do the rank-revealing factorization */ n = lp->bfp_findredundant(lp, psdata->EQmap->count, presolve_getcolumnEQ, rmapin, cmapout); /* Delete the redundant rows */ for(i = 1; i <= n; i++) { j = rmapin[i]; j = rmapout[j]; presolve_rowremove(psdata, j, TRUE); } (*nn) += n; (*nr) += n; (*nSum) += n; /* Clean up */ FREE(rmapout); FREE(rmapin); FREE(cmapout); return( n ); } STATIC int presolve_elimeq2(presolverec *psdata, int *nn, int *nr, int *nc, int *nSum) { lprec *lp = psdata->lp; int n, i, jx, jjx, k, item, *plucount, *negcount, colplu, colneg, iCoeffChanged = 0, iRowsRemoved = 0, iVarsFixed = 0, nrows = lp->rows, status = RUNNING, *colindex = NULL; MYBOOL freshupdate; REAL Coeff1, Coeff2, Value1, Value2, lobound, upbound, bound, test, product, *colvalue = NULL, *delvalue = NULL, *colitem; MATrec *mat = lp->matA, *rev = NULL; DeltaVrec *DV = NULL; LLrec *EQ2 = NULL; /* See if there is anything to do */ if(psdata->EQmap->count == 0) { (*nSum) = 0; return( status ); } /* Tally counts */ createLink(lp->rows, &EQ2, NULL); if((EQ2 == NULL) || !allocREAL(lp, &colvalue, nrows+1, FALSE) || !allocREAL(lp, &delvalue, nrows+1, FALSE)) goto Finish; for(i = firstActiveLink(psdata->EQmap); i > 0; i = nextActiveLink(psdata->EQmap, i)) { if(presolve_rowlength(psdata, i) == 2) appendLink(EQ2, i); } if(EQ2->count == 0) goto Finish; n = 0; /* Do the elimination loop for all identified 2-element equalities */ for(i = firstActiveLink(EQ2); i > 0; i = nextActiveLink(EQ2, i)) { /* Check if the constraint has been modified by a previous elimination */ if(presolve_rowlength(psdata, i) != 2) continue; /* Get the column indeces of NZ-values of the "pivot" row */ item = 0; jx = presolve_nextcol(psdata, i, &item); /* Eliminated variable coefficient b */ #ifdef Paranoia if(jx < 0) report(lp, SEVERE, "presolve_elimeq2: No qualifying %dst column was found in row %s (ostensible length %d)\n", 1, get_row_name(lp, i), presolve_rowlength(psdata, i)); #endif Coeff2 = ROW_MAT_VALUE(jx); jx = ROW_MAT_COLNR(jx); jjx = presolve_nextcol(psdata, i, &item); /* Non-eliminated variable coefficient a */ #ifdef Paranoia if(jjx < 0) report(lp, SEVERE, "presolve_elimeq2: No qualifying %dnd column was found in row %s (ostensible length %d)\n", 2, get_row_name(lp, i), presolve_rowlength(psdata, i)); #endif Coeff1 = ROW_MAT_VALUE(jjx); jjx = ROW_MAT_COLNR(jjx); /* Check if at least one of the coefficients is large enough to preserve stability; use opposing maximum column values for stability testing. */ if((fabs(Coeff1) < psdata->epspivot*mat->colmax[jx]) && ((fabs(Coeff1) != 1) && (fabs(Coeff2) != 1)) && (fabs(Coeff2) < psdata->epspivot*mat->colmax[jjx])) continue; /* Cannot eliminate a variable if both are SOS members or SC variables */ if((is_semicont(lp, jx) && is_semicont(lp, jjx)) || (SOS_is_member(lp->SOS, 0, jx) && SOS_is_member(lp->SOS, 0, jjx))) continue; /* First check if we are allowed to swap; set swap "blockers" */ k = 0; if(!is_int(lp, jx) && is_int(lp, jjx)) k += 1; else if(!is_semicont(lp, jx) && is_semicont(lp, jjx)) k += 2; else if(!SOS_is_member(lp->SOS, 0, jx) && SOS_is_member(lp->SOS, 0, jjx)) k += 4; /* If there were no blockers, determine if we MUST swap the variable to be eliminated */ if(k == 0) { if(is_int(lp, jx) && !is_int(lp, jjx)) k += 8; else if(is_semicont(lp, jx) && !is_semicont(lp, jjx)) k += 16; else if(SOS_is_member(lp->SOS, 0, jx) && !SOS_is_member(lp->SOS, 0, jjx)) k += 32; /* If we are not forced to swap, decide if it otherwise makes sense - high order */ if(k == 0) { if((fabs(Coeff2) < psdata->epspivot*mat->colmax[jjx]) && (fabs(Coeff1) > psdata->epspivot*mat->colmax[jx])) k += 64; else if(presolve_collength(psdata, jx) > presolve_collength(psdata, jjx)) k += 128; } /* If we are not forced to swap, decide if it otherwise makes sense - low order */ if(k == 0) { Value2 = Coeff1/Coeff2; #ifdef DualFeasibilityLogicEQ2 if((Value2*lp->orig_obj[jx] < 0) && (Value2*lp->orig_obj[jjx] > 0)) /* Seek increased dual feasibility */ k += 256; #endif #ifdef DivisorIntegralityLogicEQ2 if((fabs(modf(Coeff2, &Value2)) >= lp->epsvalue) && /* Seek integrality of result */ (fabs(modf(Coeff1, &Value2)) < lp->epsvalue)) k += 512; else if((fabs(fabs(Coeff2)-1) >= lp->epsvalue) && /* Seek integrality of divisor */ (fabs(fabs(Coeff1)-1) < lp->epsvalue)) k += 1024; #endif } } else k = 0; /* Perform variable index swap if indicated */ if(k != 0) { swapINT(&jx, &jjx); swapREAL(&Coeff1, &Coeff2); } Value1 = lp->orig_rhs[i]/Coeff2; /* Delta constant term */ Value2 = Coeff1/Coeff2; /* Delta variable term */ upbound = lp->orig_upbo[lp->rows+jx]; lobound = lp->orig_lowbo[lp->rows+jx]; if(lp->spx_trace) { report(lp, DETAILED, "Row %3d : Elim %g %s - %d\n", i, Coeff2, get_col_name(lp, jx), jx); report(lp, DETAILED, " Keep %g %s - %d\n", Coeff1, get_col_name(lp, jjx), jjx); } /* Get the coefficient vectors of the independent (jjx) and dependent (jx) columns; the dependent column will be deleted and reconstructed during postsolve. */ freshupdate = (MYBOOL) ((colindex == NULL) || (colindex[jjx] == 0)); if(freshupdate) mat_expandcolumn(mat, jjx, colvalue, NULL, TRUE); else mat_expandcolumn(rev, colindex[jjx], colvalue, NULL, FALSE); if((colindex == NULL) || (colindex[jx] == 0)) mat_expandcolumn(mat, jx, delvalue, NULL, TRUE); else mat_expandcolumn(rev, colindex[jx], delvalue, NULL, FALSE); /* Add variable reconstruction information */ addUndoPresolve(lp, TRUE, jx, Value1, Value2, jjx); /* If possible, tighten the bounds of the uneliminated variable based on the bounds of the eliminated variable. Also handle roundings and attempt precision management. */ bound = lobound; k = nrows+jjx; if(bound > -lp->infinite) { bound = (lp->orig_rhs[i] - Coeff2*bound) / Coeff1; if(Value2 > 0) { test = lp->orig_upbo[k]; if(bound < test - psdata->epsvalue) { if(is_int(lp, jjx)) lp->orig_upbo[k] = floor(bound + lp->epsint); else lp->orig_upbo[k] = presolve_roundrhs(lp, bound, FALSE); } } else { test = lp->orig_lowbo[k]; if(bound > test + psdata->epsvalue) { if(is_int(lp, jjx)) lp->orig_lowbo[k] = ceil(bound - lp->epsint); else lp->orig_lowbo[k] = presolve_roundrhs(lp, bound, TRUE); } } } bound = upbound; if(bound < lp->infinite) { bound = (lp->orig_rhs[i] - Coeff2*bound) / Coeff1; if(Value2 < 0) { test = lp->orig_upbo[k]; if(bound < test - psdata->epsvalue) { if(is_int(lp, jjx)) lp->orig_upbo[k] = floor(bound + lp->epsint); else lp->orig_upbo[k] = presolve_roundrhs(lp, bound, FALSE); } } else { test = lp->orig_lowbo[k]; if(bound > test + psdata->epsvalue) { if(is_int(lp, jjx)) lp->orig_lowbo[k] = ceil(bound - lp->epsint); else lp->orig_lowbo[k] = presolve_roundrhs(lp, bound, TRUE); } } } #ifdef Eq2Reldiff test = 2*lp->epsvalue; #else test = psdata->epsvalue; #endif if(/*(lp->orig_upbo[k] < lp->orig_lowbo[k]) ||*/ #ifdef Eq2Reldiff (fabs(my_reldiff(lp->orig_upbo[k],lp->orig_lowbo[k])) < test)) { #else (fabs(lp->orig_upbo[k] - lp->orig_lowbo[k]) < test)) { #endif my_roundzero(lp->orig_lowbo[k], test); lp->orig_upbo[k] = lp->orig_lowbo[k]; } else { my_roundzero(lp->orig_upbo[k], test); my_roundzero(lp->orig_lowbo[k], test); } if(/*(upbound < lobound) ||*/ #ifdef Eq2Reldiff (fabs(my_reldiff(upbound, lobound)) < test)) { #else (fabs(upbound - lobound) < test)) { #endif my_roundzero(lobound, test); lp->orig_upbo[nrows+jx] = lobound; upbound = lobound; } /* Loop over the non-zero rows of the column (jx) to be eliminated; substitute jx-variable by updating rhs and jjx coefficients */ colitem = colvalue; plucount = psdata->rows->plucount; negcount = psdata->rows->negcount; colplu = 0; colneg = 0; /* Count of non-zeros in the independent column jjx */ item = presolve_collength(psdata, jjx) - 1; if(isnz_origobj(lp, jjx)) item++; for(k = 0; k <= nrows; k++, colitem++) { bound = delvalue[k]; if((k == i) || (bound == 0) || ((k > 0) && !isActiveLink(psdata->rows->varmap, k))) continue; /* Do constraint and nz-count updates for the substituted variable */ product = bound*Value1; /* "Raw"/unsigned data */ presolve_adjustrhs(psdata, k, my_chsign(is_chsign(lp, k), product), test); /* Change back to signed part */ if(*colitem != 0) { if(*colitem > 0) { colplu--; plucount[k]--; } else { colneg--; negcount[k]--; } if((lobound < 0) && (upbound >= 0)) { psdata->cols->pluneg[jjx]--; psdata->rows->pluneg[k]--; } item--; } (*colitem) -= bound*Value2; iCoeffChanged++; /* Update counts */ if(fabs(*colitem) >= mat->epsvalue) { if(*colitem > 0) { colplu++; plucount[k]++; } else { colneg++; negcount[k]++; } if((lobound < 0) && (upbound >= 0)) { psdata->cols->pluneg[jjx]++; psdata->rows->pluneg[k]++; } item++; } else { *colitem = 0; } /* Also reduce count if the row contains the deleted variable */ if(bound > 0) plucount[k]--; else negcount[k]--; } psdata->cols->plucount[jjx] += colplu; psdata->cols->negcount[jjx] += colneg; /* Save the new column */ if(rev == NULL) { DV = createUndoLadder(lp, nrows, lp->columns / RESIZEFACTOR); rev = DV->tracker; rev->epsvalue = mat->epsvalue; allocINT(lp, &(rev->col_tag), mat->columns_alloc+1, FALSE); allocINT(lp, &colindex, lp->columns+1, TRUE); rev->col_tag[0] = 0; } n = rev->col_tag[0] = incrementUndoLadder(DV); mat_setcol(rev, n, 0, colvalue, NULL, FALSE, FALSE); rev->col_tag[n] = jjx; /* Save index to updated vector, but specially handle case where we have the same independent variable for multiple equations! */ if(!freshupdate) rev->col_tag[colindex[jjx]] *= -1; colindex[jjx] = n; /* Delete the column dependent variable */ jx = presolve_colremove(psdata, jx, FALSE); iVarsFixed++; /* Check if we have been lucky enough to have eliminated the independent variable via substitution of the dependent variable */ if(item == 0) { #ifdef Paranoia report(lp, DETAILED, "presolve_elimeq2: Was able to remove variables %d and %d in row %s\n", jx, jjx, get_row_name(lp, i)); #endif if(presolve_colfix(psdata, jjx, 0.0, TRUE, nc)) jjx = presolve_colremove(psdata, jjx, FALSE); } /* Delete the row */ presolve_rowremove(psdata, i, FALSE); iRowsRemoved++; } /* Perform the column updates collected above */ if(n > 0) { mat_mapreplace(mat, psdata->rows->varmap, psdata->cols->varmap, rev); presolve_validate(psdata, TRUE); #ifdef PresolveForceUpdateMax mat_computemax(mat /* , FALSE */); #endif psdata->forceupdate = TRUE; } /* Free work arrays */ Finish: if(DV != NULL) freeUndoLadder(&DV); freeLink(&EQ2); FREE(colvalue); FREE(delvalue); FREE(colindex); /* Update counters */ (*nn) += iCoeffChanged; (*nr) += iRowsRemoved; (*nc) += iVarsFixed; (*nSum) += iCoeffChanged + iRowsRemoved + iVarsFixed; return( status ); } STATIC MYBOOL presolve_impliedfree(lprec *lp, presolverec *psdata, int colnr) { int i, ix, ie; REAL Tlower, Tupper; MYBOOL status, rowbinds, isfree = FALSE; MATrec *mat = lp->matA; if(my_infinite(lp, get_lowbo(lp, colnr)) && my_infinite(lp, get_upbo(lp, colnr))) return( TRUE ); ie = mat->col_end[colnr]; for(ix = mat->col_end[colnr-1]; (isfree != (TRUE | AUTOMATIC)) && (ix < ie); ix++) { i = COL_MAT_ROWNR(ix); if(!isActiveLink(psdata->rows->varmap, i)) continue; Tlower = get_rh_lower(lp, i); Tupper = get_rh_upper(lp, i); status = presolve_multibounds(psdata, i, colnr, &Tlower, &Tupper, NULL, &rowbinds); isfree = isfree | status | rowbinds; } return( (MYBOOL) (isfree == (TRUE | AUTOMATIC)) ); } STATIC MYBOOL presolve_impliedcolfix(presolverec *psdata, int rownr, int colnr, MYBOOL isfree) { lprec *lp = psdata->lp; MYBOOL signflip, undoadded = FALSE; MATrec *mat = lp->matA; int jx, i, ib, ie = mat->row_end[rownr]; REAL varLo = 0, varHi = 0, varRange, conRange = 0, matValue = 0, dual, RHS = lp->orig_rhs[rownr], pivot, matAij = mat_getitem(mat, rownr, colnr), *vecOF = lp->orig_obj; /* We cannot have semi-continuous or non-qualifying integers */ if(is_semicont(lp, colnr) || is_SOS_var(lp, colnr)) return( FALSE ); if(is_int(lp, colnr)) { if(!isActiveLink(psdata->INTmap, rownr) || !is_presolve(lp, PRESOLVE_KNAPSACK)) return( FALSE ); /* colnr must have a coefficient equal to the smallest in the row */ varRange = lp->infinite; i = 0; pivot = 0; for(ib = presolve_nextcol(psdata, rownr, &i); i != 0; ib = presolve_nextcol(psdata, rownr, &i)) { jx = ROW_MAT_COLNR(ib); dual = fabs(ROW_MAT_VALUE(ib)); /* Check if we have the target column and save the pivot value */ if(jx == colnr) { /* Always accept unit coefficient */ if(fabs(dual - 1) < psdata->epsvalue) break; pivot = dual; /* Otherwise continue scan */ } /* Cannot accept case where result can be fractional */ else if((pivot > dual + psdata->epsvalue) || ((pivot > 0) && (fabs(fmod(dual, pivot)) > psdata->epsvalue))) return( FALSE ); } } /* Ascertain that the pivot value is large enough to preserve stability */ pivot = matAij; if(fabs(pivot) < psdata->epspivot*mat->colmax[colnr]) return( FALSE ); /* Must ascertain that the row variables are not SOS'es; this is because the eliminated variable will be a function of another variable. */ if(SOS_count(lp) > 0) { for(ib = mat->row_end[rownr-1]; ib < ie; ib++) if(SOS_is_member(lp->SOS, 0, ROW_MAT_COLNR(ib))) return( FALSE ); } /* Calculate the dual value */ dual = vecOF[colnr]/pivot; /* Here we have free variable in an equality constraint; this means we can can adjust the OF for the deleted variable and also delete the constraint. */ if(isfree && is_constr_type(lp, rownr, EQ)) { matValue = RHS/pivot; if(matValue != 0) undoadded = addUndoPresolve(lp, TRUE, colnr, matValue, 0.0, 0); } else { /* IMPLIEDFREE: For simplicity, ensure that we can keep the slack based at 0, and not its upper bound. Effectively, we consider the constraint an equality, using the information of the sign of the dual. IMPLIEDSLK: Since we already have an equality constraint, we wish to make sure that the ensuing inequality constraint will have an RHS that is non-infinite. */ if(isfree) { SETMIN(RHS, presolve_sumplumin(lp, rownr, psdata->rows, TRUE)); matValue = presolve_sumplumin(lp, rownr, psdata->rows, FALSE); conRange = get_rh_lower(lp, rownr); conRange = RHS - MAX(matValue, conRange); signflip = (MYBOOL) ((dual > 0) && !my_infinite(lp, conRange)); } else { varLo = get_lowbo(lp, colnr); varLo *= (my_infinite(lp, varLo) ? my_sign(pivot) : pivot); varHi = get_upbo(lp, colnr); varHi *= (my_infinite(lp, varHi) ? my_sign(pivot) : pivot); if(pivot < 0) swapREAL(&varHi, &varLo); signflip = my_infinite(lp, varLo); } if(signflip) { mat_multrow(mat, rownr, -1); RHS -= conRange; RHS = -RHS; lp->orig_rhs[rownr] = RHS; pivot = -pivot; dual = -dual; if(!isfree) { varLo = -varLo; varHi = -varHi; swapREAL(&varHi, &varLo); } } matValue = RHS/pivot; /* Prepare for deleting free or implied free variable in inequality constraint. Different strategies need to be used: ACTUAL: Find the proper constraint bound and store undo information for recovering the value of the implied free variable. The constraint is then deleted. We have to adjust the objective function if the OF coefficient for the implied free variable is non-zero. IMPLIED: Convert the constraint to an inequality at the proper bound. For given models, the new equality constraint can later provide an implied slack, which means that a further variable is eliminated, and the constraint again becomes an inequality constraint. Note that this version only implements the ACTUAL mode */ if(isfree) { /* Add undo information connecting the deleted variable to the RHS */ if(matValue != 0) undoadded = addUndoPresolve(lp, TRUE, colnr, matValue, 0.0, 0); /* Add undo information for the dual of the deleted constraint */ if(dual != 0) addUndoPresolve(lp, FALSE, rownr, dual, 0.0, 0); } /* Prepare for deleting implied slack variable. The following two cases are handled: 1. Equality constraint: Convert the constraint to an inequality constraint that is possibly ranged 2. Other constraints: Expand existing slack variable / constraint range, if required. */ else { if(my_infinite(lp, varHi)) varRange = lp->infinite; #ifdef Paranoia else if(my_infinite(lp, varLo)) { report(lp, SEVERE, "presolve_impliedcolfix: Negative infinite limit for variable %d\n", colnr); varRange = lp->infinite; } #endif else varRange = my_precision(fabs(varHi - varLo) + lp->epsvalue, psdata->epsvalue); presolve_adjustrhs(psdata, rownr, varLo, psdata->epsvalue); /* Handle case 1 of an equality constraint */ if(is_constr_type(lp, rownr, EQ)) { /* Make sure we actually have a ranged constraint */ if(varRange > 0) { set_constr_type(lp, rownr, LE); if(!my_infinite(lp, varRange)) lp->orig_upbo[rownr] = varRange; setLink(psdata->LTmap, rownr); removeLink(psdata->EQmap, rownr); } } /* Handle case 2 of an inequality constraint (UNDER CONSTRUCTION!)*/ else { if(!my_infinite(lp, lp->orig_upbo[rownr])) { if(my_infinite(lp, varRange)) lp->orig_upbo[rownr] = lp->infinite; else lp->orig_upbo[rownr] += varHi - varLo; } } /* Update counts */ if(matAij > 0) psdata->rows->plucount[rownr]--; else psdata->rows->negcount[rownr]--; if(my_sign(varLo) != my_sign(varHi)) psdata->rows->pluneg[rownr]--; /* Add undo information for the deleted variable; note that we cannot link the deleted variable to the slack, since it may not be available during undo. We really should have a mini LP to compute this allocation ex-post. */ if(RHS != 0) undoadded = addUndoPresolve(lp, TRUE, colnr, RHS/pivot, 0.0, 0); } } /* Update the OF constant */ if(dual != 0) { presolve_adjustrhs(psdata, 0, dual * RHS, 0); /* lp->orig_rhs[0] -= dual * RHS; */ vecOF[colnr] = 0; } /* Do affine transformation with the constraint row */ i = 0; for(ib = presolve_nextcol(psdata, rownr, &i); ib >= 0; ib = presolve_nextcol(psdata, rownr, &i)) { /* Get the constraint element */ jx = ROW_MAT_COLNR(ib); if(jx == colnr) continue; matValue = ROW_MAT_VALUE(ib); /* Adjust OF for the variable to be deleted */ if(dual != 0) vecOF[jx] -= dual * matValue; /* Add reconstruction/undo parameters for the deleted variable */ if(!undoadded) undoadded = addUndoPresolve(lp, TRUE, colnr, 0.0, matValue/pivot, jx); else appendUndoPresolve(lp, TRUE, matValue/pivot, jx); } return( TRUE ); } STATIC psrec *presolve_initpsrec(lprec *lp, int size) { psrec *ps = (psrec *) calloc(1, sizeof(*ps)); createLink(size, &ps->varmap, NULL); fillLink(ps->varmap); size++; allocINT(lp, &ps->empty, size, FALSE); ps->empty[0] = 0; allocREAL(lp, &ps->pluupper, size, FALSE); allocREAL(lp, &ps->negupper, size, FALSE); allocREAL(lp, &ps->plulower, size, FALSE); allocREAL(lp, &ps->neglower, size, FALSE); allocINT(lp, &ps->infcount, size, FALSE); ps->next = (int **) calloc(size, sizeof(*(ps->next))); allocINT(lp, &ps->plucount, size, TRUE); allocINT(lp, &ps->negcount, size, TRUE); allocINT(lp, &ps->pluneg, size, TRUE); ps->allocsize = size; return( ps ); } STATIC void presolve_freepsrec(psrec **ps) { FREE((*ps)->plucount); FREE((*ps)->negcount); FREE((*ps)->pluneg); FREE((*ps)->infcount); if((*ps)->next != NULL) { int i, n = (*ps)->allocsize; for(i = 0; i < n; i++) FREE((*ps)->next[i]); FREE((*ps)->next); } FREE((*ps)->plulower); FREE((*ps)->neglower); FREE((*ps)->pluupper); FREE((*ps)->negupper); FREE((*ps)->empty); freeLink(&(*ps)->varmap); FREE(*ps); } STATIC presolverec *presolve_init(lprec *lp) { int k, i, ix, ixx, colnr, ncols = lp->columns, nrows = lp->rows; REAL hold; MATrec *mat = lp->matA; presolverec *psdata = NULL; /* Optimize memory usage if we have a very large model; this is to reduce the risk of out-of-memory situations. */ ix = get_nonzeros(lp); ixx = lp->matA->mat_alloc; if((ixx - ix > MAT_START_SIZE) && ((ixx - ix) * 20 > ixx)) mat_memopt(lp->matA, nrows / 20, ncols / 20, ix / 20); psdata = (presolverec *) calloc(1, sizeof(*psdata)); psdata->lp = lp; psdata->rows = presolve_initpsrec(lp, nrows); psdata->cols = presolve_initpsrec(lp, ncols); psdata->epsvalue = PRESOLVE_EPSVALUE; psdata->epspivot = PRESOLVE_EPSPIVOT; psdata->forceupdate = TRUE; /* Save incoming primal bounds */ k = lp->sum + 1; allocREAL(lp, &psdata->pv_lobo, k, FALSE); MEMCOPY(psdata->pv_lobo, lp->orig_lowbo, k); allocREAL(lp, &psdata->pv_upbo, k, FALSE); MEMCOPY(psdata->pv_upbo, lp->orig_upbo, k); /* Create and initialize dual value (Langrangean and slack) limits */ allocREAL(lp, &psdata->dv_lobo, k, FALSE); allocREAL(lp, &psdata->dv_upbo, k, FALSE); for(i = 0; i <= nrows; i++) { psdata->dv_lobo[i] = (is_constr_type(lp, i, EQ) ? -lp->infinite : 0); psdata->dv_upbo[i] = lp->infinite; } k--; for(; i <= k; i++) { psdata->dv_lobo[i] = 0; psdata->dv_upbo[i] = lp->infinite; } /* Create NZ count and sign arrays, and do general initialization of row bounds */ createLink(nrows, &psdata->EQmap, NULL); createLink(nrows, &psdata->LTmap, NULL); createLink(nrows, &psdata->INTmap, NULL); for(i = 1; i <= nrows; i++) { switch (get_constr_type(lp, i)) { case LE: appendLink(psdata->LTmap, i); break; case EQ: appendLink(psdata->EQmap, i); break; } k = mat_rowlength(mat, i); if((lp->int_vars > 0) && (k > 0)) appendLink(psdata->INTmap, i); } /* Seek to reduce set of sum(INT*INT) rows (mainly for GCD coefficient reductions) */ if(psdata->INTmap->count > 0) for(i = 1; i <= nrows; i++) { if(!isActiveLink(psdata->INTmap, i)) continue; /* Disqualify if there is a non-int variable, otherwise find smallest absolute fractional row value */ ix = mat->row_end[i - 1]; ixx = mat->row_end[i]; colnr = 0; for(; ix < ixx; ix++) { if(!is_int(lp, ROW_MAT_COLNR(ix))) { removeLink(psdata->INTmap, i); break; } hold = fabs(ROW_MAT_VALUE(ix)); hold = fmod(hold, 1); /* Adjust colnr to be a decimal scalar */ for(k = 0; (k <= MAX_FRACSCALE) && (hold+psdata->epsvalue < 1); k++) hold *= 10; if(k > MAX_FRACSCALE) { removeLink(psdata->INTmap, i); break; } SETMAX(colnr, k); } if(!isActiveLink(psdata->INTmap, i)) continue; hold = pow(10.0, colnr); /* Also disqualify if the RHS is fractional after scaling */ if(fabs(fmod(lp->orig_rhs[i] * hold, 1)) > psdata->epsvalue) { removeLink(psdata->INTmap, i); continue; } /* We have an all-int constraint, see if we should scale it up */ if(k > 0) { ix = mat->row_end[i - 1]; for(; ix < ixx; ix++) { ROW_MAT_VALUE(ix) *= hold; } lp->orig_rhs[i] *= hold; if(!my_infinite(lp, lp->orig_upbo[i])) lp->orig_upbo[i] *= hold; /* KE: Fix due to Andy Loto - 20070619 */ } } /* Do the real tallying and ordering work */ presolve_validate(psdata, TRUE); return( psdata ); } STATIC void presolve_free(presolverec **psdata) { presolve_freepsrec(&(*psdata)->rows); presolve_freepsrec(&(*psdata)->cols); FREE((*psdata)->dv_lobo); FREE((*psdata)->dv_upbo); FREE((*psdata)->pv_lobo); FREE((*psdata)->pv_upbo); freeLink(&(*psdata)->EQmap); freeLink(&(*psdata)->LTmap); freeLink(&(*psdata)->INTmap); FREE(*psdata); } STATIC int presolve_makefree(presolverec *psdata) { lprec *lp = psdata->lp; int i, ix, j, nn = 0; REAL Xlower, Xupper, losum, upsum, lorhs, uprhs, freeinf = lp->infinite / 10; MATrec *mat = lp->matA; LLrec *colLL = NULL; /* First see if we can relax ranged constraints */ for(i = firstActiveLink(psdata->rows->varmap); i != 0; i = nextActiveLink(psdata->rows->varmap, i)) { if(is_constr_type(lp, i, EQ)) continue; presolve_range(lp, i, psdata->rows, &losum, &upsum); lorhs = get_rh_lower(lp, i); uprhs = get_rh_upper(lp, i); /* Look for opportunity to relax constraint bounds */ if(presolve_rowlength(psdata, i) > 1) { if((is_constr_type(lp, i, GE) && (upsum <= uprhs)) || (is_constr_type(lp, i, LE) && (losum >= lorhs))) set_rh_range(lp, i, lp->infinite); } } /* Collect columns available for bound relaxation (find implied free variables) (consider sorting the list in decending order of column lengths or do call to COLAMD to maximize impact) */ createLink(lp->columns, &colLL, NULL); for(j = firstActiveLink(psdata->cols->varmap); j != 0; j = nextActiveLink(psdata->cols->varmap, j)) if(presolve_impliedfree(lp, psdata, j)) appendLink(colLL, j); /* Find what columns to relax (ideally one per row) */ if(colLL->count > 0) { LLrec *rowLL = NULL; MYBOOL canfree; /* Create row tracker */ createLink(lp->rows, &rowLL, NULL); fillLink(rowLL); /* Loop over all column candidates */ for(j = firstActiveLink(colLL); (j > 0) && (rowLL->count > 0); j = nextActiveLink(colLL, j)) { /* Verify that the variable is applicable */ canfree = TRUE; for(ix = mat->col_end[j-1]; canfree && (ix < mat->col_end[j]); ix++) canfree = isActiveLink(rowLL, COL_MAT_ROWNR(ix)); /* If so, then open the bounds and update the row availability mapper */ if(canfree) { nn++; Xlower = get_lowbo(lp, j); Xupper = get_upbo(lp, j); if(Xlower >= 0) set_bounds(lp, j, 0, freeinf); else if(Xupper <= 0) set_bounds(lp, j, -freeinf, 0); else /* set_bounds(lo, j, -freeinf, freeinf); */ set_unbounded(lp, j); for(ix = mat->col_end[j-1]; ix < mat->col_end[j]; ix++) removeLink(rowLL, COL_MAT_ROWNR(ix)); } } freeLink(&rowLL); } /* Free list and return */ freeLink(&colLL); return( nn ); } STATIC MYBOOL presolve_updatesums(presolverec *psdata) { lprec *lp = psdata->lp; int j; /* Initialize row accumulation arrays */ MEMCLEAR(psdata->rows->pluupper, lp->rows + 1); MEMCLEAR(psdata->rows->negupper, lp->rows + 1); MEMCLEAR(psdata->rows->plulower, lp->rows + 1); MEMCLEAR(psdata->rows->neglower, lp->rows + 1); MEMCLEAR(psdata->rows->infcount, lp->rows + 1); /* Loop over active columns */ for(j = firstActiveLink(psdata->cols->varmap); j != 0; j = nextActiveLink(psdata->cols->varmap, j)) { presolve_colfix(psdata, j, lp->infinite, FALSE, NULL); } #ifdef UseDualPresolve /* Initialize column accumulation arrays */ MEMCLEAR(psdata->cols->pluupper, lp->columns + 1); MEMCLEAR(psdata->cols->negupper, lp->columns + 1); MEMCLEAR(psdata->cols->plulower, lp->columns + 1); MEMCLEAR(psdata->cols->neglower, lp->columns + 1); MEMCLEAR(psdata->cols->infcount, lp->columns + 1); /* Loop over active rows */ for(j = firstActiveLink(psdata->rows->varmap); j != 0; j = nextActiveLink(psdata->rows->varmap, j)) { presolve_rowfix(psdata, j, lp->infinite, FALSE, NULL); } #endif return( TRUE ); } STATIC MYBOOL presolve_finalize(presolverec *psdata) { lprec *lp = psdata->lp; MYBOOL compactvars = FALSE; int ke, n; /* Save eliminated rows and columns for restoration purposes */ #ifdef SavePresolveEliminated psdata->deletedA = mat_extractmat(lp->matA, rowmap, colmap, TRUE); if(!mat_validate(psdata->deletedA)) report(lp, SEVERE, "presolve_finalize: Could not validate matrix with undo data\n"); #endif /* Check if OF columns are to be deleted */ lp->presolve_undo->OFcolsdeleted = FALSE; for(n = firstInactiveLink(psdata->cols->varmap); (n != 0) && !lp->presolve_undo->OFcolsdeleted; n = nextInactiveLink(psdata->cols->varmap, n)) lp->presolve_undo->OFcolsdeleted = (MYBOOL) (lp->orig_obj[n] != 0); /* Delete eliminated columns */ ke = lastInactiveLink(psdata->cols->varmap); n = countInactiveLink(psdata->cols->varmap); if((n > 0) && (ke > 0)) { del_columnex(lp, psdata->cols->varmap); mat_colcompact(lp->matA, lp->presolve_undo->orig_rows, lp->presolve_undo->orig_columns); compactvars = TRUE; } /* Delete eliminated rows */ ke = lastInactiveLink(psdata->rows->varmap); n = countInactiveLink(psdata->rows->varmap); if((n > 0) && (ke > 0)) { del_constraintex(lp, psdata->rows->varmap); mat_rowcompact(lp->matA, TRUE); compactvars = TRUE; } else if(psdata->nzdeleted > 0) mat_zerocompact(lp->matA); /* Do compacting and updating of variable maps */ if(compactvars) varmap_compact(lp, lp->presolve_undo->orig_rows, lp->presolve_undo->orig_columns); /* Reduce memory usage of postsolve matrices */ if(lp->presolve_undo->primalundo != NULL) mat_memopt(lp->presolve_undo->primalundo->tracker, 0, 0, 0); if(lp->presolve_undo->dualundo != NULL) mat_memopt(lp->presolve_undo->dualundo->tracker, 0, 0, 0); /* Round near-zero objective function coefficients and RHS values */ ke = lp->columns; for(n = 1; n <= ke; n++) my_roundzero(lp->orig_obj[n], lp->epsvalue); ke = lp->rows; for(n = 1; n <= ke; n++) my_roundzero(lp->orig_rhs[n], lp->epsvalue); /* Update the SOS sparse mapping */ if(SOS_count(lp) > 0) SOS_member_updatemap(lp->SOS); /* Validate matrix and reconstruct row indexation */ return(mat_validate(lp->matA)); } STATIC MYBOOL presolve_debugdump(lprec *lp, presolverec *psdata, char *filename, MYBOOL doappend) { FILE *output = stdout; int size; MYBOOL ok; ok = (MYBOOL) ((filename == NULL) || ((output = fopen(filename, my_if(doappend, "a", "w"))) != NULL)); if(!ok) return(ok); if((filename == NULL) && (lp->outstream != NULL)) output = lp->outstream; fprintf(output, "\nPRESOLVE - Status at loop %d:%d:%d\n", psdata->outerloops, psdata->middleloops, psdata->innerloops); fprintf(output, "Model size: %d rows (%d equalities, %d less than), %d columns\n", psdata->rows->varmap->count, psdata->EQmap->count, psdata->LTmap->count, psdata->cols->varmap->count); fprintf(output, "\nMAPPERS\n-------\n\n"); size = 1; blockWriteINT(output, "colmap", psdata->cols->varmap->map, 0, size*psdata->cols->varmap->size); blockWriteINT(output, "rowmap", psdata->rows->varmap->map, 0, size*psdata->rows->varmap->size); blockWriteINT(output, "EQmap", psdata->EQmap->map, 0, size*psdata->EQmap->size); blockWriteINT(output, "LTmap", psdata->LTmap->map, 0, size*psdata->LTmap->size); fprintf(output, "\nCOUNTS\n------\n\n"); blockWriteINT(output, "plucount", psdata->rows->plucount, 0, lp->rows); blockWriteINT(output, "negcount", psdata->rows->negcount, 0, lp->rows); blockWriteINT(output, "pluneg", psdata->rows->pluneg, 0, lp->rows); fprintf(output, "\nSUMS\n----\n\n"); blockWriteREAL(output, "pluupper", psdata->rows->pluupper, 0, lp->rows); blockWriteREAL(output, "negupper", psdata->rows->negupper, 0, lp->rows); blockWriteREAL(output, "plulower", psdata->rows->pluupper, 0, lp->rows); blockWriteREAL(output, "neglower", psdata->rows->negupper, 0, lp->rows); if(filename != NULL) fclose(output); return(ok); } int CMP_CALLMODEL compRedundant(const UNIONTYPE QSORTrec *current, const UNIONTYPE QSORTrec *candidate) { int start1 = (int) (current->int4.intpar1), start2 = (int) (candidate->int4.intpar1), result = CMP_COMPARE(start1, start2); if(result == 0) { start1 = (int) (current->int4.intpar2); start2 = (int) (candidate->int4.intpar2); result = -CMP_COMPARE(start1, start2); } return( result ); } int CMP_CALLMODEL compSparsity(const UNIONTYPE QSORTrec *current, const UNIONTYPE QSORTrec *candidate) { int start1 = (int) (current->int4.intpar1), start2 = (int) (candidate->int4.intpar1), result = CMP_COMPARE(start1, start2); if(result == 0) { start1 = (int) (current->int4.intpar2); start2 = (int) (candidate->int4.intpar2); result = -CMP_COMPARE(start1, start2); } if(result == 0) { start1 = (int) (current->int4.intval); start2 = (int) (candidate->int4.intval); result = CMP_COMPARE(start1, start2); } return( result ); } int CMP_CALLMODEL compAggregate(const UNIONTYPE QSORTrec *current, const UNIONTYPE QSORTrec *candidate) { int index1 = (int) (current->pvoidint2.intval), index2 = (int) (candidate->pvoidint2.intval); lprec *lp = (lprec *) current->pvoidint2.ptr; REAL value1 = lp->orig_obj[index1], value2 = lp->orig_obj[index2]; /* Smallest objective coefficient (largest contribution to OF) */ int result = CMP_COMPARE(value1, value2); /* Smallest lower variable bound */ if(result == 0) { index1 += lp->rows; index2 += lp->rows; value1 = lp->orig_lowbo[index1]; value2 = lp->orig_lowbo[index2]; result = CMP_COMPARE(value1, value2); } /* Largest upper variable bound */ if(result == 0) { value1 = lp->orig_upbo[index1]; value2 = lp->orig_upbo[index2]; result = -CMP_COMPARE(value1, value2); } return( result ); } STATIC int presolve_rowdominance(presolverec *psdata, int *nCoeffChanged, int *nRowsRemoved, int *nVarsFixed, int *nSum) { lprec *lp = psdata->lp; MATrec *mat = lp->matA; int i, ii, ib, ie, n, jb, je, jx, *coldel = NULL, status = RUNNING, item, iCoeffChanged = 0, iRowRemoved = 0, iVarFixed = 0; REAL ratio, *rowvalues = NULL; UNIONTYPE QSORTrec *QS = (UNIONTYPE QSORTrec *) calloc(lp->rows+1, sizeof(*QS)); /* Check if we were able to obtain working memory */ if(QS == NULL) return( status); /* A dominating row of variables always satisfy the following criteria: 1) The starting column position is never lower, but could be the same 2) The non-zero row count is always lower */ n = 0; for(i = firstActiveLink(psdata->EQmap); i != 0; i = nextActiveLink(psdata->EQmap, i)) { /* Make sure we have no SOS or semi-continuous variables */ jb = je = 0; if((SOS_count(lp) > 0) || (lp->sc_vars > 0)) { item = 0; for(jb = presolve_nextcol(psdata, i, &item); jb >= 0; jb = presolve_nextcol(psdata, i, &item)) { jx = ROW_MAT_COLNR(jb); if(SOS_is_member(lp->SOS, 0, jx) || is_semicont(lp, jx)) break; } } /* Add to list if we are Ok */ if(jb < 0) { QS[n].int4.intval = i; item = 0; ii = presolve_nextcol(psdata, i, &item); QS[n].int4.intpar1 = ROW_MAT_COLNR(ii); QS[n].int4.intpar2 = presolve_rowlength(psdata, i); n++; } } if(n <= 1) goto Finish; QS_execute(QS, n, (findCompare_func *) compRedundant, NULL); /* Let us start from the top of the list, going forward and looking for the longest possible dominating row */ if(!allocREAL(lp, &rowvalues, lp->columns + 1, TRUE) || !allocINT(lp, &coldel, lp->columns + 1, FALSE)) goto Finish; for(ib = 0; ib < n; ib++) { /* Get row and check if it was previously eliminated */ i = QS[ib].int4.intval; if(i < 0) continue; /* Load the non-zero row values */ item = 0; for(jb = presolve_nextcol(psdata, i, &item); jb >= 0; jb = presolve_nextcol(psdata, i, &item)) { jx = ROW_MAT_COLNR(jb); rowvalues[jx] = ROW_MAT_VALUE(jb); } for(ie = ib+1; ie < n; ie++) { /* Get row and check if it was previously eliminated */ ii = QS[ie].int4.intval; if(ii < 0) continue; #ifdef Paranoia if((QS[ib].int4.intpar1 > QS[ie].int4.intpar1) || ((QS[ib].int4.intpar1 == QS[ie].int4.intpar1) && (QS[ib].int4.intpar2 < QS[ie].int4.intpar2))) report(lp, SEVERE, "presolve_rowdominance: Invalid sorted row order\n"); #endif /* Loop over every row member to confirm that the candidate actually dominates in every position */ if((lp->orig_rhs[i] == 0) && (lp->orig_rhs[ii] == 0)) ratio = 0; else if((lp->orig_rhs[i] != 0) && (lp->orig_rhs[ii] != 0)) ratio = lp->orig_rhs[i] / lp->orig_rhs[ii]; else continue; item = 0; for(jb = presolve_nextcol(psdata, ii, &item); jb >= 0; jb = presolve_nextcol(psdata, ii, &item)) { jx = ROW_MAT_COLNR(jb); if(rowvalues[jx] == 0) break; if(ratio == 0) ratio = rowvalues[jx] / ROW_MAT_VALUE(jb); else if(fabs(rowvalues[jx] - ratio*ROW_MAT_VALUE(jb)) > psdata->epsvalue) break; } /* "We have contact" */ if(jb < 0) { int sign_1 = 0, sign_j = 0; /* Need to fix any superset columns, but require that they have equal signs */ coldel[0] = 0; item = 0; for(jb = presolve_nextcol(psdata, i, &item); jb >= 0; jb = presolve_nextcol(psdata, i, &item)) { jx = ROW_MAT_COLNR(jb); if(mat_findelm(mat, ii, jx) <= 0) { /* Cancel if we detect a free or "quasi-free" variable */ if((lp->orig_lowbo[lp->rows + jx] < 0) && (lp->orig_upbo[lp->rows + jx] > 0)) { coldel[0] = -1; break; } /* Ensure that we are feasible */ else if((lp->orig_lowbo[lp->rows + jx] > 0) || (lp->orig_upbo[lp->rows + jx] < 0)) { report(lp, DETAILED, "presolve_rowdominate: Column %s is infeasible due to conflict in rows %s and %s\n", get_col_name(lp, jx), get_row_name(lp, i), get_row_name(lp, ii)); coldel[0] = -1; break; } /* Check consistency / uniformity of signs */ sign_j = my_sign(ROW_MAT_VALUE(jb)); sign_j = my_chsign(is_negative(lp, jx), sign_j); if(coldel[0] == 0) { sign_1 = sign_j; coldel[++coldel[0]] = jx; } else if(sign_j == sign_1) { coldel[++coldel[0]] = jx; } else { coldel[0] = -1; break; } } } /* Force break / continuation if the superset columns were incompatible */ if(coldel[0] < 0) continue; /* Do the column fixing and deletion (check for infeasibility in the process) */ for(jb = 1; jb <= coldel[0]; jb++) { jx = coldel[jb]; if(!presolve_colfix(psdata, jx, 0, TRUE, &iVarFixed)) { status = presolve_setstatus(psdata, INFEASIBLE); goto Finish; } presolve_colremove(psdata, jx, TRUE); rowvalues[jx] = 0; } /* Then delete the row */ presolve_rowremove(psdata, ii, TRUE); iRowRemoved++; QS[ie].int4.intval = -ii; } } /* Clear the non-zero row values ahead of the next row candidate */ ie = mat->row_end[i-1]; ii = mat->row_end[i]; for(; ie < ii; ie++) rowvalues[ROW_MAT_COLNR(ie)] = 0; } Finish: FREE(QS); FREE(rowvalues); FREE(coldel); (*nCoeffChanged) += iCoeffChanged; (*nRowsRemoved) += iRowRemoved; (*nVarsFixed) += iVarFixed; (*nSum) += iCoeffChanged + iRowRemoved + iVarFixed; return( status ); } #if 0 STATIC int presolve_coldominance01(presolverec *psdata, int *nConRemoved, int *nVarsFixed, int *nSum) /* The current version of this routine eliminates binary variables that are dominated via set coverage or unit knapsack constraints */ { lprec *lp = psdata->lp; MATrec *mat = lp->matA; MYBOOL first; int i, ii, ib, ie, n, jb, je, jx, jj, item, item2, *coldel = NULL, status = RUNNING, iVarFixed = 0; REAL scale, rhsval, *colvalues = NULL; UNIONTYPE QSORTrec *QS = (UNIONTYPE QSORTrec *) calloc(lp->columns+1, sizeof(*QS)); /* Check if we were able to obtain working memory */ if(QS == NULL) return( status); if(lp->int_vars == 0) goto Finish; /* A column dominates another binary variable column with the following criteria: 1) The relative matrix non-zero entries are identical 2) The relative objective coefficient is worse than the other; if the OF coefficients are identical, we can delete an arbitrary variable */ n = 0; for(i = firstActiveLink(psdata->cols->varmap); i != 0; i = nextActiveLink(psdata->cols->varmap, i)) if(is_binary(lp, i) && !SOS_is_member(lp->SOS, 0, i)) { /* Make sure we have an all-binary, unit-coefficient row */ je = mat->col_end[i]; item = 0; for(jb = presolve_nextrow(psdata, i, &item); jb >= 0; jb = presolve_nextrow(psdata, i, &item)) { jx = COL_MAT_ROWNR(jb); if(COL_MAT_VALUE(jb) != 1) break; } /* Add to list if we are Ok */ if(jb < 0) { QS[n].int4.intval = i; item = 0; ii = presolve_nextrow(psdata, i, &item); QS[n].int4.intpar1 = COL_MAT_ROWNR(ii); ii = presolve_collength(psdata, i); QS[n].int4.intpar2 = ii; n++; } } if(n <= 1) { FREE(QS); return( status ); } QS_execute(QS, n, (findCompare_func *) compRedundant, NULL); /* Let us start from the top of the list, going forward and looking for the longest possible dominated column */ if(!allocREAL(lp, &colvalues, lp->rows + 1, TRUE) || !allocINT(lp, &coldel, lp->columns + 1, FALSE)) goto Finish; for(ib = 0; ib < n; ib++) { /* Get column and check if it was previously eliminated */ i = QS[ib].int4.intval; if(i < 0) continue; /* Load the non-zero column values */ item = 0; for(jb = presolve_nextrow(psdata, i, &item); jb >= 0; jb = presolve_nextrow(psdata, i, &item)) { jx = COL_MAT_ROWNR(jb); colvalues[jx] = COL_MAT_VALUE(jb); } coldel[0] = 0; for(ie = ib+1; ie < n; ie++) { /* Insist on identical column lengths (sort is decending in column lengths) */ ii = QS[ib].int4.intpar2 - QS[ie].int4.intpar2; if(ii != 0) break; /* Also insist on identical starting positions */ ii = QS[ib].int4.intpar1 - QS[ie].int4.intpar1; if(ii != 0) break; /* Get column and check if it was previously eliminated */ ii = QS[ie].int4.intval; if(ii < 0) continue; /* Also make sure that the variables have "compatible" bounds */ #if 1 if((fabs(my_reldiff(lp->orig_lowbo[lp->rows + i], lp->orig_lowbo[lp->rows + ii])) > psdata->epsvalue) || (fabs(my_reldiff(lp->orig_upbo[lp->rows + i], lp->orig_upbo[lp->rows + ii] )) > psdata->epsvalue)) continue; #endif #ifdef Paranoia if((QS[ib].int4.intpar1 > QS[ie].int4.intpar1) || ((QS[ib].int4.intpar1 == QS[ie].int4.intpar1) && (QS[ib].int4.intpar2 < QS[ie].int4.intpar2))) report(lp, SEVERE, "presolve_coldominance01: Invalid sorted column order\n"); #endif /* Loop over every column member to confirm that the candidate is relatively identical in every position */ first = TRUE; item = 0; item2 = 0; scale = 1; for(jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2); jb >= 0; jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2)) { jx = COL_MAT_ROWNR(jb); if(jx != COL_MAT_ROWNR(jj)) break; if(first) { first = !first; scale = colvalues[jx] / COL_MAT_VALUE(jb); } else { if(fabs(colvalues[jx] - scale * COL_MAT_VALUE(jb)) > psdata->epsvalue) break; } /* Also make sure we have a compatible RHS (since this version of the dominance logic only applies to "sets") */ rhsval = scale*lp->orig_rhs[jx] - 1.0; /* if((rhsval < 0) || (rhsval > 1 + psdata->epsvalue)) */ if(fabs(rhsval) > psdata->epsvalue) break; } /* "We have contact" */ if(jb < 0) { coldel[++coldel[0]] = ii; QS[ie].int4.intval = -ii; } } /* Find the dominant column and delete / fix the others; if there is a tie, simply delete the second candidate */ ii = i; for(jb = 1; jb <= coldel[0]; jb++) { jx = coldel[jb]; if(lp->orig_obj[jx] < lp->orig_obj[ii]) swapINT(&ii, &coldel[jb]); } for(jb = 1; jb <= coldel[0]; jb++) { jx = coldel[jb]; if(!presolve_colfix(psdata, jx, lp->orig_lowbo[lp->rows+jx], TRUE, &iVarFixed)) { status = presolve_setstatus(psdata, INFEASIBLE); goto Finish; } presolve_colremove(psdata, jx, TRUE); } /* Clear the non-zero row values ahead of the next row candidate */ if(ib + 1 < n) { ie = mat->col_end[i-1]; ii = mat->col_end[i]; for(; ie < ii; ie++) colvalues[COL_MAT_ROWNR(ie)] = 0; } } Finish: FREE(QS); FREE(colvalues); FREE(coldel); (*nVarsFixed) += iVarFixed; (*nSum) += iVarFixed; return( status ); } #else /* DEVELOPMENT/TEST CODE FOR POSSIBLE REPLACEMENT OF SIMILAR FUNCTION IN lp_presolve.c */ #define NATURAL int STATIC int presolve_coldominance01(presolverec *psdata, NATURAL *nConRemoved, NATURAL *nVarsFixed, NATURAL *nSum) /* The current version of this routine eliminates binary variables that are dominated via set coverage or unit knapsack constraints */ { lprec *lp = psdata->lp; MATrec *mat = lp->matA; NATURAL i, ib, ie, jx, item, item2, n = lp->int_vars, iVarFixed = 0, nrows = lp->rows, *coldel = NULL; int jb, jj, ii, status = RUNNING; REAL rhsval = 0.0, *colvalues = NULL, *colobj = NULL; LLrec *sets = NULL; UNIONTYPE QSORTrec *QS = (UNIONTYPE QSORTrec *) calloc(n+1, sizeof(*QS)); /* Check if we were able to obtain working memory */ if(QS == NULL) return( status); if(n == 0) goto Finish; /* Create list of set coverage and knapsack constraints */ createLink(nrows, &sets, NULL); for(i = firstActiveLink(psdata->rows->varmap); i != 0; i = nextActiveLink(psdata->rows->varmap, i)) { if((lp->orig_rhs[i] < 0) || (psdata->rows->negcount[i] > 0)) continue; item = 0; for(jb = presolve_nextcol(psdata, i, &item); jb >= 0; jb = presolve_nextcol(psdata, i, &item)) { jx = ROW_MAT_COLNR(jb); if(!is_binary(lp, jx)) break; rhsval = ROW_MAT_VALUE(jb) - 1; if(fabs(rhsval) > lp->epsvalue) break; } if(jb < 0) setLink(sets, i); } if(countActiveLink(sets) == 0) goto Finish; /* A column dominates another binary variable column with the following criteria: 1) The relative matrix non-zero entries are identical 2) The relative objective coefficient is worse than the other; if the OF coefficients are identical, we can delete an arbitrary variable */ n = 0; for(i = firstActiveLink(psdata->cols->varmap); i != 0; i = nextActiveLink(psdata->cols->varmap, i)) if(is_binary(lp, i) && !SOS_is_member(lp->SOS, 0, i)) { /* Make sure the column is member of at least one set */ item = 0; for(jb = presolve_nextrow(psdata, i, &item); jb >= 0; jb = presolve_nextrow(psdata, i, &item)) { jx = COL_MAT_ROWNR(jb); if(isActiveLink(sets, jx)) break; } /* Add to list if set membership test is Ok */ if(jb >= 0) { QS[n].int4.intval = i; item = 0; ii = presolve_nextrow(psdata, i, &item); QS[n].int4.intpar1 = COL_MAT_ROWNR(ii); ii = presolve_collength(psdata, i); QS[n].int4.intpar2 = ii; n++; } } if(n <= 1) { FREE(QS); return( status ); } QS_execute(QS, n, (findCompare_func *) compRedundant, NULL); /* Let us start from the top of the list, going forward and looking for the longest possible dominated column */ if(!allocREAL(lp, &colvalues, nrows + 1, TRUE) || !allocREAL(lp, &colobj, n + 1, FALSE) || !allocINT(lp, &coldel, n + 1, FALSE)) goto Finish; for(ib = 0; ib < n; ib++) { /* Get column and check if it was previously eliminated */ i = QS[ib].int4.intval; if(!isActiveLink(psdata->cols->varmap, i)) continue; /* Load the non-zero column values */ item = 0; for(jb = presolve_nextrow(psdata, i, &item); jb >= 0; jb = presolve_nextrow(psdata, i, &item)) { jx = COL_MAT_ROWNR(jb); colvalues[jx] = COL_MAT_VALUE(jb); } /* Store data for current column */ coldel[0] = 1; coldel[1] = i; colobj[1] = lp->orig_obj[i]; /* Loop over all other columns to see if they have equal constraint coefficients */ for(ie = ib+1; ie < n; ie++) { /* Check if this column was previously eliminated */ ii = QS[ie].int4.intval; if(!isActiveLink(psdata->cols->varmap, ii)) continue; /* Insist on identical column lengths (sort is decending in column lengths) */ ii = QS[ib].int4.intpar2 - QS[ie].int4.intpar2; if(ii != 0) break; /* Also insist on identical starting positions */ ii = QS[ib].int4.intpar1 - QS[ie].int4.intpar1; if(ii != 0) break; /* Get column and check if it was previously eliminated */ ii = QS[ie].int4.intval; #ifdef Paranoia if((QS[ib].int4.intpar1 > QS[ie].int4.intpar1) || ((QS[ib].int4.intpar1 == QS[ie].int4.intpar1) && (QS[ib].int4.intpar2 < QS[ie].int4.intpar2))) report(lp, SEVERE, "presolve_coldominance01: Invalid sorted column order\n"); #endif /* Loop over every column member to confirm that the candidate is identical in every row; we also compute the minimal set order */ rhsval = lp->infinite; item = 0; item2 = 0; for(jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2); jb >= 0; jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2)) { jx = COL_MAT_ROWNR(jb); if(jx != COL_MAT_ROWNR(jj)) break; if(isActiveLink(sets, jx)) SETMIN(rhsval, lp->orig_rhs[jx]); } /* "We have contact" */ if(jb < 0) { coldel[++coldel[0]] = ii; colobj[coldel[0]] = lp->orig_obj[ii]; } } /* Find the dominant columns, fix and delete the others */ if(coldel[0] > 1) { qsortex(colobj+1, coldel[0], 0, sizeof(*colobj), FALSE, compareREAL, coldel+1, sizeof(*coldel)); /* if(rhsval+lp->epsvalue < lp->infinite) { */ jb = (NATURAL) (rhsval+lp->epsvalue); /* printf("%f / %d\n", rhsval, jb); */ for(jb++; jb <= coldel[0]; jb++) { jx = coldel[jb]; if(!presolve_colfix(psdata, jx, lp->orig_lowbo[nrows+jx], TRUE, &iVarFixed)) { status = presolve_setstatus(psdata, INFEASIBLE); goto Finish; } presolve_colremove(psdata, jx, TRUE); } /*} */ } /* Clear the non-zero row values ahead of the next row candidate */ if(ib + 1 < n) { ie = mat->col_end[i-1]; ii = mat->col_end[i]; for(; ie < ii; ie++) colvalues[COL_MAT_ROWNR(ie)] = 0; } } Finish: freeLink(&sets); FREE(QS); FREE(colvalues); FREE(coldel); FREE(colobj); (*nVarsFixed) += iVarFixed; (*nSum) += iVarFixed; return( status ); } #endif STATIC int presolve_aggregate(presolverec *psdata, int *nConRemoved, int *nVarsFixed, int *nSum) /* This routine combines compatible or identical columns */ { lprec *lp = psdata->lp; MATrec *mat = lp->matA; MYBOOL first; int i, ii, ib, ie, ix, n, jb, je, jx, jj, item, item2, *coldel = NULL, status = RUNNING, iVarFixed = 0; REAL scale, *colvalues = NULL; UNIONTYPE QSORTrec *QScand = (UNIONTYPE QSORTrec *) calloc(lp->columns+1, sizeof(*QScand)); /* Check if we were able to obtain working memory */ if(QScand == NULL) return( status); /* Obtain the list of qualifying columns to be sorted */ n = 0; for(i = firstActiveLink(psdata->cols->varmap); i != 0; i = nextActiveLink(psdata->cols->varmap, i)) if(!is_semicont(lp, i) && !SOS_is_member(lp->SOS, 0, i)) { QScand[n].int4.intval = i; item = 0; ii = presolve_nextrow(psdata, i, &item); QScand[n].int4.intpar1 = COL_MAT_ROWNR(ii); ii = presolve_collength(psdata, i); QScand[n].int4.intpar2 = ii; n++; } if(n <= 1) { FREE(QScand); return( status ); } QS_execute(QScand, n, (findCompare_func *) compRedundant, NULL); /* Let us start from the top of the list, going forward and looking for the longest possible identical column */ if(!allocREAL(lp, &colvalues, lp->rows + 1, TRUE) || !allocINT(lp, &coldel, lp->columns + 1, FALSE)) goto Finish; for(ib = 0; ib < n; ib++) { /* Get column and check if it was previously eliminated */ i = QScand[ib].int4.intval; if(i < 0) continue; /* Load the non-zero column values of this active/reference column */ item = 0; for(jb = presolve_nextrow(psdata, i, &item); jb >= 0; jb = presolve_nextrow(psdata, i, &item)) { jx = COL_MAT_ROWNR(jb); colvalues[jx] = COL_MAT_VALUE(jb); } coldel[0] = 0; for(ie = ib+1; ie < n; ie++) { /* Insist on identical column lengths (sort is decending in column lengths) */ ii = QScand[ib].int4.intpar2 - QScand[ie].int4.intpar2; if(ii != 0) break; /* Also insist on identical starting positions */ ii = QScand[ib].int4.intpar1 - QScand[ie].int4.intpar1; if(ii != 0) break; /* Get column and check if it was previously eliminated */ ii = QScand[ie].int4.intval; if(ii < 0) continue; /* Loop over every column member to confirm that the candidate is relatively identical in every position */ first = TRUE; item = 0; item2 = 0; scale = 1; for(jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2); jb >= 0; jb = presolve_nextrow(psdata, ii, &item), jj = presolve_nextrow(psdata, i, &item2)) { jx = COL_MAT_ROWNR(jb); if(jx != COL_MAT_ROWNR(jj)) break; if(first) { first = !first; scale = colvalues[jx] / COL_MAT_VALUE(jb); } else { if(fabs(colvalues[jx] - scale * COL_MAT_VALUE(jb)) > psdata->epsvalue) break; } } /* "We have contact", store the column in the aggregation list */ if(jb < 0) { coldel[++coldel[0]] = ii; QScand[ie].int4.intval = -ii; } } /* Sort the aggregation list if we have aggregation candidates */ if(coldel[0] > 1) { REAL of, ofelim, fixvalue; MYBOOL isint; UNIONTYPE QSORTrec *QSagg = (UNIONTYPE QSORTrec *) calloc(coldel[0], sizeof(*QSagg)); for(jb = 1; jb <= coldel[0]; jb++) { ii = jb - 1; QSagg[ii].pvoidint2.intval = coldel[jb]; QSagg[ii].pvoidint2.ptr = (void *) lp; } QS_execute(QSagg, coldel[0], (findCompare_func *) compAggregate, NULL); /* Process columns with identical OF coefficients */ jb = 0; while((status == RUNNING) && (jb < coldel[0])) { ii = QSagg[jb].pvoidint2.intval; of = lp->orig_obj[ii]; isint = is_int(lp, ii); je = jb + 1; while((status == RUNNING) && (je < coldel[0]) && (fabs(lp->orig_obj[ix = QSagg[je].pvoidint2.intval] - of) < psdata->epsvalue)) { /* We now have two columns with equal OFs; the following cases are possible: 1) The first column has Inf upper bound, which means that it can "absorb" compatible columns, which are then fixed at the appropriate bounds (or zero in case of free variables). 2) The first column has a -Inf lower bound, and further columns are Inf upper bounds, which means steps towards forming a free variable can be made. 3) The first column is a non-Inf upper bound, in which case the bounds are summed into a helper variable and the variable simply deleted. The deleted variables' value are allocated/distributed via a simple linear programming routine at postsolve. In the current version of this code, we only handle case 1. */ if(is_int(lp, ix) == isint) { ofelim = lp->orig_obj[ix]; if(of == 0) scale = 1; else scale = ofelim / of; if(my_infinite(lp, lp->orig_upbo[lp->rows+ii])) { /* Case 1 (recipe.mps) */ if(is_unbounded(lp, ix)) fixvalue = 0; else if(ofelim < 0) fixvalue = lp->orig_upbo[lp->rows+ix]; else fixvalue = lp->orig_lowbo[lp->rows+ix]; if(my_infinite(lp, fixvalue)) status = presolve_setstatus(psdata, UNBOUNDED); else if(!presolve_colfix(psdata, ix, fixvalue, TRUE, &iVarFixed)) status = presolve_setstatus(psdata, INFEASIBLE); else presolve_colremove(psdata, ix, TRUE); } else if(my_infinite(lp, lp->orig_lowbo[lp->rows+ii])) { /* Case 2 */ /* Do nothing */ } else { /* Case 3 */ #if 0 /* Do nothing */ #else if(ofelim >= 0) { fixvalue = lp->orig_lowbo[lp->rows+ix]; lp->orig_upbo[lp->rows+ii] += scale * (lp->orig_upbo[lp->rows+ix] - fixvalue); } else { fixvalue = lp->orig_upbo[lp->rows+ix]; lp->orig_upbo[lp->rows+ii] -= scale * (fixvalue - lp->orig_lowbo[lp->rows+ix]); } if(my_infinite(lp, fixvalue)) status = presolve_setstatus(psdata, UNBOUNDED); else if(!presolve_colfix(psdata, ix, fixvalue, TRUE, &iVarFixed)) status = presolve_setstatus(psdata, INFEASIBLE); else presolve_colremove(psdata, ix, TRUE); #ifdef xxParanoia if(presolve_rowlengthdebug(psdata) > 0) report(lp, SEVERE, "presolve_aggregate: Invalid row count\n"); #endif psdata->forceupdate = TRUE; #endif } } je++; } jb = je; } FREE(QSagg); } /* Clear the non-zero row values ahead of the next row candidate */ if(ib + 1 < n) { ie = mat->col_end[i-1]; ii = mat->col_end[i]; for(; ie < ii; ie++) colvalues[COL_MAT_ROWNR(ie)] = 0; } } Finish: FREE(QScand); FREE(colvalues); FREE(coldel); (*nVarsFixed) += iVarFixed; (*nSum) += iVarFixed; return( status ); } STATIC int presolve_makesparser(presolverec *psdata, int *nCoeffChanged, int *nConRemove, int *nVarFixed, int *nSum) { lprec *lp = psdata->lp; MATrec *mat = lp->matA; MYBOOL chsign; int i, ii, ib, ix, k, n, jb, je, jl, jjb, jje, jjl, jx, jjx, item, itemEQ, *nzidx = NULL, status = RUNNING, iObjChanged = 0, iCoeffChanged = 0, iConRemove = 0; REAL test, ratio, value, valueEQ, *valptr; LLrec *EQlist = NULL; UNIONTYPE QSORTrec *QS = (UNIONTYPE QSORTrec *) calloc(lp->rows, sizeof(*QS)); /* Check if we were able to obtain working memory */ if((QS == NULL) || (psdata->rows->varmap->count == 0) || (psdata->EQmap->count == 0)) return( status); /* Sort rows in 1) increasing order of start index, 2) decreasing length, and 3) non-equalities (i.e. equalities last) */ n = 0; for(i = firstActiveLink(psdata->rows->varmap); i != 0; i = nextActiveLink(psdata->rows->varmap, i)) { k = presolve_rowlength(psdata, i); if(k >= 2) { item = 0; ii = presolve_nextcol(psdata, i, &item); #ifdef Paranoia if((ii < 0) || (item == 0)) { report(lp, SEVERE, "presolve_makesparser: Unexpected zero-length row %d\n", i); continue; } #endif QS[n].int4.intval = my_chsign(is_constr_type(lp, i, EQ), i); QS[n].int4.intpar1 = ROW_MAT_COLNR(ii); QS[n].int4.intpar2 = k; n++; } } if(n <= 1) { FREE(QS); return( status ); } QS_execute(QS, n, (findCompare_func *) compSparsity, NULL); /* Create associated sorted map of indeces to equality constraints; note that we need to have a unit offset for compatibility. */ allocINT(lp, &nzidx, lp->columns + 1, FALSE); createLink(lp->rows, &EQlist, NULL); for(ib = 0; ib < n; ib++) { i = QS[ib].int4.intval; if(i < 0) appendLink(EQlist, ib + 1); } /* Loop over all equality masks */ for(ix = firstActiveLink(EQlist); ix != 0; ) { /* Get row starting and ending positions of the mask */ ii = abs(QS[ix-1].int4.intval); jjb = QS[ix-1].int4.intpar1; jje = presolve_lastcol(psdata, ii); jje = ROW_MAT_COLNR(jje); jjl = QS[ix-1].int4.intpar2; /* Scan the OF */ i = 0; chsign = is_chsign(lp, i); test = ratio = 0.0; itemEQ = 0; nzidx[0] = 0; while(((jjx = presolve_nextcol(psdata, ii, &itemEQ)) >= 0) && /*(itemEQ > 0) && */ (fabs(test-ratio) < psdata->epsvalue)) { valueEQ = ROW_MAT_VALUE(jjx); if(valueEQ == 0) continue; k = ROW_MAT_COLNR(jjx); value = lp->orig_obj[k]; if(fabs(value) < psdata->epsvalue) break; if(ratio == 0.0) { test = ratio = value / valueEQ; } else test = value / valueEQ; /* Store nz index */ nzidx[++nzidx[0]] = k; } /* We were successful if the equality was completely traversed; we will then zero-out the OF coefficients and update the constant term. */ if((itemEQ == 0) && (nzidx[0] > 0) && (fabs(test-ratio) < psdata->epsvalue)) { for(k = 1; k <= nzidx[0]; k++) { /* We should add recovery data for the zero'ed coefficient here */ jx = nzidx[k]; value = lp->orig_obj[jx]; lp->orig_obj[jx] = 0.0; /* Update counts */ value = my_chsign(chsign, value); if(value < 0) { psdata->rows->negcount[i]--; psdata->cols->negcount[jx]--; } else { psdata->rows->plucount[i]--; psdata->cols->plucount[jx]--; } iObjChanged++; } value = ratio * lp->orig_rhs[ii]; presolve_adjustrhs(psdata, i, value, psdata->epsvalue); } /* Scan for compatible constraints that can be masked for sparsity elimination */ for(ib = 1; ib < ix; ib++) { /* Get row starting and ending positions of the target constraint */ i = abs(QS[ib-1].int4.intval); jb = QS[ib-1].int4.intpar1; je = presolve_lastcol(psdata, i); je = ROW_MAT_COLNR(je); jl = QS[ib-1].int4.intpar2; /* Check if there is a window mismatch */ if((jjb < jb) || (jje > je) || (jjl > jl)) goto NextEQ; /* We have a window match; now check if there is a (scalar) member-by-member match as well. We approach this in the following manner: 1) Get first (or next) member of active equality 2) Loop to matching member in the target constraint, but abandon if no match 3) Set ratio if this is the first match, otherwise compare ratio and abandon on mismatch 4) Go to 1) of there are more elements in the active equality 5) Proceed to do sparsity elimination if we were successful. */ chsign = is_chsign(lp, i); test = ratio = 0.0; itemEQ = 0; item = 0; nzidx[0] = 0; while(((jjx = presolve_nextcol(psdata, ii, &itemEQ)) >= 0) && /*(itemEQ > 0) &&*/ (fabs(test-ratio) < psdata->epsvalue)) { valueEQ = ROW_MAT_VALUE(jjx); if(valueEQ == 0) continue; jx = 0; jjx = ROW_MAT_COLNR(jjx); for(k = presolve_nextcol(psdata, i, &item); (jx < jjx) && (item > 0); k = presolve_nextcol(psdata, i, &item)) { jx = ROW_MAT_COLNR(k); /* Do we have a column index match? */ if(jx == jjx) { value = ROW_MAT_VALUE(k); /* Abandon if we have a zero value */ if(value == 0) goto NextEQ; if(ratio == 0.0) { test = ratio = value / valueEQ; } else test = value / valueEQ; /* Store nz index */ nzidx[++nzidx[0]] = k; break; } /* Give up matching if there is overshooting */ else if(jx > jjx) goto NextEQ; } } /* We were successful if the equality was completely traversed */ if((itemEQ == 0) && (nzidx[0] > 0) && (fabs(test-ratio) < psdata->epsvalue)) { /* Check if we have found parametrically indentical constraints */ if(presolve_rowlength(psdata, i) == presolve_rowlength(psdata,ii)) { value = lp->orig_rhs[i]; valueEQ = lp->orig_rhs[ii]; /* Are they both equalities? */ if(is_constr_type(lp, i, EQ)) { /* Determine applicable ratio for the RHS */ if(fabs(valueEQ) < psdata->epsvalue) { if(fabs(value) < psdata->epsvalue) test = ratio; else test = lp->infinite; } else test = value / valueEQ; /* Check for infeasibility */ if(fabs(test-ratio) > psdata->epsvalue) { report(lp, NORMAL, "presolve_sparser: Infeasibility of relatively equal constraints %d and %d\n", i, ii); status = presolve_setstatus(psdata, INFEASIBLE); goto Finish; } /* Otherwise we can delete a redundant constraint */ else { removeLink(EQlist, i); presolve_rowremove(psdata, i, TRUE); MEMCOPY(&QS[ib-1], &QS[ib], n-ib); n--; iConRemove++; } } /* ... if not, then delete the inequality, since the equality dominates */ else { /* First verify feasibility of the RHS */ if((value+psdata->epsvalue < valueEQ) || (value-get_rh_range(lp, i)-psdata->epsvalue > valueEQ)) { report(lp, NORMAL, "presolve_sparser: Infeasibility of relatively equal RHS values for %d and %d\n", i, ii); status = presolve_setstatus(psdata, INFEASIBLE); goto Finish; } presolve_rowremove(psdata, i, TRUE); MEMCOPY(&QS[ib-1], &QS[ib], n-ib); n--; iConRemove++; } } /* Otherwise zero-out the target constraint coefficients and update the RHS */ else { for(k = 1; k <= nzidx[0]; k++) { /* We should add recovery data for the zero'ed coefficient here */ jjx = nzidx[k]; jx = ROW_MAT_COLNR(jjx); valptr = &ROW_MAT_VALUE(jjx); value = *valptr; *valptr = 0.0; /* Update counts */ value = my_chsign(chsign, value); if(value < 0) { psdata->rows->negcount[i]--; psdata->cols->negcount[jx]--; } else { psdata->rows->plucount[i]--; psdata->cols->plucount[jx]--; } iCoeffChanged++; } value = ratio * lp->orig_rhs[ii]; presolve_adjustrhs(psdata, i, value, psdata->epsvalue); } } } /* Get next equality index */ NextEQ: ix = nextActiveLink(EQlist, ix); } Finish: FREE(QS); freeLink(&EQlist); FREE(nzidx); /* Let us condense the matrix if we modified the constraint matrix */ if(iCoeffChanged > 0) { mat->row_end_valid = FALSE; mat_zerocompact(mat); presolve_validate(psdata, TRUE); #ifdef PresolveForceUpdateMax mat_computemax(mat /* , FALSE */); #endif psdata->forceupdate = TRUE; } (*nConRemove) += iConRemove; (*nCoeffChanged) += iCoeffChanged + iObjChanged; (*nSum) += iCoeffChanged + iObjChanged + iConRemove; return( status ); } STATIC int presolve_SOS1(presolverec *psdata, int *nCoeffChanged, int *nConRemove, int *nVarFixed, int *nSOS, int *nSum) { lprec *lp = psdata->lp; MYBOOL candelete, SOS_GUBactive = FALSE; int iCoeffChanged = 0, iConRemove = 0, iSOS = 0, i,ix,iix, j,jx,jjx, status = RUNNING; REAL Value1; MATrec *mat = lp->matA; for(i = lastActiveLink(psdata->rows->varmap); i > 0; ) { candelete = FALSE; Value1 = get_rh(lp, i); jx = get_constr_type(lp, i); if((Value1 == 1) && (presolve_rowlength(psdata, i) >= MIN_SOS1LENGTH) && ((SOS_GUBactive && (jx != GE)) || (!SOS_GUBactive && (jx == LE)))) { jjx = mat->row_end[i-1]; iix = mat->row_end[i]; for(; jjx < iix; jjx++) { j = ROW_MAT_COLNR(jjx); if(!isActiveLink(psdata->cols->varmap, j)) continue; if(!is_binary(lp, j) || (ROW_MAT_VALUE(jjx) != 1)) break; } if(jjx >= iix) { char SOSname[16]; /* Define a new SOS instance */ ix = SOS_count(lp) + 1; sprintf(SOSname, "SOS_%d", ix); ix = add_SOS(lp, SOSname, 1, ix, 0, NULL, NULL); if(jx == EQ) SOS_set_GUB(lp->SOS, ix, TRUE); Value1 = 0; jjx = mat->row_end[i-1]; for(; jjx < iix; jjx++) { j = ROW_MAT_COLNR(jjx); if(!isActiveLink(psdata->cols->varmap, j)) continue; Value1 += 1; append_SOSrec(lp->SOS->sos_list[ix-1], 1, &j, &Value1); } candelete = TRUE; iSOS++; } } /* Get next row and do the deletion of the previous, if indicated */ ix = i; i = prevActiveLink(psdata->rows->varmap, i); if(candelete) { presolve_rowremove(psdata, ix, TRUE); iConRemove++; } } if(iSOS) report(lp, DETAILED, "presolve_SOS1: Converted %5d constraints to SOS1.\n", iSOS); clean_SOSgroup(lp->SOS, (MYBOOL) (iSOS > 0)); (*nCoeffChanged) += iCoeffChanged; (*nConRemove) += iConRemove; (*nSOS) += iSOS; (*nSum) += iCoeffChanged+iConRemove+iSOS; return( status ); } STATIC int presolve_boundconflict(presolverec *psdata, int baserowno, int colno) { REAL Value1, Value2; lprec *lp = psdata->lp; MATrec *mat = lp->matA; int ix, item = 0, status = RUNNING; if(baserowno <= 0) do { ix = presolve_nextrow(psdata, colno, &item); if(ix < 0) return( status ); baserowno = COL_MAT_ROWNR(ix); } while(presolve_rowlength(psdata, baserowno) != 1); Value1 = get_rh_upper(lp, baserowno), Value2 = get_rh_lower(lp, baserowno); if(presolve_singletonbounds(psdata, baserowno, colno, &Value2, &Value1, NULL)) { int iix; item = 0; for(ix = presolve_nextrow(psdata, colno, &item); ix >= 0; ix = presolve_nextrow(psdata, colno, &item)) { iix = COL_MAT_ROWNR(ix); if((iix != baserowno) && (presolve_rowlength(psdata, iix) == 1) && !presolve_altsingletonvalid(psdata, iix, colno, Value2, Value1)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } } } else status = presolve_setstatus(psdata, INFEASIBLE); return( status ); } STATIC int presolve_columns(presolverec *psdata, int *nCoeffChanged, int *nConRemove, int *nVarFixed, int *nBoundTighten, int *nSum) { lprec *lp = psdata->lp; MYBOOL candelete, isOFNZ, unbounded, probefix = is_presolve(lp, PRESOLVE_PROBEFIX), #if 0 probereduce = is_presolve(lp, PRESOLVE_PROBEREDUCE), #endif colfixdual = is_presolve(lp, PRESOLVE_COLFIXDUAL); int iCoeffChanged = 0, iConRemove = 0, iVarFixed = 0, iBoundTighten = 0, status = RUNNING, ix, j, countNZ, item; REAL Value1; for(j = firstActiveLink(psdata->cols->varmap); (j != 0) && (status == RUNNING); ) { /* Don't presolve members SOS'es */ if(SOS_is_member(lp->SOS, 0, j)) { j = nextActiveLink(psdata->cols->varmap, j); continue; } /* Initialize */ countNZ = presolve_collength(psdata, j); isOFNZ = isnz_origobj(lp, j); Value1 = get_lowbo(lp, j); unbounded = is_unbounded(lp, j); /* Clear unnecessary semicont-definitions */ if((lp->sc_vars > 0) && (Value1 == 0) && is_semicont(lp, j)) set_semicont(lp, j, FALSE); candelete = FALSE; item = 0; ix = lp->rows + j; /* Check if the variable is unused */ if((countNZ == 0) && !isOFNZ) { if(Value1 != 0) report(lp, DETAILED, "presolve_columns: Eliminated unused variable %s\n", get_col_name(lp,j)); candelete = TRUE; } /* Check if the variable has a cost, but is not limited by constraints */ else if((countNZ == 0) && isOFNZ) { if(lp->orig_obj[j] < 0) Value1 = get_upbo(lp, j); if(fabs(Value1) >= lp->infinite) { report(lp, DETAILED, "presolve_columns: Unbounded variable %s\n", get_col_name(lp,j)); status = presolve_setstatus(psdata, UNBOUNDED); } else { /* Fix the value at its best bound */ report(lp, DETAILED, "presolve_columns: Eliminated trivial variable %s fixed at %g\n", get_col_name(lp,j), Value1); candelete = TRUE; } } /* Check if the variable can be eliminated because it is fixed */ else if(isOrigFixed(lp, ix)) { if(countNZ > 0) { status = presolve_boundconflict(psdata, -1, j); if(status != RUNNING) break; } report(lp, DETAILED, "presolve_columns: Eliminated variable %s fixed at %g\n", get_col_name(lp,j), Value1); candelete = TRUE; } #if 0 /* Merge OF-constraint column doubleton in equality constraint (if it has not been captured by the singleton free variable rule above) */ else if((countNZ == 1) && isOFNZ && ((i = presolve_nextrow(psdata, j, &item)) >= 0) && is_constr_type(lp, i = COL_MAT_ROWNR(i), EQ)) { MATrec *mat = lp->matA; /* Merge the constraint into the OF */ Value1 = lp->orig_obj[j] / get_mat(lp, i, j); for(jx = mat->row_end[i-1]; jx < mat->row_end[i]; jx++) { jjx = ROW_MAT_COLNR(jx); lp->orig_obj[jjx] -= Value1 * ROW_MAT_VALUE(jx); } Value2 = lp->orig_rhs[i]; presolve_adjustrhs(psdata, 0, Value1 * Value2, 0.0); /* Verify feasibility */ Value2 /= get_mat(lp, i, j); if((Value2 < get_lowbo(lp, j)) || (Value2 > get_upbo(lp, j))) { status = presolve_setstatus(psdata, INFEASIBLE); break; } /* Do column (and flag row) deletion */ presolve_rowremove(psdata, i, TRUE); psdata->forceupdate = TRUE; iConRemove++; candelete = TRUE; } #endif /* Look for opportunity to fix column based on the dual */ else if(colfixdual && presolve_colfixdual(psdata, j, &Value1, &status)) { if(my_infinite(lp, Value1)) { report(lp, DETAILED, "presolve_columns: Unbounded variable %s\n", get_col_name(lp,j)); status = presolve_setstatus(psdata, UNBOUNDED); } else { /* Fix the value at its best bound */ report(lp, DETAILED, "presolve_columns: Eliminated dual-zero variable %s fixed at %g\n", get_col_name(lp,j), Value1); candelete = TRUE; } } /* Do probing of binary variables to see if we can fix them */ else if(probefix && is_binary(lp, j) && presolve_probefix01(psdata, j, &Value1)) { report(lp, DETAILED, "presolve_columns: Fixed binary variable %s at %g\n", get_col_name(lp,j), Value1); candelete = TRUE; } #if 0 /* Do probing of binary variables to see if we can tighten their coefficients */ else if(probereduce && is_binary(lp, j) && (ix = presolve_probetighten01(psdata, j) > 0)) { report(lp, DETAILED, "presolve_columns: Tightened coefficients for binary variable %s in %d rows\n", get_col_name(lp,j), ix); iCoeffChanged += ix; psdata->forceupdate = TRUE; } #endif /* Perform fixing and deletion, if indicated */ if(candelete) { /* If we have a SOS1 member variable fixed at a non-zero value, then we must fix the other member variables at zero and delete the SOS(es) */ if((Value1 != 0) && SOS_is_member(lp->SOS, 0, j)) { ix = iVarFixed; if(!presolve_fixSOS1(psdata, j, Value1, &iConRemove, &iVarFixed)) status = presolve_setstatus(psdata, INFEASIBLE); if(iVarFixed > ix) psdata->forceupdate = TRUE; break; } else { if(!presolve_colfix(psdata, j, Value1, TRUE, &iVarFixed)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } j = presolve_colremove(psdata, j, TRUE); } } else j = nextActiveLink(psdata->cols->varmap, j); } /* Remove any "hanging" empty row and columns */ if(status == RUNNING) status = presolve_shrink(psdata, &iConRemove, &iVarFixed); (*nCoeffChanged) += iCoeffChanged; (*nConRemove) += iConRemove; (*nVarFixed) += iVarFixed; (*nBoundTighten) += iBoundTighten; (*nSum) += iCoeffChanged+iConRemove+iVarFixed+iBoundTighten; return( status ); } STATIC int presolve_freeandslacks(presolverec *psdata, int *nCoeffChanged, int *nConRemove, int *nVarFixed, int *nSum) { lprec *lp = psdata->lp; MYBOOL isOFNZ, unbounded, impliedfree = is_presolve(lp, PRESOLVE_IMPLIEDFREE), impliedslack = is_presolve(lp, PRESOLVE_IMPLIEDSLK); int iCoeffChanged = 0, iConRemove = 0, iVarFixed = 0, status = RUNNING, i, ix, j, countNZ; REAL coeff_bl, coeff_bu; MATrec *mat = lp->matA; if(impliedfree || impliedslack) for(j = firstActiveLink(psdata->cols->varmap); j != 0; ) { /* Check and initialize */ if((presolve_collength(psdata, j) != 1) || is_int(lp, j) || is_semicont(lp, j) || !presolve_candeletevar(psdata, j)) { j = nextActiveLink(psdata->cols->varmap, j); continue; } ix = 0; i = COL_MAT_ROWNR(presolve_nextrow(psdata, j, &ix)); isOFNZ = isnz_origobj(lp, j); countNZ = presolve_rowlength(psdata, i); coeff_bu = get_upbo(lp, j); coeff_bl = get_lowbo(lp, j); unbounded = my_infinite(lp, coeff_bl) && my_infinite(lp, coeff_bu); ix = lp->rows + j; /* Eliminate singleton free variable and its associated constraint */ if(impliedfree && unbounded && presolve_impliedcolfix(psdata, i, j, TRUE)) { report(lp, DETAILED, "presolve_freeandslacks: Eliminated free variable %s and row %s\n", get_col_name(lp, j), get_row_name(lp, i)); presolve_rowremove(psdata, i, TRUE); iConRemove++; j = presolve_colremove(psdata, j, TRUE); iVarFixed++; } /* Check for implied slack variable in equality constraint */ else if(impliedslack && (countNZ > 1) && is_constr_type(lp, i, EQ) && presolve_impliedcolfix(psdata, i, j, FALSE)) { report(lp, DETAILED, "presolve_freeandslacks: Eliminated implied slack variable %s via row %s\n", get_col_name(lp, j), get_row_name(lp, i)); psdata->forceupdate = TRUE; j = presolve_colremove(psdata, j, TRUE); iVarFixed++; } /* Check for implied (generalized) slack variable in inequality constraint */ else if(impliedslack && !isOFNZ && my_infinite(lp, coeff_bu) && /* Consider removing this test */ #if 0 /* Force zero-bounded implicit slack */ (coeff_bl == 0)) && #else !my_infinite(lp, coeff_bl) && #endif (countNZ > 1) && !is_constr_type(lp, i, EQ)) { REAL *target, ValueA = COL_MAT_VALUE(presolve_lastrow(psdata, j)); #if 0 coeff_bu = get_rh_upper(lp, i); coeff_bl = get_rh_lower(lp, i); if(!presolve_singletonbounds(psdata, i, j, &coeff_bl, &coeff_bu, &ValueA)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } #endif if((coeff_bl != 0) && !my_infinite(lp, coeff_bl) && !my_infinite(lp, coeff_bu)) coeff_bu -= coeff_bl; /* If the coefficient is negative, reduce the lower bound / increase range */ if(ValueA > 0) { target = &lp->orig_upbo[i]; if(!my_infinite(lp, *target)) { if(my_infinite(lp, coeff_bu)) { *target = lp->infinite; psdata->forceupdate = TRUE; } else { *target += ValueA * coeff_bu; *target = presolve_roundrhs(lp, *target, FALSE); } } } /* Otherwise see if the upper bound should be changed */ else { target = &lp->orig_rhs[i]; if(my_infinite(lp, coeff_bu) || my_infinite(lp, *target)) { /* Do we suddenly find that the constraint becomes redundant? (e226.mps) */ if(my_infinite(lp, lp->orig_upbo[i])) { presolve_rowremove(psdata, i, TRUE); iConRemove++; } /* Or does the upper bound of a ranged constraint become Inf? */ else { *target -= lp->orig_upbo[i]; *target = -(*target); mat_multrow(mat, i, -1); lp->orig_upbo[i] = lp->infinite; psdata->forceupdate = TRUE; } } else { *target -= ValueA * coeff_bu; *target = presolve_roundrhs(lp, *target, FALSE); } } presolve_colfix(psdata, j, coeff_bl, TRUE, &iVarFixed); report(lp, DETAILED, "presolve_freeandslacks: Eliminated duplicate slack variable %s via row %s\n", get_col_name(lp, j), get_row_name(lp, i)); j = presolve_colremove(psdata, j, TRUE); } /* Go to next column */ else j = nextActiveLink(psdata->cols->varmap, j); } (*nCoeffChanged) += iCoeffChanged; (*nConRemove) += iConRemove; (*nVarFixed) += iVarFixed; (*nSum) += iCoeffChanged+iConRemove+iVarFixed; return( status ); } STATIC int presolve_preparerows(presolverec *psdata, int *nBoundTighten, int *nSum) { lprec *lp = psdata->lp; MYBOOL impliedfree = is_presolve(lp, PRESOLVE_IMPLIEDFREE), tightenbounds = is_presolve(lp, PRESOLVE_BOUNDS); int iRangeTighten = 0, iBoundTighten = 0, status = RUNNING, i, j; REAL losum, upsum, lorhs, uprhs, epsvalue = psdata->epsvalue; MATrec *mat = lp->matA; for(i = lastActiveLink(psdata->rows->varmap); i > 0; i = prevActiveLink(psdata->rows->varmap, i)) { /* First identify any full row infeasibilities */ j = presolve_rowlengthex(psdata, i); #ifdef Paranoia if(!presolve_testrow(psdata, nextActiveLink(psdata->rows->varmap, i))) { #else if((j > 1) && !psdata->forceupdate && !presolve_rowfeasible(psdata, i, FALSE)) { #endif status = presolve_setstatus(psdata, INFEASIBLE); break; } /* Do bound (LHS) or constraint range (RHS) tightening if we will later identify implied free variables (tends to produce degeneracy otherwise) */ if(impliedfree && (j > 1) && mat_validate(mat)){ /* Look for opportunity to tighten constraint bounds (and check for feasibility again) */ presolve_range(lp, i, psdata->rows, &losum, &upsum); lorhs = get_rh_lower(lp, i); uprhs = get_rh_upper(lp, i); if((losum > MIN(upsum, uprhs)+epsvalue) || (upsum < MAX(losum, lorhs)-epsvalue)) { report(lp, NORMAL, "presolve_preparerows: Variable bound / constraint value infeasibility in row %s.\n", get_row_name(lp, i)); status = presolve_setstatus(psdata, INFEASIBLE); break; } if(losum > lorhs+epsvalue) { set_rh_lower(lp, i, presolve_roundrhs(lp, losum, TRUE)); iRangeTighten++; } if(upsum < uprhs-epsvalue) { set_rh_upper(lp, i, presolve_roundrhs(lp, upsum, FALSE)); iRangeTighten++; } } /* Seek to tighten bounds on individual variables */ if(tightenbounds && mat_validate(mat)) { #if 1 if(j > 1) status = presolve_rowtighten(psdata, i, &iBoundTighten, FALSE); #else if((MIP_count(lp) > 0) && (j > 1)) status = presolve_rowtighten(psdata, i, &iBoundTighten, TRUE); #endif } /* Look for opportunity to convert ranged constraint to equality-type */ if(!is_constr_type(lp, i, EQ) && (get_rh_range(lp, i) < epsvalue)) { presolve_setEQ(psdata, i); iRangeTighten++; } } psdata->forceupdate |= (MYBOOL) (iBoundTighten > 0); (*nBoundTighten) += iBoundTighten+iRangeTighten; (*nSum) += iBoundTighten+iRangeTighten; return( status ); } STATIC int presolve_rows(presolverec *psdata, int *nCoeffChanged, int *nConRemove, int *nVarFixed, int *nBoundTighten, int *nSum) { lprec *lp = psdata->lp; MYBOOL candelete; int iCoeffChanged = 0, iConRemove = 0, iVarFixed = 0, iBoundTighten = 0, status = RUNNING, i,ix, j,jx, item; REAL Value1, Value2, losum, upsum, lorhs, uprhs, epsvalue = psdata->epsvalue; MATrec *mat = lp->matA; for(i = lastActiveLink(psdata->rows->varmap); (i > 0) && (status == RUNNING); ) { candelete = FALSE; /* First identify any full row infeasibilities Note: Handle singletons below to ensure that conflicting multiple singleton rows with this variable do not provoke notice of infeasibility */ j = presolve_rowlengthex(psdata, i); if((j > 1) && !psdata->forceupdate && !presolve_rowfeasible(psdata, i, FALSE)) { status = presolve_setstatus(psdata, INFEASIBLE); break; } presolve_range(lp, i, psdata->rows, &losum, &upsum); lorhs = get_rh_lower(lp, i); uprhs = get_rh_upper(lp, i); #ifdef Paranoia if((losum>uprhs+epsvalue) || (upsum= -epsvalue)) { #else /* Version that deletes bound-fixed columns here */ if((j == 1) && (uprhs-lorhs >= -epsvalue)) { #endif item = 0; jx = presolve_nextcol(psdata, i, &item); j = ROW_MAT_COLNR(jx); /* Make sure we don't have conflicting other singleton rows with this variable */ Value1 = lp->infinite; Value2 = -Value1; if(presolve_collength(psdata, j) > 1) status = presolve_boundconflict(psdata, i, j); else if(is_constr_type(lp, i, EQ)) { Value2 = ROW_MAT_VALUE(jx); Value1 = lp->orig_rhs[i] / Value2; if(Value2 < 0) swapREAL(&losum, &upsum); if((Value1 < losum / my_if(my_infinite(lp, losum), my_sign(Value2), Value2) - epsvalue) || (Value1 > upsum / my_if(my_infinite(lp, upsum), my_sign(Value2), Value2) + epsvalue)) status = presolve_setstatus(psdata, INFEASIBLE); Value2 = Value1; } /* Proceed to fix and remove variable (if it is not a SOS member) */ if(status == RUNNING) { if((fabs(Value2-Value1) < epsvalue) && (fabs(Value2) > epsvalue)) { MYBOOL isSOS = (MYBOOL) (SOS_is_member(lp->SOS, 0, j) != FALSE), deleteSOS = isSOS && presolve_candeletevar(psdata, j); if((Value1 != 0) && deleteSOS) { if(!presolve_fixSOS1(psdata, j, Value1, &iConRemove, &iVarFixed)) status = presolve_setstatus(psdata, INFEASIBLE); psdata->forceupdate = TRUE; } else { if(!presolve_colfix(psdata, j, Value1, (MYBOOL) !isSOS, NULL)) status = presolve_setstatus(psdata, INFEASIBLE); else if(isSOS && !deleteSOS) iBoundTighten++; else { presolve_colremove(psdata, j, TRUE); iVarFixed++; } } } else status = presolve_colsingleton(psdata, i, j, &iBoundTighten); } if(status == INFEASIBLE) { break; } if(psdata->forceupdate != AUTOMATIC) { /* Store dual recovery information and code for deletion */ presolve_storeDualUndo(psdata, i, j); candelete = TRUE; } } /* Delete non-empty rows and variables that are completely determined at zero */ else if((j > 0) /* Only examine non-empty rows, */ && (fabs(lp->orig_rhs[i]) < epsvalue) /* .. and the current RHS is zero, */ && ((psdata->rows->plucount[i] == 0) || (psdata->rows->negcount[i] == 0)) /* .. and the parameter signs are all equal, */ && (psdata->rows->pluneg[i] == 0) /* .. and no (quasi) free variables, */ && (is_constr_type(lp, i, EQ) #ifdef FindImpliedEqualities || (fabs(lorhs-upsum) < epsvalue) /* Convert to equalities */ || (fabs(uprhs-losum) < epsvalue) /* Convert to equalities */ #endif ) ) { /* Delete the columns we can delete */ status = presolve_rowfixzero(psdata, i, &iVarFixed); /* Then delete the row, which is redundant */ if(status == RUNNING) candelete = TRUE; } /* Check if we have a constraint made redundant through bounds on individual variables; such constraints are often referred to as "forcing constraints" */ else if((losum >= lorhs-epsvalue) && (upsum <= uprhs+epsvalue)) { /* Check if we can also fix all the variables */ if(fabs(losum-upsum) < epsvalue) { item = 0; jx = presolve_nextcol(psdata, i, &item); while((status == RUNNING) && (jx >= 0)) { j = ROW_MAT_COLNR(jx); Value1 = get_lowbo(lp, j); if(presolve_colfix(psdata, j, Value1, TRUE, &iVarFixed)) { presolve_colremove(psdata, j, TRUE); iVarFixed++; jx = presolve_nextcol(psdata, i, &item); } else status = presolve_setstatus(psdata, INFEASIBLE); } } candelete = TRUE; } /* Get next row and do the deletion of the previous, if indicated */ ix = i; i = prevActiveLink(psdata->rows->varmap, i); if(candelete) { presolve_rowremove(psdata, ix, TRUE); iConRemove++; } } /* Remove any "hanging" empty row and columns */ if(status == RUNNING) status = presolve_shrink(psdata, &iConRemove, &iVarFixed); (*nCoeffChanged) += iCoeffChanged; (*nConRemove) += iConRemove; (*nVarFixed) += iVarFixed; (*nBoundTighten) += iBoundTighten; (*nSum) += iCoeffChanged+iConRemove+iVarFixed+iBoundTighten; return( status ); } /* Top level presolve routine */ STATIC int presolve(lprec *lp) { int status = RUNNING, i, j = 0, jx = 0, jjx = 0, k, oSum, iCoeffChanged = 0, iConRemove = 0, iVarFixed = 0, iBoundTighten = 0, iSOS = 0, iSum = 0, nCoeffChanged = 0, nConRemove = 0, nVarFixed = 0, nBoundTighten = 0, nSOS = 0, nSum = 0; REAL Value1, Value2, initrhs0 = lp->orig_rhs[0]; presolverec *psdata = NULL; MATrec *mat = lp->matA; #if 0 lp->do_presolve = PRESOLVE_ROWS; report(lp, IMPORTANT, "presolve: Debug override of presolve setting to %d\n", lp->do_presolve); #endif /* Lock the variable mapping arrays and counts ahead of any row/column deletion or creation in the course of presolve, solvelp or postsolve */ if(!lp->varmap_locked) varmap_lock(lp); /* Check if we have already done presolve */ mat_validate(mat); if(lp->wasPresolved) { if(SOS_count(lp) > 0) { SOS_member_updatemap(lp->SOS); make_SOSchain(lp, (MYBOOL) ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE)); } if((lp->solvecount > 1) && (lp->bb_level < 1) && ((lp->scalemode & SCALE_DYNUPDATE) != 0)) auto_scale(lp); if(!lp->basis_valid) { crash_basis(lp); report(lp, DETAILED, "presolve: Had to repair broken basis.\n"); } lp->timepresolved = timeNow(); return(status); } /* Produce original model statistics (do hoops to produce correct stats if we have SOS'es) */ i = SOS_count(lp); if(i > 0) { SOS_member_updatemap(lp->SOS); lp->sos_vars = SOS_memberships(lp->SOS, 0); } REPORT_modelinfo(lp, TRUE, "SUBMITTED"); report(lp, NORMAL, " \n"); if(i > 0) lp->sos_vars = 0; /* Finalize basis indicators; if no basis was created earlier via set_basis or crash_basis then simply set the default basis. */ if(!lp->basis_valid) lp->var_basic[0] = AUTOMATIC; /* Flag that we are presolving */ #if 0 write_lp(lp, "test_in.lp"); /* Write to lp-formatted file for debugging */ /*write_mps(lp, "test_in.mps");*/ /* Write to lp-formatted file for debugging */ #endif /* Update inf norms and check for potential factorization trouble */ mat_computemax(mat /*, FALSE */); #if 0 Value1 = fabs(lp->negrange); if(is_obj_in_basis(lp) && (mat->dynrange < Value1) && vec_computeext(lp->orig_obj, 1, lp->columns, TRUE, &i, &j)) { /* Compute relative scale metric */ Value2 = fabs(lp->orig_obj[j]/lp->orig_obj[i]) / mat->dynrange; if(Value2 < 1.0) Value2 = 1.0 / Value2; /* Determine if we should alert modeler and possibly move the OF out of the coefficient matrix */ if((Value2 > Value1) /* Case with extreme scale difference */ #if 1 || (mat->dynrange == 1.0) /* Case where we have an all-unit coefficient matrix, possibly totally unimodular */ #endif ) if((lp->simplex_strategy & SIMPLEX_DYNAMIC) > 0) { clear_action(&lp->algopt, ALGOPT_OBJINBASIS); report(lp, NORMAL, "Moved objective function out of the basis matrix to enhance factorization accuracy.\n"); } else if(mat->dynrange > 1.0) report(lp, IMPORTANT, "Warning: Objective/matrix coefficient magnitude differences will cause inaccuracy!\n"); } #endif /* Do traditional simple presolve */ yieldformessages(lp); if((lp->do_presolve & PRESOLVE_LASTMASKMODE) == PRESOLVE_NONE) { mat_checkcounts(mat, NULL, NULL, TRUE); i = 0; } else { if(lp->full_solution == NULL) allocREAL(lp, &lp->full_solution, lp->sum_alloc+1, TRUE); /* Identify infeasible SOS'es prior to any pruning */ j = 0; for(i = 1; i <= SOS_count(lp); i++) { k = SOS_infeasible(lp->SOS, i); if(k > 0) { presolverec psdata; psdata.lp = lp; report(lp, NORMAL, "presolve: Found SOS %d (type %d) to be range-infeasible on variable %d\n", i, SOS_get_type(lp->SOS, i), k); status = presolve_setstatus(&psdata, INFEASIBLE); j++; } } if(j > 0) goto Finish; /* Create and initialize the presolve data structures */ psdata = presolve_init(lp); /* Reentry point for the outermost, computationally expensive presolve loop */ psdata->outerloops = 0; do { psdata->outerloops++; iCoeffChanged = 0; iConRemove = 0; iVarFixed = 0; iBoundTighten = 0; iSOS = 0; oSum = nSum; /* Do the middle elimination loop */ do { psdata->middleloops++; nSum += iSum; iSum = 0; /* Accumulate constraint bounds based on bounds on individual variables. */ j = 0; while(presolve_statuscheck(psdata, &status) && psdata->forceupdate) { psdata->forceupdate = FALSE; /* Update sums, but limit iteration count to avoid possible "endless" loops with only marginal bound improvements */ if(presolve_updatesums(psdata) && (j < MAX_PSBOUNDTIGHTENLOOPS)) { /* Do row preparation useful for subsequent column and row presolve operations */ if((psdata->outerloops == 1) && (psdata->middleloops == 1)) status = presolve_preparerows(psdata, &iBoundTighten, &iSum); nBoundTighten += iBoundTighten; iBoundTighten = 0; nSum += iSum; iSum = 0; j++; if(status != RUNNING) report(lp, NORMAL, "presolve: Break after bound tightening iteration %d.\n", j); } } if(status != RUNNING) break; /* Do the relatively cheap innermost elimination loop */ do { psdata->innerloops++; nSum += iSum; iSum = 0; /* Eliminate empty rows, convert row singletons to bounds, tighten bounds, and remove always satisfied rows */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_ROWS)) status = presolve_rows(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iBoundTighten, &iSum); /* Eliminate empty or fixed columns (including trivial OF column singletons) */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_COLS)) status = presolve_columns(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iBoundTighten, &iSum); /* Presolve SOS'es if possible (always do this) */ if(presolve_statuscheck(psdata, &status)) status = presolve_redundantSOS(psdata, &iBoundTighten, &iSum); } while((status == RUNNING) && (iSum > 0)); if(status != RUNNING) break; /* Merge compatible similar rows; loop backwards over every row */ if(presolve_statuscheck(psdata, &status) && (psdata->outerloops == 1) && (psdata->middleloops <= MAX_PSMERGELOOPS) && is_presolve(lp, PRESOLVE_MERGEROWS)) status = presolve_mergerows(psdata, &iConRemove, &iSum); /* Eliminate dominated rows */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_ROWDOMINATE)) presolve_rowdominance(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); /* See if we can convert some constraints to SOSes (only SOS1 handled) */ if(presolve_statuscheck(psdata, &status) && (MIP_count(lp) > 0) && is_presolve(lp, PRESOLVE_SOS)) status = presolve_SOS1(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSOS, &iSum); /* Eliminate dominated columns in set coverage models */ if(presolve_statuscheck(psdata, &status) && (lp->int_vars > 1) && is_presolve(lp, PRESOLVE_COLDOMINATE)) presolve_coldominance01(psdata, &iConRemove, &iVarFixed, &iSum); /* Aggregate compatible columns */ if(presolve_statuscheck(psdata, &status) && /*TRUE ||*/ is_presolve(lp, PRESOLVE_AGGREGATE)) presolve_aggregate(psdata, &iConRemove, &iVarFixed, &iSum); /* Eliminate free variables and implied slacks */ if(presolve_statuscheck(psdata, &status) && /* !is_presolve(lp, PRESOLVE_ELIMEQ2) && */ is_presolve(lp, PRESOLVE_IMPLIEDSLK | PRESOLVE_IMPLIEDFREE)) status = presolve_freeandslacks(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); } while((status == RUNNING) && (iSum > 0)); if(status != RUNNING) break; /* Check if we can do elimination of rank-deficient equality constraints */ if(presolve_statuscheck(psdata, &status) && (psdata->EQmap->count > 1) && is_presolve(lp, PRESOLVE_LINDEP)) { #if 0 REPORT_mat_mmsave(lp, "A.mtx", NULL, FALSE, "Constraint matrix A"); #endif presolve_singularities(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); } /* Eliminate variable and tighten bounds using 2-element EQs; note that this involves modifying the coefficients of A and can therefore be a slow operation. */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_ELIMEQ2)) { jjx = 0; do { jjx += iSum; status = presolve_elimeq2(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); } while((status == RUNNING) && (iSum > jjx)); iSum = jjx; #if 0 /* Eliminate free variables and implied slacks */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_IMPLIEDSLK | PRESOLVE_IMPLIEDFREE)) status = presolve_freeandslacks(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); #endif } /* Increase A matrix sparsity by discovering common subsets using EQs */ if(presolve_statuscheck(psdata, &status) && (psdata->EQmap->count > 0) && is_presolve(lp, PRESOLVE_SPARSER)) status = presolve_makesparser(psdata, &iCoeffChanged, &iConRemove, &iVarFixed, &iSum); /* Do GCD-based coefficient reductions (also does row scaling, even if no rhs INT truncations are possible) */ if(presolve_statuscheck(psdata, &status) && (psdata->INTmap->count > 0) && is_presolve(lp, PRESOLVE_REDUCEGCD)) if(!presolve_reduceGCD(psdata, &iCoeffChanged, &iBoundTighten, &iSum)) status = presolve_setstatus(psdata, INFEASIBLE); /* Simplify knapsack or set coverage models where OF coefficients are duplicated in the constraints. At the cost of adding helper columns, this increases sparsity and facilitates identification of lower and upper bounds. */ if(presolve_statuscheck(psdata, &status) && is_presolve(lp, PRESOLVE_KNAPSACK)) { i = iCoeffChanged; status = presolve_knapsack(psdata, &iCoeffChanged); } /* Remove any "hanging" empty row and columns */ if(status == RUNNING) status = presolve_shrink(psdata, &iConRemove, &iVarFixed); nCoeffChanged += iCoeffChanged; nConRemove += iConRemove; nVarFixed += iVarFixed; nBoundTighten += iBoundTighten; nSOS += iSOS; nSum += iSum; iSum = iConRemove + iVarFixed + iBoundTighten + iCoeffChanged; if(iSum > 0) report(lp, NORMAL, "Presolve O:%d -> Reduced rows:%5d, cols:%5d --- changed bnds:%5d, Ab:%5d.\n", psdata->outerloops, iConRemove, iVarFixed, iBoundTighten, iCoeffChanged); /* Do the outermost loop again if we were successful in this presolve sequences */ } while(presolve_statuscheck(psdata, &status) && (psdata->forceupdate || (oSum < nSum)) && (psdata->outerloops < get_presolveloops(lp)) && (psdata->rows->varmap->count+psdata->cols->varmap->count > 0)); /* Finalize presolve */ #ifdef Paranoia i = presolve_debugcheck(lp, psdata->rows->varmap, psdata->cols->varmap); if(i > 0) report(lp, SEVERE, "presolve: %d internal consistency failure%s\n", i, my_plural_std(i)); if((SOS_count(lp) > 0) && !presolve_SOScheck(psdata)) report(lp, SEVERE, "presolve: SOS sparse member mapping problem - part 1\n"); #endif /* Perform bound relaxation to reduce chance of degeneracy. */ if((status == RUNNING) && !is_presolve(lp, PRESOLVE_IMPLIEDFREE)) jjx = presolve_makefree(psdata); else jjx = 0; /* Finalize the presolve */ if(!presolve_finalize(psdata)) report(lp, SEVERE, "presolve: Unable to construct internal data representation\n"); /* Report summary information */ i = NORMAL; iVarFixed = lp->presolve_undo->orig_columns - psdata->cols->varmap->count; iConRemove = lp->presolve_undo->orig_rows - psdata->rows->varmap->count; if(nSum > 0) report(lp, i, "PRESOLVE Elimination loops performed.......... O%d:M%d:I%d\n", psdata->outerloops, psdata->middleloops, psdata->innerloops); if(nVarFixed) report(lp, i, " %8d empty or fixed variables............. %s.\n", nVarFixed, "REMOVED"); if(nConRemove) report(lp, i, " %8d empty or redundant constraints....... %s.\n", nConRemove, "REMOVED"); if(nBoundTighten) report(lp, i, " %8d bounds............................... %s.\n", nBoundTighten, "TIGHTENED"); if(nCoeffChanged) report(lp, i, " %8d matrix coefficients.................. %s.\n", nCoeffChanged, "CHANGED"); if(jjx > 0) report(lp, i, " %8d variables' final bounds.............. %s.\n", jjx, "RELAXED"); if(nSOS) report(lp, i, " %8d constraints detected as SOS1......... %s.\n", nSOS, "CONVERTED"); /* Report optimality or infeasibility */ if(status == UNBOUNDED) report(lp, NORMAL, "%20s Solution status detected............. %s.\n", "", "UNBOUNDED"); else if(status == INFEASIBLE) report(lp, NORMAL, "%20s Solution status detected............. %s.\n", "", "INFEASIBLE"); else { if(psdata->cols->varmap->count == 0) Value1 = Value2 = lp->presolve_undo->fixed_rhs[0] -initrhs0; else presolve_rangeorig(lp, 0, psdata->rows, &Value1, &Value2, -initrhs0); if((fabs(Value1 - Value2) < psdata->epsvalue) || (fabs(my_reldiff(Value1, Value2)) < psdata->epsvalue)) { if((lp->rows == 0) && (lp->columns == 0)) { status = PRESOLVED; Value1 = my_chsign(is_maxim(lp), Value1); lp->solution[0] = Value1; lp->best_solution[0] = Value1; lp->full_solution[0] = Value1; } report(lp, NORMAL, "%20s OPTIMAL solution found............... %-g", "", Value1); } else if((status == RUNNING) && (i >= NORMAL)) { char lonum[20], upnum[20]; if(my_infinite(lp, Value1)) sprintf(lonum, "%13s", "-Inf"); else sprintf(lonum, "%+12g", Value1); if(my_infinite(lp, Value2)) sprintf(upnum, "%-13s", "Inf"); else sprintf(upnum, "%+-12g", Value2); report(lp, i, "%20s [ %s < Z < %s ]\n", "", lonum, upnum); } /* Update values for dual limit and best heuristic values */ if((MIP_count(lp) > 0) || (get_Lrows(lp) > 0)) { if(is_maxim(lp)) { SETMAX(lp->bb_heuristicOF, Value1); SETMIN(lp->bb_limitOF, Value2); } else { SETMIN(lp->bb_heuristicOF, Value2); SETMAX(lp->bb_limitOF, Value1); } } } report(lp, NORMAL, " \n"); /* Clean up (but save counts of constraint types for display later) */ j = psdata->LTmap->count; jx = psdata->EQmap->count; jjx = lp->rows - j - jx; presolve_free(&psdata); } /* Signal that we are done presolving */ if((lp->usermessage != NULL) && ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != 0) && (lp->msgmask & MSG_PRESOLVE)) lp->usermessage(lp, lp->msghandle, MSG_PRESOLVE); /* Create master SOS variable list */ if(SOS_count(lp) > 0) { /*SOS_member_updatemap(lp->SOS); */ make_SOSchain(lp, (MYBOOL) ((lp->do_presolve & PRESOLVE_LASTMASKMODE) != PRESOLVE_NONE)); } /* Finalize model not identified as infeasible or unbounded */ if(status == RUNNING) { /* Resolve GUBs */ if(is_bb_mode(lp, NODE_GUBMODE)) identify_GUB(lp, TRUE); #if 0 /* Mark rows containing hidden identity matrices so that supporting factorization engines can use this structural information to boost efficiency */ if(is_algopt(lp, ALGOPT_COMPACTBPF)) lp->bfpoptimize = (MYBOOL) (assist_factorization(lp, ROWTYPE_LOGICAL, &lp->rowset1, &lp->rowno1) > 0); #endif /* Scale the model based on current settings */ auto_scale(lp); /* Crash the basis, if specified */ crash_basis(lp); /* Produce presolved model statistics */ if(nConRemove+nVarFixed+nBoundTighten+nVarFixed+nCoeffChanged > 0) { REPORT_modelinfo(lp, FALSE, "REDUCED"); if(nSum > 0) { report(lp, NORMAL, "Row-types: %7d LE, %7d GE, %7d EQ.\n", j, jjx, jx); report(lp, NORMAL, " \n"); } } } /* Optionally produce data on constraint classes */ if(lp->verbose > NORMAL) { report(lp, NORMAL, " \n"); REPORT_constraintinfo(lp, "CONSTRAINT CLASSES"); report(lp, NORMAL, " \n"); } Finish: lp->wasPresolved = TRUE; lp->timepresolved = timeNow(); #if 0 /* write_mps(lp, "test_out.mps"); */ /* Must put here due to variable name mapping */ write_lp(lp, "test_out.lp"); /* Must put here due to variable name mapping */ #endif #if 0 REPORT_debugdump(lp, "testint2.txt", FALSE); #endif return( status ); } STATIC MYBOOL postsolve(lprec *lp, int status) { /* Verify solution */ if(lp->lag_status != RUNNING) { int itemp; if(status == PRESOLVED) status = OPTIMAL; if((status == OPTIMAL) || (status == SUBOPTIMAL)) { itemp = check_solution(lp, lp->columns, lp->best_solution, lp->orig_upbo, lp->orig_lowbo, lp->epssolution); if((itemp != OPTIMAL) && (lp->spx_status == OPTIMAL)) lp->spx_status = itemp; else if((itemp == OPTIMAL) && ((status == SUBOPTIMAL) || (lp->spx_status == PRESOLVED))) lp->spx_status = status; } else if(status != PRESOLVED) { report(lp, NORMAL, "lp_solve unsuccessful after %.0f iter and a last best value of %g\n", (double) get_total_iter(lp), lp->best_solution[0]); if(lp->bb_totalnodes > 0) report(lp, NORMAL, "lp_solve explored %.0f nodes before termination\n", (double) get_total_nodes(lp)); } else lp->spx_status = OPTIMAL; /* Only rebuild primal solution here, since the dual is only computed on request */ presolve_rebuildUndo(lp, TRUE); } /* Check if we can clear the variable map */ if(varmap_canunlock(lp)) lp->varmap_locked = FALSE; #if 0 REPORT_mat_mmsave(lp, "basis.mtx", NULL, FALSE); /* Write the current basis matrix (no OF) */ #endif return( TRUE ); } lp_solve_5.5/lp_presolve.h100666 0 0 10113 11141374247 14262 0ustar usergroup#ifndef HEADER_lp_presolve #define HEADER_lp_presolve #include "lp_types.h" #include "lp_matrix.h" /* -------------------------------------------------------------------------------------------- */ /* Defines for various presolve options */ /* -------------------------------------------------------------------------------------------- */ #define MAX_PSMERGELOOPS 2 /* Max loops to merge compatible constraints */ #define MAX_PSLINDEPLOOPS 1 /* Max loops to detect linearly dependendent constraints */ #define MAX_PSBOUNDTIGHTENLOOPS 5 /* Maximumn number of loops to allow bound tightenings */ #define MIN_SOS1LENGTH 4 /* Minimum length of a constraint for conversion to SOS1 */ #if 1 #define PRESOLVE_EPSVALUE (0.1*lp->epsprimal) #else #define PRESOLVE_EPSVALUE lp->epsvalue #endif #define PRESOLVE_EPSPIVOT 1.0e-3 /* Looses robustness at values smaller than ~1.0e-3 */ #define PRESOLVE_BOUNDSLACK 10 /* Extra error recovery/tolerance margin */ #define DoPresolveRounding /* Use absolute and directed rounding (disable at own risk) */ /*#define DoPresolveRelativeTest*/ /*#define PresolveForceUpdateMax*/ /*#define DualFeasibilityLogicEQ2*/ /* Add low-order feasibility/accuracy logic to elimEQ2 */ #define DivisorIntegralityLogicEQ2 /* Always prefer integer divisors */ #define FindImpliedEqualities /* Detect equalities (default is enabled) */ #define Eq2Reldiff /*#define SavePresolveEliminated */ /* Enable to activate storage of eliminated matrix data */ /*#define UseDualPresolve */ /* Enable to use full dual information for presolve */ typedef struct _psrec { LLrec *varmap; int **next; int *empty; int *plucount; int *negcount; int *pluneg; int *infcount; REAL *plulower; REAL *neglower; REAL *pluupper; REAL *negupper; int allocsize; } psrec; typedef struct _presolverec { psrec *rows; psrec *cols; LLrec *EQmap; LLrec *LTmap; LLrec *INTmap; REAL *pv_upbo; REAL *pv_lobo; REAL *dv_upbo; REAL *dv_lobo; lprec *lp; REAL epsvalue; REAL epspivot; int innerloops; int middleloops; int outerloops; int nzdeleted; MYBOOL forceupdate; } presolverec; #ifdef __cplusplus extern "C" { #endif /* Put function headers here */ STATIC MYBOOL presolve_createUndo(lprec *lp); STATIC MYBOOL presolve_rebuildUndo(lprec *lp, MYBOOL isprimal); STATIC MYBOOL inc_presolve_space(lprec *lp, int delta, MYBOOL isrows); STATIC MYBOOL presolve_setOrig(lprec *lp, int orig_rows, int orig_cols); STATIC MYBOOL presolve_colfix(presolverec *psdata, int colnr, REAL newvalue, MYBOOL remove, int *tally); STATIC MYBOOL presolve_fillUndo(lprec *lp, int orig_rows, int orig_cols, MYBOOL setOrig); STATIC MYBOOL presolve_freeUndo(lprec *lp); STATIC MYBOOL presolve_updatesums(presolverec *psdata); INLINE int presolve_nextrow(presolverec *psdata, int colnr, int *previtem); INLINE int presolve_nextcol(presolverec *psdata, int rownr, int *previtem); STATIC presolverec *presolve_init(lprec *lp); STATIC void presolve_free(presolverec **psdata); STATIC int presolve_shrink(presolverec *psdata, int *nConRemove, int *nVarRemove); STATIC void presolve_rowremove(presolverec *psdata, int rownr, MYBOOL allowcoldelete); STATIC int presolve_colremove(presolverec *psdata, int colnr, MYBOOL allowrowdelete); STATIC MYBOOL presolve_colfixdual(presolverec *psdata, int colnr, REAL *fixValue, int *status); INLINE int presolve_rowlength(presolverec *psdata, int rownr) { int *items = psdata->rows->next[rownr]; if(items == NULL) return( 0 ); else return( items[0] ); } INLINE int presolve_collength(presolverec *psdata, int colnr) { int *items = psdata->cols->next[colnr]; if(items == NULL) return( 0 ); else return( items[0] ); } STATIC int presolve(lprec *lp); STATIC MYBOOL postsolve(lprec *lp, int status); #ifdef __cplusplus } #endif #endif /* HEADER_lp_presolve */ lp_solve_5.5/lp_price.c100666 0 0 205477 11245564376 13574 0ustar usergroup #include #include "commonlib.h" #include "lp_lib.h" #include "lp_report.h" #include "lp_pricePSE.h" #include "lp_price.h" #if libBLAS > 0 #include "myblas.h" #endif #ifdef FORTIFY # include "lp_fortify.h" #endif /* Simplex pricing utility module - w/interface for lp_solve v5.0+ ------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h, commonlib.h Release notes: v1.0.0 1 July 2004 Routines extracted from lp_lib. v1.0.1 10 July 2004 Added comparison operators for determination of entering and leaving variables. Added routines for multiple and partial pricing and made corresponding changes to colprim and rowdual. v1.0.2 20 August 2004 Implemented relative pivot size control in rowprim and rowdual. v1.1.0 15 October 2004 Added dual long step logic. v1.1.1 22 October 2004 Added bound sort order to variable selections. v1.2.0 24 March 2005 Completed multiple pricing logic. ------------------------------------------------------------------------- */ /* Comparison operators for entering and leaving variables for both the primal and dual simplexes. The functions compare a candidate variable with an incumbent. */ int CMP_CALLMODEL compareImprovementVar(const pricerec *current, const pricerec *candidate) { register int result = COMP_PREFERNONE; register lprec *lp = current->lp; register REAL testvalue, margin = PREC_IMPROVEGAP; int currentcolno, currentvarno = current->varno, candidatecolno, candidatevarno = candidate->varno; MYBOOL isdual = candidate->isdual; if(isdual) { candidatevarno = lp->var_basic[candidatevarno]; currentvarno = lp->var_basic[currentvarno]; } candidatecolno = candidatevarno - lp->rows; currentcolno = currentvarno - lp->rows; /* Do pivot-based selection unless Bland's (first index) rule is active */ if(lp->_piv_rule_ != PRICER_FIRSTINDEX) { MYBOOL candbetter; /* Find the largest value - normalize in case of the dual, since constraint violation is expressed as a negative number. */ /* Use absolute test for "small numbers", relative otherwise */ testvalue = candidate->pivot; if(fabs(testvalue) < LIMIT_ABS_REL) testvalue -= current->pivot; else testvalue = my_reldiff(testvalue, current->pivot); if(isdual) testvalue = -testvalue; candbetter = (MYBOOL) (testvalue > 0); if(candbetter) { if(testvalue > margin) result = COMP_PREFERCANDIDATE; } #if 0 /* Give more opportunity to optimize on non-primary criteria */ else if (testvalue < -margin) #else /* Give reduced opportunity to optimize on non-primary criteria */ else if (testvalue < -lp->epsvalue) #endif result = COMP_PREFERINCUMBENT; #ifdef UseSortOnBound /* Extra selection criterion based on the variable's range; variable with - DUAL: small bound out; PRIMAL: large bound in */ if(result == COMP_PREFERNONE) { testvalue = lp->upbo[candidatevarno] - lp->upbo[currentvarno]; if(testvalue < -margin) result = COMP_PREFERINCUMBENT; else if(testvalue > margin) result = COMP_PREFERCANDIDATE; result = my_chsign(isdual, result); } #endif #ifdef UseSortOnColumnLength /* Prevent long columns from entering the basis */ if(result == COMP_PREFERNONE) { if(candidatecolno > 0) testvalue = mat_collength(lp->matA, candidatecolno) + (is_obj_in_basis(lp) && (lp->obj[candidatecolno] != 0) ? 1 : 0); else testvalue = 1; if(currentcolno > 0) testvalue -= mat_collength(lp->matA, currentcolno) + (is_obj_in_basis(lp) && (lp->obj[currentcolno] != 0) ? 1 : 0); else testvalue -= 1; if(testvalue > 0) result = COMP_PREFERINCUMBENT; else if(testvalue < 0) result = COMP_PREFERCANDIDATE; result = my_chsign(isdual, result); } #endif /* Select absolute best if the non-primary criteria failed to separate */ if((result == COMP_PREFERNONE) && candbetter) { result = COMP_PREFERCANDIDATE; goto Finish; } } /* Final tie-breakers */ if(result == COMP_PREFERNONE) { /* Add randomization tie-braker */ if(lp->piv_strategy & PRICE_RANDOMIZE) { result = my_sign(PRICER_RANDFACT - rand_uniform(lp, 1.0)); if(candidatevarno < currentvarno) result = -result; } /* Resolve ties via index ordinal */ if(result == COMP_PREFERNONE) { if(candidatevarno < currentvarno) result = COMP_PREFERCANDIDATE; else /* if(candidatevarno > currentvarno) */ result = COMP_PREFERINCUMBENT; if(lp->_piv_left_) result = -result; } } Finish: return( result ); } int CMP_CALLMODEL compareSubstitutionVar(const pricerec *current, const pricerec *candidate) { register int result = COMP_PREFERNONE; register lprec *lp = current->lp; register REAL testvalue = candidate->theta, margin = current->theta; MYBOOL isdual = candidate->isdual, candbetter; int currentcolno, currentvarno = current->varno, candidatecolno, candidatevarno = candidate->varno; if(!isdual) { candidatevarno = lp->var_basic[candidatevarno]; currentvarno = lp->var_basic[currentvarno]; } candidatecolno = candidatevarno - lp->rows; currentcolno = currentvarno - lp->rows; /* Compute the ranking test metric. */ if(isdual) { testvalue = fabs(testvalue); margin = fabs(margin); } /* Use absolute test for "small numbers", relative otherwise */ if(fabs(testvalue) < LIMIT_ABS_REL) testvalue -= margin; else testvalue = my_reldiff(testvalue, margin); /* Find if the new Theta is smaller or near equal (i.e. testvalue <= eps) compared to the previous best; ties will be broken by pivot size or index NB! The margin below is essential in maintaining primal/dual feasibility during the primal/dual simplex, respectively. Sometimes a small value prevents the selection of a suitable pivot, thereby weakening the numerical stability of some models */ margin = PREC_SUBSTFEASGAP; candbetter = (MYBOOL) (testvalue < 0); if(candbetter) { if(testvalue < -margin) result = COMP_PREFERCANDIDATE; } else if(testvalue > margin) result = COMP_PREFERINCUMBENT; /* Resolve a tie */ if(result == COMP_PREFERNONE) { REAL currentpivot = fabs(current->pivot), candidatepivot = fabs(candidate->pivot); /* Handle first index / Bland's rule specially */ if(lp->_piv_rule_ == PRICER_FIRSTINDEX) { #if 1 /* Special secondary selection by pivot size (limited stability protection) */ margin = candidate->epspivot; if((candidatepivot >= margin) && (currentpivot < margin)) result = COMP_PREFERCANDIDATE; #endif } else { /* General secondary selection based on pivot size */ #if 0 if(candidatepivot > MIN_STABLEPIVOT) testvalue = my_reldiff(testvalue, currentpivot); else #endif testvalue = candidatepivot - currentpivot; if(testvalue > margin) result = COMP_PREFERCANDIDATE; else if(testvalue < -margin) result = COMP_PREFERINCUMBENT; #ifdef UseSortOnBound /* Extra selection criterion based on the variable's range; variable with - PRIMAL: small bound out; DUAL: large bound in */ if(result == COMP_PREFERNONE) { testvalue = lp->upbo[candidatevarno] - lp->upbo[currentvarno]; if(testvalue < -margin) result = COMP_PREFERCANDIDATE; else if(testvalue > margin) result = COMP_PREFERINCUMBENT; result = my_chsign(isdual, result); } #endif #ifdef UseSortOnColumnLength /* Prevent long columns from entering the basis */ if(result == COMP_PREFERNONE) { if(candidatecolno > 0) testvalue = mat_collength(lp->matA, candidatecolno) + (is_obj_in_basis(lp) && (lp->obj[candidatecolno] != 0) ? 1 : 0); else testvalue = 1; if(currentcolno > 0) testvalue -= mat_collength(lp->matA, currentcolno) + (is_obj_in_basis(lp) && (lp->obj[currentcolno] != 0) ? 1 : 0); else testvalue -= 1; if(testvalue > 0) result = COMP_PREFERCANDIDATE; else if(testvalue < 0) result = COMP_PREFERINCUMBENT; result = my_chsign(isdual, result); } #endif } } /* Select absolute best if the non-primary criteria failed to separate */ if((result == COMP_PREFERNONE) && candbetter) { result = COMP_PREFERCANDIDATE; goto Finish; } /* Final tie-breakers */ if(result == COMP_PREFERNONE) { /* Add randomization tie-braker */ if(lp->piv_strategy & PRICE_RANDOMIZE) { result = my_sign(PRICER_RANDFACT - rand_uniform(lp, 1.0)); if(candidatevarno < currentvarno) result = -result; } /* Resolve ties via index ordinal (also prefers slacks over user variables) */ if(result == COMP_PREFERNONE) { if(candidatevarno < currentvarno) result = COMP_PREFERCANDIDATE; else /* if(candidatevarno > currentvarno) */ result = COMP_PREFERINCUMBENT; if(lp->_piv_left_) result = -result; } } Finish: return( result ); } int CMP_CALLMODEL compareBoundFlipVar(const pricerec *current, const pricerec *candidate) { register REAL testvalue, margin; register int result = COMP_PREFERNONE; register lprec *lp = current->lp; MYBOOL candbetter; int currentvarno = current->varno, candidatevarno = candidate->varno; if(!current->isdual) { candidatevarno = lp->var_basic[candidatevarno]; currentvarno = lp->var_basic[currentvarno]; } /* Compute the ranking test metric. */ testvalue = candidate->theta; margin = current->theta; if(candidate->isdual) { testvalue = fabs(testvalue); margin = fabs(margin); } if(fabs(margin) < LIMIT_ABS_REL) testvalue -= margin; else testvalue = my_reldiff(testvalue, margin); /* Find if the new Theta is smaller or near equal (i.e. testvalue <= eps) compared to the previous best; ties will be broken by pivot size or index */ margin = PREC_SUBSTFEASGAP; candbetter = (MYBOOL) (testvalue < 0); if(candbetter) { if(testvalue < -margin) result = COMP_PREFERCANDIDATE; } else if(testvalue > margin) result = COMP_PREFERINCUMBENT; /* Resolve a tie */ if(result == COMP_PREFERNONE) { /* Tertiary selection based on priority for large pivot sizes */ if(result == COMP_PREFERNONE) { REAL currentpivot = fabs(current->pivot), candidatepivot = fabs(candidate->pivot); if(candidatepivot > currentpivot+margin) result = COMP_PREFERCANDIDATE; else if(candidatepivot < currentpivot-margin) result = COMP_PREFERINCUMBENT; } /* Secondary selection based on priority for narrow-bounded variables */ if(result == COMP_PREFERNONE) result = compareREAL(&(lp->upbo[currentvarno]), &(lp->upbo[candidatevarno])); } /* Select absolute best if the non-primary criteria failed to separate */ if((result == COMP_PREFERNONE) && candbetter) { result = COMP_PREFERCANDIDATE; goto Finish; } /* Quaternary selection by index value */ if(result == COMP_PREFERNONE) { if(candidatevarno < currentvarno) result = COMP_PREFERCANDIDATE; else result = COMP_PREFERINCUMBENT; if(lp->_piv_left_) result = -result; } Finish: return( result ); } /* Validity operators for entering and leaving columns for both the primal and dual simplex. All candidates must satisfy these tests to qualify to be allowed to be a subject for the comparison functions/operators. */ STATIC MYBOOL validImprovementVar(pricerec *candidate) { register REAL candidatepivot = fabs(candidate->pivot); #ifdef Paranoia return( (MYBOOL) ((candidate->varno > 0) && (candidatepivot > candidate->lp->epsvalue)) ); #else return( (MYBOOL) (candidatepivot > candidate->lp->epsvalue) ); #endif } STATIC MYBOOL validSubstitutionVar(pricerec *candidate) { register lprec *lp = candidate->lp; register REAL theta = (candidate->isdual ? fabs(candidate->theta) : candidate->theta); #ifdef Paranoia if(candidate->varno <= 0) return( FALSE ); else #endif if(fabs(candidate->pivot) >= lp->infinite) return( (MYBOOL) (theta < lp->infinite) ); else return( (MYBOOL) ((theta < lp->infinite) && (fabs(candidate->pivot) >= candidate->epspivot)) ); } int CMP_CALLMODEL compareImprovementQS(const UNIONTYPE QSORTrec *current, const UNIONTYPE QSORTrec *candidate) { return( compareImprovementVar((pricerec *) current->pvoidint2.ptr, (pricerec *) candidate->pvoidint2.ptr) ); } int CMP_CALLMODEL compareSubstitutionQS(const UNIONTYPE QSORTrec *current, const UNIONTYPE QSORTrec *candidate) { return( compareBoundFlipVar((pricerec *) current->pvoidint2.ptr, (pricerec *) candidate->pvoidint2.ptr) ); /* return( compareSubstitutionVar((pricerec *) current->self, (pricerec *) candidate->self) ); */ } /* Function to add a valid pivot candidate into the specified list */ STATIC int addCandidateVar(pricerec *candidate, multirec *multi, findCompare_func findCompare, MYBOOL allowSortedExpand) { int insertpos, delta = 1; pricerec *targetrec; /* Find the insertion point (if any) */ if((multi->freeList[0] == 0) || (multi->sorted && allowSortedExpand) || (candidate->isdual && (multi->used == 1) && ((multi->step_last >= multi->epszero) || multi_truncatingvar(multi, ((pricerec *) (multi->sortedList[0].pvoidreal.ptr))->varno))) ) { UNIONTYPE QSORTrec searchTarget; /* Make sure that the list is sorted before the search for an insertion point */ if((multi->freeList[0] == 0) && !multi->sorted) { multi->sorted = QS_execute(multi->sortedList, multi->used, findCompare, &insertpos); multi->dirty = (MYBOOL) (insertpos > 0); } /* Perform the search */ searchTarget.pvoidint2.ptr = (void *) candidate; insertpos = sizeof(searchTarget); insertpos = findIndexEx(&searchTarget, multi->sortedList-delta, multi->used, delta, insertpos, findCompare, TRUE); if(insertpos > 0) return( -1 ); insertpos = -insertpos - delta; /* Check if the candidate is worse than the worst of the list */ if(((insertpos >= multi->size) && (multi->freeList[0] == 0)) || ((insertpos == multi->used) && (!allowSortedExpand || (multi->step_last >= multi->epszero)))) return( -1 ); #ifdef Paranoia /* Do validation */ if((insertpos < 0) || (insertpos > multi->used)) return( -1 ); #endif /* Define the target for storing the candidate; Case 1: List is full and we must discard the previously worst candidate Case 2: List is not full and we simply use the next free position */ if(multi->freeList[0] == 0) targetrec = (pricerec *) multi->sortedList[multi->used-1].pvoidreal.ptr; else { delta = multi->freeList[0]--; delta = multi->freeList[delta]; targetrec = &(multi->items[delta]); } } else { delta = multi->freeList[0]--; delta = multi->freeList[delta]; targetrec = &(multi->items[delta]); insertpos = multi->used; } /* Insert the new candidate record in the data store */ MEMCOPY(targetrec, candidate, 1); /* Store the pointer data and handle tree cases: Case 1: The list is unsorted and not full; simply append pointer to list, Case 2: The list is sorted and full; insert the pointer by discarding previous last, Case 3: The list is sorted and not full; shift the inferior items down, and increment count */ if((multi->used < multi->size) && (insertpos >= multi->used)) { QS_append(multi->sortedList, insertpos, targetrec); multi->used++; } else { if(multi->used == multi->size) QS_insert(multi->sortedList, insertpos, targetrec, multi->size-1); /* Discard previous last */ else { QS_insert(multi->sortedList, insertpos, targetrec, multi->used); /* Keep previous last */ multi->used++; } } multi->active = insertpos; #ifdef Paranoia if((insertpos >= multi->size) || (insertpos >= multi->used)) report(multi->lp, SEVERE, "addCandidateVar: Insertion point beyond limit!\n"); #endif return( insertpos ); } STATIC MYBOOL findImprovementVar(pricerec *current, pricerec *candidate, MYBOOL collectMP, int *candidatecount) /* PRIMAL: Find a variable to enter the basis DUAL: Find a variable to leave the basis Allowed variable set: Any pivot PRIMAL:larger or DUAL:smaller than threshold value of 0 */ { MYBOOL Action = FALSE, #ifdef ExtractedValidityTest Accept = TRUE; #else /* Check for validity and compare result with previous best */ Accept = validImprovementVar(candidate); #endif if(Accept) { if(candidatecount != NULL) (*candidatecount)++; if(collectMP) { if(addCandidateVar(candidate, current->lp->multivars, (findCompare_func *) compareImprovementQS, FALSE) < 0) return(Action); } if(current->varno > 0) Accept = (MYBOOL) (compareImprovementVar(current, candidate) > 0); } /* Apply candidate if accepted */ if(Accept) { (*current) = *candidate; /* Force immediate acceptance for Bland's rule using the primal simplex */ if(!candidate->isdual) Action = (MYBOOL) (candidate->lp->_piv_rule_ == PRICER_FIRSTINDEX); } return(Action); } /* Bound flip variable accumulation routine */ STATIC MYBOOL collectMinorVar(pricerec *candidate, multirec *longsteps, MYBOOL isphase2, MYBOOL isbatch) { int inspos; /* 1. Check for ratio and pivot validity (to have the extra flexibility that all bound-flip candidates are also possible as basis-entering variables */ if(!validSubstitutionVar(candidate)) return( FALSE ); /* 2. If the free-list is empty we need to see if we have a better candidate, and for this the candidate list has to be sorted by merit */ if(!isbatch && !longsteps->sorted && (longsteps->used > 1) && ((longsteps->freeList[0] == 0) || multi_truncatingvar(longsteps, candidate->varno) || (longsteps->step_last >= longsteps->epszero) )) { longsteps->sorted = QS_execute(longsteps->sortedList, longsteps->used, (findCompare_func *) compareSubstitutionQS, &inspos); longsteps->dirty = (MYBOOL) (inspos > 0); if(longsteps->dirty) multi_recompute(longsteps, 0, isphase2, TRUE); } /* 3. Now handle three cases... - Add to the list when the list is not full and there is opportunity for improvement, - Check if we should replace an incumbent when the list is full, - Check if we should replace an incumbent when the list is not full, there is no room for improvement, but the current candidate is better than an incumbent. */ inspos = addCandidateVar(candidate, longsteps, (findCompare_func *) compareSubstitutionQS, TRUE); /* 4. Recompute steps and objective, and (if relevant) determine if we may be suboptimal in relation to an incumbent MILP solution. */ return( (MYBOOL) (inspos >= 0) && ((isbatch == TRUE) || multi_recompute(longsteps, inspos, isphase2, TRUE)) ); } STATIC MYBOOL findSubstitutionVar(pricerec *current, pricerec *candidate, int *candidatecount) /* PRIMAL: Find a variable to leave the basis DUAL: Find a variable to enter the basis Allowed variable set: "Equal-valued" smallest thetas! */ { MYBOOL Action = FALSE, #ifdef ExtractedValidityTest Accept = TRUE; #else /* Check for validity and comparison result with previous best */ Accept = validSubstitutionVar(candidate); #endif if(Accept) { if(candidatecount != NULL) (*candidatecount)++; if(current->varno != 0) Accept = (MYBOOL) (compareSubstitutionVar(current, candidate) > 0); } /* Apply candidate if accepted */ if(Accept) { (*current) = *candidate; /* Force immediate acceptance for Bland's rule using the dual simplex */ #ifdef ForceEarlyBlandRule if(candidate->isdual) Action = (MYBOOL) (candidate->lp->_piv_rule_ == PRICER_FIRSTINDEX); #endif } return(Action); } /* Partial pricing management routines */ STATIC partialrec *partial_createBlocks(lprec *lp, MYBOOL isrow) { partialrec *blockdata; blockdata = (partialrec *) calloc(1, sizeof(*blockdata)); blockdata->lp = lp; blockdata->blockcount = 1; blockdata->blocknow = 1; blockdata->isrow = isrow; return(blockdata); } STATIC int partial_countBlocks(lprec *lp, MYBOOL isrow) { partialrec *blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( 1 ); else return( blockdata->blockcount ); } STATIC int partial_activeBlocks(lprec *lp, MYBOOL isrow) { partialrec *blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( 1 ); else return( blockdata->blocknow ); } STATIC void partial_freeBlocks(partialrec **blockdata) { if((blockdata == NULL) || (*blockdata == NULL)) return; FREE((*blockdata)->blockend); FREE((*blockdata)->blockpos); FREE(*blockdata); } /* Function to provide for left-right or right-left scanning of entering/leaving variables; note that *end must have been initialized by the calling routine! */ STATIC void makePriceLoop(lprec *lp, int *start, int *end, int *delta) { int offset = is_piv_mode(lp, PRICE_LOOPLEFT); if((offset) || (((lp->total_iter+offset) % 2 == 0) && is_piv_mode(lp, PRICE_LOOPALTERNATE))) { *delta = -1; /* Step backwards - "left" */ swapINT(start, end); lp->_piv_left_ = TRUE; } else { *delta = 1; /* Step forwards - "right" */ lp->_piv_left_ = FALSE; } } /* Routine to verify accuracy of the current basis factorization */ STATIC MYBOOL serious_facterror(lprec *lp, REAL *bvector, int maxcols, REAL tolerance) { int i, j, ib, ie, nz, nc; REAL sum, tsum = 0, err = 0; MATrec *mat = lp->matA; if(bvector == 0) bvector = lp->bsolveVal; nc =0; nz = 0; for(i = 1; (i <= lp->rows) && (nc <= maxcols); i++) { /* Do we have a non-slack variable? (we choose to skip slacks, since they have "natural" good accuracy properties) */ j = lp->var_basic[i] - lp->rows; if(j <= 0) continue; nc++; /* Compute cross product for basic, non-slack column */ ib = mat->col_end[j-1]; ie = mat->col_end[j]; nz += ie - ib; sum = get_OF_active(lp, j+lp->rows, bvector[0]); for(; ib < ie; ib++) sum += COL_MAT_VALUE(ib)*bvector[COL_MAT_ROWNR(ib)]; /* Catch high precision early, so we don't to uneccessary work */ tsum += sum; SETMAX(err, fabs(sum)); if((tsum / nc > tolerance / 100) && (err < tolerance / 100)) break; } err /= mat->infnorm; return( (MYBOOL) (err >= tolerance) ); } /* Computation of reduced costs */ STATIC void update_reducedcosts(lprec *lp, MYBOOL isdual, int leave_nr, int enter_nr, REAL *prow, REAL *drow) { /* "Fast" update of the dual reduced cost vector; note that it must be called after the pivot operation and only applies to a major "true" iteration */ int i; REAL hold; if(isdual) { hold = -drow[enter_nr]/prow[enter_nr]; for(i=1; i <= lp->sum; i++) if(!lp->is_basic[i]) { if(i == leave_nr) drow[i] = hold; else { drow[i] += hold*prow[i]; my_roundzero(drow[i], lp->epsmachine); } } } else report(lp, SEVERE, "update_reducedcosts: Cannot update primal reduced costs!\n"); } STATIC void compute_reducedcosts(lprec *lp, MYBOOL isdual, int row_nr, int *coltarget, MYBOOL dosolve, REAL *prow, int *nzprow, REAL *drow, int *nzdrow, int roundmode) { REAL epsvalue = lp->epsvalue; /* Any larger value can produce a suboptimal result */ roundmode |= MAT_ROUNDRC; if(isdual) { bsolve_xA2(lp, coltarget, row_nr, prow, epsvalue, nzprow, /* Calculate net sensitivity given a leaving variable */ 0, drow, epsvalue, nzdrow, /* Calculate the net objective function values */ roundmode); } else { REAL *bVector; #if 1 /* Legacy mode, that is possibly a little faster */ if((lp->multivars == NULL) && (lp->P1extraDim == 0)) bVector = drow; else #endif bVector = lp->bsolveVal; if(dosolve) { bsolve(lp, 0, bVector, lp->bsolveIdx, epsvalue*DOUBLEROUND, 1.0); if(!isdual && (row_nr == 0) && (lp->improve & IMPROVE_SOLUTION) && !refactRecent(lp) && serious_facterror(lp, bVector, lp->rows, lp->epsvalue)) set_action(&lp->spx_action, ACTION_REINVERT); } prod_xA(lp, coltarget, bVector, lp->bsolveIdx, epsvalue, 1.0, drow, nzdrow, roundmode); } } /* Primal: Prevent acceptance of an entering variable when the magnitude of other candidates is also very small. Dual: Prevent acceptance of a leaving variable when the magnitude of other candidates is also very small. Both of these cases are associated with numerical stalling, which we could argue should be detected and handled by the stalling monitor routine. */ STATIC MYBOOL verify_stability(lprec *lp, MYBOOL isprimal, REAL xfeas, REAL sfeas, int nfeas) { MYBOOL testOK = TRUE; return( testOK ); #if 1 /* Try to make dual feasibility as tight as possible */ if(!isprimal) /* if(lp->P1extraVal == 0) */ { xfeas /= (1+lp->rhsmax); sfeas /= (1+lp->rhsmax); } #endif xfeas = fabs(xfeas); /* Maximum (positive) infeasibility */ /* if(xfeas < lp->epspivot) { */ if(xfeas < lp->epssolution) { REAL f; sfeas = fabs(sfeas); /* Make sum of infeasibilities positive */ xfeas = (sfeas-xfeas)/nfeas; /* Average "residual" feasibility */ f = 1 + log10((REAL) nfeas); /* Some numerical complexity scalar */ /* Numerical errors can interact to cause non-convergence, and the idea is to relax the tolerance to account for this and only marginally weakening the (user-specified) tolerance. */ if((sfeas-xfeas) < f*lp->epsprimal) testOK = FALSE; } return( testOK ); } /* Find an entering column for the case that the specified basic variable is fixed or zero - typically used for artificial variable elimination */ STATIC int find_rowReplacement(lprec *lp, int rownr, REAL *prow, int *nzprow) /* The logic in this section generally follows Chvatal: Linear Programming, p. 130 Basically, the function is a specialized coldual(). */ { int i, bestindex; REAL bestvalue; /* Solve for "local reduced cost" */ set_action(&lp->piv_strategy, PRICE_FORCEFULL); compute_reducedcosts(lp, TRUE, rownr, NULL, TRUE, prow, nzprow, NULL, NULL, MAT_ROUNDDEFAULT); clear_action(&lp->piv_strategy, PRICE_FORCEFULL); /* Find a suitably non-singular variable to enter ("most orthogonal") */ bestindex = 0; bestvalue = 0; for(i = 1; i <= lp->sum-abs(lp->P1extraDim); i++) { if(!lp->is_basic[i] && !is_fixedvar(lp, i) && (fabs(prow[i]) > bestvalue)) { bestindex = i; bestvalue = fabs(prow[i]); } } /* Prepare to update inverse and pivot/iterate (compute Bw=a) */ if(i > lp->sum-abs(lp->P1extraDim)) bestindex = 0; else fsolve(lp, bestindex, prow, nzprow, lp->epsmachine, 1.0, TRUE); return( bestindex ); } /* Find the primal simplex entering non-basic column variable */ STATIC int colprim(lprec *lp, REAL *drow, int *nzdrow, MYBOOL skipupdate, int partialloop, int *candidatecount, MYBOOL updateinfeas, REAL *xviol) { int i, ix, iy, iz, ninfeas, nloop = 0; REAL f, sinfeas, xinfeas, epsvalue = lp->epsdual; pricerec current, candidate; MYBOOL collectMP = FALSE; int *coltarget = NULL; /* Identify pivot column according to pricing strategy; set entering variable initial threshold reduced cost value to "0" */ current.pivot = lp->epsprimal; /* Minimum acceptable improvement */ current.varno = 0; current.lp = lp; current.isdual = FALSE; candidate.lp = lp; candidate.isdual = FALSE; *candidatecount = 0; /* Update local value of pivot setting and determine active multiple pricing set */ lp->_piv_rule_ = get_piv_rule(lp); doLoop: nloop++; if((lp->multivars != NULL) && ((lp->simplex_mode & SIMPLEX_PRIMAL_PRIMAL) != 0)) { collectMP = multi_mustupdate(lp->multivars); if(collectMP) { multi_restart(lp->multivars); coltarget = NULL; } else coltarget = multi_indexSet(lp->multivars, FALSE); } /* Compute reduced costs c - c*Inv(B), if necessary (i.e. the previous iteration was not a "minor" iteration/bound flip) */ if(!skipupdate) { #ifdef UsePrimalReducedCostUpdate /* Recompute from scratch only at the beginning, otherwise update */ if((lp->current_iter > 0) && (refactRecent(lp) == AUTOMATIC)) #endif compute_reducedcosts(lp, FALSE, 0, coltarget, (MYBOOL) ((nloop <= 1) || (partialloop > 1)), NULL, NULL, drow, nzdrow, MAT_ROUNDDEFAULT); } /* Loop over active partial column set; we presume that reduced costs have only been updated for columns in the active partial range. */ ix = 1; iy = nzdrow[0]; ninfeas = 0; xinfeas = 0; sinfeas = 0; makePriceLoop(lp, &ix, &iy, &iz); iy *= iz; for(; ix*iz <= iy; ix += iz) { i = nzdrow[ix]; #if 0 /* Not necessary since we masked them out in compute_reducedcosts() */ if(i > lp->sum-abs(lp->P1extraDim)) continue; #endif /* Check if the pivot candidate is on the block-list */ if(lp->rejectpivot[0] > 0) { int kk; for(kk = 1; (kk <= lp->rejectpivot[0]) && (i != lp->rejectpivot[kk]); kk++); if(kk <= lp->rejectpivot[0]) continue; } /* Retrieve the applicable reduced cost - threshold should not be smaller than 0 */ f = my_chsign(lp->is_lower[i], drow[i]); if(f <= epsvalue) continue; /* Find entering variable according to strategy (largest positive f) */ ninfeas++; SETMAX(xinfeas, f); sinfeas += f; candidate.pivot = normalizeEdge(lp, i, f, FALSE); candidate.varno = i; if(findImprovementVar(¤t, &candidate, collectMP, candidatecount)) break; } /* Check if we should loop again after a multiple pricing update */ if(lp->multivars != NULL) { if(collectMP) { if(!lp->multivars->sorted) lp->multivars->sorted = QS_execute(lp->multivars->sortedList, lp->multivars->used, (findCompare_func *) compareImprovementQS, NULL); coltarget = multi_indexSet(lp->multivars, TRUE); } else if((current.varno == 0) && (lp->multivars->retries == 0)) { ix = partial_blockStart(lp, FALSE); iy = partial_blockEnd(lp, FALSE); lp->multivars->used = 0; lp->multivars->retries++; goto doLoop; } /* Shrink the candidate list */ lp->multivars->retries = 0; if(current.varno != 0) multi_removevar(lp->multivars, current.varno); } /* Check for optimality */ if(xviol != NULL) *xviol = xinfeas; if(updateinfeas) lp->suminfeas = fabs(sinfeas); if((lp->multivars == NULL) && (current.varno > 0) && !verify_stability(lp, TRUE, xinfeas, sinfeas, ninfeas)) current.varno = 0; /* Produce statistics */ if(lp->spx_trace) { if(current.varno > 0) report(lp, DETAILED, "colprim: Column %d reduced cost = " RESULTVALUEMASK "\n", current.varno, current.pivot); else report(lp, DETAILED, "colprim: No positive reduced costs found, optimality!\n"); } return( current.varno ); } /* colprim */ /* Find the primal simplex leaving basic column variable */ STATIC int rowprim(lprec *lp, int colnr, LREAL *theta, REAL *pcol, int *nzpcol, MYBOOL forceoutEQ, REAL *xviol) { int i, ii, iy, iz, Hpass, k, *nzlist; LREAL f, savef; REAL Heps, Htheta, Hlimit, epsvalue, epspivot, p = 0.0; pricerec current, candidate; MYBOOL isupper = !lp->is_lower[colnr], HarrisTwoPass = FALSE; /* Update local value of pivot setting */ lp->_piv_rule_ = get_piv_rule(lp); if(nzpcol == NULL) nzlist = (int *) mempool_obtainVector(lp->workarrays, lp->rows+1, sizeof(*nzlist)); else nzlist = nzpcol; /* Find unconditional non-zeros and optionally compute relative size of epspivot */ epspivot = lp->epspivot; epsvalue = lp->epsvalue; Hlimit = 0; Htheta = 0; k = 0; for(i = 1; i <= lp->rows; i++) { p = fabs(pcol[i]); if(p > Hlimit) Hlimit = p; if(p > epsvalue) { k++; nzlist[k] = i; SETMAX(Htheta, p); } #ifdef Paranoia else { if(lp->spx_trace) report(lp, FULL, "rowprim: Row %d with pivot " RESULTVALUEMASK " rejected as too small\n", i, p); } #endif } if(xviol != NULL) *xviol = Htheta; Htheta = 0; /* Update non-zero list based on the new pivot threshold */ #ifdef UseRelativePivot_Primal /* epspivot *= sqrt(lp->matA->dynrange) / lp->matA->infnorm; */ epspivot /= MAX(1, sqrt(lp->matA->colmax[colnr])); iy = k; k = 0; p = 0; for(ii = 1; ii <= iy; ii++) { i = nzlist[ii]; p = fabs(pcol[i]); /* Compress the list of valid alternatives, if appropriate */ if(p > epspivot) { k++; nzlist[k] = i; } #ifdef Paranoia else { if(lp->spx_trace) report(lp, FULL, "rowprim: Row %d with pivot " RESULTVALUEMASK " rejected as too small\n", i, p); } #endif } #endif /* Initialize counters */ nzlist[0] = k; k = 0; Retry: k++; HarrisTwoPass = is_piv_mode(lp, PRICE_HARRISTWOPASS); if(HarrisTwoPass) Hpass = 1; else Hpass = 2; current.theta = lp->infinite; current.pivot = 0; current.varno = 0; current.isdual = FALSE; current.epspivot = epspivot; current.lp = lp; candidate.epspivot = epspivot; candidate.isdual = FALSE; candidate.lp = lp; savef = 0; for(; Hpass <= 2; Hpass++) { Htheta = lp->infinite; if(Hpass == 1) { Hlimit = lp->infinite; /* Don't apply any limit in the first pass */ Heps = epspivot/lp->epsprimal; /* Scaled to lp->epsprimal used in compute_theta() */ } else { Hlimit = current.theta; /* This is the smallest Theta of the first pass */ Heps = 0.0; } current.theta = lp->infinite; current.pivot = 0; current.varno = 0; savef = 0; ii = 1; iy = nzlist[0]; makePriceLoop(lp, &ii, &iy, &iz); iy *= iz; for(; ii*iz <= iy; ii += iz) { i = nzlist[ii]; f = pcol[i]; candidate.theta = f; candidate.pivot = f; candidate.varno = i; /*i =*/ compute_theta(lp, i, &candidate.theta, isupper, my_if(lp->upbo[lp->var_basic[i]] < lp->epsprimal, Heps/10, Heps), TRUE); if(fabs(candidate.theta) >= lp->infinite) { savef = f; candidate.theta = 2*lp->infinite; continue; } /* Find the candidate leaving variable according to strategy (smallest theta) */ if((Hpass == 2) && (candidate.theta > Hlimit)) continue; /* Give a slight preference to fixed variables (mainly equality slacks) */ if(forceoutEQ) { p = candidate.pivot; if(lp->upbo[lp->var_basic[i]] < lp->epsprimal) { /* Give an extra early boost to equality slack elimination, if specified */ if(forceoutEQ == AUTOMATIC) candidate.pivot *= 1.0+lp->epspivot; else candidate.pivot *= 10.0; } } if(HarrisTwoPass) { f = candidate.theta; if(Hpass == 2) candidate.theta = 1; if(findSubstitutionVar(¤t, &candidate, NULL)) break; if((Hpass == 2) && (current.varno == candidate.varno)) Htheta = f; } else if(findSubstitutionVar(¤t, &candidate, NULL)) break; /* Restore temporarily modified pivot */ if(forceoutEQ && (current.varno == candidate.varno)) current.pivot = p; } } if(HarrisTwoPass) current.theta = Htheta; /* Handle case of no available leaving variable */ if(current.varno == 0) { if(lp->upbo[colnr] >= lp->infinite) { /* Optionally try again with reduced pivot threshold level */ if(k < 2) { epspivot = epspivot / 10; goto Retry; } } else { #if 1 i = 1; while((pcol[i] >= 0) && (i <= lp->rows)) i++; if(i > lp->rows) { /* Empty column with upper bound! */ lp->is_lower[colnr] = !lp->is_lower[colnr]; /* lp->is_lower[colnr] = FALSE; */ lp->rhs[0] += lp->upbo[colnr]*pcol[0]; } else /* if(pcol[i]<0) */ { current.varno = i; } #endif } } else if(current.theta >= lp->infinite) { report(lp, IMPORTANT, "rowprim: Numeric instability pcol[%d] = %g, rhs[%d] = %g, upbo = %g\n", current.varno, savef, current.varno, lp->rhs[current.varno], lp->upbo[lp->var_basic[current.varno]]); } /* Return working array to pool */ if(nzpcol == NULL) mempool_releaseVector(lp->workarrays, (char *) nzlist, FALSE); if(lp->spx_trace) report(lp, DETAILED, "row_prim: %d, pivot size = " RESULTVALUEMASK "\n", current.varno, current.pivot); /* *theta = current.theta; */ *theta = fabs(current.theta); return(current.varno); } /* rowprim */ /* Find the dual simplex leaving basic variable */ STATIC int rowdual(lprec *lp, REAL *rhvec, MYBOOL forceoutEQ, MYBOOL updateinfeas, REAL *xviol) { int k, i, iy, iz, ii, ninfeas; register REAL rh; REAL up, lo = 0, epsvalue, sinfeas, xinfeas; pricerec current, candidate; MYBOOL collectMP = FALSE; /* Initialize */ if(rhvec == NULL) rhvec = lp->rhs; epsvalue = lp->epsdual; current.pivot = -epsvalue; /* Initialize leaving variable threshold; "less than 0" */ current.theta = 0; current.varno = 0; current.isdual = TRUE; current.lp = lp; candidate.isdual = TRUE; candidate.lp = lp; /* Loop over active partial row set */ if(is_action(lp->piv_strategy, PRICE_FORCEFULL)) { k = 1; iy = lp->rows; } else { k = partial_blockStart(lp, TRUE); iy = partial_blockEnd(lp, TRUE); } ninfeas = 0; xinfeas = 0; sinfeas = 0; makePriceLoop(lp, &k, &iy, &iz); iy *= iz; for(; k*iz <= iy; k += iz) { /* Map loop variable to target */ i = k; /* Check if the pivot candidate is on the block-list */ if(lp->rejectpivot[0] > 0) { int kk; for(kk = 1; (kk <= lp->rejectpivot[0]) && (i != lp->rejectpivot[kk]); kk++); if(kk <= lp->rejectpivot[0]) continue; } /* Set local variables - express violation as a negative number */ ii = lp->var_basic[i]; up = lp->upbo[ii]; lo = 0; rh = rhvec[i]; if(rh > up) rh = up - rh; else rh -= lo; up -= lo; /* Analyze relevant constraints ... KE version skips uninteresting alternatives and gives a noticeable speedup */ /* if((rh < -epsvalue*sqrt(lp->matA->rowmax[i])) || */ if((rh < -epsvalue) || ((forceoutEQ == TRUE) && (up < epsvalue))) { /* It causes instability to remove the "TRUE" test */ /* Accumulate stats */ ninfeas++; SETMIN(xinfeas, rh); sinfeas += rh; /* Give a slight preference to fixed variables (mainly equality slacks) */ if(up < epsvalue) { /* Break out immediately if we are directed to force slacks out of the basis */ if(forceoutEQ == TRUE) { current.varno = i; current.pivot = -1; break; } /* Give an extra early boost to equality slack elimination, if specified */ if(forceoutEQ == AUTOMATIC) rh *= 10.0; else /* .. or just the normal. marginal boost */ rh *= 1.0+lp->epspivot; } /* Select leaving variable according to strategy (the most negative/largest violation) */ candidate.pivot = normalizeEdge(lp, i, rh, TRUE); candidate.varno = i; if(findImprovementVar(¤t, &candidate, collectMP, NULL)) break; } } /* Verify infeasibility */ if(updateinfeas) lp->suminfeas = fabs(sinfeas); if((ninfeas > 1) && !verify_stability(lp, FALSE, xinfeas, sinfeas, ninfeas)) { report(lp, IMPORTANT, "rowdual: Check for reduced accuracy and tolerance settings.\n"); current.varno = 0; } /* Produce statistics */ if(lp->spx_trace) { report(lp, NORMAL, "rowdual: Infeasibility sum " RESULTVALUEMASK " in %7d constraints.\n", sinfeas, ninfeas); if(current.varno > 0) { report(lp, DETAILED, "rowdual: rhs[%d] = " RESULTVALUEMASK "\n", current.varno, lp->rhs[current.varno]); } else report(lp, FULL, "rowdual: Optimality - No primal infeasibilities found\n"); } if(xviol != NULL) *xviol = fabs(xinfeas); return(current.varno); } /* rowdual */ STATIC void longdual_testset(lprec *lp, int which, int rownr, REAL *prow, int *nzprow, REAL *drow, int *nzdrow) { int i,j; REAL F = lp->infinite; if(which == 0) { /* Maros Example-1 - raw data */ j = 1; i = lp->rows+j; lp->upbo[i] = 0; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 2; drow[i] = -1; j = 2; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -2; drow[i] = 2; j = 3; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 1; drow[i] = 5; j = 4; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = 3; drow[i] = -6; j = 5; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -4; drow[i] = -2; j = 6; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -1; drow[i] = 0; j = 7; i = lp->rows+j; lp->upbo[i] = 2; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = 1; drow[i] = 0; j = 8; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -2; drow[i] = 0; j = 9; i = lp->rows+j; lp->upbo[i] = 5; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -1; drow[i] = 4; j = 10; i = lp->rows+j; lp->upbo[i] = F; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -2; drow[i] = 10; nzprow[0] = i-lp->rows; lp->rhs[rownr] = -11; lp->upbo[lp->var_basic[rownr]] = F; lp->rhs[0] = 1; } else if(which == 1) { /* Maros Example-1 - presorted in correct order */ j = 1; i = lp->rows+j; lp->upbo[i] = 0; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 2; drow[i] = -1; j = 2; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 1; drow[i] = 5; j = 3; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -4; drow[i] = -2; j = 4; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -2; drow[i] = 0; j = 5; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -1; drow[i] = 0; j = 6; i = lp->rows+j; lp->upbo[i] = 2; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = 1; drow[i] = 0; j = 7; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -2; drow[i] = 2; j = 8; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = 3; drow[i] = -6; j = 9; i = lp->rows+j; lp->upbo[i] = 5; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -1; drow[i] = 4; j = 10; i = lp->rows+j; lp->upbo[i] = F; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -2; drow[i] = 10; nzprow[0] = i-lp->rows; lp->rhs[rownr] = -11; lp->upbo[lp->var_basic[rownr]] = F; lp->rhs[0] = 1; } else if(which == 10) { /* Maros Example-2 - raw data */ j = 1; i = lp->rows+j; lp->upbo[i] = 5; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = -2; drow[i] = 2; j = 2; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 3; drow[i] = 3; j = 3; i = lp->rows+j; lp->upbo[i] = 1; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -2; drow[i] = 0; j = 4; i = lp->rows+j; lp->upbo[i] = 2; lp->is_lower[i] = FALSE; nzprow[j] = i; prow[i] = -1; drow[i] = -2; j = 5; i = lp->rows+j; lp->upbo[i] = 2; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 1; drow[i] = 0; j = 6; i = lp->rows+j; lp->upbo[i] = F; lp->is_lower[i] = TRUE; nzprow[j] = i; prow[i] = 3; drow[i] = 9; nzprow[0] = i-lp->rows; lp->rhs[rownr] = 14; lp->upbo[lp->var_basic[rownr]] = 2; lp->rhs[0] = 6; } } /* Find the dual simplex entering non-basic variable */ STATIC int coldual(lprec *lp, int row_nr, REAL *prow, int *nzprow, REAL *drow, int *nzdrow, MYBOOL dualphase1, MYBOOL skipupdate, int *candidatecount, REAL *xviol) { int i, iy, iz, ix, k, nbound; LREAL w, g, quot; REAL viol, p, epspivot = lp->epspivot; #ifdef MachinePrecRoundRHS REAL epsvalue = lp->epsmachine; #else REAL epsvalue = lp->epsvalue; #endif pricerec current, candidate; MYBOOL isbatch = FALSE, /* Requires that lp->longsteps->size > lp->sum */ dolongsteps = (MYBOOL) (lp->longsteps != NULL); /* Initialize */ if(xviol != NULL) *xviol = lp->infinite; if(dolongsteps && !dualphase1) dolongsteps = AUTOMATIC; /* Sets Phase1 = TRUE, Phase2 = AUTOMATIC */ current.theta = lp->infinite; current.pivot = 0; current.varno = 0; current.epspivot = epspivot; current.isdual = TRUE; current.lp = lp; candidate.epspivot = epspivot; candidate.isdual = TRUE; candidate.lp = lp; *candidatecount = 0; /* Compute reduced costs */ if(!skipupdate) { #ifdef UseDualReducedCostUpdate /* Recompute from scratch only at the beginning, otherwise update */ if((lp->current_iter > 0) && (refactRecent(lp) < AUTOMATIC)) compute_reducedcosts(lp, TRUE, row_nr, NULL, TRUE, prow, nzprow, NULL, NULL, MAT_ROUNDDEFAULT); else #endif compute_reducedcosts(lp, TRUE, row_nr, NULL, TRUE, prow, nzprow, drow, nzdrow, MAT_ROUNDDEFAULT); } #if 0 /* Override all above to do in-line testing with fixed test set */ if(lp->rows > 1 && lp->columns > 10) longdual_testset(lp, 10, row_nr, prow, nzprow, drow, nzdrow); #endif /* Compute the current violation of the bounds of the outgoing variable, negative for violation of lower bound, positive for upper bound violation. (Basic variables are always lower-bounded, by lp_solve convention) */ g = 1; viol = lp->rhs[row_nr]; if(viol > 0) { /* Check if the leaving variable is >= its upper bound */ p = lp->upbo[lp->var_basic[row_nr]]; if(p < lp->infinite) { viol -= p; my_roundzero(viol, epsvalue); if(viol > 0) g = -1; } /* Do validation of numerics */ if(g == 1) { if(viol >= lp->infinite) { report(lp, IMPORTANT, "coldual: Large basic solution value %g at iter %.0f indicates numerical instability\n", lp->rhs[row_nr], (double) get_total_iter(lp)); lp->spx_status = NUMFAILURE; return( 0 ); } if(skipupdate) report(lp, DETAILED, "coldual: Inaccurate bound-flip accuracy at iter %.0f\n", (double) get_total_iter(lp)); else report(lp, SEVERE, "coldual: Leaving variable %d does not violate bounds at iter %.0f\n", row_nr, (double) get_total_iter(lp)); return( -1 ); } } /* Update local value of pivot setting */ lp->_piv_rule_ = get_piv_rule(lp); /* Condense list of relevant targets */ p = 0; k = 0; nbound = 0; ix = 1; iy = nzprow[0]; for(ix = 1; ix <= iy; ix++) { i = nzprow[ix]; w = prow[i] * g; /* Change sign if upper bound of the leaving variable is violated */ w *= 2*lp->is_lower[i] - 1; /* Change sign if the non-basic variable is currently upper-bounded */ /* Check if the candidate is worth using for anything */ if(w < -epsvalue) { /* Tally bounded variables */ if(lp->upbo[i] < lp->infinite) nbound++; /* Update the nz-index */ k++; nzprow[k] = i; SETMAX(p, -w); } #ifdef Paranoia else { if(lp->spx_trace) { report(lp, FULL, "coldual: Candidate variable prow[%d] rejected with %g too small\n", i, w); } } #endif } nzprow[0] = k; if(xviol != NULL) *xviol = p; #ifdef UseRelativePivot_Dual /* epspivot *= sqrt(lp->matA->dynrange) / lp->matA->infnorm; */ epspivot /= MAX(1, sqrt(lp->matA->rowmax[row_nr])); #endif current.epspivot = epspivot; candidate.epspivot = epspivot; /* Initialize the long-step structures if indicated */ if(dolongsteps) { if((nzprow[0] <= 1) || (nbound == 0)) { /* Don't bother */ dolongsteps = FALSE; lp->longsteps->indexSet[0] = 0; } else { multi_restart(lp->longsteps); multi_valueInit(lp->longsteps, g*viol, lp->rhs[0]); } } /* Loop over all entering column candidates */ ix = 1; iy = nzprow[0]; makePriceLoop(lp, &ix, &iy, &iz); iy *= iz; for(; ix*iz <= iy; ix += iz) { i = nzprow[ix]; /* Compute the dual ratio (prow = w and drow = cbar in Chvatal's "nomenclatura") */ w = prow[i] * g; /* Change sign if upper bound of the leaving variable is violated */ quot = -drow[i] / w; /* Remember this sign-reversal in multi_recompute! */ /* Apply the selected pivot strategy (smallest theta) */ candidate.theta = quot; /* Note that abs() is applied in findSubstitutionVar */ candidate.pivot = w; candidate.varno = i; /* Collect candidates for minor iterations/bound flips */ if(dolongsteps) { if(isbatch && (ix == iy)) isbatch = AUTOMATIC; if(collectMinorVar(&candidate, lp->longsteps, (MYBOOL) (dolongsteps == AUTOMATIC), isbatch) && lp->spx_trace) report(lp, DETAILED, "coldual: Long-dual break point with %d bound-flip variables\n", lp->longsteps->used); if(lp->spx_status == FATHOMED) return( 0 ); } /* We have a candidate for entering the basis; check if it is better than the incumbent */ else if(findSubstitutionVar(¤t, &candidate, candidatecount)) break; } /* Set entering variable and long-step bound swap variables */ if(dolongsteps) { *candidatecount = lp->longsteps->used; i = multi_enteringvar(lp->longsteps, NULL, 3); } else i = current.varno; if(lp->spx_trace) report(lp, NORMAL, "coldual: Entering column %d, reduced cost %g, pivot value %g, bound swaps %d\n", i, drow[i], prow[i], multi_used(lp->longsteps)); return( i ); } /* coldual */ INLINE REAL normalizeEdge(lprec *lp, int item, REAL edge, MYBOOL isdual) { #if 1 /* Don't use the pricer "close to home", since this can possibly worsen the final feasibility picture (mainly a Devex issue?) */ if(fabs(edge) > lp->epssolution) #endif edge /= getPricer(lp, item, isdual); if((lp->piv_strategy & PRICE_RANDOMIZE) != 0) edge *= (1.0-PRICER_RANDFACT) + PRICER_RANDFACT*rand_uniform(lp, 1.0); return( edge ); } /* Support routines for block detection and partial pricing */ STATIC int partial_findBlocks(lprec *lp, MYBOOL autodefine, MYBOOL isrow) { int i, jj, n, nb, ne, items; REAL hold, biggest, *sum = NULL; MATrec *mat = lp->matA; partialrec *blockdata; if(!mat_validate(mat)) return( 1 ); blockdata = IF(isrow, lp->rowblocks, lp->colblocks); items = IF(isrow, lp->rows, lp->columns); allocREAL(lp, &sum, items+1, FALSE); /* Loop over items and compute the average column index for each */ sum[0] = 0; for(i = 1; i <= items; i++) { n = 0; if(isrow) { nb = mat->row_end[i-1]; ne = mat->row_end[i]; } else { nb = mat->col_end[i-1]; ne = mat->col_end[i]; } n = ne-nb; sum[i] = 0; if(n > 0) { if(isrow) for(jj = nb; jj < ne; jj++) sum[i] += ROW_MAT_COLNR(jj); else for(jj = nb; jj < ne; jj++) sum[i] += COL_MAT_ROWNR(jj); sum[i] /= n; } else sum[i] = sum[i-1]; } /* Loop over items again, find largest difference and make monotone */ hold = 0; biggest = 0; for(i = 2; i <= items; i++) { hold = sum[i] - sum[i-1]; if(hold > 0) { if(hold > biggest) biggest = hold; } else hold = 0; sum[i-1] = hold; } /* Loop over items again and find differences exceeding threshold; the discriminatory power of this routine depends strongly on the magnitude of the scaling factor - from empirical evidence > 0.9 */ biggest = MAX(1, 0.9*biggest); n = 0; nb = 0; ne = 0; for(i = 1; i < items; i++) if(sum[i] > biggest) { ne += i-nb; /* Compute sum of index gaps between maxima */ nb = i; n++; /* Increment count */ } /* Clean up */ FREE(sum); /* Require that the maxima are spread "nicely" across the columns, otherwise return that there is only one monolithic block. (This is probably an area for improvement in the logic!) */ if(n > 0) { ne /= n; /* Average index gap between maxima */ i = IF(isrow, lp->columns, lp->rows); nb = i / ne; /* Another estimated block count */ if(abs(nb - n) > 2) /* Probably Ok to require equality (nb==n)*/ n = 1; else if(autodefine) /* Generate row/column break-indeces for partial pricing */ set_partialprice(lp, nb, NULL, isrow); } else n = 1; return( n ); } STATIC int partial_blockStart(lprec *lp, MYBOOL isrow) { partialrec *blockdata; blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( 1 ); else { if((blockdata->blocknow < 1) || (blockdata->blocknow > blockdata->blockcount)) blockdata->blocknow = 1; return( blockdata->blockend[blockdata->blocknow-1] ); } } STATIC int partial_blockEnd(lprec *lp, MYBOOL isrow) { partialrec *blockdata; blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( IF(isrow, lp->rows, lp->sum) ); else { if((blockdata->blocknow < 1) || (blockdata->blocknow > blockdata->blockcount)) blockdata->blocknow = 1; return( blockdata->blockend[blockdata->blocknow]-1 ); } } STATIC int partial_blockNextPos(lprec *lp, int block, MYBOOL isrow) { partialrec *blockdata; blockdata = IF(isrow, lp->rowblocks, lp->colblocks); #ifdef Paranoia if((blockdata == NULL) || (block <= 1) || (block > blockdata->blockcount)) { report(lp, SEVERE, "partial_blockNextPos: Invalid block %d specified.\n", block); return( -1 ); } #endif block--; if(blockdata->blockpos[block] == blockdata->blockend[block+1]) blockdata->blockpos[block] = blockdata->blockend[block]; else blockdata->blockpos[block]++; return( blockdata->blockpos[block] ); } STATIC MYBOOL partial_blockStep(lprec *lp, MYBOOL isrow) { partialrec *blockdata; blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( FALSE ); else if(blockdata->blocknow < blockdata->blockcount) { blockdata->blocknow++; return( TRUE); } else { blockdata->blocknow = 1; return( TRUE ); } } STATIC MYBOOL partial_isVarActive(lprec *lp, int varno, MYBOOL isrow) { partialrec *blockdata; blockdata = IF(isrow, lp->rowblocks, lp->colblocks); if(blockdata == NULL) return( TRUE ); else { return( (MYBOOL) ((varno >= blockdata->blockend[blockdata->blocknow-1]) && (varno < blockdata->blockend[blockdata->blocknow])) ); } } /* Multiple pricing routines */ STATIC multirec *multi_create(lprec *lp, MYBOOL truncinf) { multirec *multi; multi = (multirec *) calloc(1, sizeof(*multi)); if(multi != NULL) { multi->active = 1; multi->lp = lp; multi->epszero = lp->epsprimal; multi->truncinf = truncinf; } return(multi); } STATIC void multi_free(multirec **multi) { if((multi == NULL) || (*multi == NULL)) return; FREE((*multi)->items); FREE((*multi)->valueList); FREE((*multi)->indexSet); FREE((*multi)->freeList); FREE((*multi)->sortedList); FREE(*multi); } STATIC MYBOOL multi_mustupdate(multirec *multi) { return( (MYBOOL) ((multi != NULL) && (multi->used < multi->limit)) ); } STATIC MYBOOL multi_resize(multirec *multi, int blocksize, int blockdiv, MYBOOL doVlist, MYBOOL doIset) { MYBOOL ok = TRUE; if((blocksize > 1) && (blockdiv > 0)) { int oldsize = multi->size; multi->size = blocksize; if(blockdiv > 1) multi->limit += (multi->size-oldsize) / blockdiv; multi->items = (pricerec *) realloc(multi->items, (multi->size+1)*sizeof(*(multi->items))); multi->sortedList = (UNIONTYPE QSORTrec *) realloc(multi->sortedList, (multi->size+1)*sizeof(*(multi->sortedList))); ok = (multi->items != NULL) && (multi->sortedList != NULL) && allocINT(multi->lp, &(multi->freeList), multi->size+1, AUTOMATIC); if(ok) { int i, n; if(oldsize == 0) i = 0; else i = multi->freeList[0]; multi->freeList[0] = i + (multi->size-oldsize); for(n = multi->size - 1, i++; i <= multi->freeList[0]; i++, n--) multi->freeList[i] = n; } if(doVlist) ok &= allocREAL(multi->lp, &(multi->valueList), multi->size+1, AUTOMATIC); if(doIset) { ok &= allocINT(multi->lp, &(multi->indexSet), multi->size+1, AUTOMATIC); if(ok && (oldsize == 0)) multi->indexSet[0] = 0; } if(!ok) goto Undo; } else { Undo: multi->size = 0; FREE(multi->items); FREE(multi->valueList); FREE(multi->indexSet); FREE(multi->freeList); FREE(multi->sortedList); } multi->active = 1; return( ok ); } STATIC int multi_size(multirec *multi) { if(multi == NULL) return( 0 ); else return( multi->size ); } STATIC int multi_used(multirec *multi) { if(multi == NULL) return( 0 ); else return( multi->used ); } STATIC int multi_restart(multirec *multi) { int i, n = multi->used; multi->used = 0; multi->sorted = FALSE; multi->dirty = FALSE; if(multi->freeList != NULL) { for(i = 1; i <= multi->size; i++) multi->freeList[i] = multi->size - i; multi->freeList[0] = multi->size; } #if 0 if(multi->indexSet != NULL) multi->indexSet[0] = 0; #endif return( n ); } STATIC void multi_valueInit(multirec *multi, REAL step_base, REAL obj_base) { multi->step_base = multi->step_last = step_base; multi->obj_base = multi->obj_last = obj_base; #ifdef Paranoia if(step_base > 0) report(multi->lp, SEVERE, "multi_valueInit: Positive constraint violation %g provided at iteration %6.0f\n", step_base, (double) get_total_iter(multi->lp)); #endif } STATIC REAL *multi_valueList(multirec *multi) { return(multi->valueList); } STATIC int *multi_indexSet(multirec *multi, MYBOOL regenerate) { if(regenerate) multi_populateSet(multi, NULL, -1); return(multi->indexSet); } STATIC int multi_getvar(multirec *multi, int item) { #ifdef Paranoia if((item < 1) || (item >= multi->size)) return(-1); #endif return( ((pricerec *) &(multi->sortedList[item].pvoidreal.ptr))->varno ); } STATIC MYBOOL multi_recompute(multirec *multi, int index, MYBOOL isphase2, MYBOOL fullupdate) { int i, n; REAL lB, uB, Alpha, this_theta, prev_theta; lprec *lp = multi->lp; pricerec *thisprice; /* Define target update window */ if(multi->dirty) { index = 0; n = multi->used - 1; } else if(fullupdate) n = multi->used - 1; else n = index; /* Initialize accumulators from the specified update index */ if(index == 0) { multi->maxpivot = 0; multi->maxbound = 0; multi->step_last = multi->step_base; multi->obj_last = multi->obj_base; thisprice = NULL; this_theta = 0; } else { multi->obj_last = multi->valueList[index-1]; multi->step_last = multi->sortedList[index-1].pvoidreal.realval; thisprice = (pricerec *) (multi->sortedList[index-1].pvoidreal.ptr); this_theta = thisprice->theta; } /* Update step lengths and objective values */ while((index <= n) && (multi->step_last < multi->epszero)) { /* Update parameters for this loop */ prev_theta = this_theta; thisprice = (pricerec *) (multi->sortedList[index].pvoidreal.ptr); this_theta = thisprice->theta; Alpha = fabs(thisprice->pivot); uB = lp->upbo[thisprice->varno]; lB = 0; SETMAX(multi->maxpivot, Alpha); SETMAX(multi->maxbound, uB); /* Do the value updates */ if(isphase2) { multi->obj_last += (this_theta - prev_theta) * multi->step_last; /* Sign-readjusted from coldual()/Maros */ if(uB >= lp->infinite) multi->step_last = lp->infinite; else multi->step_last += Alpha*(uB-lB); } else { multi->obj_last += (this_theta - prev_theta) * multi->step_last; /* Sign-readjusted from coldual()/Maros */ multi->step_last += Alpha; } /* Store updated values at the indexed locations */ multi->sortedList[index].pvoidreal.realval = multi->step_last; multi->valueList[index] = multi->obj_last; #ifdef Paranoia if(lp->spx_trace && (multi->step_last > lp->infinite)) report(lp, SEVERE, "multi_recompute: A very large step-size %g was generated at iteration %6.0f\n", multi->step_last, (double) get_total_iter(lp)); #endif index++; } /* Discard candidates entered earlier that now make the OF worsen, and make sure that the released positions are added to the free list. */ n = index; while(n < multi->used) { i = ++multi->freeList[0]; multi->freeList[i] = (int) (((pricerec *) multi->sortedList[n].pvoidreal.ptr) - multi->items); n++; } multi->used = index; if(multi->sorted && (index == 1)) multi->sorted = FALSE; multi->dirty = FALSE; /* Return TRUE if the step is now positive */ return( (MYBOOL) (multi->step_last >= multi->epszero) ); } STATIC MYBOOL multi_truncatingvar(multirec *multi, int varnr) { return( multi->truncinf && is_infinite(multi->lp, multi->lp->upbo[varnr]) ); } STATIC MYBOOL multi_removevar(multirec *multi, int varnr) { int i = 1; int *coltarget = multi->indexSet; if(coltarget == NULL) return( FALSE ); while((i <= multi->used) && (coltarget[i] != varnr)) i++; if(i > multi->used) return( FALSE ); for(; i < multi->used; i++) coltarget[i] = coltarget[i+1]; coltarget[0]--; multi->used--; multi->dirty = TRUE; return( TRUE ); } STATIC int multi_enteringvar(multirec *multi, pricerec *current, int priority) { lprec *lp = multi->lp; int i = 0, bestindex, colnr; REAL bound, score, bestscore = -lp->infinite; REAL b1, b2, b3; pricerec *candidate, *bestcand; /* Check that we have a candidate */ multi->active = bestindex = 0; if((multi == NULL) || (multi->used == 0)) return( bestindex ); /* Check for pruning possibility of the B&B tree */ if(multi->objcheck && (lp->solutioncount > 0) && bb_better(lp, OF_WORKING | OF_PROJECTED, OF_TEST_WE)) { lp->spx_status = FATHOMED; return( bestindex ); } /* Check the trivial case */ if(multi->used == 1) { bestcand = (pricerec *) (multi->sortedList[bestindex].pvoidreal.ptr); goto Finish; } /* Set priority weights */ Redo: switch(priority) { case 0: b1 = 0.0, b2 = 0.0, b3 = 1.0; /* Only OF */ bestindex = multi->used - 2; break; case 1: b1 = 0.2, b2 = 0.3, b3 = 0.5; break; /* Emphasize OF */ case 2: b1 = 0.3, b2 = 0.5, b3 = 0.2; break; /* Emphasize bound */ case 3: b1 = 0.6, b2 = 0.2, b3 = 0.2; break; /* Emphasize pivot */ case 4: b1 = 1.0, b2 = 0.0, b3 = 0.0; break; /* Only pivot */ default: b1 = 0.4, b2 = 0.2, b3 = 0.4; /* Balanced default */ } bestcand = (pricerec *) (multi->sortedList[bestindex].pvoidreal.ptr); /* Loop over all candidates to get the best entering candidate; start at the end to try to maximize the chain length */ for(i = multi->used - 1; i >= 0; i--) { candidate = (pricerec *) (multi->sortedList[i].pvoidreal.ptr); colnr = candidate->varno; bound = lp->upbo[colnr]; score = fabs(candidate->pivot) / multi->maxpivot; score = pow(1.0 + score , b1) * pow(1.0 + log(bound / multi->maxbound + 1), b2) * pow(1.0 + (REAL) i / multi->used , b3); if(score > bestscore) { bestscore = score; bestindex = i; bestcand = candidate; } } /* Do pivot protection */ if((priority < 4) && (fabs(bestcand->pivot) < lp->epssolution)) { bestindex = 0; priority++; goto Redo; } Finish: /* Make sure we shrink the list and update */ multi->active = colnr = bestcand->varno; if(bestindex < multi->used - 1) { #if 0 /* if(lp->upbo[colnr] >= lp->infinite) */ QS_swap(multi->sortedList, bestindex, multi->used-1); multi_recompute(multi, bestindex, (bestcand->isdual == AUTOMATIC), TRUE); #else multi->used = i + 1; #endif } multi_populateSet(multi, NULL, multi->active); /* Compute the entering theta and update parameters */ score = (multi->used == 1 ? multi->step_base : multi->sortedList[multi->used-2].pvoidreal.realval); score /= bestcand->pivot; score = my_chsign(!lp->is_lower[multi->active], score); if(lp->spx_trace && (fabs(score) > 1/lp->epsprimal)) report(lp, IMPORTANT, "multi_enteringvar: A very large Theta %g was generated (pivot %g)\n", score, bestcand->pivot); multi->step_base = score; if(current != NULL) *current = *bestcand; return( multi->active ); } STATIC REAL multi_enteringtheta(multirec *multi) { return( multi->step_base ); } STATIC int multi_populateSet(multirec *multi, int **list, int excludenr) { int n = 0; if(list == NULL) list = &(multi->indexSet); if((multi->used > 0) && ((*list != NULL) || allocINT(multi->lp, list, multi->size+1, FALSE))) { int i, colnr; for(i = 0; i < multi->used; i++) { colnr = ((pricerec *) (multi->sortedList[i].pvoidreal.ptr))->varno; if((colnr != excludenr) && /* Prevent an unbounded variable from "bound-flip"; this could actually indicate that we should let the entering variable be bound-swapped (in the case that it is bounded), but we disregard this possibility here, since it brings with it issues of pivot size, etc. */ ((excludenr > 0) && (multi->lp->upbo[colnr] < multi->lp->infinite))) { n++; (*list)[n] = colnr; } } (*list)[0] = n; } return( n ); } lp_solve_5.5/lp_price.h100666 0 0 12017 11141374247 13532 0ustar usergroup#ifndef HEADER_lp_price #define HEADER_lp_price /* Local defines */ /* ------------------------------------------------------------------------- */ #define UseSortOnBound_Improve /*#define UseSortOnBound_Substitute*/ #if 0 /* Stricter feasibility-preserving tolerance; use w/ *_UseRejectionList */ #define UseRelativeFeasibility /* Use machine-precision and A-scale data */ #endif #if 0 /* Stricter pivot-selection criteria; use w/ *UseRejectionList */ #define UseRelativePivot_Primal /* In rowprim based on A-scale data */ #define UseRelativePivot_Dual /* In coldual based on A-scale data */ #endif /* Include required library headers */ /* ------------------------------------------------------------------------- */ #include "lp_types.h" #ifdef __cplusplus extern "C" { #endif /* Comparison and validity routines */ int CMP_CALLMODEL compareImprovementVar(const pricerec *current, const pricerec *candidate); int CMP_CALLMODEL compareSubstitutionVar(const pricerec *current, const pricerec *candidate); int CMP_CALLMODEL compareBoundFlipVar(const pricerec *current, const pricerec *candidate); STATIC int addCandidateVar(pricerec *candidate, multirec *multi, findCompare_func findCompare, MYBOOL allowSortedExpand); STATIC MYBOOL collectMinorVar(pricerec *candidate, multirec *longsteps, MYBOOL isphase2, MYBOOL isbatch); STATIC MYBOOL validImprovementVar(pricerec *candidate); STATIC MYBOOL validSubstitutionVar(pricerec *candidate); /* Row+column selection routines */ STATIC MYBOOL findImprovementVar(pricerec *current, pricerec *candidate, MYBOOL collectMP, int *candidatecount); STATIC MYBOOL findSubstitutionVar(pricerec *current, pricerec *candidate, int *candidatecount); INLINE REAL normalizeEdge(lprec *lp, int item, REAL edge, MYBOOL isdual); STATIC void makePriceLoop(lprec *lp, int *start, int *end, int *delta); /* Computation of reduced costs */ STATIC void update_reducedcosts(lprec *lp, MYBOOL isdual, int leave_nr, int enter_nr, REAL *prow, REAL *drow); STATIC void compute_reducedcosts(lprec *lp, MYBOOL isdual, int row_nr, int *coltarget, MYBOOL dosolve, REAL *prow, int *nzprow, REAL *drow, int *nzdrow, int roundmode); /* Leaving variable selection and entering column pricing loops */ STATIC int find_rowReplacement(lprec *lp, int rownr, REAL *prow, int *nzprow); STATIC int colprim(lprec *lp, REAL *drow, int *nzdrow, MYBOOL skipupdate, int partialloop, int *candidatecount, MYBOOL updateinfeas, REAL *xviol); STATIC int rowprim(lprec *lp, int colnr, LREAL *theta, REAL *pcol, int *nzpcol, MYBOOL forceoutEQ, REAL *xviol); STATIC int rowdual(lprec *lp, REAL *rhvec, MYBOOL forceoutEQ, MYBOOL updateinfeas, REAL *xviol); STATIC int coldual(lprec *lp, int row_nr, REAL *prow, int *nzprow, REAL *drow, int *nzdrow, MYBOOL dualphase1, MYBOOL skipupdate, int *candidatecount, REAL *xviol); /* Partial pricing management routines */ STATIC partialrec *partial_createBlocks(lprec *lp, MYBOOL isrow); STATIC int partial_countBlocks(lprec *lp, MYBOOL isrow); STATIC int partial_activeBlocks(lprec *lp, MYBOOL isrow); STATIC void partial_freeBlocks(partialrec **blockdata); /* Partial pricing utility routines */ STATIC int partial_findBlocks(lprec *lp, MYBOOL autodefine, MYBOOL isrow); STATIC int partial_blockStart(lprec *lp, MYBOOL isrow); STATIC int partial_blockEnd(lprec *lp, MYBOOL isrow); STATIC int partial_blockNextPos(lprec *lp, int block, MYBOOL isrow); STATIC MYBOOL partial_blockStep(lprec *lp, MYBOOL isrow); STATIC MYBOOL partial_isVarActive(lprec *lp, int varno, MYBOOL isrow); /* Multiple pricing / dual long step management routines */ STATIC multirec *multi_create(lprec *lp, MYBOOL truncinf); STATIC MYBOOL multi_resize(multirec *multi, int blocksize, int blockdiv, MYBOOL doVlist, MYBOOL doIset); STATIC int multi_restart(multirec *multi); STATIC int multi_size(multirec *multi); STATIC int multi_used(multirec *multi); STATIC MYBOOL multi_truncatingvar(multirec *multi, int varnr); STATIC MYBOOL multi_mustupdate(multirec *multi); STATIC void multi_valueInit(multirec *multi, REAL step_base, REAL obj_base); STATIC REAL *multi_valueList(multirec *multi); STATIC int *multi_indexSet(multirec *multi, MYBOOL regenerate); STATIC int multi_getvar(multirec *multi, int item); STATIC MYBOOL multi_recompute(multirec *multi, int index, MYBOOL isphase2, MYBOOL fullupdate); STATIC MYBOOL multi_removevar(multirec *multi, int varnr); STATIC int multi_enteringvar(multirec *multi, pricerec *current, int priority); STATIC REAL multi_enteringtheta(multirec *multi); STATIC void multi_free(multirec **multi); STATIC int multi_populateSet(multirec *multi, int **list, int excludenr); #ifdef __cplusplus } #endif #endif /* HEADER_lp_price */ lp_solve_5.5/lp_pricePSE.c100666 0 0 33051 11141374247 14076 0ustar usergroup #include #include "commonlib.h" #include "lp_lib.h" #include "lp_report.h" #include "lp_pricePSE.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Advanced simplex price scaling modules - w/interface for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h Release notes: v1.0.0 1 September 2003 Implementation of DEVEX and STEEPEST EDGE routines for the primal and dual simplex. v1.0.1 1 January 2004 Made initial value of weight of ingoing variable for the standard mode of DEVEX consistent with the initialization at restart; original version could at worst contribute to cycling. v1.0.2 23 March 2004 Added floors to Steepest Edge updates and moved tests for tiny update higher. Previous logic can be simulated by disabling the compiler define ApplySteepestEdgeMinimum. v1.1.0 1 July 2004 Renamed from lp_pricerPSE to lp_pricePSE in conjuction with the creation of a separate price library. v1.2.0 1 March 2005 Changed memory allocation routines to use standard lp_solve functions, improve error handling and return boolean status values. ---------------------------------------------------------------------------------- */ INLINE MYBOOL applyPricer(lprec *lp) { int rule = get_piv_rule(lp); return( (MYBOOL) ((rule == PRICER_DEVEX) || (rule == PRICER_STEEPESTEDGE)) ); } STATIC void simplexPricer(lprec *lp, MYBOOL isdual) { if(lp->edgeVector != NULL) lp->edgeVector[0] = (REAL) isdual; } STATIC void freePricer(lprec *lp) { FREE(lp->edgeVector); } STATIC MYBOOL resizePricer(lprec *lp) { if(!applyPricer(lp)) return( TRUE ); /* Reallocate vector for new size */ if(!allocREAL(lp, &(lp->edgeVector), lp->sum_alloc+1, AUTOMATIC)) return( FALSE ); /* Signal that we have not yet initialized the price vector */ MEMCLEAR(lp->edgeVector, lp->sum_alloc+1); lp->edgeVector[0] = -1; return( TRUE ); } STATIC MYBOOL initPricer(lprec *lp) { if(!applyPricer(lp)) return( FALSE ); /* Free any pre-existing pricer */ freePricer(lp); /* Allocate vector to fit current problem size */ return( resizePricer(lp) ); } STATIC REAL getPricer(lprec *lp, int item, MYBOOL isdual) { REAL value = 1.0; if(!applyPricer(lp)) return( value ); value = *lp->edgeVector; /* Make sure we have a price vector to use */ if(value < 0) { #ifdef Paranoia report(lp, SEVERE, "getPricer: Called without having being initialized!\n"); #endif return( 1.0 ); } /* We may be calling the primal from the dual (and vice-versa) for validation of feasibility; ignore calling origin and simply return 1 */ else if(isdual != value) { return( 1.0 ); } /* Do the normal norm retrieval */ else { if(isdual) item = lp->var_basic[item]; value = lp->edgeVector[item]; if(value == 0) { value = 1.0; report(lp, SEVERE, "getPricer: Detected a zero-valued price at index %d\n", item); } #ifdef Paranoia else if(value < 0) report(lp, SEVERE, "getPricer: Invalid %s reduced cost norm %g at index %d\n", my_if(isdual, "dual", "primal"), value, item); #endif /* Return the norm */ return( sqrt(value) ); } } STATIC MYBOOL restartPricer(lprec *lp, MYBOOL isdual) { REAL *sEdge = NULL, seNorm, hold; int i, j, m; MYBOOL isDEVEX, ok = applyPricer(lp); if(!ok) return( ok ); /* Store the active/current pricing type */ if(isdual == AUTOMATIC) isdual = (MYBOOL) lp->edgeVector[0]; else lp->edgeVector[0] = isdual; m = lp->rows; /* Determine strategy and check if we have strategy fallback for the primal */ isDEVEX = is_piv_rule(lp, PRICER_DEVEX); if(!isDEVEX && !isdual) isDEVEX = is_piv_mode(lp, PRICE_PRIMALFALLBACK); /* Check if we only need to do the simple DEVEX initialization */ if(!is_piv_mode(lp, PRICE_TRUENORMINIT)) { if(isdual) { for(i = 1; i <= m; i++) lp->edgeVector[lp->var_basic[i]] = 1.0; } else { for(i = 1; i <= lp->sum; i++) if(!lp->is_basic[i]) lp->edgeVector[i] = 1.0; } return( ok ); } /* Otherwise do the full Steepest Edge norm initialization */ ok = allocREAL(lp, &sEdge, m+1, FALSE); if(!ok) return( ok ); if(isdual) { /* Extract the rows of the basis inverse and compute their squared norms */ for(i = 1; i <= m; i++) { bsolve(lp, i, sEdge, NULL, 0, 0.0); /* Compute the edge norm */ seNorm = 0; for(j = 1; j <= m; j++) { hold = sEdge[j]; seNorm += hold*hold; } j = lp->var_basic[i]; lp->edgeVector[j] = seNorm; } } else { /* Solve a=Bb for b over all non-basic variables and compute their squared norms */ for(i = 1; i <= lp->sum; i++) { if(lp->is_basic[i]) continue; fsolve(lp, i, sEdge, NULL, 0, 0.0, FALSE); /* Compute the edge norm */ seNorm = 1; for(j = 1; j <= m; j++) { hold = sEdge[j]; seNorm += hold*hold; } lp->edgeVector[i] = seNorm; } } FREE(sEdge); return( ok ); } STATIC MYBOOL formWeights(lprec *lp, int colnr, REAL *pcol, REAL **w) /* This computes Bw = a, where B is the basis and a is a column of A */ { MYBOOL ok = allocREAL(lp, w, lp->rows+1, FALSE); if(ok) { if(pcol == NULL) fsolve(lp, colnr, *w, NULL, 0.0, 0.0, FALSE); else { MEMCOPY(*w, pcol, lp->rows+1); /* *w[0] = 0; */ /* Test */ } } /* if(pcol != NULL) { REAL cEdge, hold; int i; cEdge = 0; for(i = 1; i <= m; i++) { hold = *w[i]-pcol[i]; cEdge += hold*hold; } cEdge /= m; cEdge = sqrt(cEdge); if(cEdge > lp->epspivot) report(lp, SEVERE, "updatePricer: MRS error is %g\n", cEdge); } */ return(ok); } STATIC void freeWeights(REAL *w) { FREE(w); } STATIC MYBOOL updatePricer(lprec *lp, int rownr, int colnr, REAL *pcol, REAL *prow, int *nzprow) { REAL *vEdge = NULL, cEdge, hold, *newEdge, *w = NULL; int i, m, n, exitcol, errlevel = DETAILED; MYBOOL forceRefresh = FALSE, isDual, isDEVEX, ok = FALSE; if(!applyPricer(lp)) return(ok); /* Make sure we have something to update */ hold = lp->edgeVector[0]; if(hold < 0) return(ok); isDual = (MYBOOL) (hold > 0); /* Do common initializations and computations */ m = lp->rows; n = lp->sum; isDEVEX = is_piv_rule(lp, PRICER_DEVEX); exitcol = lp->var_basic[rownr]; /* Solve/copy Bw = a */ #if 0 ok = formWeights(lp, colnr, NULL, &w); /* Compute from scratch - Experimental */ #else ok = formWeights(lp, colnr, pcol, &w); /* Use previously computed values */ #endif if(!ok) return( ok ); /* Price norms for the dual simplex - the basic columns */ if(isDual) { REAL rw; int targetcol; /* Don't need to compute cross-products with DEVEX */ if(!isDEVEX) { ok = allocREAL(lp, &vEdge, m+1, FALSE); if(!ok) return( ok ); /* Extract the row of the inverse containing the leaving variable and then form the dot products against the other variables, i.e. "Tau" */ #if 0 /* Extract row explicitly */ bsolve(lp, rownr, vEdge, 0, 0.0); #else /* Reuse previously extracted row data */ MEMCOPY(vEdge, prow, m+1); vEdge[0] = 0; #endif lp->bfp_ftran_normal(lp, vEdge, NULL); } /* Update the squared steepest edge norms; first store some constants */ cEdge = lp->edgeVector[exitcol]; rw = w[rownr]; if(fabs(rw) < lp->epspivot) { forceRefresh = TRUE; goto Finish2; } /* Deal with the variable entering the basis to become a new leaving candidate */ hold = 1 / rw; lp->edgeVector[colnr] = (hold*hold) * cEdge; #ifdef Paranoia if(lp->edgeVector[colnr] <= lp->epsmachine) report(lp, errlevel, "updatePricer: Invalid dual norm %g at entering index %d - iteration %.0f\n", lp->edgeVector[colnr], rownr, (double) (lp->total_iter+lp->current_iter)); #endif /* Then loop over all basic variables, but skip the leaving row */ for(i = 1; i <= m; i++) { if(i == rownr) continue; targetcol = lp->var_basic[i]; hold = w[i]; if(hold == 0) continue; hold /= rw; if(fabs(hold) < lp->epsmachine) continue; newEdge = &(lp->edgeVector[targetcol]); *newEdge += (hold*hold) * cEdge; if(isDEVEX) { if((*newEdge) > DEVEX_RESTARTLIMIT) { forceRefresh = TRUE; break; } } else { *newEdge -= 2*hold*vEdge[i]; #ifdef xxApplySteepestEdgeMinimum SETMAX(*newEdge, hold*hold+1); /* Kludge; use the primal lower bound */ #else if(*newEdge <= 0) { report(lp, errlevel, "updatePricer: Invalid dual norm %g at index %d - iteration %.0f\n", *newEdge, i, (double) (lp->total_iter+lp->current_iter)); forceRefresh = TRUE; break; } #endif } } } /* Price norms for the primal simplex - the non-basic columns */ else { REAL *vTemp = NULL, *vAlpha = NULL, cAlpha; int *coltarget; ok = allocREAL(lp, &vTemp, m+1, TRUE) && allocREAL(lp, &vAlpha, n+1, TRUE); if(!ok) return( ok ); /* Check if we have strategy fallback for the primal */ if(!isDEVEX) isDEVEX = is_piv_mode(lp, PRICE_PRIMALFALLBACK); /* Initialize column target array */ coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->sum+1, sizeof(*coltarget)); ok = get_colIndexA(lp, SCAN_SLACKVARS+SCAN_USERVARS+USE_NONBASICVARS, coltarget, FALSE); if(!ok) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return( ok ); } /* Don't need to compute cross-products with DEVEX */ if(!isDEVEX) { ok = allocREAL(lp, &vEdge, n+1, TRUE); if(!ok) return( ok ); /* Compute v and then N'v */ MEMCOPY(vTemp, w, m+1); bsolve(lp, -1, vTemp, NULL, lp->epsmachine*DOUBLEROUND, 0.0); vTemp[0] = 0; prod_xA(lp, coltarget, vTemp, NULL, lp->epsmachine, 0.0, vEdge, NULL, MAT_ROUNDDEFAULT); } /* Compute Sigma and then Alpha */ bsolve(lp, rownr, vTemp, NULL, 0*DOUBLEROUND, 0.0); vTemp[0] = 0; prod_xA(lp, coltarget, vTemp, NULL, lp->epsmachine, 0.0, vAlpha, NULL, MAT_ROUNDDEFAULT); mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); /* Update the squared steepest edge norms; first store some constants */ cEdge = lp->edgeVector[colnr]; cAlpha = vAlpha[colnr]; if(fabs(cAlpha) < lp->epspivot) { forceRefresh = TRUE; goto Finish1; } /* Deal with the variable leaving the basis to become a new entry candidate */ hold = 1 / cAlpha; lp->edgeVector[exitcol] = (hold*hold) * cEdge; #ifdef Paranoia if(lp->edgeVector[exitcol] <= lp->epsmachine) report(lp, errlevel, "updatePricer: Invalid primal norm %g at leaving index %d - iteration %.0f\n", lp->edgeVector[exitcol], exitcol, (double) (lp->total_iter+lp->current_iter)); #endif /* Then loop over all non-basic variables, but skip the entering column */ for(i = 1; i <= lp->sum; i++) { if(lp->is_basic[i] || (i == colnr)) continue; hold = vAlpha[i]; if(hold == 0) continue; hold /= cAlpha; if(fabs(hold) < lp->epsmachine) continue; newEdge = &(lp->edgeVector[i]); *newEdge += (hold*hold) * cEdge; if(isDEVEX) { if((*newEdge) > DEVEX_RESTARTLIMIT) { forceRefresh = TRUE; break; } } else { *newEdge -= 2*hold*vEdge[i]; #ifdef ApplySteepestEdgeMinimum SETMAX(*newEdge, hold*hold+1); #else if(*newEdge < 0) { report(lp, errlevel, "updatePricer: Invalid primal norm %g at index %d - iteration %.0f\n", *newEdge, i, (double) (lp->total_iter+lp->current_iter)); if(lp->spx_trace) report(lp, errlevel, "Error detail: (RelAlpha=%g, vEdge=%g, cEdge=%g)\n", hold, vEdge[i], cEdge); forceRefresh = TRUE; break; } #endif } } Finish1: FREE(vAlpha); FREE(vTemp); } Finish2: FREE(vEdge); freeWeights(w); if(forceRefresh) ok = restartPricer(lp, AUTOMATIC); else ok = TRUE; return( ok ); } STATIC MYBOOL verifyPricer(lprec *lp) { REAL value; int i, n; MYBOOL ok = applyPricer(lp); if(!ok) return( ok ); ok = FALSE; /* Verify */ if(lp->edgeVector == NULL) return( ok ); value = *lp->edgeVector; if(value < 0) return( ok ); /* Check the primal */ n = 1; if(value == 0) { for(n = lp->sum; n > 0; n--) { if(lp->is_basic[n]) continue; value = lp->edgeVector[n]; if(value <= 0) break; } } /* Check the dual */ else { for(i = lp->rows; i > 0; i--) { n = lp->var_basic[i]; value = lp->edgeVector[n]; if(value <= 0) break; } } ok = (MYBOOL) (n == 0); #ifdef Paranoia if(!ok) report(lp, SEVERE, "verifyPricer: Invalid norm %g at index %d\n", value, n); #endif return( ok ); } lp_solve_5.5/lp_pricePSE.h100666 0 0 1302 11141374250 14047 0ustar usergroup#ifndef HEADER_lp_pricePSE #define HEADER_lp_pricePSE #include "lp_types.h" #define ApplySteepestEdgeMinimum #ifdef __cplusplus extern "C" { #endif /* Price norm management routines */ STATIC MYBOOL initPricer(lprec *lp); INLINE MYBOOL applyPricer(lprec *lp); STATIC void simplexPricer(lprec *lp, MYBOOL isdual); STATIC void freePricer(lprec *lp); STATIC MYBOOL resizePricer(lprec *lp); STATIC REAL getPricer(lprec *lp, int item, MYBOOL isdual); STATIC MYBOOL restartPricer(lprec *lp, MYBOOL isdual); STATIC MYBOOL updatePricer(lprec *lp, int rownr, int colnr, REAL *pcol, REAL *prow, int *nzprow); STATIC MYBOOL verifyPricer(lprec *lp); #ifdef __cplusplus } #endif #endif /* HEADER_lp_pricePSE */ lp_solve_5.5/lp_report.c100666 0 0 60470 11224160040 13726 0ustar usergroup /* Mixed integer programming optimization drivers for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Michel Berkelaar (to lp_solve v3.2), Kjell Eikland Contact: License terms: LGPL. Requires: stdarg.h, lp_lib.h Release notes: v5.0.0 3 1 January 2004 New unit isolating reporting routines. v5.2.0.0 1 December 2005 Addition of Matrix Market writing function. ---------------------------------------------------------------------------------- */ #include #include #include #include "lp_lib.h" #include "lp_scale.h" #include "commonlib.h" #include "lp_report.h" #include "mmio.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Define buffer-size controled function mapping */ # if defined _MSC_VER # define vsnprintf _vsnprintf # endif /* Various reporting functions for lp_solve */ /* ------------------------------------------------------------------------- */ /* First define general utilties for reporting and output */ char * __VACALL explain(lprec *lp, char *format, ...) { char buff[DEF_STRBUFSIZE+1]; va_list ap; va_start(ap, format); vsnprintf(buff, DEF_STRBUFSIZE, format, ap); va_end(ap); allocCHAR(lp, &(lp->ex_status), (int) strlen(buff), AUTOMATIC); strcpy(lp->ex_status, buff); return( lp->ex_status ); } void __VACALL report(lprec *lp, int level, char *format, ...) { char buff[DEF_STRBUFSIZE+1]; va_list ap; if(lp == NULL) { va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } else if(level <= lp->verbose) { if(lp->writelog != NULL) { va_start(ap, format); vsnprintf(buff, DEF_STRBUFSIZE, format, ap); va_end(ap); lp->writelog(lp, lp->loghandle, buff); } if(lp->outstream != NULL) { va_start(ap, format); vfprintf(lp->outstream, format, ap); va_end(ap); if(lp->outstream != stdout) fflush(lp->outstream); } } #ifdef xParanoia if(level == CRITICAL) raise(SIGSEGV); #endif } STATIC void print_indent(lprec *lp) { int i; report(lp, NEUTRAL, "%2d", lp->bb_level); if(lp->bb_level < 50) /* useless otherwise */ for(i = lp->bb_level; i > 0; i--) report(lp, NEUTRAL, "--"); else report(lp, NEUTRAL, " *** too deep ***"); report(lp, NEUTRAL, "> "); } /* print_indent */ STATIC void debug_print(lprec *lp, char *format, ...) { va_list ap; if(lp->bb_trace) { print_indent(lp); if (lp == NULL) { va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); fputc('\n', stderr); } else if(lp->debuginfo != NULL) { char buff[DEF_STRBUFSIZE+1]; va_start(ap, format); vsnprintf(buff, DEF_STRBUFSIZE, format, ap); va_end(ap); lp->debuginfo(lp, lp->loghandle, buff); } } } /* debug_print */ STATIC void debug_print_solution(lprec *lp) { int i; if(lp->bb_trace) for (i = lp->rows + 1; i <= lp->sum; i++) { print_indent(lp); report(lp, NEUTRAL, "%s " RESULTVALUEMASK "\n", get_col_name(lp, i - lp->rows), (double)lp->solution[i]); } } /* debug_print_solution */ STATIC void debug_print_bounds(lprec *lp, REAL *upbo, REAL *lowbo) { int i; if(lp->bb_trace) for(i = lp->rows + 1; i <= lp->sum; i++) { if(lowbo[i] == upbo[i]) { print_indent(lp); report(lp, NEUTRAL, "%s = " RESULTVALUEMASK "\n", get_col_name(lp, i - lp->rows), (double)lowbo[i]); } else { if(lowbo[i] != 0) { print_indent(lp); report(lp, NEUTRAL, "%s > " RESULTVALUEMASK "\n", get_col_name(lp, i - lp->rows), (double)lowbo[i]); } if(upbo[i] != lp->infinite) { print_indent(lp); report(lp, NEUTRAL, "%s < " RESULTVALUEMASK "\n", get_col_name(lp, i - lp->rows), (double)upbo[i]); } } } } /* debug_print_bounds */ /* List a vector of LREAL values for the given index range */ void blockWriteLREAL(FILE *output, char *label, LREAL *vector, int first, int last) { int i, k = 0; fprintf(output, "%s", label); fprintf(output, "\n"); for(i = first; i <= last; i++) { fprintf(output, " %18g", vector[i]); k++; if(my_mod(k, 4) == 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) fprintf(output, "\n"); } /* List the current user data matrix columns over the selected row range */ void blockWriteAMAT(FILE *output, const char *label, lprec* lp, int first, int last) { int i, j, k = 0; int nzb, nze, jb; double hold; MATrec *mat = lp->matA; if(!mat_validate(mat)) return; if(first < 0) first = 0; if(last < 0) last = lp->rows; fprintf(output, "%s", label); fprintf(output, "\n"); if(first == 0) { for(j = 1; j <= lp->columns; j++) { hold = get_mat(lp, 0, j); fprintf(output, " %18g", hold); k++; if(my_mod(k, 4) == 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) { fprintf(output, "\n"); k = 0; } first++; } nze = mat->row_end[first-1]; for(i = first; i <= last; i++) { nzb = nze; nze = mat->row_end[i]; if(nzb >= nze) jb = lp->columns+1; else jb = ROW_MAT_COLNR(nzb); for(j = 1; j <= lp->columns; j++) { if(j < jb) hold = 0; else { hold = get_mat(lp, i, j); nzb++; if(nzb < nze) jb = ROW_MAT_COLNR(nzb); else jb = lp->columns+1; } fprintf(output, " %18g", hold); k++; if(my_mod(k, 4) == 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) fprintf(output, "\n"); } /* List the current basis matrix columns over the selected row range */ void blockWriteBMAT(FILE *output, const char *label, lprec* lp, int first, int last) { int i, j, jb, k = 0; double hold; if(first < 0) first = 0; if(last < 0) last = lp->rows; fprintf(output, "%s", label); fprintf(output, "\n"); for(i = first; i <= last; i++) { for(j = 1; j <= lp->rows; j++) { jb = lp->var_basic[j]; if(jb <= lp->rows) { if(jb == i) hold = 1; else hold = 0; } else hold = get_mat(lp, i, j); if(i == 0) modifyOF1(lp, jb, &hold, 1); hold = unscaled_mat(lp, hold, i, jb); fprintf(output, " %18g", hold); k++; if(my_mod(k, 4) == 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) { fprintf(output, "\n"); k = 0; } } if(my_mod(k, 4) != 0) fprintf(output, "\n"); } /* Do a generic readable data dump of key lp_solve model variables; principally for run difference and debugging purposes */ MYBOOL REPORT_debugdump(lprec *lp, char *filename, MYBOOL livedata) { FILE *output = stdout; MYBOOL ok; ok = (MYBOOL) ((filename == NULL) || ((output = fopen(filename,"w")) != NULL)); if(!ok) return(ok); if((filename == NULL) && (lp->outstream != NULL)) output = lp->outstream; fprintf(output, "\nGENERAL INFORMATION\n-------------------\n\n"); fprintf(output, "Model size: %d rows (%d equalities, %d Lagrangean), %d columns (%d integers, %d SC, %d SOS, %d GUB)\n", lp->rows, lp->equalities, get_Lrows(lp), lp->columns, lp->int_vars, lp->sc_vars, SOS_count(lp), GUB_count(lp)); fprintf(output, "Data size: %d model non-zeros, %d invB non-zeros (engine is %s)\n", get_nonzeros(lp), my_if(lp->invB == NULL, 0, lp->bfp_nonzeros(lp, FALSE)), lp->bfp_name()); fprintf(output, "Internal sizes: %d rows allocated, %d columns allocated, %d columns used, %d eta length\n", lp->rows_alloc, lp->columns_alloc, lp->columns, my_if(lp->invB == NULL, 0, lp->bfp_colcount(lp))); fprintf(output, "Memory use: %d sparse matrix, %d eta\n", lp->matA->mat_alloc, my_if(lp->invB == NULL, 0, lp->bfp_memallocated(lp))); fprintf(output, "Parameters: Maximize=%d, Names used=%d, Scalingmode=%d, Presolve=%d, SimplexPivot=%d\n", is_maxim(lp), lp->names_used, lp->scalemode, lp->do_presolve, lp->piv_strategy); fprintf(output, "Precision: EpsValue=%g, EpsPrimal=%g, EpsDual=%g, EpsPivot=%g, EpsPerturb=%g\n", lp->epsvalue, lp->epsprimal, lp->epsdual, lp->epspivot, lp->epsperturb); fprintf(output, "Stability: AntiDegen=%d, Improvement=%d, Split variables at=%g\n", lp->improve, lp->anti_degen, lp->negrange); fprintf(output, "B&B settings: BB pivot rule=%d, BB branching=%s, BB strategy=%d, Integer precision=%g, MIP gaps=%g,%g\n", lp->bb_rule, my_boolstr(lp->bb_varbranch), lp->bb_floorfirst, lp->epsint, lp->mip_absgap, lp->mip_relgap); fprintf(output, "\nCORE DATA\n---------\n\n"); blockWriteINT(output, "Column starts", lp->matA->col_end, 0, lp->columns); blockWriteINT(output, "row_type", lp->row_type, 0, lp->rows); blockWriteREAL(output, "orig_rhs", lp->orig_rhs, 0, lp->rows); blockWriteREAL(output, "orig_lowbo", lp->orig_lowbo, 0, lp->sum); blockWriteREAL(output, "orig_upbo", lp->orig_upbo, 0, lp->sum); blockWriteINT(output, "row_type", lp->row_type, 0, lp->rows); blockWriteBOOL(output, "var_type", lp->var_type, 0, lp->columns, TRUE); blockWriteAMAT(output, "A", lp, 0, lp->rows); if(livedata) { fprintf(output, "\nPROCESS DATA\n------------\n\n"); blockWriteREAL(output, "Active rhs", lp->rhs, 0, lp->rows); blockWriteINT(output, "Basic variables", lp->var_basic, 0, lp->rows); blockWriteBOOL(output, "is_basic", lp->is_basic, 0, lp->sum, TRUE); blockWriteREAL(output, "lowbo", lp->lowbo, 0, lp->sum); blockWriteREAL(output, "upbo", lp->upbo, 0, lp->sum); if(lp->scalars != NULL) blockWriteREAL(output, "scalars", lp->scalars, 0, lp->sum); } if(filename != NULL) fclose(output); return(ok); } /* High level reports for model results */ void REPORT_objective(lprec *lp) { if(lp->outstream == NULL) return; if(fabs(lp->best_solution[0]) < 1e-5) fprintf(lp->outstream, "\nValue of objective function: %g\n", (double)lp->best_solution[0]); else fprintf(lp->outstream, "\nValue of objective function: %.8f\n", (double)lp->best_solution[0]); fflush(lp->outstream); } void REPORT_solution(lprec *lp, int columns) { int i, j, n; REAL value; presolveundorec *psundo = lp->presolve_undo; MYBOOL NZonly = (MYBOOL) ((lp->print_sol & AUTOMATIC) > 0); if(lp->outstream == NULL) return; fprintf(lp->outstream, "\nActual values of the variables:\n"); if(columns <= 0) columns = 2; n = 0; for(i = 1; i <= psundo->orig_columns; i++) { j = psundo->orig_rows + i; value = get_var_primalresult(lp, j); if(NZonly && (fabs(value) < lp->epsprimal)) continue; n = (n+1) % columns; fprintf(lp->outstream, "%-20s %12g", get_origcol_name(lp, i), (double) value); if(n == 0) fprintf(lp->outstream, "\n"); else fprintf(lp->outstream, " "); } fflush(lp->outstream); } /* REPORT_solution */ void REPORT_constraints(lprec *lp, int columns) { int i, n; REAL value; MYBOOL NZonly = (MYBOOL) ((lp->print_sol & AUTOMATIC) > 0); if(lp->outstream == NULL) return; if(columns <= 0) columns = 2; fprintf(lp->outstream, "\nActual values of the constraints:\n"); n = 0; for(i = 1; i <= lp->rows; i++) { value = (double)lp->best_solution[i]; if(NZonly && (fabs(value) < lp->epsprimal)) continue; n = (n+1) % columns; fprintf(lp->outstream, "%-20s %12g", get_row_name(lp, i), value); if(n == 0) fprintf(lp->outstream, "\n"); else fprintf(lp->outstream, " "); } fflush(lp->outstream); } void REPORT_duals(lprec *lp) { int i; REAL *duals, *dualsfrom, *dualstill, *objfrom, *objtill, *objfromvalue; MYBOOL ret; if(lp->outstream == NULL) return; ret = get_ptr_sensitivity_objex(lp, &objfrom, &objtill, &objfromvalue, NULL); if(ret) { fprintf(lp->outstream, "\nObjective function limits:\n"); fprintf(lp->outstream, " From Till FromValue\n"); for(i = 1; i <= lp->columns; i++) if(!is_splitvar(lp, i)) fprintf(lp->outstream, "%-20s %15.7g %15.7g %15.7g\n", get_col_name(lp, i), (double)objfrom[i - 1], (double)objtill[i - 1], (double)objfromvalue[i - 1]); } ret = get_ptr_sensitivity_rhs(lp, &duals, &dualsfrom, &dualstill); if(ret) { fprintf(lp->outstream, "\nDual values with from - till limits:\n"); fprintf(lp->outstream, " Dual value From Till\n"); for(i = 1; i <= lp->sum; i++) fprintf(lp->outstream, "%-20s %15.7g %15.7g %15.7g\n", (i <= lp->rows) ? get_row_name(lp, i) : get_col_name(lp, i - lp->rows), (double)duals[i - 1], (double)dualsfrom[i - 1], (double)dualstill[i - 1]); fflush(lp->outstream); } } /* Printing of sensitivity analysis reports */ void REPORT_extended(lprec *lp) { int i, j; REAL hold; REAL *duals, *dualsfrom, *dualstill, *objfrom, *objtill; MYBOOL ret; ret = get_ptr_sensitivity_obj(lp, &objfrom, &objtill); report(lp, NORMAL, " \n"); report(lp, NORMAL, "Primal objective:\n"); report(lp, NORMAL, " \n"); report(lp, NORMAL, " Column name Value Objective Min Max\n"); report(lp, NORMAL, " --------------------------------------------------------------------------\n"); for(j = 1; j <= lp->columns; j++) { hold = get_mat(lp,0,j); report(lp, NORMAL, " %-25s " MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK "\n", get_col_name(lp,j), my_precision(hold,lp->epsprimal), my_precision(hold*lp->best_solution[lp->rows+j],lp->epsprimal), my_precision((ret) ? objfrom[j - 1] : 0.0,lp->epsprimal), my_precision((ret) ? objtill[j - 1] : 0.0,lp->epsprimal)); } report(lp, NORMAL, " \n"); ret = get_ptr_sensitivity_rhs(lp, &duals, &dualsfrom, &dualstill); report(lp, NORMAL, "Primal variables:\n"); report(lp, NORMAL, " \n"); report(lp, NORMAL, " Column name Value Slack Min Max\n"); report(lp, NORMAL, " --------------------------------------------------------------------------\n"); for(j = 1; j <= lp->columns; j++) report(lp, NORMAL, " %-25s " MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK "\n", get_col_name(lp,j), my_precision(lp->best_solution[lp->rows+j],lp->epsprimal), my_precision(my_inflimit(lp, (ret) ? duals[lp->rows+j-1] : 0.0),lp->epsprimal), my_precision((ret) ? dualsfrom[lp->rows+j-1] : 0.0,lp->epsprimal), my_precision((ret) ? dualstill[lp->rows+j-1] : 0.0,lp->epsprimal)); report(lp, NORMAL, " \n"); report(lp, NORMAL, "Dual variables:\n"); report(lp, NORMAL, " \n"); report(lp, NORMAL, " Row name Value Slack Min Max\n"); report(lp, NORMAL, " --------------------------------------------------------------------------\n"); for(i = 1; i <= lp->rows; i++) report(lp, NORMAL, " %-25s " MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK MPSVALUEMASK "\n", get_row_name(lp,i), my_precision((ret) ? duals[i - 1] : 0.0, lp->epsprimal), my_precision(lp->best_solution[i], lp->epsprimal), my_precision((ret) ? dualsfrom[i - 1] : 0.0,lp->epsprimal), my_precision((ret) ? dualstill[i - 1] : 0.0,lp->epsprimal)); report(lp, NORMAL, " \n"); } /* A more readable lp-format report of the model; antiquated and not updated */ void REPORT_lp(lprec *lp) { int i, j; if(lp->outstream == NULL) return; fprintf(lp->outstream, "Model name: %s\n", get_lp_name(lp)); fprintf(lp->outstream, " "); for(j = 1; j <= lp->columns; j++) fprintf(lp->outstream, "%8s ", get_col_name(lp,j)); fprintf(lp->outstream, "\n%simize ", (is_maxim(lp) ? "Max" : "Min")); for(j = 1; j <= lp->columns; j++) fprintf(lp->outstream, "%8g ", get_mat(lp, 0, j)); fprintf(lp->outstream, "\n"); for(i = 1; i <= lp->rows; i++) { fprintf(lp->outstream, "%-9s ", get_row_name(lp, i)); for(j = 1; j <= lp->columns; j++) fprintf(lp->outstream, "%8g ", get_mat(lp, i, j)); if(is_constr_type(lp, i, GE)) fprintf(lp->outstream, ">= "); else if(is_constr_type(lp, i, LE)) fprintf(lp->outstream, "<= "); else fprintf(lp->outstream, " = "); fprintf(lp->outstream, "%8g", get_rh(lp, i)); if(is_constr_type(lp, i, GE)) { if(get_rh_upper(lp, i) < lp->infinite) fprintf(lp->outstream, " %s = %8g", "upbo", get_rh_upper(lp, i)); } else if(is_constr_type(lp, i, LE)) { if(get_rh_lower(lp, i) > -lp->infinite) fprintf(lp->outstream, " %s = %8g", "lowbo", get_rh_lower(lp, i)); } fprintf(lp->outstream, "\n"); } fprintf(lp->outstream, "Type "); for(i = 1; i <= lp->columns; i++) { if(is_int(lp,i)) fprintf(lp->outstream, " Int "); else fprintf(lp->outstream, " Real "); } fprintf(lp->outstream, "\nupbo "); for(i = 1; i <= lp->columns; i++) if(get_upbo(lp, i) >= lp->infinite) fprintf(lp->outstream, " Inf "); else fprintf(lp->outstream, "%8g ", get_upbo(lp, i)); fprintf(lp->outstream, "\nlowbo "); for(i = 1; i <= lp->columns; i++) if(get_lowbo(lp, i) <= -lp->infinite) fprintf(lp->outstream, " -Inf "); else fprintf(lp->outstream, "%8g ", get_lowbo(lp, i)); fprintf(lp->outstream, "\n"); fflush(lp->outstream); } /* Report the scaling factors used; extremely rarely used */ void REPORT_scales(lprec *lp) { int i, colMax; colMax = lp->columns; if(lp->outstream == NULL) return; if(lp->scaling_used) { fprintf(lp->outstream, "\nScale factors:\n"); for(i = 0; i <= lp->rows + colMax; i++) fprintf(lp->outstream, "%-20s scaled at %g\n", (i <= lp->rows) ? get_row_name(lp, i) : get_col_name(lp, i - lp->rows), (double)lp->scalars[i]); } fflush(lp->outstream); } /* Report the traditional tableau corresponding to the current basis */ MYBOOL REPORT_tableau(lprec *lp) { int j, row_nr, *coltarget; REAL *prow = NULL; FILE *stream = lp->outstream; if(lp->outstream == NULL) return(FALSE); if(!lp->model_is_valid || !has_BFP(lp) || (get_total_iter(lp) == 0) || (lp->spx_status == NOTRUN)) { lp->spx_status = NOTRUN; return(FALSE); } if(!allocREAL(lp, &prow,lp->sum + 1, TRUE)) { lp->spx_status = NOMEMORY; return(FALSE); } fprintf(stream, "\n"); fprintf(stream, "Tableau at iter %.0f:\n", (double) get_total_iter(lp)); for(j = 1; j <= lp->sum; j++) if (!lp->is_basic[j]) fprintf(stream, "%15d", (j <= lp->rows ? (j + lp->columns) * ((lp->orig_upbo[j] == 0) || (is_chsign(lp, j)) ? 1 : -1) : j - lp->rows) * (lp->is_lower[j] ? 1 : -1)); fprintf(stream, "\n"); coltarget = (int *) mempool_obtainVector(lp->workarrays, lp->columns+1, sizeof(*coltarget)); if(!get_colIndexA(lp, SCAN_USERVARS+USE_NONBASICVARS, coltarget, FALSE)) { mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); return(FALSE); } for(row_nr = 1; (row_nr <= lp->rows + 1); row_nr++) { if (row_nr <= lp->rows) fprintf(stream, "%3d", (lp->var_basic[row_nr] <= lp->rows ? (lp->var_basic[row_nr] + lp->columns) * ((lp->orig_upbo[lp->var_basic [row_nr]] == 0) || (is_chsign(lp, lp->var_basic[row_nr])) ? 1 : -1) : lp->var_basic[row_nr] - lp->rows) * (lp->is_lower[lp->var_basic [row_nr]] ? 1 : -1)); else fprintf(stream, " "); bsolve(lp, row_nr <= lp->rows ? row_nr : 0, prow, NULL, lp->epsmachine*DOUBLEROUND, 1.0); prod_xA(lp, coltarget, prow, NULL, lp->epsmachine, 1.0, prow, NULL, MAT_ROUNDDEFAULT); for(j = 1; j <= lp->rows + lp->columns; j++) if (!lp->is_basic[j]) fprintf(stream, "%15.7f", prow[j] * (lp->is_lower[j] ? 1 : -1) * (row_nr <= lp->rows ? 1 : -1)); fprintf(stream, "%15.7f", lp->rhs[row_nr <= lp->rows ? row_nr : 0] * (double) ((row_nr <= lp->rows) || (is_maxim(lp)) ? 1 : -1)); fprintf(stream, "\n"); } fflush(stream); mempool_releaseVector(lp->workarrays, (char *) coltarget, FALSE); FREE(prow); return(TRUE); } void REPORT_constraintinfo(lprec *lp, char *datainfo) { int i, tally[ROWCLASS_MAX+1]; MEMCLEAR(tally, ROWCLASS_MAX+1); for(i = 1; i <= lp->rows; i++) tally[get_constr_class(lp, i)]++; if(datainfo != NULL) report(lp, NORMAL, "%s\n", datainfo); for(i = 0; i <= ROWCLASS_MAX; i++) if(tally[i] > 0) report(lp, NORMAL, "%-15s %4d\n", get_str_constr_class(lp, i), tally[i]); } void REPORT_modelinfo(lprec *lp, MYBOOL doName, char *datainfo) { if(doName) { report(lp, NORMAL, "\nModel name: '%s' - run #%-5d\n", get_lp_name(lp), lp->solvecount); report(lp, NORMAL, "Objective: %simize(%s)\n", my_if(is_maxim(lp), "Max", "Min"), get_row_name(lp, 0)); report(lp, NORMAL, " \n"); } if(datainfo != NULL) report(lp, NORMAL, "%s\n", datainfo); report(lp, NORMAL, "Model size: %7d constraints, %7d variables, %12d non-zeros.\n", lp->rows, lp->columns, get_nonzeros(lp)); if(GUB_count(lp)+SOS_count(lp) > 0) report(lp, NORMAL, "Var-types: %7d integer, %7d semi-cont., %7d SOS.\n", lp->int_vars, lp->sc_vars, lp->sos_vars); report(lp, NORMAL, "Sets: %7d GUB, %7d SOS.\n", GUB_count(lp), SOS_count(lp)); } /* Save a matrix column subset to a MatrixMarket formatted file, say to export the basis matrix for further numerical analysis. If colndx is NULL, then the full constraint matrix is assumed. */ MYBOOL REPORT_mat_mmsave(lprec *lp, char *filename, int *colndx, MYBOOL includeOF, char *infotext) { int n, m, nz, i, j, k, kk; MATrec *mat = lp->matA; MM_typecode matcode; FILE *output = stdout; MYBOOL ok; REAL *acol = NULL; int *nzlist = NULL; /* Open file */ ok = (MYBOOL) ((filename == NULL) || ((output = fopen(filename,"w")) != NULL)); if(!ok) return(ok); if((filename == NULL) && (lp->outstream != NULL)) output = lp->outstream; /* Compute column and non-zero counts */ if(colndx == lp->var_basic) { if(!lp->basis_valid) return( FALSE ); m = lp->rows; } else if(colndx != NULL) m = colndx[0]; else m = lp->columns; n = lp->rows; nz = 0; for(j = 1; j <= m; j++) { k = (colndx == NULL ? n + j : colndx[j]); if(k > n) { k -= lp->rows; nz += mat_collength(mat, k); if(includeOF && is_OF_nz(lp, k)) nz++; } else nz++; } kk = 0; if(includeOF) { n++; /* Row count */ kk++; /* Row index offset */ } /* Initialize */ mm_initialize_typecode(&matcode); mm_set_matrix(&matcode); mm_set_coordinate(&matcode); mm_set_real(&matcode); mm_write_banner(output, matcode); mm_write_mtx_crd_size(output, n+kk, m, nz+(colndx == lp->var_basic ? 1 : 0)); /* Allocate working arrays for sparse column storage */ allocREAL(lp, &acol, n+2, FALSE); allocINT(lp, &nzlist, n+2, FALSE); /* Write the matrix non-zero values column-by-column. NOTE: matrixMarket files use 1-based indeces, i.e. first row of a vector has index 1, not 0. */ if(infotext != NULL) { fprintf(output, "%%\n"); fprintf(output, "%% %s\n", infotext); fprintf(output, "%%\n"); } if(includeOF && (colndx == lp->var_basic)) fprintf(output, "%d %d %g\n", 1, 1, 1.0); for(j = 1; j <= m; j++) { k = (colndx == NULL ? lp->rows + j : colndx[j]); if(k == 0) continue; nz = obtain_column(lp, k, acol, nzlist, NULL); for(i = 1; i <= nz; i++) { if(!includeOF && (nzlist[i] == 0)) continue; fprintf(output, "%d %d %g\n", nzlist[i]+kk, j+kk, acol[i]); } } fprintf(output, "%% End of MatrixMarket file\n"); /* Finish */ FREE(acol); FREE(nzlist); fclose(output); return(ok); } lp_solve_5.5/lp_report.h100666 0 0 2634 11141374250 13721 0ustar usergroup#ifndef HEADER_lp_report #define HEADER_lp_report #ifdef __cplusplus extern "C" { #endif /* General information functions */ char * __VACALL explain(lprec *lp, char *format, ...); void __VACALL report(lprec *lp, int level, char *format, ...); /* Prototypes for debugging and general data dumps */ void debug_print(lprec *lp, char *format, ...); void debug_print_solution(lprec *lp); void debug_print_bounds(lprec *lp, REAL *upbo, REAL *lowbo); void blockWriteLREAL(FILE *output, char *label, LREAL *vector, int first, int last); void blockWriteAMAT(FILE *output, const char *label, lprec* lp, int first, int last); void blockWriteBMAT(FILE *output, const char *label, lprec* lp, int first, int last); /* Model reporting headers */ void REPORT_objective(lprec *lp); void REPORT_solution(lprec *lp, int columns); void REPORT_constraints(lprec *lp, int columns); void REPORT_duals(lprec *lp); void REPORT_extended(lprec *lp); /* Other rarely used, but sometimes extremely useful reports */ void REPORT_constraintinfo(lprec *lp, char *datainfo); void REPORT_modelinfo(lprec *lp, MYBOOL doName, char *datainfo); void REPORT_lp(lprec *lp); MYBOOL REPORT_tableau(lprec *lp); void REPORT_scales(lprec *lp); MYBOOL REPORT_debugdump(lprec *lp, char *filename, MYBOOL livedata); MYBOOL REPORT_mat_mmsave(lprec *lp, char *filename, int *colndx, MYBOOL includeOF, char *infotext); #ifdef __cplusplus } #endif #endif /* HEADER_lp_report */ lp_solve_5.5/lp_rlp.bat100777 0 0 470 11041164230 13473 0ustar usergrouprem flex -L -l lp_rlp.l flex -L lp_rlp.l rem sed -e "s/^#line.*//g" lex.yy.c >lp_rlp.h sed -e "s/yy/lp_yy/g" lex.yy.c | sed -e "s/^#line.*//g" >lp_rlp.h rem copy lex.yy.c lp_rlp.h del lex.yy.c bison --no-lines -y lp_rlp.y sed -e "s/yy/lp_yy/g" y.tab.c >lp_rlp.c rem copy y.tab.c lp_rlp.c del y.tab.c lp_solve_5.5/lp_rlp.c100666 0 0 210423 11250515167 13240 0ustar usergroup/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with lp_yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum lp_yytokentype { VAR = 258, CONS = 259, INTCONS = 260, VARIABLECOLON = 261, INF = 262, SEC_INT = 263, SEC_BIN = 264, SEC_SEC = 265, SEC_SOS = 266, SOSDESCR = 267, SEC_FREE = 268, TOK_SIGN = 269, AR_M_OP = 270, RE_OPEQ = 271, RE_OPLE = 272, RE_OPGE = 273, END_C = 274, COMMA = 275, COLON = 276, MINIMISE = 277, MAXIMISE = 278, UNDEFINED = 279 }; #endif /* Tokens. */ #define VAR 258 #define CONS 259 #define INTCONS 260 #define VARIABLECOLON 261 #define INF 262 #define SEC_INT 263 #define SEC_BIN 264 #define SEC_SEC 265 #define SEC_SOS 266 #define SOSDESCR 267 #define SEC_FREE 268 #define TOK_SIGN 269 #define AR_M_OP 270 #define RE_OPEQ 271 #define RE_OPLE 272 #define RE_OPGE 273 #define END_C 274 #define COMMA 275 #define COLON 276 #define MINIMISE 277 #define MAXIMISE 278 #define UNDEFINED 279 /* Copy the first part of user declarations. */ #include #include #include #define scanner lp_yyscanner #define PARM lp_yyget_extra(lp_yyscanner) #define YYSTYPE int #define YY_EXTRA_TYPE parse_parm * #define YY_FATAL_ERROR(msg) lex_fatal_error(PARM, lp_yyscanner, msg) #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result = lp_input((void *) PARM, buf, max_size); #define lp_yyerror read_error #include "lpkit.h" #include "yacc_read.h" typedef struct parse_vars_s { read_modeldata_func *lp_input; void *userhandle; char HadVar, HadVar0, HadVar1, HadVar2, HasAR_M_OP, HadConstraint, Had_lineair_sum, Had_lineair_sum0, do_add_row, HadSign, OP, Sign, isign, isign0, make_neg; char state, state0; char Within_int_decl; /* TRUE when we are within an char declaration */ char Within_bin_decl; /* TRUE when we are within an bin declaration */ char Within_sec_decl; /* TRUE when we are within a sec declaration */ char Within_sos_decl; /* TRUE when we are within a sos declaration */ char Within_sos_decl1; char Within_free_decl; /* TRUE when we are within a free declaration */ short SOStype, SOStype0; /* SOS type */ int SOSNr; int SOSweight; /* SOS weight */ char *Last_var, *Last_var0; REAL f, f0, f1; } parse_vars; #ifdef FORTIFY # include "lp_fortify.h" #endif /* let's please C++ users */ #ifdef __cplusplus extern "C" { #endif #if defined MSDOS || defined __MSDOS__ || defined WINDOWS || defined _WINDOWS || defined WIN32 || defined _WIN32 #define YY_NO_UNISTD_H static int isatty(int f) { return(FALSE); } #if !defined _STDLIB_H # define _STDLIB_H #endif #endif static int __WINAPI lp_input_lp_yyin(void *fpin, char *buf, int max_size) { int result; result = fread( (char*)buf, sizeof(char), max_size, (FILE *)fpin); return(result); } static int __WINAPI lp_input(void *vpp, char *buf, int max_size) { parse_parm *pp = (parse_parm *) vpp; parse_vars *pv = (parse_vars *) pp->parse_vars; int result; result = pv->lp_input(pv->userhandle, buf, max_size); if (result < 0) lex_fatal_error(pp, pp->scanner, "read() in flex scanner failed"); return(result); } #ifdef __cplusplus }; #endif #include "lp_rlp.h" #undef lp_yylval /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define lp_yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_TRIVIAL 1 #endif /* Copy the second part of user declarations. */ /* Line 216 of yacc.c. */ #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 lp_yytype_uint8; #else typedef unsigned char lp_yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 lp_yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char lp_yytype_int8; #else typedef short int lp_yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 lp_yytype_uint16; #else typedef unsigned short int lp_yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 lp_yytype_int16; #else typedef short int lp_yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int i) #else static int YYID (i) int i; #endif { return i; } #endif #if ! defined lp_yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined _STDLIB_H \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef _STDLIB_H # define _STDLIB_H 1 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined lp_yyoverflow || YYERROR_VERBOSE */ #if (! defined lp_yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union lp_yyalloc { lp_yytype_int16 lp_yyss; YYSTYPE lp_yyvs; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union lp_yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (lp_yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T lp_yyi; \ for (lp_yyi = 0; lp_yyi < (Count); lp_yyi++) \ (To)[lp_yyi] = (From)[lp_yyi]; \ } \ while (YYID (0)) # endif # endif /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T lp_yynewbytes; \ YYCOPY (&lp_yyptr->Stack, Stack, lp_yysize); \ Stack = &lp_yyptr->Stack; \ lp_yynewbytes = lp_yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ lp_yyptr += lp_yynewbytes / sizeof (*lp_yyptr); \ } \ while (YYID (0)) #endif /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 115 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 25 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 56 /* YYNRULES -- Number of rules. */ #define YYNRULES 89 /* YYNRULES -- Number of states. */ #define YYNSTATES 123 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 279 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? lp_yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const lp_yytype_uint8 lp_yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const lp_yytype_uint8 lp_yyprhs[] = { 0, 0, 3, 4, 5, 10, 13, 16, 18, 21, 23, 25, 27, 29, 31, 34, 36, 37, 41, 42, 43, 44, 53, 55, 56, 57, 63, 65, 67, 69, 70, 74, 75, 78, 80, 83, 86, 88, 89, 93, 95, 97, 99, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 127, 129, 131, 133, 135, 137, 138, 142, 143, 149, 151, 154, 156, 157, 161, 163, 164, 169, 171, 174, 176, 178, 180, 184, 186, 188, 190, 191, 193, 195, 198, 202, 205, 208, 211 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const lp_yytype_int8 lp_yyrhs[] = { 27, 0, -1, -1, -1, 28, 29, 32, 58, -1, 23, 30, -1, 22, 30, -1, 30, -1, 31, 19, -1, 26, -1, 46, -1, 26, -1, 33, -1, 34, -1, 33, 34, -1, 36, -1, -1, 6, 35, 36, -1, -1, -1, -1, 43, 37, 52, 38, 44, 39, 40, 19, -1, 26, -1, -1, -1, 52, 41, 53, 42, 57, -1, 26, -1, 44, -1, 46, -1, -1, 7, 45, 57, -1, -1, 47, 48, -1, 49, -1, 48, 49, -1, 55, 50, -1, 54, -1, -1, 56, 51, 3, -1, 16, -1, 17, -1, 18, -1, 55, 54, -1, 7, -1, 5, -1, 4, -1, 26, -1, 14, -1, 26, -1, 15, -1, 26, -1, 26, -1, 59, -1, 61, -1, 59, 61, -1, 8, -1, 9, -1, 10, -1, 11, -1, 13, -1, -1, 60, 62, 65, -1, -1, 64, 66, 71, 68, 19, -1, 63, -1, 65, 63, -1, 26, -1, -1, 12, 67, 77, -1, 26, -1, -1, 17, 5, 69, 70, -1, 26, -1, 21, 5, -1, 26, -1, 72, -1, 78, -1, 72, 73, 78, -1, 26, -1, 20, -1, 26, -1, -1, 26, -1, 26, -1, 3, 74, -1, 6, 75, 79, -1, 54, 76, -1, 77, 80, -1, 3, 74, -1, 6, 75, 54, 76, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const lp_yytype_uint16 lp_yyrline[] = { 0, 116, 116, 120, 120, 145, 149, 153, 156, 170, 171, 201, 202, 205, 206, 210, 212, 211, 224, 232, 242, 223, 288, 298, 311, 297, 342, 355, 364, 366, 365, 376, 376, 400, 401, 405, 444, 452, 451, 470, 470, 470, 473, 475, 489, 489, 492, 500, 510, 517, 526, 547, 548, 551, 552, 555, 555, 555, 555, 555, 560, 559, 570, 570, 598, 599, 602, 604, 603, 614, 626, 624, 643, 650, 660, 661, 664, 665, 670, 671, 674, 703, 724, 749, 770, 772, 777, 779, 784, 786 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const lp_yytname[] = { "$end", "error", "$undefined", "VAR", "CONS", "INTCONS", "VARIABLECOLON", "INF", "SEC_INT", "SEC_BIN", "SEC_SEC", "SEC_SOS", "SOSDESCR", "SEC_FREE", "TOK_SIGN", "AR_M_OP", "RE_OPEQ", "RE_OPLE", "RE_OPGE", "END_C", "COMMA", "COLON", "MINIMISE", "MAXIMISE", "UNDEFINED", "$accept", "EMPTY", "inputfile", "@1", "objective_function", "real_of", "lineair_sum", "constraints", "x_constraints", "constraint", "@2", "real_constraint", "@3", "@4", "@5", "optionalrange", "@6", "@7", "x_lineair_sum2", "x_lineair_sum3", "@8", "x_lineair_sum", "@9", "x_lineair_sum1", "x_lineair_term", "x_lineair_term1", "@10", "RE_OP", "cons_term", "REALCONS", "x_SIGN", "optional_AR_M_OP", "RHS_STORE", "int_bin_sec_sos_free_declarations", "real_int_bin_sec_sos_free_decls", "SEC_INT_BIN_SEC_SOS_FREE", "int_bin_sec_sos_free_declaration", "@11", "xx_int_bin_sec_sos_free_declaration", "@12", "x_int_bin_sec_sos_free_declaration", "optionalsos", "@13", "optionalsostype", "@14", "optionalSOSweight", "vars", "x_vars", "optionalcomma", "variable", "variablecolon", "sosweight", "sosdescr", "onevarwithoptionalweight", "INTCONSorVARIABLE", "x_onevarwithoptionalweight", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const lp_yytype_uint16 lp_yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const lp_yytype_uint8 lp_yyr1[] = { 0, 25, 26, 28, 27, 29, 29, 29, 30, 31, 31, 32, 32, 33, 33, 34, 35, 34, 37, 38, 39, 36, 40, 41, 42, 40, 43, 43, 44, 45, 44, 47, 46, 48, 48, 49, 50, 51, 50, 52, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 57, 58, 58, 59, 59, 60, 60, 60, 60, 60, 62, 61, 64, 63, 65, 65, 66, 67, 66, 68, 69, 68, 70, 70, 71, 71, 72, 72, 73, 73, 74, 75, 76, 77, 78, 78, 79, 79, 80, 80 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const lp_yytype_uint8 lp_yyr2[] = { 0, 2, 0, 0, 4, 2, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 0, 3, 0, 0, 0, 8, 1, 0, 0, 5, 1, 1, 1, 0, 3, 0, 2, 1, 2, 2, 1, 0, 3, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 0, 3, 0, 5, 1, 2, 1, 0, 3, 1, 0, 4, 1, 2, 1, 1, 1, 3, 1, 1, 1, 0, 1, 1, 2, 3, 2, 2, 2, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const lp_yytype_uint8 lp_yydefact[] = { 3, 0, 31, 1, 31, 31, 9, 2, 7, 0, 10, 2, 6, 5, 16, 29, 11, 2, 12, 13, 15, 18, 27, 28, 8, 47, 46, 2, 33, 2, 31, 2, 55, 56, 57, 58, 59, 51, 4, 52, 60, 53, 26, 14, 0, 34, 45, 44, 49, 48, 35, 36, 37, 17, 50, 30, 54, 62, 39, 40, 41, 19, 0, 64, 2, 61, 31, 38, 67, 66, 2, 65, 20, 2, 2, 81, 74, 2, 2, 76, 2, 83, 68, 80, 84, 2, 0, 69, 0, 79, 78, 0, 22, 0, 23, 2, 0, 85, 70, 63, 77, 21, 2, 82, 86, 2, 81, 87, 2, 43, 24, 0, 88, 0, 0, 72, 71, 2, 42, 2, 73, 25, 89 }; /* YYDEFGOTO[NTERM-NUM]. */ static const lp_yytype_int8 lp_yydefgoto[] = { -1, 6, 1, 2, 7, 8, 9, 17, 18, 19, 30, 20, 44, 66, 80, 93, 102, 117, 21, 22, 31, 23, 11, 27, 28, 50, 62, 61, 110, 51, 29, 52, 55, 38, 39, 40, 41, 57, 63, 64, 65, 70, 73, 88, 108, 116, 77, 78, 91, 84, 85, 104, 82, 79, 97, 107 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -85 static const lp_yytype_int8 lp_yypact[] = { -85, 13, 46, -85, 2, 2, -85, 32, -85, 7, -85, 26, -85, -85, -85, -85, 64, 40, 27, -85, -85, -85, -85, -85, -85, -85, -85, 42, -85, 3, -2, -85, -85, -85, -85, -85, -85, -85, -85, 40, -85, -85, -85, -85, 67, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, 59, -85, 52, 0, 84, -85, -85, -85, 22, -85, -85, -85, -85, -85, -85, 60, 35, -85, 67, -85, -85, -85, -85, 82, 87, -85, 74, -85, -85, 22, -85, 75, -85, -85, 73, -85, -85, -85, -85, -85, -5, -85, -85, -85, -85, -85, 76, -85, -85, 82, -85, 82, 91, -85, -85, -85, -85, -85, -85, -85, -85 }; /* YYPGOTO[NTERM-NUM]. */ static const lp_yytype_int8 lp_yypgoto[] = { -85, -7, -85, -85, -85, 85, -85, -85, -85, 81, -85, 72, -85, -85, -85, -85, -85, -85, -85, 34, -85, 70, -85, -85, 77, -85, -85, 23, -85, -84, 4, -85, -12, -85, -85, -85, 68, -85, 43, -85, -85, -85, -85, -85, -85, -85, -85, -85, -85, 6, 8, -10, 28, 24, -85, -85 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -76 static const lp_yytype_int8 lp_yytable[] = { 16, 95, 109, -62, 26, 15, -62, 46, 47, 25, 37, 42, -62, 3, -2, -2, -2, -62, 48, -62, 26, -2, 49, 42, 54, 74, 24, 118, 75, 119, -31, -31, -31, 14, 15, -31, -31, -31, 14, 15, 25, -31, -31, -2, -2, -2, -31, -31, 32, 33, 34, 35, -75, 36, -75, 89, 25, 69, -32, -32, -32, -32, 67, 76, 68, -2, 81, 83, 4, 5, 87, 90, 10, 92, 10, 10, 105, 86, 81, 106, -26, -26, -26, 58, 59, 60, 46, 47, 103, 12, 13, 15, 98, 99, 101, 26, 120, 114, 83, 43, 72, 115, 53, 94, 45, 121, 111, 56, 71, 122, 54, 112, 103, 96, 113, 100 }; static const lp_yytype_uint8 lp_yycheck[] = { 7, 85, 7, 3, 11, 7, 6, 4, 5, 14, 17, 18, 12, 0, 16, 17, 18, 17, 15, 19, 27, 19, 29, 30, 31, 3, 19, 111, 6, 113, 3, 4, 5, 6, 7, 3, 4, 5, 6, 7, 14, 14, 15, 16, 17, 18, 14, 15, 8, 9, 10, 11, 17, 13, 19, 20, 14, 64, 16, 17, 18, 19, 3, 70, 12, 19, 73, 74, 22, 23, 77, 78, 2, 80, 4, 5, 3, 17, 85, 6, 16, 17, 18, 16, 17, 18, 4, 5, 95, 4, 5, 7, 5, 19, 19, 102, 5, 21, 105, 18, 66, 108, 30, 80, 27, 117, 102, 39, 65, 119, 117, 105, 119, 85, 106, 91 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const lp_yytype_uint8 lp_yystos[] = { 0, 27, 28, 0, 22, 23, 26, 29, 30, 31, 46, 47, 30, 30, 6, 7, 26, 32, 33, 34, 36, 43, 44, 46, 19, 14, 26, 48, 49, 55, 35, 45, 8, 9, 10, 11, 13, 26, 58, 59, 60, 61, 26, 34, 37, 49, 4, 5, 15, 26, 50, 54, 56, 36, 26, 57, 61, 62, 16, 17, 18, 52, 51, 63, 64, 65, 38, 3, 12, 26, 66, 63, 44, 67, 3, 6, 26, 71, 72, 78, 39, 26, 77, 26, 74, 75, 17, 26, 68, 20, 26, 73, 26, 40, 52, 54, 77, 79, 5, 19, 78, 19, 41, 26, 76, 3, 6, 80, 69, 7, 53, 55, 74, 75, 21, 26, 70, 42, 54, 54, 5, 57, 76 }; #define lp_yyerrok (lp_yyerrstatus = 0) #define lp_yyclearin (lp_yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto lp_yyacceptlab #define YYABORT goto lp_yyabortlab #define YYERROR goto lp_yyerrorlab /* Like YYERROR except do call lp_yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto lp_yyerrlab #define YYRECOVERING() (!!lp_yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (lp_yychar == YYEMPTY && lp_yylen == 1) \ { \ lp_yychar = (Token); \ lp_yylval = (Value); \ lp_yytoken = YYTRANSLATE (lp_yychar); \ YYPOPSTACK (1); \ goto lp_yybackup; \ } \ else \ { \ lp_yyerror (parm, scanner, YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* YY_LOCATION_PRINT -- Print the location on the stream. This macro was not mandated originally: define only if we know we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT # if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ (Loc).last_line, (Loc).last_column) # else # define YY_LOCATION_PRINT(File, Loc) ((void) 0) # endif #endif /* YYLEX -- calling `lp_yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX lp_yylex (&lp_yylval, YYLEX_PARAM) #else # define YYLEX lp_yylex (&lp_yylval, scanner) #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (lp_yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (lp_yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ lp_yy_symbol_print (stderr, \ Type, Value, parm, scanner); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void lp_yy_symbol_value_print (FILE *lp_yyoutput, int lp_yytype, YYSTYPE const * const lp_yyvaluep, parse_parm *parm, void *scanner) #else static void lp_yy_symbol_value_print (lp_yyoutput, lp_yytype, lp_yyvaluep, parm, scanner) FILE *lp_yyoutput; int lp_yytype; YYSTYPE const * const lp_yyvaluep; parse_parm *parm; void *scanner; #endif { if (!lp_yyvaluep) return; YYUSE (parm); YYUSE (scanner); # ifdef YYPRINT if (lp_yytype < YYNTOKENS) YYPRINT (lp_yyoutput, lp_yytoknum[lp_yytype], *lp_yyvaluep); # else YYUSE (lp_yyoutput); # endif switch (lp_yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void lp_yy_symbol_print (FILE *lp_yyoutput, int lp_yytype, YYSTYPE const * const lp_yyvaluep, parse_parm *parm, void *scanner) #else static void lp_yy_symbol_print (lp_yyoutput, lp_yytype, lp_yyvaluep, parm, scanner) FILE *lp_yyoutput; int lp_yytype; YYSTYPE const * const lp_yyvaluep; parse_parm *parm; void *scanner; #endif { if (lp_yytype < YYNTOKENS) YYFPRINTF (lp_yyoutput, "token %s (", lp_yytname[lp_yytype]); else YYFPRINTF (lp_yyoutput, "nterm %s (", lp_yytname[lp_yytype]); lp_yy_symbol_value_print (lp_yyoutput, lp_yytype, lp_yyvaluep, parm, scanner); YYFPRINTF (lp_yyoutput, ")"); } /*------------------------------------------------------------------. | lp_yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void lp_yy_stack_print (lp_yytype_int16 *bottom, lp_yytype_int16 *top) #else static void lp_yy_stack_print (bottom, top) lp_yytype_int16 *bottom; lp_yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (lp_yydebug) \ lp_yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void lp_yy_reduce_print (YYSTYPE *lp_yyvsp, int lp_yyrule, parse_parm *parm, void *scanner) #else static void lp_yy_reduce_print (lp_yyvsp, lp_yyrule, parm, scanner) YYSTYPE *lp_yyvsp; int lp_yyrule; parse_parm *parm; void *scanner; #endif { int lp_yynrhs = lp_yyr2[lp_yyrule]; int lp_yyi; unsigned long int lp_yylno = lp_yyrline[lp_yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", lp_yyrule - 1, lp_yylno); /* The symbols being reduced. */ for (lp_yyi = 0; lp_yyi < lp_yynrhs; lp_yyi++) { fprintf (stderr, " $%d = ", lp_yyi + 1); lp_yy_symbol_print (stderr, lp_yyrhs[lp_yyprhs[lp_yyrule] + lp_yyi], &(lp_yyvsp[(lp_yyi + 1) - (lp_yynrhs)]) , parm, scanner); fprintf (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (lp_yydebug) \ lp_yy_reduce_print (lp_yyvsp, Rule, parm, scanner); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int lp_yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef lp_yystrlen # if defined __GLIBC__ && defined _STRING_H # define lp_yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T lp_yystrlen (const char *lp_yystr) #else static YYSIZE_T lp_yystrlen (lp_yystr) const char *lp_yystr; #endif { YYSIZE_T lp_yylen; for (lp_yylen = 0; lp_yystr[lp_yylen]; lp_yylen++) continue; return lp_yylen; } # endif # endif # ifndef lp_yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define lp_yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * lp_yystpcpy (char *lp_yydest, const char *lp_yysrc) #else static char * lp_yystpcpy (lp_yydest, lp_yysrc) char *lp_yydest; const char *lp_yysrc; #endif { char *lp_yyd = lp_yydest; const char *lp_yys = lp_yysrc; while ((*lp_yyd++ = *lp_yys++) != '\0') continue; return lp_yyd - 1; } # endif # endif # ifndef lp_yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for lp_yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from lp_yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T lp_yytnamerr (char *lp_yyres, const char *lp_yystr) { if (*lp_yystr == '"') { YYSIZE_T lp_yyn = 0; char const *lp_yyp = lp_yystr; for (;;) switch (*++lp_yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++lp_yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (lp_yyres) lp_yyres[lp_yyn] = *lp_yyp; lp_yyn++; break; case '"': if (lp_yyres) lp_yyres[lp_yyn] = '\0'; return lp_yyn; } do_not_strip_quotes: ; } if (! lp_yyres) return lp_yystrlen (lp_yystr); return lp_yystpcpy (lp_yyres, lp_yystr) - lp_yyres; } # endif /* Copy into YYRESULT an error message about the unexpected token YYCHAR while in state YYSTATE. Return the number of bytes copied, including the terminating null byte. If YYRESULT is null, do not copy anything; just return the number of bytes that would be copied. As a special case, return 0 if an ordinary "syntax error" message will do. Return YYSIZE_MAXIMUM if overflow occurs during size calculation. */ static YYSIZE_T lp_yysyntax_error (char *lp_yyresult, int lp_yystate, int lp_yychar) { int lp_yyn = lp_yypact[lp_yystate]; if (! (YYPACT_NINF < lp_yyn && lp_yyn <= YYLAST)) return 0; else { int lp_yytype = YYTRANSLATE (lp_yychar); YYSIZE_T lp_yysize0 = lp_yytnamerr (0, lp_yytname[lp_yytype]); YYSIZE_T lp_yysize = lp_yysize0; YYSIZE_T lp_yysize1; int lp_yysize_overflow = 0; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; char const *lp_yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; int lp_yyx; # if 0 /* This is so xgettext sees the translatable formats that are constructed on the fly. */ YY_("syntax error, unexpected %s"); YY_("syntax error, unexpected %s, expecting %s"); YY_("syntax error, unexpected %s, expecting %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s"); YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); # endif char *lp_yyfmt; char const *lp_yyf; static char const lp_yyunexpected[] = "syntax error, unexpected %s"; static char const lp_yyexpecting[] = ", expecting %s"; static char const lp_yyor[] = " or %s"; char lp_yyformat[sizeof lp_yyunexpected + sizeof lp_yyexpecting - 1 + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) * (sizeof lp_yyor - 1))]; char const *lp_yyprefix = lp_yyexpecting; /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. */ int lp_yyxbegin = lp_yyn < 0 ? -lp_yyn : 0; /* Stay within bounds of both lp_yycheck and lp_yytname. */ int lp_yychecklim = YYLAST - lp_yyn + 1; int lp_yyxend = lp_yychecklim < YYNTOKENS ? lp_yychecklim : YYNTOKENS; int lp_yycount = 1; lp_yyarg[0] = lp_yytname[lp_yytype]; lp_yyfmt = lp_yystpcpy (lp_yyformat, lp_yyunexpected); for (lp_yyx = lp_yyxbegin; lp_yyx < lp_yyxend; ++lp_yyx) if (lp_yycheck[lp_yyx + lp_yyn] == lp_yyx && lp_yyx != YYTERROR) { if (lp_yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { lp_yycount = 1; lp_yysize = lp_yysize0; lp_yyformat[sizeof lp_yyunexpected - 1] = '\0'; break; } lp_yyarg[lp_yycount++] = lp_yytname[lp_yyx]; lp_yysize1 = lp_yysize + lp_yytnamerr (0, lp_yytname[lp_yyx]); lp_yysize_overflow |= (lp_yysize1 < lp_yysize); lp_yysize = lp_yysize1; lp_yyfmt = lp_yystpcpy (lp_yyfmt, lp_yyprefix); lp_yyprefix = lp_yyor; } lp_yyf = YY_(lp_yyformat); lp_yysize1 = lp_yysize + lp_yystrlen (lp_yyf); lp_yysize_overflow |= (lp_yysize1 < lp_yysize); lp_yysize = lp_yysize1; if (lp_yysize_overflow) return YYSIZE_MAXIMUM; if (lp_yyresult) { /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ char *lp_yyp = lp_yyresult; int lp_yyi = 0; while ((*lp_yyp = *lp_yyf) != '\0') { if (*lp_yyp == '%' && lp_yyf[1] == 's' && lp_yyi < lp_yycount) { lp_yyp += lp_yytnamerr (lp_yyp, lp_yyarg[lp_yyi++]); lp_yyf += 2; } else { lp_yyp++; lp_yyf++; } } } return lp_yysize; } } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void lp_yydestruct (const char *lp_yymsg, int lp_yytype, YYSTYPE *lp_yyvaluep, parse_parm *parm, void *scanner) #else static void lp_yydestruct (lp_yymsg, lp_yytype, lp_yyvaluep, parm, scanner) const char *lp_yymsg; int lp_yytype; YYSTYPE *lp_yyvaluep; parse_parm *parm; void *scanner; #endif { YYUSE (lp_yyvaluep); YYUSE (parm); YYUSE (scanner); if (!lp_yymsg) lp_yymsg = "Deleting"; YY_SYMBOL_PRINT (lp_yymsg, lp_yytype, lp_yyvaluep, lp_yylocationp); switch (lp_yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int lp_yyparse (void *YYPARSE_PARAM); #else int lp_yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int lp_yyparse (parse_parm *parm, void *scanner); #else int lp_yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /*----------. | lp_yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int lp_yyparse (void *YYPARSE_PARAM) #else int lp_yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int lp_yyparse (parse_parm *parm, void *scanner) #else int lp_yyparse (parm, scanner) parse_parm *parm; void *scanner; #endif #endif { /* The look-ahead symbol. */ int lp_yychar; /* The semantic value of the look-ahead symbol. */ YYSTYPE lp_yylval; /* Number of syntax errors so far. */ int lp_yynerrs; int lp_yystate; int lp_yyn; int lp_yyresult; /* Number of tokens to shift before error messages enabled. */ int lp_yyerrstatus; /* Look-ahead token as an internal (translated) token number. */ int lp_yytoken = 0; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char lp_yymsgbuf[128]; char *lp_yymsg = lp_yymsgbuf; YYSIZE_T lp_yymsg_alloc = sizeof lp_yymsgbuf; #endif /* Three stacks and their tools: `lp_yyss': related to states, `lp_yyvs': related to semantic values, `lp_yyls': related to locations. Refer to the stacks thru separate pointers, to allow lp_yyoverflow to reallocate them elsewhere. */ /* The state stack. */ lp_yytype_int16 lp_yyssa[YYINITDEPTH]; lp_yytype_int16 *lp_yyss = lp_yyssa; lp_yytype_int16 *lp_yyssp; /* The semantic value stack. */ YYSTYPE lp_yyvsa[YYINITDEPTH]; YYSTYPE *lp_yyvs = lp_yyvsa; YYSTYPE *lp_yyvsp; #define YYPOPSTACK(N) (lp_yyvsp -= (N), lp_yyssp -= (N)) YYSIZE_T lp_yystacksize = YYINITDEPTH; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE lp_yyval; /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int lp_yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); lp_yystate = 0; lp_yyerrstatus = 0; lp_yynerrs = 0; lp_yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ lp_yyssp = lp_yyss; lp_yyvsp = lp_yyvs; goto lp_yysetstate; /*------------------------------------------------------------. | lp_yynewstate -- Push a new state, which is found in lp_yystate. | `------------------------------------------------------------*/ lp_yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ lp_yyssp++; lp_yysetstate: *lp_yyssp = lp_yystate; if (lp_yyss + lp_yystacksize - 1 <= lp_yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T lp_yysize = lp_yyssp - lp_yyss + 1; #ifdef lp_yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *lp_yyvs1 = lp_yyvs; lp_yytype_int16 *lp_yyss1 = lp_yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if lp_yyoverflow is a macro. */ lp_yyoverflow (YY_("memory exhausted"), &lp_yyss1, lp_yysize * sizeof (*lp_yyssp), &lp_yyvs1, lp_yysize * sizeof (*lp_yyvsp), &lp_yystacksize); lp_yyss = lp_yyss1; lp_yyvs = lp_yyvs1; } #else /* no lp_yyoverflow */ # ifndef YYSTACK_RELOCATE goto lp_yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= lp_yystacksize) goto lp_yyexhaustedlab; lp_yystacksize *= 2; if (YYMAXDEPTH < lp_yystacksize) lp_yystacksize = YYMAXDEPTH; { lp_yytype_int16 *lp_yyss1 = lp_yyss; union lp_yyalloc *lp_yyptr = (union lp_yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (lp_yystacksize)); if (! lp_yyptr) goto lp_yyexhaustedlab; YYSTACK_RELOCATE (lp_yyss); YYSTACK_RELOCATE (lp_yyvs); # undef YYSTACK_RELOCATE if (lp_yyss1 != lp_yyssa) YYSTACK_FREE (lp_yyss1); } # endif #endif /* no lp_yyoverflow */ lp_yyssp = lp_yyss + lp_yysize - 1; lp_yyvsp = lp_yyvs + lp_yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) lp_yystacksize)); if (lp_yyss + lp_yystacksize - 1 <= lp_yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", lp_yystate)); goto lp_yybackup; /*-----------. | lp_yybackup. | `-----------*/ lp_yybackup: /* Do appropriate processing given the current state. Read a look-ahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to look-ahead token. */ lp_yyn = lp_yypact[lp_yystate]; if (lp_yyn == YYPACT_NINF) goto lp_yydefault; /* Not known => get a look-ahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (lp_yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); lp_yychar = YYLEX; } if (lp_yychar <= YYEOF) { lp_yychar = lp_yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { lp_yytoken = YYTRANSLATE (lp_yychar); YY_SYMBOL_PRINT ("Next token is", lp_yytoken, &lp_yylval, &lp_yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ lp_yyn += lp_yytoken; if (lp_yyn < 0 || YYLAST < lp_yyn || lp_yycheck[lp_yyn] != lp_yytoken) goto lp_yydefault; lp_yyn = lp_yytable[lp_yyn]; if (lp_yyn <= 0) { if (lp_yyn == 0 || lp_yyn == YYTABLE_NINF) goto lp_yyerrlab; lp_yyn = -lp_yyn; goto lp_yyreduce; } if (lp_yyn == YYFINAL) YYACCEPT; /* Count tokens shifted since error; after three, turn off error status. */ if (lp_yyerrstatus) lp_yyerrstatus--; /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", lp_yytoken, &lp_yylval, &lp_yylloc); /* Discard the shifted token unless it is eof. */ if (lp_yychar != YYEOF) lp_yychar = YYEMPTY; lp_yystate = lp_yyn; *++lp_yyvsp = lp_yylval; goto lp_yynewstate; /*-----------------------------------------------------------. | lp_yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ lp_yydefault: lp_yyn = lp_yydefact[lp_yystate]; if (lp_yyn == 0) goto lp_yyerrlab; goto lp_yyreduce; /*-----------------------------. | lp_yyreduce -- Do a reduction. | `-----------------------------*/ lp_yyreduce: /* lp_yyn is the number of a rule to reduce with. */ lp_yylen = lp_yyr2[lp_yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ lp_yyval = lp_yyvsp[1-lp_yylen]; YY_REDUCE_PRINT (lp_yyn); switch (lp_yyn) { case 3: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = 0; pv->make_neg = 0; pv->Sign = 0; pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; } break; case 5: { set_obj_dir(PARM, TRUE); } break; case 6: { set_obj_dir(PARM, FALSE); } break; case 8: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; add_row(pp); pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; pv->isign = 0; pv->make_neg = 0; } break; case 16: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!add_constraint_name(pp, pv->Last_var)) YYABORT; pv->HadConstraint = TRUE; } break; case 18: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HadVar1 = pv->HadVar0; pv->HadVar0 = FALSE; } break; case 19: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!store_re_op(pp, pv->OP, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; pv->make_neg = 1; pv->f1 = 0; } break; case 20: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Had_lineair_sum0 = pv->Had_lineair_sum; pv->Had_lineair_sum = TRUE; pv->HadVar2 = pv->HadVar0; pv->HadVar0 = FALSE; pv->do_add_row = FALSE; if(pv->HadConstraint && !pv->HadVar ) { /* it is a range */ /* already handled */ } else if(!pv->HadConstraint && pv->HadVar) { /* it is a bound */ if(!store_bounds(pp, TRUE)) YYABORT; } else { /* it is a row restriction */ if(pv->HadConstraint && pv->HadVar) store_re_op(pp, '\0', (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum); /* makes sure that data stored in temporary buffers is treated correctly */ pv->do_add_row = TRUE; } } break; case 21: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->HadVar) && (!pv->HadConstraint)) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->do_add_row) add_row(pp); pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; pv->isign = 0; pv->make_neg = 0; null_tmp_store(pp, TRUE); } break; case 22: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->HadVar1) && (pv->Had_lineair_sum0)) if(!negate_constraint(pp)) YYABORT; } break; case 23: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->make_neg = 0; pv->isign = 0; if(pv->HadConstraint) pv->HadVar = pv->Had_lineair_sum = FALSE; pv->HadVar0 = FALSE; if(!store_re_op(pp, (char) ((pv->OP == '<') ? '>' : (pv->OP == '>') ? '<' : pv->OP), (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } break; case 24: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->f -= pv->f1; } break; case 25: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->HadVar1) || (!pv->HadVar2) || (pv->HadVar0)) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->HadConstraint && !pv->HadVar ) { /* it is a range */ /* already handled */ if(!negate_constraint(pp)) YYABORT; } else if(!pv->HadConstraint && pv->HadVar) { /* it is a bound */ if(!store_bounds(pp, TRUE)) YYABORT; } } break; case 26: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; /* to allow a range */ /* constraint: < max */ if(!pv->HadConstraint) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } pv->Had_lineair_sum = FALSE; } break; case 27: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Had_lineair_sum = TRUE; } break; case 29: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; } break; case 31: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = pv->state0 = 0; } break; case 32: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if (pv->state == 1) { /* RHS_STORE */ if ( (pv->isign0 || !pv->make_neg) && !(pv->isign0 && !pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(pv->make_neg) pv->f1 += pv->f0; if(!rhs_store(pp, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } } break; case 35: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ((pv->HadSign || pv->state == 1) && (pv->state0 == 1)) { /* RHS_STORE */ if ( (pv->isign0 || !pv->make_neg) && !(pv->isign0 && !pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(pv->make_neg) pv->f1 += pv->f0; if(!rhs_store(pp, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } if (pv->state == 1) { pv->f0 = pv->f; pv->isign0 = pv->isign; } if (pv->state == 2) { if((pv->HadSign) || (pv->state0 != 1)) { pv->isign0 = pv->isign; pv->f0 = 1.0; } if ( (pv->isign0 || pv->make_neg) && !(pv->isign0 && pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(!var_store(pp, pv->Last_var, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) { lp_yyerror(pp, pp->scanner, "var_store failed"); YYABORT; } pv->HadConstraint |= pv->HadVar; pv->HadVar = pv->HadVar0 = TRUE; } pv->state0 = pv->state; } break; case 36: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = 1; } break; case 37: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ((pv->HasAR_M_OP) && (pv->state != 1)) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } } break; case 38: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = 2; } break; case 43: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; } break; case 46: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = 0; pv->HadSign = FALSE; } break; case 47: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; pv->HadSign = TRUE; } break; case 48: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HasAR_M_OP = FALSE; } break; case 49: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HasAR_M_OP = TRUE; } break; case 50: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ( (pv->isign || !pv->make_neg) && !(pv->isign && !pv->make_neg)) /* but not both! */ pv->f = -pv->f; if(!rhs_store(pp, pv->f, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; pv->isign = 0; } break; case 60: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Within_sos_decl1 = pv->Within_sos_decl; } break; case 62: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl1) && (!pv->Within_free_decl)) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } pv->SOStype = pv->SOStype0; check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, (int) (pv->Within_sos_decl1 = (pv->Within_sos_decl1 ? 1 : 0)), (int) pv->Within_free_decl); } break; case 63: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->Within_sos_decl1) && (pv->SOStype == 0)) { lp_yyerror(pp, pp->scanner, "Unsupported SOS type (0)"); YYABORT; } } break; case 67: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; FREE(pv->Last_var0); pv->Last_var0 = strdup(pv->Last_var); } break; case 69: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1) { set_sos_type(pp, pv->SOStype); set_sos_weight(pp, (double) pv->SOSweight, 1); } } break; case 70: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->Within_sos_decl1) && (!pv->SOStype)) { set_sos_type(pp, pv->SOStype = (short) (pv->f + .1)); } else { lp_yyerror(pp, pp->scanner, "SOS type not expected"); YYABORT; } } break; case 72: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; set_sos_weight(pp, (double) pv->SOSweight, 1); } break; case 73: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; set_sos_weight(pp, pv->f, 1); } break; case 80: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { char buf[16]; pv->SOSweight++; sprintf(buf, "SOS%d", pv->SOSweight); storevarandweight(pp, buf); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; } storevarandweight(pp, pv->Last_var); if(pv->Within_sos_decl1 == 2) { pv->SOSNr++; set_sos_weight(pp, (double) pv->SOSNr, 2); } } break; case 81: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!pv->Within_sos_decl1) { lp_yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->Within_sos_decl1 == 1) { FREE(pv->Last_var0); pv->Last_var0 = strdup(pv->Last_var); } if(pv->Within_sos_decl1 == 2) { storevarandweight(pp, pv->Last_var); pv->SOSNr++; set_sos_weight(pp, (double) pv->SOSNr, 2); } } break; case 82: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { char buf[16]; pv->SOSweight++; sprintf(buf, "SOS%d", pv->SOSweight); storevarandweight(pp, buf); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; storevarandweight(pp, pv->Last_var0); pv->SOSNr++; } set_sos_weight(pp, pv->f, 2); } break; case 83: { /* SOS name */ parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; storevarandweight(pp, pv->Last_var0); set_sos_type(pp, pv->SOStype); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; pv->SOSweight++; } } break; /* Line 1267 of yacc.c. */ default: break; } YY_SYMBOL_PRINT ("-> $$ =", lp_yyr1[lp_yyn], &lp_yyval, &lp_yyloc); YYPOPSTACK (lp_yylen); lp_yylen = 0; YY_STACK_PRINT (lp_yyss, lp_yyssp); *++lp_yyvsp = lp_yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ lp_yyn = lp_yyr1[lp_yyn]; lp_yystate = lp_yypgoto[lp_yyn - YYNTOKENS] + *lp_yyssp; if (0 <= lp_yystate && lp_yystate <= YYLAST && lp_yycheck[lp_yystate] == *lp_yyssp) lp_yystate = lp_yytable[lp_yystate]; else lp_yystate = lp_yydefgoto[lp_yyn - YYNTOKENS]; goto lp_yynewstate; /*------------------------------------. | lp_yyerrlab -- here on detecting error | `------------------------------------*/ lp_yyerrlab: /* If not already recovering from an error, report this error. */ if (!lp_yyerrstatus) { ++lp_yynerrs; #if ! YYERROR_VERBOSE lp_yyerror (parm, scanner, YY_("syntax error")); #else { YYSIZE_T lp_yysize = lp_yysyntax_error (0, lp_yystate, lp_yychar); if (lp_yymsg_alloc < lp_yysize && lp_yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) { YYSIZE_T lp_yyalloc = 2 * lp_yysize; if (! (lp_yysize <= lp_yyalloc && lp_yyalloc <= YYSTACK_ALLOC_MAXIMUM)) lp_yyalloc = YYSTACK_ALLOC_MAXIMUM; if (lp_yymsg != lp_yymsgbuf) YYSTACK_FREE (lp_yymsg); lp_yymsg = (char *) YYSTACK_ALLOC (lp_yyalloc); if (lp_yymsg) lp_yymsg_alloc = lp_yyalloc; else { lp_yymsg = lp_yymsgbuf; lp_yymsg_alloc = sizeof lp_yymsgbuf; } } if (0 < lp_yysize && lp_yysize <= lp_yymsg_alloc) { (void) lp_yysyntax_error (lp_yymsg, lp_yystate, lp_yychar); lp_yyerror (parm, scanner, lp_yymsg); } else { lp_yyerror (parm, scanner, YY_("syntax error")); if (lp_yysize != 0) goto lp_yyexhaustedlab; } } #endif } if (lp_yyerrstatus == 3) { /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (lp_yychar <= YYEOF) { /* Return failure if at end of input. */ if (lp_yychar == YYEOF) YYABORT; } else { lp_yydestruct ("Error: discarding", lp_yytoken, &lp_yylval, parm, scanner); lp_yychar = YYEMPTY; } } /* Else will try to reuse look-ahead token after shifting the error token. */ goto lp_yyerrlab1; /*---------------------------------------------------. | lp_yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ lp_yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label lp_yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto lp_yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (lp_yylen); lp_yylen = 0; YY_STACK_PRINT (lp_yyss, lp_yyssp); lp_yystate = *lp_yyssp; goto lp_yyerrlab1; /*-------------------------------------------------------------. | lp_yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ lp_yyerrlab1: lp_yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { lp_yyn = lp_yypact[lp_yystate]; if (lp_yyn != YYPACT_NINF) { lp_yyn += YYTERROR; if (0 <= lp_yyn && lp_yyn <= YYLAST && lp_yycheck[lp_yyn] == YYTERROR) { lp_yyn = lp_yytable[lp_yyn]; if (0 < lp_yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (lp_yyssp == lp_yyss) YYABORT; lp_yydestruct ("Error: popping", lp_yystos[lp_yystate], lp_yyvsp, parm, scanner); YYPOPSTACK (1); lp_yystate = *lp_yyssp; YY_STACK_PRINT (lp_yyss, lp_yyssp); } if (lp_yyn == YYFINAL) YYACCEPT; *++lp_yyvsp = lp_yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", lp_yystos[lp_yyn], lp_yyvsp, lp_yylsp); lp_yystate = lp_yyn; goto lp_yynewstate; /*-------------------------------------. | lp_yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ lp_yyacceptlab: lp_yyresult = 0; goto lp_yyreturn; /*-----------------------------------. | lp_yyabortlab -- YYABORT comes here. | `-----------------------------------*/ lp_yyabortlab: lp_yyresult = 1; goto lp_yyreturn; #ifndef lp_yyoverflow /*-------------------------------------------------. | lp_yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ lp_yyexhaustedlab: lp_yyerror (parm, scanner, YY_("memory exhausted")); lp_yyresult = 2; /* Fall through. */ #endif lp_yyreturn: if (lp_yychar != YYEOF && lp_yychar != YYEMPTY) lp_yydestruct ("Cleanup: discarding lookahead", lp_yytoken, &lp_yylval, parm, scanner); /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (lp_yylen); YY_STACK_PRINT (lp_yyss, lp_yyssp); while (lp_yyssp != lp_yyss) { lp_yydestruct ("Cleanup: popping", lp_yystos[*lp_yyssp], lp_yyvsp, parm, scanner); YYPOPSTACK (1); } #ifndef lp_yyoverflow if (lp_yyss != lp_yyssa) YYSTACK_FREE (lp_yyss); #endif #if YYERROR_VERBOSE if (lp_yymsg != lp_yymsgbuf) YYSTACK_FREE (lp_yymsg); #endif /* Make sure YYID is used. */ return YYID (lp_yyresult); } static void lp_yy_delete_allocated_memory(parse_parm *pp) { parse_vars *pv = (parse_vars *) pp->parse_vars; /* free memory allocated by flex. Otherwise some memory is not freed. This is a bit tricky. There is not much documentation about this, but a lot of reports of memory that keeps allocated */ /* If you get errors on this function call, just comment it. This will only result in some memory that is not being freed. */ # if defined YY_CURRENT_BUFFER /* flex defines the macro YY_CURRENT_BUFFER, so you should only get here if lp_rlp.h is generated by flex */ /* lex doesn't define this macro and thus should not come here, but lex doesn't has this memory leak also ...*/ # if 0 /* older versions of flex */ lp_yy_delete_buffer(YY_CURRENT_BUFFER); /* comment this line if you have problems with it */ lp_yy_init = 1; /* make sure that the next time memory is allocated again */ lp_yy_start = 0; # else /* As of version 2.5.9 Flex */ lp_yylex_destroy(pp->scanner); /* comment this line if you have problems with it */ # endif # endif FREE(pv->Last_var); FREE(pv->Last_var0); } static int parse(parse_parm *pp) { return(lp_yyparse(pp, pp->scanner)); } lprec *read_lp1(lprec *lp, void *userhandle, read_modeldata_func read_modeldata, int verbose, char *lp_name) { parse_vars *pv; lprec *lp1 = NULL; CALLOC(pv, 1, parse_vars); if (pv != NULL) { parse_parm pp; memset(&pp, 0, sizeof(pp)); pp.parse_vars = (void *) pv; lp_yylex_init(&pp.scanner); lp_yyset_extra(&pp, pp.scanner); lp_yyset_in((FILE *) userhandle, pp.scanner); lp_yyset_out(NULL, pp.scanner); pv->lp_input = read_modeldata; pv->userhandle = userhandle; lp1 = yacc_read(lp, verbose, lp_name, parse, &pp, lp_yy_delete_allocated_memory); FREE(pv); } return(lp1); } lprec * __WINAPI read_lp(FILE *filename, int verbose, char *lp_name) { return(read_lp1(NULL, filename, lp_input_lp_yyin, verbose, lp_name)); } lprec * __WINAPI read_lpex(void *userhandle, read_modeldata_func read_modeldata, int verbose, char *lp_name) { return(read_lp1(NULL, userhandle, read_modeldata, verbose, lp_name)); } lprec *read_LP1(lprec *lp, char *filename, int verbose, char *lp_name) { FILE *fpin; if((fpin = fopen(filename, "r")) != NULL) { lp = read_lp1(lp, fpin, lp_input_lp_yyin, verbose, lp_name); fclose(fpin); } else lp = NULL; return(lp); } lprec * __WINAPI read_LP(char *filename, int verbose, char *lp_name) { return(read_LP1(NULL, filename, verbose, lp_name)); } MYBOOL __WINAPI LP_readhandle(lprec **lp, FILE *filename, int verbose, char *lp_name) { if(lp != NULL) *lp = read_lp1(*lp, filename, lp_input_lp_yyin, verbose, lp_name); return((lp != NULL) && (*lp != NULL)); } lp_solve_5.5/lp_rlp.h100666 0 0 220432 11250515162 13241 0ustar usergroup #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; #endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define lp_yyconst const #else #define lp_yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* An opaque pointer. */ #ifndef YY_TYPEDEF_YY_SCANNER_T #define YY_TYPEDEF_YY_SCANNER_T typedef void* lp_yyscan_t; #endif /* For convenience, these vars (plus the bison vars far below) are macros in the reentrant scanner. */ #define lp_yyin lp_yyg->lp_yyin_r #define lp_yyout lp_yyg->lp_yyout_r #define lp_yyextra lp_yyg->lp_yyextra_r #define lp_yyleng lp_yyg->lp_yyleng_r #define lp_yytext lp_yyg->lp_yytext_r #define lp_yylineno (YY_CURRENT_BUFFER_LVALUE->lp_yy_bs_lineno) #define lp_yycolumn (YY_CURRENT_BUFFER_LVALUE->lp_yy_bs_column) #define lp_yy_flex_debug lp_yyg->lp_yy_flex_debug_r /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN lp_yyg->lp_yy_start = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START ((lp_yyg->lp_yy_start - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE lp_yyrestart(lp_yyin ,lp_yyscanner ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(lp_yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct lp_yy_buffer_state *YY_BUFFER_STATE; #endif #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 /* Note: We specifically omit the test for lp_yy_rule_can_match_eol because it requires * access to the local variable lp_yy_act. Since lp_yyless() is a macro, it would break * existing scanners that call lp_yyless() from OUTSIDE lp_yylex. * One obvious solution it to make lp_yy_act a global. I tried that, and saw * a 5% performance hit in a non-lp_yylineno scanner, because lp_yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ int lp_yyl;\ for ( lp_yyl = n; lp_yyl < lp_yyleng; ++lp_yyl )\ if ( lp_yytext[lp_yyl] == '\n' )\ --lp_yylineno;\ }while(0) /* Return all but the first "n" matched characters back to the input stream. */ #define lp_yyless(n) \ do \ { \ /* Undo effects of setting up lp_yytext. */ \ int lp_yyless_macro_arg = (n); \ YY_LESS_LINENO(lp_yyless_macro_arg);\ *lp_yy_cp = lp_yyg->lp_yy_hold_char; \ YY_RESTORE_YY_MORE_OFFSET \ lp_yyg->lp_yy_c_buf_p = lp_yy_cp = lp_yy_bp + lp_yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up lp_yytext again */ \ } \ while ( 0 ) #define unput(c) lp_yyunput( c, lp_yyg->lp_yytext_ptr , lp_yyscanner ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t lp_yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct lp_yy_buffer_state { FILE *lp_yy_input_file; char *lp_yy_ch_buf; /* input buffer */ char *lp_yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ lp_yy_size_t lp_yy_buf_size; /* Number of characters read into lp_yy_ch_buf, not including EOB * characters. */ int lp_yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int lp_yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int lp_yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int lp_yy_at_bol; int lp_yy_bs_lineno; /**< The line count. */ int lp_yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int lp_yy_fill_buffer; int lp_yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via lp_yyrestart()), so that the user can continue scanning by * just pointing lp_yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( lp_yyg->lp_yy_buffer_stack \ ? lp_yyg->lp_yy_buffer_stack[lp_yyg->lp_yy_buffer_stack_top] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE lp_yyg->lp_yy_buffer_stack[lp_yyg->lp_yy_buffer_stack_top] void lp_yyrestart (FILE *input_file ,lp_yyscan_t lp_yyscanner ); void lp_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,lp_yyscan_t lp_yyscanner ); YY_BUFFER_STATE lp_yy_create_buffer (FILE *file,int size ,lp_yyscan_t lp_yyscanner ); void lp_yy_delete_buffer (YY_BUFFER_STATE b ,lp_yyscan_t lp_yyscanner ); void lp_yy_flush_buffer (YY_BUFFER_STATE b ,lp_yyscan_t lp_yyscanner ); void lp_yypush_buffer_state (YY_BUFFER_STATE new_buffer ,lp_yyscan_t lp_yyscanner ); void lp_yypop_buffer_state (lp_yyscan_t lp_yyscanner ); static void lp_yyensure_buffer_stack (lp_yyscan_t lp_yyscanner ); static void lp_yy_load_buffer_state (lp_yyscan_t lp_yyscanner ); static void lp_yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,lp_yyscan_t lp_yyscanner ); #define YY_FLUSH_BUFFER lp_yy_flush_buffer(YY_CURRENT_BUFFER ,lp_yyscanner) YY_BUFFER_STATE lp_yy_scan_buffer (char *base,lp_yy_size_t size ,lp_yyscan_t lp_yyscanner ); YY_BUFFER_STATE lp_yy_scan_string (lp_yyconst char *lp_yy_str ,lp_yyscan_t lp_yyscanner ); YY_BUFFER_STATE lp_yy_scan_bytes (lp_yyconst char *bytes,int len ,lp_yyscan_t lp_yyscanner ); void *lp_yyalloc (lp_yy_size_t ,lp_yyscan_t lp_yyscanner ); void *lp_yyrealloc (void *,lp_yy_size_t ,lp_yyscan_t lp_yyscanner ); void lp_yyfree (void * ,lp_yyscan_t lp_yyscanner ); #define lp_yy_new_buffer lp_yy_create_buffer #define lp_yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ lp_yyensure_buffer_stack (lp_yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ lp_yy_create_buffer(lp_yyin,YY_BUF_SIZE ,lp_yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->lp_yy_is_interactive = is_interactive; \ } #define lp_yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ lp_yyensure_buffer_stack (lp_yyscanner); \ YY_CURRENT_BUFFER_LVALUE = \ lp_yy_create_buffer(lp_yyin,YY_BUF_SIZE ,lp_yyscanner); \ } \ YY_CURRENT_BUFFER_LVALUE->lp_yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->lp_yy_at_bol) /* Begin user sect3 */ #define lp_yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; typedef int lp_yy_state_type; #define lp_yytext_ptr lp_yytext_r static lp_yy_state_type lp_yy_get_previous_state (lp_yyscan_t lp_yyscanner ); static lp_yy_state_type lp_yy_try_NUL_trans (lp_yy_state_type current_state ,lp_yyscan_t lp_yyscanner); static int lp_yy_get_next_buffer (lp_yyscan_t lp_yyscanner ); static void lp_yy_fatal_error (lp_yyconst char msg[] ,lp_yyscan_t lp_yyscanner ); /* Done after the current pattern has been matched and before the * corresponding action - sets up lp_yytext. */ #define YY_DO_BEFORE_ACTION \ lp_yyg->lp_yytext_ptr = lp_yy_bp; \ lp_yyleng = (size_t) (lp_yy_cp - lp_yy_bp); \ lp_yyg->lp_yy_hold_char = *lp_yy_cp; \ *lp_yy_cp = '\0'; \ lp_yyg->lp_yy_c_buf_p = lp_yy_cp; #define YY_NUM_RULES 33 #define YY_END_OF_BUFFER 34 /* This struct is not used in this scanner, but its presence is necessary. */ struct lp_yy_trans_info { flex_int32_t lp_yy_verify; flex_int32_t lp_yy_nxt; }; static lp_yyconst flex_int16_t lp_yy_accept[144] = { 0, 0, 0, 0, 0, 0, 0, 34, 32, 10, 10, 27, 17, 11, 32, 32, 14, 26, 31, 29, 28, 30, 25, 25, 10, 25, 25, 25, 25, 3, 4, 3, 3, 9, 7, 8, 10, 17, 17, 0, 15, 1, 6, 15, 14, 0, 29, 30, 0, 25, 24, 0, 25, 25, 10, 0, 0, 0, 0, 25, 25, 25, 25, 25, 2, 0, 15, 0, 15, 22, 0, 25, 25, 0, 0, 0, 0, 0, 19, 25, 18, 20, 25, 25, 21, 0, 25, 0, 13, 25, 0, 12, 25, 19, 0, 18, 20, 21, 25, 23, 25, 20, 21, 21, 16, 16, 0, 25, 25, 0, 23, 0, 21, 25, 25, 0, 0, 25, 25, 0, 0, 19, 25, 0, 0, 25, 25, 19, 0, 18, 0, 0, 25, 25, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0 } ; static lp_yyconst flex_int32_t lp_yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 5, 6, 5, 5, 5, 1, 1, 7, 8, 9, 10, 11, 12, 13, 14, 14, 13, 13, 13, 13, 13, 13, 13, 15, 16, 17, 18, 19, 1, 5, 20, 21, 22, 23, 24, 25, 26, 23, 27, 23, 23, 23, 28, 29, 30, 23, 23, 31, 32, 33, 34, 23, 23, 35, 36, 37, 5, 1, 5, 5, 5, 1, 20, 21, 22, 23, 24, 25, 26, 23, 27, 23, 23, 23, 28, 29, 30, 23, 23, 31, 32, 33, 34, 23, 23, 35, 36, 37, 5, 1, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static lp_yyconst flex_int32_t lp_yy_meta[38] = { 0, 1, 2, 3, 3, 4, 5, 6, 3, 6, 3, 5, 5, 5, 5, 7, 6, 7, 6, 6, 4, 4, 4, 4, 4, 4, 4, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } ; static lp_yyconst flex_int16_t lp_yy_base[150] = { 0, 0, 36, 36, 38, 43, 45, 366, 388, 48, 62, 388, 338, 388, 40, 48, 60, 388, 388, 346, 388, 326, 60, 65, 91, 81, 74, 85, 102, 388, 388, 388, 330, 388, 388, 388, 125, 313, 134, 308, 96, 388, 388, 117, 132, 139, 388, 388, 88, 146, 320, 0, 149, 152, 0, 307, 301, 294, 83, 153, 156, 157, 189, 160, 388, 286, 126, 65, 108, 388, 289, 181, 185, 272, 273, 250, 249, 220, 199, 203, 208, 192, 211, 219, 227, 243, 109, 163, 225, 202, 174, 224, 215, 213, 207, 191, 388, 189, 227, 228, 231, 244, 240, 253, 276, 388, 170, 260, 262, 166, 388, 169, 179, 263, 241, 166, 159, 270, 272, 149, 155, 284, 288, 130, 124, 296, 303, 388, 103, 300, 96, 45, 324, 328, 388, 82, 311, 79, 68, 54, 56, 25, 12, 388, 345, 353, 360, 367, 372, 379 } ; static lp_yyconst flex_int16_t lp_yy_def[150] = { 0, 143, 1, 144, 144, 145, 145, 143, 143, 143, 143, 143, 146, 143, 143, 143, 143, 143, 143, 143, 143, 143, 147, 147, 143, 147, 147, 147, 147, 143, 143, 143, 143, 143, 143, 143, 143, 146, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 147, 143, 148, 147, 147, 24, 143, 143, 143, 143, 147, 147, 147, 147, 147, 143, 143, 143, 143, 143, 143, 148, 147, 147, 143, 143, 143, 143, 143, 147, 147, 147, 147, 147, 147, 147, 149, 143, 143, 143, 62, 143, 143, 62, 143, 143, 143, 143, 143, 62, 62, 62, 62, 62, 62, 143, 143, 143, 62, 62, 143, 143, 143, 143, 62, 62, 143, 143, 62, 62, 143, 143, 62, 62, 143, 143, 62, 62, 143, 143, 62, 143, 143, 147, 147, 143, 143, 149, 143, 143, 143, 143, 143, 143, 0, 143, 143, 143, 143, 143, 143 } ; static lp_yyconst flex_int16_t lp_yy_nxt[426] = { 0, 8, 9, 10, 9, 8, 8, 11, 12, 13, 12, 14, 15, 16, 16, 17, 18, 19, 20, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 22, 22, 22, 22, 22, 22, 22, 22, 22, 24, 30, 31, 30, 31, 32, 96, 32, 34, 35, 34, 35, 36, 36, 36, 40, 40, 41, 37, 25, 37, 142, 42, 26, 48, 27, 36, 36, 36, 48, 28, 136, 37, 43, 37, 44, 44, 50, 48, 51, 68, 68, 50, 136, 51, 48, 45, 52, 141, 48, 140, 50, 48, 51, 53, 54, 36, 36, 50, 139, 51, 37, 50, 37, 51, 50, 48, 60, 138, 76, 59, 40, 40, 48, 55, 77, 61, 137, 56, 50, 57, 51, 45, 68, 68, 58, 50, 135, 62, 36, 36, 36, 66, 66, 63, 37, 134, 37, 38, 38, 38, 66, 66, 45, 38, 43, 38, 44, 44, 67, 48, 67, 45, 48, 68, 68, 48, 48, 45, 131, 48, 48, 130, 50, 48, 51, 50, 87, 51, 50, 50, 51, 51, 50, 50, 51, 51, 50, 90, 51, 88, 128, 79, 72, 78, 87, 71, 127, 124, 90, 123, 91, 80, 48, 84, 112, 48, 120, 88, 119, 51, 116, 91, 48, 51, 112, 50, 48, 51, 50, 89, 51, 48, 81, 92, 48, 50, 111, 51, 82, 50, 98, 51, 48, 83, 50, 49, 51, 50, 99, 51, 48, 107, 110, 100, 109, 50, 49, 51, 49, 101, 69, 69, 103, 50, 108, 51, 104, 104, 104, 49, 49, 49, 102, 97, 49, 115, 49, 49, 114, 113, 49, 49, 49, 49, 49, 49, 122, 49, 103, 49, 49, 106, 96, 49, 49, 49, 49, 81, 49, 104, 104, 104, 49, 49, 95, 49, 49, 49, 117, 49, 118, 49, 49, 49, 49, 49, 49, 49, 94, 49, 121, 49, 93, 125, 49, 126, 49, 49, 125, 86, 126, 49, 85, 49, 104, 104, 104, 49, 49, 49, 129, 132, 49, 49, 75, 49, 49, 87, 133, 49, 49, 90, 49, 74, 49, 73, 69, 49, 65, 143, 88, 39, 51, 64, 91, 47, 51, 29, 29, 29, 29, 29, 29, 29, 29, 33, 33, 33, 33, 33, 33, 33, 33, 38, 38, 46, 39, 143, 143, 38, 49, 143, 49, 49, 143, 49, 49, 70, 70, 143, 143, 70, 105, 105, 143, 105, 105, 105, 105, 7, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143 } ; static lp_yyconst flex_int16_t lp_yy_chk[426] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 4, 4, 3, 142, 4, 5, 5, 6, 6, 9, 9, 9, 14, 14, 15, 9, 2, 9, 141, 15, 2, 22, 2, 10, 10, 10, 23, 2, 131, 10, 16, 10, 16, 16, 22, 26, 22, 67, 67, 23, 131, 23, 25, 16, 23, 140, 27, 139, 26, 48, 26, 23, 24, 24, 24, 25, 138, 25, 24, 27, 24, 27, 48, 28, 26, 137, 58, 25, 40, 40, 86, 24, 58, 27, 135, 24, 28, 24, 28, 40, 68, 68, 24, 86, 130, 28, 36, 36, 36, 43, 43, 28, 36, 128, 36, 38, 38, 38, 66, 66, 43, 38, 44, 38, 44, 44, 45, 49, 45, 66, 52, 45, 45, 53, 59, 44, 124, 60, 61, 123, 49, 63, 49, 52, 87, 52, 53, 59, 53, 59, 60, 61, 60, 61, 63, 90, 63, 87, 120, 60, 53, 59, 71, 52, 119, 116, 72, 115, 90, 61, 62, 63, 112, 81, 111, 71, 109, 71, 106, 72, 78, 72, 97, 62, 79, 62, 81, 71, 81, 80, 62, 72, 82, 78, 95, 78, 62, 79, 78, 79, 83, 62, 80, 89, 80, 82, 79, 82, 84, 89, 94, 80, 93, 83, 89, 83, 92, 82, 91, 88, 84, 84, 92, 84, 85, 85, 85, 92, 98, 99, 83, 77, 100, 101, 98, 99, 100, 98, 100, 98, 99, 102, 114, 100, 114, 101, 103, 102, 114, 85, 76, 101, 102, 114, 103, 101, 101, 104, 104, 104, 103, 107, 75, 108, 113, 103, 107, 107, 108, 108, 113, 117, 107, 118, 108, 113, 74, 117, 113, 118, 73, 117, 117, 118, 118, 121, 117, 70, 118, 122, 65, 121, 136, 136, 136, 122, 121, 125, 122, 125, 122, 129, 57, 125, 126, 132, 126, 129, 125, 133, 126, 56, 129, 55, 50, 126, 39, 136, 132, 37, 132, 32, 133, 21, 133, 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 19, 12, 7, 0, 146, 147, 0, 147, 147, 0, 147, 147, 148, 148, 0, 0, 148, 149, 149, 0, 149, 149, 149, 149, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143 } ; /* Table of booleans, true if rule could match eol. */ static lp_yyconst flex_int32_t lp_yy_rule_can_match_eol[34] = { 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define lp_yymore() lp_yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET /* made reentrant with help of http://www.usualcoding.eu/post/2007/09/03/Building-a-reentrant-parser-in-C-with-Flex/Bison */ /* Note that a minimum version of flex is needed to be able to compile this. Older version don't know the reentrant code. Version 2.5.4 is not enough. Probably at least v2.5.31 is needed. Tested with v2.5.35 */ /* ** We want the scanner to be reentrant, therefore generate no global variables. ** That what the 'reentrant' option is for. ** 'bison-bridge' is used to create a bison compatible scanner and share lp_yylval */ #define INITIAL 0 #define COMMENT 1 #define LINECOMMENT 2 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Holds the entire state of the reentrant scanner. */ struct lp_yyguts_t { /* User-defined. Not touched by flex. */ YY_EXTRA_TYPE lp_yyextra_r; /* The rest are the same as the globals declared in the non-reentrant scanner. */ FILE *lp_yyin_r, *lp_yyout_r; size_t lp_yy_buffer_stack_top; /**< index of top of stack. */ size_t lp_yy_buffer_stack_max; /**< capacity of stack. */ YY_BUFFER_STATE * lp_yy_buffer_stack; /**< Stack as an array. */ char lp_yy_hold_char; int lp_yy_n_chars; int lp_yyleng_r; char *lp_yy_c_buf_p; int lp_yy_init; int lp_yy_start; int lp_yy_did_buffer_switch_on_eof; int lp_yy_start_stack_ptr; int lp_yy_start_stack_depth; int *lp_yy_start_stack; lp_yy_state_type lp_yy_last_accepting_state; char* lp_yy_last_accepting_cpos; int lp_yylineno_r; int lp_yy_flex_debug_r; char *lp_yytext_r; int lp_yy_more_flag; int lp_yy_more_len; YYSTYPE * lp_yylval_r; }; /* end struct lp_yyguts_t */ static int lp_yy_init_globals (lp_yyscan_t lp_yyscanner ); /* This must go here because YYSTYPE and YYLTYPE are included * from bison output in section 1.*/ # define lp_yylval lp_yyg->lp_yylval_r int lp_yylex_init (lp_yyscan_t* scanner); int lp_yylex_init_extra (YY_EXTRA_TYPE user_defined,lp_yyscan_t* scanner); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int lp_yylex_destroy (lp_yyscan_t lp_yyscanner ); int lp_yyget_debug (lp_yyscan_t lp_yyscanner ); void lp_yyset_debug (int debug_flag ,lp_yyscan_t lp_yyscanner ); YY_EXTRA_TYPE lp_yyget_extra (lp_yyscan_t lp_yyscanner ); void lp_yyset_extra (YY_EXTRA_TYPE user_defined ,lp_yyscan_t lp_yyscanner ); FILE *lp_yyget_in (lp_yyscan_t lp_yyscanner ); void lp_yyset_in (FILE * in_str ,lp_yyscan_t lp_yyscanner ); FILE *lp_yyget_out (lp_yyscan_t lp_yyscanner ); void lp_yyset_out (FILE * out_str ,lp_yyscan_t lp_yyscanner ); int lp_yyget_leng (lp_yyscan_t lp_yyscanner ); char *lp_yyget_text (lp_yyscan_t lp_yyscanner ); int lp_yyget_lineno (lp_yyscan_t lp_yyscanner ); void lp_yyset_lineno (int line_number ,lp_yyscan_t lp_yyscanner ); YYSTYPE * lp_yyget_lval (lp_yyscan_t lp_yyscanner ); void lp_yyset_lval (YYSTYPE * lp_yylval_param ,lp_yyscan_t lp_yyscanner ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int lp_yywrap (lp_yyscan_t lp_yyscanner ); #else extern int lp_yywrap (lp_yyscan_t lp_yyscanner ); #endif #endif static void lp_yyunput (int c,char *buf_ptr ,lp_yyscan_t lp_yyscanner); #ifndef lp_yytext_ptr static void lp_yy_flex_strncpy (char *,lp_yyconst char *,int ,lp_yyscan_t lp_yyscanner); #endif #ifdef YY_NEED_STRLEN static int lp_yy_flex_strlen (lp_yyconst char * ,lp_yyscan_t lp_yyscanner); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int lp_yyinput (lp_yyscan_t lp_yyscanner ); #else static int input (lp_yyscan_t lp_yyscanner ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #define YY_READ_BUF_SIZE 8192 #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO fwrite( lp_yytext, lp_yyleng, 1, lp_yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->lp_yy_is_interactive ) \ { \ int c = '*'; \ int n; \ for ( n = 0; n < max_size && \ (c = getc( lp_yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( lp_yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, lp_yyin))==0 && ferror(lp_yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(lp_yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "lp_yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef lp_yyterminate #define lp_yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) lp_yy_fatal_error( msg , lp_yyscanner) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int lp_yylex \ (YYSTYPE * lp_yylval_param ,lp_yyscan_t lp_yyscanner); #define YY_DECL int lp_yylex \ (YYSTYPE * lp_yylval_param , lp_yyscan_t lp_yyscanner) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after lp_yytext and lp_yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ if ( lp_yyleng > 0 ) \ YY_CURRENT_BUFFER_LVALUE->lp_yy_at_bol = \ (lp_yytext[lp_yyleng - 1] == '\n'); \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register lp_yy_state_type lp_yy_current_state; register char *lp_yy_cp, *lp_yy_bp; register int lp_yy_act; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yylval = lp_yylval_param; if ( !lp_yyg->lp_yy_init ) { lp_yyg->lp_yy_init = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! lp_yyg->lp_yy_start ) lp_yyg->lp_yy_start = 1; /* first start state */ if ( ! lp_yyin ) lp_yyin = stdin; if ( ! lp_yyout ) lp_yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { lp_yyensure_buffer_stack (lp_yyscanner); YY_CURRENT_BUFFER_LVALUE = lp_yy_create_buffer(lp_yyin,YY_BUF_SIZE ,lp_yyscanner); } lp_yy_load_buffer_state(lp_yyscanner ); } while ( 1 ) /* loops until end-of-file is reached */ { lp_yy_cp = lp_yyg->lp_yy_c_buf_p; /* Support of lp_yytext. */ *lp_yy_cp = lp_yyg->lp_yy_hold_char; /* lp_yy_bp points to the position in lp_yy_ch_buf of the start of * the current run. */ lp_yy_bp = lp_yy_cp; lp_yy_current_state = lp_yyg->lp_yy_start; lp_yy_current_state += YY_AT_BOL(); lp_yy_match: do { register YY_CHAR lp_yy_c = lp_yy_ec[YY_SC_TO_UI(*lp_yy_cp)]; if ( lp_yy_accept[lp_yy_current_state] ) { lp_yyg->lp_yy_last_accepting_state = lp_yy_current_state; lp_yyg->lp_yy_last_accepting_cpos = lp_yy_cp; } while ( lp_yy_chk[lp_yy_base[lp_yy_current_state] + lp_yy_c] != lp_yy_current_state ) { lp_yy_current_state = (int) lp_yy_def[lp_yy_current_state]; if ( lp_yy_current_state >= 144 ) lp_yy_c = lp_yy_meta[(unsigned int) lp_yy_c]; } lp_yy_current_state = lp_yy_nxt[lp_yy_base[lp_yy_current_state] + (unsigned int) lp_yy_c]; ++lp_yy_cp; } while ( lp_yy_base[lp_yy_current_state] != 388 ); lp_yy_find_action: lp_yy_act = lp_yy_accept[lp_yy_current_state]; if ( lp_yy_act == 0 ) { /* have to back up */ lp_yy_cp = lp_yyg->lp_yy_last_accepting_cpos; lp_yy_current_state = lp_yyg->lp_yy_last_accepting_state; lp_yy_act = lp_yy_accept[lp_yy_current_state]; } YY_DO_BEFORE_ACTION; if ( lp_yy_act != YY_END_OF_BUFFER && lp_yy_rule_can_match_eol[lp_yy_act] ) { int lp_yyl; for ( lp_yyl = 0; lp_yyl < lp_yyleng; ++lp_yyl ) if ( lp_yytext[lp_yyl] == '\n' ) do{ lp_yylineno++; lp_yycolumn=0; }while(0) ; } do_action: /* This label is used only to access EOF actions. */ switch ( lp_yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *lp_yy_cp = lp_yyg->lp_yy_hold_char; lp_yy_cp = lp_yyg->lp_yy_last_accepting_cpos; lp_yy_current_state = lp_yyg->lp_yy_last_accepting_state; goto lp_yy_find_action; case 1: YY_RULE_SETUP { BEGIN COMMENT; } /* begin skip comment */ YY_BREAK case 2: YY_RULE_SETUP { BEGIN INITIAL; } /* end skip comment */ YY_BREAK case 3: YY_RULE_SETUP { } YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP { } YY_BREAK case 5: YY_RULE_SETUP { } YY_BREAK case 6: YY_RULE_SETUP { BEGIN LINECOMMENT; } /* begin skip LINECOMMENT */ YY_BREAK case 7: /* rule 7 can match eol */ YY_RULE_SETUP { BEGIN INITIAL; } /* end skip LINECOMMENT */ YY_BREAK case 8: YY_RULE_SETUP { BEGIN INITIAL; } /* end skip LINECOMMENT */ YY_BREAK case 9: YY_RULE_SETUP { } YY_BREAK case 10: /* rule 10 can match eol */ YY_RULE_SETUP { } YY_BREAK case 11: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; return(COMMA); } YY_BREAK case 12: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; return(MINIMISE); } YY_BREAK case 13: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; return(MAXIMISE); } YY_BREAK case 14: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->f = atof((char *)lp_yytext); return(INTCONS); } /* f contains the last float */ YY_BREAK case 15: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->f = atof((char *)lp_yytext); return(CONS); } /* f contains the last float */ YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; char *ptr, c; pp->lineno = lp_yylineno; pv->f = DEF_INFINITE; pv->Sign = 0; ptr = (char *)lp_yytext; while (isspace(*ptr)) ptr++; if(*ptr == '-') pv->Sign = 1; if(lp_yyleng > 0) { c = lp_yytext[lp_yyleng - 1]; if(!isalnum(c)) unput(c); } return(INF); } /* f contains the last float */ YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; int x; pp->lineno = lp_yylineno; pv->Sign = 0; for(x = 0; x < lp_yyleng; x++) if(lp_yytext[x] == '-' || lp_yytext[x] == '+') pv->Sign = (pv->Sign == (lp_yytext[x] == '+')); return (TOK_SIGN); /* Sign is TRUE if the sign-string represents a '-'. Otherwise Sign is FALSE */ } YY_BREAK case 18: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_int_decl = 1; pv->Within_sos_decl1 = FALSE; } return(SEC_INT); } YY_BREAK case 19: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_int_decl = 2; pv->Within_sos_decl1 = FALSE; } return(SEC_BIN); } YY_BREAK case 20: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_sec_decl = TRUE; pv->Within_sos_decl1 = FALSE; } return(SEC_SEC); } YY_BREAK case 21: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; if(!pv->Within_sos_decl) pv->SOStype0 = (short)atoi(((char *)lp_yytext) + 3); if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) pv->Within_sos_decl = TRUE; return(SEC_SOS); } YY_BREAK case 22: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)lp_yytext); pv->Last_var[strlen(pv->Last_var) - 2] = 0; return(SOSDESCR); } YY_BREAK case 23: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_free_decl = TRUE; pv->Within_sos_decl1 = FALSE; } return(SEC_FREE); } YY_BREAK case 24: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; char *ptr; pp->lineno = lp_yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)lp_yytext); ptr = pv->Last_var + strlen(pv->Last_var); ptr[-1] = ' '; while ((--ptr >= pv->Last_var) && (isspace(*ptr))) *ptr = 0; return(VARIABLECOLON); } YY_BREAK case 25: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)lp_yytext); return(VAR); } YY_BREAK case 26: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; return (COLON); } YY_BREAK case 27: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; return(AR_M_OP); } YY_BREAK case 28: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->OP = *lp_yytext; return(RE_OPEQ); } YY_BREAK case 29: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->OP = *lp_yytext; return(RE_OPLE); } YY_BREAK case 30: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->OP = *lp_yytext; return(RE_OPGE); } YY_BREAK case 31: YY_RULE_SETUP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = lp_yylineno; pv->Within_int_decl = pv->Within_sec_decl = pv->Within_sos_decl = pv->Within_free_decl = FALSE; check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, (int) pv->Within_sos_decl, (int) pv->Within_free_decl); return(END_C); } YY_BREAK case 32: YY_RULE_SETUP { parse_parm *pp = PARM; pp->lineno = lp_yylineno; report(NULL, CRITICAL, "LEX ERROR : %s lineno %d\n", lp_yytext, lp_yylineno); return(UNDEFINED); } YY_BREAK case 33: YY_RULE_SETUP ECHO; YY_BREAK case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(LINECOMMENT): lp_yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int lp_yy_amount_of_matched_text = (int) (lp_yy_cp - lp_yyg->lp_yytext_ptr) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *lp_yy_cp = lp_yyg->lp_yy_hold_char; YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->lp_yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed lp_yyin at a new source and called * lp_yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ lp_yyg->lp_yy_n_chars = YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars; YY_CURRENT_BUFFER_LVALUE->lp_yy_input_file = lp_yyin; YY_CURRENT_BUFFER_LVALUE->lp_yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for lp_yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since lp_yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( lp_yyg->lp_yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars] ) { /* This was really a NUL. */ lp_yy_state_type lp_yy_next_state; lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yytext_ptr + lp_yy_amount_of_matched_text; lp_yy_current_state = lp_yy_get_previous_state( lp_yyscanner ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * lp_yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ lp_yy_next_state = lp_yy_try_NUL_trans( lp_yy_current_state , lp_yyscanner); lp_yy_bp = lp_yyg->lp_yytext_ptr + YY_MORE_ADJ; if ( lp_yy_next_state ) { /* Consume the NUL. */ lp_yy_cp = ++lp_yyg->lp_yy_c_buf_p; lp_yy_current_state = lp_yy_next_state; goto lp_yy_match; } else { lp_yy_cp = lp_yyg->lp_yy_c_buf_p; goto lp_yy_find_action; } } else switch ( lp_yy_get_next_buffer( lp_yyscanner ) ) { case EOB_ACT_END_OF_FILE: { lp_yyg->lp_yy_did_buffer_switch_on_eof = 0; if ( lp_yywrap(lp_yyscanner ) ) { /* Note: because we've taken care in * lp_yy_get_next_buffer() to have set up * lp_yytext, we can now set up * lp_yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yytext_ptr + YY_MORE_ADJ; lp_yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! lp_yyg->lp_yy_did_buffer_switch_on_eof ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yytext_ptr + lp_yy_amount_of_matched_text; lp_yy_current_state = lp_yy_get_previous_state( lp_yyscanner ); lp_yy_cp = lp_yyg->lp_yy_c_buf_p; lp_yy_bp = lp_yyg->lp_yytext_ptr + YY_MORE_ADJ; goto lp_yy_match; case EOB_ACT_LAST_MATCH: lp_yyg->lp_yy_c_buf_p = &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars]; lp_yy_current_state = lp_yy_get_previous_state( lp_yyscanner ); lp_yy_cp = lp_yyg->lp_yy_c_buf_p; lp_yy_bp = lp_yyg->lp_yytext_ptr + YY_MORE_ADJ; goto lp_yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of lp_yylex */ /* lp_yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int lp_yy_get_next_buffer (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; register char *dest = YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf; register char *source = lp_yyg->lp_yytext_ptr; register int number_to_move, i; int ret_val; if ( lp_yyg->lp_yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->lp_yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( lp_yyg->lp_yy_c_buf_p - lp_yyg->lp_yytext_ptr - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) (lp_yyg->lp_yy_c_buf_p - lp_yyg->lp_yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->lp_yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars = lp_yyg->lp_yy_n_chars = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int lp_yy_c_buf_p_offset = (int) (lp_yyg->lp_yy_c_buf_p - b->lp_yy_ch_buf); if ( b->lp_yy_is_our_buffer ) { int new_size = b->lp_yy_buf_size * 2; if ( new_size <= 0 ) b->lp_yy_buf_size += b->lp_yy_buf_size / 8; else b->lp_yy_buf_size *= 2; b->lp_yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ lp_yyrealloc((void *) b->lp_yy_ch_buf,b->lp_yy_buf_size + 2 ,lp_yyscanner ); } else /* Can't grow it, we don't own it. */ b->lp_yy_ch_buf = 0; if ( ! b->lp_yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); lp_yyg->lp_yy_c_buf_p = &b->lp_yy_ch_buf[lp_yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[number_to_move]), lp_yyg->lp_yy_n_chars, (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars = lp_yyg->lp_yy_n_chars; } if ( lp_yyg->lp_yy_n_chars == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; lp_yyrestart(lp_yyin ,lp_yyscanner); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->lp_yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((lp_yy_size_t) (lp_yyg->lp_yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ lp_yy_size_t new_size = lp_yyg->lp_yy_n_chars + number_to_move + (lp_yyg->lp_yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf = (char *) lp_yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf,new_size ,lp_yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in lp_yy_get_next_buffer()" ); } lp_yyg->lp_yy_n_chars += number_to_move; YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; lp_yyg->lp_yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[0]; return ret_val; } /* lp_yy_get_previous_state - get the state just before the EOB char was reached */ static lp_yy_state_type lp_yy_get_previous_state (lp_yyscan_t lp_yyscanner) { register lp_yy_state_type lp_yy_current_state; register char *lp_yy_cp; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yy_current_state = lp_yyg->lp_yy_start; lp_yy_current_state += YY_AT_BOL(); for ( lp_yy_cp = lp_yyg->lp_yytext_ptr + YY_MORE_ADJ; lp_yy_cp < lp_yyg->lp_yy_c_buf_p; ++lp_yy_cp ) { register YY_CHAR lp_yy_c = (*lp_yy_cp ? lp_yy_ec[YY_SC_TO_UI(*lp_yy_cp)] : 1); if ( lp_yy_accept[lp_yy_current_state] ) { lp_yyg->lp_yy_last_accepting_state = lp_yy_current_state; lp_yyg->lp_yy_last_accepting_cpos = lp_yy_cp; } while ( lp_yy_chk[lp_yy_base[lp_yy_current_state] + lp_yy_c] != lp_yy_current_state ) { lp_yy_current_state = (int) lp_yy_def[lp_yy_current_state]; if ( lp_yy_current_state >= 144 ) lp_yy_c = lp_yy_meta[(unsigned int) lp_yy_c]; } lp_yy_current_state = lp_yy_nxt[lp_yy_base[lp_yy_current_state] + (unsigned int) lp_yy_c]; } return lp_yy_current_state; } /* lp_yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = lp_yy_try_NUL_trans( current_state ); */ static lp_yy_state_type lp_yy_try_NUL_trans (lp_yy_state_type lp_yy_current_state , lp_yyscan_t lp_yyscanner) { register int lp_yy_is_jam; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* This var may be unused depending upon options. */ register char *lp_yy_cp = lp_yyg->lp_yy_c_buf_p; register YY_CHAR lp_yy_c = 1; if ( lp_yy_accept[lp_yy_current_state] ) { lp_yyg->lp_yy_last_accepting_state = lp_yy_current_state; lp_yyg->lp_yy_last_accepting_cpos = lp_yy_cp; } while ( lp_yy_chk[lp_yy_base[lp_yy_current_state] + lp_yy_c] != lp_yy_current_state ) { lp_yy_current_state = (int) lp_yy_def[lp_yy_current_state]; if ( lp_yy_current_state >= 144 ) lp_yy_c = lp_yy_meta[(unsigned int) lp_yy_c]; } lp_yy_current_state = lp_yy_nxt[lp_yy_base[lp_yy_current_state] + (unsigned int) lp_yy_c]; lp_yy_is_jam = (lp_yy_current_state == 143); return lp_yy_is_jam ? 0 : lp_yy_current_state; } static void lp_yyunput (int c, register char * lp_yy_bp , lp_yyscan_t lp_yyscanner) { register char *lp_yy_cp; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yy_cp = lp_yyg->lp_yy_c_buf_p; /* undo effects of setting up lp_yytext */ *lp_yy_cp = lp_yyg->lp_yy_hold_char; if ( lp_yy_cp < YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ register int number_to_move = lp_yyg->lp_yy_n_chars + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_size + 2]; register char *source = &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf ) *--dest = *--source; lp_yy_cp += (int) (dest - source); lp_yy_bp += (int) (dest - source); YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars = lp_yyg->lp_yy_n_chars = YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_size; if ( lp_yy_cp < YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--lp_yy_cp = (char) c; if ( c == '\n' ){ --lp_yylineno; } lp_yyg->lp_yytext_ptr = lp_yy_bp; lp_yyg->lp_yy_hold_char = *lp_yy_cp; lp_yyg->lp_yy_c_buf_p = lp_yy_cp; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int lp_yyinput (lp_yyscan_t lp_yyscanner) #else static int input (lp_yyscan_t lp_yyscanner) #endif { int c; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; *lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yy_hold_char; if ( *lp_yyg->lp_yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) { /* lp_yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( lp_yyg->lp_yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->lp_yy_ch_buf[lp_yyg->lp_yy_n_chars] ) /* This was really a NUL. */ *lp_yyg->lp_yy_c_buf_p = '\0'; else { /* need more input */ int offset = lp_yyg->lp_yy_c_buf_p - lp_yyg->lp_yytext_ptr; ++lp_yyg->lp_yy_c_buf_p; switch ( lp_yy_get_next_buffer( lp_yyscanner ) ) { case EOB_ACT_LAST_MATCH: /* This happens because lp_yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ lp_yyrestart(lp_yyin ,lp_yyscanner); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( lp_yywrap(lp_yyscanner ) ) return EOF; if ( ! lp_yyg->lp_yy_did_buffer_switch_on_eof ) YY_NEW_FILE; #ifdef __cplusplus return lp_yyinput(lp_yyscanner); #else return input(lp_yyscanner); #endif } case EOB_ACT_CONTINUE_SCAN: lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yytext_ptr + offset; break; } } } c = *(unsigned char *) lp_yyg->lp_yy_c_buf_p; /* cast for 8-bit char's */ *lp_yyg->lp_yy_c_buf_p = '\0'; /* preserve lp_yytext */ lp_yyg->lp_yy_hold_char = *++lp_yyg->lp_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lp_yy_at_bol = (c == '\n'); if ( YY_CURRENT_BUFFER_LVALUE->lp_yy_at_bol ) do{ lp_yylineno++; lp_yycolumn=0; }while(0) ; return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * @param lp_yyscanner The scanner object. * @note This function does not reset the start condition to @c INITIAL . */ void lp_yyrestart (FILE * input_file , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if ( ! YY_CURRENT_BUFFER ){ lp_yyensure_buffer_stack (lp_yyscanner); YY_CURRENT_BUFFER_LVALUE = lp_yy_create_buffer(lp_yyin,YY_BUF_SIZE ,lp_yyscanner); } lp_yy_init_buffer(YY_CURRENT_BUFFER,input_file ,lp_yyscanner); lp_yy_load_buffer_state(lp_yyscanner ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * @param lp_yyscanner The scanner object. */ void lp_yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* TODO. We should be able to replace this entire function body * with * lp_yypop_buffer_state(); * lp_yypush_buffer_state(new_buffer); */ lp_yyensure_buffer_stack (lp_yyscanner); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yy_hold_char; YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_pos = lp_yyg->lp_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars = lp_yyg->lp_yy_n_chars; } YY_CURRENT_BUFFER_LVALUE = new_buffer; lp_yy_load_buffer_state(lp_yyscanner ); /* We don't actually know whether we did this switch during * EOF (lp_yywrap()) processing, but the only time this flag * is looked at is after lp_yywrap() is called, so it's safe * to go ahead and always set it. */ lp_yyg->lp_yy_did_buffer_switch_on_eof = 1; } static void lp_yy_load_buffer_state (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yyg->lp_yy_n_chars = YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars; lp_yyg->lp_yytext_ptr = lp_yyg->lp_yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_pos; lp_yyin = YY_CURRENT_BUFFER_LVALUE->lp_yy_input_file; lp_yyg->lp_yy_hold_char = *lp_yyg->lp_yy_c_buf_p; } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * @param lp_yyscanner The scanner object. * @return the allocated buffer state. */ YY_BUFFER_STATE lp_yy_create_buffer (FILE * file, int size , lp_yyscan_t lp_yyscanner) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) lp_yyalloc(sizeof( struct lp_yy_buffer_state ) ,lp_yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in lp_yy_create_buffer()" ); b->lp_yy_buf_size = size; /* lp_yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->lp_yy_ch_buf = (char *) lp_yyalloc(b->lp_yy_buf_size + 2 ,lp_yyscanner ); if ( ! b->lp_yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in lp_yy_create_buffer()" ); b->lp_yy_is_our_buffer = 1; lp_yy_init_buffer(b,file ,lp_yyscanner); return b; } /** Destroy the buffer. * @param b a buffer created with lp_yy_create_buffer() * @param lp_yyscanner The scanner object. */ void lp_yy_delete_buffer (YY_BUFFER_STATE b , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->lp_yy_is_our_buffer ) lp_yyfree((void *) b->lp_yy_ch_buf ,lp_yyscanner ); lp_yyfree((void *) b ,lp_yyscanner ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a lp_yyrestart() or at EOF. */ static void lp_yy_init_buffer (YY_BUFFER_STATE b, FILE * file , lp_yyscan_t lp_yyscanner) { int oerrno = errno; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yy_flush_buffer(b ,lp_yyscanner); b->lp_yy_input_file = file; b->lp_yy_fill_buffer = 1; /* If b is the current buffer, then lp_yy_init_buffer was _probably_ * called from lp_yyrestart() or through lp_yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->lp_yy_bs_lineno = 1; b->lp_yy_bs_column = 0; } b->lp_yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * @param lp_yyscanner The scanner object. */ void lp_yy_flush_buffer (YY_BUFFER_STATE b , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if ( ! b ) return; b->lp_yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->lp_yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->lp_yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->lp_yy_buf_pos = &b->lp_yy_ch_buf[0]; b->lp_yy_at_bol = 1; b->lp_yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) lp_yy_load_buffer_state(lp_yyscanner ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * @param lp_yyscanner The scanner object. */ void lp_yypush_buffer_state (YY_BUFFER_STATE new_buffer , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if (new_buffer == NULL) return; lp_yyensure_buffer_stack(lp_yyscanner); /* This block is copied from lp_yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *lp_yyg->lp_yy_c_buf_p = lp_yyg->lp_yy_hold_char; YY_CURRENT_BUFFER_LVALUE->lp_yy_buf_pos = lp_yyg->lp_yy_c_buf_p; YY_CURRENT_BUFFER_LVALUE->lp_yy_n_chars = lp_yyg->lp_yy_n_chars; } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) lp_yyg->lp_yy_buffer_stack_top++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from lp_yy_switch_to_buffer. */ lp_yy_load_buffer_state(lp_yyscanner ); lp_yyg->lp_yy_did_buffer_switch_on_eof = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * @param lp_yyscanner The scanner object. */ void lp_yypop_buffer_state (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if (!YY_CURRENT_BUFFER) return; lp_yy_delete_buffer(YY_CURRENT_BUFFER ,lp_yyscanner); YY_CURRENT_BUFFER_LVALUE = NULL; if (lp_yyg->lp_yy_buffer_stack_top > 0) --lp_yyg->lp_yy_buffer_stack_top; if (YY_CURRENT_BUFFER) { lp_yy_load_buffer_state(lp_yyscanner ); lp_yyg->lp_yy_did_buffer_switch_on_eof = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void lp_yyensure_buffer_stack (lp_yyscan_t lp_yyscanner) { int num_to_alloc; struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if (!lp_yyg->lp_yy_buffer_stack) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; lp_yyg->lp_yy_buffer_stack = (struct lp_yy_buffer_state**)lp_yyalloc (num_to_alloc * sizeof(struct lp_yy_buffer_state*) , lp_yyscanner); if ( ! lp_yyg->lp_yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in lp_yyensure_buffer_stack()" ); memset(lp_yyg->lp_yy_buffer_stack, 0, num_to_alloc * sizeof(struct lp_yy_buffer_state*)); lp_yyg->lp_yy_buffer_stack_max = num_to_alloc; lp_yyg->lp_yy_buffer_stack_top = 0; return; } if (lp_yyg->lp_yy_buffer_stack_top >= (lp_yyg->lp_yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = lp_yyg->lp_yy_buffer_stack_max + grow_size; lp_yyg->lp_yy_buffer_stack = (struct lp_yy_buffer_state**)lp_yyrealloc (lp_yyg->lp_yy_buffer_stack, num_to_alloc * sizeof(struct lp_yy_buffer_state*) , lp_yyscanner); if ( ! lp_yyg->lp_yy_buffer_stack ) YY_FATAL_ERROR( "out of dynamic memory in lp_yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset(lp_yyg->lp_yy_buffer_stack + lp_yyg->lp_yy_buffer_stack_max, 0, grow_size * sizeof(struct lp_yy_buffer_state*)); lp_yyg->lp_yy_buffer_stack_max = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * @param lp_yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE lp_yy_scan_buffer (char * base, lp_yy_size_t size , lp_yyscan_t lp_yyscanner) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) lp_yyalloc(sizeof( struct lp_yy_buffer_state ) ,lp_yyscanner ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in lp_yy_scan_buffer()" ); b->lp_yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->lp_yy_buf_pos = b->lp_yy_ch_buf = base; b->lp_yy_is_our_buffer = 0; b->lp_yy_input_file = 0; b->lp_yy_n_chars = b->lp_yy_buf_size; b->lp_yy_is_interactive = 0; b->lp_yy_at_bol = 1; b->lp_yy_fill_buffer = 0; b->lp_yy_buffer_status = YY_BUFFER_NEW; lp_yy_switch_to_buffer(b ,lp_yyscanner ); return b; } /** Setup the input buffer state to scan a string. The next call to lp_yylex() will * scan from a @e copy of @a str. * @param lp_yystr a NUL-terminated string to scan * @param lp_yyscanner The scanner object. * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * lp_yy_scan_bytes() instead. */ YY_BUFFER_STATE lp_yy_scan_string (lp_yyconst char * lp_yystr , lp_yyscan_t lp_yyscanner) { return lp_yy_scan_bytes(lp_yystr,strlen(lp_yystr) ,lp_yyscanner); } /** Setup the input buffer state to scan the given bytes. The next call to lp_yylex() will * scan from a @e copy of @a bytes. * @param bytes the byte buffer to scan * @param len the number of bytes in the buffer pointed to by @a bytes. * @param lp_yyscanner The scanner object. * @return the newly allocated buffer state object. */ YY_BUFFER_STATE lp_yy_scan_bytes (lp_yyconst char * lp_yybytes, int _lp_yybytes_len , lp_yyscan_t lp_yyscanner) { YY_BUFFER_STATE b; char *buf; lp_yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _lp_yybytes_len + 2; buf = (char *) lp_yyalloc(n ,lp_yyscanner ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in lp_yy_scan_bytes()" ); for ( i = 0; i < _lp_yybytes_len; ++i ) buf[i] = lp_yybytes[i]; buf[_lp_yybytes_len] = buf[_lp_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = lp_yy_scan_buffer(buf,n ,lp_yyscanner); if ( ! b ) YY_FATAL_ERROR( "bad buffer in lp_yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->lp_yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void lp_yy_fatal_error (lp_yyconst char* msg , lp_yyscan_t lp_yyscanner) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine lp_yyless() so it works in section 3 code. */ #undef lp_yyless #define lp_yyless(n) \ do \ { \ /* Undo effects of setting up lp_yytext. */ \ int lp_yyless_macro_arg = (n); \ YY_LESS_LINENO(lp_yyless_macro_arg);\ lp_yytext[lp_yyleng] = lp_yyg->lp_yy_hold_char; \ lp_yyg->lp_yy_c_buf_p = lp_yytext + lp_yyless_macro_arg; \ lp_yyg->lp_yy_hold_char = *lp_yyg->lp_yy_c_buf_p; \ *lp_yyg->lp_yy_c_buf_p = '\0'; \ lp_yyleng = lp_yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the user-defined data for this scanner. * @param lp_yyscanner The scanner object. */ YY_EXTRA_TYPE lp_yyget_extra (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yyextra; } /** Get the current line number. * @param lp_yyscanner The scanner object. */ int lp_yyget_lineno (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if (! YY_CURRENT_BUFFER) return 0; return lp_yylineno; } /** Get the current column number. * @param lp_yyscanner The scanner object. */ int lp_yyget_column (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; if (! YY_CURRENT_BUFFER) return 0; return lp_yycolumn; } /** Get the input stream. * @param lp_yyscanner The scanner object. */ FILE *lp_yyget_in (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yyin; } /** Get the output stream. * @param lp_yyscanner The scanner object. */ FILE *lp_yyget_out (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yyout; } /** Get the length of the current token. * @param lp_yyscanner The scanner object. */ int lp_yyget_leng (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yyleng; } /** Get the current token. * @param lp_yyscanner The scanner object. */ char *lp_yyget_text (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yytext; } /** Set the user-defined data. This data is never touched by the scanner. * @param user_defined The data to be associated with this scanner. * @param lp_yyscanner The scanner object. */ void lp_yyset_extra (YY_EXTRA_TYPE user_defined , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yyextra = user_defined ; } /** Set the current line number. * @param line_number * @param lp_yyscanner The scanner object. */ void lp_yyset_lineno (int line_number , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) lp_yy_fatal_error( "lp_yyset_lineno called with no buffer" , lp_yyscanner); lp_yylineno = line_number; } /** Set the current column. * @param line_number * @param lp_yyscanner The scanner object. */ void lp_yyset_column (int column_no , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) lp_yy_fatal_error( "lp_yyset_column called with no buffer" , lp_yyscanner); lp_yycolumn = column_no; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * @param lp_yyscanner The scanner object. * @see lp_yy_switch_to_buffer */ void lp_yyset_in (FILE * in_str , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yyin = in_str ; } void lp_yyset_out (FILE * out_str , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yyout = out_str ; } int lp_yyget_debug (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yy_flex_debug; } void lp_yyset_debug (int bdebug , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yy_flex_debug = bdebug ; } /* Accessor methods for lp_yylval and lp_yylloc */ YYSTYPE * lp_yyget_lval (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; return lp_yylval; } void lp_yyset_lval (YYSTYPE * lp_yylval_param , lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; lp_yylval = lp_yylval_param; } /* User-visible API */ /* lp_yylex_init is special because it creates the scanner itself, so it is * the ONLY reentrant function that doesn't take the scanner as the last argument. * That's why we explicitly handle the declaration, instead of using our macros. */ int lp_yylex_init(lp_yyscan_t* ptr_lp_yy_globals) { if (ptr_lp_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_lp_yy_globals = (lp_yyscan_t) lp_yyalloc ( sizeof( struct lp_yyguts_t ), NULL ); if (*ptr_lp_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in lp_yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_lp_yy_globals,0x00,sizeof(struct lp_yyguts_t)); return lp_yy_init_globals ( *ptr_lp_yy_globals ); } /* lp_yylex_init_extra has the same functionality as lp_yylex_init, but follows the * convention of taking the scanner as the last argument. Note however, that * this is a *pointer* to a scanner, as it will be allocated by this call (and * is the reason, too, why this function also must handle its own declaration). * The user defined value in the first argument will be available to lp_yyalloc in * the lp_yyextra field. */ int lp_yylex_init_extra(YY_EXTRA_TYPE lp_yy_user_defined,lp_yyscan_t* ptr_lp_yy_globals ) { struct lp_yyguts_t dummy_lp_yyguts; lp_yyset_extra (lp_yy_user_defined, &dummy_lp_yyguts); if (ptr_lp_yy_globals == NULL){ errno = EINVAL; return 1; } *ptr_lp_yy_globals = (lp_yyscan_t) lp_yyalloc ( sizeof( struct lp_yyguts_t ), &dummy_lp_yyguts ); if (*ptr_lp_yy_globals == NULL){ errno = ENOMEM; return 1; } /* By setting to 0xAA, we expose bugs in lp_yy_init_globals. Leave at 0x00 for releases. */ memset(*ptr_lp_yy_globals,0x00,sizeof(struct lp_yyguts_t)); lp_yyset_extra (lp_yy_user_defined, *ptr_lp_yy_globals); return lp_yy_init_globals ( *ptr_lp_yy_globals ); } static int lp_yy_init_globals (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* Initialization is the same as for the non-reentrant scanner. * This function is called from lp_yylex_destroy(), so don't allocate here. */ lp_yyg->lp_yy_buffer_stack = 0; lp_yyg->lp_yy_buffer_stack_top = 0; lp_yyg->lp_yy_buffer_stack_max = 0; lp_yyg->lp_yy_c_buf_p = (char *) 0; lp_yyg->lp_yy_init = 0; lp_yyg->lp_yy_start = 0; lp_yyg->lp_yy_start_stack_ptr = 0; lp_yyg->lp_yy_start_stack_depth = 0; lp_yyg->lp_yy_start_stack = NULL; /* Defined in main.c */ #ifdef YY_STDINIT lp_yyin = stdin; lp_yyout = stdout; #else lp_yyin = (FILE *) 0; lp_yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * lp_yylex_init() */ return 0; } /* lp_yylex_destroy is for both reentrant and non-reentrant scanners. */ int lp_yylex_destroy (lp_yyscan_t lp_yyscanner) { struct lp_yyguts_t * lp_yyg = (struct lp_yyguts_t*)lp_yyscanner; /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ lp_yy_delete_buffer(YY_CURRENT_BUFFER ,lp_yyscanner ); YY_CURRENT_BUFFER_LVALUE = NULL; lp_yypop_buffer_state(lp_yyscanner); } /* Destroy the stack itself. */ lp_yyfree(lp_yyg->lp_yy_buffer_stack ,lp_yyscanner); lp_yyg->lp_yy_buffer_stack = NULL; /* Destroy the start condition stack. */ lp_yyfree(lp_yyg->lp_yy_start_stack ,lp_yyscanner ); lp_yyg->lp_yy_start_stack = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * lp_yylex() is called, initialization will occur. */ lp_yy_init_globals( lp_yyscanner); /* Destroy the main struct (reentrant only). */ lp_yyfree ( lp_yyscanner , lp_yyscanner ); lp_yyscanner = NULL; return 0; } /* * Internal utility routines. */ #ifndef lp_yytext_ptr static void lp_yy_flex_strncpy (char* s1, lp_yyconst char * s2, int n , lp_yyscan_t lp_yyscanner) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int lp_yy_flex_strlen (lp_yyconst char * s , lp_yyscan_t lp_yyscanner) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *lp_yyalloc (lp_yy_size_t size , lp_yyscan_t lp_yyscanner) { return (void *) malloc( size ); } void *lp_yyrealloc (void * ptr, lp_yy_size_t size , lp_yyscan_t lp_yyscanner) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void lp_yyfree (void * ptr , lp_yyscan_t lp_yyscanner) { free( (char *) ptr ); /* see lp_yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "lp_yytables" lp_solve_5.5/lp_rlp.l100666 0 0 15374 11141374251 13235 0ustar usergroupWS1 [ \t] WS2 [ \t\r\n] LT [A-Za-z] KR [A-Za-z0-9_\[\]\{\}/.&#$%~'@^] DI [0-9] INNM {DI}+ NM (({DI}+\.?{DI}*)|(\.{DI}+))([Ee][-+]?{DI}+)? VR {LT}{KR}*(<{KR}+>)? OPEQ = OPLE [<]=? OPGE [>]=? EOW $|[*+-;<=>]|{WS2}+ INF {WS2}*[-+][Ii][Nn][Ff]([Ii][Nn][Ii][Tt]([Ee]|[Yy]))?{EOW} S_OP [-+ \t\n\r]+ MIN [mM][iI][nN]([iI][mM][iI][zZsS][eE])?{WS1}*: MAX [mM][aA][xX]([iI][mM][iI][zZsS][eE])?{WS1}*: INT ^{WS1}*[Ii][Nn][Tt]([Ee][Gg][Ee][Rr])? BIN ^{WS1}*[Bb][Ii][Nn]([Aa][Rr][Yy])? SEC ^{WS1}*([Ss][Ee][Cc])|([Ss][Ee][Mm][Ii]-[Cc][Oo][Nn][Tt][Ii][Nn][Uu][Oo][Uu][Ss])|([Ss][Ee][Mm][Ii])|([Ss][Ee][Mm][Ii][Ss]) SOS ^{WS1}*([Ss][Oo][Ss][12]*)|([Ss][Ee][Tt][Ss]) FREE ^{WS1}*[Ff][Rr][Ee][Ee] LBL {VR}{WS1}*: SOSD {LBL}: /* made reentrant with help of http://www.usualcoding.eu/post/2007/09/03/Building-a-reentrant-parser-in-C-with-Flex/Bison */ /* Note that a minimum version of flex is needed to be able to compile this. Older version don't know the reentrant code. Version 2.5.4 is not enough. Probably at least v2.5.31 is needed. Tested with v2.5.35 */ /* ** We want the scanner to be reentrant, therefore generate no global variables. ** That what the 'reentrant' option is for. ** 'bison-bridge' is used to create a bison compatible scanner and share yylval */ %option reentrant bison-bridge %option noyywrap %option yylineno %start COMMENT %start LINECOMMENT %% "/*" { BEGIN COMMENT; } /* begin skip comment */ "*/" { BEGIN INITIAL; } /* end skip comment */ . { } \n { } \r { } "//" { BEGIN LINECOMMENT; } /* begin skip LINECOMMENT */ \n { BEGIN INITIAL; } /* end skip LINECOMMENT */ \r { BEGIN INITIAL; } /* end skip LINECOMMENT */ . { } {WS2}+ { } "," { parse_parm *pp = PARM; pp->lineno = yylineno; return(COMMA); } {MIN} { parse_parm *pp = PARM; pp->lineno = yylineno; return(MINIMISE); } {MAX} { parse_parm *pp = PARM; pp->lineno = yylineno; return(MAXIMISE); } {INNM} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->f = atof((char *)yytext); return(INTCONS); } /* f contains the last float */ {NM} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->f = atof((char *)yytext); return(CONS); } /* f contains the last float */ {INF} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; char *ptr, c; pp->lineno = yylineno; pv->f = DEF_INFINITE; pv->Sign = 0; ptr = (char *)yytext; while (isspace(*ptr)) ptr++; if(*ptr == '-') pv->Sign = 1; if(yyleng > 0) { c = yytext[yyleng - 1]; if(!isalnum(c)) unput(c); } return(INF); } /* f contains the last float */ {S_OP} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; int x; pp->lineno = yylineno; pv->Sign = 0; for(x = 0; x < yyleng; x++) if(yytext[x] == '-' || yytext[x] == '+') pv->Sign = (pv->Sign == (yytext[x] == '+')); return (TOK_SIGN); /* Sign is TRUE if the sign-string represents a '-'. Otherwise Sign is FALSE */ } {INT} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_int_decl = 1; pv->Within_sos_decl1 = FALSE; } return(SEC_INT); } {BIN} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_int_decl = 2; pv->Within_sos_decl1 = FALSE; } return(SEC_BIN); } {SEC} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_sec_decl = TRUE; pv->Within_sos_decl1 = FALSE; } return(SEC_SEC); } {SOS} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; if(!pv->Within_sos_decl) pv->SOStype0 = (short)atoi(((char *)yytext) + 3); if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) pv->Within_sos_decl = TRUE; return(SEC_SOS); } {SOSD} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)yytext); pv->Last_var[strlen(pv->Last_var) - 2] = 0; return(SOSDESCR); } {FREE} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl) && (!pv->Within_free_decl)) { pv->Within_free_decl = TRUE; pv->Within_sos_decl1 = FALSE; } return(SEC_FREE); } {LBL} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; char *ptr; pp->lineno = yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)yytext); ptr = pv->Last_var + strlen(pv->Last_var); ptr[-1] = ' '; while ((--ptr >= pv->Last_var) && (isspace(*ptr))) *ptr = 0; return(VARIABLECOLON); } {VR} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; FREE(pv->Last_var); pv->Last_var = strdup((char *)yytext); return(VAR); } ":" { parse_parm *pp = PARM; pp->lineno = yylineno; return (COLON); } "*" { parse_parm *pp = PARM; pp->lineno = yylineno; return(AR_M_OP); } {OPEQ} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->OP = *yytext; return(RE_OPEQ); } {OPLE} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->OP = *yytext; return(RE_OPLE); } {OPGE} { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->OP = *yytext; return(RE_OPGE); } ";" { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pp->lineno = yylineno; pv->Within_int_decl = pv->Within_sec_decl = pv->Within_sos_decl = pv->Within_free_decl = FALSE; check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, (int) pv->Within_sos_decl, (int) pv->Within_free_decl); return(END_C); } . { parse_parm *pp = PARM; pp->lineno = yylineno; report(NULL, CRITICAL, "LEX ERROR : %s lineno %d\n", yytext, yylineno); return(UNDEFINED); } %% lp_solve_5.5/lp_rlp.y100666 0 0 52041 11141374251 13242 0ustar usergroup/* ========================================================================= */ /* NAME : lp_rlp.y */ /* ========================================================================= */ /* made reentrant with help of http://www.usualcoding.eu/post/2007/09/03/Building-a-reentrant-parser-in-C-with-Flex/Bison */ /* Note that a minimum version of bison is needed to be able to compile this. Older version don't know the reentrant code. Version 1.35 is not enough. v1.875 could be ok. Tested with v2.3 */ %pure-parser %parse-param {parse_parm *parm} %parse-param {void *scanner} %lex-param {yyscan_t *scanner} %token VAR CONS INTCONS VARIABLECOLON INF SEC_INT SEC_BIN SEC_SEC SEC_SOS SOSDESCR SEC_FREE TOK_SIGN AR_M_OP RE_OPEQ RE_OPLE RE_OPGE END_C COMMA COLON MINIMISE MAXIMISE UNDEFINED %{ #include #include #include #define scanner yyscanner #define PARM yyget_extra(yyscanner) #define YYSTYPE int #define YY_EXTRA_TYPE parse_parm * #define YY_FATAL_ERROR(msg) lex_fatal_error(PARM, yyscanner, msg) #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result = lp_input((void *) PARM, buf, max_size); #define yyerror read_error #include "lpkit.h" #include "yacc_read.h" typedef struct parse_vars_s { read_modeldata_func *lp_input; void *userhandle; char HadVar, HadVar0, HadVar1, HadVar2, HasAR_M_OP, HadConstraint, Had_lineair_sum, Had_lineair_sum0, do_add_row, HadSign, OP, Sign, isign, isign0, make_neg; char state, state0; char Within_int_decl; /* TRUE when we are within an char declaration */ char Within_bin_decl; /* TRUE when we are within an bin declaration */ char Within_sec_decl; /* TRUE when we are within a sec declaration */ char Within_sos_decl; /* TRUE when we are within a sos declaration */ char Within_sos_decl1; char Within_free_decl; /* TRUE when we are within a free declaration */ short SOStype, SOStype0; /* SOS type */ int SOSNr; int SOSweight; /* SOS weight */ char *Last_var, *Last_var0; REAL f, f0, f1; } parse_vars; #ifdef FORTIFY # include "lp_fortify.h" #endif /* let's please C++ users */ #ifdef __cplusplus extern "C" { #endif #if defined MSDOS || defined __MSDOS__ || defined WINDOWS || defined _WINDOWS || defined WIN32 || defined _WIN32 #define YY_NO_UNISTD_H static int isatty(int f) { return(FALSE); } #if !defined _STDLIB_H # define _STDLIB_H #endif #endif static int __WINAPI lp_input_yyin(void *fpin, char *buf, int max_size) { int result; result = fread( (char*)buf, sizeof(char), max_size, (FILE *)fpin); return(result); } static int __WINAPI lp_input(void *vpp, char *buf, int max_size) { parse_parm *pp = (parse_parm *) vpp; parse_vars *pv = (parse_vars *) pp->parse_vars; int result; result = pv->lp_input(pv->userhandle, buf, max_size); if (result < 0) lex_fatal_error(pp, pp->scanner, "read() in flex scanner failed"); return(result); } #ifdef __cplusplus }; #endif #include "lp_rlp.h" #undef yylval %} %start inputfile %% EMPTY: /* EMPTY */ ; inputfile : { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = 0; pv->make_neg = 0; pv->Sign = 0; pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; } objective_function constraints int_bin_sec_sos_free_declarations ; /* start objective_function */ /* objective_function: MAXIMISE real_of | MINIMISE real_of | real_of; real_of: lineair_sum END_C; lineair_sum: EMPTY | x_lineair_sum; */ objective_function: MAXIMISE real_of { set_obj_dir(PARM, TRUE); } | MINIMISE real_of { set_obj_dir(PARM, FALSE); } | real_of ; real_of: lineair_sum END_C { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; add_row(pp); pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; pv->isign = 0; pv->make_neg = 0; } ; lineair_sum: EMPTY | x_lineair_sum ; /* end objective_function */ /* start constraints */ /* constraints: EMPTY | x_constraints; x_constraints: constraint | x_constraints constraint; constraint: real_constraint | VARIABLECOLON real_constraint; real_constraint: x_lineair_sum2 RE_OP x_lineair_sum3 optionalrange END_C; optionalrange: EMPTY | RE_OP cons_term RHS_STORE; RE_OP: RE_OPEQ | RE_OPLE | RE_OPGE; cons_term: x_SIGN REALCONS | INF; x_lineair_sum2: EMPTY | x_lineair_sum3; x_lineair_sum3: x_lineair_sum | INF RHS_STORE; x_lineair_sum: x_lineair_sum1; x_lineair_sum1: x_lineair_term | x_lineair_sum1 x_lineair_term; x_lineair_term: x_SIGN x_lineair_term1; x_lineair_term1: REALCONS | optional_AR_M_OP VAR; x_SIGN: EMPTY | TOK_SIGN; REALCONS: INTCONS | CONS; optional_AR_M_OP: EMPTY | AR_M_OP; */ constraints: EMPTY | x_constraints ; x_constraints : constraint | x_constraints constraint ; constraint : real_constraint | VARIABLECOLON { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!add_constraint_name(pp, pv->Last_var)) YYABORT; pv->HadConstraint = TRUE; } real_constraint ; real_constraint : x_lineair_sum2 { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HadVar1 = pv->HadVar0; pv->HadVar0 = FALSE; } RE_OP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!store_re_op(pp, pv->OP, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; pv->make_neg = 1; pv->f1 = 0; } x_lineair_sum3 { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Had_lineair_sum0 = pv->Had_lineair_sum; pv->Had_lineair_sum = TRUE; pv->HadVar2 = pv->HadVar0; pv->HadVar0 = FALSE; pv->do_add_row = FALSE; if(pv->HadConstraint && !pv->HadVar ) { /* it is a range */ /* already handled */ } else if(!pv->HadConstraint && pv->HadVar) { /* it is a bound */ if(!store_bounds(pp, TRUE)) YYABORT; } else { /* it is a row restriction */ if(pv->HadConstraint && pv->HadVar) store_re_op(pp, '\0', (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum); /* makes sure that data stored in temporary buffers is treated correctly */ pv->do_add_row = TRUE; } } optionalrange END_C { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->HadVar) && (!pv->HadConstraint)) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->do_add_row) add_row(pp); pv->HadConstraint = FALSE; pv->HadVar = pv->HadVar0 = FALSE; pv->isign = 0; pv->make_neg = 0; null_tmp_store(pp, TRUE); } ; optionalrange: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->HadVar1) && (pv->Had_lineair_sum0)) if(!negate_constraint(pp)) YYABORT; } | RE_OP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->make_neg = 0; pv->isign = 0; if(pv->HadConstraint) pv->HadVar = pv->Had_lineair_sum = FALSE; pv->HadVar0 = FALSE; if(!store_re_op(pp, (char) ((pv->OP == '<') ? '>' : (pv->OP == '>') ? '<' : pv->OP), (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } cons_term { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->f -= pv->f1; } RHS_STORE { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->HadVar1) || (!pv->HadVar2) || (pv->HadVar0)) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->HadConstraint && !pv->HadVar ) { /* it is a range */ /* already handled */ if(!negate_constraint(pp)) YYABORT; } else if(!pv->HadConstraint && pv->HadVar) { /* it is a bound */ if(!store_bounds(pp, TRUE)) YYABORT; } } ; x_lineair_sum2: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; /* to allow a range */ /* constraint: < max */ if(!pv->HadConstraint) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } pv->Had_lineair_sum = FALSE; } | x_lineair_sum3 { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Had_lineair_sum = TRUE; } ; x_lineair_sum3 : x_lineair_sum | INF { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; } RHS_STORE ; x_lineair_sum: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = pv->state0 = 0; } x_lineair_sum1 { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if (pv->state == 1) { /* RHS_STORE */ if ( (pv->isign0 || !pv->make_neg) && !(pv->isign0 && !pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(pv->make_neg) pv->f1 += pv->f0; if(!rhs_store(pp, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } } ; x_lineair_sum1 : x_lineair_term | x_lineair_sum1 x_lineair_term ; x_lineair_term : x_SIGN x_lineair_term1 { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ((pv->HadSign || pv->state == 1) && (pv->state0 == 1)) { /* RHS_STORE */ if ( (pv->isign0 || !pv->make_neg) && !(pv->isign0 && !pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(pv->make_neg) pv->f1 += pv->f0; if(!rhs_store(pp, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; } if (pv->state == 1) { pv->f0 = pv->f; pv->isign0 = pv->isign; } if (pv->state == 2) { if((pv->HadSign) || (pv->state0 != 1)) { pv->isign0 = pv->isign; pv->f0 = 1.0; } if ( (pv->isign0 || pv->make_neg) && !(pv->isign0 && pv->make_neg)) /* but not both! */ pv->f0 = -pv->f0; if(!var_store(pp, pv->Last_var, pv->f0, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) { yyerror(pp, pp->scanner, "var_store failed"); YYABORT; } pv->HadConstraint |= pv->HadVar; pv->HadVar = pv->HadVar0 = TRUE; } pv->state0 = pv->state; } ; x_lineair_term1 : REALCONS { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = 1; } | optional_AR_M_OP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ((pv->HasAR_M_OP) && (pv->state != 1)) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } } VAR { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->state = 2; } ; RE_OP: RE_OPEQ | RE_OPLE | RE_OPGE ; cons_term: x_SIGN REALCONS | INF { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; } ; /* end constraints */ /* start common for objective & constraints */ REALCONS: INTCONS | CONS ; x_SIGN: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = 0; pv->HadSign = FALSE; } | TOK_SIGN { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->isign = pv->Sign; pv->HadSign = TRUE; } ; optional_AR_M_OP: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HasAR_M_OP = FALSE; } | AR_M_OP { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->HasAR_M_OP = TRUE; } ; RHS_STORE: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if ( (pv->isign || !pv->make_neg) && !(pv->isign && !pv->make_neg)) /* but not both! */ pv->f = -pv->f; if(!rhs_store(pp, pv->f, (int) pv->HadConstraint, (int) pv->HadVar, (int) pv->Had_lineair_sum)) YYABORT; pv->isign = 0; } ; /* end common for objective & constraints */ /* start int_bin_sec_sos_free_declarations */ int_bin_sec_sos_free_declarations: EMPTY | real_int_bin_sec_sos_free_decls ; real_int_bin_sec_sos_free_decls: int_bin_sec_sos_free_declaration | real_int_bin_sec_sos_free_decls int_bin_sec_sos_free_declaration ; SEC_INT_BIN_SEC_SOS_FREE: SEC_INT | SEC_BIN | SEC_SEC | SEC_SOS | SEC_FREE ; int_bin_sec_sos_free_declaration: SEC_INT_BIN_SEC_SOS_FREE { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; pv->Within_sos_decl1 = pv->Within_sos_decl; } x_int_bin_sec_sos_free_declaration ; xx_int_bin_sec_sos_free_declaration: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((!pv->Within_int_decl) && (!pv->Within_sec_decl) && (!pv->Within_sos_decl1) && (!pv->Within_free_decl)) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } pv->SOStype = pv->SOStype0; check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, (int) (pv->Within_sos_decl1 = (pv->Within_sos_decl1 ? 1 : 0)), (int) pv->Within_free_decl); } optionalsos vars optionalsostype END_C { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->Within_sos_decl1) && (pv->SOStype == 0)) { yyerror(pp, pp->scanner, "Unsupported SOS type (0)"); YYABORT; } } ; x_int_bin_sec_sos_free_declaration: xx_int_bin_sec_sos_free_declaration | x_int_bin_sec_sos_free_declaration xx_int_bin_sec_sos_free_declaration ; optionalsos: EMPTY | SOSDESCR { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; FREE(pv->Last_var0); pv->Last_var0 = strdup(pv->Last_var); } sosdescr ; optionalsostype: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1) { set_sos_type(pp, pv->SOStype); set_sos_weight(pp, (double) pv->SOSweight, 1); } } | RE_OPLE INTCONS { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if((pv->Within_sos_decl1) && (!pv->SOStype)) { set_sos_type(pp, pv->SOStype = (short) (pv->f + .1)); } else { yyerror(pp, pp->scanner, "SOS type not expected"); YYABORT; } } optionalSOSweight ; optionalSOSweight:EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; set_sos_weight(pp, (double) pv->SOSweight, 1); } | COLON INTCONS { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; set_sos_weight(pp, pv->f, 1); } ; vars: EMPTY | x_vars ; x_vars : onevarwithoptionalweight | x_vars optionalcomma onevarwithoptionalweight ; optionalcomma: EMPTY | COMMA ; variable: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { char buf[16]; pv->SOSweight++; sprintf(buf, "SOS%d", pv->SOSweight); storevarandweight(pp, buf); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; } storevarandweight(pp, pv->Last_var); if(pv->Within_sos_decl1 == 2) { pv->SOSNr++; set_sos_weight(pp, (double) pv->SOSNr, 2); } } ; variablecolon: { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(!pv->Within_sos_decl1) { yyerror(pp, pp->scanner, "parse error"); YYABORT; } if(pv->Within_sos_decl1 == 1) { FREE(pv->Last_var0); pv->Last_var0 = strdup(pv->Last_var); } if(pv->Within_sos_decl1 == 2) { storevarandweight(pp, pv->Last_var); pv->SOSNr++; set_sos_weight(pp, (double) pv->SOSNr, 2); } } ; sosweight: EMPTY { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { char buf[16]; pv->SOSweight++; sprintf(buf, "SOS%d", pv->SOSweight); storevarandweight(pp, buf); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; storevarandweight(pp, pv->Last_var0); pv->SOSNr++; } set_sos_weight(pp, pv->f, 2); } ; sosdescr: EMPTY { /* SOS name */ parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; if(pv->Within_sos_decl1 == 1) { parse_parm *pp = PARM; parse_vars *pv = (parse_vars *) pp->parse_vars; storevarandweight(pp, pv->Last_var0); set_sos_type(pp, pv->SOStype); check_int_sec_sos_free_decl(pp, (int) pv->Within_int_decl, (int) pv->Within_sec_decl, 2, (int) pv->Within_free_decl); pv->Within_sos_decl1 = 2; pv->SOSNr = 0; pv->SOSweight++; } } ; onevarwithoptionalweight: VAR variable | VARIABLECOLON variablecolon INTCONSorVARIABLE ; INTCONSorVARIABLE:REALCONS /* INTCONS */ sosweight | sosdescr x_onevarwithoptionalweight ; x_onevarwithoptionalweight: VAR variable | VARIABLECOLON variablecolon REALCONS /* INTCONS */ sosweight ; /* end int_bin_sec_sos_free_declarations */ %% static void yy_delete_allocated_memory(parse_parm *pp) { parse_vars *pv = (parse_vars *) pp->parse_vars; /* free memory allocated by flex. Otherwise some memory is not freed. This is a bit tricky. There is not much documentation about this, but a lot of reports of memory that keeps allocated */ /* If you get errors on this function call, just comment it. This will only result in some memory that is not being freed. */ # if defined YY_CURRENT_BUFFER /* flex defines the macro YY_CURRENT_BUFFER, so you should only get here if lp_rlp.h is generated by flex */ /* lex doesn't define this macro and thus should not come here, but lex doesn't has this memory leak also ...*/ # if 0 /* older versions of flex */ yy_delete_buffer(YY_CURRENT_BUFFER); /* comment this line if you have problems with it */ yy_init = 1; /* make sure that the next time memory is allocated again */ yy_start = 0; # else /* As of version 2.5.9 Flex */ yylex_destroy(pp->scanner); /* comment this line if you have problems with it */ # endif # endif FREE(pv->Last_var); FREE(pv->Last_var0); } static int parse(parse_parm *pp) { return(yyparse(pp, pp->scanner)); } lprec *read_lp1(lprec *lp, void *userhandle, read_modeldata_func read_modeldata, int verbose, char *lp_name) { parse_vars *pv; lprec *lp1 = NULL; CALLOC(pv, 1, parse_vars); if (pv != NULL) { parse_parm pp; memset(&pp, 0, sizeof(pp)); pp.parse_vars = (void *) pv; yylex_init(&pp.scanner); yyset_extra(&pp, pp.scanner); yyset_in((FILE *) userhandle, pp.scanner); yyset_out(NULL, pp.scanner); pv->lp_input = read_modeldata; pv->userhandle = userhandle; lp1 = yacc_read(lp, verbose, lp_name, parse, &pp, yy_delete_allocated_memory); FREE(pv); } return(lp1); } lprec * __WINAPI read_lp(FILE *filename, int verbose, char *lp_name) { return(read_lp1(NULL, filename, lp_input_yyin, verbose, lp_name)); } lprec * __WINAPI read_lpex(void *userhandle, read_modeldata_func read_modeldata, int verbose, char *lp_name) { return(read_lp1(NULL, userhandle, read_modeldata, verbose, lp_name)); } lprec *read_LP1(lprec *lp, char *filename, int verbose, char *lp_name) { FILE *fpin; if((fpin = fopen(filename, "r")) != NULL) { lp = read_lp1(lp, fpin, lp_input_yyin, verbose, lp_name); fclose(fpin); } else lp = NULL; return(lp); } lprec * __WINAPI read_LP(char *filename, int verbose, char *lp_name) { return(read_LP1(NULL, filename, verbose, lp_name)); } MYBOOL __WINAPI LP_readhandle(lprec **lp, FILE *filename, int verbose, char *lp_name) { if(lp != NULL) *lp = read_lp1(*lp, filename, lp_input_yyin, verbose, lp_name); return((lp != NULL) && (*lp != NULL)); } lp_solve_5.5/lp_scale.c100666 0 0 71272 11245564033 13521 0ustar usergroup #include #include "commonlib.h" #include "lp_lib.h" #include "lp_report.h" #include "lp_scale.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Scaling routines for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h, lp_scale.h Release notes: v5.0.0 1 January 2004 Significantly expanded and repackaged scaling routines. v5.0.1 20 February 2004 Modified rounding behaviour in several areas. v5.1.0 20 July 2004 Reworked with flexible matrix storage model. v5.2.0 20 February 2005 Converted to matrix storage model without the OF. ---------------------------------------------------------------------------------- */ /* First define scaling and unscaling primitives */ REAL scaled_value(lprec *lp, REAL value, int index) { if(fabs(value) < lp->infinite) { if(lp->scaling_used) { if(index > lp->rows) value /= lp->scalars[index]; else value *= lp->scalars[index]; } } else value = my_sign(value)*lp->infinite; return(value); } REAL unscaled_value(lprec *lp, REAL value, int index) { if(fabs(value) < lp->infinite) { if(lp->scaling_used) { if(index > lp->rows) value *= lp->scalars[index]; else value /= lp->scalars[index]; } } else value = my_sign(value)*lp->infinite; return(value); } STATIC REAL scaled_mat(lprec *lp, REAL value, int rownr, int colnr) { if(lp->scaling_used) value *= lp->scalars[rownr] * lp->scalars[lp->rows + colnr]; return( value ); } STATIC REAL unscaled_mat(lprec *lp, REAL value, int rownr, int colnr) { if(lp->scaling_used) value /= lp->scalars[rownr] * lp->scalars[lp->rows + colnr]; return( value ); } /* Compute the scale factor by the formulae: FALSE: SUM (log |Aij|) ^ 2 TRUE: SUM (log |Aij| - RowScale[i] - ColScale[j]) ^ 2 */ REAL CurtisReidMeasure(lprec *lp, MYBOOL _Advanced, REAL *FRowScale, REAL *FColScale) { int i, nz; REAL absvalue, logvalue; register REAL result; MATrec *mat = lp->matA; REAL *value; int *rownr, *colnr; /* Do OF part */ result = 0; for(i = 1; i <= lp->columns; i++) { absvalue = fabs(lp->orig_obj[i]); if(absvalue > 0) { logvalue = log(absvalue); if(_Advanced) logvalue -= FRowScale[0] + FColScale[i]; result += logvalue*logvalue; } } /* Do constraint matrix part */ mat_validate(mat); value = &(COL_MAT_VALUE(0)); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); nz = get_nonzeros(lp); for(i = 0; i < nz; i++, value += matValueStep, rownr += matRowColStep, colnr += matRowColStep) { absvalue = fabs(*value); if(absvalue > 0) { logvalue = log(absvalue); if(_Advanced) logvalue -= FRowScale[*rownr] + FColScale[*colnr]; result += logvalue*logvalue; } } return( result ); } /* Implementation of the Curtis-Reid scaling based on the paper "On the Automatic Scaling of Matrices for Gaussian Elimination," Journal of the Institute of Mathematics and Its Applications (1972) 10, 118-124. Solve the system | M E | (r) (sigma) | | ( ) = ( ) | E^T N | (c) ( tau ) by the conjugate gradient method (clever recurrences). E is the matrix A with all elements = 1 M is diagonal matrix of row counts (RowCount) N is diagonal matrix of column counts (ColCount) sigma is the vector of row logarithm sums (RowSum) tau is the vector of column logarithm sums (ColSum) r, c are resulting row and column scalings (RowScale, ColScale) */ int CurtisReidScales(lprec *lp, MYBOOL _Advanced, REAL *FRowScale, REAL *FColScale) { int i, row, col, ent, nz; REAL *RowScalem2, *ColScalem2, *RowSum, *ColSum, *residual_even, *residual_odd; REAL sk, qk, ek, skm1, qkm1, ekm1, qkm2, qkqkm1, ekm2, ekekm1, absvalue, logvalue, StopTolerance; int *RowCount, *ColCount, colMax; int Result; MATrec *mat = lp->matA; REAL *value; int *rownr, *colnr; if(CurtisReidMeasure(lp, _Advanced, FRowScale, FColScale)<0.1*get_nonzeros(lp)) return(0); /* Allocate temporary memory and find RowSum and ColSum measures */ nz = get_nonzeros(lp); colMax = lp->columns; allocREAL(lp, &RowSum, lp->rows+1, TRUE); allocINT(lp, &RowCount, lp->rows+1, TRUE); allocREAL(lp, &residual_odd, lp->rows+1, TRUE); allocREAL(lp, &ColSum, colMax+1, TRUE); allocINT(lp, &ColCount, colMax+1, TRUE); allocREAL(lp, &residual_even, colMax+1, TRUE); allocREAL(lp, &RowScalem2, lp->rows+1, FALSE); allocREAL(lp, &ColScalem2, colMax+1, FALSE); /* Set origin for row scaling */ for(i = 1; i <= colMax; i++) { absvalue=fabs(lp->orig_obj[i]); if(absvalue>0) { logvalue = log(absvalue); ColSum[i] += logvalue; RowSum[0] += logvalue; ColCount[i]++; RowCount[0]++; } } value = &(COL_MAT_VALUE(0)); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); for(i = 0; i < nz; i++, value += matValueStep, rownr += matRowColStep, colnr += matRowColStep) { absvalue=fabs(*value); if(absvalue>0) { logvalue = log(absvalue); ColSum[*colnr] += logvalue; RowSum[*rownr] += logvalue; ColCount[*colnr]++; RowCount[*rownr]++; } } /* Make sure we dont't have division by zero errors */ for(row = 0; row <= lp->rows; row++) if(RowCount[row] == 0) RowCount[row] = 1; for(col = 1; col <= colMax; col++) if(ColCount[col] == 0) ColCount[col] = 1; /* Initialize to RowScale = RowCount-1 RowSum ColScale = 0.0 residual = ColSum - ET RowCount-1 RowSum */ StopTolerance= MAX(lp->scalelimit-floor(lp->scalelimit), DEF_SCALINGEPS); StopTolerance *= (REAL) nz; for(row = 0; row <= lp->rows; row++) { FRowScale[row] = RowSum[row] / (REAL) RowCount[row]; RowScalem2[row] = FRowScale[row]; } /* Compute initial residual */ for(col = 1; col <= colMax; col++) { FColScale[col] = 0; ColScalem2[col] = 0; residual_even[col] = ColSum[col]; if(lp->orig_obj[col] != 0) residual_even[col] -= RowSum[0] / (REAL) RowCount[0]; i = mat->col_end[col-1]; rownr = &(COL_MAT_ROWNR(i)); ent = mat->col_end[col]; for(; i < ent; i++, rownr += matRowColStep) { residual_even[col] -= RowSum[*rownr] / (REAL) RowCount[*rownr]; } } /* Compute sk */ sk = 0; skm1 = 0; for(col = 1; col <= colMax; col++) sk += (residual_even[col]*residual_even[col]) / (REAL) ColCount[col]; Result = 0; qk=1; qkm1=0; qkm2=0; ek=0; ekm1=0; ekm2=0; while(sk>StopTolerance) { /* Given the values of residual and sk, construct ColScale (when pass is even) RowScale (when pass is odd) */ qkqkm1 = qk * qkm1; ekekm1 = ek * ekm1; if((Result % 2) == 0) { /* pass is even; construct RowScale[pass+1] */ if(Result != 0) { for(row = 0; row <= lp->rows; row++) RowScalem2[row] = FRowScale[row]; if(qkqkm1 != 0) { for(row = 0; row <= lp->rows; row++) FRowScale[row]*=(1 + ekekm1 / qkqkm1); for(row = 0; row<=lp->rows; row++) FRowScale[row]+=(residual_odd[row] / (qkqkm1 * (REAL) RowCount[row]) - RowScalem2[row] * ekekm1 / qkqkm1); } } } else { /* pass is odd; construct ColScale[pass+1] */ for(col = 1; col <= colMax; col++) ColScalem2[col] = FColScale[col]; if(qkqkm1 != 0) { for(col = 1; col <= colMax; col++) FColScale[col] *= (1 + ekekm1 / qkqkm1); for(col = 1; col <= colMax; col++) FColScale[col] += (residual_even[col] / ((REAL) ColCount[col] * qkqkm1) - ColScalem2[col] * ekekm1 / qkqkm1); } } /* update residual and sk (pass + 1) */ if((Result % 2) == 0) { /* even */ /* residual */ for(row = 0; row <= lp->rows; row++) residual_odd[row] *= ek; for(i = 1; i <= colMax; i++) if(lp->orig_obj[i] != 0) residual_odd[0] += (residual_even[i] / (REAL) ColCount[i]); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); for(i = 0; i < nz; i++, rownr += matRowColStep, colnr += matRowColStep) { residual_odd[*rownr] += (residual_even[*colnr] / (REAL) ColCount[*colnr]); } for(row = 0; row <= lp->rows; row++) residual_odd[row] *= (-1 / qk); /* sk */ skm1 = sk; sk = 0; for(row = 0; row <= lp->rows; row++) sk += (residual_odd[row]*residual_odd[row]) / (REAL) RowCount[row]; } else { /* odd */ /* residual */ for(col = 1; col <= colMax; col++) residual_even[col] *= ek; for(i = 1; i <= colMax; i++) if(lp->orig_obj[i] != 0) residual_even[i] += (residual_odd[0] / (REAL) RowCount[0]); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); for(i = 0; i < nz; i++, rownr += matRowColStep, colnr += matRowColStep) { residual_even[*colnr] += (residual_odd[*rownr] / (REAL) RowCount[*rownr]); } for(col = 1; col <= colMax; col++) residual_even[col] *= (-1 / qk); /* sk */ skm1 = sk; sk = 0; for(col = 1; col <= colMax; col++) sk += (residual_even[col]*residual_even[col]) / (REAL) ColCount[col]; } /* Compute ek and qk */ ekm2=ekm1; ekm1=ek; ek=qk * sk / skm1; qkm2=qkm1; qkm1=qk; qk=1-ek; Result++; } /* Synchronize the RowScale and ColScale vectors */ ekekm1 = ek * ekm1; if(qkm1 != 0) { if((Result % 2) == 0) { /* pass is even, compute RowScale */ for(row = 0; row<=lp->rows; row++) FRowScale[row]*=(1.0 + ekekm1 / qkm1); for(row = 0; row<=lp->rows; row++) FRowScale[row]+=(residual_odd[row] / (qkm1 * (REAL) RowCount[row]) - RowScalem2[row] * ekekm1 / qkm1); } else { /* pass is odd, compute ColScale */ for(col=1; col<=colMax; col++) FColScale[col]*=(1 + ekekm1 / qkm1); for(col=1; col<=colMax; col++) FColScale[col]+=(residual_even[col] / ((REAL) ColCount[col] * qkm1) - ColScalem2[col] * ekekm1 / qkm1); } } /* Do validation, if indicated */ if(FALSE && mat_validate(mat)){ double check, error; /* CHECK: M RowScale + E ColScale = RowSum */ error = 0; for(row = 0; row <= lp->rows; row++) { check = (REAL) RowCount[row] * FRowScale[row]; if(row == 0) { for(i = 1; i <= colMax; i++) { if(lp->orig_obj[i] != 0) check += FColScale[i]; } } else { i = mat->row_end[row-1]; ent = mat->row_end[row]; for(; i < ent; i++) { col = ROW_MAT_COLNR(i); check += FColScale[col]; } } check -= RowSum[row]; error += check*check; } /* CHECK: E^T RowScale + N ColScale = ColSum */ error = 0; for(col = 1; col <= colMax; col++) { check = (REAL) ColCount[col] * FColScale[col]; if(lp->orig_obj[col] != 0) check += FRowScale[0]; i = mat->col_end[col-1]; ent = mat->col_end[col]; rownr = &(COL_MAT_ROWNR(i)); for(; i < ent; i++, rownr += matRowColStep) { check += FRowScale[*rownr]; } check -= ColSum[col]; error += check*check; } } /* Convert to scaling factors (rounding to nearest power of 2 can optionally be done as a separate step later) */ for(col = 1; col <= colMax; col++) { absvalue = exp(-FColScale[col]); if(absvalue < MIN_SCALAR) absvalue = MIN_SCALAR; if(absvalue > MAX_SCALAR) absvalue = MAX_SCALAR; if(!is_int(lp,col) || is_integerscaling(lp)) FColScale[col] = absvalue; else FColScale[col] = 1; } for(row = 0; row <= lp->rows; row++) { absvalue = exp(-FRowScale[row]); if(absvalue < MIN_SCALAR) absvalue = MIN_SCALAR; if(absvalue > MAX_SCALAR) absvalue = MAX_SCALAR; FRowScale[row] = absvalue; } /* free temporary memory */ FREE(RowSum); FREE(ColSum); FREE(RowCount); FREE(ColCount); FREE(residual_even); FREE(residual_odd); FREE(RowScalem2); FREE(ColScalem2); return(Result); } STATIC MYBOOL scaleCR(lprec *lp, REAL *scaledelta) { REAL *scalechange = NULL; int Result; if(!lp->scaling_used) { allocREAL(lp, &lp->scalars, lp->sum_alloc + 1, FALSE); for(Result = 0; Result <= lp->sum; Result++) lp->scalars[Result] = 1; lp->scaling_used = TRUE; } if(scaledelta == NULL) allocREAL(lp, &scalechange, lp->sum + 1, FALSE); else scalechange = scaledelta; Result=CurtisReidScales(lp, FALSE, scalechange, &scalechange[lp->rows]); if(Result>0) { /* Do the scaling*/ if(scale_updaterows(lp, scalechange, TRUE) || scale_updatecolumns(lp, &scalechange[lp->rows], TRUE)) lp->scalemode |= SCALE_CURTISREID; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); } if(scaledelta == NULL) FREE(scalechange); return((MYBOOL) (Result > 0)); } STATIC MYBOOL transform_for_scale(lprec *lp, REAL *value) { MYBOOL Accept = TRUE; *value = fabs(*value); #ifdef Paranoia if(*value < lp->epsmachine) { Accept = FALSE; report(lp, SEVERE, "transform_for_scale: A zero-valued entry was passed\n"); } else #endif if(is_scalemode(lp, SCALE_LOGARITHMIC)) *value = log(*value); else if(is_scalemode(lp, SCALE_QUADRATIC)) (*value) *= (*value); return( Accept ); } STATIC void accumulate_for_scale(lprec *lp, REAL *min, REAL *max, REAL value) { if(transform_for_scale(lp, &value)) { if(is_scaletype(lp, SCALE_MEAN)) { *max += value; *min += 1; } else { SETMAX(*max, value); SETMIN(*min, value); } } } STATIC REAL minmax_to_scale(lprec *lp, REAL min, REAL max, int itemcount) { REAL scale; /* Initialize according to transformation / weighting model */ if(is_scalemode(lp, SCALE_LOGARITHMIC)) scale = 0; else scale = 1; if(itemcount <= 0) return(scale); /* Compute base scalar according to chosen scaling type */ if(is_scaletype(lp, SCALE_MEAN)) { if(min > 0) scale = max / min; } else if(is_scaletype(lp, SCALE_RANGE)) scale = (max + min) / 2; else if(is_scaletype(lp, SCALE_GEOMETRIC)) scale = sqrt(min*max); else if(is_scaletype(lp, SCALE_EXTREME)) scale = max; /* Compute final scalar according to transformation / weighting model */ if(is_scalemode(lp, SCALE_LOGARITHMIC)) scale = exp(-scale); else if(is_scalemode(lp, SCALE_QUADRATIC)) { if(scale == 0) scale = 1; else scale = 1 / sqrt(scale); } else { if(scale == 0) scale = 1; else scale = 1 / scale; } /* Make sure we are within acceptable scaling ranges */ SETMAX(scale, MIN_SCALAR); SETMIN(scale, MAX_SCALAR); return(scale); } STATIC REAL roundPower2(REAL scale) /* Purpose is to round a number to it nearest power of 2; in a system with binary number representation, this avoids rounding errors when scale is used to normalize another value */ { long int power2; MYBOOL isSmall = FALSE; if(scale == 1) return( scale ); /* Obtain the fractional power of 2 */ if(scale < 2) { scale = 2 / scale; isSmall = TRUE; } else scale /= 2; scale = log(scale)/log(2.0); /* Find the desired nearest power of two and compute the associated scalar */ power2 = (long) ceil(scale-0.5); scale = 1 << power2; if(isSmall) scale = 1.0 / scale; return( scale ); } STATIC MYBOOL scale_updatecolumns(lprec *lp, REAL *scalechange, MYBOOL updateonly) { int i, j; /* Verify that the scale change is significant (different from the unit) */ for(i = lp->columns; i > 0; i--) if(fabs(scalechange[i]-1) > lp->epsprimal) break; if(i <= 0) return( FALSE ); /* Update the pre-existing column scalar */ if(updateonly) for(i = 1, j = lp->rows + 1; j <= lp->sum; i++, j++) lp->scalars[j] *= scalechange[i]; else for(i = 1, j = lp->rows + 1; j <= lp->sum; i++, j++) lp->scalars[j] = scalechange[i]; return( TRUE ); } STATIC MYBOOL scale_updaterows(lprec *lp, REAL *scalechange, MYBOOL updateonly) { int i; /* Verify that the scale change is significant (different from the unit) */ for(i = lp->rows; i >= 0; i--) { if(fabs(scalechange[i]-1) > lp->epsprimal) break; } if(i < 0) return( FALSE ); /* Update the pre-existing row scalar */ if(updateonly) for(i = 0; i <= lp->rows; i++) lp->scalars[i] *= scalechange[i]; else for(i = 0; i <= lp->rows; i++) lp->scalars[i] = scalechange[i]; return( TRUE ); } STATIC MYBOOL scale_columns(lprec *lp, REAL *scaledelta) { int i,j, colMax, nz; REAL *scalechange; REAL *value; int *colnr; MATrec *mat = lp->matA; /* Check that columns are in fact targeted */ if((lp->scalemode & SCALE_ROWSONLY) != 0) return( TRUE ); if(scaledelta == NULL) scalechange = &lp->scalars[lp->rows]; else scalechange = &scaledelta[lp->rows]; colMax = lp->columns; /* Scale matrix entries (including any Lagrangean constraints) */ for(i = 1; i <= lp->columns; i++) { lp->orig_obj[i] *= scalechange[i]; } mat_validate(lp->matA); nz = get_nonzeros(lp); value = &(COL_MAT_VALUE(0)); colnr = &(COL_MAT_COLNR(0)); for(i = 0; i < nz; i++, value += matValueStep, colnr += matRowColStep) { (*value) *= scalechange[*colnr]; } /* Scale variable bounds as well */ for(i = 1, j = lp->rows + 1; j <= lp->sum; i++, j++) { if(lp->orig_lowbo[j] > -lp->infinite) lp->orig_lowbo[j] /= scalechange[i]; if(lp->orig_upbo[j] < lp->infinite) lp->orig_upbo[j] /= scalechange[i]; if(lp->sc_lobound[i] != 0) lp->sc_lobound[i] /= scalechange[i]; } lp->columns_scaled = TRUE; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); return( TRUE ); } STATIC MYBOOL scale_rows(lprec *lp, REAL *scaledelta) { int i, j, nz, colMax; REAL *scalechange; REAL *value; int *rownr; MATrec *mat = lp->matA; /* Check that rows are in fact targeted */ if((lp->scalemode & SCALE_COLSONLY) != 0) return( TRUE ); if(scaledelta == NULL) scalechange = lp->scalars; else scalechange = scaledelta; colMax = lp->columns; /* First row-scale the matrix (including the objective function) */ for(i = 1; i <= colMax; i++) { lp->orig_obj[i] *= scalechange[0]; } nz = get_nonzeros(lp); value = &(COL_MAT_VALUE(0)); rownr = &(COL_MAT_ROWNR(0)); for(i = 0; i < nz; i++, value += matValueStep, rownr += matRowColStep) { (*value) *= scalechange[*rownr]; } /* ...and scale the rhs and the row bounds (RANGES in MPS!!) */ for(i = 0; i <= lp->rows; i++) { if(fabs(lp->orig_rhs[i]) < lp->infinite) lp->orig_rhs[i] *= scalechange[i]; j = lp->presolve_undo->var_to_orig[i]; if(j != 0) lp->presolve_undo->fixed_rhs[j] *= scalechange[i]; if(lp->orig_upbo[i] < lp->infinite) /* This is the range */ lp->orig_upbo[i] *= scalechange[i]; if((lp->orig_lowbo[i] != 0) && (fabs(lp->orig_lowbo[i]) < lp->infinite)) lp->orig_lowbo[i] *= scalechange[i]; } set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); return( TRUE ); } STATIC REAL scale(lprec *lp, REAL *scaledelta) { int i, j, nz, row_count, nzOF = 0; REAL *row_max, *row_min, *scalechange = NULL, absval; REAL col_max, col_min; MYBOOL rowscaled, colscaled; MATrec *mat = lp->matA; REAL *value; int *rownr; if(is_scaletype(lp, SCALE_NONE)) return(0.0); if(!lp->scaling_used) { allocREAL(lp, &lp->scalars, lp->sum_alloc + 1, FALSE); for(i = 0; i <= lp->sum; i++) { lp->scalars[i] = 1; } lp->scaling_used = TRUE; } #ifdef Paranoia else for(i = 0; i <= lp->sum; i++) { if(lp->scalars[i] == 0) report(lp, SEVERE, "scale: Zero-valued scalar found at index %d\n", i); } #endif if(scaledelta == NULL) allocREAL(lp, &scalechange, lp->sum + 1, FALSE); else scalechange = scaledelta; /* Must initialize due to computation of scaling statistic - KE */ for(i = 0; i <= lp->sum; i++) scalechange[i] = 1; row_count = lp->rows; allocREAL(lp, &row_max, row_count + 1, TRUE); allocREAL(lp, &row_min, row_count + 1, FALSE); /* Initialise min and max values of rows */ for(i = 0; i <= row_count; i++) { if(is_scaletype(lp, SCALE_MEAN)) row_min[i] = 0; /* Carries the count of elements */ else row_min[i] = lp->infinite; /* Carries the minimum element */ } /* Calculate row scaling data */ for(j = 1; j <= lp->columns; j++) { absval = lp->orig_obj[j]; if(absval != 0) { absval = scaled_mat(lp, absval, 0, j); accumulate_for_scale(lp, &row_min[0], &row_max[0], absval); nzOF++; } i = mat->col_end[j - 1]; value = &(COL_MAT_VALUE(i)); rownr = &(COL_MAT_ROWNR(i)); nz = mat->col_end[j]; for(; i < nz; i++, value += matValueStep, rownr += matRowColStep) { absval = scaled_mat(lp, *value, *rownr, j); accumulate_for_scale(lp, &row_min[*rownr], &row_max[*rownr], absval); } } /* Calculate scale factors for rows */ i = 0; for(; i <= lp->rows; i++) { if(i == 0) nz = nzOF; else nz = mat_rowlength(lp->matA, i); absval = minmax_to_scale(lp, row_min[i], row_max[i], nzOF); if(absval == 0) absval = 1; scalechange[i] = absval; } FREE(row_max); FREE(row_min); /* Row-scale the matrix (including the objective function and Lagrangean constraints) */ rowscaled = scale_updaterows(lp, scalechange, TRUE); /* Calculate column scales */ i = 1; for(j = 1; j <= lp->columns; j++) { if(is_int(lp,j) && !is_integerscaling(lp)) { /* do not scale integer columns */ scalechange[lp->rows + j] = 1; } else { col_max = 0; if(is_scaletype(lp, SCALE_MEAN)) col_min = 0; else col_min = lp->infinite; absval = lp->orig_obj[j]; if(absval != 0) { absval = scaled_mat(lp, absval, 0, j); accumulate_for_scale(lp, &col_min, &col_max, absval); } i = mat->col_end[j - 1]; value = &(COL_MAT_VALUE(i)); rownr = &(COL_MAT_ROWNR(i)); nz = mat->col_end[j]; for(; i < nz; i++, value += matValueStep, rownr += matRowColStep) { absval = scaled_mat(lp, *value, *rownr, j); accumulate_for_scale(lp, &col_min, &col_max, absval); } nz = mat_collength(lp->matA, j); if(fabs(lp->orig_obj[j]) > 0) nz++; scalechange[lp->rows + j] = minmax_to_scale(lp, col_min, col_max, nz); } } /* ... and then column-scale the already row-scaled matrix */ colscaled = scale_updatecolumns(lp, &scalechange[lp->rows], TRUE); /* Create a geometric mean-type measure of the extent of scaling performed; */ /* ideally, upon successive calls to scale() the value should converge to 0 */ if(rowscaled || colscaled) { col_max = 0; for(j = 1; j <= lp->columns; j++) col_max += log(scalechange[lp->rows + j]); col_max = exp(col_max/lp->columns); i = 0; col_min = 0; for(; i <= lp->rows; i++) col_min += log(scalechange[i]); col_min = exp(col_min/row_count); } else { col_max = 1; col_min = 1; } if(scaledelta == NULL) FREE(scalechange); return(1 - sqrt(col_max*col_min)); } STATIC MYBOOL finalize_scaling(lprec *lp, REAL *scaledelta) { int i; /* Check if we should equilibrate */ if(is_scalemode(lp, SCALE_EQUILIBRATE) && !is_scaletype(lp, SCALE_CURTISREID)) { int oldmode; oldmode = lp->scalemode; lp->scalemode = SCALE_LINEAR + SCALE_EXTREME; scale(lp, scaledelta); lp->scalemode = oldmode; } /* Check if we should prevent rounding errors */ if(is_scalemode(lp, SCALE_POWER2)) { REAL *scalars; if(scaledelta == NULL) scalars = lp->scalars; else scalars = scaledelta; for(i = 0; i <= lp->sum; i++) scalars[i] = roundPower2(scalars[i]); } /* Then transfer the scalars to the model's data */ return( scale_rows(lp, scaledelta) && scale_columns(lp, scaledelta) ); } STATIC REAL auto_scale(lprec *lp) { int n = 1; REAL scalingmetric = 0, *scalenew = NULL; if(lp->scaling_used && ((((lp->scalemode & SCALE_DYNUPDATE) == 0)) || (lp->bb_level > 0))) return( scalingmetric); if(lp->scalemode != SCALE_NONE) { /* Allocate array for incremental scaling if appropriate */ if((lp->solvecount > 1) && (lp->bb_level < 1) && ((lp->scalemode & SCALE_DYNUPDATE) != 0)) allocREAL(lp, &scalenew, lp->sum + 1, FALSE); if(is_scaletype(lp, SCALE_CURTISREID)) { scalingmetric = scaleCR(lp, scalenew); } else { REAL scalinglimit, scalingdelta; int count; /* Integer value of scalelimit holds the maximum number of iterations; default to 1 */ count = (int) floor(lp->scalelimit); scalinglimit = lp->scalelimit; if((count == 0) || (scalinglimit == 0)) { if(scalinglimit > 0) count = DEF_SCALINGLIMIT; /* A non-zero convergence has been given, default to max 5 iterations */ else count = 1; } else scalinglimit -= count; /* Scale to desired relative convergence or iteration limit */ n = 0; scalingdelta = 1.0; scalingmetric = 1.0; while((n < count) && (fabs(scalingdelta) > scalinglimit)) { n++; scalingdelta = scale(lp, scalenew); scalingmetric = scalingmetric*(1+scalingdelta); } scalingmetric -= 1; } } /* Update the inf norm of the elements of the matrix (excluding the OF) */ mat_computemax(lp->matA); /* Check if we really have to do scaling */ if(lp->scaling_used && (fabs(scalingmetric) >= lp->epsprimal)) /* Ok, do it */ finalize_scaling(lp, scalenew); else { /* Otherwise reset scaling variables */ if(lp->scalars != NULL) { FREE(lp->scalars); } lp->scaling_used = FALSE; lp->columns_scaled = FALSE; } if(scalenew != NULL) FREE(scalenew); return(scalingmetric); } STATIC void unscale_columns(lprec *lp) { int i, j, nz; MATrec *mat = lp->matA; REAL *value; int *rownr, *colnr; if(!lp->columns_scaled) return; /* Unscale OF */ for(j = 1; j <= lp->columns; j++) { lp->orig_obj[j] = unscaled_mat(lp, lp->orig_obj[j], 0, j); } /* Unscale mat */ mat_validate(mat); nz = get_nonzeros(lp); value = &(COL_MAT_VALUE(0)); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); for(j = 0; j < nz; j++, value += matValueStep, rownr += matRowColStep, colnr += matRowColStep) { *value = unscaled_mat(lp, *value, *rownr, *colnr); } /* Unscale bounds as well */ for(i = lp->rows + 1, j = 1; i <= lp->sum; i++, j++) { lp->orig_lowbo[i] = unscaled_value(lp, lp->orig_lowbo[i], i); lp->orig_upbo[i] = unscaled_value(lp, lp->orig_upbo[i], i); lp->sc_lobound[j] = unscaled_value(lp, lp->sc_lobound[j], i); } for(i = lp->rows + 1; i<= lp->sum; i++) lp->scalars[i] = 1; lp->columns_scaled = FALSE; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); } void undoscale(lprec *lp) { int i, j, nz; MATrec *mat = lp->matA; REAL *value; int *rownr, *colnr; if(lp->scaling_used) { /* Unscale the OF */ for(j = 1; j <= lp->columns; j++) { lp->orig_obj[j] = unscaled_mat(lp, lp->orig_obj[j], 0, j); } /* Unscale the matrix */ mat_validate(mat); nz = get_nonzeros(lp); value = &(COL_MAT_VALUE(0)); rownr = &(COL_MAT_ROWNR(0)); colnr = &(COL_MAT_COLNR(0)); for(j = 0; j < nz; j++, value += matValueStep, rownr += matRowColStep, colnr += matRowColStep) { *value = unscaled_mat(lp, *value, *rownr, *colnr); } /* Unscale variable bounds */ for(i = lp->rows + 1, j = 1; i <= lp->sum; i++, j++) { lp->orig_lowbo[i] = unscaled_value(lp, lp->orig_lowbo[i], i); lp->orig_upbo[i] = unscaled_value(lp, lp->orig_upbo[i], i); lp->sc_lobound[j] = unscaled_value(lp, lp->sc_lobound[j], i); } /* Unscale the rhs, upper and lower bounds... */ for(i = 0; i <= lp->rows; i++) { lp->orig_rhs[i] = unscaled_value(lp, lp->orig_rhs[i], i); j = lp->presolve_undo->var_to_orig[i]; if(j != 0) lp->presolve_undo->fixed_rhs[j] = unscaled_value(lp, lp->presolve_undo->fixed_rhs[j], i); lp->orig_lowbo[i] = unscaled_value(lp, lp->orig_lowbo[i], i); lp->orig_upbo[i] = unscaled_value(lp, lp->orig_upbo[i], i); } FREE(lp->scalars); lp->scaling_used = FALSE; lp->columns_scaled = FALSE; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT | ACTION_RECOMPUTE); } } lp_solve_5.5/lp_scale.h100666 0 0 1760 11141374251 13475 0ustar usergroup#ifndef HEADER_lp_scale #define HEADER_lp_scale #include "lp_types.h" #ifdef __cplusplus extern "C" { #endif /* Put function headers here */ STATIC MYBOOL scale_updatecolumns(lprec *lp, REAL *scalechange, MYBOOL updateonly); STATIC MYBOOL scale_updaterows(lprec *lp, REAL *scalechange, MYBOOL updateonly); STATIC MYBOOL scale_rows(lprec *lp, REAL *scaledelta); STATIC MYBOOL scale_columns(lprec *lp, REAL *scaledelta); STATIC void unscale_columns(lprec *lp); STATIC REAL scale(lprec *lp, REAL *scaledelta); STATIC REAL scaled_mat(lprec *lp, REAL value, int rownr, int colnr); STATIC REAL unscaled_mat(lprec *lp, REAL value, int rownr, int colnr); STATIC REAL scaled_value(lprec *lp, REAL value, int index); STATIC REAL unscaled_value(lprec *lp, REAL value, int index); STATIC MYBOOL scaleCR(lprec *lp, REAL *scaledelta); STATIC MYBOOL finalize_scaling(lprec *lp, REAL *scaledelta); STATIC REAL auto_scale(lprec *lp); void undoscale(lprec *lp); #ifdef __cplusplus } #endif #endif /* HEADER_lp_scale */ lp_solve_5.5/lp_simplex.c100666 0 0 225200 11245563711 14125 0ustar usergroup /* Core optimization drivers for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Michel Berkelaar (to lp_solve v3.2), Kjell Eikland (v4.0 and forward) Contact: License terms: LGPL. Requires: lp_lib.h, lp_simplex.h, lp_presolve.h, lp_pricerPSE.h Release notes: v5.0.0 1 January 2004 New unit applying stacked basis and bounds storage. v5.0.1 31 January 2004 Moved B&B routines to separate file and implemented a new runsolver() general purpose call method. v5.0.2 1 May 2004 Changed routine names to be more intuitive. v5.1.0 10 January 2005 Created modular stalling/cycling functions. Rewrote dualloop() to optimize long dual and also streamlined primloop() correspondingly. v5.2.0 20 March 2005 Reimplemented primal phase 1 logic. Made multiple pricing finally work (primal simplex). ---------------------------------------------------------------------------------- */ #include #include "commonlib.h" #include "lp_lib.h" #include "lp_BFP.h" #include "lp_simplex.h" #include "lp_crash.h" #include "lp_presolve.h" #include "lp_price.h" #include "lp_pricePSE.h" #include "lp_report.h" #ifdef FORTIFY # include "lp_fortify.h" #endif STATIC void stallMonitor_update(lprec *lp, REAL newOF) { int newpos; OBJmonrec *monitor = lp->monitor; if(monitor->countstep < OBJ_STEPS) monitor->countstep++; else monitor->startstep = mod(monitor->startstep + 1, OBJ_STEPS); newpos = mod(monitor->startstep + monitor->countstep - 1, OBJ_STEPS); monitor->objstep[newpos] = newOF; monitor->idxstep[newpos] = monitor->Icount; monitor->currentstep = newpos; } STATIC MYBOOL stallMonitor_creepingObj(lprec *lp) { OBJmonrec *monitor = lp->monitor; if(monitor->countstep > 1) { REAL deltaOF = (monitor->objstep[monitor->currentstep] - monitor->objstep[monitor->startstep]) / monitor->countstep; deltaOF /= MAX(1, (monitor->idxstep[monitor->currentstep] - monitor->idxstep[monitor->startstep])); deltaOF = my_chsign(monitor->isdual, deltaOF); return( (MYBOOL) (deltaOF < monitor->epsvalue) ); } else return( FALSE ); } STATIC MYBOOL stallMonitor_shortSteps(lprec *lp) { OBJmonrec *monitor = lp->monitor; if(monitor->countstep == OBJ_STEPS) { REAL deltaOF = MAX(1, (monitor->idxstep[monitor->currentstep] - monitor->idxstep[monitor->startstep])) / monitor->countstep; deltaOF = pow(deltaOF*OBJ_STEPS, 0.66); return( (MYBOOL) (deltaOF > monitor->limitstall[TRUE]) ); } else return( FALSE ); } STATIC void stallMonitor_reset(lprec *lp) { OBJmonrec *monitor = lp->monitor; monitor->ruleswitches = 0; monitor->Ncycle = 0; monitor->Mcycle = 0; monitor->Icount = 0; monitor->startstep = 0; monitor->objstep[monitor->startstep] = lp->infinite; monitor->idxstep[monitor->startstep] = monitor->Icount; monitor->prevobj = 0; monitor->countstep = 1; } STATIC MYBOOL stallMonitor_create(lprec *lp, MYBOOL isdual, char *funcname) { OBJmonrec *monitor = NULL; if(lp->monitor != NULL) return( FALSE ); monitor = (OBJmonrec *) calloc(sizeof(*monitor), 1); if(monitor == NULL) return( FALSE ); monitor->lp = lp; strcpy(monitor->spxfunc, funcname); monitor->isdual = isdual; monitor->pivdynamic = is_piv_mode(lp, PRICE_ADAPTIVE); monitor->oldpivstrategy = lp->piv_strategy; monitor->oldpivrule = get_piv_rule(lp); if(MAX_STALLCOUNT <= 1) monitor->limitstall[FALSE] = 0; else monitor->limitstall[FALSE] = MAX(MAX_STALLCOUNT, (int) pow((REAL) (lp->rows+lp->columns)/2, 0.667)); #if 1 monitor->limitstall[FALSE] *= 2+2; /* Expand degeneracy/stalling tolerance range */ #endif monitor->limitstall[TRUE] = monitor->limitstall[FALSE]; if(monitor->oldpivrule == PRICER_DEVEX) /* Increase tolerance since primal Steepest Edge is expensive */ monitor->limitstall[TRUE] *= 2; if(MAX_RULESWITCH <= 0) monitor->limitruleswitches = MAXINT32; else monitor->limitruleswitches = MAX(MAX_RULESWITCH, lp->rows/MAX_RULESWITCH); monitor->epsvalue = lp->epsprimal; /* lp->epsvalue; */ lp->monitor = monitor; stallMonitor_reset(lp); lp->suminfeas = lp->infinite; return( TRUE ); } STATIC MYBOOL stallMonitor_check(lprec *lp, int rownr, int colnr, int lastnr, MYBOOL minit, MYBOOL approved, MYBOOL *forceoutEQ) { OBJmonrec *monitor = lp->monitor; MYBOOL isStalled, isCreeping, acceptance = TRUE; int altrule, #ifdef Paranoia msglevel = NORMAL; #else msglevel = DETAILED; #endif REAL deltaobj = lp->suminfeas; /* Accept unconditionally if this is the first or second call */ monitor->active = FALSE; if(monitor->Icount <= 1) { if(monitor->Icount == 1) { monitor->prevobj = lp->rhs[0]; monitor->previnfeas = deltaobj; } monitor->Icount++; return( acceptance ); } /* Define progress as primal objective less sum of (primal/dual) infeasibilities */ monitor->thisobj = lp->rhs[0]; monitor->thisinfeas = deltaobj; if(lp->spx_trace && (lastnr > 0)) report(lp, NORMAL, "%s: Objective at iter %10.0f is " RESULTVALUEMASK " (%4d: %4d %s- %4d)\n", monitor->spxfunc, (double) get_total_iter(lp), monitor->thisobj, rownr, lastnr, my_if(minit == ITERATE_MAJORMAJOR, "<","|"), colnr); monitor->pivrule = get_piv_rule(lp); /* Check if we have a stationary solution at selected tolerance level; allow some difference in case we just refactorized the basis. */ deltaobj = my_reldiff(monitor->thisobj, monitor->prevobj); deltaobj = fabs(deltaobj); /* Pre v5.2 version */ isStalled = (MYBOOL) (deltaobj < monitor->epsvalue); /* Also require that we have a measure of infeasibility-stalling */ if(isStalled) { REAL testvalue, refvalue = monitor->epsvalue; #if 1 if(monitor->isdual) refvalue *= 1000*log10(9.0+lp->rows); else refvalue *= 1000*log10(9.0+lp->columns); #else refvalue *= 1000*log10(9.0+lp->sum); #endif testvalue = my_reldiff(monitor->thisinfeas, monitor->previnfeas); isStalled &= (fabs(testvalue) < refvalue); /* Check if we should force "major" pivoting, i.e. no bound flips; this is activated when we see the feasibility deteriorate */ /* if(!isStalled && (testvalue > 0) && (TRUE || is_action(lp->anti_degen, ANTIDEGEN_BOUNDFLIP))) */ #if !defined _PRICE_NOBOUNDFLIP if(!isStalled && (testvalue > 0) && is_action(lp->anti_degen, ANTIDEGEN_BOUNDFLIP)) acceptance = AUTOMATIC; } #else if(!isStalled && (testvalue > 0) && !ISMASKSET(lp->piv_strategy, PRICE_NOBOUNDFLIP)) { SETMASK(lp->piv_strategy, PRICE_NOBOUNDFLIP); acceptance = AUTOMATIC; } } else CLEARMASK(lp->piv_strategy, PRICE_NOBOUNDFLIP); #endif #if 1 isCreeping = FALSE; #else isCreeping |= stallMonitor_creepingObj(lp); /* isCreeping |= stallMonitor_shortSteps(lp); */ #endif if(isStalled || isCreeping) { /* Update counters along with specific tolerance for bound flips */ #if 1 if(minit != ITERATE_MAJORMAJOR) { if(++monitor->Mcycle > 2) { monitor->Mcycle = 0; monitor->Ncycle++; } } else #endif monitor->Ncycle++; /* Start to monitor for variable cycling if this is the initial stationarity */ if(monitor->Ncycle <= 1) { monitor->Ccycle = colnr; monitor->Rcycle = rownr; } /* Check if we should change pivoting strategy */ else if(isCreeping || /* We have OF creep */ (monitor->Ncycle > monitor->limitstall[monitor->isdual]) || /* KE empirical value */ ((monitor->Ccycle == rownr) && (monitor->Rcycle == colnr))) { /* Obvious cycling */ monitor->active = TRUE; /* Try to force out equality slacks to combat degeneracy */ if((lp->fixedvars > 0) && (*forceoutEQ != TRUE)) { *forceoutEQ = TRUE; goto Proceed; } /* Our options are now to select an alternative rule or to do bound perturbation; check if these options are available to us or if we must signal failure and break out. */ approved &= monitor->pivdynamic && (monitor->ruleswitches < monitor->limitruleswitches); if(!approved && !is_anti_degen(lp, ANTIDEGEN_STALLING)) { lp->spx_status = DEGENERATE; report(lp, msglevel, "%s: Stalling at iter %10.0f; no alternative strategy left.\n", monitor->spxfunc, (double) get_total_iter(lp)); acceptance = FALSE; return( acceptance ); } /* See if we can do the appropriate alternative rule. */ switch (monitor->oldpivrule) { case PRICER_FIRSTINDEX: altrule = PRICER_DEVEX; break; case PRICER_DANTZIG: altrule = PRICER_DEVEX; break; case PRICER_DEVEX: altrule = PRICER_STEEPESTEDGE; break; case PRICER_STEEPESTEDGE: altrule = PRICER_DEVEX; break; default: altrule = PRICER_FIRSTINDEX; } if(approved && (monitor->pivrule != altrule) && (monitor->pivrule == monitor->oldpivrule)) { /* Switch rule to combat degeneracy. */ monitor->ruleswitches++; lp->piv_strategy = altrule; monitor->Ccycle = 0; monitor->Rcycle = 0; monitor->Ncycle = 0; monitor->Mcycle = 0; report(lp, msglevel, "%s: Stalling at iter %10.0f; changed to '%s' rule.\n", monitor->spxfunc, (double) get_total_iter(lp), get_str_piv_rule(get_piv_rule(lp))); if((altrule == PRICER_DEVEX) || (altrule == PRICER_STEEPESTEDGE)) restartPricer(lp, AUTOMATIC); } /* If not, code for bound relaxation/perturbation */ else { report(lp, msglevel, "%s: Stalling at iter %10.0f; proceed to bound relaxation.\n", monitor->spxfunc, (double) get_total_iter(lp)); acceptance = FALSE; lp->spx_status = DEGENERATE; return( acceptance ); } } } /* Otherwise change back to original selection strategy as soon as possible */ else { if(monitor->pivrule != monitor->oldpivrule) { lp->piv_strategy = monitor->oldpivstrategy; altrule = monitor->oldpivrule; if((altrule == PRICER_DEVEX) || (altrule == PRICER_STEEPESTEDGE)) restartPricer(lp, AUTOMATIC); report(lp, msglevel, "...returned to original pivot selection rule at iter %.0f.\n", (double) get_total_iter(lp)); } stallMonitor_update(lp, monitor->thisobj); monitor->Ccycle = 0; monitor->Rcycle = 0; monitor->Ncycle = 0; monitor->Mcycle = 0; } /* Update objective progress tracker */ Proceed: monitor->Icount++; if(deltaobj >= monitor->epsvalue) monitor->prevobj = monitor->thisobj; monitor->previnfeas = monitor->thisinfeas; return( acceptance ); } STATIC void stallMonitor_finish(lprec *lp) { OBJmonrec *monitor = lp->monitor; if(monitor == NULL) return; if(lp->piv_strategy != monitor->oldpivstrategy) lp->piv_strategy = monitor->oldpivstrategy; FREE(monitor); lp->monitor = NULL; } STATIC MYBOOL add_artificial(lprec *lp, int forrownr, REAL *nzarray, int *idxarray) /* This routine is called for each constraint at the start of primloop and the primal problem is infeasible. Its purpose is to add artificial variables and associated objective function values to populate primal phase 1. */ { MYBOOL add; /* Make sure we don't add unnecessary artificials, i.e. avoid cases where the slack variable is enough */ add = !isBasisVarFeasible(lp, lp->epspivot, forrownr); if(add) { int *rownr = NULL, i, bvar, ii; REAL *avalue = NULL, rhscoef, acoef; MATrec *mat = lp->matA; /* Check the simple case where a slack is basic */ for(i = 1; i <= lp->rows; i++) { if(lp->var_basic[i] == forrownr) break; } acoef = 1; /* If not, look for any basic user variable that has a non-zero coefficient in the current constraint row */ if(i > lp->rows) { for(i = 1; i <= lp->rows; i++) { ii = lp->var_basic[i] - lp->rows; if((ii <= 0) || (ii > (lp->columns-lp->P1extraDim))) continue; ii = mat_findelm(mat, forrownr, ii); if(ii >= 0) { acoef = COL_MAT_VALUE(ii); break; } } } /* If no candidate was found above, gamble on using the densest column available */ #if 0 if(i > lp->rows) { int len = 0; bvar = 0; for(i = 1; i <= lp->rows; i++) { ii = lp->var_basic[i] - lp->rows; if((ii <= 0) || (ii > (lp->columns-lp->P1extraDim))) continue; if(mat_collength(mat, ii) > len) { len = mat_collength(mat, ii); bvar = i; } } i = bvar; acoef = 1; } #endif bvar = i; add = (MYBOOL) (bvar <= lp->rows); if(add) { rhscoef = lp->rhs[forrownr]; /* Create temporary sparse array storage */ if(nzarray == NULL) allocREAL(lp, &avalue, 2, FALSE); else avalue = nzarray; if(idxarray == NULL) allocINT(lp, &rownr, 2, FALSE); else rownr = idxarray; /* Set the objective coefficient */ rownr[0] = 0; avalue[0] = my_chsign(is_chsign(lp, 0), 1); /* Set the constraint row coefficient */ rownr[1] = forrownr; avalue[1] = my_chsign(is_chsign(lp, forrownr), my_sign(rhscoef/acoef)); /* Add the column of artificial variable data to the user data matrix */ add_columnex(lp, 2, avalue, rownr); /* Free the temporary sparse array storage */ if(idxarray == NULL) FREE(rownr); if(nzarray == NULL) FREE(avalue); /* Now set the artificial variable to be basic */ set_basisvar(lp, bvar, lp->sum); lp->P1extraDim++; } else { report(lp, CRITICAL, "add_artificial: Could not find replacement basis variable for row %d\n", forrownr); lp->basis_valid = FALSE; } } return(add); } STATIC int get_artificialRow(lprec *lp, int colnr) { MATrec *mat = lp->matA; #ifdef Paranoia if((colnr <= lp->columns-abs(lp->P1extraDim)) || (colnr > lp->columns)) report(lp, SEVERE, "get_artificialRow: Invalid column index %d\n", colnr); if(mat->col_end[colnr] - mat->col_end[colnr-1] != 1) report(lp, SEVERE, "get_artificialRow: Invalid column non-zero count\n"); #endif /* Return the row index of the singleton */ colnr = mat->col_end[colnr-1]; colnr = COL_MAT_ROWNR(colnr); return( colnr ); } STATIC int findAnti_artificial(lprec *lp, int colnr) /* Primal simplex: Find a basic artificial variable to swap against the non-basic slack variable, if possible */ { int i, k, rownr = 0, P1extraDim = abs(lp->P1extraDim); if((P1extraDim == 0) || (colnr > lp->rows) || !lp->is_basic[colnr]) return( rownr ); for(i = 1; i <= lp->rows; i++) { k = lp->var_basic[i]; if((k > lp->sum-P1extraDim) && (lp->rhs[i] == 0)) { rownr = get_artificialRow(lp, k-lp->rows); /* Should we find the artificial's slack direct "antibody"? */ if(rownr == colnr) break; rownr = 0; } } return( rownr ); } STATIC int findBasicArtificial(lprec *lp, int before) { int i = 0, P1extraDim = abs(lp->P1extraDim); if(P1extraDim > 0) { if(before > lp->rows || before <= 1) i = lp->rows; else i = before; while((i > 0) && (lp->var_basic[i] <= lp->sum-P1extraDim)) i--; } return(i); } STATIC void eliminate_artificials(lprec *lp, REAL *prow) { int i, j, colnr, rownr, P1extraDim = abs(lp->P1extraDim); for(i = 1; (i <= lp->rows) && (P1extraDim > 0); i++) { j = lp->var_basic[i]; if(j <= lp->sum-P1extraDim) continue; j -= lp->rows; rownr = get_artificialRow(lp, j); colnr = find_rowReplacement(lp, rownr, prow, NULL); #if 0 performiteration(lp, rownr, colnr, 0.0, TRUE, FALSE, prow, NULL, NULL, NULL, NULL); #else set_basisvar(lp, rownr, colnr); #endif del_column(lp, j); P1extraDim--; } lp->P1extraDim = 0; } STATIC void clear_artificials(lprec *lp) { int i, j, n, P1extraDim; /* Substitute any basic artificial variable for its slack counterpart */ n = 0; P1extraDim = abs(lp->P1extraDim); for(i = 1; (i <= lp->rows) && (n < P1extraDim); i++) { j = lp->var_basic[i]; if(j <= lp->sum-P1extraDim) continue; j = get_artificialRow(lp, j-lp->rows); set_basisvar(lp, i, j); n++; } #ifdef Paranoia if(n != lp->P1extraDim) report(lp, SEVERE, "clear_artificials: Unable to clear all basic artificial variables\n"); #endif /* Delete any remaining non-basic artificial variables */ while(P1extraDim > 0) { i = lp->sum-lp->rows; del_column(lp, i); P1extraDim--; } lp->P1extraDim = 0; if(n > 0) { set_action(&lp->spx_action, ACTION_REINVERT); lp->basis_valid = TRUE; } } STATIC int primloop(lprec *lp, MYBOOL primalfeasible, REAL primaloffset) { MYBOOL primal = TRUE, bfpfinal = FALSE, changedphase = FALSE, forceoutEQ = AUTOMATIC, primalphase1, pricerCanChange, minit, stallaccept, pendingunbounded; int i, j, k, colnr = 0, rownr = 0, lastnr = 0, candidatecount = 0, minitcount = 0, ok = TRUE; LREAL theta = 0.0; REAL epsvalue, xviolated, cviolated = 0.0, *prow = NULL, *pcol = NULL, *drow = lp->drow; int *workINT = NULL, *nzdrow = lp->nzdrow; if(lp->spx_trace) report(lp, DETAILED, "Entered primal simplex algorithm with feasibility %s\n", my_boolstr(primalfeasible)); /* Add sufficent number of artificial variables to make the problem feasible through the first phase; delete when primal feasibility has been achieved */ lp->P1extraDim = 0; if(!primalfeasible) { lp->simplex_mode = SIMPLEX_Phase1_PRIMAL; #ifdef Paranoia if(!verify_basis(lp)) report(lp, SEVERE, "primloop: No valid basis for artificial variables\n"); #endif #if 0 /* First check if we can get away with a single artificial variable */ if(lp->equalities == 0) { i = (int) feasibilityOffset(lp, !primal); add_artificial(lp, i, prow, (int *) pcol); } else #endif /* Otherwise add as many artificial variables as is necessary to force primal feasibility. */ for(i = 1; i <= lp->rows; i++) { add_artificial(lp, i, NULL, NULL); } /* Make sure we update the working objective */ if(lp->P1extraDim > 0) { #if 1 /* v5.1 code: Not really necessary since we do not price the artificial variables (stored at the end of the column list, they are initially basic and are never allowed to enter the basis, once they exit) */ ok = allocREAL(lp, &(lp->drow), lp->sum+1, AUTOMATIC) && allocINT(lp, &(lp->nzdrow), lp->sum+1, AUTOMATIC); if(!ok) goto Finish; lp->nzdrow[0] = 0; drow = lp->drow; nzdrow = lp->nzdrow; #endif mat_validate(lp->matA); set_OF_p1extra(lp, 0.0); } if(lp->spx_trace) report(lp, DETAILED, "P1extraDim count = %d\n", lp->P1extraDim); simplexPricer(lp, (MYBOOL)!primal); invert(lp, INITSOL_USEZERO, TRUE); } else { lp->simplex_mode = SIMPLEX_Phase2_PRIMAL; restartPricer(lp, (MYBOOL)!primal); } /* Create work arrays and optionally the multiple pricing structure */ ok = allocREAL(lp, &(lp->bsolveVal), lp->rows + 1, FALSE) && allocREAL(lp, &prow, lp->sum + 1, TRUE) && allocREAL(lp, &pcol, lp->rows + 1, TRUE); if(is_piv_mode(lp, PRICE_MULTIPLE) && (lp->multiblockdiv > 1)) { lp->multivars = multi_create(lp, FALSE); ok &= (lp->multivars != NULL) && multi_resize(lp->multivars, lp->sum / lp->multiblockdiv, 2, FALSE, TRUE); } if(!ok) goto Finish; /* Initialize regular primal simplex algorithm variables */ lp->spx_status = RUNNING; minit = ITERATE_MAJORMAJOR; epsvalue = lp->epspivot; pendingunbounded = FALSE; ok = stallMonitor_create(lp, FALSE, "primloop"); if(!ok) goto Finish; lp->rejectpivot[0] = 0; /* Iterate while we are successful; exit when the model is infeasible/unbounded, or we must terminate due to numeric instability or user-determined reasons */ while((lp->spx_status == RUNNING) && !userabort(lp, -1)) { primalphase1 = (MYBOOL) (lp->P1extraDim > 0); clear_action(&lp->spx_action, ACTION_REINVERT | ACTION_ITERATE); /* Check if we have stalling (from numerics or degenerate cycling) */ pricerCanChange = !primalphase1; stallaccept = stallMonitor_check(lp, rownr, colnr, lastnr, minit, pricerCanChange, &forceoutEQ); if(!stallaccept) break; /* Find best column to enter the basis */ RetryCol: #if 0 if(verify_solution(lp, FALSE, "spx_loop") > 0) i = 1; /* This is just a debug trap */ #endif if(!changedphase) { i = 0; do { i++; colnr = colprim(lp, drow, nzdrow, (MYBOOL) (minit == ITERATE_MINORRETRY), i, &candidatecount, TRUE, &xviolated); } while ((colnr == 0) && (i < partial_countBlocks(lp, (MYBOOL) !primal)) && partial_blockStep(lp, (MYBOOL) !primal)); /* Handle direct outcomes */ if(colnr == 0) lp->spx_status = OPTIMAL; if(lp->rejectpivot[0] > 0) minit = ITERATE_MAJORMAJOR; /* See if accuracy check during compute_reducedcosts flagged refactorization */ if(is_action(lp->spx_action, ACTION_REINVERT)) bfpfinal = TRUE; } /* Make sure that we do not erroneously conclude that an unbounded model is optimal */ #ifdef primal_UseRejectionList if((colnr == 0) && (lp->rejectpivot[0] > 0)) { lp->spx_status = UNBOUNDED; if((lp->spx_trace && (lp->bb_totalnodes == 0)) || (lp->bb_trace && (lp->bb_totalnodes > 0))) report(lp, DETAILED, "The model is primal unbounded.\n"); colnr = lp->rejectpivot[1]; rownr = 0; lp->rejectpivot[0] = 0; ok = FALSE; break; } #endif /* Check if we found an entering variable (indicating that we are still dual infeasible) */ if(colnr > 0) { changedphase = FALSE; fsolve(lp, colnr, pcol, NULL, lp->epsmachine, 1.0, TRUE); /* Solve entering column for Pi */ /* Do special anti-degeneracy column selection, if specified */ if(is_anti_degen(lp, ANTIDEGEN_COLUMNCHECK) && !check_degeneracy(lp, pcol, NULL)) { if(lp->rejectpivot[0] < DEF_MAXPIVOTRETRY/3) { i = ++lp->rejectpivot[0]; lp->rejectpivot[i] = colnr; report(lp, DETAILED, "Entering column %d found to be non-improving due to degeneracy.\n", colnr); minit = ITERATE_MINORRETRY; goto RetryCol; } else { lp->rejectpivot[0] = 0; report(lp, DETAILED, "Gave up trying to find a strictly improving entering column.\n"); } } /* Find the leaving variable that gives the most stringent bound on the entering variable */ theta = drow[colnr]; rownr = rowprim(lp, colnr, &theta, pcol, workINT, forceoutEQ, &cviolated); #ifdef AcceptMarginalAccuracy /* Check for marginal accuracy */ if((rownr > 0) && (xviolated+cviolated < lp->epspivot)) { if(lp->bb_trace || (lp->bb_totalnodes == 0)) report(lp, DETAILED, "primloop: Assuming convergence with reduced accuracy %g.\n", MAX(xviolated, cviolated)); rownr = 0; colnr = 0; goto Optimality; } else #endif /* See if we can do a straight artificial<->slack replacement (when "colnr" is a slack) */ if((lp->P1extraDim != 0) && (rownr == 0) && (colnr <= lp->rows)) rownr = findAnti_artificial(lp, colnr); if(rownr > 0) { pendingunbounded = FALSE; lp->rejectpivot[0] = 0; set_action(&lp->spx_action, ACTION_ITERATE); if(!lp->obj_in_basis) /* We must manually copy the reduced cost for RHS update */ pcol[0] = my_chsign(!lp->is_lower[colnr], drow[colnr]); lp->bfp_prepareupdate(lp, rownr, colnr, pcol); } /* We may be unbounded... */ else { /* First make sure that we are not suffering from precision loss */ #ifdef primal_UseRejectionList if(lp->rejectpivot[0] < DEF_MAXPIVOTRETRY) { lp->spx_status = RUNNING; lp->rejectpivot[0]++; lp->rejectpivot[lp->rejectpivot[0]] = colnr; report(lp, DETAILED, "...trying to recover via another pivot column.\n"); minit = ITERATE_MINORRETRY; goto RetryCol; } else #endif /* Check that we are not having numerical problems */ if(!refactRecent(lp) && !pendingunbounded) { bfpfinal = TRUE; pendingunbounded = TRUE; set_action(&lp->spx_action, ACTION_REINVERT); } /* Conclude that the model is unbounded */ else { lp->spx_status = UNBOUNDED; report(lp, DETAILED, "The model is primal unbounded.\n"); break; } } } /* We handle optimality and phase 1 infeasibility ... */ else { Optimality: /* Handle possible transition from phase 1 to phase 2 */ if(!primalfeasible || isP1extra(lp)) { if(feasiblePhase1(lp, epsvalue)) { lp->spx_status = RUNNING; if(lp->bb_totalnodes == 0) { report(lp, NORMAL, "Found feasibility by primal simplex after %10.0f iter.\n", (double) get_total_iter(lp)); if((lp->usermessage != NULL) && (lp->msgmask & MSG_LPFEASIBLE)) lp->usermessage(lp, lp->msghandle, MSG_LPFEASIBLE); } changedphase = FALSE; primalfeasible = TRUE; lp->simplex_mode = SIMPLEX_Phase2_PRIMAL; set_OF_p1extra(lp, 0.0); /* We can do two things now; 1) delete the rows belonging to those variables, since they are redundant, OR 2) drive out the existing artificial variables via pivoting. */ if(lp->P1extraDim > 0) { #ifdef Phase1EliminateRedundant /* If it is not a MIP model we can try to delete redundant rows */ if((lp->bb_totalnodes == 0) && (MIP_count(lp) == 0)) { while(lp->P1extraDim > 0) { i = lp->rows; while((i > 0) && (lp->var_basic[i] <= lp->sum-lp->P1extraDim)) i--; #ifdef Paranoia if(i <= 0) { report(lp, SEVERE, "primloop: Could not find redundant artificial.\n"); break; } #endif /* Obtain column and row indeces */ j = lp->var_basic[i]-lp->rows; k = get_artificialRow(lp, j); /* Delete row before column due to basis "compensation logic" */ if(lp->is_basic[k]) { lp->is_basic[lp->rows+j] = FALSE; del_constraint(lp, k); } else set_basisvar(lp, i, k); del_column(lp, j); lp->P1extraDim--; } lp->basis_valid = TRUE; } /* Otherwise we drive out the artificials by elimination pivoting */ else eliminate_artificials(lp, prow); #else /* Indicate phase 2 with artificial variables by negating P1extraDim */ lp->P1extraDim = my_flipsign(lp->P1extraDim); #endif } /* We must refactorize since the OF changes from phase 1 to phase 2 */ set_action(&lp->spx_action, ACTION_REINVERT); bfpfinal = TRUE; } /* We are infeasible in phase 1 */ else { lp->spx_status = INFEASIBLE; minit = ITERATE_MAJORMAJOR; if(lp->spx_trace) report(lp, NORMAL, "Model infeasible by primal simplex at iter %10.0f.\n", (double) get_total_iter(lp)); } } /* Handle phase 1 optimality */ else { /* (Do nothing special) */ } /* Check if we are still primal feasible; the default assumes that this check is not necessary after the relaxed problem has been solved satisfactorily. */ if((lp->bb_level <= 1) || (lp->improve & IMPROVE_BBSIMPLEX) /* || (lp->bb_rule & NODE_RCOSTFIXING) */) { /* NODE_RCOSTFIXING fix */ set_action(&lp->piv_strategy, PRICE_FORCEFULL); i = rowdual(lp, lp->rhs, FALSE, FALSE, NULL); clear_action(&lp->piv_strategy, PRICE_FORCEFULL); if(i > 0) { lp->spx_status = LOSTFEAS; if(lp->total_iter == 0) report(lp, DETAILED, "primloop: Lost primal feasibility at iter %10.0f: will try to recover.\n", (double) get_total_iter(lp)); } } } /* Pivot row/col and update the inverse */ if(is_action(lp->spx_action, ACTION_ITERATE)) { lastnr = lp->var_basic[rownr]; if(refactRecent(lp) == AUTOMATIC) minitcount = 0; else if(minitcount > MAX_MINITUPDATES) { recompute_solution(lp, INITSOL_USEZERO); minitcount = 0; } minit = performiteration(lp, rownr, colnr, theta, primal, (MYBOOL) (/*(candidatecount > 1) && */ (stallaccept != AUTOMATIC)), NULL, NULL, pcol, NULL, NULL); if(minit != ITERATE_MAJORMAJOR) minitcount++; if((lp->spx_status == USERABORT) || (lp->spx_status == TIMEOUT)) break; else if(minit == ITERATE_MINORMAJOR) continue; #ifdef UsePrimalReducedCostUpdate /* Do a fast update of the reduced costs in preparation for the next iteration */ if(minit == ITERATE_MAJORMAJOR) update_reducedcosts(lp, primal, lastnr, colnr, pcol, drow); #endif /* Detect if an auxiliary variable has left the basis and delete it; if the non-basic variable only changed bound (a "minor iteration"), the basic artificial variable did not leave and there is nothing to do */ if((minit == ITERATE_MAJORMAJOR) && (lastnr > lp->sum - abs(lp->P1extraDim))) { #ifdef Paranoia if(lp->is_basic[lastnr] || !lp->is_basic[colnr]) report(lp, SEVERE, "primloop: Invalid basis indicator for variable %d at iter %10.0f.\n", lastnr, (double) get_total_iter(lp)); #endif del_column(lp, lastnr-lp->rows); if(lp->P1extraDim > 0) lp->P1extraDim--; else lp->P1extraDim++; if(lp->P1extraDim == 0) { colnr = 0; changedphase = TRUE; stallMonitor_reset(lp); } } } if(lp->spx_status == SWITCH_TO_DUAL) ; else if(!changedphase && lp->bfp_mustrefactorize(lp)) { #ifdef ResetMinitOnReinvert minit = ITERATE_MAJORMAJOR; #endif if(!invert(lp, INITSOL_USEZERO, bfpfinal)) lp->spx_status = SINGULAR_BASIS; bfpfinal = FALSE; } } /* Remove any remaining artificial variables (feasible or infeasible model) */ lp->P1extraDim = abs(lp->P1extraDim); /* if((lp->P1extraDim > 0) && (lp->spx_status != DEGENERATE)) { */ if(lp->P1extraDim > 0) { clear_artificials(lp); if(lp->spx_status != OPTIMAL) restore_basis(lp); i = invert(lp, INITSOL_USEZERO, TRUE); } #ifdef Paranoia if(!verify_basis(lp)) report(lp, SEVERE, "primloop: Invalid basis detected due to internal error\n"); #endif /* Switch to dual phase 1 simplex for MIP models during B&B phases, since this is typically far more efficient */ #ifdef ForceDualSimplexInBB if((lp->bb_totalnodes == 0) && (MIP_count(lp) > 0) && ((lp->simplex_strategy & SIMPLEX_Phase1_DUAL) == 0)) { lp->simplex_strategy &= ~SIMPLEX_Phase1_PRIMAL; lp->simplex_strategy += SIMPLEX_Phase1_DUAL; } #endif Finish: stallMonitor_finish(lp); multi_free(&(lp->multivars)); FREE(prow); FREE(pcol); FREE(lp->bsolveVal); return(ok); } /* primloop */ STATIC int dualloop(lprec *lp, MYBOOL dualfeasible, int dualinfeasibles[], REAL dualoffset) { MYBOOL primal = FALSE, inP1extra, dualphase1 = FALSE, changedphase = TRUE, pricerCanChange, minit, stallaccept, longsteps, forceoutEQ = FALSE, bfpfinal = FALSE; int i, colnr = 0, rownr = 0, lastnr = 0, candidatecount = 0, minitcount = 0, #ifdef FixInaccurateDualMinit minitcolnr = 0, #endif ok = TRUE; int *boundswaps = NULL; LREAL theta = 0.0; REAL epsvalue, xviolated, cviolated, *prow = NULL, *pcol = NULL, *drow = lp->drow; int *nzprow = NULL, *workINT = NULL, *nzdrow = lp->nzdrow; if(lp->spx_trace) report(lp, DETAILED, "Entered dual simplex algorithm with feasibility %s.\n", my_boolstr(dualfeasible)); /* Allocate work arrays */ ok = allocREAL(lp, &prow, lp->sum + 1, TRUE) && allocINT (lp, &nzprow, lp->sum + 1, FALSE) && allocREAL(lp, &pcol, lp->rows + 1, TRUE); if(!ok) goto Finish; /* Set non-zero P1extraVal value to force dual feasibility when the dual simplex is used as a phase 1 algorithm for the primal simplex. The value will be reset when primal feasibility has been achieved, or a dual non-feasibility has been encountered (no candidate for a first leaving variable) */ inP1extra = (MYBOOL) (dualoffset != 0); if(inP1extra) { set_OF_p1extra(lp, dualoffset); simplexPricer(lp, (MYBOOL)!primal); invert(lp, INITSOL_USEZERO, TRUE); } else restartPricer(lp, (MYBOOL)!primal); /* Prepare dual long-step structures */ #if 0 longsteps = TRUE; #elif 0 longsteps = (MYBOOL) ((MIP_count(lp) > 0) && (lp->bb_level > 1)); #elif 0 longsteps = (MYBOOL) ((MIP_count(lp) > 0) && (lp->solutioncount >= 1)); #else longsteps = FALSE; #endif #ifdef UseLongStepDualPhase1 longsteps = !dualfeasible && (MYBOOL) (dualinfeasibles != NULL); #endif if(longsteps) { lp->longsteps = multi_create(lp, TRUE); ok = (lp->longsteps != NULL) && multi_resize(lp->longsteps, MIN(lp->boundedvars+2, 11), 1, TRUE, TRUE); if(!ok) goto Finish; #ifdef UseLongStepPruning lp->longsteps->objcheck = TRUE; #endif boundswaps = multi_indexSet(lp->longsteps, FALSE); } /* Do regular dual simplex variable initializations */ lp->spx_status = RUNNING; minit = ITERATE_MAJORMAJOR; epsvalue = lp->epspivot; ok = stallMonitor_create(lp, TRUE, "dualloop"); if(!ok) goto Finish; lp->rejectpivot[0] = 0; if(dualfeasible) lp->simplex_mode = SIMPLEX_Phase2_DUAL; else lp->simplex_mode = SIMPLEX_Phase1_DUAL; /* Check if we have equality slacks in the basis and we should try to drive them out in order to reduce chance of degeneracy in Phase 1. forceoutEQ = FALSE : Only eliminate assured "good" violated equality constraint slacks AUTOMATIC: Seek more elimination of equality constraint slacks (but not as aggressive as the rule used in lp_solve v4.0 and earlier) TRUE: Force remaining equality slacks out of the basis */ if(dualphase1 || inP1extra || ((lp->fixedvars > 0) && is_anti_degen(lp, ANTIDEGEN_FIXEDVARS))) { forceoutEQ = AUTOMATIC; } #if 1 if(is_anti_degen(lp, ANTIDEGEN_DYNAMIC) && (bin_count(lp, TRUE)*2 > lp->columns)) { switch (forceoutEQ) { case FALSE: forceoutEQ = AUTOMATIC; break; /* case AUTOMATIC: forceoutEQ = TRUE; break; default: forceoutEQ = TRUE; */ } } #endif while((lp->spx_status == RUNNING) && !userabort(lp, -1)) { /* Check if we have stalling (from numerics or degenerate cycling) */ pricerCanChange = !dualphase1 && !inP1extra; stallaccept = stallMonitor_check(lp, rownr, colnr, lastnr, minit, pricerCanChange, &forceoutEQ); if(!stallaccept) break; /* Store current LP index for reference at next iteration */ changedphase = FALSE; /* Compute (pure) dual phase1 offsets / reduced costs if appropriate */ dualphase1 &= (MYBOOL) (lp->simplex_mode == SIMPLEX_Phase1_DUAL); if(longsteps && dualphase1 && !inP1extra) { obtain_column(lp, dualinfeasibles[1], pcol, NULL, NULL); i = 2; for(i = 2; i <= dualinfeasibles[0]; i++) mat_multadd(lp->matA, pcol, dualinfeasibles[i], 1.0); /* Solve (note that solved pcol will be used instead of lp->rhs) */ ftran(lp, pcol, NULL, lp->epsmachine); } /* Do minor iterations (non-basic variable bound flips) for as long as possible since this is a cheap way of iterating */ #if (defined dual_Phase1PriceEqualities) || (defined dual_UseRejectionList) RetryRow: #endif if(minit != ITERATE_MINORRETRY) { i = 0; do { i++; rownr = rowdual(lp, my_if(dualphase1, pcol, NULL), forceoutEQ, TRUE, &xviolated); } while ((rownr == 0) && (i < partial_countBlocks(lp, (MYBOOL) !primal)) && partial_blockStep(lp, (MYBOOL) !primal)); } /* Make sure that we do not erroneously conclude that an infeasible model is optimal */ #ifdef dual_UseRejectionList if((rownr == 0) && (lp->rejectpivot[0] > 0)) { lp->spx_status = INFEASIBLE; if((lp->spx_trace && (lp->bb_totalnodes == 0)) || (lp->bb_trace && (lp->bb_totalnodes > 0))) report(lp, DETAILED, "The model is primal infeasible.\n"); rownr = lp->rejectpivot[1]; colnr = 0; lp->rejectpivot[0] = 0; ok = FALSE; break; } #endif /* If we found a leaving variable, find a matching entering one */ clear_action(&lp->spx_action, ACTION_ITERATE); if(rownr > 0) { colnr = coldual(lp, rownr, prow, nzprow, drow, nzdrow, (MYBOOL) (dualphase1 && !inP1extra), (MYBOOL) (minit == ITERATE_MINORRETRY), &candidatecount, &cviolated); if(colnr < 0) { minit = ITERATE_MAJORMAJOR; continue; } #ifdef AcceptMarginalAccuracy else if(xviolated+cviolated < lp->epspivot) { if(lp->bb_trace || (lp->bb_totalnodes == 0)) report(lp, DETAILED, "dualloop: Assuming convergence with reduced accuracy %g.\n", MAX(xviolated, cviolated)); rownr = 0; colnr = 0; } #endif /* Check if the long-dual found reason to prune the B&B tree */ if(lp->spx_status == FATHOMED) break; } else colnr = 0; /* Process primal-infeasible row */ if(rownr > 0) { if(colnr > 0) { #ifdef Paranoia if((rownr > lp->rows) || (colnr > lp->sum)) { report(lp, SEVERE, "dualloop: Invalid row %d(%d) and column %d(%d) pair selected at iteration %.0f\n", rownr, lp->rows, colnr-lp->columns, lp->columns, (double) get_total_iter(lp)); lp->spx_status = UNKNOWNERROR; break; } #endif fsolve(lp, colnr, pcol, workINT, lp->epsmachine, 1.0, TRUE); #ifdef FixInaccurateDualMinit /* Prevent bound flip-flops during minor iterations; used to detect infeasibility after triggering of minor iteration accuracy management */ if(colnr != minitcolnr) minitcolnr = 0; #endif /* Getting division by zero here; catch it and try to recover */ if(pcol[rownr] == 0) { if(lp->spx_trace) report(lp, DETAILED, "dualloop: Attempt to divide by zero (pcol[%d])\n", rownr); if(!refactRecent(lp)) { report(lp, DETAILED, "...trying to recover by refactorizing basis.\n"); set_action(&lp->spx_action, ACTION_REINVERT); bfpfinal = FALSE; } else { if(lp->bb_totalnodes == 0) report(lp, DETAILED, "...cannot recover by refactorizing basis.\n"); lp->spx_status = NUMFAILURE; ok = FALSE; } } else { set_action(&lp->spx_action, ACTION_ITERATE); lp->rejectpivot[0] = 0; if(!lp->obj_in_basis) /* We must manually copy the reduced cost for RHS update */ pcol[0] = my_chsign(!lp->is_lower[colnr], drow[colnr]); theta = lp->bfp_prepareupdate(lp, rownr, colnr, pcol); /* Verify numeric accuracy of the basis factorization and change to the "theoretically" correct version of the theta */ if((lp->improve & IMPROVE_THETAGAP) && !refactRecent(lp) && (my_reldiff(fabs(theta), fabs(prow[colnr])) > lp->epspivot*10.0*log(2.0+50.0*lp->rows))) { /* This is my kludge - KE */ set_action(&lp->spx_action, ACTION_REINVERT); bfpfinal = TRUE; #ifdef IncreasePivotOnReducedAccuracy lp->epspivot = MIN(1.0e-4, lp->epspivot*2.0); #endif report(lp, DETAILED, "dualloop: Refactorizing at iter %.0f due to loss of accuracy.\n", (double) get_total_iter(lp)); } theta = prow[colnr]; compute_theta(lp, rownr, &theta, !lp->is_lower[colnr], 0, primal); } } #ifdef FixInaccurateDualMinit /* Force reinvertion and try another row if we did not find a bound-violated leaving column */ else if(!refactRecent(lp) && (minit != ITERATE_MAJORMAJOR) && (colnr != minitcolnr)) { minitcolnr = colnr; i = invert(lp, INITSOL_USEZERO, TRUE); if((lp->spx_status == USERABORT) || (lp->spx_status == TIMEOUT)) break; else if(!i) { lp->spx_status = SINGULAR_BASIS; break; } minit = ITERATE_MAJORMAJOR; continue; } #endif /* We may be infeasible, have lost dual feasibility, or simply have no valid entering variable for the selected row. The strategy is to refactorize if we suspect numerical problems and loss of dual feasibility; this is done if it has been a while since refactorization. If not, first try to select a different row/leaving variable to see if a valid entering variable can be found. Otherwise, determine this model as infeasible. */ else { /* As a first option, try to recover from any numerical trouble by refactorizing */ if(!refactRecent(lp)) { set_action(&lp->spx_action, ACTION_REINVERT); bfpfinal = TRUE; } #ifdef dual_UseRejectionList /* Check for pivot size issues */ else if(lp->rejectpivot[0] < DEF_MAXPIVOTRETRY) { lp->spx_status = RUNNING; lp->rejectpivot[0]++; lp->rejectpivot[lp->rejectpivot[0]] = rownr; if(lp->bb_totalnodes == 0) report(lp, DETAILED, "...trying to find another pivot row!\n"); goto RetryRow; } #endif /* Check if we may have lost dual feasibility if we also did phase 1 here */ else if(dualphase1 && (dualoffset != 0)) { lp->spx_status = LOSTFEAS; if((lp->spx_trace && (lp->bb_totalnodes == 0)) || (lp->bb_trace && (lp->bb_totalnodes > 0))) report(lp, DETAILED, "dualloop: Model lost dual feasibility.\n"); ok = FALSE; break; } /* Otherwise just determine that we are infeasible */ else { if(lp->spx_status == RUNNING) { #if 1 if(xviolated < lp->epspivot) { if(lp->bb_trace || (lp->bb_totalnodes == 0)) report(lp, NORMAL, "The model is primal optimal, but marginally infeasible.\n"); lp->spx_status = OPTIMAL; break; } #endif lp->spx_status = INFEASIBLE; if((lp->spx_trace && (lp->bb_totalnodes == 0)) || (lp->bb_trace && (lp->bb_totalnodes > 0))) report(lp, DETAILED, "The model is primal infeasible.\n"); } ok = FALSE; break; } } } /* Make sure that we enter the primal simplex with a high quality solution */ else if(inP1extra && !refactRecent(lp) && is_action(lp->improve, IMPROVE_INVERSE)) { set_action(&lp->spx_action, ACTION_REINVERT); bfpfinal = TRUE; } /* High quality solution with no leaving candidates available ... */ else { bfpfinal = TRUE; #ifdef dual_RemoveBasicFixedVars /* See if we should try to eliminate basic fixed variables; can be time-consuming for some models */ if(inP1extra && (colnr == 0) && (lp->fixedvars > 0) && is_anti_degen(lp, ANTIDEGEN_FIXEDVARS)) { report(lp, DETAILED, "dualloop: Trying to pivot out %d fixed basic variables at iter %.0f\n", lp->fixedvars, (double) get_total_iter(lp)); rownr = 0; while(lp->fixedvars > 0) { rownr = findBasicFixedvar(lp, rownr, TRUE); if(rownr == 0) { colnr = 0; break; } colnr = find_rowReplacement(lp, rownr, prow, nzprow); if(colnr > 0) { theta = 0; performiteration(lp, rownr, colnr, theta, TRUE, FALSE, prow, NULL, NULL, NULL, NULL); lp->fixedvars--; } } } #endif /* Check if we are INFEASIBLE for the case that the dual is used as phase 1 before the primal simplex phase 2 */ if(inP1extra && (colnr < 0) && !isPrimalFeasible(lp, lp->epsprimal, NULL, NULL)) { if(lp->bb_totalnodes == 0) { if(dualfeasible) report(lp, DETAILED, "The model is primal infeasible and dual feasible.\n"); else report(lp, DETAILED, "The model is primal infeasible and dual unbounded.\n"); } set_OF_p1extra(lp, 0); inP1extra = FALSE; set_action(&lp->spx_action, ACTION_REINVERT); lp->spx_status = INFEASIBLE; lp->simplex_mode = SIMPLEX_UNDEFINED; ok = FALSE; } /* Check if we are FEASIBLE (and possibly also optimal) for the case that the dual is used as phase 1 before the primal simplex phase 2 */ else if(inP1extra) { /* Set default action; force an update of the rhs vector, adjusted for the new P1extraVal=0 (set here so that usermessage() behaves properly) */ if(lp->bb_totalnodes == 0) { report(lp, NORMAL, "Found feasibility by dual simplex after %10.0f iter.\n", (double) get_total_iter(lp)); if((lp->usermessage != NULL) && (lp->msgmask & MSG_LPFEASIBLE)) lp->usermessage(lp, lp->msghandle, MSG_LPFEASIBLE); } set_OF_p1extra(lp, 0); inP1extra = FALSE; set_action(&lp->spx_action, ACTION_REINVERT); #if 1 /* Optionally try another dual loop, if so selected by the user */ if((lp->simplex_strategy & SIMPLEX_DUAL_PRIMAL) && (lp->fixedvars == 0)) lp->spx_status = SWITCH_TO_PRIMAL; #endif changedphase = TRUE; } /* We are primal feasible and also optimal if we were in phase 2 */ else { lp->simplex_mode = SIMPLEX_Phase2_DUAL; /* Check if we still have equality slacks stuck in the basis; drive them out? */ if((lp->fixedvars > 0) && (lp->bb_totalnodes == 0)) { #ifdef dual_Phase1PriceEqualities if(forceoutEQ != TRUE) { forceoutEQ = TRUE; goto RetryRow; } #endif #ifdef Paranoia report(lp, NORMAL, #else report(lp, DETAILED, #endif "Found dual solution with %d fixed slack variables left basic.\n", lp->fixedvars); } /* Check if we are still dual feasible; the default assumes that this check is not necessary after the relaxed problem has been solved satisfactorily. */ colnr = 0; if((dualoffset != 0) || (lp->bb_level <= 1) || (lp->improve & IMPROVE_BBSIMPLEX) || (lp->bb_rule & NODE_RCOSTFIXING)) { /* NODE_RCOSTFIXING fix */ set_action(&lp->piv_strategy, PRICE_FORCEFULL); colnr = colprim(lp, drow, nzdrow, FALSE, 1, &candidatecount, FALSE, NULL); clear_action(&lp->piv_strategy, PRICE_FORCEFULL); if((dualoffset == 0) && (colnr > 0)) { lp->spx_status = LOSTFEAS; if(lp->total_iter == 0) report(lp, DETAILED, "Recovering lost dual feasibility at iter %10.0f.\n", (double) get_total_iter(lp)); break; } } if(colnr == 0) lp->spx_status = OPTIMAL; else { lp->spx_status = SWITCH_TO_PRIMAL; if(lp->total_iter == 0) report(lp, DETAILED, "Use primal simplex for finalization at iter %10.0f.\n", (double) get_total_iter(lp)); } if((lp->total_iter == 0) && (lp->spx_status == OPTIMAL)) report(lp, DETAILED, "Optimal solution with dual simplex at iter %10.0f.\n", (double) get_total_iter(lp)); } /* Determine if we are ready to break out of the loop */ if(!changedphase) break; } /* Check if we are allowed to iterate on the chosen column and row */ if(is_action(lp->spx_action, ACTION_ITERATE)) { lastnr = lp->var_basic[rownr]; if(refactRecent(lp) == AUTOMATIC) minitcount = 0; else if(minitcount > MAX_MINITUPDATES) { recompute_solution(lp, INITSOL_USEZERO); minitcount = 0; } minit = performiteration(lp, rownr, colnr, theta, primal, (MYBOOL) (/*(candidatecount > 1) && */ (stallaccept != AUTOMATIC)), prow, nzprow, pcol, NULL, boundswaps); /* Check if we should abandon iterations on finding that there is no hope that this branch can improve on the incumbent B&B solution */ if(!lp->is_strongbranch && (lp->solutioncount >= 1) && !lp->spx_perturbed && !inP1extra && bb_better(lp, OF_WORKING, OF_TEST_WE)) { lp->spx_status = FATHOMED; ok = FALSE; break; } if(minit != ITERATE_MAJORMAJOR) minitcount++; /* Update reduced costs for (pure) dual long-step phase 1 */ if(longsteps && dualphase1 && !inP1extra) { dualfeasible = isDualFeasible(lp, lp->epsprimal, NULL, dualinfeasibles, NULL); if(dualfeasible) { dualphase1 = FALSE; changedphase = TRUE; lp->simplex_mode = SIMPLEX_Phase2_DUAL; } } #ifdef UseDualReducedCostUpdate /* Do a fast update of reduced costs in preparation for the next iteration */ else if(minit == ITERATE_MAJORMAJOR) update_reducedcosts(lp, primal, lastnr, colnr, prow, drow); #endif if((minit == ITERATE_MAJORMAJOR) && (lastnr <= lp->rows) && is_fixedvar(lp, lastnr)) lp->fixedvars--; } /* Refactorize if required to */ if(lp->bfp_mustrefactorize(lp)) { if(invert(lp, INITSOL_USEZERO, bfpfinal)) { #if 0 /* Verify dual feasibility in case we are attempting the extra dual loop */ if(changedphase && (dualoffset != 0) && !inP1extra && (lp->spx_status != SWITCH_TO_PRIMAL)) { #if 1 if(!isDualFeasible(lp, lp->epsdual, &colnr, NULL, NULL)) { #else set_action(&lp->piv_strategy, PRICE_FORCEFULL); colnr = colprim(lp, drow, nzdrow, FALSE, 1, &candidatecount, FALSE, NULL); clear_action(&lp->piv_strategy, PRICE_FORCEFULL); if(colnr > 0) { #endif lp->spx_status = SWITCH_TO_PRIMAL; colnr = 0; } } #endif bfpfinal = FALSE; #ifdef ResetMinitOnReinvert minit = ITERATE_MAJORMAJOR; #endif } else lp->spx_status = SINGULAR_BASIS; } } Finish: stallMonitor_finish(lp); multi_free(&(lp->longsteps)); FREE(prow); FREE(nzprow); FREE(pcol); return(ok); } STATIC int spx_run(lprec *lp, MYBOOL validInvB) { int i, j, singular_count, lost_feas_count, *infeasibles = NULL, *boundflip_count; MYBOOL primalfeasible, dualfeasible, lost_feas_state, isbb; REAL primaloffset = 0, dualoffset = 0; lp->current_iter = 0; lp->current_bswap = 0; lp->spx_status = RUNNING; lp->bb_status = lp->spx_status; lp->P1extraDim = 0; set_OF_p1extra(lp, 0); singular_count = 0; lost_feas_count = 0; lost_feas_state = FALSE; lp->simplex_mode = SIMPLEX_DYNAMIC; /* Compute the number of fixed basic and bounded variables (used in long duals) */ lp->fixedvars = 0; lp->boundedvars = 0; for(i = 1; i <= lp->rows; i++) { j = lp->var_basic[i]; if((j <= lp->rows) && is_fixedvar(lp, j)) lp->fixedvars++; if((lp->upbo[i] < lp->infinite) && (lp->upbo[i] > lp->epsprimal)) lp->boundedvars++; } for(; i <= lp->sum; i++){ if((lp->upbo[i] < lp->infinite) && (lp->upbo[i] > lp->epsprimal)) lp->boundedvars++; } #ifdef UseLongStepDualPhase1 allocINT(lp, &infeasibles, lp->columns + 1, FALSE); infeasibles[0] = 0; #endif /* Reinvert for initialization, if necessary */ isbb = (MYBOOL) ((MIP_count(lp) > 0) && (lp->bb_level > 1)); if(is_action(lp->spx_action, ACTION_REINVERT)) { if(isbb && (lp->bb_bounds->nodessolved == 0)) /* if(isbb && (lp->bb_basis->pivots == 0)) */ recompute_solution(lp, INITSOL_SHIFTZERO); else { i = my_if(is_action(lp->spx_action, ACTION_REBASE), INITSOL_SHIFTZERO, INITSOL_USEZERO); invert(lp, (MYBOOL) i, TRUE); } } else if(is_action(lp->spx_action, ACTION_REBASE)) recompute_solution(lp, INITSOL_SHIFTZERO); /* Optionally try to do bound flips to obtain dual feasibility */ if(is_action(lp->improve, IMPROVE_DUALFEAS) || (lp->rows == 0)) boundflip_count = &i; else boundflip_count = NULL; /* Loop for as long as is needed */ while(lp->spx_status == RUNNING) { /* Check for dual and primal feasibility */ dualfeasible = isbb || isDualFeasible(lp, lp->epsprimal, boundflip_count, infeasibles, &dualoffset); /* Recompute if the dual feasibility check included bound flips */ if(is_action(lp->spx_action, ACTION_RECOMPUTE)) recompute_solution(lp, INITSOL_USEZERO); primalfeasible = isPrimalFeasible(lp, lp->epsprimal, NULL, &primaloffset); if(userabort(lp, -1)) break; if(lp->spx_trace) { if(primalfeasible) report(lp, NORMAL, "Start at primal feasible basis\n"); else if(dualfeasible) report(lp, NORMAL, "Start at dual feasible basis\n"); else if(lost_feas_count > 0) report(lp, NORMAL, "Continuing at infeasible basis\n"); else report(lp, NORMAL, "Start at infeasible basis\n"); } /* Now do the simplex magic */ if(((lp->simplex_strategy & SIMPLEX_Phase1_DUAL) == 0) || ((MIP_count(lp) > 0) && (lp->total_iter == 0) && is_presolve(lp, PRESOLVE_REDUCEMIP))) { if(!lost_feas_state && primalfeasible && ((lp->simplex_strategy & SIMPLEX_Phase2_DUAL) > 0)) lp->spx_status = SWITCH_TO_DUAL; else primloop(lp, primalfeasible, 0.0); if(lp->spx_status == SWITCH_TO_DUAL) dualloop(lp, TRUE, NULL, 0.0); } else { if(!lost_feas_state && primalfeasible && ((lp->simplex_strategy & SIMPLEX_Phase2_PRIMAL) > 0)) lp->spx_status = SWITCH_TO_PRIMAL; else dualloop(lp, dualfeasible, infeasibles, dualoffset); if(lp->spx_status == SWITCH_TO_PRIMAL) primloop(lp, TRUE, 0.0); } /* Check for simplex outcomes that always involve breaking out of the loop; this includes optimality, unboundedness, pure infeasibility (i.e. not loss of feasibility), numerical failure and perturbation-based degeneracy handling */ i = lp->spx_status; primalfeasible = (MYBOOL) (i == OPTIMAL); if(primalfeasible || (i == UNBOUNDED)) break; else if(((i == INFEASIBLE) && is_anti_degen(lp, ANTIDEGEN_INFEASIBLE)) || ((i == LOSTFEAS) && is_anti_degen(lp, ANTIDEGEN_LOSTFEAS)) || ((i == NUMFAILURE) && is_anti_degen(lp, ANTIDEGEN_NUMFAILURE)) || ((i == DEGENERATE) && is_anti_degen(lp, ANTIDEGEN_STALLING))) { /* Check if we should not loop here, but do perturbations */ if((lp->bb_level <= 1) || is_anti_degen(lp, ANTIDEGEN_DURINGBB)) break; /* Assume that accuracy during B&B is high and that infeasibility is "real" */ #ifdef AssumeHighAccuracyInBB if((lp->bb_level > 1) && (i == INFEASIBLE)) break; #endif } /* Check for outcomes that may involve trying another simplex loop */ if(lp->spx_status == SINGULAR_BASIS) { lost_feas_state = FALSE; singular_count++; if(singular_count >= DEF_MAXSINGULARITIES) { report(lp, IMPORTANT, "spx_run: Failure due to too many singular bases.\n"); lp->spx_status = NUMFAILURE; break; } if(lp->spx_trace || (lp->verbose > DETAILED)) report(lp, NORMAL, "spx_run: Singular basis; attempting to recover.\n"); lp->spx_status = RUNNING; /* Singular pivots are simply skipped by the inversion, leaving a row's slack variable in the basis instead of the singular user variable. */ } else { lost_feas_state = (MYBOOL) (lp->spx_status == LOSTFEAS); #if 0 /* Optionally handle loss of numerical accuracy as loss of feasibility, but only attempt a single loop to try to recover from this. */ lost_feas_state |= (MYBOOL) ((lp->spx_status == NUMFAILURE) && (lost_feas_count < 1)); #endif if(lost_feas_state) { lost_feas_count++; if(lost_feas_count < DEF_MAXSINGULARITIES) { report(lp, DETAILED, "spx_run: Recover lost feasibility at iter %10.0f.\n", (double) get_total_iter(lp)); lp->spx_status = RUNNING; } else { report(lp, IMPORTANT, "spx_run: Lost feasibility %d times - iter %10.0f and %9.0f nodes.\n", lost_feas_count, (double) get_total_iter(lp), (double) lp->bb_totalnodes); lp->spx_status = NUMFAILURE; } } } } /* Update iteration tallies before returning */ lp->total_iter += lp->current_iter; lp->current_iter = 0; lp->total_bswap += lp->current_bswap; lp->current_bswap = 0; FREE(infeasibles); return(lp->spx_status); } /* spx_run */ lprec *make_lag(lprec *lpserver) { int i; lprec *hlp; MYBOOL ret; REAL *duals; /* Create a Lagrangean solver instance */ hlp = make_lp(0, lpserver->columns); if(hlp != NULL) { /* First create and core variable data */ set_sense(hlp, is_maxim(lpserver)); hlp->lag_bound = lpserver->bb_limitOF; for(i = 1; i <= lpserver->columns; i++) { set_mat(hlp, 0, i, get_mat(lpserver, 0, i)); if(is_binary(lpserver, i)) set_binary(hlp, i, TRUE); else { set_int(hlp, i, is_int(lpserver, i)); set_bounds(hlp, i, get_lowbo(lpserver, i), get_upbo(lpserver, i)); } } /* Then fill data for the Lagrangean constraints */ hlp->matL = lpserver->matA; inc_lag_space(hlp, lpserver->rows, TRUE); ret = get_ptr_sensitivity_rhs(hlp, &duals, NULL, NULL); for(i = 1; i <= lpserver->rows; i++) { hlp->lag_con_type[i] = get_constr_type(lpserver, i); hlp->lag_rhs[i] = lpserver->orig_rhs[i]; hlp->lambda[i] = (ret) ? duals[i - 1] : 0.0; } } return(hlp); } STATIC int heuristics(lprec *lp, int mode) /* Initialize / bound a MIP problem */ { lprec *hlp; int status = PROCFAIL; if(lp->bb_level > 1) return( status ); status = RUNNING; lp->bb_limitOF = my_chsign(is_maxim(lp), -lp->infinite); if(FALSE && (lp->int_vars > 0)) { /* 1. Copy the problem into a new relaxed instance, extracting Lagrangean constraints */ hlp = make_lag(lp); /* 2. Run the Lagrangean relaxation */ status = solve(hlp); /* 3. Copy the key results (bound) into the original problem */ lp->bb_heuristicOF = hlp->best_solution[0]; /* 4. Delete the helper heuristic */ hlp->matL = NULL; delete_lp(hlp); } lp->timeheuristic = timeNow(); return( status ); } STATIC int lag_solve(lprec *lp, REAL start_bound, int num_iter) { int i, j, citer, nochange, oldpresolve; MYBOOL LagFeas, AnyFeas, Converged, same_basis; REAL *OrigObj, *ModObj, *SubGrad, *BestFeasSol; REAL Zub, Zlb, Znow, Zprev, Zbest, rhsmod, hold; REAL Phi, StepSize = 0.0, SqrsumSubGrad; /* Make sure we have something to work with */ if(lp->spx_status != OPTIMAL) { lp->lag_status = NOTRUN; return( lp->lag_status ); } /* Allocate iteration arrays */ if(!allocREAL(lp, &OrigObj, lp->columns + 1, FALSE) || !allocREAL(lp, &ModObj, lp->columns + 1, TRUE) || !allocREAL(lp, &SubGrad, get_Lrows(lp) + 1, TRUE) || !allocREAL(lp, &BestFeasSol, lp->sum + 1, TRUE)) { lp->lag_status = NOMEMORY; return( lp->lag_status ); } lp->lag_status = RUNNING; /* Prepare for Lagrangean iterations using results from relaxed problem */ oldpresolve = lp->do_presolve; lp->do_presolve = PRESOLVE_NONE; push_basis(lp, NULL, NULL, NULL); /* Initialize variables (assume minimization problem in overall structure) */ Zlb = lp->best_solution[0]; Zub = start_bound; Zbest = Zub; Znow = Zlb; Zprev = lp->infinite; rhsmod = 0; Phi = DEF_LAGCONTRACT; /* In the range 0-2.0 to guarantee convergence */ /* Phi = 0.15; */ LagFeas = FALSE; Converged= FALSE; AnyFeas = FALSE; citer = 0; nochange = 0; /* Initialize reference and solution vectors; don't bother about the original OF offset since we are maintaining an offset locally. */ /* #define DirectOverrideOF */ get_row(lp, 0, OrigObj); #ifdef DirectOverrideOF set_OF_override(lp, ModObj); #endif OrigObj[0] = get_rh(lp, 0); for(i = 1 ; i <= get_Lrows(lp); i++) lp->lambda[i] = 0; /* Iterate to convergence, failure or user-specified termination */ while((lp->lag_status == RUNNING) && (citer < num_iter)) { citer++; /* Compute constraint feasibility gaps and associated sum of squares, and determine feasibility over the Lagrangean constraints; SubGrad is the subgradient, which here is identical to the slack. */ LagFeas = TRUE; Converged = TRUE; SqrsumSubGrad = 0; for(i = 1; i <= get_Lrows(lp); i++) { hold = lp->lag_rhs[i]; for(j = 1; j <= lp->columns; j++) hold -= mat_getitem(lp->matL, i, j) * lp->best_solution[lp->rows + j]; if(LagFeas) { if(lp->lag_con_type[i] == EQ) { if(fabs(hold) > lp->epsprimal) LagFeas = FALSE; } else if(hold < -lp->epsprimal) LagFeas = FALSE; } /* Test for convergence and update */ if(Converged && (fabs(my_reldiff(hold , SubGrad[i])) > lp->lag_accept)) Converged = FALSE; SubGrad[i] = hold; SqrsumSubGrad += hold * hold; } SqrsumSubGrad = sqrt(SqrsumSubGrad); #if 1 Converged &= LagFeas; #endif if(Converged) break; /* Modify step parameters and initialize ahead of next iteration */ Znow = lp->best_solution[0] - rhsmod; if(Znow > Zub) { /* Handle exceptional case where we overshoot */ Phi *= DEF_LAGCONTRACT; StepSize *= (Zub-Zlb) / (Znow-Zlb); } else #define LagBasisContract #ifdef LagBasisContract /* StepSize = Phi * (Zub - Znow) / SqrsumSubGrad; */ StepSize = Phi * (2-DEF_LAGCONTRACT) * (Zub - Znow) / SqrsumSubGrad; #else StepSize = Phi * (Zub - Znow) / SqrsumSubGrad; #endif /* Compute the new dual price vector (Lagrangean multipliers, lambda) */ for(i = 1; i <= get_Lrows(lp); i++) { lp->lambda[i] += StepSize * SubGrad[i]; if((lp->lag_con_type[i] != EQ) && (lp->lambda[i] > 0)) { /* Handle case where we overshoot and need to correct (see above) */ if(Znow < Zub) lp->lambda[i] = 0; } } /* normalizeVector(lp->lambda, get_Lrows(lp)); */ /* Save the current vector if it is better */ if(LagFeas && (Znow < Zbest)) { /* Recompute the objective function value in terms of the original values */ MEMCOPY(BestFeasSol, lp->best_solution, lp->sum+1); hold = OrigObj[0]; for(i = 1; i <= lp->columns; i++) hold += lp->best_solution[lp->rows + i] * OrigObj[i]; BestFeasSol[0] = hold; if(lp->lag_trace) report(lp, NORMAL, "lag_solve: Improved feasible solution at iteration %d of %g\n", citer, hold); /* Reset variables */ Zbest = Znow; AnyFeas = TRUE; nochange = 0; } else if(Znow == Zprev) { nochange++; if(nochange > LAG_SINGULARLIMIT) { Phi *= 0.5; nochange = 0; } } Zprev = Znow; /* Recompute the objective function values for the next iteration */ for(j = 1; j <= lp->columns; j++) { hold = 0; for(i = 1; i <= get_Lrows(lp); i++) hold += lp->lambda[i] * mat_getitem(lp->matL, i, j); ModObj[j] = OrigObj[j] - my_chsign(is_maxim(lp), hold); #ifndef DirectOverrideOF set_mat(lp, 0, j, ModObj[j]); #endif } /* Recompute the fixed part of the new objective function */ rhsmod = my_chsign(is_maxim(lp), get_rh(lp, 0)); for(i = 1; i <= get_Lrows(lp); i++) rhsmod += lp->lambda[i] * lp->lag_rhs[i]; /* Print trace/debugging information, if specified */ if(lp->lag_trace) { report(lp, IMPORTANT, "Zub: %10g Zlb: %10g Stepsize: %10g Phi: %10g Feas %d\n", (double) Zub, (double) Zlb, (double) StepSize, (double) Phi, LagFeas); for(i = 1; i <= get_Lrows(lp); i++) report(lp, IMPORTANT, "%3d SubGrad %10g lambda %10g\n", i, (double) SubGrad[i], (double) lp->lambda[i]); if(lp->sum < 20) print_lp(lp); } /* Solve the Lagrangean relaxation, handle failures and compute the Lagrangean objective value, if successful */ i = spx_solve(lp); if(lp->spx_status == UNBOUNDED) { if(lp->lag_trace) { report(lp, NORMAL, "lag_solve: Unbounded solution encountered with this OF:\n"); for(i = 1; i <= lp->columns; i++) report(lp, NORMAL, RESULTVALUEMASK " ", (double) ModObj[i]); } goto Leave; } else if((lp->spx_status == NUMFAILURE) || (lp->spx_status == PROCFAIL) || (lp->spx_status == USERABORT) || (lp->spx_status == TIMEOUT) || (lp->spx_status == INFEASIBLE)) { lp->lag_status = lp->spx_status; } /* Compare optimal bases and contract if we have basis stationarity */ #ifdef LagBasisContract same_basis = compare_basis(lp); if(LagFeas && !same_basis) { pop_basis(lp, FALSE); push_basis(lp, NULL, NULL, NULL); Phi *= DEF_LAGCONTRACT; } if(lp->lag_trace) { report(lp, DETAILED, "lag_solve: Simplex status code %d, same basis %s\n", lp->spx_status, my_boolstr(same_basis)); print_solution(lp, 1); } #endif } /* Transfer solution values */ if(AnyFeas) { lp->lag_bound = my_chsign(is_maxim(lp), Zbest); for(i = 0; i <= lp->sum; i++) lp->solution[i] = BestFeasSol[i]; transfer_solution(lp, TRUE); if(!is_maxim(lp)) for(i = 1; i <= get_Lrows(lp); i++) lp->lambda[i] = my_flipsign(lp->lambda[i]); } /* Do standard postprocessing */ Leave: /* Set status variables and report */ if(citer >= num_iter) { if(AnyFeas) lp->lag_status = FEASFOUND; else lp->lag_status = NOFEASFOUND; } else lp->lag_status = lp->spx_status; if(lp->lag_status == OPTIMAL) { report(lp, NORMAL, "\nLagrangean convergence achieved in %d iterations\n", citer); i = check_solution(lp, lp->columns, lp->best_solution, lp->orig_upbo, lp->orig_lowbo, lp->epssolution); } else { report(lp, NORMAL, "\nUnsatisfactory convergence achieved over %d Lagrangean iterations.\n", citer); if(AnyFeas) report(lp, NORMAL, "The best feasible Lagrangean objective function value was %g\n", lp->best_solution[0]); } /* Restore the original objective function */ #ifdef DirectOverrideOF set_OF_override(lp, NULL); #else for(i = 1; i <= lp->columns; i++) set_mat(lp, 0, i, OrigObj[i]); #endif /* ... and then free memory */ FREE(BestFeasSol); FREE(SubGrad); FREE(OrigObj); FREE(ModObj); pop_basis(lp, FALSE); lp->do_presolve = oldpresolve; return( lp->lag_status ); } STATIC int spx_solve(lprec *lp) { int status; MYBOOL iprocessed; lp->total_iter = 0; lp->total_bswap = 0; lp->perturb_count = 0; lp->bb_maxlevel = 1; lp->bb_totalnodes = 0; lp->bb_improvements = 0; lp->bb_strongbranches= 0; lp->is_strongbranch = FALSE; lp->bb_level = 0; lp->bb_solutionlevel = 0; lp->best_solution[0] = my_chsign(is_maxim(lp), lp->infinite); if(lp->invB != NULL) lp->bfp_restart(lp); lp->spx_status = presolve(lp); if(lp->spx_status == PRESOLVED) { status = lp->spx_status; goto Reconstruct; } else if(lp->spx_status != RUNNING) goto Leave; iprocessed = !lp->wasPreprocessed; if(!preprocess(lp) || userabort(lp, -1)) goto Leave; if(mat_validate(lp->matA)) { /* Do standard initializations */ lp->solutioncount = 0; lp->real_solution = lp->infinite; set_action(&lp->spx_action, ACTION_REBASE | ACTION_REINVERT); lp->bb_break = FALSE; /* Do the call to the real underlying solver (note that run_BB is replaceable with any compatible MIP solver) */ status = run_BB(lp); /* Restore modified problem */ if(iprocessed) postprocess(lp); /* Restore data related to presolve (mainly a placeholder as of v5.1) */ Reconstruct: if(!postsolve(lp, status)) report(lp, SEVERE, "spx_solve: Failure during postsolve.\n"); goto Leave; } /* If we get here, mat_validate(lp) failed. */ if(lp->bb_trace || lp->spx_trace) report(lp, CRITICAL, "spx_solve: The current LP seems to be invalid\n"); lp->spx_status = NUMFAILURE; Leave: lp->timeend = timeNow(); if((lp->lag_status != RUNNING) && (lp->invB != NULL)) { int itemp; REAL test; itemp = lp->bfp_nonzeros(lp, TRUE); test = 100; if(lp->total_iter > 0) test *= (REAL) lp->total_bswap/lp->total_iter; report(lp, NORMAL, "\n "); report(lp, NORMAL, "MEMO: lp_solve version %d.%d.%d.%d for %d bit OS, with %d bit REAL variables.\n", MAJORVERSION, MINORVERSION, RELEASE, BUILD, 8*sizeof(void *), 8*sizeof(REAL)); report(lp, NORMAL, " In the total iteration count %.0f, %.0f (%.1f%%) were bound flips.\n", (double) lp->total_iter, (double) lp->total_bswap, test); report(lp, NORMAL, " There were %d refactorizations, %d triggered by time and %d by density.\n", lp->bfp_refactcount(lp, BFP_STAT_REFACT_TOTAL), lp->bfp_refactcount(lp, BFP_STAT_REFACT_TIMED), lp->bfp_refactcount(lp, BFP_STAT_REFACT_DENSE)); report(lp, NORMAL, " ... on average %.1f major pivots per refactorization.\n", get_refactfrequency(lp, TRUE)); report(lp, NORMAL, " The largest [%s] fact(B) had %d NZ entries, %.1fx largest basis.\n", lp->bfp_name(), itemp, lp->bfp_efficiency(lp)); if(lp->perturb_count > 0) report(lp, NORMAL, " The bounds were relaxed via perturbations %d times.\n", lp->perturb_count); if(MIP_count(lp) > 0) { if(lp->bb_solutionlevel > 0) report(lp, NORMAL, " The maximum B&B level was %d, %.1fx MIP order, %d at the optimal solution.\n", lp->bb_maxlevel, (double) lp->bb_maxlevel / (MIP_count(lp)+lp->int_vars), lp->bb_solutionlevel); else report(lp, NORMAL, " The maximum B&B level was %d, %.1fx MIP order, with %.0f nodes explored.\n", lp->bb_maxlevel, (double) lp->bb_maxlevel / (MIP_count(lp)+lp->int_vars), (double) get_total_nodes(lp)); if(GUB_count(lp) > 0) report(lp, NORMAL, " %d general upper-bounded (GUB) structures were employed during B&B.\n", GUB_count(lp)); } report(lp, NORMAL, " The constraint matrix inf-norm is %g, with a dynamic range of %g.\n", lp->matA->infnorm, lp->matA->dynrange); report(lp, NORMAL, " Time to load data was %.3f seconds, presolve used %.3f seconds,\n", lp->timestart-lp->timecreate, lp->timepresolved-lp->timestart); report(lp, NORMAL, " ... %.3f seconds in simplex solver, in total %.3f seconds.\n", lp->timeend-lp->timepresolved, lp->timeend-lp->timecreate); } return( lp->spx_status ); } /* spx_solve */ int lin_solve(lprec *lp) { int status = NOTRUN; /* Don't do anything in case of an empty model */ lp->lag_status = NOTRUN; /* if(get_nonzeros(lp) == 0) { */ if(lp->columns == 0) { default_basis(lp); lp->spx_status = NOTRUN; return( /* OPTIMAL */ lp->spx_status); } /* Otherwise reset selected arrays before solving */ unset_OF_p1extra(lp); free_duals(lp); FREE(lp->drow); FREE(lp->nzdrow); if(lp->bb_cuttype != NULL) freecuts_BB(lp); /* Reset/initialize timers */ lp->timestart = timeNow(); lp->timeheuristic = 0; lp->timepresolved = 0; lp->timeend = 0; /* Do heuristics ahead of solving the model */ if(heuristics(lp, AUTOMATIC) != RUNNING) return( INFEASIBLE ); /* Solve the full, prepared model */ status = spx_solve(lp); if((get_Lrows(lp) > 0) && (lp->lag_status == NOTRUN)) { if(status == OPTIMAL) status = lag_solve(lp, lp->bb_heuristicOF, DEF_LAGMAXITERATIONS); else report(lp, IMPORTANT, "\nCannot do Lagrangean optimization since root model was not solved.\n"); } /* Reset heuristic in preparation for next run (if any) */ lp->bb_heuristicOF = my_chsign(is_maxim(lp), lp->infinite); /* Check that correct status code is returned */ /* peno 26.12.07 status was not set to SUBOPTIMAL, only lp->spx_status Bug occured by a change in 5.5.0.10 when && (lp->bb_totalnodes > 0) was added added status = See UnitTest3 */ /* peno 12.01.08 If an integer solution is found with the same objective value as the relaxed solution then searching is stopped. This by setting lp->bb_break. However this resulted in a report of SUBOPTIMAL solution. For this, && !bb_better(lp, OF_DUALLIMIT, OF_TEST_BE) is added in the test. See UnitTest20 */ if((lp->spx_status == OPTIMAL) && (lp->bb_totalnodes > 0)) { if((lp->bb_break && !bb_better(lp, OF_DUALLIMIT, OF_TEST_BE)) /* || ISMASKSET(lp->trace, TRACE_NOBBLIMIT) */) status = lp->spx_status = SUBOPTIMAL; } return( status ); } lp_solve_5.5/lp_simplex.h100666 0 0 2041 11141374252 14061 0ustar usergroup#ifndef HEADER_lp_simplex #define HEADER_lp_simplex #include "lp_types.h" #define ForceDualSimplexInBB /* Force use/switch of dual simplex in B&B */ #define AssumeHighAccuracyInBB /* No iteration of simplex solves at infeasibility */ /*#define UseLongStepPruning*/ /*#define UseLongStepDualPhase1*/ #define primal_UseRejectionList #define dual_UseRejectionList #define dual_RemoveBasicFixedVars /*#define dual_Phase1PriceEqualities */ /* Force elimination of equality slacks */ #define AcceptMarginalAccuracy #ifdef __cplusplus extern "C" { #endif /* Put function headers here */ STATIC int primloop(lprec *lp, MYBOOL primalfeasible, REAL primaloffset); STATIC int dualloop(lprec *lp, MYBOOL dualfeasible, int dualinfeasibles[], REAL dualoffset); STATIC int spx_run(lprec *lp, MYBOOL validInvB); STATIC int spx_solve(lprec *lp); STATIC int lag_solve(lprec *lp, REAL start_bound, int num_iter); STATIC int heuristics(lprec *lp, int mode); STATIC int lin_solve(lprec *lp); #ifdef __cplusplus } #endif #endif /* HEADER_lp_simplex */ lp_solve_5.5/lp_solve/ 40777 0 0 0 11254510404 13261 5ustar usergrouplp_solve_5.5/lp_solve/cbcc32.bat100777 0 0 1665 11137720110 15115 0ustar usergroup@echo off REM This batch file compiles the lp_solve driver program with the Borland C++ 5.5 compiler for Windows set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c set c=bcc32 -w-8004 -w-8057 rem -DLLONG=__int64 set PLATFORM=win32 if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -a8 -DWIN32 -DYY_NEVER_INTERACTIVE=1 -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -ebin\%PLATFORM%\lp_solve.exe %src% if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/lp_solve/ccc100666 0 0 3024 11137130707 14034 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("ux%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 math=-lm #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 opts='-O3' def= if [ "$PLATFORM" = "SCO_UNIX" ] then opts='-O0' def='-dy -K PIC -DLLONG=long' dl=-ldl else dl=-ldl fi $c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl lp_solve_5.5/lp_solve/ccc.osx100666 0 0 2750 11137130715 14650 0ustar usergroup: src='../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../fortify.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c' c=cc #determine platform (32/64 bit) >/tmp/platform.c echo '#include '>>/tmp/platform.c echo '#include '>>/tmp/platform.c echo 'main(){printf("osx%d", (int) (sizeof(void *)*8));}'>>/tmp/platform.c $c /tmp/platform.c -o /tmp/platform PLATFORM=`/tmp/platform` rm /tmp/platform /tmp/platform.c >/dev/null 2>&1 mkdir bin bin/$PLATFORM >/dev/null 2>&1 math=-lm #check if this system has the isnan function >/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo '#include '>>/tmp/isnan.c echo 'main(){isnan(0);}'>>/tmp/isnan.c $c /tmp/isnan.c -o /tmp/isnan $math >/dev/null 2>&1 if [ $? = 0 ] then NOISNAN= else NOISNAN=-DNOISNAN fi rm /tmp/isnan.c /tmp/isnan >/dev/null 2>&1 def= dl=-ldl opts='-idirafter /usr/include/sys -O3 -DINTEGERTIME -Wno-long-double' $c -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared $opts $def $NOISNAN -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine $src -o bin/$PLATFORM/lp_solve $math $dl lp_solve_5.5/lp_solve/cgcc.bat100777 0 0 2177 11245571700 14765 0ustar usergroup@echo off REM This batch file compiles the lp_solve driver program with the GNU gcc compiler under Windows set c=gcc REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% platform.c -o platform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../lp_MDO.c ../shared/commonlib.c ../colamd/colamd.c ../shared/mmio.c ../shared/myblas.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ..\ini.c ..\lp_params.c %c% -DINLINE=static -Wall -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared -O3 -DBFP_CALLMODEL=__stdcall -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine %src% -o bin\%PLATFORM%\lp_solve.exe set PLATFORM= lp_solve_5.5/lp_solve/cvc6.bat100777 0 0 2644 11136446016 14726 0ustar usergroup@echo off REM This batch file compiles the lp_solve driver program with the Microsoft Visual C/C++ compiler under Windows set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c %1 set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if "%PLATFORM%" == "win32" goto ok1 echo. echo This batch file is entended for 32 bit compilation with MS Visual C 6 echo For newer versions use cvc8*.bat goto done :ok1 if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O2 /Zp8 /Gd -D"LP_MAXLINELEN=0" -DNoParanoia -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -Febin\%PLATFORM%\lp_solve.exe %src% if exist *.obj del *.obj :done set PLATFORM= lp_solve_5.5/lp_solve/cvc6d.bat100777 0 0 31 10413041622 15005 0ustar usergroupcall cvc6 -DParanoia %1 lp_solve_5.5/lp_solve/cvc8.bat100777 0 0 2443 11136446025 14725 0ustar usergroup@echo off REM This batch file compiles the lp_solve driver program with the Microsoft Visual C/C++ compiler under Windows set c=cl REM determine platform (win32/win64) echo main(){printf("SET PLATFORM=win%%d\n", (int) (sizeof(void *)*8));}>platform.c %c% /nologo platform.c /Feplatform.exe del platform.c platform.exe >platform.bat del platform.exe call platform.bat del platform.bat if not exist bin\%PLATFORM%\*.* md bin\%PLATFORM% set src=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c %1 %c% -I.. -I../bfp -I../bfp/bfp_LUSOL -I../bfp/bfp_LUSOL/LUSOL -I../colamd -I../shared /O1 /Zp8 /Gd -D"LP_MAXLINELEN=0" -DNoParanoia -DWIN32 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine -Febin\%PLATFORM%\lp_solve.exe %src% editbin /LARGEADDRESSAWARE bin\%PLATFORM%\lp_solve.exe if exist *.obj del *.obj set PLATFORM= lp_solve_5.5/lp_solve/lp_solve.c100666 0 0 143136 11252255034 15420 0ustar usergroup#include #include #include #include #include #include "lp_lib.h" #ifdef FORTIFY # include "lp_fortify.h" #endif #define filetypeLP 1 #define filetypeMPS 2 #define filetypeFREEMPS 3 #define filetypeCPLEX 4 #define filetypeXLI 5 #define FORCED_EXIT 255 int EndOfPgr(int i) { # if defined FORTIFY Fortify_LeaveScope(); # endif exit(i); return(0); } void SIGABRT_func(int sig) { EndOfPgr(FORCED_EXIT); } void print_help(char *argv[]) { printf("Usage of %s version %d.%d.%d.%d:\n", argv[0], MAJORVERSION, MINORVERSION, RELEASE, BUILD); printf("%s [options] [[<]input_file]\n", argv[0]); printf("List of options:\n"); printf("-h\t\tprints this message\n"); #if defined PARSER_LP printf("-lp\t\tread from LP file (default)\n"); #endif printf("-mps\t\tread from MPS file, default in fixed format\n"); printf("-mps_free\t\tuse free format\n"); printf("-mps_ibm\t\tinterprete integers accoring to ibm format\n"); printf("-mps_negobjconst\tnegate objective constant\n"); printf("-fmps\t\tread from MPS file in free format\n"); printf("-rpar filename\tread parameters from filename.\n"); printf("-rparopt options\n\t\toptions for parameter file:\n"); printf("\t\t -H headername: header name for parameters. By default 'Default'\n"); printf("-rxli xliname filename\n\t\tread file with xli library\n"); printf("-rxlidata datafilename\n\t\tdata file name for xli library.\n"); printf("-rxliopt options\n\t\toptions for xli library.\n"); printf("-rbas filename\tread basis from filename.\n"); printf("-gbas filename\tguess basis with variables from filename.\n"); printf("-plp\t\tprint model.\n"); printf("-wlp filename\twrite to LP file\n"); printf("-wmps filename\twrite to MPS file in fixed format\n"); printf("-wfmps filename\twrite to MPS file in free format\n"); printf("-wxli xliname filename\n\t\twrite file with xli library\n"); printf("-wxliopt options\n\t\toptions for xli library.\n"); printf("-wxlisol xliname filename\n\t\twrite solution file with xli library\n"); printf("-wxlisolopt options\n\t\toptions for xli library.\n"); printf("-wbas filename\twrite basis to filename.\n"); printf("-wpar filename\twrite parameters to filename.\n"); printf("-wparopt options\n\t\toptions for parameter file:\n"); printf("\t\t -H headername: header name for parameters. By default 'Default'\n"); printf("-wafter\t\tWrite model after solve (useful if presolve used).\n"); printf("-parse_only\tparse input file but do not solve\n"); printf("-nonames\tIgnore variables and constraint names\n"); printf("-norownames\tIgnore constraint names\n"); printf("-nocolnames\tIgnore variable names\n"); printf("\n"); printf("-min\t\tMinimize the lp problem (overrules setting in file)\n"); printf("-max\t\tMaximize the lp problem (overrules setting in file)\n"); printf("-r \tspecify max nbr of pivots between a re-inversion of the matrix\n"); printf("-piv \tspecify simplex pivot rule\n"); printf("\t -piv0: Select first\n"); printf("\t -piv1: Select according to Dantzig\n"); printf("\t -piv2: Select Devex pricing from Paula Harris (default)\n"); printf("\t -piv3: Select steepest edge\n"); printf("These pivot rules can be combined with any of the following:\n"); printf("-pivf\t\tIn case of Steepest Edge, fall back to DEVEX in primal.\n"); printf("-pivm\t\tMultiple pricing.\n"); printf("-piva\t\tTemporarily use First Index if cycling is detected.\n"); printf("-pivr\t\tAdds a small randomization effect to the selected pricer.\n"); #if defined EnablePartialOptimization printf("-pivp\t\tEnable partial pricing.\n"); printf("-pivpc\t\tEnable partial pricing on columns.\n"); printf("-pivpr\t\tEnable partial pricing on rows.\n"); #endif printf("-pivll\t\tScan entering/leaving columns left rather than right.\n"); printf("-pivla\t\tScan entering/leaving columns alternatingly left/right.\n"); printf("-pivh\t\tUse Harris' primal pivot logic rather than the default.\n"); printf("-pivt\t\tUse true norms for Devex and Steepest Edge initializations.\n"); printf("-o0\t\tDon't put objective in basis%s.\n", DEF_OBJINBASIS ? "" : " (default)"); printf("-o1\t\tPut objective in basis%s.\n", DEF_OBJINBASIS ? " (default)" : ""); printf("-s \tuse automatic problem scaling.\n"); printf("\t -s0: No scaling\n"); printf("\t -s1: Geometric scaling (default)\n"); printf("\t -s2: Curtis-reid scaling\n"); printf("\t -s3: Scale to convergence using largest absolute value\n"); printf("\t -s:\n"); printf("\t -s4: Numerical range-based scaling\n"); printf("\t -s5: Scale to convergence using logarithmic mean of all values\n"); printf("\t -s6: Scale based on the simple numerical range\n"); printf("\t -s7: Scale quadratic\n"); printf("These scaling rules can be combined with any of the following:\n"); printf("-sp\t\talso do power scaling.\n"); printf("-si\t\talso do Integer scaling (default).\n"); printf("-se\t\talso do equilibration to scale to the -1..1 range (default).\n"); printf("-presolve\tpresolve problem before start optimizing (rows+columns)\n"); printf("-presolverow\tpresolve problem before start optimizing (rows only)\n"); printf("-presolvecol\tpresolve problem before start optimizing (columns only)\n"); printf("-presolvel\talso eliminate linearly dependent rows\n"); printf("-presolves\talso convert constraints to SOSes (only SOS1 handled)\n"); printf("-presolver\tIf the phase 1 solution process finds that a constraint is\n\t\tredundant then this constraint is deleted\n"); printf("-presolvek\tSimplification of knapsack-type constraints through\n\t\taddition of an extra variable, which also helps bound the OF\n"); printf("-presolveq\tDirect substitution of one variable in 2-element equality\n\t\tconstraints; this requires changes to the constraint matrix\n"); printf("-presolvem\tMerge rows\n"); printf("-presolvefd\tCOLFIXDUAL\n"); printf("-presolvebnd\tPresolve bounds\n"); printf("-presolved\tPresolve duals\n"); printf("-presolvef\tIdentify implied free variables (releasing their expl. bounds)\n"); printf("-presolveslk\tIMPLIEDSLK\n"); printf("-presolveg\tReduce (tighten) coef. in integer models based on GCD argument\n"); printf("-presolveb\tAttempt to fix binary variables at one of their bounds\n"); printf("-presolvec\tAttempt to reduce coefficients in binary models\n"); printf("-presolverowd\tIdenfify and delete qualifying constraints that\n\t\tare dominated by others, also fixes variables at a bound\n"); printf("-presolvecold\tDeletes variables (mainly binary), that are dominated\n\t\tby others (only one can be non-zero)\n"); printf("-C \tbasis crash mode\n"); printf("\t -C0: No crash basis\n"); printf("\t -C2: Most feasible basis\n"); printf("\t -C3: Least degenerate basis\n"); printf("-prim\t\tPrefer the primal simplex for both phases.\n"); printf("-dual\t\tPrefer the dual simplex for both phases.\n"); printf("-simplexpp\tSet Phase1 Primal, Phase2 Primal.\n"); printf("-simplexdp\tSet Phase1 Dual, Phase2 Primal.\n"); printf("-simplexpd\tSet Phase1 Primal, Phase2 Dual.\n"); printf("-simplexdd\tSet Phase1 Dual, Phase2 Dual.\n"); printf("-degen\t\tuse perturbations to reduce degeneracy,\n\t\tcan increase numerical instability\n"); printf("-degenc\t\tuse column check to reduce degeneracy\n"); printf("-degend\t\tdynamic check to reduce degeneracy\n"); printf("-degenf\t\tanti-degen fixedvars\n"); printf("-degens\t\tanti-degen stalling\n"); printf("-degenn\t\tanti-degen numfailure\n"); printf("-degenl\t\tanti-degen lostfeas\n"); printf("-degeni\t\tanti-degen infeasible\n"); printf("-degenb\t\tanti-degen B&B\n"); printf("-degenr\t\tanti-degen Perturbation of the working RHS at refactorization\n"); printf("-degenp\t\tanti-degen Limit bound flips\n"); printf("-trej \tset minimum pivot value\n"); printf("-epsd \tset minimum tolerance for reduced costs\n"); printf("-epsb \tset minimum tolerance for the RHS\n"); printf("-epsel \tset tolerance for rounding values to zero\n"); printf("-epsp \tset the value that is used as perturbation scalar for\n\t\tdegenerative problems\n"); printf("-improve \titerative improvement level\n"); printf("\t -improve0: none\n"); printf("\t -improve1: Running accuracy measurement of solved equations on Bx=r\n"); printf("\t -improve2: Improve initial dual feasibility by bound flips (default)\n"); printf("\t -improve4: Low-cost accuracy monitoring in the dual\n"); printf("\t -improve8: check for primal/dual feasibility at the node level\n"); printf("-timeout \tTimeout after sec seconds when not solution found.\n"); /* printf("-timeoutok\tIf timeout, take the best yet found solution.\n"); */ printf("-bfp \tSet basis factorization package.\n"); printf("\n"); printf("-noint\t\tIgnore integer restrictions\n"); printf("-e \tspecifies the tolerance which is used to determine whether a\n\t\tfloating point number is in fact an integer.\n\t\tShould be < 0.5\n"); printf("-g \n"); printf("-ga \tspecifies the absolute MIP gap for branch-and-bound.\n\t\tThis specifies the absolute allowed tolerance\n\t\ton the object function. Can result in faster solving times.\n"); printf("-gr \tspecifies the relative MIP gap for branch-and-bound.\n\t\tThis specifies the relative allowed tolerance\n\t\ton the object function. Can result in faster solving times.\n"); printf("-f\t\tspecifies that branch-and-bound algorithm stops at first found\n"); printf("\t\tsolution\n"); printf("-b \tspecify a lower bound for the objective function\n\t\tto the program. If close enough, may speed up the\n\t\tcalculations.\n"); printf("-o \tspecifies that branch-and-bound algorithm stops when objective\n"); printf("\t\tvalue is better than value\n"); printf("-c\n"); printf("-cc\t\tduring branch-and-bound, take the ceiling branch first\n"); printf("-cf\t\tduring branch-and-bound, take the floor branch first\n"); printf("-ca\t\tduring branch-and-bound, the algorithm chooses branch\n"); printf("-depth \tset branch-and-bound depth limit\n"); printf("-n \tspecify which solution number to return\n"); printf("-B \tspecify branch-and-bound rule\n"); printf("\t -B0: Select Lowest indexed non-integer column (default)\n"); printf("\t -B1: Selection based on distance from the current bounds\n"); printf("\t -B2: Selection based on the largest current bound\n"); printf("\t -B3: Selection based on largest fractional value\n"); printf("\t -B4: Simple, unweighted pseudo-cost of a variable\n"); printf("\t -B5: This is an extended pseudo-costing strategy based on minimizing\n\t the number of integer infeasibilities\n"); printf("\t -B6: This is an extended pseudo-costing strategy based on maximizing\n\t the normal pseudo-cost divided by the number of infeasibilities.\n\t Similar to (the reciprocal of) a cost/benefit ratio\n"); printf("These branch-and-bound rules can be combined with any of the following:\n"); printf("-Bw\t\tWeightReverse branch-and-bound\n"); printf("-Bb\t\tBranchReverse branch-and-bound\n"); printf("-Bg\t\tGreedy branch-and-bound\n"); printf("-Bp\t\tPseudoCost branch-and-bound\n"); printf("-Bf\t\tDepthFirst branch-and-bound\n"); printf("-Br\t\tRandomize branch-and-bound\n"); printf("-BG\t\tGubMode branch-and-bound\n"); printf("-Bd\t\tDynamic branch-and-bound\n"); printf("-Bs\t\tRestartMode branch-and-bound\n"); printf("-BB\t\tBreadthFirst branch-and-bound\n"); printf("-Bo\t\tOrder variables to improve branch-and-bound performance\n"); printf("-Bc\t\tDo bound tightening during B&B based of reduced cost info\n"); printf("-Bi\t\tInitialize pseudo-costs by strong branching\n"); printf("\n"); printf("-time\t\tPrint CPU time to parse input and to calculate result.\n"); printf("-v \tverbose mode, gives flow through the program.\n"); printf("\t\t if level not provided (-v) then -v4 (NORMAL) is taken.\n"); printf("\t -v0: NEUTRAL\n"); printf("\t -v1: CRITICAL\n"); printf("\t -v2: SEVERE\n"); printf("\t -v3: IMPORTANT (default)\n"); printf("\t -v4: NORMAL\n"); printf("\t -v5: DETAILED\n"); printf("\t -v6: FULL\n"); printf("-t\t\ttrace pivot selection\n"); printf("-d\t\tdebug mode, all intermediate results are printed,\n\t\tand the branch-and-bound decisions\n"); printf("-R\t\treport information while solving the model\n"); printf("-Db \tDo a generic readable data dump of key lp_solve model variables\n\t\tbefore solve.\n\t\tPrincipally for run difference and debugging purposes\n"); printf("-Da \tDo a generic readable data dump of key lp_solve model variables\n\t\tafter solve.\n\t\tPrincipally for run difference and debugging purposes\n"); printf("-i\t\tprint all intermediate valid solutions.\n\t\tCan give you useful solutions even if the total run time\n\t\tis too long\n"); printf("-ia\t\tprint all intermediate (only non-zero values) valid solutions.\n\t\tCan give you useful solutions even if the total run time\n\t\tis too long\n"); printf("-stat\t\tPrint model statistics\n"); printf("-S \tPrint solution. If detail omitted, then -S2 is used.\n"); printf("\t -S0: Print nothing\n"); printf("\t -S1: Only objective value\n"); printf("\t -S2: Obj value+variables (default)\n"); printf("\t -S3: Obj value+variables+constraints\n"); printf("\t -S4: Obj value+variables+constraints+duals\n"); printf("\t -S5: Obj value+variables+constraints+duals+lp model\n"); printf("\t -S6: Obj value+variables+constraints+duals+lp model+scales\n"); printf("\t -S7: Obj value+variables+constraints+duals+lp model+scales+lp tableau\n"); } void print_cpu_times(const char *info) { static clock_t last_time = 0; clock_t new_time; new_time = clock(); fprintf(stderr, "CPU Time for %s: %gs (%gs total since program start)\n", info, (new_time - last_time) / (double) CLOCKS_PER_SEC, new_time / (double) CLOCKS_PER_SEC); last_time = new_time; } #if 0 int myabortfunc(lprec *lp, void *aborthandle) { /* printf("%f\n",lp->rhs[0]*(lp->maximise ? 1 : -1)); */ return(0); } #endif static MYBOOL isNum(char *val) { int ord; char *pointer; ord = strtol(val, &pointer, 10); return(*pointer == 0); } static void DoReport(lprec *lp, char *str) { fprintf(stderr, "%s %6.1fsec %8g\n", str, time_elapsed(lp), get_working_objective(lp)); } static void __WINAPI LPMessageCB(lprec *lp, void *USERHANDLE, int msg) { if(msg==MSG_LPFEASIBLE) DoReport(lp, "Feasible solution "); else if(msg==MSG_LPOPTIMAL) DoReport(lp, "Real solution "); else if(msg==MSG_MILPFEASIBLE) DoReport(lp, "First MILP "); else if(msg==MSG_MILPBETTER) DoReport(lp, "Improved MILP "); } void write_model(lprec *lp, char plp, char *wlp, char *wmps, char *wfmps, char *wxli, char *wxlisol, char *wxliname, char *wxlioptions) { if(plp) print_lp(lp); if(wlp != NULL) write_lp(lp, wlp); if(wmps != NULL) write_mps(lp, wmps); if(wfmps != NULL) write_freemps(lp, wfmps); if((wxliname != NULL) && (wxli != NULL)) { if(!set_XLI(lp, wxliname)) { fprintf(stderr, "Unable to set XLI library (%s).\n", wxliname); EndOfPgr(FORCED_EXIT); } write_XLI(lp, wxli, wxlioptions, FALSE); set_XLI(lp, NULL); } if((wxliname != NULL) && (wxlisol != NULL)) { if(!set_XLI(lp, wxliname)) { fprintf(stderr, "Unable to set XLI library (%s).\n", wxliname); EndOfPgr(FORCED_EXIT); } write_XLI(lp, wxlisol, wxlioptions, TRUE); set_XLI(lp, NULL); } } static void or_value(int *value, int orvalue) { if(*value == -1) *value = 0; *value |= orvalue; } static void set_value(int *value, int orvalue) { *value = orvalue; } #define nstats 5 static void minmax1(REAL value0, REAL factor, REAL *minmax, int *nminmax, int row, int *rowminmax, int col, int *colminmax) { int i, n; REAL value; if (value0 == 0) return; value = fabs(value0) * factor; for (i = 0; (i < *nminmax) && (value <= fabs(minmax[i]) * factor); i++) if (value == fabs(minmax[i]) * factor) return; if (i >= nstats) return; n = *nminmax; if (n == nstats) n--; memmove(minmax + i + 1, minmax + i, (n - i) * sizeof(*minmax)); minmax[i] = value0; if (rowminmax != NULL) { memmove(rowminmax + i + 1, rowminmax + i, (n - i) * sizeof(*rowminmax)); rowminmax[i] = row; } if (colminmax != NULL) { memmove(colminmax + i + 1, colminmax + i, (n - i) * sizeof(*colminmax)); colminmax[i] = col; } if (*nminmax < nstats) (*nminmax)++; } static void minmax(REAL value, REAL *minima, REAL *maxima, int *nminima, int *nmaxima, int row, int *rowmin, int *rowmax, int col, int *colmin, int *colmax) { minmax1(value, -1.0, minima, nminima, row, rowmin, col, colmin); minmax1(value, +1.0, maxima, nmaxima, row, rowmax, col, colmax); } /* static void printminmax1(lprec *lp, char *s, REAL *minmax, int nminmax, int *rowminmax, int *colminmax) { int i; for (i = 0; i < nminmax; i++) { printf(" %s(", s); if (rowminmax != NULL) printf("%s", get_row_name(lp, rowminmax[i])); if ((rowminmax != NULL) && (colminmax != NULL)) printf(", "); if (colminmax != NULL) printf("%s", get_col_name(lp, colminmax[i])); printf(") = %.8f\n", minmax[i]); } } static void printminmax(lprec *lp, char *s, REAL *minima, REAL *maxima, int nminima, int nmaxima, int *rowmin, int *rowmax, int *colmin, int *colmax) { printf("Minima:\n"); printminmax1(lp, s, minima, nminima, rowmin, colmin); printf("Maxima:\n"); printminmax1(lp, s, maxima, nmaxima, rowmax, colmax); } */ static void printminmax(lprec *lp, char *s, REAL *minima, REAL *maxima, int nminima, int nmaxima, int *rowmin, int *rowmax, int *colmin, int *colmax) { int i, nminmax, n; nminmax = nminima; if (nmaxima > nminmax) nminmax = nmaxima; for (i = 0; i < nminmax; i++) { n = 0; if (i < nminima) { n += printf("%s(", s); if (rowmin != NULL) n+= printf("%s", get_row_name(lp, rowmin[i])); if ((rowmin != NULL) && (colmin != NULL)) n += printf(", "); if (colmin != NULL) n += printf("%s", get_col_name(lp, colmin[i])); n += printf(") = %.8f", minima[i]); } if (n < 40) n = 40 - n; else n = 1; printf("%*.*s", n, n, ""); if (i < nmaxima) { n += printf("%s(", s); if (rowmax != NULL) n+= printf("%s", get_row_name(lp, rowmax[i])); if ((rowmax != NULL) && (colmax != NULL)) n += printf(", "); if (colmax != NULL) n += printf("%s", get_col_name(lp, colmax[i])); n += printf(") = %.8f", maxima[i]); } printf("\n"); } } static void print_statistics(lprec *lp) { REAL *col, *RHSmin, *RHSmax, *OBJmin, *OBJmax, *MATmin, *MATmax; int *nz, ret, m, n, i, j, k, l, nRHSmin = 0, nRHSmax = 0, nOBJmin = 0, nOBJmax = 0, nMATmin = 0, nMATmax = 0, *rowRHSmin, *rowRHSmax, *colOBJmin, *colOBJmax, *rowMATmin, *rowMATmax, *colMATmin, *colMATmax; m = get_Nrows(lp); n = get_Ncolumns(lp); col = (REAL *) malloc((1 + m) * sizeof(*col)); nz = (int *) malloc((1 + m) * sizeof(*RHSmin)); RHSmin = (REAL *) malloc(nstats * sizeof(*RHSmin)); RHSmax = (REAL *) malloc(nstats * sizeof(*RHSmax)); rowRHSmin = (int *) malloc(nstats * sizeof(*RHSmin)); rowRHSmax = (int *) malloc(nstats * sizeof(*RHSmax)); OBJmin = (REAL *) malloc(nstats * sizeof(*OBJmin)); OBJmax = (REAL *) malloc(nstats * sizeof(*OBJmax)); colOBJmin = (int *) malloc(nstats * sizeof(*colOBJmin)); colOBJmax = (int *) malloc(nstats * sizeof(*colOBJmax)); MATmin = (REAL *) malloc(nstats * sizeof(*MATmin)); MATmax = (REAL *) malloc(nstats * sizeof(*MATmax)); rowMATmin = (int *) malloc(nstats * sizeof(*rowMATmin)); rowMATmax = (int *) malloc(nstats * sizeof(*rowMATmax)); colMATmin = (int *) malloc(nstats * sizeof(*colMATmin)); colMATmax = (int *) malloc(nstats * sizeof(*colMATmax)); /* minmax(2.0, MATmin, MATmax, &nMATmin, &nMATmax, 1, rowMATmin, rowMATmax, 8, colMATmin, colMATmax); minmax(1.0, MATmin, MATmax, &nMATmin, &nMATmax, 2, rowMATmin, rowMATmax, 7, colMATmin, colMATmax); minmax(1.5, MATmin, MATmax, &nMATmin, &nMATmax, 3, rowMATmin, rowMATmax, 6, colMATmin, colMATmax); minmax(3.0, MATmin, MATmax, &nMATmin, &nMATmax, 4, rowMATmin, rowMATmax, 5, colMATmin, colMATmax); minmax(4.0, MATmin, MATmax, &nMATmin, &nMATmax, 5, rowMATmin, rowMATmax, 4, colMATmin, colMATmax); minmax(0.1, MATmin, MATmax, &nMATmin, &nMATmax, 6, rowMATmin, rowMATmax, 3, colMATmin, colMATmax); minmax(5.0, MATmin, MATmax, &nMATmin, &nMATmax, 7, rowMATmin, rowMATmax, 2, colMATmin, colMATmax); minmax(1.4, MATmin, MATmax, &nMATmin, &nMATmax, 8, rowMATmin, rowMATmax, 1, colMATmin, colMATmax); printminmax(MATmin, MATmax, nMATmin, nMATmax, rowMATmin, rowMATmax, colMATmin, colMATmax); */ for (i = 1; i <= m; i++) minmax(get_rh(lp, i), RHSmin, RHSmax, &nRHSmin, &nRHSmax, i, rowRHSmin, rowRHSmax, 0, NULL, NULL); for (j = 1; j <= n; j++) { ret = get_columnex(lp, j, col, nz); for (i = 0; i < ret; i++) if (nz[i] == 0) minmax(col[i], OBJmin, OBJmax, &nOBJmin, &nOBJmax, 0, NULL, NULL, j, colOBJmin, colOBJmax); else minmax(col[i], MATmin, MATmax, &nMATmin, &nMATmax, nz[i], rowMATmin, rowMATmax, j, colMATmin, colMATmax); } printf("Constraints: %d\n", get_Nrows(lp)); printf("Variables : %d\n", get_Ncolumns(lp)); for (j = k = l = 0, i = n; i >= 1; i--) { if (is_int(lp, i)) j++; if (is_semicont(lp, i)) k++; if (is_SOS_var(lp, i)) l++; } printf("Integers : %d\n", j); printf("Semi-cont : %d\n", k); printf("SOS : %d\n", l); k = get_nonzeros(lp); printf("Non-zeros : %d\tdensity=%f%%\n", k, ((double) k) / (((double) m) * ((double) n)) * 100.0); printf("\nAbsolute Ranges:\n\n Minima Maxima\n"); printf("\nMatrix Coeficients:\n"); printminmax(lp, "A", MATmin, MATmax, nMATmin, nMATmax, rowMATmin, rowMATmax, colMATmin, colMATmax); printf("\nObj. Vector:\n"); printminmax(lp, "c", OBJmin, OBJmax, nOBJmin, nOBJmax, NULL, NULL, colOBJmin, colOBJmax); printf("\nRHS Vector:\n"); printminmax(lp, "b", RHSmin, RHSmax, nRHSmin, nRHSmax, rowRHSmin, rowRHSmax, NULL, NULL); free(col); free(nz); free(RHSmin); free(RHSmax); free(rowRHSmin); free(rowRHSmax); free(OBJmin); free(OBJmax); free(colOBJmin); free(colOBJmax); free(MATmin); free(MATmax); free(rowMATmin); free(rowMATmax); free(colMATmin); free(colMATmax); } int main(int argc, char *argv[]) { lprec *lp = NULL; char *filen, *wlp = NULL, *wmps = NULL, *wfmps = NULL, plp = FALSE; int i; int verbose = IMPORTANT /* CRITICAL */; int debug = -1; MYBOOL report = FALSE; MYBOOL nonames = FALSE, norownames = FALSE, nocolnames = FALSE; MYBOOL write_model_after = FALSE; MYBOOL noint = FALSE; int print_sol = -1; MYBOOL print_stats = FALSE; int floor_first = -1; MYBOOL do_set_bb_depthlimit = FALSE; int bb_depthlimit = 0; MYBOOL do_set_solutionlimit = FALSE; int solutionlimit = 0; MYBOOL break_at_first = FALSE; int scaling = 0; double scaleloop = 0; MYBOOL tracing = FALSE; short filetype = filetypeLP; int anti_degen1 = -1; int anti_degen2 = -1; short print_timing = FALSE; short parse_only = FALSE; int do_presolve = -1; short objective = 0; short PRINT_SOLUTION = 2; int improve = -1; int pivoting1 = -1; int pivoting2 = -1; int bb_rule1 = -1; int bb_rule2 = -1; int max_num_inv = -1; int scalemode1 = -1; int scalemode2 = -1; int crashmode = -1; char *guessbasis = NULL; /* short timeoutok = FALSE; */ long sectimeout = -1; int result; MYBOOL preferdual = AUTOMATIC; int simplextype = -1; MYBOOL do_set_obj_bound = FALSE; REAL obj_bound = 0; REAL mip_absgap = -1; REAL mip_relgap = -1; REAL epsperturb = -1; REAL epsint = -1; REAL epspivot = -1; REAL epsd = -1; REAL epsb = -1; REAL epsel = -1; MYBOOL do_set_break_at_value = FALSE; REAL break_at_value = 0; FILE *fpin = stdin; char *bfp = NULL; char *rxliname = NULL, *rxli = NULL, *rxlidata = NULL, *rxlioptions = NULL, *wxliname = NULL, *wxlisol = NULL, *wxli = NULL, *wxlioptions = NULL, *wxlisoloptions = NULL; char *rbasname = NULL, *wbasname = NULL; char *debugdump_before = NULL; char *debugdump_after = NULL; char *rparname = NULL; char *rparoptions = NULL; char *wparname = NULL; char *wparoptions = NULL; char obj_in_basis = -1; char mps_ibm = FALSE; char mps_negobjconst = FALSE; char mps_free = FALSE; MYBOOL ok; # define SCALINGTHRESHOLD 0.03 /* read command line arguments */ # if defined FORTIFY Fortify_EnterScope(); # endif for(i = 1; i < argc; i++) { ok = FALSE; if(strncmp(argv[i], "-v", 2) == 0) { if (argv[i][2]) verbose = atoi(argv[i] + 2); else verbose = NORMAL; } else if(strcmp(argv[i], "-d") == 0) debug = TRUE; else if(strcmp(argv[i], "-R") == 0) report = TRUE; else if(strcmp(argv[i], "-i") == 0) print_sol = TRUE; else if(strcmp(argv[i], "-ia") == 0) print_sol = AUTOMATIC; else if(strcmp(argv[i], "-stat") == 0) print_stats = TRUE; else if(strcmp(argv[i], "-nonames") == 0) nonames = TRUE; else if(strcmp(argv[i], "-norownames") == 0) norownames = TRUE; else if(strcmp(argv[i], "-nocolnames") == 0) nocolnames = TRUE; else if((strcmp(argv[i], "-c") == 0) || (strcmp(argv[i], "-cc") == 0)) floor_first = BRANCH_CEILING; else if(strcmp(argv[i], "-cf") == 0) floor_first = BRANCH_FLOOR; else if(strcmp(argv[i], "-ca") == 0) floor_first = BRANCH_AUTOMATIC; else if((strcmp(argv[i], "-depth") == 0) && (i + 1 < argc)) { do_set_bb_depthlimit = TRUE; bb_depthlimit = atoi(argv[++i]); } else if(strcmp(argv[i], "-Bw") == 0) or_value(&bb_rule2, NODE_WEIGHTREVERSEMODE); else if(strcmp(argv[i], "-Bb") == 0) or_value(&bb_rule2, NODE_BRANCHREVERSEMODE); else if(strcmp(argv[i], "-Bg") == 0) or_value(&bb_rule2, NODE_GREEDYMODE); else if(strcmp(argv[i], "-Bp") == 0) or_value(&bb_rule2, NODE_PSEUDOCOSTMODE); else if(strcmp(argv[i], "-Bf") == 0) or_value(&bb_rule2, NODE_DEPTHFIRSTMODE); else if(strcmp(argv[i], "-Br") == 0) or_value(&bb_rule2, NODE_RANDOMIZEMODE); else if(strcmp(argv[i], "-BG") == 0) or_value(&bb_rule2, 0 /* NODE_GUBMODE */); /* doesn't work yet */ else if(strcmp(argv[i], "-Bd") == 0) or_value(&bb_rule2, NODE_DYNAMICMODE); else if(strcmp(argv[i], "-Bs") == 0) or_value(&bb_rule2, NODE_RESTARTMODE); else if(strcmp(argv[i], "-BB") == 0) or_value(&bb_rule2, NODE_BREADTHFIRSTMODE); else if(strcmp(argv[i], "-Bo") == 0) or_value(&bb_rule2, NODE_AUTOORDER); else if(strcmp(argv[i], "-Bc") == 0) or_value(&bb_rule2, NODE_RCOSTFIXING); else if(strcmp(argv[i], "-Bi") == 0) or_value(&bb_rule2, NODE_STRONGINIT); else if(strncmp(argv[i], "-B", 2) == 0) { if (argv[i][2]) set_value(&bb_rule1, atoi(argv[i] + 2)); else set_value(&bb_rule1, NODE_FIRSTSELECT); } else if((strcmp(argv[i], "-n") == 0) && (i + 1 < argc)) { do_set_solutionlimit = TRUE; solutionlimit = atoi(argv[++i]); } else if((strcmp(argv[i], "-b") == 0) && (i + 1 < argc)) { obj_bound = atof(argv[++i]); do_set_obj_bound = TRUE; } else if(((strcmp(argv[i], "-g") == 0) || (strcmp(argv[i], "-ga") == 0)) && (i + 1 < argc)) mip_absgap = atof(argv[++i]); else if((strcmp(argv[i], "-gr") == 0) && (i + 1 < argc)) mip_relgap = atof(argv[++i]); else if((strcmp(argv[i], "-e") == 0) && (i + 1 < argc)) { epsint = atof(argv[++i]); if((epsint <= 0.0) || (epsint >= 0.5)) { fprintf(stderr, "Invalid tolerance %g; 0 < epsilon < 0.5\n", (double)epsint); EndOfPgr(FORCED_EXIT); } } else if((strcmp(argv[i], "-r") == 0) && (i + 1 < argc)) max_num_inv = atoi(argv[++i]); else if((strcmp(argv[i], "-o") == 0) && (i + 1 < argc)) { break_at_value = atof(argv[++i]); do_set_break_at_value = TRUE; } else if(strcmp(argv[i], "-f") == 0) break_at_first = TRUE; else if(strcmp(argv[i], "-timeoutok") == 0) /* timeoutok = TRUE */; /* option no longer needed, but still accepted */ else if(strcmp(argv[i], "-h") == 0) { print_help(argv); EndOfPgr(EXIT_SUCCESS); } else if(strcmp(argv[i], "-prim") == 0) preferdual = FALSE; else if(strcmp(argv[i], "-dual") == 0) preferdual = TRUE; else if(strcmp(argv[i], "-simplexpp") == 0) simplextype = SIMPLEX_PRIMAL_PRIMAL; else if(strcmp(argv[i], "-simplexdp") == 0) simplextype = SIMPLEX_DUAL_PRIMAL; else if(strcmp(argv[i], "-simplexpd") == 0) simplextype = SIMPLEX_PRIMAL_DUAL; else if(strcmp(argv[i], "-simplexdd") == 0) simplextype = SIMPLEX_DUAL_DUAL; else if(strcmp(argv[i], "-sp") == 0) or_value(&scalemode2, SCALE_POWER2); else if(strcmp(argv[i], "-si") == 0) or_value(&scalemode2, SCALE_INTEGERS); else if(strcmp(argv[i], "-se") == 0) or_value(&scalemode2, SCALE_EQUILIBRATE); else if(strncmp(argv[i], "-s", 2) == 0) { set_value(&scalemode1, SCALE_NONE); scaling = SCALE_MEAN; if (argv[i][2]) { switch (atoi(argv[i] + 2)) { case 0: scaling = SCALE_NONE; break; case 1: set_value(&scalemode1, SCALE_GEOMETRIC); break; case 2: set_value(&scalemode1, SCALE_CURTISREID); break; case 3: set_value(&scalemode1, SCALE_EXTREME); break; case 4: set_value(&scalemode1, SCALE_MEAN); break; case 5: set_value(&scalemode1, SCALE_MEAN | SCALE_LOGARITHMIC); break; case 6: set_value(&scalemode1, SCALE_RANGE); break; case 7: set_value(&scalemode1, SCALE_MEAN | SCALE_QUADRATIC); break; } } else set_value(&scalemode1, SCALE_MEAN); if((i + 1 < argc) && (isNum(argv[i + 1]))) scaleloop = atoi(argv[++i]); } else if(strncmp(argv[i], "-C", 2) == 0) crashmode = atoi(argv[i] + 2); else if((strcmp(argv[i],"-gbas") == 0) && (i + 1 < argc)) guessbasis = argv[++i]; else if(strcmp(argv[i], "-t") == 0) tracing = TRUE; else if(strncmp(argv[i], "-S", 2) == 0) { if (argv[i][2]) PRINT_SOLUTION = (short) atoi(argv[i] + 2); else PRINT_SOLUTION = 2; } else if(strncmp(argv[i], "-improve", 8) == 0) { if (argv[i][8]) or_value(&improve, atoi(argv[i] + 8)); } else if(strcmp(argv[i], "-pivll") == 0) or_value(&pivoting2, PRICE_LOOPLEFT); else if(strcmp(argv[i], "-pivla") == 0) or_value(&pivoting2, PRICE_LOOPALTERNATE); #if defined EnablePartialOptimization else if(strcmp(argv[i], "-pivpc") == 0) or_value(&pivoting2, PRICE_AUTOPARTIALCOLS); else if(strcmp(argv[i], "-pivpr") == 0) or_value(&pivoting2, PRICE_AUTOPARTIALROWS); else if(strcmp(argv[i], "-pivp") == 0) or_value(&pivoting2, PRICE_AUTOPARTIAL); #endif else if(strcmp(argv[i], "-pivf") == 0) or_value(&pivoting2, PRICE_PRIMALFALLBACK); else if(strcmp(argv[i], "-pivm") == 0) or_value(&pivoting2, PRICE_MULTIPLE); else if(strcmp(argv[i], "-piva") == 0) or_value(&pivoting2, PRICE_ADAPTIVE); else if(strcmp(argv[i], "-pivr") == 0) or_value(&pivoting2, PRICE_RANDOMIZE); else if(strcmp(argv[i], "-pivh") == 0) or_value(&pivoting2, PRICE_HARRISTWOPASS); else if(strcmp(argv[i], "-pivt") == 0) or_value(&pivoting2, PRICE_TRUENORMINIT); else if(strncmp(argv[i], "-piv", 4) == 0) { if (argv[i][4]) set_value(&pivoting1, atoi(argv[i] + 4)); else set_value(&pivoting1, PRICER_DEVEX | PRICE_ADAPTIVE); } #if defined PARSER_LP else if(strcmp(argv[i],"-lp") == 0) filetype = filetypeLP; #endif else if((strcmp(argv[i],"-wlp") == 0) && (i + 1 < argc)) wlp = argv[++i]; else if(strcmp(argv[i],"-plp") == 0) plp = TRUE; else if(strcmp(argv[i],"-mps") == 0) filetype = filetypeMPS; else if(strcmp(argv[i],"-mps_ibm") == 0) mps_ibm = TRUE; else if(strcmp(argv[i],"-mps_negobjconst") == 0) mps_negobjconst = TRUE; else if(strcmp(argv[i],"-mps_free") == 0) mps_free = TRUE; else if(strcmp(argv[i],"-fmps") == 0) filetype = filetypeFREEMPS; else if((strcmp(argv[i],"-wmps") == 0) && (i + 1 < argc)) wmps = argv[++i]; else if((strcmp(argv[i],"-wfmps") == 0) && (i + 1 < argc)) wfmps = argv[++i]; else if(strcmp(argv[i],"-wafter") == 0) write_model_after = TRUE; else if(strcmp(argv[i],"-degen") == 0) set_value(&anti_degen1, ANTIDEGEN_DEFAULT); else if(strcmp(argv[i],"-degenf") == 0) or_value(&anti_degen2, ANTIDEGEN_FIXEDVARS); else if(strcmp(argv[i],"-degenc") == 0) or_value(&anti_degen2, ANTIDEGEN_COLUMNCHECK); else if(strcmp(argv[i],"-degens") == 0) or_value(&anti_degen2, ANTIDEGEN_STALLING); else if(strcmp(argv[i],"-degenn") == 0) or_value(&anti_degen2, ANTIDEGEN_NUMFAILURE); else if(strcmp(argv[i],"-degenl") == 0) or_value(&anti_degen2, ANTIDEGEN_LOSTFEAS); else if(strcmp(argv[i],"-degeni") == 0) or_value(&anti_degen2, ANTIDEGEN_INFEASIBLE); else if(strcmp(argv[i],"-degend") == 0) or_value(&anti_degen2, ANTIDEGEN_DYNAMIC); else if(strcmp(argv[i],"-degenb") == 0) or_value(&anti_degen2, ANTIDEGEN_DURINGBB); else if(strcmp(argv[i],"-degenr") == 0) or_value(&anti_degen2, ANTIDEGEN_RHSPERTURB); else if(strcmp(argv[i],"-degenp") == 0) or_value(&anti_degen2, ANTIDEGEN_BOUNDFLIP); else if(strcmp(argv[i],"-time") == 0) { if(clock() == -1) fprintf(stderr, "CPU times not available on this machine\n"); else print_timing = TRUE; } else if((strcmp(argv[i],"-bfp") == 0) && (i + 1 < argc)) bfp = argv[++i]; else if((strcmp(argv[i],"-rxli") == 0) && (i + 2 < argc)) { rxliname = argv[++i]; rxli = argv[++i]; fpin = NULL; filetype = filetypeXLI; } else if((strcmp(argv[i],"-rxlidata") == 0) && (i + 1 < argc)) rxlidata = argv[++i]; else if((strcmp(argv[i],"-rxliopt") == 0) && (i + 1 < argc)) rxlioptions = argv[++i]; else if((strcmp(argv[i],"-wxli") == 0) && (i + 2 < argc)) { wxliname = argv[++i]; wxli = argv[++i]; } else if((strcmp(argv[i],"-wxliopt") == 0) && (i + 1 < argc)) wxlioptions = argv[++i]; else if((strcmp(argv[i],"-wxlisol") == 0) && (i + 2 < argc)) { wxliname = argv[++i]; wxlisol = argv[++i]; } else if((strcmp(argv[i],"-wxlisolopt") == 0) && (i + 1 < argc)) wxlisoloptions = argv[++i]; else if((strcmp(argv[i],"-rbas") == 0) && (i + 1 < argc)) rbasname = argv[++i]; else if((strcmp(argv[i],"-wbas") == 0) && (i + 1 < argc)) wbasname = argv[++i]; else if((strcmp(argv[i],"-Db") == 0) && (i + 1 < argc)) debugdump_before = argv[++i]; else if((strcmp(argv[i],"-Da") == 0) && (i + 1 < argc)) debugdump_after = argv[++i]; else if((strcmp(argv[i],"-timeout") == 0) && (i + 1 < argc)) sectimeout = atol(argv[++i]); else if((strcmp(argv[i],"-trej") == 0) && (i + 1 < argc)) epspivot = atof(argv[++i]); else if((strcmp(argv[i],"-epsp") == 0) && (i + 1 < argc)) epsperturb = atof(argv[++i]); else if((strcmp(argv[i],"-epsd") == 0) && (i + 1 < argc)) epsd = atof(argv[++i]); else if((strcmp(argv[i],"-epsb") == 0) && (i + 1 < argc)) epsb = atof(argv[++i]); else if((strcmp(argv[i],"-epsel") == 0) && (i + 1 < argc)) epsel = atof(argv[++i]); else if(strcmp(argv[i],"-parse_only") == 0) parse_only = TRUE; else ok = TRUE; if(!ok) ; else if(strcmp(argv[i],"-presolverow") == 0) or_value(&do_presolve, PRESOLVE_ROWS); else if(strcmp(argv[i],"-presolvecol") == 0) or_value(&do_presolve, PRESOLVE_COLS); else if(strcmp(argv[i],"-presolve") == 0) or_value(&do_presolve, PRESOLVE_ROWS | PRESOLVE_COLS); else if(strcmp(argv[i],"-presolvel") == 0) or_value(&do_presolve, PRESOLVE_LINDEP); else if(strcmp(argv[i],"-presolves") == 0) or_value(&do_presolve, PRESOLVE_SOS); else if(strcmp(argv[i],"-presolver") == 0) or_value(&do_presolve, PRESOLVE_REDUCEMIP); else if(strcmp(argv[i],"-presolvek") == 0) or_value(&do_presolve, PRESOLVE_KNAPSACK); else if(strcmp(argv[i],"-presolveq") == 0) or_value(&do_presolve, PRESOLVE_ELIMEQ2); else if(strcmp(argv[i],"-presolvem") == 0) or_value(&do_presolve, PRESOLVE_MERGEROWS); else if(strcmp(argv[i],"-presolvefd") == 0) or_value(&do_presolve, PRESOLVE_COLFIXDUAL); else if(strcmp(argv[i],"-presolvebnd") == 0) or_value(&do_presolve, PRESOLVE_BOUNDS); else if(strcmp(argv[i],"-presolved") == 0) or_value(&do_presolve, PRESOLVE_DUALS); else if(strcmp(argv[i],"-presolvef") == 0) or_value(&do_presolve, PRESOLVE_IMPLIEDFREE); else if(strcmp(argv[i],"-presolveslk") == 0) or_value(&do_presolve, PRESOLVE_IMPLIEDSLK); else if(strcmp(argv[i],"-presolveg") == 0) or_value(&do_presolve, PRESOLVE_REDUCEGCD); else if(strcmp(argv[i],"-presolveb") == 0) or_value(&do_presolve, PRESOLVE_PROBEFIX); else if(strcmp(argv[i],"-presolvec") == 0) or_value(&do_presolve, PRESOLVE_PROBEREDUCE); else if(strcmp(argv[i],"-presolverowd") == 0) or_value(&do_presolve, PRESOLVE_ROWDOMINATE); else if(strcmp(argv[i],"-presolvecold") == 0) or_value(&do_presolve, PRESOLVE_COLDOMINATE); else if(strcmp(argv[i],"-min") == 0) objective = -1; else if(strcmp(argv[i],"-max") == 0) objective = 1; else if(strcmp(argv[i],"-noint") == 0) noint = TRUE; else if((strcmp(argv[i],"-rpar") == 0) && (i + 1 < argc)) i++; else if((strcmp(argv[i],"-rparopt") == 0) && (i + 1 < argc)) i++; else if((strcmp(argv[i],"-wpar") == 0) && (i + 1 < argc)) i++; else if((strcmp(argv[i],"-wparopt") == 0) && (i + 1 < argc)) i++; else if(strcmp(argv[i],"-o0") == 0) obj_in_basis = FALSE; else if(strcmp(argv[i],"-o1") == 0) obj_in_basis = TRUE; else if(fpin == stdin) { filen = argv[i]; if(*filen == '<') filen++; if((fpin = fopen(filen, "r")) == NULL) { print_help(argv); fprintf(stderr,"\nError, Unable to open input file '%s'\n", argv[i]); EndOfPgr(FORCED_EXIT); } } else { filen = argv[i]; if(*filen != '>') { print_help(argv); fprintf(stderr, "\nError, Unrecognized command line argument '%s'\n", argv[i]); EndOfPgr(FORCED_EXIT); } } } signal(SIGABRT,/* (void (*) OF((int))) */ SIGABRT_func); if ((filetype != filetypeXLI) && (fpin == NULL)) { lp = NULL; fprintf(stderr, "Cannot combine -rxli option with -lp, -mps, -fmps.\n"); } else { switch(filetype) { #if defined PARSER_LP case filetypeLP: lp = read_lp(fpin, verbose, NULL); break; #endif case filetypeMPS: lp = read_mps(fpin, verbose | (mps_free ? MPS_FREE : 0) | (mps_ibm ? MPS_IBM : 0) | (mps_negobjconst ? MPS_NEGOBJCONST : 0)); break; case filetypeFREEMPS: lp = read_freemps(fpin, verbose | (mps_ibm ? MPS_IBM : 0) | (mps_negobjconst ? MPS_NEGOBJCONST : 0)); break; case filetypeXLI: lp = read_XLI(rxliname, rxli, rxlidata, rxlioptions, verbose); break; } } if((fpin != NULL) && (fpin != stdin)) fclose(fpin); if(print_timing) print_cpu_times("Parsing input"); if(lp == NULL) { fprintf(stderr, "Unable to read model.\n"); EndOfPgr(FORCED_EXIT); } for(i = 1; i < argc; i++) { if((strcmp(argv[i],"-rpar") == 0) && (i + 1 < argc)) { if(rparname != NULL) { if(!read_params(lp, rparname, rparoptions)) { fprintf(stderr, "Unable to read parameter file (%s)\n", rparname); delete_lp(lp); EndOfPgr(FORCED_EXIT); } } rparname = argv[++i]; } else if((strcmp(argv[i],"-rparopt") == 0) && (i + 1 < argc)) rparoptions = argv[++i]; else if((strcmp(argv[i],"-wpar") == 0) && (i + 1 < argc)) wparname = argv[++i]; else if((strcmp(argv[i],"-wparopt") == 0) && (i + 1 < argc)) wparoptions = argv[++i]; } if(rparname != NULL) if(!read_params(lp, rparname, rparoptions)) { fprintf(stderr, "Unable to read parameter file (%s)\n", rparname); delete_lp(lp); EndOfPgr(FORCED_EXIT); } if((nonames) || (nocolnames)) set_use_names(lp, FALSE, FALSE); if((nonames) || (norownames)) set_use_names(lp, TRUE, FALSE); if(objective != 0) { if(objective == 1) set_maxim(lp); else set_minim(lp); } if (obj_in_basis != -1) set_obj_in_basis(lp, obj_in_basis); if(noint) { /* remove integer conditions */ for(i = get_Ncolumns(lp); i >= 1; i--) { if(is_SOS_var(lp, i)) { fprintf(stderr, "Unable to remove integer conditions because there is at least one SOS constraint\n"); delete_lp(lp); EndOfPgr(FORCED_EXIT); } set_semicont(lp, i, FALSE); set_int(lp, i, FALSE); } } if(!write_model_after) write_model(lp, plp, wlp, wmps, wfmps, wxli, NULL, wxliname, wxlioptions); if(print_stats) print_statistics(lp); if(parse_only) { if(!write_model_after) { delete_lp(lp); EndOfPgr(0); } /* else if(!sectimeout) */ sectimeout = 1; } if(PRINT_SOLUTION >= 5) print_lp(lp); #if 0 put_abortfunc(lp,(abortfunc *) myabortfunc, NULL); #endif if(sectimeout > 0) set_timeout(lp, sectimeout); if(print_sol >= 0) set_print_sol(lp, print_sol); if(epsint >= 0) set_epsint(lp, epsint); if(epspivot >= 0) set_epspivot(lp, epspivot); if(epsperturb >= 0) set_epsperturb(lp, epsperturb); if(epsd >= 0) set_epsd(lp, epsd); if(epsb >= 0) set_epsb(lp, epsb); if(epsel >= 0) set_epsel(lp, epsel); if(debug >= 0) set_debug(lp, (MYBOOL) debug); if(floor_first != -1) set_bb_floorfirst(lp, floor_first); if(do_set_bb_depthlimit) set_bb_depthlimit(lp, bb_depthlimit); if(do_set_solutionlimit) set_solutionlimit(lp, solutionlimit); if(tracing) set_trace(lp, tracing); if(do_set_obj_bound) set_obj_bound(lp, obj_bound); if(do_set_break_at_value) set_break_at_value(lp, break_at_value); if(break_at_first) set_break_at_first(lp, break_at_first); if(mip_absgap >= 0) set_mip_gap(lp, TRUE, mip_absgap); if(mip_relgap >= 0) set_mip_gap(lp, FALSE, mip_relgap); if((anti_degen1 != -1) || (anti_degen2 != -1)) { if((anti_degen1 == -1) || (anti_degen2 != -1)) anti_degen1 = 0; if(anti_degen2 == -1) anti_degen2 = 0; set_anti_degen(lp, anti_degen1 | anti_degen2); } set_presolve(lp, ((do_presolve == -1) ? get_presolve(lp): do_presolve) | ((PRINT_SOLUTION >= 4) ? PRESOLVE_SENSDUALS : 0), get_presolveloops(lp)); if(improve != -1) set_improve(lp, improve); if(max_num_inv >= 0) set_maxpivot(lp, max_num_inv); if(preferdual != AUTOMATIC) set_preferdual(lp, preferdual); if((pivoting1 != -1) || (pivoting2 != -1)) { if(pivoting1 == -1) pivoting1 = get_pivoting(lp) & PRICER_LASTOPTION; if(pivoting2 == -1) pivoting2 = 0; set_pivoting(lp, pivoting1 | pivoting2); } if((scalemode1 != -1) || (scalemode2 != -1)) { if(scalemode1 == -1) scalemode1 = get_scaling(lp) & SCALE_CURTISREID; if(scalemode2 == -1) scalemode2 = 0; set_scaling(lp, scalemode1 | scalemode2); } if(crashmode != -1) set_basiscrash(lp, crashmode); if((bb_rule1 != -1) || (bb_rule2 != -1)) { if(bb_rule1 == -1) bb_rule1 = get_bb_rule(lp) & NODE_USERSELECT; if(bb_rule2 == -1) bb_rule2 = 0; set_bb_rule(lp, bb_rule1 | bb_rule2); } if(simplextype != -1) set_simplextype(lp, simplextype); if(bfp != NULL) if(!set_BFP(lp, bfp)) { fprintf(stderr, "Unable to set BFP package.\n"); delete_lp(lp); EndOfPgr(FORCED_EXIT); } if(debugdump_before != NULL) print_debugdump(lp, debugdump_before); if(report) put_msgfunc(lp, LPMessageCB, NULL, MSG_LPFEASIBLE | MSG_LPOPTIMAL | MSG_MILPFEASIBLE | MSG_MILPBETTER | MSG_PERFORMANCE); if(scaling) { if(scaleloop <= 0) scaleloop = 5; if(scaleloop - (int) scaleloop < SCALINGTHRESHOLD) scaleloop = (int) scaleloop + SCALINGTHRESHOLD; set_scalelimit(lp, scaleloop); } if(guessbasis != NULL) { REAL *guessvector, a; int *basisvector; int Nrows = get_Nrows(lp); int Ncolumns = get_Ncolumns(lp); int col; char buf[50], *ptr; FILE *fp; if ((fp = fopen(guessbasis, "r")) != NULL) { guessvector = (REAL *) calloc(1+Ncolumns, sizeof(*guessvector)); basisvector = (int *) malloc((1+Nrows+Ncolumns)*sizeof(*basisvector)); if ((guessvector != NULL) && (basisvector != NULL)) { while ((!feof(fp)) && (fgets(buf, sizeof(buf), fp) != NULL)) { ptr = strrchr(buf, ':'); if (ptr == NULL) { printf("Mallformed line: %s\n", buf); } else { a = atof(ptr + 1); while ((ptr > buf) && (isspace(ptr[-1]))) ptr--; *ptr = 0; col = get_nameindex(lp, buf, FALSE); if (col < 1) printf("guess_basis: Unknown variable name %s\n", buf); else guessvector[col] = a; } } if (guess_basis(lp, guessvector, basisvector)) { if (!set_basis(lp, basisvector, TRUE)) printf("Unable to set guessed basis.\n"); } else printf("Unable to guess basis from provided variables.\n"); } else printf("guess_basis: Out of memory.\n"); if (basisvector != NULL) free(basisvector); if (guessvector != NULL) free(guessvector); fclose(fp); } else printf("Unable to open file %s\n", guessbasis); } if(rbasname != NULL) if(!read_basis(lp, rbasname, NULL)) { fprintf(stderr, "Unable to read basis file.\n"); delete_lp(lp); EndOfPgr(FORCED_EXIT); } result = solve(lp); if(wbasname != NULL) if(!write_basis(lp, wbasname)) fprintf(stderr, "Unable to write basis file.\n"); if(write_model_after) write_model(lp, plp, wlp, wmps, wfmps, wxli, NULL, wxliname, wxlioptions); write_model(lp, FALSE, NULL, NULL, NULL, NULL, wxlisol, wxliname, wxlisoloptions); if(PRINT_SOLUTION >= 6) print_scales(lp); if((print_timing) && (!parse_only)) print_cpu_times("solving"); if(debugdump_after != NULL) print_debugdump(lp, debugdump_after); if(wparname != NULL) if(!write_params(lp, wparname, wparoptions)) { fprintf(stderr, "Unable to write parameter file (%s)\n", wparname); delete_lp(lp); EndOfPgr(FORCED_EXIT); } if(parse_only) { delete_lp(lp); EndOfPgr(0); } /* if((timeoutok) && (result == TIMEOUT) && (get_solutioncount(lp) > 0)) result = OPTIMAL; */ switch(result) { case SUBOPTIMAL: case PRESOLVED: case OPTIMAL: case PROCBREAK: case FEASFOUND: if ((result == SUBOPTIMAL) && (PRINT_SOLUTION >= 1)) printf("Suboptimal solution\n"); if (result == PRESOLVED) printf("Presolved solution\n"); if (PRINT_SOLUTION >= 1) print_objective(lp); if (PRINT_SOLUTION >= 2) print_solution(lp, 1); if (PRINT_SOLUTION >= 3) print_constraints(lp, 1); if (PRINT_SOLUTION >= 4) print_duals(lp); if(tracing) fprintf(stderr, "Branch & Bound depth: %d\nNodes processed: %.0f\nSimplex pivots: %.0f\nNumber of equal solutions: %d\n", get_max_level(lp), (REAL) get_total_nodes(lp), (REAL) get_total_iter(lp), get_solutioncount(lp)); break; case NOMEMORY: if (PRINT_SOLUTION >= 1) printf("Out of memory\n"); break; case INFEASIBLE: if (PRINT_SOLUTION >= 1) printf("This problem is infeasible\n"); break; case UNBOUNDED: if (PRINT_SOLUTION >= 1) printf("This problem is unbounded\n"); break; case PROCFAIL: if (PRINT_SOLUTION >= 1) printf("The B&B routine failed\n"); break; case TIMEOUT: if (PRINT_SOLUTION >= 1) printf("Timeout\n"); break; case USERABORT: if (PRINT_SOLUTION >= 1) printf("User aborted\n"); break; default: if (PRINT_SOLUTION >= 1) printf("lp_solve failed\n"); break; } if (PRINT_SOLUTION >= 7) print_tableau(lp); delete_lp(lp); EndOfPgr(result); return(result); } lp_solve_5.5/lp_solve/lp_solve.sln100666 0 0 4531 11126023502 15716 0ustar usergroup Microsoft Visual Studio Solution File, Format Version 10.00 # Visual Studio 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lp_solve", "lp_solve.vcproj", "{2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug Fortify|Win32 = Debug Fortify|Win32 Debug Fortify|x64 = Debug Fortify|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Debug2|Win32 = Debug2|Win32 Debug2|x64 = Debug2|x64 oops|Win32 = oops|Win32 oops|x64 = oops|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug Fortify|Win32.ActiveCfg = Debug Fortify|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug Fortify|Win32.Build.0 = Debug Fortify|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug Fortify|x64.ActiveCfg = Debug Fortify|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug Fortify|x64.Build.0 = Debug Fortify|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug|Win32.ActiveCfg = Debug|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug|Win32.Build.0 = Debug|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug|x64.ActiveCfg = Debug|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug|x64.Build.0 = Debug|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug2|Win32.ActiveCfg = Debug2|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug2|Win32.Build.0 = Debug2|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug2|x64.ActiveCfg = Debug2|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Debug2|x64.Build.0 = Debug2|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.oops|Win32.ActiveCfg = oops|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.oops|Win32.Build.0 = oops|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.oops|x64.ActiveCfg = oops|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.oops|x64.Build.0 = oops|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Release|Win32.ActiveCfg = Release|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Release|Win32.Build.0 = Release|Win32 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Release|x64.ActiveCfg = Release|x64 {2098FB68-99FD-40D4-ABD6-87E2FD11D1B5}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal lp_solve_5.5/lp_solve/lp_solve.vcproj100666 0 0 61044 11252255123 16455 0ustar usergroup lp_solve_5.5/lp_solve/Makefile.msc100666 0 0 5010 10560210650 15572 0ustar usergroup# Makefile for Microsoft visual C++ (tested on version 5, 6 & 7 (.NET)) # to be called with GMAKE # gmake -f Makefile.msc CC= cl CFLAGS= /ML /O1 /Zp8 /Gd /W2 /DWIN32 /D_WINDOWS /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DYY_NEVER_INTERACTIVE /DPARSER_LP /I.. /I../bfp /I../bfp/bfp_etaPFI /I../colamd /I../shared /I../BFP/BFP_LUSOL/LUSOL # You can add a -DREAL= to the CFLAGS, to change the default float # type used in lp_solve (double) to float or 'long double'. However, type float # might be fast on your computer, but it is not accurate enough to solve even # moderately sized problems without running into numerical problems. # The use of long doubles does increase the numerical stability of lp_solve, # if your compiler actually implements them with more bits than a double. But # it slows down things quite a bit. # Choose your favorite or available version of lex and yacc YACC= bison --no-lines -y LEX= flex -L -l LEXLIB= #ANSI math lib MATHLIB= TESTFILES1= lp_examples/*.lp TESTFILES2= lp_examples/*.mps TARGET=lp_solve CSOURCES=../shared/commonlib.c ../shared/mmio.c ../shared/myblas.c ../ini.c ../lp_rlp.c ../lp_crash.c ../bfp/bfp_LUSOL/lp_LUSOL.c ../bfp/bfp_LUSOL/LUSOL/lusol.c ../lp_Hash.c ../lp_lib.c ../lp_wlp.c ../lp_matrix.c ../lp_mipbb.c ../lp_MPS.c ../lp_params.c ../lp_presolve.c ../lp_price.c ../lp_pricePSE.c ../lp_report.c ../lp_scale.c ../lp_simplex.c lp_solve.c ../lp_SOS.c ../lp_utils.c ../yacc_read.c ../lp_MDO.c ../colamd/colamd.c CSOURCES1=$(notdir $(CSOURCES)) COBJ=$(CSOURCES1:.c=.obj) HEADERS=../colamd/colamd.h ../shared/commonlib.h ../declare.h ../fortify.h ../bfp/lp_BFP.h ../lp_crash.h ../bfp/bfp_etaPFI/lp_etaPFI.h ../lp_fortify.h ../lp_Hash.h ../lp_lib.h ../lp_matrix.h ../lp_MDO.h ../lp_mipbb.h ../lp_MPS.h ../lp_presolve.h ../lp_price.h ../lp_pricePSE.h ../lp_report.h ../lp_rlp.h ../lp_scale.h ../lp_simplex.h ../lp_SOS.h ../lp_types.h ../lp_utils.h ../lp_wlp.h ../lpkit.h ../shared/myblas.h ../ufortify.h ../yacc_read.h ../BFP/BFP_LUSOL/LUSOL/lusol.h all: $(TARGET).exe $(TARGET).exe: lp_solve.c $(HEADERS) $(COBJ) $(CC) -o $(TARGET).exe $(CFLAGS) lp_solve.c $(COBJ) $(LEXLIB) $(MATHLIB) $(COBJ): $(HEADERS) $(CSOURCES) $(CC) -c $(CFLAGS) $(CSOURCES) ../lp_rlp.h: ../lp_rlp.l $(LEX) ../lp_rlp.l sed -e "s/yy/lp_yy/g" lex.yy.c >../lp_rlp.h rm lex.yy.c ../lp_rlp.c: ../lp_rlp.y $(YACC) ../lp_rlp.y sed -e "s/yy/lp_yy/g" y.tab.c >../lp_rlp.c rm y.tab.c clean: rm -f pe.cfg *.obj $(TARGET).exe TAGS: etags *.[chyl] lp_solve_5.5/lp_solve/readme.txt100666 0 0 541 11141374643 15344 0ustar usergroupThis directory contains the files to build the lp_solve program To build the program under Windows with the Visual C/C++ compiler, use cvc6.bat (also works for VS.NET) To build the program under DOS/Windows with the gcc compiler, use cgcc.bat To build the program under Linux/Unix, use sh ccc To build the program under Mac OS X 10.3.5, use sh ccc.osx lp_solve_5.5/lp_solve.def100666 0 0 10414 11127446346 14072 0ustar usergroupEXPORTS add_SOS add_column add_columnex add_constraint add_constraintex add_lag_con column_in_lp copy_lp default_basis del_column del_constraint delete_lp dualize_lp free_lp get_Lrows get_Ncolumns get_Norig_columns get_Norig_rows get_Nrows get_pseudocosts get_anti_degen get_basis get_basiscrash get_bb_depthlimit get_bb_floorfirst get_bb_rule get_bounds_tighter get_break_at_value get_col_name get_column get_columnex get_constr_type get_constr_value get_constraints get_dual_solution get_epsb get_epsd get_epsel get_epsint get_epsperturb get_epspivot get_improve get_infinite get_lambda get_lowbo get_lp_index get_lp_name get_mat get_mat_byindex get_max_level get_maxpivot get_mip_gap get_multiprice get_nameindex get_negrange get_nonzeros get_obj_bound get_objective get_orig_index get_origcol_name get_origrow_name get_partialprice get_pivoting get_presolve get_presolveloops get_primal_solution get_print_sol get_ptr_constraints get_ptr_dual_solution get_ptr_lambda get_ptr_primal_solution get_ptr_sensitivity_obj get_ptr_sensitivity_objex get_ptr_sensitivity_rhs get_ptr_variables get_rh get_rh_range get_row get_rowex get_row_name get_scalelimit get_scaling get_sensitivity_obj get_sensitivity_objex get_sensitivity_rhs get_simplextype get_solutioncount get_solutionlimit get_status get_statustext get_timeout get_total_iter get_total_nodes get_upbo get_var_branch get_var_dualresult get_var_primalresult get_var_priority get_variables get_verbose get_working_objective guess_basis has_BFP has_XLI is_SOS_var is_add_rowmode is_anti_degen is_binary is_break_at_first is_constr_type is_debug is_feasible is_unbounded is_infinite is_int is_integerscaling is_lag_trace is_maxim is_nativeBFP is_nativeXLI is_negative is_obj_in_basis is_piv_mode is_piv_rule is_presolve is_scalemode is_scaletype is_semicont is_trace is_use_names lp_solve_version make_lp print_constraints print_debugdump print_duals print_lp print_objective print_scales print_solution print_str print_tableau put_abortfunc put_bb_nodefunc put_bb_branchfunc put_logfunc put_msgfunc read_LP read_MPS read_XLI read_freeMPS read_freemps read_lp read_lpex read_mps read_basis read_params reset_basis reset_params resize_lp set_BFP set_pseudocosts set_XLI set_add_rowmode set_anti_degen set_basis set_basiscrash set_basisvar set_bb_depthlimit set_bb_floorfirst set_bb_rule set_binary set_bounds set_bounds_tighter set_break_at_first set_break_at_value set_col_name set_column set_columnex set_constr_type set_debug set_epsb set_epsd set_epsel set_epsint set_epslevel set_epsperturb set_epspivot set_unbounded set_improve set_infinite set_int set_lag_trace set_lowbo set_lp_name set_mat set_maxim set_maxpivot set_minim set_mip_gap set_multiprice set_negrange set_obj set_obj_bound set_obj_fn set_obj_fnex set_obj_in_basis set_outputfile set_outputstream set_partialprice set_pivoting set_preferdual set_presolve set_print_sol set_rh set_rh_range set_rh_vec set_row set_row_name set_rowex set_scalelimit set_scaling set_semicont set_sense set_simplextype set_solutionlimit set_timeout set_trace set_upbo set_use_names set_var_branch set_var_weights set_verbose solve str_add_column str_add_constraint str_add_lag_con str_set_obj_fn str_set_rh_vec time_elapsed unscale write_LP write_MPS write_XLI write_freeMPS write_freemps MPS_writefileex write_lp write_lpex write_mps write_basis write_params lp_solve_5.5/lp_solveDLL.c100666 0 0 374 11141374254 14050 0ustar usergroup /* lp_solve.cpp : Defines the entry point for the DLL. */ #include "lp_solveDLL.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { return TRUE; } lp_solve_5.5/lp_solveDLL.h100666 0 0 1411 11250516360 14063 0ustar usergroup// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // #if !defined(AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_) #define AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // Insert your headers here #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #include // TODO: reference additional headers your program requires here //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_STDAFX_H__22BF6D92_917F_4BDF_B806_0954721EBA95__INCLUDED_) lp_solve_5.5/lp_SOS.c100666 0 0 120073 11141374255 13110 0ustar usergroup #include #include "commonlib.h" #include "lp_lib.h" #include "lp_report.h" #include "lp_SOS.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Specially Ordered Set (SOS) routines - w/interface for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lp_lib.h Release notes: v1.0 1 September 2003 Complete package for SOS creation and use in a LP setting. Notable feature of this implementation compared to those in other commercial systems is the generalization to SOS'es of "unlimited" order. v1.1 8 December 2003 Added variable (index) deletion method. v1.2 17 December 2004 Added bound change tracking functionality. v1.3 18 September 2005 Added sparse SOS handling to speed up processing of large number of SOS'es. ---------------------------------------------------------------------------------- */ /* SOS group functions */ STATIC SOSgroup *create_SOSgroup(lprec *lp) { SOSgroup *group; group = (SOSgroup *) calloc(1, sizeof(*group)); group->lp = lp; group->sos_alloc = SOS_START_SIZE; group->sos_list = (SOSrec **) malloc((group->sos_alloc) * sizeof(*group->sos_list)); return(group); } STATIC void resize_SOSgroup(SOSgroup *group) { if(group->sos_count == group->sos_alloc) { group->sos_alloc = (int)((double) group->sos_alloc*RESIZEFACTOR); group->sos_list = (SOSrec **) realloc(group->sos_list, (group->sos_alloc) * sizeof(*group->sos_list)); } } STATIC int append_SOSgroup(SOSgroup *group, SOSrec *SOS) { int i, k; SOSrec *SOSHold; /* Check if we should resize */ resize_SOSgroup(group); /* First append to the end of the list */ group->sos_list[group->sos_count] = SOS; group->sos_count++; i = abs(SOS->type); SETMAX(group->maxorder, i); if(i == 1) group->sos1_count++; k = group->sos_count; SOS->tagorder = k; /* Sort the SOS list by given priority */ for(i = group->sos_count-1; i > 0; i--) { if(group->sos_list[i]->priority < group->sos_list[i-1]->priority) { SOSHold = group->sos_list[i]; group->sos_list[i] = group->sos_list[i-1]; group->sos_list[i-1] = SOSHold; if(SOSHold == SOS) k = i; /* This is the index in the [1..> range */ } else break; } /* Return the list index of the new SOS */ return( k ); } STATIC int clean_SOSgroup(SOSgroup *group, MYBOOL forceupdatemap) { int i, n, k; SOSrec *SOS; if(group == NULL) return( 0 ); /* Delete any SOS without members or trivial member count */ n = 0; if(group->sos_alloc > 0) { group->maxorder = 0; for(i = group->sos_count; i > 0; i--) { SOS = group->sos_list[i-1]; k = SOS->members[0]; if((k == 0) || /* Empty */ ((k == abs(SOS->type)) && (k <= 2))) { /* Trivial */ delete_SOSrec(group, i); n++; } else { SETMAX(group->maxorder, abs(SOS->type)); } } if((n > 0) || forceupdatemap) SOS_member_updatemap(group); } return( n ); } STATIC void free_SOSgroup(SOSgroup **group) { int i; if((group == NULL) || (*group == NULL)) return; if((*group)->sos_alloc > 0) { for(i = 0; i < (*group)->sos_count; i++) free_SOSrec((*group)->sos_list[i]); FREE((*group)->sos_list); FREE((*group)->membership); FREE((*group)->memberpos); } FREE(*group); } /* SOS record functions */ STATIC SOSrec *create_SOSrec(SOSgroup *group, char *name, int type, int priority, int size, int *variables, REAL *weights) { SOSrec *SOS; SOS = (SOSrec *) calloc(1 , sizeof(*SOS)); SOS->parent = group; SOS->type = type; if(name == NULL) SOS->name = NULL; else { allocCHAR(group->lp, &SOS->name, (int) (strlen(name)+1), FALSE); strcpy(SOS->name, name); } if(type < 0) type = abs(type); SOS->tagorder = 0; SOS->size = 0; SOS->priority = priority; SOS->members = NULL; SOS->weights = NULL; SOS->membersSorted = NULL; SOS->membersMapped = NULL; if(size > 0) size = append_SOSrec(SOS, size, variables, weights); return(SOS); } STATIC int append_SOSrec(SOSrec *SOS, int size, int *variables, REAL *weights) { int i, oldsize, newsize, nn; lprec *lp = SOS->parent->lp; oldsize = SOS->size; newsize = oldsize + size; nn = abs(SOS->type); /* Shift existing active data right (normally zero) */ if(SOS->members == NULL) allocINT(lp, &SOS->members, 1+newsize+1+nn, TRUE); else { allocINT(lp, &SOS->members, 1+newsize+1+nn, AUTOMATIC); for(i = newsize+1+nn; i > newsize+1; i--) SOS->members[i] = SOS->members[i-size]; } SOS->members[0] = newsize; SOS->members[newsize+1] = nn; /* Copy the new data into the arrays */ if(SOS->weights == NULL) allocREAL(lp, &SOS->weights, 1+newsize, TRUE); else allocREAL(lp, &SOS->weights, 1+newsize, AUTOMATIC); for(i = oldsize+1; i <= newsize; i++) { SOS->members[i] = variables[i-oldsize-1]; if((SOS->members[i] < 1) || (SOS->members[i] > lp->columns)) report(lp, IMPORTANT, "append_SOS_rec: Invalid SOS variable definition for index %d\n", SOS->members[i]); else { if(SOS->isGUB) lp->var_type[SOS->members[i]] |= ISGUB; else lp->var_type[SOS->members[i]] |= ISSOS; } if(weights == NULL) SOS->weights[i] = i; /* Follow standard, which is sorted ascending */ else SOS->weights[i] = weights[i-oldsize-1]; SOS->weights[0] += SOS->weights[i]; } /* Sort the new paired lists ascending by weight (simple bubble sort) */ i = sortByREAL(SOS->members, SOS->weights, newsize, 1, TRUE); if(i > 0) report(lp, DETAILED, "append_SOS_rec: Non-unique SOS variable weight for index %d\n", i); /* Define mapping arrays to search large SOS's faster */ allocINT(lp, &SOS->membersSorted, newsize, AUTOMATIC); allocINT(lp, &SOS->membersMapped, newsize, AUTOMATIC); for(i = oldsize+1; i <= newsize; i++) { SOS->membersSorted[i - 1] = SOS->members[i]; SOS->membersMapped[i - 1] = i; } sortByINT(SOS->membersMapped, SOS->membersSorted, newsize, 0, TRUE); /* Confirm the new size */ SOS->size = newsize; return(newsize); } STATIC int make_SOSchain(lprec *lp, MYBOOL forceresort) { int i, j, k, n; MYBOOL *hold = NULL; REAL *order, sum, weight; SOSgroup *group = lp->SOS; /* PART A: Resort individual SOS member lists, if specified */ if(forceresort) SOS_member_sortlist(group, 0); /* PART B: Tally SOS variables and create master SOS variable list */ n = 0; for(i = 0; i < group->sos_count; i++) n += group->sos_list[i]->size; lp->sos_vars = n; if(lp->sos_vars > 0) /* Prevent memory loss in case of multiple solves */ FREE(lp->sos_priority); allocINT(lp, &lp->sos_priority, n, FALSE); allocREAL(lp, &order, n, FALSE); /* Move variable data to the master SOS list and sort by ascending weight */ n = 0; sum = 0; for(i = 0; i < group->sos_count; i++) { for(j = 1; j <= group->sos_list[i]->size; j++) { lp->sos_priority[n] = group->sos_list[i]->members[j]; weight = group->sos_list[i]->weights[j]; sum += weight; order[n] = sum; n++; } } hpsortex(order, n, 0, sizeof(*order), FALSE, compareREAL, lp->sos_priority); FREE(order); /* Remove duplicate SOS variables */ allocMYBOOL(lp, &hold, lp->columns+1, TRUE); k = 0; for(i = 0; i < n; i++) { j = lp->sos_priority[i]; if(!hold[j]) { hold[j] = TRUE; if(k < i) lp->sos_priority[k] = j; k++; } } FREE(hold); /* Adjust the size of the master variable list, if necessary */ if(k < lp->sos_vars) { allocINT(lp, &lp->sos_priority, k, AUTOMATIC); lp->sos_vars = k; } return( k ); } STATIC MYBOOL delete_SOSrec(SOSgroup *group, int sosindex) { #ifdef Paranoia if((sosindex <= 0) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "delete_SOSrec: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif /* Delete and free the SOS record */ if(abs(SOS_get_type(group, sosindex)) == 1) group->sos1_count--; free_SOSrec(group->sos_list[sosindex-1]); while(sosindex < group->sos_count) { group->sos_list[sosindex-1] = group->sos_list[sosindex]; sosindex++; } group->sos_count--; /* Update maxorder */ group->maxorder = 0; for(sosindex = 0; sosindex < group->sos_count; sosindex++) { SETMAX(group->maxorder, abs(group->sos_list[sosindex]->type)); } return(TRUE); } STATIC void free_SOSrec(SOSrec *SOS) { if(SOS->name != NULL) FREE(SOS->name); if(SOS->size > 0) { FREE(SOS->members); FREE(SOS->weights); FREE(SOS->membersSorted); FREE(SOS->membersMapped); } FREE(SOS); } STATIC MYBOOL SOS_member_sortlist(SOSgroup *group, int sosindex) /* Routine to (re-)sort SOS member arrays for faster access to large SOSes */ { int i, n; int *list; lprec *lp = group->lp; SOSrec *SOS; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_member_sortlist: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) { if(!SOS_member_sortlist(group, i)) return(FALSE); } } else { SOS = group->sos_list[sosindex-1]; list = SOS->members; n = list[0]; /* Make sure that the arrays are properly allocated and sized */ if(n != group->sos_list[sosindex-1]->size) { allocINT(lp, &SOS->membersSorted, n, AUTOMATIC); allocINT(lp, &SOS->membersMapped, n, AUTOMATIC); group->sos_list[sosindex-1]->size = n; } /* Reload the arrays and do the sorting */ for(i = 1; i <= n; i++) { SOS->membersSorted[i - 1] = list[i]; SOS->membersMapped[i - 1] = i; } sortByINT(SOS->membersMapped, SOS->membersSorted, n, 0, TRUE); } return( TRUE ); } STATIC int SOS_member_updatemap(SOSgroup *group) { int i, j, k, n, nvars = 0, *list, *tally = NULL; SOSrec *rec; lprec *lp = group->lp; /* (Re)-initialize usage arrays */ allocINT(lp, &group->memberpos, lp->columns+1, AUTOMATIC); allocINT(lp, &tally, lp->columns+1, TRUE); /* Get each variable's SOS membership count */ for(i = 0; i < group->sos_count; i++) { rec = group->sos_list[i]; n = rec->size; list = rec->members; for(j = 1; j <= n; j++) { k = list[j]; #ifdef Paranoia if((k < 1) || (k > lp->columns)) report(lp, SEVERE, "SOS_member_updatemap: Member %j of SOS number %d is out of column range (%d)\n", j, i+1, k); #endif tally[k]++; } } /* Compute pointer into column-sorted array */ group->memberpos[0] = 0; for(i = 1; i <= lp->columns; i++) { n = tally[i]; if(n > 0) nvars++; group->memberpos[i] = group->memberpos[i-1] + n; } n = group->memberpos[lp->columns]; MEMCOPY(tally+1, group->memberpos, lp->columns); /* Load the column-sorted SOS indeces / pointers */ allocINT(lp, &group->membership, n+1, AUTOMATIC); for(i = 0; i < group->sos_count; i++) { rec = group->sos_list[i]; n = rec->size; list = rec->members; for(j = 1; j <= n; j++) { k = tally[list[j]]++; #ifdef Paranoia if(k > group->memberpos[lp->columns]) report(lp, SEVERE, "SOS_member_updatemap: Member mapping for variable %j of SOS number %d is invalid\n", list[j], i+1); #endif group->membership[k] = i+1; } } FREE(tally); return( nvars ); } STATIC MYBOOL SOS_shift_col(SOSgroup *group, int sosindex, int column, int delta, LLrec *usedmap, MYBOOL forceresort) /* Routine to adjust SOS indeces for variable insertions or deletions; Note: SOS_shift_col must be called before make_SOSchain! */ { int i, ii, n, nn, nr; int changed; int *list; REAL *weights; #ifdef Paranoia lprec *lp = group->lp; if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_shift_col: Invalid SOS index %d\n", sosindex); return(FALSE); } else if((column < 1) || (delta == 0)) { report(lp, IMPORTANT, "SOS_shift_col: Invalid column %d specified with delta %d\n", column, delta); return(FALSE); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) { if(!SOS_shift_col(group, i, column, delta, usedmap, forceresort)) return(FALSE); } } else { list = group->sos_list[sosindex-1]->members; weights = group->sos_list[sosindex-1]->weights; n = list[0]; nn = list[n+1]; /* Case where variable indeces are to be incremented */ if(delta > 0) { for(i = 1; i <= n; i++) { if(list[i] >= column) list[i] += delta; } } /* Case where variables are to be deleted/indeces decremented */ else { changed = 0; if(usedmap != NULL) { int *newidx = NULL; /* Defer creation of index mapper until we are sure that a member of this SOS is actually targeted for deletion */ if(newidx == NULL) { allocINT(group->lp, &newidx, group->lp->columns+1, TRUE); for(i = firstActiveLink(usedmap), ii = 1; i != 0; i = nextActiveLink(usedmap, i), ii++) newidx[i] = ii; } for(i = 1, ii = 0; i <= n; i++) { nr = list[i]; /* Check if this SOS variable should be deleted */ if(!isActiveLink(usedmap, nr)) continue; /* If the index is "high" then make adjustment and shift */ changed++; ii++; list[ii] = newidx[nr]; weights[ii] = weights[i]; } FREE(newidx); } else for(i = 1, ii = 0; i <= n; i++) { nr = list[i]; /* Check if this SOS variable should be deleted */ if((nr >= column) && (nr < column-delta)) continue; /* If the index is "high" then decrement */ if(nr > column) { changed++; nr += delta; } ii++; list[ii] = nr; weights[ii] = weights[i]; } /* Update the SOS length / type indicators */ if(ii < n) { list[0] = ii; list[ii+1] = nn; } /* Update mapping arrays to search large SOS's faster */ if(forceresort && ((ii < n) || (changed > 0))) SOS_member_sortlist(group, sosindex); } } return(TRUE); } int SOS_member_count(SOSgroup *group, int sosindex) { SOSrec *SOS; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "SOS_member_count: Invalid SOS index %d\n", sosindex); return( -1 ); } #endif SOS = group->sos_list[sosindex-1]; return( SOS->members[0] ); } int SOS_member_delete(SOSgroup *group, int sosindex, int member) { int *list, i, i2, k, n, nn = 0; SOSrec *SOS; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "SOS_member_delete: Invalid SOS index %d\n", sosindex); return( -1 ); } #endif if(sosindex == 0) { for(i = group->memberpos[member-1]; i < group->memberpos[member]; i++) { k = group->membership[i]; n = SOS_member_delete(group, k, member); if(n >= 0) nn += n; else return( n ); } /* We must update the mapper */ k = group->memberpos[member]; i = group->memberpos[member-1]; n = group->memberpos[lp->columns] - k; if(n > 0) MEMCOPY(group->membership + i, group->membership + k, n); for(i = member; i <= lp->columns; i++) group->memberpos[i] = group->memberpos[i-1]; } else { SOS = group->sos_list[sosindex-1]; list = SOS->members; n = list[0]; /* Find the offset of the member */ i = 1; while((i <= n) && (abs(list[i]) != member)) i++; if(i > n) return( -1 ); nn++; /* Shift remaining members *and* the active count one position left */ while(i <= n) { list[i] = list[i+1]; i++; } list[0]--; SOS->size--; /* Do the same with the active list one position left */ i = n + 1; i2 = i + list[n]; k = i + 1; while(i < i2) { if(abs(list[k]) == member) k++; list[i] = list[k]; i++; k++; } } return( nn ); } int SOS_get_type(SOSgroup *group, int sosindex) { #ifdef Paranoia if((sosindex < 1) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "SOS_get_type: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif return(group->sos_list[sosindex-1]->type); } int SOS_infeasible(SOSgroup *group, int sosindex) { int i, n, nn, varnr, failindex, *list; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_infeasible: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(sosindex == 0 && group->sos_count == 1) sosindex = 1; failindex = 0; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) { failindex = SOS_infeasible(group, i); if(failindex > 0) break; } } else { list = group->sos_list[sosindex-1]->members; n = list[0]; nn = list[n+1]; /* Find index of next lower-bounded variable */ for(i = 1; i <= n; i++) { varnr = abs(list[i]); if((lp->orig_lowbo[lp->rows + varnr] > 0) && !((lp->sc_vars > 0) && is_semicont(lp, varnr))) break; } /* Find if there is another lower-bounded variable beyond the type window */ i = i+nn; while(i <= n) { varnr = abs(list[i]); if((lp->orig_lowbo[lp->rows + varnr] > 0) && !((lp->sc_vars > 0) && is_semicont(lp, varnr))) break; i++; } if(i <= n) failindex = abs(list[i]); } return(failindex); } int SOS_member_index(SOSgroup *group, int sosindex, int member) { int n; SOSrec *SOS; SOS = group->sos_list[sosindex-1]; n = SOS->members[0]; n = searchFor(member, SOS->membersSorted, n, 0, FALSE); if(n >= 0) n = SOS->membersMapped[n]; return(n); } int SOS_memberships(SOSgroup *group, int varnr) { int i, n = 0; lprec *lp; /* Check if there is anything to do */ if((group == NULL) || (SOS_count(lp = group->lp) == 0)) return( n ); #ifdef Paranoia if((varnr < 0) || (varnr > lp->columns)) { report(lp, IMPORTANT, "SOS_memberships: Invalid variable index %d given\n", varnr); return( n ); } #endif if(varnr == 0) { for(i = 1; i <= lp->columns; i++) if(group->memberpos[i] > group->memberpos[i-1]) n++; } else n = group->memberpos[varnr] - group->memberpos[varnr-1]; return( n ); } int SOS_is_member(SOSgroup *group, int sosindex, int column) { int i, n = FALSE, *list; lprec *lp; if(group == NULL) return( FALSE ); lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_member: Invalid SOS index %d\n", sosindex); return(n); } #endif if(sosindex == 0) { if(lp->var_type[column] & (ISSOS | ISGUB)) n = (MYBOOL) (SOS_memberships(group, column) > 0); } else if(lp->var_type[column] & (ISSOS | ISGUB)) { /* Search for the variable */ i = SOS_member_index(group, sosindex, column); /* Signal active status if found, otherwise return FALSE */ if(i > 0) { list = group->sos_list[sosindex-1]->members; if(list[i] < 0) n = -TRUE; else n = TRUE; } } return(n); } MYBOOL SOS_is_member_of_type(SOSgroup *group, int column, int sostype) { int i, k, n; if(group != NULL) for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { k = group->membership[i]; n = SOS_get_type(group, k); if(((n == sostype) || ((sostype == SOSn) && (n > 2))) && SOS_is_member(group, k, column)) return(TRUE); } return(FALSE); } MYBOOL SOS_set_GUB(SOSgroup *group, int sosindex, MYBOOL state) { int i; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "SOS_set_GUB: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) SOS_set_GUB(group, i, state); } else group->sos_list[sosindex-1]->isGUB = state; return(TRUE); } MYBOOL SOS_is_GUB(SOSgroup *group, int sosindex) { int i; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(group->lp, IMPORTANT, "SOS_is_GUB: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) { if(SOS_is_GUB(group, i)) return(TRUE); } return(FALSE); } else return( group->sos_list[sosindex-1]->isGUB ); } MYBOOL SOS_is_marked(SOSgroup *group, int sosindex, int column) { int i, k, n, *list; lprec *lp; if(group == NULL) return( FALSE ); lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_marked: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { k = group->membership[i]; n = SOS_is_marked(group, k, column); if(n) return(TRUE); } } else { list = group->sos_list[sosindex-1]->members; n = list[0]; /* Search for the variable (normally always faster to do linear search here) */ column = -column; for(i = 1; i <= n; i++) if(list[i] == column) return(TRUE); } return(FALSE); } MYBOOL SOS_is_active(SOSgroup *group, int sosindex, int column) { int i, n, nn, *list; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_active: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { nn = group->membership[i]; n = SOS_is_active(group, nn, column); if(n) return(TRUE); } } else { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; /* Scan the active (non-zero) SOS index list */ for(i = 1; (i <= nn) && (list[n+i] != 0); i++) if(list[n+i] == column) return(TRUE); } return(FALSE); } MYBOOL SOS_is_full(SOSgroup *group, int sosindex, int column, MYBOOL activeonly) { int i, nn, n, *list; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_full: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { nn = group->membership[i]; if(SOS_is_full(group, nn, column, activeonly)) return(TRUE); } } else if(SOS_is_member(group, sosindex, column)) { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; /* Info: Last item in the active list is non-zero if the current SOS is full */ if(list[n+nn] != 0) return(TRUE); if(!activeonly) { /* Spool to last active variable */ for(i = nn-1; (i > 0) && (list[n+i] == 0); i--); /* Having found it, check if subsequent variables are set (via bounds) as inactive */ if(i > 0) { nn -= i; /* Compute unused active slots */ i = SOS_member_index(group, sosindex, list[n+i]); for(; (nn > 0) && (list[i] < 0); i++, nn--); if(nn == 0) return(TRUE); } } } return(FALSE); } MYBOOL SOS_can_activate(SOSgroup *group, int sosindex, int column) { int i, n, nn, nz, *list; lprec *lp; if(group == NULL) return( FALSE ); lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_can_activate: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { nn = group->membership[i]; n = SOS_can_activate(group, nn, column); if(n == FALSE) return(FALSE); } } else if(SOS_is_member(group, sosindex, column)) { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; #if 0 /* Accept if the SOS is empty */ if(list[n+1] == 0) return(TRUE); #endif /* Cannot activate a variable if the SOS is full */ if(list[n+nn] != 0) return(FALSE); /* Check if there are variables quasi-active via non-zero lower bounds */ nz = 0; for(i = 1; i < n; i++) if(lp->bb_bounds->lowbo[lp->rows+abs(list[i])] > 0) { nz++; /* Reject outright if selected column has a non-zero lower bound */ if(list[i] == column) return(FALSE); } #ifdef Paranoia if(nz > nn) report(lp, SEVERE, "SOS_can_activate: Found too many non-zero member variables for SOS index %d\n", sosindex); #endif for(i = 1; i <= nn; i++) { if(list[n+i] == 0) break; if(lp->bb_bounds->lowbo[lp->rows+list[n+i]] == 0) nz++; } if(nz == nn) return(FALSE); /* Accept if the SOS is empty */ if(list[n+1] == 0) return(TRUE); /* Check if we can set variable active in SOS2..SOSn (must check left and right neighbours if one variable is already active) */ if(nn > 1) { /* Find the variable that was last activated; Also check that the candidate variable is not already active */ for(i = 1; i <= nn; i++) { if(list[n+i] == 0) break; if(list[n+i] == column) return(FALSE); } i--; nn = list[n+i]; /* SOS accepts an additional variable; confirm neighbourness of candidate; Search for the SOS set index of the last activated variable */ n = list[0]; for(i = 1; i <= n; i++) if(abs(list[i]) == nn) break; if(i > n) { report(lp, CRITICAL, "SOS_can_activate: Internal index error at SOS %d\n", sosindex); return(FALSE); } /* SOS accepts an additional variable; confirm neighbourness of candidate */ /* Check left neighbour */ if((i > 1) && (list[i-1] == column)) return(TRUE); /* Check right neighbour */ if((i < n) && (list[i+1] == column)) return(TRUE); /* It is not the right neighbour; return false */ return(FALSE); } } return(TRUE); } MYBOOL SOS_set_marked(SOSgroup *group, int sosindex, int column, MYBOOL asactive) { int i, n, nn, *list; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_set_marked: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { /* Define an IBM-"SOS3" member variable temporarily as integer, if it is not already a permanent integer; is reset in SOS_unmark */ if(asactive && !is_int(lp, column) && SOS_is_member_of_type(group, column, SOS3)) { lp->var_type[column] |= ISSOSTEMPINT; set_int(lp, column, TRUE); } nn = 0; for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { n = group->membership[i]; if(SOS_set_marked(group, n, column, asactive)) nn++; } return((MYBOOL) (nn == group->sos_count)); } else { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; /* Search for the variable */ i = SOS_member_index(group, sosindex, column); /* First mark active in the set member list as used */ if((i > 0) && (list[i] > 0)) list[i] *= -1; else return(TRUE); /* Then move the variable to the live list */ if(asactive) { for(i = 1; i <= nn; i++) { if(list[n+i] == column) return(FALSE); else if(list[n+i] == 0) { list[n+i] = column; return(FALSE); } } } return(TRUE); } } MYBOOL SOS_unmark(SOSgroup *group, int sosindex, int column) { int i, n, nn, *list; MYBOOL isactive; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_unmark: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif if(!(lp->var_type[column] & (ISSOS | ISGUB))) return(FALSE); if(sosindex == 0) { /* Undefine a SOS3 member variable that has temporarily been set as integer */ if(lp->var_type[column] & ISSOSTEMPINT) { lp->var_type[column] &= !ISSOSTEMPINT; set_int(lp, column, FALSE); } nn = 0; for(i = group->memberpos[column-1]; i < group->memberpos[column]; i++) { n = group->membership[i]; if(SOS_unmark(group, n, column)) nn++; } return((MYBOOL) (nn == group->sos_count)); } else { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; /* Search for the variable */ i = SOS_member_index(group, sosindex, column); /* Restore sign in main list */ if((i > 0) && (list[i] < 0)) list[i] *= -1; else return(TRUE); /* Find the variable in the active list... */ isactive = SOS_is_active(group, sosindex, column); if(isactive) { for(i = 1; i <= nn; i++) if(list[n+i] == column) break; /* ...shrink the list if found, otherwise return error */ if(i <= nn) { for(; ilp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_fix_unmarked: Invalid SOS index %d\n", sosindex); return(FALSE); } #endif count = 0; if(sosindex == 0) { for(i = group->memberpos[variable-1]; i < group->memberpos[variable]; i++) { n = group->membership[i]; count += SOS_fix_unmarked(group, n, variable, bound, value, isupper, diffcount, changelog); } } else { list = group->sos_list[sosindex-1]->members; n = list[0]+1; /* Count the number of active and free SOS variables */ nn = list[n]; for(i = 1; i <= nn; i++) { if(list[n+i] == 0) break; } i--; i = nn - i; /* Establish the number of unused slots */ /* Determine the free SOS variable window */ if(i == nn) { nLeft = 0; nRight = SOS_member_index(group, sosindex, variable); } else { nLeft = SOS_member_index(group, sosindex, list[n+1]); if(variable == list[n+1]) nRight = nLeft; else nRight = SOS_member_index(group, sosindex, variable); } nRight += i; /* Loop (nRight+1)..n */ /* Fix variables outside of the free SOS variable window */ for(i = 1; i < n; i++) { /* Skip the SOS variable window */ if((i >= nLeft) && (i <= nRight)) continue; /* Otherwise proceed to set bound */ ii = list[i]; if(ii > 0) { ii += lp->rows; if(bound[ii] != value) { /* Verify that we don't violate original bounds */ if(isupper && (value < lp->orig_lowbo[ii])) return(-ii); else if(!isupper && (value > lp->orig_upbo[ii])) return(-ii); /* OK, set the new bound */ count++; if(changelog == NULL) bound[ii] = value; else modifyUndoLadder(changelog, ii, bound, value); } if((diffcount != NULL) && (lp->solution[ii] != value)) (*diffcount)++; } } } return(count); } int *SOS_get_candidates(SOSgroup *group, int sosindex, int column, MYBOOL excludetarget, REAL *upbound, REAL *lobound) { int i, ii, j, n, nn = 0, *list, *candidates = NULL; lprec *lp = group->lp; if(group == NULL) return( candidates ); #ifdef Paranoia if(sosindex > group->sos_count) { report(lp, IMPORTANT, "SOS_get_candidates: Invalid index %d\n", sosindex); return( candidates ); } #endif /* Determine SOS target(s); note that if "sosindex" is negative, only the first non-empty SOS where "column" is a member is processed */ if(sosindex <= 0) { i = 0; ii = group->sos_count; } else { i = sosindex - 1; ii = sosindex; } /* Tally candidate usage */ allocINT(lp, &candidates, lp->columns+1, TRUE); for(; i < ii; i++) { if(!SOS_is_member(group, i+1, column)) continue; list = group->sos_list[i]->members; n = list[0]; while(n > 0) { j = list[n]; if((j > 0) && (upbound[lp->rows+j] > 0)) { if(lobound[lp->rows+j] > 0) { report(lp, IMPORTANT, "SOS_get_candidates: Invalid non-zero lower bound setting\n"); n = 0; goto Finish; } if(candidates[j] == 0) nn++; candidates[j]++; } n--; } if((sosindex < 0) && (nn > 1)) break; } /* Condense the list into indeces */ n = 0; for(i = 1; i <= lp->columns; i++) { if((candidates[i] > 0) && (!excludetarget || (i != column))) { n++; candidates[n] = i; } } /* Finalize */ Finish: candidates[0] = n; if(n == 0) FREE(candidates); return( candidates); } int SOS_fix_list(SOSgroup *group, int sosindex, int variable, REAL *bound, int *varlist, MYBOOL isleft, DeltaVrec *changelog) { int i, ii, jj, count = 0; REAL value = 0; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_fix_list: Invalid index %d\n", sosindex); return(FALSE); } #endif if(sosindex == 0) { for(i = group->memberpos[variable-1]; i < group->memberpos[variable]; i++) { ii = group->membership[i]; count += SOS_fix_list(group, ii, variable, bound, varlist, isleft, changelog); } } else { /* Establish the number of unmarked variables in the left window (note that "variable" should have been marked previously) */ ii = varlist[0] / 2; if(isleft) { i = 1; if(isleft == AUTOMATIC) ii = varlist[0]; } else { i = ii + 1; ii = varlist[0]; } /* Loop over members to fix values at the new bound (zero) */ while(i <= ii) { if(SOS_is_member(group, sosindex, varlist[i])) { jj = lp->rows + varlist[i]; /* Verify that we don't violate original bounds */ if(value < lp->orig_lowbo[jj]) return( -jj ); /* OK, set the new bound */ count++; if(changelog == NULL) bound[jj] = value; else modifyUndoLadder(changelog, jj, bound, value); } i++; } } return( count ); } int SOS_is_satisfied(SOSgroup *group, int sosindex, REAL *solution) /* Determine if the SOS is satisfied for the current solution vector; The return code is in the range [-2..+2], depending on the type of satisfaction. Positive return value means too many non-zero values, negative value means set incomplete: -2: Set member count not full (SOS3) -1: Set member count not full 0: Set is full (also returned if the SOS index is invalid) 1: Too many non-zero sequential variables 2: Set consistency error */ { int i, n, nn, count, *list; int type, status = 0; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_satisfied: Invalid index %d\n", sosindex); return( SOS_COMPLETE ); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; i <= group->sos_count; i++) { status = SOS_is_satisfied(group, i, solution); if((status != SOS_COMPLETE) && (status != SOS_INCOMPLETE)) break; } } else { type = SOS_get_type(group, sosindex); list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; /* Count the number of active SOS variables */ for(i = 1; i <= nn; i++) { if(list[n+i] == 0) break; } count = i-1; if(count == nn) status = SOS_COMPLETE; /* Set is full */ else status = SOS_INCOMPLETE; /* Set is partial */ /* Find index of the first active variable; fail if some are non-zero */ if(count > 0) { nn = list[n+1]; for(i = 1; i < n; i++) { if((abs(list[i]) == nn) || (solution[lp->rows + abs(list[i])] != 0)) break; } if(abs(list[i]) != nn) status = SOS_INTERNALERROR; /* Set consistency error (leading set variables are non-zero) */ else { /* Scan active SOS variables until we find a non-zero value */ while(count > 0) { if(solution[lp->rows + abs(list[i])] != 0) break; i++; count--; } /* Scan active non-zero SOS variables; break at first non-zero (rest required to be zero) */ while(count > 0) { if(solution[lp->rows + abs(list[i])] == 0) break; i++; count--; } if(count > 0) status = SOS_INTERNALERROR; /* Set consistency error (active set variables are zero) */ } } else { i = 1; /* There are no active variables; see if we have happened to find a valid header */ while((i < n) && (solution[lp->rows + abs(list[i])] == 0)) i++; count = 0; while((i < n) && (count <= nn) && (solution[lp->rows + abs(list[i])] != 0)) { count++; i++; } if(count > nn) status = SOS_INFEASIBLE; /* Too-many sequential non-zero variables */ } /* Scan the trailing set of SOS variables; fail if some are non-zero */ if(status <= 0) { n--; while(i <= n) { if(solution[lp->rows + abs(list[i])] != 0) break; i++; } if(i <= n) status = SOS_INFEASIBLE; /* Too-many sequential non-zero variables */ /* Code member deficiency for SOS3 separately */ else if((status == -1) && (type <= SOS3)) status = SOS3_INCOMPLETE; } } return( status ); } MYBOOL SOS_is_feasible(SOSgroup *group, int sosindex, REAL *solution) /* Determine if the SOS is feasible up to the current SOS variable */ { int i, n, nn, *list; MYBOOL status = TRUE; lprec *lp = group->lp; #ifdef Paranoia if((sosindex < 0) || (sosindex > group->sos_count)) { report(lp, IMPORTANT, "SOS_is_feasible: Invalid SOS index %d\n", sosindex); return( 0 ); } #endif if((sosindex == 0) && (group->sos_count == 1)) sosindex = 1; if(sosindex == 0) { for(i = 1; status && (i <= group->sos_count); i++) { status = SOS_is_feasible(group, i, solution); } } else { list = group->sos_list[sosindex-1]->members; n = list[0]+1; nn = list[n]; if(nn <= 2) return(status); /* Find if we have a gap in the non-zero solution values */ i = 1; sosindex = 0; while((i <= nn) && (list[n+i] != 0)) { while((i <= nn) && (list[n+i] != 0) && (solution[lp->rows+list[n+i]] == 0)) i++; if((i <= nn) && (list[n+i] != 0)) { i++; /* Step to next */ while((i <= nn) && (list[n+i] != 0) && (solution[lp->rows+list[n+i]] != 0)) i++; sosindex++; } i++; /* Step to next */ } status = (MYBOOL) (sosindex <= 1); } return(status); } lp_solve_5.5/lp_SOS.h100666 0 0 11023 11141374255 13067 0ustar usergroup#ifndef HEADER_lp_SOS #define HEADER_lp_SOS /* Specially Ordered Sets (SOS) prototypes and settings */ /* ------------------------------------------------------------------------- */ #include "lp_types.h" #include "lp_utils.h" #include "lp_matrix.h" /* SOS constraint defines */ /* ------------------------------------------------------------------------- */ #define SOS1 1 #define SOS2 2 #define SOS3 -1 #define SOSn MAXINT32 #define SOS_START_SIZE 10 /* Start size of SOS_list array; realloced if needed */ /* Define SOS_is_feasible() return values */ /* ------------------------------------------------------------------------- */ #define SOS3_INCOMPLETE -2 #define SOS_INCOMPLETE -1 #define SOS_COMPLETE 0 #define SOS_INFEASIBLE 1 #define SOS_INTERNALERROR 2 typedef struct _SOSgroup SOSgroup; typedef struct _SOSrec { SOSgroup *parent; int tagorder; char *name; int type; MYBOOL isGUB; int size; int priority; int *members; REAL *weights; int *membersSorted; int *membersMapped; } SOSrec; /* typedef */ struct _SOSgroup { lprec *lp; /* Pointer to owner */ SOSrec **sos_list; /* Array of pointers to SOS lists */ int sos_alloc; /* Size allocated to specially ordered sets (SOS1, SOS2...) */ int sos_count; /* Number of specially ordered sets (SOS1, SOS2...) */ int maxorder; /* The highest-order SOS in the group */ int sos1_count; /* Number of the lowest order SOS in the group */ int *membership; /* Array of variable-sorted indeces to SOSes that the variable is member of */ int *memberpos; /* Starting positions of the each column's membership list */ } /* SOSgroup */; #ifdef __cplusplus extern "C" { #endif /* SOS storage structure */ STATIC SOSgroup *create_SOSgroup(lprec *lp); STATIC void resize_SOSgroup(SOSgroup *group); STATIC int append_SOSgroup(SOSgroup *group, SOSrec *SOS); STATIC int clean_SOSgroup(SOSgroup *group, MYBOOL forceupdatemap); STATIC void free_SOSgroup(SOSgroup **group); STATIC SOSrec *create_SOSrec(SOSgroup *group, char *name, int type, int priority, int size, int *variables, REAL *weights); STATIC MYBOOL delete_SOSrec(SOSgroup *group, int sosindex); STATIC int append_SOSrec(SOSrec *SOS, int size, int *variables, REAL *weights); STATIC void free_SOSrec(SOSrec *SOS); /* SOS utilities */ STATIC int make_SOSchain(lprec *lp, MYBOOL forceresort); STATIC int SOS_member_updatemap(SOSgroup *group); STATIC MYBOOL SOS_member_sortlist(SOSgroup *group, int sosindex); STATIC MYBOOL SOS_shift_col(SOSgroup *group, int sosindex, int column, int delta, LLrec *usedmap, MYBOOL forceresort); int SOS_member_delete(SOSgroup *group, int sosindex, int member); int SOS_get_type(SOSgroup *group, int sosindex); int SOS_infeasible(SOSgroup *group, int sosindex); int SOS_member_index(SOSgroup *group, int sosindex, int member); int SOS_member_count(SOSgroup *group, int sosindex); int SOS_memberships(SOSgroup *group, int column); int *SOS_get_candidates(SOSgroup *group, int sosindex, int column, MYBOOL excludetarget, REAL *upbound, REAL *lobound); int SOS_is_member(SOSgroup *group, int sosindex, int column); MYBOOL SOS_is_member_of_type(SOSgroup *group, int column, int sostype); MYBOOL SOS_set_GUB(SOSgroup *group, int sosindex, MYBOOL state); MYBOOL SOS_is_GUB(SOSgroup *group, int sosindex); MYBOOL SOS_is_marked(SOSgroup *group, int sosindex, int column); MYBOOL SOS_is_active(SOSgroup *group, int sosindex, int column); MYBOOL SOS_is_full(SOSgroup *group, int sosindex, int column, MYBOOL activeonly); MYBOOL SOS_can_activate(SOSgroup *group, int sosindex, int column); MYBOOL SOS_set_marked(SOSgroup *group, int sosindex, int column, MYBOOL asactive); MYBOOL SOS_unmark(SOSgroup *group, int sosindex, int column); int SOS_fix_unmarked(SOSgroup *group, int sosindex, int variable, REAL *bound, REAL value, MYBOOL isupper, int *diffcount, DeltaVrec *changelog); int SOS_fix_list(SOSgroup *group, int sosindex, int variable, REAL *bound, int *varlist, MYBOOL isleft, DeltaVrec *changelog); int SOS_is_satisfied(SOSgroup *group, int sosindex, REAL *solution); MYBOOL SOS_is_feasible(SOSgroup *group, int sosindex, REAL *solution); #ifdef __cplusplus } #endif #endif /* HEADER_lp_SOS */ lp_solve_5.5/lp_types.h100666 0 0 23077 11141374255 13603 0ustar usergroup#ifndef HEADER_lp_types #define HEADER_lp_types #ifdef WIN32 #include #endif /* Define data types */ /* ------------------------------------------------------------------------- */ #ifndef LLONG #if defined __BORLANDC__ #define LLONG __int64 #elif !defined _MSC_VER || _MSC_VER >= 1310 #define LLONG long long #else #define LLONG __int64 #endif #endif #ifndef COUNTER #define COUNTER LLONG #endif #ifndef REAL #define REAL double #endif #ifndef REALXP #if 1 #define REALXP long double /* Set local accumulation variable as long double */ #else #define REALXP REAL /* Set local accumulation as default precision */ #endif #endif #ifndef LREAL #if 0 #define LREAL long double /* Set global solution update variable as long double */ #else #define LREAL REAL /* Set global solution update variable as default precision */ #endif #endif #define RESULTVALUEMASK "%18.12g" /* Set fixed-format real-valued output precision; suggested width: ABS(exponent of DEF_EPSVALUE)+6. */ #define INDEXVALUEMASK "%8d" /* Set fixed-format integer-valued output width */ #ifndef DEF_STRBUFSIZE #define DEF_STRBUFSIZE 512 #endif #ifndef MAXINT32 #define MAXINT32 2147483647 #endif #ifndef MAXUINT32 #define MAXUINT32 4294967295 #endif #ifndef MAXINT64 #if defined _LONGLONG || defined __LONG_LONG_MAX__ || defined LLONG_MAX #define MAXINT64 9223372036854775807ll #else #define MAXINT64 9223372036854775807l #endif #endif #ifndef MAXUINT64 #if defined _LONGLONG || defined __LONG_LONG_MAX__ || defined LLONG_MAX #define MAXUINT64 18446744073709551615ll #else #define MAXUINT64 18446744073709551615l #endif #endif #ifndef CHAR_BIT #define CHAR_BIT 8 #endif #ifndef MYBOOL #define MYBOOL unsigned char /* Conserve memory, could be unsigned int */ #endif /* Constants */ /* ------------------------------------------------------------------------- */ #ifndef NULL #define NULL 0 #endif /* Byte-sized Booleans and extended options */ #define FALSE 0 #define TRUE 1 #define AUTOMATIC 2 #define DYNAMIC 4 /* Sorting and comparison constants */ #define COMP_PREFERCANDIDATE 1 #define COMP_PREFERNONE 0 #define COMP_PREFERINCUMBENT -1 /* Library load status values */ #define LIB_LOADED 0 #define LIB_NOTFOUND 1 #define LIB_NOINFO 2 #define LIB_NOFUNCTION 3 #define LIB_VERINVALID 4 #define LIB_STR_LOADED "Successfully loaded" #define LIB_STR_NOTFOUND "File not found" #define LIB_STR_NOINFO "No version data" #define LIB_STR_NOFUNCTION "Missing function header" #define LIB_STR_VERINVALID "Incompatible version" #define LIB_STR_MAXLEN 23 /* Compiler/target settings */ /* ------------------------------------------------------------------------- */ #if (defined _WIN32) || (defined WIN32) || (defined _WIN64) || (defined WIN64) # define __WINAPI WINAPI #else # define __WINAPI #endif #if (defined _WIN32) || (defined WIN32) || (defined _WIN64) || (defined WIN64) # define __VACALL __cdecl #else # define __VACALL #endif #ifndef __BORLANDC__ #ifdef _USRDLL #if 1 #define __EXPORT_TYPE __declspec(dllexport) #else /* Set up for the Microsoft compiler */ #ifdef LP_SOLVE_EXPORTS #define __EXPORT_TYPE __declspec(dllexport) #else #define __EXPORT_TYPE __declspec(dllimport) #endif #endif #else #define __EXPORT_TYPE #endif #ifdef __cplusplus #define __EXTERN_C extern "C" #else #define __EXTERN_C #endif #else /* Otherwise set up for the Borland compiler */ #ifdef __DLL__ #define _USRDLL #define __EXTERN_C extern "C" #ifdef __READING_THE_DLL #define __EXPORT_TYPE __import #else #define __EXPORT_TYPE __export #endif #else #define __EXPORT_TYPE #define __EXTERN_C extern "C" #endif #endif #if 0 #define STATIC static #else #define STATIC #endif #if !defined INLINE #if defined __cplusplus #define INLINE inline #elif (defined _WIN32) || (defined WIN32) || (defined _WIN64) || (defined WIN64) #define INLINE __inline #else #define INLINE static #endif #endif /* Function macros */ /* ------------------------------------------------------------------------- */ #define my_limitrange(x, lo, hi) ((x) < (lo) ? (lo) : ((x) > (hi) ? (hi) : (x))) #ifndef my_mod #define my_mod(n, m) ((n) % (m)) #endif #define my_if(t, x, y) ((t) ? (x) : (y)) #define my_sign(x) ((x) < 0 ? -1 : 1) #if 0 #define my_chsign(t, x) ( ((t) && ((x) != 0)) ? -(x) : (x)) #else #define my_chsign(t, x) ( (2*((t) == 0) - 1) * (x) ) /* "Pipelined" */ #endif #define my_flipsign(x) ( fabs((REAL) (x)) == 0 ? 0 : -(x) ) #define my_roundzero(val, eps) if (fabs((REAL) (val)) < eps) val = 0 #define my_avoidtiny(val, eps) (fabs((REAL) (val)) < eps ? 0 : val) #if 1 #define my_infinite(lp, val) ( (MYBOOL) (fabs(val) >= lp->infinite) ) #else #define my_infinite(lp, val) is_infinite(lp, val) #endif #define my_inflimit(lp, val) ( my_infinite(lp, val) ? lp->infinite * my_sign(val) : (val) ) #if 0 #define my_precision(val, eps) ((fabs((REAL) (val))) < (eps) ? 0 : (val)) #else #define my_precision(val, eps) restoreINT(val, eps) #endif #define my_reldiff(x, y) (((x) - (y)) / (1.0 + fabs((REAL) (y)))) #define my_boundstr(x) (fabs(x) < lp->infinite ? sprintf("%g",x) : ((x) < 0 ? "-Inf" : "Inf") ) #ifndef my_boolstr #define my_boolstr(x) (!(x) ? "FALSE" : "TRUE") #endif #define my_basisstr(isbasic) ((isbasic) ? "BASIC" : "NON-BASIC") #define my_simplexstr(isdual) ((isdual) ? "DUAL" : "PRIMAL") #define my_plural_std(count) (count == 1 ? "" : "s") #define my_plural_y(count) (count == 1 ? "y" : "ies") #define my_lowbound(x) ((FULLYBOUNDEDSIMPLEX) ? (x) : 0) /* Bound macros usable for both the standard and fully bounded simplex */ /* ------------------------------------------------------------------------- */ /* #define my_lowbo(lp, varnr) ( lp->isfullybounded ? lp->lowbo[varnr] : 0.0 ) #define my_upbo(lp, varnr) ( lp->isfullybounded ? lp->upbo[varnr] : lp->lowbo[varnr] + lp->upbo[varnr] ) #define my_rangebo(lp, varnr) ( lp->isfullybounded ? lp->upbo[varnr] - lp->lowbo[varnr] : lp->upbo[varnr] ) */ #define my_lowbo(lp, varnr) ( 0.0 ) #define my_upbo(lp, varnr) ( lp->lowbo[varnr] + lp->upbo[varnr] ) #define my_rangebo(lp, varnr) ( lp->upbo[varnr] ) #define my_unbounded(lp, varnr) ((lp->upbo[varnr] >= lp->infinite) && (lp->lowbo[varnr] <= -lp->infinite)) #define my_bounded(lp, varnr) ((lp->upbo[varnr] < lp->infinite) && (lp->lowbo[varnr] > -lp->infinite)) /* Forward declarations */ /* ------------------------------------------------------------------------- */ typedef struct _lprec lprec; typedef struct _INVrec INVrec; union QSORTrec; #ifndef UNIONTYPE #ifdef __cplusplus #define UNIONTYPE #else #define UNIONTYPE union #endif #endif /* B4 factorization optimization data */ typedef struct _B4rec { int *B4_var; /* Position of basic columns in the B4 basis */ int *var_B4; /* Variable in the B4 basis */ int *B4_row; /* B4 position of the i'th row */ int *row_B4; /* Original position of the i'th row */ REAL *wcol; int *nzwcol; } B4rec; #define OBJ_STEPS 5 typedef struct _OBJmonrec { lprec *lp; int oldpivstrategy, oldpivrule, pivrule, ruleswitches, limitstall[2], limitruleswitches, idxstep[OBJ_STEPS], countstep, startstep, currentstep, Rcycle, Ccycle, Ncycle, Mcycle, Icount; REAL thisobj, prevobj, objstep[OBJ_STEPS], thisinfeas, previnfeas, epsvalue; char spxfunc[10]; MYBOOL pivdynamic; MYBOOL isdual; MYBOOL active; } OBJmonrec; typedef struct _edgerec { REAL *edgeVector; } edgerec; typedef struct _pricerec { REAL theta; REAL pivot; REAL epspivot; int varno; lprec *lp; MYBOOL isdual; } pricerec; typedef struct _multirec { lprec *lp; int size; /* The maximum number of multiply priced rows/columns */ int used; /* The current / active number of multiply priced rows/columns */ int limit; /* The active/used count at which a full update is triggered */ pricerec *items; /* Array of best multiply priced rows/columns */ int *freeList; /* The indeces of available positions in "items" */ UNIONTYPE QSORTrec *sortedList; /* List of pointers to "pricerec" items in sorted order */ REAL *stepList; /* Working array (values in sortedList order) */ REAL *valueList; /* Working array (values in sortedList order) */ int *indexSet; /* The final exported index list of pivot variables */ int active; /* Index of currently active multiply priced row/column */ int retries; REAL step_base; REAL step_last; REAL obj_base; REAL obj_last; REAL epszero; REAL maxpivot; REAL maxbound; MYBOOL sorted; MYBOOL truncinf; MYBOOL objcheck; MYBOOL dirty; } multirec; #endif /* HEADER_lp_types */ lp_solve_5.5/lp_utils.c100666 0 0 63346 11245561740 13577 0ustar usergroup#define CODE_lp_utils #include #include "commonlib.h" #include "lp_lib.h" #include "lp_utils.h" #include #include #include "lp_bit.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Miscellaneous utilities as implemented for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: GLPL. Requires: lp_utils.h, lp_lib.h Release notes: v1.0.0 1 January 2003 Memory allocation, sorting, searching, time and doubly linked list functions. v1.1.0 15 May 2004 Added vector packing functionality v1.2.0 10 January 2005 Added vector pushing/popping functionality Modified return values and fixed problem in linked list functions. ---------------------------------------------------------------------------------- */ STATIC MYBOOL allocCHAR(lprec *lp, char **ptr, int size, MYBOOL clear) { if(clear == TRUE) *ptr = (char *) calloc(size, sizeof(**ptr)); else if(clear & AUTOMATIC) { *ptr = (char *) realloc(*ptr, size * sizeof(**ptr)); if(clear & TRUE) MEMCLEAR(*ptr, size); } else *ptr = (char *) malloc(size * sizeof(**ptr)); if(((*ptr) == NULL) && (size > 0)) { lp->report(lp, CRITICAL, "alloc of %d 'char' failed\n", size); lp->spx_status = NOMEMORY; return( FALSE ); } else return( TRUE ); } STATIC MYBOOL allocMYBOOL(lprec *lp, MYBOOL **ptr, int size, MYBOOL clear) { if(clear == TRUE) *ptr = (MYBOOL *) calloc(size, sizeof(**ptr)); else if(clear & AUTOMATIC) { *ptr = (MYBOOL *) realloc(*ptr, size * sizeof(**ptr)); if(clear & TRUE) MEMCLEAR(*ptr, size); } else *ptr = (MYBOOL *) malloc(size * sizeof(**ptr)); if(((*ptr) == NULL) && (size > 0)) { lp->report(lp, CRITICAL, "alloc of %d 'MYBOOL' failed\n", size); lp->spx_status = NOMEMORY; return( FALSE ); } else return( TRUE ); } STATIC MYBOOL allocINT(lprec *lp, int **ptr, int size, MYBOOL clear) { if(clear == TRUE) *ptr = (int *) calloc(size, sizeof(**ptr)); else if(clear & AUTOMATIC) { *ptr = (int *) realloc(*ptr, size * sizeof(**ptr)); if(clear & TRUE) MEMCLEAR(*ptr, size); } else *ptr = (int *) malloc(size * sizeof(**ptr)); if(((*ptr) == NULL) && (size > 0)) { lp->report(lp, CRITICAL, "alloc of %d 'INT' failed\n", size); lp->spx_status = NOMEMORY; return( FALSE ); } else return( TRUE ); } STATIC MYBOOL allocREAL(lprec *lp, REAL **ptr, int size, MYBOOL clear) { if(clear == TRUE) *ptr = (REAL *) calloc(size, sizeof(**ptr)); else if(clear & AUTOMATIC) { *ptr = (REAL *) realloc(*ptr, size * sizeof(**ptr)); if(clear & TRUE) MEMCLEAR(*ptr, size); } else *ptr = (REAL *) malloc(size * sizeof(**ptr)); if(((*ptr) == NULL) && (size > 0)) { lp->report(lp, CRITICAL, "alloc of %d 'REAL' failed\n", size); lp->spx_status = NOMEMORY; return( FALSE ); } else return( TRUE ); } STATIC MYBOOL allocLREAL(lprec *lp, LREAL **ptr, int size, MYBOOL clear) { if(clear == TRUE) *ptr = (LREAL *) calloc(size, sizeof(**ptr)); else if(clear & AUTOMATIC) { *ptr = (LREAL *) realloc(*ptr, size * sizeof(**ptr)); if(clear & TRUE) MEMCLEAR(*ptr, size); } else *ptr = (LREAL *) malloc(size * sizeof(**ptr)); if(((*ptr) == NULL) && (size > 0)) { lp->report(lp, CRITICAL, "alloc of %d 'LREAL' failed\n", size); lp->spx_status = NOMEMORY; return( FALSE ); } else return( TRUE ); } STATIC MYBOOL allocFREE(lprec *lp, void **ptr) { MYBOOL status = TRUE; if(*ptr != NULL) { free(*ptr); *ptr = NULL; } else { status = FALSE; lp->report(lp, CRITICAL, "free() failed on line %d of file %s\n", __LINE__, __FILE__); } return(status); } /* Do hoops to provide debugging info with FORTIFY */ #undef CODE_lp_utils #include "lp_utils.h" /* alloc-routines should always be before this line! */ int comp_bits(MYBOOL *bitarray1, MYBOOL *bitarray2, int items) { int i, items4, left = 0, right = 0; MYBOOL comp1; unsigned long comp4; /* Convert items count to 8-bit representation, if necessary */ if(items > 0) { i = items % 8; items /= 8; if(i) items++; } else items = -items; /* Do the wide unsigned integer part for speed */ items4 = items / sizeof(unsigned long); i = 0; while(i < items4) { comp4 = ((unsigned long *) bitarray1)[i] & ~((unsigned long *) bitarray2)[i]; if(comp4) left++; comp4 = ((unsigned long *) bitarray2)[i] & ~((unsigned long *) bitarray1)[i]; if(comp4) right++; i++; } /* Do the trailing slow narrow unsigned integer part */ i *= sizeof(unsigned long); i++; while(i < items) { comp1 = bitarray1[i] & ~bitarray2[i]; if(comp1) left++; comp1 = bitarray2[i] & ~bitarray1[i]; if(comp1) right++; i++; } /* Determine set comparison outcomes */ if((left > 0) && (right == 0)) /* array1 is a superset of array2 */ i = 1; else if((left == 0) && (right > 0)) /* array2 is a superset of array1 */ i = -1; else if((left == 0) && (right == 0)) /* array1 and array2 are identical */ i = 0; else i = -2; /* indicate all other outcomes */ return( i ); } STATIC workarraysrec *mempool_create(lprec *lp) { workarraysrec *temp; temp = (workarraysrec *) calloc(1, sizeof(workarraysrec)); temp->lp = lp; return( temp ); } STATIC char *mempool_obtainVector(workarraysrec *mempool, int count, int unitsize) { char *newmem = NULL; MYBOOL *bnewmem = NULL; int *inewmem = NULL, size, i, ib, ie, memMargin = 0; REAL *rnewmem = NULL; /* First find the iso-sized window (binary search) */ size = count*unitsize; memMargin += size; ib = 0; ie = mempool->count-1; while(ie >= ib) { i = (ib+ie) / 2; if(abs(mempool->vectorsize[i]) > memMargin) ie = i-1; else if(abs(mempool->vectorsize[i]) < size) ib = i+1; else { /* Find the beginning of the exact-sized array group */ do { ib = i; i--; } while((i >= 0) && (abs(mempool->vectorsize[i]) >= size)); break; } } /* Check if we have a preallocated unused array of sufficient size */ ie = mempool->count-1; for(i = ib; i <= ie; i++) if(mempool->vectorsize[i] < 0) break; /* Obtain and activate existing, unused vector if we are permitted */ if(i <= ie) { #ifdef Paranoia if((mempool->vectorsize[i] > 0) || (abs(mempool->vectorsize[i]) < size)) { lprec *lp = mempool->lp; lp->report(lp, SEVERE, "mempool_obtainVector: Invalid %s existing vector selected\n", (ie < 0 ? "too small" : "occupied")); lp->spx_status = NOMEMORY; lp->bb_break = TRUE; return( newmem ); } #endif newmem = mempool->vectorarray[i]; mempool->vectorsize[i] *= -1; } /* Otherwise allocate a new vector */ else if(unitsize == sizeof(MYBOOL)) { allocMYBOOL(mempool->lp, &bnewmem, count, TRUE); newmem = (char *) bnewmem; } else if(unitsize == sizeof(int)) { allocINT(mempool->lp, &inewmem, count, TRUE); newmem = (char *) inewmem; } else if(unitsize == sizeof(REAL)) { allocREAL(mempool->lp, &rnewmem, count, TRUE); newmem = (char *) rnewmem; } /* Insert into master array if necessary (maintain sort by ascending size) */ if((i > ie) && (newmem != NULL)) { mempool->count++; if(mempool->count >= mempool->size) { mempool->size += 10; mempool->vectorarray = (char **) realloc(mempool->vectorarray, sizeof(*(mempool->vectorarray))*mempool->size); mempool->vectorsize = (int *) realloc(mempool->vectorsize, sizeof(*(mempool->vectorsize))*mempool->size); } ie++; i = ie + 1; if(i < mempool->count) { MEMMOVE(mempool->vectorarray+i, mempool->vectorarray+ie, 1); MEMMOVE(mempool->vectorsize+i, mempool->vectorsize+ie, 1); } mempool->vectorarray[ie] = newmem; mempool->vectorsize[ie] = size; } return( newmem ); } STATIC MYBOOL mempool_releaseVector(workarraysrec *mempool, char *memvector, MYBOOL forcefree) { int i; #if 0 forcefree = TRUE; #endif for(i = mempool->count-1; i >= 0; i--) if(mempool->vectorarray[i] == memvector) break; if((i < 0) || (mempool->vectorsize[i] < 0)) return( FALSE ); if(forcefree) { FREE(mempool->vectorarray[i]); mempool->count--; for(; i < mempool->count; i++) mempool->vectorarray[i] = mempool->vectorarray[i+1]; } else mempool->vectorsize[i] *= -1; return( TRUE ); } STATIC MYBOOL mempool_free(workarraysrec **mempool) { int i = (*mempool)->count; while(i > 0) { i--; if((*mempool)->vectorsize[i] < 0) /* Handle unused vectors */ (*mempool)->vectorsize[i] *= -1; mempool_releaseVector(*mempool, (*mempool)->vectorarray[i], TRUE); } FREE((*mempool)->vectorarray); FREE((*mempool)->vectorsize); FREE(*mempool); return( TRUE ); } REAL *cloneREAL(lprec *lp, REAL *origlist, int size) { REAL *newlist; size += 1; if(allocREAL(lp, &newlist, size, FALSE)) MEMCOPY(newlist, origlist, size); return(newlist); } MYBOOL *cloneMYBOOL(lprec *lp, MYBOOL *origlist, int size) { MYBOOL *newlist; size += 1; if(allocMYBOOL(lp, &newlist, size, FALSE)) MEMCOPY(newlist, origlist, size); return(newlist); } int *cloneINT(lprec *lp, int *origlist, int size) { int *newlist; size += 1; if(allocINT(lp, &newlist, size, FALSE)) MEMCOPY(newlist, origlist, size); return(newlist); } STATIC void roundVector(LREAL *myvector, int endpos, LREAL roundzero) { if(roundzero > 0) for(; endpos >= 0; myvector++, endpos--) if(fabs(*myvector) < roundzero) *myvector = 0; } STATIC REAL normalizeVector(REAL *myvector, int endpos) /* Scale the ingoing vector so that its norm is unit, and return the original length */ { int i; REAL SSQ; /* Cumulate squares */ SSQ = 0; for(i = 0; i <= endpos; myvector++, i++) SSQ += (*myvector) * (*myvector); /* Normalize */ SSQ = sqrt(SSQ); if(SSQ > 0) for(myvector--; i > 0; myvector--, i--) (*myvector) /= SSQ; return( SSQ ); } /* ---------------------------------------------------------------------------------- */ /* Other general utilities */ /* ---------------------------------------------------------------------------------- */ STATIC void swapINT(int *item1, int *item2) { int hold = *item1; *item1 = *item2; *item2 = hold; } STATIC void swapREAL(REAL *item1, REAL *item2) { REAL hold = *item1; *item1 = *item2; *item2 = hold; } STATIC void swapPTR(void **item1, void **item2) { void *hold; hold = *item1; *item1 = *item2; *item2 = hold; } STATIC REAL restoreINT(REAL valREAL, REAL epsilon) { REAL valINT, fracREAL, fracABS; fracREAL = modf(valREAL, &valINT); fracABS = fabs(fracREAL); if(fracABS < epsilon) return(valINT); else if(fracABS > 1-epsilon) { if(fracREAL < 0) return(valINT-1); else return(valINT+1); } return(valREAL); } STATIC REAL roundToPrecision(REAL value, REAL precision) { #if 1 REAL vmod; int vexp2, vexp10; LLONG sign; if(precision == 0) return(value); sign = my_sign(value); value = fabs(value); /* Round to integer if possible */ if(value < precision) return( 0 ); else if(value == floor(value)) return( value*sign ); else if((value < (REAL) MAXINT64) && (modf((REAL) (value+precision), &vmod) < precision)) { /* sign *= (LLONG) (value+precision); */ sign *= (LLONG) (value+0.5); return( (REAL) sign ); } /* Optionally round with base 2 representation for additional precision */ #define roundPrecisionBase2 #ifdef roundPrecisionBase2 value = frexp(value, &vexp2); #else vexp2 = 0; #endif /* Convert to desired precision */ vexp10 = (int) log10(value); precision *= pow(10.0, vexp10); modf(value/precision+0.5, &value); value *= sign*precision; /* Restore base 10 representation if base 2 was active */ if(vexp2 != 0) value = ldexp(value, vexp2); #endif return( value ); } /* ---------------------------------------------------------------------------------- */ /* Searching function specialized for lp_solve */ /* ---------------------------------------------------------------------------------- */ STATIC int searchFor(int target, int *attributes, int size, int offset, MYBOOL absolute) { int beginPos, endPos; int newPos, match; /* Set starting and ending index offsets */ beginPos = offset; endPos = beginPos + size - 1; /* Do binary search logic based on a sorted attribute vector */ newPos = (beginPos + endPos) / 2; match = attributes[newPos]; if(absolute) match = abs(match); while(endPos - beginPos > LINEARSEARCH) { if(match < target) { beginPos = newPos + 1; newPos = (beginPos + endPos) / 2; match = attributes[newPos]; if(absolute) match = abs(match); } else if(match > target) { endPos = newPos - 1; newPos = (beginPos + endPos) / 2; match = attributes[newPos]; if(absolute) match = abs(match); } else { beginPos = newPos; endPos = newPos; } } /* Do linear (unsorted) search logic */ if(endPos - beginPos <= LINEARSEARCH) { match = attributes[beginPos]; if(absolute) match = abs(match); while((beginPos < endPos) && (match != target)) { beginPos++; match = attributes[beginPos]; if(absolute) match = abs(match); } if(match == target) endPos = beginPos; } /* Return the index if a match was found, or signal failure with a -1 */ if((beginPos == endPos) && (match == target)) return(beginPos); else return(-1); } /* ---------------------------------------------------------------------------------- */ /* Other supporting math routines */ /* ---------------------------------------------------------------------------------- */ STATIC MYBOOL isINT(lprec *lp, REAL value) { #if 0 return( (MYBOOL) (modf(fabs(value)+lp->epsint, &value) < 2*lp->epsint) ); #elif 1 value = fabs(value)+lp->epsint; return( (MYBOOL) (my_reldiff(value, floor(value)) < 2*lp->epsint) ); #elif 0 REAL hold; value = fabs(value); hold = pow(10, MIN(-2, log10(value+1)+log10(lp->epsint))); return( (MYBOOL) (modf(value+lp->epsint, &value) < 2*hold) ); #elif 0 value -= (REAL)floor(value); return( (MYBOOL) ((value < lp->epsint) || (value > (1 - lp->epsint)) ); #else value += lp->epsint; return( (MYBOOL) (fabs(value-floor(value)) < 2*lp->epsint) ); #endif } STATIC MYBOOL isOrigFixed(lprec *lp, int varno) { return( (MYBOOL) (lp->orig_upbo[varno] - lp->orig_lowbo[varno] <= lp->epsmachine) ); } STATIC void chsign_bounds(REAL *lobound, REAL *upbound) { REAL temp; temp = *upbound; if(fabs(*lobound) > 0) *upbound = -(*lobound); else *upbound = 0; if(fabs(temp) > 0) *lobound = -temp; else *lobound = 0; } /* ---------------------------------------------------------------------------------- */ /* Define randomization routine */ /* ---------------------------------------------------------------------------------- */ STATIC REAL rand_uniform(lprec *lp, REAL range) { static MYBOOL randomized = FALSE; /* static ok here for reentrancy/multithreading */ if(!randomized) { randomized = TRUE; srand((unsigned) time( NULL )); } range *= (REAL) rand() / (REAL) RAND_MAX; return( range ); } /* ---------------------------------------------------------------------------------- */ /* Define routines for doubly linked lists of integers */ /* ---------------------------------------------------------------------------------- */ STATIC int createLink(int size, LLrec **linkmap, MYBOOL *usedpos) { int i, j; MYBOOL reverse; *linkmap = (LLrec *) calloc(1, sizeof(**linkmap)); if(*linkmap == NULL) return( -1 ); reverse = (MYBOOL) (size < 0); if(reverse) size = -size; (*linkmap)->map = (int *) calloc(2*(size + 1), sizeof(int)); if((*linkmap)->map == NULL) return( -1 ); (*linkmap)->size = size; j = 0; if(usedpos == NULL) (*linkmap)->map[0] = 0; else { for(i = 1; i <= size; i++) if(!usedpos[i] ^ reverse) { /* Set the forward link */ (*linkmap)->map[j] = i; /* Set the backward link */ (*linkmap)->map[size+i] = j; j = i; if((*linkmap)->count == 0) (*linkmap)->firstitem = i; (*linkmap)->lastitem = i; (*linkmap)->count++; } } (*linkmap)->map[2*size+1] = j; return( (*linkmap)->count ); } STATIC MYBOOL freeLink(LLrec **linkmap) { MYBOOL status = TRUE; if((linkmap == NULL) || (*linkmap == NULL)) status = FALSE; else { if((*linkmap)->map != NULL) free((*linkmap)->map); free(*linkmap); *linkmap = NULL; } return( status ); } STATIC int sizeLink(LLrec *linkmap) { return(linkmap->size); } STATIC MYBOOL isActiveLink(LLrec *linkmap, int itemnr) { if((linkmap->map[itemnr] != 0) || (linkmap->map[linkmap->size+itemnr] != 0) || (linkmap->map[0] == itemnr)) return( TRUE ); else return( FALSE ); } STATIC int countActiveLink(LLrec *linkmap) { return(linkmap->count); } STATIC int countInactiveLink(LLrec *linkmap) { return(linkmap->size-linkmap->count); } STATIC int firstActiveLink(LLrec *linkmap) { return(linkmap->map[0]); } STATIC int lastActiveLink(LLrec *linkmap) { return(linkmap->map[2*linkmap->size+1]); } STATIC MYBOOL appendLink(LLrec *linkmap, int newitem) { int k, size; size = linkmap->size; if(linkmap->map[newitem] != 0) return( FALSE ); /* Link forward */ k = linkmap->map[2*size+1]; linkmap->map[k] = newitem; /* Link backward */ linkmap->map[size+newitem] = k; linkmap->map[2*size+1] = newitem; /* Update count and return */ if(linkmap->count == 0) linkmap->firstitem = newitem; linkmap->lastitem = newitem; linkmap->count++; return( TRUE ); } STATIC MYBOOL insertLink(LLrec *linkmap, int afteritem, int newitem) { int k, size; size = linkmap->size; if(linkmap->map[newitem] != 0) return( FALSE ); if(afteritem == linkmap->map[2*size+1]) appendLink(linkmap, newitem); else { /* Link forward */ k = linkmap->map[afteritem]; linkmap->map[afteritem] = newitem; linkmap->map[newitem] = k; /* Link backward */ linkmap->map[size+k] = newitem; linkmap->map[size+newitem] = afteritem; /* Update count */ SETMIN(linkmap->firstitem, newitem); SETMAX(linkmap->lastitem, newitem); linkmap->count++; } return( TRUE ); } STATIC MYBOOL setLink(LLrec *linkmap, int newitem) { if(isActiveLink(linkmap, newitem)) return( FALSE ); else return( insertLink(linkmap, prevActiveLink(linkmap, newitem), newitem) ); } STATIC MYBOOL fillLink(LLrec *linkmap) { int k, size; size = linkmap->size; k = firstActiveLink(linkmap); if(k != 0) return( FALSE ); for(k = 1; k <= size; k++) appendLink(linkmap, k); return( TRUE ); } STATIC int nextActiveLink(LLrec *linkmap, int backitemnr) { if((backitemnr < 0) || (backitemnr > linkmap->size)) return( -1 ); else { if(backitemnr < linkmap->lastitem) while((backitemnr > linkmap->firstitem) && (linkmap->map[backitemnr] == 0)) backitemnr--; return(linkmap->map[backitemnr]); } } STATIC int prevActiveLink(LLrec *linkmap, int forwitemnr) { if((forwitemnr <= 0) || (forwitemnr > linkmap->size+1)) return( -1 ); else { if(forwitemnr > linkmap->lastitem) return( linkmap->lastitem); if(forwitemnr > linkmap->firstitem) { forwitemnr += linkmap->size; while((forwitemnr < linkmap->size + linkmap->lastitem) && (linkmap->map[forwitemnr] == 0)) forwitemnr++; } else forwitemnr += linkmap->size; return(linkmap->map[forwitemnr]); } } STATIC int firstInactiveLink(LLrec *linkmap) { int i, n; if(countInactiveLink(linkmap) == 0) return( 0 ); n = 1; i = firstActiveLink(linkmap); while(i == n) { n++; i = nextActiveLink(linkmap, i); } return( n ); } STATIC int lastInactiveLink(LLrec *linkmap) { int i, n; if(countInactiveLink(linkmap) == 0) return( 0 ); n = linkmap->size; i = lastActiveLink(linkmap); while(i == n) { n--; i = prevActiveLink(linkmap, i); } return( n ); } STATIC int nextInactiveLink(LLrec *linkmap, int backitemnr) { do { backitemnr++; } while((backitemnr <= linkmap->size) && isActiveLink(linkmap, backitemnr)); if(backitemnr <= linkmap->size) return( backitemnr ); else return( 0 ); } STATIC int prevInactiveLink(LLrec *linkmap, int forwitemnr) { return( 0 ); } STATIC int removeLink(LLrec *linkmap, int itemnr) { int size, prevnr, nextnr = -1; size = linkmap->size; if((itemnr <= 0) || (itemnr > size)) return( nextnr ); #ifdef Paranoia if(!isActiveLink(linkmap, itemnr)) return( nextnr ); #endif /* Get link data at the specified position */ nextnr = linkmap->map[itemnr]; prevnr = linkmap->map[size+itemnr]; if(itemnr == linkmap->firstitem) linkmap->firstitem = nextnr; if(itemnr == linkmap->lastitem) linkmap->lastitem = prevnr; /* Update forward link */ linkmap->map[prevnr] = linkmap->map[itemnr]; linkmap->map[itemnr] = 0; /* Update backward link */ if(nextnr == 0) linkmap->map[2*size+1] = prevnr; else linkmap->map[size+nextnr] = linkmap->map[size+itemnr]; linkmap->map[size+itemnr] = 0; /* Decrement the count */ linkmap->count--; /* Return the next active item */ return( nextnr ); } STATIC LLrec *cloneLink(LLrec *sourcemap, int newsize, MYBOOL freesource) { LLrec *testmap = NULL; if((newsize == sourcemap->size) || (newsize <= 0)) { createLink(sourcemap->size, &testmap, NULL); MEMCOPY(testmap->map, sourcemap->map, 2*(sourcemap->size+1)); testmap->firstitem = sourcemap->firstitem; testmap->lastitem = sourcemap->lastitem; testmap->size = sourcemap->size; testmap->count = sourcemap->count; } else { int j; createLink(newsize, &testmap, NULL); for(j = firstActiveLink(sourcemap); (j != 0) && (j <= newsize); j = nextActiveLink(sourcemap, j)) appendLink(testmap, j); } if(freesource) freeLink(&sourcemap); return(testmap); } STATIC int compareLink(LLrec *linkmap1, LLrec *linkmap2) { int test; test = memcmp(&linkmap1->size, &linkmap2->size, sizeof(int)); if(test == 0) test = memcmp(&linkmap1->count, &linkmap2->count, sizeof(int)); if(test == 0) test = memcmp(linkmap1->map, linkmap2->map, sizeof(int)*(2*linkmap1->size+1)); return( test ); } STATIC MYBOOL verifyLink(LLrec *linkmap, int itemnr, MYBOOL doappend) { LLrec *testmap; testmap = cloneLink(linkmap, -1, FALSE); if(doappend) { appendLink(testmap, itemnr); removeLink(testmap, itemnr); } else { int previtem = prevActiveLink(testmap, itemnr); removeLink(testmap, itemnr); insertLink(testmap, previtem, itemnr); } itemnr = compareLink(linkmap, testmap); freeLink(&testmap); return((MYBOOL) (itemnr == 0)); } /* Packed vector routines */ STATIC PVrec *createPackedVector(int size, REAL *values, int *workvector) { int i, k; REGISTER REAL ref; PVrec *newPV = NULL; MYBOOL localWV = (MYBOOL) (workvector == NULL); if(localWV) workvector = (int *) malloc((size+1)*sizeof(*workvector)); /* Tally equal-valued vector entries - also check if it is worth compressing */ k = 0; workvector[k] = 1; ref = values[1]; for(i = 2; i <= size; i++) { if(fabs(ref - values[i]) > DEF_EPSMACHINE) { k++; workvector[k] = i; ref = values[i]; } } if(k > size / 2) { if(localWV) FREE(workvector); return( newPV ); } /* Create the packing object, adjust the position vector and allocate value vector */ newPV = (PVrec *) malloc(sizeof(*newPV)); k++; /* Adjust from index to to count */ newPV->count = k; if(localWV) newPV->startpos = (int *) realloc(workvector, (k + 1)*sizeof(*(newPV->startpos))); else { newPV->startpos = (int *) malloc((k + 1)*sizeof(*(newPV->startpos))); MEMCOPY(newPV->startpos, workvector, k); } newPV->startpos[k] = size + 1; /* Store terminal index + 1 for searching purposes */ newPV->value = (REAL *) malloc(k*sizeof(*(newPV->value))); /* Fill the values vector before returning */ for(i = 0; i < k; i++) newPV->value[i] = values[newPV->startpos[i]]; return( newPV ); } STATIC MYBOOL unpackPackedVector(PVrec *PV, REAL **target) { int i, ii, k; REGISTER REAL ref; /* Test for validity of the target and create it if necessary */ if(target == NULL) return( FALSE ); if(*target == NULL) allocREAL(NULL, target, PV->startpos[PV->count], FALSE); /* Expand the packed vector into the target */ i = PV->startpos[0]; for(k = 0; k < PV->count; k++) { ii = PV->startpos[k+1]; ref = PV->value[k]; while (i < ii) { (*target)[i] = ref; i++; } } return( TRUE ); } STATIC REAL getvaluePackedVector(PVrec *PV, int index) { index = searchFor(index, PV->startpos, PV->count, 0, FALSE); index = abs(index)-1; if(index >= 0) return( PV->value[index] ); else return( 0 ); } STATIC MYBOOL freePackedVector(PVrec **PV) { if((PV == NULL) || (*PV == NULL)) return( FALSE ); FREE((*PV)->value); FREE((*PV)->startpos); FREE(*PV); return( TRUE ); } STATIC void pushPackedVector(PVrec *PV, PVrec *parent) { PV->parent = parent; } STATIC PVrec *popPackedVector(PVrec *PV) { PVrec *parent = PV->parent; freePackedVector(&PV); return( parent ); } lp_solve_5.5/lp_utils.h100666 0 0 13120 11245561655 13572 0ustar usergroup#ifndef HEADER_lp_utils #define HEADER_lp_utils #ifdef FORTIFY #include "lp_fortify.h" #define allocCHAR allocCHAR_FORTIFY #define allocMYBOOL allocMYBOOL_FORTIFY #define allocINT allocINT_FORTIFY #define allocREAL allocREAL_FORTIFY #define allocLREAL allocLREAL_FORTIFY #endif #include "lp_types.h" /* Temporary data storage arrays */ typedef struct _workarraysrec { lprec *lp; int size; int count; char **vectorarray; int *vectorsize; } workarraysrec; typedef struct _LLrec { int size; /* The allocated list size */ int count; /* The current entry count */ int firstitem; int lastitem; int *map; /* The list of forward and backward-mapped entries */ } LLrec; typedef struct _PVrec { int count; /* The allocated list item count */ int *startpos; /* Starting index of the current value */ REAL *value; /* The list of forward and backward-mapped entries */ struct _PVrec *parent; /* The parent record in a pushed chain */ } PVrec; #ifdef __cplusplus extern "C" { #endif /* Put function headers here */ STATIC MYBOOL allocCHAR(lprec *lp, char **ptr, int size, MYBOOL clear); STATIC MYBOOL allocMYBOOL(lprec *lp, MYBOOL **ptr, int size, MYBOOL clear); STATIC MYBOOL allocINT(lprec *lp, int **ptr, int size, MYBOOL clear); STATIC MYBOOL allocREAL(lprec *lp, REAL **ptr, int size, MYBOOL clear); STATIC MYBOOL allocLREAL(lprec *lp, LREAL **ptr, int size, MYBOOL clear); STATIC MYBOOL allocFREE(lprec *lp, void **ptr); REAL *cloneREAL(lprec *lp, REAL *origlist, int size); MYBOOL *cloneMYBOOL(lprec *lp, MYBOOL *origlist, int size); int *cloneINT(lprec *lp, int *origlist, int size); int comp_bits(MYBOOL *bitarray1, MYBOOL *bitarray2, int items); STATIC workarraysrec *mempool_create(lprec *lp); STATIC char *mempool_obtainVector(workarraysrec *mempool, int count, int unitsize); STATIC MYBOOL mempool_releaseVector(workarraysrec *mempool, char *memvector, MYBOOL forcefree); STATIC MYBOOL mempool_free(workarraysrec **mempool); STATIC void roundVector(LREAL *myvector, int endpos, LREAL roundzero); STATIC REAL normalizeVector(REAL *myvector, int endpos); STATIC void swapINT(int *item1, int *item2); STATIC void swapREAL(REAL *item1, REAL *item2); STATIC void swapPTR(void **item1, void **item2); STATIC REAL restoreINT(REAL valREAL, REAL epsilon); STATIC REAL roundToPrecision(REAL value, REAL precision); STATIC int searchFor(int target, int *attributes, int size, int offset, MYBOOL absolute); STATIC MYBOOL isINT(lprec *lp, REAL value); STATIC MYBOOL isOrigFixed(lprec *lp, int varno); STATIC void chsign_bounds(REAL *lobound, REAL *upbound); STATIC REAL rand_uniform(lprec *lp, REAL range); /* Doubly linked list routines */ STATIC int createLink(int size, LLrec **linkmap, MYBOOL *usedpos); STATIC MYBOOL freeLink(LLrec **linkmap); STATIC int sizeLink(LLrec *linkmap); STATIC MYBOOL isActiveLink(LLrec *linkmap, int itemnr); STATIC int countActiveLink(LLrec *linkmap); STATIC int countInactiveLink(LLrec *linkmap); STATIC int firstActiveLink(LLrec *linkmap); STATIC int lastActiveLink(LLrec *linkmap); STATIC MYBOOL appendLink(LLrec *linkmap, int newitem); STATIC MYBOOL insertLink(LLrec *linkmap, int afteritem, int newitem); STATIC MYBOOL setLink(LLrec *linkmap, int newitem); STATIC MYBOOL fillLink(LLrec *linkmap); STATIC int nextActiveLink(LLrec *linkmap, int backitemnr); STATIC int prevActiveLink(LLrec *linkmap, int forwitemnr); STATIC int firstInactiveLink(LLrec *linkmap); STATIC int lastInactiveLink(LLrec *linkmap); STATIC int nextInactiveLink(LLrec *linkmap, int backitemnr); STATIC int prevInactiveLink(LLrec *linkmap, int forwitemnr); STATIC int removeLink(LLrec *linkmap, int itemnr); STATIC LLrec *cloneLink(LLrec *sourcemap, int newsize, MYBOOL freesource); STATIC int compareLink(LLrec *linkmap1, LLrec *linkmap2); STATIC MYBOOL verifyLink(LLrec *linkmap, int itemnr, MYBOOL doappend); /* Packed vector routines */ STATIC PVrec *createPackedVector(int size, REAL *values, int *workvector); STATIC void pushPackedVector(PVrec *PV, PVrec *parent); STATIC MYBOOL unpackPackedVector(PVrec *PV, REAL **target); STATIC REAL getvaluePackedVector(PVrec *PV, int index); STATIC PVrec *popPackedVector(PVrec *PV); STATIC MYBOOL freePackedVector(PVrec **PV); #ifdef __cplusplus } #endif #endif /* HEADER_lp_utils */ #ifdef FORTIFY #if defined CODE_lp_utils && !defined CODE_lp_utils_ int _Fortify_ret; #else extern int _Fortify_ret; #endif #ifdef CODE_lp_utils #define CODE_lp_utils_ #else # undef allocCHAR # undef allocMYBOOL # undef allocINT # undef allocREAL # undef allocLREAL # define allocCHAR(lp, ptr, size, clear) (Fortify_LINE(__LINE__), Fortify_FILE(__FILE__), _Fortify_ret = allocCHAR_FORTIFY(lp, ptr, size, clear), Fortify_LINE(0), Fortify_FILE(NULL), _Fortify_ret) # define allocMYBOOL(lp, ptr, size, clear) (Fortify_LINE(__LINE__), Fortify_FILE(__FILE__), _Fortify_ret = allocMYBOOL_FORTIFY(lp, ptr, size, clear), Fortify_LINE(0), Fortify_FILE(NULL), _Fortify_ret) # define allocINT(lp, ptr, size, clear) (Fortify_LINE(__LINE__), Fortify_FILE(__FILE__), _Fortify_ret = allocINT_FORTIFY(lp, ptr, size, clear), Fortify_LINE(0), Fortify_FILE(NULL), _Fortify_ret) # define allocREAL(lp, ptr, size, clear) (Fortify_LINE(__LINE__), Fortify_FILE(__FILE__), _Fortify_ret = allocREAL_FORTIFY(lp, ptr, size, clear), Fortify_LINE(0), Fortify_FILE(NULL), _Fortify_ret) # define allocLREAL(lp, ptr, size, clear) (Fortify_LINE(__LINE__), Fortify_FILE(__FILE__), _Fortify_ret = allocLREAL_FORTIFY(lp, ptr, size, clear), Fortify_LINE(0), Fortify_FILE(NULL), _Fortify_ret) #endif #endif lp_solve_5.5/lp_wlp.c100666 0 0 30207 11254506611 13223 0ustar usergroup #include #include #include #include "commonlib.h" #include "lp_lib.h" #include "lp_scale.h" #include "lp_utils.h" #include "lp_report.h" #include "lp_wlp.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Define buffer-size controled function mapping */ # if defined _MSC_VER # define vsnprintf _vsnprintf # endif /* ------------------------------------------------------------------------- */ /* Input and output of lp format model files for lp_solve */ /* ------------------------------------------------------------------------- */ static int write_data(void *userhandle, write_modeldata_func write_modeldata, char *format, ...) { char buff[DEF_STRBUFSIZE+1]; va_list ap; int n; va_start(ap, format); vsnprintf(buff, DEF_STRBUFSIZE, format, ap); va_end(ap); n = write_modeldata(userhandle, buff); return(n); } STATIC void write_lpcomment(void *userhandle, write_modeldata_func write_modeldata, char *string, MYBOOL newlinebefore) { write_data(userhandle, write_modeldata, "%s/* %s */\n", (newlinebefore) ? "\n" : "", string); } STATIC int write_lprow(lprec *lp, int rowno, void *userhandle, write_modeldata_func write_modeldata, int maxlen, int *idx, REAL *val) { int i, j, nchars, elements; REAL a; MYBOOL first = TRUE; char buf[50]; elements = get_rowex(lp, rowno, val, idx); if(write_modeldata != NULL) { nchars = 0; for(i = 0; i < elements; i++) { j = idx[i]; if(is_splitvar(lp, j)) continue; a = val[i]; if(!first) nchars += write_data(userhandle, write_modeldata, " "); else first = FALSE; sprintf(buf, "%+.12g", (double)a); if(strcmp(buf, "-1") == 0) nchars += write_data(userhandle, write_modeldata, "-"); else if(strcmp(buf, "+1") == 0) nchars += write_data(userhandle, write_modeldata, "+"); else nchars += write_data(userhandle, write_modeldata, "%s ", buf); nchars += write_data(userhandle, write_modeldata, "%s", get_col_name(lp, j)); /* Check if we should add a linefeed */ if((maxlen > 0) && (nchars >= maxlen) && (i < elements-1)) { write_data(userhandle, write_modeldata, "%s", "\n"); nchars = 0; } } } return(elements); } #if !defined LP_MAXLINELEN # define LP_MAXLINELEN 100 #endif MYBOOL __WINAPI write_lpex(lprec *lp, void *userhandle, write_modeldata_func write_modeldata) { int i, j, b, nrows = lp->rows, ncols = lp->columns, nchars, maxlen = LP_MAXLINELEN, *idx; MYBOOL ok; REAL a, *val; char *ptr; if(!mat_validate(lp->matA)) { report(lp, IMPORTANT, "LP_writefile: Could not validate the data matrix.\n"); return(FALSE); } /* Write name of model */ ptr = get_lp_name(lp); if(ptr != NULL) { if(*ptr) write_lpcomment(userhandle, write_modeldata, ptr, FALSE); else ptr = NULL; } /* Write the objective function */ write_lpcomment(userhandle, write_modeldata, "Objective function", (MYBOOL) (ptr != NULL)); if(is_maxim(lp)) write_data(userhandle, write_modeldata, "max: "); else write_data(userhandle, write_modeldata, "min: "); allocREAL(lp, &val, 1 + lp->columns, TRUE); allocINT(lp, &idx, 1 + lp->columns, TRUE); write_lprow(lp, 0, userhandle, write_modeldata, maxlen, idx, val); a = get_rh(lp, 0); if(a != 0) write_data(userhandle, write_modeldata, " %+.12g", a); write_data(userhandle, write_modeldata, ";\n"); /* Write constraints */ if(nrows > 0) write_lpcomment(userhandle, write_modeldata, "Constraints", TRUE); for(j = 1; j <= nrows; j++) { if(((lp->names_used) && (lp->row_name[j] != NULL)) || (write_lprow(lp, j, userhandle, NULL, maxlen, idx, val) == 1)) ptr = get_row_name(lp, j); else ptr = NULL; if((ptr != NULL) && (*ptr)) write_data(userhandle, write_modeldata, "%s: ", ptr); #ifndef SingleBoundedRowInLP /* Write the ranged part of the constraint, if specified */ if ((lp->orig_upbo[j]) && (lp->orig_upbo[j] < lp->infinite)) { if(my_chsign(is_chsign(lp, j), lp->orig_rhs[j]) == -lp->infinite) write_data(userhandle, write_modeldata, "-Inf %s ", (is_chsign(lp, j)) ? ">=" : "<="); else if(my_chsign(is_chsign(lp, j), lp->orig_rhs[j]) == lp->infinite) write_data(userhandle, write_modeldata, "+Inf %s ", (is_chsign(lp, j)) ? ">=" : "<="); else write_data(userhandle, write_modeldata, "%+.12g %s ", (lp->orig_upbo[j]-lp->orig_rhs[j]) * (is_chsign(lp, j) ? 1.0 : -1.0) / (lp->scaling_used ? lp->scalars[j] : 1.0), (is_chsign(lp, j)) ? ">=" : "<="); } #endif if((!write_lprow(lp, j, userhandle, write_modeldata, maxlen, idx, val)) && (ncols >= 1)) write_data(userhandle, write_modeldata, "0 %s", get_col_name(lp, 1)); if(lp->orig_upbo[j] == 0) write_data(userhandle, write_modeldata, " ="); else if(is_chsign(lp, j)) write_data(userhandle, write_modeldata, " >="); else write_data(userhandle, write_modeldata, " <="); if(fabs(get_rh(lp, j) + lp->infinite) < 1) write_data(userhandle, write_modeldata, " -Inf;\n"); else if(fabs(get_rh(lp, j) - lp->infinite) < 1) write_data(userhandle, write_modeldata, " +Inf;\n"); else write_data(userhandle, write_modeldata, " %.12g;\n", get_rh(lp, j)); #ifdef SingleBoundedRowInLP /* Write the ranged part of the constraint, if specified */ if ((lp->orig_upbo[j]) && (lp->orig_upbo[j] < lp->infinite)) { if(((lp->names_used) && (lp->row_name[j] != NULL)) || (write_lprow(lp, j, userhandle, NULL, maxlen, idx, val) == 1)) ptr = get_row_name(lp, j); else ptr = NULL; if((ptr != NULL) && (*ptr)) write_data(userhandle, write_modeldata, "%s: ", ptr); if((!write_lprow(lp, j, userhandle, write_modeldata, maxlen, idx, val)) && (get_Ncolumns(lp) >= 1)) write_data(userhandle, write_modeldata, "0 %s", get_col_name(lp, 1)); write_data(userhandle, write_modeldata, " %s %g;\n", (is_chsign(lp, j)) ? "<=" : ">=", (lp->orig_upbo[j]-lp->orig_rhs[j]) * (is_chsign(lp, j) ? 1.0 : -1.0) / (lp->scaling_used ? lp->scalars[j] : 1.0)); } #endif } /* Write bounds on variables */ ok = FALSE; for(i = nrows + 1; i <= lp->sum; i++) if(!is_splitvar(lp, i - nrows)) { if(lp->orig_lowbo[i] == lp->orig_upbo[i]) { if(!ok) { write_lpcomment(userhandle, write_modeldata, "Variable bounds", TRUE); ok = TRUE; } write_data(userhandle, write_modeldata, "%s = %.12g;\n", get_col_name(lp, i - nrows), get_upbo(lp, i - nrows)); } else { #ifndef SingleBoundedRowInLP if((lp->orig_lowbo[i] != 0) && (lp->orig_upbo[i] < lp->infinite)) { if(!ok) { write_lpcomment(userhandle, write_modeldata, "Variable bounds", TRUE); ok = TRUE; } if(lp->orig_lowbo[i] == -lp->infinite) write_data(userhandle, write_modeldata, "-Inf"); else write_data(userhandle, write_modeldata, "%.12g", get_lowbo(lp, i - nrows)); write_data(userhandle, write_modeldata, " <= %s <= ", get_col_name(lp, i - nrows)); if(lp->orig_lowbo[i] == lp->infinite) write_data(userhandle, write_modeldata, "+Inf"); else write_data(userhandle, write_modeldata, "%.12g", get_upbo(lp, i - nrows)); write_data(userhandle, write_modeldata, ";\n"); } else #endif { if(lp->orig_lowbo[i] != 0) { if(!ok) { write_lpcomment(userhandle, write_modeldata, "Variable bounds", TRUE); ok = TRUE; } if(lp->orig_lowbo[i] == -lp->infinite) write_data(userhandle, write_modeldata, "%s >= -Inf;\n", get_col_name(lp, i - nrows)); else if(lp->orig_lowbo[i] == lp->infinite) write_data(userhandle, write_modeldata, "%s >= +Inf;\n", get_col_name(lp, i - nrows)); else write_data(userhandle, write_modeldata, "%s >= %.12g;\n", get_col_name(lp, i - nrows), get_lowbo(lp, i - nrows)); } if(lp->orig_upbo[i] != lp->infinite) { if(!ok) { write_lpcomment(userhandle, write_modeldata, "Variable bounds", TRUE); ok = TRUE; } write_data(userhandle, write_modeldata, "%s <= %.12g;\n", get_col_name(lp, i - nrows), get_upbo(lp, i - nrows)); } } } } /* Write optional integer section */ if(lp->int_vars > 0) { write_lpcomment(userhandle, write_modeldata, "Integer definitions", TRUE); i = 1; while((i <= ncols) && !is_int(lp, i)) i++; if(i <= ncols) { nchars = write_data(userhandle, write_modeldata, "int %s", get_col_name(lp, i)); i++; for(; i <= ncols; i++) if((!is_splitvar(lp, i)) && (is_int(lp, i))) { if((maxlen!= 0) && (nchars > maxlen)) { write_data(userhandle, write_modeldata, "%s", "\n"); nchars = 0; } write_data(userhandle, write_modeldata, ",%s", get_col_name(lp, i)); } write_data(userhandle, write_modeldata, ";\n"); } } /* Write optional SEC section */ if(lp->sc_vars > 0) { write_lpcomment(userhandle, write_modeldata, "Semi-continuous variables", TRUE); i = 1; while((i <= ncols) && !is_semicont(lp, i)) i++; if(i <= ncols) { nchars = write_data(userhandle, write_modeldata, "sec %s", get_col_name(lp, i)); i++; for(; i <= ncols; i++) if((!is_splitvar(lp, i)) && (is_semicont(lp, i))) { if((maxlen != 0) && (nchars > maxlen)) { write_data(userhandle, write_modeldata, "%s", "\n"); nchars = 0; } nchars += write_data(userhandle, write_modeldata, ",%s", get_col_name(lp, i)); } write_data(userhandle, write_modeldata, ";\n"); } } /* Write optional SOS section */ if(SOS_count(lp) > 0) { SOSgroup *SOS = lp->SOS; write_lpcomment(userhandle, write_modeldata, "SOS definitions", TRUE); write_data(userhandle, write_modeldata, "SOS\n"); for(b = 0, i = 0; i < SOS->sos_count; b = SOS->sos_list[i]->priority, i++) { nchars = write_data(userhandle, write_modeldata, "%s: ", (SOS->sos_list[i]->name == NULL) || (*SOS->sos_list[i]->name==0) ? "SOS" : SOS->sos_list[i]->name); /* formatnumber12((double) lp->sos_list[i]->priority) */ for(a = 0.0, j = 1; j <= SOS->sos_list[i]->size; a = SOS->sos_list[i]->weights[j], j++) { if((maxlen != 0) && (nchars > maxlen)) { write_data(userhandle, write_modeldata, "%s", "\n"); nchars = 0; } if(SOS->sos_list[i]->weights[j] == ++a) nchars += write_data(userhandle, write_modeldata, "%s%s", (j > 1) ? "," : "", get_col_name(lp, SOS->sos_list[i]->members[j])); else nchars += write_data(userhandle, write_modeldata, "%s%s:%.12g", (j > 1) ? "," : "", get_col_name(lp, SOS->sos_list[i]->members[j]), SOS->sos_list[i]->weights[j]); } if(SOS->sos_list[i]->priority == ++b) nchars += write_data(userhandle, write_modeldata, " <= %d;\n", SOS->sos_list[i]->type); else nchars += write_data(userhandle, write_modeldata, " <= %d:%d;\n", SOS->sos_list[i]->type, SOS->sos_list[i]->priority); } } FREE(val); FREE(idx); ok = TRUE; return(ok); } static int __WINAPI write_lpdata(void *userhandle, char *buf) { return(fprintf((FILE *) userhandle, "%s", buf)); } MYBOOL LP_writefile(lprec *lp, char *filename) { FILE *output = stdout; MYBOOL ok; if (filename != NULL) { ok = (MYBOOL) ((output = fopen(filename, "w")) != NULL); if(!ok) return(ok); } else output = lp->outstream; ok = write_lpex(lp, (void *) output, write_lpdata); if (filename != NULL) fclose(output); return(ok); } MYBOOL LP_writehandle(lprec *lp, FILE *output) { MYBOOL ok; if (output != NULL) set_outputstream(lp, output); output = lp->outstream; ok = write_lpex(lp, (void *) output, write_lpdata); return(ok); } lp_solve_5.5/lp_wlp.h100666 0 0 446 11141374256 13175 0ustar usergroup#ifndef HEADER_lp_lp #define HEADER_lp_lp #include "lp_types.h" #ifdef __cplusplus extern "C" { #endif /* Put function headers here */ MYBOOL LP_writefile(lprec *lp, char *filename); MYBOOL LP_writehandle(lprec *lp, FILE *output); #ifdef __cplusplus } #endif #endif /* HEADER_lp_lp */ lp_solve_5.5/Makefile100666 0 0 11420 10725613522 13220 0ustar usergroupCC= gcc MINGW_EXTRA = c:/cygwin/mingw MINGW_INCDIR = $(MINGW_EXTRA)/include MINGW_LIBDIR = $(MINGW_EXTRA)/lib AS = as DLLTOOL = dlltool DLLWRAP = dllwrap DLLWRAP_FLAGS = --dlltool-name=$(DLLTOOL) --as=$(AS) --driver-name=$(CC) \ --target=i386-mingw32 DLL_LDFLAGS = -L$(MINGW_LIBDIR) -mno-cygwin -mwindows DLL_LDLIBS = liblpk.a # # Beginning of supplied stuff # #should be OK in most situations: #CFLAGS= -O # HP/UX 9.0X optimized code #CFLAGS= +O3 +Oaggressive +Olibcalls -Aa -D_POSIX_SOURCE -DCHECK +FP VZOUiD # HP/UX 9.0X debugging #CFLAGS= -g -Aa -D_POSIX_SOURCE -DCHECK +FP VZOUiD # nice for gcc CFLAGS= -O3 -Wall -pedantic -ansi -mrtd #CFLAGS= -g -Wall -pedantic -ansi INCLUDE=-Ibfp -Ibfp/bfp_etaPFI -I. -Icolamd -Ishared CFLAGS= -O3 -Wall -pedantic -ansi -mrtd -mno-cygwin -I$(MINGW_INCDIR)\ -DINTEGERTIME -DPARSER_LP -DYY_INTERACTIVE -DWIN32 $(INCLUDE) \ -DBUILDING_FOR_R -DWIN32 -g # Option -DCHECK checks for numerical problems during rounding of numbers. # It will slow things down a bit. # You can add a -DREAL= to the CFLAGS, to change the default float # type used in lp_solve (double) to float or 'long double'. However, type float # might be fast on your computer, but it is not accurate enough to solve even # moderately sized problems without running into numerical problems. # The use of long doubles does increase the numerical stability of lp_solve, # if your compiler actually implements them with more bits than a double. But # it slows down things quite a bit. # Choose your favorite or available version of lex and yacc #YACC= yacc #especially for linux: YACC= bison -y #LEX= lex #especially for linux: LEX= flex -l #LEXLIB= -ll #especially for linux: LEXLIB= -lfl #ANSI math lib #MATHLIB= -lM #non-ANSI math lib, should also work MATHLIB= -lm LPKSRC.c= $(wildcard *.c) lp_MDO.c \ colamd/colamd.c shared/commonlib.c shared/myblas.c LEXFILE.l= lp_rlp.l YACCFILE.y= lp_rlp.y LPKLIB=liblpk.a LEXFILE.c= $(LEXFILE.l:.l=.c) YACCFILE.c= $(YACCFILE.y:.y=.c) YACCFILE.o= $(YACCFILE.y:.y=.o) CSOURCES=$(LEXFILE.c) $(YACCFILE.c) $(wildcard *.c) # commonlib.c fortify.c lp_Hash.c \ # lp_LUMOD.c lp_MPS.c lp_SOS.c lp_crash.c lp_lib.c lp_matrix.c lp_mipbb.c \ # lp_presolve.c lp_price.c lp_pricePSE.c lp_report.c lp_rlp.c lp_scale.c \ # lp_simplex.c lp_solveDLL.c lp_utils.c lp_wlp.c lpslink.c myblas.c \ # yacc_read.c COBJ=$(CSOURCES:.c=.o) LPKSRC= $(LPKSRC.c) $(YACCFILE.c) LPKOBJ= $(LPKSRC:.c=.o) HEADERS=*.h all: lpslink.dll q8.exe: q8.o $(CC) -o q8.exe $(CFLAGS) \ --allow-multiple-definition \ q8.o colamd/colamd.o shared/commonlib.o \ fortify.o ini.o \ lp_Hash.o lp_LUSOL.o lp_MDO.o lp_MPS.o lp_SOS.o lp_crash.o lp_lib.o \ lp_matrix.o lp_mipbb.o lp_params.o lp_presolve.o lp_price.o lp_pricePSE.o \ lp_report.o lp_rlp.o lp_scale.o lp_simplex.o lp_utils.o lp_wlp.o lpslink.o \ lusol.o mmio.o shared/myblas.o yacc_read.o \ $(MATHLIB) $(LPKLIB) \ -Wl,--allow-multiple-definition $(COBJ): $(HEADERS) purify: lp_solve.o $(LPKLIB) purify $(CC) -o $(TARGET) $(CFLAGS) lp_solve.o $(LPKLIB) $(LEXLIB) $(MATHLIB) quantify: lp_solve.o $(LPKLIB) quantify $(CC) -o $(TARGET) $(CFLAGS) lp_solve.o $(LPKLIB) $(LEXLIB) $(MATHLIB) $(LPKLIB): $(LPKOBJ) ar rv $@ $(LPKOBJ) ranlib $(LPKLIB) $(YACCFILE.o): $(LEXFILE.c) $(LEXFILE.c): $(LEXFILE.l) $(LEX) $(LEXFILE.l) mv lex.yy.c $(LEXFILE.c) $(YACCFILE.c): $(YACCFILE.y) $(YACC) $(YACCFILE.y) mv y.tab.c $(YACCFILE.c) # liblpk.def: lpslink.o # dlltool -z liblpk.def -e exports.o -l liblpk.lib lpslink.o lpslink.dll: lpslink.o liblpk.def liblpk.a $(DLLWRAP) $(DLLWRAP_FLAGS) -o $@ --def liblpk.def \ lpslink.o $(DLL_LDFLAGS) $(DLL_LDLIBS) test: -for i in $(TESTFILES1); do\ ./$(TARGET) -s -S3 -time < $$i > xxx.tmp;\ if diff xxx.tmp lp_examples/`basename $$i .lp`.out > /dev/null; then\ echo "$$i gives the correct result";\ else\ echo "*** $$i gives different result, please check ***";\ fi;\ done;\ for i in $(TESTFILES2); do\ ./$(TARGET) -mps -s -S3 -time < $$i > xxx.tmp;\ if diff xxx.tmp lp_examples/`basename $$i .mps`.out > /dev/null; then\ echo "$$i gives the correct result";\ else\ echo "*** $$i gives different result, please check ***";\ fi;\ done;\ rm xxx.tmp mktest: -for i in $(TESTFILES1); do\ ./$(TARGET) -s -S3 -time < $$i > lp_examples/`basename $$i .lp`.out;\ done;\ for i in $(TESTFILES2); do\ ./$(TARGET) -mps -s -S3 -time < $$i > lp_examples/`basename $$i .mps`.out;\ done;\ $(TARGET).man: $(TARGET).1 nroff -man $(TARGET).1 > $(TARGET).man MANIFEST: clean ls -lR > MANIFEST; ls -lR > MANIFEST clean: rm -f *.a *.o TAGS $(LEXFILE.c) $(YACCFILE.c) demo $(TARGET) lp2mps mps2lp .pure .softdebughist datafile TAGS: etags *.[chyl] lp_solve_5.5/Makefile.in100666 0 0 6036 10641503502 13605 0ustar usergroupPACKAGE_NAME=@PACKAGE_NAME@ PACKAGE_STRING=@PACKAGE_NAME@_@PACKAGE_VERSION@ CCSHARED=@CCSHARED@ prefix = @prefix@ includedir = @includedir@/lpsolve libdir = @libdir@ CFLAGS=@CFLAGS@ INCLUDES=-I. -I./shared -I./bfp -I./bfp/bfp_LUSOL -I./bfp/bfp_LUSOL/LUSOL -I./colamd DEFINES=-DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine @DEF@ LIBS=-lc -lm -ldl INSTALL_DATA = ${INSTALL} -m 644 INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL = @INSTALL@ mkdir_p = mkdir -p HEADERS = \ declare.h \ fortify.h \ ini.h \ lp_crash.h \ lp_explicit.h \ lp_fortify.h \ lp_Hash.h \ lpkit.h \ lp_lib.h \ lp_matrix.h \ lp_MDO.h \ lp_mipbb.h \ lp_MPS.h \ lp_presolve.h \ lp_price.h \ lp_pricePSE.h \ lp_report.h \ lp_rlp.h \ lp_scale.h \ lp_simplex.h \ lp_solveDLL.h \ lpsolve.h \ lp_SOS.h \ lp_types.h \ lp_utils.h \ lp_wlp.h \ ufortify.h \ yacc_read.h SOURCES = lp_MDO.c \ shared/commonlib.c \ shared/mmio.c \ shared/myblas.c \ ini.c \ fortify.c \ colamd/colamd.c \ lp_rlp.c \ lp_crash.c \ bfp/bfp_LUSOL/lp_LUSOL.c \ bfp/bfp_LUSOL/LUSOL/lusol.c \ lp_Hash.c \ lp_lib.c \ lp_wlp.c \ lp_matrix.c \ lp_mipbb.c \ lp_MPS.c \ lp_params.c \ lp_presolve.c \ lp_price.c \ lp_pricePSE.c \ lp_report.c \ lp_scale.c \ lp_simplex.c \ lp_SOS.c \ lp_utils.c \ yacc_read.c all: liblpsolve55.a @SHARED_LIB@ # OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) #.c.o: # $(CC) -s -c $(INCLUDES) $(CFLAGS) $(DEFINES) $(SOURCES) liblpsolve55.a: $(SOURCES) $(CC) -s -c $(INCLUDES) $(CFLAGS) $(DEFINES) $(SOURCES) ar rv $@ `echo $(SOURCES)|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` ranlib $@ liblpsolve55@SO@: $(SOURCES) $(CC) $(CCSHARED) -s -c $(INCLUDES) $(CFLAGS) $(DEFINES) $(SOURCES) $(CC) -shared -Wl,-Bsymbolic -Wl,-soname,$@ -o $@ `echo $(SOURCES)|sed s/[.]c/.o/g|sed 's/[^ ]*\///g'` $(LIBS) install: install-HEADERS install-LIBRARIES install-HEADERS: $(HEADERS) test -d $(includedir) || $(mkdir_p) $(includedir) @list='$(HEADERS)'; for p in $$list; do \ echo " $(INSTALL) $$p $(includedir)/$$f"; \ $(INSTALL) $$p $(includedir)/$$f; \ done install-LIBRARIES: liblpsolve55.a @SHARED_LIB@ test -d $(libdir) || $(mkdir_p) $(libdir) @list='liblpsolve55.a @SHARED_LIB@'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL) $$p $(libdir)/$$f"; \ $(INSTALL) $$p $(libdir)/$$f; \ else :; fi; \ done uninstall-LIBRARIES: @set -x; list='liblpsolve55.a @SHARED_LIB@'; for p in $$list; do \ echo " rm -f $(libdir)/$$f"; \ rm -f "$(libdir)/$$f"; \ done uninstall: uninstall-HEADERS uninstall-LIBRARIES uninstall-HEADERS: @set -x; @list=$(HEADERS); for p in $$list; do \ echo " rm -f $(includedir)/$$f"; \ rm -f "$(includedir)/$$f"; \ done dist: mkdir $(PACKAGE_STRING) tar -cpf- -T MANIFEST | (cd $(PACKAGE_STRING) && tar -xpf- ) tar -czpf $(PACKAGE_STRING).tar.bz2 ./$(PACKAGE_STRING) -rm -fr $(PACKAGE_STRING) CLEANFILES = *.o *.so *.a clean: -rm -f $(CLEANFILES) .PHONY: install install-HEADERS install-LIBRARIES uninstall uninstall-HEADERS uninstall-LIBRARIES all lp_solve_5.5/Makefile.Linux100666 0 0 5000 10557467270 14305 0ustar usergroup# # Makefile for building lp_solve using GNU Make # Usage: # make -f Makefile.Linux [all | bin | lib | clean] # # $Revision: 1.1 $ # AR = ar ARFLAGS = rv CC = gcc LEX = flex YACC = bison INCLUDE = -I. -Ibfp -Ibfp/bfp_LUSOL -Ibfp/bfp_LUSOL/LUSOL -Icolamd -Ishared # Uncomment any of the following two depending on your profile #DEBUG = -g -pg DEBUG = -O2 DEFINE = -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine # Uncomment any of the following two depending on how easily compiler messages scare you #CFLAGS= $(INCLUDE) $(DEBUG) $(DEFINE) -fpic -Wall -pedantic -trigraphs CFLAGS= $(INCLUDE) $(DEBUG) $(DEFINE) -fpic LFLAGS = -L -l YFLAGS = --no-lines -y LDFLAGS = -lm -ldl LUSOLSRC = bfp/bfp_LUSOL/lp_LUSOL.c bfp/bfp_LUSOL/LUSOL/lusol.c LUSOLOBJS = bfp/bfp_LUSOL/lp_LUSOL.o bfp/bfp_LUSOL/LUSOL/lusol.o OBJECTS = $(LUSOLOBJS) lp_MDO.o shared/commonlib.o colamd/colamd.o \ shared/mmio.o shared/myblas.o ini.o fortify.o lp_rlp.o lp_crash.o \ lp_Hash.o lp_lib.o lp_wlp.o lp_matrix.o lp_mipbb.o lp_MPS.o \ lp_params.o lp_presolve.o lp_price.o lp_pricePSE.o lp_report.o \ lp_scale.o lp_simplex.o lp_SOS.o lp_utils.o yacc_read.o SRC = $(LUSOLSRC) lp_MDO.c shared/commonlib.c colamd/colamd.c \ shared/mmio.c shared/myblas.c ini.c fortify.c lp_rlp.c lp_crash.c \ lp_Hash.c lp_lib.c lp_wlp.c lp_matrix.c lp_mipbb.c lp_MPS.c \ lp_params.c lp_presolve.c lp_price.c lp_pricePSE.c lp_report.c \ lp_scale.c lp_simplex.c lp_SOS.c lp_utils.c yacc_read.c LIBRARIES = liblpsolve55.a liblpsolve55.so BINARIES = lp_solve demo ALL = $(BINARIES) $(DEMOS) $(LIBRARIES) .PHONY=clean lp_solve all: $(ALL) lib: $(LIBRARIES) bin: $(BINARIES) objects: $(OBJECTS) lp_rlp.o: lp_rlp.l lp_rlp.y $(LEX) $(LFLAGS) lp_rlp.l sed -e "s/yy/lp_yy/g" lex.yy.c >lp_rlp.h rm -f lex.yy.c $(YACC) $(YFLAGS) lp_rlp.y sed -e "s/yy/lp_yy/g" y.tab.c >lp_rlp.c rm -f y.tab.c $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INCLUDE) -c $*.c lp_solve: lp_solve/lp_solve.c $(OBJECTS) $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INCLUDE) $< $(OBJECTS) -o lp_solve/lp_solve $(LDFLAGS) demo: demo/demo.c $(OBJECTS) $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INCLUDE) $< $(OBJECTS) -o demo/demo $(LDFLAGS) liblpsolve55.a: $(OBJECTS) $(AR) $(ARFLAGS) lpsolve55/$@ `echo $(SRC)|sed 's/[.]c/.o/g'` ranlib lpsolve55/$@ liblpsolve55.so: $(OBJECTS) $(CC) -fpic -shared -Wl,-Bsymbolic -Wl,-soname,$@ -o lpsolve55/$@ `echo $(SRC)|sed 's/[.]c/.o/g'` $(LDFLAGS) clean: rm -f $(OBJECTS) *.so *.a lp_solve/lp_solve demo/demo lpsolve55/*.so lpsolve55/*.a lp_solve_5.5/Makefile.msc100666 0 0 5274 10560217106 13766 0ustar usergroup# # Makefile for building lp_solve using GNU Make # Usage: # gmake -f Makefile.msc [all | bin | lib | clean] # # $Revision: 1.1 $ # AR = ar ARFLAGS = rv CC = cl LEX = flex YACC = bison INC = -I. -Ibfp -Ibfp/bfp_LUSOL -Ibfp/bfp_LUSOL/LUSOL -Icolamd -Ishared # Uncomment any of the following two depending on your profile #DEBUG = -g -pg DEBUG = /ML /O1 /Zp8 /Gd /W2 /DWIN32 /D_WINDOWS DEFINE = -DNoParanoia -DWIN32 -DYY_NEVER_INTERACTIVE -DPARSER_LP -DINVERSE_ACTIVE=INVERSE_LUSOL -DRoleIsExternalInvEngine # Uncomment any of the following two depending on how easily compiler messages scare you CFLAGS= $(INC) $(DEBUG) $(DEFINE) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE LFLAGS = -L -l YFLAGS = --no-lines -y LDFLAGS = LUSOLSRC = bfp/bfp_LUSOL/lp_LUSOL.c bfp/bfp_LUSOL/LUSOL/lusol.c LUSOLOBJS = bfp/bfp_LUSOL/lp_LUSOL.obj bfp/bfp_LUSOL/LUSOL/lusol.obj OBJECTS = $(LUSOLOBJS) lp_MDO.obj shared/commonlib.obj colamd/colamd.obj \ shared/mmio.obj shared/myblas.obj ini.obj fortify.obj lp_rlp.obj lp_crash.obj \ lp_Hash.obj lp_lib.obj lp_wlp.obj lp_matrix.obj lp_mipbb.obj lp_MPS.obj \ lp_params.obj lp_presolve.obj lp_price.obj lp_pricePSE.obj lp_report.obj \ lp_scale.obj lp_simplex.obj lp_SOS.obj lp_utils.obj yacc_read.obj SRC = $(LUSOLSRC) lp_MDO.c shared/commonlib.c colamd/colamd.c \ shared/mmio.c shared/myblas.c ini.c fortify.c lp_rlp.c lp_crash.c \ lp_Hash.c lp_lib.c lp_wlp.c lp_matrix.c lp_mipbb.c lp_MPS.c \ lp_params.c lp_presolve.c lp_price.c lp_pricePSE.c lp_report.c \ lp_scale.c lp_simplex.c lp_SOS.c lp_utils.c yacc_read.c #LIBRARIES = liblpsolve55.lib liblpsolve55d.lib lpsolve55.dll LIBRARIES = #BINARIES = lp_solve.exe demo.exe BINARIES = lp_solve.exe ALL = $(BINARIES) $(DEMOS) $(LIBRARIES) .PHONY=clean lp_solve all: $(ALL) lib: $(LIBRARIES) bin: $(BINARIES) objects: $(OBJECTS) $(OBJECTS): $(SRC) $(CC) -c $(CFLAGS) $(SRC) lp_rlp.c: lp_rlp.l lp_rlp.y $(LEX) $(LFLAGS) lp_rlp.l sed -e "s/yy/lp_yy/g" lex.yy.c >lp_rlp.h rm -f lex.yy.c $(YACC) $(YFLAGS) lp_rlp.y sed -e "s/yy/lp_yy/g" y.tab.c >lp_rlp.c rm -f y.tab.c $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INC) -c $*.c lp_solve.exe: lp_solve/lp_solve.c $(OBJECTS) $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INC) $< $(OBJECTS) -Felp_solve/lp_solve $(LDFLAGS) demo.exe: demo/demo.c $(OBJECTS) $(CC) $(CFLAGS) $(DEBUG) $(DEFINE) $(INC) $< $(OBJECTS) -Fedemo/demo $(LDFLAGS) lpsolve.res: lpsolve.rc $(RC) lpsolve.rc liblpsolve55.lib: $(OBJECTS) $(LIB) *.obj /OUT:lpsolve55/$@ lpsolve55.dll: $(OBJECTS) $(CC) -fpic -shared -Wl,-Bsymbolic -Wl,-soname,$@ -o lpsolve55/$@ `echo $(SRC)|sed 's/[.]c/.obj/g'` $(LDFLAGS) clean: rm -f $(OBJECTS) *.lib *.dll lp_solve/lp_solve.exe demo/demo.exe lpsolve55/*.dll lpsolve55/*.lib lp_solve_5.5/README.txt100666 0 0 64704 11254506753 13300 0ustar usergroupIntroduction ------------ What is lp_solve and what is it not? The simple answer is, lp_solve is a Mixed Integer Linear Programming (MILP) solver. It is a free (see LGPL for the GNU lesser general public license) linear (integer) programming solver based on the revised simplex method and the Branch-and-bound method for the integers. It contains full source, examples and manuals. lp_solve solves pure linear, (mixed) integer/binary, semi-continuous and special ordered sets (SOS) models. See the reference guide for more information. lp_solve 5.5 ------------ Why a jump from version numbers 5.1 to 5.5 ? This is done to indicate that this is more than just another update. The solver engine was revised and optimised in such a way that performance has improved considerably. Numerical stability is also better resulting in more models that can be solved. The LUSOL bfp is now also the default. In the past, the etaPFI bfp package was the default, but for larger models this leads faster to numerical instabilities and performance problems. Overall, the v5.5 code is faster and more robust than v5.1. This robustness is for example proven by the fact that many more models can now be solved even without scaling. The API hasn't changed very much. There are a couple of new routines and one routine has an extra argument. Some constants got new values. * Fundamental internal change to the solver engine resulting in better performance and numerical stability. Both the LP solver and the B&B solvers are enhanced. * Optimised MILP branch truncation, with reduced cost fixing. * LUSOL bfp is now the default. * Presolve is improved in functionality and performance. * Better handling of degeneracy, with more options. * Store and read options from a file make it easier to set options. * Partial pricing for the primal simplex now works. * Full support for xli_ZIMPL v2.0.3. * The objective function is no longer stored as part of the constraint matrix. * Dual-long step code is in place, but not fully activated yet. * General code cleanup. * Added OBJSENSE and OBJNAME headers in the free MPS format (See MPS file format). * The MathProg xli driver has now the ability to generate a model. * New API routines Start by taking a look at 'Changes compared to version 4', 'Changes from version 5.1 to version 5.5' and 'lp_solve usage' This gives a good starting point. BFP's ----- BFP stands for Basis Factorization Package, which is a unique lp_solve feature. Considerable effort has been put in this new feature and we have big expectations for this. BFP is a generic interface model and users can develop their own implementations based on the provided templates. We are very interested in providing as many different BFPs as possible to the community. lp_solve 5.5 has the LUSOL BFP built in as default engine. In addition two other BFPs are included for both Windows and Linux: bfp_etaPFI.dll, bfp_GLPK.dll for Windows and libbfp_etaPFI.so, libbfp_GLPK.so for Linux. The bfp_etaPFI includes advanced column ordering using the COLAMD library, as well as better pivot management for stability. For complex models, however, the LU factorization approach is much better, and lp_solve now includes LUSOL as one of the most stable engines available anywhere. LUSOL was originally developed by Prof. Saunders at Stanford, and it has now been ported to C and enhanced by Kjell. If you compile BFPs yourself, make sure that under Windows, you use __stdcall convention and use 8 byte alignments. This is needed for the BFPs to work correctly with the general distribution of lp_solve and also to make sharing BFPs as uncomplicated as possible. See the reference guide for more information. XLI's ----- XLI stands for eXternal Language Interface, also a unique lp_solve feature. XLI's are stand-alone libraries used as add-on to lp_solve to make it possible to read and write lp models in a format not natively supported by lp_solve. Examples are CPLEX lp format, LINDO lp format, MathProg format, XML format... See the reference guide for more information. lpsolve API ----------- Don't forget that the API has changed compared to previous versions of lpsolve and that you just can't use the version 5 lpsolve library with your version 4 or older code. That is also the reason why the library is now called lpsolve55.dll/lpsolve55.a. lpsolve55.dll or lpsolve55.a are only needed when you call the lpsolve library via the API interface from your program. The lp_solve program is still a stand-alone executable program. There are examples interfaces for different language like C, VB, C#, VB.NET, Java, Delphi, and there is now also even a COM object to access the lpsolve library. This means that the door is wide-open for using lp_solve in many different situations. Thus everything that is available in version 4 is now also available in version 5 and already much more! See the reference guide for more information. Conversion between lp modeling formats -------------------------------------- Note that lp2mps and mps2lp don't exist anymore. However this functionality is now implemented in lp_solve: lp2mps can be simulated as following: lp_solve -parse_only -lp infile -wmps outfile mps2lp can be simulated as following: lp_solve -parse_only -mps infile -wlp outfile via the -rxli option, a model can be read via an XLI library and via the -wxli option, a model can be written via an XLI library. How to build the executables yourself. --------------------------------------- At this time, there are no Makefiles yet. However for the time being, there are batch files/scripts to build. For the Microsoft compiler under Windows, use cvc6.bat, for the gnu compiler under Windows, use cgcc.bat and for Unix/Linux, use the ccc shell script (sh ccc). See the reference guide for more information. IDE --- Under Windows, there is now also a very user friendly lpsolve IDE. Check out LPSolveIDE See the reference guide for more information. Documentation (reference guide) ------------------------------- See lp_solve55.chm for a Windows HTML help documentation file. The html files are also in lp_solve_5.5_doc.tar.gz. Start with index.htm Also see http://lpsolve.sourceforge.net/ for a on-line documentation Change history: --------------- 17/05/05 version 5.5.0.0 - Beta release of version 5.5 ??/??/05 version 5.5.0.1 - ? 26/06/05 version 5.5.0.2 - ? 29/06/05 version 5.5.0.3 - ? 16/08/05 version 5.5.0.4 - There are no API changes - The LUSOL message routine could generate a crash under some cicumstances. Fixed - A crash could occur when building the model in add_row_mode. Fixed. - write_params didn't write the PRESOLVE and PRESOLVELOOPS correctly. Fixed. - write_params didn't write constants with value 0. Fixed. - The library did not compile under msdev 2002 (VC 7.0 _MSC_VER 1300). Fixed. - There were some problems with printing long long variables which could generate a crash. Fixed. - An overflow error could occur because memory was sometimes overwritten. Fixed. - Presolve routines are revised. They are again improved and made faster. Also some problems with it are fixed (possible crashes). - Solver revised. Again made faster and more stable. - get_row/get_column returned FALSE if the row/column is empty. Fixed. - get_rowex/get_columnex now returns -1 if and error is detected. This instead of 0. This to know the distinction between an empty row/column and an error. - set_bounds had a possible problem when min and max are equal. Fixed. - A crash/damage error could occur when rows/columns are added after a solve. Fixed. - The my_chsign macro in lp_types.h gave warnings with some compilers. Fixed. - The lp_solve program now returns 255 if an unexpected error occurs. Before this was 1 But this interferes with the lpsolve library return codes. - With the lp_solve program, debug and print modes were not written correctly in a specified parameter file. Fixed. - With the lp_solve program, presolveloops was not set correctly. Fixed. 17/09/05 version 5.5.0.5 - In some cases, SOS restrictions were not optimized till optimality. Fixed. - Presolve sometimes generated 'Column -xxx out of range during presolve' with a possible crash. - Presolve sometimes removed integer and/or semi-cont variables that should not be deleted. Fixed. - B&B sometimes didn't find the most optimal solution. Fixed. - Internal constant COMP_EQUAL renamed to COMP_PREFERNONE because this could interfere with a define in the standard header files. - The lp parser had problems with variables starting with INF and there is a + or - sign just before it. Fixed. - Added options -presolvem, -presolvefd, -presolvebnd, -presolved, -presolveslk - Updated documentation. put_bb_branchfunc, put_bb_nodefunc, set_epslevel, dualize_lp, set_basisvar 16/11/05 version 5.5.0.6 - set_add_rowmode should not be called after a solve. There is now a test in this routine when this is done and it then returns FALSE. - When an empty string ("") as filename is provided to set_outputfile, then output is completely ignored. - In some cases, SOS models did not solve to their most optimal solution. - There was as problem with get_sensitivity_objex. Calling it (sometimes only after multiple times) resulted in protection errors/core dumps. - When a model has no constraints, it did not solve most of the times. - column_in_lp didn't work anymore. - Large upper bounds could make the model unstable. A change was made to fix this. - set_improve could let crash the model. - lp_params.c used the non-ANSI function unlink(). Changed to ANSI function remove(). - Presolve is again revised considerably. - SOS handling is improved when there are a lot of SOS constraints. - Limited constraint-to-SOS1 presolve to constraints with at least 4 variables. - Limited bound tightening presolve loops. 12/02/06 version 5.5.0.7 - When SOS restrictions are added after a previous solve, a crash could occur. - Optimized renaming a variable when the new name is equal to the old name. - A possible crash could occur when presolve was enabled - The constant ANTIDEGEN_DEFAULT is changed. ANTIDEGEN_INFEASIBLE is removed from it. This constant should not be used unless you have some very tight and hard to solve models where the optimal solution numerically straddles infeasibility. - There was a possible problem with set_row(ex). It sometimes wrongfully changed the row. - When integer variables were scaled, it could happen that because of rounding errors, a loop was created. - Sometimes integer models kept on looping in the B&B algorithm. - A memory overrun could occur when an initial basis is set. This when variable names are in Rnnn format and constraint names in Cnnn format. - Some fixes are made in presolve. - On 64-bit systems, compiler warnings were given and some code worked wrong resulting in wrong results. - lp_solve.c didn't compile with some compilers because if a very deep nested if statement. - The distributed files now have the version number include in the filename. For example lp_solve_5.5.0.7_exe.zip This for a possible move to SourceForge in the (near?) future. - When illegal bounds are specified in the MPS format (lower bound larger than upper bound) then a warning was given but the illegal bound was just ignored and the model was solved. This resulted in a solution that did not comply to the original model. Now the message is seen as an error and solving is aborted. 06/09/06 version 5.5.0.8 - When presolve is active and columns are removed and there are SOS constraints, then presolve had an error which could result in hanging while solve or maybe wrong solutions. - set_row(ex) set wrong values when used after a previous solve and scaling is active. - disabled PRESOLVE_REDUCEMIP since it is very rare that this is effective, and also that it adds code complications and delayed presolve effects that are not captured properly. - made routine guess_basis available for all languages (now exported by the dll). The routine is now also documented. - some bug corrections in guess_basis. - Corrected a problem with add_column(ex) when add_rowmode is enabled. - write_lp now wraps long lines over multiple lines to make it more readable. - A compilation warning/error sometimes occured on is_fixedvar in lp_lusol.c with some compilers. - Added options -wxlisol and -wxlisolopt to lp_solve program to write a solution file for those XLIs that support it. - Updated CPLEX XLI to support constants in objective. - Added documentation on infeasible models, guess_basis, DIMACS models, CPLEX format, Zimpl, GNU Mathprog. Corrected/updated documentation on get_col_name, get_row_name, get_nameindex, write_xli, External Language Interfaces. - The mps reader was improved for the rarely cases where the same elements are provided multiple times. These are now added. - Revised the java unittest example because it gave some errors that it shouldn't give. 07/10/06 version 5.5.0.9 - set_row(ex) could sometimes set wrong values in the model. - Sometimes models with semi-cont variables which are also integer and scaling is active, a solution was returned that is not most optimal or it returns infeasible. - write_mps didn't write semi-cont variables with an infinite upper bound. - When presolve can solve the model on its own and objective direction is maximize then a wrong sign was shown in the reported price on screen. - write_lp writes constraint and bounds in the same way if a constraint is not named. If a constraint only has one variable then it looks like a bound. This can give problems because when a constraint is interpreted as bound and it is negative then the problem definition changes. Therefore a constraint which is not named and having only one variable in it is getting a name to make sure it is interpreted as a constraint. - The lp_solve program didn't interprete the PRESOLVED solve return code very well. Fixed. - bfp_GLPK and xli_MathProg are now compiled against GLPK 4.11 - When an integer model is aborted before the most optimal solution is found (timeout or break at first, ...) solve returned OPTIMAL (0) instead of SUBOPTIMAL (1). This is now corrected. 14/01/07 version 5.5.0.10 - If a model has integer variables, but the model is already integer optimal in the simplex fase, then it was reported as suboptimal feasible. - get_objective, get_variables, get_ptr_variables, get_constraints, get_ptr_constraints, get_primal_solution reported 'not a valid basis' when presolve is active and the model is entirely solved by presolve. - presolve on a model with SOS variables sometimes went wrong. - presolve on a model with SOS variables where infeasibility is detected crashed. - read_bas could fail when not all constraints had names or had names like default variable names. - A crash could occur with set_row(ex) in rowmode. - The lp format has been extended with a free section to define free variables. - bfp_GLPK and xli_MathProg are now compiled against GLPK 4.13 - fixed bug in the pseudocost logic that can blow up subsequent pseudocost values in that branch and make them almost random. - In some rare cases a memory overrun could occur when constraints are added after a previous solve. - Made the copy_lp routine work. Note that information about the optimisation of the original model is not copied (at this time). Only the model is. - Fixed a bug in the hashing routines that had only influence in some rare cases in the MATLAB, O-Matrix, Scilab, Octave, Python drivers. - coldual sometimes worked on a uninitialised variable value with unpredictable results. 27/12/07 version 5.5.0.11 - Fixed a problem in presolve. Sometimes an array-index-out-of-bounds error occured. - Added a makefile for Linux. - When adding constraints, in some rare cases a memory overrun could occur resulting in a crash. - add_constraintex with count=0 and row=colno=NULL gave a protection error. several XLIs didn't work anymore because of this. - set_constr_type sometimes set wrong signs for the coefficient matrix when add_rowmode is on. - presolve did an unnecessary extra loop. Also a test is added to stop presolve when very few changes are done. - for very large models, a request of much more memory than is reasonable could occur. Fixed. - Modified LINDO XLI to read keywords also not at column 1 and to accept an empty objective function. Previously this wat not possible. - In some rare cases, numbers very close to their integer values (for example 11276.999999999998) were truncated to their ceiling value (for example 11276) instead of rounded (for example 11277). - Solved a problem with presolve with an all-int constraint. - Solved a problem with presolve coldominate - Added stronger checking of the MPS format. Fields that must be blank are now also tested accordingly so that if data is there that it is not ignored as before. - FREE MPS format was not read ok if row/column name were all numbers or a FR, MI, PL, BV bound was defined. Fixed. - The lp-format now also supports a bin(ary) section to define binary variables. - When an integer model is aborted before the most optimal solution is found via break at first or break at value, solve returned OPTIMAL (0) instead of SUBOPTIMAL (1). This is now corrected. Problem occured in version 5.5.0.10 - Fixed a problem with del_constraint. Constraints names were not shifted and reported variable result was incorrect. - read_XLI failed with MathProg if datamodel was provided with "" when there is no datamodel. NULL was expected in the past. "" is now also accepted. - Added an XLI to read Xpress lp files. - Added routines MPS_writefileex, write_lpex. - Added options -o0, -o1 to lp_solve command driven program to specify if objective is in basis or not. - Added new information in the reference guide: - Linear programming basics - Presolve - Xpress lp files 04/01/08 version 5.5.0.11 - There was an error in the lp-parser resulting is misreading the model in many cases. This was fixed in the existing release and an update of following files is posted: lp_solve_5.5.0.11_exe.tar.gz lp_solve_5.5.0.11_dev.tar.gz lp_solve_5.5.0.11_source.tar.gz lp_solve_5.5.0.11_exe.zip lp_solve_5.5.0.11_dev.zip 13/03/08 version 5.5.0.12 - When NODE_RCOSTFIXING (bound tightening during B&B) (enabled by default) was enabled some models were not solved to optimality. - In following situation a (sub-optimal) solution was returned while no integer solution isn't found yet at this time. - The model contains integers - A break at first is set - A timeout is set - The timeout occurs before a first integer solution is found - When the timeout occurs, the simplex algorithm is in phase 2 and has a feasible (but non-integer) solution, but not optimal yet. - If an integer solution is found with the same objective value as the relaxed solution then B&B is stopped. However this resulted in a report of a SUBOPTIMAL solution while this is not true. The found solution is then optimal. - On 64-bit Linux systems crashes occured when information is printed via variable argument routines. - There was a warning about redefinition of MAXINT32, MAXUINT32, MAXINT64, MAXUINT64 when compiled with MS Visual C 2008. - The reference guide now also contains the Java documentation. 03/08/08 version 5.5.0.13 - The code should now completely be reentrant and thread safe. Especially the lp-parser, but also the solver code itself used static variables which made it not reentrant. The lp parser code has changed considerably for this. Also the lex and yacc code had to be made reentrant. This is only tested with GNU flex and bison. Not with lex and yacc. This should be no problem since the corresponding c files are included with the source so people don't have to build these themselves. - commonlib.c/h were also under BFP/BFP_LUSOL/LUSOL while a more advanced version is also under the shared directory. The one from LUSOL is removed. - If objective coefficients are all integer and the columns are integer or objective coefficients are zero, then B&B can stop when the objective function equals ceil/floor(real objective) which results in a faster solving process. This did not work anymore and is now fixed. - The lpsolve IDE is now also on sourceforge (previously it was a link to another site). Also the sources are included. 02/02/09 version 5.5.0.14 - The lp format now allows spaces between the row label and the colon. - Added better error handling in the copy_lp API - Timeout in a MIP model sometimes resulted in an endless loop - Revised isnan call for gnu compilers - Removed some extra static variables for better reentrance support. - REPORT_Objective now reports large objective values (>1e-5) with better precision - On Windows the binaries are again compiled with compiler optimization /O2 for better performance. - Compiled and tested on Windows and Linux 64-bit. 64-bit binaries are now provided. Changed project files and compile scripts for 64-bit compilation. Binaries are now located in a subdirectory bin\platform - Added PHP driver so that lpsolve can be called from PHP - When an MPS file is created, upper bounds were written before lower bounds. Now it is the other way around. First lower bounds and then upper bounds. - The MPS reader could not handle negative lower bounds where the lower bound was specified after the upper bound. - The MPS write now writes the implicit lower bound of zero if the variable has no lower bound and it is integer. This to make sure that other solvers (like CPLEX) interprete the variable as integer and not binary. - The LINDO XLI parser interpreted negative lower and upper bounds as positive - Added the option -stat to the lp_solve driver program. It prints statistics of the model like number of rows/columns used and smalled and largest value in objective, RHS and coefficient matrix. - Added the option -plp to the lp_solve driver program. It prints the model via the print_lp API function. 09/09/09 version 5.5.0.15 - Improved guess_basis - set_row(ex) corrections. Actually completely revised the routine. Sometimes the matrix was corrupted after the call. - When in set_add_row mode, all API calls can now be used. For example printing or writing the model, retrieving data from the model and so on are now all possible in that mode. Will help greatly when debugging your models. - Sometimes an integer model is reported infeasible while it isn't because the integer solution is much different from the relaxed (real) model. Then API call set_bb_depthlimit can be used to increase the default B&B depth. However its new value was not used for the depth limit of an individual variabled which could result in still infeasible results. - modified the demo program not to use the str_ versions of API calls, because they are not performant and not intended to be used in real programs. - Added an lpsolve driver to Sysquake. - Added an lpsolve driver to FreeMat. - Added an lpsolve driver to Euler. - Added an Access example. - Added documentation to use lpsolve from Sage via the existing Python driver. - Changed the second parameter to read_mps, read_MPS, read_freemps and read_freeMPS from verbose to options. These routines now supports via this options parameter the native IBM interpretation of integer variables and allows to negate the objective constant. This is also supported by the lp_solve command line program via the -mps_ibm and -mps_negobjconst options. This is also supported by the IDE in the options tab. - Removed read_LPhandle and read_MPShandle from the lprec structure. On their place there is now read_LP and read_MPS. The handle functions are not usable anyway under windows as dll because the FILE structure is searched in the dll space and therefore not working. read_LP and read_MPS work on the file name and always work. Since these handle routines were not documented anyway and the lp structure should not be accessed by applications (except XLI and BFP drivers) this change should not give any (compatibility) problem at all. - write_lp/write_LP write just a + or - if the factor to a variable is +1 or -1 However when the number was not exactly one, for example 1.0000000000001, then the test on equal to one gave false, but the writing was a 1 because only 12 significant digits are written. The result was that the 1 was written in that case. Not an error, but when lp files are compared, this is enoying. Now this is solved. When a +1 or -1 would be written then alyways only + and - is written and +1 or -1 will never occur again. - When a message function is set via put_msgfunc, in message MSG_LPOPTIMAL it was not possible to get the solution. Now it is. Also when messages MSG_MILPFEASIBLE, MSG_MILPBETTER, MSG_MILPEQUAL were catched the returned solution was the one from the previous MIP solution. This is now also fixed. With this fix, the IDE now also shows the relaxed solution (column LP Optimal). - Extended the MATLAB, O-Matrix, Scilab, Octave, Python, PHP and of course the new Sysquake, FreeMat and Euler drivers to support string constants. See the reference guide. - Compiled and tested lpsolve on MAC OSX 10.4.8 (Intel). Compilation scripts for this platform were added and revised and binaries are provided to download. - Revised the c# and vb.net lpsolve code to pass arrays back and forth to the dll to make it also work on 64 bit systems. - IDE enhancements: - Can talk to the lpsolve55.dll large address aware version so access to 3.4G 32 bit memory. - Can write and read lp_solve parameter files ( type .lpi) via Options, Solver params, so it is easy to save a readable file of parameters for a particular problem class when it is found. The file can then be collected by the -rpar exe param or the read_params() API. - Added Options, Reset to solver defaults to go back to all lp_solve defaults. - Added in Help a link to the online help files. - Resized the help, main and statistics windows for Vista. - Added the Xpress XLI to the setup. - Use the latest dlls, especially lpsolve55.dll, in the setup. - Added the two new MPS options for IBM integer variables and negate objective constant. - Added the option to ignore integer restrictions. 17/09/09 version 5.5.0.15b - objfrom values where not correct if scaling is active. Routine to calculate these values and the objective from-till values is revised and made a bit more performant. - write_lp did not write all column data. For objective function and constraints. We are thrilled to hear from you and your experiences with this new version. The good and the bad. Also we would be pleased to hear about your experiences with the different BFPs on your models. Please send reactions to: Peter Notebaert: lpsolve@peno.be Kjell Eikland: kjell.eikland@broadpark.no lp_solve_5.5/shared/ 40777 0 0 0 11141374260 12707 5ustar usergrouplp_solve_5.5/shared/commonlib.c100666 0 0 61106 11141374257 15161 0ustar usergroup #include #if defined INTEGERTIME || defined CLOCKTIME || defined PosixTime # include #elif defined EnhTime # include #else # include #endif #include #include #ifdef WIN32 # include /* Used in file search functions */ #endif #include #include #include #include #include "commonlib.h" #ifdef FORTIFY # include "lp_fortify.h" #endif #if defined FPUexception /* FPU exception masks */ unsigned int clearFPU() { return( _clearfp() ); } unsigned int resetFPU(unsigned int mask) { _clearfp(); mask = _controlfp( mask, 0xfffff); return( mask ); } unsigned int catchFPU(unsigned int mask) { /* Always call _clearfp before enabling/unmasking a FPU exception */ unsigned int u = _clearfp(); /* Set the new mask by not-and'ing it with the previous settings */ u = _controlfp(0, 0); mask = u & ~mask; mask = _controlfp(mask, _MCW_EM); /* Return the previous mask */ return( u ); } #endif /* Math operator equivalence function */ int intpow(int base, int exponent) { int result = 1; while(exponent > 0) { result *= base; exponent--; } while(exponent < 0) { result /= base; exponent++; } return( result ); } int mod(int n, int d) { return(n % d); } /* Some string functions */ void strtoup(char *s) { if(s != NULL) while (*s) { *s = toupper(*s); s++; } } void strtolo(char *s) { if(s != NULL) while (*s) { *s = tolower(*s); s++; } } void strcpyup(char *t, char *s) { if((s != NULL) && (t != NULL)) { while (*s) { *t = toupper(*s); t++; s++; } *t = '\0'; } } void strcpylo(char *t, char *s) { if((s != NULL) && (t != NULL)) { while (*s) { *t = tolower(*s); t++; s++; } *t = '\0'; } } /* Unix library naming utility function */ MYBOOL so_stdname(char *stdname, char *descname, int buflen) { char *ptr; if((descname == NULL) || (stdname == NULL) || (((int) strlen(descname)) >= buflen - 6)) return( FALSE ); strcpy(stdname, descname); if((ptr = strrchr(descname, '/')) == NULL) ptr = descname; else ptr++; stdname[(int) (ptr - descname)] = 0; if(strncmp(ptr, "lib", 3)) strcat(stdname, "lib"); strcat(stdname, ptr); if(strcmp(stdname + strlen(stdname) - 3, ".so")) strcat(stdname, ".so"); return( TRUE ); } /* Return the greatest common divisor of a and b, or -1 if it is not defined. Return through the pointer arguments the integers such that gcd(a,b) = c*a + b*d. */ int gcd(LLONG a, LLONG b, int *c, int *d) { LLONG q,r,t; int cret,dret,C,D,rval, sgn_a = 1,sgn_b = 1, swap = 0; if((a == 0) || (b == 0)) return( -1 ); /* Use local multiplier instances, if necessary */ if(c == NULL) c = &cret; if(d == NULL) d = &dret; /* Normalize so that 0 < a <= b */ if(a < 0){ a = -a; sgn_a = -1; } if(b < 0){ b = -b; sgn_b = -1; } if(b < a){ t = b; b = a; a = t; swap = 1; } /* Now a <= b and both >= 1. */ q = b/a; r = b - a*q; if(r == 0) { if(swap){ *d = 1; *c = 0; } else { *c = 1; *d = 0; } *c = sgn_a*(*c); *d = sgn_b*(*d); return( (int) a ); } rval = gcd(a,r,&C,&D); if(swap){ *d = (int) (C-D*q); *c = D; } else { *d = D; *c = (int) (C-D*q); } *c = sgn_a*(*c); *d = sgn_b*(*d); return( rval ); } /* Array search functions */ int findIndex(int target, int *attributes, int count, int offset) { int focusPos, beginPos, endPos; int focusAttrib, beginAttrib, endAttrib; /* Set starting and ending index offsets */ beginPos = offset; endPos = beginPos + count - 1; if(endPos < beginPos) return(-1); /* Do binary search logic based on a sorted (decending) attribute vector */ focusPos = (beginPos + endPos) / 2; beginAttrib = attributes[beginPos]; focusAttrib = attributes[focusPos]; endAttrib = attributes[endPos]; while(endPos - beginPos > LINEARSEARCH) { if(beginAttrib == target) { focusAttrib = beginAttrib; endPos = beginPos; } else if(endAttrib == target) { focusAttrib = endAttrib; beginPos = endPos; } else if(focusAttrib < target) { beginPos = focusPos + 1; beginAttrib = attributes[beginPos]; focusPos = (beginPos + endPos) / 2; focusAttrib = attributes[focusPos]; } else if(focusAttrib > target) { endPos = focusPos - 1; endAttrib = attributes[endPos]; focusPos = (beginPos + endPos) / 2; focusAttrib = attributes[focusPos]; } else { beginPos = focusPos; endPos = focusPos; } } /* Do linear (unsorted) search logic */ if(endPos - beginPos <= LINEARSEARCH) { /* CPU intensive loop; provide alternative evaluation models */ #if defined DOFASTMATH /* Do fast pointer arithmetic */ int *attptr = attributes + beginPos; while((beginPos < endPos) && ((*attptr) < target)) { beginPos++; attptr++; } focusAttrib = (*attptr); #else /* Do traditional indexed access */ focusAttrib = attributes[beginPos]; while((beginPos < endPos) && (focusAttrib < target)) { beginPos++; focusAttrib = attributes[beginPos]; } #endif } /* Return the index if a match was found, or signal failure with a -1 */ if(focusAttrib == target) /* Found; return retrieval index */ return(beginPos); else if(focusAttrib > target) /* Not found; last item */ return(-beginPos); else if(beginPos > offset+count-1) return(-(endPos+1)); /* Not found; end of list */ else return(-(beginPos+1)); /* Not found; intermediate point */ } int findIndexEx(void *target, void *attributes, int count, int offset, int recsize, findCompare_func findCompare, MYBOOL ascending) { int focusPos, beginPos, endPos, compare, order; void *focusAttrib, *beginAttrib, *endAttrib; /* Set starting and ending index offsets */ beginPos = offset; endPos = beginPos + count - 1; if(endPos < beginPos) return(-1); order = (ascending ? -1 : 1); /* Do binary search logic based on a sorted attribute vector */ focusPos = (beginPos + endPos) / 2; beginAttrib = CMP_ATTRIBUTES(beginPos); focusAttrib = CMP_ATTRIBUTES(focusPos); endAttrib = CMP_ATTRIBUTES(endPos); compare = 0; while(endPos - beginPos > LINEARSEARCH) { if(findCompare(target, beginAttrib) == 0) { focusAttrib = beginAttrib; endPos = beginPos; } else if(findCompare(target, endAttrib) == 0) { focusAttrib = endAttrib; beginPos = endPos; } else { compare = findCompare(target, focusAttrib)*order; if(compare < 0) { beginPos = focusPos + 1; beginAttrib = CMP_ATTRIBUTES(beginPos); focusPos = (beginPos + endPos) / 2; focusAttrib = CMP_ATTRIBUTES(focusPos); } else if(compare > 0) { endPos = focusPos - 1; endAttrib = CMP_ATTRIBUTES(endPos); focusPos = (beginPos + endPos) / 2; focusAttrib = CMP_ATTRIBUTES(focusPos); } else { beginPos = focusPos; endPos = focusPos; } } } /* Do linear (unsorted) search logic */ if(endPos - beginPos <= LINEARSEARCH) { /* Do traditional indexed access */ focusAttrib = CMP_ATTRIBUTES(beginPos); if(beginPos == endPos) compare = findCompare(target, focusAttrib)*order; else while((beginPos < endPos) && ((compare = findCompare(target, focusAttrib)*order) < 0)) { beginPos++; focusAttrib = CMP_ATTRIBUTES(beginPos); } } /* Return the index if a match was found, or signal failure with a -1 */ if(compare == 0) /* Found; return retrieval index */ return(beginPos); else if(compare > 0) /* Not found; last item */ return(-beginPos); else if(beginPos > offset+count-1) return(-(endPos+1)); /* Not found; end of list */ else return(-(beginPos+1)); /* Not found; intermediate point */ } /* Simple sorting and searching comparison "operators" */ int CMP_CALLMODEL compareCHAR(const void *current, const void *candidate) { return( CMP_COMPARE( *(char *) current, *(char *) candidate ) ); } int CMP_CALLMODEL compareINT(const void *current, const void *candidate) { return( CMP_COMPARE( *(int *) current, *(int *) candidate ) ); } int CMP_CALLMODEL compareREAL(const void *current, const void *candidate) { return( CMP_COMPARE( *(REAL *) current, *(REAL *) candidate ) ); } /* Heap sort function (procedurally based on the Numerical Recipes version, but expanded and generalized to hande any object with the use of qsort-style comparison operator). An expanded version is also implemented, where interchanges are reflected in a caller-initialized integer "tags" list. */ void hpsort(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare) { register int i, j, k, ir, order; register char *hold, *base; char *save; if(count < 2) return; offset -= 1; attributes = CMP_ATTRIBUTES(offset); base = CMP_ATTRIBUTES(1); save = (char *) malloc(recsize); if(descending) order = -1; else order = 1; k = (count >> 1) + 1; ir = count; for(;;) { if(k > 1) { MEMCOPY(save, CMP_ATTRIBUTES(--k), recsize); } else { hold = CMP_ATTRIBUTES(ir); MEMCOPY(save, hold, recsize); MEMCOPY(hold, base, recsize); if(--ir == 1) { MEMCOPY(base, save, recsize); break; } } i = k; j = k << 1; while(j <= ir) { hold = CMP_ATTRIBUTES(j); if( (j < ir) && (findCompare(hold, CMP_ATTRIBUTES(j+1))*order < 0) ) { hold += recsize; j++; } if(findCompare(save, hold)*order < 0) { MEMCOPY(CMP_ATTRIBUTES(i), hold, recsize); i = j; j <<= 1; } else break; } MEMCOPY(CMP_ATTRIBUTES(i), save, recsize); } FREE(save); } void hpsortex(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare, int *tags) { if(count < 2) return; if(tags == NULL) { hpsort(attributes, count, offset, recsize, descending, findCompare); return; } else { register int i, j, k, ir, order; register char *hold, *base; char *save; int savetag; offset -= 1; attributes = CMP_ATTRIBUTES(offset); tags += offset; base = CMP_ATTRIBUTES(1); save = (char *) malloc(recsize); if(descending) order = -1; else order = 1; k = (count >> 1) + 1; ir = count; for(;;) { if(k > 1) { MEMCOPY(save, CMP_ATTRIBUTES(--k), recsize); savetag = tags[k]; } else { hold = CMP_ATTRIBUTES(ir); MEMCOPY(save, hold, recsize); MEMCOPY(hold, base, recsize); savetag = tags[ir]; tags[ir] = tags[1]; if(--ir == 1) { MEMCOPY(base, save, recsize); tags[1] = savetag; break; } } i = k; j = k << 1; while(j <= ir) { hold = CMP_ATTRIBUTES(j); if( (j < ir) && (findCompare(hold, CMP_ATTRIBUTES(j+1))*order < 0) ) { hold += recsize; j++; } if(findCompare(save, hold)*order < 0) { MEMCOPY(CMP_ATTRIBUTES(i), hold, recsize); tags[i] = tags[j]; i = j; j <<= 1; } else break; } MEMCOPY(CMP_ATTRIBUTES(i), save, recsize); tags[i] = savetag; } FREE(save); } } /* This is a "specialized generic" version of C.A.R Hoare's Quick Sort algorithm. It will handle arrays that are already sorted, and arrays with duplicate keys. There are two versions here; one extended conventional with optional tag data for each sortable value, and a version for the QSORTrec format. The QSORTrec format i.a. includes the ability for to do linked list sorting. If the passed comparison operator is NULL, the comparison is assumed to be for integers. */ #define QS_IS_switch LINEARSEARCH /* Threshold for switching to insertion sort */ void qsortex_swap(void *attributes, int l, int r, int recsize, void *tags, int tagsize, char *save, char *savetag) { MEMCOPY(save, CMP_ATTRIBUTES(l), recsize); MEMCOPY(CMP_ATTRIBUTES(l), CMP_ATTRIBUTES(r), recsize); MEMCOPY(CMP_ATTRIBUTES(r), save, recsize); if(tags != NULL) { MEMCOPY(savetag, CMP_TAGS(l), tagsize); MEMCOPY(CMP_TAGS(l), CMP_TAGS(r), tagsize); MEMCOPY(CMP_TAGS(r), savetag, tagsize); } } int qsortex_sort(void *attributes, int l, int r, int recsize, int sortorder, findCompare_func findCompare, void *tags, int tagsize, char *save, char *savetag) { register int i, j, nmove = 0; char *v; /* Perform the a fast QuickSort */ if((r-l) > QS_IS_switch) { i = (r+l)/2; /* Tri-Median Method */ if(sortorder*findCompare(CMP_ATTRIBUTES(l), CMP_ATTRIBUTES(i)) > 0) { nmove++; qsortex_swap(attributes, l,i, recsize, tags, tagsize, save, savetag); } if(sortorder*findCompare(CMP_ATTRIBUTES(l), CMP_ATTRIBUTES(r)) > 0) { nmove++; qsortex_swap(attributes, l,r, recsize, tags, tagsize, save, savetag); } if(sortorder*findCompare(CMP_ATTRIBUTES(i), CMP_ATTRIBUTES(r)) > 0) { nmove++; qsortex_swap(attributes, i,r, recsize, tags, tagsize, save, savetag); } j = r-1; qsortex_swap(attributes, i,j, recsize, tags, tagsize, save, savetag); i = l; v = CMP_ATTRIBUTES(j); for(;;) { while(sortorder*findCompare(CMP_ATTRIBUTES(++i), v) < 0); while(sortorder*findCompare(CMP_ATTRIBUTES(--j), v) > 0); if(j < i) break; nmove++; qsortex_swap(attributes, i,j, recsize, tags, tagsize, save, savetag); } nmove++; qsortex_swap(attributes, i,r-1, recsize, tags, tagsize, save, savetag); nmove += qsortex_sort(attributes, l,j, recsize, sortorder, findCompare, tags, tagsize, save, savetag); nmove += qsortex_sort(attributes, i+1,r, recsize, sortorder, findCompare, tags, tagsize, save, savetag); } return( nmove ); } int qsortex_finish(void *attributes, int lo0, int hi0, int recsize, int sortorder, findCompare_func findCompare, void *tags, int tagsize, char *save, char *savetag) { int i, j, nmove = 0; /* This is actually InsertionSort, which is faster for local sorts */ for(i = lo0+1; i <= hi0; i++) { /* Save bottom-most item */ MEMCOPY(save, CMP_ATTRIBUTES(i), recsize); if(tags != NULL) MEMCOPY(savetag, CMP_TAGS(i), tagsize); /* Shift down! */ j = i; while ((j > lo0) && (sortorder*findCompare(CMP_ATTRIBUTES(j-1), save) > 0)) { MEMCOPY(CMP_ATTRIBUTES(j), CMP_ATTRIBUTES(j-1), recsize); if(tags != NULL) MEMCOPY(CMP_TAGS(j), CMP_TAGS(j-1), tagsize); j--; nmove++; } /* Store bottom-most item at the top */ MEMCOPY(CMP_ATTRIBUTES(j), save, recsize); if(tags != NULL) MEMCOPY(CMP_TAGS(j), savetag, tagsize); } return( nmove ); } int qsortex(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare, void *tags, int tagsize) { int iswaps = 0, sortorder = (descending ? -1 : 1); char *save = NULL, *savetag = NULL; /* Check and initialize to zero-based arrays */ if(count <= 1) goto Finish; attributes = (void *) CMP_ATTRIBUTES(offset); save = (char *) malloc(recsize); if((tagsize <= 0) && (tags != NULL)) tags = NULL; else if(tags != NULL) { tags = (void *) CMP_TAGS(offset); savetag = (char *) malloc(tagsize); } count--; /* Perform sort */ iswaps = qsortex_sort(attributes, 0, count, recsize, sortorder, findCompare, tags, tagsize, save, savetag); #if QS_IS_switch > 0 iswaps += qsortex_finish(attributes, 0, count, recsize, sortorder, findCompare, tags, tagsize, save, savetag); #endif Finish: FREE(save); FREE(savetag); return( iswaps ); } #undef QS_IS_switch /* This is a "specialized generic" version of C.A.R Hoare's Quick Sort algorithm. It will handle arrays that are already sorted, and arrays with duplicate keys. The implementation here requires the user to pass a comparison operator and assumes that the array passed has the QSORTrec format, which i.a. includes the ability for to do linked list sorting. If the passed comparison operator is NULL, the comparison is assumed to be for integers. */ #define QS_IS_switch 4 /* Threshold for switching to insertion sort */ void QS_swap(UNIONTYPE QSORTrec a[], int i, int j) { UNIONTYPE QSORTrec T = a[i]; a[i] = a[j]; a[j] = T; } int QS_addfirst(UNIONTYPE QSORTrec a[], void *mydata) { a[0].pvoid2.ptr = mydata; return( 0 ); } int QS_append(UNIONTYPE QSORTrec a[], int ipos, void *mydata) { if(ipos <= 0) ipos = QS_addfirst(a, mydata); else a[ipos].pvoid2.ptr = mydata; return( ipos ); } void QS_replace(UNIONTYPE QSORTrec a[], int ipos, void *mydata) { a[ipos].pvoid2.ptr = mydata; } void QS_insert(UNIONTYPE QSORTrec a[], int ipos, void *mydata, int epos) { for(; epos > ipos; epos--) a[epos] = a[epos-1]; a[ipos].pvoid2.ptr = mydata; } void QS_delete(UNIONTYPE QSORTrec a[], int ipos, int epos) { for(; epos > ipos; epos--) a[epos] = a[epos-1]; } int QS_sort(UNIONTYPE QSORTrec a[], int l, int r, findCompare_func findCompare) { register int i, j, nmove = 0; UNIONTYPE QSORTrec v; /* Perform the a fast QuickSort */ if((r-l) > QS_IS_switch) { i = (r+l)/2; /* Tri-Median Method */ if(findCompare((char *) &a[l], (char *) &a[i]) > 0) { nmove++; QS_swap(a,l,i); } if(findCompare((char *) &a[l], (char *) &a[r]) > 0) { nmove++; QS_swap(a,l,r); } if(findCompare((char *) &a[i], (char *) &a[r]) > 0) { nmove++; QS_swap(a,i,r); } j = r-1; QS_swap(a,i,j); i = l; v = a[j]; for(;;) { while(findCompare((char *) &a[++i], (char *) &v) < 0); while(findCompare((char *) &a[--j], (char *) &v) > 0); if(j < i) break; nmove++; QS_swap (a,i,j); } nmove++; QS_swap(a,i,r-1); nmove += QS_sort(a,l,j,findCompare); nmove += QS_sort(a,i+1,r,findCompare); } return( nmove ); } int QS_finish(UNIONTYPE QSORTrec a[], int lo0, int hi0, findCompare_func findCompare) { int i, j, nmove = 0; UNIONTYPE QSORTrec v; /* This is actually InsertionSort, which is faster for local sorts */ for(i = lo0+1; i <= hi0; i++) { /* Save bottom-most item */ v = a[i]; /* Shift down! */ j = i; while ((j > lo0) && (findCompare((char *) &a[j-1], (char *) &v) > 0)) { a[j] = a[j-1]; j--; nmove++; } /* Store bottom-most item at the top */ a[j] = v; } return( nmove ); } MYBOOL QS_execute(UNIONTYPE QSORTrec a[], int count, findCompare_func findCompare, int *nswaps) { int iswaps = 0; /* Check and initialize */ if(count <= 1) goto Finish; count--; /* Perform sort */ iswaps = QS_sort(a, 0, count, findCompare); #if QS_IS_switch > 0 iswaps += QS_finish(a, 0, count, findCompare); #endif Finish: if(nswaps != NULL) *nswaps = iswaps; return( TRUE ); } /* Simple specialized bubble/insertion sort functions */ int sortByREAL(int *item, REAL *weight, int size, int offset, MYBOOL unique) { int i, ii, saveI; REAL saveW; for(i = 1; i < size; i++) { ii = i+offset-1; while ((ii >= offset) && (weight[ii] >= weight[ii+1])) { if(weight[ii] == weight[ii+1]) { if(unique) return(item[ii]); } else { saveI = item[ii]; saveW = weight[ii]; item[ii] = item[ii+1]; weight[ii] = weight[ii+1]; item[ii+1] = saveI; weight[ii+1] = saveW; } ii--; } } return(0); } int sortByINT(int *item, int *weight, int size, int offset, MYBOOL unique) { int i, ii, saveI; int saveW; for(i = 1; i < size; i++) { ii = i+offset-1; while ((ii >= offset) && (weight[ii] >= weight[ii+1])) { if(weight[ii] == weight[ii+1]) { if(unique) return(item[ii]); } else { saveI = item[ii]; saveW = weight[ii]; item[ii] = item[ii+1]; weight[ii] = weight[ii+1]; item[ii+1] = saveI; weight[ii+1] = saveW; } ii--; } } return(0); } REAL sortREALByINT(REAL *item, int *weight, int size, int offset, MYBOOL unique) { int i, ii, saveW; REAL saveI; for(i = 1; i < size; i++) { ii = i+offset-1; while ((ii >= offset) && (weight[ii] >= weight[ii+1])) { if(weight[ii] == weight[ii+1]) { if(unique) return(item[ii]); } else { saveI = item[ii]; saveW = weight[ii]; item[ii] = item[ii+1]; weight[ii] = weight[ii+1]; item[ii+1] = saveI; weight[ii+1] = saveW; } ii--; } } return(0); } /* Time and message functions */ double timeNow(void) { #ifdef INTEGERTIME return((double)time(NULL)); #elif defined CLOCKTIME return((double)clock()/CLOCKS_PER_SEC /* CLK_TCK */); #elif defined PosixTime struct timespec t; # if 0 clock_gettime(CLOCK_REALTIME, &t); return( (double) t.tv_sec + (double) t.tv_nsec/1.0e9 ); # else static double timeBase; clock_gettime(CLOCK_MONOTONIC, &t); if(timeBase == 0) timeBase = clockNow() - ((double) t.tv_sec + (double) t.tv_nsec/1.0e9); return( timeBase + (double) t.tv_sec + (double) t.tv_nsec/1.0e9 ); # endif #elif defined EnhTime static LARGE_INTEGER freq; static double timeBase; LARGE_INTEGER now; QueryPerformanceCounter(&now); if(timeBase == 0) { QueryPerformanceFrequency(&freq); timeBase = clockNow() - (double) now.QuadPart/(double) freq.QuadPart; } return( timeBase + (double) now.QuadPart/(double) freq.QuadPart ); #else struct timeb buf; ftime(&buf); return((double)buf.time+((double) buf.millitm)/1000.0); #endif } /* Miscellaneous reporting functions */ /* List a vector of INT values for the given index range */ void blockWriteINT(FILE *output, char *label, int *myvector, int first, int last) { int i, k = 0; fprintf(output, "%s", label); fprintf(output, "\n"); for(i = first; i <= last; i++) { fprintf(output, " %5d", myvector[i]); k++; if(k % 12 == 0) { fprintf(output, "\n"); k = 0; } } if(k % 12 != 0) fprintf(output, "\n"); } /* List a vector of MYBOOL values for the given index range */ void blockWriteBOOL(FILE *output, char *label, MYBOOL *myvector, int first, int last, MYBOOL asRaw) { int i, k = 0; fprintf(output, "%s", label); fprintf(output, "\n"); for(i = first; i <= last; i++) { if(asRaw) fprintf(output, " %1d", myvector[i]); else fprintf(output, " %5s", my_boolstr(myvector[i])); k++; if(k % 36 == 0) { fprintf(output, "\n"); k = 0; } } if(k % 36 != 0) fprintf(output, "\n"); } /* List a vector of REAL values for the given index range */ void blockWriteREAL(FILE *output, char *label, REAL *myvector, int first, int last) { int i, k = 0; fprintf(output, "%s", label); fprintf(output, "\n"); for(i = first; i <= last; i++) { fprintf(output, " %18g", myvector[i]); k++; if(k % 4 == 0) { fprintf(output, "\n"); k = 0; } } if(k % 4 != 0) fprintf(output, "\n"); } /* CONSOLE vector and matrix printing routines */ void printvec( int n, REAL *x, int modulo ) { int i; if (modulo <= 0) modulo = 5; for (i = 1; i<=n; i++) { if(mod(i, modulo) == 1) printf("\n%2d:%12g", i, x[i]); else printf(" %2d:%12g", i, x[i]); } if(i % modulo != 0) printf("\n"); } void printmatUT( int size, int n, REAL *U, int modulo) { int i, ll; ll = 0; for(i = 1; i<=n; i++) { printvec(n-i+1, &U[ll], modulo); ll += size-i+1; } } void printmatSQ( int size, int n, REAL *X, int modulo) { int i, ll; ll = 0; for(i = 1; i<=n; i++) { printvec(n, &X[ll], modulo); ll += size; } } /* Miscellaneous file functions */ #if defined _MSC_VER /* Check MS versions before 7 */ #if _MSC_VER < 1300 # define intptr_t long #endif int fileCount( char *filemask ) { struct _finddata_t c_file; intptr_t hFile; int count = 0; /* Find first .c file in current directory */ if( (hFile = _findfirst( filemask, &c_file )) == -1L ) ; /* Iterate over all matching names */ else { while( _findnext( hFile, &c_file ) == 0 ) count++; _findclose( hFile ); } return( count ); } MYBOOL fileSearchPath( char *envvar, char *searchfile, char *foundpath ) { char pathbuffer[_MAX_PATH]; _searchenv( searchfile, envvar, pathbuffer ); if(pathbuffer[0] == '\0') return( FALSE ); else { if(foundpath != NULL) strcpy(foundpath, pathbuffer); return( TRUE ); } } #endif lp_solve_5.5/shared/commonlib.h100666 0 0 22255 11245552432 15166 0ustar usergroup#ifndef HEADER_commonlib #define HEADER_commonlib #include #include #ifdef WIN32 #include #endif /* static char SpaceChars[3] = {" " "\7"}; */ /* static char NumChars[14] = {"0123456789-+."}; */ #define BIGNUMBER 1.0e+30 #define TINYNUMBER 1.0e-04 #define MACHINEPREC 2.22e-16 #define MATHPREC 1.0e-16 #define ERRLIMIT 1.0e-06 #ifndef LINEARSEARCH #define LINEARSEARCH 5 #endif #if 0 #define INTEGERTIME #endif /* ************************************************************************ */ /* Define loadable library function headers */ /* ************************************************************************ */ #if (defined WIN32) || (defined WIN64) #define my_LoadLibrary(name) LoadLibrary(name) #define my_GetProcAddress(handle, name) GetProcAddress(handle, name) #define my_FreeLibrary(handle) FreeLibrary(handle); \ handle = NULL #else #define my_LoadLibrary(name) dlopen(name, RTLD_LAZY) #define my_GetProcAddress(handle, name) dlsym(handle, name) #define my_FreeLibrary(handle) dlclose(handle); \ handle = NULL #endif /* ************************************************************************ */ /* Define sizes of standard number types */ /* ************************************************************************ */ #ifndef LLONG #if defined __BORLANDC__ #define LLONG __int64 #elif !defined _MSC_VER || _MSC_VER >= 1310 #define LLONG long long #else #define LLONG __int64 #endif #endif #ifndef MYBOOL #if 0 #define MYBOOL unsigned int #else #define MYBOOL unsigned char #endif #endif #ifndef REAL #define REAL double #endif #ifndef BLAS_prec #define BLAS_prec "d" /* The BLAS precision prefix must correspond to the REAL type */ #endif #ifndef REALXP #if 1 #define REALXP long double /* Set local accumulation variable as long double */ #else #define REALXP REAL /* Set local accumulation as default precision */ #endif #endif #ifndef my_boolstr #define my_boolstr(x) (!(x) ? "FALSE" : "TRUE") #endif #ifndef NULL #define NULL 0 #endif #ifndef FALSE #define FALSE 0 #define TRUE 1 #endif #ifndef DEF_STRBUFSIZE #define DEF_STRBUFSIZE 512 #endif #ifndef MAXINT32 #define MAXINT32 2147483647 #endif #ifndef MAXUINT32 #define MAXUINT32 4294967295 #endif #ifndef MAXINT64 #if defined _LONGLONG || defined __LONG_LONG_MAX__ || defined LLONG_MAX #define MAXINT64 9223372036854775807ll #else #define MAXINT64 9223372036854775807l #endif #endif #ifndef MAXUINT64 #if defined _LONGLONG || defined __LONG_LONG_MAX__ || defined LLONG_MAX #define MAXUINT64 18446744073709551615ll #else #define MAXUINT64 18446744073709551615l #endif #endif #ifndef DOFASTMATH #define DOFASTMATH #endif #ifndef CALLOC #define CALLOC(ptr, nr)\ if(!((void *) ptr = calloc((size_t)(nr), sizeof(*ptr))) && nr) {\ printf("calloc of %d bytes failed on line %d of file %s\n",\ (size_t) nr * sizeof(*ptr), __LINE__, __FILE__);\ } #endif #ifndef MALLOC #define MALLOC(ptr, nr)\ if(!((void *) ptr = malloc((size_t)((size_t) (nr) * sizeof(*ptr)))) && nr) {\ printf("malloc of %d bytes failed on line %d of file %s\n",\ (size_t) nr * sizeof(*ptr), __LINE__, __FILE__);\ } #endif #ifndef REALLOC #define REALLOC(ptr, nr)\ if(!((void *) ptr = realloc(ptr, (size_t)((size_t) (nr) * sizeof(*ptr)))) && nr) {\ printf("realloc of %d bytes failed on line %d of file %s\n",\ (size_t) nr * sizeof(*ptr), __LINE__, __FILE__);\ } #endif #ifndef FREE #define FREE(ptr)\ if((void *) ptr != NULL) {\ free(ptr);\ ptr = NULL; \ } #endif #ifndef MEMCOPY #define MEMCOPY(nptr, optr, nr)\ memcpy((nptr), (optr), (size_t)((size_t)(nr) * sizeof(*(optr)))) #endif #ifndef MEMMOVE #define MEMMOVE(nptr, optr, nr)\ memmove((nptr), (optr), (size_t)((size_t)(nr) * sizeof(*(optr)))) #endif #ifndef MEMALLOCCOPY #define MEMALLOCCOPY(nptr, optr, nr)\ {MALLOC(nptr, (size_t)(nr));\ MEMCOPY(nptr, optr, (size_t)(nr));} #endif #ifndef STRALLOCCOPY #define STRALLOCCOPY(nstr, ostr)\ {nstr = (char *) malloc((size_t) (strlen(ostr) + 1));\ strcpy(nstr, ostr);} #endif #ifndef MEMCLEAR /*#define useMMX*/ #ifdef useMMX #define MEMCLEAR(ptr, nr)\ mem_set((ptr), '\0', (size_t)((size_t)(nr) * sizeof(*(ptr)))) #else #define MEMCLEAR(ptr, nr)\ memset((ptr), '\0', (size_t)((size_t)(nr) * sizeof(*(ptr)))) #endif #endif #define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MAX(x, y) ((x) > (y) ? (x) : (y)) #define SETMIN(x, y) if((x) > (y)) x = y #define SETMAX(x, y) if((x) < (y)) x = y #define LIMIT(lo, x, hi) ((x < (lo) ? lo : ((x) > hi ? hi : x))) #define BETWEEN(x, a, b) (MYBOOL) (((x)-(a)) * ((x)-(b)) <= 0) #define IF(t, x, y) ((t) ? (x) : (y)) #define SIGN(x) ((x) < 0 ? -1 : 1) #define DELTA_SIZE(newSize, oldSize) ((int) ((newSize) * MIN(1.33, pow(1.5, fabs((double)newSize)/((oldSize+newSize)+1))))) #ifndef CMP_CALLMODEL #if (defined WIN32) || (defined WIN64) #define CMP_CALLMODEL _cdecl #else #define CMP_CALLMODEL #endif #endif typedef int (CMP_CALLMODEL findCompare_func)(const void *current, const void *candidate); #define CMP_COMPARE(current, candidate) ( current < candidate ? -1 : (current > candidate ? 1 : 0) ) #define CMP_ATTRIBUTES(item) (((char *) attributes)+(item)*recsize) #define CMP_TAGS(item) (((char *) tags)+(item)*tagsize) #ifndef UNIONTYPE #ifdef __cplusplus #define UNIONTYPE #else #define UNIONTYPE union #endif #endif /* This defines a 16 byte sort record (in both 32 and 64 bit OS-es) */ typedef struct _QSORTrec1 { void *ptr; void *ptr2; } QSORTrec1; typedef struct _QSORTrec2 { void *ptr; double realval; } QSORTrec2; typedef struct _QSORTrec3 { void *ptr; int intval; int intpar1; } QSORTrec3; typedef struct _QSORTrec4 { REAL realval; int intval; int intpar1; } QSORTrec4; typedef struct _QSORTrec5 { double realval; long int longval; } QSORTrec5; typedef struct _QSORTrec6 { double realval; double realpar1; } QSORTrec6; typedef struct _QSORTrec7 { int intval; int intpar1; int intpar2; int intpar3; } QSORTrec7; union QSORTrec { QSORTrec1 pvoid2; QSORTrec2 pvoidreal; QSORTrec3 pvoidint2; QSORTrec4 realint2; QSORTrec5 reallong; QSORTrec6 real2; QSORTrec7 int4; }; #ifdef __cplusplus extern "C" { #endif int intpow(int base, int exponent); int mod(int n, int d); void strtoup(char *s); void strtolo(char *s); void strcpyup(char *t, char *s); void strcpylo(char *t, char *s); MYBOOL so_stdname(char *stdname, char *descname, int buflen); int gcd(LLONG a, LLONG b, int *c, int *d); int findIndex(int target, int *attributes, int count, int offset); int findIndexEx(void *target, void *attributes, int count, int offset, int recsize, findCompare_func findCompare, MYBOOL ascending); void qsortex_swap(void *attributes, int l, int r, int recsize, void *tags, int tagsize, char *save, char *savetag); int qsortex(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare, void *tags, int tagsize); int CMP_CALLMODEL compareCHAR(const void *current, const void *candidate); int CMP_CALLMODEL compareINT(const void *current, const void *candidate); int CMP_CALLMODEL compareREAL(const void *current, const void *candidate); void hpsort(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare); void hpsortex(void *attributes, int count, int offset, int recsize, MYBOOL descending, findCompare_func findCompare, int *tags); void QS_swap(UNIONTYPE QSORTrec a[], int i, int j); int QS_addfirst(UNIONTYPE QSORTrec a[], void *mydata); int QS_append(UNIONTYPE QSORTrec a[], int ipos, void *mydata); void QS_replace(UNIONTYPE QSORTrec a[], int ipos, void *mydata); void QS_insert(UNIONTYPE QSORTrec a[], int ipos, void *mydata, int epos); void QS_delete(UNIONTYPE QSORTrec a[], int ipos, int epos); MYBOOL QS_execute(UNIONTYPE QSORTrec a[], int count, findCompare_func findCompare, int *nswaps); int sortByREAL(int *item, REAL *weight, int size, int offset, MYBOOL unique); int sortByINT(int *item, int *weight, int size, int offset, MYBOOL unique); REAL sortREALByINT(REAL *item, int *weight, int size, int offset, MYBOOL unique); double timeNow(void); void blockWriteBOOL(FILE *output, char *label, MYBOOL *myvector, int first, int last, MYBOOL asRaw); void blockWriteINT(FILE *output, char *label, int *myvector, int first, int last); void blockWriteREAL(FILE *output, char *label, REAL *myvector, int first, int last); void printvec( int n, REAL *x, int modulo ); void printmatSQ( int size, int n, REAL *X, int modulo ); void printmatUT( int size, int n, REAL *U, int modulo ); unsigned int catchFPU(unsigned int mask); #if defined _MSC_VER int fileCount( char *filemask ); MYBOOL fileSearchPath( char *envvar, char *searchfile, char *foundpath ); #endif #ifdef __cplusplus } #endif #endif /* HEADER_commonlib */ lp_solve_5.5/shared/mmio.c100666 0 0 30423 11141374257 14141 0ustar usergroup/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. * * (Version 1.01, 5/2003) */ #include #include #include #include #include "mmio.h" int mm_read_unsymmetric_sparse(const char *fname, int *M_, int *N_, int *nz_, double **val_, int **I_, int **J_) { FILE *f; MM_typecode matcode; int M, N, nz; int i; double *val; int *I, *J; int x; if ((f = fopen(fname, "r")) == NULL) return -1; if (mm_read_banner(f, &matcode) != 0) { printf("mm_read_unsymetric: Could not process Matrix Market banner "); printf(" in file [%s]\n", fname); return -1; } if ( !(mm_is_real(matcode) && mm_is_matrix(matcode) && mm_is_sparse(matcode))) { fprintf(stderr, "Sorry, this application does not support "); fprintf(stderr, "Market Market type: [%s]\n", mm_typecode_to_str(matcode)); return -1; } /* find out size of sparse matrix: M, N, nz .... */ if (mm_read_mtx_crd_size(f, &M, &N, &nz) !=0) { fprintf(stderr, "read_unsymmetric_sparse(): could not parse matrix size.\n"); return -1; } *M_ = M; *N_ = N; *nz_ = nz; /* reseve memory for matrices */ I = (int *) malloc(nz * sizeof(int)); J = (int *) malloc(nz * sizeof(int)); val = (double *) malloc(nz * sizeof(double)); *val_ = val; *I_ = I; *J_ = J; /* NOTE: when reading in doubles, ANSI C requires the use of the "l" */ /* specifier as in "%lg", "%lf", "%le", otherwise errors will occur */ /* (ANSI C X3.159-1989, Sec. 4.9.6.2, p. 136 lines 13-15) */ for (i=0; i= 2) return 0; else do { num_items_read = fscanf(f, "%d %d %d", M, N, nz); if (num_items_read == EOF) return MM_PREMATURE_EOF; } while (num_items_read < 2); return 0; } int mm_read_mtx_array_size(FILE *f, int *M, int *N) { char line[MM_MAX_LINE_LENGTH]; int num_items_read; /* set return null parameter values, in case we exit with errors */ *M = *N = 0; /* now continue scanning until you reach the end-of-comments */ do { if (fgets(line,MM_MAX_LINE_LENGTH,f) == NULL) return MM_PREMATURE_EOF; }while (line[0] == '%'); /* line[] is either blank or has M,N, nz */ if (sscanf(line, "%d %d", M, N) == 2) return 0; else /* we have a blank line */ do { num_items_read = fscanf(f, "%d %d", M, N); if (num_items_read == EOF) return MM_PREMATURE_EOF; } while (num_items_read != 2); return 0; } int mm_write_mtx_array_size(FILE *f, int M, int N) { if (fprintf(f, "%d %d\n", M, N) < 0) return MM_COULD_NOT_WRITE_FILE; else return 0; } /*-------------------------------------------------------------------------*/ /******************************************************************/ /* use when I[], J[], and val[]J, and val[] are already allocated */ /******************************************************************/ int mm_read_mtx_crd_data(FILE *f, int M, int N, int nz, int I[], int J[], double val[], MM_typecode matcode) { int i; if (mm_is_complex(matcode)) { for (i=0; i #include /*#include */ #include #include #include "myblas.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* ************************************************************************ */ /* Initialize BLAS interfacing routines */ /* ************************************************************************ */ MYBOOL mustinitBLAS = TRUE; #ifdef WIN32 HINSTANCE hBLAS = NULL; #else void *hBLAS = NULL; #endif /* ************************************************************************ */ /* Function pointers for external BLAS library (C base 0) */ /* ************************************************************************ */ BLAS_dscal_func *BLAS_dscal; BLAS_dcopy_func *BLAS_dcopy; BLAS_daxpy_func *BLAS_daxpy; BLAS_dswap_func *BLAS_dswap; BLAS_ddot_func *BLAS_ddot; BLAS_idamax_func *BLAS_idamax; BLAS_dload_func *BLAS_dload; BLAS_dnormi_func *BLAS_dnormi; /* ************************************************************************ */ /* Define the BLAS interfacing routines */ /* ************************************************************************ */ void init_BLAS(void) { if(mustinitBLAS) { load_BLAS(NULL); mustinitBLAS = FALSE; } } MYBOOL is_nativeBLAS(void) { #ifdef LoadableBlasLib return( (MYBOOL) (hBLAS == NULL) ); #else return( TRUE ); #endif } MYBOOL load_BLAS(char *libname) { MYBOOL result = TRUE; #ifdef LoadableBlasLib if(hBLAS != NULL) { #ifdef WIN32 FreeLibrary(hBLAS); #else dlclose(hBLAS); #endif hBLAS = NULL; } #endif if(libname == NULL) { if(!mustinitBLAS && is_nativeBLAS()) return( FALSE ); BLAS_dscal = my_dscal; BLAS_dcopy = my_dcopy; BLAS_daxpy = my_daxpy; BLAS_dswap = my_dswap; BLAS_ddot = my_ddot; BLAS_idamax = my_idamax; BLAS_dload = my_dload; BLAS_dnormi = my_dnormi; if(mustinitBLAS) mustinitBLAS = FALSE; } else { #ifdef LoadableBlasLib #ifdef WIN32 /* Get a handle to the Windows DLL module. */ hBLAS = LoadLibrary(libname); /* If the handle is valid, try to get the function addresses. */ result = (MYBOOL) (hBLAS != NULL); if(result) { BLAS_dscal = (BLAS_dscal_func *) GetProcAddress(hBLAS, BLAS_prec "scal"); BLAS_dcopy = (BLAS_dcopy_func *) GetProcAddress(hBLAS, BLAS_prec "copy"); BLAS_daxpy = (BLAS_daxpy_func *) GetProcAddress(hBLAS, BLAS_prec "axpy"); BLAS_dswap = (BLAS_dswap_func *) GetProcAddress(hBLAS, BLAS_prec "swap"); BLAS_ddot = (BLAS_ddot_func *) GetProcAddress(hBLAS, BLAS_prec "dot"); BLAS_idamax = (BLAS_idamax_func *) GetProcAddress(hBLAS, "i" BLAS_prec "amax"); #if 0 BLAS_dload = (BLAS_dload_func *) GetProcAddress(hBLAS, BLAS_prec "load"); BLAS_dnormi = (BLAS_dnormi_func *) GetProcAddress(hBLAS, BLAS_prec "normi"); #endif } #else /* First standardize UNIX .SO library name format. */ char blasname[260], *ptr; strcpy(blasname, libname); if((ptr = strrchr(libname, '/')) == NULL) ptr = libname; else ptr++; blasname[(int) (ptr - libname)] = 0; if(strncmp(ptr, "lib", 3)) strcat(blasname, "lib"); strcat(blasname, ptr); if(strcmp(blasname + strlen(blasname) - 3, ".so")) strcat(blasname, ".so"); /* Get a handle to the module. */ hBLAS = dlopen(blasname, RTLD_LAZY); /* If the handle is valid, try to get the function addresses. */ result = (MYBOOL) (hBLAS != NULL); if(result) { BLAS_dscal = (BLAS_dscal_func *) dlsym(hBLAS, BLAS_prec "scal"); BLAS_dcopy = (BLAS_dcopy_func *) dlsym(hBLAS, BLAS_prec "copy"); BLAS_daxpy = (BLAS_daxpy_func *) dlsym(hBLAS, BLAS_prec "axpy"); BLAS_dswap = (BLAS_dswap_func *) dlsym(hBLAS, BLAS_prec "swap"); BLAS_ddot = (BLAS_ddot_func *) dlsym(hBLAS, BLAS_prec "dot"); BLAS_idamax = (BLAS_idamax_func *) dlsym(hBLAS, "i" BLAS_prec "amax"); #if 0 BLAS_dload = (BLAS_dload_func *) dlsym(hBLAS, BLAS_prec "load"); BLAS_dnormi = (BLAS_dnormi_func *) dlsym(hBLAS, BLAS_prec "normi"); #endif } #endif #endif /* Do validation */ if(!result || ((BLAS_dscal == NULL) || (BLAS_dcopy == NULL) || (BLAS_daxpy == NULL) || (BLAS_dswap == NULL) || (BLAS_ddot == NULL) || (BLAS_idamax == NULL) || (BLAS_dload == NULL) || (BLAS_dnormi == NULL)) ) { load_BLAS(NULL); result = FALSE; } } return( result ); } MYBOOL unload_BLAS(void) { return( load_BLAS(NULL) ); } /* ************************************************************************ */ /* Now define the unoptimized local BLAS functions */ /* ************************************************************************ */ void daxpy( int n, REAL da, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; BLAS_daxpy( &n, &da, dx, &incx, dy, &incy); } void BLAS_CALLMODEL my_daxpy( int *_n, REAL *_da, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* constant times a vector plus a vector. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ int i, ix, iy; #if !defined DOFASTMATH int m, mp1; #endif register REAL rda; REAL da = *_da; int n = *_n, incx = *_incx, incy = *_incy; if (n <= 0) return; if (da == 0.0) return; dx--; dy--; ix = 1; iy = 1; if (incx < 0) ix = (-n+1)*incx + 1; if (incy < 0) iy = (-n+1)*incy + 1; rda = da; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) (*yptr) += rda*(*xptr); return; } #else if (incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for (i = 1; i<=n; i++) { dy[iy]+= rda*dx[ix]; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1 */ /* clean-up loop */ x20: m = n % 4; if (m == 0) goto x40; for (i = 1; i<=m; i++) dy[i]+= rda*dx[i]; if(n < 4) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+4) { dy[i]+= rda*dx[i]; dy[i + 1]+= rda*dx[i + 1]; dy[i + 2]+= rda*dx[i + 2]; dy[i + 3]+= rda*dx[i + 3]; } #endif } /* ************************************************************************ */ void dcopy( int n, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; BLAS_dcopy( &n, dx, &incx, dy, &incy); } void BLAS_CALLMODEL my_dcopy (int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* copies a vector, x, to a vector, y. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ int i, ix, iy; #if !defined DOFASTMATH int m, mp1; #endif int n = *_n, incx = *_incx, incy = *_incy; if (n<=0) return; dx--; dy--; ix = 1; iy = 1; if (incx<0) ix = (-n+1)*incx + 1; if (incy<0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) (*yptr) = (*xptr); return; } #else if (incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for (i = 1; i<=n; i++) { dy[iy] = dx[ix]; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1 */ /* version with fast machine copy logic (requires memory.h or string.h) */ x20: #if defined DOFASTMATH MEMCOPY(&dy[1], &dx[1], n); return; #else m = n % 7; if (m == 0) goto x40; for (i = 1; i<=m; i++) dy[i] = dx[i]; if (n < 7) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+7) { dy[i] = dx[i]; dy[i + 1] = dx[i + 1]; dy[i + 2] = dx[i + 2]; dy[i + 3] = dx[i + 3]; dy[i + 4] = dx[i + 4]; dy[i + 5] = dx[i + 5]; dy[i + 6] = dx[i + 6]; } #endif #endif } /* ************************************************************************ */ void dscal (int n, REAL da, REAL *dx, int incx) { dx++; BLAS_dscal (&n, &da, dx, &incx); } void BLAS_CALLMODEL my_dscal (int *_n, REAL *_da, REAL *dx, int *_incx) { /* Multiply a vector by a constant. --Input-- N number of elements in input vector(s) DA double precision scale factor DX double precision vector with N elements INCX storage spacing between elements of DX --Output-- DX double precision result (unchanged if N.LE.0) Replace double precision DX by double precision DA*DX. For I = 0 to N-1, replace DX(IX+I*INCX) with DA * DX(IX+I*INCX), where IX = 1 if INCX .GE. 0, else IX = 1+(1-N)*INCX. */ int i; #if !defined DOFASTMATH int ix, m, mp1; #endif register REAL rda; REAL da = *_da; int n = *_n, incx = *_incx; if (n <= 0) return; rda = da; dx--; /* Optionally do fast pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr; for (i = 1, xptr = dx + 1; i <= n; i++, xptr += incx) (*xptr) *= rda; return; } #else if (incx == 1) goto x20; /* Code for increment not equal to 1 */ ix = 1; if (incx < 0) ix = (-n+1)*incx + 1; for(i = 1; i <= n; i++, ix += incx) dx[ix] *= rda; return; /* Code for increment equal to 1. */ /* Clean-up loop so remaining vector length is a multiple of 5. */ x20: m = n % 5; if (m == 0) goto x40; for( i = 1; i <= m; i++) dx[i] *= rda; if (n < 5) return; x40: mp1 = m + 1; for(i = mp1; i <= n; i += 5) { dx[i] *= rda; dx[i+1] *= rda; dx[i+2] *= rda; dx[i+3] *= rda; dx[i+4] *= rda; } #endif } /* ************************************************************************ */ REAL ddot(int n, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; return( BLAS_ddot (&n, dx, &incx, dy, &incy) ); } REAL BLAS_CALLMODEL my_ddot(int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* forms the dot product of two vectors. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ register REAL dtemp; int i, ix, iy; #if !defined DOFASTMATH int m, mp1; #endif int n = *_n, incx = *_incx, incy = *_incy; dtemp = 0.0; if (n<=0) return( (REAL) dtemp); dx--; dy--; ix = 1; iy = 1; if (incx<0) ix = (-n+1)*incx + 1; if (incy<0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) dtemp+= (*yptr)*(*xptr); return(dtemp); } #else if (incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for (i = 1; i<=n; i++) { dtemp+= dx[ix]*dy[iy]; ix+= incx; iy+= incy; } return(dtemp); /* code for both increments equal to 1 */ /* clean-up loop */ x20: m = n % 5; if (m == 0) goto x40; for (i = 1; i<=m; i++) dtemp+= dx[i]*dy[i]; if (n < 5) goto x60; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+5) dtemp+= dx[i]*dy[i] + dx[i + 1]*dy[i + 1] + dx[i + 2]*dy[i + 2] + dx[i + 3]*dy[i + 3] + dx[i + 4]*dy[i + 4]; x60: return(dtemp); #endif } /* ************************************************************************ */ void dswap( int n, REAL *dx, int incx, REAL *dy, int incy ) { dx++; dy++; BLAS_dswap( &n, dx, &incx, dy, &incy ); } void BLAS_CALLMODEL my_dswap( int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy ) { int i, ix, iy; #if !defined DOFASTMATH int m, mp1, ns; REAL dtemp2, dtemp3; #endif REAL dtemp1; int n = *_n, incx = *_incx, incy = *_incy; if (n <= 0) return; dx--; dy--; ix = 1; iy = 1; if (incx < 0) ix = (-n+1)*incx + 1; if (incy < 0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) { dtemp1 = (*xptr); (*xptr) = (*yptr); (*yptr) = dtemp1; } return; } #else if (incx == incy) { if (incx <= 0) goto x5; if (incx == 1) goto x20; goto x60; } /* code for unequal or nonpositive increments. */ x5: for (i = 1; i<=n; i++) { dtemp1 = dx[ix]; dx[ix] = dy[iy]; dy[iy] = dtemp1; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1. clean-up loop so remaining vector length is a multiple of 3. */ x20: m = n % 3; if (m == 0) goto x40; for (i = 1; i<=m; i++) { dtemp1 = dx[i]; dx[i] = dy[i]; dy[i] = dtemp1; } if (n < 3) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+3) { dtemp1 = dx[i]; dtemp2 = dx[i+1]; dtemp3 = dx[i+2]; dx[i] = dy[i]; dx[i+1] = dy[i+1]; dx[i+2] = dy[i+2]; dy[i] = dtemp1; dy[i+1] = dtemp2; dy[i+2] = dtemp3; } return; /* code for equal, positive, non-unit increments. */ x60: ns = n*incx; for (i = 1; i<=ns; i=i+incx) { dtemp1 = dx[i]; dx[i] = dy[i]; dy[i] = dtemp1; } #endif } /* ************************************************************************ */ void dload(int n, REAL da, REAL *dx, int incx) { dx++; BLAS_dload (&n, &da, dx, &incx); } void BLAS_CALLMODEL my_dload (int *_n, REAL *_da, REAL *dx, int *_incx) { /* copies a scalar, a, to a vector, x. uses unrolled loops when incx equals one. To change the precision of this program, run the change program on dload.f Alternatively, to make a single precision version append a comment character to the start of all lines between sequential precision > double and end precision > double comments and delete the comment character at the start of all lines between sequential precision > single and end precision > single comments. To make a double precision version interchange the append and delete operations in these instructions. */ int i, ix, m, mp1; REAL da = *_da; int n = *_n, incx = *_incx; if (n<=0) return; dx--; if (incx==1) goto x20; /* code for incx not equal to 1 */ ix = 1; if (incx<0) ix = (-n+1)*incx + 1; for (i = 1; i<=n; i++) { dx[ix] = da; ix+= incx; } return; /* code for incx equal to 1 and clean-up loop */ x20: m = n % 7; if (m == 0) goto x40; for (i = 1; i<=m; i++) dx[i] = da; if (n < 7) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+7) { dx[i] = da; dx[i + 1] = da; dx[i + 2] = da; dx[i + 3] = da; dx[i + 4] = da; dx[i + 5] = da; dx[i + 6] = da; } } /* ************************************************************************ */ int idamax( int n, REAL *x, int is ) { x++; return ( BLAS_idamax( &n, x, &is ) ); } int BLAS_CALLMODEL my_idamax( int *_n, REAL *x, int *_is ) { register REAL xmax, xtest; int i, imax = 0; #if !defined DOFASTMATH int ii; #endif int n = *_n, is = *_is; if((n < 1) || (is <= 0)) return(imax); imax = 1; if(n == 1) return(imax); #if defined DOFASTMATH xmax = fabs(*x); for (i = 2, x += is; i <= n; i++, x += is) { xtest = fabs(*x); if(xtest > xmax) { xmax = xtest; imax = i; } } #else x--; ii = 1; xmax = fabs(x[ii]); for(i = 2, ii+ = is; i <= n; i++, ii+ = is) { xtest = fabs(x[ii]); if(xtest > xmax) { xmax = xtest; imax = i; } } #endif return(imax); } /* ************************************************************************ */ REAL dnormi( int n, REAL *x ) { x++; return( BLAS_dnormi( &n, x ) ); } REAL BLAS_CALLMODEL my_dnormi( int *_n, REAL *x ) { /* =============================================================== dnormi returns the infinity-norm of the vector x. =============================================================== */ int j; register REAL hold, absval; int n = *_n; x--; hold = 0.0; /* for(j = 1; j <= n; j++) */ for(j = n; j > 0; j--) { absval = fabs(x[j]); hold = MAX( hold, absval ); } return( hold ); } /* ************************************************************************ */ /* Subvector and submatrix access routines (Fortran compatibility) */ /* ************************************************************************ */ #ifndef UseMacroVector int subvec( int item) { return( item-1 ); } #endif int submat( int nrowb, int row, int col) { return( nrowb*(col-1) + subvec(row) ); } int posmat( int nrowb, int row, int col) { return( submat(nrowb, row, col)+BLAS_BASE ); } /* ************************************************************************ */ /* Randomization functions */ /* ************************************************************************ */ void randomseed(int seeds[]) /* Simply create some default seed values */ { seeds[1] = 123456; seeds[2] = 234567; seeds[3] = 345678; } void randomdens( int n, REAL *x, REAL r1, REAL r2, REAL densty, int *seeds ) { /* ------------------------------------------------------------------ random generates a vector x[*] of random numbers in the range (r1, r2) with (approximate) specified density. seeds[*] must be initialized before the first call. ------------------------------------------------------------------ */ int i; REAL *y; y = (REAL *) malloc(sizeof(*y) * (n+1)); ddrand( n, x, 1, seeds ); ddrand( n, y, 1, seeds ); for (i = 1; i<=n; i++) { if (y[i] < densty) x[i] = r1 + (r2 - r1) * x[i]; else x[i] = 0.0; } free(y); } /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ void ddrand( int n, REAL *x, int incx, int *seeds ) { /* ------------------------------------------------------------------ ddrand fills a vector x with uniformly distributed random numbers in the interval (0, 1) using a method due to Wichman and Hill. seeds[1..3] should be set to integer values between 1 and 30000 before the first entry. Integer arithmetic up to 30323 is required. Blatantly copied from Wichman and Hill 19-January-1987. 14-Feb-94. Original version. 30 Jun 1999. seeds stored in an array. 30 Jun 1999. This version of ddrand. ------------------------------------------------------------------ */ int ix, xix; if (n < 1) return; for (ix = 1; ix<=1+(n-1)*incx; ix=ix+incx) { seeds[1] = 171*(seeds[1] % 177) - 2*(seeds[1]/177); seeds[2] = 172*(seeds[2] % 176) - 35*(seeds[2]/176); seeds[3] = 170*(seeds[3] % 178) - 63*(seeds[3]/178); if (seeds[1] < 0) seeds[1] = seeds[1] + 30269; if (seeds[2] < 0) seeds[2] = seeds[2] + 30307; if (seeds[3] < 0) seeds[3] = seeds[3] + 30323; x[ix] = ((REAL) seeds[1])/30269.0 + ((REAL) seeds[2])/30307.0 + ((REAL) seeds[3])/30323.0; xix = (int) x[ix]; x[ix] = fabs(x[ix] - xix); } } lp_solve_5.5/shared/myblas.h100666 0 0 12325 11141374260 14467 0ustar usergroup#ifndef HEADER_myblas #define HEADER_myblas /* ************************************************************************ */ /* BLAS function interface with local and external loadable versions */ /* Author: Kjell Eikland */ /* Version: Initial version spring 2004 */ /* Licence: LGPL */ /* ************************************************************************ */ /* Changes: 19 September 2004 Moved function pointer variable */ /* declarations from myblas.h to myblas.c */ /* to avoid linker problems with the Mac. */ /* 20 April 2005 Modified all double types to REAL to self- */ /* adjust to global settings. Note that BLAS */ /* as of now does not have double double. */ /* ************************************************************************ */ #define BLAS_BASE 1 #define UseMacroVector #if defined LoadableBlasLib # if LoadableBlasLib == 0 # undef LoadableBlasLib # endif #else # define LoadableBlasLib #endif /* ************************************************************************ */ /* Include necessary libraries */ /* ************************************************************************ */ #include "commonlib.h" #ifdef LoadableBlasLib #ifdef WIN32 #include #else #include #endif #endif #ifdef __cplusplus extern "C" { #endif /* ************************************************************************ */ /* BLAS functions */ /* ************************************************************************ */ #ifndef BLAS_CALLMODEL #ifdef WIN32 # define BLAS_CALLMODEL _cdecl #else # define BLAS_CALLMODEL #endif #endif typedef void (BLAS_CALLMODEL BLAS_dscal_func) (int *n, REAL *da, REAL *dx, int *incx); typedef void (BLAS_CALLMODEL BLAS_dcopy_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef void (BLAS_CALLMODEL BLAS_daxpy_func) (int *n, REAL *da, REAL *dx, int *incx, REAL *dy, int *incy); typedef void (BLAS_CALLMODEL BLAS_dswap_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef double (BLAS_CALLMODEL BLAS_ddot_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef int (BLAS_CALLMODEL BLAS_idamax_func)(int *n, REAL *x, int *is); typedef void (BLAS_CALLMODEL BLAS_dload_func) (int *n, REAL *da, REAL *dx, int *incx); typedef double (BLAS_CALLMODEL BLAS_dnormi_func)(int *n, REAL *x); #ifndef __WINAPI # ifdef WIN32 # define __WINAPI WINAPI # else # define __WINAPI # endif #endif void init_BLAS(void); MYBOOL is_nativeBLAS(void); MYBOOL load_BLAS(char *libname); MYBOOL unload_BLAS(void); /* ************************************************************************ */ /* User-callable BLAS definitions (C base 1) */ /* ************************************************************************ */ void dscal ( int n, REAL da, REAL *dx, int incx ); void dcopy ( int n, REAL *dx, int incx, REAL *dy, int incy ); void daxpy ( int n, REAL da, REAL *dx, int incx, REAL *dy, int incy ); void dswap ( int n, REAL *dx, int incx, REAL *dy, int incy ); REAL ddot ( int n, REAL *dx, int incx, REAL *dy, int incy ); int idamax( int n, REAL *x, int is ); void dload ( int n, REAL da, REAL *dx, int incx ); REAL dnormi( int n, REAL *x ); /* ************************************************************************ */ /* Locally implemented BLAS functions (C base 0) */ /* ************************************************************************ */ void BLAS_CALLMODEL my_dscal ( int *n, REAL *da, REAL *dx, int *incx ); void BLAS_CALLMODEL my_dcopy ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); void BLAS_CALLMODEL my_daxpy ( int *n, REAL *da, REAL *dx, int *incx, REAL *dy, int *incy ); void BLAS_CALLMODEL my_dswap ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); REAL BLAS_CALLMODEL my_ddot ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); int BLAS_CALLMODEL my_idamax( int *n, REAL *x, int *is ); void BLAS_CALLMODEL my_dload ( int *n, REAL *da, REAL *dx, int *incx ); REAL BLAS_CALLMODEL my_dnormi( int *n, REAL *x ); /* ************************************************************************ */ /* Subvector and submatrix access routines (Fortran compatibility) */ /* ************************************************************************ */ #ifdef UseMacroVector #define subvec(item) (item - 1) #else int subvec( int item ); #endif int submat( int nrowb, int row, int col ); int posmat( int nrowb, int row, int col ); /* ************************************************************************ */ /* Randomization functions */ /* ************************************************************************ */ void randomseed(int *seeds); void randomdens( int n, REAL *x, REAL r1, REAL r2, REAL densty, int *seeds); void ddrand( int n, REAL *x, int incx, int *seeds ); #ifdef __cplusplus } #endif #endif lp_solve_5.5/ufortify.h100666 0 0 3436 11141374260 13564 0ustar usergroup/* * FILE: * ufortify.h * * DESCRIPTION: * User options for fortify. Changes to this file require fortify.c to be * recompiled, but nothing else. */ #ifndef __UFORTIFY_H__ #define __UFORTIFY_H__ #define FORTIFY_STORAGE #if defined MSDOS || defined __BORLANDC__ || defined __HIGHC__ # define KNOWS_POINTER_TYPE #endif #define FORTIFY_WAIT_FOR_KEY /* Pause after message */ #if !defined FORTIFY_BEFORE_SIZE # define FORTIFY_BEFORE_SIZE 16 /* Bytes to allocate before block */ #endif #if !defined FORTIFY_BEFORE_VALUE # define FORTIFY_BEFORE_VALUE 0xA3 /* Fill value before block */ #endif #if !defined FORTIFY_AFTER_SIZE # define FORTIFY_AFTER_SIZE 16 /* Bytes to allocate after block */ #endif #if !defined FORTIFY_AFTER_VALUE # define FORTIFY_AFTER_VALUE 0xA5 /* Fill value after block */ #endif #define FILL_ON_MALLOC /* Nuke out malloc'd memory */ #if !defined FILL_ON_MALLOC_VALUE # define FILL_ON_MALLOC_VALUE 0xA7 /* Value to initialize with */ #endif #define FILL_ON_FREE /* free'd memory is cleared */ #if !defined FILL_ON_FREE_VALUE # define FILL_ON_FREE_VALUE 0xA9 /* Value to de-initialize with */ #endif #define FORTIFY_CheckInterval 1 /* seconds */ /* #define CHECK_ALL_MEMORY_ON_MALLOC */ #define CHECK_ALL_MEMORY_ON_FREE #define PARANOID_FREE #define WARN_ON_MALLOC_FAIL /* A debug is issued on a failed malloc */ #define WARN_ON_ZERO_MALLOC /* A debug is issued on a malloc(0) */ #define WARN_ON_FALSE_FAIL /* See Fortify_SetMallocFailRate */ #define WARN_ON_SIZE_T_OVERFLOW/* Watch for breaking the 64K limit in */ /* some braindead architectures... */ #define FORTIFY_LOCK() #define FORTIFY_UNLOCK() #endif lp_solve_5.5/yacc_read.c100666 0 0 104552 11250516333 13663 0ustar usergroup/* ============================================================================ NAME : yacc_read.c PURPOSE : translation of lp-problem and storage in sparse matrix SHORT : Subroutines for yacc program to store the input in an intermediate data-structure. The yacc and lex programs translate the input. First the problemsize is determined and the date is read into an intermediate structure, then readinput fills the sparse matrix. USAGE : call yyparse(); to start reading the input. call readinput(); to fill the sparse matrix. ============================================================================ Rows : contains the amount of rows + 1. Rows-1 is the amount of constraints (no bounds) Rows also contains the rownr 0 which is the objective function Columns : contains the amount of columns (different variable names found in the constraints) Nonnuls : contains the amount of nonnuls = sum of different entries of all columns in the constraints and in the objectfunction Hash_tab : contains all columnnames on the first level of the structure the row information is kept under each column structure in a linked list (also the objective funtion is in this structure) Bound information is also stored under under the column name First_rside : points to a linked list containing all relational operators and the righthandside values of the constraints the linked list is in reversed order with respect to the rownumbers ============================================================================ */ #include #include #include #include "lpkit.h" #include "yacc_read.h" #ifdef FORTIFY # include "lp_fortify.h" #endif #define tol 1.0e-10 #define coldatastep 100 #define HASHSIZE 10007 /* A prime number! */ struct structSOSvars { char *name; int col; REAL weight; struct structSOSvars *next; }; struct structSOS { char *name; short type; int Nvars; int weight; struct structSOSvars *SOSvars, *LastSOSvars; struct structSOS *next; }; struct SOSrow { int col; REAL value; struct SOSrow *next; }; struct SOSrowdata { short type; char *name; struct SOSrow *SOSrow; }; struct rside /* contains relational operator and rhs value */ { int row; REAL value; REAL range_value; struct rside *next; short relat; short range_relat; char negate; short SOStype; }; struct column { int row; REAL value; struct column *next; struct column *prev; }; struct structcoldata { int must_be_int; int must_be_sec; int must_be_free; REAL upbo; REAL lowbo; struct column *firstcol; struct column *col; }; static void error(parse_parm *pp, int verbose, char *string) { if(pp == NULL) report(NULL, CRITICAL, string); else if(pp->Verbose >= verbose) report(NULL, verbose, "%s on line %d\n", string, pp->lineno); } /* * error handling routine for yyparse() */ void read_error(parse_parm *pp, void *scanner, char *string) { error(pp, CRITICAL, string); } /* called when lex gets a fatal error */ void lex_fatal_error(parse_parm *pp, void *scanner, char *msg) { read_error(pp, scanner, msg); longjmp(pp->jump_buf, 1); } void add_row(parse_parm *pp) { pp->Rows++; pp->rs = NULL; pp->Lin_term_count = 0; } void add_sos_row(parse_parm *pp, short SOStype) { if (pp->rs != NULL) pp->rs->SOStype = SOStype; pp->Rows++; pp->rs = NULL; pp->Lin_term_count = 0; } void check_int_sec_sos_free_decl(parse_parm *pp, int within_int_decl, int within_sec_decl, int sos_decl0, int within_free_decl) { pp->Ignore_int_decl = TRUE; pp->Ignore_sec_decl = TRUE; pp->Ignore_free_decl = TRUE; pp->sos_decl = 0; if(within_int_decl) { pp->Ignore_int_decl = FALSE; pp->int_decl = (char) within_int_decl; if(within_sec_decl) pp->Ignore_sec_decl = FALSE; } else if(within_sec_decl) { pp->Ignore_sec_decl = FALSE; } else if(sos_decl0) { pp->sos_decl = (char) sos_decl0; } else if(within_free_decl) { pp->Ignore_free_decl = FALSE; } } static void add_int_var(parse_parm *pp, char *name, short int_decl) { hashelem *hp; if((hp = findhash(name, pp->Hash_tab)) == NULL) { char buf[256]; sprintf(buf, "Unknown variable %s declared integer, ignored", name); error(pp, NORMAL, buf); } else if(pp->coldata[hp->index].must_be_int) { char buf[256]; sprintf(buf, "Variable %s declared integer more than once, ignored", name); error(pp, NORMAL, buf); } else { pp->coldata[hp->index].must_be_int = TRUE; if(int_decl == 2) { if(pp->coldata[hp->index].lowbo != -DEF_INFINITE * (REAL) 10.0) { char buf[256]; sprintf(buf, "Variable %s: lower bound on variable redefined", name); error(pp, NORMAL, buf); } pp->coldata[hp->index].lowbo = 0; if(pp->coldata[hp->index].upbo < DEF_INFINITE) { char buf[256]; sprintf(buf, "Variable %s: upper bound on variable redefined", name); error(pp, NORMAL, buf); } pp->coldata[hp->index].upbo = 1; } else if(int_decl == 3) { if(pp->coldata[hp->index].upbo == DEF_INFINITE * (REAL) 10.0) pp->coldata[hp->index].upbo = 1.0; } } } static void add_sec_var(parse_parm *pp, char *name) { hashelem *hp; if((hp = findhash(name, pp->Hash_tab)) == NULL) { char buf[256]; sprintf(buf, "Unknown variable %s declared semi-continuous, ignored", name); error(pp, NORMAL, buf); } else if(pp->coldata[hp->index].must_be_sec) { char buf[256]; sprintf(buf, "Variable %s declared semi-continuous more than once, ignored", name); error(pp, NORMAL, buf); } else pp->coldata[hp->index].must_be_sec = TRUE; } int set_sec_threshold(parse_parm *pp, char *name, REAL threshold) { hashelem *hp; if((hp = findhash(name, pp->Hash_tab)) == NULL) { char buf[256]; sprintf(buf, "Unknown variable %s declared semi-continuous, ignored", name); error(pp, NORMAL, buf); return(FALSE); } if ((pp->coldata[hp->index].lowbo > 0.0) && (threshold > 0.0)) { char buf[256]; pp->coldata[hp->index].must_be_sec = FALSE; sprintf(buf, "Variable %s declared semi-continuous, but it has a non-negative lower bound (%f), ignored", name, pp->coldata[hp->index].lowbo); error(pp, NORMAL, buf); } if (threshold > pp->coldata[hp->index].lowbo) pp->coldata[hp->index].lowbo = threshold; return(pp->coldata[hp->index].must_be_sec); } static void add_free_var(parse_parm *pp, char *name) { hashelem *hp; if((hp = findhash(name, pp->Hash_tab)) == NULL) { char buf[256]; sprintf(buf, "Unknown variable %s declared free, ignored", name); error(pp, NORMAL, buf); } else if(pp->coldata[hp->index].must_be_free) { char buf[256]; sprintf(buf, "Variable %s declared free more than once, ignored", name); error(pp, NORMAL, buf); } else pp->coldata[hp->index].must_be_free = TRUE; } static int add_sos_name(parse_parm *pp, char *name) { struct structSOS *SOS; if(CALLOC(SOS, 1, struct structSOS) == NULL) return(FALSE); if(MALLOC(SOS->name, strlen(name) + 1, char) == NULL) { FREE(SOS); return(FALSE); } strcpy(SOS->name, name); SOS->type = 0; if(pp->FirstSOS == NULL) pp->FirstSOS = SOS; else pp->LastSOS->next = SOS; pp->LastSOS = SOS; return(TRUE); } static int add_sos_var(parse_parm *pp, char *name) { struct structSOSvars *SOSvar; if(name != NULL) { if(CALLOC(SOSvar, 1, struct structSOSvars) == NULL) return(FALSE); if(MALLOC(SOSvar->name, strlen(name) + 1, char) == NULL) { FREE(SOSvar); return(FALSE); } strcpy(SOSvar->name, name); if(pp->LastSOS->SOSvars == NULL) pp->LastSOS->SOSvars = SOSvar; else pp->LastSOS->LastSOSvars->next = SOSvar; pp->LastSOS->LastSOSvars = SOSvar; pp->LastSOS->Nvars = pp->LastSOS->Nvars + 1; } pp->LastSOS->LastSOSvars->weight = 0; return(TRUE); } void storevarandweight(parse_parm *pp, char *name) { if(!pp->Ignore_int_decl) { add_int_var(pp, name, pp->int_decl); if(!pp->Ignore_sec_decl) add_sec_var(pp, name); } else if(!pp->Ignore_sec_decl) add_sec_var(pp, name); else if(pp->sos_decl==1) add_sos_name(pp, name); else if(pp->sos_decl==2) add_sos_var(pp, name); else if(!pp->Ignore_free_decl) add_free_var(pp, name); } int set_sos_type(parse_parm *pp, int SOStype) { if(pp->LastSOS != NULL) pp->LastSOS->type = (short) SOStype; return(TRUE); } int set_sos_weight(parse_parm *pp, double weight, int sos_decl) { if(pp->LastSOS != NULL) { if(sos_decl==1) pp->LastSOS->weight = (int) (weight+.1); else pp->LastSOS->LastSOSvars->weight = weight; } return(TRUE); } static int inccoldata(parse_parm *pp) { long Columns = pp->Columns; if(Columns == 0) CALLOC(pp->coldata, coldatastep, struct structcoldata); else if((Columns%coldatastep) == 0) REALLOC(pp->coldata, Columns + coldatastep, struct structcoldata); if(pp->coldata != NULL) { pp->coldata[Columns].upbo = (REAL) DEF_INFINITE * (REAL) 10.0; pp->coldata[Columns].lowbo = (REAL) -DEF_INFINITE * (REAL) 10.0; /* temporary. If still this value then 0 will be taken */ pp->coldata[Columns].col = NULL; pp->coldata[Columns].firstcol = NULL; pp->coldata[Columns].must_be_int = FALSE; pp->coldata[Columns].must_be_sec = FALSE; pp->coldata[Columns].must_be_free = FALSE; } return(pp->coldata != NULL); } /* * initialisation of hashstruct and globals. */ static int init_read(parse_parm *pp, int verbose) { int ok = FALSE; pp->Verbose = verbose; set_obj_dir(pp, TRUE); pp->Rows = 0; pp->Non_zeros = 0; pp->Columns = 0; pp->FirstSOS = pp->LastSOS = NULL; pp->Lin_term_count = 0; if (CALLOC(pp->First_rside, 1, struct rside) != NULL) { pp->rs = pp->First_rside; pp->rs->value = pp->rs->range_value = 0; /* first row (nr 0) is always the objective function */ pp->rs->relat = OF; pp->rs->range_relat = -1; pp->rs->SOStype = 0; pp->Hash_tab = NULL; pp->Hash_constraints = NULL; if (((pp->Hash_tab = create_hash_table(HASHSIZE, 0)) == NULL) || ((pp->Hash_constraints = create_hash_table(HASHSIZE, 0)) == NULL)){ FREE(pp->First_rside); FREE(pp->Hash_tab); FREE(pp->Hash_constraints); } else ok = TRUE; } return(ok); } /* init */ /* * clears the tmp_store variable after all information has been copied */ void null_tmp_store(parse_parm *pp, int init_Lin_term_count) { pp->tmp_store.value = 0; pp->tmp_store.rhs_value = 0; FREE(pp->tmp_store.name); if(init_Lin_term_count) pp->Lin_term_count = 0; } /* * variable : pointer to text array with name of variable * row : the rownumber of the constraint * value : value of matrixelement * A(row, variable). * Sign : (global) determines the sign of value. * store() : stores value in matrix * A(row, variable). If A(row, variable) already contains data, * value is added to the existing value. */ static int store(parse_parm *pp, char *variable, int row, REAL value) { hashelem *h_tab_p; struct column *col_p; if(value == 0) { char buf[256]; sprintf(buf, "(store) Warning, variable %s has an effective coefficient of 0, Ignored", variable); error(pp, NORMAL, buf); /* return(TRUE); */ } if((h_tab_p = findhash(variable, pp->Hash_tab)) == NULL) { if (((h_tab_p = puthash(variable, pp->Columns, NULL, pp->Hash_tab)) == NULL) ) return(FALSE); inccoldata(pp); pp->Columns++; /* counter for calloc of final array */ if(value) { if (CALLOC(col_p, 1, struct column) == NULL) return(FALSE); pp->Non_zeros++; /* for calloc of final arrays */ col_p->row = row; col_p->value = value; pp->coldata[h_tab_p->index].firstcol = pp->coldata[h_tab_p->index].col = col_p; } } else if((pp->coldata[h_tab_p->index].col == NULL) || (pp->coldata[h_tab_p->index].col->row != row)) { if(value) { if (CALLOC(col_p, 1, struct column) == NULL) return(FALSE); pp->Non_zeros++; /* for calloc of final arrays */ if(pp->coldata[h_tab_p->index].col != NULL) pp->coldata[h_tab_p->index].col->prev = col_p; else pp->coldata[h_tab_p->index].firstcol = col_p; col_p->value = value; col_p->row = row; col_p->next = pp->coldata[h_tab_p->index].col; pp->coldata[h_tab_p->index].col = col_p; } } else if(value) { pp->coldata[h_tab_p->index].col->value += value; if(fabs(pp->coldata[h_tab_p->index].col->value) < tol) /* eliminitate rounding errors */ pp->coldata[h_tab_p->index].col->value = 0; } return(TRUE); } /* store */ static int storefirst(parse_parm *pp) { struct rside *rp; if ((pp->rs != NULL) && (pp->rs->row == pp->tmp_store.row)) return(TRUE); /* make space for the rhs information */ if (CALLOC(rp, 1, struct rside) == NULL) return(FALSE); rp->next = pp->First_rside; pp->First_rside = pp->rs = rp; pp->rs->row = /* row */ pp->tmp_store.row; pp->rs->value = pp->tmp_store.rhs_value; pp->rs->relat = pp->tmp_store.relat; pp->rs->range_relat = -1; pp->rs->SOStype = 0; if(pp->tmp_store.name != NULL) { if(pp->tmp_store.value != 0) { if (!store(pp, pp->tmp_store.name, pp->tmp_store.row, pp->tmp_store.value)) return(FALSE); } else { char buf[256]; sprintf(buf, "Warning, variable %s has an effective coefficient of 0, ignored", pp->tmp_store.name); error(pp, NORMAL, buf); } } null_tmp_store(pp, FALSE); return(TRUE); } /* * store relational operator given in yylex[0] in the rightside list. * Also checks if it constraint was a bound and if so stores it in the * boundslist */ int store_re_op(parse_parm *pp, char OP, int HadConstraint, int HadVar, int Had_lineair_sum) { short tmp_relat; switch(OP) { case '=': tmp_relat = EQ; break; case '>': tmp_relat = GE; break; case '<': tmp_relat = LE; break; case 0: if(pp->rs != NULL) tmp_relat = pp->rs->relat; else tmp_relat = pp->tmp_store.relat; break; default: { char buf[256]; sprintf(buf, "Error: unknown relational operator %c", OP); error(pp, CRITICAL, buf); } return(FALSE); break; } if(/* pp->Lin_term_count > 1 */ HadConstraint && HadVar) {/* it is not a bound */ if(pp->Lin_term_count <= 1) if(!storefirst(pp)) return(FALSE); pp->rs->relat = tmp_relat; } else if(/* pp->Lin_term_count == 0 */ HadConstraint && !Had_lineair_sum /* HadVar */ /* && (pp->rs != NULL) */) { /* it is a range */ if(pp->Lin_term_count == 1) if(!storefirst(pp)) return(FALSE); if(pp->rs == NULL) { /* range before row, already reported */ error(pp, CRITICAL, "Error: range for undefined row"); return(FALSE); } if(pp->rs->negate) switch (tmp_relat) { case LE: tmp_relat = GE; break; case GE: tmp_relat = LE; break; } if(pp->rs->range_relat != -1) { error(pp, CRITICAL, "Error: There was already a range for this row"); return(FALSE); } else if(tmp_relat == pp->rs->relat) { error(pp, CRITICAL, "Error: relational operator for range is the same as relation operator for equation"); return(FALSE); } else pp->rs->range_relat = tmp_relat; } else /* could be a bound */ pp->tmp_store.relat = tmp_relat; return(TRUE); } /* store_re_op */ int negate_constraint(parse_parm *pp) { if(pp->rs != NULL) pp->rs->negate = TRUE; return(TRUE); } /* * store RHS value in the rightside structure * if type = true then */ int rhs_store(parse_parm *pp, REAL value, int HadConstraint, int HadVar, int Had_lineair_sum) { if(/* pp->Lin_term_count > 1 */ (HadConstraint && HadVar) || (pp->Rows == 0)){ /* not a bound */ if (pp->Rows == 0) value = -value; /* if(pp->Lin_term_count < 2) */ if(pp->rs == NULL) pp->tmp_store.rhs_value += value; else if(pp->rs == NULL) { error(pp, CRITICAL, "Error: No variable specified"); return(FALSE); } else pp->rs->value += value; } else if(/* pp->Lin_term_count == 0 */ HadConstraint && !HadVar) { /* a range */ if(pp->rs == NULL) /* if range before row, already reported */ pp->tmp_store.rhs_value += value; else if(pp->rs->range_relat < 0) /* was a bad range; ignore */; else { if(pp->rs->negate) value = -value; if(((pp->rs->relat == LE) && (pp->rs->range_relat == GE) && (pp->rs->value < value)) || ((pp->rs->relat == GE) && (pp->rs->range_relat == LE) && (pp->rs->value > value)) || ((pp->rs->relat == EQ) || (pp->rs->range_relat == EQ))) { pp->rs->range_relat = -2; error(pp, CRITICAL, "Error: range restriction conflicts"); return(FALSE); } else pp->rs->range_value += value; } } else /* a bound */ pp->tmp_store.rhs_value += value; return(TRUE); } /* RHS_store */ /* * store all data in the right place * count the amount of lineair terms in a constraint * only store in data-structure if the constraint is not a bound */ int var_store(parse_parm *pp, char *var, REAL value, int HadConstraint, int HadVar, int Had_lineair_sum) { int row; row = pp->Rows; /* also in a bound the same var name can occur more than once. Check for this. Don't increment Lin_term_count */ if(pp->Lin_term_count != 1 || pp->tmp_store.name == NULL || strcmp(pp->tmp_store.name, var) != 0) pp->Lin_term_count++; /* always store objective function with rownr == 0. */ if(row == 0) return(store(pp, var, row, value)); if(pp->Lin_term_count == 1) { /* don't store yet. could be a bound */ if(MALLOC(pp->tmp_store.name, strlen(var) + 1, char) != NULL) strcpy(pp->tmp_store.name, var); pp->tmp_store.row = row; pp->tmp_store.value += value; return(TRUE); } if(pp->Lin_term_count == 2) { /* now you can also store the first variable */ if(!storefirst(pp)) return(FALSE); /* null_tmp_store(pp, FALSE); */ } return(store(pp, var, row, value)); } /* var_store */ /* * store the information in tmp_store because it is a bound */ int store_bounds(parse_parm *pp, int warn) { if(pp->tmp_store.value != 0) { hashelem *h_tab_p; REAL boundvalue; if((h_tab_p = findhash(pp->tmp_store.name, pp->Hash_tab)) == NULL) { /* a new columnname is found, create an entry in the hashlist */ if ((h_tab_p = puthash(pp->tmp_store.name, pp->Columns, NULL, pp->Hash_tab)) == NULL) { error(pp, CRITICAL, "Not enough memory"); return(FALSE); } inccoldata(pp); pp->Columns++; /* counter for calloc of final array */ } if(pp->tmp_store.value < 0) { /* divide by negative number, */ /* relational operator may change */ if(pp->tmp_store.relat == GE) pp->tmp_store.relat = LE; else if(pp->tmp_store.relat == LE) pp->tmp_store.relat = GE; } boundvalue = pp->tmp_store.rhs_value / pp->tmp_store.value; #if FALSE /* Check sanity of bound; all variables should be positive */ if( ((pp->tmp_store.relat == EQ) && (boundvalue < 0)) || ((pp->tmp_store.relat == LE) && (boundvalue < 0))) { /* Error */ error(pp, CRITICAL, "Error: variables must always be non-negative"); return(FALSE); } #endif #if FALSE if((pp->tmp_store.relat == GE) && (boundvalue <= 0)) /* Warning */ error(pp, NORMAL, "Warning: useless bound; variables are always >= 0"); #endif /* bound seems to be sane, add it */ if((pp->tmp_store.relat == GE) || (pp->tmp_store.relat == EQ)) { if(boundvalue > pp->coldata[h_tab_p->index].lowbo - tol) pp->coldata[h_tab_p->index].lowbo = boundvalue; else if(warn) error(pp, NORMAL, "Ineffective lower bound, ignored"); } if((pp->tmp_store.relat == LE) || (pp->tmp_store.relat == EQ)) { if(boundvalue < pp->coldata[h_tab_p->index].upbo + tol) pp->coldata[h_tab_p->index].upbo = boundvalue; else if (warn) error(pp, NORMAL, "Ineffective upper bound, ignored"); } /* check for empty range */ if((warn) && (pp->coldata[h_tab_p->index].upbo + tol < pp->coldata[h_tab_p->index].lowbo)) { error(pp, CRITICAL, "Error: bound contradicts earlier bounds"); return(FALSE); } } else /* pp->tmp_store.value = 0 ! */ { char buf[256]; if((pp->tmp_store.rhs_value == 0) || ((pp->tmp_store.rhs_value > 0) && (pp->tmp_store.relat == LE)) || ((pp->tmp_store.rhs_value < 0) && (pp->tmp_store.relat == GE))) { sprintf(buf, "Variable %s has an effective coefficient of 0 in bound, ignored", pp->tmp_store.name); if(warn) error(pp, NORMAL, buf); } else { sprintf(buf, "Error, variable %s has an effective coefficient of 0 in bound", pp->tmp_store.name); error(pp, CRITICAL, buf); return(FALSE); } } /* null_tmp_store(pp, FALSE); */ pp->tmp_store.rhs_value = 0; return(TRUE); } /* store_bounds */ int set_title(parse_parm *pp, char *name) { pp->title = strdup(name); return(TRUE); } int add_constraint_name(parse_parm *pp, char *name) { int row; hashelem *hp; if((hp = findhash(name, pp->Hash_constraints)) != NULL) { row = hp->index; pp->rs = pp->First_rside; while ((pp->rs != NULL) && (pp->rs->row != row)) pp->rs = pp->rs->next; } else { row = pp->Rows; if (((hp = puthash(name, row, NULL, pp->Hash_constraints)) == NULL) ) return(FALSE); if(row) pp->rs = NULL; } return(TRUE); } /* * transport the data from the intermediate structure to the sparse matrix * and free the intermediate structure */ static int readinput(parse_parm *pp, lprec *lp) { int i, i1, count, index, col; struct column *cp, *tcp; hashelem *hp; struct rside *rp; signed char *negateAndSOS = NULL; REAL *row = NULL, a; int *rowno = NULL; MYBOOL SOSinMatrix = FALSE; struct SOSrowdata *SOSrowdata = NULL; struct SOSrow *SOSrow, *SOSrow1; if(lp != NULL) { if (CALLOC(negateAndSOS, 1 + pp->Rows, signed char) == NULL) return(FALSE); rp = pp->First_rside; for(i = pp->Rows; (i >= 0) && (rp != NULL); i--) { if(rp->SOStype == 0) negateAndSOS[i] = (rp->negate ? -1 : 0); else negateAndSOS[i] = (signed char) rp->SOStype; rp = rp->next; } /* fill names with the rownames */ hp = pp->Hash_constraints->first; while(hp != NULL) { if (/* (negateAndSOS[hp->index] <= 0) && */ (!set_row_name(lp, hp->index, hp->name))) return(FALSE); hp = hp->nextelem; } } for(i = pp->Rows; i >= 0; i--) { rp = pp->First_rside; if((lp != NULL) && (rp != NULL)) { if(rp->SOStype == 0) { if (rp->negate) { switch (rp->relat) { case LE: rp->relat = GE; break; case GE: rp->relat = LE; break; } switch (rp->range_relat) { case LE: rp->range_relat = GE; break; case GE: rp->range_relat = LE; break; } rp->range_value = -rp->range_value; rp->value = -rp->value; } if((rp->range_relat >= 0) && (rp->value == lp->infinite)) { rp->value = rp->range_value; rp->relat = rp->range_relat; rp->range_relat = -1; } else if((rp->range_relat >= 0) && (rp->value == -lp->infinite)) { rp->value = rp->range_value; rp->relat = rp->range_relat; rp->range_relat = -1; } if ((rp->range_relat >= 0) && (rp->range_value == rp->value)) { rp->relat = EQ; rp->range_relat = EQ; } if(i) { set_constr_type(lp, i, rp->relat); pp->relat[i] = rp->relat; } set_rh(lp, i, rp->value); if (rp->range_relat >= 0) set_rh_range(lp, i, rp->range_value - rp->value); } else { SOSinMatrix = TRUE; if(i) pp->relat[i] = rp->relat; } } if(rp != NULL) { pp->First_rside = rp->next; free(rp); /* free memory when data has been read */ } else pp->First_rside = NULL; } while(pp->First_rside != NULL) { rp = pp->First_rside; pp->First_rside = rp->next; free(rp); /* free memory when data has been read */ } /* start reading the Hash_list structure */ index = 0; if((SOSinMatrix) && (CALLOC(SOSrowdata, 1 + pp->Rows, struct SOSrowdata) == NULL)) { FREE(negateAndSOS); FREE(row); FREE(rowno); return(FALSE); } if((lp != NULL) && ((MALLOC(row, 1 + pp->Rows, REAL) == NULL) || (MALLOC(rowno, 1 + pp->Rows, int) == NULL))) { FREE(SOSrowdata); FREE(negateAndSOS); FREE(row); FREE(rowno); return(FALSE); } /* for(i = 0; i < pp->Hash_tab->size; i++) { hp = pp->Hash_tab->table[i]; */ hp = pp->Hash_tab->first; while(hp != NULL) { count = 0; index++; cp = pp->coldata[hp->index].firstcol; col = hp->index + 1; while(cp != NULL) { if(lp != NULL) { if (negateAndSOS[cp->row] <= 0) { rowno[count] = cp->row; a = cp->value; if (negateAndSOS[cp->row]) a = -a; row[count++] = a; } else { if (MALLOC(SOSrow, 1, struct SOSrow) == NULL) { FREE(SOSrowdata); FREE(negateAndSOS); FREE(row); FREE(rowno); return(FALSE); } if(SOSrowdata[cp->row].SOSrow == NULL) SOSrowdata[cp->row].name = strdup(get_row_name(lp, cp->row)); SOSrow->next = SOSrowdata[cp->row].SOSrow; SOSrowdata[cp->row].SOSrow = SOSrow; SOSrowdata[cp->row].type = negateAndSOS[cp->row]; SOSrow->col = col; SOSrow->value = cp->value; } } tcp = cp; /* cp = cp->next; */ cp = cp->prev; free(tcp); /* free memory when data has been read */ } if(lp != NULL) { add_columnex(lp, count, row, rowno); /* check for bound */ if(pp->coldata[hp->index].lowbo == -DEF_INFINITE * 10.0) /* lp->orig_lowbo[pp->Rows+index] = 0.0; */ set_lowbo(lp, index, 0); else /* lp->orig_lowbo[pp->Rows+index] = pp->coldata[hp->index].lowbo; */ set_lowbo(lp, index, pp->coldata[hp->index].lowbo); /* lp->orig_upbo[pp->Rows+index] = pp->coldata[hp->index].upbo; */ if(pp->coldata[hp->index].upbo >= DEF_INFINITE) set_upbo(lp, index, DEF_INFINITE); else set_upbo(lp, index, pp->coldata[hp->index].upbo); /* check if it must be an integer variable */ if(pp->coldata[hp->index].must_be_int) { /* lp->must_be_int[pp->Rows + index]=TRUE; */ set_int(lp, index, TRUE); } if(pp->coldata[hp->index].must_be_sec) { set_semicont(lp, index, TRUE); } if(pp->coldata[hp->index].must_be_free) { set_unbounded(lp, index); } /* copy name of column variable */ if (!set_col_name(lp, index, hp->name)) { FREE(SOSrowdata); FREE(negateAndSOS); FREE(row); FREE(rowno); return(FALSE); } /* put matrix values in intermediate row */ /* cp = hp->col; */ /* cp = hp->firstcol; */ } /* thp = hp; */ /* hp = hp->next; */ /* free(thp->name); */ /* free(thp); */ /* free memory when data has been read */ hp = hp->nextelem; } /* pp->Hash_tab->table[i] = NULL; */ FREE(pp->coldata); if(SOSrowdata != NULL) { struct structSOS *structSOS; struct structSOSvars *SOSvars, *SOSvars1; int SOSweight = 0; for(i = 1; i <= pp->Rows; i++) { SOSrow = SOSrowdata[i].SOSrow; if(SOSrow != NULL) { if(MALLOC(structSOS, 1, struct structSOS) == NULL) { FREE(SOSrowdata); FREE(negateAndSOS); FREE(row); FREE(rowno); return(FALSE); } structSOS->Nvars = 0; structSOS->type = SOSrowdata[i].type; structSOS->weight = ++SOSweight; structSOS->name = strdup(SOSrowdata[i].name); structSOS->LastSOSvars = NULL; structSOS->next = pp->FirstSOS; pp->FirstSOS = structSOS; SOSvars = NULL; while(SOSrow != NULL) { SOSvars1 = SOSvars; MALLOC(SOSvars, 1, struct structSOSvars); SOSvars->next = SOSvars1; SOSvars->col = SOSrow->col; SOSvars->weight = SOSrow->value; SOSvars->name = NULL; structSOS->Nvars++; SOSrow1 = SOSrow->next; FREE(SOSrow); SOSrow = SOSrow1; } structSOS->SOSvars = SOSvars; } } FREE(SOSrowdata); } while(pp->FirstSOS != NULL) { struct structSOSvars *SOSvars, *SOSvars1; int *sosvars, n, col; REAL *weights; hashelem *hp; pp->LastSOS = pp->FirstSOS; pp->FirstSOS = pp->FirstSOS->next; SOSvars = pp->LastSOS->SOSvars; if(lp != NULL) { MALLOC(sosvars, pp->LastSOS->Nvars, int); MALLOC(weights, pp->LastSOS->Nvars, double); } else { sosvars = NULL; weights = NULL; } n = 0; while(SOSvars != NULL) { SOSvars1 = SOSvars; SOSvars = SOSvars->next; if(lp != NULL) { col = SOSvars1->col; if(col == 0) if((hp = findhash(SOSvars1->name, lp->colname_hashtab)) != NULL) col = hp->index; if (col) { sosvars[n] = col; weights[n++] = SOSvars1->weight; } } FREE(SOSvars1->name); FREE(SOSvars1); } if(lp != NULL) { add_SOS(lp, pp->LastSOS->name, pp->LastSOS->type, pp->LastSOS->weight, n, sosvars, weights); FREE(weights); FREE(sosvars); } FREE(pp->LastSOS->name); FREE(pp->LastSOS); } if(negateAndSOS != NULL) { for(i1 = 0, i = 1; i <= pp->Rows; i++) if(negateAndSOS[i] <= 0) pp->relat[++i1] = pp->relat[i]; #if 01 for(i = pp->Rows; i > 0; i--) if(negateAndSOS[i] > 0) { del_constraint(lp, i); pp->Rows--; } #endif } /* the following should be replaced by a call to the MPS print routine MB */ #if 0 if(pp->Verbose) { int j; printf("\n"); printf("**********Data read**********\n"); printf("Rows : %d\n", pp->Rows); printf("Columns : %d\n", pp->Columns); printf("Nonnuls : %d\n", pp->Non_zeros); printf("NAME LPPROB\n"); printf("ROWS\n"); for(i = 0; i <= pp->Rows; i++) { if(pp->relat[i] == LE) printf(" L "); else if(pp->relat[i] == EQ) printf(" E "); else if(pp->relat[i] == GE) printf(" G "); else if(pp->relat[i] == OF) printf(" N "); printf("%s\n", get_row_name(lp, i)); } printf("COLUMNS\n"); j = 0; for(i = 0; i < pp->Non_zeros; i++) { if(i == lp->col_end[j]) j++; printf(" %-8s %-8s %g\n", get_col_name(lp, j), get_row_name(lp, lp->mat[i].row_nr), (double)lp->mat[i].value); } printf("RHS\n"); for(i = 0; i <= pp->Rows; i++) { printf(" RHS %-8s %g\n", get_row_name(lp, i), (double)lp->orig_rhs[i]); } printf("RANGES\n"); for(i = 1; i <= pp->Rows; i++) if((lp->orig_upbo[i] != lp->infinite) && (lp->orig_upbo[i] != 0)) { printf(" RGS %-8s %g\n", get_row_name(lp, i), (double)lp->orig_upbo[i]); } else if((lp->orig_lowbo[i] != 0)) { printf(" RGS %-8s %g\n", get_row_name(lp, i), (double)-lp->orig_lowbo[i]); } printf("BOUNDS\n"); for(i = pp->Rows + 1; i <= pp->Rows + pp->Columns; i++) { if((lp->orig_lowbo[i] != 0) && (lp->orig_upbo[i] < lp->infinite) && (lp->orig_lowbo[i] == lp->orig_upbo[i])) { printf(" FX BND %-8s %g\n", get_col_name(lp, i - pp->Rows), (double)lp->orig_upbo[i]); } else { if(lp->orig_upbo[i] < lp->infinite) printf(" UP BND %-8s %g\n", get_col_name(lp, i - pp->Rows), (double)lp->orig_upbo[i]); if(lp->orig_lowbo[i] > 0) printf(" LO BND %-8s %g\n", get_col_name(lp, i - pp->Rows), (double)lp->orig_lowbo[i]); } } printf("ENDATA\n"); } #endif FREE(row); FREE(rowno); FREE(negateAndSOS); return(TRUE); } /* readinput */ lprec *yacc_read(lprec *lp, int verbose, char *lp_name, int (*parse) (parse_parm *pp), parse_parm *pp, void (*delete_allocated_memory) (parse_parm *pp)) { REAL *orig_upbo; int stat = -1; lprec *lp0 = lp; pp->title = lp_name; if(!init_read(pp, verbose)) error(pp, CRITICAL, "init_read failed"); else if (setjmp(pp->jump_buf) == 0) stat = parse(pp); delete_allocated_memory(pp); pp->Rows--; pp->relat = NULL; if((stat != 0) || (CALLOC(pp->relat, pp->Rows + 1, short) != NULL)) { if(stat == 0) { if(lp == NULL) { lp = make_lp(pp->Rows, 0); } else { int NRows; for(NRows = get_Nrows(lp); NRows < pp->Rows; NRows++) add_constraintex(lp, 0, NULL, NULL, LE, 0); } } else lp = NULL; if ((stat != 0) || (lp != NULL)) { if(lp != NULL) { set_verbose(lp, pp->Verbose); } if (!readinput(pp, lp)) { if((lp != NULL) && (lp0 == NULL)) delete_lp(lp); lp = NULL; } if(lp != NULL) { set_lp_name(lp, pp->title); if(pp->Maximise) set_maxim(lp); if(pp->Rows) { int row; MALLOCCPY(orig_upbo, lp->orig_upbo, 1 + pp->Rows, REAL); for(row = 1; row <= pp->Rows; row++) set_constr_type(lp, row, pp->relat[row]); memcpy(lp->orig_upbo, orig_upbo, (1 + pp->Rows) * sizeof(*orig_upbo)); /* restore upper bounds (range) */ FREE(orig_upbo); } } if((pp->title != NULL) && (pp->title != lp_name)) free(pp->title); free_hash_table(pp->Hash_tab); free_hash_table(pp->Hash_constraints); } FREE(pp->relat); } null_tmp_store(pp, FALSE); return(lp); } lp_solve_5.5/yacc_read.h100666 0 0 3706 11141374612 13630 0ustar usergroup/* prototypes of functions used in the parser */ #include #ifndef __READ_H__ #define __READ_H__ struct _tmp_store_struct { char *name; int row; REAL value; REAL rhs_value; short relat; }; typedef struct parse_parm_s { void *scanner; long lineno; int Verbose; jmp_buf jump_buf; long Rows, Columns, Non_zeros, Lin_term_count; struct rside *First_rside, *rs; short SOStype; /* SOS type */ char Ignore_int_decl, int_decl, Ignore_sec_decl, Ignore_free_decl, sos_decl, Maximise; hashtable *Hash_tab, *Hash_constraints; struct structcoldata *coldata; struct structSOS *FirstSOS, *LastSOS; struct _tmp_store_struct tmp_store; char *title; short *relat; void *parse_vars; } parse_parm; void lex_fatal_error(parse_parm *, void *, char *); int set_title(parse_parm *pp, char *name); int add_constraint_name(parse_parm *pp, char *name); int store_re_op(parse_parm *pp, char OP, int HadConstraint, int HadVar, int Had_lineair_sum); void null_tmp_store(parse_parm *pp, int init_Lin_term_count); int store_bounds(parse_parm *pp, int warn); void storevarandweight(parse_parm *pp, char *name); int set_sos_type(parse_parm *pp, int SOStype); int set_sos_weight(parse_parm *pp, double weight, int sos_decl); int set_sec_threshold(parse_parm *pp, char *name, REAL threshold); int rhs_store(parse_parm *pp, REAL value, int HadConstraint, int HadVar, int Had_lineair_sum); int var_store(parse_parm *pp, char *var, REAL value, int HadConstraint, int HadVar, int Had_lineair_sum); int negate_constraint(parse_parm *pp); void add_row(parse_parm *pp); void add_sos_row(parse_parm *pp, short SOStype); void read_error(parse_parm *, void *, char *); void check_int_sec_sos_free_decl(parse_parm *, int, int, int, int); lprec *yacc_read(lprec *lp, int verbose, char *lp_name, int (*parse) (parse_parm *pp), parse_parm *pp, void (*delete_allocated_memory) (parse_parm *pp)); #define set_obj_dir(pp, maximise) pp->Maximise = maximise #endif lp_solve_5.5/bfp/lp_BFP.h100666 0 0 11000 11141443437 13573 0ustar usergroup /* ---------------------------------------------------------------------------------- */ /* lp_solve v5+ headers for basis inversion / factorization libraries */ /* ---------------------------------------------------------------------------------- */ #define BFP_STATUS_RANKLOSS -1 #define BFP_STATUS_SUCCESS 0 #define BFP_STATUS_SINGULAR 1 #define BFP_STATUS_UNSTABLE 2 #define BFP_STATUS_NOPIVOT 3 #define BFP_STATUS_DIMERROR 4 #define BFP_STATUS_DUPLICATE 5 #define BFP_STATUS_NOMEMORY 6 #define BFP_STATUS_ERROR 7 /* Unspecified, command-related error */ #define BFP_STATUS_FATAL 8 #define BFP_STAT_ERROR -1 #define BFP_STAT_REFACT_TOTAL 0 #define BFP_STAT_REFACT_TIMED 1 #define BFP_STAT_REFACT_DENSE 2 #ifndef BFP_CALLMODEL #ifdef WIN32 #define BFP_CALLMODEL __stdcall /* "Standard" call model */ #else #define BFP_CALLMODEL #endif #endif #ifdef RoleIsExternalInvEngine #define __BFP_EXPORT_TYPE __EXPORT_TYPE #else #define __BFP_EXPORT_TYPE #endif /* Routines with UNIQUE implementations for each inversion engine */ /* ---------------------------------------------------------------------------------- */ char __BFP_EXPORT_TYPE *(BFP_CALLMODEL bfp_name)(void); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_free)(lprec *lp); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_resize)(lprec *lp, int newsize); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_nonzeros)(lprec *lp, MYBOOL maximum); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_memallocated)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_preparefactorization)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_factorize)(lprec *lp, int uservars, int Bsize, MYBOOL *usedpos, MYBOOL final); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_finishupdate)(lprec *lp, MYBOOL changesign); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_ftran_normal)(lprec *lp, REAL *pcol, int *nzidx); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_ftran_prepare)(lprec *lp, REAL *pcol, int *nzidx); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_btran_normal)(lprec *lp, REAL *prow, int *nzidx); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_status)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_findredundant)(lprec *lp, int items, getcolumnex_func cb, int *maprow, int*mapcol); /* Routines SHARED for all inverse implementations; located in lp_BFP1.c */ /* ---------------------------------------------------------------------------------- */ MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_compatible)(lprec *lp, int bfpversion, int lpversion, int sizeofvar); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_indexbase)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_rowoffset)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotmax)(lprec *lp); REAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_efficiency)(lprec *lp); REAL __BFP_EXPORT_TYPE *(BFP_CALLMODEL bfp_pivotvector)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotcount)(lprec *lp); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_mustrefactorize)(lprec *lp); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_refactcount)(lprec *lp, int kind); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_isSetI)(lprec *lp); int *bfp_createMDO(lprec *lp, MYBOOL *usedpos, int count, MYBOOL doMDO); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_updaterefactstats)(lprec *lp); int BFP_CALLMODEL bfp_rowextra(lprec *lp); /* Routines with OPTIONAL SHARED code; template routines suitable for canned */ /* inverse engines are located in lp_BFP2.c */ /* ---------------------------------------------------------------------------------- */ MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_init)(lprec *lp, int size, int deltasize, char *options); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_restart)(lprec *lp); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_implicitslack)(lprec *lp); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotalloc)(lprec *lp, int newsize); int __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_colcount)(lprec *lp); MYBOOL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_canresetbasis)(lprec *lp); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_finishfactorization)(lprec *lp); LREAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_prepareupdate)(lprec *lp, int row_nr, int col_nr, REAL *pcol); REAL __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_pivotRHS)(lprec *lp, LREAL theta, REAL *pcol); void __BFP_EXPORT_TYPE (BFP_CALLMODEL bfp_btran_double)(lprec *lp, REAL *prow, int *pnzidx, REAL *drow, int *dnzidx); lp_solve_5.5/bfp/lp_BFP1.c100666 0 0 12701 11141443437 13660 0ustar usergroup /* Routines located in lp_BFP1.cpp; common for all factorization engines */ /* Cfr. lp_BFP.h for definitions */ /* ---------------------------------------------------------------------------------- */ /* Changes: */ /* 29 May 2004 Corrected calculation of bfp_efficiency(), which required */ /* modifying the max_Bsize to include slack variables. KE. */ /* 16 June 2004 Make the symbolic minimum degree ordering routine available */ /* to BFPs as a routine internal to the library. KE */ /* 1 July 2004 Change due to change in MDO naming. */ /* ---------------------------------------------------------------------------------- */ /* MUST MODIFY */ MYBOOL BFP_CALLMODEL bfp_compatible(lprec *lp, int bfpversion, int lpversion, int sizeofvar) { MYBOOL status = FALSE; if((lp != NULL) && (bfpversion == BFPVERSION) && (sizeof(REAL) == sizeofvar)) { #if 0 if(lpversion == MAJORVERSION) /* Forces BFP renewal at lp_solve major version changes */ #endif status = TRUE; } return( status ); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_status(lprec *lp) { return(lp->invB->status); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_indexbase(lprec *lp) { return( MATINDEXBASE ); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_rowoffset(lprec *lp) { if(lp->obj_in_basis) return( 1 ); else return( 0 ); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_pivotmax(lprec *lp) { if(lp->max_pivots > 0) return( lp->max_pivots ); else return( DEF_MAXPIVOT ); } /* DON'T MODIFY */ REAL * BFP_CALLMODEL bfp_pivotvector(lprec *lp) { return( lp->invB->pcol ); } /* DON'T MODIFY */ REAL BFP_CALLMODEL bfp_efficiency(lprec *lp) { REAL hold; hold = lp->bfp_nonzeros(lp, AUTOMATIC); if(hold == 0) hold = 1 + lp->rows; hold = lp->bfp_nonzeros(lp, TRUE)/hold; return(hold); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_pivotcount(lprec *lp) { return(lp->invB->num_pivots); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_refactcount(lprec *lp, int kind) { if(kind == BFP_STAT_REFACT_TOTAL) return(lp->invB->num_refact); else if(kind == BFP_STAT_REFACT_TIMED) return(lp->invB->num_timed_refact); else if(kind == BFP_STAT_REFACT_DENSE) return(lp->invB->num_dense_refact); else return( BFP_STAT_ERROR ); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_mustrefactorize(lprec *lp) { MYBOOL test = lp->is_action(lp->spx_action, ACTION_REINVERT | ACTION_TIMEDREINVERT); if(!test) { REAL f; INVrec *lu = lp->invB; if(lu->num_pivots > 0) f = (timeNow()-lu->time_refactstart) / (REAL) lu->num_pivots; else f = 0; /* Always refactorize if we are above the set pivot limit */ if(lu->force_refact || (lu->num_pivots >= lp->bfp_pivotmax(lp))) lp->set_action(&lp->spx_action, ACTION_REINVERT); /* Check if we should do an optimal time-based refactorization */ else if(lu->timed_refact && (lu->num_pivots > 1) && (f > MIN_TIMEPIVOT) && (f > lu->time_refactnext)) { /* If we have excessive time usage in automatic mode then treat as untimed case and update optimal time metric, ... */ if((lu->timed_refact == AUTOMATIC) && (lu->num_pivots < 0.4*lp->bfp_pivotmax(lp))) lu->time_refactnext = f; /* ... otherwise set flag for the optimal time-based refactorization */ else lp->set_action(&lp->spx_action, ACTION_TIMEDREINVERT); } /* Otherwise simply update the optimal time metric */ else lu->time_refactnext = f; #if 0 if(lu->num_pivots % 10 == 0) lp->report(lp, NORMAL, "bfp pivot %d - start %f - timestat %f", lu->num_pivots, lu->time_refactstart, f); #endif } test = lp->is_action(lp->spx_action, ACTION_REINVERT | ACTION_TIMEDREINVERT); return(test); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_isSetI(lprec *lp) { return( (MYBOOL) lp->invB->set_Bidentity ); } /* DON'T MODIFY */ int *bfp_createMDO(lprec *lp, MYBOOL *usedpos, int count, MYBOOL doMDO) { int *mdo, i, j, kk; mdo = (int *) malloc((count + 1)*sizeof(*mdo)); /* allocINT(lp, &mdo, count + 1, FALSE); */ /* Fill the mdo[] array with remaining full-pivot basic user variables */ kk = 0; for(j = 1; j <= lp->columns; j++) { i = lp->rows + j; if(usedpos[i] == TRUE) { kk++; mdo[kk] = i; } } mdo[0] = kk; if(kk == 0) goto Process; /* Calculate the approximate minimum degree column ordering */ if(doMDO) { i = lp->getMDO(lp, usedpos, mdo, NULL, FALSE); if(i != 0) { lp->report(lp, CRITICAL, "bfp_createMDO: Internal error %d in minimum degree ordering routine", i); FREE(mdo); } } Process: return( mdo ); } void BFP_CALLMODEL bfp_updaterefactstats(lprec *lp) { INVrec *lu = lp->invB; /* Signal that we are refactorizing */ lu->is_dirty = AUTOMATIC; /* Set time of start of current refactorization cycle */ lu->time_refactstart = timeNow(); lu->time_refactnext = 0; lu->user_colcount = 0; /* Do the numbers */ if(lu->force_refact) lu->num_dense_refact++; else if(lu->timed_refact && lp->is_action(lp->spx_action, ACTION_TIMEDREINVERT)) lu->num_timed_refact++; lu->num_refact++; } int BFP_CALLMODEL bfp_rowextra(lprec *lp) { if(lp->is_obj_in_basis(lp)) return( 1 ); else return( 0 ); } lp_solve_5.5/bfp/lp_BFP2.c100666 0 0 10425 11141443437 13662 0ustar usergroup /* Routines located in lp_BFP2.cpp; optional shared for canned implementations */ /* Cfr. lp_BFP.h for definitions */ /* ---------------------------------------------------------------------------------- */ /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_init(lprec *lp, int size, int delta, char *options) { INVrec *lu; lp->invB = (INVrec *) calloc(1, sizeof(*(lp->invB))); lu = lp->invB; if((lu == NULL) || !lp->bfp_resize(lp, size) || !lp->bfp_restart(lp)) return( FALSE ); /* Store any passed options */ if(options != NULL) { size_t len = strlen(options); lu->opts = (char *) malloc(len + 1); strcpy(lu->opts, options); } /* Prepare for factorization and undo values reset by bfp_preparefactorization */ lp->bfp_preparefactorization(lp); lu->num_refact = 0; return( TRUE ); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_restart(lprec *lp) { INVrec *lu; lu = lp->invB; if(lu == NULL) return( FALSE ); lu->status = BFP_STATUS_SUCCESS; lu->max_Bsize = 0; /* The largest NZ-count of the B matrix */ lu->max_colcount = 0; /* The maximum number of user columns in B */ lu->max_LUsize = 0; /* The largest NZ-count of LU-files generated */ lu->num_refact = 0; /* The number of times the basis has been factored */ lu->num_timed_refact = 0; lu->num_dense_refact = 0; lu->num_pivots = 0; /* The number of pivots since last factorization */ lu->pcol = NULL; lu->set_Bidentity = FALSE; return( TRUE ); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_implicitslack(lprec *lp) { return( FALSE ); } /* DON'T MODIFY */ int BFP_CALLMODEL bfp_colcount(lprec *lp) { return(lp->invB->user_colcount); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_canresetbasis(lprec *lp) { return( FALSE ); } /* DON'T MODIFY */ MYBOOL BFP_CALLMODEL bfp_pivotalloc(lprec *lp, int newsize) { /* Does nothing in the default implementation */ return( TRUE ); } /* DON'T MODIFY */ void BFP_CALLMODEL bfp_finishfactorization(lprec *lp) { INVrec *lu; lu = lp->invB; SETMAX(lu->max_colcount, lp->bfp_colcount(lp)); SETMAX(lu->max_LUsize, lp->bfp_nonzeros(lp, FALSE)); /* Signal that we done factorizing/reinverting */ lu->is_dirty = FALSE; lp->clear_action(&lp->spx_action, ACTION_REINVERT | ACTION_TIMEDREINVERT); lu->force_refact = FALSE; /* Store information about the current inverse */ lu->num_pivots = 0; } /* DON'T MODIFY */ LREAL BFP_CALLMODEL bfp_prepareupdate(lprec *lp, int row_nr, int col_nr, REAL *pcol) /* Was condensecol() in versions of lp_solve before 4.0.1.8 - KE */ { LREAL pivValue; INVrec *lu; lu = lp->invB; /* Store the incoming pivot value for RHS update purposes */ lu->col_enter = col_nr; /* The index of the new data column */ lu->col_pos = row_nr; /* The basis column to be replaced */ lu->col_leave = lp->var_basic[row_nr]; if(pcol == NULL) pivValue = 0; else pivValue = pcol[row_nr]; lu->theta_enter = pivValue; /* Save reference to the elimination vector */ lu->pcol = pcol; /* Set completion status; but hold if we are reinverting */ if(lu->is_dirty != AUTOMATIC) lu->is_dirty = TRUE; return( pivValue ); } /* DON'T MODIFY */ REAL BFP_CALLMODEL bfp_pivotRHS(lprec *lp, LREAL theta, REAL *pcol) /* This function is used to adjust the RHS in bound swap operations as well as handling the updating of the RHS for normal basis changes. Was rhsmincol(), ie. "rhs minus column" in versions of lp_solve before 4.0.1.8 - KE */ { INVrec *lu; lu = lp->invB; if(pcol == NULL) pcol = lu->pcol; if(theta != 0) { register int i, n = lp->rows; register LREAL roundzero = lp->epsvalue; register LREAL *rhs = lp->rhs, rhsmax = 0; for(i = 0; i <= n; i++, rhs++, pcol++) { (*rhs) -= theta * (*pcol); my_roundzero(*rhs, roundzero); SETMAX(rhsmax, fabs(*rhs)); } lp->rhsmax = rhsmax; } if(pcol == lu->pcol) return( lu->theta_enter ); else return( 0.0 ); } /* DON'T MODIFY */ void BFP_CALLMODEL bfp_btran_double(lprec *lp, REAL *prow, int *pnzidx, REAL *drow, int *dnzidx) { if(prow != NULL) lp->bfp_btran_normal(lp, prow, pnzidx); if(drow != NULL) lp->bfp_btran_normal(lp, drow, dnzidx); } lp_solve_5.5/bfp/bfp_LUSOL/bfp_LUSOL.c100666 0 0 667 11141443432 15712 0ustar usergroup #include "bfp_LUSOL.h" #include "lp_lib.h" #include "lp_LUSOL.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; } #if defined FORTIFY int EndOfPgr(int i) { exit(i); } #endif lp_solve_5.5/bfp/bfp_LUSOL/bfp_LUSOL.h100666 0 0 651 11141443432 15710 0ustar usergroup// stdafx.h : include file for standard system include files, // or project specific include files that are used frequently, but // are changed infrequently // //#pragma once //RoleIsExternalInvEngine;INVERSE_ACTIVE=INVERSE_LUSOL #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers // Windows Header Files: #include // TODO: reference additional headers your program requires here lp_solve_5.5/bfp/bfp_LUSOL/lp_LUSOL.c100666 0 0 56377 11141443432 15627 0ustar usergroup /* Modularized simplex basis factorization module - w/interface for lp_solve v5.0+ ---------------------------------------------------------------------------------- Author: Kjell Eikland Contact: kjell.eikland@broadpark.no License terms: LGPL. Requires: lusol.h, lp_lib.h, myblas.h Release notes: v2.0.0 1 March 2004 First implementation of the LUSOL v2.0 C translation. v2.0.1 1 April 2004 Added singularity recovery and fast/reuse update logic. v2.0.2 23 May 2004 Moved mustrefact() function into the BFP structure. v2.0.3 5 September 2004 Reworked pivot threshold tightening logic and default values. v2.1.0 18 June 2005 Made changes to allow for "pure" factorization; i.e. without the objective function included. ---------------------------------------------------------------------------------- */ /* Generic include libraries */ #include #include #include "lp_lib.h" /* Include libraries for this factorization system */ #include "myblas.h" #include "commonlib.h" #include "lp_LUSOL.h" #include "lusol.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* Include routines common to factorization engine implementations */ #include "lp_BFP1.c" #include "lp_BFP2.c" /* MUST MODIFY */ char * BFP_CALLMODEL bfp_name(void) { return( "LUSOL v2.2.1.0" ); } /* MUST MODIFY */ MYBOOL BFP_CALLMODEL bfp_resize(lprec *lp, int newsize) { INVrec *lu; lu = lp->invB; /* Increment dimensionality since we put the objective row at the top */ newsize = newsize + bfp_rowoffset(lp); lu->dimalloc = newsize; /* Allocate index tracker arrays, LU matrices and various work vectors */ if(!allocREAL(lp, &(lu->value), newsize+MATINDEXBASE, AUTOMATIC)) return( FALSE ); /* Data specific to the factorization engine */ if(lu->LUSOL != NULL) { if(newsize > 0) LUSOL_sizeto(lu->LUSOL, newsize, newsize, 0); else { LUSOL_free(lu->LUSOL); lu->LUSOL = NULL; } } else if(newsize > 0) { int asize; REAL bsize; lu->LUSOL = LUSOL_create(NULL, 0, LUSOL_PIVMOD_TPP, bfp_pivotmax(lp)*0); #if 1 lu->LUSOL->luparm[LUSOL_IP_ACCELERATION] = LUSOL_AUTOORDER; lu->LUSOL->parmlu[LUSOL_RP_SMARTRATIO] = 0.50; #endif #if 0 lu->timed_refact = DEF_TIMEDREFACT; #else lu->timed_refact = FALSE; #endif /* The following adjustments seem necessary to make the really tough NETLIB models perform reliably and still performant (e.g. cycle.mps) */ #if 0 lu->LUSOL->parmlu[LUSOL_RP_SMALLDIAG_U] = lu->LUSOL->parmlu[LUSOL_RP_EPSDIAG_U] = lp->epsprimal; #endif #if 0 lu->LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE] = lp->epsvalue; #endif #if 1 LUSOL_setpivotmodel(lu->LUSOL, LUSOL_PIVMOD_NOCHANGE, LUSOL_PIVTOL_SLIM); #else LUSOL_setpivotmodel(lu->LUSOL, LUSOL_PIVMOD_NOCHANGE, LUSOL_PIVTOL_TIGHT); #endif #ifdef LUSOL_UseBLAS /* if(fileSearchPath("PATH", "myBLAS.DLL", NULL) && load_BLAS("myBLAS")) */ if(is_nativeBLAS() && load_BLAS(libnameBLAS)) lp->report(lp, NORMAL, "Optimized BLAS was successfully loaded for bfp_LUSOL.\n"); #endif /* Try to minimize memory allocation if we have a large number of unit columns */ bsize = (REAL) lp->get_nonzeros(lp); if(newsize > lp->columns) bsize += newsize; else bsize = bsize/lp->columns*newsize; /* Add a "reasonable" delta to allow for B and associated factorizations that are denser than average; this makes reallocations less frequent. Values between 1.2 and 1.5 appear to be reasonable. */ asize = (int) (bsize*MAX_DELTAFILLIN*1.3333); if(!LUSOL_sizeto(lu->LUSOL, newsize, newsize, asize)) return( FALSE ); } lu->dimcount = newsize; return( TRUE ); } /* MUST MODIFY */ void BFP_CALLMODEL bfp_free(lprec *lp) { INVrec *lu; lu = lp->invB; if(lu == NULL) return; /* General arrays */ FREE(lu->opts); FREE(lu->value); /* Data specific to the factorization engine */ LUSOL_free(lu->LUSOL); FREE(lu); lp->invB = NULL; } /* MUST MODIFY */ int BFP_CALLMODEL bfp_nonzeros(lprec *lp, MYBOOL maximum) { INVrec *lu; lu = lp->invB; if(maximum == TRUE) return(lu->max_LUsize); else if(maximum == AUTOMATIC) return(lu->max_Bsize); else return(lu->LUSOL->luparm[LUSOL_IP_NONZEROS_L0]+lu->LUSOL->luparm[LUSOL_IP_NONZEROS_U0]); /* return(lu->LUSOL->luparm[LUSOL_IP_NONZEROS_ROW]); */ } /* MUST MODIFY (or ignore) */ int BFP_CALLMODEL bfp_memallocated(lprec *lp) { int mem; LUSOLrec *LUSOL = lp->invB->LUSOL; mem = sizeof(REAL) * (LUSOL->lena+LUSOL->maxm+LUSOL_RP_LASTITEM); mem += sizeof(int) * (2*LUSOL->lena+5*LUSOL->maxm+5*LUSOL->maxn+LUSOL_IP_LASTITEM); if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TCP) mem += sizeof(REAL) * LUSOL->maxn + 2*sizeof(REAL)*LUSOL->maxn; else if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TRP) mem += sizeof(REAL) * LUSOL->maxn; if(!LUSOL->luparm[LUSOL_IP_KEEPLU]) mem += sizeof(REAL) * LUSOL->maxn; return( mem ); } /* MUST MODIFY */ int BFP_CALLMODEL bfp_preparefactorization(lprec *lp) { INVrec *lu = lp->invB; /* Finish any outstanding business */ if(lu->is_dirty == AUTOMATIC) lp->bfp_finishfactorization(lp); /* Clear or resize the existing LU matrices - specific for the factorization engine */ LUSOL_clear(lu->LUSOL, TRUE); if(lu->dimcount != lp->rows + bfp_rowoffset(lp)) lp->bfp_resize(lp, lp->rows); /* Reset additional indicators */ lp->bfp_updaterefactstats(lp); lu->col_pos = 0; return(0); } /* LOCAL HELPER ROUTINE - Replace a basis column with corresponding slack */ int bfp_LUSOLsetcolumn(lprec *lp, int posnr, int colnr) { int nz, inform; nz = lp->get_lpcolumn(lp, colnr, lp->invB->LUSOL->w + bfp_rowoffset(lp), NULL, NULL); inform = LUSOL_replaceColumn(lp->invB->LUSOL, posnr, lp->invB->LUSOL->w); return( inform ); } /* LOCAL HELPER ROUTINE - force the basis to be the identity matrix */ int bfp_LUSOLidentity(lprec *lp, int *rownum) { int i, nz; INVrec *invB = lp->invB; /* Reset the factorization engine */ LUSOL_clear(invB->LUSOL, TRUE); /* Add the basis columns */ lp->invB->set_Bidentity = TRUE; for(i = 1; i <= invB->dimcount; i++) { nz = lp->get_basiscolumn(lp, i, rownum, invB->value); LUSOL_loadColumn(invB->LUSOL, rownum, i, invB->value, nz, 0); } lp->invB->set_Bidentity = FALSE; /* Factorize */ i = LUSOL_factorize(invB->LUSOL); return( i ); } /* LOCAL HELPER ROUTINE */ int bfp_LUSOLfactorize(lprec *lp, MYBOOL *usedpos, int *rownum, int *singular) { int i, j, nz, deltarows = bfp_rowoffset(lp); INVrec *invB = lp->invB; /* Handle normal, presumed nonsingular case */ if(singular == NULL) { /* Optionally do a symbolic minimum degree ordering; not that slack variables should not be processed */ /*#define UsePreprocessMDO*/ #ifdef UsePreprocessMDO int *mdo; mdo = lp->bfp_createMDO(lp, usedpos, lp->rows, TRUE); if(mdo != NULL) { for(i = 1; i <= lp->rows; i++) lp->set_basisvar(lp, i, mdo[i]); FREE(mdo); } #endif /* Reset the factorization engine */ LUSOL_clear(invB->LUSOL, TRUE); /* Add the basis columns in the original order */ for(i = 1; i <= invB->dimcount; i++) { nz = lp->get_basiscolumn(lp, i, rownum, invB->value); LUSOL_loadColumn(invB->LUSOL, rownum, i, invB->value, nz, 0); if((i > deltarows) && (lp->var_basic[i-deltarows] > lp->rows)) lp->invB->user_colcount++; } /* Factorize */ i = LUSOL_factorize(invB->LUSOL); } /* Handle case where a column may be singular */ else { LLrec *map; /* Reset the factorization engine */ i = bfp_LUSOLidentity(lp, rownum); /* Build map of available columns */ nz = createLink(lp->rows, &map, NULL); for(i = 1; i <= lp->rows; i++) { if(lp->var_basic[i] <= lp->rows) removeLink(map, i); } /* Rebuild the basis, column by column, while skipping slack columns */ j = firstActiveLink(map); for(i = 1; i <= lp->rows; i++) { if(lp->var_basic[i] <= lp->rows) continue; nz = bfp_LUSOLsetcolumn(lp, j+deltarows, lp->var_basic[i]); if(nz == LUSOL_INFORM_LUSUCCESS) lp->invB->user_colcount++; else { nz = bfp_LUSOLsetcolumn(lp, j+deltarows, i); lp->set_basisvar(lp, i, i); } j = nextActiveLink(map, j); } /* Sort the basis list */ MEMCOPY(rownum, lp->var_basic, lp->rows+1); sortByINT(lp->var_basic, rownum, lp->rows, 1, TRUE); } return( i ); } /* LOCAL HELPER ROUTINE */ void bfp_LUSOLtighten(lprec *lp) { int infolevel = DETAILED; switch(LUSOL_tightenpivot(lp->invB->LUSOL)) { case FALSE: lp->report(lp, infolevel, "bfp_factorize: Very hard numerics, but cannot tighten LUSOL thresholds further.\n"); break; case TRUE: lp->report(lp, infolevel, "bfp_factorize: Frequent refact pivot count %d at iter %.0f; tightened thresholds.\n", lp->invB->num_pivots, (REAL) lp->get_total_iter(lp)); break; default: lp->report(lp, infolevel, "bfp_factorize: LUSOL switched to %s pivoting model to enhance stability.\n", LUSOL_pivotLabel(lp->invB->LUSOL)); } } #define is_fixedvar is_fixedvar_ /* resolves a compiler warning/error conflict with lp_lib.h */ static MYBOOL is_fixedvar(lprec *lp, int variable) { if((lp->bb_bounds != NULL && lp->bb_bounds->UBzerobased) || (variable <= lp->rows)) return( (MYBOOL) (lp->upbo[variable] < lp->epsprimal) ); else return( (MYBOOL) (lp->upbo[variable]-lp->lowbo[variable] < lp->epsprimal) ); } /* is_fixedvar */ /* MUST MODIFY */ int BFP_CALLMODEL bfp_factorize(lprec *lp, int uservars, int Bsize, MYBOOL *usedpos, MYBOOL final) { int kcol, inform, *rownum = NULL, singularities = 0, dimsize = lp->invB->dimcount; LUSOLrec *LUSOL = lp->invB->LUSOL; /* Set dimensions and create work array */ SETMAX(lp->invB->max_Bsize, Bsize+(1+lp->rows-uservars)); kcol = lp->invB->dimcount; LUSOL->m = kcol; LUSOL->n = kcol; allocINT(lp, &rownum, kcol+1, FALSE); /* Check if the refactorization frequency is low; tighten pivot thresholds if appropriate */ inform = lp->bfp_pivotcount(lp); if(!final && /* No solution update-based refactorization */ !lp->invB->force_refact && /* No sparsity-based refactorization */ !lp->is_action(lp->spx_action, ACTION_TIMEDREINVERT) && /* No optimal time-based refactorization */ (inform > 5) && (inform < 0.25*lp->bfp_pivotmax(lp))) bfp_LUSOLtighten(lp); /* Reload B and factorize */ inform = bfp_LUSOLfactorize(lp, usedpos, rownum, NULL); /* Do some checks */ #ifdef Paranoia if(uservars != lp->invB->user_colcount) { lp->report(lp, SEVERE, "bfp_factorize: User variable count reconciliation failed\n"); return( singularities ); } #endif /* Check result and do further remedial action if necessary */ if(inform != LUSOL_INFORM_LUSUCCESS) { int singularcols, replacedcols = 0; REAL hold; /* Make sure we do not tighten factorization pivot criteria too often, and simply accept the substitution of slack columns into the basis */ if((lp->invB->num_singular+1) % TIGHTENAFTER == 0) bfp_LUSOLtighten(lp); /* Try to restore a non-singular basis by substituting singular columns with slacks */ while((inform == LUSOL_INFORM_LUSINGULAR) && (replacedcols < dimsize)) { int iLeave, jLeave, iEnter; MYBOOL isfixed; singularities++; singularcols = LUSOL->luparm[LUSOL_IP_SINGULARITIES]; hold = (REAL) lp->get_total_iter(lp); lp->report(lp, NORMAL, "bfp_factorize: Resolving %d singularit%s at refact %d, iter %.0f\n", singularcols, my_plural_y(singularcols), lp->invB->num_refact, hold); /* Find the failing / singular column(s) and make slack substitutions */ for(kcol = 1; kcol <= singularcols; kcol++) { /* Determine leaving and entering columns. */ iLeave = LUSOL_getSingularity(LUSOL, kcol); /* This is the singular column as natural index */ iEnter = iLeave; /* This is the target replacement slack */ #if 1 iEnter = LUSOL->iqinv[iEnter]; iEnter = LUSOL->ip[iEnter]; #endif iLeave-= bfp_rowextra(lp); /* This is the original B column/basis index */ jLeave = lp->var_basic[iLeave]; /* This is the IA column index in lp_solve */ /* Express the slack index in original lp_solve [1..rows] reference and check validity */ /* if(B4 != NULL) iEnter = B4->B4_row[iEnter]; v6 FUNCTIONALITY */ iEnter -= bfp_rowextra(lp); if(lp->is_basic[iEnter]) { lp->report(lp, DETAILED, "bfp_factorize: Replacement slack %d is already basic!\n", iEnter); /* See if we can find a good alternative slack variable to enter */ iEnter = 0; for(inform = 1; inform <= lp->rows; inform++) if(!lp->is_basic[inform]) { if((iEnter == 0) || (lp->upbo[inform] > lp->upbo[iEnter])) { iEnter = inform; if(my_infinite(lp, lp->upbo[iEnter])) break; } } if(iEnter == 0) { lp->report(lp, SEVERE, "bfp_factorize: Could not find replacement slack variable!\n"); break; } } /* We should update bound states for both the entering and leaving variables. Note that this may cause (primal or dual) infeasibility, but I assume that lp_solve traps this and takes necessary corrective action. */ isfixed = is_fixedvar(lp, iEnter); if(isfixed) lp->fixedvars++; hold = lp->upbo[jLeave]; lp->is_lower[jLeave] = isfixed || (fabs(hold)>=lp->infinite) || (lp->rhs[iLeave] < hold); lp->is_lower[iEnter] = TRUE; /* Do the basis replacement */ lp->set_basisvar(lp, iLeave, iEnter); } /* Refactorize with slack substitutions */ inform = bfp_LUSOLfactorize(lp, NULL, rownum, NULL); replacedcols += singularcols; } /* Check if we had a fundamental problem */ if(singularities >= dimsize) { lp->report(lp, IMPORTANT, "bfp_factorize: LUSOL was unable to recover from a singular basis\n"); lp->spx_status = NUMFAILURE; } } /* Clean up before returning */ FREE(rownum); /* Update statistics */ /* SETMAX(lp->invB->max_Bsize, (*Bsize)); */ lp->invB->num_singular += singularities; /* The total number of singular updates */ return( singularities ); } /* MUST MODIFY */ MYBOOL BFP_CALLMODEL bfp_finishupdate(lprec *lp, MYBOOL changesign) /* Was addetacol() in versions of lp_solve before 4.0.1.8 - KE */ { int i, k, kcol, deltarows = bfp_rowoffset(lp); REAL DIAG, VNORM; INVrec *lu = lp->invB; LUSOLrec *LUSOL = lu->LUSOL; if(!lu->is_dirty) return( FALSE ); if(lu->is_dirty != AUTOMATIC) lu->is_dirty = FALSE; /* Perform the update */ k = lu->col_pos+deltarows; lu->num_pivots++; if(lu->col_leave > lu->dimcount-deltarows) lu->user_colcount--; if(lu->col_enter > lu->dimcount-deltarows) lu->user_colcount++; kcol = lu->col_pos; lu->col_pos = 0; /* Do standard update */ #ifdef LUSOLSafeFastUpdate /* NB! Defined in lusol.h */ if(TRUE || !changesign) { if(changesign) { REAL *temp = LUSOL->vLU6L; for(i = 1, temp++; i <= lp->rows+deltarows; i++, temp++) if(*temp != 0) *temp = -(*temp); } /* Execute the update using data prepared earlier */ LU8RPC(LUSOL, LUSOL_UPDATE_OLDNONEMPTY, LUSOL_UPDATE_USEPREPARED, k, NULL, NULL, &i, &DIAG, &VNORM); } else #endif { /* Retrieve the data for the entering column (base 0) */ i = lp->get_lpcolumn(lp, lu->col_enter, lu->value+deltarows, NULL, NULL); lu->value[0] = 0; /* Execute the update */ LU8RPC(LUSOL, LUSOL_UPDATE_OLDNONEMPTY, LUSOL_UPDATE_NEWNONEMPTY, k, lu->value, NULL, &i, &DIAG, &VNORM); } if(i == LUSOL_INFORM_LUSUCCESS) { /* Check if we should refactorize based on accumulation of fill-in */ DIAG = LUSOL->luparm[LUSOL_IP_NONZEROS_L]+LUSOL->luparm[LUSOL_IP_NONZEROS_U]; VNORM = LUSOL->luparm[LUSOL_IP_NONZEROS_L0]+LUSOL->luparm[LUSOL_IP_NONZEROS_U0]; #if 0 /* This is Michael Saunder's fixed parameter */ VNORM *= MAX_DELTAFILLIN; #else /* This is Kjell Eikland's dynamic error accumulation measure */ VNORM *= pow(MAX_DELTAFILLIN, pow((0.5*LUSOL->nelem/VNORM), 0.25)); #endif lu->force_refact = (MYBOOL) ((DIAG > VNORM) && (lu->num_pivots > 20)); #if 0 /* Additional KE logic to reduce maximum pivot count based on the density of B */ if(!lu->force_refact) { VNORM = lp->rows+1; VNORM = 1.0 - pow((REAL) LUSOL->nelem/VNORM/VNORM, 0.2); lu->force_refact = (MYBOOL) (lu->num_pivots > VNORM*lp->bfp_pivotmax(lp)); } #endif } /* Handle errors */ else { /* int infolevel = NORMAL; */ int infolevel = DETAILED; lp->report(lp, infolevel, "bfp_finishupdate: Failed at iter %.0f, pivot %d;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), lu->num_pivots, LUSOL_informstr(LUSOL, i)); if(i == LUSOL_INFORM_ANEEDMEM) { /* To compress used memory and realloc, if necessary */ lp->invert(lp, INITSOL_USEZERO, FALSE); if(i != LUSOL_INFORM_LUSUCCESS) lp->report(lp, NORMAL, "bfp_finishupdate: Insufficient memory at iter %.0f;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), LUSOL_informstr(LUSOL, i)); } else if(i == LUSOL_INFORM_RANKLOSS) { /* To fix rank loss and clear cumulative errors */ #if 0 /* This is test code to do pivot in slack BEFORE refactorization (pessimistic approach); assumes that LUSOL returns correct information about the source of the singularity */ kcol = LUSOL->luparm[LUSOL_IP_SINGULARINDEX]; #ifdef MAPSINGULARCOLUMN kcol = LUSOL_findColumnPosition(LUSOL, kcol); #endif lp->set_basisvar(lp, kcol-deltarows, kcol-deltarows); #endif lp->invert(lp, INITSOL_USEZERO, FALSE); i = LUSOL->luparm[LUSOL_IP_INFORM]; if(i != LUSOL_INFORM_LUSUCCESS) lp->report(lp, NORMAL, "bfp_finishupdate: Recovery attempt unsuccessful at iter %.0f;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), LUSOL_informstr(LUSOL, i)); else lp->report(lp, infolevel, "bfp_finishupdate: Correction or recovery was successful.\n"); } } return( (MYBOOL) (i == LUSOL_INFORM_LUSUCCESS) ); } /* bfp_finishupdate */ /* MUST MODIFY */ void BFP_CALLMODEL bfp_ftran_normal(lprec *lp, REAL *pcol, int *nzidx) { int i; INVrec *lu; lu = lp->invB; /* Do the LUSOL ftran */ i = LUSOL_ftran(lu->LUSOL, pcol-bfp_rowoffset(lp), nzidx, FALSE); if(i != LUSOL_INFORM_LUSUCCESS) { lu->status = BFP_STATUS_ERROR; lp->report(lp, NORMAL, "bfp_ftran_normal: Failed at iter %.0f, pivot %d;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), lu->num_pivots, LUSOL_informstr(lu->LUSOL, i)); } } /* MAY MODIFY */ void BFP_CALLMODEL bfp_ftran_prepare(lprec *lp, REAL *pcol, int *nzidx) { int i; INVrec *lu; lu = lp->invB; /* Do the LUSOL ftran */ i = LUSOL_ftran(lu->LUSOL, pcol-bfp_rowoffset(lp), nzidx, TRUE); if(i != LUSOL_INFORM_LUSUCCESS) { lu->status = BFP_STATUS_ERROR; lp->report(lp, NORMAL, "bfp_ftran_prepare: Failed at iter %.0f, pivot %d;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), lu->num_pivots, LUSOL_informstr(lu->LUSOL, i)); } } /* MUST MODIFY */ void BFP_CALLMODEL bfp_btran_normal(lprec *lp, REAL *prow, int *nzidx) { int i; INVrec *lu; lu = lp->invB; /* Do the LUSOL btran */ i = LUSOL_btran(lu->LUSOL, prow-bfp_rowoffset(lp), nzidx); if(i != LUSOL_INFORM_LUSUCCESS) { lu->status = BFP_STATUS_ERROR; lp->report(lp, NORMAL, "bfp_btran_normal: Failed at iter %.0f, pivot %d;\n%s\n", (REAL) (lp->total_iter+lp->current_iter), lu->num_pivots, LUSOL_informstr(lu->LUSOL, i)); } /* Check performance data */ #if 0 if(lu->num_pivots == 1) { if(lu->LUSOL->luparm[LUSOL_IP_ACCELERATION] > 0) lp->report(lp, NORMAL, "RowL0 R:%10.7f C:%10.7f NZ:%10.7f\n", (REAL) lu->LUSOL->luparm[LUSOL_IP_ROWCOUNT_L0] / lu->LUSOL->m, (REAL) lu->LUSOL->luparm[LUSOL_IP_COLCOUNT_L0] / lu->LUSOL->m, (REAL) lu->LUSOL->luparm[LUSOL_IP_NONZEROS_L0] / pow((REAL) lu->LUSOL->m, 2)); else lp->report(lp, NORMAL, "ColL0 C:%10.7f NZ:%10.7f\n", (REAL) lu->LUSOL->luparm[LUSOL_IP_COLCOUNT_L0] / lu->LUSOL->m, (REAL) lu->LUSOL->luparm[LUSOL_IP_NONZEROS_L0] / pow((REAL) lu->LUSOL->m, 2)); } #endif } /* MUST MODIFY - Routine to find maximum rank of equality constraints */ int BFP_CALLMODEL bfp_findredundant(lprec *lp, int items, getcolumnex_func cb, int *maprow, int *mapcol) { int i, j, nz = 0, m = 0, n = 0, *nzrows = NULL; REAL *nzvalues = NULL, *arraymax = NULL; LUSOLrec *LUSOL; /* Are we capable of finding redundancy with this BFP? */ if((maprow == NULL) && (mapcol == NULL)) return( n ); /* If so, initialize memory structures */ if(!allocINT(lp, &nzrows, items, FALSE) || !allocREAL(lp, &nzvalues, items, FALSE)) return( n ); /* Compute the number of non-empty columns */ m = 0; for(j = 1; j <= mapcol[0]; j++) { n = cb(lp, mapcol[j], NULL, NULL, maprow); if(n > 0) { m++; mapcol[m] = mapcol[j]; nz += n; } } mapcol[0] = m; /* Instantiate a LUSOL object */ LUSOL = LUSOL_create(NULL, 0, LUSOL_PIVMOD_TRP, 0); if((LUSOL == NULL) || !LUSOL_sizeto(LUSOL, items, m, nz*LUSOL_MULT_nz_a)) goto Finish; /* Modify relevant LUSOL parameters */ LUSOL->m = items; LUSOL->n = m; #if 0 LUSOL->luparm[LUSOL_IP_KEEPLU] = FALSE; LUSOL->luparm[LUSOL_IP_PIVOTTYPE] = LUSOL_PIVMOD_TRP; LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = 2.0; #endif /* Load the columns into LUSOL */ for(j = 1; j <= m; j++) { n = cb(lp, mapcol[j], nzvalues, nzrows, maprow); i = LUSOL_loadColumn(LUSOL, nzrows, j, nzvalues, n, -1); if(n != i) { lp->report(lp, IMPORTANT, "bfp_findredundant: Error %d while loading column %d with %d nz\n", i, j, n); n = 0; goto Finish; } } /* Scale rows to prevent numerical problems */ if((lp->scalemode != SCALE_NONE) && allocREAL(lp, &arraymax, items+1, TRUE)) { for(i = 1; i <= nz; i++) { SETMAX(arraymax[LUSOL->indc[i]], fabs(LUSOL->a[i])); } for(i = 1; i <= nz; i++) LUSOL->a[i] /= arraymax[LUSOL->indc[i]]; FREE(arraymax); } /* Factorize for maximum rank */ n = 0; i = LUSOL_factorize(LUSOL); /* lp->report(lp, NORMAL, "bfp_findredundant: r=%d c=%d - %s\n", items, m, LUSOL_informstr(LUSOL, i));*/ if((i == LUSOL_INFORM_LUSUCCESS) || (i != LUSOL_INFORM_LUSINGULAR)) goto Finish; /* We have a singular matrix, obtain the indeces of the singular rows */ for(i = LUSOL->luparm[LUSOL_IP_RANK_U] + 1; i <= items; i++) { n++; maprow[n] = LUSOL->ip[i]; } maprow[0] = n; /* Clean up */ Finish: LUSOL_free(LUSOL); FREE(nzrows); FREE(nzvalues); return( n ); } lp_solve_5.5/bfp/bfp_LUSOL/lp_LUSOL.h100666 0 0 5402 11141443432 15573 0ustar usergroup#ifndef HEADER_lp_LUSOL #define HEADER_lp_LUSOL /* Include libraries for this inverse system */ #include "lp_types.h" #include "lusol.h" /* LUSOL defines */ #ifdef WIN32 # define LUSOL_UseBLAS #endif /*#define MAPSINGULARCOLUMN*/ #define MATINDEXBASE LUSOL_ARRAYOFFSET /* Inversion engine index start for arrays */ #define LU_START_SIZE 10000 /* Start size of LU; realloc'ed if needed */ #define DEF_MAXPIVOT 250 /* Maximum number of pivots before refactorization */ #define MAX_DELTAFILLIN 2.0 /* Do refactorizations based on sparsity considerations */ #define TIGHTENAFTER 10 /* Tighten LU pivot criteria only after this number of singularities */ /* typedef */ struct _INVrec { int status; /* Last operation status code */ int dimcount; /* The actual number of LU rows/columns */ int dimalloc; /* The allocated LU rows/columns size */ int user_colcount; /* The number of user LU columns */ LUSOLrec *LUSOL; int col_enter; /* The full index of the entering column */ int col_leave; /* The full index of the leaving column */ int col_pos; /* The B column to be changed at the next update using data in value[.]*/ REAL *value; REAL *pcol; /* Reference to the elimination vector */ REAL theta_enter; /* Value of the entering column theta */ int max_Bsize; /* The largest B matrix of user variables */ int max_colcount; /* The maximum number of user columns in LU */ int max_LUsize; /* The largest NZ-count of LU-files generated */ int num_refact; /* Number of times the basis was refactored */ int num_timed_refact; int num_dense_refact; double time_refactstart; /* Time since start of last refactorization-pivots cyle */ double time_refactnext; /* Time estimated to next refactorization */ int num_pivots; /* Number of pivots since last refactorization */ int num_singular; /* The total number of singular updates */ char *opts; MYBOOL is_dirty; /* Specifies if a column is incompletely processed */ MYBOOL force_refact; /* Force refactorization at the next opportunity */ MYBOOL timed_refact; /* Set if timer-driven refactorization should be active */ MYBOOL set_Bidentity; /* Force B to be the identity matrix at the next refactorization */ } /* INVrec */; #ifdef __cplusplus /* namespace LUSOL */ extern "C" { #endif /* Put function headers here */ #include "lp_BFP.h" #ifdef __cplusplus } #endif #endif /* HEADER_lp_LUSOL */ lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/ 40777 0 0 0 11141443437 14636 5ustar usergrouplp_solve_5.5/bfp/bfp_LUSOL/LUSOL/bfile3.txt100666 0 0 77 11141374613 16603 0ustar usergroup -0.187248E+05 0.112479E+05 0.132356E+05 lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/hbio.c100666 0 0 167460 11141443432 16071 0ustar usergroup /* Harwell-Boeing File I/O in C V. 1.0 National Institute of Standards and Technology, MD. K.A. Remington ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ NOTICE Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted provided that the above copyright notice appear in all copies and that both the copyright notice and this permission notice appear in supporting documentation. Neither the Author nor the Institution (National Institute of Standards and Technology) make any representations about the suitability of this software for any purpose. This software is provided "as is" without expressed or implied warranty. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --------------------- INTERFACE DESCRIPTION --------------------- --------------- QUERY FUNCTIONS --------------- FUNCTION: int readHB_info(const char *filename, int *M, int *N, int *nz, char **Type, int *Nrhs) DESCRIPTION: The readHB_info function opens and reads the header information from the specified Harwell-Boeing file, and reports back the number of rows and columns in the stored matrix (M and N), the number of nonzeros in the matrix (nz), the 3-character matrix type(Type), and the number of right-hand-sides stored along with the matrix (Nrhs). This function is designed to retrieve basic size information which can be used to allocate arrays. FUNCTION: int readHB_header(FILE* in_file, char* Title, char* Key, char* Type, int* Nrow, int* Ncol, int* Nnzero, int* Nrhs, int* Nrhsix, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, int* Ptrcrd, int* Indcrd, int* Valcrd, int* Rhscrd, char *Rhstype) DESCRIPTION: More detailed than the readHB_info function, readHB_header() reads from the specified Harwell-Boeing file all of the header information. ------------------------------ DOUBLE PRECISION I/O FUNCTIONS ------------------------------ FUNCTION: int readHB_newmat_double(const char *filename, int *M, int *N, *int nz, int **colptr, int **rowind, double**val) int readHB_mat_double(const char *filename, int *colptr, int *rowind, double*val) DESCRIPTION: This function opens and reads the specified file, interpreting its contents as a sparse matrix stored in the Harwell/Boeing standard format. (See readHB_aux_double to read auxillary vectors.) -- Values are interpreted as double precision numbers. -- The "mat" function uses _pre-allocated_ vectors to hold the index and nonzero value information. The "newmat" function allocates vectors to hold the index and nonzero value information, and returns pointers to these vectors along with matrix dimension and number of nonzeros. FUNCTION: int readHB_aux_double(const char* filename, const char AuxType, double b[]) int readHB_newaux_double(const char* filename, const char AuxType, double** b) DESCRIPTION: This function opens and reads from the specified file auxillary vector(s). The char argument Auxtype determines which type of auxillary vector(s) will be read (if present in the file). AuxType = 'F' right-hand-side AuxType = 'G' initial estimate (Guess) AuxType = 'X' eXact solution If Nrhs > 1, all of the Nrhs vectors of the given type are read and stored in column-major order in the vector b. The "newaux" function allocates a vector to hold the values retrieved. The "mat" function uses a _pre-allocated_ vector to hold the values. FUNCTION: int writeHB_mat_double(const char* filename, int M, int N, int nz, const int colptr[], const int rowind[], const double val[], int Nrhs, const double rhs[], const double guess[], const double exact[], const char* Title, const char* Key, const char* Type, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, const char* Rhstype) DESCRIPTION: The writeHB_mat_double function opens the named file and writes the specified matrix and optional auxillary vector(s) to that file in Harwell-Boeing format. The format arguments (Ptrfmt,Indfmt,Valfmt, and Rhsfmt) are character strings specifying "Fortran-style" output formats -- as they would appear in a Harwell-Boeing file. They are used to produce output which is as close as possible to what would be produced by Fortran code, but note that "D" and "P" edit descriptors are not supported. If NULL, the following defaults will be used: Ptrfmt = Indfmt = "(8I10)" Valfmt = Rhsfmt = "(4E20.13)" ----------------------- CHARACTER I/O FUNCTIONS ----------------------- FUNCTION: int readHB_mat_char(const char* filename, int colptr[], int rowind[], char val[], char* Valfmt) int readHB_newmat_char(const char* filename, int* M, int* N, int* nonzeros, int** colptr, int** rowind, char** val, char** Valfmt) DESCRIPTION: This function opens and reads the specified file, interpreting its contents as a sparse matrix stored in the Harwell/Boeing standard format. (See readHB_aux_char to read auxillary vectors.) -- Values are interpreted as char strings. -- (Used to translate exact values from the file into a new storage format.) The "mat" function uses _pre-allocated_ arrays to hold the index and nonzero value information. The "newmat" function allocates char arrays to hold the index and nonzero value information, and returns pointers to these arrays along with matrix dimension and number of nonzeros. FUNCTION: int readHB_aux_char(const char* filename, const char AuxType, char b[]) int readHB_newaux_char(const char* filename, const char AuxType, char** b, char** Rhsfmt) DESCRIPTION: This function opens and reads from the specified file auxillary vector(s). The char argument Auxtype determines which type of auxillary vector(s) will be read (if present in the file). AuxType = 'F' right-hand-side AuxType = 'G' initial estimate (Guess) AuxType = 'X' eXact solution If Nrhs > 1, all of the Nrhs vectors of the given type are read and stored in column-major order in the vector b. The "newaux" function allocates a character array to hold the values retrieved. The "mat" function uses a _pre-allocated_ array to hold the values. FUNCTION: int writeHB_mat_char(const char* filename, int M, int N, int nz, const int colptr[], const int rowind[], const char val[], int Nrhs, const char rhs[], const char guess[], const char exact[], const char* Title, const char* Key, const char* Type, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, const char* Rhstype) DESCRIPTION: The writeHB_mat_char function opens the named file and writes the specified matrix and optional auxillary vector(s) to that file in Harwell-Boeing format. The format arguments (Ptrfmt,Indfmt,Valfmt, and Rhsfmt) are character strings specifying "Fortran-style" output formats -- as they would appear in a Harwell-Boeing file. Valfmt and Rhsfmt must accurately represent the character representation of the values stored in val[] and rhs[]. If NULL, the following defaults will be used for the integer vectors: Ptrfmt = Indfmt = "(8I10)" Valfmt = Rhsfmt = "(4E20.13)" */ /*---------------------------------------------------------------------*/ /* If zero-based indexing is desired, _SP_base should be set to 0 */ /* This will cause indices read from H-B files to be decremented by 1 */ /* and indices written to H-B files to be incremented by 1 */ /* <<< Standard usage is _SP_base = 1 >>> */ #ifndef _SP_base #define _SP_base 1 #endif /*---------------------------------------------------------------------*/ #include "hbio.h" #include #include char *substr(const char* S, const int pos, const int len); void upcase(char* S); void IOHBTerminate(char* message); int readHB_info(const char* filename, int* M, int* N, int* nz, char** Type, int* Nrhs) { /****************************************************************************/ /* The readHB_info function opens and reads the header information from */ /* the specified Harwell-Boeing file, and reports back the number of rows */ /* and columns in the stored matrix (M and N), the number of nonzeros in */ /* the matrix (nz), and the number of right-hand-sides stored along with */ /* the matrix (Nrhs). */ /* */ /* For a description of the Harwell Boeing standard, see: */ /* Duff, et al., ACM TOMS Vol.15, No.1, March 1989 */ /* */ /* ---------- */ /* **CAVEAT** */ /* ---------- */ /* ** If the input file does not adhere to the H/B format, the ** */ /* ** results will be unpredictable. ** */ /* */ /****************************************************************************/ FILE *in_file; int Ptrcrd, Indcrd, Valcrd, Rhscrd; int Nrow, Ncol, Nnzero, Nrhsix; char *mat_type; char Title[73], Key[9], Rhstype[4]; char Ptrfmt[17], Indfmt[17], Valfmt[21], Rhsfmt[21]; mat_type = (char *) malloc(4); if ( mat_type == NULL ) IOHBTerminate("Insufficient memory for mat_typen"); if ( (in_file = fopen( filename, "r")) == NULL ) { fprintf(stderr,"Error: Cannot open file: %s\n",filename); return 0; } readHB_header(in_file, Title, Key, mat_type, &Nrow, &Ncol, &Nnzero, Nrhs, &Nrhsix, Ptrfmt, Indfmt, Valfmt, Rhsfmt, &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); fclose(in_file); *Type = mat_type; *(*Type+3) = (char) NULL; *M = Nrow; *N = Ncol; *nz = Nnzero; if (Rhscrd == 0) {*Nrhs = 0;} /* In verbose mode, print some of the header information: */ /* if (verbose == 1) { printf("Reading from Harwell-Boeing file %s (verbose on)...\n",filename); printf(" Title: %s\n",Title); printf(" Key: %s\n",Key); printf(" The stored matrix is %i by %i with %i nonzeros.\n", *M, *N, *nz ); printf(" %i right-hand--side(s) stored.\n",*Nrhs); } */ return 1; } int readHB_header(FILE* in_file, char* Title, char* Key, char* Type, int* Nrow, int* Ncol, int* Nnzero, int* Nrhs, int* Nrhsix, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, int* Ptrcrd, int* Indcrd, int* Valcrd, int* Rhscrd, char *Rhstype) { /*************************************************************************/ /* Read header information from the named H/B file... */ /*************************************************************************/ int Totcrd,Neltvl; char line[BUFSIZ]; /* First line: */ fgets(line, BUFSIZ, in_file); if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) first line of HB file.\n"); (void) sscanf(line, "%72c%8[^\n]", Title, Key); *(Key+8) = (char) NULL; *(Title+72) = (char) NULL; /* Second line: */ fgets(line, BUFSIZ, in_file); if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) second line of HB file.\n"); if ( sscanf(line,"%i",&Totcrd) != 1) Totcrd = 0; if ( sscanf(line,"%*i%i",Ptrcrd) != 1) *Ptrcrd = 0; if ( sscanf(line,"%*i%*i%i",Indcrd) != 1) *Indcrd = 0; if ( sscanf(line,"%*i%*i%*i%i",Valcrd) != 1) *Valcrd = 0; if ( sscanf(line,"%*i%*i%*i%*i%i",Rhscrd) != 1) *Rhscrd = 0; /* Third line: */ fgets(line, BUFSIZ, in_file); if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) third line of HB file.\n"); if ( sscanf(line, "%3c", Type) != 1) IOHBTerminate("iohb.c: Invalid Type info, line 3 of Harwell-Boeing file.\n"); upcase(Type); if ( sscanf(line,"%*3c%i",Nrow) != 1) *Nrow = 0 ; if ( sscanf(line,"%*3c%*i%i",Ncol) != 1) *Ncol = 0 ; if ( sscanf(line,"%*3c%*i%*i%i",Nnzero) != 1) *Nnzero = 0 ; if ( sscanf(line,"%*3c%*i%*i%*i%i",&Neltvl) != 1) Neltvl = 0 ; /* Fourth line: */ fgets(line, BUFSIZ, in_file); if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) fourth line of HB file.\n"); if ( sscanf(line, "%16c",Ptrfmt) != 1) IOHBTerminate("iohb.c: Invalid format info, line 4 of Harwell-Boeing file.\n"); if ( sscanf(line, "%*16c%16c",Indfmt) != 1) IOHBTerminate("iohb.c: Invalid format info, line 4 of Harwell-Boeing file.\n"); if ( sscanf(line, "%*16c%*16c%20c",Valfmt) != 1) IOHBTerminate("iohb.c: Invalid format info, line 4 of Harwell-Boeing file.\n"); sscanf(line, "%*16c%*16c%*20c%20c",Rhsfmt); *(Ptrfmt+16) = (char) NULL; *(Indfmt+16) = (char) NULL; *(Valfmt+20) = (char) NULL; *(Rhsfmt+20) = (char) NULL; /* (Optional) Fifth line: */ if (*Rhscrd != 0 ) { fgets(line, BUFSIZ, in_file); if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) fifth line of HB file.\n"); if ( sscanf(line, "%3c", Rhstype) != 1) IOHBTerminate("iohb.c: Invalid RHS type information, line 5 of Harwell-Boeing file.\n"); if ( sscanf(line, "%*3c%i", Nrhs) != 1) *Nrhs = 0; if ( sscanf(line, "%*3c%*i%i", Nrhsix) != 1) *Nrhsix = 0; } return 1; } int readHB_mat_double(const char* filename, int colptr[], int rowind[], double val[]) { /****************************************************************************/ /* This function opens and reads the specified file, interpreting its */ /* contents as a sparse matrix stored in the Harwell/Boeing standard */ /* format and creating compressed column storage scheme vectors to hold */ /* the index and nonzero value information. */ /* */ /* ---------- */ /* **CAVEAT** */ /* ---------- */ /* Parsing real formats from Fortran is tricky, and this file reader */ /* does not claim to be foolproof. It has been tested for cases when */ /* the real values are printed consistently and evenly spaced on each */ /* line, with Fixed (F), and Exponential (E or D) formats. */ /* */ /* ** If the input file does not adhere to the H/B format, the ** */ /* ** results will be unpredictable. ** */ /* */ /****************************************************************************/ FILE *in_file; int i,j,ind,col,offset,count,last,Nrhs,Nrhsix; int Ptrcrd, Indcrd, Valcrd, Rhscrd; int Nrow, Ncol, Nnzero, Nentries; int Ptrperline, Ptrwidth, Indperline, Indwidth; int Valperline, Valwidth, Valprec; int Valflag; /* Indicates 'E','D', or 'F' float format */ char* ThisElement; char Title[73], Key[9], Type[4], Rhstype[4]; char Ptrfmt[17], Indfmt[17], Valfmt[21], Rhsfmt[21]; char line[BUFSIZ]; if ( (in_file = fopen( filename, "r")) == NULL ) { fprintf(stderr,"Error: Cannot open file: %s\n",filename); return 0; } readHB_header(in_file, Title, Key, Type, &Nrow, &Ncol, &Nnzero, &Nrhs, &Nrhsix, Ptrfmt, Indfmt, Valfmt, Rhsfmt, &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); /* Parse the array input formats from Line 3 of HB file */ ParseIfmt(Ptrfmt,&Ptrperline,&Ptrwidth); ParseIfmt(Indfmt,&Indperline,&Indwidth); if ( Type[0] != 'P' ) { /* Skip if pattern only */ ParseRfmt(Valfmt,&Valperline,&Valwidth,&Valprec,&Valflag); } /* Read column pointer array: */ offset = 1-_SP_base; /* if base 0 storage is declared (via macro definition), */ /* then storage entries are offset by 1 */ ThisElement = (char *) malloc(Ptrwidth+1); if ( ThisElement == NULL ) IOHBTerminate("Insufficient memory for ThisElement."); *(ThisElement+Ptrwidth) = (char) NULL; count=0; for (i=0;i Ncol) break; strncpy(ThisElement,line+col,Ptrwidth); /* ThisElement = substr(line,col,Ptrwidth); */ colptr[count] = atoi(ThisElement)-offset; count++; col += Ptrwidth; } } free(ThisElement); /* Read row index array: */ ThisElement = (char *) malloc(Indwidth+1); if ( ThisElement == NULL ) IOHBTerminate("Insufficient memory for ThisElement."); *(ThisElement+Indwidth) = (char) NULL; count = 0; for (i=0;i=0;j--) { ThisElement[j] = ThisElement[j-1]; if ( ThisElement[j] == '+' || ThisElement[j] == '-' ) { ThisElement[j-1] = Valflag; break; } } } val[count] = atof(ThisElement); count++; col += Valwidth; } } free(ThisElement); } fclose(in_file); return 1; } int readHB_newmat_double(const char* filename, int* M, int* N, int* nonzeros, int** colptr, int** rowind, double** val) { int Nrhs; char *Type; readHB_info(filename, M, N, nonzeros, &Type, &Nrhs); *colptr = (int *)malloc((*N+1)*sizeof(int)); if ( *colptr == NULL ) IOHBTerminate("Insufficient memory for colptr.\n"); *rowind = (int *)malloc(*nonzeros*sizeof(int)); if ( *rowind == NULL ) IOHBTerminate("Insufficient memory for rowind.\n"); if ( Type[0] == 'C' ) { /* fprintf(stderr, "Warning: Reading complex data from HB file %s.\n",filename); fprintf(stderr, " Real and imaginary parts will be interlaced in val[].\n"); */ /* Malloc enough space for real AND imaginary parts of val[] */ *val = (double *)malloc(*nonzeros*sizeof(double)*2); if ( *val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); } else { if ( Type[0] != 'P' ) { /* Malloc enough space for real array val[] */ *val = (double *)malloc(*nonzeros*sizeof(double)); if ( *val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); } } /* No val[] space needed if pattern only */ return readHB_mat_double(filename, *colptr, *rowind, *val); } int readHB_aux_double(const char* filename, const char AuxType, double b[]) { /****************************************************************************/ /* This function opens and reads the specified file, placing auxillary */ /* vector(s) of the given type (if available) in b. */ /* Return value is the number of vectors successfully read. */ /* */ /* AuxType = 'F' full right-hand-side vector(s) */ /* AuxType = 'G' initial Guess vector(s) */ /* AuxType = 'X' eXact solution vector(s) */ /* */ /* ---------- */ /* **CAVEAT** */ /* ---------- */ /* Parsing real formats from Fortran is tricky, and this file reader */ /* does not claim to be foolproof. It has been tested for cases when */ /* the real values are printed consistently and evenly spaced on each */ /* line, with Fixed (F), and Exponential (E or D) formats. */ /* */ /* ** If the input file does not adhere to the H/B format, the ** */ /* ** results will be unpredictable. ** */ /* */ /****************************************************************************/ FILE *in_file; int i,j,n,maxcol,start,stride,col,last,linel; int Ptrcrd, Indcrd, Valcrd, Rhscrd; int Nrow, Ncol, Nnzero, Nentries; int Nrhs, Nrhsix, nvecs, rhsi; int Rhsperline, Rhswidth, Rhsprec; int Rhsflag; char *ThisElement; char Title[73], Key[9], Type[4], Rhstype[4]; char Ptrfmt[17], Indfmt[17], Valfmt[21], Rhsfmt[21]; char line[BUFSIZ]; if ((in_file = fopen( filename, "r")) == NULL) { fprintf(stderr,"Error: Cannot open file: %s\n",filename); return 0; } readHB_header(in_file, Title, Key, Type, &Nrow, &Ncol, &Nnzero, &Nrhs, &Nrhsix, Ptrfmt, Indfmt, Valfmt, Rhsfmt, &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); if (Nrhs <= 0) { fprintf(stderr, "Warn: Attempt to read auxillary vector(s) when none are present.\n"); return 0; } if (Rhstype[0] != 'F' ) { fprintf(stderr,"Warn: Attempt to read auxillary vector(s) which are not stored in Full form.\n"); fprintf(stderr," Rhs must be specified as full. \n"); return 0; } /* If reading complex data, allow for interleaved real and imaginary values. */ if ( Type[0] == 'C' ) { Nentries = 2*Nrow; } else { Nentries = Nrow; } nvecs = 1; if ( Rhstype[1] == 'G' ) nvecs++; if ( Rhstype[2] == 'X' ) nvecs++; if ( AuxType == 'G' && Rhstype[1] != 'G' ) { fprintf(stderr, "Warn: Attempt to read auxillary Guess vector(s) when none are present.\n"); return 0; } if ( AuxType == 'X' && Rhstype[2] != 'X' ) { fprintf(stderr, "Warn: Attempt to read auxillary eXact solution vector(s) when none are present.\n"); return 0; } ParseRfmt(Rhsfmt, &Rhsperline, &Rhswidth, &Rhsprec,&Rhsflag); maxcol = Rhsperline*Rhswidth; /* Lines to skip before starting to read RHS values... */ n = Ptrcrd + Indcrd + Valcrd; for (i = 0; i < n; i++) fgets(line, BUFSIZ, in_file); /* start - number of initial aux vector entries to skip */ /* to reach first vector requested */ /* stride - number of aux vector entries to skip between */ /* requested vectors */ if ( AuxType == 'F' ) start = 0; else if ( AuxType == 'G' ) start = Nentries; else start = (nvecs-1)*Nentries; stride = (nvecs-1)*Nentries; fgets(line, BUFSIZ, in_file); linel= strchr(line,'\n')-line; col = 0; /* Skip to initial offset */ for (i=0;i= ( maxcol= ( maxcol=0;j--) { ThisElement[j] = ThisElement[j-1]; if ( ThisElement[j] == '+' || ThisElement[j] == '-' ) { ThisElement[j-1] = Rhsflag; break; } } } b[i] = atof(ThisElement); col += Rhswidth; } /* Skip any interleaved Guess/eXact vectors */ for (i=0;i= ( maxcol 0 ) { if ( Rhsfmt == NULL ) Rhsfmt = Valfmt; ParseRfmt(Rhsfmt,&Rhsperline,&Rhswidth,&Rhsprec, &Rhsflag); if (Rhsflag == 'F') sprintf(rformat,"%% %d.%df",Rhswidth,Rhsprec); else sprintf(rformat,"%% %d.%dE",Rhswidth,Rhsprec); if (Rhsflag == 'D') *strchr(Rhsfmt,'D') = 'E'; rhscrd = nrhsentries/Rhsperline; if ( nrhsentries%Rhsperline != 0) rhscrd++; if ( Rhstype[1] == 'G' ) rhscrd+=rhscrd; if ( Rhstype[2] == 'X' ) rhscrd+=rhscrd; rhscrd*=Nrhs; } else rhscrd = 0; totcrd = 4+ptrcrd+indcrd+valcrd+rhscrd; /* Print header information: */ fprintf(out_file,"%-72s%-8s\n%14d%14d%14d%14d%14d\n",Title, Key, totcrd, ptrcrd, indcrd, valcrd, rhscrd); fprintf(out_file,"%3s%11s%14d%14d%14d\n",Type," ", M, N, nz); fprintf(out_file,"%-16s%-16s%-20s", Ptrfmt, Indfmt, Valfmt); if ( Nrhs != 0 ) { /* Print Rhsfmt on fourth line and */ /* optional fifth header line for auxillary vector information: */ fprintf(out_file,"%-20s\n%-14s%d\n",Rhsfmt,Rhstype,Nrhs); } else fprintf(out_file,"\n"); offset = 1-_SP_base; /* if base 0 storage is declared (via macro definition), */ /* then storage entries are offset by 1 */ /* Print column pointers: */ for (i=0;i 0 ) { for (i=0;i Ncol) break; strncpy(ThisElement,line+col,Ptrwidth); /*ThisElement = substr(line,col,Ptrwidth);*/ colptr[count] = atoi(ThisElement)-offset; count++; col += Ptrwidth; } } free(ThisElement); /* Read row index array: */ ThisElement = (char *) malloc(Indwidth+1); if ( ThisElement == NULL ) IOHBTerminate("Insufficient memory for ThisElement."); *(ThisElement+Indwidth) = (char) NULL; count = 0; for (i=0;i=0;j--) { ThisElement[j] = ThisElement[j-1]; if ( ThisElement[j] == '+' || ThisElement[j] == '-' ) { ThisElement[j-1] = Valflag; break; } } } count++; col += Valwidth; } } } return 1; } int readHB_newmat_char(const char* filename, int* M, int* N, int* nonzeros, int** colptr, int** rowind, char** val, char** Valfmt) { FILE *in_file; int Nrhs,Nrhsix; int Ptrcrd, Indcrd, Valcrd, Rhscrd; int Valperline, Valwidth, Valprec; int Valflag; /* Indicates 'E','D', or 'F' float format */ char Title[73], Key[9], Type[4], Rhstype[4]; char Ptrfmt[17], Indfmt[17], Rhsfmt[21]; if ((in_file = fopen( filename, "r")) == NULL) { fprintf(stderr,"Error: Cannot open file: %s\n",filename); return 0; } *Valfmt = (char *)malloc(21*sizeof(char)); if ( *Valfmt == NULL ) IOHBTerminate("Insufficient memory for Valfmt."); readHB_header(in_file, Title, Key, Type, M, N, nonzeros, &Nrhs, &Nrhsix, Ptrfmt, Indfmt, (*Valfmt), Rhsfmt, &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); fclose(in_file); ParseRfmt(*Valfmt,&Valperline,&Valwidth,&Valprec,&Valflag); *colptr = (int *)malloc((*N+1)*sizeof(int)); if ( *colptr == NULL ) IOHBTerminate("Insufficient memory for colptr.\n"); *rowind = (int *)malloc(*nonzeros*sizeof(int)); if ( *rowind == NULL ) IOHBTerminate("Insufficient memory for rowind.\n"); if ( Type[0] == 'C' ) { /* fprintf(stderr, "Warning: Reading complex data from HB file %s.\n",filename); fprintf(stderr, " Real and imaginary parts will be interlaced in val[].\n"); */ /* Malloc enough space for real AND imaginary parts of val[] */ *val = (char *)malloc(*nonzeros*Valwidth*sizeof(char)*2); if ( *val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); } else { if ( Type[0] != 'P' ) { /* Malloc enough space for real array val[] */ *val = (char *)malloc(*nonzeros*Valwidth*sizeof(char)); if ( *val == NULL ) IOHBTerminate("Insufficient memory for val.\n"); } } /* No val[] space needed if pattern only */ return readHB_mat_char(filename, *colptr, *rowind, *val, *Valfmt); } int readHB_aux_char(const char* filename, const char AuxType, char b[]) { /****************************************************************************/ /* This function opens and reads the specified file, placing auxilary */ /* vector(s) of the given type (if available) in b : */ /* Return value is the number of vectors successfully read. */ /* */ /* AuxType = 'F' full right-hand-side vector(s) */ /* AuxType = 'G' initial Guess vector(s) */ /* AuxType = 'X' eXact solution vector(s) */ /* */ /* ---------- */ /* **CAVEAT** */ /* ---------- */ /* Parsing real formats from Fortran is tricky, and this file reader */ /* does not claim to be foolproof. It has been tested for cases when */ /* the real values are printed consistently and evenly spaced on each */ /* line, with Fixed (F), and Exponential (E or D) formats. */ /* */ /* ** If the input file does not adhere to the H/B format, the ** */ /* ** results will be unpredictable. ** */ /* */ /****************************************************************************/ FILE *in_file; int i,j,n,maxcol,start,stride,col,last,linel,nvecs,rhsi; int Nrow, Ncol, Nnzero, Nentries,Nrhs,Nrhsix; int Ptrcrd, Indcrd, Valcrd, Rhscrd; int Rhsperline, Rhswidth, Rhsprec; int Rhsflag; char Title[73], Key[9], Type[4], Rhstype[4]; char Ptrfmt[17], Indfmt[17], Valfmt[21], Rhsfmt[21]; char line[BUFSIZ]; char *ThisElement; if ((in_file = fopen( filename, "r")) == NULL) { fprintf(stderr,"Error: Cannot open file: %s\n",filename); return 0; } readHB_header(in_file, Title, Key, Type, &Nrow, &Ncol, &Nnzero, &Nrhs, &Nrhsix, Ptrfmt, Indfmt, Valfmt, Rhsfmt, &Ptrcrd, &Indcrd, &Valcrd, &Rhscrd, Rhstype); if (Nrhs <= 0) { fprintf(stderr, "Warn: Attempt to read auxillary vector(s) when none are present.\n"); return 0; } if (Rhstype[0] != 'F' ) { fprintf(stderr,"Warn: Attempt to read auxillary vector(s) which are not stored in Full form.\n"); fprintf(stderr," Rhs must be specified as full. \n"); return 0; } /* If reading complex data, allow for interleaved real and imaginary values. */ if ( Type[0] == 'C' ) { Nentries = 2*Nrow; } else { Nentries = Nrow; } nvecs = 1; if ( Rhstype[1] == 'G' ) nvecs++; if ( Rhstype[2] == 'X' ) nvecs++; if ( AuxType == 'G' && Rhstype[1] != 'G' ) { fprintf(stderr, "Warn: Attempt to read auxillary Guess vector(s) when none are present.\n"); return 0; } if ( AuxType == 'X' && Rhstype[2] != 'X' ) { fprintf(stderr, "Warn: Attempt to read auxillary eXact solution vector(s) when none are present.\n"); return 0; } ParseRfmt(Rhsfmt, &Rhsperline, &Rhswidth, &Rhsprec,&Rhsflag); maxcol = Rhsperline*Rhswidth; /* Lines to skip before starting to read RHS values... */ n = Ptrcrd + Indcrd + Valcrd; for (i = 0; i < n; i++) fgets(line, BUFSIZ, in_file); /* start - number of initial aux vector entries to skip */ /* to reach first vector requested */ /* stride - number of aux vector entries to skip between */ /* requested vectors */ if ( AuxType == 'F' ) start = 0; else if ( AuxType == 'G' ) start = Nentries; else start = (nvecs-1)*Nentries; stride = (nvecs-1)*Nentries; fgets(line, BUFSIZ, in_file); linel= strchr(line,'\n')-line; if ( sscanf(line,"%*s") < 0 ) IOHBTerminate("iohb.c: Null (or blank) line in auxillary vector data region of HB file.\n"); col = 0; /* Skip to initial offset */ for (i=0;i= ( maxcol= ( maxcol=0;j--) { ThisElement[j] = ThisElement[j-1]; if ( ThisElement[j] == '+' || ThisElement[j] == '-' ) { ThisElement[j-1] = Rhsflag; break; } } } col += Rhswidth; } b+=Nentries*Rhswidth; /* Skip any interleaved Guess/eXact vectors */ for (i=0;i= ( maxcol 0 ) { if ( Rhsfmt == NULL ) Rhsfmt = Valfmt; ParseRfmt(Rhsfmt,&Rhsperline,&Rhswidth,&Rhsprec, &Rhsflag); sprintf(rformat,"%%%ds",Rhswidth); rhscrd = nrhsentries/Rhsperline; if ( nrhsentries%Rhsperline != 0) rhscrd++; if ( Rhstype[1] == 'G' ) rhscrd+=rhscrd; if ( Rhstype[2] == 'X' ) rhscrd+=rhscrd; rhscrd*=Nrhs; } else rhscrd = 0; totcrd = 4+ptrcrd+indcrd+valcrd+rhscrd; /* Print header information: */ fprintf(out_file,"%-72s%-8s\n%14d%14d%14d%14d%14d\n",Title, Key, totcrd, ptrcrd, indcrd, valcrd, rhscrd); fprintf(out_file,"%3s%11s%14d%14d%14d\n",Type," ", M, N, nz); fprintf(out_file,"%-16s%-16s%-20s", Ptrfmt, Indfmt, Valfmt); if ( Nrhs != 0 ) { /* Print Rhsfmt on fourth line and */ /* optional fifth header line for auxillary vector information: */ fprintf(out_file,"%-20s\n%-14s%d\n",Rhsfmt,Rhstype,Nrhs); } else fprintf(out_file,"\n"); offset = 1-_SP_base; /* if base 0 storage is declared (via macro definition), */ /* then storage entries are offset by 1 */ /* Print column pointers: */ for (i=0;i 0 ) { for (j=0;j void upcase(char* S) { /* Convert S to uppercase */ int i,len; len = strlen(S); for (i=0;i< len;i++) S[i] = toupper(S[i]); } void IOHBTerminate(char* message) { fprintf(stderr,message); exit(1); } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/hbio.h100666 0 0 5166 11141443433 16031 0ustar usergroup#ifndef IOHB_H #define IOHB_H #include #include #include #ifdef __cplusplus extern "C" { #endif int readHB_info(const char* filename, int* M, int* N, int* nz, char** Type, int* Nrhs); int readHB_header(FILE* in_file, char* Title, char* Key, char* Type, int* Nrow, int* Ncol, int* Nnzero, int* Nrhs, int* Nrhsix, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, int* Ptrcrd, int* Indcrd, int* Valcrd, int* Rhscrd, char *Rhstype); int readHB_mat_double(const char* filename, int colptr[], int rowind[], double val[]); int readHB_newmat_double(const char* filename, int* M, int* N, int* nonzeros, int** colptr, int** rowind, double** val); int readHB_aux_double(const char* filename, const char AuxType, double b[]); int readHB_newaux_double(const char* filename, const char AuxType, double** b); int writeHB_mat_double(const char* filename, int M, int N, int nz, const int colptr[], const int rowind[], const double val[], int Nrhs, const double rhs[], const double guess[], const double exact[], const char* Title, const char* Key, const char* Type, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, const char* Rhstype); int readHB_mat_char(const char* filename, int colptr[], int rowind[], char val[], char* Valfmt); int readHB_newmat_char(const char* filename, int* M, int* N, int* nonzeros, int** colptr, int** rowind, char** val, char** Valfmt); int readHB_aux_char(const char* filename, const char AuxType, char b[]); int readHB_newaux_char(const char* filename, const char AuxType, char** b, char** Rhsfmt); int writeHB_mat_char(const char* filename, int M, int N, int nz, const int colptr[], const int rowind[], const char val[], int Nrhs, const char rhs[], const char guess[], const char exact[], const char* Title, const char* Key, const char* Type, char* Ptrfmt, char* Indfmt, char* Valfmt, char* Rhsfmt, const char* Rhstype); int ParseIfmt(char* fmt, int* perline, int* width); int ParseRfmt(char* fmt, int* perline, int* width, int* prec, int* flag); void IOHBTerminate(char* message); #ifdef __cplusplus } #endif #endif lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/LUSOL-overview.txt100666 0 0 12623 11141374613 20261 0ustar usergroup Notes for Contribution of LUSOL to COIN-OR May 2004 Introduction ============ LUSOL maintains sparse LU factors of a square or rectangular sparse matrix. It includes a Basis Factorization Package (BFP) suitable for implementing simplex and reduced-gradient methods for optimization. It is a set of routines written in ANSI C (adapted from the original Fortran 77 version). LUSOL includes the following features: - A Markowitz-based sparse LU factorization for square, rectangular and possibly singular matrices. - Three options for balancing sparsity and stability: Threshold Partial/Rook/Complete Pivoting (TPP, TRP, TCP). - Rank-revealing properties. TRP and TCP are intended for detecting singularities. - Dynamic storage allocation (C version only). - Stable column replacement as in the method of Bartels and Golub. - Other stable updates: add, replace, or delete row or column (currently F77 version only). - Implementation into an easy-to-use BFP API (C version only). Implementation ============== The Factor routine is similar to the classical Markowitz routines MA28 and LA05 in the Harwell Subroutine Library. The source matrix nonzeros are stored column-wise with the largest entry at the top of each column. Internally, the structure is also accessible row-wise. All entries in a particular column or row are held in contiguous storage. Fill is accommodated by moving a column or row to the beginning of free storage. Occasional compressions recover storage. This scheme is effective for column-oriented TPP. When the remaining matrix reaches a specified density, the factors are completed using dense processing. TRP uses an additional vector of storage to maintain the largest element in each remaining row. TCP uses a heap structure to hold the largest element in each column. The largest element in the remaining matrix is then available at the top of the heap. The final L is stored column-wise (and never changed). The final U is stored row-wise as a triangular or trapezoidal sparse matrix. Column replacements are implemented using a forward sweep of 2-by-2 stabilized elimination matrices. L is updated in product form. U is updated explicitly. The other updates use either forward or backward sweeps. They tend to generate more nonzeros than column replacement. Both the F77 and C versions contain extensive comments, method and implementational information as part of the code. The C version contains a record-based wrapper for the data. Function calls have been simplified by including references to this structure. New maintenance routines enable dynamic instance creation and destruction, and simplifies access to the most frequently used functions. The LUSOL C library is multi-instance and fully re-entrant. All control and output parameters have been given long descriptive names for usability. Benefits ======== Rank-revealing properties and rectangular factors (and updates) have not previously been available in sparse LU software. With sensible parameter settings and reasonably scaled data, all routines are numerically stable. The updates may be called hundreds of times, and the decision to refactorize can be based on sparsity considerations alone. In the Factor routine, rook pivoting (TRP) gives reliable rank determination without catastrophic degradation in sparsity or speed. Complete pivoting (TCP) is included for moderate-sized matrices and for checking pathological cases (but the factors tend to be substantially more dense). To conserve storage, one may request only the row and column pivot orders. The factors are discarded as they are computed. This is useful for basis repair, or for selecting a basis from a rectangular matrix. Known Inefficiencies ==================== LUSOL is usually efficient on sparse matrices with dimensions up to about 100,000 (but not millions). In the Factor routine, row and column lists must be updated each time a row and column is eliminated. Deleting the pivot row and column is inefficient if the original matrix contains unusually dense rows or columns. For TPP, dense columns could be kept aside and incorporated at the end via updates (but dense rows remain a difficulty). For TRP and TCP, all rows and columns must be present to achieve the required numerical properties. For TRP, the current bottleneck is updating the vector containing the largest element in each row. One solution would be to include the matrix nonzeros in the row structure (but this carries its own cost). For TCP, the heap structure is already efficient, but the dense factors (and the extended searching for acceptable pivots) are unavoidable expenses. The triangular Solve routines do not take full of advantage of sparse right-hand sides. Gilbert and Peierls have shown how to solve Lx = (sparse b) efficiently if L is stored column-wise. Their approach could therefore be implemented in LUSOL for solves with L and U(transpose). Solves with L(transpose) and U would need a second copy of L and U. Original Reference ================== P. E. Gill, W. Murray, M. A. Saunders and M. H. Wright, Maintaining LU factors of a general sparse matrix, Linear Algebra and its Applications 88/89, 239-270 (1987). Maintainers =========== F77 version: Michael Saunders (saunders@stanford.edu). C version: Kjell Eikland (kjell.eikland@broadpark.no). Contributors ============ Philip Gill, Walter Murray, Margaret Wright, Michael O'Sullivan. lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol.c100666 0 0 60541 11141443433 16257 0ustar usergroup /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ LUSOL routines from the Stanford Optimization Laboratory The parts included are: lusol1 Factor a given matrix A from scratch (lu1fac). lusol2 Heap-management routines for lu1fac. lusol6 Solve with the current LU factors. lusol7 Utilities for all update routines. lusol8 Replace a column (Bartels-Golub update). ------------------------------------------------------------------ 26 Apr 2002: TCP implemented using heap data structure. 01 May 2002: lu1DCP implemented. 07 May 2002: lu1mxc must put 0.0 at top of empty columns. 09 May 2002: lu1mCP implements Markowitz with cols searched in heap order. Often faster (searching 20 or 40 cols) but more dense. 11 Jun 2002: TRP implemented. lu1mRP implements Markowitz with Threshold Rook Pivoting. lu1mxc maintains max col elements (was lu1max.) lu1mxr maintains max row elements. 12 Jun 2002: lu1mCP seems too slow on big problems (e.g. memplus). Disabled it for the moment. (Use lu1mar + TCP.) 14 Dec 2002: TSP implemented. lu1mSP implements Markowitz with TSP. 07 Mar 2003: character*1, character*2 changed to f90 form. Comments changed from * in column to ! in column 1. Comments kept within column 72 to avoid compiler warning. 06 Mar 2004: Translation to C by Kjell Eikland with the addition of data wrappers, parametric constants, various helper routines, and dynamic memory reallocation. 26 May 2004: Added LUSOL_IP_UPDATELIMIT parameter and provided for dynamic memory expansion based on possible forward requirements. 08 Jul 2004: Revised logic in lu6chk based on new code from Michael Saunders. 01 Dec 2005: Add support for CMEX interface (disable by undef MATLAB) Also include various bug fixes (disable by undef YZHANG) Yin Zhang 01 Jan 2006: Added storage of singular indeces, not only the last. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ #include #include #include #include #include #include #include "lusol.h" #include "myblas.h" #ifdef MATLAB #include "mex.h" #endif /* LUSOL Object creation and destruction */ void *clean_realloc(void *oldptr, int width, int newsize, int oldsize) { newsize *= width; oldsize *= width; oldptr = LUSOL_REALLOC(oldptr, newsize); if(newsize > oldsize) /* MEMCLEAR(oldptr+oldsize, newsize-oldsize); */ memset((char *)oldptr+oldsize, '\0', newsize-oldsize); return(oldptr); } MYBOOL LUSOL_realloc_a(LUSOLrec *LUSOL, int newsize) { int oldsize; if(newsize < 0) newsize = LUSOL->lena + MAX(abs(newsize), LUSOL_MINDELTA_a); oldsize = LUSOL->lena; LUSOL->lena = newsize; if(newsize > 0) newsize++; if(oldsize > 0) oldsize++; LUSOL->a = (REAL *) clean_realloc(LUSOL->a, sizeof(*(LUSOL->a)), newsize, oldsize); LUSOL->indc = (int *) clean_realloc(LUSOL->indc, sizeof(*(LUSOL->indc)), newsize, oldsize); LUSOL->indr = (int *) clean_realloc(LUSOL->indr, sizeof(*(LUSOL->indr)), newsize, oldsize); if((newsize == 0) || ((LUSOL->a != NULL) && (LUSOL->indc != NULL) && (LUSOL->indr != NULL))) return( TRUE ); else return( FALSE ); } MYBOOL LUSOL_expand_a(LUSOLrec *LUSOL, int *delta_lena, int *right_shift) { #ifdef StaticMemAlloc return( FALSE ); #else int LENA, NFREE, LFREE; /* Add expansion factor to avoid having to resize too often/too much; (exponential formula suggested by Michael A. Saunders) */ LENA = LUSOL->lena; *delta_lena = DELTA_SIZE(*delta_lena, LENA); /* Expand it! */ if((*delta_lena <= 0) || !LUSOL_realloc_a(LUSOL, LENA+(*delta_lena))) return( FALSE ); /* Make sure we return the actual memory increase of a */ *delta_lena = LUSOL->lena-LENA; /* Shift the used memory area to the right */ LFREE = *right_shift; NFREE = LFREE+*delta_lena; LENA -= LFREE-1; MEMMOVE(LUSOL->a+NFREE, LUSOL->a+LFREE, LENA); MEMMOVE(LUSOL->indr+NFREE, LUSOL->indr+LFREE, LENA); MEMMOVE(LUSOL->indc+NFREE, LUSOL->indc+LFREE, LENA); /* Also return the new starting position for the used memory area of a */ *right_shift = NFREE; LUSOL->expanded_a++; return( TRUE ); #endif } MYBOOL LUSOL_realloc_r(LUSOLrec *LUSOL, int newsize) { int oldsize; if(newsize < 0) newsize = LUSOL->maxm + MAX(abs(newsize), LUSOL_MINDELTA_rc); oldsize = LUSOL->maxm; LUSOL->maxm = newsize; if(newsize > 0) newsize++; if(oldsize > 0) oldsize++; LUSOL->lenr = (int *) clean_realloc(LUSOL->lenr, sizeof(*(LUSOL->lenr)), newsize, oldsize); LUSOL->ip = (int *) clean_realloc(LUSOL->ip, sizeof(*(LUSOL->ip)), newsize, oldsize); LUSOL->iqloc = (int *) clean_realloc(LUSOL->iqloc, sizeof(*(LUSOL->iqloc)), newsize, oldsize); LUSOL->ipinv = (int *) clean_realloc(LUSOL->ipinv, sizeof(*(LUSOL->ipinv)), newsize, oldsize); LUSOL->locr = (int *) clean_realloc(LUSOL->locr, sizeof(*(LUSOL->locr)), newsize, oldsize); if((newsize == 0) || ((LUSOL->lenr != NULL) && (LUSOL->ip != NULL) && (LUSOL->iqloc != NULL) && (LUSOL->ipinv != NULL) && (LUSOL->locr != NULL))) { #ifndef ClassicHamaxR #ifdef AlwaysSeparateHamaxR if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TRP) #endif { LUSOL->amaxr = (REAL *) clean_realloc(LUSOL->amaxr, sizeof(*(LUSOL->amaxr)), newsize, oldsize); if((newsize > 0) && (LUSOL->amaxr == NULL)) return( FALSE ); } #endif return( TRUE ); } else return( FALSE ); } MYBOOL LUSOL_realloc_c(LUSOLrec *LUSOL, int newsize) { int oldsize; if(newsize < 0) newsize = LUSOL->maxn + MAX(abs(newsize), LUSOL_MINDELTA_rc); oldsize = LUSOL->maxn; LUSOL->maxn = newsize; if(newsize > 0) newsize++; if(oldsize > 0) oldsize++; LUSOL->lenc = (int *) clean_realloc(LUSOL->lenc, sizeof(*(LUSOL->lenc)), newsize, oldsize); LUSOL->iq = (int *) clean_realloc(LUSOL->iq, sizeof(*(LUSOL->iq)), newsize, oldsize); LUSOL->iploc = (int *) clean_realloc(LUSOL->iploc, sizeof(*(LUSOL->iploc)), newsize, oldsize); LUSOL->iqinv = (int *) clean_realloc(LUSOL->iqinv, sizeof(*(LUSOL->iqinv)), newsize, oldsize); LUSOL->locc = (int *) clean_realloc(LUSOL->locc, sizeof(*(LUSOL->locc)), newsize, oldsize); LUSOL->w = (REAL *) clean_realloc(LUSOL->w, sizeof(*(LUSOL->w)), newsize, oldsize); #ifdef LUSOLSafeFastUpdate LUSOL->vLU6L = (REAL *) clean_realloc(LUSOL->vLU6L, sizeof(*(LUSOL->vLU6L)), newsize, oldsize); #else LUSOL->vLU6L = LUSOL->w; #endif if((newsize == 0) || ((LUSOL->w != NULL) && (LUSOL->lenc != NULL) && (LUSOL->iq != NULL) && (LUSOL->iploc != NULL) && (LUSOL->iqinv != NULL) && (LUSOL->locc != NULL))) { #ifndef ClassicHamaxR if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TCP) { LUSOL->Ha = (REAL *) clean_realloc(LUSOL->Ha, sizeof(*(LUSOL->Ha)), newsize, oldsize); LUSOL->Hj = (int *) clean_realloc(LUSOL->Hj, sizeof(*(LUSOL->Hj)), newsize, oldsize); LUSOL->Hk = (int *) clean_realloc(LUSOL->Hk, sizeof(*(LUSOL->Hk)), newsize, oldsize); if((newsize > 0) && ((LUSOL->Ha == NULL) || (LUSOL->Hj == NULL) || (LUSOL->Hk == NULL))) return( FALSE ); } #endif #ifndef ClassicdiagU if(LUSOL->luparm[LUSOL_IP_KEEPLU] == FALSE) { LUSOL->diagU = (REAL *) clean_realloc(LUSOL->diagU, sizeof(*(LUSOL->diagU)), newsize, oldsize); if((newsize > 0) && (LUSOL->diagU == NULL)) return( FALSE ); } #endif return( TRUE ); } else return( FALSE ); } LUSOLrec *LUSOL_create(FILE *outstream, int msgfil, int pivotmodel, int updatelimit) { LUSOLrec *newLU; newLU = (LUSOLrec *) LUSOL_CALLOC(1, sizeof(*newLU)); if(newLU == NULL) return( newLU ); newLU->luparm[LUSOL_IP_SCALAR_NZA] = LUSOL_MULT_nz_a; newLU->outstream = outstream; newLU->luparm[LUSOL_IP_PRINTUNIT] = msgfil; newLU->luparm[LUSOL_IP_PRINTLEVEL] = LUSOL_MSG_SINGULARITY; LUSOL_setpivotmodel(newLU, pivotmodel, LUSOL_PIVTOL_DEFAULT); newLU->parmlu[LUSOL_RP_GAMMA] = LUSOL_DEFAULT_GAMMA; newLU->parmlu[LUSOL_RP_ZEROTOLERANCE] = 3.0e-13; newLU->parmlu[LUSOL_RP_SMALLDIAG_U] = /*3.7e-11;*/ newLU->parmlu[LUSOL_RP_EPSDIAG_U] = 3.7e-11; newLU->parmlu[LUSOL_RP_COMPSPACE_U] = 3.0e+0; newLU->luparm[LUSOL_IP_MARKOWITZ_MAXCOL] = 5; newLU->parmlu[LUSOL_RP_MARKOWITZ_CONLY] = 0.3e+0; newLU->parmlu[LUSOL_RP_MARKOWITZ_DENSE] = 0.5e+0; newLU->parmlu[LUSOL_RP_SMARTRATIO] = LUSOL_DEFAULT_SMARTRATIO; #ifdef ForceRowBasedL0 newLU->luparm[LUSOL_IP_ACCELERATION] = LUSOL_BASEORDER; #endif newLU->luparm[LUSOL_IP_KEEPLU] = TRUE; newLU->luparm[LUSOL_IP_UPDATELIMIT] = updatelimit; init_BLAS(); return( newLU ); } MYBOOL LUSOL_sizeto(LUSOLrec *LUSOL, int init_r, int init_c, int init_a) { if(init_c == 0) LUSOL_FREE(LUSOL->isingular); if(LUSOL_realloc_a(LUSOL, init_a) && LUSOL_realloc_r(LUSOL, init_r) && LUSOL_realloc_c(LUSOL, init_c)) return( TRUE ); else return( FALSE ); } char *LUSOL_pivotLabel(LUSOLrec *LUSOL) { static /*const*/ char *pivotText[LUSOL_PIVMOD_MAX+1] = {"TPP", "TRP", "TCP", "TSP"}; return(pivotText[LUSOL->luparm[LUSOL_IP_PIVOTTYPE]]); } void LUSOL_setpivotmodel(LUSOLrec *LUSOL, int pivotmodel, int initlevel) { REAL newFM, newUM; /* Set pivotmodel if specified */ if(pivotmodel > LUSOL_PIVMOD_NOCHANGE) { if((pivotmodel <= LUSOL_PIVMOD_DEFAULT) || (pivotmodel > LUSOL_PIVMOD_MAX)) pivotmodel = LUSOL_PIVMOD_TPP; LUSOL->luparm[LUSOL_IP_PIVOTTYPE] = pivotmodel; } /* Check if we need bother about changing tolerances */ if((initlevel <= LUSOL_PIVTOL_NOCHANGE) || (initlevel > LUSOL_PIVTOL_MAX)) return; /* Set default pivot tolerances (note that UPDATEMAX should always be <= FACTORMAX) */ if(initlevel == LUSOL_PIVTOL_BAGGY) { /* Extra-loose pivot thresholds */ newFM = 500.0; newUM = newFM / 20; } else if(initlevel == LUSOL_PIVTOL_LOOSE) { /* Moderately tight pivot tolerances */ newFM = 100.0; newUM = newFM / 10; } else if(initlevel == LUSOL_PIVTOL_NORMAL) { /* Standard pivot tolerances */ newFM = 28.0; newUM = newFM / 4; } else if(initlevel == LUSOL_PIVTOL_SLIM) { /* Better accuracy pivot tolerances */ newFM = 10.0; newUM = newFM / 2; } else if(initlevel == LUSOL_PIVTOL_TIGHT) { /* Enhanced accuracy pivot tolerances */ newFM = 5.0; newUM = newFM / 2; } else if(initlevel == LUSOL_PIVTOL_SUPER) { /* Very tight pivot tolerances for extra accuracy */ newFM = 2.5; newUM = 1.99; } else { /* Extremely tight pivot tolerances for extra accuracy */ newFM = 1.99; newUM = newFM / 1.49; } /* Set the tolerances */ LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = newFM; LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij] = newUM; } MYBOOL LUSOL_tightenpivot(LUSOLrec *LUSOL) { #if 0 REAL newvalue; #endif /* Give up tightening if we are already less than limit and we cannot change strategy */ if(MIN(LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij], LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij]) < 1.1) { if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] >= LUSOL_PIVMOD_TRP) return( FALSE ); LUSOL_setpivotmodel(LUSOL, LUSOL->luparm[LUSOL_IP_PIVOTTYPE]+1, LUSOL_PIVTOL_DEFAULT+1); return( 2 ); } /* Otherwise tighten according to defined schedule */ #if 0 /* This is Michael Saunder's proposed tightening procedure */ newvalue = sqrt(LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]); LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = newvalue; SETMIN(LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij], newvalue); #elif 0 /* This is Kjell Eikland's schedule #1 */ newvalue = sqrt(LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]); LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = newvalue; LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij] = 1.0 + (newvalue - 1.0) / 2; #else /* This was Kjell Eikland's schedule #2 */ LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = 1.0 + LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]/3.0; LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij] = 1.0 + LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij]/3.0; #endif return( TRUE ); } MYBOOL LUSOL_addSingularity(LUSOLrec *LUSOL, int singcol, int *inform) { int NSING = LUSOL->luparm[LUSOL_IP_SINGULARITIES], ASING = LUSOL->luparm[LUSOL_IP_SINGULARLISTSIZE]; /* Check if we need to allocated list memory to store multiple singularities */ if((NSING > 0) && (NSING >= ASING)) { /* Increase list in "reasonable" steps */ ASING += (int) (10.0 * (log10((REAL) LUSOL->m)+1.0)); LUSOL->isingular = (int *) LUSOL_REALLOC(LUSOL->isingular, sizeof(*LUSOL->isingular)*(ASING+1)); if(LUSOL->isingular == NULL) { LUSOL->luparm[LUSOL_IP_SINGULARLISTSIZE] = 0; *inform = LUSOL_INFORM_NOMEMLEFT; return( FALSE ); } LUSOL->luparm[LUSOL_IP_SINGULARLISTSIZE] = ASING; /* Transfer the first singularity if the list was just created */ if(NSING == 1) LUSOL->isingular[NSING] = LUSOL->luparm[LUSOL_IP_SINGULARINDEX]; } /* Update singularity count and store its index */ NSING++; if(NSING > 1) { LUSOL->isingular[0] = NSING; LUSOL->isingular[NSING] = singcol; } LUSOL->luparm[LUSOL_IP_SINGULARITIES] = NSING; /* Mimic old logic by keeping the last singularity stored */ LUSOL->luparm[LUSOL_IP_SINGULARINDEX] = singcol; return( TRUE ); } int LUSOL_getSingularity(LUSOLrec *LUSOL, int singitem) { if((singitem > LUSOL->luparm[LUSOL_IP_SINGULARITIES]) || (singitem < 0)) singitem = -1; else if(singitem == 0) singitem = LUSOL->luparm[LUSOL_IP_SINGULARITIES]; else if(singitem > 1) singitem = LUSOL->isingular[singitem]; else singitem = LUSOL->luparm[LUSOL_IP_SINGULARINDEX]; return( singitem ); } int LUSOL_findSingularityPosition(LUSOLrec *LUSOL, int singcol) /* The purpose of this routine is to find the slack row/column in user-index that was singular in the last unsuccessful column update; zero is returned if the search was unsuccessful. By adding a slack at this position this particular singularity should disappear. (Source: Michael A. Saunders; private communication to KE) */ { #if 0 /* Michael Saunders version */ int j; for(j = LUSOL->m; j > 0; j--) if(LUSOL->iq[j] == singcol) break; singcol = j; #else /* Kjell Eikland version (note that iqinv could be invalid in early versions of LUSOL) */ singcol = LUSOL->iqinv[singcol]; #endif return( LUSOL->ip[singcol] ); } char *LUSOL_informstr(LUSOLrec *LUSOL, int inform) { static char *informText[LUSOL_INFORM_MAX-LUSOL_INFORM_MIN+1] = {"LUSOL_RANKLOSS: Lost rank", "LUSOL_LUSUCCESS: Success", "LUSOL_LUSINGULAR: Singular A", "LUSOL_LUUNSTABLE: Unstable factorization", "LUSOL_ADIMERR: Row or column count exceeded", "LUSOL_ADUPLICATE: Duplicate A matrix entry found", "(Undefined message)", "(Undefined message)", "LUSOL_ANEEDMEM: Insufficient memory for factorization", "LUSOL_FATALERR: Fatal internal error", "LUSOL_NOPIVOT: Found no suitable pivot", "LUSOL_NOMEMLEFT: Could not obtain more memory"}; if((inform < LUSOL_INFORM_MIN) || (inform > LUSOL_INFORM_MAX)) inform = LUSOL->luparm[LUSOL_IP_INFORM]; return(informText[inform-LUSOL_INFORM_MIN]); } void LUSOL_clear(LUSOLrec *LUSOL, MYBOOL nzonly) { int len; LUSOL->nelem = 0; if(!nzonly) { /* lena arrays */ len = LUSOL->lena + LUSOL_ARRAYOFFSET; MEMCLEAR(LUSOL->a, len); MEMCLEAR(LUSOL->indc, len); MEMCLEAR(LUSOL->indr, len); /* maxm arrays */ len = LUSOL->maxm + LUSOL_ARRAYOFFSET; MEMCLEAR(LUSOL->lenr, len); MEMCLEAR(LUSOL->ip, len); MEMCLEAR(LUSOL->iqloc, len); MEMCLEAR(LUSOL->ipinv, len); MEMCLEAR(LUSOL->locr, len); #ifndef ClassicHamaxR if((LUSOL->amaxr != NULL) #ifdef AlwaysSeparateHamaxR && (LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TRP) #endif ) MEMCLEAR(LUSOL->amaxr, len); #endif /* maxn arrays */ len = LUSOL->maxn + LUSOL_ARRAYOFFSET; MEMCLEAR(LUSOL->lenc, len); MEMCLEAR(LUSOL->iq, len); MEMCLEAR(LUSOL->iploc, len); MEMCLEAR(LUSOL->iqinv, len); MEMCLEAR(LUSOL->locc, len); MEMCLEAR(LUSOL->w, len); if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TCP) { MEMCLEAR(LUSOL->Ha, len); MEMCLEAR(LUSOL->Hj, len); MEMCLEAR(LUSOL->Hk, len); } #ifndef ClassicdiagU if(LUSOL->luparm[LUSOL_IP_KEEPLU] == FALSE) { MEMCLEAR(LUSOL->diagU, len); } #endif } } MYBOOL LUSOL_assign(LUSOLrec *LUSOL, int iA[], int jA[], REAL Aij[], int nzcount, MYBOOL istriplet) { int k, m, n, ij, kol; /* Adjust the size of the a structure */ if(nzcount > (LUSOL->lena/LUSOL->luparm[LUSOL_IP_SCALAR_NZA]) && !LUSOL_realloc_a(LUSOL, nzcount*LUSOL->luparm[LUSOL_IP_SCALAR_NZA])) return( FALSE ); m = 0; n = 0; kol = 1; for(k = 1; k <= nzcount; k++) { /* First the row indicator */ ij = iA[k]; if(ij > m) { m = ij; if(m > LUSOL->maxm && !LUSOL_realloc_r(LUSOL, -(m / LUSOL_MINDELTA_FACTOR + 1))) return( FALSE ); } LUSOL->indc[k] = ij; /* Then the column indicator; Handle both triplet and column count formats */ if(istriplet) ij = jA[k]; else { if(k >= jA[kol]) kol++; ij = kol; } if(ij > n) { n = ij; if(n > LUSOL->maxn && !LUSOL_realloc_c(LUSOL, -(n / LUSOL_MINDELTA_FACTOR + 1))) return( FALSE ); } LUSOL->indr[k] = ij; /* Lastly the matrix value itself */ LUSOL->a[k] = Aij[k]; } LUSOL->m = m; LUSOL->n = n; LUSOL->nelem = nzcount; return( TRUE ); } int LUSOL_loadColumn(LUSOLrec *LUSOL, int iA[], int jA, REAL Aij[], int nzcount, int offset1) { int i, ii, nz, k; nz = LUSOL->nelem; i = nz + nzcount; if(i > (LUSOL->lena/LUSOL->luparm[LUSOL_IP_SCALAR_NZA]) && !LUSOL_realloc_a(LUSOL, i*LUSOL->luparm[LUSOL_IP_SCALAR_NZA])) return( -1 ); k = 0; for(ii = 1; ii <= nzcount; ii++) { i = ii + offset1; if(Aij[i] == 0) continue; if(iA[i] <= 0 || iA[i] > LUSOL->m || jA <= 0 || jA > LUSOL->n) { LUSOL_report(LUSOL, 0, "Variable index outside of set bounds (r:%d/%d, c:%d/%d)\n", iA[i], LUSOL->m, jA, LUSOL->n); continue; } k++; nz++; LUSOL->a[nz] = Aij[i]; LUSOL->indc[nz] = iA[i]; LUSOL->indr[nz] = jA; } LUSOL->nelem = nz; return( k ); } void LUSOL_free(LUSOLrec *LUSOL) { LUSOL_realloc_a(LUSOL, 0); LUSOL_realloc_r(LUSOL, 0); LUSOL_realloc_c(LUSOL, 0); if(LUSOL->L0 != NULL) LUSOL_matfree(&(LUSOL->L0)); if(LUSOL->U != NULL) LUSOL_matfree(&(LUSOL->U)); if(!is_nativeBLAS()) unload_BLAS(); LUSOL_FREE(LUSOL); } void LUSOL_report(LUSOLrec *LUSOL, int msglevel, char *format, ...) { va_list ap; if(LUSOL == NULL) { va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); } else if(msglevel >= 0 /*LUSOL->luparm[2]*/) { if(LUSOL->writelog != NULL) { char buff[255]; va_start(ap, format); vsprintf(buff, format, ap); va_end(ap); LUSOL->writelog(LUSOL, LUSOL->loghandle, buff); } if(LUSOL->outstream != NULL) { va_start(ap, format); vfprintf(LUSOL->outstream, format, ap); va_end(ap); fflush(LUSOL->outstream); } } } void LUSOL_timer(LUSOLrec *LUSOL, int timerid, char *text) { LUSOL_report(LUSOL, -1, "TimerID %d at %s - %s\n", timerid, "", text); } int LUSOL_factorize(LUSOLrec *LUSOL) { int inform; LU1FAC( LUSOL, &inform ); return( inform ); } int LUSOL_ftran(LUSOLrec *LUSOL, REAL b[], int NZidx[], MYBOOL prepareupdate) { int inform; REAL *vector; if(prepareupdate) vector = LUSOL->vLU6L; else vector = LUSOL->w; /* Copy RHS vector, but make adjustment for offset since this can create a memory error when the calling program uses a 0-base vector offset back to comply with LUSOL. */ MEMCOPY(vector+1, b+1, LUSOL->n); vector[0] = 0; LU6SOL(LUSOL, LUSOL_SOLVE_Aw_v, vector, b, NZidx, &inform); LUSOL->luparm[LUSOL_IP_FTRANCOUNT]++; return(inform); } int LUSOL_btran(LUSOLrec *LUSOL, REAL b[], int NZidx[]) { int inform; /* Copy RHS vector, but make adjustment for offset since this can create a memory error when the calling program uses a 0-base vector offset back to comply with LUSOL. */ MEMCOPY(LUSOL->w+1, b+1, LUSOL->m); LUSOL->w[0] = 0; LU6SOL(LUSOL, LUSOL_SOLVE_Atv_w, b, LUSOL->w, NZidx, &inform); LUSOL->luparm[LUSOL_IP_BTRANCOUNT]++; return(inform); } int LUSOL_replaceColumn(LUSOLrec *LUSOL, int jcol, REAL v[]) { int inform; REAL DIAG, VNORM; LU8RPC(LUSOL, LUSOL_UPDATE_OLDNONEMPTY, LUSOL_UPDATE_NEWNONEMPTY, jcol, v, NULL, &inform, &DIAG, &VNORM); LUSOL->replaced_c++; return( inform ); } REAL LUSOL_vecdensity(LUSOLrec *LUSOL, REAL V[]) { int I, N = 0; for(I = 1; I <= LUSOL->m; I++) if(fabs(V[I]) > 0) N++; return( (REAL) N / (REAL) LUSOL->m ); } char relationChar(REAL left, REAL right) { if(left > right) return('>'); else if(left == right) return('='); else return('<'); } /* Retrieve the core modules ordered by order of dependency */ #include "lusol2.c" /* Heap management */ #include "lusol6a.c" /* Singularity checking and equation solving */ #include "lusol1.c" /* Factorization and core components */ #include "lusol7a.c" /* Utility routines for updates */ #include "lusol8a.c" /* Column update */ void LUSOL_dump(FILE *output, LUSOLrec *LUSOL) { MYBOOL userfile = (MYBOOL) (output != NULL); if(!userfile) output = fopen("LUSOL.dbg", "w"); blockWriteREAL(output, "a", LUSOL->a, 1, LUSOL->lena); blockWriteINT(output, "indc", LUSOL->indc, 1, LUSOL->lena); blockWriteINT(output, "indr", LUSOL->indr, 1, LUSOL->lena); blockWriteINT(output, "ip", LUSOL->ip, 1, LUSOL->m); blockWriteINT(output, "iq", LUSOL->iq, 1, LUSOL->n); blockWriteINT(output, "lenc", LUSOL->lenc, 1, LUSOL->n); blockWriteINT(output, "lenr", LUSOL->lenr, 1, LUSOL->m); blockWriteINT(output, "locc", LUSOL->locc, 1, LUSOL->n); blockWriteINT(output, "locr", LUSOL->locr, 1, LUSOL->m); blockWriteINT(output, "iploc", LUSOL->iploc, 1, LUSOL->n); blockWriteINT(output, "iqloc", LUSOL->iqloc, 1, LUSOL->m); blockWriteINT(output, "ipinv", LUSOL->ipinv, 1, LUSOL->m); blockWriteINT(output, "iqinv", LUSOL->iqinv, 1, LUSOL->n); if(!userfile) fclose(output); } LUSOLmat *LUSOL_matcreate(int dim, int nz) { LUSOLmat *newm; newm = (LUSOLmat *) LUSOL_CALLOC(1, sizeof(*newm)); if(newm != NULL) { newm->a = (REAL *) LUSOL_MALLOC((nz+1)*sizeof(REAL)); newm->lenx = (int *) LUSOL_MALLOC((dim+1)*sizeof(int)); newm->indx = (int *) LUSOL_MALLOC((dim+1)*sizeof(int)); newm->indr = (int *) LUSOL_MALLOC((nz+1)*sizeof(int)); newm->indc = (int *) LUSOL_MALLOC((nz+1)*sizeof(int)); if((newm->a == NULL) || (newm->lenx == NULL) || (newm->indx == NULL) || (newm->indr == NULL) || (newm->indc == NULL)) LUSOL_matfree(&newm); } return(newm); } void LUSOL_matfree(LUSOLmat **mat) { if((mat == NULL) || (*mat == NULL)) return; LUSOL_FREE((*mat)->a); LUSOL_FREE((*mat)->indc); LUSOL_FREE((*mat)->indr); LUSOL_FREE((*mat)->lenx); LUSOL_FREE((*mat)->indx); LUSOL_FREE(*mat); } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol.h100666 0 0 33325 11141443433 16264 0ustar usergroup#ifndef HEADER_LUSOL #define HEADER_LUSOL /* Include necessary libraries */ /* ------------------------------------------------------------------------- */ #include #include "commonlib.h" /* Version information */ /* ------------------------------------------------------------------------- */ #define LUSOL_VERMAJOR 2 #define LUSOL_VERMINOR 2 #define LUSOL_RELEASE 2 #define LUSOL_BUILD 0 /* Dynamic memory management macros */ /* ------------------------------------------------------------------------- */ #ifdef MATLAB #define LUSOL_MALLOC(bytesize) mxMalloc(bytesize) #define LUSOL_CALLOC(count, recsize) mxCalloc(count, recsize) #define LUSOL_REALLOC(ptr, bytesize) mxRealloc((void *) ptr, bytesize) #define LUSOL_FREE(ptr) {mxFree(ptr); ptr=NULL;} #else #define LUSOL_MALLOC(bytesize) malloc(bytesize) #define LUSOL_CALLOC(count, recsize) calloc(count, recsize) #define LUSOL_REALLOC(ptr, bytesize) realloc((void *) ptr, bytesize) #define LUSOL_FREE(ptr) {free(ptr); ptr=NULL;} #endif /* Performance compiler options */ /* ------------------------------------------------------------------------- */ #if 1 #define ForceInitialization /* Satisfy compilers, check during debugging! */ #define LUSOLFastDenseIndex /* Increment the linearized dense address */ #define LUSOLFastClear /* Use intrinsic functions for memory zeroing */ #define LUSOLFastMove /* Use intrinsic functions for memory moves */ #define LUSOLFastCopy /* Use intrinsic functions for memory copy */ #define LUSOLFastSolve /* Use pointer operations in equation solving */ #define LUSOLSafeFastUpdate /* Use separate array for LU6L result storage */ /*#define UseOld_LU6CHK_20040510 */ /*#define AlwaysSeparateHamaxR */ /* Enabled when the pivot model is fixed */ #if 0 #define ForceRowBasedL0 /* Create a row-sorted version of L0 */ #endif /* #define SetSmallToZero*/ /* #define DoTraceL0 */ #endif /*#define UseTimer */ /* Legacy compatibility and testing options (Fortran-LUSOL) */ /* ------------------------------------------------------------------------- */ #if 0 #define LegacyTesting #define StaticMemAlloc /* Preallocated vs. dynamic memory allocation */ #define ClassicdiagU /* Store diagU at end of a */ #define ClassicHamaxR /* Store H+AmaxR at end of a/indc/indr */ #endif /* General constants and data type definitions */ /* ------------------------------------------------------------------------- */ #define LUSOL_ARRAYOFFSET 1 #ifndef ZERO #define ZERO 0 #endif #ifndef ONE #define ONE 1 #endif #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE 1 #endif #ifndef NULL #define NULL 0 #endif #ifndef REAL #define REAL double #endif #ifndef REALXP #define REALXP long double #endif #ifndef MYBOOL #define MYBOOL unsigned char #endif /* User-settable default parameter values */ /* ------------------------------------------------------------------------- */ #define LUSOL_DEFAULT_GAMMA 2.0 #define LUSOL_SMALLNUM 1.0e-20 /* IAEE doubles have precision 2.22e-16 */ #define LUSOL_BIGNUM 1.0e+20 #define LUSOL_MINDELTA_FACTOR 4 #define LUSOL_MINDELTA_a 10000 #if 1 #define LUSOL_MULT_nz_a 2 /* Suggested by Yin Zhang */ #else #define LUSOL_MULT_nz_a 5 /* Could consider 6 or 7 */ #endif #define LUSOL_MINDELTA_rc 1000 #define LUSOL_DEFAULT_SMARTRATIO 0.667 /* Fixed system parameters (changeable only by developers) */ /* ------------------------------------------------------------------------- */ /* parmlu INPUT parameters: */ #define LUSOL_RP_SMARTRATIO 0 #define LUSOL_RP_FACTORMAX_Lij 1 #define LUSOL_RP_UPDATEMAX_Lij 2 #define LUSOL_RP_ZEROTOLERANCE 3 #define LUSOL_RP_SMALLDIAG_U 4 #define LUSOL_RP_EPSDIAG_U 5 #define LUSOL_RP_COMPSPACE_U 6 #define LUSOL_RP_MARKOWITZ_CONLY 7 #define LUSOL_RP_MARKOWITZ_DENSE 8 #define LUSOL_RP_GAMMA 9 /* parmlu OUPUT parameters: */ #define LUSOL_RP_MAXELEM_A 10 #define LUSOL_RP_MAXMULT_L 11 #define LUSOL_RP_MAXELEM_U 12 #define LUSOL_RP_MAXELEM_DIAGU 13 #define LUSOL_RP_MINELEM_DIAGU 14 #define LUSOL_RP_MAXELEM_TCP 15 #define LUSOL_RP_GROWTHRATE 16 #define LUSOL_RP_USERDATA_1 17 #define LUSOL_RP_USERDATA_2 18 #define LUSOL_RP_USERDATA_3 19 #define LUSOL_RP_RESIDUAL_U 20 #define LUSOL_RP_LASTITEM LUSOL_RP_RESIDUAL_U /* luparm INPUT parameters: */ #define LUSOL_IP_USERDATA_0 0 #define LUSOL_IP_PRINTUNIT 1 #define LUSOL_IP_PRINTLEVEL 2 #define LUSOL_IP_MARKOWITZ_MAXCOL 3 #define LUSOL_IP_SCALAR_NZA 4 #define LUSOL_IP_UPDATELIMIT 5 #define LUSOL_IP_PIVOTTYPE 6 #define LUSOL_IP_ACCELERATION 7 #define LUSOL_IP_KEEPLU 8 #define LUSOL_IP_SINGULARLISTSIZE 9 /* luparm OUTPUT parameters: */ #define LUSOL_IP_INFORM 10 #define LUSOL_IP_SINGULARITIES 11 #define LUSOL_IP_SINGULARINDEX 12 #define LUSOL_IP_MINIMUMLENA 13 #define LUSOL_IP_MAXLEN 14 #define LUSOL_IP_UPDATECOUNT 15 #define LUSOL_IP_RANK_U 16 #define LUSOL_IP_COLCOUNT_DENSE1 17 #define LUSOL_IP_COLCOUNT_DENSE2 18 #define LUSOL_IP_COLINDEX_DUMIN 19 #define LUSOL_IP_COLCOUNT_L0 20 #define LUSOL_IP_NONZEROS_L0 21 #define LUSOL_IP_NONZEROS_U0 22 #define LUSOL_IP_NONZEROS_L 23 #define LUSOL_IP_NONZEROS_U 24 #define LUSOL_IP_NONZEROS_ROW 25 #define LUSOL_IP_COMPRESSIONS_LU 26 #define LUSOL_IP_MARKOWITZ_MERIT 27 #define LUSOL_IP_TRIANGROWS_U 28 #define LUSOL_IP_TRIANGROWS_L 29 #define LUSOL_IP_FTRANCOUNT 30 #define LUSOL_IP_BTRANCOUNT 31 #define LUSOL_IP_ROWCOUNT_L0 32 #define LUSOL_IP_LASTITEM LUSOL_IP_ROWCOUNT_L0 /* Macros for matrix-based access for dense part of A and timer mapping */ /* ------------------------------------------------------------------------- */ #define DAPOS(row, col) (row + (col-1)*LDA) #define timer(text, id) LUSOL_timer(LUSOL, id, text) /* Parameter/option defines */ /* ------------------------------------------------------------------------- */ #define LUSOL_MSG_NONE -1 #define LUSOL_MSG_SINGULARITY 0 #define LUSOL_MSG_STATISTICS 10 #define LUSOL_MSG_PIVOT 50 #define LUSOL_BASEORDER 0 #define LUSOL_OTHERORDER 1 #define LUSOL_AUTOORDER 2 #define LUSOL_ACCELERATE_L0 4 #define LUSOL_ACCELERATE_U 8 #define LUSOL_PIVMOD_NOCHANGE -2 /* Don't change active pivoting model */ #define LUSOL_PIVMOD_DEFAULT -1 /* Set pivoting model to default */ #define LUSOL_PIVMOD_TPP 0 /* Threshold Partial pivoting (normal) */ #define LUSOL_PIVMOD_TRP 1 /* Threshold Rook pivoting */ #define LUSOL_PIVMOD_TCP 2 /* Threshold Complete pivoting */ #define LUSOL_PIVMOD_TSP 3 /* Threshold Symmetric pivoting */ #define LUSOL_PIVMOD_MAX LUSOL_PIVMOD_TSP #define LUSOL_PIVTOL_NOCHANGE 0 #define LUSOL_PIVTOL_BAGGY 1 #define LUSOL_PIVTOL_LOOSE 2 #define LUSOL_PIVTOL_NORMAL 3 #define LUSOL_PIVTOL_SLIM 4 #define LUSOL_PIVTOL_TIGHT 5 #define LUSOL_PIVTOL_SUPER 6 #define LUSOL_PIVTOL_CORSET 7 #define LUSOL_PIVTOL_DEFAULT LUSOL_PIVTOL_SLIM #define LUSOL_PIVTOL_MAX LUSOL_PIVTOL_CORSET #define LUSOL_UPDATE_OLDEMPTY 0 /* No/empty current column. */ #define LUSOL_UPDATE_OLDNONEMPTY 1 /* Current column need not have been empty. */ #define LUSOL_UPDATE_NEWEMPTY 0 /* New column is taken to be zero. */ #define LUSOL_UPDATE_NEWNONEMPTY 1 /* v(*) contains the new column; on exit, v(*) satisfies L*v = a(new). */ #define LUSOL_UPDATE_USEPREPARED 2 /* v(*) must satisfy L*v = a(new). */ #define LUSOL_SOLVE_Lv_v 1 /* v solves L v = v(input). w is not touched. */ #define LUSOL_SOLVE_Ltv_v 2 /* v solves L'v = v(input). w is not touched. */ #define LUSOL_SOLVE_Uw_v 3 /* w solves U w = v. v is not altered. */ #define LUSOL_SOLVE_Utv_w 4 /* v solves U'v = w. w is destroyed. */ #define LUSOL_SOLVE_Aw_v 5 /* w solves A w = v. v is altered as in 1. */ #define LUSOL_FTRAN LUSOL_SOLVE_Aw_v #define LUSOL_SOLVE_Atv_w 6 /* v solves A'v = w. w is destroyed. */ #define LUSOL_BTRAN LUSOL_SOLVE_Atv_w /* If mode = 3,4,5,6, v and w must not be the same arrays. If lu1fac has just been used to factorize a symmetric matrix A (which must be definite or quasi-definite), the factors A = L U may be regarded as A = LDL', where D = diag(U). In such cases, the following (faster) solve codes may be used: */ #define LUSOL_SOLVE_Av_v 7 /* v solves A v = L D L'v = v(input). w is not touched. */ #define LUSOL_SOLVE_LDLtv_v 8 /* v solves L |D| L'v = v(input). w is not touched. */ #define LUSOL_INFORM_RANKLOSS -1 #define LUSOL_INFORM_LUSUCCESS 0 #define LUSOL_INFORM_LUSINGULAR 1 #define LUSOL_INFORM_LUUNSTABLE 2 #define LUSOL_INFORM_ADIMERR 3 #define LUSOL_INFORM_ADUPLICATE 4 #define LUSOL_INFORM_ANEEDMEM 7 /* Set lena >= luparm[LUSOL_IP_MINIMUMLENA] */ #define LUSOL_INFORM_FATALERR 8 #define LUSOL_INFORM_NOPIVOT 9 /* No diagonal pivot found with TSP or TDP. */ #define LUSOL_INFORM_NOMEMLEFT 10 #define LUSOL_INFORM_MIN LUSOL_INFORM_RANKLOSS #define LUSOL_INFORM_MAX LUSOL_INFORM_NOMEMLEFT #define LUSOL_INFORM_GETLAST 10 /* Code for LUSOL_informstr. */ #define LUSOL_INFORM_SERIOUS LUSOL_INFORM_LUUNSTABLE /* Prototypes for call-back functions */ /* ------------------------------------------------------------------------- */ typedef void LUSOLlogfunc(void *lp, void *userhandle, char *buf); /* Sparse matrix data */ typedef struct _LUSOLmat { REAL *a; int *lenx, *indr, *indc, *indx; } LUSOLmat; /* The main LUSOL data record */ /* ------------------------------------------------------------------------- */ typedef struct _LUSOLrec { /* General data */ FILE *outstream; /* Output stream, initialized to STDOUT */ LUSOLlogfunc *writelog; void *loghandle; LUSOLlogfunc *debuginfo; /* Parameter storage arrays */ int luparm[LUSOL_IP_LASTITEM + 1]; REAL parmlu[LUSOL_RP_LASTITEM + 1]; /* Arrays of length lena+1 */ int lena, nelem; int *indc, *indr; REAL *a; /* Arrays of length maxm+1 (row storage) */ int maxm, m; int *lenr, *ip, *iqloc, *ipinv, *locr; /* Arrays of length maxn+1 (column storage) */ int maxn, n; int *lenc, *iq, *iploc, *iqinv, *locc; REAL *w, *vLU6L; /* List of singular columns, with dynamic size allocation */ int *isingular; /* Extra arrays of length n for TCP and keepLU == FALSE */ REAL *Ha, *diagU; int *Hj, *Hk; /* Extra arrays of length m for TRP*/ REAL *amaxr; /* Extra array for L0 and U stored by row/column for faster btran/ftran */ LUSOLmat *L0; LUSOLmat *U; /* Miscellaneous data */ int expanded_a; int replaced_c; int replaced_r; } LUSOLrec; LUSOLrec *LUSOL_create(FILE *outstream, int msgfil, int pivotmodel, int updatelimit); MYBOOL LUSOL_sizeto(LUSOLrec *LUSOL, int init_r, int init_c, int init_a); MYBOOL LUSOL_assign(LUSOLrec *LUSOL, int iA[], int jA[], REAL Aij[], int nzcount, MYBOOL istriplet); void LUSOL_clear(LUSOLrec *LUSOL, MYBOOL nzonly); void LUSOL_free(LUSOLrec *LUSOL); LUSOLmat *LUSOL_matcreate(int dim, int nz); void LUSOL_matfree(LUSOLmat **mat); int LUSOL_loadColumn(LUSOLrec *LUSOL, int iA[], int jA, REAL Aij[], int nzcount, int offset1); void LUSOL_setpivotmodel(LUSOLrec *LUSOL, int pivotmodel, int initlevel); int LUSOL_factorize(LUSOLrec *LUSOL); int LUSOL_replaceColumn(LUSOLrec *LUSOL, int jcol, REAL v[]); MYBOOL LUSOL_tightenpivot(LUSOLrec *LUSOL); MYBOOL LUSOL_addSingularity(LUSOLrec *LUSOL, int singcol, int *inform); int LUSOL_getSingularity(LUSOLrec *LUSOL, int singitem); int LUSOL_findSingularityPosition(LUSOLrec *LUSOL, int singcol); char *LUSOL_pivotLabel(LUSOLrec *LUSOL); char *LUSOL_informstr(LUSOLrec *LUSOL, int inform); REAL LUSOL_vecdensity(LUSOLrec *LUSOL, REAL V[]); void LUSOL_report(LUSOLrec *LUSOL, int msglevel, char *format, ...); void LUSOL_timer(LUSOLrec *LUSOL, int timerid, char *text); int LUSOL_ftran(LUSOLrec *LUSOL, REAL b[], int NZidx[], MYBOOL prepareupdate); int LUSOL_btran(LUSOLrec *LUSOL, REAL b[], int NZidx[]); void LU1FAC(LUSOLrec *LUSOL, int *INFORM); MYBOOL LU1L0(LUSOLrec *LUSOL, LUSOLmat **mat, int *inform); void LU6SOL(LUSOLrec *LUSOL, int MODE, REAL V[], REAL W[], int NZidx[], int *INFORM); void LU8RPC(LUSOLrec *LUSOL, int MODE1, int MODE2, int JREP, REAL V[], REAL W[], int *INFORM, REAL *DIAG, REAL *VNORM); void LUSOL_dump(FILE *output, LUSOLrec *LUSOL); void print_L0(LUSOLrec *LUSOL); #endif /* HEADER_LUSOL */ lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol1.c100666 0 0 411061 11141443433 16355 0ustar usergroup /* ================================================================== lu1DCP factors a dense m x n matrix A by Gaussian elimination, using Complete Pivoting (row and column interchanges) for stability. This version also uses column interchanges if all elements in a pivot column are smaller than (or equal to) "small". Such columns are changed to zero and permuted to the right-hand end. As in LINPACK's dgefa, ipvt(!) keeps track of pivot rows. Rows of U are interchanged, but we don't have to physically permute rows of L. In contrast, column interchanges are applied directly to the columns of both L and U, and to the column permutation vector iq(*). ------------------------------------------------------------------ On entry: a Array holding the matrix A to be factored. lda The leading dimension of the array a. m The number of rows in A. n The number of columns in A. small A drop tolerance. Must be zero or positive. On exit: a An upper triangular matrix and the multipliers which were used to obtain it. The factorization can be written A = L*U where L is a product of permutation and unit lower triangular matrices and U is upper triangular. nsing Number of singularities detected. ipvt Records the pivot rows. iq A vector to which column interchanges are applied. ------------------------------------------------------------------ 01 May 2002: First dense Complete Pivoting, derived from lu1DPP. 07 May 2002: Another break needed at end of first loop. 07 May 2002: Current version of lu1DCP. ================================================================== */ void LU1DCP(LUSOLrec *LUSOL, REAL DA[], int LDA, int M, int N, REAL SMALL, int *NSING, int IPVT[], int IX[]) { int I, J, K, KP1, L, LAST, LENCOL, IMAX, JMAX, JLAST, JNEW; REAL AIJMAX, AJMAX; register REAL T; #ifdef LUSOLFastDenseIndex register REAL *DA1, *DA2; int IDA1, IDA2; #else register int IDA1, IDA2; #endif *NSING = 0; LENCOL = M+1; LAST = N; /* ----------------------------------------------------------------- Start of elimination loop. ----------------------------------------------------------------- */ for(K = 1; K <= N; K++) { KP1 = K+1; LENCOL--; /* Find the biggest aij in row imax and column jmax. */ AIJMAX = ZERO; IMAX = K; JMAX = K; JLAST = LAST; for(J = K; J <= JLAST; J++) { x10: L = idamax(LENCOL,DA+DAPOS(K,J)-LUSOL_ARRAYOFFSET,1)+K-1; AJMAX = fabs(DA[DAPOS(L,J)]); if(AJMAX<=SMALL) { /* ======================================================== Do column interchange, changing old column to zero. Reduce "last" and try again with same j. ======================================================== */ (*NSING)++; JNEW = IX[LAST]; IX[LAST] = IX[J]; IX[J] = JNEW; #ifdef LUSOLFastDenseIndex DA1 = DA+DAPOS(0,LAST); DA2 = DA+DAPOS(0,J); for(I = 1; I <= K-1; I++) { DA1++; DA2++; T = *DA1; *DA1 = *DA2; *DA2 = T; #else for(I = 1; I <= K-1; I++) { IDA1 = DAPOS(I,LAST); IDA2 = DAPOS(I,J); T = DA[IDA1]; DA[IDA1] = DA[IDA2]; DA[IDA2] = T; #endif } #ifdef LUSOLFastDenseIndex for(I = K; I <= M; I++) { DA1++; DA2++; T = *DA1; *DA1 = ZERO; *DA2 = T; #else for(I = K; I <= M; I++) { IDA1 = DAPOS(I,LAST); IDA2 = DAPOS(I,J); T = DA[IDA1]; DA[IDA1] = ZERO; DA[IDA2] = T; #endif } LAST--; if(J<=LAST) goto x10; break; } /* Check if this column has biggest aij so far. */ if(AIJMAX=LAST) break; } IPVT[K] = IMAX; if(JMAX!=K) { /* ========================================================== Do column interchange (k and jmax). ========================================================== */ JNEW = IX[JMAX]; IX[JMAX] = IX[K]; IX[K] = JNEW; #ifdef LUSOLFastDenseIndex DA1 = DA+DAPOS(0,JMAX); DA2 = DA+DAPOS(0,K); for(I = 1; I <= M; I++) { DA1++; DA2++; T = *DA1; *DA1 = *DA2; *DA2 = T; #else for(I = 1; I <= M; I++) { IDA1 = DAPOS(I,JMAX); IDA2 = DAPOS(I,K); T = DA[IDA1]; DA[IDA1] = DA[IDA2]; DA[IDA2] = T; #endif } } if(M>K) { /* =========================================================== Do row interchange if necessary. =========================================================== */ if(IMAX!=K) { IDA1 = DAPOS(IMAX,K); IDA2 = DAPOS(K,K); T = DA[IDA1]; DA[IDA1] = DA[IDA2]; DA[IDA2] = T; } /* =========================================================== Compute multipliers. Do row elimination with column indexing. =========================================================== */ T = -ONE/DA[DAPOS(K,K)]; dscal(M-K,T,DA+DAPOS(KP1,K)-LUSOL_ARRAYOFFSET,1); for(J = KP1; J <= LAST; J++) { IDA1 = DAPOS(IMAX,J); T = DA[IDA1]; if(IMAX!=K) { IDA2 = DAPOS(K,J); DA[IDA1] = DA[IDA2]; DA[IDA2] = T; } daxpy(M-K,T,DA+DAPOS(KP1,K)-LUSOL_ARRAYOFFSET,1, DA+DAPOS(KP1,J)-LUSOL_ARRAYOFFSET,1); } } else break; if(K>=LAST) break; } /* Set ipvt(*) for singular rows. */ for(K = LAST+1; K <= M; K++) IPVT[K] = K; } /* ================================================================== lu1DPP factors a dense m x n matrix A by Gaussian elimination, using row interchanges for stability, as in dgefa from LINPACK. This version also uses column interchanges if all elements in a pivot column are smaller than (or equal to) "small". Such columns are changed to zero and permuted to the right-hand end. As in LINPACK, ipvt(*) keeps track of pivot rows. Rows of U are interchanged, but we don't have to physically permute rows of L. In contrast, column interchanges are applied directly to the columns of both L and U, and to the column permutation vector iq(*). ------------------------------------------------------------------ On entry: a Array holding the matrix A to be factored. lda The leading dimension of the array a. m The number of rows in A. n The number of columns in A. small A drop tolerance. Must be zero or positive. On exit: a An upper triangular matrix and the multipliers which were used to obtain it. The factorization can be written A = L*U where L is a product of permutation and unit lower triangular matrices and U is upper triangular. nsing Number of singularities detected. ipvt Records the pivot rows. iq A vector to which column interchanges are applied. ------------------------------------------------------------------ 02 May 1989: First version derived from dgefa in LINPACK (version dated 08/14/78). 05 Feb 1994: Generalized to treat rectangular matrices and use column interchanges when necessary. ipvt is retained, but column permutations are applied directly to iq(*). 21 Dec 1994: Bug found via example from Steve Dirkse. Loop 100 added to set ipvt(*) for singular rows. ================================================================== */ void LU1DPP(LUSOLrec *LUSOL, REAL DA[], int LDA, int M, int N, REAL SMALL, int *NSING, int IPVT[], int IX[]) { int I, J, K, KP1, L, LAST, LENCOL; register REAL T; #ifdef LUSOLFastDenseIndex register REAL *DA1, *DA2; int IDA1, IDA2; #else register int IDA1, IDA2; #endif *NSING = 0; K = 1; LAST = N; /* ------------------------------------------------------------------ Start of elimination loop. ------------------------------------------------------------------ */ x10: KP1 = K+1; LENCOL = (M-K)+1; /* Find l, the pivot row. */ L = (idamax(LENCOL,DA+DAPOS(K,K)-LUSOL_ARRAYOFFSET,1)+K)-1; IPVT[K] = L; if(fabs(DA[DAPOS(L,K)])<=SMALL) { /* =============================================================== Do column interchange, changing old pivot column to zero. Reduce "last" and try again with same k. =============================================================== */ (*NSING)++; J = IX[LAST]; IX[LAST] = IX[K]; IX[K] = J; #ifdef LUSOLFastDenseIndex DA1 = DA+DAPOS(0,LAST); DA2 = DA+DAPOS(0,K); for(I = 1; I <= K-1; I++) { DA1++; DA2++; T = *DA1; *DA1 = *DA2; *DA2 = T; #else for(I = 1; I <= K-1; I++) { IDA1 = DAPOS(I,LAST); IDA2 = DAPOS(I,K); T = DA[IDA1]; DA[IDA1] = DA[IDA2]; DA[IDA2] = T; #endif } #ifdef LUSOLFastDenseIndex for(I = K; I <= M; I++) { DA1++; DA2++; T = *DA1; *DA1 = ZERO; *DA2 = T; #else for(I = K; I <= M; I++) { IDA1 = DAPOS(I,LAST); IDA2 = DAPOS(I,K); T = DA[IDA1]; DA[IDA1] = ZERO; DA[IDA2] = T; #endif } LAST = LAST-1; if(K<=LAST) goto x10; } else if(M>K) { /* =============================================================== Do row interchange if necessary. =============================================================== */ if(L!=K) { IDA1 = DAPOS(L,K); IDA2 = DAPOS(K,K); T = DA[IDA1]; DA[IDA1] = DA[IDA2]; DA[IDA2] = T; } /* =============================================================== Compute multipliers. Do row elimination with column indexing. =============================================================== */ T = -ONE/DA[DAPOS(K,K)]; dscal(M-K,T,DA+DAPOS(KP1,K)-LUSOL_ARRAYOFFSET,1); for(J = KP1; J <= LAST; J++) { IDA1 = DAPOS(L,J); T = DA[IDA1]; if(L!=K) { IDA2 = DAPOS(K,J); DA[IDA1] = DA[IDA2]; DA[IDA2] = T; } daxpy(M-K,T,DA+DAPOS(KP1,K)-LUSOL_ARRAYOFFSET,1, DA+DAPOS(KP1,J)-LUSOL_ARRAYOFFSET,1); } K++; if(K<=LAST) goto x10; } /* Set ipvt(*) for singular rows. */ for(K = LAST+1; K <= M; K++) IPVT[K] = K; } /* ================================================================== lu1pq1 constructs a permutation iperm from the array len. ------------------------------------------------------------------ On entry: len(i) holds the number of nonzeros in the i-th row (say) of an m by n matrix. num(*) can be anything (workspace). On exit: iperm contains a list of row numbers in the order rows of length 0, rows of length 1,..., rows of length n. loc(nz) points to the first row containing nz nonzeros, nz = 1, n. inv(i) points to the position of row i within iperm(*). ================================================================== */ void LU1PQ1(LUSOLrec *LUSOL, int M, int N, int LEN[], int IPERM[], int LOC[], int INV[], int NUM[]) { int NZEROS, NZ, I, L; /* Count the number of rows of each length. */ NZEROS = 0; for(NZ = 1; NZ <= N; NZ++) { NUM[NZ] = 0; LOC[NZ] = 0; } for(I = 1; I <= M; I++) { NZ = LEN[I]; if(NZ==0) NZEROS++; else NUM[NZ]++; } /* Set starting locations for each length. */ L = NZEROS+1; for(NZ = 1; NZ <= N; NZ++) { LOC[NZ] = L; L += NUM[NZ]; NUM[NZ] = 0; } /* Form the list. */ NZEROS = 0; for(I = 1; I <= M; I++) { NZ = LEN[I]; if(NZ==0) { NZEROS++; IPERM[NZEROS] = I; } else { L = LOC[NZ]+NUM[NZ]; IPERM[L] = I; NUM[NZ]++; } } /* Define the inverse of iperm. */ for(L = 1; L <= M; L++) { I = IPERM[L]; INV[I] = L; } } /* ================================================================== lu1pq2 frees the space occupied by the pivot row, and updates the column permutation iq. Also used to free the pivot column and update the row perm ip. ------------------------------------------------------------------ nzpiv (input) is the length of the pivot row (or column). nzchng (output) is the net change in total nonzeros. ------------------------------------------------------------------ 14 Apr 1989 First version. ================================================================== */ void LU1PQ2(LUSOLrec *LUSOL, int NZPIV, int *NZCHNG, int IND[], int LENOLD[], int LENNEW[], int IXLOC[], int IX[], int IXINV[]) { int LR, J, NZ, NZNEW, L, NEXT, LNEW, JNEW; *NZCHNG = 0; for(LR = 1; LR <= NZPIV; LR++) { J = IND[LR]; IND[LR] = 0; NZ = LENOLD[LR]; NZNEW = LENNEW[J]; if(NZ!=NZNEW) { L = IXINV[J]; *NZCHNG = (*NZCHNG+NZNEW)-NZ; /* l above is the position of column j in iq (so j = iq(l)). */ if(NZNZNEW) goto x120; } IX[LNEW] = J; IXINV[J] = LNEW; } } } /* ================================================================== lu1pq3 looks at the permutation iperm(*) and moves any entries to the end whose corresponding length len(*) is zero. ------------------------------------------------------------------ 09 Feb 1994: Added work array iw(*) to improve efficiency. ================================================================== */ void LU1PQ3(LUSOLrec *LUSOL, int MN, int LEN[], int IPERM[], int IW[], int *NRANK) { int NZEROS, K, I; *NRANK = 0; NZEROS = 0; for(K = 1; K <= MN; K++) { I = IPERM[K]; if(LEN[I]==0) { NZEROS++; IW[NZEROS] = I; } else { (*NRANK)++; IPERM[*NRANK] = I; } } for(K = 1; K <= NZEROS; K++) IPERM[(*NRANK)+K] = IW[K]; } /* ================================================================== lu1rec ------------------------------------------------------------------ On exit: ltop is the length of useful entries in ind(*), a(*). ind(ltop+1) is "i" such that len(i), loc(i) belong to the last item in ind(*), a(*). ------------------------------------------------------------------ 00 Jun 1983: Original version of lu1rec followed John Reid's compression routine in LA05. It recovered space in ind(*) and optionally a(*) by eliminating entries with ind(l) = 0. The elements of ind(*) could not be negative. If len(i) was positive, entry i contained that many elements, starting at loc(i). Otherwise, entry i was eliminated. 23 Mar 2001: Realised we could have len(i) = 0 in rare cases! (Mostly during TCP when the pivot row contains a column of length 1 that couldn't be a pivot.) Revised storage scheme to keep entries with ind(l) > 0, squeeze out entries with -n <= ind(l) <= 0, and to allow len(i) = 0. Empty items are moved to the end of the compressed ind(*) and/or a(*) arrays are given one empty space. Items with len(i) < 0 are still eliminated. 27 Mar 2001: Decided to use only ind(l) > 0 and = 0 in lu1fad. Still have to keep entries with len(i) = 0. ================================================================== */ void LU1REC(LUSOLrec *LUSOL, int N, MYBOOL REALS, int *LTOP, int IND[], int LEN[], int LOC[]) { int NEMPTY, I, LENI, L, LEND, K, KLAST, ILAST, LPRINT; NEMPTY = 0; for(I = 1; I <= N; I++) { LENI = LEN[I]; if(LENI>0) { L = (LOC[I]+LENI)-1; LEN[I] = IND[L]; IND[L] = -(N+I); } else if(LENI==0) NEMPTY++; } K = 0; /* Previous k */ KLAST = 0; /* Last entry moved. */ ILAST = 0; LEND = *LTOP; for(L = 1; L <= LEND; L++) { I = IND[L]; if(I>0) { K++; IND[K] = I; if(REALS) LUSOL->a[K] = LUSOL->a[L]; } else if(I<-N) { /* This is the end of entry i. */ I = -(N+I); ILAST = I; K++; IND[K] = LEN[I]; if(REALS) LUSOL->a[K] = LUSOL->a[L]; LOC[I] = KLAST+1; LEN[I] = K-KLAST; KLAST = K; } } /* Move any empty items to the end, adding 1 free entry for each. */ if(NEMPTY>0) { for(I = 1; I <= N; I++) { if(LEN[I]==0) { K++; LOC[I] = K; IND[K] = 0; ILAST = I; } } } LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; if(LPRINT>=LUSOL_MSG_PIVOT) LUSOL_report(LUSOL, 0, "lu1rec. File compressed from %d to %d\n", *LTOP,K,REALS,NEMPTY); /* ncp */ LUSOL->luparm[LUSOL_IP_COMPRESSIONS_LU]++; /* Return ilast in ind(ltop + 1). */ *LTOP = K; IND[(*LTOP)+1] = ILAST; } /* ================================================================== lu1slk sets w(j) > 0 if column j is a unit vector. ------------------------------------------------------------------ 21 Nov 2000: First version. lu1fad needs it for TCP. Note that w(*) is nominally an integer array, but the only spare space is the double array w(*). ================================================================== */ void LU1SLK(LUSOLrec *LUSOL) { int J, LC1, LQ, LQ1, LQ2; for(J = 1; J <= LUSOL->n; J++) { LUSOL->w[J] = 0; } LQ1 = (LUSOL->iqloc ? LUSOL->iqloc[1] : LUSOL->n+1); /* LQ1 = LUSOL->iqloc[1]; This is the original version; correction above by Yin Zhang */ LQ2 = LUSOL->n; if(LUSOL->m>1) LQ2 = LUSOL->iqloc[2]-1; for(LQ = LQ1; LQ <= LQ2; LQ++) { J = LUSOL->iq[LQ]; LC1 = LUSOL->locc[J]; if(fabs(LUSOL->a[LC1])==1) { LUSOL->w[J] = 1; } } } /* ================================================================== lu1gau does most of the work for each step of Gaussian elimination. A multiple of the pivot column is added to each other column j in the pivot row. The column list is fully updated. The row list is updated if there is room, but some fill-ins may remain, as indicated by ifill and jfill. ------------------------------------------------------------------ Input: ilast is the row at the end of the row list. jlast is the column at the end of the column list. lfirst is the first column to be processed. lu + 1 is the corresponding element of U in au(*). nfill keeps track of pending fill-in. a(*) contains the nonzeros for each column j. indc(*) contains the row indices for each column j. al(*) contains the new column of L. A multiple of it is used to modify each column. mark(*) has been set to -1, -2, -3, ... in the rows corresponding to nonzero 1, 2, 3, ... of the col of L. au(*) contains the new row of U. Each nonzero gives the required multiple of the column of L. Workspace: markl(*) marks the nonzeros of L actually used. (A different mark, namely j, is used for each column.) Output: ilast New last row in the row list. jlast New last column in the column list. lfirst = 0 if all columns were completed, > 0 otherwise. lu returns the position of the last nonzero of U actually used, in case we come back in again. nfill keeps track of the total extra space needed in the row file. ifill(ll) counts pending fill-in for rows involved in the new column of L. jfill(lu) marks the first pending fill-in stored in columns involved in the new row of U. ------------------------------------------------------------------ 16 Apr 1989: First version of lu1gau. 23 Apr 1989: lfirst, lu, nfill are now input and output to allow re-entry if elimination is interrupted. 23 Mar 2001: Introduced ilast, jlast. 27 Mar 2001: Allow fill-in "in situ" if there is already room up to but NOT INCLUDING the end of the row or column file. Seems safe way to avoid overwriting empty rows/cols at the end. (May not be needed though, now that we have ilast and jlast.) ================================================================== */ void LU1GAU(LUSOLrec *LUSOL, int MELIM, int NSPARE, REAL SMALL, int LPIVC1, int LPIVC2, int *LFIRST, int LPIVR2, int LFREE, int MINFRE, int ILAST, int *JLAST, int *LROW, int *LCOL, int *LU, int *NFILL, int MARK[], REAL AL[], int MARKL[], REAL AU[], int IFILL[], int JFILL[]) { MYBOOL ATEND; int LR, J, LENJ, NFREE, LC1, LC2, NDONE, NDROP, L, I, LL, K, LR1, LAST, LREP, L1, L2, LC, LENI; register REAL UJ; REAL AIJ; for(LR = *LFIRST; LR <= LPIVR2; LR++) { J = LUSOL->indr[LR]; LENJ = LUSOL->lenc[J]; NFREE = LFREE - *LCOL; if(NFREElocc[J]; LC2 = (LC1+LENJ)-1; ATEND = (MYBOOL) (J==*JLAST); NDONE = 0; if(LENJ==0) goto x500; NDROP = 0; for(L = LC1; L <= LC2; L++) { I = LUSOL->indc[L]; LL = -MARK[I]; if(LL>0) { NDONE++; MARKL[LL] = J; LUSOL->a[L] += AL[LL]*UJ; if(fabs(LUSOL->a[L])<=SMALL) { NDROP++; } } } /* --------------------------------------------------------------- Remove any negligible modified nonzeros from both the column file and the row file. --------------------------------------------------------------- */ if(NDROP==0) goto x500; K = LC1; for(L = LC1; L <= LC2; L++) { I = LUSOL->indc[L]; if(fabs(LUSOL->a[L])<=SMALL) goto x460; LUSOL->a[K] = LUSOL->a[L]; LUSOL->indc[K] = I; K++; continue; /* Delete the nonzero from the row file. */ x460: LENJ--; LUSOL->lenr[I]--; LR1 = LUSOL->locr[I]; LAST = LR1+LUSOL->lenr[I]; for(LREP = LR1; LREP <= LAST; LREP++) { if(LUSOL->indr[LREP]==J) break; } LUSOL->indr[LREP] = LUSOL->indr[LAST]; LUSOL->indr[LAST] = 0; if(I==ILAST) (*LROW)--; } /* Free the deleted elements from the column file. */ #ifdef LUSOLFastClear MEMCLEAR(LUSOL->indc+K, LC2-K+1); #else for(L = K; L <= LC2; L++) LUSOL->indc[L] = ZERO; #endif if(ATEND) *LCOL = K-1; /* --------------------------------------------------------------- Deal with the fill-in in column j. --------------------------------------------------------------- */ x500: if(NDONE==MELIM) goto x590; /* See if column j already has room for the fill-in. */ if(ATEND) goto x540; LAST = (LC1+LENJ)-1; L1 = LAST+1; L2 = (LAST+MELIM)-NDONE; /* 27 Mar 2001: Be sure it's not at or past end of the col file. */ if(L2>=*LCOL) goto x520; for(L = L1; L <= L2; L++) { if(LUSOL->indc[L]!=0) goto x520; } goto x540; /* We must move column j to the end of the column file. First, leave some spare room at the end of the current last column. */ x520: #if 1 L1 = (*LCOL)+1; L2 = (*LCOL)+NSPARE; *LCOL = L2; for(L = L1; L <= L2; L++) { #else for(L = (*LCOL)+1; L <= (*LCOL)+NSPARE; L++) { *LCOL = L; /* ****** ERROR ???? */ #endif /* Spare space is free. */ LUSOL->indc[L] = 0; } ATEND = TRUE; *JLAST = J; L1 = LC1; L2 = *LCOL; LC1 = L2+1; LUSOL->locc[J] = LC1; for(L = L1; L <= LAST; L++) { L2++; LUSOL->a[L2] = LUSOL->a[L]; LUSOL->indc[L2] = LUSOL->indc[L]; /* Free space. */ LUSOL->indc[L] = 0; } *LCOL = L2; /* --------------------------------------------------------------- Inner loop for the fill-in in column j. This is usually not very expensive. --------------------------------------------------------------- */ x540: LAST = (LC1+LENJ)-1; LL = 0; for(LC = LPIVC1; LC <= LPIVC2; LC++) { LL++; if(MARKL[LL]==J) continue; AIJ = AL[LL]*UJ; if(fabs(AIJ)<=SMALL) continue; LENJ++; LAST++; LUSOL->a[LAST] = AIJ; I = LUSOL->indc[LC]; LUSOL->indc[LAST] = I; LENI = LUSOL->lenr[I]; /* Add 1 fill-in to row i if there is already room. 27 Mar 2001: Be sure it's not at or past the } of the row file. */ L = LUSOL->locr[I]+LENI; if(L>=*LROW) goto x550; if(LUSOL->indr[L]>0) goto x550; LUSOL->indr[L] = J; LUSOL->lenr[I] = LENI+1; continue; /* Row i does not have room for the fill-in. Increment ifill(ll) to count how often this has happened to row i. Also, add m to the row index indc(last) in column j to mark it as a fill-in that is still pending. If this is the first pending fill-in for row i, nfill includes the current length of row i (since the whole row has to be moved later). If this is the first pending fill-in for column j, jfill(lu) records the current length of column j (to shorten the search for pending fill-ins later). */ x550: if(IFILL[LL]==0) (*NFILL) += LENI+NSPARE; if(JFILL[*LU]==0) JFILL[*LU] = LENJ; (*NFILL)++; IFILL[LL]++; LUSOL->indc[LAST] = LUSOL->m+I; } if(ATEND) *LCOL = LAST; /* End loop for column j. Store its final length. */ x590: LUSOL->lenc[J] = LENJ; } /* Successful completion. */ *LFIRST = 0; return; /* Interruption. We have to come back in after the column file is compressed. Give lfirst a new value. lu and nfill will retain their current values. */ x900: *LFIRST = LR; } /* ================================================================== lu1mar uses a Markowitz criterion to select a pivot element for the next stage of a sparse LU factorization, subject to a Threshold Partial Pivoting stability criterion (TPP) that bounds the elements of L. ------------------------------------------------------------------ gamma is "gamma" in the tie-breaking rule TB4 in the LUSOL paper. ------------------------------------------------------------------ Search cols of length nz = 1, then rows of length nz = 1, then cols of length nz = 2, then rows of length nz = 2, etc. ------------------------------------------------------------------ 00 Jan 1986 Version documented in LUSOL paper: Gill, Murray, Saunders and Wright (1987), Maintaining LU factors of a general sparse matrix, Linear algebra and its applications 88/89, 239-270. 02 Feb 1989 Following Suhl and Aittoniemi (1987), the largest element in each column is now kept at the start of the column, i.e. in position locc(j) of a and indc. This should speed up the Markowitz searches. 26 Apr 1989 Both columns and rows searched during spars1 phase. Only columns searched during spars2 phase. maxtie replaced by maxcol and maxrow. 05 Nov 1993 Initializing "mbest = m * n" wasn't big enough when m = 10, n = 3, and last column had 7 nonzeros. 09 Feb 1994 Realised that "mbest = maxmn * maxmn" might overflow. Changed to "mbest = maxmn * 1000". 27 Apr 2000 On large example from Todd Munson, that allowed "if (mbest .le. nz1**2) go to 900" to exit before any pivot had been found. Introduced kbest = mbest / nz1. Most pivots can be rejected with no integer multiply. TRUE merit is evaluated only if it's as good as the best so far (or better). There should be no danger of integer overflow unless A is incredibly large and dense. 10 Sep 2000 TCP, aijtol added for Threshold Complete Pivoting. ================================================================== */ void LU1MAR(LUSOLrec *LUSOL, int MAXMN, MYBOOL TCP, REAL AIJTOL, REAL LTOL, int MAXCOL, int MAXROW, int *IBEST, int *JBEST, int *MBEST) { int KBEST, NCOL, NROW, NZ1, NZ, LQ1, LQ2, LQ, J, LC1, LC2, LC, I, LEN1, MERIT, LP1, LP2, LP, LR1, LR2, LR; REAL ABEST, LBEST, AMAX, AIJ, CMAX; ABEST = ZERO; LBEST = ZERO; *IBEST = 0; *MBEST = -1; KBEST = MAXMN+1; NCOL = 0; NROW = 0; NZ1 = 0; for(NZ = 1; NZ <= MAXMN; NZ++) { /* nz1 = nz - 1 if (mbest .le. nz1**2) go to 900 */ if(KBEST<=NZ1) goto x900; if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } if(NZ>LUSOL->m) goto x200; /* --------------------------------------------------------------- Search the set of columns of length nz. --------------------------------------------------------------- */ LQ1 = LUSOL->iqloc[NZ]; LQ2 = LUSOL->n; if(NZm) LQ2 = LUSOL->iqloc[NZ+1]-1; for(LQ = LQ1; LQ <= LQ2; LQ++) { NCOL = NCOL+1; J = LUSOL->iq[LQ]; LC1 = LUSOL->locc[J]; LC2 = LC1+NZ1; AMAX = fabs(LUSOL->a[LC1]); /* Test all aijs in this column. amax is the largest element (the first in the column). cmax is the largest multiplier if aij becomes pivot. */ if(TCP) { /* Nothing in whole column */ if(AMAXindc[LC]; LEN1 = LUSOL->lenr[I]-1; /* merit = nz1 * len1 if (merit > mbest) continue; */ if(LEN1>KBEST) continue; /* aij has a promising merit. Apply the stability test. We require aij to be sufficiently large compared to all other nonzeros in column j. This is equivalent to requiring cmax to be bounded by Ltol. */ if(LC==LC1) { /* This is the maximum element, amax. Find the biggest element in the rest of the column and hence get cmax. We know cmax .le. 1, but we still want it exactly in order to break ties. 27 Apr 2002: Settle for cmax = 1. */ AIJ = AMAX; CMAX = ONE; /* cmax = zero for (l = lc1 + 1; l <= lc2; l++) cmax = max( cmax, abs( a(l) ) ); cmax = cmax / amax; */ } else { /* aij is not the biggest element, so cmax .ge. 1. Bail out if cmax will be too big. */ AIJ = fabs(LUSOL->a[LC]); /* Absolute test for Complete Pivoting */ if(TCP) { if(AIJparmlu[LUSOL_RP_GAMMA] && CMAX<=LUSOL->parmlu[LUSOL_RP_GAMMA]) { if(ABEST>=AIJ) continue; } else { if(LBEST<=CMAX) continue; } } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; KBEST = LEN1; *MBEST = MERIT; ABEST = AIJ; LBEST = CMAX; if(NZ==1) goto x900; } /* Finished with that column. */ if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } } /* --------------------------------------------------------------- Search the set of rows of length nz. --------------------------------------------------------------- */ x200: /* if (mbest .le. nz*nz1) go to 900 */ if(KBEST<=NZ) goto x900; if(*IBEST>0) { if(NROW>=MAXROW) goto x290; } if(NZ>LUSOL->n) goto x290; LP1 = LUSOL->iploc[NZ]; LP2 = LUSOL->m; if(NZn) LP2 = LUSOL->iploc[NZ+1]-1; for(LP = LP1; LP <= LP2; LP++) { NROW++; I = LUSOL->ip[LP]; LR1 = LUSOL->locr[I]; LR2 = LR1+NZ1; for(LR = LR1; LR <= LR2; LR++) { J = LUSOL->indr[LR]; LEN1 = LUSOL->lenc[J]-1; /* merit = nz1 * len1 if (merit .gt. mbest) continue */ if(LEN1>KBEST) continue; /* aij has a promising merit. Find where aij is in column j. */ LC1 = LUSOL->locc[J]; LC2 = LC1+LEN1; AMAX = fabs(LUSOL->a[LC1]); for(LC = LC1; LC <= LC2; LC++) { if(LUSOL->indc[LC]==I) break; } /* Apply the same stability test as above. */ AIJ = fabs(LUSOL->a[LC]); /* Absolute test for Complete Pivoting */ if(TCP) { if(AIJparmlu[LUSOL_RP_GAMMA] && CMAX<=LUSOL->parmlu[LUSOL_RP_GAMMA]) { if(ABEST>=AIJ) continue; } else { if(LBEST<=CMAX) continue; } } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; *MBEST = MERIT; KBEST = LEN1; ABEST = AIJ; LBEST = CMAX; if(NZ==1) goto x900; } /* Finished with that row. */ if(*IBEST>0) { if(NROW>=MAXROW) goto x290; } } /* See if it's time to quit. */ x290: if(*IBEST>0) { if(NROW>=MAXROW && NCOL>=MAXCOL) goto x900; } /* Press on with next nz. */ NZ1 = NZ; if(*IBEST>0) KBEST = *MBEST/NZ1; } x900: ; } /* ================================================================== lu1mCP uses a Markowitz criterion to select a pivot element for the next stage of a sparse LU factorization, subject to a Threshold Complete Pivoting stability criterion (TCP) that bounds the elements of L and U. ------------------------------------------------------------------ gamma is "gamma" in the tie-breaking rule TB4 in the LUSOL paper. ------------------------------------------------------------------ 09 May 2002: First version of lu1mCP. It searches columns only, using the heap that holds the largest element in each column. 09 May 2002: Current version of lu1mCP. ================================================================== */ void LU1MCP(LUSOLrec *LUSOL, REAL AIJTOL, int *IBEST, int *JBEST, int *MBEST, int HLEN, REAL HA[], int HJ[]) { int J, KHEAP, LC, LC1, LC2, LENJ, MAXCOL, NCOL, NZ1, I, LEN1, MERIT; REAL ABEST, AIJ, AMAX, CMAX, LBEST; /* ------------------------------------------------------------------ Search up to maxcol columns stored at the top of the heap. The very top column helps initialize mbest. ------------------------------------------------------------------ */ ABEST = ZERO; LBEST = ZERO; *IBEST = 0; /* Column at the top of the heap */ *JBEST = HJ[1]; LENJ = LUSOL->lenc[*JBEST]; /* Bigger than any possible merit */ *MBEST = LENJ*HLEN; /* ??? Big question */ MAXCOL = 40; /* No. of columns searched */ NCOL = 0; for(KHEAP = 1; KHEAP <= HLEN; KHEAP++) { AMAX = HA[KHEAP]; if(AMAXlenc[J]; NZ1 = LENJ-1; LC1 = LUSOL->locc[J]; LC2 = LC1+NZ1; /* -- amax = abs( a(lc1) ) Test all aijs in this column. amax is the largest element (the first in the column). cmax is the largest multiplier if aij becomes pivot. */ for(LC = LC1; LC <= LC2; LC++) { I = LUSOL->indc[LC]; LEN1 = LUSOL->lenr[I]-1; MERIT = NZ1*LEN1; if(MERIT>*MBEST) continue; /* aij has a promising merit. */ if(LC==LC1) { /* This is the maximum element, amax. Find the biggest element in the rest of the column and hence get cmax. We know cmax .le. 1, but we still want it exactly in order to break ties. 27 Apr 2002: Settle for cmax = 1. */ AIJ = AMAX; CMAX = ONE; /* cmax = ZERO; for(l = lc1 + 1; l <= lc2; l++) cmax = max( cmax, abs( a(l) ) ) cmax = cmax / amax; */ } else { /* aij is not the biggest element, so cmax .ge. 1. Bail out if cmax will be too big. */ AIJ = fabs(LUSOL->a[LC]); if(AIJparmlu[LUSOL_RP_GAMMA] && CMAX<=LUSOL->parmlu[LUSOL_RP_GAMMA]) { if(ABEST>=AIJ) continue; } else { if(LBEST<=CMAX) continue; } } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; *MBEST = MERIT; ABEST = AIJ; LBEST = CMAX; /* Col or row of length 1 */ if(MERIT==0) goto x900; } if(NCOL>=MAXCOL) goto x900; } x900: ; } /* ================================================================== lu1mRP uses a Markowitz criterion to select a pivot element for the next stage of a sparse LU factorization, subject to a Threshold Rook Pivoting stability criterion (TRP) that bounds the elements of L and U. ------------------------------------------------------------------ 11 Jun 2002: First version of lu1mRP derived from lu1mar. 11 Jun 2002: Current version of lu1mRP. ================================================================== */ void LU1MRP(LUSOLrec *LUSOL, int MAXMN, REAL LTOL, int MAXCOL, int MAXROW, int *IBEST, int *JBEST, int *MBEST, REAL AMAXR[]) { int I, J, KBEST, LC, LC1, LC2, LEN1, LP, LP1, LP2, LQ, LQ1, LQ2, LR, LR1, LR2, MERIT, NCOL, NROW, NZ, NZ1; REAL ABEST, AIJ, AMAX, ATOLI, ATOLJ; /* ------------------------------------------------------------------ Search cols of length nz = 1, then rows of length nz = 1, then cols of length nz = 2, then rows of length nz = 2, etc. ------------------------------------------------------------------ */ ABEST = ZERO; *IBEST = 0; KBEST = MAXMN+1; *MBEST = -1; NCOL = 0; NROW = 0; NZ1 = 0; for(NZ = 1; NZ <= MAXMN; NZ++) { /* nz1 = nz - 1 if (mbest .le. nz1**2) go to 900 */ if(KBEST<=NZ1) goto x900; if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } if(NZ>LUSOL->m) goto x200; /* --------------------------------------------------------------- Search the set of columns of length nz. --------------------------------------------------------------- */ LQ1 = LUSOL->iqloc[NZ]; LQ2 = LUSOL->n; if(NZm) LQ2 = LUSOL->iqloc[NZ+1]-1; for(LQ = LQ1; LQ <= LQ2; LQ++) { NCOL = NCOL+1; J = LUSOL->iq[LQ]; LC1 = LUSOL->locc[J]; LC2 = LC1+NZ1; AMAX = fabs(LUSOL->a[LC1]); /* Min size of pivots in col j */ ATOLJ = AMAX/LTOL; /* Test all aijs in this column. */ for(LC = LC1; LC <= LC2; LC++) { I = LUSOL->indc[LC]; LEN1 = LUSOL->lenr[I]-1; /* merit = nz1 * len1 if (merit .gt. mbest) continue; */ if(LEN1>KBEST) continue; /* aij has a promising merit. Apply the Threshold Rook Pivoting stability test. First we require aij to be sufficiently large compared to other nonzeros in column j. Then we require aij to be sufficiently large compared to other nonzeros in row i. */ AIJ = fabs(LUSOL->a[LC]); if(AIJ=AIJ) continue; } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; KBEST = LEN1; *MBEST = MERIT; ABEST = AIJ; if(NZ==1) goto x900; } /* Finished with that column. */ if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } } /* --------------------------------------------------------------- Search the set of rows of length nz. --------------------------------------------------------------- */ x200: /* if (mbest .le. nz*nz1) go to 900 */ if(KBEST<=NZ) goto x900; if(*IBEST>0) { if(NROW>=MAXROW) goto x290; } if(NZ>LUSOL->n) goto x290; LP1 = LUSOL->iploc[NZ]; LP2 = LUSOL->m; if(NZn) LP2 = LUSOL->iploc[NZ+1]-1; for(LP = LP1; LP <= LP2; LP++) { NROW = NROW+1; I = LUSOL->ip[LP]; LR1 = LUSOL->locr[I]; LR2 = LR1+NZ1; /* Min size of pivots in row i */ ATOLI = AMAXR[I]/LTOL; for(LR = LR1; LR <= LR2; LR++) { J = LUSOL->indr[LR]; LEN1 = LUSOL->lenc[J]-1; /* merit = nz1 * len1 if (merit .gt. mbest) continue; */ if(LEN1>KBEST) continue; /* aij has a promising merit. Find where aij is in column j. */ LC1 = LUSOL->locc[J]; LC2 = LC1+LEN1; AMAX = fabs(LUSOL->a[LC1]); for(LC = LC1; LC <= LC2; LC++) { if(LUSOL->indc[LC]==I) break; } /* Apply the Threshold Rook Pivoting stability test. First we require aij to be sufficiently large compared to other nonzeros in row i. Then we require aij to be sufficiently large compared to other nonzeros in column j. */ AIJ = fabs(LUSOL->a[LC]); if(AIJ=AIJ) continue; } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; KBEST = LEN1; *MBEST = MERIT; ABEST = AIJ; if(NZ==1) goto x900; } /* Finished with that row. */ if(*IBEST>0) { if(NROW>=MAXROW) goto x290; } } /* See if it's time to quit. */ x290: if(*IBEST>0) { if(NROW>=MAXROW && NCOL>=MAXCOL) goto x900; } /* Press on with next nz. */ NZ1 = NZ; if(*IBEST>0) KBEST = *MBEST/NZ1; } x900: ; } /* ================================================================== lu1mSP is intended for symmetric matrices that are either definite or quasi-definite. lu1mSP uses a Markowitz criterion to select a pivot element for the next stage of a sparse LU factorization of a symmetric matrix, subject to a Threshold Symmetric Pivoting stability criterion (TSP) restricted to diagonal elements to preserve symmetry. This bounds the elements of L and U and should have rank-revealing properties analogous to Threshold Rook Pivoting for unsymmetric matrices. ------------------------------------------------------------------ 14 Dec 2002: First version of lu1mSP derived from lu1mRP. There is no safeguard to ensure that A is symmetric. 14 Dec 2002: Current version of lu1mSP. ================================================================== */ void LU1MSP(LUSOLrec *LUSOL, int MAXMN, REAL LTOL, int MAXCOL, int *IBEST, int *JBEST, int *MBEST) { int I, J, KBEST, LC, LC1, LC2, LQ, LQ1, LQ2, MERIT, NCOL, NZ, NZ1; REAL ABEST, AIJ, AMAX, ATOLJ; /* ------------------------------------------------------------------ Search cols of length nz = 1, then cols of length nz = 2, etc. ------------------------------------------------------------------ */ ABEST = ZERO; *IBEST = 0; *MBEST = -1; KBEST = MAXMN+1; NCOL = 0; NZ1 = 0; for(NZ = 1; NZ <= MAXMN; NZ++) { /* nz1 = nz - 1 if (mbest .le. nz1**2) go to 900 */ if(KBEST<=NZ1) goto x900; if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } if(NZ>LUSOL->m) goto x200; /* --------------------------------------------------------------- Search the set of columns of length nz. --------------------------------------------------------------- */ LQ1 = LUSOL->iqloc[NZ]; LQ2 = LUSOL->n; if(NZm) LQ2 = LUSOL->iqloc[NZ+1]-1; for(LQ = LQ1; LQ <= LQ2; LQ++) { NCOL++; J = LUSOL->iq[LQ]; LC1 = LUSOL->locc[J]; LC2 = LC1+NZ1; AMAX = fabs(LUSOL->a[LC1]); /* Min size of pivots in col j */ ATOLJ = AMAX/LTOL; /* Test all aijs in this column. Ignore everything except the diagonal. */ for(LC = LC1; LC <= LC2; LC++) { I = LUSOL->indc[LC]; /* Skip off-diagonals. */ if(I!=J) continue; /* merit = nz1 * nz1 if (merit .gt. mbest) continue; */ if(NZ1>KBEST) continue; /* aij has a promising merit. Apply the Threshold Partial Pivoting stability test (which is equivalent to Threshold Rook Pivoting for symmetric matrices). We require aij to be sufficiently large compared to other nonzeros in column j. */ AIJ = fabs(LUSOL->a[LC]); if(AIJ=AIJ) continue; } /* aij is the best pivot so far. */ *IBEST = I; *JBEST = J; KBEST = NZ1; *MBEST = MERIT; ABEST = AIJ; if(NZ==1) goto x900; } /* Finished with that column. */ if(*IBEST>0) { if(NCOL>=MAXCOL) goto x200; } } /* See if it's time to quit. */ x200: if(*IBEST>0) { if(NCOL>=MAXCOL) goto x900; } /* Press on with next nz. */ NZ1 = NZ; if(*IBEST>0) KBEST = *MBEST/NZ1; } x900: ; } /* ================================================================== lu1mxc moves the largest element in each of columns iq(k1:k2) to the top of its column. If k1 > k2, nothing happens. ------------------------------------------------------------------ 06 May 2002: (and earlier) All columns k1:k2 must have one or more elements. 07 May 2002: Allow for empty columns. The heap routines need to find 0.0 as the "largest element". 29 Nov 2005: Bug fix - avoiding overwriting the next column when the current column is empty (i.e. LENJ==0) Yin Zhang ================================================================== */ void LU1MXC(LUSOLrec *LUSOL, int K1, int K2, int IX[]) { int I, J, K, L, LC, LENJ; REAL AMAX; for(K = K1; K <= K2; K++) { J = IX[K]; LC = LUSOL->locc[J]; LENJ = LUSOL->lenc[J]; if(LENJ==0) /* LUSOL->a[LC] = ZERO; Removal suggested by Yin Zhang to avoid overwriting next column when current is empty */ ; else { L = idamax(LUSOL->lenc[J], LUSOL->a + LC - LUSOL_ARRAYOFFSET,1) + LC - 1; if(L>LC) { AMAX = LUSOL->a[L]; LUSOL->a[L] = LUSOL->a[LC]; LUSOL->a[LC] = AMAX; I = LUSOL->indc[L]; LUSOL->indc[L] = LUSOL->indc[LC]; LUSOL->indc[LC] = I; } } } } /* ================================================================== lu1mxr finds the largest element in each of row ip(k1:k2) and stores it in Amaxr(*). The nonzeros are stored column-wise in (a,indc,lenc,locc) and their structure is row-wise in ( indr,lenr,locr). If k1 > k2, nothing happens. ------------------------------------------------------------------ 11 Jun 2002: First version of lu1mxr. Allow for empty columns. ================================================================== */ void LU1MXR(LUSOLrec *LUSOL, int K1, int K2, int IX[], REAL AMAXR[]) { #define FastMXR #ifdef FastMXR static int I, *J, *IC, K, LC, LC1, LC2, LR, LR1, LR2; static REAL AMAX; #else int I, J, K, LC, LC1, LC2, LR, LR1, LR2; REAL AMAX; #endif for(K = K1; K <= K2; K++) { AMAX = ZERO; I = IX[K]; /* Find largest element in row i. */ LR1 = LUSOL->locr[I]; LR2 = (LR1+LUSOL->lenr[I])-1; #ifdef FastMXR for(LR = LR1, J = LUSOL->indr + LR1; LR <= LR2; LR++, J++) { /* Find where aij is in column j. */ LC1 = LUSOL->locc[*J]; LC2 = LC1+LUSOL->lenc[*J]; for(LC = LC1, IC = LUSOL->indc + LC1; LC < LC2; LC++, IC++) { if(*IC==I) break; } SETMAX(AMAX,fabs(LUSOL->a[LC])); } #else for(LR = LR1; LR <= LR2; LR++) { J = LUSOL->indr[LR]; /* Find where aij is in column j. */ LC1 = LUSOL->locc[J]; LC2 = (LC1+LUSOL->lenc[J])-1; for(LC = LC1; LC <= LC2; LC++) { if(LUSOL->indc[LC]==I) break; } SETMAX(AMAX,fabs(LUSOL->a[LC])); } #endif AMAXR[I] = AMAX; } } /* ================================================================== lu1ful computes a dense (full) LU factorization of the mleft by nleft matrix that remains to be factored at the beginning of the nrowu-th pass through the main loop of lu1fad. ------------------------------------------------------------------ 02 May 1989: First version. 05 Feb 1994: Column interchanges added to lu1DPP. 08 Feb 1994: ipinv reconstructed, since lu1pq3 may alter ip. ================================================================== */ void LU1FUL(LUSOLrec *LUSOL, int LEND, int LU1, MYBOOL TPP, int MLEFT, int NLEFT, int NRANK, int NROWU, int *LENL, int *LENU, int *NSING, MYBOOL KEEPLU, REAL SMALL, REAL D[], int IPVT[]) { int L, I, J, IPBASE, LDBASE, LQ, LC1, LC2, LC, LD, LKK, LKN, LU, K, L1, L2, IBEST, JBEST, LA, LL, NROWD, NCOLD; REAL AI, AJ; /* ------------------------------------------------------------------ If lu1pq3 moved any empty rows, reset ipinv = inverse of ip. ------------------------------------------------------------------ */ if(NRANKm) { for(L = 1; L <= LUSOL->m; L++) { I = LUSOL->ip[L]; LUSOL->ipinv[I] = L; } } /* ------------------------------------------------------------------ Copy the remaining matrix into the dense matrix D. ------------------------------------------------------------------ */ #ifdef LUSOLFastClear MEMCLEAR((D+1), LEND); #else /* dload(LEND, ZERO, D, 1); */ for(J = 1; J <= LEND; J++) D[J] = ZERO; #endif IPBASE = NROWU-1; LDBASE = 1-NROWU; for(LQ = NROWU; LQ <= LUSOL->n; LQ++) { J = LUSOL->iq[LQ]; LC1 = LUSOL->locc[J]; LC2 = (LC1+LUSOL->lenc[J])-1; for(LC = LC1; LC <= LC2; LC++) { I = LUSOL->indc[LC]; LD = LDBASE+LUSOL->ipinv[I]; D[LD] = LUSOL->a[LC]; } LDBASE += MLEFT; } /* ------------------------------------------------------------------ Call our favorite dense LU factorizer. ------------------------------------------------------------------ */ if(TPP) LU1DPP(LUSOL, D,MLEFT,MLEFT,NLEFT,SMALL,NSING,IPVT,LUSOL->iq+NROWU-LUSOL_ARRAYOFFSET); else LU1DCP(LUSOL, D,MLEFT,MLEFT,NLEFT,SMALL,NSING,IPVT,LUSOL->iq+NROWU-LUSOL_ARRAYOFFSET); /* ------------------------------------------------------------------ Move D to the beginning of A, and pack L and U at the top of a, indc, indr. In the process, apply the row permutation to ip. lkk points to the diagonal of U. ------------------------------------------------------------------ */ #ifdef LUSOLFastCopy MEMCOPY(LUSOL->a+1,D+1,LEND); #else dcopy(LEND,D,1,LUSOL->a,1); #endif #ifdef ClassicdiagU LUSOL->diagU = LUSOL->a + (LUSOL->lena-LUSOL->n); #endif LKK = 1; LKN = (LEND-MLEFT)+1; LU = LU1; for(K = 1; K <= MIN(MLEFT,NLEFT); K++) { L1 = IPBASE+K; L2 = IPBASE+IPVT[K]; if(L1!=L2) { I = LUSOL->ip[L1]; LUSOL->ip[L1] = LUSOL->ip[L2]; LUSOL->ip[L2] = I; } IBEST = LUSOL->ip[L1]; JBEST = LUSOL->iq[L1]; if(KEEPLU) { /* =========================================================== Pack the next column of L. =========================================================== */ LA = LKK; LL = LU; NROWD = 1; for(I = K+1; I <= MLEFT; I++) { LA++; AI = LUSOL->a[LA]; if(fabs(AI)>SMALL) { NROWD = NROWD+1; LL--; LUSOL->a[LL] = AI; LUSOL->indc[LL] = LUSOL->ip[IPBASE+I]; LUSOL->indr[LL] = IBEST; } } /* =========================================================== Pack the next row of U. We go backwards through the row of D so the diagonal ends up at the front of the row of U. Beware -- the diagonal may be zero. =========================================================== */ LA = LKN+MLEFT; LU = LL; NCOLD = 0; for(J = NLEFT; J >= K; J--) { LA = LA-MLEFT; AJ = LUSOL->a[LA]; if(fabs(AJ)>SMALL || J==K) { NCOLD++; LU--; LUSOL->a[LU] = AJ; LUSOL->indr[LU] = LUSOL->iq[IPBASE+J]; } } LUSOL->lenr[IBEST] = -NCOLD; LUSOL->lenc[JBEST] = -NROWD; *LENL = ((*LENL)+NROWD)-1; *LENU = (*LENU)+NCOLD; LKN++; } else { /* =========================================================== Store just the diagonal of U, in natural order. =========================================================== */ LUSOL->diagU[JBEST] = LUSOL->a[LKK]; } LKK += MLEFT+1; } } /* ================================================================== lu1or1 organizes the elements of an m by n matrix A as follows. On entry, the parallel arrays a, indc, indr, contain nelem entries of the form aij, i, j, in any order. nelem must be positive. Entries not larger than the input parameter small are treated as zero and removed from a, indc, indr. The remaining entries are defined to be nonzero. numnz returns the number of such nonzeros and Amax returns the magnitude of the largest nonzero. The arrays lenc, lenr return the number of nonzeros in each column and row of A. inform = 0 on exit, except inform = 1 if any of the indices in indc, indr imply that the element aij lies outside the m by n dimensions of A. ------------------------------------------------------------------ xx Feb 1985: Original version. 17 Oct 2000: a, indc, indr now have size lena to allow nelem = 0. ================================================================== */ void LU1OR1(LUSOLrec *LUSOL, REAL SMALL, REAL *AMAX, int *NUMNZ, int *LERR, int *INFORM) { int I, J, L, LDUMMY; #ifdef LUSOLFastClear MEMCLEAR((LUSOL->lenr+1), LUSOL->m); MEMCLEAR((LUSOL->lenc+1), LUSOL->n); #else for(I = 1; I <= LUSOL->m; I++) LUSOL->lenr[I] = ZERO; for(I = 1; I <= LUSOL->n; I++) LUSOL->lenc[I] = ZERO; #endif *AMAX = 0; *NUMNZ = LUSOL->nelem; L = LUSOL->nelem+1; for(LDUMMY = 1; LDUMMY <= LUSOL->nelem; LDUMMY++) { L--; if(fabs(LUSOL->a[L])>SMALL) { I = LUSOL->indc[L]; J = LUSOL->indr[L]; SETMAX(*AMAX,fabs(LUSOL->a[L])); if(I<1 || I>LUSOL->m) goto x910; if(J<1 || J>LUSOL->n) goto x910; LUSOL->lenr[I]++; LUSOL->lenc[J]++; } else { /* Replace a negligible element by last element. Since we are going backwards, we know the last element is ok. */ LUSOL->a[L] = LUSOL->a[*NUMNZ]; LUSOL->indc[L] = LUSOL->indc[*NUMNZ]; LUSOL->indr[L] = LUSOL->indr[*NUMNZ]; (*NUMNZ)--; } } *LERR = 0; *INFORM = LUSOL_INFORM_LUSUCCESS; return; x910: *LERR = L; *INFORM = LUSOL_INFORM_LUSINGULAR; } /* ================================================================== lu1or2 sorts a list of matrix elements a(i,j) into column order, given numa entries a(i,j), i, j in the parallel arrays a, inum, jnum respectively. The matrix is assumed to have n columns and an arbitrary number of rows. On entry, len(*) must contain the length of each column. On exit, a(*) and inum(*) are sorted, jnum(*) = 0, and loc(j) points to the start of column j. lu1or2 is derived from mc20ad, a routine in the Harwell Subroutine Library, author J. K. Reid. ------------------------------------------------------------------ xx Feb 1985: Original version. 17 Oct 2000: a, inum, jnum now have size lena to allow nelem = 0. ================================================================== */ void LU1OR2(LUSOLrec *LUSOL) { REAL ACE, ACEP; int L, J, I, JCE, ICE, ICEP, JCEP, JA, JB; /* Set loc(j) to point to the beginning of column j. */ L = 1; for(J = 1; J <= LUSOL->n; J++) { LUSOL->locc[J] = L; L += LUSOL->lenc[J]; } /* Sort the elements into column order. The algorithm is an in-place sort and is of order numa. */ for(I = 1; I <= LUSOL->nelem; I++) { /* Establish the current entry. */ JCE = LUSOL->indr[I]; if(JCE==0) continue; ACE = LUSOL->a[I]; ICE = LUSOL->indc[I]; LUSOL->indr[I] = 0; /* Chain from current entry. */ for(J = 1; J <= LUSOL->nelem; J++) { /* The current entry is not in the correct position. Determine where to store it. */ L = LUSOL->locc[JCE]; LUSOL->locc[JCE]++; /* Save the contents of that location. */ ACEP = LUSOL->a[L]; ICEP = LUSOL->indc[L]; JCEP = LUSOL->indr[L]; /* Store current entry. */ LUSOL->a[L] = ACE; LUSOL->indc[L] = ICE; LUSOL->indr[L] = 0; /* If next current entry needs to be processed, copy it into current entry. */ if(JCEP==0) break; ACE = ACEP; ICE = ICEP; JCE = JCEP; } } /* Reset loc(j) to point to the start of column j. */ JA = 1; for(J = 1; J <= LUSOL->n; J++) { JB = LUSOL->locc[J]; LUSOL->locc[J] = JA; JA = JB; } } /* ================================================================== lu1or3 looks for duplicate elements in an m by n matrix A defined by the column list indc, lenc, locc. iw is used as a work vector of length m. ------------------------------------------------------------------ xx Feb 1985: Original version. 17 Oct 2000: indc, indr now have size lena to allow nelem = 0. ================================================================== */ void LU1OR3(LUSOLrec *LUSOL, int *LERR, int *INFORM) { int I, J, L1, L2, L; #ifdef LUSOLFastClear MEMCLEAR((LUSOL->ip+1), LUSOL->m); #else for(I = 1; I <= LUSOL->m; I++) LUSOL->ip[I] = ZERO; #endif for(J = 1; J <= LUSOL->n; J++) { if(LUSOL->lenc[J]>0) { L1 = LUSOL->locc[J]; L2 = (L1+LUSOL->lenc[J])-1; for(L = L1; L <= L2; L++) { I = LUSOL->indc[L]; if(LUSOL->ip[I]==J) goto x910; LUSOL->ip[I] = J; } } } *INFORM = LUSOL_INFORM_LUSUCCESS; return; x910: *LERR = L; *INFORM = LUSOL_INFORM_LUSINGULAR; } /* ================================================================== lu1or4 constructs a row list indr, locr from a corresponding column list indc, locc, given the lengths of both columns and rows in lenc, lenr. ------------------------------------------------------------------ xx Feb 1985: Original version. 17 Oct 2000: indc, indr now have size lena to allow nelem = 0. ================================================================== */ void LU1OR4(LUSOLrec *LUSOL) { int L, I, L2, J, JDUMMY, L1, LR; /* Initialize locr(i) to point just beyond where the last component of row i will be stored. */ L = 1; for(I = 1; I <= LUSOL->m; I++) { L += LUSOL->lenr[I]; LUSOL->locr[I] = L; } /* By processing the columns backwards and decreasing locr(i) each time it is accessed, it will end up pointing to the beginning of row i as required. */ L2 = LUSOL->nelem; J = LUSOL->n+1; for(JDUMMY = 1; JDUMMY <= LUSOL->n; JDUMMY++) { J = J-1; if(LUSOL->lenc[J]>0) { L1 = LUSOL->locc[J]; for(L = L1; L <= L2; L++) { I = LUSOL->indc[L]; LR = LUSOL->locr[I]-1; LUSOL->locr[I] = LR; LUSOL->indr[LR] = J; } L2 = L1-1; } } } /* ================================================================== lu1pen deals with pending fill-in in the row file. ------------------------------------------------------------------ ifill(ll) says if a row involved in the new column of L has to be updated. If positive, it is the total length of the final updated row. jfill(lu) says if a column involved in the new row of U contains any pending fill-ins. If positive, it points to the first fill-in in the column that has yet to be added to the row file. ------------------------------------------------------------------ 16 Apr 1989: First version of lu1pen. 23 Mar 2001: ilast used and updated. ================================================================== */ void LU1PEN(LUSOLrec *LUSOL, int NSPARE, int *ILAST, int LPIVC1, int LPIVC2, int LPIVR1, int LPIVR2, int *LROW, int IFILL[], int JFILL[]) { int LL, LC, L, I, LR1, LR2, LR, LU, J, LC1, LC2, LAST; LL = 0; for(LC = LPIVC1; LC <= LPIVC2; LC++) { LL++; if(IFILL[LL]==0) continue; /* Another row has pending fill. First, add some spare space at the } of the current last row. */ #if 1 LC1 = (*LROW)+1; LC2 = (*LROW)+NSPARE; *LROW = LC2; for(L = LC1; L <= LC2; L++) { #else for(L = (*LROW)+1; L <= (*LROW)+NSPARE; L++) { *LROW = L; /* ******* ERROR ???? */ #endif LUSOL->indr[L] = 0; } /* Now move row i to the end of the row file. */ I = LUSOL->indc[LC]; *ILAST = I; LR1 = LUSOL->locr[I]; LR2 = (LR1+LUSOL->lenr[I])-1; LUSOL->locr[I] = (*LROW)+1; for(LR = LR1; LR <= LR2; LR++) { (*LROW)++; LUSOL->indr[*LROW] = LUSOL->indr[LR]; LUSOL->indr[LR] = 0; } (*LROW) += IFILL[LL]; } /* Scan all columns of D and insert the pending fill-in into the row file. */ LU = 1; for(LR = LPIVR1; LR <= LPIVR2; LR++) { LU++; if(JFILL[LU]==0) continue; J = LUSOL->indr[LR]; LC1 = (LUSOL->locc[J]+JFILL[LU])-1; LC2 = (LUSOL->locc[J]+LUSOL->lenc[J])-1; for(LC = LC1; LC <= LC2; LC++) { I = LUSOL->indc[LC]-LUSOL->m; if(I>0) { LUSOL->indc[LC] = I; LAST = LUSOL->locr[I]+LUSOL->lenr[I]; LUSOL->indr[LAST] = J; LUSOL->lenr[I]++; } } } } /* ================================================================== lu1fad is a driver for the numerical phase of lu1fac. At each stage it computes a column of L and a row of U, using a Markowitz criterion to select the pivot element, subject to a stability criterion that bounds the elements of L. ------------------------------------------------------------------ Local variables --------------- lcol is the length of the column file. It points to the last nonzero in the column list. lrow is the analogous quantity for the row file. lfile is the file length (lcol or lrow) after the most recent compression of the column list or row list. nrowd and ncold are the number of rows and columns in the matrix defined by the pivot column and row. They are the dimensions of the submatrix D being altered at this stage. melim and nelim are the number of rows and columns in the same matrix D, excluding the pivot column and row. mleft and nleft are the number of rows and columns still left to be factored. nzchng is the increase in nonzeros in the matrix that remains to be factored after the current elimination (usually negative). nzleft is the number of nonzeros still left to be factored. nspare is the space we leave at the end of the last row or column whenever a row or column is being moved to the } of its file. nspare = 1 or 2 might help reduce the number of file compressions when storage is tight. The row and column ordering permutes A into the form ------------------------ \ | \ U1 | \ | -------------------- |\ | \ | \ P A Q = | \ | \ | -------------- | | | | | | | L1 | A2 | | | | | | | -------------------- where the block A2 is factored as A2 = L2 U2. The phases of the factorization are as follows. Utri is true when U1 is being determined. Any column of length 1 is accepted immediately (if TPP). Ltri is true when L1 is being determined. lu1mar exits as soon as an acceptable pivot is found in a row of length 1. spars1 is true while the density of the (modified) A2 is less than the parameter dens1 = parmlu(7) = 0.3 say. lu1mar searches maxcol columns and maxrow rows, where maxcol = luparm(3), maxrow = maxcol - 1. lu1mxc is used to keep the biggest element at the top of all remaining columns. spars2 is true while the density of the modified A2 is less than the parameter dens2 = parmlu(8) = 0.6 say. lu1mar searches maxcol columns and no rows. lu1mxc could fix up only the first maxcol cols (with TPP). 22 Sep 2000: For simplicity, lu1mxc fixes all modified cols. dense is true once the density of A2 reaches dens2. lu1mar searches only 1 column (the shortest). lu1mxc could fix up only the first column (with TPP). ------------------------------------------------------------------ 00 Jan 1986 Version documented in LUSOL paper: Gill, Murray, Saunders and Wright (1987), Maintaining LU factors of a general sparse matrix, Linear algebra and its applications 88/89, 239-270. 02 Feb 1989 Following Suhl and Aittoniemi (1987), the largest element in each column is now kept at the start of the column, i.e. in position locc(j) of a and indc. This should speed up the Markowitz searches. To save time on highly triangular matrices, we wait until there are no further columns of length 1 before setting and maintaining that property. 12 Apr 1989 ipinv and iqinv added (inverses of ip and iq) to save searching ip and iq for rows and columns altered in each elimination step. (Used in lu1pq2) 19 Apr 1989 Code segmented to reduce its size. lu1gau does most of the Gaussian elimination work. lu1mar does just the Markowitz search. lu1mxc moves biggest elements to top of columns. lu1pen deals with pending fill-in in the row list. lu1pq2 updates the row and column permutations. 26 Apr 1989 maxtie replaced by maxcol, maxrow in the Markowitz search. maxcol, maxrow change as density increases. 25 Oct 1993 keepLU implemented. 07 Feb 1994 Exit main loop early to finish off with a dense LU. densLU tells lu1fad whether to do it. 21 Dec 1994 Bug fixed. nrank was wrong after the call to lu1ful. 12 Nov 1999 A parallel version of dcopy gave trouble in lu1ful during left-shift of dense matrix D within a(*). Fixed this unexpected problem here in lu1fad by making sure the first and second D don't overlap. 13 Sep 2000 TCP (Threshold Complete Pivoting) implemented. lu2max added (finds aijmax from biggest elems in each col). Utri, Ltri and Spars1 phases apply. No switch to Dense CP yet. (Only TPP switches.) 14 Sep 2000 imax needed to remember row containing aijmax. 22 Sep 2000 For simplicity, lu1mxc always fixes all modified cols. (TPP spars2 used to fix just the first maxcol cols.) 08 Nov 2000: Speed up search for aijmax. Don't need to search all columns if the elimination didn't alter the col containing the current aijmax. 21 Nov 2000: lu1slk implemented for Utri phase with TCP to guard against deceptive triangular matrices. (Utri used to have aijtol >= 0.9999 to include slacks, but this allows other 1s to be accepted.) Utri now accepts slacks, but applies normal aijtol test to other pivots. 28 Nov 2000: TCP with empty cols must call lu1mxc and lu2max with ( lq1, n, ... ), not just ( 1, n, ... ). 23 Mar 2001: lu1fad bug with TCP. A col of length 1 might not be accepted as a pivot. Later it appears in a pivot row and temporarily has length 0 (when pivot row is removed but before the column is filled in). If it is the last column in storage, the preceding col also thinks it is "last". Trouble arises when the preceding col needs fill-in -- it overlaps the real "last" column. (Very rarely, same trouble might have happened if the drop tolerance caused columns to have length 0.) Introduced ilast to record the last row in row file, jlast to record the last col in col file. lu1rec returns ilast = indr(lrow + 1) or jlast = indc(lcol + 1). (Should be an output parameter, but didn't want to alter lu1rec's parameter list.) lu1rec also treats empty rows or cols safely. (Doesn't eliminate them!) 26 Apr 2002: Heap routines added for TCP. lu2max no longer needed. imax, jmax used only for printing. 01 May 2002: lu1DCP implemented (dense complete pivoting). Both TPP and TCP now switch to dense LU when density exceeds dens2. 06 May 2002: In dense mode, store diag(U) in natural order. 09 May 2002: lu1mCP implemented (Markowitz TCP via heap). 11 Jun 2002: lu1mRP implemented (Markowitz TRP). 28 Jun 2002: Fixed call to lu1mxr. 14 Dec 2002: lu1mSP implemented (Markowitz TSP). 15 Dec 2002: Both TPP and TSP can grab cols of length 1 during Utri. ================================================================== */ void LU1FAD(LUSOLrec *LUSOL, #ifdef ClassicHamaxR int LENA2, int LENH, REAL HA[], int HJ[], int HK[], REAL AMAXR[], #endif int *INFORM, int *LENL, int *LENU, int *MINLEN, int *MERSUM, int *NUTRI, int *NLTRI, int *NDENS1, int *NDENS2, int *NRANK, REAL *LMAX, REAL *UMAX, REAL *DUMAX, REAL *DUMIN, REAL *AKMAX) { MYBOOL UTRI, LTRI, SPARS1, SPARS2, DENSE, DENSLU, KEEPLU, TCP, TPP, TRP,TSP; int HLEN, HOPS, H, LPIV, LPRINT, MAXCOL, MAXROW, ILAST, JLAST, LFILE, LROW, LCOL, MINMN, MAXMN, NZLEFT, NSPARE, LU1, KK, J, LC, MLEFT, NLEFT, NROWU, LQ1, LQ2, JBEST, LQ, I, IBEST, MBEST, LEND, NFREE, LD, NCOLD, NROWD, MELIM, NELIM, JMAX, IMAX, LL1, LSAVE, LFREE, LIMIT, MINFRE, LPIVR, LPIVR1, LPIVR2, L, LPIVC, LPIVC1, LPIVC2, KBEST, LU, LR, LENJ, LC1, LAST, LL, LS, LENI, LR1, LFIRST, NFILL, NZCHNG, K, MRANK, NSING; REAL LIJ, LTOL, SMALL, USPACE, DENS1, DENS2, AIJMAX, AIJTOL, AMAX, ABEST, DIAG, V; #ifdef ClassicHamaxR int LDIAGU; #else int LENA2 = LUSOL->lena; #endif #ifdef UseTimer int eltime, mktime, ntime; timer ( "start", 3 ); ntime = LUSOL->n / 4; #endif #ifdef ForceInitialization AIJMAX = 0; AIJTOL = 0; HLEN = 0; JBEST = 0; IBEST = 0; MBEST = 0; LEND = 0; LD = 0; #endif LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; MAXCOL = LUSOL->luparm[LUSOL_IP_MARKOWITZ_MAXCOL]; LPIV = LUSOL->luparm[LUSOL_IP_PIVOTTYPE]; KEEPLU = (MYBOOL) (LUSOL->luparm[LUSOL_IP_KEEPLU]!=FALSE); /* Threshold Partial Pivoting (normal). */ TPP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TPP); /* Threshold Rook Pivoting */ TRP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TRP); /* Threshold Complete Pivoting. */ TCP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TCP); /* Threshold Symmetric Pivoting. */ TSP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TSP); DENSLU = FALSE; MAXROW = MAXCOL-1; /* Assume row m is last in the row file. */ ILAST = LUSOL->m; /* Assume col n is last in the col file. */ JLAST = LUSOL->n; LFILE = LUSOL->nelem; LROW = LUSOL->nelem; LCOL = LUSOL->nelem; MINMN = MIN(LUSOL->m,LUSOL->n); MAXMN = MAX(LUSOL->m,LUSOL->n); NZLEFT = LUSOL->nelem; NSPARE = 1; if(KEEPLU) LU1 = LENA2+1; else { /* Store only the diagonals of U in the top of memory. */ #ifdef ClassicdiagU LDIAGU = LENA2-LUSOL->n; LU1 = LDIAGU+1; LUSOL->diagU = LUSOL->a+LDIAGU; #else LU1 = LENA2+1; #endif } LTOL = LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; USPACE = LUSOL->parmlu[LUSOL_RP_COMPSPACE_U]; DENS1 = LUSOL->parmlu[LUSOL_RP_MARKOWITZ_CONLY]; DENS2 = LUSOL->parmlu[LUSOL_RP_MARKOWITZ_DENSE]; UTRI = TRUE; LTRI = FALSE; SPARS1 = FALSE; SPARS2 = FALSE; DENSE = FALSE; /* Check parameters. */ SETMAX(LTOL,1.0001E+0); SETMIN(DENS1,DENS2); /* Initialize output parameters. lenL, lenU, minlen, mersum, nUtri, nLtri, ndens1, ndens2, nrank are already initialized by lu1fac. */ *LMAX = ZERO; *UMAX = ZERO; *DUMAX = ZERO; *DUMIN = LUSOL_BIGNUM; if(LUSOL->nelem==0) *DUMIN = ZERO; *AKMAX = ZERO; HOPS = 0; /* More initialization. Don't worry yet about lu1mxc. */ if(TPP || TSP) { AIJMAX = ZERO; AIJTOL = ZERO; HLEN = 1; /* TRP or TCP */ } else { /* Move biggest element to top of each column. Set w(*) to mark slack columns (unit vectors). */ LU1MXC(LUSOL, 1,LUSOL->n,LUSOL->iq); LU1SLK(LUSOL); } if(TRP) /* Find biggest element in each row. */ #ifdef ClassicHamaxR LU1MXR(LUSOL, 1,LUSOL->m,LUSOL->ip,AMAXR); #else LU1MXR(LUSOL, 1,LUSOL->m,LUSOL->ip,LUSOL->amaxr); #endif if(TCP) { /* Set Ha(1:Hlen) = biggest element in each column, Hj(1:Hlen) = corresponding column indices. */ HLEN = 0; for(KK = 1; KK <= LUSOL->n; KK++) { HLEN++; J = LUSOL->iq[KK]; LC = LUSOL->locc[J]; #ifdef ClassicHamaxR HA[HLEN] = fabs(LUSOL->a[LC]); HJ[HLEN] = J; HK[J] = HLEN; #else LUSOL->Ha[HLEN] = fabs(LUSOL->a[LC]); LUSOL->Hj[HLEN] = J; LUSOL->Hk[J] = HLEN; #endif } /* Build the heap, creating new Ha, Hj and setting Hk(1:Hlen). */ #ifdef ClassicHamaxR HBUILD(HA,HJ,HK,HLEN,&HOPS); #else HBUILD(LUSOL->Ha,LUSOL->Hj,LUSOL->Hk,HLEN,&HOPS); #endif } /* ------------------------------------------------------------------ Start of main loop. ------------------------------------------------------------------ */ MLEFT = LUSOL->m+1; NLEFT = LUSOL->n+1; for(NROWU = 1; NROWU <= MINMN; NROWU++) { #ifdef UseTimer mktime = (nrowu / ntime) + 4; eltime = (nrowu / ntime) + 9; #endif MLEFT--; NLEFT--; /* Bail out if there are no nonzero rows left. */ if(LUSOL->iploc[1]>LUSOL->m) goto x900; /* For TCP, the largest Aij is at the top of the heap. */ if(TCP) { /* Marvelously easy */ #ifdef ClassicHamaxR AIJMAX = HA[1]; #else AIJMAX = LUSOL->Ha[1]; #endif SETMAX(*AKMAX,AIJMAX); AIJTOL = AIJMAX/LTOL; } /* =============================================================== Find a suitable pivot element. =============================================================== */ if(UTRI) { /* ------------------------------------------------------------ So far all columns have had length 1. We are still looking for the (backward) triangular part of A that forms the first rows and columns of U. ------------------------------------------------------------ */ LQ1 = LUSOL->iqloc[1]; LQ2 = LUSOL->n; if(LUSOL->m>1) LQ2 = LUSOL->iqloc[2]-1; /* There are more cols of length 1. */ if(LQ1<=LQ2) { if(TPP || TSP) { /* Grab the first one. */ JBEST = LUSOL->iq[LQ1]; /* Scan all columns of length 1 ... TRP or TCP */ } else { JBEST = 0; for(LQ = LQ1; LQ <= LQ2; LQ++) { J = LUSOL->iq[LQ]; /* Accept a slack */ if(LUSOL->w[J]>ZERO) { JBEST = J; goto x250; } LC = LUSOL->locc[J]; AMAX = fabs(LUSOL->a[LC]); if(TRP) { I = LUSOL->indc[LC]; #ifdef ClassicHamaxR AIJTOL = AMAXR[I]/LTOL; #else AIJTOL = LUSOL->amaxr[I]/LTOL; #endif } if(AMAX>=AIJTOL) { JBEST = J; goto x250; } } } x250: if(JBEST>0) { LC = LUSOL->locc[JBEST]; IBEST = LUSOL->indc[LC]; MBEST = 0; goto x300; } } /* This is the end of the U triangle. We will not return to this part of the code. TPP and TSP call lu1mxc for the first time (to move biggest element to top of each column). */ if(LPRINT>=LUSOL_MSG_PIVOT) LUSOL_report(LUSOL, 0, "Utri ended. spars1 = TRUE\n"); UTRI = FALSE; LTRI = TRUE; SPARS1 = TRUE; *NUTRI = NROWU-1; if(TPP || TSP) LU1MXC(LUSOL, LQ1,LUSOL->n,LUSOL->iq); } if(SPARS1) { /* ------------------------------------------------------------ Perform a Markowitz search. Search cols of length 1, then rows of length 1, then cols of length 2, then rows of length 2, etc. ------------------------------------------------------------ */ #ifdef UseTimer timer ( "start", mktime ); #endif /* 12 Jun 2002: Next line disables lu1mCP below if (TPP) then */ if(TPP || TCP) { LU1MAR(LUSOL, MAXMN,TCP,AIJTOL,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST); } else if(TRP) { #ifdef ClassicHamaxR LU1MRP(LUSOL, MAXMN,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST,AMAXR); #else LU1MRP(LUSOL, MAXMN,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST,LUSOL->amaxr); #endif /* else if (TCP) { lu1mCP( m , n , lena , aijtol, ibest, jbest , mbest , a , indc , indr , lenc , lenr , locc , Hlen , Ha , Hj ) */ } else if(TSP) { LU1MSP(LUSOL, MAXMN,LTOL,MAXCOL,&IBEST,&JBEST,&MBEST); if(IBEST==0) goto x990; } #ifdef UseTimer timer ( "finish", mktime ); #endif if(LTRI) { /* So far all rows have had length 1. We are still looking for the (forward) triangle of A that forms the first rows and columns of L. */ if(MBEST>0) { LTRI = FALSE; *NLTRI = NROWU-1-*NUTRI; if(LPRINT>=LUSOL_MSG_PIVOT) LUSOL_report(LUSOL, 0, "Ltri ended.\n"); } } else { /* See if what's left is as dense as dens1. */ if(NZLEFT>=(DENS1*MLEFT)*NLEFT) { SPARS1 = FALSE; SPARS2 = TRUE; *NDENS1 = NLEFT; MAXROW = 0; if(LPRINT>=LUSOL_MSG_PIVOT) LUSOL_report(LUSOL, 0, "spars1 ended. spars2 = TRUE\n"); } } } else if(SPARS2 || DENSE) { /* ------------------------------------------------------------ Perform a restricted Markowitz search, looking at only the first maxcol columns. (maxrow = 0.) ------------------------------------------------------------ */ #ifdef UseTimer timer ( "start", mktime ); #endif /* 12 Jun 2002: Next line disables lu1mCP below if (TPP) then */ if(TPP || TCP) { LU1MAR(LUSOL, MAXMN,TCP,AIJTOL,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST); } else if(TRP) { #ifdef ClassicHamaxR LU1MRP(LUSOL, MAXMN,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST,AMAXR); #else LU1MRP(LUSOL, MAXMN,LTOL,MAXCOL,MAXROW,&IBEST,&JBEST,&MBEST,LUSOL->amaxr); #endif /* else if (TCP) { lu1mCP( m , n , lena , aijtol, ibest, jbest , mbest , a , indc , indr , lenc , lenr , locc , Hlen , Ha , Hj ) */ } else if(TSP) { LU1MSP(LUSOL, MAXMN,LTOL,MAXCOL,&IBEST,&JBEST,&MBEST); if(IBEST==0) goto x985; } #ifdef UseTimer timer ( "finish", mktime ); #endif /* See if what's left is as dense as dens2. */ if(SPARS2) { if(NZLEFT>=(DENS2*MLEFT)*NLEFT) { SPARS2 = FALSE; DENSE = TRUE; *NDENS2 = NLEFT; MAXCOL = 1; if(LPRINT>=LUSOL_MSG_PIVOT) LUSOL_report(LUSOL, 0, "spars2 ended. dense = TRUE\n"); } } } /* --------------------------------------------------------------- See if we can finish quickly. --------------------------------------------------------------- */ if(DENSE) { LEND = MLEFT*NLEFT; NFREE = LU1-1; if(NFREE>=2*LEND) { /* There is room to treat the remaining matrix as a dense matrix D. We may have to compress the column file first. 12 Nov 1999: D used to be put at the beginning of free storage (lD = lcol + 1). Now put it at the end (lD = lu1 - lenD) so the left-shift in lu1ful will not involve overlapping storage (fatal with parallel dcopy). */ DENSLU = TRUE; *NDENS2 = NLEFT; LD = LU1-LEND; if(LCOL>=LD) { LU1REC(LUSOL, LUSOL->n,TRUE,&LCOL, LUSOL->indc,LUSOL->lenc,LUSOL->locc); LFILE = LCOL; JLAST = LUSOL->indc[LCOL+1]; } goto x900; } } /* =============================================================== The best aij has been found. The pivot row ibest and the pivot column jbest Define a dense matrix D of size nrowd by ncold. =============================================================== */ x300: NCOLD = LUSOL->lenr[IBEST]; NROWD = LUSOL->lenc[JBEST]; MELIM = NROWD-1; NELIM = NCOLD-1; (*MERSUM) += MBEST; (*LENL) += MELIM; (*LENU) += NCOLD; if(LPRINT>=LUSOL_MSG_PIVOT) { if(NROWU==1) LUSOL_report(LUSOL, 0, "lu1fad debug:\n"); if(TPP || TRP || TSP) { LUSOL_report(LUSOL, 0, "nrowu:%7d i,jbest:%7d,%7d nrowd,ncold:%6d,%6d\n", NROWU, IBEST,JBEST, NROWD,NCOLD); /* TCP */ } else { #ifdef ClassicHamaxR JMAX = HJ[1]; #else JMAX = LUSOL->Hj[1]; #endif IMAX = LUSOL->indc[LUSOL->locc[JMAX]]; LUSOL_report(LUSOL, 0, "nrowu:%7d i,jbest:%7d,%7d nrowd,ncold:%6d,%6d i,jmax:%7d,%7d aijmax:%g\n", NROWU, IBEST,JBEST, NROWD,NCOLD, IMAX,JMAX, AIJMAX); } } /* =============================================================== Allocate storage for the next column of L and next row of U. Initially the top of a, indc, indr are used as follows: ncold melim ncold melim a |...........|...........|ujbest..ujn|li1......lim| indc |...........| lenr(i) | lenc(j) | markl(i) | indr |...........| iqloc(i) | jfill(j) | ifill(i) | ^ ^ ^ ^ ^ lfree lsave lu1 ll1 oldlu1 Later the correct indices are inserted: indc | | | |i1........im| indr | | |jbest....jn|ibest..ibest| =============================================================== */ if(!KEEPLU) { /* Always point to the top spot. Only the current column of L and row of U will take up space, overwriting the previous ones. */ #ifdef ClassicHamaxR LU1 = LDIAGU+1; #else LU1 = LENA2+1; #endif } /* Update (left-shift) pointers to make room for the new data */ LL1 = LU1-MELIM; LU1 = LL1-NCOLD; LSAVE = LU1-NROWD; LFREE = LSAVE-NCOLD; /* Check if we need to allocate more memory, and allocate if necessary */ #if 0 /* Proposal by Michael A. Saunders (logic based on Markowitz' rule) */ L = NROWD*NCOLD; /* Try to avoid future expansions by anticipating further updates - KE extension */ if(LUSOL->luparm[LUSOL_IP_UPDATELIMIT] > 0) #if 1 L *= (int) (log(LUSOL->luparm[LUSOL_IP_UPDATELIMIT]-LUSOL->luparm[LUSOL_IP_UPDATECOUNT]+2.0) + 1); #else L *= (LUSOL->luparm[LUSOL_IP_UPDATELIMIT]-LUSOL->luparm[LUSOL_IP_UPDATECOUNT]) / 2 + 1; #endif #else /* Version by Kjell Eikland (from luparm[LUSOL_IP_MINIMUMLENA] and safety margin) */ L = (KEEPLU ? MAX(LROW, LCOL) + 2*(LUSOL->m+LUSOL->n) : 0); L *= LUSOL_MULT_nz_a; SETMAX(L, NROWD*NCOLD); #endif /* Do the memory expansion */ if((L > LFREE-LCOL) && LUSOL_expand_a(LUSOL, &L, &LFREE)) { LL1 += L; LU1 += L; LSAVE += L; #ifdef ClassicdiagU LUSOL->diagU += L; #endif #ifdef ClassicHamaxR HA += L; HJ += L; HK += L; AMAXR += L; #endif } LIMIT = (int) (USPACE*LFILE)+LUSOL->m+LUSOL->n+1000; /* Make sure the column file has room. Also force a compression if its length exceeds a certain limit. */ #ifdef StaticMemAlloc MINFRE = NCOLD+MELIM; #else MINFRE = NROWD*NCOLD; #endif NFREE = LFREE-LCOL; if(NFREELIMIT) { LU1REC(LUSOL, LUSOL->n,TRUE,&LCOL, LUSOL->indc,LUSOL->lenc,LUSOL->locc); LFILE = LCOL; JLAST = LUSOL->indc[LCOL+1]; NFREE = LFREE-LCOL; if(NFREELIMIT) { LU1REC(LUSOL, LUSOL->m,FALSE,&LROW, LUSOL->indr,LUSOL->lenr,LUSOL->locr); LFILE = LROW; ILAST = LUSOL->indr[LROW+1]; NFREE = LFREE-LROW; if(NFREElocr[IBEST]; LPIVR1 = LPIVR+1; LPIVR2 = LPIVR+NELIM; for(L = LPIVR; L <= LPIVR2; L++) { if(LUSOL->indr[L]==JBEST) break; } LUSOL->indr[L] = LUSOL->indr[LPIVR]; LUSOL->indr[LPIVR] = JBEST; LPIVC = LUSOL->locc[JBEST]; LPIVC1 = LPIVC+1; LPIVC2 = LPIVC+MELIM; for(L = LPIVC; L <= LPIVC2; L++) { if(LUSOL->indc[L]==IBEST) break; } LUSOL->indc[L] = LUSOL->indc[LPIVC]; LUSOL->indc[LPIVC] = IBEST; ABEST = LUSOL->a[L]; LUSOL->a[L] = LUSOL->a[LPIVC]; LUSOL->a[LPIVC] = ABEST; if(!KEEPLU) /* Store just the diagonal of U, in natural order. !! a[ldiagU + nrowu] = abest ! This was in pivot order. */ LUSOL->diagU[JBEST] = ABEST; /* ============================================================== Delete pivot col from heap. Hk tells us where it is in the heap. ============================================================== */ if(TCP) { #ifdef ClassicHamaxR KBEST = HK[JBEST]; HDELETE(HA,HJ,HK,&HLEN,KBEST,&H); #else KBEST = LUSOL->Hk[JBEST]; HDELETE(LUSOL->Ha,LUSOL->Hj,LUSOL->Hk,&HLEN,KBEST,&H); #endif HOPS += H; } /* =============================================================== Delete the pivot row from the column file and store it as the next row of U. set indr(lu) = 0 to initialize jfill ptrs on columns of D, indc(lu) = lenj to save the original column lengths. =============================================================== */ LUSOL->a[LU1] = ABEST; LUSOL->indr[LU1] = JBEST; LUSOL->indc[LU1] = NROWD; LU = LU1; DIAG = fabs(ABEST); SETMAX(*UMAX,DIAG); SETMAX(*DUMAX,DIAG); SETMIN(*DUMIN,DIAG); for(LR = LPIVR1; LR <= LPIVR2; LR++) { LU++; J = LUSOL->indr[LR]; LENJ = LUSOL->lenc[J]; LUSOL->lenc[J] = LENJ-1; LC1 = LUSOL->locc[J]; LAST = LC1+LUSOL->lenc[J]; for(L = LC1; L <= LAST; L++) { if(LUSOL->indc[L]==IBEST) break; } LUSOL->a[LU] = LUSOL->a[L]; LUSOL->indr[LU] = 0; LUSOL->indc[LU] = LENJ; SETMAX(*UMAX,fabs(LUSOL->a[LU])); LUSOL->a[L] = LUSOL->a[LAST]; LUSOL->indc[L] = LUSOL->indc[LAST]; /* Free entry */ LUSOL->indc[LAST] = 0; /* ??? if (j .eq. jlast) lcol = lcol - 1 */ } /* =============================================================== Delete the pivot column from the row file and store the nonzeros of the next column of L. Set indc(ll) = 0 to initialize markl(*) markers, indr(ll) = 0 to initialize ifill(*) row fill-in cntrs, indc(ls) = leni to save the original row lengths, indr(ls) = iqloc(i) to save parts of iqloc(*), iqloc(i) = lsave - ls to point to the nonzeros of L = -1, -2, -3, ... in mark(*). =============================================================== */ LUSOL->indc[LSAVE] = NCOLD; if(MELIM==0) goto x700; LL = LL1-1; LS = LSAVE; ABEST = ONE/ABEST; for(LC = LPIVC1; LC <= LPIVC2; LC++) { LL++; LS++; I = LUSOL->indc[LC]; LENI = LUSOL->lenr[I]; LUSOL->lenr[I] = LENI-1; LR1 = LUSOL->locr[I]; LAST = LR1+LUSOL->lenr[I]; for(L = LR1; L <= LAST; L++) { if(LUSOL->indr[L]==JBEST) break; } LUSOL->indr[L] = LUSOL->indr[LAST]; /* Free entry */ LUSOL->indr[LAST] = 0; LUSOL->a[LL] = -LUSOL->a[LC]*ABEST; LIJ = fabs(LUSOL->a[LL]); SETMAX(*LMAX,LIJ); LUSOL->indc[LL] = 0; LUSOL->indr[LL] = 0; LUSOL->indc[LS] = LENI; LUSOL->indr[LS] = LUSOL->iqloc[I]; LUSOL->iqloc[I] = LSAVE-LS; } /* =============================================================== Do the Gaussian elimination. This involves adding a multiple of the pivot column to all other columns in the pivot row. Sometimes more than one call to lu1gau is needed to allow compression of the column file. lfirst says which column the elimination should start with. minfre is a bound on the storage needed for any one column. lu points to off-diagonals of u. nfill keeps track of pending fill-in in the row file. =============================================================== */ if(NELIM==0) goto x700; LFIRST = LPIVR1; MINFRE = MLEFT+NSPARE; LU = 1; NFILL = 0; x400: #ifdef UseTimer timer ( "start", eltime ); #endif LU1GAU(LUSOL, MELIM,NSPARE,SMALL,LPIVC1,LPIVC2,&LFIRST,LPIVR2, LFREE,MINFRE,ILAST,&JLAST,&LROW,&LCOL,&LU,&NFILL, LUSOL->iqloc, LUSOL->a+LL1-LUSOL_ARRAYOFFSET, LUSOL->indc+LL1-LUSOL_ARRAYOFFSET, LUSOL->a+LU1-LUSOL_ARRAYOFFSET, LUSOL->indr+LL1-LUSOL_ARRAYOFFSET, LUSOL->indr+LU1-LUSOL_ARRAYOFFSET); #ifdef UseTimer timer ( "finish", eltime ); #endif if(LFIRST>0) { /* The elimination was interrupted. Compress the column file and try again. lfirst, lu and nfill have appropriate new values. */ LU1REC(LUSOL, LUSOL->n,TRUE,&LCOL, LUSOL->indc,LUSOL->lenc,LUSOL->locc); LFILE = LCOL; JLAST = LUSOL->indc[LCOL+1]; LPIVC = LUSOL->locc[JBEST]; LPIVC1 = LPIVC+1; LPIVC2 = LPIVC+MELIM; NFREE = LFREE-LCOL; if(NFREE0) { /* Compress the row file if necessary. lu1gau has set nfill to be the number of pending fill-ins plus the current length of any rows that need to be moved. */ MINFRE = NFILL; NFREE = LFREE-LROW; if(NFREEm,FALSE,&LROW, LUSOL->indr,LUSOL->lenr,LUSOL->locr); LFILE = LROW; ILAST = LUSOL->indr[LROW+1]; LPIVR = LUSOL->locr[IBEST]; LPIVR1 = LPIVR+1; LPIVR2 = LPIVR+NELIM; NFREE = LFREE-LROW; if(NFREEindr+LL1-LUSOL_ARRAYOFFSET,LUSOL->indr+LU1-LUSOL_ARRAYOFFSET); } /* =============================================================== Restore the saved values of iqloc. Insert the correct indices for the col of L and the row of U. =============================================================== */ x700: LUSOL->lenr[IBEST] = 0; LUSOL->lenc[JBEST] = 0; LL = LL1-1; LS = LSAVE; for(LC = LPIVC1; LC <= LPIVC2; LC++) { LL++; LS++; I = LUSOL->indc[LC]; LUSOL->iqloc[I] = LUSOL->indr[LS]; LUSOL->indc[LL] = I; LUSOL->indr[LL] = IBEST; } LU = LU1-1; for(LR = LPIVR; LR <= LPIVR2; LR++) { LU++; LUSOL->indr[LU] = LUSOL->indr[LR]; } /* =============================================================== Free the space occupied by the pivot row and update the column permutation. Then free the space occupied by the pivot column and update the row permutation. nzchng is found in both calls to lu1pq2, but we use it only after the second. =============================================================== */ LU1PQ2(LUSOL, NCOLD, &NZCHNG, LUSOL->indr+LPIVR-LUSOL_ARRAYOFFSET, LUSOL->indc+LU1-LUSOL_ARRAYOFFSET, LUSOL->lenc, LUSOL->iqloc, LUSOL->iq, LUSOL->iqinv); LU1PQ2(LUSOL, NROWD, &NZCHNG, LUSOL->indc+LPIVC-LUSOL_ARRAYOFFSET, LUSOL->indc+LSAVE-LUSOL_ARRAYOFFSET, LUSOL->lenr, LUSOL->iploc, LUSOL->ip, LUSOL->ipinv); NZLEFT += NZCHNG; /* =============================================================== lu1mxr resets Amaxr(i) in each modified row i. lu1mxc moves the largest aij to the top of each modified col j. 28 Jun 2002: Note that cols of L have an implicit diag of 1.0, so lu1mxr is called with ll1, not ll1+1, whereas lu1mxc is called with lu1+1. =============================================================== */ if(UTRI && TPP) { /* Relax -- we're not keeping big elements at the top yet. */ } else { if(TRP && MELIM>0) #ifdef ClassicHamaxR LU1MXR(LUSOL, LL1,LL,LUSOL->indc,AMAXR); #else LU1MXR(LUSOL, LL1,LL,LUSOL->indc,LUSOL->amaxr); #endif if(NELIM>0) { LU1MXC(LUSOL, LU1+1,LU,LUSOL->indr); /* Update modified columns in heap */ if(TCP) { for(KK = LU1+1; KK <= LU; KK++) { J = LUSOL->indr[KK]; #ifdef ClassicHamaxR K = HK[J]; #else K = LUSOL->Hk[J]; #endif /* Biggest aij in column j */ V = fabs(LUSOL->a[LUSOL->locc[J]]); #ifdef ClassicHamaxR HCHANGE(HA,HJ,HK,HLEN,K,V,J,&H); #else HCHANGE(LUSOL->Ha,LUSOL->Hj,LUSOL->Hk,HLEN,K,V,J,&H); #endif HOPS += H; } } } } /* =============================================================== Negate lengths of pivot row and column so they will be eliminated during compressions. =============================================================== */ LUSOL->lenr[IBEST] = -NCOLD; LUSOL->lenc[JBEST] = -NROWD; /* Test for fatal bug: row or column lists overwriting L and U. */ if(LROW>LSAVE || LCOL>LSAVE) goto x980; /* Reset the file lengths if pivot row or col was at the end. */ if(IBEST==ILAST) LROW = LUSOL->locr[IBEST]; if(JBEST==JLAST) LCOL = LUSOL->locc[JBEST]; } /* ------------------------------------------------------------------ End of main loop. ------------------------------------------------------------------ ------------------------------------------------------------------ Normal exit. Move empty rows and cols to the end of ip, iq. Then finish with a dense LU if necessary. ------------------------------------------------------------------ */ x900: *INFORM = LUSOL_INFORM_LUSUCCESS; LU1PQ3(LUSOL, LUSOL->m,LUSOL->lenr,LUSOL->ip,LUSOL->ipinv,&MRANK); LU1PQ3(LUSOL, LUSOL->n,LUSOL->lenc,LUSOL->iq,LUSOL->iqinv,NRANK); SETMIN(*NRANK, MRANK); if(DENSLU) { #ifdef UseTimer timer ( "start", 17 ); #endif LU1FUL(LUSOL, LEND,LU1,TPP,MLEFT,NLEFT,*NRANK,NROWU,LENL,LENU, &NSING,KEEPLU,SMALL,LUSOL->a+LD-LUSOL_ARRAYOFFSET,LUSOL->locr); /* *** 21 Dec 1994: Bug in next line. *** nrank = nrank - nsing */ *NRANK = MINMN-NSING; #ifdef UseTimer timer ( "finish", 17 ); #endif } *MINLEN = (*LENL)+(*LENU)+2*(LUSOL->m+LUSOL->n); goto x990; /* Not enough space free after a compress. Set minlen to an estimate of the necessary value of lena. */ x970: *INFORM = LUSOL_INFORM_ANEEDMEM; *MINLEN = LENA2+LFILE+2*(LUSOL->m+LUSOL->n); goto x990; /* Fatal error. This will never happen! (Famous last words.) */ x980: *INFORM = LUSOL_INFORM_FATALERR; goto x990; /* Fatal error with TSP. Diagonal pivot not found. */ x985: *INFORM = LUSOL_INFORM_NOPIVOT; /* Exit. */ x990: #ifdef UseTimer timer ( "finish", 3 ); #endif ; } /* ================================================================== lu1fac computes a factorization A = L*U, where A is a sparse matrix with m rows and n columns, P*L*P' is lower triangular and P*U*Q is upper triangular for certain permutations P, Q (which are returned in the arrays ip, iq). Stability is ensured by limiting the size of the elements of L. The nonzeros of A are input via the parallel arrays a, indc, indr, which should contain nelem entries of the form aij, i, j in any order. There should be no duplicate pairs i, j. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Beware !!! The row indices i must be in indc, + + and the column indices j must be in indr. + + (Not the other way round!) + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ It does not matter if some of the entries in a(*) are zero. Entries satisfying abs( a(i) ) .le. parmlu(3) are ignored. Other parameters in luparm and parmlu are described below. The matrix A may be singular. On exit, nsing = luparm(11) gives the number of apparent singularities. This is the number of "small" diagonals of the permuted factor U, as judged by the input tolerances Utol1 = parmlu(4) and Utol2 = parmlu(5). The diagonal element diagj associated with column j of A is "small" if abs( diagj ) .le. Utol1 or abs( diagj ) .le. Utol2 * max( uj ), where max( uj ) is the maximum element in the j-th column of U. The position of such elements is returned in w(*). In general, w(j) = + max( uj ), but if column j is a singularity, w(j) = - max( uj ). Thus, w(j) .le. 0 if column j appears to be dependent on the other columns of A. NOTE: lu1fac (like certain other sparse LU packages) does not treat dense columns efficiently. This means it will be slow on "arrow matrices" of the form A = (x a) ( x b) ( x c) ( x d) (x x x x e) if the numerical values in the dense column allow it to be chosen LATE in the pivot order. With TPP (Threshold Partial Pivoting), the dense column is likely to be chosen late. With TCP (Threshold Complete Pivoting), if any of a,b,c,d is significantly larger than other elements of A, it will be chosen as the first pivot and the dense column will be eliminated, giving reasonably sparse factors. However, if element e is so big that TCP chooses it, the factors will become dense. (It's hard to win on these examples!) ------------------------------------------------------------------ Notes on the array names ------------------------ During the LU factorization, the sparsity pattern of the matrix being factored is stored twice: in a column list and a row list. The column list is ( a, indc, locc, lenc ) where a(*) holds the nonzeros, indc(*) holds the indices for the column list, locc(j) points to the start of column j in a(*) and indc(*), lenc(j) is the number of nonzeros in column j. The row list is ( indr, locr, lenr ) where indr(*) holds the indices for the row list, locr(i) points to the start of row i in indr(*), lenr(i) is the number of nonzeros in row i. At all stages of the LU factorization, ip contains a complete row permutation. At the start of stage k, ip(1), ..., ip(k-1) are the first k-1 rows of the final row permutation P. The remaining rows are stored in an ordered list ( ip, iploc, ipinv ) where iploc(nz) points to the start in ip(*) of the set of rows that currently contain nz nonzeros, ipinv(i) points to the position of row i in ip(*). For example, iploc(1) = k (and this is where rows of length 1 {), iploc(2) = k+p if there are p rows of length 1 (and this is where rows of length 2 {). Similarly for iq, iqloc, iqinv. --------------------------------------------------------------------- INPUT PARAMETERS m (not altered) is the number of rows in A. n (not altered) is the number of columns in A. nelem (not altered) is the number of matrix entries given in the arrays a, indc, indr. lena (not altered) is the dimension of a, indc, indr. This should be significantly larger than nelem. Typically one should have lena > max( 2*nelem, 10*m, 10*n, 10000 ) but some applications may need more. On machines with virtual memory it is safe to have lena "far bigger than necessary", since not all of the arrays will be used. a (overwritten) contains entries Aij in a(1:nelem). indc (overwritten) contains the indices i in indc(1:nelem). indr (overwritten) contains the indices j in indr(1:nelem). luparm input parameters: Typical value luparm( 1) = nout File number for printed messages. 6 luparm( 2) = lprint Print level. 0 < 0 suppresses output. = 0 gives error messages. >= 10 gives statistics about the LU factors. >= 50 gives debug output from lu1fac (the pivot row and column and the no. of rows and columns involved at each elimination step). luparm( 3) = maxcol lu1fac: maximum number of columns 5 searched allowed in a Markowitz-type search for the next pivot element. For some of the factorization, the number of rows searched is maxrow = maxcol - 1. luparm( 6) = 0 => TPP: Threshold Partial Pivoting. 0 = 1 => TRP: Threshold Rook Pivoting. = 2 => TCP: Threshold Complete Pivoting. = 3 => TSP: Threshold Symmetric Pivoting. = 4 => TDP: Threshold Diagonal Pivoting. (TDP not yet implemented). TRP and TCP are more expensive than TPP but more stable and better at revealing rank. Take care with setting parmlu(1), especially with TCP. NOTE: TSP and TDP are for symmetric matrices that are either definite or quasi-definite. TSP is effectively TRP for symmetric matrices. TDP is effectively TCP for symmetric matrices. luparm( 8) = keepLU lu1fac: keepLU = 1 means the numerical 1 factors will be computed if possible. keepLU = 0 means L and U will be discarded but other information such as the row and column permutations will be returned. The latter option requires less storage. parmlu input parameters: Typical value parmlu( 1) = Ltol1 Max Lij allowed during Factor. TPP 10.0 or 100.0 TRP 4.0 or 10.0 TCP 5.0 or 10.0 TSP 4.0 or 10.0 With TRP and TCP (Rook and Complete Pivoting), values less than 25.0 may be expensive on badly scaled data. However, values less than 10.0 may be needed to obtain a reliable rank-revealing factorization. parmlu( 2) = Ltol2 Max Lij allowed during Updates. 10.0 during updates. parmlu( 3) = small Absolute tolerance for eps**0.8 = 3.0d-13 treating reals as zero. parmlu( 4) = Utol1 Absolute tol for flagging eps**0.67= 3.7d-11 small diagonals of U. parmlu( 5) = Utol2 Relative tol for flagging eps**0.67= 3.7d-11 small diagonals of U. (eps = machine precision) parmlu( 6) = Uspace Factor limiting waste space in U. 3.0 In lu1fac, the row or column lists are compressed if their length exceeds Uspace times the length of either file after the last compression. parmlu( 7) = dens1 The density at which the Markowitz 0.3 pivot strategy should search maxcol columns and no rows. (Use 0.3 unless you are experimenting with the pivot strategy.) parmlu( 8) = dens2 the density at which the Markowitz 0.5 strategy should search only 1 column, or (if storage is available) the density at which all remaining rows and columns will be processed by a dense LU code. For example, if dens2 = 0.1 and lena is large enough, a dense LU will be used once more than 10 per cent of the remaining matrix is nonzero. OUTPUT PARAMETERS a, indc, indr contain the nonzero entries in the LU factors of A. If keepLU = 1, they are in a form suitable for use by other parts of the LUSOL package, such as lu6sol. U is stored by rows at the start of a, indr. L is stored by cols at the end of a, indc. If keepLU = 0, only the diagonals of U are stored, at the end of a. ip, iq are the row and column permutations defining the pivot order. For example, row ip(1) and column iq(1) defines the first diagonal of U. lenc(1:numl0) contains the number of entries in nontrivial columns of L (in pivot order). lenr(1:m) contains the number of entries in each row of U (in original order). locc(1:n) = 0 (ready for the LU update routines). locr(1:m) points to the beginning of the rows of U in a, indr. iploc, iqloc, ipinv, iqinv are undefined. w indicates singularity as described above. inform = 0 if the LU factors were obtained successfully. = 1 if U appears to be singular, as judged by lu6chk. = 3 if some index pair indc(l), indr(l) lies outside the matrix dimensions 1:m , 1:n. = 4 if some index pair indc(l), indr(l) duplicates another such pair. = 7 if the arrays a, indc, indr were not large enough. Their length "lena" should be increase to at least the value "minlen" given in luparm(13). = 8 if there was some other fatal error. (Shouldn't happen!) = 9 if no diagonal pivot could be found with TSP or TDP. The matrix must not be sufficiently definite or quasi-definite. luparm output parameters: luparm(10) = inform Return code from last call to any LU routine. luparm(11) = nsing No. of singularities marked in the output array w(*). luparm(12) = jsing Column index of last singularity. luparm(13) = minlen Minimum recommended value for lena. luparm(14) = maxlen ? luparm(15) = nupdat No. of updates performed by the lu8 routines. luparm(16) = nrank No. of nonempty rows of U. luparm(17) = ndens1 No. of columns remaining when the density of the matrix being factorized reached dens1. luparm(18) = ndens2 No. of columns remaining when the density of the matrix being factorized reached dens2. luparm(19) = jumin The column index associated with DUmin. luparm(20) = numL0 No. of columns in initial L. luparm(21) = lenL0 Size of initial L (no. of nonzeros). luparm(22) = lenU0 Size of initial U. luparm(23) = lenL Size of current L. luparm(24) = lenU Size of current U. luparm(25) = lrow Length of row file. luparm(26) = ncp No. of compressions of LU data structures. luparm(27) = mersum lu1fac: sum of Markowitz merit counts. luparm(28) = nUtri lu1fac: triangular rows in U. luparm(29) = nLtri lu1fac: triangular rows in L. luparm(30) = parmlu output parameters: parmlu(10) = Amax Maximum element in A. parmlu(11) = Lmax Maximum multiplier in current L. parmlu(12) = Umax Maximum element in current U. parmlu(13) = DUmax Maximum diagonal in U. parmlu(14) = DUmin Minimum diagonal in U. parmlu(15) = Akmax Maximum element generated at any stage during TCP factorization. parmlu(16) = growth TPP: Umax/Amax TRP, TCP, TSP: Akmax/Amax parmlu(17) = parmlu(18) = parmlu(19) = parmlu(20) = resid lu6sol: residual after solve with U or U'. ... parmlu(30) = ------------------------------------------------------------------ 00 Jun 1983 Original version. 00 Jul 1987 nrank saved in luparm(16). 12 Apr 1989 ipinv, iqinv added as workspace. 26 Apr 1989 maxtie replaced by maxcol in Markowitz search. 16 Mar 1992 jumin saved in luparm(19). 10 Jun 1992 lu1fad has to move empty rows and cols to the bottom (via lu1pq3) before doing the dense LU. 12 Jun 1992 Deleted dense LU (lu1ful, lu1vlu). 25 Oct 1993 keepLU implemented. 07 Feb 1994 Added new dense LU (lu1ful, lu1den). 21 Dec 1994 Bugs fixed in lu1fad (nrank) and lu1ful (ipvt). 08 Aug 1995 Use ip instead of w as parameter to lu1or3 (for F90). 13 Sep 2000 TPP and TCP options implemented. 17 Oct 2000 Fixed troubles due to A = empty matrix (Todd Munson). 01 Dec 2000 Save Lmax, Umax, etc. after both lu1fad and lu6chk. lu1fad sets them when keepLU = false. lu6chk sets them otherwise, and includes items from the dense LU. 11 Mar 2001 lu6chk now looks at diag(U) when keepLU = false. 26 Apr 2002 New TCP implementation using heap routines to store largest element in each column. New workspace arrays Ha, Hj, Hk required. For compatibility, borrow space from a, indc, indr rather than adding new input parameters. 01 May 2002 lu1den changed to lu1DPP (dense partial pivoting). lu1DCP implemented (dense complete pivoting). Both TPP and TCP now switch to dense mode and end. ================================================================== */ void LU1FAC(LUSOLrec *LUSOL, int *INFORM) { MYBOOL KEEPLU, TCP, TPP, TRP, TSP; int LPIV, NELEM0, LPRINT, MINLEN, NUML0, LENL, LENU, LROW, MERSUM, NUTRI, NLTRI, NDENS1, NDENS2, NRANK, NSING, JSING, JUMIN, NUMNZ, LERR, LU, LL, LM, LTOPL, K, I, LENUK, J, LENLK, IDUMMY, LLSAVE, NMOVE, L2, L, NCP, NBUMP; #ifdef ClassicHamaxR int LENH, LENA2, LOCH, LMAXR; #endif REAL LMAX, LTOL, SMALL, AMAX, UMAX, DUMAX, DUMIN, AKMAX, DM, DN, DELEM, DENSTY, AGRWTH, UGRWTH, GROWTH, CONDU, DINCR, AVGMER; /* Free row-based version of L0 (regenerated by LUSOL_btran). */ if(LUSOL->L0 != NULL) LUSOL_matfree(&(LUSOL->L0)); /* Grab relevant input parameters. */ NELEM0 = LUSOL->nelem; LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; LPIV = LUSOL->luparm[LUSOL_IP_PIVOTTYPE]; KEEPLU = (MYBOOL) (LUSOL->luparm[LUSOL_IP_KEEPLU]!=FALSE); /* Limit on size of Lij */ LTOL = LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]; /* Drop tolerance */ SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; TPP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TPP); TRP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TRP); TCP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TCP); TSP = (MYBOOL) (LPIV==LUSOL_PIVMOD_TSP); /* Initialize output parameters. */ *INFORM = LUSOL_INFORM_LUSUCCESS; LERR = 0; MINLEN = LUSOL->nelem + 2*(LUSOL->m+LUSOL->n); NUML0 = 0; LENL = 0; LENU = 0; LROW = 0; MERSUM = 0; NUTRI = LUSOL->m; NLTRI = 0; NDENS1 = 0; NDENS2 = 0; NRANK = 0; NSING = 0; JSING = 0; JUMIN = 0; AMAX = ZERO; LMAX = ZERO; UMAX = ZERO; DUMAX = ZERO; DUMIN = ZERO; AKMAX = ZERO; /* Float version of dimensions. */ DM = LUSOL->m; DN = LUSOL->n; DELEM = LUSOL->nelem; /* Initialize workspace parameters. */ LUSOL->luparm[LUSOL_IP_COMPRESSIONS_LU] = 0; if(LUSOL->lena < MINLEN) { if(!LUSOL_realloc_a(LUSOL, MINLEN)) goto x970; } /* ------------------------------------------------------------------ Organize the aij's in a, indc, indr. lu1or1 deletes small entries, tests for illegal i,j's, and counts the nonzeros in each row and column. lu1or2 reorders the elements of A by columns. lu1or3 uses the column list to test for duplicate entries (same indices i,j). lu1or4 constructs a row list from the column list. ------------------------------------------------------------------ */ LU1OR1(LUSOL, SMALL,&AMAX,&NUMNZ,&LERR,INFORM); if(LPRINT>=LUSOL_MSG_STATISTICS) { DENSTY = (100*DELEM)/(DM*DN); LUSOL_report(LUSOL, 0, "m:%6d %c n:%6d nzcount:%9d Amax:%g Density:%g\n", LUSOL->m, relationChar(LUSOL->m, LUSOL->n), LUSOL->n, LUSOL->nelem, AMAX, DENSTY); } if(*INFORM!=LUSOL_INFORM_LUSUCCESS) goto x930; LUSOL->nelem = NUMNZ; LU1OR2(LUSOL); LU1OR3(LUSOL, &LERR,INFORM); if(*INFORM!=LUSOL_INFORM_LUSUCCESS) goto x940; LU1OR4(LUSOL); /* ------------------------------------------------------------------ Set up lists of rows and columns with equal numbers of nonzeros, using indc(*) as workspace. ------------------------------------------------------------------ */ LU1PQ1(LUSOL, LUSOL->m,LUSOL->n,LUSOL->lenr, LUSOL->ip,LUSOL->iploc,LUSOL->ipinv, LUSOL->indc+LUSOL->nelem); /* LUSOL_ARRAYOFFSET implied */ LU1PQ1(LUSOL, LUSOL->n,LUSOL->m,LUSOL->lenc, LUSOL->iq,LUSOL->iqloc,LUSOL->iqinv, LUSOL->indc+LUSOL->nelem); /* LUSOL_ARRAYOFFSET implied */ /* ------------------------------------------------------------------ For TCP, Ha, Hj, Hk are allocated separately, similarly amaxr for TRP. Then compute the factorization A = L*U. ------------------------------------------------------------------ */ #ifdef ClassicHamaxR if(TPP || TSP) { LENH = 1; LENA2 = LUSOL->lena; LOCH = LUSOL->lena; LMAXR = 1; } else if(TRP) { LENH = 1; /* Dummy */ LENA2 = LUSOL->lena-LUSOL->m; /* Reduced length of a */ LOCH = LUSOL->lena; /* Dummy */ LMAXR = LENA2+1; /* Start of Amaxr in a */ } else if(TCP) { LENH = LUSOL->n; /* Length of heap */ LENA2 = LUSOL->lena-LENH; /* Reduced length of a, indc, indr */ LOCH = LENA2+1; /* Start of Ha, Hj, Hk in a, indc, indr */ LMAXR = 1; /* Dummy */ } LU1FAD(LUSOL, LENA2,LENH, LUSOL->a+LOCH-LUSOL_ARRAYOFFSET, LUSOL->indc+LOCH-LUSOL_ARRAYOFFSET, LUSOL->indr+LOCH-LUSOL_ARRAYOFFSET, LUSOL->a+LMAXR-LUSOL_ARRAYOFFSET, INFORM,&LENL,&LENU, &MINLEN,&MERSUM,&NUTRI,&NLTRI,&NDENS1,&NDENS2, &NRANK,&LMAX,&UMAX,&DUMAX,&DUMIN,&AKMAX); #else LU1FAD(LUSOL, INFORM,&LENL,&LENU, &MINLEN,&MERSUM,&NUTRI,&NLTRI,&NDENS1,&NDENS2, &NRANK,&LMAX,&UMAX,&DUMAX,&DUMIN,&AKMAX); #endif LUSOL->luparm[LUSOL_IP_RANK_U] = NRANK; LUSOL->luparm[LUSOL_IP_NONZEROS_L] = LENL; if(*INFORM==LUSOL_INFORM_ANEEDMEM) goto x970; if(*INFORM==LUSOL_INFORM_NOPIVOT) goto x985; if(*INFORM>LUSOL_INFORM_LUSUCCESS) goto x980; if(KEEPLU) { /* --------------------------------------------------------------- The LU factors are at the top of a, indc, indr, with the columns of L and the rows of U in the order ( free ) ... ( u3 ) ( l3 ) ( u2 ) ( l2 ) ( u1 ) ( l1 ). Starting with ( l1 ) and ( u1 ), move the rows of U to the left and the columns of L to the right, giving ( u1 ) ( u2 ) ( u3 ) ... ( free ) ... ( l3 ) ( l2 ) ( l1 ). Also, set numl0 = the number of nonempty columns of U. --------------------------------------------------------------- */ LU = 0; LL = LUSOL->lena+1; #ifdef ClassicHamaxR LM = LENA2+1; #else LM = LL; #endif LTOPL = LL-LENL-LENU; LROW = LENU; for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; LENUK = -LUSOL->lenr[I]; LUSOL->lenr[I] = LENUK; J = LUSOL->iq[K]; LENLK = -LUSOL->lenc[J]-1; if(LENLK>0) { NUML0++; LUSOL->iqloc[NUML0] = LENLK; } if(LU+LENUKa[LL] = LUSOL->a[LM]; LUSOL->indc[LL] = LUSOL->indc[LM]; LUSOL->indr[LL] = LUSOL->indr[LM]; } } else { /* ========================================================= There is no room for ( uk ) yet. We have to right-shift the whole of the remaining LU file. Note that ( lk ) ends up in the correct place. ========================================================= */ LLSAVE = LL-LENLK; NMOVE = LM-LTOPL; for(IDUMMY = 1; IDUMMY <= NMOVE; IDUMMY++) { LL--; LM--; LUSOL->a[LL] = LUSOL->a[LM]; LUSOL->indc[LL] = LUSOL->indc[LM]; LUSOL->indr[LL] = LUSOL->indr[LM]; } LTOPL = LL; LL = LLSAVE; LM = LL; } /* ====================================================== Left-shift ( uk ). ====================================================== */ LUSOL->locr[I] = LU+1; L2 = LM-1; LM = LM-LENUK; for(L = LM; L <= L2; L++) { LU = LU+1; LUSOL->a[LU] = LUSOL->a[L]; LUSOL->indr[LU] = LUSOL->indr[L]; } } /* --------------------------------------------------------------- Save the lengths of the nonempty columns of L, and initialize locc(j) for the LU update routines. --------------------------------------------------------------- */ for(K = 1; K <= NUML0; K++) { LUSOL->lenc[K] = LUSOL->iqloc[K]; } for(J = 1; J <= LUSOL->n; J++) { LUSOL->locc[J] = 0; } /* --------------------------------------------------------------- Test for singularity. lu6chk sets nsing, jsing, jumin, Lmax, Umax, DUmax, DUmin (including entries from the dense LU). inform = 1 if there are singularities (nsing gt 0). --------------------------------------------------------------- */ LU6CHK(LUSOL, 1,LUSOL->lena,INFORM); NSING = LUSOL->luparm[LUSOL_IP_SINGULARITIES]; JSING = LUSOL->luparm[LUSOL_IP_SINGULARINDEX]; JUMIN = LUSOL->luparm[LUSOL_IP_COLINDEX_DUMIN]; LMAX = LUSOL->parmlu[LUSOL_RP_MAXMULT_L]; UMAX = LUSOL->parmlu[LUSOL_RP_MAXELEM_U]; DUMAX = LUSOL->parmlu[LUSOL_RP_MAXELEM_DIAGU]; DUMIN = LUSOL->parmlu[LUSOL_RP_MINELEM_DIAGU]; } else { /* --------------------------------------------------------------- keepLU = 0. L and U were not kept, just the diagonals of U. lu1fac will probably be called again soon with keepLU = .true. 11 Mar 2001: lu6chk revised. We can call it with keepLU = 0, but we want to keep Lmax, Umax from lu1fad. 05 May 2002: Allow for TCP with new lu1DCP. Diag(U) starts below lena2, not lena. Need lena2 in next line. --------------------------------------------------------------- */ #ifdef ClassicHamaxR LU6CHK(LUSOL, 1,LENA2,INFORM); #else LU6CHK(LUSOL, 1,LUSOL->lena,INFORM); #endif NSING = LUSOL->luparm[LUSOL_IP_SINGULARITIES]; JSING = LUSOL->luparm[LUSOL_IP_SINGULARINDEX]; JUMIN = LUSOL->luparm[LUSOL_IP_COLINDEX_DUMIN]; DUMAX = LUSOL->parmlu[LUSOL_RP_MAXELEM_DIAGU]; DUMIN = LUSOL->parmlu[LUSOL_RP_MINELEM_DIAGU]; } goto x990; /* ------------ Error exits. ------------ */ x930: *INFORM = LUSOL_INFORM_ADIMERR; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu1fac error...\nentry a[%d] has an illegal row (%d) or column (%d) index\n", LERR,LUSOL->indc[LERR],LUSOL->indr[LERR]); goto x990; x940: *INFORM = LUSOL_INFORM_ADUPLICATE; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu1fac error...\nentry a[%d] is a duplicate with indeces indc=%d, indr=%d\n", LERR,LUSOL->indc[LERR],LUSOL->indr[LERR]); goto x990; x970: *INFORM = LUSOL_INFORM_ANEEDMEM; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu1fac error...\ninsufficient storage; increase lena from %d to at least %d\n", LUSOL->lena, MINLEN); goto x990; x980: *INFORM = LUSOL_INFORM_FATALERR; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu1fac error...\nfatal bug (sorry --- this should never happen)\n"); goto x990; x985: *INFORM = LUSOL_INFORM_NOPIVOT; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu1fac error...\nTSP used but diagonal pivot could not be found\n"); /* Finalize and store output parameters. */ x990: LUSOL->nelem = NELEM0; LUSOL->luparm[LUSOL_IP_SINGULARITIES] = NSING; LUSOL->luparm[LUSOL_IP_SINGULARINDEX] = JSING; LUSOL->luparm[LUSOL_IP_MINIMUMLENA] = MINLEN; LUSOL->luparm[LUSOL_IP_UPDATECOUNT] = 0; LUSOL->luparm[LUSOL_IP_RANK_U] = NRANK; LUSOL->luparm[LUSOL_IP_COLCOUNT_DENSE1] = NDENS1; LUSOL->luparm[LUSOL_IP_COLCOUNT_DENSE2] = NDENS2; LUSOL->luparm[LUSOL_IP_COLINDEX_DUMIN] = JUMIN; LUSOL->luparm[LUSOL_IP_COLCOUNT_L0] = NUML0; LUSOL->luparm[LUSOL_IP_ROWCOUNT_L0] = 0; LUSOL->luparm[LUSOL_IP_NONZEROS_L0] = LENL; LUSOL->luparm[LUSOL_IP_NONZEROS_U0] = LENU; LUSOL->luparm[LUSOL_IP_NONZEROS_L] = LENL; LUSOL->luparm[LUSOL_IP_NONZEROS_U] = LENU; LUSOL->luparm[LUSOL_IP_NONZEROS_ROW] = LROW; LUSOL->luparm[LUSOL_IP_MARKOWITZ_MERIT] = MERSUM; LUSOL->luparm[LUSOL_IP_TRIANGROWS_U] = NUTRI; LUSOL->luparm[LUSOL_IP_TRIANGROWS_L] = NLTRI; LUSOL->parmlu[LUSOL_RP_MAXELEM_A] = AMAX; LUSOL->parmlu[LUSOL_RP_MAXMULT_L] = LMAX; LUSOL->parmlu[LUSOL_RP_MAXELEM_U] = UMAX; LUSOL->parmlu[LUSOL_RP_MAXELEM_DIAGU] = DUMAX; LUSOL->parmlu[LUSOL_RP_MINELEM_DIAGU] = DUMIN; LUSOL->parmlu[LUSOL_RP_MAXELEM_TCP] = AKMAX; AGRWTH = AKMAX/(AMAX+LUSOL_SMALLNUM); UGRWTH = UMAX/(AMAX+LUSOL_SMALLNUM); if(TPP) GROWTH = UGRWTH; /* TRP or TCP or TSP */ else GROWTH = AGRWTH; LUSOL->parmlu[LUSOL_RP_GROWTHRATE] = GROWTH; LUSOL->luparm[LUSOL_IP_FTRANCOUNT] = 0; LUSOL->luparm[LUSOL_IP_BTRANCOUNT] = 0; /* ------------------------------------------------------------------ Set overall status variable. ------------------------------------------------------------------ */ LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; if(*INFORM == LUSOL_INFORM_NOMEMLEFT) LUSOL_report(LUSOL, 0, "lu1fac error...\ninsufficient memory available\n"); /* ------------------------------------------------------------------ Print statistics for the LU factors. ------------------------------------------------------------------ */ NCP = LUSOL->luparm[LUSOL_IP_COMPRESSIONS_LU]; CONDU = DUMAX/MAX(DUMIN,LUSOL_SMALLNUM); DINCR = (LENL+LENU)-LUSOL->nelem; DINCR = (DINCR*100)/MAX(DELEM,ONE); AVGMER = MERSUM; AVGMER = AVGMER/DM; NBUMP = LUSOL->m-NUTRI-NLTRI; if(LPRINT>=LUSOL_MSG_STATISTICS) { if(TPP) { LUSOL_report(LUSOL, 0, "Merit %g %d %d %d %g %d %d %g %g %d %d %d\n", AVGMER,LENL,LENL+LENU,NCP,DINCR,NUTRI,LENU, LTOL,UMAX,UGRWTH,NLTRI,NDENS1,LMAX); } else { LUSOL_report(LUSOL, 0, "Merit %s %g %d %d %d %g %d %d %g %g %d %d %d %g %g\n", LUSOL_pivotLabel(LUSOL), AVGMER,LENL,LENL+LENU,NCP,DINCR,NUTRI,LENU, LTOL,UMAX,UGRWTH,NLTRI,NDENS1,LMAX,AKMAX,AGRWTH); } LUSOL_report(LUSOL, 0, "bump%9d dense2%7d DUmax%g DUmin%g conDU%g\n", NBUMP,NDENS2,DUMAX,DUMIN,CONDU); } } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol2.c100666 0 0 14445 11141443433 16343 0ustar usergroup /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ File lusol2 LUSOL heap management routines Hbuild Hchange Hdelete Hdown Hinsert Hup Heap-management routines for LUSOL's lu1fac. May be useful for other applications. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ For LUSOL, the heap structure involves three arrays of length N. N is the current number of entries in the heap. Ha(1:N) contains the values that the heap is partially sorting. For LUSOL they are double precision values -- the largest element in each remaining column of the updated matrix. The biggest entry is in Ha(1), the top of the heap. Hj(1:N) contains column numbers j. Ha(k) is the biggest entry in column j = Hj(k). Hk(1:N) contains indices within the heap. It is the inverse of Hj(1:N), so k = Hk(j) <=> j = Hj(k). Column j is entry k in the heap. hops is the number of heap operations, i.e., the number of times an entry is moved (the number of "hops" up or down the heap). Together, Hj and Hk let us find values inside the heap whenever we want to change one of the values in Ha. For other applications, Ha may need to be some other data type, like the keys that sort routines operate on. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 11 Feb 2002: MATLAB version derived from "Algorithms" by R. Sedgewick 03 Mar 2002: F77 version derived from MATLAB version. 07 May 2002: Safeguard input parameters k, N, Nk. We don't want them to be output! 07 May 2002: Current version of lusol2.f. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* ================================================================== Hdown updates heap by moving down tree from node k. ------------------------------------------------------------------ 01 May 2002: Need Nk for length of Hk. 05 May 2002: Change input paramter k to kk to stop k being output. 05 May 2002: Current version of Hdown. ================================================================== */ void HDOWN(REAL HA[], int HJ[], int HK[], int N, int K, int *HOPS) { int J, JJ, JV, N2; REAL V; *HOPS = 0; V = HA[K]; JV = HJ[K]; N2 = N/2; /* while 1 break */ x100: if(K>N2) goto x200; (*HOPS)++; J = K+K; if(J=HA[J]) goto x200; HA[K] = HA[J]; JJ = HJ[J]; HJ[K] = JJ; HK[JJ] = K; K = J; goto x100; /* end while */ x200: HA[K] = V; HJ[K] = JV; HK[JV] = K; } /* ================================================================== Hup updates heap by moving up tree from node k. ------------------------------------------------------------------ 01 May 2002: Need Nk for length of Hk. 05 May 2002: Change input paramter k to kk to stop k being output. 05 May 2002: Current version of Hup. ================================================================== */ void HUP(REAL HA[], int HJ[], int HK[], int K, int *HOPS) { int J, JV, K2; REAL V; *HOPS = 0; V = HA[K]; JV = HJ[K]; /* while 1 break */ x100: if(K<2) goto x200; K2 = K/2; /* break */ if(V n - nrank may occur. If keepLU = 0, Lmax and Umax are already set by lu1fac. The diagonals of U are in the top of A. Only Utol1 is used in the singularity test to set w(*). inform = 0 if A appears to have full column rank (nsing = 0). inform = 1 otherwise (nsing .gt. 0). ------------------------------------------------------------------ 00 Jul 1987: Early version. 09 May 1988: f77 version. 11 Mar 2001: Allow for keepLU = 0. 17 Nov 2001: Briefer output for singular factors. 05 May 2002: Comma needed in format 1100 (via Kenneth Holmstrom). 06 May 2002: With keepLU = 0, diags of U are in natural order. They were not being extracted correctly. 23 Apr 2004: TRP can judge singularity better by comparing all diagonals to DUmax. 27 Jun 2004: (PEG) Allow write only if nout .gt. 0. ================================================================== */ #ifdef UseOld_LU6CHK_20040510 void LU6CHK(LUSOLrec *LUSOL, int MODE, int LENA2, int *INFORM) { MYBOOL KEEPLU; int I, J, JUMIN, K, L, L1, L2, LENL, LPRINT, NDEFIC, NRANK; REAL AIJ, DIAG, DUMAX, DUMIN, LMAX, UMAX, UTOL1, UTOL2; LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; KEEPLU = (MYBOOL) (LUSOL->luparm[LUSOL_IP_KEEPLU]!=0); NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; LENL = LUSOL->luparm[LUSOL_IP_NONZEROS_L]; UTOL1 = LUSOL->parmlu[LUSOL_RP_SMALLDIAG_U]; UTOL2 = LUSOL->parmlu[LUSOL_RP_EPSDIAG_U]; *INFORM = LUSOL_INFORM_LUSUCCESS; LMAX = ZERO; UMAX = ZERO; LUSOL->luparm[LUSOL_IP_SINGULARITIES] = 0; LUSOL->luparm[LUSOL_IP_SINGULARINDEX] = 0; JUMIN = 0; DUMAX = ZERO; DUMIN = LUSOL_BIGNUM; #ifdef LUSOLFastClear MEMCLEAR(LUSOL->w+1, LUSOL->n); #else for(I = 1; I <= LUSOL->n; I++) LUSOL->w[I] = ZERO; #endif if(KEEPLU) { /* -------------------------------------------------------------- Find Lmax. -------------------------------------------------------------- */ for(L = (LENA2+1)-LENL; L <= LENA2; L++) { SETMAX(LMAX,fabs(LUSOL->a[L])); } /* -------------------------------------------------------------- Find Umax and set w(j) = maximum element in j-th column of U. -------------------------------------------------------------- */ for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; L1 = LUSOL->locr[I]; L2 = (L1+LUSOL->lenr[I])-1; for(L = L1; L <= L2; L++) { J = LUSOL->indr[L]; AIJ = fabs(LUSOL->a[L]); SETMAX(LUSOL->w[J],AIJ); SETMAX(UMAX,AIJ); } } /* -------------------------------------------------------------- Negate w(j) if the corresponding diagonal of U is too small in absolute terms or relative to the other elements in the same column of U. Also find DUmax and DUmin, the extreme diagonals of U. -------------------------------------------------------------- */ for(K = 1; K <= LUSOL->n; K++) { J = LUSOL->iq[K]; if(K>NRANK) DIAG = ZERO; else { I = LUSOL->ip[K]; L1 = LUSOL->locr[I]; DIAG = fabs(LUSOL->a[L1]); SETMAX(DUMAX,DIAG); if(DUMIN>DIAG) { DUMIN = DIAG; JUMIN = J; } } if((DIAG<=UTOL1) || (DIAG<=UTOL2*LUSOL->w[J])) { LUSOL_addSingularity(LUSOL, J, INFORM); LUSOL->w[J] = -LUSOL->w[J]; } } LUSOL->parmlu[LUSOL_RP_MAXMULT_L] = LMAX; LUSOL->parmlu[LUSOL_RP_MAXELEM_U] = UMAX; } else { /* -------------------------------------------------------------- keepLU = 0. Only diag(U) is stored. Set w(*) accordingly. -------------------------------------------------------------- */ for(K = 1; K <= LUSOL->n; K++) { J = LUSOL->iq[K]; if(K>NRANK) DIAG = ZERO; else { /* ! diag = abs( diagU(k) ) ! 06 May 2002: Diags are in natural order */ DIAG = fabs(LUSOL->diagU[J]); LUSOL->w[J] = DIAG; SETMAX(DUMAX,DIAG); if(DUMIN>DIAG) { DUMIN = DIAG; JUMIN = J; } } if(DIAG<=UTOL1) { LUSOL_addSingularity(LUSOL, J, INFORM); LUSOL->w[J] = -LUSOL->w[J]; } } } /* ----------------------------------------------------------------- Set output parameters. ----------------------------------------------------------------- */ if(JUMIN==0) DUMIN = ZERO; LUSOL->luparm[LUSOL_IP_COLINDEX_DUMIN] = JUMIN; LUSOL->parmlu[LUSOL_RP_MAXELEM_DIAGU] = DUMAX; LUSOL->parmlu[LUSOL_RP_MINELEM_DIAGU] = DUMIN; /* The matrix has been judged singular. */ if(LUSOL->luparm[LUSOL_IP_SINGULARITIES]>0) { *INFORM = LUSOL_INFORM_LUSINGULAR; NDEFIC = LUSOL->n-NRANK; if(LPRINT>=LUSOL_MSG_SINGULARITY) { LUSOL_report(LUSOL, 0, "Singular(m%cn) rank:%9d n-rank:%8d nsing:%9d\n", relationChar(LUSOL->m, LUSOL->n),NRANK,NDEFIC, LUSOL->luparm[LUSOL_IP_SINGULARITIES]); } } /* Exit. */ LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; } #else void LU6CHK(LUSOLrec *LUSOL, int MODE, int LENA2, int *INFORM) { MYBOOL KEEPLU, TRP; int I, J, JUMIN, K, L, L1, L2, LENL, LDIAGU, LPRINT, NDEFIC, NRANK; REAL AIJ, DIAG, DUMAX, DUMIN, LMAX, UMAX, UTOL1, UTOL2; LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; KEEPLU = (MYBOOL) (LUSOL->luparm[LUSOL_IP_KEEPLU] != 0); TRP = (MYBOOL) (LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TRP); NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; LENL = LUSOL->luparm[LUSOL_IP_NONZEROS_L]; UTOL1 = LUSOL->parmlu[LUSOL_RP_SMALLDIAG_U]; UTOL2 = LUSOL->parmlu[LUSOL_RP_EPSDIAG_U]; *INFORM = LUSOL_INFORM_LUSUCCESS; LMAX = ZERO; UMAX = ZERO; LUSOL->luparm[LUSOL_IP_SINGULARITIES] = 0; LUSOL->luparm[LUSOL_IP_SINGULARINDEX] = 0; JUMIN = 0; DUMAX = ZERO; DUMIN = LUSOL_BIGNUM; #ifdef LUSOLFastClear MEMCLEAR(LUSOL->w+1, LUSOL->n); #else for(I = 1; I <= LUSOL->n; I++) LUSOL->w[I] = ZERO; #endif if(KEEPLU) { /* -------------------------------------------------------------- Find Lmax. -------------------------------------------------------------- */ for(L = (LENA2+1)-LENL; L <= LENA2; L++) { SETMAX(LMAX,fabs(LUSOL->a[L])); } /* -------------------------------------------------------------- Find Umax and set w(j) = maximum element in j-th column of U. -------------------------------------------------------------- */ for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; L1 = LUSOL->locr[I]; L2 = (L1+LUSOL->lenr[I])-1; for(L = L1; L <= L2; L++) { J = LUSOL->indr[L]; AIJ = fabs(LUSOL->a[L]); SETMAX(LUSOL->w[J],AIJ); SETMAX(UMAX,AIJ); } } LUSOL->parmlu[LUSOL_RP_MAXMULT_L] = LMAX; LUSOL->parmlu[LUSOL_RP_MAXELEM_U] = UMAX; /* -------------------------------------------------------------- Find DUmax and DUmin, the extreme diagonals of U. -------------------------------------------------------------- */ for(K = 1; K <= NRANK; K++) { J = LUSOL->iq[K]; I = LUSOL->ip[K]; L1 = LUSOL->locr[I]; DIAG = fabs(LUSOL->a[L1]); SETMAX( DUMAX, DIAG ); if(DUMIN > DIAG) { DUMIN = DIAG; JUMIN = J; } } } else { /* -------------------------------------------------------------- keepLU = 0. Only diag(U) is stored. Set w(*) accordingly. Find DUmax and DUmin, the extreme diagonals of U. -------------------------------------------------------------- */ LDIAGU = LENA2 - LUSOL->n; for(K = 1; K <= NRANK; K++) { J = LUSOL->iq[K]; DIAG = fabs( LUSOL->a[LDIAGU + J] ); /* are in natural order */ LUSOL->w[J] = DIAG; SETMAX( DUMAX, DIAG ); if(DUMIN > DIAG) { DUMIN = DIAG; JUMIN = J; } } } /* -------------------------------------------------------------- Negate w(j) if the corresponding diagonal of U is too small in absolute terms or relative to the other elements in the same column of U. 23 Apr 2004: TRP ensures that diags are NOT small relative to other elements in their own column. Much better, we can compare all diags to DUmax. -------------------------------------------------------------- */ if((MODE == 1) && TRP) { SETMAX( UTOL1, UTOL2*DUMAX ); } if(KEEPLU) { for(K = 1; K <= LUSOL->n; K++) { J = LUSOL->iq[K]; if(K>NRANK) DIAG = ZERO; else { I = LUSOL->ip[K]; L1 = LUSOL->locr[I]; DIAG = fabs(LUSOL->a[L1]); } if((DIAG<=UTOL1) || (DIAG<=UTOL2*LUSOL->w[J])) { LUSOL_addSingularity(LUSOL, J, INFORM); LUSOL->w[J] = -LUSOL->w[J]; } } } else { /* keepLU = FALSE */ for(K = 1; K <= LUSOL->n; K++) { J = LUSOL->iq[K]; DIAG = LUSOL->w[J]; if(DIAG<=UTOL1) { LUSOL_addSingularity(LUSOL, J, INFORM); LUSOL->w[J] = -LUSOL->w[J]; } } } /* ----------------------------------------------------------------- Set output parameters. ----------------------------------------------------------------- */ if(JUMIN==0) DUMIN = ZERO; LUSOL->luparm[LUSOL_IP_COLINDEX_DUMIN] = JUMIN; LUSOL->parmlu[LUSOL_RP_MAXELEM_DIAGU] = DUMAX; LUSOL->parmlu[LUSOL_RP_MINELEM_DIAGU] = DUMIN; /* The matrix has been judged singular. */ if(LUSOL->luparm[LUSOL_IP_SINGULARITIES]>0) { *INFORM = LUSOL_INFORM_LUSINGULAR; NDEFIC = LUSOL->n-NRANK; if((LUSOL->outstream!=NULL) && (LPRINT>=LUSOL_MSG_SINGULARITY)) { LUSOL_report(LUSOL, 0, "Singular(m%cn) rank:%9d n-rank:%8d nsing:%9d\n", relationChar(LUSOL->m, LUSOL->n),NRANK,NDEFIC, LUSOL->luparm[LUSOL_IP_SINGULARITIES]); } } /* Exit. */ LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; } #endif /* ------------------------------------------------------------------ Include routines for row-based L0. 20 Apr 2005 Current version - KE. ------------------------------------------------------------------ */ #include "lusol6l0.c" /* ------------------------------------------------------------------ lu6L solves L v = v(input). ------------------------------------------------------------------ 15 Dec 2002: First version derived from lu6sol. 15 Dec 2002: Current version. ------------------------------------------------------------------ */ void LU6L(LUSOLrec *LUSOL, int *INFORM, REAL V[], int NZidx[]) { int JPIV, K, L, L1, LEN, LENL, LENL0, NUML, NUML0; REAL SMALL; register REAL VPIV; #ifdef LUSOLFastSolve REAL *aptr; int *iptr, *jptr; #else int I, J; #endif NUML0 = LUSOL->luparm[LUSOL_IP_COLCOUNT_L0]; LENL0 = LUSOL->luparm[LUSOL_IP_NONZEROS_L0]; LENL = LUSOL->luparm[LUSOL_IP_NONZEROS_L]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; L1 = LUSOL->lena+1; for(K = 1; K <= NUML0; K++) { LEN = LUSOL->lenc[K]; L = L1; L1 -= LEN; JPIV = LUSOL->indr[L1]; VPIV = V[JPIV]; if(fabs(VPIV)>SMALL) { /* ***** This loop could be coded specially. */ #ifdef LUSOLFastSolve L--; for(aptr = LUSOL->a+L, iptr = LUSOL->indc+L; LEN > 0; LEN--, aptr--, iptr--) V[*iptr] += (*aptr) * VPIV; #else for(; LEN > 0; LEN--) { L--; I = LUSOL->indc[L]; V[I] += LUSOL->a[L]*VPIV; } #endif } #ifdef SetSmallToZero else V[JPIV] = 0; #endif } L = (LUSOL->lena-LENL0)+1; NUML = LENL-LENL0; /* ***** This loop could be coded specially. */ #ifdef LUSOLFastSolve L--; for(aptr = LUSOL->a+L, jptr = LUSOL->indr+L, iptr = LUSOL->indc+L; NUML > 0; NUML--, aptr--, jptr--, iptr--) { if(fabs(V[*jptr])>SMALL) V[*iptr] += (*aptr) * V[*jptr]; #ifdef SetSmallToZero else V[*jptr] = 0; #endif } #else for(; NUML > 0; NUML--) { L--; J = LUSOL->indr[L]; if(fabs(V[J])>SMALL) { I = LUSOL->indc[L]; V[I] += LUSOL->a[L]*V[J]; } #ifdef SetSmallToZero else V[J] = 0; #endif } #endif /* Exit. */ LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; } /* ================================================================== lu6LD assumes lu1fac has computed factors A = LU of a symmetric definite or quasi-definite matrix A, using Threshold Symmetric Pivoting (TSP), luparm(6) = 3, or Threshold Diagonal Pivoting (TDP), luparm(6) = 4. It also assumes that no updates have been performed. In such cases, U = D L', where D = diag(U). lu6LDL returns v as follows: mode 1 v solves L D v = v(input). 2 v solves L|D|v = v(input). ------------------------------------------------------------------ 15 Dec 2002: First version of lu6LD. 15 Dec 2002: Current version. ================================================================== */ void LU6LD(LUSOLrec *LUSOL, int *INFORM, int MODE, REAL V[], int NZidx[]) { int IPIV, K, L, L1, LEN, NUML0; REAL DIAG, SMALL; register REAL VPIV; #ifdef LUSOLFastSolve REAL *aptr; int *jptr; #else int J; #endif /* Solve L D v(new) = v or L|D|v(new) = v, depending on mode. The code for L is the same as in lu6L, but when a nonzero entry of v arises, we divide by the corresponding entry of D or |D|. */ NUML0 = LUSOL->luparm[LUSOL_IP_COLCOUNT_L0]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; L1 = LUSOL->lena+1; for(K = 1; K <= NUML0; K++) { LEN = LUSOL->lenc[K]; L = L1; L1 -= LEN; IPIV = LUSOL->indr[L1]; VPIV = V[IPIV]; if(fabs(VPIV)>SMALL) { /* ***** This loop could be coded specially. */ #ifdef LUSOLFastSolve L--; for(aptr = LUSOL->a+L, jptr = LUSOL->indc+L; LEN > 0; LEN--, aptr--, jptr--) V[*jptr] += (*aptr)*VPIV; #else for(; LEN > 0; LEN--) { L--; J = LUSOL->indc[L]; V[J] += LUSOL->a[L]*VPIV; } #endif /* Find diag = U(ipiv,ipiv) and divide by diag or |diag|. */ L = LUSOL->locr[IPIV]; DIAG = LUSOL->a[L]; if(MODE==2) DIAG = fabs(DIAG); V[IPIV] = VPIV/DIAG; } #ifdef SetSmallToZero else V[IPIV] = 0; #endif } } /* ================================================================== lu6Lt solves L'v = v(input). ------------------------------------------------------------------ 15 Dec 2002: First version derived from lu6sol. 15 Dec 2002: Current version. ================================================================== */ void LU6LT(LUSOLrec *LUSOL, int *INFORM, REAL V[], int NZidx[]) { #ifdef DoTraceL0 REAL TEMP; #endif int K, L, L1, L2, LEN, LENL, LENL0, NUML0; REAL SMALL; register REALXP SUM; register REAL HOLD; #if (defined LUSOLFastSolve) && !(defined DoTraceL0) REAL *aptr; int *iptr, *jptr; #else int I, J; #endif NUML0 = LUSOL->luparm[LUSOL_IP_COLCOUNT_L0]; LENL0 = LUSOL->luparm[LUSOL_IP_NONZEROS_L0]; LENL = LUSOL->luparm[LUSOL_IP_NONZEROS_L]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; L1 = (LUSOL->lena-LENL)+1; L2 = LUSOL->lena-LENL0; /* ***** This loop could be coded specially. */ #if (defined LUSOLFastSolve) && !(defined DoTraceL0) for(L = L1, aptr = LUSOL->a+L1, iptr = LUSOL->indr+L1, jptr = LUSOL->indc+L1; L <= L2; L++, aptr++, iptr++, jptr++) { HOLD = V[*jptr]; if(fabs(HOLD)>SMALL) V[*iptr] += (*aptr)*HOLD; #ifdef SetSmallToZero else V[*jptr] = 0; #endif } #else for(L = L1; L <= L2; L++) { J = LUSOL->indc[L]; HOLD = V[J]; if(fabs(HOLD)>SMALL) { I = LUSOL->indr[L]; V[I] += LUSOL->a[L]*HOLD; } #ifdef SetSmallToZero else V[J] = 0; #endif } #endif /* Do row-based L0 version, if available */ if((LUSOL->L0 != NULL) || ((LUSOL->luparm[LUSOL_IP_BTRANCOUNT] == 0) && LU1L0(LUSOL, &(LUSOL->L0), INFORM))) { LU6L0T_v(LUSOL, LUSOL->L0, V, NZidx, INFORM); } /* Alternatively, do the standard column-based L0 version */ else { /* Perform loop over columns */ for(K = NUML0; K >= 1; K--) { SUM = ZERO; LEN = LUSOL->lenc[K]; L1 = L2+1; L2 += LEN; /* ***** This loop could be coded specially. */ #if (defined LUSOLFastSolve) && !(defined DoTraceL0) for(L = L1, aptr = LUSOL->a+L1, jptr = LUSOL->indc+L1; L <= L2; L++, aptr++, jptr++) SUM += (*aptr) * V[*jptr]; #else for(L = L1; L <= L2; L++) { J = LUSOL->indc[L]; #ifndef DoTraceL0 SUM += LUSOL->a[L]*V[J]; #else TEMP = V[LUSOL->indr[L1]] + SUM; SUM += LUSOL->a[L]*V[J]; printf("V[%3d] = V[%3d] + L[%d,%d]*V[%3d]\n", LUSOL->indr[L1], LUSOL->indr[L1], J,LUSOL->indr[L1], J); printf("%6g = %6g + %6g*%6g\n", V[LUSOL->indr[L1]] + SUM, TEMP, LUSOL->a[L], V[J]); #endif } #endif V[LUSOL->indr[L1]] += (REAL) SUM; } } /* Exit. */ LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; } void print_L0(LUSOLrec *LUSOL) { int I, J, K, L, L1, L2, LEN, LENL0, NUML0; REAL *denseL0 = (REAL*) calloc(LUSOL->m+1, (LUSOL->n+1)*sizeof(*denseL0)); NUML0 = LUSOL->luparm[LUSOL_IP_COLCOUNT_L0]; LENL0 = LUSOL->luparm[LUSOL_IP_NONZEROS_L0]; L2 = LUSOL->lena-LENL0; for(K = NUML0; K >= 1; K--) { LEN = LUSOL->lenc[K]; L1 = L2+1; L2 += LEN; for(L = L1; L <= L2; L++) { I = LUSOL->indc[L]; I = LUSOL->ipinv[I]; /* Undo row mapping */ J = LUSOL->indr[L]; denseL0[(LUSOL->n+1)*(J-1) + I] = LUSOL->a[L]; } } for(I = 1; I <= LUSOL->n; I++) { for(J = 1; J <= LUSOL->m; J++) fprintf(stdout, "%10g", denseL0[(LUSOL->n+1)*(J-1) + I]); fprintf(stdout, "\n"); } LUSOL_FREE(denseL0); } /* ------------------------------------------------------------------ Include routines for column-based U. 5 Feb 2006 Current version - KE. ------------------------------------------------------------------ */ #include "lusol6u.c" /* ================================================================== lu6U solves U w = v. v is not altered. ------------------------------------------------------------------ 15 Dec 2002: First version derived from lu6sol. 15 Dec 2002: Current version. ================================================================== */ void LU6U(LUSOLrec *LUSOL, int *INFORM, REAL V[], REAL W[], int NZidx[]) { /* Do column-based U version, if available */ if((LUSOL->U != NULL) || ((LUSOL->luparm[LUSOL_IP_FTRANCOUNT] == 0) && LU1U0(LUSOL, &(LUSOL->U), INFORM))) { LU6U0_v(LUSOL, LUSOL->U, V, W, NZidx, INFORM); } /* Alternatively, do the standard column-based L0 version */ else { int I, J, K, KLAST, L, L1, L2, L3, NRANK, NRANK1; REAL SMALL; register REALXP T; #ifdef LUSOLFastSolve REAL *aptr; int *jptr; #endif NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; NRANK1 = NRANK+1; /* Find the first nonzero in v(1:nrank), counting backwards. */ for(KLAST = NRANK; KLAST >= 1; KLAST--) { I = LUSOL->ip[KLAST]; if(fabs(V[I])>SMALL) break; } L = LUSOL->n; #ifdef LUSOLFastSolve for(K = KLAST+1, jptr = LUSOL->iq+K; K <= L; K++, jptr++) W[*jptr] = ZERO; #else for(K = KLAST+1; K <= L; K++) { J = LUSOL->iq[K]; W[J] = ZERO; } #endif /* Do the back-substitution, using rows 1:klast of U. */ for(K = KLAST; K >= 1; K--) { I = LUSOL->ip[K]; T = V[I]; L1 = LUSOL->locr[I]; L2 = L1+1; L3 = (L1+LUSOL->lenr[I])-1; /* ***** This loop could be coded specially. */ #ifdef LUSOLFastSolve for(L = L2, aptr = LUSOL->a+L2, jptr = LUSOL->indr+L2; L <= L3; L++, aptr++, jptr++) T -= (*aptr) * W[*jptr]; #else for(L = L2; L <= L3; L++) { J = LUSOL->indr[L]; T -= LUSOL->a[L]*W[J]; } #endif J = LUSOL->iq[K]; if(fabs((REAL) T)<=SMALL) T = ZERO; else T /= LUSOL->a[L1]; W[J] = (REAL) T; } /* Compute residual for overdetermined systems. */ T = ZERO; for(K = NRANK1; K <= LUSOL->m; K++) { I = LUSOL->ip[K]; T += fabs(V[I]); } /* Exit. */ if(T>ZERO) *INFORM = LUSOL_INFORM_LUSINGULAR; LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; LUSOL->parmlu[LUSOL_RP_RESIDUAL_U] = (REAL) T; } } /* ================================================================== lu6Ut solves U'v = w. w is destroyed. ------------------------------------------------------------------ 15 Dec 2002: First version derived from lu6sol. 15 Dec 2002: Current version. ================================================================== */ void LU6UT(LUSOLrec *LUSOL, int *INFORM, REAL V[], REAL W[], int NZidx[]) { int I, J, K, L, L1, L2, NRANK, NRANK1, *ip = LUSOL->ip + 1, *iq = LUSOL->iq + 1; REAL SMALL; register REAL T; #ifdef LUSOLFastSolve REAL *aptr; int *jptr; #endif NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; NRANK1 = NRANK+1; L = LUSOL->m; #ifdef LUSOLFastSolve for(K = NRANK1, jptr = LUSOL->ip+K; K <= L; K++, jptr++) V[*jptr] = ZERO; #else for(K = NRANK1; K <= L; K++) { I = LUSOL->ip[K]; V[I] = ZERO; } #endif /* Do the forward-substitution, skipping columns of U(transpose) when the associated element of w(*) is negligible. */ #if 0 for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; J = LUSOL->iq[K]; #else for(K = 1; K <= NRANK; K++, ip++, iq++) { I = *ip; J = *iq; #endif T = W[J]; if(fabs(T)<=SMALL) { V[I] = ZERO; continue; } L1 = LUSOL->locr[I]; T /= LUSOL->a[L1]; V[I] = T; L2 = (L1+LUSOL->lenr[I])-1; L1++; /* ***** This loop could be coded specially. */ #ifdef LUSOLFastSolve for(L = L1, aptr = LUSOL->a+L1, jptr = LUSOL->indr+L1; L <= L2; L++, aptr++, jptr++) W[*jptr] -= T * (*aptr); #else for(L = L1; L <= L2; L++) { J = LUSOL->indr[L]; W[J] -= T*LUSOL->a[L]; } #endif } /* Compute residual for overdetermined systems. */ T = ZERO; for(K = NRANK1; K <= LUSOL->n; K++) { J = LUSOL->iq[K]; T += fabs(W[J]); } /* Exit. */ if(T>ZERO) *INFORM = LUSOL_INFORM_LUSINGULAR; LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; LUSOL->parmlu[LUSOL_RP_RESIDUAL_U] = T; } /* ================================================================== lu6sol uses the factorization A = L U as follows: ------------------------------------------------------------------ mode 1 v solves L v = v(input). w is not touched. 2 v solves L'v = v(input). w is not touched. 3 w solves U w = v. v is not altered. 4 v solves U'v = w. w is destroyed. 5 w solves A w = v. v is altered as in 1. 6 v solves A'v = w. w is destroyed. If mode = 3,4,5,6, v and w must not be the same arrays. If lu1fac has just been used to factorize a symmetric matrix A (which must be definite or quasi-definite), the factors A = L U may be regarded as A = LDL', where D = diag(U). In such cases, mode 7 v solves A v = L D L'v = v(input). w is not touched. 8 v solves L |D| L'v = v(input). w is not touched. ip(*), iq(*) hold row and column numbers in pivotal order. lenc(k) is the length of the k-th column of initial L. lenr(i) is the length of the i-th row of U. locc(*) is not used. locr(i) is the start of the i-th row of U. U is assumed to be in upper-trapezoidal form (nrank by n). The first entry for each row is the diagonal element (according to the permutations ip, iq). It is stored at location locr(i) in a(*), indr(*). On exit, inform = 0 except as follows. if(mode = 3,4,5,6 and if U (and hence A) is singular,) inform = 1 if there is a nonzero residual in solving the system involving U. parmlu(20) returns the norm of the residual. ------------------------------------------------------------------ July 1987: Early version. 09 May 1988: f77 version. 27 Apr 2000: Abolished the dreaded "computed go to". But hard to change other "go to"s to "if then else". 15 Dec 2002: lu6L, lu6Lt, lu6U, lu6Ut added to modularize lu6sol. ================================================================== */ void LU6SOL(LUSOLrec *LUSOL, int MODE, REAL V[], REAL W[], int NZidx[], int *INFORM) { if(MODE==LUSOL_SOLVE_Lv_v) { /* Solve L v(new) = v. */ LU6L(LUSOL, INFORM,V, NZidx); } else if(MODE==LUSOL_SOLVE_Ltv_v) { /* Solve L'v(new) = v. */ LU6LT(LUSOL, INFORM,V, NZidx); } else if(MODE==LUSOL_SOLVE_Uw_v) { /* Solve U w = v. */ LU6U(LUSOL, INFORM,V,W, NZidx); } else if(MODE==LUSOL_SOLVE_Utv_w) { /* Solve U'v = w. */ LU6UT(LUSOL, INFORM,V,W, NZidx); } else if(MODE==LUSOL_SOLVE_Aw_v) { /* Solve A w = v (i.e. FTRAN) */ LU6L(LUSOL, INFORM,V, NZidx); /* via L v(new) = v */ LU6U(LUSOL, INFORM,V,W, NULL); /* ... and U w = v(new). */ } else if(MODE==LUSOL_SOLVE_Atv_w) { /* Solve A'v = w (i.e. BTRAN) */ LU6UT(LUSOL, INFORM,V,W, NZidx); /* via U'v = w */ LU6LT(LUSOL, INFORM,V, NULL); /* ... and L'v(new) = v. */ } else if(MODE==LUSOL_SOLVE_Av_v) { /* Solve LDv(bar) = v */ LU6LD(LUSOL, INFORM,1,V, NZidx); /* and L'v(new) = v(bar). */ LU6LT(LUSOL, INFORM,V, NULL); } else if(MODE==LUSOL_SOLVE_LDLtv_v) { /* Solve L|D|v(bar) = v */ LU6LD(LUSOL, INFORM,2,V, NZidx); /* and L'v(new) = v(bar). */ LU6LT(LUSOL, INFORM,V, NULL); } } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol6l0.c100666 0 0 10622 11141443434 16575 0ustar usergroup /* Create a row-based version of L0. This makes it possible to solve L0'x=h (btran) faster for sparse h, since we only run down the columns of L0' (rows of LO) for which the corresponding entry in h is non-zero. */ MYBOOL LU1L0(LUSOLrec *LUSOL, LUSOLmat **mat, int *inform) { MYBOOL status = FALSE; int K, L, LL, L1, L2, LENL0, NUML0, I; int *lsumr; /* Assume success */ *inform = LUSOL_INFORM_LUSUCCESS; /* Check if there is anything worth doing */ if(mat == NULL) return( status ); if(*mat != NULL) LUSOL_matfree(mat); NUML0 = LUSOL->luparm[LUSOL_IP_COLCOUNT_L0]; LENL0 = LUSOL->luparm[LUSOL_IP_NONZEROS_L0]; if((NUML0 == 0) || (LENL0 == 0) || (LUSOL->luparm[LUSOL_IP_ACCELERATION] == LUSOL_BASEORDER) || ((LUSOL->luparm[LUSOL_IP_ACCELERATION] & LUSOL_ACCELERATE_L0) == 0)) return( status ); /* Allocate temporary array */ lsumr = (int *) LUSOL_CALLOC((LUSOL->m+1), sizeof(*lsumr)); if(lsumr == NULL) { *inform = LUSOL_INFORM_NOMEMLEFT; return( status ); } /* Compute non-zero counts by permuted row index (order is unimportant) */ K = 0; L2 = LUSOL->lena; L1 = L2-LENL0+1; for(L = L1; L <= L2; L++) { I = LUSOL->indc[L]; lsumr[I]++; if(lsumr[I] == 1) K++; } LUSOL->luparm[LUSOL_IP_ROWCOUNT_L0] = K; /* Check if we should apply "smarts" before proceeding to the row matrix creation */ if((LUSOL->luparm[LUSOL_IP_ACCELERATION] & LUSOL_AUTOORDER) && ((REAL) LUSOL->luparm[LUSOL_IP_ROWCOUNT_L0] / #if 0 LUSOL->luparm[LUSOL_IP_COLCOUNT_L0] #else LUSOL->m #endif > LUSOL->parmlu[LUSOL_RP_SMARTRATIO])) goto Finish; /* We are Ok to create the new matrix object */ *mat = LUSOL_matcreate(LUSOL->m, LENL0); if(*mat == NULL) { *inform = LUSOL_INFORM_NOMEMLEFT; goto Finish; } /* Cumulate row counts to get vector offsets; first row is leftmost (stick with Fortran array offset for consistency) */ (*mat)->lenx[0] = 1; for(K = 1; K <= LUSOL->m; K++) { (*mat)->lenx[K] = (*mat)->lenx[K-1] + lsumr[K]; lsumr[K] = (*mat)->lenx[K-1]; } /* Map the matrix into row order by permuted index; Note: The first permuted row is located leftmost in the array. The column order is irrelevant, since the indeces will refer to constant / resolved values of V[] during solve. */ L2 = LUSOL->lena; L1 = L2-LENL0+1; for(L = L1; L <= L2; L++) { I = LUSOL->indc[L]; LL = lsumr[I]++; (*mat)->a[LL] = LUSOL->a[L]; (*mat)->indr[LL] = LUSOL->indr[L]; (*mat)->indc[LL] = I; } /* Pack row starting positions, and set mapper from original index to packed */ I = 0; for(L = 1; L <= LUSOL->m; L++) { K = LUSOL->ip[L]; if((*mat)->lenx[K] > (*mat)->lenx[K-1]) { I++; (*mat)->indx[I] = K; } } /* Confirm that everything went well */ status = TRUE; /* Clean up */ Finish: FREE(lsumr); return( status ); } /* Solve L0' v = v based on row-based version of L0, constructed by LU1L0 */ void LU6L0T_v(LUSOLrec *LUSOL, LUSOLmat *mat, REAL V[], int NZidx[], int *INFORM) { #ifdef DoTraceL0 REAL TEMP; #endif int LEN, K, KK, L, L1, NUML0; REAL SMALL; register REAL VPIV; #if (defined LUSOLFastSolve) && !(defined DoTraceL0) REAL *aptr; int *jptr; #else int J; #endif NUML0 = LUSOL->luparm[LUSOL_IP_ROWCOUNT_L0]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; /* Loop over the nz columns of L0' - from the end, going forward. */ for(K = NUML0; K > 0; K--) { KK = mat->indx[K]; L = mat->lenx[KK]; L1 = mat->lenx[KK-1]; LEN = L - L1; if(LEN == 0) continue; /* Get value of the corresponding active entry of V[] */ VPIV = V[KK]; /* Only process the column of L0' if the value of V[] is non-zero */ if(fabs(VPIV)>SMALL) { /* ***** This loop could be coded specially. */ #if (defined LUSOLFastSolve) && !(defined DoTraceL0) L--; for(aptr = mat->a+L, jptr = mat->indr+L; LEN > 0; LEN--, aptr--, jptr--) V[*jptr] += VPIV * (*aptr); #else for(; LEN > 0; LEN--) { L--; J = mat->indr[L]; #ifndef DoTraceL0 V[J] += VPIV * mat->a[L]; #else TEMP = V[J]; V[J] += VPIV * mat->a[L]; printf("V[%3d] = V[%3d] + L[%d,%d]*V[%3d]\n", J, J, KK,J, KK); printf("%6g = %6g + %6g*%6g\n", V[J], TEMP, mat->a[L], VPIV); #endif } #endif } #ifdef SetSmallToZero else V[KK] = 0; #endif } } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol6u.c100666 0 0 11443 11141443434 16530 0ustar usergroup /* Create a column-based version of U. This makes it possible to solve Ux=h (ftran) faster for sparse h, since we only run down the rows of U (columns of U') for which the corresponding entry in h is non-zero. */ MYBOOL LU1U0(LUSOLrec *LUSOL, LUSOLmat **mat, int *inform) { MYBOOL status = FALSE; int K, L, LL, LENU, NUMU, J; int *lsumc; /* Assume success */ *inform = LUSOL_INFORM_LUSUCCESS; /* Check if there is anything worth doing */ if(mat == NULL) return( status ); if(*mat != NULL) LUSOL_matfree(mat); NUMU = LUSOL->luparm[LUSOL_IP_RANK_U]; LENU = LUSOL->luparm[LUSOL_IP_NONZEROS_U]; if((NUMU == 0) || (LENU == 0) || (LUSOL->luparm[LUSOL_IP_ACCELERATION] == LUSOL_BASEORDER) || ((LUSOL->luparm[LUSOL_IP_ACCELERATION] & LUSOL_ACCELERATE_U) == 0)) return( status ); /* Allocate temporary array */ lsumc = (int *) LUSOL_CALLOC((LUSOL->n+1), sizeof(*lsumc)); if(lsumc == NULL) { *inform = LUSOL_INFORM_NOMEMLEFT; return( status ); } /* Compute non-zero counts by permuted column index (order is unimportant) */ for(L = 1; L <= LENU; L++) { J = LUSOL->indr[L]; lsumc[J]++; } /* Check if we should apply "smarts" before proceeding to the column matrix creation */ if((LUSOL->luparm[LUSOL_IP_ACCELERATION] & LUSOL_AUTOORDER) && ((REAL) sqrt((REAL) NUMU/LENU) > LUSOL->parmlu[LUSOL_RP_SMARTRATIO])) goto Finish; /* We are Ok to create the new matrix object */ *mat = LUSOL_matcreate(LUSOL->n, LENU); if(*mat == NULL) { *inform = LUSOL_INFORM_NOMEMLEFT; goto Finish; } /* Cumulate row counts to get vector offsets; first column is leftmost (stick with Fortran array offset for consistency) */ (*mat)->lenx[0] = 1; for(K = 1; K <= LUSOL->n; K++) { (*mat)->lenx[K] = (*mat)->lenx[K-1] + lsumc[K]; lsumc[K] = (*mat)->lenx[K-1]; } /* Map the matrix into column order by permuted index; Note: The first permuted column is located leftmost in the array. The row order is irrelevant, since the indeces will refer to constant / resolved values of V[] during solve. */ for(L = 1; L <= LENU; L++) { J = LUSOL->indr[L]; LL = lsumc[J]++; (*mat)->a[LL] = LUSOL->a[L]; (*mat)->indr[LL] = J; (*mat)->indc[LL] = LUSOL->indc[L]; } /* Pack column starting positions, and set mapper from original index to packed */ J = 0; for(L = 1; L <= LUSOL->n; L++) { K = LUSOL->iq[L]; #if 1 /* Deactivate to produce a full-rank version (implicit unit diagonals) */ if((*mat)->lenx[K] > (*mat)->lenx[K-1]) #endif { J++; (*mat)->indx[J] = K; } } /* Confirm that everything went well */ status = TRUE; /* Clean up */ Finish: FREE(lsumc); return( status ); } /* Solve U w = v based on column-based version of U, constructed by LU1U0 */ void LU6U0_v(LUSOLrec *LUSOL, LUSOLmat *mat, REAL V[], REAL W[], int NZidx[], int *INFORM) { #ifdef DoTraceU0 REAL TEMP; #endif int LEN, I, K, L, L1, NRANK, NRANK1, KLAST; REAL SMALL; register REAL T; #if (defined xxLUSOLFastSolve) && !(defined DoTraceU0) REAL *aptr; int *jptr; #else int J; #endif NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *INFORM = LUSOL_INFORM_LUSUCCESS; NRANK1 = NRANK+1; /* Find the first nonzero in v(1:nrank), counting backwards. */ for(KLAST = NRANK; KLAST >= 1; KLAST--) { I = LUSOL->ip[KLAST]; if(fabs(V[I])>SMALL) break; } L = LUSOL->n; #ifdef xxLUSOLFastSolve for(K = KLAST+1, jptr = LUSOL->iq+K; K <= L; K++, jptr++) W[*jptr] = ZERO; #else for(K = KLAST+1; K <= L; K++) { J = LUSOL->iq[K]; W[J] = ZERO; } #endif /* Loop over the nz columns of U - from the right, going left. */ for(K = NRANK; K > 0; K--) { I = mat->indx[K]; L = mat->lenx[I]; L1 = mat->lenx[I-1]; LEN = L - L1; T = V[I]; if(fabs(T)<=SMALL) { W[K] = ZERO; continue; } T /= mat->a[L1]; /* Should it be L or L1 ? */ W[K] = T; LEN--; /* ***** This loop could be coded specially. */ #ifdef xxLUSOLFastSolve L--; for(aptr = mat->a+L, jptr = mat->indc+L; LEN > 0; LEN--, aptr--, jptr--) V[*jptr] -= T * (*aptr); #else for(; LEN > 0; LEN--) { L--; J = mat->indc[L]; #ifndef DoTraceL0 V[J] -= T * mat->a[L]; #else TEMP = V[J]; V[J] += T * mat->a[L]; printf("V[%3d] = V[%3d] + L[%d,%d]*V[%3d]\n", J, J, I,J, I); printf("%6g = %6g + %6g*%6g\n", V[J], TEMP, mat->a[L], T); #endif } #endif } /* Compute residual for overdetermined systems. */ T = ZERO; for(K = NRANK1; K <= LUSOL->m; K++) { I = LUSOL->ip[K]; T += fabs(V[I]); } /* Exit. */ if(T>ZERO) *INFORM = LUSOL_INFORM_LUSINGULAR; LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; LUSOL->parmlu[LUSOL_RP_RESIDUAL_U] = (REAL) T; } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol7a.c100666 0 0 53245 11141443434 16513 0ustar usergroup /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ File lusol7a lu7add lu7cyc lu7elm lu7for lu7rnk lu7zap Utilities for LUSOL's update routines. lu7for is the most important -- the forward sweep. 01 May 2002: Derived from LUSOL's original lu7a.f file. 01 May 2002: Current version of lusol7a.f. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* ================================================================== lu7add inserts the first nrank elements of the vector v(*) as column jadd of U. We assume that U does not yet have any entries in this column. Elements no larger than parmlu(3) are treated as zero. klast will be set so that the last row to be affected (in pivotal order) is row ip(klast). ------------------------------------------------------------------ 09 May 1988: First f77 version. ================================================================== */ void LU7ADD(LUSOLrec *LUSOL, int JADD, REAL V[], int LENL, int *LENU, int *LROW, int NRANK, int *INFORM, int *KLAST, REAL *VNORM) { REAL SMALL; int K, I, LENI, MINFRE, NFREE, LR1, LR2, L; #ifndef LUSOLFastMove int J; #endif SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; *VNORM = ZERO; *KLAST = 0; for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; if(fabs(V[I])<=SMALL) continue; *KLAST = K; (*VNORM) += fabs(V[I]); LENI = LUSOL->lenr[I]; /* Compress row file if necessary. */ MINFRE = LENI+1; NFREE = LUSOL->lena - LENL - *LROW; if(NFREEm, TRUE,LROW,LUSOL->indr,LUSOL->lenr,LUSOL->locr); NFREE = LUSOL->lena - LENL - *LROW; if(NFREElocr[I] = (*LROW) + 1; LR1 = LUSOL->locr[I]; LR2 = (LR1+LENI)-1; if(LR2==*LROW) goto x150; if(LUSOL->indr[LR2+1]==0) goto x180; LUSOL->locr[I] = (*LROW) + 1; #ifdef LUSOLFastMove L = LR2-LR1+1; if(L > 0) { LR2 = (*LROW)+1; MEMMOVE(LUSOL->a+LR2, LUSOL->a+LR1, L); MEMMOVE(LUSOL->indr+LR2, LUSOL->indr+LR1, L); MEMCLEAR(LUSOL->indr+LR1, L); *LROW += L; } #else for(L = LR1; L <= LR2; L++) { (*LROW)++; LUSOL->a[*LROW] = LUSOL->a[L]; J = LUSOL->indr[L]; LUSOL->indr[L] = 0; LUSOL->indr[*LROW] = J; } #endif x150: LR2 = *LROW; (*LROW)++; /* Add the element of v. */ x180: LR2++; LUSOL->a[LR2] = V[I]; LUSOL->indr[LR2] = JADD; LUSOL->lenr[I] = LENI+1; (*LENU)++; } /* Normal exit. */ *INFORM = LUSOL_INFORM_LUSUCCESS; goto x990; /* Not enough storage. */ x970: *INFORM = LUSOL_INFORM_ANEEDMEM; x990: ; } /* ================================================================== lu7cyc performs a cyclic permutation on the row or column ordering stored in ip, moving entry kfirst down to klast. If kfirst .ge. klast, lu7cyc should not be called. Sometimes klast = 0 and nothing should happen. ------------------------------------------------------------------ 09 May 1988: First f77 version. ================================================================== */ void LU7CYC(LUSOLrec *LUSOL, int KFIRST, int KLAST, int IX[]) { if(KFIRST 0, y has just become column jelm of the matrix A. lu7elm should not be called unless m is greater than nrank. inform = 0 if y contained no subdiagonal nonzeros to eliminate. inform = 1 if y contained at least one nontrivial subdiagonal. inform = 7 if there is insufficient storage. ------------------------------------------------------------------ 09 May 1988: First f77 version. No longer calls lu7for at end. lu8rpc, lu8mod do so. ================================================================== */ void LU7ELM(LUSOLrec *LUSOL, int JELM, REAL V[], int *LENL, int *LROW, int NRANK, int *INFORM, REAL *DIAG) { REAL VI, VMAX, SMALL; int NRANK1, MINFRE, NFREE, KMAX, L, K, I, LMAX, IMAX, L1, L2; #ifdef ForceInitialization LMAX = 0; #endif SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; NRANK1 = NRANK+1; *DIAG = ZERO; /* Compress row file if necessary. */ MINFRE = LUSOL->m-NRANK; NFREE = LUSOL->lena-(*LENL)-(*LROW); if(NFREE>=MINFRE) goto x100; LU1REC(LUSOL, LUSOL->m,TRUE,LROW,LUSOL->indr,LUSOL->lenr,LUSOL->locr); NFREE = LUSOL->lena-(*LENL)-(*LROW); if(NFREElena-(*LENL))+1; for(K = NRANK1; K <= LUSOL->m; K++) { I = LUSOL->ip[K]; VI = fabs(V[I]); if(VI<=SMALL) continue; L--; LUSOL->a[L] = V[I]; LUSOL->indc[L] = I; if(VMAX>=VI) continue; VMAX = VI; KMAX = K; LMAX = L; } if(KMAX==0) goto x900; /* ------------------------------------------------------------------ Remove vmax by overwriting it with the last packed v(i). Then set the multipliers in L for the other elements. ------------------------------------------------------------------ */ IMAX = LUSOL->ip[KMAX]; VMAX = LUSOL->a[LMAX]; LUSOL->a[LMAX] = LUSOL->a[L]; LUSOL->indc[LMAX] = LUSOL->indc[L]; L1 = L+1; L2 = LUSOL->lena-(*LENL); *LENL = ((*LENL)+L2)-L; for(L = L1; L <= L2; L++) { LUSOL->a[L] /= -VMAX; LUSOL->indr[L] = IMAX; } /* Move the row containing vmax to pivotal position nrank + 1. */ LUSOL->ip[KMAX] = LUSOL->ip[NRANK1]; LUSOL->ip[NRANK1] = IMAX; *DIAG = VMAX; /* ------------------------------------------------------------------ If jelm is positive, insert vmax into a new row of U. This is now the only subdiagonal element. ------------------------------------------------------------------ */ if(JELM>0) { (*LROW)++; LUSOL->locr[IMAX] = *LROW; LUSOL->lenr[IMAX] = 1; LUSOL->a[*LROW] = VMAX; LUSOL->indr[*LROW] = JELM; } *INFORM = LUSOL_INFORM_LUSINGULAR; goto x990; /* No elements to eliminate. */ x900: *INFORM = LUSOL_INFORM_LUSUCCESS; goto x990; /* Not enough storage. */ x970: *INFORM = LUSOL_INFORM_ANEEDMEM; x990: ; } /* ================================================================== lu7for (forward sweep) updates the LU factorization A = L*U when row iw = ip(klast) of U is eliminated by a forward sweep of stabilized row operations, leaving ip * U * iq upper triangular. The row permutation ip is updated to preserve stability and/or sparsity. The column permutation iq is not altered. kfirst is such that row ip(kfirst) is the first row involved in eliminating row iw. (Hence, kfirst marks the first nonzero in row iw in pivotal order.) If kfirst is unknown it may be input as 1. klast is such that row ip(klast) is the row being eliminated. klast is not altered. lu7for should be called only if kfirst .le. klast. If kfirst = klast, there are no nonzeros to eliminate, but the diagonal element of row ip(klast) may need to be moved to the front of the row. ------------------------------------------------------------------ On entry, locc(*) must be zero. On exit: inform = 0 if row iw has a nonzero diagonal (could be small). inform = 1 if row iw has no diagonal. inform = 7 if there is not enough storage to finish the update. On a successful exit (inform le 1), locc(*) will again be zero. ------------------------------------------------------------------ Jan 1985: Final f66 version. 09 May 1988: First f77 version. ================================================================== */ void LU7FOR(LUSOLrec *LUSOL, int KFIRST, int KLAST, int *LENL, int *LENU, int *LROW, int *INFORM, REAL *DIAG) { MYBOOL SWAPPD; int KBEGIN, IW, LENW, LW1, LW2, JFIRST, MINFRE, NFREE, L, J, KSTART, KSTOP, K, LFIRST, IV, LENV, LV1, JLAST, LV2, LV3, LV, JV, LW, LDIAG, LIMIT; REAL AMULT, LTOL, USPACE, SMALL, VJ, WJ; LTOL = LUSOL->parmlu[LUSOL_RP_UPDATEMAX_Lij]; SMALL = LUSOL->parmlu[LUSOL_RP_ZEROTOLERANCE]; USPACE = LUSOL->parmlu[LUSOL_RP_COMPSPACE_U]; KBEGIN = KFIRST; SWAPPD = FALSE; /* We come back here from below if a row interchange is performed. */ x100: IW = LUSOL->ip[KLAST]; LENW = LUSOL->lenr[IW]; if(LENW==0) goto x910; LW1 = LUSOL->locr[IW]; LW2 = (LW1+LENW)-1; JFIRST = LUSOL->iq[KBEGIN]; if(KBEGIN>=KLAST) goto x700; /* Make sure there is room at the end of the row file in case row iw is moved there and fills in completely. */ MINFRE = LUSOL->n+1; NFREE = LUSOL->lena-(*LENL)-(*LROW); if(NFREEm,TRUE,LROW,LUSOL->indr,LUSOL->lenr,LUSOL->locr); LW1 = LUSOL->locr[IW]; LW2 = (LW1+LENW)-1; NFREE = LUSOL->lena-(*LENL)-(*LROW); if(NFREEindr[L]; LUSOL->locc[J] = L; } /* ================================================================== Main elimination loop. ================================================================== */ KSTART = KBEGIN; KSTOP = MIN(KLAST,LUSOL->n); for(K = KSTART; K <= KSTOP; K++) { JFIRST = LUSOL->iq[K]; LFIRST = LUSOL->locc[JFIRST]; if(LFIRST==0) goto x490; /* Row iw has its first element in column jfirst. */ WJ = LUSOL->a[LFIRST]; if(K==KLAST) goto x490; /* --------------------------------------------------------------- We are about to use the first element of row iv to eliminate the first element of row iw. However, we may wish to interchange the rows instead, to preserve stability and/or sparsity. --------------------------------------------------------------- */ IV = LUSOL->ip[K]; LENV = LUSOL->lenr[IV]; LV1 = LUSOL->locr[IV]; VJ = ZERO; if(LENV==0) goto x150; if(LUSOL->indr[LV1]!=JFIRST) goto x150; VJ = LUSOL->a[LV1]; if(SWAPPD) goto x200; if(LTOL*fabs(WJ)ip[KLAST] = IV; LUSOL->ip[K] = IW; KBEGIN = K; SWAPPD = TRUE; goto x600; /* --------------------------------------------------------------- Delete the eliminated element from row iw by overwriting it with the last element. --------------------------------------------------------------- */ x200: LUSOL->a[LFIRST] = LUSOL->a[LW2]; JLAST = LUSOL->indr[LW2]; LUSOL->indr[LFIRST] = JLAST; LUSOL->indr[LW2] = 0; LUSOL->locc[JLAST] = LFIRST; LUSOL->locc[JFIRST] = 0; LENW--; (*LENU)--; if(*LROW==LW2) (*LROW)--; LW2 = LW2-1; /* --------------------------------------------------------------- Form the multiplier and store it in the L file. --------------------------------------------------------------- */ if(fabs(WJ)<=SMALL) goto x490; AMULT = -WJ/VJ; L = LUSOL->lena-(*LENL); LUSOL->a[L] = AMULT; LUSOL->indr[L] = IV; LUSOL->indc[L] = IW; (*LENL)++; /* --------------------------------------------------------------- Add the appropriate multiple of row iv to row iw. We use two different inner loops. The first one is for the case where row iw is not at the end of storage. --------------------------------------------------------------- */ if(LENV==1) goto x490; LV2 = LV1+1; LV3 = (LV1+LENV)-1; if(LW2==*LROW) goto x400; /* ............................................................... This inner loop will be interrupted only if fill-in occurs enough to bump into the next row. ............................................................... */ for(LV = LV2; LV <= LV3; LV++) { JV = LUSOL->indr[LV]; LW = LUSOL->locc[JV]; if(LW>0) { /* No fill-in. */ LUSOL->a[LW] += AMULT*LUSOL->a[LV]; if(fabs(LUSOL->a[LW])<=SMALL) { /* Delete small computed element. */ LUSOL->a[LW] = LUSOL->a[LW2]; J = LUSOL->indr[LW2]; LUSOL->indr[LW] = J; LUSOL->indr[LW2] = 0; LUSOL->locc[J] = LW; LUSOL->locc[JV] = 0; (*LENU)--; LENW--; LW2--; } } else { /* Row iw doesn't have an element in column jv yet so there is a fill-in. */ if(LUSOL->indr[LW2+1]!=0) goto x360; (*LENU)++; LENW++; LW2++; LUSOL->a[LW2] = AMULT*LUSOL->a[LV]; LUSOL->indr[LW2] = JV; LUSOL->locc[JV] = LW2; } } goto x490; /* Fill-in interrupted the previous loop. Move row iw to the end of the row file. */ x360: LV2 = LV; LUSOL->locr[IW] = (*LROW)+1; #ifdef LUSOLFastMove L = LW2-LW1+1; if(L > 0) { int loci, *locp; for(loci = LW1, locp = LUSOL->indr+LW1; loci <= LW2; loci++, locp++) { (*LROW)++; LUSOL->locc[*locp] = *LROW; } LW2 = (*LROW)-L+1; MEMMOVE(LUSOL->a+LW2, LUSOL->a+LW1, L); MEMMOVE(LUSOL->indr+LW2, LUSOL->indr+LW1, L); MEMCLEAR(LUSOL->indr+LW1, L); } #else for(L = LW1; L <= LW2; L++) { (*LROW)++; LUSOL->a[*LROW] = LUSOL->a[L]; J = LUSOL->indr[L]; LUSOL->indr[L] = 0; LUSOL->indr[*LROW] = J; LUSOL->locc[J] = *LROW; } #endif LW1 = LUSOL->locr[IW]; LW2 = *LROW; /* ............................................................... Inner loop with row iw at the end of storage. ............................................................... */ x400: for(LV = LV2; LV <= LV3; LV++) { JV = LUSOL->indr[LV]; LW = LUSOL->locc[JV]; if(LW>0) { /* No fill-in. */ LUSOL->a[LW] += AMULT*LUSOL->a[LV]; if(fabs(LUSOL->a[LW])<=SMALL) { /* Delete small computed element. */ LUSOL->a[LW] = LUSOL->a[LW2]; J = LUSOL->indr[LW2]; LUSOL->indr[LW] = J; LUSOL->indr[LW2] = 0; LUSOL->locc[J] = LW; LUSOL->locc[JV] = 0; (*LENU)--; LENW--; LW2--; } } else { /* Row iw doesn't have an element in column jv yet so there is a fill-in. */ (*LENU)++; LENW++; LW2++; LUSOL->a[LW2] = AMULT*LUSOL->a[LV]; LUSOL->indr[LW2] = JV; LUSOL->locc[JV] = LW2; } } *LROW = LW2; /* The k-th element of row iw has been processed. Reset swappd before looking at the next element. */ x490: SWAPPD = FALSE; } /* ================================================================== End of main elimination loop. ================================================================== Cancel markers on row iw. */ x600: LUSOL->lenr[IW] = LENW; if(LENW==0) goto x910; for(L = LW1; L <= LW2; L++) { J = LUSOL->indr[L]; LUSOL->locc[J] = 0; } /* Move the diagonal element to the front of row iw. At this stage, lenw gt 0 and klast le n. */ x700: for(L = LW1; L <= LW2; L++) { LDIAG = L; if(LUSOL->indr[L]==JFIRST) goto x730; } goto x910; x730: *DIAG = LUSOL->a[LDIAG]; LUSOL->a[LDIAG] = LUSOL->a[LW1]; LUSOL->a[LW1] = *DIAG; LUSOL->indr[LDIAG] = LUSOL->indr[LW1]; LUSOL->indr[LW1] = JFIRST; /* If an interchange is needed, repeat from the beginning with the new row iw, knowing that the opposite interchange cannot occur. */ if(SWAPPD) goto x100; *INFORM = LUSOL_INFORM_LUSUCCESS; goto x950; /* Singular. */ x910: *DIAG = ZERO; *INFORM = LUSOL_INFORM_LUSINGULAR; /* Force a compression if the file for U is much longer than the no. of nonzeros in U (i.e. if lrow is much bigger than lenU). This should prevent memory fragmentation when there is far more memory than necessary (i.e. when lena is huge). */ x950: LIMIT = (int) (USPACE*(*LENU))+LUSOL->m+LUSOL->n+1000; if(*LROW>LIMIT) LU1REC(LUSOL, LUSOL->m,TRUE,LROW,LUSOL->indr,LUSOL->lenr,LUSOL->locr); goto x990; /* Not enough storage. */ x970: *INFORM = LUSOL_INFORM_ANEEDMEM; /* Exit. */ x990: ; } /* ================================================================== lu7rnk (check rank) assumes U is currently nrank by n and determines if row nrank contains an acceptable pivot. If not, the row is deleted and nrank is decreased by 1. jsing is an input parameter (not altered). If jsing is positive, column jsing has already been judged dependent. A substitute (if any) must be some other column. ------------------------------------------------------------------ -- Jul 1987: First version. 09 May 1988: First f77 version. ================================================================== */ void LU7RNK(LUSOLrec *LUSOL, int JSING, int *LENU, int *LROW, int *NRANK, int *INFORM, REAL *DIAG) { REAL UTOL1, UMAX; int IW, LENW, L1, L2, LMAX, L, JMAX, KMAX; #ifdef ForceInitialization L1 = 0; L2 = 0; #endif UTOL1 = LUSOL->parmlu[LUSOL_RP_SMALLDIAG_U]; *DIAG = ZERO; /* Find Umax, the largest element in row nrank. */ IW = LUSOL->ip[*NRANK]; LENW = LUSOL->lenr[IW]; if(LENW==0) goto x400; L1 = LUSOL->locr[IW]; L2 = (L1+LENW)-1; UMAX = ZERO; LMAX = L1; for(L = L1; L <= L2; L++) { if(UMAXa[L])) { UMAX = fabs(LUSOL->a[L]); LMAX = L; } } /* Find which column that guy is in (in pivotal order). Interchange him with column nrank, then move him to be the new diagonal at the front of row nrank. */ *DIAG = LUSOL->a[LMAX]; JMAX = LUSOL->indr[LMAX]; for(KMAX = *NRANK; KMAX <= LUSOL->n; KMAX++) { if(LUSOL->iq[KMAX]==JMAX) break; } LUSOL->iq[KMAX] = LUSOL->iq[*NRANK]; LUSOL->iq[*NRANK] = JMAX; LUSOL->a[LMAX] = LUSOL->a[L1]; LUSOL->a[L1] = *DIAG; LUSOL->indr[LMAX] = LUSOL->indr[L1]; LUSOL->indr[L1] = JMAX; /* See if the new diagonal is big enough. */ if(UMAX<=UTOL1) goto x400; if(JMAX==JSING) goto x400; /* ------------------------------------------------------------------ The rank stays the same. ------------------------------------------------------------------ */ *INFORM = LUSOL_INFORM_LUSUCCESS; return; /* ------------------------------------------------------------------ The rank decreases by one. ------------------------------------------------------------------ */ x400: *INFORM = LUSOL_INFORM_RANKLOSS; (*NRANK)--; if(LENW>0) { /* Delete row nrank from U. */ LENU = LENU-LENW; LUSOL->lenr[IW] = 0; for(L = L1; L <= L2; L++) { LUSOL->indr[L] = 0; } if(L2==*LROW) { /* This row was at the end of the data structure. We have to reset lrow. Preceding rows might already have been deleted, so we have to be prepared to go all the way back to 1. */ for(L = 1; L <= L2; L++) { if(LUSOL->indr[*LROW]>0) goto x900; (*LROW)--; } } } x900: ; } /* ================================================================== lu7zap eliminates all nonzeros in column jzap of U. It also sets kzap to the position of jzap in pivotal order. Thus, on exit we have iq(kzap) = jzap. ------------------------------------------------------------------ -- Jul 1987: nrank added. 10 May 1988: First f77 version. ================================================================== */ void LU7ZAP(LUSOLrec *LUSOL, int JZAP, int *KZAP, int *LENU, int *LROW, int NRANK) { int K, I, LENI, LR1, LR2, L; for(K = 1; K <= NRANK; K++) { I = LUSOL->ip[K]; LENI = LUSOL->lenr[I]; if(LENI==0) goto x90; LR1 = LUSOL->locr[I]; LR2 = (LR1+LENI)-1; for(L = LR1; L <= LR2; L++) { if(LUSOL->indr[L]==JZAP) goto x60; } goto x90; /* Delete the old element. */ x60: LUSOL->a[L] = LUSOL->a[LR2]; LUSOL->indr[L] = LUSOL->indr[LR2]; LUSOL->indr[LR2] = 0; LUSOL->lenr[I] = LENI-1; (*LENU)--; /* Stop if we know there are no more rows containing jzap. */ x90: *KZAP = K; if(LUSOL->iq[K]==JZAP) goto x800; } /* nrank must be smaller than n because we haven't found kzap yet. */ L = LUSOL->n; for(K = NRANK+1; K <= L; K++) { *KZAP = K; if(LUSOL->iq[K]==JZAP) break; } /* See if we zapped the last element in the file. */ x800: if(*LROW>0) { if(LUSOL->indr[*LROW]==0) (*LROW)--; } } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusol8a.c100666 0 0 25647 11141443435 16522 0ustar usergroup /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ File lusol8a lu8rpc Sparse LU update: Replace Column LUSOL's sparse implementation of the Bartels-Golub update. 01 May 2002: Derived from LUSOL's original lu8a.f file. 01 May 2002: Current version of lusol8a.f. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ /* ================================================================== lu8rpc updates the LU factorization A = L*U when column jrep is replaced by some vector a(new). lu8rpc is an implementation of the Bartels-Golub update, designed for the case where A is rectangular and/or singular. L is a product of stabilized eliminations (m x m, nonsingular). P U Q is upper trapezoidal (m x n, rank nrank). If mode1 = 0, the old column is taken to be zero (so it does not have to be removed from U). If mode1 = 1, the old column need not have been zero. If mode2 = 0, the new column is taken to be zero. v(*) is not used or altered. If mode2 = 1, v(*) must contain the new column a(new). On exit, v(*) will satisfy L*v = a(new). If mode2 = 2, v(*) must satisfy L*v = a(new). The array w(*) is not used or altered. On entry, all elements of locc are assumed to be zero. On a successful exit (inform != 7), this will again be true. On exit: inform = -1 if the rank of U decreased by 1. inform = 0 if the rank of U stayed the same. inform = 1 if the rank of U increased by 1. inform = 2 if the update seemed to be unstable (diag much bigger than vnorm). inform = 7 if the update was not completed (lack of storage). inform = 8 if jrep is not between 1 and n. ------------------------------------------------------------------ -- Jan 1985: Original F66 version. -- Jul 1987: Modified to maintain U in trapezoidal form. 10 May 1988: First f77 version. 16 Oct 2000: Added test for instability (inform = 2). ================================================================== */ void LU8RPC(LUSOLrec *LUSOL, int MODE1, int MODE2, int JREP, REAL V[], REAL W[], int *INFORM, REAL *DIAG, REAL *VNORM) { MYBOOL SINGLR; int LPRINT, NRANK, LENL, LENU, LROW, NRANK0, KREP, KLAST, IW, L1, J1, JSING; REAL UTOL1, UTOL2; LPRINT = LUSOL->luparm[LUSOL_IP_PRINTLEVEL]; NRANK = LUSOL->luparm[LUSOL_IP_RANK_U]; LENL = LUSOL->luparm[LUSOL_IP_NONZEROS_L]; LENU = LUSOL->luparm[LUSOL_IP_NONZEROS_U]; LROW = LUSOL->luparm[LUSOL_IP_NONZEROS_ROW]; UTOL1 = LUSOL->parmlu[LUSOL_RP_SMALLDIAG_U]; UTOL2 = LUSOL->parmlu[LUSOL_RP_EPSDIAG_U]; NRANK0 = NRANK; *DIAG = ZERO; *VNORM = ZERO; if(JREP<1) goto x980; if(JREP>LUSOL->n) goto x980; /* ------------------------------------------------------------------ If mode1 = 0, there are no elements to be removed from U but we still have to set krep (using a backward loop). Otherwise, use lu7zap to remove column jrep from U and set krep at the same time. ------------------------------------------------------------------ */ if(MODE1==LUSOL_UPDATE_OLDEMPTY) { KREP = LUSOL->n+1; x10: KREP--; if(LUSOL->iq[KREP]!=JREP) goto x10; } else LU7ZAP(LUSOL, JREP,&KREP,&LENU,&LROW,NRANK); /* ------------------------------------------------------------------ Insert a new column of u and find klast. ------------------------------------------------------------------ */ if(MODE2==LUSOL_UPDATE_NEWEMPTY) { KLAST = 0; } else { if(MODE2==LUSOL_UPDATE_NEWNONEMPTY) { /* Transform v = a(new) to satisfy L*v = a(new). */ LU6SOL(LUSOL, LUSOL_SOLVE_Lv_v, V,W, NULL, INFORM); } else if(V==NULL) /* Otherwise, the V vector is taken to satisfy this already, or stored earlier. */ V=LUSOL->vLU6L; /* Insert into U any nonzeros in the top of v. row ip(klast) will contain the last nonzero in pivotal order. Note that klast will be in the range ( 0, nrank ). */ LU7ADD(LUSOL, JREP,V,LENL,&LENU,&LROW,NRANK,INFORM,&KLAST,VNORM); if(*INFORM==LUSOL_INFORM_ANEEDMEM) goto x970; } /* ------------------------------------------------------------------ In general, the new column causes U to look like this: krep n krep n ....a......... ..........a... . a . . a . . a . . a . .a . . a . P U Q = a . or . a . b. . . a . b . . . a . b . . . a . b ...... ..a... nrank c c c c c c m klast points to the last nonzero "a" or "b". klast = 0 means all "a" and "b" entries are zero. ------------------------------------------------------------------ */ if(MODE2==LUSOL_UPDATE_NEWEMPTY) { if(KREP>NRANK) goto x900; } else if(NRANKm) { /* Eliminate any "c"s (in either case). Row nrank + 1 may end up containing one nonzero. */ LU7ELM(LUSOL, JREP,V,&LENL,&LROW,NRANK,INFORM,DIAG); if(*INFORM==LUSOL_INFORM_ANEEDMEM) goto x970; if(*INFORM==LUSOL_INFORM_LUSINGULAR) { /* The nonzero is apparently significant. Increase nrank by 1 and make klast point to the bottom. */ NRANK++; KLAST = NRANK; } } if(NRANKn) { /* The column rank is low. In the first case, we want the new column to end up in position nrank, so the trapezoidal columns will have a chance later on (in lu7rnk) to pivot in that position. Otherwise the new column is not part of the triangle. We swap it into position nrank so we can judge it for singularity. lu7rnk might choose some other trapezoidal column later. */ if(KREPiq[KREP] = LUSOL->iq[NRANK]; LUSOL->iq[NRANK] = JREP; KREP = NRANK; } } /* ------------------------------------------------------------------ If krep .lt. klast, there are some "b"s to eliminate: krep ....a......... . a . . a . .a . P U Q = a . krep b. . b . . b . . b ...... nrank If krep .eq. klast, there are no "b"s, but the last "a" still has to be moved to the front of row krep (by lu7for). ------------------------------------------------------------------ */ if(KREP<=KLAST) { /* Perform a cyclic permutation on the current pivotal order, and eliminate the resulting row spike. krep becomes klast. The final diagonal (if any) will be correctly positioned at the front of the new krep-th row. nrank stays the same. */ LU7CYC(LUSOL, KREP,KLAST,LUSOL->ip); LU7CYC(LUSOL, KREP,KLAST,LUSOL->iq); LU7FOR(LUSOL, KREP,KLAST,&LENL,&LENU,&LROW,INFORM,DIAG); if(*INFORM==LUSOL_INFORM_ANEEDMEM) goto x970; KREP = KLAST; /* Test for instability (diag much bigger than vnorm). */ SINGLR = (MYBOOL) ((*VNORM)ip[KREP]; SINGLR = (MYBOOL) (LUSOL->lenr[IW]==0); if(!SINGLR) { L1 = LUSOL->locr[IW]; J1 = LUSOL->indr[L1]; SINGLR = (MYBOOL) (J1!=JREP); if(!SINGLR) { *DIAG = LUSOL->a[L1]; SINGLR = (MYBOOL) (fabs(*DIAG)<=UTOL1 || fabs(*DIAG)<=UTOL2*(*VNORM)); } } if(SINGLR && (KREPip); LU7CYC(LUSOL, KREP,LUSOL->n,LUSOL->iq); LU7FOR(LUSOL, KREP,NRANK,&LENL,&LENU,&LROW,INFORM,DIAG); if(*INFORM==LUSOL_INFORM_ANEEDMEM) goto x970; } /* Find the best column to be in position nrank. If singlr, it can't be the new column, jrep. If nothing satisfactory exists, nrank will be decreased. */ if(SINGLR || (NRANKn)) { JSING = 0; if(SINGLR) JSING = JREP; LU7RNK(LUSOL, JSING,&LENU,&LROW,&NRANK,INFORM,DIAG); } /* ------------------------------------------------------------------ Update indeces of optional row-based version of L0. ------------------------------------------------------------------ */ #if 0 if(LUSOL->L0 != NULL) LU1L0UPD(LUSOL, INFORM); #endif /* ------------------------------------------------------------------ Set inform for exit. ------------------------------------------------------------------ */ x900: if(NRANK==NRANK0) *INFORM = LUSOL_INFORM_LUSUCCESS; else if(NRANKn) { if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu8rpc warning...\nSingularity after replacing column. jrep=%8d diag=%g\n", JREP,DIAG); } } else *INFORM = LUSOL_INFORM_LUSINGULAR; goto x990; /* Instability. */ x920: *INFORM = LUSOL_INFORM_LUUNSTABLE; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu8rpc warning...\nInstability after replacing column. jrep=%8d diag=%g\n", JREP,DIAG); goto x990; /* Not enough storage. */ x970: *INFORM = LUSOL_INFORM_ANEEDMEM; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu8rpc error...\nInsufficient memory. lena=%8d\n", LUSOL->lena); goto x990; /* jrep is out of range. */ x980: *INFORM = LUSOL_INFORM_FATALERR; if(LPRINT>=LUSOL_MSG_SINGULARITY) LUSOL_report(LUSOL, 0, "lu8rpc error...\njrep is out of range. m=%8d n=%8d jrep=%8d\n", LUSOL->m,LUSOL->n,JREP); /* Exit. */ x990: LUSOL->luparm[LUSOL_IP_UPDATECOUNT]++; LUSOL->luparm[LUSOL_IP_RANK_U] = NRANK; LUSOL->luparm[LUSOL_IP_NONZEROS_L] = LENL; LUSOL->luparm[LUSOL_IP_NONZEROS_U] = LENU; LUSOL->luparm[LUSOL_IP_NONZEROS_ROW] = LROW; LUSOL->luparm[LUSOL_IP_INFORM] = *INFORM; } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusolio.c100666 0 0 16151 11141443435 16607 0ustar usergroup #include #include #include "mmio.h" #include "hbio.h" #include "lusolio.h" /* Utility routines to read matrix files in the Coordinate Text File format*/ MYBOOL ctf_read_A(char *filename, int maxm, int maxn, int maxnz, int *m, int *n, int *nnzero, int *iA, int *jA, REAL *Aij) { FILE *iofile; int eof; char buffer[100]; int k, i, j; REAL Ak; MYBOOL filldata; *nnzero = 0; *m = 0; *n = 0; iofile = fopen(filename, "r" ); if(iofile == NULL) { printf("A file %s does not exist\n", filename); return( FALSE ); } filldata = (MYBOOL) !((iA == NULL) && (jA == NULL) && (Aij == NULL)); eof = TRUE; for (k = 1; k <= maxnz; k++) { eof = feof(iofile); if(eof) break; eof = fscanf(iofile, "%d %d %s", &i, &j, buffer); if(eof == 0 || eof == EOF || i <= 0 || j <= 0 || strlen(buffer) == 0) break; Ak = atof(buffer); (*nnzero)++; if (filldata) { iA[k] = i; jA[k] = j; Aij[k] = Ak; } if (i > *m) *m = i; if (j > *n) *n = j; } fclose( iofile ); if(!eof) { printf("Too much data in A file. Increase maxnz\n"); printf("Current maxnz = %d\n", maxnz); return( FALSE ); } printf("A read successfully\n"); printf("m = %d n = %d nnzero = %d\n", *m, *n, *nnzero); if (*m > maxm || *n > maxn) { printf("However, matrix dimensions exceed maxm or maxn\n"); return( FALSE ); } return( TRUE ); } MYBOOL ctf_size_A(char *filename, int *m, int *n, int *nnzero) { int maxint = 200000000; return( ctf_read_A(filename, maxint, maxint, maxint, m, n, nnzero, NULL, NULL, NULL) ); } MYBOOL ctf_read_b(char *filename, int m, REAL *b) { FILE *iofile; int eof; char buffer[100]; int i; iofile = fopen(filename, "r"); if(iofile == NULL) { printf("b file %s does not exist\n", filename); return( FALSE ); } for (i = 1; i <= m; i++) { if(feof(iofile)) goto x350; eof = fscanf(iofile, "%s", buffer); if(eof == 0 || eof == EOF) goto x350; b[i] = atof(buffer); } fclose( iofile ); printf("b read successfully\n"); return( TRUE ); x350: fclose( iofile ); printf("Not enough data in b file.\n"); return( FALSE ); } /* Utility routines to read matrix files in the MatrixMarket format*/ #define mmf_recsize 255 MYBOOL mmf_read_A(char *filename, int maxM, int maxN, int maxnz, int *M, int *N, int *nz, int *iA, int *jA, REAL *Aij) { MM_typecode matcode; FILE *f; int i, k, ret_code, ival, jval; REAL Aval; MYBOOL status = FALSE, ispat, filldata; char buf[mmf_recsize]; f = fopen(filename, "r"); if(f == NULL) return( status ); if(mm_read_banner(f, &matcode) != 0) { printf("Could not process Matrix Market banner.\n"); goto x900; } /* Screen matrix types since LUSOL only supports a subset of the Matrix Market data types. */ if(mm_is_complex(matcode) || mm_is_pattern(matcode)) { printf("Sorry, this application does not support "); printf("Market Market type: [%s]\n", mm_typecode_to_str(matcode)); goto x900; } /* Verify that we have sufficient array storage */ filldata = (MYBOOL) !((iA == NULL) && (jA == NULL) && (Aij == NULL)); if(filldata && maxN > 1 && jA == NULL) { printf("Market Market insufficient array storage specified\n"); goto x900; } /* Find out size of sparse matrix .... */ ret_code = mm_read_mtx_crd_size(f, M, N, nz); if(ret_code != 0 || !filldata || (*M > maxM) || (*N > maxN) || (*nz > maxnz)) { status = !filldata; goto x900; } /* NOTE: when reading in doubles, ANSI C requires the use of the "l" */ /* specifier as in "%lg", "%lf", "%le", otherwise errors will occur */ /* (ANSI C X3.159-1989, Sec. 4.9.6.2, p. 136 lines 13-15) */ /* Read dense matrix in column order */ ispat = (MYBOOL) mm_is_pattern(matcode); k = 1; if(mm_is_dense(matcode)) { maxN = MIN(maxN, *N); for (jval = 1; jval <= maxN; jval++) { for (i = 1; i <= *M; i++) { if(fgets(buf, mmf_recsize-1, f) == NULL) break; if(sscanf(buf, "%lg\n", &Aval) == 0) break; if(Aval != 0) { if(iA != NULL) iA[k] = i; if(jA != NULL) jA[k] = jval; /* Make sure we handle dense vector reading properly */ if(iA == NULL && jA == NULL) Aij[i] = Aval; else Aij[k] = Aval; k++; } } } } /* Read sparse matrix by coordinate */ else { for (i = 1; i <= *nz; i++) { if(fgets(buf, mmf_recsize-1, f) == NULL) break; if(buf[0] == '%') continue; if(ispat) { if(sscanf(buf, "%d %d\n", &ival, &jval) == 0) continue; Aij[k] = 1.0; } else if(sscanf(buf, "%d %d %lg\n", &ival, &jval, &Aval) == 0) continue; /* Check if it is a nonzero and we are within column dimension */ if(Aval != 0 && jval <= maxN) { Aij[k] = Aval; if(iA != NULL) iA[k] = ival; if(jA != NULL) jA[k] = jval; k++; } } } *nz = k - 1; /* Handle case where only the lower triangular parts are given */ if(!mm_is_general(matcode)) { if((M != N) || (maxN != maxM) || (2*(*nz) > maxnz)) { printf("Market Market cannot fill in symmetry data\n"); goto x900; } ispat = mm_is_skew(matcode); for(i = 1; i <= *nz; i++) { iA[k] = jA[i]; jA[k] = iA[i]; if(ispat) Aij[k] = -Aij[i]; else Aij[k] = Aij[i]; k++; } *nz = k - 1; } status = TRUE; /* Finish up */ x900: fclose( f ); return( status ); } MYBOOL mmf_size_A(char *filename, int *M, int *N, int *nz) { int maxint = 200000000; return( mmf_read_A(filename, maxint, maxint, maxint, M, N, nz, NULL, NULL, NULL) ); } MYBOOL mmf_read_b(char *filename, int m, REAL *b) { int im, jn, nnzero; return( mmf_read_A(filename, m, 1, m, &im, &jn, &nnzero, NULL, NULL, b)); } /* Utility routines to read matrix files in Harwell-Boeing format*/ MYBOOL hbf_read_A(char *filename, int maxM, int maxN, int maxnz, int *M, int *N, int *nz, int *iA, int *jA, REAL *Aij) { MYBOOL success; success = hbf_size_A(filename, M, N, nz); if(!success) return( success ); Aij[1] = 0; success = (MYBOOL) readHB_mat_double(filename, jA, iA-1, Aij-1); /* Test if we have a pattern matrix and fill it with all zeros */ if(Aij[1] == 0) { int i; for(i = 1; i <= *nz; i++) Aij[i] = 1; } /* Expand the column nz counts to triplet format */ if(success) { int i, j, ii, k; k = *nz; for(j = *N; j > 0; j--) { ii = jA[j]; for(i = jA[j-1]; i < ii; i++, k--) jA[k] = j; } } return( success ); } MYBOOL hbf_size_A(char *filename, int *M, int *N, int *nz) { int Nrhs; char *Type; return( (MYBOOL) readHB_info(filename, M, N, nz, &Type, &Nrhs) ); } MYBOOL hbf_read_b(char *filename, int m, REAL *b) { return( (MYBOOL) readHB_aux_double(filename, 'F', b) ); /* Same format as matrix */ } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusolio.h100666 0 0 1766 11141443435 16602 0ustar usergroup#ifndef HEADER_lusolio #define HEADER_lusolio /* Include necessary libraries */ /* ------------------------------------------------------------------------- */ #include "lusol.h" MYBOOL ctf_read_A(char *filename, int maxm, int maxn, int maxnz, int *m, int *n, int *nnzero, int *iA, int *jA, REAL *Aij); MYBOOL ctf_size_A(char *filename, int *m, int *n, int *nnzero); MYBOOL ctf_read_b(char *filename, int m, REAL *b); MYBOOL mmf_read_A(char *filename, int maxM, int maxN, int maxnz, int *M, int *N, int *nz, int *iA, int *jA, REAL *Aij); MYBOOL mmf_size_A(char *filename, int *M, int *N, int *nz); MYBOOL mmf_read_b(char *filename, int m, REAL *b); MYBOOL hbf_read_A(char *filename, int maxM, int maxN, int maxnz, int *M, int *N, int *nz, int *iA, int *jA, REAL *Aij); MYBOOL hbf_size_A(char *filename, int *M, int *N, int *nz); MYBOOL hbf_read_b(char *filename, int m, REAL *b); #endif /* HEADER_lusolio */ lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusolmain.c100666 0 0 36467 11141443435 17140 0ustar usergroup /* This program solves a sparse linear system Ax = b using LUSOL. */ #include #include #include #include #include #include "commonlib.h" #include "myblas.h" #include "lusol.h" #include "lusolio.h" #include "lusolmain.h" #if (defined WIN32) || (defined WIN64) void _strupr_(char *s) { _strupr(s); } #else /* Yin Zhang noted that _strupr() is not available on many Unix platforms */ void _strupr_(char *s) { int i; char c; for (i = 0; i < strlen(s); i++) { c = s[i]; if (c <= 'z' && c >= 'a') { s[i] = c - 'a' + 'A'; } } } #endif MYBOOL getFileName(char *filename, char *test) { MYBOOL status; status = (MYBOOL) (('-' != test[0]) && (strlen(test) > 1)); if(status) strcpy(filename, test); return(status); } MYBOOL isNum(char val) { int ord; ord = (int) val - 48; return( (MYBOOL) ((ord >= 0) && (ord <= 9)) ); } void main( int argc, char *argv[], char *envp[] ) { /* Output device */ FILE *outunit = stdout; /* Overall dimensions allocated */ int maxm = MAXROWS, maxn = MAXCOLS, maxnz = MAXNZ, replace = 0, randcol = 0; MYBOOL ftran = TRUE; /* Storage for A, b */ REAL *Aij = NULL, *b = NULL, *xexact = NULL; int *iA = NULL, *jA = NULL; /* Storage for LUSOL */ LUSOLrec *LUSOL = NULL; /* Define local storage variables */ int i , inform, j , k , i1 , m , useropt, lenb, lenx, n , nelem , nnzero; REAL Amax , test , bnorm , rnorm , xnorm, *rhs = NULL, *r = NULL, *x = NULL; char fileext[50], filename[255], blasname[255]; MYBOOL printsolution = FALSE, success = FALSE; /* Check if we have input parameters */ useropt = argc; if(useropt < 2) { printf("LUSOL v%d.%d.%d.%d - Linear equation solver - Development edition.\n", LUSOL_VERMAJOR, LUSOL_VERMINOR, LUSOL_RELEASE, LUSOL_BUILD); printf("Usage: lusol [-p ] [-t ] [-m ]\n"); printf(" [-s] []\n"); printf("Options: -p <0..3> Selects pivot type.\n"); printf(" -t <1..100> Selects diagonal tolerance.\n"); printf(" -m <%d..100> Memory allocation scalar.\n", LUSOL_MULT_nz_a); printf(" -b Solves using btran (rather than ftran).\n"); printf(" -r Randomly replace a column and resolve.\n"); printf(" -s Show the computed solution.\n"); printf(" -blas Activates external optimized BLAS library.\n"); printf("Formats: Conventional RCV .TXT, MatrixMarket .MTX, or Harwell-Boeing .RUA\n"); printf("Author: Michael A. Saunders (original Fortran version)\n"); printf(" Kjell Eikland (modified C version)\n"); return; } /* Create the LUSOL object and set user options */ LUSOL = LUSOL_create(outunit, 0, LUSOL_PIVMOD_TPP, 0); #if 1 LUSOL->luparm[LUSOL_IP_ACCELERATION] = LUSOL_OTHERORDER | LUSOL_ACCELERATE_L0; #elif 0 LUSOL->luparm[LUSOL_IP_ACCELERATION] = LUSOL_AUTOORDER | LUSOL_ACCELERATE_L0; #endif LUSOL->luparm[LUSOL_IP_SCALAR_NZA] = 10; i = 1; n = 0; filename[0] = '\0'; blasname[0] = '\0'; while((n == 0) && (i < argc)) { if(strcmp("-p", argv[i]) == 0) { i1 = i+1; if((i1 < argc) && isNum(argv[i1][0])) { i = i1; m = atoi(argv[i]); if(m < 0 || m > LUSOL_PIVMOD_MAX) continue; LUSOL->luparm[LUSOL_IP_PIVOTTYPE] = m; } } else if(strcmp("-t", argv[i]) == 0) { i1 = i+1; if((i1 < argc) && isNum(argv[i1][0])) { i = i1; Amax = atof(argv[i]); if(Amax < 1 || Amax > 100) continue; LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij] = Amax; } } else if(strcmp("-m", argv[i]) == 0) { i1 = i+1; if((i1 < argc) && isNum(argv[i1][0])) { i = i1; m = atoi(argv[i]); if(m < LUSOL_MULT_nz_a || m > 100) continue; LUSOL->luparm[LUSOL_IP_SCALAR_NZA] = atoi(argv[i]); } } else if(strcmp("-s", argv[i]) == 0) printsolution = TRUE; else if(strcmp("-b", argv[i]) == 0) ftran = FALSE; else if(strcmp("-r", argv[i]) == 0) { i1 = i+1; if((i1 < argc) && isNum(argv[i1][0])) { i = i1; m = atoi(argv[i]); if(m < 0 || m > 10) continue; } else m = 1; srand((unsigned) time( NULL )); replace = 2*m; } else if(strcmp("-blas", argv[i]) == 0) { i1 = i+1; if((i1 < argc) && getFileName(blasname, argv[i1])) { if(!load_BLAS(blasname)) fprintf(outunit, "Could not load external BLAS library '%s'\n", blasname); i = i1; } else fprintf(outunit, "Ignoring incomplete parameter %d '%s'\n", i, argv[i]); } else { if(getFileName(filename, argv[i])) { useropt = i; break; } else fprintf(outunit, "Ignoring unknown parameter %d '%s'\n", i, argv[i]); } i++; } /* Obtain file extension and see if we must estimate matrix data size */ strcpy(fileext, strchr(argv[useropt], '.')); /* Yin Zhang noted that _strupr() is not available on many Unix platforms. */ _strupr_(fileext); /* _strupr(fileext);*/ /* Read conventional text file format */ if(strcmp(fileext, ".TXT") == 0) { if(!ctf_size_A(filename, &maxm, &maxn, &maxnz)) goto x900; } /* Read MatrixMarket file format */ else if(strcmp(fileext, ".MTX") == 0) { if(!mmf_size_A(filename, &maxm, &maxn, &maxnz)) goto x900; } /* Read Harwell-Boeing file format */ else if(strcmp(fileext, ".RUA") == 0) { if(!hbf_size_A(filename, &maxm, &maxn, &maxnz)) goto x900; } else { fprintf(outunit, "Unrecognized matrix file extension %s\n", fileext); goto x900; } /* Create the arrays */ Aij = (REAL *) LUSOL_CALLOC(maxnz + BLAS_BASE, sizeof(REAL)); iA = (int *) LUSOL_CALLOC(maxnz + BLAS_BASE, sizeof(int)); jA = (int *) LUSOL_CALLOC(maxnz + BLAS_BASE, sizeof(int)); if(ftran) lenb = maxm; else lenb = maxn; b = (REAL *) LUSOL_CALLOC(lenb+BLAS_BASE, sizeof(REAL)); rhs = (REAL *) LUSOL_CALLOC(lenb+BLAS_BASE, sizeof(REAL)); if(ftran) lenx = maxn; else lenx = maxm; xexact = (REAL *) LUSOL_CALLOC(lenx+BLAS_BASE, sizeof(REAL)); r = (REAL *) LUSOL_CALLOC(lenx+BLAS_BASE, sizeof(REAL)); x = (REAL *) LUSOL_CALLOC(lenx+BLAS_BASE, sizeof(REAL)); /* ----------------------------------------------------------------- Read data files. ----------------------------------------------------------------- */ fprintf(stdout, "\n========================================\n"); fprintf(stdout, "LUSOL v%d.%d.%d.%d - Linear equation solver", LUSOL_VERMAJOR, LUSOL_VERMINOR, LUSOL_RELEASE, LUSOL_BUILD); fprintf(stdout, "\n========================================\n"); /* ----------------------------------------------------------------- Read data for A ----------------------------------------------------------------- */ /* Read conventional text file format */ if(strcmp(fileext, ".TXT") == 0) { if(!ctf_read_A(argv[useropt], maxm, maxn, maxnz, &m, &n, &nnzero, iA, jA, Aij)) goto x900; } /* Read MatrixMarket file format */ else if(strcmp(fileext, ".MTX") == 0) { if(!mmf_read_A(argv[useropt], maxm, maxn, maxnz, &m, &n, &nnzero, iA, jA, Aij)) goto x900; } /* Read Harwell-Boeing file format */ else if(strcmp(fileext, ".RUA") == 0) { if(!hbf_read_A(argv[useropt], maxm, maxn, maxnz, &m, &n, &nnzero, iA, jA, Aij)) goto x900; } else { fprintf(outunit, "Error: Unrecognized matrix file extension %s\n", fileext); goto x900; } /* ----------------------------------------------------------------- Read data for b ----------------------------------------------------------------- */ /* Handle Harwell-Boeing case where the file contains a RHS */ i = strcmp(fileext, ".RUA"); if((useropt == argc-1) && (i != 0)) { srand(timeNow()); i1 = m; while(i1 > 0) { test = rand(); i = RAND_MAX; i = (int) ((test/i)*(m-1)); /* b[i+1] = 1.0; */ b[i+1] = i - 5; i1--; } if(printsolution) blockWriteREAL(outunit, "\nGenerated RHS vector", b, 1, lenb); } else { if(i != 0) useropt++; strcpy(fileext, strchr(argv[useropt], '.')); _strupr_(fileext); /* Read conventional text file format */ if(strcmp(fileext, ".TXT") == 0) { if(!ctf_read_b(argv[useropt], lenb, b)) goto x900; } /* Read MatrixMarket file format */ else if(strcmp(fileext, ".MTX") == 0) { if(!mmf_read_b(argv[useropt], lenb, b)) goto x900; } /* Read Harwell-Boeing file format */ else if(strcmp(fileext, ".RUA") == 0) { if(!hbf_read_b(argv[useropt], lenb, b)) goto x900; } else { fprintf(outunit, "Error: Unrecognized vector file extension %s\n", fileext); goto x900; } } success = TRUE; /* ----------------------------------------------------------------- Show data on input ----------------------------------------------------------------- */ fprintf(outunit, "\nData read from:\n%s\n", filename); test = (double) nnzero / ((double) m * (double) n); test *= 100.0; fprintf(outunit, "Rows = %d Columns = %d Non-zeros = %d Density =%8.4f%%\n", m, n, nnzero, test); /* ----------------------------------------------------------------- Load A into (a, indc, indr). ----------------------------------------------------------------- */ #if 0 /* BUG !!! */ if(n != m) LUSOL->luparm[LUSOL_IP_KEEPLU] = FALSE; #endif #ifdef LegacyTesting LUSOL->luparm[LUSOL_IP_SCALAR_NZA] = LUSOL_MULT_nz_a; LUSOL_sizeto(LUSOL, MAXROWS, MAXCOLS, MAXNZ*LUSOL_MULT_nz_a); #endif if(!LUSOL_assign(LUSOL, iA, jA, Aij, nnzero, TRUE)) { fprintf(outunit, "Error: LUSOL failed due to insufficient memory.\n"); goto x900; } /* ------------------------------------------------------------------ Factor A = L U. ------------------------------------------------------------------ */ nelem = nnzero; inform = LUSOL_factorize( LUSOL); if(inform > LUSOL_INFORM_SERIOUS) { fprintf(outunit, "Error:\n%s\n", LUSOL_informstr(LUSOL, inform)); goto x900; } if(n != m) goto x800; /* Get the largest element in A; we use it below as an estimate of ||A||_inf, even though it isn't a proper norm. */ Amax = LUSOL->parmlu[LUSOL_RP_MAXELEM_A]; /* ------------------------------------------------------------------ SOLVE A x = b or x'A = b'. Save b first because lu6sol() overwrites the rhs. ------------------------------------------------------------------ */ MEMCOPY(x, b, lenb+BLAS_BASE); Resolve: if(ftran) inform = LUSOL_ftran(LUSOL, x, NULL, FALSE); else inform = LUSOL_btran(LUSOL, x, NULL); if(inform > LUSOL_INFORM_SERIOUS) { fprintf(outunit, "Error:\n%s\n", LUSOL_informstr(LUSOL, inform)); goto x900; } if(printsolution) blockWriteREAL(outunit, "\nSolution vector", x, 1, lenb); /* ------------------------------------------------------------------ Set r = b - Ax. Find norm of r and x. ------------------------------------------------------------------ */ MEMCOPY(r, b, lenb+BLAS_BASE); for(k = 1; k <= nnzero; k++) { i = iA[k]; /* Row number */ j = jA[k]; /* Column number */ if(ftran) r[i] -= Aij[k]*x[j]; else r[j] -= Aij[k]*x[i]; } /* blockWriteREAL(outunit, "\nResidual vector", r, 1, lenb);*/ bnorm = dnormi( lenb, b ); rnorm = dnormi( lenb, r ); xnorm = dnormi( lenx, x ); /* ------------------------------------------------------------------ Report the findings. ------------------------------------------------------------------ */ if(randcol > 0) fprintf(outunit, "\n\nColumn %d was %s\n", randcol, (mod(replace,2) == 1 ? "replaced with random data" : "restored")); x800: fprintf(outunit, "\nLU size statistics (%d reallocations):\n", LUSOL->expanded_a); test = LUSOL->luparm[LUSOL_IP_NONZEROS_U0]+LUSOL->luparm[LUSOL_IP_NONZEROS_L0]; fprintf(outunit, "L0-size = %d U0-size = %d LU-nonzeros = %d Fill-in = %.1fx\n", LUSOL->luparm[LUSOL_IP_NONZEROS_L0], LUSOL->luparm[LUSOL_IP_NONZEROS_U0], (int) test, test/nnzero); if(n != m) { fprintf(outunit, "%s with a factor tol. of %g identified %d singularities.\n", LUSOL_pivotLabel(LUSOL), LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij], LUSOL->luparm[LUSOL_IP_SINGULARITIES]); goto x900; } test = rnorm / (Amax*xnorm); fprintf(outunit, "\nAccuracy statistics:\n"); fprintf(outunit, "%s with a factor tol. of %g gave a rel.error of %g and %d singularities.\n", LUSOL_pivotLabel(LUSOL), LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij], test, LUSOL->luparm[LUSOL_IP_SINGULARITIES]); fprintf(outunit, "Amax = %g bnorm = %g rnorm = %g xnorm = %g\n", Amax, bnorm, rnorm, xnorm); fprintf(outunit, "\n"); if (test <= 1.0e-8) fprintf(outunit, "The equations were solved with very high accuracy.\n"); else if (test <= 1.0e-6) fprintf(outunit, "The equations were solved with reasonably good accuracy.\n"); else { if (test <= 1.0e-4) fprintf(outunit, "Questionable accuracy; the LU factors may not be good enough.\n"); else fprintf(outunit, "Poor accuracy; the LU factorization probably failed.\n"); if(LUSOL->luparm[LUSOL_IP_PIVOTTYPE] == LUSOL_PIVMOD_TRP) fprintf(outunit, "Try a smaller factor tolerance (current is %g).\n", LUSOL->parmlu[LUSOL_RP_FACTORMAX_Lij]); else fprintf(outunit, "Try a smaller factor tolerance and/or TRP pivoting.\n"); } /* Check if we should replace a column and resolve */ if(replace > 0) { replace--; MEMCLEAR(x, lenb+BLAS_BASE); if(mod(replace, 2) == 1) { /* Randomly find a column and replace the column values with random data */ rnorm = rand(); randcol = (int) (n * rnorm / (RAND_MAX+1.0)) + 1; for(i = 1; i < m; i++) x[i] = Amax * rand() / RAND_MAX; } else { /* Put the previously replaced column back and resolve */ for (k = 1; k <= nnzero; k++) { i = iA[k]; j = jA[k]; if(j == randcol) x[i] = Aij[k]; } } inform = LUSOL_replaceColumn(LUSOL, randcol, x); MEMCOPY(b, x, lenb+BLAS_BASE); if(inform != LUSOL_INFORM_LUSUCCESS) fprintf(outunit, "Error:\n%s\n", LUSOL_informstr(LUSOL, inform)); else goto Resolve; } /* Free memory */ x900: if(!success) fprintf(outunit, "Insufficient memory or data file not found.\n"); LUSOL_FREE(Aij); LUSOL_FREE(b); LUSOL_FREE(xexact); LUSOL_FREE(iA); LUSOL_FREE(jA); LUSOL_FREE(rhs); LUSOL_FREE(r); LUSOL_FREE(x); #if 0 LUSOL_dump(NULL, LUSOL); -blas "atlas_AXP_512_360.dll" -b -p 1 "STP3D_A.MTX" "C:\Shared Files\Visual Studio Projects\LU\MatrixMarket\sherman5.mtx" "C:\Shared Files\Visual Studio Projects\LU\MatrixMarket\sherman5_rhs1.mtx" A6805.txt b6805.txt A10009.txt b10009.txt fidap005.mtx fidap005_rhs1.mtx fidapm05.mtx fidapm05_rhs1.mtx -b -p 1 "basis.mtx" -b -p 1 "LU-test3.mtx" #endif LUSOL_free(LUSOL); /* End of main program for Test of LUSOL */ } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/lusolmain.h100666 0 0 677 11141443435 17077 0ustar usergroup #ifdef StaticMemAlloc #if 0 #define MAXNZ 300000 #define MAXROWS 15000 #elif 0 #define MAXNZ 60000 #define MAXROWS 12500 #elif 1 #define MAXNZ 40000 #define MAXROWS 3500 #else #define MAXNZ 1000 #define MAXROWS 50 #endif #else #define MAXNZ 1000 #define MAXROWS 50 #endif #define MAXCOLS MAXROWS #define MAXLU (LUSOL_MULT_nz_a*MAXNZ) lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/LUSOL_LGPL.txt100666 0 0 63474 11141374613 17245 0ustar usergroup GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/LUSOL_Overview.txt100666 0 0 12623 11141374614 20304 0ustar usergroup Notes for Contribution of LUSOL to COIN-OR May 2004 Introduction ============ LUSOL maintains sparse LU factors of a square or rectangular sparse matrix. It includes a Basis Factorization Package (BFP) suitable for implementing simplex and reduced-gradient methods for optimization. It is a set of routines written in ANSI C (adapted from the original Fortran 77 version). LUSOL includes the following features: - A Markowitz-based sparse LU factorization for square, rectangular and possibly singular matrices. - Three options for balancing sparsity and stability: Threshold Partial/Rook/Complete Pivoting (TPP, TRP, TCP). - Rank-revealing properties. TRP and TCP are intended for detecting singularities. - Dynamic storage allocation (C version only). - Stable column replacement as in the method of Bartels and Golub. - Other stable updates: add, replace, or delete row or column (currently F77 version only). - Implementation into an easy-to-use BFP API (C version only). Implementation ============== The Factor routine is similar to the classical Markowitz routines MA28 and LA05 in the Harwell Subroutine Library. The source matrix nonzeros are stored column-wise with the largest entry at the top of each column. Internally, the structure is also accessible row-wise. All entries in a particular column or row are held in contiguous storage. Fill is accommodated by moving a column or row to the beginning of free storage. Occasional compressions recover storage. This scheme is effective for column-oriented TPP. When the remaining matrix reaches a specified density, the factors are completed using dense processing. TRP uses an additional vector of storage to maintain the largest element in each remaining row. TCP uses a heap structure to hold the largest element in each column. The largest element in the remaining matrix is then available at the top of the heap. The final L is stored column-wise (and never changed). The final U is stored row-wise as a triangular or trapezoidal sparse matrix. Column replacements are implemented using a forward sweep of 2-by-2 stabilized elimination matrices. L is updated in product form. U is updated explicitly. The other updates use either forward or backward sweeps. They tend to generate more nonzeros than column replacement. Both the F77 and C versions contain extensive comments, method and implementational information as part of the code. The C version contains a record-based wrapper for the data. Function calls have been simplified by including references to this structure. New maintenance routines enable dynamic instance creation and destruction, and simplifies access to the most frequently used functions. The LUSOL C library is multi-instance and fully re-entrant. All control and output parameters have been given long descriptive names for usability. Benefits ======== Rank-revealing properties and rectangular factors (and updates) have not previously been available in sparse LU software. With sensible parameter settings and reasonably scaled data, all routines are numerically stable. The updates may be called hundreds of times, and the decision to refactorize can be based on sparsity considerations alone. In the Factor routine, rook pivoting (TRP) gives reliable rank determination without catastrophic degradation in sparsity or speed. Complete pivoting (TCP) is included for moderate-sized matrices and for checking pathological cases (but the factors tend to be substantially more dense). To conserve storage, one may request only the row and column pivot orders. The factors are discarded as they are computed. This is useful for basis repair, or for selecting a basis from a rectangular matrix. Known Inefficiencies ==================== LUSOL is usually efficient on sparse matrices with dimensions up to about 100,000 (but not millions). In the Factor routine, row and column lists must be updated each time a row and column is eliminated. Deleting the pivot row and column is inefficient if the original matrix contains unusually dense rows or columns. For TPP, dense columns could be kept aside and incorporated at the end via updates (but dense rows remain a difficulty). For TRP and TCP, all rows and columns must be present to achieve the required numerical properties. For TRP, the current bottleneck is updating the vector containing the largest element in each row. One solution would be to include the matrix nonzeros in the row structure (but this carries its own cost). For TCP, the heap structure is already efficient, but the dense factors (and the extended searching for acceptable pivots) are unavoidable expenses. The triangular Solve routines do not take full of advantage of sparse right-hand sides. Gilbert and Peierls have shown how to solve Lx = (sparse b) efficiently if L is stored column-wise. Their approach could therefore be implemented in LUSOL for solves with L and U(transpose). Solves with L(transpose) and U would need a second copy of L and U. Original Reference ================== P. E. Gill, W. Murray, M. A. Saunders and M. H. Wright, Maintaining LU factors of a general sparse matrix, Linear Algebra and its Applications 88/89, 239-270 (1987). Maintainers =========== F77 version: Michael Saunders (saunders@stanford.edu). C version: Kjell Eikland (kjell.eikland@broadpark.no). Contributors ============ Philip Gill, Walter Murray, Margaret Wright, Michael O'Sullivan. lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/LUSOL_README.txt100666 0 0 4146 11141374614 17414 0ustar usergroupREADME.TXT for LUSOL - Advanced LU solver with enhanced numerical stability options ----------------------------------------------------------------------------------- LUSOL - pronounced "L-U-SOL" - was developed by Prof. Michael Saunders at the Stanford (University) Optimization Laboratory over a period of 2 decades of progressive improvements. It is a particularly capable matrix factorization system and includes sparsity-preserving column updates and equation solving. It is therefore particularly well suited to be part of a system to solve tough mathematical programming problems. Further details can be found in the file "LUSOL-overview.txt." A big step has been made in converting the original Fortran code into a much more easily accessible and modularized system based on ANSI C as part of the release of lp_solve v5. LUSOL is fully implemented as a "Basis Factorization Package", BFP in lp_solve and is the BFP of choice for large and complex models, if not all. As part of the conversion to C, processor optimized BLAS functionality has been enabled, and future enhancements to LUSOL may make increasing use of this, ensuring top performance. For the lp_solve release of LUSOL, a stand-alone equation solving system has also been developed. A pre-compiled Windows command-line executable version is included in the standard distribution of LUSOL. In addition, the program options illustrate several advanced uses of LUSOL. The equation solving utility features reading of standard matrix files in the Harwell-Boeing, MatrixMarket and text formats. Sample matrix models are provided for Harwell-Boeing (.RUA) and MatrixMarket (.mtx). The LUSOL code is released under the GNU Lesser General Public Licence. Confer the file "Licence_LGPL.txt" for the full terms of this licence. These terms make lp_solve and LUSOL available and distributable on equal licencing terms. It is expected that LUSOL will have an official repository in the near future, but the LUSOL archive at the Yahoo lp_solve group will be an official copy and the formal repository until further notice. Kjell Eikland 14 July 2004 Oslo, Norway lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/mmio.c100666 0 0 30552 11141443436 16064 0ustar usergroup/* * Matrix Market I/O library for ANSI C * * See http://math.nist.gov/MatrixMarket for details. * * (Version 1.01, 5/2003) */ #include #include #include #include #include "mmio.h" int mm_read_unsymmetric_sparse(const char *fname, int *M_, int *N_, int *nz_, double **val_, int **I_, int **J_) { FILE *f; MM_typecode matcode; int M, N, nz; int i; double *val; int *I, *J; if ((f = fopen(fname, "r")) == NULL) return -1; if (mm_read_banner(f, &matcode) != 0) { printf("mm_read_unsymetric: Could not process Matrix Market banner "); printf(" in file [%s]\n", fname); return -1; } if ( !(mm_is_real(matcode) && mm_is_matrix(matcode) && mm_is_sparse(matcode))) { fprintf(stderr, "Sorry, this application does not support "); fprintf(stderr, "Market Market type: [%s]\n", mm_typecode_to_str(matcode)); return -1; } /* find out size of sparse matrix: M, N, nz .... */ if (mm_read_mtx_crd_size(f, &M, &N, &nz) !=0) { fprintf(stderr, "read_unsymmetric_sparse(): could not parse matrix size.\n"); return -1; } *M_ = M; *N_ = N; *nz_ = nz; /* reseve memory for matrices */ I = (int *) malloc(nz * sizeof(int)); J = (int *) malloc(nz * sizeof(int)); val = (double *) malloc(nz * sizeof(double)); *val_ = val; *I_ = I; *J_ = J; /* NOTE: when reading in doubles, ANSI C requires the use of the "l" */ /* specifier as in "%lg", "%lf", "%le", otherwise errors will occur */ /* (ANSI C X3.159-1989, Sec. 4.9.6.2, p. 136 lines 13-15) */ for (i=0; i= 2) return 0; else do { num_items_read = fscanf(f, "%d %d %d", M, N, nz); if (num_items_read == EOF) return MM_PREMATURE_EOF; } while (num_items_read < 2); return 0; } int mm_read_mtx_array_size(FILE *f, int *M, int *N) { char line[MM_MAX_LINE_LENGTH]; int num_items_read; /* set return null parameter values, in case we exit with errors */ *M = *N = 0; /* now continue scanning until you reach the end-of-comments */ do { if (fgets(line,MM_MAX_LINE_LENGTH,f) == NULL) return MM_PREMATURE_EOF; }while (line[0] == '%'); /* line[] is either blank or has M,N, nz */ if (sscanf(line, "%d %d", M, N) == 2) return 0; else /* we have a blank line */ do { num_items_read = fscanf(f, "%d %d", M, N); if (num_items_read == EOF) return MM_PREMATURE_EOF; } while (num_items_read != 2); return 0; } int mm_write_mtx_array_size(FILE *f, int M, int N) { if (fprintf(f, "%d %d\n", M, N) < 0) return MM_COULD_NOT_WRITE_FILE; else return 0; } /*-------------------------------------------------------------------------*/ /******************************************************************/ /* use when I[], J[], and val[]J, and val[] are already allocated */ /******************************************************************/ int mm_read_mtx_crd_data(FILE *f, int M, int N, int nz, int I[], int J[], double val[], MM_typecode matcode) { int i; if (mm_is_complex(matcode)) { for (i=0; i #include /*#include */ #include #include #include "myblas.h" #ifdef FORTIFY # include "lp_fortify.h" #endif /* ************************************************************************ */ /* Initialize BLAS interfacing routines */ /* ************************************************************************ */ MYBOOL mustinitBLAS = TRUE; #if (defined WIN32) || (defined WIN64) HINSTANCE hBLAS = NULL; #else void *hBLAS = NULL; #endif /* ************************************************************************ */ /* Function pointers for external BLAS library (C base 0) */ /* ************************************************************************ */ BLAS_dscal_func *BLAS_dscal; BLAS_dcopy_func *BLAS_dcopy; BLAS_daxpy_func *BLAS_daxpy; BLAS_dswap_func *BLAS_dswap; BLAS_ddot_func *BLAS_ddot; BLAS_idamax_func *BLAS_idamax; BLAS_idamin_func *BLAS_idamin; BLAS_dload_func *BLAS_dload; BLAS_dnormi_func *BLAS_dnormi; /* ************************************************************************ */ /* Define the BLAS interfacing routines */ /* ************************************************************************ */ void init_BLAS(void) { if(mustinitBLAS) { load_BLAS(NULL); mustinitBLAS = FALSE; } } MYBOOL is_nativeBLAS(void) { #ifdef LoadableBlasLib return( (MYBOOL) (hBLAS == NULL) ); #else return( TRUE ); #endif } MYBOOL load_BLAS(char *libname) { MYBOOL result = TRUE; #ifdef LoadableBlasLib if(hBLAS != NULL) { my_FreeLibrary(hBLAS); } #endif if(libname == NULL) { if(!mustinitBLAS && is_nativeBLAS()) return( FALSE ); BLAS_dscal = my_dscal; BLAS_dcopy = my_dcopy; BLAS_daxpy = my_daxpy; BLAS_dswap = my_dswap; BLAS_ddot = my_ddot; BLAS_idamax = my_idamax; BLAS_idamin = my_idamin; BLAS_dload = my_dload; BLAS_dnormi = my_dnormi; if(mustinitBLAS) mustinitBLAS = FALSE; } else { #ifdef LoadableBlasLib #if (defined WIN32) || (defined WIN64) char *blasname = libname; #else /* First standardize UNIX .SO library name format. */ char blasname[260]; if(!so_stdname(blasname, libname, 260)) return( FALSE ); #endif /* Get a handle to the Windows DLL module. */ hBLAS = my_LoadLibrary(blasname); /* If the handle is valid, try to get the function addresses. */ result = (MYBOOL) (hBLAS != NULL); if(result) { BLAS_dscal = (BLAS_dscal_func *) my_GetProcAddress(hBLAS, BLAS_prec "scal"); BLAS_dcopy = (BLAS_dcopy_func *) my_GetProcAddress(hBLAS, BLAS_prec "copy"); BLAS_daxpy = (BLAS_daxpy_func *) my_GetProcAddress(hBLAS, BLAS_prec "axpy"); BLAS_dswap = (BLAS_dswap_func *) my_GetProcAddress(hBLAS, BLAS_prec "swap"); BLAS_ddot = (BLAS_ddot_func *) my_GetProcAddress(hBLAS, BLAS_prec "dot"); BLAS_idamax = (BLAS_idamax_func *) my_GetProcAddress(hBLAS, "i" BLAS_prec "amax"); BLAS_idamin = (BLAS_idamin_func *) my_GetProcAddress(hBLAS, "i" BLAS_prec "amin"); #if 0 BLAS_dload = (BLAS_dload_func *) my_GetProcAddress(hBLAS, BLAS_prec "load"); BLAS_dnormi = (BLAS_dnormi_func *) my_GetProcAddress(hBLAS, BLAS_prec "normi"); #endif } #endif /* Do validation */ if(!result || ((BLAS_dscal == NULL) || (BLAS_dcopy == NULL) || (BLAS_daxpy == NULL) || (BLAS_dswap == NULL) || (BLAS_ddot == NULL) || (BLAS_idamax == NULL) || (BLAS_idamin == NULL) || (BLAS_dload == NULL) || (BLAS_dnormi == NULL)) ) { load_BLAS(NULL); result = FALSE; } } return( result ); } MYBOOL unload_BLAS(void) { return( load_BLAS(NULL) ); } /* ************************************************************************ */ /* Now define the unoptimized local BLAS functions */ /* ************************************************************************ */ void daxpy( int n, REAL da, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; BLAS_daxpy( &n, &da, dx, &incx, dy, &incy); } void BLAS_CALLMODEL my_daxpy( int *_n, REAL *_da, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* constant times a vector plus a vector. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ int i, ix, iy; #ifndef DOFASTMATH int m, mp1; #endif register REAL rda; REAL da = *_da; int n = *_n, incx = *_incx, incy = *_incy; if (n <= 0) return; if (da == 0.0) return; dx--; dy--; ix = 1; iy = 1; if (incx < 0) ix = (-n+1)*incx + 1; if (incy < 0) iy = (-n+1)*incy + 1; rda = da; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) (*yptr) += rda*(*xptr); } #else if (incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for (i = 1; i<=n; i++) { dy[iy]+= rda*dx[ix]; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1 */ /* clean-up loop */ x20: m = n % 4; if (m == 0) goto x40; for (i = 1; i<=m; i++) dy[i]+= rda*dx[i]; if(n < 4) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+4) { dy[i]+= rda*dx[i]; dy[i + 1]+= rda*dx[i + 1]; dy[i + 2]+= rda*dx[i + 2]; dy[i + 3]+= rda*dx[i + 3]; } #endif } /* ************************************************************************ */ void dcopy( int n, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; BLAS_dcopy( &n, dx, &incx, dy, &incy); } void BLAS_CALLMODEL my_dcopy (int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* copies a vector, x, to a vector, y. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ int i, ix, iy; #ifndef DOFASTMATH int m, mp1; #endif int n = *_n, incx = *_incx, incy = *_incy; if(n<=0) return; dx--; dy--; ix = 1; iy = 1; if(incx<0) ix = (-n+1)*incx + 1; if(incy<0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) (*yptr) = (*xptr); } #else if(incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for(i = 1; i<=n; i++) { dy[iy] = dx[ix]; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1 */ /* version with fast machine copy logic (requires memory.h or string.h) */ x20: m = n % 7; if (m == 0) goto x40; for (i = 1; i<=m; i++) dy[i] = dx[i]; if (n < 7) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+7) { dy[i] = dx[i]; dy[i + 1] = dx[i + 1]; dy[i + 2] = dx[i + 2]; dy[i + 3] = dx[i + 3]; dy[i + 4] = dx[i + 4]; dy[i + 5] = dx[i + 5]; dy[i + 6] = dx[i + 6]; } #endif } /* ************************************************************************ */ void dscal (int n, REAL da, REAL *dx, int incx) { dx++; BLAS_dscal (&n, &da, dx, &incx); } void BLAS_CALLMODEL my_dscal (int *_n, REAL *_da, REAL *dx, int *_incx) { /* Multiply a vector by a constant. --Input-- N number of elements in input vector(s) DA double precision scale factor DX double precision vector with N elements INCX storage spacing between elements of DX --Output-- DX double precision result (unchanged if N.LE.0) Replace double precision DX by double precision DA*DX. For I = 0 to N-1, replace DX(IX+I*INCX) with DA * DX(IX+I*INCX), where IX = 1 if INCX .GE. 0, else IX = 1+(1-N)*INCX. */ int i; #ifndef DOFASTMATH int m, mp1, ix; #endif register REAL rda; REAL da = *_da; int n = *_n, incx = *_incx; if (n <= 0) return; rda = da; dx--; /* Optionally do fast pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr; for (i = 1, xptr = dx + 1; i <= n; i++, xptr += incx) (*xptr) *= rda; } #else if (incx == 1) goto x20; /* Code for increment not equal to 1 */ ix = 1; if (incx < 0) ix = (-n+1)*incx + 1; for(i = 1; i <= n; i++, ix += incx) dx[ix] *= rda; return; /* Code for increment equal to 1. */ /* Clean-up loop so remaining vector length is a multiple of 5. */ x20: m = n % 5; if (m == 0) goto x40; for( i = 1; i <= m; i++) dx[i] *= rda; if (n < 5) return; x40: mp1 = m + 1; for(i = mp1; i <= n; i += 5) { dx[i] *= rda; dx[i+1] *= rda; dx[i+2] *= rda; dx[i+3] *= rda; dx[i+4] *= rda; } #endif } /* ************************************************************************ */ REAL ddot(int n, REAL *dx, int incx, REAL *dy, int incy) { dx++; dy++; return( BLAS_ddot (&n, dx, &incx, dy, &incy) ); } REAL BLAS_CALLMODEL my_ddot(int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy) { /* forms the dot product of two vectors. uses unrolled loops for increments equal to one. jack dongarra, linpack, 3/11/78. modified 12/3/93, array[1] declarations changed to array[*] */ register REAL dtemp; int i, ix, iy; #ifndef DOFASTMATH int m, mp1; #endif int n = *_n, incx = *_incx, incy = *_incy; dtemp = 0.0; if (n<=0) return( (REAL) dtemp); dx--; dy--; ix = 1; iy = 1; if (incx<0) ix = (-n+1)*incx + 1; if (incy<0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) dtemp+= (*yptr)*(*xptr); } #else if (incx==1 && incy==1) goto x20; /* code for unequal increments or equal increments not equal to 1 */ for (i = 1; i<=n; i++) { dtemp+= dx[ix]*dy[iy]; ix+= incx; iy+= incy; } return(dtemp); /* code for both increments equal to 1 */ /* clean-up loop */ x20: m = n % 5; if (m == 0) goto x40; for (i = 1; i<=m; i++) dtemp+= dx[i]*dy[i]; if (n < 5) goto x60; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+5) dtemp+= dx[i]*dy[i] + dx[i + 1]*dy[i + 1] + dx[i + 2]*dy[i + 2] + dx[i + 3]*dy[i + 3] + dx[i + 4]*dy[i + 4]; x60: #endif return(dtemp); } /* ************************************************************************ */ void dswap( int n, REAL *dx, int incx, REAL *dy, int incy ) { dx++; dy++; BLAS_dswap( &n, dx, &incx, dy, &incy ); } void BLAS_CALLMODEL my_dswap( int *_n, REAL *dx, int *_incx, REAL *dy, int *_incy ) { int i, ix, iy; #ifndef DOFASTMATH int m, mp1, ns; REAL dtemp2, dtemp3; #endif register REAL dtemp1; int n = *_n, incx = *_incx, incy = *_incy; if (n <= 0) return; dx--; dy--; ix = 1; iy = 1; if (incx < 0) ix = (-n+1)*incx + 1; if (incy < 0) iy = (-n+1)*incy + 1; /* CPU intensive loop; option to do pointer arithmetic */ #if defined DOFASTMATH { REAL *xptr, *yptr; for (i = 1, xptr = dx + ix, yptr = dy + iy; i <= n; i++, xptr += incx, yptr += incy) { dtemp1 = (*xptr); (*xptr) = (*yptr); (*yptr) = dtemp1; } } #else if (incx == incy) { if (incx <= 0) goto x5; if (incx == 1) goto x20; goto x60; } /* code for unequal or nonpositive increments. */ x5: for (i = 1; i<=n; i++) { dtemp1 = dx[ix]; dx[ix] = dy[iy]; dy[iy] = dtemp1; ix+= incx; iy+= incy; } return; /* code for both increments equal to 1. clean-up loop so remaining vector length is a multiple of 3. */ x20: m = n % 3; if (m == 0) goto x40; for (i = 1; i<=m; i++) { dtemp1 = dx[i]; dx[i] = dy[i]; dy[i] = dtemp1; } if (n < 3) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+3) { dtemp1 = dx[i]; dtemp2 = dx[i+1]; dtemp3 = dx[i+2]; dx[i] = dy[i]; dx[i+1] = dy[i+1]; dx[i+2] = dy[i+2]; dy[i] = dtemp1; dy[i+1] = dtemp2; dy[i+2] = dtemp3; } return; /* code for equal, positive, non-unit increments. */ x60: ns = n*incx; for (i = 1; i<=ns; i=i+incx) { dtemp1 = dx[i]; dx[i] = dy[i]; dy[i] = dtemp1; } #endif } /* ************************************************************************ */ void dload(int n, REAL da, REAL *dx, int incx) { dx++; BLAS_dload (&n, &da, dx, &incx); } void BLAS_CALLMODEL my_dload (int *_n, REAL *_da, REAL *dx, int *_incx) { /* copies a scalar, a, to a vector, x. uses unrolled loops when incx equals one. To change the precision of this program, run the change program on dload.f Alternatively, to make a single precision version append a comment character to the start of all lines between sequential precision > double and end precision > double comments and delete the comment character at the start of all lines between sequential precision > single and end precision > single comments. To make a double precision version interchange the append and delete operations in these instructions. */ int i, ix, m, mp1; REAL da = *_da; int n = *_n, incx = *_incx; if (n<=0) return; dx--; if (incx==1) goto x20; /* code for incx not equal to 1 */ ix = 1; if (incx<0) ix = (-n+1)*incx + 1; for (i = 1; i<=n; i++) { dx[ix] = da; ix+= incx; } return; /* code for incx equal to 1 and clean-up loop */ x20: m = n % 7; if (m == 0) goto x40; for (i = 1; i<=m; i++) dx[i] = da; if (n < 7) return; x40: mp1 = m + 1; for (i = mp1; i<=n; i=i+7) { dx[i] = da; dx[i + 1] = da; dx[i + 2] = da; dx[i + 3] = da; dx[i + 4] = da; dx[i + 5] = da; dx[i + 6] = da; } } /* ************************************************************************ */ int idamax( int n, REAL *x, int is ) { x++; return ( BLAS_idamax( &n, x, &is ) ); } int idamin( int n, REAL *x, int is ) { x++; return ( BLAS_idamin( &n, x, &is ) ); } int BLAS_CALLMODEL my_idamax( int *_n, REAL *x, int *_is ) { register REAL xmax, xtest; int i, imax = 0; #if !defined DOFASTMATH int ii; #endif int n = *_n, is = *_is; if((n < 1) || (is <= 0)) return(imax); imax = 1; if(n == 1) return(imax); #if defined DOFASTMATH xmax = fabs(*x); for (i = 2, x += is; i <= n; i++, x += is) { xtest = fabs(*x); if(xtest > xmax) { xmax = xtest; imax = i; } } #else x--; ii = 1; xmax = fabs(x[ii]); for(i = 2, ii+ = is; i <= n; i++, ii+ = is) { xtest = fabs(x[ii]); if(xtest > xmax) { xmax = xtest; imax = i; } } #endif return(imax); } int BLAS_CALLMODEL my_idamin( int *_n, REAL *x, int *_is ) { register REAL xmin, xtest; int i, imin = 0; #if !defined DOFASTMATH int ii; #endif int n = *_n, is = *_is; if((n < 1) || (is <= 0)) return(imin); imin = 1; if(n == 1) return(imin); #if defined DOFASTMATH xmin = fabs(*x); for (i = 2, x += is; i <= n; i++, x += is) { xtest = fabs(*x); if(xtest < xmin) { xmin = xtest; imin = i; } } #else x--; ii = 1; xmin = fabs(x[ii]); for(i = 2, ii+ = is; i <= n; i++, ii+ = is) { xtest = fabs(x[ii]); if(xtest < xmin) { xmin = xtest; imin = i; } } #endif return(imin); } /* ************************************************************************ */ REAL dnormi( int n, REAL *x ) { x++; return( BLAS_dnormi( &n, x ) ); } REAL BLAS_CALLMODEL my_dnormi( int *_n, REAL *x ) { /* =============================================================== dnormi returns the infinity-norm of the vector x. =============================================================== */ int j; register REAL hold, absval; int n = *_n; x--; hold = 0.0; /* for(j = 1; j <= n; j++) */ for(j = n; j > 0; j--) { absval = fabs(x[j]); hold = MAX( hold, absval ); } return( hold ); } /* ************************************************************************ */ /* Subvector and submatrix access routines (Fortran compatibility) */ /* ************************************************************************ */ #ifndef UseMacroVector int subvec( int item) { return( item-1 ); } #endif int submat( int nrowb, int row, int col) { return( nrowb*(col-1) + subvec(row) ); } int posmat( int nrowb, int row, int col) { return( submat(nrowb, row, col)+BLAS_BASE ); } /* ************************************************************************ */ /* Randomization functions */ /* ************************************************************************ */ void randomseed(int seeds[]) /* Simply create some default seed values */ { seeds[1] = 123456; seeds[2] = 234567; seeds[3] = 345678; } void randomdens( int n, REAL *x, REAL r1, REAL r2, REAL densty, int *seeds ) { /* ------------------------------------------------------------------ random generates a vector x[*] of random numbers in the range (r1, r2) with (approximate) specified density. seeds[*] must be initialized before the first call. ------------------------------------------------------------------ */ int i; REAL *y; y = (REAL *) malloc(sizeof(*y) * (n+1)); ddrand( n, x, 1, seeds ); ddrand( n, y, 1, seeds ); for (i = 1; i<=n; i++) { if (y[i] < densty) x[i] = r1 + (r2 - r1) * x[i]; else x[i] = 0.0; } free(y); } /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ void ddrand( int n, REAL *x, int incx, int *seeds ) { /* ------------------------------------------------------------------ ddrand fills a vector x with uniformly distributed random numbers in the interval (0, 1) using a method due to Wichman and Hill. seeds[1..3] should be set to integer values between 1 and 30000 before the first entry. Integer arithmetic up to 30323 is required. Blatantly copied from Wichman and Hill 19-January-1987. 14-Feb-94. Original version. 30 Jun 1999. seeds stored in an array. 30 Jun 1999. This version of ddrand. ------------------------------------------------------------------ */ int ix, xix; if (n < 1) return; for (ix = 1; ix<=1+(n-1)*incx; ix=ix+incx) { seeds[1] = 171*(seeds[1] % 177) - 2*(seeds[1]/177); seeds[2] = 172*(seeds[2] % 176) - 35*(seeds[2]/176); seeds[3] = 170*(seeds[3] % 178) - 63*(seeds[3]/178); if (seeds[1] < 0) seeds[1] = seeds[1] + 30269; if (seeds[2] < 0) seeds[2] = seeds[2] + 30307; if (seeds[3] < 0) seeds[3] = seeds[3] + 30323; x[ix] = ((REAL) seeds[1])/30269.0 + ((REAL) seeds[2])/30307.0 + ((REAL) seeds[3])/30323.0; xix = (int) x[ix]; x[ix] = fabs(x[ix] - xix); } } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/myblas.h100666 0 0 12714 11141443436 16417 0ustar usergroup#ifndef HEADER_myblas #define HEADER_myblas /* ************************************************************************ */ /* BLAS function interface with local and external loadable versions */ /* Author: Kjell Eikland */ /* Version: Initial version spring 2004 */ /* Licence: LGPL */ /* ************************************************************************ */ /* Changes: 19 September 2004 Moved function pointer variable */ /* declarations from myblas.h to myblas.c */ /* to avoid linker problems with the Mac. */ /* 20 April 2005 Modified all double types to REAL to self- */ /* adjust to global settings. Note that BLAS */ /* as of now does not have double double. */ /* 15 December 2005 Added idamin() */ /* ************************************************************************ */ #define BLAS_BASE 1 #define UseMacroVector #define LoadableBlasLib /* ************************************************************************ */ /* Include necessary libraries */ /* ************************************************************************ */ #include "commonlib.h" #ifdef LoadableBlasLib #if (defined WIN32) || (defined WIN64) #include #else #include #endif #endif #ifdef __cplusplus extern "C" { #endif /* ************************************************************************ */ /* BLAS functions */ /* ************************************************************************ */ #ifndef BLAS_CALLMODEL #if (defined WIN32) || (defined WIN64) #define BLAS_CALLMODEL _cdecl #else #define BLAS_CALLMODEL #endif #endif typedef void (BLAS_CALLMODEL BLAS_dscal_func) (int *n, REAL *da, REAL *dx, int *incx); typedef void (BLAS_CALLMODEL BLAS_dcopy_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef void (BLAS_CALLMODEL BLAS_daxpy_func) (int *n, REAL *da, REAL *dx, int *incx, REAL *dy, int *incy); typedef void (BLAS_CALLMODEL BLAS_dswap_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef double (BLAS_CALLMODEL BLAS_ddot_func) (int *n, REAL *dx, int *incx, REAL *dy, int *incy); typedef int (BLAS_CALLMODEL BLAS_idamax_func)(int *n, REAL *x, int *is); typedef int (BLAS_CALLMODEL BLAS_idamin_func)(int *n, REAL *x, int *is); typedef void (BLAS_CALLMODEL BLAS_dload_func) (int *n, REAL *da, REAL *dx, int *incx); typedef double (BLAS_CALLMODEL BLAS_dnormi_func)(int *n, REAL *x); #ifndef __WINAPI #if (defined WIN32) || (defined WIN64) #define __WINAPI WINAPI #else #define __WINAPI #endif #endif void init_BLAS(void); MYBOOL is_nativeBLAS(void); MYBOOL load_BLAS(char *libname); MYBOOL unload_BLAS(void); /* ************************************************************************ */ /* User-callable BLAS definitions (C base 1) */ /* ************************************************************************ */ void dscal ( int n, REAL da, REAL *dx, int incx ); void dcopy ( int n, REAL *dx, int incx, REAL *dy, int incy ); void daxpy ( int n, REAL da, REAL *dx, int incx, REAL *dy, int incy ); void dswap ( int n, REAL *dx, int incx, REAL *dy, int incy ); REAL ddot ( int n, REAL *dx, int incx, REAL *dy, int incy ); int idamax( int n, REAL *x, int is ); int idamin( int n, REAL *x, int is ); void dload ( int n, REAL da, REAL *dx, int incx ); REAL dnormi( int n, REAL *x ); /* ************************************************************************ */ /* Locally implemented BLAS functions (C base 0) */ /* ************************************************************************ */ void BLAS_CALLMODEL my_dscal ( int *n, REAL *da, REAL *dx, int *incx ); void BLAS_CALLMODEL my_dcopy ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); void BLAS_CALLMODEL my_daxpy ( int *n, REAL *da, REAL *dx, int *incx, REAL *dy, int *incy ); void BLAS_CALLMODEL my_dswap ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); REAL BLAS_CALLMODEL my_ddot ( int *n, REAL *dx, int *incx, REAL *dy, int *incy ); int BLAS_CALLMODEL my_idamax( int *n, REAL *x, int *is ); int BLAS_CALLMODEL my_idamin( int *n, REAL *x, int *is ); void BLAS_CALLMODEL my_dload ( int *n, REAL *da, REAL *dx, int *incx ); REAL BLAS_CALLMODEL my_dnormi( int *n, REAL *x ); /* ************************************************************************ */ /* Subvector and submatrix access routines (Fortran compatibility) */ /* ************************************************************************ */ #ifdef UseMacroVector #define subvec(item) (item - 1) #else int subvec( int item ); #endif int submat( int nrowb, int row, int col ); int posmat( int nrowb, int row, int col ); /* ************************************************************************ */ /* Randomization functions */ /* ************************************************************************ */ void randomseed(int *seeds); void randomdens( int n, REAL *x, REAL r1, REAL r2, REAL densty, int *seeds); void ddrand( int n, REAL *x, int incx, int *seeds ); #ifdef __cplusplus } #endif #endif lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/Row-based L0.txt100666 0 0 2062 10233535016 17547 0ustar usergroupTraditional column-based L0 --------------------------- V[ 3] = V[ 3] + L[1,3]*V[ 1] 0.9375 = -1.26316 + -0.789474*-2.7875 V[ 2] = V[ 2] + L[1,2]*V[ 1] -0.846875 = -0.15 + 0.25*-2.7875 V[ 2] = V[ 2] + L[3,2]*V[ 3] -0.925 = -0.846875 + -0.0833333*0.9375 V[ 4] = V[ 4] + L[3,4]*V[ 3] -0.3125 = 0 + -0.333333*0.9375 Solution vector -2.7875 -0.925 0.9375 -0.3125 New row-based L0 ---------------- V[ 4] = V[ 4] + L[3,4]*V[ 3] 0.421053 = 0 + -0.333333*-1.26316 V[ 2] = V[ 2] + L[3,2]*V[ 3] -0.0447368 = -0.15 + -0.0833333*-1.26316 V[ 2] = V[ 2] + L[1,2]*V[ 1] -0.741612 = -0.0447368 + 0.25*-2.7875 V[ 3] = V[ 3] + L[1,3]*V[ 1] 0.9375 = -1.26316 + -0.789474*-2.7875 Solution vector -2.7875 -0.741612 0.9375 0.421053 L0 generated ---------------- 0 0 0 0 0 0 0 0 0 0.25 -0.789474 0 0-0.0833333 0 -0.333333lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/sherman5.mtx100666 0 0 2371634 10354206632 17306 0ustar usergroup%%MatrixMarket matrix coordinate real general 3312 3312 20793 1 1 1.0000000000000e+00 2 2 1.0000000000000e+00 3 3 1.0000000000000e+00 4 4 1.0000000000000e+00 5 5 1.0000000000000e+00 6 6 1.0000000000000e+00 7 7 1.0000000000000e+00 8 8 1.0000000000000e+00 9 9 1.0000000000000e+00 10 10 1.0000000000000e+00 11 11 1.0000000000000e+00 12 12 1.0000000000000e+00 13 13 1.0000000000000e+00 14 14 1.0000000000000e+00 15 15 1.0000000000000e+00 16 16 1.0000000000000e+00 17 17 1.0000000000000e+00 18 18 1.0000000000000e+00 19 19 1.0000000000000e+00 20 20 1.0000000000000e+00 21 21 1.0000000000000e+00 22 22 1.0000000000000e+00 23 23 1.0000000000000e+00 24 24 1.0000000000000e+00 25 25 1.0000000000000e+00 26 26 1.0000000000000e+00 27 27 1.0000000000000e+00 28 28 1.0000000000000e+00 29 29 1.0000000000000e+00 30 30 1.0000000000000e+00 31 31 1.0000000000000e+00 32 32 1.0000000000000e+00 33 33 1.0000000000000e+00 34 34 1.0000000000000e+00 35 35 1.0000000000000e+00 36 36 1.0000000000000e+00 37 37 1.0000000000000e+00 38 38 1.0000000000000e+00 39 39 1.0000000000000e+00 40 40 1.0000000000000e+00 41 41 1.0000000000000e+00 42 42 1.0000000000000e+00 43 43 1.0000000000000e+00 44 44 1.0000000000000e+00 45 45 1.0000000000000e+00 46 46 1.0000000000000e+00 47 47 1.0000000000000e+00 48 48 1.0000000000000e+00 49 49 1.0000000000000e+00 50 50 1.0000000000000e+00 51 51 1.0000000000000e+00 52 52 1.0000000000000e+00 53 53 1.0000000000000e+00 54 54 1.0000000000000e+00 55 55 1.0000000000000e+00 56 56 1.0000000000000e+00 57 57 1.0000000000000e+00 58 58 1.0000000000000e+00 59 59 1.0000000000000e+00 60 60 1.0000000000000e+00 61 61 1.0000000000000e+00 62 62 1.0000000000000e+00 63 63 1.0000000000000e+00 64 64 1.0000000000000e+00 65 65 1.0000000000000e+00 66 66 1.0000000000000e+00 67 67 1.0000000000000e+00 68 68 1.0000000000000e+00 69 69 1.0000000000000e+00 70 70 1.0000000000000e+00 71 71 1.0000000000000e+00 72 72 1.0000000000000e+00 73 73 1.0000000000000e+00 74 74 1.0000000000000e+00 75 75 1.0000000000000e+00 76 76 1.0000000000000e+00 77 77 1.0000000000000e+00 78 78 1.0000000000000e+00 79 79 1.0000000000000e+00 80 80 1.0000000000000e+00 81 81 1.0000000000000e+00 82 82 1.0000000000000e+00 83 83 1.0000000000000e+00 84 84 1.0000000000000e+00 85 85 1.0000000000000e+00 86 86 1.0000000000000e+00 87 87 1.0000000000000e+00 88 88 1.0000000000000e+00 89 89 1.0000000000000e+00 90 90 1.0000000000000e+00 91 91 1.0000000000000e+00 92 92 1.0000000000000e+00 93 93 1.0000000000000e+00 94 94 1.0000000000000e+00 95 95 1.0000000000000e+00 96 96 1.0000000000000e+00 97 97 1.0000000000000e+00 98 98 1.0000000000000e+00 99 99 1.0000000000000e+00 100 100 1.0000000000000e+00 101 101 1.0000000000000e+00 102 102 1.0000000000000e+00 103 103 1.0000000000000e+00 104 104 1.0000000000000e+00 105 105 1.0000000000000e+00 106 106 1.0000000000000e+00 107 107 1.0000000000000e+00 108 108 1.0000000000000e+00 109 109 1.0000000000000e+00 110 110 1.0000000000000e+00 111 111 1.0000000000000e+00 112 112 5.8231501000000e+02 114 112 5.2492442000000e-01 115 112 -2.0203364000000e+00 117 112 -2.7550543000000e-01 160 112 -5.6252230000000e+00 162 112 -1.6807221000000e-01 112 113 -3.5663180000000e+02 113 113 -8.8662401000000e+01 114 113 4.3323260000000e+00 117 113 -1.9094766000000e+00 160 113 2.6312807000000e+01 162 113 -2.4130042000000e+00 112 114 -6.0285039000000e+02 113 114 7.5193603000000e+01 114 114 7.3233615000000e+00 117 114 -3.2277769000000e+00 160 114 4.4479169000000e+01 161 114 -5.0183851000000e+00 162 114 -4.0789423000000e+00 112 115 -1.6998248000000e+00 114 115 -2.7550543000000e-01 115 115 5.8372624000000e+02 117 115 6.3124101000000e-01 163 115 -7.3516016000000e+00 165 115 -2.7406444000000e-01 112 116 1.4215287000000e+00 114 116 -1.9094766000000e+00 115 116 -3.5731519000000e+02 116 116 -8.2875303000000e+01 117 116 3.8183672000000e+00 163 116 2.5567757000000e+01 165 116 -1.8996892000000e+00 112 117 2.4029503000000e+00 113 117 -2.3924408000000e-01 114 117 -3.2277769000000e+00 115 117 -6.0400514000000e+02 116 117 7.0151506000000e+01 117 117 6.4545628000000e+00 163 117 4.3219704000000e+01 164 117 -4.3030678000000e+00 165 117 -3.2112320000000e+00 118 118 1.0000000000000e+00 119 119 1.0000000000000e+00 120 120 1.0000000000000e+00 121 121 1.0000000000000e+00 122 122 1.0000000000000e+00 123 123 1.0000000000000e+00 124 124 5.3832442000000e+02 126 124 5.3782022000000e-01 127 124 -6.3733512000000e-01 129 124 -1.5517509000000e-01 172 124 -8.9792671000000e+00 174 124 -3.0109811000000e-01 124 125 -3.3089489000000e+02 125 125 -7.4442006000000e+01 126 125 3.7903600000000e+00 129 125 -2.1251184000000e+00 172 125 2.6986678000000e+01 174 125 -1.6569781000000e+00 124 126 -5.5934473000000e+02 125 126 6.3483385000000e+01 126 126 6.4072219000000e+00 129 126 -3.5922975000000e+00 172 126 4.5618281000000e+01 173 126 -4.5334382000000e+00 174 126 -2.8009558000000e+00 124 127 -1.3980131000000e+00 126 127 -1.5517509000000e-01 127 127 5.0198176000000e+02 129 127 4.7689354000000e-01 130 127 -6.3224679000000e-01 132 127 -8.6217037000000e-02 175 127 -5.7287189000000e+00 177 127 -1.5448592000000e-01 124 128 1.3851396000000e+00 126 128 -2.1251184000000e+00 127 128 -3.1288440000000e+02 128 128 -7.5938657000000e+01 129 128 6.6177709000000e+00 132 128 -2.3682623000000e+00 175 128 2.7415937000000e+01 177 128 -2.1159596000000e+00 124 129 2.3414383000000e+00 125 129 -2.6047842000000e-01 126 129 -3.5922975000000e+00 127 129 -5.2889940000000e+02 128 129 6.5540651000000e+01 129 129 1.1186675000000e+01 132 129 -4.0033106000000e+00 175 129 4.6343867000000e+01 176 129 -5.1556247000000e+00 177 129 -3.5768156000000e+00 127 130 -1.4107303000000e+00 129 130 -8.6217037000000e-02 130 130 4.6586228000000e+02 132 130 2.9383283000000e-01 133 130 -3.8013097000000e-01 135 130 -4.2128177000000e-02 178 130 -4.3311389000000e+00 180 130 -8.4835819000000e-02 127 131 4.3689315000000e+00 129 131 -2.3682623000000e+00 130 131 -2.9407852000000e+02 131 131 -7.4441522000000e+01 132 131 7.2325006000000e+00 135 131 -2.5253587000000e+00 178 131 2.5448551000000e+01 180 131 -2.3306147000000e+00 127 132 7.3852418000000e+00 128 132 -9.3201429000000e-01 129 132 -4.0033106000000e+00 130 132 -4.9711033000000e+02 131 132 6.5294128000000e+01 132 132 1.2225815000000e+01 135 132 -4.2688625000000e+00 178 132 4.3018230000000e+01 179 132 -5.4288819000000e+00 180 132 -3.9396711000000e+00 130 133 -1.4010699000000e+00 132 133 -4.2128177000000e-02 133 133 4.2014767000000e+02 135 133 2.8664674000000e-01 136 133 -4.5043645000000e-01 138 133 -2.8088374000000e-02 181 133 -3.0132612000000e+00 183 133 -4.1440337000000e-02 1237 133 -1.5185682000000e+00 1239 133 -9.4695072000000e-02 130 134 8.3901469000000e+00 132 134 -2.5253587000000e+00 133 134 -2.7386615000000e+02 134 134 -7.0163194000000e+01 135 134 8.4045939000000e+00 138 134 -2.4770889000000e+00 181 134 2.7643276000000e+01 183 134 -2.4844433000000e+00 1239 134 -9.0991269000000e-01 130 135 1.4182692000000e+01 131 135 -1.8692398000000e+00 132 135 -4.2688625000000e+00 133 135 -4.6294292000000e+02 134 135 6.3568717000000e+01 135 135 1.4207117000000e+01 138 135 -4.1872710000000e+00 181 135 4.6728152000000e+01 182 135 -6.1586425000000e+00 183 135 -4.1996989000000e+00 1239 135 -1.5381153000000e+00 133 136 -1.1205588000000e+00 135 136 -2.8088374000000e-02 136 136 3.9605626000000e+02 138 136 2.1289817000000e-01 139 136 -4.3256755000000e-01 141 136 -1.9131946000000e-02 184 136 -2.4236070000000e+00 186 136 -2.7943549000000e-02 1240 136 -1.3020729000000e+00 1242 136 -5.7589129000000e-02 133 137 7.3902619000000e+00 135 137 -2.4770889000000e+00 136 137 -2.5965366000000e+02 137 137 -6.7508510000000e+01 138 137 8.6129243000000e+00 141 137 -2.4530265000000e+00 184 137 2.7643725000000e+01 186 137 -2.4646498000000e+00 1242 137 -1.2106635000000e+00 133 138 1.2492498000000e+01 134 138 -1.6776607000000e+00 135 138 -4.1872710000000e+00 136 138 -4.3891854000000e+02 137 138 6.1392103000000e+01 138 138 1.4559283000000e+01 141 138 -4.1465920000000e+00 184 138 4.6728953000000e+01 185 138 -6.2753919000000e+00 186 138 -4.1662440000000e+00 1242 138 -2.0465056000000e+00 136 139 -8.1089445000000e-01 138 139 -1.9131946000000e-02 139 139 3.7180667000000e+02 141 139 1.6790239000000e-01 142 139 -2.7576248000000e-01 144 139 -1.2196645000000e-02 187 139 -2.0755418000000e+00 189 139 -1.8758993000000e-02 1243 139 -8.5465113000000e-01 1245 139 -3.7800198000000e-02 136 140 5.6903327000000e+00 138 140 -2.4530265000000e+00 139 140 -2.4225577000000e+02 140 140 -6.4514006000000e+01 141 140 8.7655485000000e+00 144 140 -2.4257603000000e+00 187 140 2.5159407000000e+01 189 140 -2.4055380000000e+00 1245 140 -1.4740605000000e+00 136 141 9.6189292000000e+00 137 141 -1.3569623000000e+00 138 141 -4.1465920000000e+00 139 141 -4.0950877000000e+02 140 141 5.8423373000000e+01 141 141 1.4817273000000e+01 144 141 -4.1005051000000e+00 187 141 4.2529422000000e+01 188 141 -5.9997136000000e+00 189 141 -4.0663174000000e+00 1245 141 -2.4917501000000e+00 139 142 -5.8379831000000e-01 141 142 -1.2196645000000e-02 142 142 3.4769930000000e+02 144 142 1.2785204000000e-01 190 142 -1.5025582000000e+00 192 142 -1.1948511000000e-02 1246 142 -8.1286985000000e-01 1248 142 -2.3819524000000e-02 139 143 3.4445751000000e+00 141 143 -2.4257603000000e+00 142 143 -2.2507085000000e+02 143 143 -6.1460330000000e+01 144 143 6.5646306000000e+00 190 143 2.3436855000000e+01 192 143 -2.3767260000000e+00 1248 143 -1.7553192000000e+00 139 144 5.8227096000000e+00 140 144 -8.3153640000000e-01 141 144 -4.1005051000000e+00 142 144 -3.8045976000000e+02 143 144 5.5129317000000e+01 144 144 1.1096852000000e+01 190 144 3.9617660000000e+01 191 144 -5.6577656000000e+00 192 144 -4.0176177000000e+00 1248 144 -2.9671916000000e+00 145 145 1.0000000000000e+00 146 146 1.0000000000000e+00 147 147 1.0000000000000e+00 148 148 1.0000000000000e+00 149 149 1.0000000000000e+00 150 150 1.0000000000000e+00 151 151 1.0000000000000e+00 152 152 1.0000000000000e+00 153 153 1.0000000000000e+00 154 154 1.0000000000000e+00 155 155 1.0000000000000e+00 156 156 1.0000000000000e+00 157 157 1.0000000000000e+00 158 158 1.0000000000000e+00 159 159 1.0000000000000e+00 112 160 -9.5033409000000e+00 114 160 -1.6807221000000e-01 160 160 5.8715640000000e+02 162 160 2.0768709000000e-01 163 160 -6.6263142000000e-01 165 160 -1.1226122000000e-02 208 160 -1.4917882000000e+00 210 160 -1.1178095000000e-02 1264 160 -8.8143285000000e-01 1266 160 -1.5588662000000e-02 114 161 -2.4130042000000e+00 160 161 -3.6403964000000e+02 161 161 -1.0420357000000e+02 162 161 1.1702675000000e+01 163 161 1.0112293000000e+00 165 161 -4.1288435000000e+00 208 161 3.2774276000000e+01 210 161 -4.1117354000000e+00 1266 161 -1.0375061000000e+00 114 162 -4.0789423000000e+00 160 162 -6.1537261000000e+02 161 162 9.0595331000000e+01 162 162 1.9782202000000e+01 163 162 1.7093819000000e+00 164 162 -2.4808822000000e-01 165 162 -6.9793971000000e+00 208 162 5.5401636000000e+01 209 162 -8.0406217000000e+00 210 162 -6.9504776000000e+00 1266 162 -1.7538002000000e+00 115 163 -9.3527780000000e+00 117 163 -2.7406444000000e-01 160 163 -3.8310490000000e-01 162 163 -1.1226122000000e-02 163 163 5.8877517000000e+02 165 163 3.7583663000000e-01 166 163 -9.7621276000000e-01 168 163 -2.8605960000000e-02 211 163 -2.1579866000000e+00 213 163 -2.2766993000000e-02 1267 163 -1.2770249000000e+00 1269 163 -3.7420658000000e-02 117 164 -1.8996892000000e+00 162 164 -4.1288435000000e+00 163 164 -3.6275210000000e+02 164 164 -1.0186561000000e+02 165 164 1.4544988000000e+01 166 164 7.2034968000000e-01 168 164 -3.8446595000000e+00 211 164 3.1763844000000e+01 213 164 -3.8235852000000e+00 1269 164 -8.3688804000000e-01 117 165 -3.2112320000000e+00 162 165 -6.9793971000000e+00 163 165 -6.1319572000000e+02 164 165 8.8189741000000e+01 165 165 2.4586836000000e+01 166 165 1.2176783000000e+00 167 165 -1.7063358000000e-01 168 165 -6.4990078000000e+00 211 165 5.3693564000000e+01 212 165 -7.5240940000000e+00 213 165 -6.4633840000000e+00 1269 165 -1.4146747000000e+00 163 166 -6.9261266000000e-01 165 166 -2.8605960000000e-02 166 166 5.7964280000000e+02 168 166 2.1236083000000e-01 169 166 -6.4659514000000e-01 171 166 -2.8598130000000e-02 214 166 -2.6326900000000e+00 216 166 -2.8465858000000e-02 1270 166 -1.0407070000000e+00 1272 166 -4.6029227000000e-02 165 167 -3.8446595000000e+00 166 167 -3.6080559000000e+02 167 167 -9.2549851000000e+01 168 167 1.2072043000000e+01 171 167 -3.7281591000000e+00 214 167 3.0535283000000e+01 216 167 -3.7102441000000e+00 1272 167 -7.7776517000000e-01 165 168 -6.4990078000000e+00 166 168 -6.0990576000000e+02 167 168 1.0113849000000e+02 168 168 2.0406572000000e+01 171 168 -6.3020758000000e+00 214 168 5.1616842000000e+01 215 168 -7.2946364000000e+00 216 168 -6.2717966000000e+00 1272 168 -1.3147342000000e+00 166 169 -7.4936863000000e-01 168 169 -2.8598130000000e-02 169 169 5.7960782000000e+02 171 169 2.0612325000000e-01 172 169 -5.0660252000000e-01 174 169 -2.2406424000000e-02 217 169 -2.6813113000000e+00 219 169 -2.8468338000000e-02 1273 169 -1.0397916000000e+00 1275 169 -4.5988738000000e-02 166 170 1.6519968000000e+00 168 170 -3.7281591000000e+00 169 170 -3.6323852000000e+02 170 170 -1.0089664000000e+02 171 170 1.2039996000000e+01 174 170 -3.8116668000000e+00 217 170 3.1315243000000e+01 219 170 -3.7116769000000e+00 1275 170 -7.7727817000000e-01 166 171 2.7925334000000e+00 167 171 -3.9466218000000e-01 168 171 -6.3020758000000e+00 169 171 -6.1401798000000e+02 170 171 8.7613858000000e+01 171 171 2.0352399000000e+01 174 171 -6.4432415000000e+00 217 171 5.2935250000000e+01 218 171 -7.4812153000000e+00 219 171 -6.2742143000000e+00 1275 171 -1.3139100000000e+00 124 172 -1.0275334000000e+01 126 172 -3.0109811000000e-01 169 172 -9.2027711000000e-01 171 172 -2.2406424000000e-02 172 172 5.7841498000000e+02 174 172 4.0105527000000e-01 175 172 -6.0633936000000e-01 177 172 -1.7767561000000e-02 220 172 -2.2549502000000e+00 222 172 -2.2319387000000e-02 1276 172 -1.2199801000000e+00 1278 172 -3.5749077000000e-02 126 173 -1.6569781000000e+00 169 173 4.9808187000000e+00 171 173 -3.8116668000000e+00 172 173 -3.6291867000000e+02 173 173 -9.9874183000000e+01 174 173 1.3885676000000e+01 177 173 -3.7395622000000e+00 220 173 3.4272320000000e+01 222 173 -3.7973032000000e+00 1278 173 -8.6906437000000e-01 126 174 -2.8009558000000e+00 169 174 8.4195758000000e+00 170 174 -1.1816716000000e+00 171 174 -6.4432415000000e+00 172 174 -6.1347772000000e+02 173 174 8.8241532000000e+01 174 174 2.3472342000000e+01 177 174 -6.3213517000000e+00 220 174 5.7933929000000e+01 221 174 -8.1309186000000e+00 222 174 -6.4189614000000e+00 1278 174 -1.4690664000000e+00 127 175 -5.2720176000000e+00 129 175 -1.5448592000000e-01 172 175 -8.8376592000000e-01 174 175 -1.7767561000000e-02 175 175 5.3819049000000e+02 177 175 2.2860480000000e-01 178 175 -3.6629296000000e-01 180 175 -1.0733482000000e-02 223 175 -2.1028053000000e+00 225 175 -1.7511047000000e-02 1279 175 -9.0554114000000e-01 1281 175 -2.6535070000000e-02 129 176 -2.1159596000000e+00 172 176 6.4992267000000e+00 174 176 -3.7395622000000e+00 175 176 -3.4501964000000e+02 176 176 -9.4437882000000e+01 177 176 1.4167430000000e+01 180 176 -3.5930102000000e+00 223 176 3.4671114000000e+01 225 176 -3.6860291000000e+00 1281 176 -1.0223718000000e+00 129 177 -3.5768156000000e+00 172 177 1.0986285000000e+01 173 177 -1.5779046000000e+00 174 177 -6.3213517000000e+00 175 177 -5.8322082000000e+02 176 177 8.4628322000000e+01 177 177 2.3948610000000e+01 180 177 -6.0736243000000e+00 223 177 5.8608013000000e+01 224 177 -8.4175711000000e+00 225 177 -6.2308592000000e+00 1281 177 -1.7282160000000e+00 130 178 -4.7968887000000e+00 132 178 -8.4835819000000e-02 175 178 -8.0210585000000e-01 177 178 -1.0733482000000e-02 178 178 4.9120539000000e+02 180 178 1.3248632000000e-01 181 178 -3.9934254000000e-01 183 178 -7.0626095000000e-03 226 178 -1.5065650000000e+00 228 178 -1.0573342000000e-02 1282 178 -1.0123748000000e+00 1284 178 -1.7904448000000e-02 132 179 -2.3306147000000e+00 175 179 7.4001667000000e+00 177 179 -3.5930102000000e+00 178 179 -3.1953541000000e+02 179 179 -8.7270037000000e+01 180 179 1.4135047000000e+01 183 179 -3.4167533000000e+00 226 179 3.4709746000000e+01 228 179 -3.5398843000000e+00 1284 179 -1.2450844000000e+00 132 180 -3.9396711000000e+00 175 180 1.2509242000000e+01 176 180 -1.7988232000000e+00 177 180 -6.0736243000000e+00 178 180 -5.4014266000000e+02 179 180 7.9198658000000e+01 180 180 2.3893881000000e+01 183 180 -5.7756766000000e+00 226 180 5.8673355000000e+01 227 180 -8.4372023000000e+00 228 180 -5.9838204000000e+00 1284 180 -2.1046906000000e+00 133 181 -2.3431693000000e+00 135 181 -4.1440337000000e-02 178 181 -6.0882022000000e-01 180 181 -7.0626095000000e-03 181 181 4.5308736000000e+02 183 181 6.8671832000000e-02 184 181 -1.7952822000000e-01 186 181 -3.1750629000000e-03 229 181 -1.2500289000000e+00 231 181 -6.9509890000000e-03 1285 181 -4.9817901000000e-01 1287 181 -8.8105909000000e-03 135 182 -2.4844433000000e+00 178 182 8.0397464000000e+00 180 182 -3.4167533000000e+00 181 182 -2.9842278000000e+02 182 182 -8.1860502000000e+01 183 182 1.4079488000000e+01 186 182 -3.2915798000000e+00 229 182 3.2776872000000e+01 231 182 -3.3632083000000e+00 1287 182 -1.5144038000000e+00 135 183 -4.1996989000000e+00 178 183 1.3590380000000e+01 179 183 -2.0179013000000e+00 180 183 -5.7756766000000e+00 181 183 -5.0445359000000e+02 182 183 7.4924081000000e+01 183 183 2.3799955000000e+01 186 183 -5.5640865000000e+00 229 183 5.5405994000000e+01 230 183 -8.2266890000000e+00 231 183 -5.6851642000000e+00 1287 183 -2.5599466000000e+00 136 184 -1.5800177000000e+00 138 184 -2.7943549000000e-02 181 184 -3.8085523000000e-01 183 184 -3.1750629000000e-03 184 184 4.1704012000000e+02 186 184 4.2224667000000e-02 187 184 -1.2247098000000e-01 189 184 -2.1659719000000e-03 232 184 -9.6282021000000e-01 234 184 -3.1237309000000e-03 1288 184 -2.6765315000000e-01 1290 184 -4.7336046000000e-03 138 185 -2.4646498000000e+00 181 185 7.6865494000000e+00 183 185 -3.2915798000000e+00 184 185 -2.7554457000000e+02 185 185 -7.6543503000000e+01 186 185 1.3835576000000e+01 189 185 -3.0734057000000e+00 232 185 3.0072650000000e+01 234 185 -3.2388179000000e+00 1290 185 -1.7586124000000e+00 138 186 -4.1662440000000e+00 181 186 1.2993343000000e+01 182 186 -2.0075327000000e+00 183 186 -5.5640865000000e+00 184 186 -4.6578054000000e+02 185 186 7.0327031000000e+01 186 186 2.3387654000000e+01 189 186 -5.1952822000000e+00 232 186 5.0834807000000e+01 233 186 -7.8542169000000e+00 234 186 -5.4748978000000e+00 1290 186 -2.9727583000000e+00 139 187 -1.7974492000000e+00 141 187 -1.8758993000000e-02 184 187 -2.8221387000000e-01 186 187 -2.1659719000000e-03 187 187 3.8232845000000e+02 189 187 2.9595214000000e-02 190 187 -1.7389934000000e-01 192 187 -1.8148921000000e-03 235 187 -4.6688455000000e-01 237 187 -2.1283901000000e-03 1291 187 -3.5963947000000e-01 1293 187 -3.7533603000000e-03 141 188 -2.4055380000000e+00 184 188 7.2573020000000e+00 186 188 -3.0734057000000e+00 187 188 -2.5249098000000e+02 188 188 -7.0502971000000e+01 189 188 1.3352024000000e+01 192 188 -2.8726571000000e+00 235 188 2.7264523000000e+01 237 188 -3.0204609000000e+00 1293 188 -1.9721237000000e+00 141 189 -4.0663174000000e+00 184 189 1.2267737000000e+01 185 189 -1.8598161000000e+00 186 189 -5.1952822000000e+00 187 189 -4.2681054000000e+02 188 189 6.4538446000000e+01 189 189 2.2570249000000e+01 192 189 -4.8559394000000e+00 235 189 4.6087927000000e+01 236 189 -6.9870316000000e+00 237 189 -5.1057843000000e+00 1293 189 -3.3336753000000e+00 142 190 -1.1448824000000e+00 144 190 -1.1948511000000e-02 187 190 -2.2552177000000e-01 189 190 -1.8148921000000e-03 190 190 3.5827852000000e+02 192 190 1.9645213000000e-02 238 190 -3.4041326000000e-01 240 190 -1.8063119000000e-03 1294 190 -3.0363694000000e-01 1296 190 -3.1688925000000e-03 144 191 -2.3767260000000e+00 187 191 5.0814602000000e+00 189 191 -2.8726571000000e+00 190 191 -2.3237971000000e+02 191 191 -6.6372454000000e+01 192 191 1.0250425000000e+01 238 191 2.2538935000000e+01 240 191 -2.8594450000000e+00 1296 191 -2.1342173000000e+00 144 192 -4.0176177000000e+00 187 192 8.5897002000000e+00 188 192 -1.3110006000000e+00 189 192 -4.8559394000000e+00 190 192 -3.9281466000000e+02 191 192 5.9555841000000e+01 192 192 1.7327318000000e+01 238 192 3.8099815000000e+01 239 192 -5.8149738000000e+00 240 192 -4.8336058000000e+00 1296 192 -3.6076809000000e+00 193 193 1.0000000000000e+00 194 194 1.0000000000000e+00 195 195 1.0000000000000e+00 196 196 1.0000000000000e+00 197 197 1.0000000000000e+00 198 198 1.0000000000000e+00 199 199 1.0000000000000e+00 200 200 1.0000000000000e+00 201 201 1.0000000000000e+00 202 202 1.0000000000000e+00 203 203 1.0000000000000e+00 204 204 1.0000000000000e+00 205 205 1.0000000000000e+00 206 206 1.0000000000000e+00 207 207 1.0000000000000e+00 160 208 -1.0710627000000e+00 162 208 -1.1178095000000e-02 208 208 5.7664083000000e+02 210 208 2.0060363000000e-02 211 208 -2.4673275000000e-01 213 208 -2.4431051000000e-03 256 208 -5.0275251000000e-01 258 208 -2.4344383000000e-03 1312 208 -2.4521007000000e-01 1314 208 -2.5591232000000e-03 162 209 -4.1117354000000e+00 208 209 -3.6951689000000e+02 209 209 -1.0739081000000e+02 210 209 1.4473053000000e+01 211 209 1.2598142000000e+00 213 209 -4.5324730000000e+00 256 209 3.8055507000000e+01 258 209 -4.5169952000000e+00 1314 209 -1.2998960000000e+00 162 210 -6.9504776000000e+00 208 210 -6.2463134000000e+02 209 210 9.4914364000000e+01 210 210 2.4465248000000e+01 211 210 2.1295899000000e+00 212 210 -3.2783572000000e-01 213 210 -7.6616923000000e+00 256 210 6.4329029000000e+01 257 210 -9.9030117000000e+00 258 210 -7.6355288000000e+00 1314 210 -2.1973442000000e+00 163 211 -2.1814878000000e+00 165 211 -2.2766993000000e-02 208 211 -2.3409345000000e-01 210 211 -2.4431051000000e-03 211 211 5.7810629000000e+02 213 211 3.4919008000000e-02 214 211 -2.6512178000000e-01 216 211 -2.6886511000000e-03 259 211 -5.7254940000000e-01 261 211 -2.6800805000000e-03 1315 211 -2.7636288000000e-01 1317 211 -2.8842481000000e-03 165 212 -3.8235852000000e+00 210 212 -4.5324730000000e+00 211 212 -3.6896133000000e+02 212 212 -1.0720477000000e+02 213 212 1.8657388000000e+01 214 212 7.4248961000000e-01 216 212 -4.5082972000000e+00 259 212 3.8015026000000e+01 261 212 -4.4945266000000e+00 1317 212 -1.2865738000000e+00 165 213 -6.4633840000000e+00 210 213 -7.6616923000000e+00 211 213 -6.2369183000000e+02 212 213 9.4574832000000e+01 213 213 3.1538432000000e+01 214 213 1.2551036000000e+00 215 213 -1.9218681000000e-01 216 213 -7.6208205000000e+00 259 213 6.4260557000000e+01 260 213 -9.8398496000000e+00 261 213 -7.5975428000000e+00 1317 213 -2.1748226000000e+00 166 214 -2.7275416000000e+00 168 214 -2.8465858000000e-02 211 214 -2.5762117000000e-01 213 214 -2.6886511000000e-03 214 214 5.7892699000000e+02 216 214 4.2732943000000e-02 217 214 -3.2769397000000e-01 219 214 -3.4199625000000e-03 262 214 -6.9620582000000e-01 264 214 -3.1666804000000e-03 1318 214 -3.3683290000000e-01 1320 214 -3.5153406000000e-03 168 215 -3.7102441000000e+00 213 215 -4.5082972000000e+00 214 215 -3.6893026000000e+02 215 215 -9.8002191000000e+01 216 215 1.8375718000000e+01 219 215 -4.4366481000000e+00 262 215 3.8721161000000e+01 264 215 -4.4472212000000e+00 1320 215 -1.2614183000000e+00 168 216 -6.2717966000000e+00 213 216 -7.6208205000000e+00 214 216 -6.2363972000000e+02 215 216 1.0911105000000e+02 216 216 3.1062304000000e+01 219 216 -7.4997050000000e+00 262 216 6.5454250000000e+01 263 216 -9.9161438000000e+00 264 216 -7.5175827000000e+00 1320 216 -2.1323014000000e+00 169 217 -2.7277792000000e+00 171 217 -2.8468338000000e-02 214 217 -3.3767214000000e-01 216 217 -3.4199625000000e-03 217 217 5.7908054000000e+02 219 217 4.4058334000000e-02 220 217 -3.2755690000000e-01 222 217 -3.4185321000000e-03 265 217 -7.3488848000000e-01 267 217 -3.4093212000000e-03 1321 217 -3.6942559000000e-01 1323 217 -3.8554926000000e-03 171 218 -3.7116769000000e+00 214 218 9.8147627000000e-01 216 218 -4.4366481000000e+00 217 218 -3.7128234000000e+02 218 218 -1.0664909000000e+02 219 218 1.8269537000000e+01 222 218 -4.4365683000000e+00 265 218 4.0088522000000e+01 267 218 -4.4233411000000e+00 1323 218 -1.2494341000000e+00 171 219 -6.2742143000000e+00 214 219 1.6590864000000e+00 215 219 -2.5000051000000e-01 216 219 -7.4997050000000e+00 217 219 -6.2761527000000e+02 218 219 9.4589072000000e+01 219 219 3.0882809000000e+01 222 219 -7.4995750000000e+00 265 219 6.7765594000000e+01 266 219 -1.0211302000000e+01 267 219 -7.4772107000000e+00 1323 219 -2.1120419000000e+00 172 220 -2.1385990000000e+00 174 220 -2.2319387000000e-02 217 220 -3.6012857000000e-01 219 220 -3.4185321000000e-03 220 220 5.7847280000000e+02 222 220 3.7287746000000e-02 223 220 -2.6939197000000e-01 225 220 -2.8114965000000e-03 268 220 -7.5130318000000e-01 270 220 -3.4090856000000e-03 1324 220 -3.6819108000000e-01 1326 220 -3.8426087000000e-03 174 221 -3.7973032000000e+00 217 221 3.2107202000000e+00 219 221 -4.4365683000000e+00 220 221 -3.7513644000000e+02 221 221 -1.0664886000000e+02 222 221 1.8317866000000e+01 225 221 -4.3982700000000e+00 268 221 4.1711503000000e+01 270 221 -4.4248029000000e+00 1326 221 -1.2490543000000e+00 174 222 -6.4189614000000e+00 217 222 5.4274013000000e+00 218 222 -8.1785463000000e-01 219 222 -7.4995750000000e+00 220 222 -6.3413063000000e+02 221 222 9.5574845000000e+01 222 222 3.0964516000000e+01 225 222 -7.4348304000000e+00 268 222 7.0509125000000e+01 269 222 -1.0625014000000e+01 270 222 -7.4796868000000e+00 1326 222 -2.1114013000000e+00 175 223 -1.6778735000000e+00 177 223 -1.7511047000000e-02 220 223 -3.1793598000000e-01 222 223 -2.8114965000000e-03 223 223 5.5474903000000e+02 225 223 2.9553440000000e-02 226 223 -1.8227636000000e-01 228 223 -1.9023186000000e-03 271 223 -6.7335162000000e-01 273 223 -2.8042008000000e-03 1327 223 -2.9888915000000e-01 1329 223 -3.1193424000000e-03 177 224 -3.6860291000000e+00 220 224 4.7680567000000e+00 222 224 -4.3982700000000e+00 223 224 -3.6390682000000e+02 224 224 -1.0278084000000e+02 225 224 1.8064403000000e+01 228 224 -4.2463847000000e+00 271 224 4.2136737000000e+01 273 224 -4.3874214000000e+00 1329 224 -1.3348595000000e+00 177 225 -6.2308592000000e+00 220 225 8.0599173000000e+00 221 225 -1.2292842000000e+00 222 225 -7.4348304000000e+00 223 225 -6.1514765000000e+02 224 225 9.3163769000000e+01 225 225 3.0536050000000e+01 228 225 -7.1780887000000e+00 271 225 7.1227889000000e+01 272 225 -1.0863549000000e+01 273 225 -7.4164918000000e+00 1329 225 -2.2564449000000e+00 178 226 -1.0131165000000e+00 180 226 -1.0573342000000e-02 223 226 -2.4825922000000e-01 225 226 -1.9023186000000e-03 226 226 5.1920487000000e+02 228 226 1.8823489000000e-02 229 226 -1.1827383000000e-01 231 226 -1.2343592000000e-03 274 226 -5.1884683000000e-01 276 226 -1.8782924000000e-03 1330 226 -1.8675856000000e-01 1332 226 -1.9490968000000e-03 180 227 -3.5398843000000e+00 223 227 6.4838811000000e+00 225 227 -4.2463847000000e+00 226 227 -3.4419200000000e+02 227 227 -9.6916962000000e+01 228 227 1.7439049000000e+01 231 227 -3.9733548000000e+00 274 227 4.0524145000000e+01 276 227 -4.1932912000000e+00 1332 227 -1.4753468000000e+00 180 228 -5.9838204000000e+00 223 228 1.0960352000000e+01 224 228 -1.7017208000000e+00 225 228 -7.1780887000000e+00 226 228 -5.8182216000000e+02 227 228 8.8768635000000e+01 228 228 2.9478962000000e+01 231 228 -6.7165536000000e+00 274 228 6.8502014000000e+01 275 228 -1.0635726000000e+01 276 228 -7.0883394000000e+00 1332 228 -2.4939263000000e+00 181 229 -6.6602986000000e-01 183 229 -6.9509890000000e-03 226 229 -1.9858635000000e-01 228 229 -1.2343592000000e-03 229 229 4.7252958000000e+02 231 229 1.2074909000000e-02 232 229 -2.8192377000000e-02 234 229 -2.9422840000000e-04 277 229 -3.6741877000000e-01 279 229 -1.2175774000000e-03 1333 229 -1.1756918000000e-01 1335 229 -1.2270051000000e-03 183 230 -3.3632083000000e+00 226 230 7.8886303000000e+00 228 230 -3.9733548000000e+00 229 230 -3.1651079000000e+02 230 230 -8.8678619000000e+01 231 230 1.6662947000000e+01 234 230 -3.7352263000000e+00 277 230 3.7856342000000e+01 279 230 -3.9198308000000e+00 1335 230 -1.6614562000000e+00 183 231 -5.6851642000000e+00 226 231 1.3334930000000e+01 227 231 -2.0974954000000e+00 228 231 -6.7165536000000e+00 229 231 -5.3502944000000e+02 230 231 8.2092491000000e+01 231 231 2.8167030000000e+01 234 231 -6.3140265000000e+00 277 231 6.3992312000000e+01 278 231 -1.0065562000000e+01 279 231 -6.6260765000000e+00 1335 231 -2.8085241000000e+00 184 232 -2.9930964000000e-01 186 232 -3.1237309000000e-03 229 232 -1.1643972000000e-01 231 232 -2.9422840000000e-04 232 232 4.3738055000000e+02 234 232 5.5958296000000e-03 235 232 -1.6217394000000e-03 237 232 -1.6925206000000e-05 280 232 -2.0947241000000e-01 282 232 -2.8999742000000e-04 1336 232 -8.0340221000000e-02 1338 232 -8.3846689000000e-04 186 233 -3.2388179000000e+00 229 233 8.6664178000000e+00 231 233 -3.7352263000000e+00 232 233 -2.9406254000000e+02 233 233 -8.2802041000000e+01 234 233 1.5978837000000e+01 237 233 -3.4760355000000e+00 280 233 3.4447542000000e+01 282 233 -3.6819706000000e+00 1338 233 -1.8375694000000e+00 186 234 -5.4748978000000e+00 229 234 1.4649713000000e+01 230 234 -2.3563697000000e+00 231 234 -6.3140265000000e+00 232 234 -4.9708331000000e+02 233 234 7.7003990000000e+01 234 234 2.7010623000000e+01 237 234 -5.8758874000000e+00 280 234 5.8230126000000e+01 281 234 -9.3661703000000e+00 282 234 -6.2240031000000e+00 1338 234 -3.1062273000000e+00 187 235 -2.0393809000000e-01 189 235 -2.1283901000000e-03 232 235 -1.1023481000000e-01 234 235 -1.6925206000000e-05 235 235 4.0269551000000e+02 237 235 3.7167283000000e-03 238 235 -1.4737675000000e-03 240 235 -1.5380905000000e-05 283 235 -1.2353727000000e-01 285 235 -1.6665148000000e-05 1339 235 -5.7366022000000e-02 1341 235 -5.9869776000000e-04 189 236 -3.0204609000000e+00 232 236 9.0983861000000e+00 234 236 -3.4760355000000e+00 235 236 -2.6989504000000e+02 236 236 -7.6449015000000e+01 237 236 1.5194425000000e+01 240 236 -3.2404837000000e+00 283 236 2.9659902000000e+01 285 236 -3.4229940000000e+00 1341 236 -2.0259409000000e+00 189 237 -5.1057843000000e+00 232 237 1.5379904000000e+01 233 237 -2.4917653000000e+00 234 237 -5.8758874000000e+00 235 237 -4.5623034000000e+02 236 237 7.0887220000000e+01 237 237 2.5684645000000e+01 240 237 -5.4777135000000e+00 283 237 5.0137073000000e+01 284 237 -8.1229254000000e+00 285 237 -5.7862261000000e+00 1341 237 -3.4246482000000e+00 190 238 -1.7307719000000e-01 192 238 -1.8063119000000e-03 235 238 -1.4162830000000e-01 237 238 -1.5380905000000e-05 238 238 3.7956711000000e+02 240 238 2.7342053000000e-03 286 238 -1.8468844000000e-03 288 238 -1.5122013000000e-05 1342 238 -3.5584583000000e-02 1344 238 -1.0490999000000e-05 192 239 -2.8594450000000e+00 235 239 8.7075681000000e+00 237 239 -3.2404837000000e+00 238 239 -2.4332481000000e+02 239 239 -7.2082031000000e+01 240 239 1.1483163000000e+01 286 239 1.6689927000000e+01 288 239 -3.1862433000000e+00 1344 239 -2.1889664000000e+00 192 240 -4.8336058000000e+00 235 240 1.4719273000000e+01 236 240 -2.3847611000000e+00 237 240 -5.4777135000000e+00 238 240 -4.1131626000000e+02 239 240 6.3780781000000e+01 240 240 1.9411139000000e+01 286 240 2.8212653000000e+01 287 240 -4.5709076000000e+00 288 240 -5.3860258000000e+00 1344 240 -3.7002288000000e+00 241 241 1.0000000000000e+00 242 242 1.0000000000000e+00 243 243 1.0000000000000e+00 244 244 1.0000000000000e+00 245 245 1.0000000000000e+00 246 246 1.0000000000000e+00 247 247 1.0000000000000e+00 248 248 1.0000000000000e+00 249 249 1.0000000000000e+00 250 250 1.0000000000000e+00 251 251 1.0000000000000e+00 252 252 1.0000000000000e+00 253 253 1.0000000000000e+00 254 254 1.0000000000000e+00 255 255 1.0000000000000e+00 208 256 -2.3326301000000e-01 210 256 -2.4344383000000e-03 256 256 5.7507916000000e+02 258 256 3.8357379000000e-03 259 256 -6.1330853000000e-02 261 256 -2.4941367000000e-05 304 256 -2.4053318000000e-01 306 256 -2.4894191000000e-05 1360 256 -1.9741121000000e-02 1362 256 -7.6162909000000e-06 210 257 -4.5169952000000e+00 256 257 -3.7305396000000e+02 257 257 -1.0022923000000e+02 258 257 1.5487904000000e+01 259 257 1.2056910000000e+00 261 257 -4.7705675000000e+00 304 257 4.1710395000000e+01 306 257 -4.7620287000000e+00 1362 257 -1.4261365000000e+00 210 258 -7.6355288000000e+00 256 258 -6.3061041000000e+02 257 258 1.1299210000000e+02 258 258 2.6180753000000e+01 259 258 2.0381001000000e+00 260 258 -3.3018964000000e-01 261 258 -8.0641672000000e+00 304 258 7.0507252000000e+01 305 258 -1.1422778000000e+01 306 258 -8.0497333000000e+00 1362 258 -2.4107412000000e+00 211 259 -2.5679995000000e-01 213 259 -2.6800805000000e-03 256 259 -2.3898319000000e-03 258 259 -2.4941367000000e-05 259 259 5.7512775000000e+02 261 259 4.1066606000000e-03 262 259 -8.7123907000000e-02 264 259 -2.5087633000000e-05 307 259 -2.4811441000000e-01 309 259 -2.5032665000000e-05 1363 259 -5.1195054000000e-03 1365 259 -7.6616229000000e-06 213 260 -4.4945266000000e+00 258 260 -4.7705675000000e+00 259 260 -3.7403651000000e+02 260 260 -1.0925131000000e+02 261 260 2.0220255000000e+01 262 260 1.4464879000000e+00 264 260 -4.7706176000000e+00 307 260 4.2446987000000e+01 309 260 -4.7606802000000e+00 1365 260 -1.4116883000000e+00 213 261 -7.5975428000000e+00 258 261 -8.0641672000000e+00 259 261 -6.3227092000000e+02 260 261 9.8012889000000e+01 261 261 3.4180302000000e+01 262 261 2.4451416000000e+00 263 261 -3.9613289000000e-01 264 261 -8.0642470000000e+00 307 261 7.1752342000000e+01 308 261 -1.1624465000000e+01 309 261 -8.0474488000000e+00 1365 261 -2.3863159000000e+00 214 262 -3.0342498000000e-01 216 262 -3.1666804000000e-03 259 262 -2.4038469000000e-03 261 262 -2.5087633000000e-05 262 262 5.7515641000000e+02 264 262 5.2770057000000e-03 265 262 -7.9344378000000e-03 267 262 -2.5382928000000e-05 310 262 -2.4183986000000e-01 312 262 -2.5312166000000e-05 1366 262 -6.6178409000000e-02 1368 262 -6.9066782000000e-04 216 263 -4.4472212000000e+00 261 263 -4.7706176000000e+00 262 263 -3.7464345000000e+02 263 263 -1.0924511000000e+02 264 263 2.0149213000000e+01 265 263 3.9033555000000e-01 267 263 -4.7709720000000e+00 310 263 4.4102251000000e+01 312 263 -4.7581730000000e+00 1368 263 -1.3900576000000e+00 216 264 -7.5175827000000e+00 261 264 -8.0642470000000e+00 262 264 -6.3329729000000e+02 263 264 9.8193118000000e+01 264 264 3.4060225000000e+01 265 264 6.5982322000000e-01 266 264 -1.0689604000000e-01 267 264 -8.0648511000000e+00 310 264 7.4550445000000e+01 311 264 -1.2077701000000e+01 312 264 -8.0432156000000e+00 1368 264 -2.3497534000000e+00 217 265 -3.2667434000000e-01 219 265 -3.4093212000000e-03 262 265 -2.4321414000000e-03 264 265 -2.5382928000000e-05 265 265 5.7529329000000e+02 267 265 6.3019063000000e-03 268 265 -4.7552521000000e-02 270 265 -4.9627962000000e-04 313 265 -3.0674308000000e-01 315 265 -2.5241294000000e-04 1369 265 -7.3306335000000e-02 1371 265 -7.6505808000000e-04 219 266 -4.4233411000000e+00 264 266 -4.7709720000000e+00 265 266 -3.7636258000000e+02 266 266 -1.0907205000000e+02 267 266 2.0050582000000e+01 270 266 -4.7241863000000e+00 313 266 4.6208999000000e+01 315 266 -4.7371923000000e+00 1371 266 -1.3827379000000e+00 219 267 -7.4772107000000e+00 264 267 -8.0648511000000e+00 265 267 -6.3620291000000e+02 266 267 9.8474973000000e+01 267 267 3.3893491000000e+01 270 267 -7.9857645000000e+00 313 267 7.8111643000000e+01 314 267 -1.2595337000000e+01 315 267 -8.0077441000000e+00 1371 267 -2.3373788000000e+00 220 268 -3.2665177000000e-01 222 268 -3.4090856000000e-03 265 268 -6.3767677000000e-02 267 268 -4.9627962000000e-04 268 268 5.7538353000000e+02 270 268 6.6288635000000e-03 271 268 -2.4141033000000e-03 273 268 -2.5194674000000e-05 316 268 -3.7051672000000e-01 318 268 -4.9508786000000e-04 1372 268 -8.0441990000000e-02 1374 268 -8.3952900000000e-04 222 269 -4.4248029000000e+00 265 269 1.5957294000000e+00 267 269 -4.7241863000000e+00 268 269 -3.7965795000000e+02 269 269 -1.0888646000000e+02 270 269 2.0020417000000e+01 273 269 -4.7703035000000e+00 316 269 4.7904941000000e+01 318 269 -4.7132973000000e+00 1374 269 -1.3756968000000e+00 222 270 -7.4796868000000e+00 265 270 2.6974210000000e+00 266 270 -4.3276435000000e-01 267 270 -7.9857645000000e+00 268 270 -6.4177380000000e+02 269 270 9.9168081000000e+01 270 270 3.3842508000000e+01 273 270 -8.0637164000000e+00 316 270 8.0978512000000e+01 317 270 -1.2991897000000e+01 318 270 -7.9673577000000e+00 1374 270 -2.3254778000000e+00 223 271 -2.6869291000000e-01 225 271 -2.8042008000000e-03 268 271 -6.3581913000000e-02 270 271 -2.5194674000000e-05 271 271 5.7525873000000e+02 273 271 4.8382758000000e-03 274 271 -2.3029972000000e-03 276 271 -2.4035121000000e-05 319 271 -3.3088133000000e-01 321 271 -2.5145119000000e-05 1375 271 -5.9007951000000e-02 1377 271 -6.1583367000000e-04 225 272 -4.3874214000000e+00 268 272 3.5641332000000e+00 270 272 -4.7703035000000e+00 271 272 -3.8200388000000e+02 272 272 -1.0924551000000e+02 273 272 1.9950620000000e+01 276 272 -4.6228863000000e+00 319 272 4.8289200000000e+01 321 272 -4.7614281000000e+00 1377 272 -1.3964088000000e+00 225 273 -7.4164918000000e+00 268 273 6.0248073000000e+00 269 273 -9.7606576000000e-01 270 273 -8.0637164000000e+00 271 273 -6.4573900000000e+02 272 273 1.0020851000000e+02 273 273 3.3724511000000e+01 276 273 -7.8145269000000e+00 319 273 8.1628018000000e+01 320 273 -1.3224376000000e+01 321 273 -8.0487133000000e+00 1377 273 -2.3604874000000e+00 226 274 -1.7997422000000e-01 228 274 -1.8782924000000e-03 271 274 -1.1448077000000e-01 273 274 -2.4035121000000e-05 274 274 5.4067833000000e+02 276 274 3.2197793000000e-03 277 274 -2.1259208000000e-03 279 274 -2.2187071000000e-05 322 274 -3.0833229000000e-01 324 274 -2.3990032000000e-05 1378 274 -1.3839797000000e-02 1380 274 -8.0577291000000e-06 228 275 -4.1932912000000e+00 271 275 5.7457621000000e+00 273 275 -4.6228863000000e+00 274 275 -3.6306423000000e+02 275 275 -1.0269365000000e+02 276 275 1.9287736000000e+01 279 275 -4.3364913000000e+00 322 275 4.6980387000000e+01 324 275 -4.6146947000000e+00 1380 275 -1.5089297000000e+00 228 276 -7.0883394000000e+00 271 276 9.7126360000000e+00 272 276 -1.5735346000000e+00 273 276 -7.8145269000000e+00 274 276 -6.1372377000000e+02 275 276 9.5280061000000e+01 276 276 3.2603984000000e+01 279 276 -7.3304000000000e+00 322 276 7.9415645000000e+01 323 276 -1.2866050000000e+01 324 276 -7.8006799000000e+00 1380 276 -2.5506948000000e+00 229 277 -1.1666583000000e-01 231 277 -1.2175774000000e-03 274 277 -1.5370768000000e-01 276 277 -2.2187071000000e-05 277 277 5.0616727000000e+02 279 277 2.4728039000000e-03 280 277 -1.9243063000000e-03 282 277 -2.0082931000000e-05 325 277 -2.6547366000000e-01 327 277 -2.1915232000000e-05 1381 277 -4.5514360000000e-02 1383 277 -8.4730171000000e-06 231 278 -3.9198308000000e+00 274 278 7.8590684000000e+00 276 278 -4.3364913000000e+00 277 278 -3.4227959000000e+02 278 278 -9.6142388000000e+01 279 278 1.8194383000000e+01 282 278 -3.9985084000000e+00 325 278 4.3895681000000e+01 327 278 -4.2838474000000e+00 1383 278 -1.6449913000000e+00 231 279 -6.6260765000000e+00 274 279 1.3284960000000e+01 275 279 -2.1523019000000e+00 276 279 -7.3304000000000e+00 277 279 -5.7858903000000e+02 278 279 8.9845061000000e+01 279 279 3.0755768000000e+01 282 279 -6.7590784000000e+00 325 279 7.4201208000000e+01 326 279 -1.2021368000000e+01 327 279 -7.2414106000000e+00 1383 279 -2.7806916000000e+00 232 280 -2.7786973000000e-02 234 280 -2.8999742000000e-04 277 280 -1.4812760000000e-01 279 280 -2.0082931000000e-05 280 280 4.6009423000000e+02 282 280 1.4319779000000e-03 283 280 -1.7349305000000e-03 285 280 -1.8106519000000e-05 328 280 -2.3696305000000e-01 330 280 -1.9590447000000e-05 1384 280 -5.8360867000000e-02 1386 280 -9.1538248000000e-06 234 281 -3.6819706000000e+00 277 281 9.5606028000000e+00 279 281 -3.9985084000000e+00 280 281 -3.1505563000000e+02 281 281 -8.7403089000000e+01 282 281 1.7081396000000e+01 285 281 -3.6678429000000e+00 328 281 4.1382436000000e+01 330 281 -3.9008968000000e+00 1386 281 -1.8224369000000e+00 234 282 -6.2240031000000e+00 277 282 1.6161243000000e+01 278 282 -2.6183124000000e+00 279 282 -6.7590784000000e+00 280 282 -5.3257003000000e+02 281 282 8.2741962000000e+01 282 282 2.8874387000000e+01 285 282 -6.2001176000000e+00 328 282 6.9952869000000e+01 329 282 -1.1333192000000e+01 330 282 -6.5940759000000e+00 1386 282 -3.0806474000000e+00 235 283 -1.5968212000000e-03 237 283 -1.6665148000000e-05 280 283 -1.6533186000000e-01 282 283 -1.8106519000000e-05 283 283 4.2564353000000e+02 285 283 1.0727203000000e-03 286 283 -1.5518553000000e-03 288 283 -1.6195864000000e-05 331 283 -2.6510563000000e-01 333 283 -1.7618593000000e-05 1387 283 -5.9577134000000e-02 1389 283 -9.7283995000000e-06 237 284 -3.4229940000000e+00 280 284 1.1886166000000e+01 282 284 -3.6678429000000e+00 283 284 -2.9901873000000e+02 284 284 -8.0847251000000e+01 285 284 1.6020787000000e+01 288 284 -3.3809302000000e+00 331 284 4.2827330000000e+01 333 284 -3.5694188000000e+00 1389 284 -1.9705921000000e+00 237 285 -5.7862261000000e+00 280 285 2.0092362000000e+01 281 285 -3.2552296000000e+00 282 285 -6.2001176000000e+00 283 285 -5.0546093000000e+02 284 285 7.8617985000000e+01 285 285 2.7081526000000e+01 288 285 -5.7151243000000e+00 331 285 7.2395271000000e+01 332 285 -1.1728997000000e+01 333 285 -6.0337414000000e+00 1389 285 -3.3310866000000e+00 238 286 -1.4489610000000e-03 240 286 -1.5122013000000e-05 283 286 -2.6775677000000e-01 285 286 -1.6195864000000e-05 286 286 3.9101108000000e+02 288 286 9.5535783000000e-04 1390 286 -5.9779534000000e-02 1392 286 -1.0278589000000e-05 240 287 -3.1862433000000e+00 283 287 2.0669061000000e+01 285 287 -3.3809302000000e+00 286 287 -2.4516982000000e+02 287 287 -7.4289358000000e+01 288 287 8.7210274000000e+00 1392 287 -2.1455762000000e+00 240 288 -5.3860258000000e+00 283 288 3.4938980000000e+01 284 288 -5.6606570000000e+00 285 288 -5.7151243000000e+00 286 288 -4.1443506000000e+02 287 288 6.4143619000000e+01 288 288 1.4742025000000e+01 1392 288 -3.6268820000000e+00 289 289 1.0000000000000e+00 290 290 1.0000000000000e+00 291 291 1.0000000000000e+00 292 292 1.0000000000000e+00 293 293 1.0000000000000e+00 294 294 1.0000000000000e+00 295 295 1.0000000000000e+00 296 296 1.0000000000000e+00 297 297 1.0000000000000e+00 298 298 1.0000000000000e+00 299 299 1.0000000000000e+00 300 300 1.0000000000000e+00 301 301 1.0000000000000e+00 302 302 1.0000000000000e+00 303 303 1.0000000000000e+00 256 304 -2.3853116000000e-03 258 304 -2.4894191000000e-05 304 304 5.7485382000000e+02 306 304 1.4276539000000e-03 307 304 -6.9040852000000e-02 309 304 -2.5585438000000e-05 352 304 -2.3914903000000e-01 354 304 -2.5509959000000e-05 1408 304 -5.5206415000000e-02 1410 304 -7.8195004000000e-06 258 305 -4.7620287000000e+00 304 305 -3.7818800000000e+02 305 305 -1.0026451000000e+02 306 305 1.5762163000000e+01 307 305 1.9554283000000e+00 309 305 -4.7716102000000e+00 352 305 4.6140393000000e+01 354 305 -4.7580907000000e+00 1410 305 -1.4582423000000e+00 258 306 -8.0497333000000e+00 304 306 -6.3928900000000e+02 305 306 1.1431216000000e+02 306 306 2.6644360000000e+01 307 306 3.3054560000000e+00 308 306 -5.3550504000000e-01 309 306 -8.0659299000000e+00 352 306 7.7995721000000e+01 353 306 -1.2635806000000e+01 354 306 -8.0430765000000e+00 1410 306 -2.4650128000000e+00 259 307 -2.3985799000000e-03 261 307 -2.5032665000000e-05 304 307 -2.4515455000000e-03 306 307 -2.5585438000000e-05 307 307 5.7486458000000e+02 309 307 1.4534908000000e-03 310 307 -8.0982370000000e-02 312 307 -2.5634127000000e-05 355 307 -2.3200970000000e-01 357 307 -2.5550840000000e-05 1411 307 -5.5119630000000e-02 1413 307 -7.8381908000000e-06 261 308 -4.7606802000000e+00 306 308 -4.7716102000000e+00 307 308 -3.8094393000000e+02 308 308 -1.0928573000000e+02 309 308 2.0531953000000e+01 310 308 3.1282473000000e+00 312 308 -4.7717070000000e+00 355 308 4.7718748000000e+01 357 308 -4.7567900000000e+00 1413 308 -1.4589760000000e+00 261 309 -8.0474488000000e+00 306 309 -8.0659299000000e+00 307 309 -6.4394718000000e+02 308 309 9.9820041000000e+01 309 309 3.4707196000000e+01 310 309 5.2879856000000e+00 311 309 -8.5668723000000e-01 312 309 -8.0660879000000e+00 355 309 8.0663716000000e+01 356 309 -1.3068034000000e+01 357 309 -8.0408723000000e+00 1413 309 -2.4662515000000e+00 262 310 -2.4253612000000e-03 264 310 -2.5312166000000e-05 307 310 -2.4562108000000e-03 309 310 -2.5634127000000e-05 310 310 5.7484861000000e+02 312 310 1.4539954000000e-03 313 310 -5.1146276000000e-02 315 310 -2.5710072000000e-05 358 310 -2.4387167000000e-01 360 310 -2.5618235000000e-05 1414 310 -5.3671820000000e-02 1416 310 -7.8650378000000e-06 264 311 -4.7581730000000e+00 309 311 -4.7717070000000e+00 310 311 -3.8375362000000e+02 311 311 -1.0928258000000e+02 312 311 2.0527605000000e+01 313 311 2.4899798000000e+00 315 311 -4.7718289000000e+00 358 311 5.1162626000000e+01 360 311 -4.7553911000000e+00 1416 311 -1.4583174000000e+00 264 312 -8.0432156000000e+00 309 312 -8.0660879000000e+00 310 312 -6.4869713000000e+02 311 312 1.0059674000000e+02 312 312 3.4699859000000e+01 313 312 4.2090618000000e+00 314 312 -6.8189325000000e-01 315 312 -8.0662996000000e+00 358 312 8.6485303000000e+01 359 312 -1.4011138000000e+01 360 312 -8.0385130000000e+00 1416 312 -2.4651397000000e+00 265 313 -2.4185703000000e-02 267 313 -2.5241294000000e-04 310 313 -2.4634877000000e-03 312 313 -2.5710072000000e-05 313 313 5.7490045000000e+02 315 313 1.6813887000000e-03 316 313 -2.6877149000000e-02 318 313 -2.5804428000000e-05 361 313 -3.0468985000000e-01 363 313 -2.5711604000000e-05 1417 313 -4.6162916000000e-02 1419 313 -7.8893794000000e-06 267 314 -4.7371923000000e+00 312 314 -4.7718289000000e+00 313 314 -3.8505782000000e+02 314 314 -1.0928134000000e+02 315 314 2.0498379000000e+01 316 314 1.0447785000000e-01 318 314 -4.7717809000000e+00 361 314 5.4850702000000e+01 363 314 -4.7552271000000e+00 1419 314 -1.4501622000000e+00 267 315 -8.0077441000000e+00 312 315 -8.0662996000000e+00 313 315 -6.5090125000000e+02 314 315 1.0095682000000e+02 315 315 3.4650441000000e+01 316 315 1.7660924000000e-01 317 315 -2.8611716000000e-02 318 315 -8.0662125000000e+00 361 315 9.2719559000000e+01 362 315 -1.5021105000000e+01 363 315 -8.0382301000000e+00 1419 315 -2.4513525000000e+00 268 316 -4.7438329000000e-02 270 316 -4.9508786000000e-04 313 316 -2.4725287000000e-03 315 316 -2.5804428000000e-05 316 316 5.7491829000000e+02 318 316 1.9241236000000e-03 319 316 -2.4623592000000e-03 321 316 -2.5698295000000e-05 364 316 -3.2828139000000e-01 366 316 -2.5763098000000e-05 1420 316 -3.9116784000000e-02 1422 316 -7.9051779000000e-06 270 317 -4.7132973000000e+00 315 317 -4.7717809000000e+00 316 317 -3.8727296000000e+02 317 317 -1.0025400000000e+02 318 317 2.0466586000000e+01 321 317 -4.7712987000000e+00 364 317 5.7167553000000e+01 366 317 -4.7551848000000e+00 1422 317 -1.4428372000000e+00 270 318 -7.9673577000000e+00 315 318 -8.0662125000000e+00 316 318 -6.5464621000000e+02 317 318 1.1682452000000e+02 318 318 3.4596706000000e+01 321 318 -8.0653990000000e+00 364 318 9.6636031000000e+01 365 318 -1.5655569000000e+01 366 318 -8.0381643000000e+00 1422 318 -2.4389721000000e+00 271 319 -2.4093550000000e-03 273 319 -2.5145119000000e-05 316 319 -5.8354240000000e-02 318 319 -2.5698295000000e-05 319 319 5.7493642000000e+02 321 319 1.4537194000000e-03 322 319 -2.4482718000000e-03 324 319 -2.5551272000000e-05 367 319 -3.2882232000000e-01 369 319 -2.5608416000000e-05 1423 319 -4.6988259000000e-02 1425 319 -7.8592885000000e-06 273 320 -4.7614281000000e+00 316 320 3.1989950000000e+00 318 320 -4.7712987000000e+00 319 320 -3.9052649000000e+02 320 320 -1.0928015000000e+02 321 320 2.0521060000000e+01 324 320 -4.7704788000000e+00 367 320 5.7223219000000e+01 369 320 -4.7552192000000e+00 1425 320 -1.4504481000000e+00 273 321 -8.0487133000000e+00 316 321 5.4075782000000e+00 317 321 -8.7606062000000e-01 318 321 -8.0653990000000e+00 319 321 -6.6014561000000e+02 320 321 1.0245752000000e+02 321 321 3.4688785000000e+01 324 321 -8.0640173000000e+00 367 321 9.6730076000000e+01 368 321 -1.5670861000000e+01 369 321 -8.0382181000000e+00 1425 321 -2.4518359000000e+00 274 322 -2.2986769000000e-03 276 322 -2.3990032000000e-05 319 322 -1.3090690000000e-01 321 322 -2.5551272000000e-05 322 322 5.7501910000000e+02 324 322 1.4509787000000e-03 325 322 -2.3278464000000e-03 327 322 -2.4294459000000e-05 370 322 -3.3392357000000e-01 372 322 -2.5481281000000e-05 1426 322 -5.6475911000000e-02 1428 322 -7.8137698000000e-06 276 323 -4.6146947000000e+00 319 323 5.7425527000000e+00 321 323 -4.7704788000000e+00 322 323 -3.9129491000000e+02 323 323 -1.0928448000000e+02 324 323 2.0186025000000e+01 327 323 -4.5718624000000e+00 370 323 5.5453699000000e+01 372 323 -4.7580243000000e+00 1428 323 -1.4587762000000e+00 276 324 -7.8006799000000e+00 319 324 9.7072109000000e+00 320 324 -1.5726313000000e+00 321 324 -8.0640173000000e+00 322 324 -6.6144491000000e+02 323 324 1.0265780000000e+02 324 324 3.4122453000000e+01 327 324 -7.7282720000000e+00 370 324 9.3738933000000e+01 371 324 -1.5186317000000e+01 372 324 -8.0429643000000e+00 1428 324 -2.4659153000000e+00 277 325 -2.0998737000000e-03 279 325 -2.1915232000000e-05 322 325 -1.8420454000000e-01 324 325 -2.4294459000000e-05 325 325 5.2909333000000e+02 327 325 1.3365414000000e-03 328 325 -2.1140734000000e-03 330 325 -2.2063427000000e-05 373 325 -3.2053148000000e-01 375 325 -2.3521242000000e-05 1429 325 -5.7097011000000e-02 1431 325 -8.4205212000000e-06 279 326 -4.2838474000000e+00 322 326 7.9814062000000e+00 324 326 -4.5718624000000e+00 325 326 -3.6183494000000e+02 326 326 -1.0054776000000e+02 327 326 1.9068643000000e+01 330 326 -4.1902376000000e+00 373 326 5.0170634000000e+01 375 326 -4.4269149000000e+00 1431 326 -1.5845640000000e+00 279 327 -7.2414106000000e+00 322 327 1.3491762000000e+01 323 327 -2.1857632000000e+00 324 327 -7.7282720000000e+00 325 327 -6.1164545000000e+02 326 327 9.4936056000000e+01 327 327 3.2233618000000e+01 330 327 -7.0831776000000e+00 373 327 8.4808394000000e+01 374 327 -1.3739575000000e+01 375 327 -7.4832529000000e+00 1431 327 -2.6785451000000e+00 280 328 -1.8771175000000e-03 282 328 -1.9590447000000e-05 325 328 -1.6038550000000e-01 327 328 -2.2063427000000e-05 328 328 4.8305359000000e+02 330 328 1.2210278000000e-03 331 328 -1.9047534000000e-03 333 328 -1.9878868000000e-05 376 328 -2.6610429000000e-01 378 328 -2.1544321000000e-05 1432 328 -5.7996357000000e-02 1434 328 -9.1411352000000e-06 282 329 -3.9008968000000e+00 325 329 8.5022034000000e+00 327 329 -4.1902376000000e+00 328 329 -3.3090803000000e+02 329 329 -9.1807741000000e+01 330 329 1.7737475000000e+01 333 329 -3.8079455000000e+00 376 329 4.5134249000000e+01 378 329 -4.0921523000000e+00 1434 329 -1.7360007000000e+00 282 330 -6.5940759000000e+00 325 330 1.4372125000000e+01 326 330 -2.3283983000000e+00 327 330 -7.0831776000000e+00 328 330 -5.5936694000000e+02 329 330 8.6820392000000e+01 330 330 2.9983424000000e+01 333 330 -6.4369470000000e+00 376 330 7.6294935000000e+01 377 330 -1.2360385000000e+01 378 330 -6.9173742000000e+00 1434 330 -2.9345355000000e+00 283 331 -1.6881784000000e-03 285 331 -1.7618593000000e-05 328 331 -1.2017962000000e-01 330 331 -1.9878868000000e-05 331 331 4.3702283000000e+02 333 331 1.0881647000000e-03 379 331 -2.3734229000000e-01 381 331 -1.9354806000000e-05 1435 331 -5.8560585000000e-02 1437 331 -1.0017061000000e-05 285 332 -3.5694188000000e+00 328 332 7.0459977000000e+00 330 332 -3.8079455000000e+00 331 332 -2.9843639000000e+02 332 332 -8.3065671000000e+01 333 332 1.3013397000000e+01 379 332 4.0527498000000e+01 381 332 -3.7079928000000e+00 1437 332 -1.9187718000000e+00 285 333 -6.0337414000000e+00 328 333 1.1910547000000e+01 329 333 -1.9296126000000e+00 330 333 -6.4369470000000e+00 331 333 -5.0447656000000e+02 332 333 7.8286656000000e+01 333 333 2.1997831000000e+01 379 333 6.8507639000000e+01 380 333 -1.1098836000000e+01 381 333 -6.2679871000000e+00 1437 333 -3.2434895000000e+00 334 334 1.0000000000000e+00 335 335 1.0000000000000e+00 336 336 1.0000000000000e+00 337 337 1.0000000000000e+00 338 338 1.0000000000000e+00 339 339 1.0000000000000e+00 340 340 1.0000000000000e+00 341 341 1.0000000000000e+00 342 342 1.0000000000000e+00 343 343 1.0000000000000e+00 344 344 1.0000000000000e+00 345 345 1.0000000000000e+00 346 346 1.0000000000000e+00 347 347 1.0000000000000e+00 348 348 1.0000000000000e+00 349 349 1.0000000000000e+00 350 350 1.0000000000000e+00 351 351 1.0000000000000e+00 304 352 -2.4443132000000e-03 306 352 -2.5509959000000e-05 352 352 5.7478946000000e+02 354 352 1.4296456000000e-03 355 352 -6.2044278000000e-02 357 352 -2.6688160000000e-05 400 352 -2.2352072000000e-01 402 352 -2.5425414000000e-05 1456 352 -5.6169102000000e-02 1458 352 -8.1663047000000e-06 306 353 -4.7580907000000e+00 352 353 -3.8266089000000e+02 353 353 -1.0030582000000e+02 354 353 1.5551099000000e+01 355 353 3.5517256000000e+00 357 353 -4.7728386000000e+00 400 353 4.9071106000000e+01 402 353 -4.5475998000000e+00 1458 353 -1.4603618000000e+00 306 354 -8.0430765000000e+00 352 354 -6.4684997000000e+02 353 354 1.1543532000000e+02 354 354 2.6287578000000e+01 355 354 6.0038370000000e+00 356 354 -9.7263799000000e-01 357 354 -8.0680064000000e+00 400 354 8.2949797000000e+01 401 354 -1.3438094000000e+01 402 354 -7.6872627000000e+00 1458 354 -2.4685955000000e+00 307 355 -2.4482304000000e-03 309 355 -2.5550840000000e-05 352 355 -2.5572061000000e-03 354 355 -2.6688160000000e-05 355 355 5.7484386000000e+02 357 355 1.4571430000000e-03 358 355 -9.3051196000000e-02 360 355 -2.6770459000000e-05 403 355 -2.4476972000000e-01 405 355 -2.6083358000000e-05 1459 355 -5.5215162000000e-02 1461 355 -8.1907446000000e-06 309 356 -4.7567900000000e+00 354 356 -4.7728386000000e+00 355 356 -3.8785209000000e+02 356 356 -1.0932835000000e+02 357 356 2.0425388000000e+01 358 356 6.5986580000000e+00 360 356 -4.7726485000000e+00 403 356 5.1214427000000e+01 405 356 -4.6507363000000e+00 1461 356 -1.4601662000000e+00 309 357 -8.0408723000000e+00 354 357 -8.0680064000000e+00 355 357 -6.5562483000000e+02 356 357 1.0160568000000e+02 357 357 3.4527060000000e+01 358 357 1.1154366000000e+01 359 357 -1.8070354000000e+00 360 357 -8.0676805000000e+00 403 357 8.6572821000000e+01 404 357 -1.4025016000000e+01 405 357 -7.8616002000000e+00 1461 357 -2.4682635000000e+00 310 358 -2.4546880000000e-03 312 358 -2.5618235000000e-05 355 358 -2.5650918000000e-03 357 358 -2.6770459000000e-05 358 358 5.7493309000000e+02 360 358 1.4582277000000e-03 361 358 -1.1228963000000e-01 363 358 -2.6928272000000e-05 406 358 -3.1656758000000e-01 408 358 -2.6806025000000e-05 1462 358 -5.3682695000000e-02 1464 358 -8.2386264000000e-06 312 359 -4.7553911000000e+00 357 359 -4.7726485000000e+00 358 359 -3.9452018000000e+02 359 359 -1.0932875000000e+02 360 359 2.0524561000000e+01 361 359 6.1930383000000e+00 363 359 -4.7726177000000e+00 406 359 5.8288778000000e+01 408 359 -4.7516012000000e+00 1464 359 -1.4600938000000e+00 312 360 -8.0385130000000e+00 357 360 -8.0676805000000e+00 358 360 -6.6689692000000e+02 359 360 1.0343025000000e+02 360 360 3.4694713000000e+01 361 360 1.0468712000000e+01 362 360 -1.6959515000000e+00 363 360 -8.0676330000000e+00 406 360 9.8531351000000e+01 407 360 -1.5962269000000e+01 408 360 -8.0321067000000e+00 1464 360 -2.4681426000000e+00 313 361 -2.4636345000000e-03 315 361 -2.5711604000000e-05 358 361 -2.5802131000000e-03 360 361 -2.6928272000000e-05 361 361 5.7492132000000e+02 363 361 1.4588529000000e-03 364 361 -5.0668791000000e-02 366 361 -2.7077998000000e-05 409 361 -3.6617143000000e-01 411 361 -2.6972819000000e-05 1465 361 -5.2128653000000e-02 1467 361 -8.2886627000000e-06 315 362 -4.7552271000000e+00 360 362 -4.7726177000000e+00 361 362 -3.9794035000000e+02 362 362 -1.0932680000000e+02 363 362 2.0528588000000e+01 364 362 2.4299921000000e+00 366 362 -4.7727468000000e+00 409 362 6.5469467000000e+01 411 362 -4.7549139000000e+00 1467 362 -1.4608747000000e+00 315 363 -8.0382301000000e+00 360 363 -8.0676330000000e+00 361 363 -6.7267788000000e+02 362 363 1.0437131000000e+02 363 363 3.4701505000000e+01 364 363 4.1076556000000e+00 365 363 -6.6544656000000e-01 366 363 -8.0678453000000e+00 409 363 1.1066951000000e+02 410 363 -1.7928632000000e+01 411 363 -8.0377006000000e+00 1467 363 -2.4694602000000e+00 316 364 -2.4685685000000e-03 318 364 -2.5763098000000e-05 361 364 -2.5945596000000e-03 363 364 -2.7077998000000e-05 364 364 5.7491705000000e+02 366 364 1.4591127000000e-03 367 364 -2.5925027000000e-03 369 364 -2.7056531000000e-05 412 364 -4.0929373000000e-01 414 364 -2.7031042000000e-05 1468 364 -5.1377246000000e-02 1470 364 -8.3065546000000e-06 318 365 -4.7551848000000e+00 363 365 -4.7727468000000e+00 364 365 -3.9975022000000e+02 365 365 -1.0932556000000e+02 366 365 2.0528470000000e+01 369 365 -4.7725660000000e+00 412 365 6.9707805000000e+01 414 365 -4.7549027000000e+00 1470 365 -1.4608630000000e+00 318 366 -8.0381643000000e+00 363 366 -8.0678453000000e+00 364 366 -6.7573777000000e+02 365 366 1.0486962000000e+02 366 366 3.4701317000000e+01 369 366 -8.0675420000000e+00 412 366 1.1783407000000e+02 413 366 -1.9089266000000e+01 414 366 -8.0376875000000e+00 1470 366 -2.4694428000000e+00 319 367 -2.4537472000000e-03 321 367 -2.5608416000000e-05 364 367 -5.7927708000000e-02 366 367 -2.7056531000000e-05 367 367 5.7495935000000e+02 369 367 1.4586587000000e-03 370 367 -2.5753546000000e-03 372 367 -2.6877566000000e-05 415 367 -3.9677260000000e-01 417 367 -2.6960165000000e-05 1471 367 -5.1990619000000e-02 1473 367 -8.2830240000000e-06 321 368 -4.7552192000000e+00 364 368 3.1437670000000e+00 366 368 -4.7725660000000e+00 367 368 -4.0167152000000e+02 368 368 -1.0932652000000e+02 369 368 2.0529394000000e+01 372 368 -4.7721327000000e+00 415 368 6.8486522000000e+01 417 368 -4.7562860000000e+00 1473 368 -1.4609828000000e+00 321 369 -8.0382181000000e+00 364 369 5.3142214000000e+00 365 369 -8.6091209000000e-01 366 369 -8.0675420000000e+00 367 369 -6.7898527000000e+02 368 369 1.0539374000000e+02 369 369 3.4702875000000e+01 372 369 -8.0668130000000e+00 415 369 1.1576957000000e+02 416 369 -1.8754848000000e+01 417 369 -8.0400223000000e+00 1473 369 -2.4696437000000e+00 322 370 -2.4415654000000e-03 324 370 -2.5481281000000e-05 367 370 -1.2610705000000e-01 369 370 -2.6877566000000e-05 370 370 5.7500724000000e+02 372 370 1.4570466000000e-03 373 370 -2.4732826000000e-03 375 370 -2.5812297000000e-05 418 370 -3.7633253000000e-01 420 370 -2.6785208000000e-05 1474 370 -5.3475055000000e-02 1476 370 -8.2253849000000e-06 324 371 -4.7580243000000e+00 367 371 7.5519975000000e+00 369 371 -4.7721327000000e+00 370 371 -4.0178322000000e+02 371 371 -1.0932794000000e+02 372 371 2.0383029000000e+01 375 371 -4.6239093000000e+00 418 371 6.4191733000000e+01 420 371 -4.7564077000000e+00 1476 371 -1.4603466000000e+00 324 372 -8.0429643000000e+00 367 372 1.2765896000000e+01 368 372 -2.0681019000000e+00 369 372 -8.0668130000000e+00 370 372 -6.7917436000000e+02 371 372 1.0542131000000e+02 372 372 3.4455466000000e+01 375 372 -7.8162509000000e+00 418 372 1.0850970000000e+02 419 372 -1.7578799000000e+01 420 372 -8.0402315000000e+00 1476 372 -2.4685699000000e+00 325 373 -2.2537584000000e-03 327 373 -2.3521242000000e-05 370 373 -1.7606838000000e-01 372 373 -2.5812297000000e-05 373 373 5.4055330000000e+02 375 373 1.3706714000000e-03 376 373 -2.2970968000000e-03 378 373 -2.3973542000000e-05 421 373 -3.4175937000000e-01 423 373 -2.5475303000000e-05 1477 373 -5.4844342000000e-02 1479 373 -8.6688503000000e-06 327 374 -4.4269149000000e+00 370 374 9.5580479000000e+00 372 374 -4.6239093000000e+00 373 374 -3.7674337000000e+02 374 374 -1.0277157000000e+02 375 374 1.9517038000000e+01 378 374 -4.3377454000000e+00 421 374 5.6952369000000e+01 423 374 -4.5641563000000e+00 1479 374 -1.5528349000000e+00 327 375 -7.4832529000000e+00 370 375 1.6156913000000e+01 371 375 -2.6174681000000e+00 372 375 -7.8162509000000e+00 373 375 -6.3684655000000e+02 374 375 9.8833318000000e+01 375 375 3.2991584000000e+01 378 375 -7.3325248000000e+00 421 375 9.6272217000000e+01 422 375 -1.5596386000000e+01 423 375 -7.7152444000000e+00 1479 375 -2.6249103000000e+00 328 376 -2.0643337000000e-03 330 376 -2.1544321000000e-05 373 376 -1.9807344000000e-01 375 376 -2.3973542000000e-05 376 376 5.0605598000000e+02 378 376 1.2828126000000e-03 379 376 -2.1007017000000e-03 381 376 -2.1923874000000e-05 424 376 -2.9231577000000e-01 426 376 -2.3634552000000e-05 1480 376 -5.6318974000000e-02 1482 376 -9.1602712000000e-06 330 377 -4.0921523000000e+00 373 377 1.0116997000000e+01 375 377 -4.3377454000000e+00 376 377 -3.4911006000000e+02 377 377 -9.6216272000000e+01 378 377 1.8374990000000e+01 381 377 -4.0000020000000e+00 424 377 4.8568136000000e+01 426 377 -4.2769539000000e+00 1482 377 -1.6573901000000e+00 330 378 -6.9173742000000e+00 373 378 1.7101772000000e+01 374 378 -2.7705515000000e+00 375 378 -7.3325248000000e+00 376 378 -5.9013565000000e+02 377 378 9.1532256000000e+01 378 378 3.1061078000000e+01 381 378 -6.7615985000000e+00 424 378 8.2099576000000e+01 425 378 -1.3300440000000e+01 426 378 -7.2297629000000e+00 1482 378 -2.8016522000000e+00 331 379 -1.8545388000000e-03 333 379 -1.9354806000000e-05 376 379 -1.3037112000000e-01 378 379 -2.1923874000000e-05 379 379 4.5988358000000e+02 381 379 1.1474481000000e-03 427 379 -1.4544903000000e-01 429 379 -2.1098457000000e-05 1483 379 -5.7318543000000e-02 1485 379 -1.0010604000000e-05 333 380 -3.7079928000000e+00 376 380 7.7991083000000e+00 378 380 -4.0000020000000e+00 379 380 -3.0975874000000e+02 380 380 -8.7470802000000e+01 381 380 1.3394024000000e+01 427 380 3.7938706000000e+01 429 380 -3.8499013000000e+00 1485 380 -1.8263584000000e+00 333 381 -6.2679871000000e+00 376 381 1.3183603000000e+01 377 381 -2.1358043000000e+00 378 381 -6.7615985000000e+00 379 381 -5.2361580000000e+02 380 381 8.1123098000000e+01 381 381 2.2641243000000e+01 427 381 6.4131542000000e+01 428 381 -1.0389604000000e+01 429 381 -6.5078683000000e+00 1485 381 -3.0872741000000e+00 382 382 1.0000000000000e+00 383 383 1.0000000000000e+00 384 384 1.0000000000000e+00 385 385 1.0000000000000e+00 386 386 1.0000000000000e+00 387 387 1.0000000000000e+00 388 388 1.0000000000000e+00 389 389 1.0000000000000e+00 390 390 1.0000000000000e+00 391 391 1.0000000000000e+00 392 392 1.0000000000000e+00 393 393 1.0000000000000e+00 394 394 1.0000000000000e+00 395 395 1.0000000000000e+00 396 396 1.0000000000000e+00 397 397 5.0551705000000e+02 399 397 1.2406478000000e-03 400 397 -2.4057914000000e-03 402 397 -2.5107928000000e-05 445 397 -2.2066738000000e-03 447 397 -2.3029846000000e-05 1501 397 -5.7686407000000e-02 1503 397 -9.9051999000000e-06 397 398 -3.1019601000000e+02 398 398 -9.6262683000000e+01 399 398 9.7862578000000e+00 402 398 -4.2940391000000e+00 445 398 1.9835020000000e+01 447 398 -3.8097221000000e+00 1503 398 -1.6717298000000e+00 397 399 -5.2435500000000e+02 398 399 8.0758997000000e+01 399 399 1.6542684000000e+01 402 399 -7.2586437000000e+00 445 399 3.3529096000000e+01 446 399 -5.4316301000000e+00 447 399 -6.4399502000000e+00 1503 399 -2.8258900000000e+00 352 400 -2.4362123000000e-03 354 400 -2.5425414000000e-05 397 400 -7.4876051000000e-02 399 400 -2.5107928000000e-05 400 400 5.2865880000000e+02 402 400 1.3461324000000e-03 403 400 -7.3997074000000e-02 405 400 -2.6227671000000e-05 448 400 -8.4434598000000e-03 450 400 -2.3686270000000e-05 1504 400 -5.6046068000000e-02 1506 400 -9.3289205000000e-06 354 401 -4.5475998000000e+00 397 401 1.3837884000000e+01 399 401 -4.2940391000000e+00 400 401 -3.5889487000000e+02 401 401 -1.0062627000000e+02 402 401 1.8984973000000e+01 403 401 4.3310283000000e+00 405 401 -4.4853735000000e+00 448 401 3.7150315000000e+01 450 401 -4.0513848000000e+00 1506 401 -1.5953249000000e+00 354 402 -7.6872627000000e+00 397 402 2.3391558000000e+01 398 402 -3.7894005000000e+00 399 402 -7.2586437000000e+00 400 402 -6.0667588000000e+02 401 402 9.3934360000000e+01 402 402 3.2092198000000e+01 403 402 7.3211702000000e+00 404 402 -1.1860196000000e+00 405 402 -7.5820754000000e+00 448 402 6.2798893000000e+01 449 402 -1.0173335000000e+01 450 402 -6.8484609000000e+00 1506 402 -2.6967372000000e+00 355 403 -2.4992552000000e-03 357 403 -2.6083358000000e-05 400 403 -2.5130830000000e-03 402 403 -2.6227671000000e-05 403 403 5.5177232000000e+02 405 403 1.4044010000000e-03 406 403 -1.5668612000000e-01 408 403 -2.7455381000000e-05 451 403 -1.3782599000000e-01 453 403 -2.5552152000000e-05 1507 403 -5.3265675000000e-02 1509 403 -8.9667033000000e-06 357 404 -4.6507363000000e+00 402 404 -4.4853735000000e+00 403 404 -3.7906662000000e+02 404 404 -1.0500044000000e+02 405 404 1.9704360000000e+01 406 404 1.2333979000000e+01 408 404 -4.6764159000000e+00 451 404 4.9956892000000e+01 453 404 -4.3529070000000e+00 1509 404 -1.5271880000000e+00 357 405 -7.8616002000000e+00 402 405 -7.5820754000000e+00 403 405 -6.4077381000000e+02 404 405 9.9271279000000e+01 405 405 3.3308234000000e+01 406 405 2.0849344000000e+01 407 405 -3.3775593000000e+00 408 405 -7.9050080000000e+00 451 405 8.4447076000000e+01 452 405 -1.3680288000000e+01 453 405 -7.3581490000000e+00 1509 405 -2.5815568000000e+00 358 406 -2.5684997000000e-03 360 406 -2.6806025000000e-05 403 406 -2.6307197000000e-03 405 406 -2.7455381000000e-05 406 406 5.7492296000000e+02 408 406 1.4624084000000e-03 409 406 -1.6198256000000e-01 411 406 -2.8322849000000e-05 454 406 -3.1386583000000e-01 456 406 -2.7259136000000e-05 1510 406 -4.8974647000000e-02 1512 406 -8.6838251000000e-06 360 407 -4.7516012000000e+00 405 407 -4.6764159000000e+00 406 407 -4.0792812000000e+02 407 407 -1.0937761000000e+02 408 407 2.0272988000000e+01 409 407 1.3362148000000e+01 411 407 -4.7738776000000e+00 454 407 6.4594518000000e+01 456 407 -4.5952814000000e+00 1512 407 -1.4635822000000e+00 360 408 -8.0321067000000e+00 405 408 -7.9050080000000e+00 406 408 -6.8956168000000e+02 407 408 1.0697965000000e+02 408 408 3.4269454000000e+01 409 408 2.2587375000000e+01 410 408 -3.6590933000000e+00 411 408 -8.0697626000000e+00 454 408 1.0919057000000e+02 455 408 -1.7688576000000e+01 456 408 -7.7678636000000e+00 1512 408 -2.4740393000000e+00 361 409 -2.5844816000000e-03 363 409 -2.6972819000000e-05 406 409 -2.7138387000000e-03 408 409 -2.8322849000000e-05 409 409 5.7507018000000e+02 411 409 1.4650380000000e-03 412 409 -9.4098850000000e-02 414 409 -2.8635332000000e-05 457 409 -5.3819792000000e-01 459 409 -2.8456061000000e-05 1513 409 -4.3304230000000e-02 1515 409 -8.7599193000000e-06 363 410 -4.7549139000000e+00 408 410 -4.7738776000000e+00 409 410 -4.1669717000000e+02 410 410 -1.0938061000000e+02 411 410 2.0519955000000e+01 412 410 6.6853787000000e+00 414 410 -4.7738909000000e+00 457 410 8.0044732000000e+01 459 410 -4.7447320000000e+00 1515 410 -1.4603090000000e+00 363 411 -8.0377006000000e+00 408 411 -8.0697626000000e+00 409 411 -7.0438450000000e+02 410 411 1.0937287000000e+02 411 411 3.4686913000000e+01 412 411 1.1300958000000e+01 413 411 -1.8307135000000e+00 414 411 -8.0697798000000e+00 457 411 1.3530754000000e+02 458 411 -2.1919324000000e+01 459 411 -8.0204896000000e+00 1515 411 -2.4685050000000e+00 364 412 -2.5900604000000e-03 366 412 -2.7031042000000e-05 409 412 -2.7437802000000e-03 411 412 -2.8635332000000e-05 412 412 5.7506595000000e+02 414 412 1.4657043000000e-03 415 412 -2.7497649000000e-03 417 412 -2.8697790000000e-05 460 412 -6.2907866000000e-01 462 412 -2.8632140000000e-05 1516 412 -3.9838055000000e-02 1518 412 -8.8100746000000e-06 366 413 -4.7549027000000e+00 411 413 -4.7738909000000e+00 412 413 -4.1895970000000e+02 413 413 -1.0938104000000e+02 414 413 2.0522181000000e+01 417 413 -4.7738956000000e+00 460 413 8.8993349000000e+01 462 413 -4.7469534000000e+00 1518 413 -1.4603067000000e+00 366 414 -8.0376875000000e+00 411 414 -8.0697798000000e+00 412 414 -7.0820948000000e+02 413 414 1.0999085000000e+02 414 414 3.4690686000000e+01 417 414 -8.0697896000000e+00 460 414 1.5043436000000e+02 461 414 -2.4369717000000e+01 462 414 -8.0242501000000e+00 1518 414 -2.4685025000000e+00 367 415 -2.5832691000000e-03 369 415 -2.6960165000000e-05 412 415 -7.0760107000000e-02 414 415 -2.8697790000000e-05 415 415 5.7510738000000e+02 417 415 1.4652996000000e-03 418 415 -2.7223071000000e-03 420 415 -2.8411228000000e-05 463 415 -6.0098619000000e-01 465 415 -2.8563549000000e-05 1519 415 -4.1964468000000e-02 1521 415 -8.7739954000000e-06 369 416 -4.7562860000000e+00 412 416 4.3901562000000e+00 414 416 -4.7738956000000e+00 415 416 -4.1833130000000e+02 416 416 -1.0938150000000e+02 417 416 2.0527906000000e+01 420 416 -4.7737187000000e+00 463 416 8.3975321000000e+01 465 416 -4.7522972000000e+00 1521 416 -1.4594767000000e+00 369 417 -8.0400223000000e+00 412 417 7.4211168000000e+00 413 417 -1.2021920000000e+00 414 417 -8.0697896000000e+00 415 417 -7.0714692000000e+02 416 417 1.0981801000000e+02 417 417 3.4700360000000e+01 420 417 -8.0694940000000e+00 463 417 1.4195182000000e+02 464 417 -2.2995641000000e+01 465 417 -8.0332795000000e+00 1521 417 -2.4670980000000e+00 370 418 -2.5665051000000e-03 372 418 -2.6785208000000e-05 415 418 -1.4676595000000e-01 417 418 -2.8411228000000e-05 418 418 5.7507029000000e+02 420 418 1.4638510000000e-03 421 418 -2.6614878000000e-03 423 418 -2.7776491000000e-05 466 418 -4.8044860000000e-01 468 418 -2.8301956000000e-05 1522 418 -4.6530041000000e-02 1524 418 -8.6924355000000e-06 372 419 -4.7564077000000e+00 415 419 1.1865530000000e+01 417 419 -4.7737187000000e+00 418 419 -4.1626645000000e+02 419 419 -1.0937908000000e+02 420 419 2.0483830000000e+01 423 419 -4.7250120000000e+00 466 419 7.4431540000000e+01 468 419 -4.7560321000000e+00 1524 419 -1.4604292000000e+00 372 420 -8.0402315000000e+00 415 420 2.0057491000000e+01 416 420 -3.2492529000000e+00 417 420 -8.0694940000000e+00 418 420 -7.0365680000000e+02 419 420 1.0925919000000e+02 420 420 3.4625861000000e+01 423 420 -7.9871544000000e+00 466 420 1.2581907000000e+02 467 420 -2.0382310000000e+01 468 420 -8.0395966000000e+00 1524 420 -2.4687096000000e+00 373 421 -2.4409926000000e-03 375 421 -2.5475303000000e-05 418 421 -2.0002262000000e-01 420 421 -2.7776491000000e-05 421 421 5.6352835000000e+02 423 421 1.4329259000000e-03 424 421 -2.5152802000000e-03 426 421 -2.6250602000000e-05 469 421 -3.6799836000000e-01 471 421 -2.7663830000000e-05 1525 421 -5.0662846000000e-02 1527 421 -8.7673732000000e-06 375 422 -4.5641563000000e+00 418 422 1.4573841000000e+01 420 422 -4.7250120000000e+00 421 422 -4.0302041000000e+02 422 422 -1.0719043000000e+02 423 422 2.0027838000000e+01 426 422 -4.5288581000000e+00 469 422 6.5074723000000e+01 471 422 -4.7065101000000e+00 1527 422 -1.4913157000000e+00 375 423 -7.7152444000000e+00 418 423 2.4635603000000e+01 419 423 -3.9909248000000e+00 420 423 -7.9871544000000e+00 421 423 -6.8126520000000e+02 422 423 1.0573024000000e+02 423 423 3.3855038000000e+01 426 423 -7.6555817000000e+00 469 423 1.1000223000000e+02 470 423 -1.7820172000000e+01 471 423 -7.9558789000000e+00 1527 423 -2.5209182000000e+00 376 424 -2.2646155000000e-03 378 424 -2.3634552000000e-05 421 424 -2.3641910000000e-01 423 424 -2.6250602000000e-05 424 424 5.2896125000000e+02 426 424 1.3447081000000e-03 427 424 -2.2650799000000e-03 429 424 -2.3639399000000e-05 472 424 -2.2590056000000e-01 474 424 -2.5613009000000e-05 1528 424 -5.3706823000000e-02 1530 424 -9.2257162000000e-06 378 425 -4.2769539000000e+00 421 425 1.5644070000000e+01 423 425 -4.5288581000000e+00 424 425 -3.7281321000000e+02 425 425 -1.0062862000000e+02 426 425 1.8965360000000e+01 429 425 -4.1372028000000e+00 472 425 5.3596444000000e+01 474 425 -4.4195152000000e+00 1530 425 -1.5915783000000e+00 378 426 -7.2297629000000e+00 421 426 2.6444736000000e+01 422 426 -4.2840328000000e+00 423 426 -7.6555817000000e+00 424 426 -6.3020345000000e+02 425 426 9.7740717000000e+01 426 426 3.2059040000000e+01 429 426 -6.9935225000000e+00 472 426 9.0599428000000e+01 473 426 -1.4677058000000e+01 474 426 -7.4707486000000e+00 1530 426 -2.6904039000000e+00 379 427 -2.0216120000000e-03 381 427 -2.1098457000000e-05 424 427 -2.6132781000000e-01 426 427 -2.3639399000000e-05 427 427 4.7136634000000e+02 429 427 1.1796732000000e-03 475 427 -5.1081988000000e-02 477 427 -2.2804627000000e-05 1531 427 -5.5373045000000e-02 1533 427 -1.0189061000000e-05 381 428 -3.8499013000000e+00 424 428 1.4276224000000e+01 426 428 -4.1372028000000e+00 427 428 -3.1413612000000e+02 428 428 -8.9695520000000e+01 429 428 1.3771905000000e+01 475 428 2.9290310000000e+01 477 428 -3.9916066000000e+00 1533 428 -1.7831636000000e+00 381 429 -6.5078683000000e+00 424 429 2.4132512000000e+01 425 429 -3.9094881000000e+00 426 429 -6.9935225000000e+00 427 429 -5.3101534000000e+02 428 429 8.2134742000000e+01 429 429 2.3280012000000e+01 475 429 4.9512306000000e+01 476 429 -8.0210370000000e+00 477 429 -6.7474068000000e+00 1533 429 -3.0142581000000e+00 430 430 1.0000000000000e+00 431 431 1.0000000000000e+00 432 432 1.0000000000000e+00 433 433 1.0000000000000e+00 434 434 1.0000000000000e+00 435 435 1.0000000000000e+00 436 436 1.0000000000000e+00 437 437 1.0000000000000e+00 438 438 1.0000000000000e+00 439 439 1.0000000000000e+00 440 440 1.0000000000000e+00 441 441 1.0000000000000e+00 442 442 1.0000000000000e+00 443 443 1.0000000000000e+00 444 444 1.0000000000000e+00 397 445 -1.8958112000000e-01 399 445 -2.3029846000000e-05 445 445 4.2537296000000e+02 447 445 1.0715340000000e-03 448 445 -1.2628141000000e-01 450 445 -2.2183240000000e-05 493 445 -1.9073349000000e-03 495 445 -1.9905810000000e-05 1549 445 -5.7003955000000e-02 1551 445 -1.1969802000000e-05 399 446 -3.8097221000000e+00 445 446 -2.6914069000000e+02 446 446 -8.0988821000000e+01 447 446 1.2675962000000e+01 448 446 2.7187583000000e+00 450 446 -3.6700656000000e+00 493 446 2.2310249000000e+01 495 446 -3.2068077000000e+00 1551 446 -1.9802948000000e+00 399 447 -6.4399502000000e+00 445 447 -4.5495508000000e+02 446 447 7.0082321000000e+01 447 447 2.1427431000000e+01 448 447 4.5957857000000e+00 449 447 -7.4449701000000e-01 450 447 -6.2038744000000e+00 493 447 3.7713218000000e+01 494 447 -6.1093750000000e+00 495 447 -5.4207838000000e+00 1551 447 -3.3474880000000e+00 400 448 -2.2695710000000e-03 402 448 -2.3686270000000e-05 445 448 -2.1255537000000e-03 447 448 -2.2183240000000e-05 448 448 4.5971170000000e+02 450 448 1.1786059000000e-03 451 448 -1.8440792000000e-01 453 448 -2.4261411000000e-05 496 448 -2.1320279000000e-03 498 448 -2.2250808000000e-05 1552 448 -5.4499852000000e-02 1554 448 -1.1137754000000e-05 402 449 -4.0513848000000e+00 447 449 -3.6700656000000e+00 448 449 -3.0965220000000e+02 449 449 -8.7547250000000e+01 450 449 1.7112696000000e+01 451 449 1.3093529000000e+01 453 449 -4.0014572000000e+00 496 449 3.2643080000000e+01 498 449 -3.5431100000000e+00 1554 449 -1.8368744000000e+00 402 450 -6.8484609000000e+00 447 450 -6.2038744000000e+00 448 450 -5.2343607000000e+02 449 450 8.0902187000000e+01 450 450 2.8927296000000e+01 451 450 2.2133302000000e+01 452 450 -3.5854881000000e+00 453 450 -6.7640633000000e+00 496 450 5.5179862000000e+01 497 450 -8.9388715000000e+00 498 450 -5.9892731000000e+00 1554 450 -3.1050525000000e+00 403 451 -2.4483561000000e-03 405 451 -2.5552152000000e-05 448 451 -2.3246798000000e-03 450 451 -2.4261411000000e-05 451 451 5.0591618000000e+02 453 451 1.2930679000000e-03 454 451 -3.0440354000000e-01 456 451 -2.6645486000000e-05 499 451 -1.4649951000000e-01 501 451 -2.3763460000000e-05 1555 451 -4.8561085000000e-02 1557 451 -1.0237645000000e-05 405 452 -4.3529070000000e+00 450 452 -4.0014572000000e+00 451 452 -3.6019235000000e+02 452 452 -9.6302513000000e+01 453 452 1.8242362000000e+01 454 452 2.2638721000000e+01 456 452 -4.3393966000000e+00 499 452 4.7247510000000e+01 501 452 -3.8706427000000e+00 1557 452 -1.6671745000000e+00 405 453 -7.3581490000000e+00 450 453 -6.7640633000000e+00 451 453 -6.0886882000000e+02 452 453 9.4350579000000e+01 453 453 3.0836875000000e+01 454 453 3.8268474000000e+01 455 453 -6.1992643000000e+00 456 453 -7.3353123000000e+00 499 453 7.9867150000000e+01 500 453 -1.2938001000000e+01 501 453 -6.5429310000000e+00 1557 453 -2.8181894000000e+00 406 454 -2.6119159000000e-03 408 454 -2.7259136000000e-05 451 454 -2.5531172000000e-03 453 454 -2.6645486000000e-05 454 454 5.4060151000000e+02 456 454 1.3826741000000e-03 457 454 -3.6581696000000e-01 459 454 -2.8986084000000e-05 502 454 -3.2336120000000e-01 504 454 -2.6733988000000e-05 1558 454 -3.7939151000000e-02 1560 454 -9.7877547000000e-06 408 455 -4.5952814000000e+00 453 455 -4.3393966000000e+00 454 455 -4.0561228000000e+02 455 455 -1.0287077000000e+02 456 455 1.9402726000000e+01 457 455 2.5964243000000e+01 459 455 -4.6265250000000e+00 502 455 6.9551885000000e+01 504 455 -4.2678508000000e+00 1560 455 -1.5621511000000e+00 408 456 -7.7678636000000e+00 453 456 -7.3353123000000e+00 454 456 -6.8564699000000e+02 455 456 1.0648907000000e+02 456 456 3.2798363000000e+01 457 456 4.3889957000000e+01 458 456 -7.1098200000000e+00 459 456 -7.8206778000000e+00 502 456 1.1757051000000e+02 503 456 -1.9045476000000e+01 504 456 -7.2143749000000e+00 1560 456 -2.6406602000000e+00 409 457 -2.7266028000000e-03 411 457 -2.8456061000000e-05 454 457 -2.7773886000000e-03 456 457 -2.8986084000000e-05 457 457 5.7512809000000e+02 459 457 1.4710524000000e-03 460 457 -1.8542539000000e-01 462 457 -3.0563854000000e-05 505 457 -5.8596145000000e-01 507 457 -2.9723276000000e-05 1561 457 -2.3834622000000e-02 1563 457 -9.4021289000000e-06 411 458 -4.7447320000000e+00 456 458 -4.6265250000000e+00 457 458 -4.4592885000000e+02 458 458 -1.0943785000000e+02 459 458 2.0272320000000e+01 460 458 1.5650290000000e+01 462 458 -4.7751626000000e+00 505 458 1.0039086000000e+02 507 458 -4.6448017000000e+00 1563 458 -1.4688418000000e+00 411 459 -8.0204896000000e+00 456 459 -7.8206778000000e+00 457 459 -7.5379764000000e+02 458 459 1.1723273000000e+02 459 459 3.4268312000000e+01 460 459 2.6455233000000e+01 461 459 -4.2854807000000e+00 462 459 -8.0719295000000e+00 505 459 1.6970060000000e+02 506 459 -2.7489782000000e+01 507 459 -7.8515677000000e+00 1563 459 -2.4829287000000e+00 412 460 -2.7434744000000e-03 414 460 -2.8632140000000e-05 457 460 -2.9285674000000e-03 459 460 -3.0563854000000e-05 460 460 5.7520322000000e+02 462 460 1.4740832000000e-03 463 460 -2.9416280000000e-03 465 460 -3.0700161000000e-05 508 460 -8.5968395000000e-01 510 460 -3.0749960000000e-05 1564 460 -1.1791679000000e-02 1566 460 -9.5039760000000e-06 414 461 -4.7469534000000e+00 459 461 -4.7751626000000e+00 460 461 -4.5529778000000e+02 461 461 -1.0944174000000e+02 462 461 2.0525033000000e+01 465 461 -4.7749737000000e+00 508 461 1.2541576000000e+02 510 461 -4.7484940000000e+00 1566 461 -1.4671910000000e+00 414 462 -8.0242501000000e+00 459 462 -8.0719295000000e+00 460 462 -7.6963537000000e+02 461 462 1.1978744000000e+02 462 462 3.4695505000000e+01 465 462 -8.0716104000000e+00 508 462 2.1200280000000e+02 509 462 -3.4342032000000e+01 510 462 -8.0268543000000e+00 1566 462 -2.4801396000000e+00 415 463 -2.7369021000000e-03 417 463 -2.8563549000000e-05 460 463 -9.9876087000000e-02 462 463 -3.0700161000000e-05 463 463 5.7516494000000e+02 465 463 1.4732997000000e-03 466 463 -2.8922477000000e-03 468 463 -3.0184806000000e-05 511 463 -7.1220218000000e-01 513 463 -3.0505978000000e-05 1567 463 -2.0158733000000e-02 1569 463 -9.4187340000000e-06 417 464 -4.7522972000000e+00 460 464 9.5332522000000e+00 462 464 -4.7749737000000e+00 463 464 -4.4573274000000e+02 464 464 -1.0943806000000e+02 465 464 2.0524459000000e+01 468 464 -4.7743924000000e+00 511 464 1.0631215000000e+02 513 464 -4.7456943000000e+00 1569 464 -1.4648449000000e+00 417 465 -8.0332795000000e+00 460 465 1.6114999000000e+01 461 465 -2.6104598000000e+00 462 465 -8.0716104000000e+00 463 465 -7.5346616000000e+02 464 465 1.1717810000000e+02 465 465 3.4694530000000e+01 468 465 -8.0706327000000e+00 511 465 1.7970995000000e+02 512 465 -2.9111112000000e+01 513 465 -8.0221160000000e+00 1569 465 -2.4761723000000e+00 418 466 -2.7118368000000e-03 420 466 -2.8301956000000e-05 463 466 -2.6835624000000e-01 465 466 -3.0184806000000e-05 466 466 5.7520815000000e+02 468 466 1.4712649000000e-03 469 466 -2.8382956000000e-03 471 466 -2.9621737000000e-05 514 466 -5.6931617000000e-01 516 466 -3.0004439000000e-05 1570 466 -3.3098183000000e-02 1572 466 -9.2428001000000e-06 420 467 -4.7560321000000e+00 463 467 2.1512569000000e+01 465 467 -4.7743924000000e+00 466 467 -4.3681580000000e+02 467 467 -1.0943408000000e+02 468 467 2.0524231000000e+01 471 467 -4.7731085000000e+00 514 467 8.5410030000000e+01 516 467 -4.7465937000000e+00 1572 467 -1.4618491000000e+00 420 468 -8.0395966000000e+00 463 468 3.6364846000000e+01 464 468 -5.8907798000000e+00 465 468 -8.0706327000000e+00 466 468 -7.3839342000000e+02 467 468 1.1474748000000e+02 468 468 3.4694155000000e+01 471 468 -8.0684581000000e+00 514 468 1.4437711000000e+02 515 468 -2.3387800000000e+01 516 468 -8.0236419000000e+00 1572 468 -2.4711096000000e+00 421 469 -2.6506929000000e-03 423 469 -2.7663830000000e-05 466 469 -3.1107453000000e-01 468 469 -2.9621737000000e-05 469 469 5.7514268000000e+02 471 469 1.4678365000000e-03 472 469 -2.6956843000000e-03 474 469 -2.8133381000000e-05 517 469 -4.4832657000000e-01 519 469 -2.9452477000000e-05 1573 469 -4.3135835000000e-02 1575 469 -9.0771279000000e-06 423 470 -4.7065101000000e+00 466 470 2.3423199000000e+01 468 470 -4.7731085000000e+00 469 470 -4.2683226000000e+02 470 470 -1.0943152000000e+02 471 470 2.0326504000000e+01 474 470 -4.6255575000000e+00 517 470 7.3511831000000e+01 519 470 -4.7465231000000e+00 1575 470 -1.4625507000000e+00 423 471 -7.9558789000000e+00 466 471 3.9594554000000e+01 467 471 -6.4140399000000e+00 468 471 -8.0684581000000e+00 469 471 -7.2151684000000e+02 470 471 1.1202164000000e+02 471 471 3.4359905000000e+01 474 471 -7.8190422000000e+00 517 471 1.2426433000000e+02 518 471 -2.0129948000000e+01 519 471 -8.0235181000000e+00 1575 471 -2.4722944000000e+00 424 472 -2.4541873000000e-03 426 472 -2.5613009000000e-05 469 472 -3.6670428000000e-01 471 472 -2.8133381000000e-05 472 472 5.4076809000000e+02 474 472 1.3791015000000e-03 475 472 -2.4187469000000e-03 477 472 -2.5243137000000e-05 520 472 -4.7462177000000e-01 522 472 -2.7428044000000e-05 1576 472 -4.8717647000000e-02 1578 472 -9.4536151000000e-06 426 473 -4.4195152000000e+00 469 473 2.3835402000000e+01 471 473 -4.6255575000000e+00 472 473 -4.0613436000000e+02 473 473 -1.0286765000000e+02 474 473 1.9409339000000e+01 477 473 -4.2882222000000e+00 520 473 7.2197736000000e+01 522 473 -4.5102819000000e+00 1578 473 -1.5542434000000e+00 426 474 -7.4707486000000e+00 469 474 4.0291363000000e+01 470 474 -6.5269939000000e+00 471 474 -7.8190422000000e+00 472 474 -6.8652953000000e+02 473 474 1.0664209000000e+02 474 474 3.2809543000000e+01 477 474 -7.2488069000000e+00 520 474 1.2204305000000e+02 521 474 -1.9770349000000e+01 522 474 -7.6241805000000e+00 1578 474 -2.6272931000000e+00 427 475 -2.1850937000000e-03 429 475 -2.2804627000000e-05 472 475 -4.3512517000000e-01 474 475 -2.5243137000000e-05 475 475 4.9442470000000e+02 477 475 1.2137476000000e-03 1579 475 -5.3505942000000e-02 1581 475 -1.0006409000000e-05 429 476 -3.9916066000000e+00 472 476 3.5331745000000e+01 474 476 -4.2882222000000e+00 475 476 -3.1905106000000e+02 476 476 -9.4106391000000e+01 477 476 9.9901027000000e+00 1581 476 -1.6997381000000e+00 429 477 -6.7474068000000e+00 472 477 5.9724749000000e+01 473 477 -9.6752944000000e+00 474 477 -7.2488069000000e+00 475 477 -5.3932361000000e+02 476 477 8.3202806000000e+01 477 477 1.6887259000000e+01 1581 477 -2.8732354000000e+00 478 478 1.0000000000000e+00 479 479 1.0000000000000e+00 480 480 1.0000000000000e+00 481 481 1.0000000000000e+00 482 482 1.0000000000000e+00 483 483 1.0000000000000e+00 484 484 1.0000000000000e+00 485 485 1.0000000000000e+00 486 486 1.0000000000000e+00 487 487 1.0000000000000e+00 488 488 1.0000000000000e+00 489 489 1.0000000000000e+00 490 490 1.0000000000000e+00 491 491 1.0000000000000e+00 492 492 1.0000000000000e+00 445 493 -2.2188495000000e-02 447 493 -1.9905810000000e-05 493 493 3.5624958000000e+02 495 493 9.0470568000000e-04 496 493 -1.2056436000000e-01 498 493 -1.9490644000000e-05 541 493 -1.6758613000000e-03 543 493 -1.7490047000000e-05 1597 493 -5.6812041000000e-02 1599 493 -1.4640770000000e-05 447 494 -3.2068077000000e+00 493 494 -2.3145383000000e+02 494 494 -6.7884610000000e+01 495 494 1.1464227000000e+01 496 494 9.4096397000000e+00 498 494 -3.1402877000000e+00 541 494 1.7558430000000e+01 543 494 -2.7507270000000e+00 1599 494 -2.3587909000000e+00 447 495 -5.4207838000000e+00 493 495 -3.9124930000000e+02 494 495 6.0276811000000e+01 495 495 1.9379115000000e+01 496 495 1.5906044000000e+01 497 495 -2.5766673000000e+00 498 495 -5.3083387000000e+00 541 495 2.9680750000000e+01 542 495 -4.8080725000000e+00 543 495 -4.6498258000000e+00 1599 495 -3.9872974000000e+00 448 496 -1.0442122000000e-02 450 496 -2.2250808000000e-05 493 496 -1.8675545000000e-03 495 496 -1.9490644000000e-05 496 496 4.0240967000000e+02 498 496 1.0367382000000e-03 499 496 -2.9821239000000e-01 501 496 -2.1851909000000e-05 544 496 -5.8779169000000e-02 546 496 -1.9325226000000e-05 1600 496 -5.2065558000000e-02 1602 496 -1.3125358000000e-05 450 497 -3.5431100000000e+00 495 497 -3.1402877000000e+00 496 497 -2.7845932000000e+02 497 497 -7.6645502000000e+01 498 497 1.5340356000000e+01 499 497 2.1802822000000e+01 501 497 -3.4800929000000e+00 544 497 2.5787942000000e+01 546 497 -3.0780453000000e+00 1602 497 -2.0902235000000e+00 450 498 -5.9892731000000e+00 495 498 -5.3083387000000e+00 496 498 -4.7070763000000e+02 497 498 7.2743432000000e+01 498 498 2.5931334000000e+01 499 498 3.6855490000000e+01 500 498 -5.9702838000000e+00 501 498 -5.8827489000000e+00 544 498 4.3591937000000e+01 545 498 -7.0615323000000e+00 546 498 -5.2031278000000e+00 1602 498 -3.5333138000000e+00 451 499 -2.2769672000000e-03 453 499 -2.3763460000000e-05 496 499 -2.0938062000000e-03 498 499 -2.1851909000000e-05 499 499 4.3705599000000e+02 501 499 1.1260789000000e-03 502 499 -4.1640767000000e-01 504 499 -2.4773945000000e-05 547 499 -1.5382048000000e-01 549 499 -2.1953293000000e-05 1603 499 -3.9166332000000e-02 1605 499 -1.2390340000000e-05 453 500 -3.8706427000000e+00 498 500 -3.4800929000000e+00 499 500 -3.2692845000000e+02 500 500 -8.3216692000000e+01 501 500 1.6556385000000e+01 502 500 3.5863226000000e+01 504 500 -3.8537242000000e+00 547 500 4.0410594000000e+01 549 500 -3.4153510000000e+00 1605 500 -1.9272396000000e+00 453 501 -6.5429310000000e+00 498 501 -5.8827489000000e+00 499 501 -5.5263943000000e+02 500 501 8.5709818000000e+01 501 501 2.7986897000000e+01 502 501 6.0623151000000e+01 503 501 -9.8203101000000e+00 504 501 -6.5143303000000e+00 547 501 6.8310016000000e+01 548 501 -1.1065501000000e+01 549 501 -5.7733048000000e+00 1605 501 -3.2578037000000e+00 454 502 -2.5615973000000e-03 456 502 -2.6733988000000e-05 499 502 -2.3737899000000e-03 501 502 -2.4773945000000e-05 502 502 4.9493426000000e+02 504 502 1.2728968000000e-03 505 502 -5.6088406000000e-01 507 502 -2.8811357000000e-05 550 502 -4.9629986000000e-01 552 502 -2.5522785000000e-05 1606 502 -1.4348107000000e-02 1608 502 -1.1291817000000e-05 456 503 -4.2678508000000e+00 501 503 -3.8537242000000e+00 502 503 -3.9920173000000e+02 503 503 -9.4176106000000e+01 504 503 1.8002224000000e+01 505 503 4.7350486000000e+01 507 503 -4.3330727000000e+00 550 503 6.8230276000000e+01 552 503 -3.8389315000000e+00 1608 503 -1.6980784000000e+00 456 504 -7.2143749000000e+00 501 504 -6.5143303000000e+00 502 504 -6.7481061000000e+02 503 504 1.0497153000000e+02 504 504 3.0430955000000e+01 505 504 8.0041261000000e+01 506 504 -1.2965548000000e+01 507 504 -7.3246260000000e+00 550 504 1.1533646000000e+02 551 504 -1.8682869000000e+01 552 504 -6.4893297000000e+00 1608 504 -2.8704318000000e+00 457 505 -2.8480249000000e-03 459 505 -2.9723276000000e-05 502 505 -2.7606466000000e-03 504 505 -2.8811357000000e-05 505 505 5.5265280000000e+02 507 505 1.4215661000000e-03 508 505 -4.3860921000000e-01 510 505 -3.2333973000000e-05 553 505 -9.3809341000000e-01 555 505 -3.0174259000000e-05 1609 505 -9.8984396000000e-04 1611 505 -1.0330459000000e-05 459 506 -4.6448017000000e+00 504 506 -4.3330727000000e+00 505 506 -4.7899523000000e+02 506 506 -1.0513858000000e+02 507 506 1.9561832000000e+01 508 506 3.7782580000000e+01 510 506 -4.6790249000000e+00 553 506 1.2462987000000e+02 555 506 -4.3673821000000e+00 1611 506 -1.5257493000000e+00 459 507 -7.8515677000000e+00 504 507 -7.3246260000000e+00 505 507 -8.0969294000000e+02 506 507 1.2628357000000e+02 507 507 3.3067302000000e+01 508 507 6.3867626000000e+01 509 507 -1.0345390000000e+01 510 507 -7.9094179000000e+00 553 507 2.1067418000000e+02 554 507 -3.4125373000000e+01 555 507 -7.3826173000000e+00 1611 507 -2.5791245000000e+00 460 508 -2.9463997000000e-03 462 508 -3.0749960000000e-05 505 508 -3.0981766000000e-03 507 508 -3.2333973000000e-05 508 508 5.7610393000000e+02 510 508 1.4841410000000e-03 511 508 -3.1852221000000e-03 513 508 -3.3242419000000e-05 556 508 -1.8658174000000e+00 558 508 -3.3766112000000e-05 1612 508 -9.6472465000000e-04 1614 508 -1.0068303000000e-05 462 509 -4.7484940000000e+00 507 509 -4.6790249000000e+00 508 509 -5.4056621000000e+02 509 509 -1.0952935000000e+02 510 509 2.0434084000000e+01 513 509 -4.7765998000000e+00 556 509 2.1080725000000e+02 558 509 -4.7563521000000e+00 1614 509 -1.4613155000000e+00 462 510 -8.0268543000000e+00 507 510 -7.9094179000000e+00 508 510 -9.1377311000000e+02 509 510 1.4291169000000e+02 510 510 3.4541762000000e+01 513 510 -8.0743576000000e+00 556 510 3.5634858000000e+02 557 510 -5.7720843000000e+01 558 510 -8.0401375000000e+00 1614 510 -2.4702077000000e+00 463 511 -2.9230218000000e-03 465 511 -3.0505978000000e-05 508 511 -2.4803450000000e-01 510 511 -3.3242419000000e-05 511 511 5.7550887000000e+02 513 511 1.4829856000000e-03 514 511 -3.0883055000000e-03 516 511 -3.2230953000000e-05 559 511 -1.0092726000000e+00 561 511 -3.3068305000000e-05 1615 511 -9.5556070000000e-04 1617 511 -9.9726638000000e-06 465 512 -4.7456943000000e+00 508 512 2.8689754000000e+01 510 512 -4.7765998000000e+00 511 512 -4.9409341000000e+02 512 512 -1.0951398000000e+02 513 512 2.0528275000000e+01 516 512 -4.7759952000000e+00 559 512 1.3562274000000e+02 561 512 -4.7524962000000e+00 1617 512 -1.4651993000000e+00 465 513 -8.0221160000000e+00 508 513 4.8497120000000e+01 509 513 -7.8556109000000e+00 510 513 -8.0743576000000e+00 511 513 -8.3521480000000e+02 512 513 1.3022704000000e+02 513 513 3.4700975000000e+01 516 513 -8.0733421000000e+00 559 513 2.2925650000000e+02 560 513 -3.7135191000000e+01 561 513 -8.0336129000000e+00 1617 513 -2.4767708000000e+00 466 514 -2.8749653000000e-03 468 514 -3.0004439000000e-05 511 514 -4.1241729000000e-01 513 514 -3.2230953000000e-05 514 514 5.7519069000000e+02 516 514 1.4795120000000e-03 517 514 -3.0069859000000e-03 519 514 -3.1382266000000e-05 562 514 -4.9911312000000e-01 564 514 -3.2047129000000e-05 1618 514 -8.0139423000000e-03 1620 514 -9.9070950000000e-06 468 515 -4.7465937000000e+00 511 515 4.2569293000000e+01 513 515 -4.7759952000000e+00 514 515 -4.6234161000000e+02 515 515 -1.0949542000000e+02 516 515 2.0527064000000e+01 519 515 -4.7748703000000e+00 562 515 8.9964943000000e+01 564 515 -4.7494534000000e+00 1620 515 -1.4678694000000e+00 468 516 -8.0236419000000e+00 511 516 7.1959131000000e+01 512 516 -1.1656244000000e+01 513 516 -8.0733421000000e+00 514 516 -7.8154226000000e+02 515 516 1.2158133000000e+02 516 516 3.4698943000000e+01 519 516 -8.0714349000000e+00 562 516 1.5207674000000e+02 563 516 -2.4634033000000e+01 564 516 -8.0284759000000e+00 1620 516 -2.4812864000000e+00 469 517 -2.8220775000000e-03 471 517 -2.9452477000000e-05 514 517 -4.3290524000000e-01 516 517 -3.1382266000000e-05 517 517 5.7503149000000e+02 519 517 1.4758353000000e-03 520 517 -2.8957310000000e-03 522 517 -3.0221159000000e-05 565 517 -2.8886261000000e-01 567 517 -3.1218023000000e-05 1621 517 -3.0579909000000e-02 1623 517 -9.6501086000000e-06 471 518 -4.7465231000000e+00 514 518 3.5396470000000e+01 516 518 -4.7748703000000e+00 517 518 -4.3450468000000e+02 518 518 -1.0948827000000e+02 519 518 2.0429436000000e+01 522 518 -4.6769808000000e+00 565 518 6.9290058000000e+01 567 518 -4.7506181000000e+00 1623 518 -1.4681648000000e+00 471 519 -8.0235181000000e+00 514 519 5.9834150000000e+01 515 519 -9.6923637000000e+00 516 519 -8.0714349000000e+00 517 519 -7.3448618000000e+02 518 519 1.1397923000000e+02 519 519 3.4533900000000e+01 522 519 -7.9059682000000e+00 565 519 1.1712783000000e+02 566 519 -1.8973202000000e+01 567 519 -8.0304389000000e+00 1623 519 -2.4817839000000e+00 472 520 -2.6281004000000e-03 474 520 -2.7428044000000e-05 517 520 -3.2038204000000e-01 519 520 -3.0221159000000e-05 520 520 5.5186282000000e+02 522 520 1.3874395000000e-03 568 520 -1.9750234000000e-01 570 520 -2.9774965000000e-05 1624 520 -3.9997528000000e-02 1626 520 -9.8819052000000e-06 474 521 -4.5102819000000e+00 517 521 2.1665194000000e+01 519 521 -4.6769808000000e+00 520 521 -3.9709700000000e+02 521 521 -9.6452757000000e+01 522 521 1.5336972000000e+01 568 521 5.8806825000000e+01 570 521 -4.6086963000000e+00 1626 521 -1.5292250000000e+00 474 522 -7.6241805000000e+00 517 522 3.6622843000000e+01 518 522 -5.9324904000000e+00 519 522 -7.9059682000000e+00 520 522 -6.7125278000000e+02 521 522 1.1856897000000e+02 522 522 2.5925617000000e+01 568 522 9.9407057000000e+01 569 522 -1.6102830000000e+01 570 522 -7.7905402000000e+00 1626 522 -2.5850020000000e+00 523 523 1.0000000000000e+00 524 524 1.0000000000000e+00 525 525 1.0000000000000e+00 526 526 1.0000000000000e+00 527 527 1.0000000000000e+00 528 528 1.0000000000000e+00 529 529 1.0000000000000e+00 530 530 1.0000000000000e+00 531 531 1.0000000000000e+00 532 532 1.0000000000000e+00 533 533 1.0000000000000e+00 534 534 1.0000000000000e+00 535 535 1.0000000000000e+00 536 536 1.0000000000000e+00 537 537 1.0000000000000e+00 538 538 1.0000000000000e+00 539 539 1.0000000000000e+00 540 540 1.0000000000000e+00 493 541 -4.8867607000000e-03 495 541 -1.7490047000000e-05 541 541 3.1031167000000e+02 543 541 7.9300686000000e-04 544 541 -1.5765390000000e-01 546 541 -1.7263735000000e-05 589 541 -9.1135186000000e-03 591 541 -1.5422818000000e-05 1645 541 -5.7152102000000e-02 1647 541 -1.7161875000000e-05 495 542 -2.7507270000000e+00 541 542 -1.9981890000000e+02 542 542 -5.9147403000000e+01 543 542 1.0598055000000e+01 544 542 1.3552430000000e+01 546 542 -2.7154363000000e+00 589 542 8.1967632000000e+00 591 542 -2.4259626000000e+00 1647 542 -2.6992882000000e+00 495 543 -4.6498258000000e+00 541 543 -3.3777366000000e+02 542 543 5.1959485000000e+01 543 543 1.7914941000000e+01 544 543 2.2909013000000e+01 545 543 -3.7110429000000e+00 546 543 -4.5901706000000e+00 589 543 1.3855800000000e+01 590 543 -2.2445083000000e+00 591 543 -4.1008446000000e+00 1647 543 -4.5628743000000e+00 496 544 -1.8517045000000e-03 498 544 -1.9325226000000e-05 541 544 -1.6541766000000e-03 543 544 -1.7263735000000e-05 544 544 3.4496899000000e+02 546 544 8.9592176000000e-04 547 544 -3.3972665000000e-01 549 544 -1.9714003000000e-05 592 544 -4.4239529000000e-02 594 544 -1.7560687000000e-05 1648 544 -4.9122130000000e-02 1650 544 -1.5748757000000e-05 498 545 -3.0780453000000e+00 543 545 -2.7154363000000e+00 544 545 -2.4255089000000e+02 545 545 -6.5723061000000e+01 546 545 1.3987573000000e+01 547 545 2.9580329000000e+01 549 545 -3.0438226000000e+00 592 545 1.5120848000000e+01 594 545 -2.7114628000000e+00 1650 545 -2.4314260000000e+00 498 546 -5.2031278000000e+00 543 546 -4.5901706000000e+00 544 546 -4.1000802000000e+02 545 546 6.3344299000000e+01 546 546 2.3644591000000e+01 547 546 5.0002588000000e+01 548 546 -8.0998458000000e+00 549 546 -5.1452776000000e+00 592 546 2.5560282000000e+01 593 546 -4.1404725000000e+00 594 546 -4.5834567000000e+00 1650 546 -4.1100826000000e+00 499 547 -2.1035206000000e-03 501 547 -2.1953293000000e-05 544 547 -1.8889563000000e-03 546 547 -1.9714003000000e-05 547 547 3.9125737000000e+02 549 547 1.0133153000000e-03 550 547 -6.5888912000000e-01 552 547 -2.2988498000000e-05 595 547 -1.0794534000000e-01 597 547 -2.0394295000000e-05 1651 547 -2.6226452000000e-02 1653 547 -1.4424569000000e-05 501 548 -3.4153510000000e+00 546 548 -3.0438226000000e+00 547 548 -3.0226887000000e+02 548 548 -7.4494601000000e+01 549 548 1.5085272000000e+01 550 548 5.2248365000000e+01 552 548 -3.4270315000000e+00 595 548 2.5803312000000e+01 597 548 -3.0405040000000e+00 1653 548 -2.1501943000000e+00 501 549 -5.7733048000000e+00 546 549 -5.1452776000000e+00 547 549 -5.1095495000000e+02 548 549 7.9264038000000e+01 549 549 2.5500128000000e+01 550 549 8.8320577000000e+01 551 549 -1.4306604000000e+01 552 549 -5.7930501000000e+00 595 549 4.3617890000000e+01 596 549 -7.0654417000000e+00 597 549 -5.1396644000000e+00 1653 549 -3.6346854000000e+00 502 550 -2.4455422000000e-03 504 550 -2.5522785000000e-05 547 550 -2.2027119000000e-03 549 550 -2.2988498000000e-05 550 550 4.3748058000000e+02 552 550 1.1357538000000e-03 553 550 -8.3735753000000e-01 555 550 -2.7548317000000e-05 598 550 -2.5091805000000e-01 600 550 -2.4896148000000e-05 1654 550 -1.2839192000000e-03 1656 550 -1.3399561000000e-05 504 551 -3.8389315000000e+00 549 551 -3.4270315000000e+00 550 551 -3.8540336000000e+02 551 551 -8.3267654000000e+01 552 551 1.6619424000000e+01 553 551 8.4500754000000e+01 555 551 -3.8958941000000e+00 598 551 5.0320737000000e+01 600 551 -3.5209698000000e+00 1656 551 -1.9272400000000e+00 504 552 -6.4893297000000e+00 549 552 -5.7930501000000e+00 550 552 -6.5148583000000e+02 551 552 1.0158914000000e+02 552 552 2.8093470000000e+01 553 552 1.4284007000000e+02 554 552 -2.3137098000000e+01 555 552 -6.5856193000000e+00 598 552 8.5062173000000e+01 599 552 -1.3778289000000e+01 600 552 -5.9518472000000e+00 1656 552 -3.2578065000000e+00 505 553 -2.8912371000000e-03 507 553 -3.0174259000000e-05 550 553 -2.6396247000000e-03 552 553 -2.7548317000000e-05 553 553 5.0753119000000e+02 555 553 1.3171729000000e-03 556 553 -1.2129343000000e+00 558 553 -3.3917203000000e-05 601 553 -1.0637215000000e+00 603 553 -3.0689517000000e-05 1657 553 -1.1608889000000e-03 1659 553 -1.2115562000000e-05 507 554 -4.3673821000000e+00 552 554 -3.8958941000000e+00 553 554 -5.2536138000000e+02 554 554 -9.6452559000000e+01 555 554 1.8456140000000e+01 556 554 1.0669878000000e+02 558 554 -4.4722193000000e+00 601 554 1.2856937000000e+02 603 554 -4.0471967000000e+00 1659 554 -1.6625969000000e+00 507 555 -7.3826173000000e+00 552 555 -6.5856193000000e+00 553 555 -8.8807032000000e+02 554 555 1.3918923000000e+02 555 555 3.1198243000000e+01 556 555 1.8036351000000e+02 557 555 -2.9213649000000e+01 558 555 -7.5598347000000e+00 601 555 2.1733352000000e+02 602 555 -3.5201717000000e+01 603 555 -6.8413770000000e+00 1659 555 -2.8104518000000e+00 508 556 -3.2354013000000e-03 510 556 -3.3766112000000e-05 553 556 -3.2498785000000e-03 555 556 -3.3917203000000e-05 556 556 5.7849567000000e+02 558 556 1.4973431000000e-03 559 556 -3.4951579000000e-03 561 556 -3.6477050000000e-05 604 556 -4.3747313000000e+00 606 556 -3.8023947000000e-05 1660 556 -1.0601736000000e-03 1662 556 -1.1064451000000e-05 510 557 -4.7563521000000e+00 555 557 -4.4722193000000e+00 556 557 -7.9450407000000e+02 557 557 -1.0963647000000e+02 558 557 2.0151920000000e+01 561 557 -4.7785850000000e+00 604 557 4.6489940000000e+02 606 557 -4.6673536000000e+00 1662 557 -1.4650651000000e+00 510 558 -8.0401375000000e+00 555 558 -7.5598347000000e+00 556 558 -1.3430296000000e+03 557 558 2.1215420000000e+02 558 558 3.4064795000000e+01 561 558 -8.0777140000000e+00 604 558 7.8586592000000e+02 605 558 -1.2728026000000e+02 606 558 -7.8896943000000e+00 1662 558 -2.4765460000000e+00 511 559 -3.1685388000000e-03 513 559 -3.3068305000000e-05 556 559 -1.1079898000000e+00 558 559 -3.6477050000000e-05 559 559 5.7644819000000e+02 561 559 1.4950011000000e-03 562 559 -3.2937125000000e-03 564 559 -3.4374674000000e-05 607 559 -1.1830743000000e+00 609 559 -3.6365310000000e-05 1663 559 -1.0245894000000e-03 1665 559 -1.0693079000000e-05 513 560 -4.7524962000000e+00 556 560 1.0412546000000e+02 558 560 -4.7785850000000e+00 559 560 -5.7975761000000e+02 560 560 -1.0960089000000e+02 561 560 2.0548189000000e+01 564 560 -4.7776800000000e+00 607 560 1.4597505000000e+02 609 560 -4.7645572000000e+00 1665 560 -1.4625411000000e+00 513 561 -8.0336129000000e+00 556 561 1.7601354000000e+02 557 561 -2.8508945000000e+01 558 561 -8.0777140000000e+00 559 561 -9.8002155000000e+02 560 561 1.5345788000000e+02 561 561 3.4734637000000e+01 564 561 -8.0761900000000e+00 607 561 2.4675605000000e+02 608 561 -3.9967119000000e+01 609 561 -8.0540009000000e+00 1665 561 -2.4722779000000e+00 514 562 -3.0706918000000e-03 516 562 -3.2047129000000e-05 559 562 -9.2503375000000e-01 561 562 -3.4374674000000e-05 562 562 5.7558862000000e+02 564 562 1.4879754000000e-03 565 562 -3.1647136000000e-03 567 562 -3.3028383000000e-05 610 562 -4.7106134000000e-01 612 562 -3.4274280000000e-05 1666 562 -9.8565306000000e-04 1668 562 -1.0286721000000e-05 516 563 -4.7494534000000e+00 559 563 8.8420532000000e+01 561 563 -4.7776800000000e+00 562 563 -4.9169918000000e+02 563 563 -1.0956911000000e+02 564 563 2.0541572000000e+01 567 563 -4.7763472000000e+00 610 563 7.3575168000000e+01 612 563 -4.7640016000000e+00 1668 563 -1.4617749000000e+00 516 564 -8.0284759000000e+00 559 564 1.4946606000000e+02 560 564 -2.4210075000000e+01 561 564 -8.0761900000000e+00 562 564 -8.3116828000000e+02 563 564 1.2943272000000e+02 564 564 3.4723467000000e+01 567 564 -8.0739316000000e+00 610 564 1.2437146000000e+02 611 564 -2.0145325000000e+01 612 564 -8.0530681000000e+00 1668 564 -2.4709843000000e+00 517 565 -2.9912485000000e-03 519 565 -3.1218023000000e-05 562 565 -6.4445134000000e-01 564 565 -3.3028383000000e-05 565 565 5.7516975000000e+02 567 565 1.4832013000000e-03 568 565 -3.0629382000000e-03 570 565 -3.1966208000000e-05 613 565 -3.0291400000000e-01 615 565 -3.2962271000000e-05 1669 565 -1.4067534000000e-02 1671 565 -1.0104963000000e-05 519 566 -4.7506181000000e+00 562 566 5.6210454000000e+01 564 566 -4.7763472000000e+00 565 566 -4.4068899000000e+02 566 566 -1.0955398000000e+02 567 566 2.0495125000000e+01 570 566 -4.7275361000000e+00 613 566 5.4752635000000e+01 615 566 -4.7671558000000e+00 1671 566 -1.4611605000000e+00 519 567 -8.0304389000000e+00 562 567 9.5018084000000e+01 563 567 -1.5391186000000e+01 564 567 -8.0739316000000e+00 565 567 -7.4494017000000e+02 566 567 1.1550708000000e+02 567 567 3.4644941000000e+01 570 567 -7.9914270000000e+00 613 567 9.2553790000000e+01 614 567 -1.4992013000000e+01 615 567 -8.0583944000000e+00 1671 567 -2.4699439000000e+00 520 568 -2.8529776000000e-03 522 568 -2.9774965000000e-05 565 568 -4.0867176000000e-01 567 568 -3.1966208000000e-05 568 568 5.6332193000000e+02 570 568 1.4207330000000e-03 616 568 -1.5716562000000e-01 618 568 -3.1899025000000e-05 1672 568 -3.1166100000000e-02 1674 568 -1.0076485000000e-05 522 569 -4.6086963000000e+00 565 569 3.0525309000000e+01 567 569 -4.7275361000000e+00 568 569 -3.9126151000000e+02 569 569 -1.0736000000000e+02 570 569 1.5556430000000e+01 616 569 3.7600113000000e+01 618 569 -4.7180090000000e+00 1674 569 -1.4901284000000e+00 522 570 -7.7905402000000e+00 565 570 5.1599982000000e+01 566 570 -8.3583710000000e+00 567 570 -7.9914270000000e+00 568 570 -6.6138846000000e+02 569 570 1.0208534000000e+02 570 570 2.6296589000000e+01 616 570 6.3559232000000e+01 617 570 -1.0295578000000e+01 618 570 -7.9753225000000e+00 1674 570 -2.5189130000000e+00 571 571 1.0000000000000e+00 572 572 1.0000000000000e+00 573 573 1.0000000000000e+00 574 574 1.0000000000000e+00 575 575 1.0000000000000e+00 576 576 1.0000000000000e+00 577 577 1.0000000000000e+00 578 578 1.0000000000000e+00 579 579 1.0000000000000e+00 580 580 1.0000000000000e+00 581 581 1.0000000000000e+00 582 582 1.0000000000000e+00 583 583 1.0000000000000e+00 584 584 1.0000000000000e+00 585 585 1.0000000000000e+00 586 586 2.2978609000000e+02 588 586 5.8613218000000e-04 589 586 -3.5185103000000e-02 591 586 -1.3283667000000e-05 634 586 -1.1599025000000e-03 636 586 -1.2105267000000e-05 1690 586 -6.2688382000000e-02 1692 586 -2.3213044000000e-05 586 587 -1.3774419000000e+02 587 587 -4.3816660000000e+01 588 587 7.6424481000000e+00 589 587 5.8459524000000e+00 591 587 -2.0845371000000e+00 636 587 -1.9104687000000e+00 1692 587 -3.6425216000000e+00 586 588 -2.3284278000000e+02 587 588 3.5667017000000e+01 588 588 1.2918794000000e+01 589 588 9.8819980000000e+00 590 588 -1.6007868000000e+00 591 588 -3.5237015000000e+00 636 588 -3.2294562000000e+00 1692 588 -6.1573185000000e+00 541 589 -1.4777835000000e-03 543 589 -1.5422818000000e-05 586 589 -1.2728144000000e-03 588 589 -1.3283667000000e-05 589 589 2.7585334000000e+02 591 589 7.2235850000000e-04 592 589 -1.7145267000000e-01 594 589 -1.5635827000000e-05 637 589 -1.2860444000000e-03 639 589 -1.3421741000000e-05 1693 589 -5.8961975000000e-02 1695 589 -1.9556480000000e-05 543 590 -2.4259626000000e+00 588 590 -2.0845371000000e+00 589 590 -1.7607907000000e+02 590 590 -5.2585057000000e+01 591 590 1.2065069000000e+01 592 590 1.7455773000000e+01 594 590 -2.4283018000000e+00 637 590 3.5253523000000e-01 639 590 -2.0833663000000e+00 1695 590 -3.0369940000000e+00 543 591 -4.1008446000000e+00 588 591 -3.5237015000000e+00 589 591 -2.9764387000000e+02 590 591 4.5741228000000e+01 591 591 2.0394783000000e+01 592 591 2.9507220000000e+01 593 591 -4.7798516000000e+00 594 591 -4.1047987000000e+00 637 591 5.9592515000000e-01 638 591 -9.6533443000000e-02 639 591 -3.5217201000000e+00 1695 591 -5.1337324000000e+00 544 592 -1.6826299000000e-03 546 592 -1.7560687000000e-05 589 592 -1.4981936000000e-03 591 592 -1.5635827000000e-05 592 592 3.1047109000000e+02 594 592 8.1079021000000e-04 595 592 -3.5516694000000e-01 597 592 -1.7948696000000e-05 640 592 -1.5437154000000e-03 642 592 -1.6110912000000e-05 1696 592 -4.8563239000000e-02 1698 592 -1.7854924000000e-05 546 593 -2.7114628000000e+00 591 593 -2.4283018000000e+00 592 593 -2.1574654000000e+02 593 593 -5.9166043000000e+01 594 593 1.2989807000000e+01 595 593 3.4295519000000e+01 597 593 -2.7159780000000e+00 640 593 3.4077931000000e+00 642 593 -2.4258745000000e+00 1698 593 -2.7015410000000e+00 546 594 -4.5834567000000e+00 591 594 -4.1047987000000e+00 592 594 -3.6469795000000e+02 593 594 5.6273456000000e+01 594 594 2.1957967000000e+01 595 594 5.7973145000000e+01 596 594 -9.3908619000000e+00 597 594 -4.5910892000000e+00 640 594 5.7605335000000e+00 641 594 -9.3312816000000e-01 642 594 -4.1006982000000e+00 1698 594 -4.5666848000000e+00 547 595 -1.9541406000000e-03 549 595 -2.0394295000000e-05 592 595 -1.7198082000000e-03 594 595 -1.7948696000000e-05 595 595 3.4523209000000e+02 597 595 9.0225060000000e-04 598 595 -7.1300240000000e-01 600 595 -2.1604671000000e-05 643 595 -1.8373648000000e-03 645 595 -1.9175571000000e-05 1699 595 -1.4615176000000e-02 1701 595 -1.6793702000000e-05 549 596 -3.0405040000000e+00 594 596 -2.7159780000000e+00 595 596 -2.6674948000000e+02 596 596 -6.5753455000000e+01 597 596 1.4087562000000e+01 598 596 6.5837486000000e+01 600 596 -3.1277751000000e+00 643 596 3.1057057000000e+00 645 596 -2.7649448000000e+00 1701 596 -2.4309664000000e+00 549 597 -5.1396644000000e+00 594 597 -4.5910892000000e+00 595 597 -4.5091303000000e+02 596 597 6.9892338000000e+01 597 597 2.3813602000000e+01 598 597 1.1129162000000e+02 599 597 -1.8027209000000e+01 600 597 -5.2871876000000e+00 643 597 5.2498816000000e+00 644 597 -8.5038494000000e-01 645 597 -4.6738596000000e+00 1701 597 -4.1093030000000e+00 550 598 -2.3854991000000e-03 552 598 -2.4896148000000e-05 595 598 -2.0701163000000e-03 597 598 -2.1604671000000e-05 598 598 4.1487000000000e+02 600 598 1.0797161000000e-03 601 598 -1.4893747000000e+00 603 598 -2.7142091000000e-05 646 598 -2.2757736000000e-03 648 598 -2.3751003000000e-05 1702 598 -1.4057315000000e-03 1704 598 -1.4670850000000e-05 552 599 -3.5209698000000e+00 597 599 -3.1277751000000e+00 598 599 -3.8085355000000e+02 599 599 -7.8927659000000e+01 600 599 1.5582531000000e+01 601 599 1.4352064000000e+02 603 599 -3.6647369000000e+00 648 599 -3.2334390000000e+00 1704 599 -2.0267265000000e+00 552 600 -5.9518472000000e+00 597 600 -5.2871876000000e+00 598 600 -6.4379484000000e+02 599 600 1.0044229000000e+02 600 600 2.6340706000000e+01 601 600 2.4260728000000e+02 602 600 -3.9295989000000e+01 603 600 -6.1948711000000e+00 648 600 -5.4658053000000e+00 1704 600 -3.4259784000000e+00 553 601 -2.9406082000000e-03 555 601 -3.0689517000000e-05 598 601 -2.6007009000000e-03 600 601 -2.7142091000000e-05 601 601 4.7473149000000e+02 603 601 1.2383838000000e-03 604 601 -3.9991868000000e+00 606 601 -3.5238816000000e-05 649 601 -2.8115951000000e-03 651 601 -2.9343079000000e-05 1705 601 -1.3243924000000e-03 1707 601 -1.3821958000000e-05 555 602 -4.0471967000000e+00 600 602 -3.6647369000000e+00 601 602 -6.5802809000000e+02 602 602 -8.9945654000000e+01 603 602 1.7444635000000e+01 604 602 3.8781468000000e+02 606 602 -4.2295457000000e+00 651 602 -3.7128363000000e+00 1707 602 -1.7801773000000e+00 555 603 -6.8413770000000e+00 600 603 -6.1948711000000e+00 601 603 -1.1123300000000e+03 602 603 1.7564428000000e+02 603 603 2.9488395000000e+01 604 603 6.5556152000000e+02 605 603 -1.0617404000000e+02 606 603 -7.1496192000000e+00 651 603 -6.2761737000000e+00 1707 603 -3.0092095000000e+00 556 604 -3.6433786000000e-03 558 604 -3.8023947000000e-05 601 604 -3.3765129000000e-03 603 604 -3.5238816000000e-05 604 604 5.6907973000000e+02 606 604 1.5789273000000e-03 607 604 -3.7515504000000e-03 609 604 -3.9152878000000e-05 652 604 -3.6096880000000e-03 654 604 -3.7672337000000e-05 1708 604 -1.2329110000000e-03 1710 604 -1.2867217000000e-05 558 605 -4.6673536000000e+00 603 605 -4.2295457000000e+00 604 605 -2.1044274000000e+03 605 605 -1.0545640000000e+02 606 605 3.1506343000000e+01 609 605 -4.6844756000000e+00 654 605 -4.4348850000000e+00 1710 605 -1.5208751000000e+00 558 606 -7.8896943000000e+00 603 606 -7.1496192000000e+00 604 606 -3.5573237000000e+03 605 606 5.7035342000000e+02 606 606 5.3258311000000e+01 609 606 -7.9186335000000e+00 654 606 -7.4967294000000e+00 1710 606 -2.5708872000000e+00 559 607 -3.4844513000000e-03 561 607 -3.6365310000000e-05 604 607 -4.3132374000000e+00 606 607 -3.9152878000000e-05 607 607 5.7838196000000e+02 609 607 1.5051761000000e-03 610 607 -3.4620455000000e-03 612 607 -3.6131473000000e-05 655 607 -3.6521160000000e-03 657 607 -3.8115135000000e-05 1711 607 -1.0845381000000e-03 1713 607 -1.1318731000000e-05 561 608 -4.7645572000000e+00 604 608 4.2514024000000e+02 606 608 -4.6844756000000e+00 607 608 -7.5467552000000e+02 608 608 -1.0968478000000e+02 609 608 2.0472160000000e+01 612 608 -4.7794951000000e+00 657 608 -4.7715009000000e+00 1713 608 -1.4597647000000e+00 561 609 -8.0540009000000e+00 604 609 7.1865668000000e+02 605 609 -1.1639256000000e+02 606 609 -7.9186335000000e+00 607 609 -1.2757028000000e+03 608 609 2.0112619000000e+02 609 609 3.4606123000000e+01 612 609 -8.0792585000000e+00 657 609 -8.0657406000000e+00 1713 609 -2.4675848000000e+00 562 610 -3.2840929000000e-03 564 610 -3.4274280000000e-05 607 610 -1.6392645000000e+00 609 610 -3.6131473000000e-05 610 610 5.7577660000000e+02 612 610 1.4956980000000e-03 613 610 -3.2907314000000e-03 615 610 -3.4343562000000e-05 658 610 -3.4728984000000e-03 660 610 -3.6244739000000e-05 1714 610 -1.0266717000000e-03 1716 610 -1.0714810000000e-05 564 611 -4.7640016000000e+00 607 611 1.6106208000000e+02 609 611 -4.7794951000000e+00 610 611 -4.9827023000000e+02 611 611 -1.0962325000000e+02 612 611 2.0564645000000e+01 615 611 -4.7780980000000e+00 658 611 7.5819676000000e+00 660 611 -4.7703929000000e+00 1716 611 -1.4603184000000e+00 564 612 -8.0530681000000e+00 607 612 2.7225934000000e+02 608 612 -4.4098175000000e+01 609 612 -8.0792585000000e+00 610 612 -8.4227598000000e+02 611 612 1.3109326000000e+02 612 612 3.4762469000000e+01 615 612 -8.0768906000000e+00 658 612 1.2816558000000e+01 659 612 -2.0759135000000e+00 660 612 -8.0638721000000e+00 1716 612 -2.4685221000000e+00 565 613 -3.1583789000000e-03 567 613 -3.2962271000000e-05 610 613 -8.1337681000000e-01 612 613 -3.4343562000000e-05 613 613 5.7519600000000e+02 615 613 1.4890724000000e-03 616 613 -3.1813009000000e-03 618 613 -3.3201496000000e-05 661 613 -2.2166944000000e-01 663 613 -3.4294215000000e-05 1717 613 -9.9022856000000e-04 1719 613 -1.0334473000000e-05 567 614 -4.7671558000000e+00 610 614 7.5140097000000e+01 612 614 -4.7780980000000e+00 613 614 -4.4468461000000e+02 614 614 -1.0959875000000e+02 615 614 2.0565455000000e+01 618 614 -4.7774699000000e+00 661 614 3.9882149000000e+01 663 614 -4.7713253000000e+00 1719 614 -1.4590786000000e+00 567 615 -8.0583944000000e+00 610 615 1.2701672000000e+02 611 615 -2.0573825000000e+01 612 615 -8.0768906000000e+00 613 615 -7.5169429000000e+02 614 615 1.1648750000000e+02 615 615 3.4763825000000e+01 618 615 -8.0758350000000e+00 661 615 6.7416734000000e+01 662 615 -1.0919981000000e+01 663 615 -8.0654413000000e+00 1719 615 -2.4664250000000e+00 568 616 -3.0565007000000e-03 570 616 -3.1899025000000e-05 613 616 -5.5733083000000e-01 615 616 -3.3201496000000e-05 616 616 5.7475318000000e+02 618 616 1.4191498000000e-03 1720 616 -2.5510073000000e-02 1722 616 -1.0149217000000e-05 570 617 -4.7180090000000e+00 613 617 4.7641436000000e+01 615 617 -4.7774699000000e+00 616 617 -3.7732136000000e+02 617 617 -1.0958694000000e+02 618 617 1.0968069000000e+01 1722 617 -1.4602675000000e+00 570 618 -7.9753225000000e+00 613 618 8.0533082000000e+01 614 618 -1.3044827000000e+01 615 618 -8.0758350000000e+00 616 618 -6.3782403000000e+02 617 618 9.8074874000000e+01 618 618 1.8540423000000e+01 1722 618 -2.4684361000000e+00 619 619 1.0000000000000e+00 620 620 1.0000000000000e+00 621 621 1.0000000000000e+00 622 622 1.0000000000000e+00 623 623 1.0000000000000e+00 624 624 1.0000000000000e+00 625 625 1.0000000000000e+00 626 626 1.0000000000000e+00 627 627 1.0000000000000e+00 628 628 1.0000000000000e+00 629 629 1.0000000000000e+00 630 630 1.0000000000000e+00 631 631 1.0000000000000e+00 632 632 1.0000000000000e+00 633 633 1.0000000000000e+00 586 634 -6.7886457000000e-02 588 634 -1.2105267000000e-05 634 634 2.2985844000000e+02 636 634 5.9672425000000e-04 637 634 -4.1488017000000e-02 639 634 -1.2103840000000e-05 682 634 -1.1404836000000e-03 684 634 -1.1902603000000e-05 1738 634 -6.3308042000000e-02 1740 634 -2.3087268000000e-05 586 635 2.8870110000000e+00 588 635 -1.9104687000000e+00 634 635 -1.4334945000000e+02 635 635 -4.3819004000000e+01 636 635 9.3800710000000e+00 637 635 8.5673652000000e+00 639 635 -1.9103693000000e+00 684 635 -1.9106725000000e+00 1740 635 -3.6436389000000e+00 586 636 4.8802034000000e+00 587 636 -7.9054791000000e-01 588 636 -3.2294562000000e+00 634 636 -2.4231791000000e+02 635 636 3.7196344000000e+01 636 636 1.5856072000000e+01 637 636 1.4482274000000e+01 638 636 -2.3459947000000e+00 639 636 -3.2292883000000e+00 684 636 -3.2298007000000e+00 1740 636 -6.1592072000000e+00 589 637 -6.3956856000000e-02 591 637 -1.3421741000000e-05 634 637 -1.1597657000000e-03 636 637 -1.2103840000000e-05 637 637 2.2995780000000e+02 639 637 6.1212934000000e-04 640 637 -1.5422862000000e-01 642 637 -1.3429905000000e-05 685 637 -1.1663975000000e-03 687 637 -1.2173052000000e-05 1741 637 -6.0973523000000e-02 1743 637 -2.3473926000000e-05 591 638 -2.0833663000000e+00 636 638 -1.9103693000000e+00 637 638 -1.4944624000000e+02 638 638 -4.3826616000000e+01 639 638 1.1637723000000e+01 640 638 1.7561895000000e+01 642 638 -2.0848288000000e+00 687 638 -1.9104756000000e+00 1743 638 -3.6437574000000e+00 591 639 -3.5217201000000e+00 636 639 -3.2292883000000e+00 637 639 -2.5262376000000e+02 638 639 3.8846729000000e+01 639 639 1.9672395000000e+01 640 639 2.9686608000000e+01 641 639 -4.8089082000000e+00 642 639 -3.5241921000000e+00 687 639 -3.2294658000000e+00 1743 639 -6.1594038000000e+00 592 640 -6.6318298000000e-02 594 640 -1.6110912000000e-05 637 640 -1.2868267000000e-03 639 640 -1.3429905000000e-05 640 640 2.7605201000000e+02 642 640 7.2487228000000e-04 643 640 -3.2951707000000e-01 645 640 -1.6403515000000e-05 688 640 -1.3144753000000e-03 690 640 -1.3718459000000e-05 1744 640 -5.2938282000000e-02 1746 640 -2.0166959000000e-05 594 641 -2.4258745000000e+00 639 641 -2.0848288000000e+00 640 641 -1.8874184000000e+02 641 641 -5.2601941000000e+01 642 641 1.2107669000000e+01 643 641 3.0495022000000e+01 645 641 -2.4701913000000e+00 690 641 -2.0841773000000e+00 1746 641 -3.0366821000000e+00 594 642 -4.1006982000000e+00 639 642 -3.5241921000000e+00 640 642 -3.1904920000000e+02 641 642 4.9165927000000e+01 642 642 2.0466800000000e+01 643 642 5.1548785000000e+01 644 642 -8.3501761000000e+00 645 642 -4.1756113000000e+00 690 642 -3.5230932000000e+00 1746 642 -5.1332074000000e+00 595 643 -6.8362792000000e-02 597 643 -1.9175571000000e-05 640 643 -1.5717520000000e-03 642 643 -1.6403515000000e-05 643 643 3.2214757000000e+02 645 643 8.4329072000000e-04 646 643 -5.2465201000000e-01 648 643 -1.9795671000000e-05 691 643 -1.6557416000000e-03 693 643 -1.7280069000000e-05 1747 643 -2.9494763000000e-02 1749 643 -1.8063337000000e-05 597 644 -2.7649448000000e+00 642 644 -2.4701913000000e+00 643 644 -2.3400402000000e+02 644 644 -6.1379794000000e+01 645 644 1.3221950000000e+01 646 644 4.9398648000000e+01 648 644 -2.8547062000000e+00 693 644 -2.5206038000000e+00 1749 644 -2.6045985000000e+00 597 645 -4.6738596000000e+00 642 645 -4.1756113000000e+00 643 645 -3.9556015000000e+02 644 645 6.1111547000000e+01 645 645 2.2350372000000e+01 646 645 8.3503422000000e+01 647 645 -1.3525992000000e+01 648 645 -4.8255923000000e+00 693 645 -4.2608252000000e+00 1749 645 -4.4028107000000e+00 598 646 -2.2283947000000e-01 600 646 -2.3751003000000e-05 643 646 -1.8967816000000e-03 645 646 -1.9795671000000e-05 646 646 3.6847470000000e+02 648 646 9.6544672000000e-04 649 646 -8.1318431000000e-01 651 646 -2.4093738000000e-05 694 646 -2.0286485000000e-03 696 646 -2.1171893000000e-05 1750 646 -1.5824708000000e-03 1752 646 -1.6515382000000e-05 598 647 8.4749399000000e+00 600 647 -3.2334390000000e+00 645 647 -2.8547062000000e+00 646 647 -2.9669662000000e+02 647 647 -7.0166544000000e+01 648 647 1.4612125000000e+01 649 647 7.7270965000000e+01 651 647 -3.2805685000000e+00 696 647 -2.9554628000000e+00 1752 647 -2.2800486000000e+00 598 648 1.4326038000000e+01 599 648 -2.3204550000000e+00 600 648 -5.4658053000000e+00 645 648 -4.8255923000000e+00 646 648 -5.0153595000000e+02 647 648 7.7805696000000e+01 648 648 2.4700333000000e+01 649 648 1.3061884000000e+02 650 648 -2.1156940000000e+01 651 648 -5.5454729000000e+00 696 648 -4.9959143000000e+00 1752 648 -3.8541941000000e+00 601 649 -8.4451639000000e-01 603 649 -2.9343079000000e-05 646 649 -2.3086138000000e-03 648 649 -2.4093738000000e-05 649 649 4.2671000000000e+02 651 649 1.1198369000000e-03 652 649 -1.0475849000000e+00 654 649 -3.0681625000000e-05 697 649 -2.5012740000000e-03 699 649 -2.6104427000000e-05 1753 649 -1.4416386000000e-03 1755 649 -1.5045593000000e-05 601 650 6.7680332000000e+01 603 650 -3.7128363000000e+00 648 650 -3.2805685000000e+00 649 650 -4.0881465000000e+02 650 650 -8.1159344000000e+01 651 650 1.6340623000000e+01 652 650 9.7265790000000e+01 654 650 -3.8824558000000e+00 699 650 -3.4832142000000e+00 1755 650 -1.9724001000000e+00 601 651 1.1440675000000e+02 602 651 -1.8529986000000e+01 603 651 -6.2761737000000e+00 648 651 -5.5454729000000e+00 649 651 -6.9105976000000e+02 650 651 1.0788868000000e+02 651 651 2.7622172000000e+01 652 651 1.6441797000000e+02 653 651 -2.6630093000000e+01 654 651 -6.5628982000000e+00 699 651 -5.8880212000000e+00 1755 651 -3.3341428000000e+00 604 652 -4.0053101000000e+00 606 652 -3.7672337000000e-05 649 652 -2.9398520000000e-03 651 652 -3.0681625000000e-05 652 652 5.2063920000000e+02 654 652 1.3599029000000e-03 655 652 -3.4660619000000e-03 657 652 -3.6173390000000e-05 700 652 -3.1482507000000e-03 702 652 -3.2856569000000e-05 1756 652 -1.2296929000000e-03 1758 652 -1.2833632000000e-05 604 653 3.7637479000000e+02 606 653 -4.4348850000000e+00 651 653 -3.8824558000000e+00 652 653 -6.7291882000000e+02 653 653 -9.8742650000000e+01 654 653 1.8725128000000e+01 657 653 -4.5287714000000e+00 702 653 -4.2455944000000e+00 1758 653 -1.6222799000000e+00 604 654 6.3622393000000e+02 605 654 -1.0304043000000e+02 606 654 -7.4967294000000e+00 651 654 -6.5628982000000e+00 652 654 -1.1375019000000e+03 653 654 1.7922403000000e+02 654 654 3.1652947000000e+01 657 654 -7.6554309000000e+00 702 654 -7.1767526000000e+00 1758 654 -2.7423019000000e+00 607 655 -9.7162808000000e-01 609 655 -3.8115135000000e-05 652 655 -1.0016969000000e+00 654 655 -3.6173390000000e-05 655 655 5.7604994000000e+02 657 655 1.5023318000000e-03 658 655 -3.4792827000000e-03 660 655 -3.6311369000000e-05 703 655 -3.4989709000000e-03 705 655 -3.6516844000000e-05 1759 655 -1.0719859000000e-03 1761 655 -1.1187730000000e-05 607 656 7.4628540000000e+01 609 656 -4.7715009000000e+00 652 656 9.7489376000000e+01 654 656 -4.5287714000000e+00 655 656 -5.0166834000000e+02 656 656 -1.0967559000000e+02 657 656 2.0323078000000e+01 660 656 -4.7798171000000e+00 705 656 -4.7714255000000e+00 1761 656 -1.4592005000000e+00 607 657 1.2615201000000e+02 608 657 -2.0432140000000e+01 609 657 -8.0657406000000e+00 652 657 1.6479595000000e+02 653 657 -2.6691085000000e+01 654 657 -7.6554309000000e+00 655 657 -8.4801969000000e+02 656 657 1.3188810000000e+02 657 657 3.4354116000000e+01 660 657 -8.0798027000000e+00 705 657 -8.0656140000000e+00 1761 657 -2.4666309000000e+00 610 658 -1.5987333000000e-01 612 658 -3.6244739000000e-05 655 658 -8.2628466000000e-01 657 658 -3.6311369000000e-05 658 658 5.7509413000000e+02 660 658 1.4986357000000e-03 661 658 -3.3828411000000e-03 663 658 -3.5304860000000e-05 706 658 -3.4459143000000e-03 708 658 -3.5963121000000e-05 1762 658 -1.0383418000000e-03 1764 658 -1.0836605000000e-05 612 659 -4.7703929000000e+00 655 659 7.8714003000000e+01 657 659 -4.7798171000000e+00 658 659 -4.0830577000000e+02 659 659 -1.0964765000000e+02 660 659 2.0571294000000e+01 663 659 -4.7794430000000e+00 708 659 -4.7708020000000e+00 1764 659 -1.4584898000000e+00 612 660 -8.0638721000000e+00 655 660 1.3305815000000e+02 656 660 -2.1551510000000e+01 657 660 -8.0798027000000e+00 658 660 -6.9020007000000e+02 659 660 1.0640089000000e+02 660 660 3.4773710000000e+01 663 660 -8.0791644000000e+00 708 660 -8.0645636000000e+00 1764 660 -2.4654311000000e+00 613 661 -3.2860031000000e-03 615 661 -3.4294215000000e-05 658 661 -4.3816125000000e-01 660 661 -3.5304860000000e-05 661 661 5.7456493000000e+02 663 661 1.4597886000000e-03 709 661 -3.3981475000000e-03 711 661 -3.5464605000000e-05 1765 661 -2.1262248000000e-03 1767 661 -1.0778205000000e-05 615 662 -4.7713253000000e+00 658 662 4.2804789000000e+01 660 662 -4.7794430000000e+00 661 662 -3.8206304000000e+02 662 662 -1.0963121000000e+02 663 662 1.5793919000000e+01 709 662 9.6425004000000e+00 711 662 -4.7718529000000e+00 1767 662 -1.4589556000000e+00 615 663 -8.0654413000000e+00 658 663 7.2357161000000e+01 659 663 -1.1719986000000e+01 660 663 -8.0791644000000e+00 661 663 -6.4583890000000e+02 662 663 9.9258914000000e+01 663 663 2.6698019000000e+01 709 663 1.6299671000000e+01 710 663 -2.6401245000000e+00 711 663 -8.0663336000000e+00 1767 663 -2.4662167000000e+00 664 664 1.0000000000000e+00 665 665 1.0000000000000e+00 666 666 1.0000000000000e+00 667 667 1.0000000000000e+00 668 668 1.0000000000000e+00 669 669 1.0000000000000e+00 670 670 1.0000000000000e+00 671 671 1.0000000000000e+00 672 672 1.0000000000000e+00 673 673 1.0000000000000e+00 674 674 1.0000000000000e+00 675 675 1.0000000000000e+00 676 676 1.0000000000000e+00 677 677 1.0000000000000e+00 678 678 1.0000000000000e+00 679 679 2.4128114000000e+02 681 679 6.1053060000000e-04 682 679 -3.6745224000000e-02 684 679 -1.1963890000000e-05 727 679 -1.2401056000000e-03 729 679 -1.2942303000000e-05 1783 679 -6.3456979000000e-02 1785 679 -2.1232487000000e-05 679 680 -1.4777267000000e+02 680 680 -4.6000009000000e+01 681 680 7.5709913000000e+00 682 680 9.2686398000000e+00 684 680 -1.9555350000000e+00 729 680 -2.1400582000000e+00 1785 680 -3.4702348000000e+00 679 681 -2.4979476000000e+02 680 681 3.8330186000000e+01 681 681 1.2797995000000e+01 682 681 1.5667699000000e+01 683 681 -2.5380787000000e+00 684 681 -3.3056342000000e+00 729 681 -3.6175519000000e+00 1785 681 -5.8660810000000e+00 634 682 -1.1595734000000e-01 636 682 -1.1902603000000e-05 679 682 -1.1463560000000e-03 681 682 -1.1963890000000e-05 682 682 2.2992078000000e+02 684 682 6.0799291000000e-04 685 682 -5.3412268000000e-02 687 682 -1.1896592000000e-05 730 682 -1.1498448000000e-03 732 682 -1.2000301000000e-05 1786 682 -6.3594462000000e-02 1788 682 -2.2712078000000e-05 634 683 8.5387112000000e+00 636 683 -1.9106725000000e+00 681 683 -1.9555350000000e+00 682 683 -1.5201540000000e+02 683 683 -4.3818310000000e+01 684 683 1.1383840000000e+01 685 683 1.1580450000000e+01 687 683 -1.9098309000000e+00 732 683 -1.9571084000000e+00 1788 683 -3.6457717000000e+00 634 684 1.4433837000000e+01 635 684 -2.3381730000000e+00 636 684 -3.2298007000000e+00 681 684 -3.3056342000000e+00 682 684 -2.5696684000000e+02 683 684 3.9571585000000e+01 684 684 1.9243241000000e+01 685 684 1.9575592000000e+01 686 684 -3.1710985000000e+00 687 684 -3.2283782000000e+00 732 684 -3.3082960000000e+00 1788 684 -6.1628125000000e+00 637 685 -1.0399828000000e-01 639 685 -1.2173052000000e-05 682 685 -1.1399077000000e-03 684 685 -1.1896592000000e-05 685 685 2.2998800000000e+02 687 685 6.0896425000000e-04 688 685 -1.4493342000000e-01 690 685 -1.2176631000000e-05 733 685 -1.1487335000000e-03 735 685 -1.1988703000000e-05 1789 685 -6.2686689000000e-02 1791 685 -2.3209883000000e-05 637 686 5.5208100000000e+00 639 686 -1.9104756000000e+00 684 686 -1.9098309000000e+00 685 686 -1.5431280000000e+02 686 686 -4.3828808000000e+01 687 686 1.1289908000000e+01 688 686 1.6910541000000e+01 690 686 -1.9111809000000e+00 735 686 -1.9108935000000e+00 1791 686 -3.6426013000000e+00 637 687 9.3323711000000e+00 638 687 -1.5117534000000e+00 639 687 -3.2294658000000e+00 684 687 -3.2283782000000e+00 685 687 -2.6085019000000e+02 686 687 4.0174310000000e+01 687 687 1.9084451000000e+01 688 687 2.8585561000000e+01 689 687 -4.6305832000000e+00 690 687 -3.2306580000000e+00 735 687 -3.2301723000000e+00 1791 687 -6.1574493000000e+00 640 688 -1.0959146000000e-01 642 688 -1.3718459000000e-05 685 688 -1.1667404000000e-03 687 688 -1.2176631000000e-05 688 688 2.3007758000000e+02 690 688 6.1374558000000e-04 691 688 -2.4328091000000e-01 693 688 -1.3979237000000e-05 736 688 -1.1848147000000e-03 738 688 -1.2365262000000e-05 1792 688 -5.8185297000000e-02 1794 688 -2.3977760000000e-05 640 689 5.1372413000000e+00 642 689 -2.0841773000000e+00 687 689 -1.9111809000000e+00 688 689 -1.6120435000000e+02 689 689 -4.3837882000000e+01 690 689 1.1678161000000e+01 691 689 2.4198730000000e+01 693 689 -2.1239615000000e+00 738 689 -1.9111011000000e+00 1794 689 -3.6428105000000e+00 640 690 8.6839927000000e+00 641 690 -1.4066924000000e+00 642 690 -3.5230932000000e+00 687 690 -3.2306580000000e+00 688 690 -2.7249984000000e+02 689 690 4.2037981000000e+01 690 690 1.9740762000000e+01 691 690 4.0905532000000e+01 692 690 -6.6261574000000e+00 693 690 -3.5903445000000e+00 738 690 -3.2305253000000e+00 1794 690 -6.1578069000000e+00 643 691 -1.8009043000000e-01 645 691 -1.7280069000000e-05 688 691 -1.3394625000000e-03 690 691 -1.3979237000000e-05 691 691 2.8765248000000e+02 693 691 7.5606631000000e-04 694 691 -3.5662905000000e-01 696 691 -1.7870173000000e-05 739 691 -1.4366905000000e-03 741 691 -1.4993952000000e-05 1795 691 -4.5081617000000e-02 1797 691 -2.0015607000000e-05 643 692 8.6115155000000e+00 645 692 -2.5206038000000e+00 690 692 -2.1239615000000e+00 691 692 -2.0758615000000e+02 692 692 -5.4808161000000e+01 693 692 1.2411776000000e+01 694 692 3.4155028000000e+01 696 692 -2.6069066000000e+00 741 692 -2.2345164000000e+00 1797 692 -2.9196208000000e+00 643 693 1.4556894000000e+01 644 693 -2.3579633000000e+00 645 693 -4.2608252000000e+00 690 693 -3.5903445000000e+00 691 693 -3.5090337000000e+02 692 693 5.4184103000000e+01 693 693 2.0980854000000e+01 694 693 5.7735619000000e+01 695 693 -9.3521645000000e+00 696 693 -4.4067113000000e+00 741 693 -3.7772243000000e+00 1797 693 -4.9353235000000e+00 646 694 -3.5002965000000e-01 648 694 -2.1171893000000e-05 691 694 -1.7122843000000e-03 693 694 -1.7870173000000e-05 694 694 3.4530721000000e+02 696 694 9.0444207000000e-04 697 694 -4.7150985000000e-01 699 694 -2.2409953000000e-05 742 694 -1.8424100000000e-03 744 694 -1.9228224000000e-05 1798 694 -1.5534761000000e-02 1800 694 -1.7423765000000e-05 646 695 2.2515897000000e+01 648 695 -2.9554628000000e+00 693 695 -2.6069066000000e+00 694 695 -2.6385430000000e+02 695 695 -6.5783412000000e+01 696 695 1.3891176000000e+01 697 695 4.3574756000000e+01 699 695 -3.1285009000000e+00 744 695 -2.7607207000000e+00 1800 695 -2.4321780000000e+00 646 696 3.8060872000000e+01 647 696 -6.1650064000000e+00 648 696 -4.9959143000000e+00 693 696 -4.4067113000000e+00 694 696 -4.4601930000000e+02 695 696 6.9023803000000e+01 696 696 2.3481640000000e+01 697 696 7.3658766000000e+01 698 696 -1.1931066000000e+01 699 696 -5.2884179000000e+00 744 696 -4.6667223000000e+00 1800 696 -4.1113536000000e+00 649 697 -7.5095722000000e-01 651 697 -2.6104427000000e-05 694 697 -2.1472769000000e-03 696 697 -2.2409953000000e-05 697 697 4.1453605000000e+02 699 697 1.0835157000000e-03 700 697 -4.3707748000000e-01 702 697 -2.8371765000000e-05 745 697 -2.3028751000000e-03 747 697 -2.4033846000000e-05 1801 697 -1.4331548000000e-03 1803 697 -1.4957052000000e-05 649 698 6.0063016000000e+01 651 698 -3.4832142000000e+00 696 698 -3.1285009000000e+00 697 698 -3.3647841000000e+02 698 698 -7.8955712000000e+01 699 698 1.5770532000000e+01 700 698 3.9122168000000e+01 702 698 -3.7857528000000e+00 747 698 -3.3371646000000e+00 1803 698 -2.0270036000000e+00 649 699 1.0153045000000e+02 650 699 -1.6445125000000e+01 651 699 -5.8880212000000e+00 696 699 -5.2884179000000e+00 697 699 -5.6878271000000e+02 698 699 8.8222558000000e+01 699 699 2.6658491000000e+01 700 699 6.6132068000000e+01 701 699 -1.0711566000000e+01 702 699 -6.3994322000000e+00 747 699 -5.6411381000000e+00 1803 699 -3.4264445000000e+00 652 700 -1.5705797000000e+00 654 700 -3.2856569000000e-05 697 700 -2.7185258000000e-03 699 700 -2.8371765000000e-05 700 700 5.0676230000000e+02 702 700 1.3209824000000e-03 703 700 -3.2815703000000e-03 705 700 -3.4247952000000e-05 748 700 -2.9025049000000e-03 750 700 -3.0291855000000e-05 1804 700 -1.1989549000000e-03 1806 700 -1.2512836000000e-05 652 701 1.3569495000000e+02 654 701 -4.2455944000000e+00 699 701 -3.7857528000000e+00 700 701 -4.2570079000000e+02 701 701 -9.6514271000000e+01 702 701 1.8276708000000e+01 705 701 -4.4749500000000e+00 750 701 -4.1004355000000e+00 1806 701 -1.6590973000000e+00 652 702 2.2937874000000e+02 653 702 -3.7152092000000e+01 654 702 -7.1767526000000e+00 699 702 -6.3994322000000e+00 700 702 -7.1960461000000e+02 701 702 1.1174866000000e+02 702 702 3.0894940000000e+01 705 702 -7.5644520000000e+00 750 702 -6.9313760000000e+00 1806 702 -2.8045381000000e+00 655 703 -8.7393253000000e-01 657 703 -3.6516844000000e-05 700 703 -1.5378390000000e-01 702 703 -3.4247952000000e-05 703 703 5.7511438000000e+02 705 703 1.4971549000000e-03 706 703 -3.4522739000000e-03 708 703 -3.6029493000000e-05 751 703 -3.3966575000000e-03 753 703 -3.5449055000000e-05 1807 703 -1.0485927000000e-03 1809 703 -1.0943588000000e-05 655 704 6.7319482000000e+01 657 704 -4.7714255000000e+00 700 704 1.6436817000000e+01 702 704 -4.4749500000000e+00 703 704 -4.1332039000000e+02 704 704 -1.0966693000000e+02 705 704 2.0268791000000e+01 708 704 -4.7798503000000e+00 753 704 -4.7704216000000e+00 1809 704 -1.4597855000000e+00 655 705 1.1379680000000e+02 656 705 -1.8431643000000e+01 657 705 -8.0656140000000e+00 700 705 2.7784783000000e+01 701 705 -4.5002953000000e+00 702 705 -7.5644520000000e+00 703 705 -6.9867647000000e+02 704 705 1.0772560000000e+02 705 705 3.4262351000000e+01 708 705 -8.0798587000000e+00 753 705 -8.0639167000000e+00 1809 705 -2.4676190000000e+00 658 706 -2.8639730000000e-01 660 706 -3.5963121000000e-05 703 706 -2.3772233000000e-01 705 706 -3.6029493000000e-05 706 706 5.7461766000000e+02 708 706 1.4623046000000e-03 709 706 -3.4034794000000e-03 711 706 -3.5520251000000e-05 1810 706 -1.0384528000000e-03 1812 706 -1.0837763000000e-05 658 707 1.1770645000000e+01 660 707 -4.7708020000000e+00 703 707 2.3067276000000e+01 705 707 -4.7798503000000e+00 706 707 -3.6441519000000e+02 707 707 -1.0965817000000e+02 708 707 1.5803139000000e+01 711 707 -4.7796613000000e+00 1812 707 -1.4604714000000e+00 658 708 1.9897097000000e+01 659 708 -3.2227639000000e+00 660 708 -8.0645636000000e+00 703 708 3.8992923000000e+01 704 708 -6.3157445000000e+00 705 708 -8.0798587000000e+00 706 708 -6.1600743000000e+02 707 708 9.4358729000000e+01 708 708 2.6713622000000e+01 711 708 -8.0795357000000e+00 1812 708 -2.4687808000000e+00 661 709 -9.2241827000000e-02 663 709 -3.5464605000000e-05 706 709 -2.4367706000000e-01 708 709 -3.5520251000000e-05 709 709 5.7444270000000e+02 711 709 1.4257672000000e-03 1813 709 -1.1013347000000e-02 1815 709 -1.0844475000000e-05 663 710 -4.7718529000000e+00 706 710 2.1354776000000e+01 708 710 -4.7796613000000e+00 709 710 -3.5094102000000e+02 710 710 -1.0965215000000e+02 711 710 1.1023000000000e+01 1815 710 -1.4591348000000e+00 663 711 -8.0663336000000e+00 706 711 3.6098097000000e+01 707 711 -5.8469286000000e+00 708 711 -8.0795357000000e+00 709 711 -5.9323041000000e+02 710 711 9.0685708000000e+01 711 711 1.8633268000000e+01 1815 711 -2.4665199000000e+00 712 712 1.0000000000000e+00 713 713 1.0000000000000e+00 714 714 1.0000000000000e+00 715 715 1.0000000000000e+00 716 716 1.0000000000000e+00 717 717 1.0000000000000e+00 718 718 1.0000000000000e+00 719 719 1.0000000000000e+00 720 720 1.0000000000000e+00 721 721 1.0000000000000e+00 722 722 1.0000000000000e+00 723 723 1.0000000000000e+00 724 724 1.0000000000000e+00 725 725 1.0000000000000e+00 726 726 1.0000000000000e+00 679 727 -5.0524872000000e-02 681 727 -1.2942303000000e-05 727 727 2.7575451000000e+02 729 727 7.0388324000000e-04 730 727 -1.2552775000000e-03 732 727 -1.3100644000000e-05 775 727 -1.3823857000000e-03 777 727 -1.4427202000000e-05 1831 727 -6.3023480000000e-02 1833 727 -1.8396914000000e-05 679 728 6.2654400000000e+00 681 728 -2.1400582000000e+00 727 728 -1.7223406000000e+02 728 728 -5.2567430000000e+01 729 728 9.7508953000000e+00 730 728 7.6726354000000e+00 732 728 -2.1364055000000e+00 777 728 -2.4266808000000e+00 1833 728 -3.0418515000000e+00 679 729 1.0591093000000e+01 680 729 -1.7157092000000e+00 681 729 -3.6175519000000e+00 727 729 -2.9114430000000e+02 728 729 4.4733734000000e+01 729 729 1.6482902000000e+01 730 729 1.2969815000000e+01 731 729 -2.1010516000000e+00 732 729 -3.6113775000000e+00 777 729 -4.1020580000000e+00 1833 729 -5.1419423000000e+00 682 730 -1.0974181000000e-01 684 730 -1.2000301000000e-05 727 730 -3.1715043000000e-02 729 730 -1.3100644000000e-05 730 730 2.4142916000000e+02 732 730 6.3568310000000e-04 733 730 -5.2575007000000e-02 735 730 -1.1994335000000e-05 778 730 -1.2365576000000e-03 780 730 -1.2905275000000e-05 1834 730 -6.3367554000000e-02 1836 730 -2.1296887000000e-05 682 731 7.9768355000000e+00 684 731 -1.9571084000000e+00 729 731 -2.1364055000000e+00 730 731 -1.5824006000000e+02 731 731 -4.6008688000000e+01 732 731 1.1667628000000e+01 733 731 1.1771221000000e+01 735 731 -1.9562652000000e+00 780 731 -2.1395018000000e+00 1836 731 -3.4731796000000e+00 682 732 1.3484043000000e+01 683 732 -2.1843344000000e+00 684 732 -3.3082960000000e+00 729 732 -3.6113775000000e+00 730 732 -2.6748900000000e+02 731 732 4.1175183000000e+01 732 732 1.9722955000000e+01 733 732 1.9898073000000e+01 734 732 -3.2233689000000e+00 735 732 -3.3068706000000e+00 780 732 -3.6166139000000e+00 1836 732 -5.8710629000000e+00 685 733 -1.0923002000000e-01 687 733 -1.1988703000000e-05 730 733 -1.1492732000000e-03 732 733 -1.1994335000000e-05 733 733 2.2997364000000e+02 735 733 6.0811355000000e-04 736 733 -1.2408179000000e-01 738 733 -1.1983552000000e-05 781 733 -1.1284540000000e-03 783 733 -1.1777057000000e-05 1837 733 -6.3341723000000e-02 1839 733 -2.2857855000000e-05 685 734 7.8766213000000e+00 687 734 -1.9108935000000e+00 732 734 -1.9562652000000e+00 733 734 -1.5553723000000e+02 734 734 -4.3828367000000e+01 735 734 1.1336191000000e+01 736 734 1.5778360000000e+01 738 734 -1.9101879000000e+00 783 734 -1.9106690000000e+00 1839 734 -3.6432492000000e+00 685 735 1.3314632000000e+01 686 735 -2.1568618000000e+00 687 735 -3.2301723000000e+00 732 735 -3.3068706000000e+00 733 735 -2.6291996000000e+02 734 735 4.0511193000000e+01 735 735 1.9162684000000e+01 736 735 2.6671722000000e+01 737 735 -4.3206013000000e+00 738 735 -3.2289795000000e+00 783 735 -3.2297921000000e+00 1839 735 -6.1585434000000e+00 688 736 -1.3003196000000e-01 690 736 -1.2365262000000e-05 733 736 -1.1482400000000e-03 735 736 -1.1983552000000e-05 736 736 2.3001051000000e+02 738 736 6.1051613000000e-04 739 736 -1.5214170000000e-01 741 736 -1.2950488000000e-05 784 736 -1.1609537000000e-03 786 736 -1.2116238000000e-05 1840 736 -6.1680865000000e-02 1842 736 -2.3581201000000e-05 688 737 9.0008987000000e+00 690 737 -1.9111011000000e+00 735 737 -1.9101879000000e+00 736 737 -1.6126652000000e+02 737 737 -4.3837874000000e+01 738 737 1.1383674000000e+01 739 737 2.0397004000000e+01 741 737 -2.0017149000000e+00 786 737 -1.9112524000000e+00 1842 737 -3.6444874000000e+00 688 738 1.5215119000000e+01 689 738 -2.4646760000000e+00 690 738 -3.2305253000000e+00 735 738 -3.2289795000000e+00 736 738 -2.7260493000000e+02 737 738 4.2055632000000e+01 738 738 1.9242960000000e+01 739 738 3.4479096000000e+01 740 738 -5.5852208000000e+00 741 738 -3.3836988000000e+00 786 738 -3.2307810000000e+00 1842 738 -6.1606414000000e+00 691 739 -2.3814062000000e-01 693 739 -1.4993952000000e-05 736 739 -1.2408899000000e-03 738 739 -1.2950488000000e-05 739 739 2.5318809000000e+02 741 739 6.7070663000000e-04 742 739 -2.7655441000000e-01 744 739 -1.5803473000000e-05 787 739 -1.2889535000000e-03 789 739 -1.3452102000000e-05 1843 739 -5.5112544000000e-02 1845 739 -2.2226569000000e-05 691 740 1.3212071000000e+01 693 740 -2.2345164000000e+00 738 740 -2.0017149000000e+00 739 740 -1.8333979000000e+02 740 740 -4.8235318000000e+01 741 740 1.1962878000000e+01 742 740 2.5091868000000e+01 744 740 -2.3553143000000e+00 789 740 -2.0535280000000e+00 1845 740 -3.3123752000000e+00 691 741 2.2333672000000e+01 692 741 -3.6177164000000e+00 693 741 -3.7772243000000e+00 738 741 -3.3836988000000e+00 739 741 -3.0991742000000e+02 740 741 4.7854592000000e+01 741 741 2.0222038000000e+01 742 741 4.2415271000000e+01 743 741 -6.8706306000000e+00 744 741 -3.9814210000000e+00 789 741 -3.4712812000000e+00 1845 741 -5.5992353000000e+00 694 742 -3.4772057000000e-01 696 742 -1.9228224000000e-05 739 742 -1.5142572000000e-03 741 742 -1.5803473000000e-05 742 742 3.2221786000000e+02 744 742 8.4364185000000e-04 745 742 -3.2405406000000e-01 747 742 -2.0445989000000e-05 790 742 -1.6677751000000e-03 792 742 -1.7405656000000e-05 1846 742 -4.1786403000000e-02 1848 742 -1.8199507000000e-05 694 743 2.3081303000000e+01 696 743 -2.7607207000000e+00 741 743 -2.3553143000000e+00 742 743 -2.3689682000000e+02 743 743 -6.1399215000000e+01 744 743 1.3243956000000e+01 745 743 2.9237469000000e+01 747 743 -2.9356936000000e+00 792 743 -2.5723639000000e+00 1848 743 -2.6129498000000e+00 694 744 3.9016635000000e+01 695 744 -6.3199419000000e+00 696 744 -4.6667223000000e+00 741 744 -3.9814210000000e+00 742 744 -4.0045039000000e+02 743 744 6.1855639000000e+01 744 744 2.2387581000000e+01 745 744 4.9423017000000e+01 746 744 -8.0055750000000e+00 747 744 -4.9624965000000e+00 792 744 -4.3483240000000e+00 1848 744 -4.4169304000000e+00 697 745 -5.5488178000000e-01 699 745 -2.4033846000000e-05 742 745 -1.9590937000000e-03 744 745 -2.0445989000000e-05 745 745 3.9127008000000e+02 747 745 1.0222417000000e-03 748 745 -3.0670813000000e-01 750 745 -2.5872768000000e-05 793 745 -2.1638333000000e-03 795 745 -2.2582743000000e-05 1849 745 -2.1586607000000e-02 1851 745 -1.5462216000000e-05 697 746 4.1144406000000e+01 699 746 -3.3371646000000e+00 744 746 -2.9356936000000e+00 745 746 -2.9348485000000e+02 746 746 -7.4565981000000e+01 747 746 1.5258691000000e+01 748 746 2.8224648000000e+01 750 746 -3.5925698000000e+00 795 746 -3.2380134000000e+00 1851 746 -2.1468502000000e+00 697 747 6.9550444000000e+01 698 747 -1.1265575000000e+01 699 747 -5.6411381000000e+00 744 747 -4.9624965000000e+00 745 747 -4.9610636000000e+02 746 747 7.6678890000000e+01 747 747 2.5793274000000e+01 748 747 4.7710903000000e+01 749 747 -7.7280713000000e+00 750 747 -6.0728747000000e+00 795 747 -5.4735325000000e+00 1851 747 -3.6290334000000e+00 700 748 -8.0505229000000e-01 702 748 -3.0291855000000e-05 745 748 -2.4790769000000e-03 747 748 -2.5872768000000e-05 748 748 4.8314666000000e+02 750 748 1.2586842000000e-03 751 748 -1.0306687000000e-01 753 748 -3.2242448000000e-05 796 748 -2.7353350000000e-03 798 748 -2.8547194000000e-05 1852 748 -6.9197351000000e-03 1854 748 -1.2840853000000e-05 700 749 6.0712756000000e+01 702 749 -4.1004355000000e+00 747 749 -3.5925698000000e+00 748 749 -3.4528836000000e+02 749 749 -9.2121217000000e+01 750 749 1.7763898000000e+01 751 749 7.7418258000000e+00 753 749 -4.3643937000000e+00 798 749 -3.9580552000000e+00 1854 749 -1.7380630000000e+00 700 750 1.0262884000000e+02 701 750 -1.6623199000000e+01 702 750 -6.9313760000000e+00 747 750 -6.0728747000000e+00 748 750 -5.8367545000000e+02 749 750 8.9969790000000e+01 750 750 3.0028088000000e+01 751 750 1.3086782000000e+01 752 750 -2.1197178000000e+00 753 750 -7.3775710000000e+00 798 750 -6.6906964000000e+00 1854 750 -2.9380216000000e+00 703 751 -6.6691780000000e-01 705 751 -3.5449055000000e-05 748 751 -3.0894068000000e-03 750 751 -3.2242448000000e-05 751 751 5.7476523000000e+02 753 751 1.4569444000000e-03 799 751 -3.3038625000000e-03 801 751 -3.4480604000000e-05 1855 751 -1.4370886000000e-02 1857 751 -1.0849465000000e-05 703 752 4.4649890000000e+01 705 752 -4.7704216000000e+00 750 752 -4.3643937000000e+00 751 752 -3.7421213000000e+02 752 752 -1.0966919000000e+02 753 752 1.5329533000000e+01 801 752 -4.7224174000000e+00 1857 752 -1.4599415000000e+00 703 753 7.5476138000000e+01 704 753 -1.2225121000000e+01 705 753 -8.0639167000000e+00 750 753 -7.3775710000000e+00 751 753 -6.3256788000000e+02 752 753 9.7015417000000e+01 753 753 2.5913031000000e+01 801 753 -7.9827685000000e+00 1857 753 -2.4678833000000e+00 754 754 1.0000000000000e+00 755 755 1.0000000000000e+00 756 756 1.0000000000000e+00 757 757 1.0000000000000e+00 758 758 1.0000000000000e+00 759 759 1.0000000000000e+00 760 760 1.0000000000000e+00 761 761 1.0000000000000e+00 762 762 1.0000000000000e+00 763 763 1.0000000000000e+00 764 764 1.0000000000000e+00 765 765 1.0000000000000e+00 766 766 1.0000000000000e+00 767 767 1.0000000000000e+00 768 768 1.0000000000000e+00 769 769 1.0000000000000e+00 770 770 1.0000000000000e+00 771 771 1.0000000000000e+00 772 772 3.4465067000000e+02 774 772 8.5349529000000e-04 775 772 -1.5446407000000e-03 777 772 -1.6120569000000e-05 820 772 -1.6955321000000e-02 822 772 -1.6827433000000e-05 1876 772 -6.1746864000000e-02 1878 772 -1.4279239000000e-05 772 773 -2.0606605000000e+02 773 773 -6.5688502000000e+01 774 773 8.0134569000000e+00 775 773 8.1670580000000e+00 777 773 -2.7112761000000e+00 822 773 -2.8642856000000e+00 1878 773 -2.4305303000000e+00 772 774 -3.4833405000000e+02 773 774 5.3442501000000e+01 774 774 1.3545947000000e+01 775 774 1.3805595000000e+01 776 774 -2.2364809000000e+00 777 774 -4.5831412000000e+00 822 774 -4.8417883000000e+00 1878 774 -4.1085685000000e+00 727 775 -8.0360452000000e-02 729 775 -1.4427202000000e-05 772 775 -1.6347658000000e-02 774 775 -1.6120569000000e-05 775 775 3.1027071000000e+02 777 775 8.0301749000000e-04 778 775 -1.4011493000000e-03 780 775 -1.4623028000000e-05 823 775 -9.4939016000000e-03 825 775 -1.6134123000000e-05 1879 775 -6.2288830000000e-02 1881 775 -1.6074153000000e-05 727 776 1.0544002000000e+01 729 776 -2.4266808000000e+00 774 776 -2.7112761000000e+00 775 776 -1.9758860000000e+02 776 776 -5.9131265000000e+01 777 776 1.2985718000000e+01 778 776 8.9515889000000e+00 780 776 -2.4240280000000e+00 825 776 -2.7135730000000e+00 1881 776 -2.7035268000000e+00 727 777 1.7823566000000e+01 728 777 -2.8873665000000e+00 729 777 -4.1020580000000e+00 774 777 -4.5831412000000e+00 775 777 -3.3400353000000e+02 776 777 5.1391010000000e+01 777 777 2.1951045000000e+01 778 777 1.5131755000000e+01 779 777 -2.4513007000000e+00 780 777 -4.0975736000000e+00 825 777 -4.5870206000000e+00 1881 777 -4.5700380000000e+00 730 778 -4.7710277000000e-02 732 778 -1.2905275000000e-05 775 778 -9.7353670000000e-03 777 778 -1.4623028000000e-05 778 778 2.7578622000000e+02 780 778 7.1734272000000e-04 781 778 -3.2091054000000e-02 783 778 -1.2554981000000e-05 826 778 -1.3328196000000e-03 828 778 -1.3909909000000e-05 1882 778 -6.2920115000000e-02 1884 778 -1.8339563000000e-05 730 779 9.0787260000000e+00 732 779 -2.1395018000000e+00 777 779 -2.4240280000000e+00 778 779 -1.7892355000000e+02 779 779 -5.2573077000000e+01 780 779 1.2029808000000e+01 781 779 1.1556585000000e+01 783 779 -2.0814907000000e+00 828 779 -2.3386791000000e+00 1884 779 -3.0402072000000e+00 730 780 1.5346678000000e+01 731 780 -2.4860947000000e+00 732 780 -3.6166139000000e+00 777 780 -4.0975736000000e+00 778 780 -3.0245236000000e+02 779 780 4.6551825000000e+01 780 780 2.0335185000000e+01 781 780 1.9535251000000e+01 782 780 -3.1646251000000e+00 783 780 -3.5185518000000e+00 828 780 -3.9533031000000e+00 1884 780 -5.1391662000000e+00 733 781 -6.4501178000000e-02 735 781 -1.1777057000000e-05 778 781 -1.2029931000000e-03 780 781 -1.2554981000000e-05 781 781 2.2988296000000e+02 783 781 6.0793532000000e-04 784 781 -7.1293148000000e-02 786 781 -1.1759384000000e-05 829 781 -1.1352142000000e-03 831 781 -1.1847609000000e-05 1885 781 -6.3524363000000e-02 1887 781 -2.2487696000000e-05 733 782 8.9962395000000e+00 735 782 -1.9106690000000e+00 780 782 -2.0814907000000e+00 781 782 -1.5514131000000e+02 782 782 -4.3822323000000e+01 783 782 1.1509553000000e+01 784 782 1.4254211000000e+01 786 782 -1.9078821000000e+00 831 782 -1.9564876000000e+00 1887 782 -3.6481002000000e+00 733 783 1.5207231000000e+01 734 783 -2.4634745000000e+00 735 783 -3.2297921000000e+00 780 783 -3.5185518000000e+00 781 783 -2.6225068000000e+02 782 783 4.0418167000000e+01 783 783 1.9455737000000e+01 784 783 2.4095299000000e+01 785 783 -3.9032848000000e+00 786 783 -3.2250813000000e+00 831 783 -3.3072448000000e+00 1887 783 -6.1667448000000e+00 736 784 -1.1725771000000e-01 738 784 -1.2116238000000e-05 781 784 -1.1267607000000e-03 783 784 -1.1759384000000e-05 784 784 2.2994354000000e+02 786 784 6.0877046000000e-04 787 784 -9.2996664000000e-02 789 784 -1.2390710000000e-05 832 784 -1.1361215000000e-03 834 784 -1.1857078000000e-05 1888 784 -6.3099117000000e-02 1890 784 -2.3135219000000e-05 736 785 1.0506499000000e+01 738 785 -1.9112524000000e+00 783 785 -1.9078821000000e+00 784 785 -1.5977102000000e+02 785 785 -4.3834704000000e+01 786 785 1.1338339000000e+01 787 785 1.7391223000000e+01 789 785 -1.9546905000000e+00 834 785 -1.9103239000000e+00 1890 785 -3.6492619000000e+00 736 786 1.7760186000000e+01 737 786 -2.8769849000000e+00 738 786 -3.2307810000000e+00 783 786 -3.2250813000000e+00 784 786 -2.7007692000000e+02 785 786 4.1654598000000e+01 786 786 1.9166326000000e+01 787 786 2.9398124000000e+01 788 786 -4.7622225000000e+00 789 786 -3.3042088000000e+00 834 786 -3.2292116000000e+00 1890 786 -6.1687123000000e+00 739 787 -1.8435981000000e-01 741 787 -1.3452102000000e-05 784 787 -1.1872531000000e-03 786 787 -1.2390710000000e-05 787 787 2.4151139000000e+02 789 787 6.4034340000000e-04 790 787 -1.2935698000000e-01 792 787 -1.4531498000000e-05 835 787 -1.2285658000000e-03 837 787 -1.2821869000000e-05 1891 787 -6.0194981000000e-02 1893 787 -2.2755466000000e-05 739 788 1.3942145000000e+01 741 788 -2.0535280000000e+00 786 788 -1.9546905000000e+00 787 788 -1.7286665000000e+02 788 788 -4.6041311000000e+01 789 788 1.1712269000000e+01 790 788 2.0478718000000e+01 792 788 -2.2184736000000e+00 837 788 -2.0067788000000e+00 1893 788 -3.4736169000000e+00 739 789 2.3567784000000e+01 740 789 -3.8176844000000e+00 741 789 -3.4712812000000e+00 786 789 -3.3042088000000e+00 787 789 -2.9221357000000e+02 788 789 4.5098157000000e+01 789 789 1.9798408000000e+01 790 789 3.4617200000000e+01 791 789 -5.6075503000000e+00 792 789 -3.7501050000000e+00 837 789 -3.3922563000000e+00 1893 789 -5.8717972000000e+00 742 790 -3.8295568000000e-01 744 790 -1.7405656000000e-05 787 790 -1.3923791000000e-03 789 790 -1.4531498000000e-05 790 790 2.9929629000000e+02 792 790 7.8507417000000e-04 793 790 -3.2737127000000e-01 795 790 -1.9053771000000e-05 838 790 -1.5647942000000e-03 840 790 -1.6330900000000e-05 1894 790 -5.3320545000000e-02 1896 790 -1.8974124000000e-05 742 791 2.1121733000000e+01 744 791 -2.5723639000000e+00 789 791 -2.2184736000000e+00 790 791 -2.1642027000000e+02 791 791 -5.7020556000000e+01 792 791 1.2900552000000e+01 793 791 2.3913941000000e+01 795 791 -2.8160557000000e+00 840 791 -2.4830562000000e+00 1896 791 -2.8041797000000e+00 742 792 3.5704177000000e+01 743 792 -5.7835004000000e+00 744 792 -4.3483240000000e+00 789 792 -3.7501050000000e+00 790 792 -3.6583682000000e+02 791 792 5.6448122000000e+01 792 792 2.1807090000000e+01 793 792 4.0424126000000e+01 794 792 -6.5480560000000e+00 795 792 -4.7602606000000e+00 840 792 -4.1973582000000e+00 1896 792 -4.7401854000000e+00 745 793 -4.6302039000000e-01 747 793 -2.2582743000000e-05 790 793 -1.8256942000000e-03 792 793 -1.9053771000000e-05 793 793 3.9127995000000e+02 795 793 1.0169382000000e-03 796 793 -3.8635653000000e-01 798 793 -2.4784809000000e-05 841 793 -2.0770616000000e-03 843 793 -2.1677154000000e-05 1897 793 -4.4529385000000e-02 1899 793 -1.5027311000000e-05 745 794 3.1337242000000e+01 747 794 -3.2380134000000e+00 792 794 -2.8160557000000e+00 793 794 -2.9176279000000e+02 794 794 -7.4567079000000e+01 795 794 1.5008424000000e+01 796 794 3.6310525000000e+01 798 794 -3.5539269000000e+00 843 794 -3.2374225000000e+00 1899 794 -2.1546054000000e+00 745 795 5.2972422000000e+01 746 795 -8.5805093000000e+00 747 795 -5.4735325000000e+00 792 795 -4.7602606000000e+00 793 795 -4.9319535000000e+02 794 795 7.6206877000000e+01 795 795 2.5370222000000e+01 796 795 6.1379251000000e+01 797 795 -9.9422529000000e+00 798 795 -6.0075522000000e+00 843 795 -5.4725347000000e+00 1899 795 -3.6421424000000e+00 748 796 -4.7355919000000e-01 750 796 -2.8547194000000e-05 793 796 -2.3748308000000e-03 795 796 -2.4784809000000e-05 796 796 4.7143383000000e+02 798 796 1.1989427000000e-03 799 796 -1.8473176000000e-01 801 796 -3.0784169000000e-05 1900 796 -3.3230226000000e-02 1902 796 -1.2848602000000e-05 748 797 2.8960471000000e+01 750 797 -3.9580552000000e+00 795 797 -3.5539269000000e+00 796 797 -3.1504032000000e+02 797 797 -8.9932956000000e+01 798 797 1.3571840000000e+01 799 797 1.5843805000000e+01 801 797 -4.2683282000000e+00 1902 797 -1.7813940000000e+00 748 798 4.8954780000000e+01 749 798 -7.9295357000000e+00 750 798 -6.6906964000000e+00 795 798 -6.0075522000000e+00 796 798 -5.3254415000000e+02 797 798 8.1786007000000e+01 798 798 2.2941832000000e+01 799 798 2.6782368000000e+01 800 798 -4.3381207000000e+00 801 798 -7.2151819000000e+00 1902 798 -3.0112683000000e+00 751 799 -4.7209570000000e-01 753 799 -3.4480604000000e-05 796 799 -2.9496775000000e-03 798 799 -3.0784169000000e-05 799 799 5.6309388000000e+02 801 799 1.3931534000000e-03 1903 799 -3.2800322000000e-02 1905 799 -1.0878457000000e-05 751 800 2.5400288000000e+01 753 800 -4.7224174000000e+00 798 800 -4.2683282000000e+00 799 800 -3.4835832000000e+02 800 800 -1.0748533000000e+02 801 800 1.0492712000000e+01 1905 800 -1.4898504000000e+00 751 801 4.2936615000000e+01 752 801 -6.9546765000000e+00 753 801 -7.9827685000000e+00 798 801 -7.2151819000000e+00 799 801 -5.8886449000000e+02 800 801 9.0023638000000e+01 801 801 1.7736873000000e+01 1905 801 -2.5184421000000e+00 802 802 1.0000000000000e+00 803 803 1.0000000000000e+00 804 804 1.0000000000000e+00 805 805 1.0000000000000e+00 806 806 1.0000000000000e+00 807 807 1.0000000000000e+00 808 808 1.0000000000000e+00 809 809 1.0000000000000e+00 810 810 1.0000000000000e+00 811 811 1.0000000000000e+00 812 812 1.0000000000000e+00 813 813 1.0000000000000e+00 814 814 1.0000000000000e+00 815 815 1.0000000000000e+00 816 816 1.0000000000000e+00 817 817 1.0000000000000e+00 818 818 1.0000000000000e+00 819 819 1.0000000000000e+00 772 820 -1.6123710000000e-03 774 820 -1.6827433000000e-05 820 820 3.4466858000000e+02 822 820 8.7085051000000e-04 823 820 -1.6123285000000e-03 825 820 -1.6826990000000e-05 868 820 -2.6112782000000e-02 870 820 -1.6734138000000e-05 1924 820 -6.1603359000000e-02 1926 820 -1.4191919000000e-05 772 821 4.0042888000000e+00 774 821 -2.8642856000000e+00 820 821 -2.0657734000000e+02 821 821 -6.0270803000000e+01 822 821 1.1026543000000e+01 823 821 4.6647492000000e+00 825 821 -2.8613005000000e+00 870 821 -2.8643717000000e+00 1926 821 -2.4292229000000e+00 772 822 6.7688497000000e+00 773 822 -1.0965447000000e+00 774 822 -4.8417883000000e+00 820 822 -3.4919834000000e+02 821 822 6.2745862000000e+01 822 822 1.8639267000000e+01 823 822 7.8852921000000e+00 824 822 -1.2774069000000e+00 825 822 -4.8367423000000e+00 870 822 -4.8419339000000e+00 1926 822 -4.1063585000000e+00 775 823 -1.5459394000000e-03 777 823 -1.6134123000000e-05 820 823 -2.4181174000000e-02 822 823 -1.6826990000000e-05 823 823 3.4465958000000e+02 825 823 8.8570179000000e-04 826 823 -1.4820698000000e-03 828 823 -1.5467551000000e-05 871 823 -1.5995969000000e-03 873 823 -1.6694117000000e-05 1927 823 -6.2083342000000e-02 1929 823 -1.4311777000000e-05 775 824 7.5436455000000e+00 777 824 -2.7135730000000e+00 822 824 -2.8613005000000e+00 823 824 -2.1303816000000e+02 824 824 -6.5690055000000e+01 825 824 1.3480709000000e+01 826 824 7.5976270000000e+00 828 824 -2.6002803000000e+00 873 824 -2.8645800000000e+00 1929 824 -2.4336098000000e+00 775 825 1.2751770000000e+01 776 825 -2.0657632000000e+00 777 825 -4.5870206000000e+00 822 825 -4.8367423000000e+00 823 825 -3.6011950000000e+02 824 825 5.5347981000000e+01 825 825 2.2787778000000e+01 826 825 1.2843021000000e+01 827 825 -2.0805458000000e+00 828 825 -4.3955109000000e+00 873 825 -4.8422821000000e+00 1929 825 -4.1137712000000e+00 778 826 -3.8541788000000e-02 780 826 -1.3909909000000e-05 823 826 -5.9415082000000e-02 825 826 -1.5467551000000e-05 826 826 2.8730014000000e+02 828 826 7.4559879000000e-04 829 826 -1.2714392000000e-02 831 826 -1.2947817000000e-05 874 826 -1.3440434000000e-03 876 826 -1.4027045000000e-05 1930 826 -6.2647550000000e-02 1932 826 -1.7362667000000e-05 778 827 8.3044124000000e+00 780 827 -2.3386791000000e+00 825 827 -2.6002803000000e+00 826 827 -1.8323488000000e+02 827 827 -5.4755899000000e+01 828 827 1.2428043000000e+01 829 827 1.0036045000000e+01 831 827 -2.1769877000000e+00 876 827 -2.3869578000000e+00 1932 827 -2.9189937000000e+00 778 828 1.4037779000000e+01 779 828 -2.2740776000000e+00 780 828 -3.9533031000000e+00 825 828 -4.3955109000000e+00 826 828 -3.0974023000000e+02 827 828 4.7649979000000e+01 828 828 2.1008360000000e+01 829 828 1.6964930000000e+01 830 828 -2.7482673000000e+00 831 828 -3.6799801000000e+00 876 828 -4.0349134000000e+00 1932 828 -4.9342670000000e+00 781 829 -5.0980577000000e-02 783 829 -1.1847609000000e-05 826 829 -1.2406339000000e-03 828 829 -1.2947817000000e-05 829 829 2.4133039000000e+02 831 829 6.3401457000000e-04 832 829 -4.0353251000000e-02 834 829 -1.1828373000000e-05 877 829 -1.1450563000000e-03 879 829 -1.1950326000000e-05 1933 829 -6.3485672000000e-02 1935 829 -2.1059135000000e-05 781 830 8.7901707000000e+00 783 830 -1.9564876000000e+00 828 830 -2.1769877000000e+00 829 830 -1.5972654000000e+02 830 830 -4.6006226000000e+01 831 830 1.1574441000000e+01 832 830 1.2440799000000e+01 834 830 -1.9533845000000e+00 879 830 -2.0049953000000e+00 1935 830 -3.4774202000000e+00 781 831 1.4858896000000e+01 782 831 -2.4070718000000e+00 783 831 -3.3072448000000e+00 828 831 -3.6799801000000e+00 829 831 -2.7000159000000e+02 830 831 4.1588697000000e+01 831 831 1.9565427000000e+01 832 831 2.1029915000000e+01 833 831 -3.4067479000000e+00 834 831 -3.3019994000000e+00 879 831 -3.3892421000000e+00 1935 831 -5.8782276000000e+00 784 832 -8.1700425000000e-02 786 832 -1.1857078000000e-05 829 832 -1.1333710000000e-03 831 832 -1.1828373000000e-05 832 832 2.2988232000000e+02 834 832 6.0759939000000e-04 835 832 -5.9511872000000e-02 837 832 -1.2122750000000e-05 880 832 -1.1122322000000e-03 882 832 -1.1607759000000e-05 1936 832 -6.3616243000000e-02 1938 832 -2.2676231000000e-05 784 833 1.0688462000000e+01 786 833 -1.9103239000000e+00 831 833 -1.9533845000000e+00 832 833 -1.5760196000000e+02 833 833 -4.3828011000000e+01 834 833 1.1384557000000e+01 835 833 1.5030646000000e+01 837 833 -1.9532233000000e+00 882 833 -1.9095173000000e+00 1938 833 -3.6531824000000e+00 784 834 1.8067775000000e+01 785 834 -2.9268498000000e+00 786 834 -3.2292116000000e+00 831 834 -3.3019994000000e+00 832 834 -2.6641036000000e+02 833 834 4.1077746000000e+01 834 834 1.9244453000000e+01 835 834 2.5407804000000e+01 836 834 -4.1158816000000e+00 837 834 -3.3017287000000e+00 882 834 -3.2278480000000e+00 1938 834 -6.1753395000000e+00 787 835 -1.2015405000000e-01 789 835 -1.2821869000000e-05 832 835 -1.1615777000000e-03 834 835 -1.2122750000000e-05 835 835 2.4140711000000e+02 837 835 6.3818803000000e-04 838 835 -7.9495381000000e-02 840 835 -1.4154005000000e-05 883 835 -1.1963318000000e-03 885 835 -1.2485460000000e-05 1939 835 -6.2279773000000e-02 1941 835 -2.2219399000000e-05 787 836 1.3639587000000e+01 789 836 -2.0067788000000e+00 834 836 -1.9532233000000e+00 835 836 -1.6979047000000e+02 836 836 -4.6034272000000e+01 837 836 1.1661624000000e+01 838 836 1.7694926000000e+01 840 836 -2.2153792000000e+00 885 836 -2.0036945000000e+00 1941 836 -3.4773703000000e+00 787 837 2.3056342000000e+01 788 837 -3.7348969000000e+00 789 837 -3.3922563000000e+00 834 837 -3.3017287000000e+00 835 837 -2.8701362000000e+02 836 837 4.4274019000000e+01 837 837 1.9712798000000e+01 838 837 2.9911484000000e+01 839 837 -4.8453611000000e+00 840 837 -3.7448743000000e+00 885 837 -3.3870428000000e+00 1941 837 -5.8781421000000e+00 790 838 -2.0433902000000e-01 792 838 -1.6330900000000e-05 835 838 -1.3562085000000e-03 837 838 -1.4154005000000e-05 838 838 2.9882746000000e+02 840 838 7.8228312000000e-04 841 838 -2.2783386000000e-02 843 838 -1.8495824000000e-05 886 838 -1.5362482000000e-03 888 838 -1.6032981000000e-05 1942 838 -5.9223097000000e-02 1944 838 -1.8503913000000e-05 790 839 1.9964062000000e+01 792 839 -2.4830562000000e+00 837 839 -2.2153792000000e+00 838 839 -2.0562103000000e+02 839 839 -5.7012907000000e+01 840 839 1.2812149000000e+01 841 839 1.4261129000000e+01 843 839 -2.8123255000000e+00 888 839 -2.4817049000000e+00 1944 839 -2.8132636000000e+00 790 840 3.3747250000000e+01 791 840 -5.4666118000000e+00 792 840 -4.1973582000000e+00 837 840 -3.7448743000000e+00 838 840 -3.4758178000000e+02 839 840 5.3511216000000e+01 840 840 2.1657654000000e+01 841 840 2.4107012000000e+01 842 840 -3.9050196000000e+00 843 840 -4.7539550000000e+00 888 840 -4.1950740000000e+00 1944 840 -4.7555408000000e+00 793 841 -6.1648801000000e-01 795 841 -2.1677154000000e-05 838 841 -1.7722328000000e-03 840 841 -1.8495824000000e-05 841 841 3.9105156000000e+02 843 841 9.8930809000000e-04 889 841 -2.0095705000000e-03 891 841 -2.0972787000000e-05 1945 841 -5.6386148000000e-02 1947 841 -1.4393578000000e-05 793 842 3.7103314000000e+01 795 842 -3.2374225000000e+00 840 842 -2.8123255000000e+00 841 842 -2.6120857000000e+02 842 842 -7.4574783000000e+01 843 842 1.1401721000000e+01 891 842 -3.1939497000000e+00 1947 842 -2.1496197000000e+00 793 843 6.2719392000000e+01 794 843 -1.0159607000000e+01 795 843 -5.4725347000000e+00 840 843 -4.7539550000000e+00 841 843 -4.4154665000000e+02 842 843 6.7824365000000e+01 843 843 1.9273457000000e+01 891 843 -5.3990486000000e+00 1947 843 -3.6337143000000e+00 844 844 1.0000000000000e+00 845 845 1.0000000000000e+00 846 846 1.0000000000000e+00 847 847 1.0000000000000e+00 848 848 1.0000000000000e+00 849 849 1.0000000000000e+00 850 850 1.0000000000000e+00 851 851 1.0000000000000e+00 852 852 1.0000000000000e+00 853 853 1.0000000000000e+00 854 854 1.0000000000000e+00 855 855 1.0000000000000e+00 856 856 1.0000000000000e+00 857 857 1.0000000000000e+00 858 858 1.0000000000000e+00 859 859 1.0000000000000e+00 860 860 1.0000000000000e+00 861 861 1.0000000000000e+00 862 862 1.0000000000000e+00 863 863 1.0000000000000e+00 864 864 1.0000000000000e+00 865 865 1.0000000000000e+00 866 866 1.0000000000000e+00 867 867 1.0000000000000e+00 820 868 -1.6034316000000e-03 822 868 -1.6734138000000e-05 868 868 3.4466303000000e+02 870 868 8.7042247000000e-04 871 868 -1.5980291000000e-03 873 868 -1.6677755000000e-05 916 868 -1.1800204000000e-02 918 868 -1.6632213000000e-05 1972 868 -6.1592932000000e-02 1974 868 -1.4105490000000e-05 820 869 4.4809201000000e+00 822 869 -2.8643717000000e+00 868 869 -2.0522846000000e+02 869 869 -6.0262267000000e+01 870 869 1.1027649000000e+01 871 869 2.8279019000000e+00 873 869 -2.8615690000000e+00 918 869 -2.8647960000000e+00 1974 869 -2.4295537000000e+00 820 870 7.5745473000000e+00 821 870 -1.2270711000000e+00 822 870 -4.8419339000000e+00 868 870 -3.4691819000000e+02 869 870 6.2397303000000e+01 870 870 1.8641137000000e+01 871 870 4.7802854000000e+00 872 870 -7.7440273000000e-01 873 870 -4.8371963000000e+00 918 870 -4.8426511000000e+00 1974 870 -4.1069176000000e+00 823 871 -2.3809981000000e-02 825 871 -1.6694117000000e-05 868 871 -7.0844374000000e-02 870 871 -1.6677755000000e-05 871 871 3.4475336000000e+02 873 871 8.8551476000000e-04 874 871 -1.4651131000000e-03 876 871 -1.5290583000000e-05 919 871 -1.9760735000000e-02 921 871 -1.6411306000000e-05 1975 871 -6.1994042000000e-02 1977 871 -1.4174587000000e-05 823 872 6.3203559000000e+00 825 872 -2.8645800000000e+00 870 872 -2.8615690000000e+00 871 872 -2.0969684000000e+02 872 872 -6.5683722000000e+01 873 872 1.3583208000000e+01 874 872 5.4707735000000e+00 876 872 -2.6017154000000e+00 921 872 -2.8158806000000e+00 1977 872 -2.4321006000000e+00 823 873 1.0683921000000e+01 824 873 -1.7307849000000e+00 825 873 -4.8422821000000e+00 870 873 -4.8371963000000e+00 871 873 -3.5447129000000e+02 872 873 5.4448839000000e+01 873 873 2.2961043000000e+01 874 873 9.2477889000000e+00 875 873 -1.4981326000000e+00 876 873 -4.3979361000000e+00 921 873 -4.7599617000000e+00 1977 873 -4.1112205000000e+00 826 874 -1.6360339000000e-02 828 874 -1.4027045000000e-05 871 874 -5.5631807000000e-02 873 874 -1.5290583000000e-05 874 874 2.8727143000000e+02 876 874 7.4492479000000e-04 877 874 -1.2435232000000e-03 879 874 -1.2977970000000e-05 922 874 -1.3030250000000e-03 924 874 -1.3598958000000e-05 1978 874 -6.2596797000000e-02 1980 874 -1.7146335000000e-05 826 875 7.2214688000000e+00 828 875 -2.3869578000000e+00 873 875 -2.6017154000000e+00 874 875 -1.7984791000000e+02 875 875 -5.4747707000000e+01 876 875 1.2427625000000e+01 877 875 7.7206051000000e+00 879 875 -2.1771781000000e+00 924 875 -2.3380768000000e+00 1980 875 -2.9175561000000e+00 826 876 1.2207171000000e+01 827 876 -1.9775386000000e+00 828 876 -4.0349134000000e+00 873 876 -4.3979361000000e+00 874 876 -3.0401491000000e+02 875 876 4.6742926000000e+01 876 876 2.1007653000000e+01 877 876 1.3050911000000e+01 878 876 -2.1142229000000e+00 879 876 -3.6803018000000e+00 924 876 -3.9522850000000e+00 1980 876 -4.9318369000000e+00 829 877 -2.5620619000000e-02 831 877 -1.1950326000000e-05 874 877 -2.6518293000000e-03 876 877 -1.2977970000000e-05 877 877 2.4128914000000e+02 879 877 6.3315052000000e-04 880 877 -1.3810981000000e-02 882 877 -1.1634779000000e-05 925 877 -1.1006289000000e-03 927 877 -1.1486661000000e-05 1981 877 -6.3481695000000e-02 1983 877 -2.0719887000000e-05 829 878 8.1989485000000e+00 831 878 -2.0049953000000e+00 876 878 -2.1771781000000e+00 877 878 -1.5653041000000e+02 878 878 -4.5997623000000e+01 879 878 1.1571691000000e+01 880 878 9.8238567000000e+00 882 878 -1.9520974000000e+00 927 878 -1.9561967000000e+00 1983 878 -3.4760615000000e+00 829 879 1.3859495000000e+01 830 879 -2.2451946000000e+00 831 879 -3.3892421000000e+00 876 879 -3.6803018000000e+00 877 879 -2.6459887000000e+02 878 879 4.0735007000000e+01 879 879 1.9560777000000e+01 880 879 1.6606239000000e+01 881 879 -2.6901584000000e+00 882 879 -3.2998235000000e+00 927 879 -3.3067529000000e+00 1983 879 -5.8759299000000e+00 832 880 -5.0339268000000e-02 834 880 -1.1607759000000e-05 877 880 -1.1148212000000e-03 879 880 -1.1634779000000e-05 880 880 2.2981958000000e+02 882 880 6.0621082000000e-04 883 880 -1.8023531000000e-02 885 880 -1.1876018000000e-05 928 880 -1.0881183000000e-03 930 880 -1.1356095000000e-05 1984 880 -6.3837177000000e-02 1986 880 -2.2231077000000e-05 832 881 1.0360255000000e+01 834 881 -1.9095173000000e+00 879 881 -1.9520974000000e+00 880 881 -1.5508784000000e+02 881 881 -4.3818848000000e+01 882 881 1.1386064000000e+01 883 881 1.2831785000000e+01 885 881 -1.9537229000000e+00 930 881 -1.9090161000000e+00 1986 881 -3.6567886000000e+00 832 882 1.7512975000000e+01 833 882 -2.8370121000000e+00 834 882 -3.2278480000000e+00 879 882 -3.2998235000000e+00 880 882 -2.6216048000000e+02 881 882 4.0412391000000e+01 882 882 1.9247000000000e+01 883 882 2.1690848000000e+01 884 882 -3.5138060000000e+00 885 882 -3.3025732000000e+00 930 882 -3.2270008000000e+00 1986 882 -6.1814354000000e+00 835 883 -9.5382011000000e-02 837 883 -1.2485460000000e-05 880 883 -1.1379363000000e-03 882 883 -1.1876018000000e-05 883 883 2.4148168000000e+02 885 883 6.3659101000000e-04 886 883 -1.6867021000000e-01 888 883 -1.3820054000000e-05 931 883 -1.1826096000000e-03 933 883 -1.2342249000000e-05 1987 883 -6.3020186000000e-02 1989 883 -2.1688252000000e-05 835 884 1.3129917000000e+01 837 884 -2.0036945000000e+00 882 884 -1.9537229000000e+00 883 884 -1.7274263000000e+02 884 884 -4.6025611000000e+01 885 884 1.1710275000000e+01 886 884 2.1144376000000e+01 888 884 -2.2179112000000e+00 933 884 -2.0494640000000e+00 1989 884 -3.4803075000000e+00 835 885 2.2194797000000e+01 836 885 -3.5953912000000e+00 837 885 -3.3870428000000e+00 882 885 -3.3025732000000e+00 883 885 -2.9200397000000e+02 884 885 4.5104546000000e+01 885 885 1.9795037000000e+01 886 885 3.5742431000000e+01 887 885 -5.7900063000000e+00 888 885 -3.7491545000000e+00 933 885 -3.4644117000000e+00 1989 885 -5.8831074000000e+00 838 886 -1.8480862000000e-02 840 886 -1.6032981000000e-05 883 886 -1.3242099000000e-03 885 886 -1.3820054000000e-05 886 886 2.9865514000000e+02 888 886 7.6469165000000e-04 889 886 -2.0105532000000e-02 891 886 -1.7925139000000e-05 1990 886 -6.0966350000000e-02 1992 886 -1.8146949000000e-05 838 887 1.2425388000000e+01 840 887 -2.4817049000000e+00 885 887 -2.2179112000000e+00 886 887 -1.9650986000000e+02 887 887 -5.6998073000000e+01 888 887 1.0289227000000e+01 889 887 1.2667573000000e+01 891 887 -2.7745677000000e+00 1992 887 -2.8086301000000e+00 838 888 2.1003875000000e+01 839 888 -3.4023914000000e+00 840 888 -4.1950740000000e+00 885 888 -3.7491545000000e+00 886 888 -3.3218027000000e+02 887 888 5.1053573000000e+01 888 888 1.7392906000000e+01 889 888 2.1413265000000e+01 890 888 -3.4687080000000e+00 891 888 -4.6901292000000e+00 1992 888 -4.7477083000000e+00 841 889 -2.6512448000000e-02 843 889 -2.0972787000000e-05 886 889 -1.7175510000000e-03 888 889 -1.7925139000000e-05 889 889 3.7900353000000e+02 891 889 9.4034887000000e-04 1993 889 -5.9610596000000e-02 1995 889 -1.4556352000000e-05 841 890 1.7605472000000e+01 843 890 -3.1939497000000e+00 888 890 -2.7745677000000e+00 889 890 -2.3514888000000e+02 890 890 -7.2360764000000e+01 891 890 8.1931919000000e+00 1995 890 -2.2165275000000e+00 841 891 2.9760267000000e+01 842 891 -4.8207812000000e+00 843 891 -5.3990486000000e+00 888 891 -4.6901292000000e+00 889 891 -3.9749538000000e+02 890 891 6.0849346000000e+01 891 891 1.3849764000000e+01 1995 891 -3.7468149000000e+00 892 892 1.0000000000000e+00 893 893 1.0000000000000e+00 894 894 1.0000000000000e+00 895 895 1.0000000000000e+00 896 896 1.0000000000000e+00 897 897 1.0000000000000e+00 898 898 1.0000000000000e+00 899 899 1.0000000000000e+00 900 900 1.0000000000000e+00 901 901 1.0000000000000e+00 902 902 1.0000000000000e+00 903 903 1.0000000000000e+00 904 904 1.0000000000000e+00 905 905 1.0000000000000e+00 906 906 1.0000000000000e+00 907 907 1.0000000000000e+00 908 908 1.0000000000000e+00 909 909 1.0000000000000e+00 910 910 1.0000000000000e+00 911 911 1.0000000000000e+00 912 912 1.0000000000000e+00 913 913 1.0000000000000e+00 914 914 1.0000000000000e+00 915 915 1.0000000000000e+00 868 916 -1.5936654000000e-03 870 916 -1.6632213000000e-05 916 916 3.4465667000000e+02 918 916 8.5322576000000e-04 919 916 -1.5603987000000e-03 921 916 -1.6285026000000e-05 2020 916 -6.1605779000000e-02 2022 916 -1.4034255000000e-05 868 917 3.1315115000000e+00 870 917 -2.8647960000000e+00 916 917 -2.0210141000000e+02 917 917 -6.5668414000000e+01 918 917 8.1139592000000e+00 919 917 1.0432158000000e+00 921 917 -2.8137417000000e+00 2022 917 -2.4280655000000e+00 868 918 5.2935070000000e+00 869 918 -8.5754645000000e-01 870 918 -4.8426511000000e+00 916 918 -3.4163222000000e+02 917 918 5.2406411000000e+01 918 918 1.3715837000000e+01 919 918 1.7634519000000e+00 920 918 -2.8567865000000e-01 921 918 -4.7563489000000e+00 2022 918 -4.1044020000000e+00 871 919 -1.5724985000000e-03 873 919 -1.6411306000000e-05 916 919 -6.1502372000000e-02 918 919 -1.6285026000000e-05 919 919 3.3323007000000e+02 921 919 8.5636298000000e-04 922 919 -1.3963692000000e-03 924 919 -1.4573141000000e-05 967 919 -5.3339692000000e-03 969 919 -1.5145699000000e-05 2023 919 -6.2108993000000e-02 2025 919 -1.4554666000000e-05 871 920 4.8166846000000e+00 873 920 -2.8158806000000e+00 918 920 -2.8137417000000e+00 919 920 -1.9928675000000e+02 920 920 -6.3486307000000e+01 921 920 1.3273757000000e+01 922 920 3.1502848000000e+00 924 920 -2.5053347000000e+00 969 920 -2.6169199000000e+00 2025 920 -2.5147666000000e+00 871 921 8.1421188000000e+00 872 921 -1.3190203000000e+00 873 921 -4.7599617000000e+00 918 921 -4.7563489000000e+00 919 921 -3.3687412000000e+02 920 921 5.1716900000000e+01 921 921 2.2437948000000e+01 922 921 5.3252382000000e+00 923 921 -8.6268678000000e-01 924 921 -4.2350152000000e+00 969 921 -4.4236383000000e+00 2025 921 -4.2509584000000e+00 874 922 -6.2867949000000e-03 876 922 -1.3598958000000e-05 919 922 -7.5083445000000e-02 921 922 -1.4573141000000e-05 922 922 2.7580705000000e+02 924 922 7.1551982000000e-04 925 922 -1.1711663000000e-03 927 922 -1.2222822000000e-05 970 922 -4.9045070000000e-03 972 922 -1.2440083000000e-05 2026 922 -6.2807060000000e-02 2028 922 -1.7675613000000e-05 874 923 5.9756739000000e+00 876 923 -2.3380768000000e+00 921 923 -2.5053347000000e+00 922 923 -1.6923485000000e+02 923 923 -5.2550474000000e+01 924 923 1.2108122000000e+01 925 923 4.9393941000000e+00 927 923 -2.0813670000000e+00 972 923 -2.1386753000000e+00 2028 923 -3.0387763000000e+00 874 924 1.0101279000000e+01 875 924 -1.6363979000000e+00 876 924 -3.9522850000000e+00 921 924 -4.2350152000000e+00 922 924 -2.8607459000000e+02 923 924 4.3955116000000e+01 924 924 2.0467567000000e+01 925 924 8.3495517000000e+00 926 924 -1.3526197000000e+00 927 924 -3.5183427000000e+00 972 924 -3.6152167000000e+00 2028 924 -5.1367475000000e+00 877 925 -2.8587000000000e-02 879 925 -1.1486661000000e-05 922 925 -2.7329265000000e-02 924 925 -1.2222822000000e-05 925 925 2.2982680000000e+02 927 925 6.0506617000000e-04 928 925 -1.0877487000000e-03 930 925 -1.1352238000000e-05 973 925 -1.0614415000000e-03 975 925 -1.1077684000000e-05 2029 925 -6.3624211000000e-02 2031 925 -2.1422054000000e-05 877 926 7.2941785000000e+00 879 926 -1.9561967000000e+00 924 926 -2.0813670000000e+00 925 926 -1.4544989000000e+02 926 926 -4.3800301000000e+01 927 926 1.1508061000000e+01 928 926 6.2339408000000e+00 930 926 -1.9081462000000e+00 975 926 -1.9094757000000e+00 2031 926 -3.6479617000000e+00 877 927 1.2330072000000e+01 878 927 -1.9974504000000e+00 879 927 -3.3067529000000e+00 924 927 -3.5183427000000e+00 925 927 -2.4586833000000e+02 926 927 3.7819564000000e+01 927 927 1.9453216000000e+01 928 927 1.0537847000000e+01 929 927 -1.7071130000000e+00 930 927 -3.2255284000000e+00 975 927 -3.2277759000000e+00 2031 927 -6.1665103000000e+00 880 928 -5.1644733000000e-02 882 928 -1.1356095000000e-05 925 928 -1.2405304000000e-02 927 928 -1.1352238000000e-05 928 928 2.2982524000000e+02 930 928 6.0513208000000e-04 931 928 -1.1533051000000e-03 933 928 -1.2036414000000e-05 976 928 -1.0709075000000e-03 978 928 -1.1176475000000e-05 2032 928 -6.3794897000000e-02 2034 928 -2.1708012000000e-05 880 929 1.0488328000000e+01 882 929 -1.9090161000000e+00 927 929 -1.9081462000000e+00 928 929 -1.4859170000000e+02 929 929 -4.3809625000000e+01 930 929 1.1378192000000e+01 931 929 6.1945942000000e+00 933 929 -1.9983706000000e+00 978 929 -1.9088204000000e+00 2034 929 -3.6489216000000e+00 880 930 1.7729469000000e+01 881 930 -2.8721199000000e+00 882 930 -3.2270008000000e+00 927 930 -3.2255284000000e+00 928 930 -2.5117942000000e+02 929 930 3.8656718000000e+01 930 930 1.9233694000000e+01 931 930 1.0471342000000e+01 932 930 -1.6963254000000e+00 933 930 -3.3780457000000e+00 978 930 -3.2266700000000e+00 2034 930 -6.1681371000000e+00 883 931 -7.6275901000000e-02 885 931 -1.2342249000000e-05 928 931 -4.1889144000000e-03 930 931 -1.2036414000000e-05 931 931 2.5280021000000e+02 933 931 6.4834342000000e-04 979 931 -1.2183070000000e-03 981 931 -1.2714803000000e-05 2035 931 -6.3493138000000e-02 2037 931 -1.9998318000000e-05 883 932 1.8367232000000e+01 885 932 -2.0494640000000e+00 930 932 -1.9983706000000e+00 931 932 -1.6345444000000e+02 932 932 -4.8199513000000e+01 933 932 9.5205031000000e+00 981 932 -2.1469161000000e+00 2037 932 -3.3203392000000e+00 883 933 3.1047948000000e+01 884 933 -5.0296385000000e+00 885 933 -3.4644117000000e+00 930 933 -3.3780457000000e+00 931 933 -2.7630321000000e+02 932 933 4.2501223000000e+01 933 933 1.6093452000000e+01 981 933 -3.6291456000000e+00 2037 933 -5.6126982000000e+00 934 934 1.0000000000000e+00 935 935 1.0000000000000e+00 936 936 1.0000000000000e+00 937 937 1.0000000000000e+00 938 938 1.0000000000000e+00 939 939 1.0000000000000e+00 940 940 1.0000000000000e+00 941 941 1.0000000000000e+00 942 942 1.0000000000000e+00 943 943 1.0000000000000e+00 944 944 1.0000000000000e+00 945 945 1.0000000000000e+00 946 946 1.0000000000000e+00 947 947 1.0000000000000e+00 948 948 1.0000000000000e+00 949 949 1.0000000000000e+00 950 950 1.0000000000000e+00 951 951 1.0000000000000e+00 952 952 1.0000000000000e+00 953 953 1.0000000000000e+00 954 954 1.0000000000000e+00 955 955 1.0000000000000e+00 956 956 1.0000000000000e+00 957 957 1.0000000000000e+00 958 958 1.0000000000000e+00 959 959 1.0000000000000e+00 960 960 1.0000000000000e+00 961 961 1.0000000000000e+00 962 962 1.0000000000000e+00 963 963 1.0000000000000e+00 964 964 1.0000000000000e+00 965 965 1.0000000000000e+00 966 966 1.0000000000000e+00 919 967 -1.4512306000000e-03 921 967 -1.5145699000000e-05 967 967 2.9870923000000e+02 969 967 7.4286310000000e-04 970 967 -1.2253255000000e-03 972 967 -1.2788052000000e-05 2071 967 -6.2497635000000e-02 2073 967 -1.6162266000000e-05 919 968 2.9235106000000e+00 921 968 -2.6169199000000e+00 967 968 -1.7516579000000e+02 968 968 -5.6914730000000e+01 969 968 7.6454607000000e+00 970 968 7.0861485000000e-01 972 968 -2.2168790000000e+00 2073 968 -2.8052857000000e+00 919 969 4.9418988000000e+00 920 969 -8.0058804000000e-01 921 969 -4.4236383000000e+00 967 969 -2.9610005000000e+02 968 969 4.5417038000000e+01 969 969 1.2923878000000e+01 970 969 1.1978417000000e+00 971 969 -1.9405045000000e-01 972 969 -3.7474097000000e+00 2073 969 -4.7420516000000e+00 922 970 -1.1919839000000e-03 924 970 -1.2440083000000e-05 967 970 -6.5872756000000e-02 969 970 -1.2788052000000e-05 970 970 2.4133995000000e+02 972 970 6.3226544000000e-04 973 970 -1.0868674000000e-03 975 970 -1.1343040000000e-05 1018 970 -2.6363345000000e-03 1020 970 -1.1284175000000e-05 2074 970 -6.3248693000000e-02 2076 970 -2.0025997000000e-05 922 971 4.3947349000000e+00 924 971 -2.1386753000000e+00 969 971 -2.2168790000000e+00 970 971 -1.4570455000000e+02 971 971 -4.2188136000000e+01 972 971 1.1743620000000e+01 973 971 2.7719884000000e+00 975 971 -1.9550432000000e+00 1020 971 -1.9561966000000e+00 2076 971 -3.4716727000000e+00 922 972 7.4288598000000e+00 923 972 -1.2034742000000e+00 924 972 -3.6152167000000e+00 969 972 -3.7474097000000e+00 970 972 -2.4629897000000e+02 971 972 4.4227243000000e+01 972 972 1.9851412000000e+01 973 972 4.6857691000000e+00 974 972 -7.5909392000000e-01 975 972 -3.3048051000000e+00 1020 972 -3.3067548000000e+00 2076 972 -5.8685156000000e+00 925 973 -1.2781218000000e-02 927 973 -1.1077684000000e-05 970 973 -4.1053693000000e-02 972 973 -1.1343040000000e-05 973 973 2.2983246000000e+02 975 973 6.0332626000000e-04 976 973 -1.0707159000000e-03 978 973 -1.1174475000000e-05 1021 973 -1.6420732000000e-03 1023 973 -1.1077758000000e-05 2077 973 -6.3744100000000e-02 2079 973 -2.1148424000000e-05 925 974 5.7477390000000e+00 927 974 -1.9094757000000e+00 972 974 -1.9550432000000e+00 973 974 -1.4206599000000e+02 974 974 -4.3793757000000e+01 975 974 1.1332200000000e+01 976 974 4.3873821000000e+00 978 974 -1.9082874000000e+00 1023 974 -1.9093383000000e+00 2079 974 -3.6451450000000e+00 925 975 9.7159725000000e+00 926 975 -1.5739818000000e+00 927 975 -3.2277759000000e+00 972 975 -3.3048051000000e+00 973 975 -2.4014821000000e+02 974 975 3.6909200000000e+01 975 975 1.9155942000000e+01 976 975 7.4164266000000e+00 977 975 -1.2014568000000e+00 978 975 -3.2257672000000e+00 1023 975 -3.2275438000000e+00 2079 975 -6.1617491000000e+00 928 976 -1.2881402000000e-02 930 976 -1.1176475000000e-05 973 976 -1.2486327000000e-02 975 976 -1.1174475000000e-05 976 976 2.2979623000000e+02 978 976 6.0487171000000e-04 979 976 -1.1582667000000e-03 981 976 -1.2088195000000e-05 1024 976 -1.1079653000000e-03 1026 976 -1.1563228000000e-05 2080 976 -6.3757781000000e-02 2082 976 -2.1366055000000e-05 928 977 7.5932097000000e+00 930 977 -1.9088204000000e+00 975 977 -1.9082874000000e+00 976 977 -1.4534879000000e+02 977 977 -4.3800643000000e+01 978 977 1.1511560000000e+01 979 977 5.8342629000000e+00 981 977 -2.0408938000000e+00 1026 977 -1.9998514000000e+00 2082 977 -3.6487932000000e+00 928 978 1.2835562000000e+01 929 978 -2.0793411000000e+00 930 978 -3.2266700000000e+00 975 978 -3.2257672000000e+00 976 978 -2.4569759000000e+02 977 978 3.7791073000000e+01 978 978 1.9459139000000e+01 979 978 9.8622379000000e+00 980 978 -1.5976672000000e+00 981 978 -3.4499269000000e+00 1026 978 -3.3805488000000e+00 2082 978 -6.1679201000000e+00 931 979 -2.8942638000000e-02 933 979 -1.2714803000000e-05 976 979 -1.7989387000000e-02 978 979 -1.2088195000000e-05 979 979 2.6426011000000e+02 981 979 6.6172256000000e-04 2083 979 -6.3402179000000e-02 2085 979 -1.8793556000000e-05 931 980 9.0579294000000e+00 933 980 -2.1469161000000e+00 978 980 -2.0408938000000e+00 979 980 -1.6075354000000e+02 980 980 -5.0380740000000e+01 981 980 7.3665337000000e+00 2085 980 -3.1730689000000e+00 931 981 1.5311518000000e+01 932 981 -2.4804263000000e+00 933 981 -3.6291456000000e+00 978 981 -3.4499269000000e+00 979 981 -2.7173768000000e+02 980 981 4.1683042000000e+01 981 981 1.2452383000000e+01 2085 981 -5.3637519000000e+00 982 982 1.0000000000000e+00 983 983 1.0000000000000e+00 984 984 1.0000000000000e+00 985 985 1.0000000000000e+00 986 986 1.0000000000000e+00 987 987 1.0000000000000e+00 988 988 1.0000000000000e+00 989 989 1.0000000000000e+00 990 990 1.0000000000000e+00 991 991 1.0000000000000e+00 992 992 1.0000000000000e+00 993 993 1.0000000000000e+00 994 994 1.0000000000000e+00 995 995 1.0000000000000e+00 996 996 1.0000000000000e+00 997 997 1.0000000000000e+00 998 998 1.0000000000000e+00 999 999 1.0000000000000e+00 1000 1000 1.0000000000000e+00 1001 1001 1.0000000000000e+00 1002 1002 1.0000000000000e+00 1003 1003 1.0000000000000e+00 1004 1004 1.0000000000000e+00 1005 1005 1.0000000000000e+00 1006 1006 1.0000000000000e+00 1007 1007 1.0000000000000e+00 1008 1008 1.0000000000000e+00 1009 1009 1.0000000000000e+00 1010 1010 1.0000000000000e+00 1011 1011 1.0000000000000e+00 1012 1012 1.0000000000000e+00 1013 1013 1.0000000000000e+00 1014 1014 1.0000000000000e+00 1015 1015 1.0000000000000e+00 1016 1016 1.0000000000000e+00 1017 1017 1.0000000000000e+00 970 1018 -1.0812271000000e-03 972 1018 -1.1284175000000e-05 1018 1018 2.2980627000000e+02 1020 1018 5.9156273000000e-04 1021 1018 -1.0508456000000e-03 1023 1018 -1.0967101000000e-05 1066 1018 -1.5430391000000e-02 1068 1018 -1.0935180000000e-05 2122 1018 -6.3775482000000e-02 2124 1018 -2.0866851000000e-05 970 1019 3.4945548000000e+00 972 1019 -1.9561966000000e+00 1018 1019 -1.3702239000000e+02 1019 1019 -4.3781862000000e+01 1020 1019 9.4233865000000e+00 1021 1019 1.5805871000000e+00 1023 1019 -1.9089412000000e+00 1068 1019 -1.9095203000000e+00 2124 1019 -3.6438231000000e+00 970 1020 5.9071955000000e+00 971 1020 -9.5696878000000e-01 972 1020 -3.3067548000000e+00 1018 1020 -2.3162265000000e+02 1019 1020 3.5557344000000e+01 1020 1020 1.5929293000000e+01 1021 1020 2.6718245000000e+00 1022 1020 -4.3283697000000e-01 1023 1020 -3.2268743000000e+00 1068 1020 -3.2278531000000e+00 2124 1020 -6.1595186000000e+00 973 1021 -1.0614486000000e-03 975 1021 -1.1077758000000e-05 1018 1021 -4.1015050000000e-02 1020 1021 -1.0967101000000e-05 1021 1021 2.2983972000000e+02 1023 1021 6.0301883000000e-04 1024 1021 -1.1082774000000e-03 1026 1021 -1.1566485000000e-05 1069 1021 -1.4084164000000e-02 1071 1021 -1.0968606000000e-05 2125 1021 -6.3794062000000e-02 2127 1021 -2.0933286000000e-05 973 1022 4.5370145000000e+00 975 1022 -1.9093383000000e+00 1020 1022 -1.9089412000000e+00 1021 1022 -1.3962158000000e+02 1022 1022 -4.3787669000000e+01 1023 1022 1.1376364000000e+01 1024 1022 3.1452839000000e+00 1026 1022 -2.0002494000000e+00 1071 1022 -1.9092098000000e+00 2127 1022 -3.6437176000000e+00 973 1023 7.6693654000000e+00 974 1023 -1.2424395000000e+00 975 1023 -3.2275438000000e+00 1020 1023 -3.2268743000000e+00 1021 1023 -2.3601620000000e+02 1022 1023 3.6254915000000e+01 1023 1023 1.9230594000000e+01 1024 1023 5.3167851000000e+00 1025 1023 -8.6132074000000e-01 1026 1023 -3.3812198000000e+00 1071 1023 -3.2273259000000e+00 2127 1023 -6.1593344000000e+00 976 1024 -3.0386974000000e-03 978 1024 -1.1563228000000e-05 1021 1024 -1.5614702000000e-02 1023 1024 -1.1566485000000e-05 1024 1024 2.5276665000000e+02 1026 1024 6.3354621000000e-04 2128 1024 -6.3580760000000e-02 2130 1024 -1.9161880000000e-05 976 1025 6.2052888000000e+00 978 1025 -1.9998514000000e+00 1023 1025 -2.0002494000000e+00 1024 1025 -1.5133049000000e+02 1025 1025 -4.8172242000000e+01 1026 1025 7.3192863000000e+00 2130 1025 -3.3137845000000e+00 976 1026 1.0489420000000e+01 977 1026 -1.6992821000000e+00 978 1026 -3.3805488000000e+00 1023 1026 -3.3812198000000e+00 1024 1026 -2.5580907000000e+02 1025 1026 3.9248992000000e+01 1026 1026 1.2372520000000e+01 2130 1026 -5.6016213000000e+00 1027 1027 1.0000000000000e+00 1028 1028 1.0000000000000e+00 1029 1029 1.0000000000000e+00 1030 1030 1.0000000000000e+00 1031 1031 1.0000000000000e+00 1032 1032 1.0000000000000e+00 1033 1033 1.0000000000000e+00 1034 1034 1.0000000000000e+00 1035 1035 1.0000000000000e+00 1036 1036 1.0000000000000e+00 1037 1037 1.0000000000000e+00 1038 1038 1.0000000000000e+00 1039 1039 1.0000000000000e+00 1040 1040 1.0000000000000e+00 1041 1041 1.0000000000000e+00 1042 1042 1.0000000000000e+00 1043 1043 1.0000000000000e+00 1044 1044 1.0000000000000e+00 1045 1045 1.0000000000000e+00 1046 1046 1.0000000000000e+00 1047 1047 1.0000000000000e+00 1048 1048 1.0000000000000e+00 1049 1049 1.0000000000000e+00 1050 1050 1.0000000000000e+00 1051 1051 1.0000000000000e+00 1052 1052 1.0000000000000e+00 1053 1053 1.0000000000000e+00 1054 1054 1.0000000000000e+00 1055 1055 1.0000000000000e+00 1056 1056 1.0000000000000e+00 1057 1057 1.0000000000000e+00 1058 1058 1.0000000000000e+00 1059 1059 1.0000000000000e+00 1060 1060 1.0000000000000e+00 1061 1061 1.0000000000000e+00 1062 1062 1.0000000000000e+00 1063 1063 1.0000000000000e+00 1064 1064 1.0000000000000e+00 1065 1065 1.0000000000000e+00 1018 1066 -1.0477870000000e-03 1020 1066 -1.0935180000000e-05 1066 1066 2.2979553000000e+02 1068 1066 5.8009517000000e-04 1069 1066 -1.0433945000000e-03 1071 1066 -1.0889337000000e-05 2170 1066 -6.3870563000000e-02 2172 1066 -2.0759632000000e-05 1018 1067 2.2605796000000e+00 1020 1067 -1.9095203000000e+00 1066 1067 -1.3474317000000e+02 1067 1067 -4.3777519000000e+01 1068 1067 7.4661549000000e+00 1069 1067 5.2937606000000e-01 1071 1067 -1.9090927000000e+00 2172 1067 -3.6426386000000e+00 1018 1068 3.8212837000000e+00 1019 1068 -6.1905167000000e-01 1020 1068 -3.2278531000000e+00 1066 1068 -2.2776985000000e+02 1067 1068 3.4943889000000e+01 1068 1068 1.2620788000000e+01 1069 1068 8.9485729000000e-01 1070 1068 -1.4496775000000e-01 1071 1068 -3.2271302000000e+00 2172 1068 -6.1575162000000e+00 1021 1069 -1.0509899000000e-03 1023 1069 -1.0968606000000e-05 1066 1069 -4.2359559000000e-02 1068 1069 -1.0889337000000e-05 1069 1069 2.2983197000000e+02 1071 1069 5.8014818000000e-04 2173 1069 -6.3888929000000e-02 2175 1069 -2.0783011000000e-05 1021 1070 3.3115470000000e+00 1023 1070 -1.9092098000000e+00 1068 1070 -1.9090927000000e+00 1069 1070 -1.3525858000000e+02 1070 1070 -4.3782057000000e+01 1071 1070 7.4668641000000e+00 2175 1070 -3.6436564000000e+00 1021 1071 5.5978351000000e+00 1022 1071 -9.0685487000000e-01 1023 1071 -3.2273259000000e+00 1068 1071 -3.2271302000000e+00 1069 1071 -2.2864096000000e+02 1070 1071 3.5074011000000e+01 1071 1071 1.2621981000000e+01 2175 1071 -6.1592331000000e+00 1072 1072 1.0000000000000e+00 1073 1073 1.0000000000000e+00 1074 1074 1.0000000000000e+00 1075 1075 1.0000000000000e+00 1076 1076 1.0000000000000e+00 1077 1077 1.0000000000000e+00 1078 1078 1.0000000000000e+00 1079 1079 1.0000000000000e+00 1080 1080 1.0000000000000e+00 1081 1081 1.0000000000000e+00 1082 1082 1.0000000000000e+00 1083 1083 1.0000000000000e+00 1084 1084 1.0000000000000e+00 1085 1085 1.0000000000000e+00 1086 1086 1.0000000000000e+00 1087 1087 1.0000000000000e+00 1088 1088 1.0000000000000e+00 1089 1089 1.0000000000000e+00 1090 1090 1.0000000000000e+00 1091 1091 1.0000000000000e+00 1092 1092 1.0000000000000e+00 1093 1093 1.0000000000000e+00 1094 1094 1.0000000000000e+00 1095 1095 1.0000000000000e+00 1096 1096 1.0000000000000e+00 1097 1097 1.0000000000000e+00 1098 1098 1.0000000000000e+00 1099 1099 1.0000000000000e+00 1100 1100 1.0000000000000e+00 1101 1101 1.0000000000000e+00 1102 1102 1.0000000000000e+00 1103 1103 1.0000000000000e+00 1104 1104 1.0000000000000e+00 1105 1105 1.0000000000000e+00 1106 1106 1.0000000000000e+00 1107 1107 1.0000000000000e+00 1108 1108 1.0000000000000e+00 1109 1109 1.0000000000000e+00 1110 1110 1.0000000000000e+00 1111 1111 1.0000000000000e+00 1112 1112 1.0000000000000e+00 1113 1113 1.0000000000000e+00 1114 1114 1.0000000000000e+00 1115 1115 1.0000000000000e+00 1116 1116 1.0000000000000e+00 1117 1117 1.0000000000000e+00 1118 1118 1.0000000000000e+00 1119 1119 1.0000000000000e+00 1120 1120 1.0000000000000e+00 1121 1121 1.0000000000000e+00 1122 1122 1.0000000000000e+00 1123 1123 1.0000000000000e+00 1124 1124 1.0000000000000e+00 1125 1125 1.0000000000000e+00 1126 1126 1.0000000000000e+00 1127 1127 1.0000000000000e+00 1128 1128 1.0000000000000e+00 1129 1129 1.0000000000000e+00 1130 1130 1.0000000000000e+00 1131 1131 1.0000000000000e+00 1132 1132 1.0000000000000e+00 1133 1133 1.0000000000000e+00 1134 1134 1.0000000000000e+00 1135 1135 1.0000000000000e+00 1136 1136 1.0000000000000e+00 1137 1137 1.0000000000000e+00 1138 1138 1.0000000000000e+00 1139 1139 1.0000000000000e+00 1140 1140 1.0000000000000e+00 1141 1141 1.0000000000000e+00 1142 1142 1.0000000000000e+00 1143 1143 1.0000000000000e+00 1144 1144 1.0000000000000e+00 1145 1145 1.0000000000000e+00 1146 1146 1.0000000000000e+00 1147 1147 1.0000000000000e+00 1148 1148 1.0000000000000e+00 1149 1149 1.0000000000000e+00 1150 1150 1.0000000000000e+00 1151 1151 1.0000000000000e+00 1152 1152 1.0000000000000e+00 1153 1153 1.0000000000000e+00 1154 1154 1.0000000000000e+00 1155 1155 1.0000000000000e+00 1156 1156 1.0000000000000e+00 1157 1157 1.0000000000000e+00 1158 1158 1.0000000000000e+00 1159 1159 1.0000000000000e+00 1160 1160 1.0000000000000e+00 1161 1161 1.0000000000000e+00 1162 1162 1.0000000000000e+00 1163 1163 1.0000000000000e+00 1164 1164 1.0000000000000e+00 1165 1165 1.0000000000000e+00 1166 1166 1.0000000000000e+00 1167 1167 1.0000000000000e+00 1168 1168 1.0000000000000e+00 1169 1169 1.0000000000000e+00 1170 1170 1.0000000000000e+00 1171 1171 1.0000000000000e+00 1172 1172 1.0000000000000e+00 1173 1173 1.0000000000000e+00 1174 1174 1.0000000000000e+00 1175 1175 1.0000000000000e+00 1176 1176 1.0000000000000e+00 1177 1177 1.0000000000000e+00 1178 1178 1.0000000000000e+00 1179 1179 1.0000000000000e+00 1180 1180 1.0000000000000e+00 1181 1181 1.0000000000000e+00 1182 1182 1.0000000000000e+00 1183 1183 1.0000000000000e+00 1184 1184 1.0000000000000e+00 1185 1185 1.0000000000000e+00 1186 1186 1.0000000000000e+00 1187 1187 1.0000000000000e+00 1188 1188 1.0000000000000e+00 1189 1189 1.0000000000000e+00 1190 1190 1.0000000000000e+00 1191 1191 1.0000000000000e+00 1192 1192 1.0000000000000e+00 1193 1193 1.0000000000000e+00 1194 1194 1.0000000000000e+00 1195 1195 1.0000000000000e+00 1196 1196 1.0000000000000e+00 1197 1197 1.0000000000000e+00 1198 1198 1.0000000000000e+00 1199 1199 1.0000000000000e+00 1200 1200 1.0000000000000e+00 1201 1201 1.0000000000000e+00 1202 1202 1.0000000000000e+00 1203 1203 1.0000000000000e+00 1204 1204 1.0000000000000e+00 1205 1205 1.0000000000000e+00 1206 1206 1.0000000000000e+00 1207 1207 1.0000000000000e+00 1208 1208 1.0000000000000e+00 1209 1209 1.0000000000000e+00 1210 1210 1.0000000000000e+00 1211 1211 1.0000000000000e+00 1212 1212 1.0000000000000e+00 1213 1213 1.0000000000000e+00 1214 1214 1.0000000000000e+00 1215 1215 1.0000000000000e+00 1216 1216 1.0000000000000e+00 1217 1217 1.0000000000000e+00 1218 1218 1.0000000000000e+00 1219 1219 1.0000000000000e+00 1220 1220 1.0000000000000e+00 1221 1221 1.0000000000000e+00 1222 1222 1.0000000000000e+00 1223 1223 1.0000000000000e+00 1224 1224 1.0000000000000e+00 1225 1225 1.0000000000000e+00 1226 1226 1.0000000000000e+00 1227 1227 1.0000000000000e+00 1228 1228 1.0000000000000e+00 1229 1229 1.0000000000000e+00 1230 1230 1.0000000000000e+00 1231 1231 1.0000000000000e+00 1232 1232 1.0000000000000e+00 1233 1233 1.0000000000000e+00 1234 1234 1.0000000000000e+00 1235 1235 1.0000000000000e+00 1236 1236 1.0000000000000e+00 133 1237 -2.5994143000000e+00 135 1237 -9.4695072000000e-02 1237 1237 1.9983945000000e+02 1239 1237 2.6103739000000e-01 1240 1237 -1.8307631000000e-01 1242 1237 -3.0282569000000e-02 1285 1237 -2.6654401000000e+00 1287 1237 -5.6301327000000e-02 133 1238 1.0350072000000e+01 135 1238 -9.0991269000000e-01 1237 1238 -1.3370690000000e+02 1238 1238 -2.8933988000000e+01 1239 1238 2.0907142000000e+00 1242 1238 -6.3656354000000e-01 1285 1238 1.1613324000000e+01 1287 1238 -5.4102785000000e-01 133 1239 1.7495750000000e+01 134 1239 -1.8416690000000e+00 135 1239 -1.5381153000000e+00 1237 1239 -2.2601800000000e+02 1238 1239 2.6839463000000e+01 1239 1239 3.5341416000000e+00 1242 1239 -1.0760470000000e+00 1285 1239 1.9631152000000e+01 1286 1239 -2.0664493000000e+00 1287 1239 -9.1455284000000e-01 136 1240 -2.0304410000000e+00 138 1240 -5.7589129000000e-02 1237 1240 -5.0296613000000e-01 1239 1240 -3.0282569000000e-02 1240 1240 1.8993261000000e+02 1242 1240 3.9513066000000e-01 1243 1240 -1.5909447000000e-01 1245 1240 -1.7631713000000e-02 1288 1240 -2.0257365000000e+00 1290 1240 -3.0138742000000e-02 2344 1240 -1.6231279000000e+00 2346 1240 -1.7988385000000e-01 136 1241 1.1063571000000e+01 138 1241 -1.2106635000000e+00 1237 1241 1.5421811000000e+00 1239 1241 -6.3656354000000e-01 1240 1241 -1.3058767000000e+02 1241 1241 -2.9175140000000e+01 1242 1241 4.0757323000000e+00 1245 1241 -6.8751686000000e-01 1288 1241 1.2447368000000e+01 1290 1241 -6.3364510000000e-01 2346 1241 -9.0410623000000e-01 136 1242 1.8701860000000e+01 137 1242 -2.2185372000000e+00 138 1242 -2.0465056000000e+00 1237 1242 2.6069029000000e+00 1238 1242 -3.0924792000000e-01 1239 1242 -1.0760470000000e+00 1240 1242 -2.2074539000000e+02 1241 1242 2.8144064000000e+01 1242 1242 6.8896171000000e+00 1245 1242 -1.1621777000000e+00 1288 1242 2.1041031000000e+01 1289 1242 -2.4960249000000e+00 1290 1242 -1.0711137000000e+00 2346 1242 -1.5283012000000e+00 139 1243 -1.5798380000000e+00 141 1243 -3.7800198000000e-02 1240 1243 -3.0421249000000e-01 1242 1243 -1.7631713000000e-02 1243 1243 1.7737888000000e+02 1245 1243 2.5785878000000e-01 1246 1243 -1.0992009000000e-01 1248 1243 -9.7964493000000e-03 1291 1243 -1.5190962000000e+00 1293 1243 -1.7293696000000e-02 2347 1243 -1.0753633000000e+00 2349 1243 -9.5840005000000e-02 139 1244 1.0271379000000e+01 141 1244 -1.4740605000000e+00 1240 1244 7.6804050000000e-01 1242 1244 -6.8751686000000e-01 1243 1244 -1.2169148000000e+02 1244 1244 -2.8598581000000e+01 1245 1244 4.9391117000000e+00 1248 1244 -7.2186927000000e-01 1291 1244 1.1326966000000e+01 1293 1244 -6.7444889000000e-01 2349 1244 -1.3780428000000e+00 139 1245 1.7362727000000e+01 140 1245 -2.2457823000000e+00 141 1245 -2.4917501000000e+00 1240 1245 1.2982948000000e+00 1241 1245 -1.6792798000000e-01 1242 1245 -1.1621777000000e+00 1243 1245 -2.0570714000000e+02 1244 1245 2.7549954000000e+01 1245 1245 8.3490693000000e+00 1248 1245 -1.2202478000000e+00 1291 1245 1.9147090000000e+01 1292 1245 -2.4765803000000e+00 1293 1245 -1.1400876000000e+00 2349 1245 -2.3294416000000e+00 142 1246 -1.2449286000000e+00 144 1246 -2.3819524000000e-02 1243 1246 -2.1725091000000e-01 1245 1246 -9.7964493000000e-03 1246 1246 1.6530078000000e+02 1248 1246 1.7101052000000e-01 1294 1246 -1.0736056000000e+00 1296 1246 -9.6005376000000e-03 2350 1246 -7.7598780000000e-01 2352 1246 -4.8389152000000e-02 142 1247 9.9607313000000e+00 144 1247 -1.7553192000000e+00 1243 1247 3.9035433000000e-01 1245 1247 -7.2186927000000e-01 1246 1247 -1.1383567000000e+02 1247 1247 -2.7734053000000e+01 1248 1247 5.0443281000000e+00 1294 1247 1.0369892000000e+01 1296 1247 -7.0754460000000e-01 2352 1247 -1.8565169000000e+00 142 1248 1.6837620000000e+01 143 1248 -2.2908186000000e+00 144 1248 -2.9671916000000e+00 1243 1248 6.5985496000000e-01 1244 1248 -8.9775633000000e-02 1245 1248 -1.2202478000000e+00 1246 1248 -1.9242782000000e+02 1247 1248 2.6733771000000e+01 1248 1248 8.5269322000000e+00 1294 1248 1.7529266000000e+01 1295 1248 -2.3849195000000e+00 1296 1248 -1.1960334000000e+00 2352 1248 -3.1382562000000e+00 1249 1249 1.0000000000000e+00 1250 1250 1.0000000000000e+00 1251 1251 1.0000000000000e+00 1252 1252 1.0000000000000e+00 1253 1253 1.0000000000000e+00 1254 1254 1.0000000000000e+00 1255 1255 1.0000000000000e+00 1256 1256 1.0000000000000e+00 1257 1257 1.0000000000000e+00 1258 1258 1.0000000000000e+00 1259 1259 1.0000000000000e+00 1260 1260 1.0000000000000e+00 1261 1261 1.0000000000000e+00 1262 1262 1.0000000000000e+00 1263 1263 1.0000000000000e+00 160 1264 -9.4341750000000e-01 162 1264 -1.5588662000000e-02 1264 1264 2.7372638000000e+02 1266 1264 1.8675300000000e-01 1267 1264 -3.1063380000000e-01 1269 1264 -1.7255584000000e-02 1312 1264 -1.5953616000000e+00 1314 1264 -1.7181733000000e-02 2368 1264 -9.1320914000000e-01 2370 1264 -5.6946019000000e-02 160 1265 7.7871889000000e+00 162 1265 -1.0375061000000e+00 1264 1265 -1.7821273000000e+02 1265 1265 -4.6024490000000e+01 1266 1265 4.0170978000000e+00 1269 1265 -9.2429644000000e-01 1312 1265 1.5256565000000e+01 1314 1265 -1.1435802000000e+00 2370 1265 -9.0660211000000e-01 160 1266 1.3163464000000e+01 161 1266 -1.7642359000000e+00 162 1266 -1.7538002000000e+00 1264 1266 -3.0125080000000e+02 1265 1266 4.1622307000000e+01 1266 1266 6.7905012000000e+00 1269 1266 -1.5624298000000e+00 1312 1266 2.5789698000000e+01 1313 1266 -3.4564694000000e+00 1314 1266 -1.9331079000000e+00 2370 1266 -1.5325202000000e+00 163 1267 -1.3679222000000e+00 165 1267 -3.7420658000000e-02 1264 1267 -1.5570059000000e-01 1266 1267 -1.7255584000000e-02 1267 1267 2.7429668000000e+02 1269 1267 2.2662886000000e-01 1270 1267 -4.5924620000000e-01 1272 1267 -5.0896157000000e-02 1315 1267 -2.3447556000000e+00 1317 1267 -4.1112199000000e-02 163 1268 7.2414355000000e+00 165 1268 -8.3688804000000e-01 1264 1268 6.6831393000000e-03 1266 1268 -9.2429644000000e-01 1267 1268 -1.7646757000000e+02 1268 1268 -4.3113782000000e+01 1269 1268 3.5454112000000e+00 1272 1268 -8.5993164000000e-01 1315 1268 1.4043798000000e+01 1317 1268 -9.1950682000000e-01 163 1269 1.2240915000000e+01 164 1269 -1.4746526000000e+00 165 1269 -1.4146747000000e+00 1264 1269 1.1297172000000e-02 1265 1269 -1.3609606000000e-03 1266 1269 -1.5624298000000e+00 1267 1269 -2.9830062000000e+02 1268 1269 3.8450812000000e+01 1269 1269 5.9931604000000e+00 1272 1269 -1.4536284000000e+00 1315 1269 2.3739623000000e+01 1316 1269 -2.8598919000000e+00 1317 1269 -1.5543334000000e+00 166 1270 -1.5307554000000e+00 168 1270 -4.6029227000000e-02 1267 1270 -4.2528600000000e-01 1269 1270 -5.0896157000000e-02 1270 1270 2.7499971000000e+02 1272 1270 2.7845349000000e-01 1273 1270 -3.7315851000000e-01 1275 1270 -5.0886177000000e-02 1318 1270 -2.6999874000000e+00 1320 1270 -5.0646805000000e-02 166 1271 7.3587639000000e+00 168 1271 -7.7776517000000e-01 1267 1271 3.5203495000000e-01 1269 1271 -8.5993164000000e-01 1270 1271 -1.7669933000000e+02 1271 1271 -4.2206845000000e+01 1272 1271 3.3582000000000e+00 1275 1271 -8.5997629000000e-01 1318 1271 1.3811176000000e+01 1320 1271 -8.5583973000000e-01 166 1272 1.2439255000000e+01 167 1272 -1.4685408000000e+00 168 1272 -1.3147342000000e+00 1267 1272 5.9507987000000e-01 1268 1272 -7.0253332000000e-02 1269 1272 -1.4536284000000e+00 1270 1272 -2.9869255000000e+02 1271 1272 3.7696049000000e+01 1272 1272 5.6767002000000e+00 1275 1272 -1.4537028000000e+00 1318 1272 2.3346412000000e+01 1319 1272 -2.7562069000000e+00 1320 1272 -1.4467115000000e+00 169 1273 -1.5171271000000e+00 171 1273 -4.5988738000000e-02 1270 1273 -4.3522813000000e-01 1272 1273 -5.0886177000000e-02 1273 1273 2.7494106000000e+02 1275 1273 2.6592512000000e-01 1276 1273 -2.8159209000000e-01 1278 1273 -3.8399619000000e-02 1321 1273 -2.7363301000000e+00 1323 1273 -5.0655485000000e-02 169 1274 7.2782798000000e+00 171 1274 -7.7727817000000e-01 1270 1274 3.7276885000000e-01 1272 1274 -8.5997629000000e-01 1273 1274 -1.7682748000000e+02 1274 1274 -4.2207454000000e+01 1275 1274 3.4315562000000e+00 1278 1274 -9.3341499000000e-01 1321 1274 1.3998636000000e+01 1323 1274 -8.5619956000000e-01 169 1275 1.2303195000000e+01 170 1275 -1.4525767000000e+00 171 1275 -1.3139100000000e+00 1270 1275 6.3012799000000e-01 1271 1275 -7.4396062000000e-02 1272 1275 -1.4537028000000e+00 1273 1275 -2.9890894000000e+02 1274 1275 3.7723230000000e+01 1275 1275 5.8006993000000e+00 1278 1275 -1.5778447000000e+00 1321 1275 2.3663276000000e+01 1322 1275 -2.7938047000000e+00 1323 1275 -1.4473186000000e+00 172 1276 -1.3225046000000e+00 174 1276 -3.5749077000000e-02 1273 1276 -4.2846889000000e-01 1275 1276 -3.8399619000000e-02 1276 1276 2.6894547000000e+02 1278 1276 2.1794486000000e-01 1279 1276 -2.3129015000000e-01 1281 1276 -2.5632829000000e-02 1324 1276 -2.3927782000000e+00 1326 1276 -3.8254744000000e-02 172 1277 7.0173118000000e+00 174 1277 -8.6906437000000e-01 1273 1277 5.3178770000000e-01 1275 1277 -9.3341499000000e-01 1276 1277 -1.7415171000000e+02 1277 1277 -4.2499768000000e+01 1278 1277 3.7247494000000e+00 1281 1277 -9.8752534000000e-01 1324 1277 1.4529641000000e+01 1326 1277 -9.3002484000000e-01 172 1278 1.1862064000000e+01 173 1278 -1.4575026000000e+00 174 1278 -1.4690664000000e+00 1273 1278 8.9893392000000e-01 1274 1278 -1.1045283000000e-01 1275 1278 -1.5778447000000e+00 1276 1278 -2.9438605000000e+02 1277 1278 3.8216679000000e+01 1278 1278 6.2963151000000e+00 1281 1278 -1.6693115000000e+00 1324 1278 2.4560905000000e+01 1325 1278 -3.0178208000000e+00 1326 1278 -1.5721140000000e+00 175 1279 -1.1990370000000e+00 177 1279 -2.6535070000000e-02 1276 1279 -4.8675089000000e-01 1278 1279 -2.5632829000000e-02 1279 1279 2.5345377000000e+02 1281 1279 2.7783541000000e-01 1282 1279 -1.6380963000000e-01 1284 1279 -1.4599267000000e-02 1327 1279 -2.0431895000000e+00 1329 1279 -2.5273315000000e-02 2383 1279 -1.1895630000000e+00 2385 1279 -1.0601787000000e-01 175 1280 7.5441924000000e+00 177 1280 -1.0223718000000e+00 1276 1280 1.6053408000000e+00 1278 1280 -9.8752534000000e-01 1279 1280 -1.6708346000000e+02 1280 1280 -4.1094302000000e+01 1281 1280 4.7692005000000e+00 1284 1280 -1.0151535000000e+00 1327 1280 1.5172454000000e+01 1329 1280 -9.7381837000000e-01 2385 1280 -7.6576743000000e-01 175 1281 1.2752693000000e+01 176 1281 -1.6457484000000e+00 177 1281 -1.7282160000000e+00 1276 1281 2.7136660000000e+00 1277 1281 -3.5020145000000e-01 1278 1281 -1.6693115000000e+00 1279 1281 -2.8243766000000e+02 1280 1281 3.7822306000000e+01 1281 1281 8.0618517000000e+00 1284 1281 -1.7160154000000e+00 1327 1281 2.5647495000000e+01 1328 1281 -3.3098362000000e+00 1329 1281 -1.6461413000000e+00 2385 1281 -1.2944525000000e+00 178 1282 -9.4429877000000e-01 180 1282 -1.7904448000000e-02 1279 1282 -3.2832762000000e-01 1281 1282 -1.4599267000000e-02 1282 1282 2.3061226000000e+02 1284 1282 1.9055436000000e-01 1285 1282 -2.7684053000000e-01 1287 1282 -1.3444978000000e-02 1330 1282 -1.4800182000000e+00 1332 1282 -1.4389328000000e-02 2386 1282 -8.1124421000000e-01 2388 1282 -5.0587676000000e-02 178 1283 7.0004257000000e+00 180 1283 -1.2450844000000e+00 1279 1283 7.7100684000000e-01 1281 1283 -1.0151535000000e+00 1282 1283 -1.5247358000000e+02 1283 1283 -3.8737952000000e+01 1284 1283 5.3963467000000e+00 1285 1283 3.3671755000000e-02 1287 1283 -9.3492686000000e-01 1330 1283 1.4324093000000e+01 1332 1283 -1.0007156000000e+00 2388 1283 -1.1961635000000e+00 178 1284 1.1833520000000e+01 179 1284 -1.5965280000000e+00 180 1284 -2.1046906000000e+00 1279 1284 1.3033100000000e+00 1280 1284 -1.7583702000000e-01 1281 1284 -1.7160154000000e+00 1282 1284 -2.5774134000000e+02 1283 1284 3.5691370000000e+01 1284 1284 9.1219845000000e+00 1285 1284 5.6918735000000e-02 1286 1284 -7.6792327000000e-03 1287 1284 -1.5804004000000e+00 1330 1284 2.4213447000000e+01 1331 1284 -3.2667749000000e+00 1332 1284 -1.6916096000000e+00 2388 1284 -2.0219947000000e+00 181 1285 -4.9113639000000e-01 183 1285 -8.8105909000000e-03 1237 1285 -1.9213504000000e+00 1239 1285 -5.6301327000000e-02 1282 1285 -4.5882599000000e-01 1284 1285 -1.3444978000000e-02 1285 1285 2.1517023000000e+02 1287 1285 1.1397561000000e-01 1288 1285 -9.6336002000000e-02 1290 1285 -2.8229337000000e-03 1333 1285 -7.4843137000000e-01 1335 1285 -6.0525091000000e-03 2389 1285 -8.8396792000000e-01 2391 1285 -2.5902910000000e-02 181 1286 4.3571752000000e+00 183 1286 -1.5144038000000e+00 1239 1286 -5.4102785000000e-01 1284 1286 -9.3492686000000e-01 1285 1286 -1.3784731000000e+02 1286 1286 -3.7353073000000e+01 1287 1286 6.6361713000000e+00 1290 1286 -1.0486939000000e+00 1333 1286 1.2460168000000e+01 1335 1286 -1.0404125000000e+00 2391 1286 -1.5525563000000e+00 181 1287 7.3653644000000e+00 182 1287 -1.0349868000000e+00 183 1287 -2.5599466000000e+00 1239 1287 -9.1455284000000e-01 1284 1287 -1.5804004000000e+00 1285 1287 -2.3301694000000e+02 1286 1287 3.3533235000000e+01 1287 1287 1.1217779000000e+01 1290 1287 -1.7727122000000e+00 1333 1287 2.1062655000000e+01 1334 1287 -2.9597410000000e+00 1335 1287 -1.7587122000000e+00 2391 1287 -2.6244395000000e+00 184 1288 -3.5135249000000e-01 186 1288 -4.7336046000000e-03 1240 1288 -1.7041409000000e+00 1242 1288 -3.0138742000000e-02 1285 1288 -2.0094568000000e-01 1287 1288 -2.8229337000000e-03 1288 1288 1.9779559000000e+02 1290 1288 5.3736241000000e-02 1291 1288 -1.0674129000000e-01 1293 1288 -1.8877829000000e-03 1336 1288 -4.5062396000000e-01 1338 1288 -2.7784901000000e-03 2392 1288 -6.1217237000000e-01 2394 1288 -1.0826631000000e-02 184 1289 3.1476727000000e+00 186 1289 -1.7586124000000e+00 1242 1289 -6.3364510000000e-01 1285 1289 1.5631499000000e+00 1287 1289 -1.0486939000000e+00 1288 1289 -1.2762179000000e+02 1289 1289 -3.5250430000000e+01 1290 1289 7.4250632000000e+00 1293 1289 -9.9184626000000e-01 1336 1289 1.1194629000000e+01 1338 1289 -1.0323390000000e+00 2394 1289 -1.9560092000000e+00 184 1290 5.3208259000000e+00 185 1290 -7.7296038000000e-01 186 1290 -2.9727583000000e+00 1242 1290 -1.0711137000000e+00 1285 1290 2.6423486000000e+00 1286 1290 -3.8385597000000e-01 1287 1290 -1.7727122000000e+00 1288 1290 -2.1573187000000e+02 1289 1290 3.1772134000000e+01 1290 1290 1.2551325000000e+01 1293 1290 -1.6766156000000e+00 1336 1290 1.8923400000000e+01 1337 1290 -2.7490166000000e+00 1338 1290 -1.7450659000000e+00 2394 1290 -3.3064380000000e+00 187 1291 -2.8222379000000e-01 189 1291 -3.7533603000000e-03 1243 1291 -9.7784090000000e-01 1245 1291 -1.7293696000000e-02 1288 1291 -1.5896989000000e-01 1290 1291 -1.8877829000000e-03 1291 1291 1.8041258000000e+02 1293 1291 3.3488050000000e-02 1294 1291 -7.8484528000000e-02 1296 1291 -1.3880454000000e-03 1339 1291 -3.5805095000000e-01 1341 1291 -1.8557042000000e-03 2395 1291 -3.8579490000000e-01 2397 1291 -6.8230113000000e-03 187 1292 2.7004002000000e+00 189 1292 -1.9721237000000e+00 1245 1292 -6.7444889000000e-01 1288 1292 2.0088489000000e+00 1290 1292 -9.9184626000000e-01 1291 1292 -1.1678376000000e+02 1292 1292 -3.2598054000000e+01 1293 1292 7.8000515000000e+00 1296 1292 -9.3479640000000e-01 1339 1292 9.6689609000000e+00 1341 1292 -9.7512180000000e-01 2397 1292 -2.2480915000000e+00 187 1293 4.5647529000000e+00 188 1293 -6.8172614000000e-01 189 1293 -3.3336753000000e+00 1245 1293 -1.1400876000000e+00 1288 1293 3.3957556000000e+00 1289 1293 -5.0714144000000e-01 1290 1293 -1.6766156000000e+00 1291 1293 -1.9741111000000e+02 1292 1293 2.9396479000000e+01 1293 1293 1.3185199000000e+01 1296 1293 -1.5801798000000e+00 1339 1293 1.6344398000000e+01 1340 1293 -2.4409657000000e+00 1341 1293 -1.6483446000000e+00 2397 1293 -3.8001718000000e+00 190 1294 -2.4677947000000e-01 192 1294 -3.1688925000000e-03 1246 1294 -5.4284512000000e-01 1248 1294 -9.6005376000000e-03 1291 1294 -1.1892199000000e-01 1293 1294 -1.3880454000000e-03 1294 1294 1.6891509000000e+02 1296 1294 2.2088858000000e-02 1342 1294 -2.8875352000000e-01 1344 1294 -1.3818955000000e-03 2398 1294 -3.4495919000000e-01 2400 1294 -6.1008077000000e-03 190 1295 2.6224513000000e+00 192 1295 -2.1342173000000e+00 1248 1295 -7.0754460000000e-01 1291 1295 1.5524766000000e+00 1293 1295 -9.3479640000000e-01 1294 1295 -1.0842997000000e+02 1295 1295 -3.0770477000000e+01 1296 1295 7.1518116000000e+00 1342 1295 8.0561138000000e+00 1344 1295 -9.3077878000000e-01 2400 1295 -2.4410548000000e+00 190 1296 4.4329917000000e+00 191 1296 -6.7205137000000e-01 192 1296 -3.6076809000000e+00 1248 1296 -1.1960334000000e+00 1291 1296 2.6243064000000e+00 1292 1296 -3.9785068000000e-01 1293 1296 -1.5801798000000e+00 1294 1296 -1.8329003000000e+02 1295 1296 2.7455917000000e+01 1296 1296 1.2089422000000e+01 1342 1296 1.3618055000000e+01 1343 1296 -2.0645273000000e+00 1344 1296 -1.5733884000000e+00 2400 1296 -4.1263590000000e+00 1297 1297 1.0000000000000e+00 1298 1298 1.0000000000000e+00 1299 1299 1.0000000000000e+00 1300 1300 1.0000000000000e+00 1301 1301 1.0000000000000e+00 1302 1302 1.0000000000000e+00 1303 1303 1.0000000000000e+00 1304 1304 1.0000000000000e+00 1305 1305 1.0000000000000e+00 1306 1306 1.0000000000000e+00 1307 1307 1.0000000000000e+00 1308 1308 1.0000000000000e+00 1309 1309 1.0000000000000e+00 1310 1310 1.0000000000000e+00 1311 1311 1.0000000000000e+00 208 1312 -2.2967574000000e-01 210 1312 -2.5591232000000e-03 1264 1312 -9.7151014000000e-01 1266 1312 -1.7181733000000e-02 1312 1312 2.7223071000000e+02 1314 1312 3.2932197000000e-02 1315 1312 -1.7210740000000e-01 1317 1312 -2.8294990000000e-03 1360 1312 -5.3250509000000e-01 1362 1312 -2.8194601000000e-03 2416 1312 -3.8467931000000e-01 2418 1312 -6.8032816000000e-03 208 1313 3.2697759000000e+00 210 1313 -1.2998960000000e+00 1266 1313 -1.1435802000000e+00 1312 1313 -1.7317694000000e+02 1313 1313 -4.9368972000000e+01 1314 1313 6.7511947000000e+00 1315 1313 4.9197405000000e-01 1317 1313 -1.4371314000000e+00 1360 1313 1.4275476000000e+01 1362 1313 -1.4322317000000e+00 2418 1313 -1.4328639000000e+00 208 1314 5.5272291000000e+00 209 1314 -8.2353642000000e-01 210 1314 -2.1973442000000e+00 1266 1314 -1.9331079000000e+00 1312 1314 -2.9273829000000e+02 1313 1314 4.3512859000000e+01 1314 1314 1.1412219000000e+01 1315 1314 8.3163294000000e-01 1316 1314 -1.2391019000000e-01 1317 1314 -2.4293269000000e+00 1360 1314 2.4131264000000e+01 1361 1314 -3.5954678000000e+00 1362 1314 -2.4210445000000e+00 2418 1314 -2.4221131000000e+00 211 1315 -2.4668124000000e-01 213 1315 -2.8842481000000e-03 1267 1315 -2.3246153000000e+00 1269 1315 -4.1112199000000e-02 1312 1315 -1.5998893000000e-01 1314 1315 -2.8294990000000e-03 1315 1315 2.7395310000000e+02 1317 1315 6.3605256000000e-02 1318 1315 -1.8438923000000e-01 1320 1315 -3.1910365000000e-03 1363 1315 -5.5027657000000e-01 1365 1315 -3.1808633000000e-03 2419 1315 -5.4619795000000e-01 2421 1315 -9.6598344000000e-03 211 1316 3.1960331000000e+00 213 1316 -1.2865738000000e+00 1269 1316 -9.1950682000000e-01 1314 1316 -1.4371314000000e+00 1315 1316 -1.7264244000000e+02 1316 1316 -4.9216982000000e+01 1317 1316 7.8573807000000e+00 1318 1316 1.6264263000000e-01 1320 1316 -1.4233134000000e+00 1363 1316 1.4143033000000e+01 1365 1316 -1.4189740000000e+00 2421 1316 -1.3664069000000e+00 211 1317 5.4025700000000e+00 212 1317 -7.9723475000000e-01 213 1317 -2.1748226000000e+00 1269 1317 -1.5543334000000e+00 1314 1317 -2.4293269000000e+00 1315 1317 -2.9183455000000e+02 1316 1317 4.3218287000000e+01 1317 1317 1.3282108000000e+01 1318 1317 2.7493090000000e-01 1319 1317 -4.0570407000000e-02 1320 1317 -2.4059670000000e+00 1363 1317 2.3907365000000e+01 1364 1317 -3.5279108000000e+00 1365 1317 -2.3986317000000e+00 2421 1317 -2.3097726000000e+00 214 1318 -2.8443899000000e-01 216 1318 -3.5153406000000e-03 1270 1318 -2.8637324000000e+00 1272 1318 -5.0646805000000e-02 1315 1318 -1.8043142000000e-01 1317 1318 -3.1910365000000e-03 1318 1318 2.7481093000000e+02 1320 1318 7.8662068000000e-02 1321 1318 -2.4138800000000e-01 1323 1318 -4.2690898000000e-03 1366 1318 -5.9699022000000e-01 1368 1318 -3.8802399000000e-03 2422 1318 -7.0088362000000e-01 2424 1318 -1.2395542000000e-02 214 1319 3.2664290000000e+00 216 1319 -1.2614183000000e+00 1272 1319 -8.5583973000000e-01 1317 1319 -1.4233134000000e+00 1318 1319 -1.7281288000000e+02 1319 1319 -4.8921717000000e+01 1320 1319 7.6431732000000e+00 1323 1319 -1.3833851000000e+00 1366 1319 1.4403206000000e+01 1368 1319 -1.3924364000000e+00 2424 1319 -1.3213394000000e+00 214 1320 5.5215716000000e+00 215 1320 -7.9947677000000e-01 216 1320 -2.1323014000000e+00 1272 1320 -1.4467115000000e+00 1317 1320 -2.4059670000000e+00 1318 1320 -2.9212289000000e+02 1319 1320 4.2950807000000e+01 1320 1320 1.2920016000000e+01 1323 1320 -2.3384726000000e+00 1366 1320 2.4347179000000e+01 1367 1320 -3.5252652000000e+00 1368 1320 -2.3537745000000e+00 2424 1320 -2.2335922000000e+00 217 1321 -2.6456607000000e-01 219 1321 -3.8554926000000e-03 1273 1321 -1.7286792000000e+00 1275 1321 -5.0655485000000e-02 1318 1321 -1.5451154000000e-01 1320 1321 -4.2690898000000e-03 1321 1321 2.7349579000000e+02 1323 1321 8.2507420000000e-02 1324 1321 -1.4526412000000e-01 1326 1321 -4.2566742000000e-03 1369 1321 -7.6581908000000e-01 1371 1321 -4.2558043000000e-03 2425 1321 -4.9287455000000e-01 2427 1321 -1.4442702000000e-02 217 1322 3.0876061000000e+00 219 1322 -1.2494341000000e+00 1275 1322 -8.5619956000000e-01 1318 1322 2.4181193000000e-01 1320 1322 -1.3833851000000e+00 1321 1322 -1.7276544000000e+02 1322 1322 -4.8774953000000e+01 1323 1322 7.5456821000000e+00 1326 1322 -1.3835616000000e+00 1369 1322 1.4291331000000e+01 1371 1322 -1.3792433000000e+00 2427 1322 -1.2884342000000e+00 217 1323 5.2192858000000e+00 218 1323 -7.7639466000000e-01 219 1323 -2.1120419000000e+00 1275 1323 -1.4473186000000e+00 1318 1323 4.0875861000000e-01 1319 1323 -6.0804872000000e-02 1320 1323 -2.3384726000000e+00 1321 1323 -2.9204251000000e+02 1322 1323 4.2945063000000e+01 1323 1323 1.2755213000000e+01 1326 1323 -2.3387725000000e+00 1369 1323 2.4158050000000e+01 1370 1323 -3.5936298000000e+00 1371 1323 -2.3314713000000e+00 2427 1323 -2.1779671000000e+00 220 1324 -2.5348871000000e-01 222 1324 -3.8426087000000e-03 1276 1324 -1.3054890000000e+00 1278 1324 -3.8254744000000e-02 1321 1324 -1.7752046000000e-01 1323 1324 -4.2566742000000e-03 1324 1324 2.7306577000000e+02 1326 1324 6.9051934000000e-02 1327 1324 -1.1080353000000e-01 1329 1324 -3.2468757000000e-03 1372 1324 -7.8112229000000e-01 1374 1324 -4.2450288000000e-03 2428 1324 -4.9257780000000e-01 2430 1324 -1.4434007000000e-02 220 1325 2.8481953000000e+00 222 1325 -1.2490543000000e+00 1278 1325 -9.3002484000000e-01 1321 1325 7.5067591000000e-01 1323 1325 -1.3835616000000e+00 1324 1325 -1.7340412000000e+02 1325 1325 -4.8777713000000e+01 1326 1325 7.6252238000000e+00 1329 1325 -1.3893338000000e+00 1372 1325 1.4659879000000e+01 1374 1325 -1.3799393000000e+00 2430 1325 -1.2878855000000e+00 220 1326 4.8145894000000e+00 221 1326 -7.1633806000000e-01 222 1326 -2.1114013000000e+00 1278 1326 -1.5721140000000e+00 1321 1326 1.2689425000000e+00 1322 1326 -1.8879944000000e-01 1323 1326 -2.3387725000000e+00 1324 1326 -2.9312233000000e+02 1325 1326 4.3110071000000e+01 1326 1326 1.2889677000000e+01 1329 1326 -2.3485284000000e+00 1372 1326 2.4781060000000e+01 1373 1326 -3.6870468000000e+00 1374 1326 -2.3326495000000e+00 2430 1326 -2.1770417000000e+00 223 1327 -2.4545835000000e-01 225 1327 -3.1193424000000e-03 1279 1327 -1.4290341000000e+00 1281 1327 -2.5273315000000e-02 1324 1327 -2.1351350000000e-01 1326 1327 -3.2468757000000e-03 1327 1327 2.6218126000000e+02 1329 1327 4.5701364000000e-02 1330 1327 -1.0206592000000e-01 1332 1327 -1.8050962000000e-03 1375 1327 -5.7719046000000e-01 1377 1327 -3.2392722000000e-03 2431 1327 -4.6913868000000e-01 2433 1327 -8.2969956000000e-03 223 1328 2.6556692000000e+00 225 1328 -1.3348595000000e+00 1281 1328 -9.7381837000000e-01 1324 1328 1.1211317000000e+00 1326 1328 -1.3893338000000e+00 1327 1328 -1.6777298000000e+02 1328 1328 -4.7196986000000e+01 1329 1328 7.9181472000000e+00 1332 1328 -1.3662471000000e+00 1375 1328 1.5059125000000e+01 1377 1328 -1.3862673000000e+00 2433 1328 -1.4623719000000e+00 223 1329 4.4891401000000e+00 224 1329 -6.6023896000000e-01 225 1329 -2.2564449000000e+00 1281 1329 -1.6461413000000e+00 1324 1329 1.8951598000000e+00 1325 1329 -2.7873005000000e-01 1326 1329 -2.3485284000000e+00 1327 1329 -2.8360325000000e+02 1328 1329 4.1945986000000e+01 1329 1329 1.3384829000000e+01 1332 1329 -2.3095040000000e+00 1375 1329 2.5455928000000e+01 1376 1329 -3.7439226000000e+00 1377 1329 -2.3433446000000e+00 2433 1329 -2.4719924000000e+00 226 1330 -1.6964017000000e-01 228 1330 -1.9490968000000e-03 1282 1330 -8.1361864000000e-01 1284 1330 -1.4389328000000e-02 1327 1330 -1.4452863000000e-01 1329 1330 -1.8050962000000e-03 1330 1330 2.4486254000000e+02 1332 1330 2.6182592000000e-02 1333 1330 -5.4021312000000e-02 1335 1330 -9.5539891000000e-04 1378 1330 -4.7203252000000e-01 1380 1330 -1.7830369000000e-03 2434 1330 -2.6316000000000e-01 2436 1330 -4.6541406000000e-03 226 1331 2.2969720000000e+00 228 1331 -1.4753468000000e+00 1284 1331 -1.0007156000000e+00 1327 1331 1.6297685000000e+00 1329 1331 -1.3662471000000e+00 1330 1331 -1.5774793000000e+02 1331 1331 -4.1064603000000e+01 1332 1331 8.1507424000000e+00 1335 1331 -1.2936026000000e+00 1378 1331 1.4196280000000e+01 1380 1331 -1.3497327000000e+00 2436 1331 -1.6601180000000e+00 226 1332 3.8828015000000e+00 227 1332 -5.9213620000000e-01 228 1332 -2.4939263000000e+00 1284 1332 -1.6916096000000e+00 1327 1332 2.7549606000000e+00 1328 1332 -4.2013785000000e-01 1329 1332 -2.3095040000000e+00 1330 1332 -2.6665710000000e+02 1331 1332 4.6264109000000e+01 1332 1332 1.3778014000000e+01 1335 1332 -2.1867046000000e+00 1378 1332 2.3997392000000e+01 1379 1332 -3.6596577000000e+00 1380 1332 -2.2815881000000e+00 2436 1332 -2.8062634000000e+00 229 1333 -1.3642991000000e-01 231 1333 -1.2270051000000e-03 1285 1333 -5.7993932000000e-01 1287 1333 -6.0525091000000e-03 1330 1333 -1.1300694000000e-01 1332 1333 -9.5539891000000e-04 1333 1333 2.2278356000000e+02 1335 1333 1.3701012000000e-02 1336 1333 -5.3377101000000e-02 1338 1333 -5.5706758000000e-04 1381 1333 -2.2680976000000e-01 1383 1333 -9.4287598000000e-04 2437 1333 -3.2536038000000e-01 2439 1333 -3.3956081000000e-03 229 1334 1.8522376000000e+00 231 1334 -1.6614562000000e+00 1287 1334 -1.0404125000000e+00 1330 1334 2.0830028000000e+00 1332 1334 -1.2936026000000e+00 1333 1334 -1.4455120000000e+02 1334 1334 -4.1118626000000e+01 1335 1334 8.3866352000000e+00 1338 1334 -1.2207824000000e+00 1381 1334 1.3404257000000e+01 1383 1334 -1.2768153000000e+00 2439 1334 -1.8889917000000e+00 229 1335 3.1310206000000e+00 230 1335 -4.7319693000000e-01 231 1335 -2.8085241000000e+00 1287 1335 -1.7587122000000e+00 1330 1335 3.5211060000000e+00 1331 1335 -5.3215124000000e-01 1332 1335 -2.1867046000000e+00 1333 1335 -2.4434921000000e+02 1334 1335 3.6879671000000e+01 1335 1335 1.4176761000000e+01 1338 1335 -2.0636106000000e+00 1381 1335 2.2658544000000e+01 1382 1335 -3.4244273000000e+00 1383 1335 -2.1583274000000e+00 2439 1335 -3.1931494000000e+00 232 1336 -9.4691775000000e-02 234 1336 -8.3846689000000e-04 1288 1336 -2.6622936000000e-01 1290 1336 -2.7784901000000e-03 1333 1336 -7.9317551000000e-02 1335 1336 -5.5706758000000e-04 1336 1336 2.0593401000000e+02 1338 1336 7.1190537000000e-03 1339 1336 -3.2430064000000e-02 1341 1336 -3.3845482000000e-04 1384 1336 -1.6328562000000e-01 1386 1336 -5.4926603000000e-04 2440 1336 -1.4818824000000e-01 2442 1336 -1.5465596000000e-03 232 1337 1.4134890000000e+00 234 1337 -1.8375694000000e+00 1290 1337 -1.0323390000000e+00 1333 1337 2.5500288000000e+00 1335 1337 -1.2207824000000e+00 1336 1337 -1.3389236000000e+02 1337 1337 -3.8434575000000e+01 1338 1337 8.5689023000000e+00 1341 1337 -1.1452500000000e+00 1384 1337 1.2028529000000e+01 1386 1337 -1.2038403000000e+00 2442 1337 -2.1248446000000e+00 232 1338 2.3893618000000e+00 233 1338 -3.7068624000000e-01 234 1338 -3.1062273000000e+00 1290 1338 -1.7450659000000e+00 1333 1338 4.3105686000000e+00 1334 1338 -6.6874278000000e-01 1335 1338 -2.0636106000000e+00 1336 1338 -2.2633164000000e+02 1337 1338 3.4516930000000e+01 1338 1338 1.4484871000000e+01 1341 1338 -1.9359292000000e+00 1384 1338 2.0333025000000e+01 1385 1338 -3.1544711000000e+00 1386 1338 -2.0349717000000e+00 2442 1338 -3.5918374000000e+00 235 1339 -5.9815559000000e-02 237 1339 -5.9869776000000e-04 1291 1339 -1.7780986000000e-01 1293 1339 -1.8557042000000e-03 1336 1339 -6.1814214000000e-02 1338 1339 -3.3845482000000e-04 1339 1339 1.8949353000000e+02 1341 1339 4.9610741000000e-03 1342 1339 -1.0790809000000e-02 1344 1339 -1.1261776000000e-04 1387 1339 -1.0917736000000e-01 1389 1339 -3.3334856000000e-04 2443 1339 -1.2089323000000e-01 2445 1339 -1.2616964000000e-03 235 1340 1.1849396000000e+00 237 1340 -2.0259409000000e+00 1293 1340 -9.7512180000000e-01 1336 1340 2.8854936000000e+00 1338 1340 -1.1452500000000e+00 1339 1340 -1.2295136000000e+02 1340 1340 -3.5577035000000e+01 1341 1340 8.7141966000000e+00 1344 1340 -1.0875644000000e+00 1387 1340 1.0289212000000e+01 1389 1340 -1.1280965000000e+00 2445 1340 -2.3482642000000e+00 235 1341 2.0030206000000e+00 236 1341 -3.1551711000000e-01 237 1341 -3.4246482000000e+00 1293 1341 -1.6483446000000e+00 1336 1341 4.8776351000000e+00 1337 1341 -7.6832827000000e-01 1338 1341 -1.9359292000000e+00 1339 1341 -2.0783683000000e+02 1340 1341 3.1890305000000e+01 1341 1341 1.4730469000000e+01 1344 1341 -1.8384188000000e+00 1387 1341 1.7392873000000e+01 1388 1341 -2.7397367000000e+00 1389 1341 -1.9069330000000e+00 2445 1341 -3.9695031000000e+00 238 1342 -1.0052266000000e-03 240 1342 -1.0490999000000e-05 1294 1342 -1.3241047000000e-01 1296 1342 -1.3818955000000e-03 1339 1342 -3.9817283000000e-02 1341 1342 -1.1261776000000e-04 1342 1342 1.7843031000000e+02 1344 1342 2.8591254000000e-03 1390 1342 -2.3448881000000e-02 1392 1342 -1.1074615000000e-04 2446 1342 -7.8631371000000e-02 2448 1342 -8.2063256000000e-04 238 1343 1.0530149000000e+00 240 1343 -2.1889664000000e+00 1296 1343 -9.3077878000000e-01 1339 1343 2.8496034000000e+00 1341 1343 -1.0875644000000e+00 1342 1343 -1.1210207000000e+02 1343 1343 -3.3750151000000e+01 1344 1343 7.8225303000000e+00 1390 1343 5.8141667000000e+00 1392 1343 -1.0695946000000e+00 2448 1343 -2.5418704000000e+00 238 1344 1.7800163000000e+00 239 1344 -2.8562166000000e-01 240 1344 -3.7002288000000e+00 1296 1344 -1.5733884000000e+00 1339 1344 4.8169695000000e+00 1340 1344 -7.7293156000000e-01 1341 1344 -1.8384188000000e+00 1342 1344 -1.8949733000000e+02 1343 1344 2.9257887000000e+01 1344 1344 1.3223205000000e+01 1390 1344 9.8282675000000e+00 1391 1344 -1.5770451000000e+00 1392 1344 -1.8080426000000e+00 2448 1344 -4.2967777000000e+00 1345 1345 1.0000000000000e+00 1346 1346 1.0000000000000e+00 1347 1347 1.0000000000000e+00 1348 1348 1.0000000000000e+00 1349 1349 1.0000000000000e+00 1350 1350 1.0000000000000e+00 1351 1351 1.0000000000000e+00 1352 1352 1.0000000000000e+00 1353 1353 1.0000000000000e+00 1354 1354 1.0000000000000e+00 1355 1355 1.0000000000000e+00 1356 1356 1.0000000000000e+00 1357 1357 1.0000000000000e+00 1358 1358 1.0000000000000e+00 1359 1359 1.0000000000000e+00 256 1360 -7.2977776000000e-04 258 1360 -7.6162909000000e-06 1312 1360 -2.7015503000000e-01 1314 1360 -2.8194601000000e-03 1360 1360 2.7046663000000e+02 1362 1360 5.1151597000000e-03 1363 1360 -3.7651590000000e-02 1365 1360 -3.5388657000000e-04 1408 1360 -1.5377477000000e-01 1410 1360 -3.5321712000000e-04 2464 1360 -8.9063470000000e-02 2466 1360 -9.2950667000000e-04 256 1361 1.6788203000000e+00 258 1361 -1.4261365000000e+00 1314 1361 -1.4322317000000e+00 1360 1361 -1.7189519000000e+02 1361 1361 -4.6745499000000e+01 1362 1361 7.6639625000000e+00 1363 1361 3.6624285000000e-01 1365 1361 -1.5827589000000e+00 1408 1361 1.4741648000000e+01 1410 1361 -1.5799292000000e+00 2466 1361 -1.6372305000000e+00 256 1362 2.8378778000000e+00 257 1362 -4.5011231000000e-01 258 1362 -2.4107412000000e+00 1314 1362 -2.4210445000000e+00 1360 1362 -2.9057162000000e+02 1361 1362 5.1757860000000e+01 1362 1362 1.2955162000000e+01 1363 1362 6.1909691000000e-01 1364 1362 -9.8194198000000e-02 1365 1362 -2.6754957000000e+00 1408 1362 2.4919282000000e+01 1409 1362 -3.9524166000000e+00 1410 1362 -2.6707124000000e+00 2466 1362 -2.7675744000000e+00 259 1363 -7.3412139000000e-04 261 1363 -7.6616229000000e-06 1315 1363 -3.0478396000000e-01 1317 1363 -3.1808633000000e-03 1360 1363 -3.3908703000000e-02 1362 1363 -3.5388657000000e-04 1363 1363 2.7060496000000e+02 1365 1363 6.3467067000000e-03 1366 1363 -5.4179127000000e-02 1368 1363 -5.1886286000000e-04 1411 1363 -1.8816192000000e-01 1413 1363 -5.1772590000000e-04 2467 1363 -1.0603352000000e-01 2469 1363 -1.1066138000000e-03 259 1364 1.7171980000000e+00 261 1364 -1.4116883000000e+00 1317 1364 -1.4189740000000e+00 1362 1364 -1.5827589000000e+00 1363 1364 -1.7228586000000e+02 1364 1364 -5.0782874000000e+01 1365 1364 9.1689950000000e+00 1366 1364 4.3654628000000e-01 1368 1364 -1.5665785000000e+00 1411 1364 1.5021144000000e+01 1413 1364 -1.5633187000000e+00 2469 1364 -1.6200209000000e+00 259 1365 2.9027491000000e+00 260 1365 -4.5568920000000e-01 261 1365 -2.3863159000000e+00 1317 1365 -2.3986317000000e+00 1362 1365 -2.6754957000000e+00 1363 1365 -2.9123177000000e+02 1364 1365 4.4566443000000e+01 1365 1365 1.5499259000000e+01 1366 1365 7.3793721000000e-01 1367 1365 -1.1584536000000e-01 1368 1365 -2.6481421000000e+00 1411 1365 2.5391720000000e+01 1412 1365 -3.9861297000000e+00 1413 1365 -2.6426316000000e+00 2469 1365 -2.7384818000000e+00 262 1366 -8.3648948000000e-02 264 1366 -6.9066782000000e-04 1318 1366 -3.7179683000000e-01 1320 1366 -3.8802399000000e-03 1363 1366 -4.9716401000000e-02 1365 1366 -5.1886286000000e-04 1366 1366 2.7088887000000e+02 1368 1366 8.9254441000000e-03 1369 1366 -7.5229391000000e-02 1371 1366 -7.6641004000000e-04 1414 1366 -2.3217630000000e-01 1416 1366 -7.6427333000000e-04 2470 1366 -1.5613218000000e-01 2472 1366 -1.6294661000000e-03 262 1367 1.7659413000000e+00 264 1367 -1.3900576000000e+00 1320 1367 -1.3924364000000e+00 1365 1367 -1.5665785000000e+00 1366 1367 -1.7267578000000e+02 1367 1367 -5.0522390000000e+01 1368 1367 9.0250451000000e+00 1369 1367 1.7603575000000e-01 1371 1367 -1.5423978000000e+00 1414 1367 1.5619168000000e+01 1416 1367 -1.5382633000000e+00 2472 1367 -1.5896856000000e+00 262 1368 2.9851472000000e+00 263 1368 -4.6135374000000e-01 264 1368 -2.3497534000000e+00 1320 1368 -2.3537745000000e+00 1365 1368 -2.6481421000000e+00 1366 1368 -2.9189114000000e+02 1367 1368 4.4401261000000e+01 1368 1368 1.5255934000000e+01 1369 1368 2.9757084000000e-01 1370 1368 -4.5989498000000e-02 1371 1368 -2.6072693000000e+00 1414 1368 2.6402642000000e+01 1415 1368 -4.0805217000000e+00 1416 1368 -2.6002803000000e+00 2472 1368 -2.6872046000000e+00 265 1369 -9.0841256000000e-02 267 1369 -7.6505808000000e-04 1321 1369 -4.0778265000000e-01 1323 1369 -4.2558043000000e-03 1366 1369 -7.3435877000000e-02 1368 1369 -7.6641004000000e-04 1369 1369 2.7102069000000e+02 1371 1369 1.0247861000000e-02 1372 1369 -8.9236815000000e-02 1374 1369 -9.3131578000000e-04 1417 1369 -2.4653057000000e-01 1419 1369 -8.4683365000000e-04 2473 1369 -1.9183742000000e-01 2475 1369 -2.0021021000000e-03 265 1370 1.7265057000000e+00 267 1370 -1.3827379000000e+00 1323 1370 -1.3792433000000e+00 1368 1370 -1.5423978000000e+00 1369 1370 -1.7309385000000e+02 1370 1370 -5.0435532000000e+01 1371 1370 8.9420690000000e+00 1374 1370 -1.5260234000000e+00 1417 1370 1.6251500000000e+01 1419 1370 -1.5306042000000e+00 2475 1370 -1.5754464000000e+00 265 1371 2.9184835000000e+00 266 1371 -4.4868031000000e-01 267 1371 -2.3373788000000e+00 1323 1371 -2.3314713000000e+00 1368 1371 -2.6072693000000e+00 1369 1371 -2.9259767000000e+02 1370 1371 4.4420332000000e+01 1371 1371 1.5115667000000e+01 1374 1371 -2.5795900000000e+00 1417 1371 2.7471520000000e+01 1418 1371 -4.2234023000000e+00 1419 1371 -2.5873318000000e+00 2475 1371 -2.6631324000000e+00 268 1372 -9.6814191000000e-02 270 1372 -8.3952900000000e-04 1324 1372 -4.0675017000000e-01 1326 1372 -4.2450288000000e-03 1369 1372 -9.3438877000000e-02 1371 1372 -9.3131578000000e-04 1372 1372 2.7107150000000e+02 1374 1372 1.0687625000000e-02 1375 1372 -6.5512219000000e-02 1377 1372 -6.8371516000000e-04 1420 1372 -2.5906107000000e-01 1422 1372 -9.2907918000000e-04 2476 1372 -2.2745387000000e-01 2478 1372 -2.3738115000000e-03 268 1373 1.6122468000000e+00 270 1373 -1.3756968000000e+00 1326 1373 -1.3799393000000e+00 1369 1373 4.1368427000000e-01 1371 1373 -1.5260234000000e+00 1372 1373 -1.7385172000000e+02 1373 1373 -5.0348460000000e+01 1374 1373 8.9215598000000e+00 1377 1373 -1.5502175000000e+00 1420 1373 1.6708277000000e+01 1422 1373 -1.5225090000000e+00 2478 1373 -1.5615681000000e+00 268 1374 2.7253420000000e+00 269 1374 -4.1677580000000e-01 270 1374 -2.3254778000000e+00 1326 1374 -2.3326495000000e+00 1369 1374 6.9929187000000e-01 1370 1374 -1.0693995000000e-01 1371 1374 -2.5795900000000e+00 1372 1374 -2.9387895000000e+02 1373 1374 4.4526891000000e+01 1374 1374 1.5081003000000e+01 1377 1374 -2.6204856000000e+00 1420 1374 2.8243671000000e+01 1421 1374 -4.3191932000000e+00 1422 1374 -2.5736492000000e+00 2478 1374 -2.6396747000000e+00 271 1375 -6.5999328000000e-02 273 1375 -6.1583367000000e-04 1327 1375 -3.1038059000000e-01 1329 1375 -3.2392722000000e-03 1372 1375 -7.5844300000000e-02 1374 1375 -6.8371516000000e-04 1375 1375 2.7077148000000e+02 1377 1375 7.6019344000000e-03 1378 1375 -4.1026695000000e-02 1380 1375 -4.2817315000000e-04 1423 1375 -2.3560074000000e-01 1425 1375 -6.8240063000000e-04 2479 1375 -1.2282236000000e-01 2481 1375 -1.2818297000000e-03 271 1376 1.4359568000000e+00 273 1376 -1.3964088000000e+00 1329 1376 -1.3862673000000e+00 1372 1376 1.0137104000000e+00 1374 1376 -1.5502175000000e+00 1375 1376 -1.7428890000000e+02 1376 1376 -5.0608681000000e+01 1377 1376 9.0132706000000e+00 1380 1376 -1.5252253000000e+00 1423 1376 1.6724953000000e+01 1425 1376 -1.5474048000000e+00 2481 1376 -1.6021115000000e+00 271 1377 2.4273393000000e+00 272 1377 -3.7711731000000e-01 273 1377 -2.3604874000000e+00 1329 1377 -2.3433446000000e+00 1372 1377 1.7135748000000e+00 1373 1377 -2.6622512000000e-01 1374 1377 -2.6204856000000e+00 1375 1377 -2.9461773000000e+02 1376 1377 4.4916084000000e+01 1377 1377 1.5236023000000e+01 1380 1377 -2.5782408000000e+00 1423 1377 2.8271838000000e+01 1424 1377 -4.3923811000000e+00 1425 1377 -2.6157309000000e+00 2481 1377 -2.7082075000000e+00 274 1378 -7.7207549000000e-04 276 1378 -8.0577291000000e-06 1330 1378 -1.7084703000000e-01 1332 1378 -1.7830369000000e-03 1375 1378 -5.8311841000000e-02 1377 1378 -4.2817315000000e-04 1378 1378 2.5425503000000e+02 1380 1378 4.4242257000000e-03 1381 1378 -1.0246567000000e-02 1383 1378 -1.0693781000000e-04 1426 1378 -1.9127099000000e-01 1428 1378 -4.2747906000000e-04 2482 1378 -1.0092811000000e-01 2484 1378 -1.0533314000000e-03 274 1379 1.2813488000000e+00 276 1379 -1.5089297000000e+00 1332 1379 -1.3497327000000e+00 1375 1379 1.6975120000000e+00 1377 1379 -1.5252253000000e+00 1378 1379 -1.6491776000000e+02 1379 1379 -4.7810756000000e+01 1380 1379 9.1070254000000e+00 1383 1379 -1.4596526000000e+00 1426 1379 1.6134038000000e+01 1428 1379 -1.5229139000000e+00 2484 1379 -1.7352467000000e+00 274 1380 2.1659920000000e+00 275 1380 -3.4166937000000e-01 276 1380 -2.5506948000000e+00 1332 1380 -2.2815881000000e+00 1375 1380 2.8694743000000e+00 1376 1380 -4.5263855000000e-01 1377 1380 -2.5782408000000e+00 1378 1380 -2.7877699000000e+02 1379 1380 4.2765198000000e+01 1380 1380 1.5394514000000e+01 1383 1380 -2.4673954000000e+00 1426 1380 2.7272978000000e+01 1427 1380 -4.3021124000000e+00 1428 1380 -2.5743337000000e+00 2484 1380 -2.9332610000000e+00 277 1381 -8.1186756000000e-04 279 1381 -8.4730171000000e-06 1333 1381 -9.0344491000000e-02 1335 1381 -9.4287598000000e-04 1378 1381 -3.4337972000000e-02 1380 1381 -1.0693781000000e-04 1381 1381 2.3782966000000e+02 1383 1381 2.4260529000000e-03 1384 1381 -6.5885284000000e-04 1386 1381 -6.8760863000000e-06 1429 1381 -1.1179913000000e-01 1431 1381 -1.0565836000000e-04 2485 1381 -6.6503128000000e-02 2487 1381 -6.9405673000000e-04 277 1382 1.0325500000000e+00 279 1382 -1.6449913000000e+00 1335 1382 -1.2768153000000e+00 1378 1382 2.3644677000000e+00 1380 1382 -1.4596526000000e+00 1381 1382 -1.5480489000000e+02 1382 1382 -4.5058371000000e+01 1383 1382 9.0804599000000e+00 1386 1382 -1.3549230000000e+00 1429 1382 1.4912651000000e+01 1431 1382 -1.4423564000000e+00 2487 1382 -1.8967026000000e+00 277 1383 1.7454215000000e+00 278 1383 -2.8089742000000e-01 279 1383 -2.7806916000000e+00 1335 1383 -2.1583274000000e+00 1378 1383 3.9968939000000e+00 1379 1383 -6.4323556000000e-01 1380 1383 -2.4673954000000e+00 1381 1383 -2.6168204000000e+02 1382 1383 4.0473282000000e+01 1383 1383 1.5349602000000e+01 1386 1383 -2.2903617000000e+00 1429 1383 2.5208332000000e+01 1430 1383 -4.0568740000000e+00 1431 1383 -2.4381578000000e+00 2487 1383 -3.2061840000000e+00 280 1384 -8.7710119000000e-04 282 1384 -9.1538248000000e-06 1336 1384 -5.2629573000000e-02 1338 1384 -5.4926603000000e-04 1381 1384 -4.4043340000000e-02 1383 1384 -6.8760863000000e-06 1384 1384 2.1612747000000e+02 1386 1384 1.0941948000000e-03 1387 1384 -5.9104318000000e-04 1389 1384 -6.1683940000000e-06 1432 1384 -8.2149322000000e-02 1434 1384 -6.7098090000000e-06 2488 1384 -1.6242420000000e-02 2490 1384 -1.0967924000000e-05 280 1385 8.3364392000000e-01 282 1385 -1.8224369000000e+00 1338 1385 -1.2038403000000e+00 1381 1385 3.0148106000000e+00 1383 1385 -1.3549230000000e+00 1384 1385 -1.4190275000000e+02 1385 1385 -4.1054366000000e+01 1386 1385 9.0787282000000e+00 1389 1385 -1.2428850000000e+00 1432 1385 1.3969117000000e+01 1434 1385 -1.3223121000000e+00 2490 1385 -2.1277579000000e+00 280 1386 1.4091917000000e+00 281 1386 -2.2830455000000e-01 282 1386 -3.0806474000000e+00 1338 1386 -2.0349717000000e+00 1381 1386 5.0962357000000e+00 1382 1386 -8.2564623000000e-01 1383 1386 -2.2903617000000e+00 1384 1386 -2.3987241000000e+02 1385 1386 3.7214192000000e+01 1386 1386 1.5346681000000e+01 1389 1386 -2.1009714000000e+00 1432 1386 2.3613395000000e+01 1433 1386 -3.8256296000000e+00 1434 1386 -2.2352363000000e+00 2490 1386 -3.5967619000000e+00 283 1387 -9.3215578000000e-04 285 1387 -9.7283995000000e-06 1339 1387 -3.1940792000000e-02 1341 1387 -3.3334856000000e-04 1384 1387 -5.8247628000000e-02 1386 1387 -6.1683940000000e-06 1387 1387 1.9996790000000e+02 1389 1387 8.3949727000000e-04 1390 1387 -5.2533485000000e-04 1392 1387 -5.4826322000000e-06 1435 1387 -9.0193798000000e-02 1437 1387 -6.0039162000000e-06 2491 1387 -5.0112401000000e-02 2493 1387 -1.1599637000000e-05 283 1388 7.2120326000000e-01 285 1388 -1.9705921000000e+00 1341 1388 -1.1280965000000e+00 1384 1388 3.9142685000000e+00 1386 1388 -1.2428850000000e+00 1387 1388 -1.3385425000000e+02 1388 1388 -3.7975522000000e+01 1389 1388 9.0385088000000e+00 1392 1388 -1.1456522000000e+00 1435 1388 1.4440091000000e+01 1437 1388 -1.2098873000000e+00 2493 1388 -2.3371655000000e+00 283 1389 1.2191212000000e+00 284 1389 -1.9751333000000e-01 285 1389 -3.3310866000000e+00 1341 1389 -1.9069330000000e+00 1384 1389 6.6166751000000e+00 1385 1389 -1.0719866000000e+00 1386 1389 -2.1009714000000e+00 1387 1389 -2.2626707000000e+02 1388 1389 3.5133565000000e+01 1389 1389 1.5278686000000e+01 1392 1389 -1.9366105000000e+00 1435 1389 2.4409514000000e+01 1436 1389 -3.9546552000000e+00 1437 1389 -2.0451922000000e+00 2493 1389 -3.9507414000000e+00 286 1390 -9.8487380000000e-04 288 1390 -1.0278589000000e-05 1342 1390 -1.0611475000000e-02 1344 1390 -1.1074615000000e-04 1387 1390 -9.3439445000000e-02 1389 1390 -5.4826322000000e-06 1390 1390 1.8369762000000e+02 1392 1390 5.6796279000000e-04 2494 1390 -5.0293461000000e-02 2496 1390 -1.2178326000000e-05 286 1391 7.1032899000000e-01 288 1391 -2.1455762000000e+00 1344 1391 -1.0695946000000e+00 1387 1391 6.9641265000000e+00 1389 1391 -1.1456522000000e+00 1390 1391 -1.1314811000000e+02 1391 1391 -3.4895594000000e+01 1392 1391 6.9094057000000e+00 2496 1391 -2.5446960000000e+00 286 1392 1.2007401000000e+00 287 1392 -1.9453863000000e-01 288 1392 -3.6268820000000e+00 1344 1392 -1.8080426000000e+00 1387 1392 1.1772159000000e+01 1388 1392 -1.9072734000000e+00 1389 1392 -1.9366105000000e+00 1390 1392 -1.9126556000000e+02 1391 1392 2.9589117000000e+01 1392 1392 1.1679659000000e+01 2496 1392 -4.3015541000000e+00 1393 1393 1.0000000000000e+00 1394 1394 1.0000000000000e+00 1395 1395 1.0000000000000e+00 1396 1396 1.0000000000000e+00 1397 1397 1.0000000000000e+00 1398 1398 1.0000000000000e+00 1399 1399 1.0000000000000e+00 1400 1400 1.0000000000000e+00 1401 1401 1.0000000000000e+00 1402 1402 1.0000000000000e+00 1403 1403 1.0000000000000e+00 1404 1404 1.0000000000000e+00 1405 1405 1.0000000000000e+00 1406 1406 1.0000000000000e+00 1407 1407 1.0000000000000e+00 304 1408 -7.4924889000000e-04 306 1408 -7.8195004000000e-06 1360 1408 -3.3844558000000e-02 1362 1408 -3.5321712000000e-04 1408 1408 2.7006466000000e+02 1410 1408 1.0190183000000e-03 1411 1408 -2.3272008000000e-02 1413 1408 -8.6914551000000e-06 1456 1408 -8.1983186000000e-02 1458 1408 -8.6631152000000e-06 2512 1408 -2.6950785000000e-02 2514 1408 -9.2959444000000e-06 304 1409 1.1331974000000e+00 306 1409 -1.4582423000000e+00 1362 1409 -1.5799292000000e+00 1408 1409 -1.7259416000000e+02 1409 1409 -4.7092408000000e+01 1410 1409 7.9812487000000e+00 1411 1409 6.5042611000000e-01 1413 1409 -1.6170433000000e+00 1456 1409 1.5723926000000e+01 1458 1409 -1.6119602000000e+00 2514 1409 -1.7083509000000e+00 304 1410 1.9155568000000e+00 305 1410 -3.1033210000000e-01 306 1410 -2.4650128000000e+00 1362 1410 -2.6707124000000e+00 1408 1410 -2.9175317000000e+02 1409 1410 5.2338123000000e+01 1410 1410 1.3491503000000e+01 1411 1410 1.0994803000000e+00 1412 1410 -1.7812263000000e-01 1413 1410 -2.7334499000000e+00 1456 1410 2.6579724000000e+01 1457 1410 -4.3060803000000e+00 1458 1410 -2.7248575000000e+00 2514 1410 -2.8877963000000e+00 307 1411 -7.5103977000000e-04 309 1411 -7.8381908000000e-06 1363 1411 -4.9607460000000e-02 1365 1411 -5.1772590000000e-04 1408 1411 -8.3279784000000e-04 1410 1411 -8.6914551000000e-06 1411 1411 2.7006462000000e+02 1413 1411 1.1924069000000e-03 1414 1411 -2.5815780000000e-02 1416 1411 -8.7442691000000e-06 1459 1411 -7.8661667000000e-02 1461 1411 -8.7145283000000e-06 2515 1411 -9.3601400000000e-03 2517 1411 -9.3569795000000e-06 307 1412 1.1448642000000e+00 309 1412 -1.4589760000000e+00 1365 1412 -1.5633187000000e+00 1410 1412 -1.6170433000000e+00 1411 1412 -1.7344824000000e+02 1412 1412 -5.1330777000000e+01 1413 1412 9.5657797000000e+00 1414 1412 1.0439707000000e+00 1416 1412 -1.6170724000000e+00 1459 1412 1.6170540000000e+01 1461 1412 -1.6117717000000e+00 2517 1412 -1.6918757000000e+00 307 1413 1.9352772000000e+00 308 1413 -3.1352611000000e-01 309 1413 -2.4662515000000e+00 1365 1413 -2.6426316000000e+00 1410 1413 -2.7334499000000e+00 1411 1413 -2.9319672000000e+02 1412 1413 4.5408629000000e+01 1413 1413 1.6169985000000e+01 1414 1413 1.7647269000000e+00 1415 1413 -2.8589598000000e-01 1416 1413 -2.7334974000000e+00 1459 1413 2.7334664000000e+01 1460 1413 -4.4283740000000e+00 1461 1413 -2.7245372000000e+00 2517 1413 -2.8599448000000e+00 310 1414 -7.5361219000000e-04 312 1414 -7.8650378000000e-06 1366 1414 -7.3231142000000e-02 1368 1414 -7.6427333000000e-04 1411 1414 -8.3785838000000e-04 1413 1414 -8.7442691000000e-06 1414 1414 2.7012596000000e+02 1416 1414 2.0389723000000e-03 1417 1414 -1.0518080000000e-02 1419 1414 -2.4119375000000e-05 1462 1414 -8.4096921000000e-02 1464 1414 -2.4033219000000e-05 2518 1414 -5.5354421000000e-02 2520 1414 -5.7770378000000e-04 310 1415 1.1600652000000e+00 312 1415 -1.4583174000000e+00 1368 1415 -1.5382633000000e+00 1413 1415 -1.6170724000000e+00 1414 1415 -1.7424625000000e+02 1415 1415 -5.1313295000000e+01 1416 1415 9.5203559000000e+00 1417 1415 8.0556735000000e-01 1419 1415 -1.6156055000000e+00 1462 1415 1.7189845000000e+01 1464 1415 -1.6100400000000e+00 2520 1415 -1.6753377000000e+00 310 1416 1.9609742000000e+00 311 1416 -3.1739229000000e-01 312 1416 -2.4651397000000e+00 1368 1416 -2.6002803000000e+00 1413 1416 -2.7334974000000e+00 1414 1416 -2.9454586000000e+02 1415 1416 4.5613128000000e+01 1416 1416 1.6093208000000e+01 1417 1416 1.3617310000000e+00 1418 1416 -2.2040215000000e-01 1419 1416 -2.7310196000000e+00 1462 1416 2.9057715000000e+01 1463 1416 -4.7031187000000e+00 1464 1416 -2.7216116000000e+00 2520 1416 -2.8319909000000e+00 313 1417 -7.5594456000000e-04 315 1417 -7.8893794000000e-06 1369 1417 -8.1141907000000e-02 1371 1417 -8.4683365000000e-04 1414 1417 -2.3110703000000e-03 1416 1417 -2.4119375000000e-05 1417 1417 2.7017949000000e+02 1419 1417 2.3944515000000e-03 1420 1417 -1.0675461000000e-02 1422 1417 -1.0662713000000e-04 1465 1417 -1.1909565000000e-01 1467 1417 -1.0624358000000e-04 2521 1417 -6.3785526000000e-02 2523 1417 -6.6569460000000e-04 313 1418 1.1939511000000e+00 315 1418 -1.4501622000000e+00 1371 1418 -1.5306042000000e+00 1416 1418 -1.6156055000000e+00 1417 1418 -1.7463575000000e+02 1418 1418 -5.1226801000000e+01 1419 1418 9.4771723000000e+00 1420 1418 4.4261743000000e-02 1422 1418 -1.6074876000000e+00 1465 1418 1.8305960000000e+01 1467 1418 -1.6019100000000e+00 2523 1418 -1.6656929000000e+00 313 1419 2.0182535000000e+00 314 1419 -3.2502469000000e-01 315 1419 -2.4513525000000e+00 1371 1419 -2.5873318000000e+00 1416 1419 -2.7310196000000e+00 1417 1419 -2.9520408000000e+02 1418 1419 4.5626707000000e+01 1419 1419 1.6020203000000e+01 1420 1419 7.4820002000000e-02 1421 1419 -1.2049203000000e-02 1422 1419 -2.7172951000000e+00 1465 1419 3.0944375000000e+01 1466 1419 -4.9833605000000e+00 1467 1419 -2.7078668000000e+00 2523 1419 -2.8156854000000e+00 316 1420 -7.5745833000000e-04 318 1420 -7.9051779000000e-06 1372 1420 -8.9022509000000e-02 1374 1420 -9.2907918000000e-04 1417 1420 -1.0216799000000e-02 1419 1420 -1.0662713000000e-04 1420 1420 2.7022719000000e+02 1422 1420 2.7344592000000e-03 1423 1420 -1.0210680000000e-02 1425 1420 -1.0656327000000e-04 1468 1420 -1.4191900000000e-01 1470 1420 -1.8843431000000e-04 2524 1420 -7.2246429000000e-02 2526 1420 -7.5399642000000e-04 316 1421 1.1859610000000e+00 318 1421 -1.4428372000000e+00 1374 1421 -1.5225090000000e+00 1419 1421 -1.6074876000000e+00 1420 1421 -1.7527966000000e+02 1421 1421 -5.1139888000000e+01 1422 1421 9.4366858000000e+00 1425 1421 -1.6073277000000e+00 1468 1421 1.9000849000000e+01 1470 1421 -1.5938227000000e+00 2526 1421 -1.6570018000000e+00 316 1422 2.0047484000000e+00 317 1422 -3.2122225000000e-01 318 1422 -2.4389721000000e+00 1374 1422 -2.5736492000000e+00 1419 1422 -2.7172951000000e+00 1420 1422 -2.9629274000000e+02 1421 1422 4.5709042000000e+01 1422 1422 1.5951770000000e+01 1425 1422 -2.7170249000000e+00 1468 1422 3.2119036000000e+01 1469 1422 -5.1464557000000e+00 1470 1422 -2.6941978000000e+00 2526 1422 -2.8009959000000e+00 319 1423 -7.5306130000000e-04 321 1423 -7.8592885000000e-06 1375 1423 -6.5386264000000e-02 1377 1423 -6.8240063000000e-04 1420 1423 -2.0434374000000e-02 1422 1423 -1.0656327000000e-04 1423 1423 2.7017970000000e+02 1425 1423 2.2144193000000e-03 1426 1423 -8.3475666000000e-04 1428 1423 -8.7118981000000e-06 1471 1423 -1.2621266000000e-01 1473 1423 -1.0619059000000e-04 2527 1423 -6.3781487000000e-02 2529 1423 -6.6565245000000e-04 319 1424 1.1138329000000e+00 321 1424 -1.4504481000000e+00 1377 1424 -1.5474048000000e+00 1420 1424 1.0039705000000e+00 1422 1424 -1.6073277000000e+00 1423 1424 -1.7621607000000e+02 1424 1424 -5.1226311000000e+01 1425 1424 9.4953093000000e+00 1428 1424 -1.6164755000000e+00 1471 1424 1.9005981000000e+01 1473 1424 -1.6019098000000e+00 2529 1424 -1.6660338000000e+00 319 1425 1.8828219000000e+00 320 1425 -3.0321541000000e-01 321 1425 -2.4518359000000e+00 1377 1425 -2.6157309000000e+00 1420 1425 1.6971106000000e+00 1421 1425 -2.7330792000000e-01 1422 1425 -2.7170249000000e+00 1423 1425 -2.9787545000000e+02 1424 1425 4.6058279000000e+01 1425 1425 1.6050862000000e+01 1428 1425 -2.7324901000000e+00 1471 1425 3.2127690000000e+01 1472 1425 -5.1739417000000e+00 1473 1425 -2.7078666000000e+00 2529 1425 -2.8162617000000e+00 322 1426 -7.4869979000000e-04 324 1426 -7.8137698000000e-06 1378 1426 -4.0960189000000e-02 1380 1426 -4.2747906000000e-04 1423 1426 -3.3836202000000e-02 1425 1426 -8.7118981000000e-06 1426 1426 2.7009668000000e+02 1428 1426 1.1015790000000e-03 1429 1426 -7.8804909000000e-04 1431 1426 -8.2244368000000e-06 1474 1426 -1.0977257000000e-01 1476 1426 -8.6890117000000e-06 2530 1426 -1.0376518000000e-02 2532 1426 -9.3263373000000e-06 322 1427 1.0105250000000e+00 324 1427 -1.4587762000000e+00 1380 1427 -1.5229139000000e+00 1423 1427 1.8318018000000e+00 1425 1427 -1.6164755000000e+00 1426 1427 -1.7638804000000e+02 1427 1427 -5.1330268000000e+01 1428 1427 9.4573617000000e+00 1431 1427 -1.5490538000000e+00 1474 1427 1.8456170000000e+01 1476 1427 -1.6124359000000e+00 2532 1427 -1.6919846000000e+00 322 1428 1.7081915000000e+00 323 1428 -2.7673724000000e-01 324 1428 -2.4659153000000e+00 1380 1428 -2.5743337000000e+00 1423 1428 3.0964777000000e+00 1424 1428 -5.0164789000000e-01 1425 1428 -2.7324901000000e+00 1426 1428 -2.9816634000000e+02 1427 1428 4.6214953000000e+01 1428 1428 1.5986723000000e+01 1431 1428 -2.6185188000000e+00 1474 1428 3.1198310000000e+01 1475 1428 -5.0543129000000e+00 1476 1428 -2.7256617000000e+00 2532 1428 -2.8601308000000e+00 325 1429 -8.0683750000000e-04 327 1429 -8.4205212000000e-06 1381 1429 -1.0123973000000e-02 1383 1429 -1.0565836000000e-04 1426 1429 -6.6563982000000e-02 1428 1429 -8.2244368000000e-06 1429 1429 2.4853926000000e+02 1431 1429 7.2852564000000e-04 1432 1429 -7.1484597000000e-04 1434 1429 -7.4604560000000e-06 1477 1429 -1.0755802000000e-01 1479 1429 -7.9657624000000e-06 2533 1429 -4.9089751000000e-02 2535 1429 -9.9785368000000e-06 325 1430 9.5135559000000e-01 327 1430 -1.5845640000000e+00 1383 1430 -1.4423564000000e+00 1426 1430 2.5614310000000e+00 1428 1430 -1.5490538000000e+00 1429 1430 -1.6295395000000e+02 1430 1430 -4.7227537000000e+01 1431 1430 9.3810030000000e+00 1434 1430 -1.4198346000000e+00 1477 1430 1.6763446000000e+01 1479 1430 -1.5005276000000e+00 2535 1430 -1.8794010000000e+00 325 1431 1.6081704000000e+00 326 1431 -2.6053543000000e-01 327 1431 -2.6785451000000e+00 1383 1431 -2.4381578000000e+00 1426 1431 4.3298401000000e+00 1427 1431 -7.0146590000000e-01 1428 1431 -2.6185188000000e+00 1429 1431 -2.7545719000000e+02 1430 1431 4.2694757000000e+01 1431 1431 1.5857638000000e+01 1434 1431 -2.4000884000000e+00 1477 1431 2.8336913000000e+01 1478 1431 -4.5907875000000e+00 1479 1431 -2.5364900000000e+00 2535 1431 -3.1769365000000e+00 328 1432 -8.7588529000000e-04 330 1432 -9.1411352000000e-06 1384 1432 -6.4292048000000e-04 1386 1432 -6.7098090000000e-06 1429 1432 -5.8069268000000e-02 1431 1432 -7.4604560000000e-06 1432 1432 2.2691115000000e+02 1434 1432 5.7844776000000e-04 1435 1432 -6.4440876000000e-04 1437 1432 -6.7253413000000e-06 1480 1432 -9.0980477000000e-02 1482 1432 -7.2877828000000e-06 2536 1432 -4.9472007000000e-02 2538 1432 -1.0817669000000e-05 328 1433 8.7183274000000e-01 330 1433 -1.7360007000000e+00 1386 1433 -1.3223121000000e+00 1429 1433 2.7416608000000e+00 1431 1433 -1.4198346000000e+00 1432 1433 -1.4900934000000e+02 1433 1433 -4.3123039000000e+01 1434 1433 9.2191644000000e+00 1437 1433 -1.2903395000000e+00 1480 1433 1.5127805000000e+01 1482 1433 -1.3871457000000e+00 2538 1433 -2.0587232000000e+00 328 1434 1.4737461000000e+00 329 1434 -2.3875883000000e-01 330 1434 -2.9345355000000e+00 1386 1434 -2.2352363000000e+00 1429 1434 4.6345034000000e+00 1430 1434 -7.5082716000000e-01 1431 1434 -2.4000884000000e+00 1432 1434 -2.5188539000000e+02 1433 1434 3.9038658000000e+01 1434 1434 1.5584074000000e+01 1437 1434 -2.1811882000000e+00 1480 1434 2.5572042000000e+01 1481 1434 -4.1428785000000e+00 1482 1434 -2.3448311000000e+00 2538 1434 -3.4800657000000e+00 331 1435 -9.5981471000000e-04 333 1435 -1.0017061000000e-05 1387 1435 -5.7528325000000e-04 1389 1435 -6.0039162000000e-06 1432 1435 -4.4446802000000e-02 1434 1435 -6.7253413000000e-06 1435 1435 2.0529453000000e+02 1437 1435 5.2095283000000e-04 1483 1435 -8.1520667000000e-02 1485 1435 -6.5501878000000e-06 2539 1435 -4.9415207000000e-02 2541 1435 -1.1860249000000e-05 331 1436 8.2470459000000e-01 333 1436 -1.9187718000000e+00 1389 1436 -1.2098873000000e+00 1432 1436 2.2942588000000e+00 1434 1436 -1.2903395000000e+00 1435 1436 -1.3459675000000e+02 1436 1436 -3.9017438000000e+01 1437 1436 7.9557264000000e+00 1483 1436 1.3617892000000e+01 1485 1436 -1.2568843000000e+00 2541 1436 -2.2754922000000e+00 331 1437 1.3940796000000e+00 332 1437 -2.2585332000000e-01 333 1437 -3.2434895000000e+00 1389 1437 -2.0451922000000e+00 1432 1437 3.8782123000000e+00 1433 1437 -6.2830496000000e-01 1434 1437 -2.1811882000000e+00 1435 1437 -2.2752218000000e+02 1436 1437 3.5257103000000e+01 1437 1437 1.3448350000000e+01 1483 1437 2.3019668000000e+01 1484 1437 -3.7293910000000e+00 1485 1437 -2.1246357000000e+00 2541 1437 -3.8464892000000e+00 1438 1438 1.0000000000000e+00 1439 1439 1.0000000000000e+00 1440 1440 1.0000000000000e+00 1441 1441 1.0000000000000e+00 1442 1442 1.0000000000000e+00 1443 1443 1.0000000000000e+00 1444 1444 1.0000000000000e+00 1445 1445 1.0000000000000e+00 1446 1446 1.0000000000000e+00 1447 1447 1.0000000000000e+00 1448 1448 1.0000000000000e+00 1449 1449 1.0000000000000e+00 1450 1450 1.0000000000000e+00 1451 1451 1.0000000000000e+00 1452 1452 1.0000000000000e+00 1453 1453 1.0000000000000e+00 1454 1454 1.0000000000000e+00 1455 1455 1.0000000000000e+00 352 1456 -7.8247898000000e-04 354 1456 -8.1663047000000e-06 1408 1456 -8.3008238000000e-04 1410 1456 -8.6631152000000e-06 1456 1456 2.7001834000000e+02 1458 1456 6.7542648000000e-04 1459 1456 -1.9974614000000e-02 1461 1456 -9.0183575000000e-06 1504 1456 -7.0525855000000e-02 1506 1456 -8.5828473000000e-06 2560 1456 -4.8509484000000e-02 2562 1456 -9.6623255000000e-06 352 1457 1.0519100000000e+00 354 1457 -1.4603618000000e+00 1410 1457 -1.6119602000000e+00 1456 1457 -1.7386680000000e+02 1457 1457 -4.7111932000000e+01 1458 1457 7.9679799000000e+00 1459 1457 1.1004158000000e+00 1461 1457 -1.6174652000000e+00 1504 1457 1.6653300000000e+01 1506 1457 -1.5395618000000e+00 2562 1457 -1.7328999000000e+00 352 1458 1.7781486000000e+00 353 1458 -2.8806540000000e-01 354 1458 -2.4685955000000e+00 1410 1458 -2.7248575000000e+00 1456 1458 -2.9390444000000e+02 1457 1458 5.2638811000000e+01 1458 1458 1.3469073000000e+01 1459 1458 1.8601429000000e+00 1460 1458 -3.0134873000000e-01 1461 1458 -2.7341631000000e+00 1504 1458 2.8150739000000e+01 1505 1458 -4.5605041000000e+00 1506 1458 -2.6024753000000e+00 2562 1458 -2.9292939000000e+00 355 1459 -7.8482076000000e-04 357 1459 -8.1907446000000e-06 1411 1459 -8.3500867000000e-04 1413 1459 -8.7145283000000e-06 1456 1459 -8.6412098000000e-04 1458 1459 -9.0183575000000e-06 1459 1459 2.7003674000000e+02 1461 1459 6.8480065000000e-04 1462 1459 -2.9835450000000e-02 1464 1459 -9.0455668000000e-06 1507 1459 -7.8257894000000e-02 1509 1459 -8.8081726000000e-06 2563 1459 -4.8060852000000e-02 2565 1459 -9.6879349000000e-06 355 1460 1.1450184000000e+00 357 1460 -1.4601662000000e+00 1413 1460 -1.6117717000000e+00 1458 1460 -1.6174652000000e+00 1459 1460 -1.7544405000000e+02 1460 1460 -5.1350908000000e+01 1461 1460 9.6198756000000e+00 1462 1460 2.0692633000000e+00 1464 1460 -1.6173997000000e+00 1507 1460 1.7168040000000e+01 1509 1460 -1.5751537000000e+00 2565 1460 -1.7321883000000e+00 355 1461 1.9355381000000e+00 356 1461 -3.1356263000000e-01 357 1461 -2.4682635000000e+00 1413 1461 -2.7245372000000e+00 1458 1461 -2.7341631000000e+00 1459 1461 -2.9657046000000e+02 1460 1461 4.5905440000000e+01 1461 1461 1.6261429000000e+01 1462 1461 3.4978806000000e+00 1463 1461 -5.6666650000000e-01 1464 1461 -2.7340508000000e+00 1507 1461 2.9020837000000e+01 1508 1461 -4.7014575000000e+00 1509 1461 -2.6626383000000e+00 2565 1461 -2.9280891000000e+00 358 1462 -7.8940871000000e-04 360 1462 -8.2386264000000e-06 1414 1462 -2.3028150000000e-03 1416 1462 -2.4033219000000e-05 1459 1462 -8.6672812000000e-04 1461 1462 -9.0455668000000e-06 1462 1462 2.7006740000000e+02 1464 1462 7.0053882000000e-04 1465 1462 -3.6297248000000e-02 1467 1462 -9.0947386000000e-06 1510 1462 -1.0191037000000e-01 1512 1462 -9.0508544000000e-06 2566 1462 -4.7232910000000e-02 2568 1462 -9.7375877000000e-06 358 1463 1.2957864000000e+00 360 1463 -1.4600938000000e+00 1416 1463 -1.6100400000000e+00 1461 1463 -1.6173997000000e+00 1462 1463 -1.7750451000000e+02 1463 1463 -5.1350998000000e+01 1464 1463 9.6521019000000e+00 1465 1463 1.9262750000000e+00 1467 1463 -1.6173879000000e+00 1510 1463 1.9220924000000e+01 1512 1463 -1.6098024000000e+00 2568 1463 -1.7316471000000e+00 358 1464 2.1903974000000e+00 359 1464 -3.5484929000000e-01 360 1464 -2.4681426000000e+00 1416 1464 -2.7216116000000e+00 1461 1464 -2.7340508000000e+00 1462 1464 -3.0005362000000e+02 1463 1464 4.6469243000000e+01 1464 1464 1.6315911000000e+01 1465 1464 3.2561752000000e+00 1466 1464 -5.2750769000000e-01 1467 1464 -2.7340325000000e+00 1510 1464 3.2491049000000e+01 1511 1464 -5.2636228000000e+00 1512 1464 -2.7212100000000e+00 2568 1464 -2.9271763000000e+00 361 1465 -7.9420309000000e-04 363 1465 -8.2886627000000e-06 1417 1465 -1.0180047000000e-02 1419 1465 -1.0624358000000e-04 1462 1465 -8.7143967000000e-04 1464 1465 -9.0947386000000e-06 1465 1465 2.7006765000000e+02 1467 1465 7.8304509000000e-04 1468 1465 -1.6336949000000e-02 1470 1465 -9.1531613000000e-06 1513 1465 -1.1435344000000e-01 1515 1465 -9.1176109000000e-06 2569 1465 -4.6196229000000e-02 2571 1465 -9.8051430000000e-06 361 1466 1.4523774000000e+00 363 1466 -1.4608747000000e+00 1419 1466 -1.6019100000000e+00 1464 1466 -1.6173879000000e+00 1465 1466 -1.7848422000000e+02 1466 1466 -5.1349972000000e+01 1467 1466 9.6472855000000e+00 1468 1466 7.4175981000000e-01 1470 1466 -1.6174298000000e+00 1513 1466 2.1227252000000e+01 1515 1466 -1.6113827000000e+00 2571 1466 -1.7325699000000e+00 361 1467 2.4550965000000e+00 362 1467 -3.9773011000000e-01 363 1467 -2.4694602000000e+00 1419 1467 -2.7078668000000e+00 1464 1467 -2.7340325000000e+00 1465 1467 -3.0170946000000e+02 1466 1467 4.6739878000000e+01 1467 1467 1.6307760000000e+01 1468 1467 1.2538697000000e+00 1469 1467 -2.0312916000000e-01 1470 1467 -2.7341007000000e+00 1513 1467 3.5882516000000e+01 1514 1467 -5.8130322000000e+00 1515 1467 -2.7238788000000e+00 2571 1467 -2.9287341000000e+00 364 1468 -7.9591745000000e-04 366 1468 -8.3065546000000e-06 1420 1468 -1.8055398000000e-02 1422 1468 -1.8843431000000e-04 1465 1468 -8.7703761000000e-04 1467 1468 -9.1531613000000e-06 1468 1468 2.7007190000000e+02 1470 1468 8.6537164000000e-04 1471 1468 -8.7636085000000e-04 1473 1468 -9.1460984000000e-06 1516 1468 -1.2596991000000e-01 1518 1468 -9.1484399000000e-06 2572 1468 -4.5679259000000e-02 2574 1468 -9.8382960000000e-06 364 1469 1.5262413000000e+00 366 1469 -1.4608630000000e+00 1422 1469 -1.5938227000000e+00 1467 1469 -1.6174298000000e+00 1468 1469 -1.7895839000000e+02 1469 1469 -5.1349336000000e+01 1470 1469 9.6391433000000e+00 1473 1469 -1.6173685000000e+00 1516 1469 2.2368532000000e+01 1518 1469 -1.6113755000000e+00 2574 1469 -1.7325536000000e+00 364 1470 2.5799584000000e+00 365 1470 -4.1795678000000e-01 366 1470 -2.4694428000000e+00 1422 1470 -2.6941978000000e+00 1467 1470 -2.7341007000000e+00 1468 1470 -3.0251126000000e+02 1469 1470 4.6871070000000e+01 1470 1470 1.6294003000000e+01 1473 1470 -2.7339979000000e+00 1516 1470 3.7811766000000e+01 1517 1470 -6.1255577000000e+00 1518 1470 -2.7238692000000e+00 2574 1470 -2.9287086000000e+00 367 1471 -7.9366279000000e-04 369 1471 -8.2830240000000e-06 1423 1471 -1.0174970000000e-02 1425 1471 -1.0619059000000e-04 1468 1471 -1.8953762000000e-02 1470 1471 -9.1460984000000e-06 1471 1471 2.7007945000000e+02 1473 1471 7.8294893000000e-04 1474 1471 -8.6954137000000e-04 1476 1471 -9.0749271000000e-06 1519 1471 -1.2342382000000e-01 1521 1471 -9.1135260000000e-06 2575 1471 -4.6118381000000e-02 2577 1471 -9.7986799000000e-06 367 1472 1.4663627000000e+00 369 1472 -1.4609828000000e+00 1425 1472 -1.6019098000000e+00 1468 1472 9.9902844000000e-01 1470 1472 -1.6173685000000e+00 1471 1472 -1.7965018000000e+02 1472 1472 -5.1349843000000e+01 1473 1472 9.6476569000000e+00 1476 1472 -1.6171212000000e+00 1519 1472 2.2121760000000e+01 1521 1472 -1.6118470000000e+00 2577 1472 -1.7326971000000e+00 367 1473 2.4787378000000e+00 368 1473 -4.0156009000000e-01 369 1473 -2.4696437000000e+00 1425 1473 -2.7078666000000e+00 1468 1473 1.6887565000000e+00 1469 1473 -2.7358167000000e-01 1470 1473 -2.7339979000000e+00 1471 1473 -3.0368046000000e+02 1472 1473 4.7059527000000e+01 1473 1473 1.6308390000000e+01 1476 1473 -2.7335816000000e+00 1519 1473 3.7394598000000e+01 1520 1473 -6.0579939000000e+00 1521 1473 -2.7246643000000e+00 2577 1473 -2.9289491000000e+00 370 1474 -7.8813993000000e-04 372 1474 -8.2253849000000e-06 1426 1474 -8.3256372000000e-04 1428 1474 -8.6890117000000e-06 1471 1474 -4.1060224000000e-02 1473 1474 -9.0749271000000e-06 1474 1474 2.7008865000000e+02 1476 1474 6.8481087000000e-04 1477 1474 -8.3543184000000e-04 1479 1474 -8.7189446000000e-06 1522 1474 -1.1984362000000e-01 1524 1474 -9.0443172000000e-06 2578 1474 -4.6864971000000e-02 2580 1474 -9.7207651000000e-06 370 1475 1.3171960000000e+00 372 1475 -1.4603466000000e+00 1428 1475 -1.6124359000000e+00 1471 1475 2.3948027000000e+00 1473 1475 -1.6171212000000e+00 1474 1475 -1.7976978000000e+02 1475 1475 -5.1350607000000e+01 1476 1475 9.6064392000000e+00 1479 1475 -1.5667697000000e+00 1522 1475 2.0995709000000e+01 1524 1475 -1.6118921000000e+00 2580 1475 -1.7321429000000e+00 370 1476 2.2265881000000e+00 371 1476 -3.6071267000000e-01 372 1476 -2.4685699000000e+00 1428 1476 -2.7256617000000e+00 1471 1476 4.0481744000000e+00 1472 1476 -6.5581405000000e-01 1473 1476 -2.7335816000000e+00 1474 1476 -3.0388283000000e+02 1475 1476 4.7090596000000e+01 1476 1476 1.6238723000000e+01 1479 1476 -2.6484659000000e+00 1522 1476 3.5491147000000e+01 1523 1476 -5.7496518000000e+00 1524 1476 -2.7247424000000e+00 2580 1476 -2.9280144000000e+00 373 1477 -8.3063190000000e-04 375 1477 -8.6688503000000e-06 1429 1477 -7.6326343000000e-04 1431 1477 -7.9657624000000e-06 1474 1477 -6.1690204000000e-02 1476 1477 -8.7189446000000e-06 1477 1477 2.5390840000000e+02 1479 1477 6.4576394000000e-04 1480 1477 -7.7640669000000e-04 1482 1477 -8.1029315000000e-06 1525 1477 -1.1373980000000e-01 1527 1477 -8.6082212000000e-06 2581 1477 -4.7159864000000e-02 2583 1477 -1.0248069000000e-05 373 1478 1.1837465000000e+00 375 1478 -1.5528349000000e+00 1431 1478 -1.5005276000000e+00 1474 1478 3.0200314000000e+00 1476 1478 -1.5667697000000e+00 1477 1478 -1.6878018000000e+02 1478 1478 -4.8271778000000e+01 1479 1478 9.4839287000000e+00 1482 1478 -1.4698187000000e+00 1525 1478 1.8820856000000e+01 1527 1478 -1.5470819000000e+00 2583 1478 -1.8415082000000e+00 373 1479 2.0010037000000e+00 374 1479 -3.2416910000000e-01 375 1479 -2.6249103000000e+00 1431 1479 -2.5364900000000e+00 1474 1479 5.1050579000000e+00 1475 1479 -8.2703595000000e-01 1476 1479 -2.6484659000000e+00 1477 1479 -2.8530584000000e+02 1478 1479 4.4204439000000e+01 1479 1479 1.6031624000000e+01 1482 1479 -2.4845815000000e+00 1525 1479 3.1814754000000e+01 1526 1479 -5.1540934000000e+00 1527 1479 -2.6151855000000e+00 2583 1479 -3.1128835000000e+00 376 1480 -8.7771886000000e-04 378 1480 -9.1602712000000e-06 1432 1480 -6.9830077000000e-04 1434 1480 -7.2877828000000e-06 1477 1480 -6.9078878000000e-02 1479 1480 -8.1029315000000e-06 1480 1480 2.3770616000000e+02 1482 1480 6.0635441000000e-04 1483 1480 -7.1017836000000e-04 1485 1480 -7.4117426000000e-06 1528 1480 -9.8724622000000e-02 1530 1480 -7.9912181000000e-06 2584 1480 -4.7971359000000e-02 2586 1480 -1.0835706000000e-05 376 1481 1.0382496000000e+00 378 1481 -1.6573901000000e+00 1434 1481 -1.3871457000000e+00 1477 1481 3.2285571000000e+00 1479 1481 -1.4698187000000e+00 1480 1481 -1.5688330000000e+02 1481 1481 -4.5193359000000e+01 1482 1481 9.2900489000000e+00 1485 1481 -1.3554128000000e+00 1528 1481 1.6168101000000e+01 1530 1481 -1.4497408000000e+00 2586 1481 -1.9654957000000e+00 376 1482 1.7550571000000e+00 377 1482 -2.8432625000000e-01 378 1482 -2.8016522000000e+00 1434 1482 -2.3448311000000e+00 1477 1482 5.4575529000000e+00 1478 1482 -8.8414531000000e-01 1479 1482 -2.4845815000000e+00 1480 1482 -2.6519553000000e+02 1481 1482 4.1068716000000e+01 1482 1482 1.5703897000000e+01 1485 1482 -2.2911882000000e+00 1528 1482 2.7330557000000e+01 1529 1482 -4.4276594000000e+00 1530 1482 -2.4506419000000e+00 2586 1482 -3.3224740000000e+00 379 1483 -9.5919609000000e-04 381 1483 -1.0010604000000e-05 1435 1483 -6.2762590000000e-04 1437 1483 -6.5501878000000e-06 1480 1483 -4.7692092000000e-02 1482 1483 -7.4117426000000e-06 1483 1483 2.1604354000000e+02 1485 1483 5.4800677000000e-04 1531 1483 -4.8856002000000e-02 1533 1483 -7.1352826000000e-06 2587 1483 -4.8565204000000e-02 2589 1483 -1.1844695000000e-05 379 1484 9.5949762000000e-01 381 1484 -1.8263584000000e+00 1437 1484 -1.2568843000000e+00 1480 1484 2.5058817000000e+00 1482 1484 -1.3554128000000e+00 1483 1484 -1.4020691000000e+02 1484 1484 -4.1086240000000e+01 1485 1484 7.9143095000000e+00 1531 1484 1.2699265000000e+01 1533 1484 -1.3050280000000e+00 2589 1484 -2.1660390000000e+00 379 1485 1.6219336000000e+00 380 1485 -2.6276103000000e-01 381 1485 -3.0872741000000e+00 1437 1485 -2.1246357000000e+00 1480 1485 4.2359396000000e+00 1481 1485 -6.8624254000000e-01 1482 1485 -2.2911882000000e+00 1483 1485 -2.3700561000000e+02 1484 1485 3.6671012000000e+01 1485 1485 1.3378339000000e+01 1531 1485 2.1466823000000e+01 1532 1485 -3.4777282000000e+00 1533 1485 -2.2060178000000e+00 2589 1485 -3.6614697000000e+00 1486 1486 1.0000000000000e+00 1487 1487 1.0000000000000e+00 1488 1488 1.0000000000000e+00 1489 1489 1.0000000000000e+00 1490 1490 1.0000000000000e+00 1491 1491 1.0000000000000e+00 1492 1492 1.0000000000000e+00 1493 1493 1.0000000000000e+00 1494 1494 1.0000000000000e+00 1495 1495 1.0000000000000e+00 1496 1496 1.0000000000000e+00 1497 1497 1.0000000000000e+00 1498 1498 1.0000000000000e+00 1499 1499 1.0000000000000e+00 1500 1500 1.0000000000000e+00 397 1501 -9.4909644000000e-04 399 1501 -9.9051999000000e-06 1501 1501 2.3751600000000e+02 1503 1501 5.9348746000000e-04 1504 1501 -8.1308798000000e-04 1506 1501 -8.4857540000000e-06 1549 1501 -7.4546262000000e-04 1551 1501 -7.7799852000000e-06 2605 1501 -4.9070637000000e-02 2607 1501 -1.1738265000000e-05 397 1502 9.6736796000000e-01 399 1502 -1.6717298000000e+00 1501 1502 -1.4417444000000e+02 1502 1502 -4.5215223000000e+01 1503 1502 6.4070392000000e+00 1506 1502 -1.4551388000000e+00 1549 1502 6.7886956000000e+00 1551 1502 -1.2892139000000e+00 2607 1502 -1.9859020000000e+00 397 1503 1.6352377000000e+00 398 1503 -2.6490482000000e-01 399 1503 -2.8258900000000e+00 1501 1503 -2.4371230000000e+02 1502 1503 3.7533536000000e+01 1503 1503 1.0830453000000e+01 1506 1503 -2.4597666000000e+00 1549 1503 1.1475603000000e+01 1550 1503 -1.8590219000000e+00 1551 1503 -2.1792857000000e+00 2607 1503 -3.3569658000000e+00 400 1504 -8.9387850000000e-04 402 1504 -9.3289205000000e-06 1456 1504 -8.2239126000000e-04 1458 1504 -8.5828473000000e-06 1501 1504 -2.4458134000000e-02 1503 1504 -8.4857540000000e-06 1504 1504 2.4836450000000e+02 1506 1504 6.3543396000000e-04 1507 1504 -2.4687892000000e-02 1509 1504 -8.8644260000000e-06 1552 1504 -7.9467502000000e-04 1554 1504 -8.2935881000000e-06 2608 1504 -4.8017324000000e-02 2610 1504 -1.1047996000000e-05 400 1505 1.1078724000000e+00 402 1505 -1.5953249000000e+00 1458 1505 -1.5395618000000e+00 1501 1505 4.8579944000000e+00 1503 1505 -1.4551388000000e+00 1504 1505 -1.6231943000000e+02 1505 1505 -4.7264376000000e+01 1506 1505 9.3809026000000e+00 1507 1505 1.1591144000000e+00 1509 1505 -1.5200077000000e+00 1552 1505 1.2566956000000e+01 1554 1505 -1.3712112000000e+00 2610 1505 -1.8943762000000e+00 400 1506 1.8727475000000e+00 401 1506 -3.0338303000000e-01 402 1506 -2.6967372000000e+00 1458 1506 -2.6024753000000e+00 1501 1506 8.2119536000000e+00 1502 1506 -1.3303274000000e+00 1503 1506 -2.4597666000000e+00 1504 1506 -2.7438477000000e+02 1505 1506 4.2428957000000e+01 1506 1506 1.5857478000000e+01 1507 1506 1.9593670000000e+00 1508 1506 -3.1741530000000e-01 1509 1506 -2.5694210000000e+00 1552 1506 2.1243182000000e+01 1553 1506 -3.4413720000000e+00 1554 1506 -2.3178955000000e+00 2610 1506 -3.2022536000000e+00 403 1507 -8.5917158000000e-04 405 1507 -8.9667033000000e-06 1459 1507 -8.4398148000000e-04 1461 1507 -8.8081726000000e-06 1504 1507 -8.4937157000000e-04 1506 1507 -8.8644260000000e-06 1507 1507 2.5919759000000e+02 1509 1507 6.6122729000000e-04 1510 1507 -5.0848390000000e-02 1512 1507 -9.2733182000000e-06 1555 1507 -3.8161872000000e-02 1557 1507 -8.6210888000000e-06 2611 1507 -4.6123540000000e-02 2613 1507 -1.0607112000000e-05 403 1508 1.3706750000000e+00 405 1508 -1.5271880000000e+00 1461 1508 -1.5751537000000e+00 1506 1508 -1.5200077000000e+00 1507 1508 -1.7047620000000e+02 1508 1508 -4.9318400000000e+01 1509 1508 9.4987930000000e+00 1510 1508 3.6763866000000e+00 1512 1508 -1.5847634000000e+00 1555 1508 1.6599150000000e+01 1557 1508 -1.4735359000000e+00 2613 1508 -1.8126331000000e+00 403 1509 2.3169875000000e+00 404 1509 -3.7534895000000e-01 405 1509 -2.5815568000000e+00 1461 1509 -2.6626383000000e+00 1506 1509 -2.5694210000000e+00 1507 1509 -2.8817279000000e+02 1508 1509 4.4577014000000e+01 1509 1509 1.6056750000000e+01 1510 1509 6.2145599000000e+00 1511 1509 -1.0067506000000e+00 1512 1509 -2.6788823000000e+00 1555 1509 2.8059187000000e+01 1556 1509 -4.5455510000000e+00 1557 1509 -2.4908634000000e+00 2613 1509 -3.0640727000000e+00 406 1510 -8.3206675000000e-04 408 1510 -8.6838251000000e-06 1462 1510 -8.6723476000000e-04 1464 1510 -9.0508544000000e-06 1507 1510 -8.8855081000000e-04 1509 1510 -9.2733182000000e-06 1510 1510 2.7004009000000e+02 1512 1510 6.8734928000000e-04 1513 1510 -4.8725905000000e-02 1515 1510 -9.5533495000000e-06 1558 1510 -9.1979919000000e-02 1560 1510 -9.1876557000000e-06 2614 1510 -4.3192237000000e-02 2616 1510 -1.0255506000000e-05 406 1511 1.7787051000000e+00 408 1511 -1.4635822000000e+00 1464 1511 -1.6098024000000e+00 1509 1511 -1.5847634000000e+00 1510 1511 -1.8161181000000e+02 1511 1511 -5.1373691000000e+01 1512 1511 9.5744591000000e+00 1513 1511 3.9218115000000e+00 1515 1511 -1.6178102000000e+00 1558 1511 2.0880731000000e+01 1560 1511 -1.5561203000000e+00 2616 1511 -1.7366396000000e+00 406 1512 3.0067231000000e+00 407 1512 -4.8708231000000e-01 408 1512 -2.4740393000000e+00 1464 1512 -2.7212100000000e+00 1509 1512 -2.6788823000000e+00 1510 1512 -3.0699661000000e+02 1511 1512 4.7537372000000e+01 1512 1512 1.6184664000000e+01 1513 1512 6.6294301000000e+00 1514 1512 -1.0739526000000e+00 1515 1512 -2.7347463000000e+00 1558 1512 3.5296787000000e+01 1559 1512 -5.7179994000000e+00 1560 1512 -2.6304658000000e+00 2616 1512 -2.9356156000000e+00 409 1513 -8.3935795000000e-04 411 1513 -8.7599193000000e-06 1465 1513 -8.7363124000000e-04 1467 1513 -9.1176109000000e-06 1510 1513 -9.1538284000000e-04 1512 1513 -9.5533495000000e-06 1513 1513 2.7008309000000e+02 1515 1513 6.8833418000000e-04 1516 1513 -2.8041727000000e-02 1518 1513 -9.6454470000000e-06 1561 1513 -1.6072546000000e-01 1563 1513 -9.5827761000000e-06 2617 1513 -3.9367327000000e-02 2619 1513 -1.0326069000000e-05 409 1514 2.3223633000000e+00 411 1514 -1.4603090000000e+00 1467 1514 -1.6113827000000e+00 1512 1514 -1.6178102000000e+00 1513 1514 -1.8423016000000e+02 1514 1514 -5.1374787000000e+01 1515 1514 9.6524961000000e+00 1516 1514 1.8876594000000e+00 1518 1514 -1.6178115000000e+00 1561 1514 2.4991137000000e+01 1563 1514 -1.6075376000000e+00 2619 1514 -1.7319037000000e+00 409 1515 3.9257207000000e+00 410 1515 -6.3595464000000e-01 411 1515 -2.4685050000000e+00 1467 1515 -2.7238788000000e+00 1512 1515 -2.7347463000000e+00 1513 1515 -3.1142250000000e+02 1514 1515 4.8251452000000e+01 1515 1515 1.6316571000000e+01 1516 1515 3.1908977000000e+00 1517 1515 -5.1691558000000e-01 1518 1515 -2.7347471000000e+00 1561 1515 4.2244995000000e+01 1562 1515 -6.8435583000000e+00 1563 1515 -2.7173801000000e+00 2619 1515 -2.9276085000000e+00 412 1516 -8.4416373000000e-04 414 1516 -8.8100746000000e-06 1468 1516 -8.7658522000000e-04 1470 1516 -9.1484399000000e-06 1513 1516 -9.2420744000000e-04 1515 1516 -9.6454470000000e-06 1516 1516 2.7007521000000e+02 1518 1516 6.8862876000000e-04 1519 1516 -9.2584909000000e-04 1521 1516 -9.6625799000000e-06 1564 1516 -1.8218975000000e-01 1566 1516 -9.6351775000000e-06 2620 1516 -3.7136019000000e-02 2622 1516 -1.0375283000000e-05 412 1517 2.6636120000000e+00 414 1517 -1.4603067000000e+00 1470 1517 -1.6113755000000e+00 1515 1517 -1.6178115000000e+00 1516 1517 -1.8480023000000e+02 1517 1517 -5.1374772000000e+01 1518 1517 9.6536146000000e+00 1521 1517 -1.6178126000000e+00 1564 1517 2.7107692000000e+01 1566 1517 -1.6086679000000e+00 2622 1517 -1.7318990000000e+00 412 1518 4.5025698000000e+00 413 1518 -7.2939997000000e-01 414 1518 -2.4685025000000e+00 1470 1518 -2.7238692000000e+00 1515 1518 -2.7347471000000e+00 1516 1518 -3.1238630000000e+02 1517 1518 4.8407342000000e+01 1518 1518 1.6318467000000e+01 1521 1518 -2.7347488000000e+00 1564 1518 4.5822842000000e+01 1565 1518 -7.4231342000000e+00 1566 1518 -2.7192922000000e+00 2622 1518 -2.9276020000000e+00 415 1519 -8.4070669000000e-04 417 1519 -8.7739954000000e-06 1471 1519 -8.7323983000000e-04 1473 1519 -9.1135260000000e-06 1516 1519 -2.1590804000000e-02 1518 1519 -9.6625799000000e-06 1519 1519 2.7009410000000e+02 1521 1519 6.8843280000000e-04 1522 1519 -9.1766119000000e-04 1524 1519 -9.5771274000000e-06 1567 1519 -1.7948756000000e-01 1569 1519 -9.6173852000000e-06 2623 1519 -3.8450156000000e-02 2625 1519 -1.0338482000000e-05 415 1520 2.4505236000000e+00 417 1520 -1.4594767000000e+00 1473 1520 -1.6118470000000e+00 1516 1520 1.2533309000000e+00 1518 1520 -1.6178126000000e+00 1519 1520 -1.8481019000000e+02 1520 1520 -5.1375126000000e+01 1521 1520 9.6540106000000e+00 1524 1520 -1.6177334000000e+00 1567 1520 2.6077818000000e+01 1569 1520 -1.6104834000000e+00 2625 1520 -1.7309160000000e+00 415 1521 4.1423626000000e+00 416 1521 -6.7104929000000e-01 417 1521 -2.4670980000000e+00 1473 1521 -2.7246643000000e+00 1516 1521 2.1186294000000e+00 1517 1521 -3.4321107000000e-01 1518 1521 -2.7347488000000e+00 1519 1521 -3.1240296000000e+02 1520 1521 4.8409390000000e+01 1521 1521 1.6319131000000e+01 1524 1521 -2.7346166000000e+00 1567 1521 4.4081918000000e+01 1568 1521 -7.1411270000000e+00 1569 1521 -2.7223596000000e+00 2625 1521 -2.9259386000000e+00 418 1522 -8.3289178000000e-04 420 1522 -8.6924355000000e-06 1474 1522 -8.6660839000000e-04 1476 1522 -9.0443172000000e-06 1519 1522 -4.4701745000000e-02 1521 1522 -9.5771274000000e-06 1522 1522 2.7008965000000e+02 1524 1522 6.8782746000000e-04 1525 1522 -8.9809299000000e-04 1527 1522 -9.3729048000000e-06 1570 1522 -1.4792916000000e-01 1572 1522 -9.5404218000000e-06 2626 1522 -4.1432319000000e-02 2628 1522 -1.0254566000000e-05 418 1523 2.0051029000000e+00 420 1523 -1.4604292000000e+00 1476 1523 -1.6118921000000e+00 1519 1523 3.5260769000000e+00 1521 1523 -1.6177334000000e+00 1522 1523 -1.8431844000000e+02 1523 1523 -5.1374246000000e+01 1524 1523 9.6407722000000e+00 1527 1523 -1.6011305000000e+00 1570 1523 2.3757471000000e+01 1572 1523 -1.6117570000000e+00 2628 1523 -1.7320887000000e+00 418 1524 3.3894259000000e+00 419 1524 -5.4907849000000e-01 420 1524 -2.4687096000000e+00 1476 1524 -2.7247424000000e+00 1519 1524 5.9604802000000e+00 1520 1524 -9.6558282000000e-01 1521 1524 -2.7346166000000e+00 1522 1524 -3.1157189000000e+02 1523 1524 4.8277121000000e+01 1524 1524 1.6296759000000e+01 1527 1524 -2.7065491000000e+00 1570 1524 4.0159629000000e+01 1571 1524 -6.5057592000000e+00 1572 1524 -2.7245140000000e+00 2628 1524 -2.9279228000000e+00 421 1525 -8.4007217000000e-04 423 1525 -8.7673732000000e-06 1477 1525 -8.2482254000000e-04 1479 1525 -8.6082212000000e-06 1522 1525 -6.4392667000000e-02 1524 1525 -9.3729048000000e-06 1525 1525 2.6468463000000e+02 1527 1525 6.7401653000000e-04 1528 1525 -8.4943775000000e-04 1530 1525 -8.8651167000000e-06 1573 1525 -1.1755223000000e-01 1575 1525 -9.3363636000000e-06 2629 1525 -4.4120055000000e-02 2631 1525 -1.0353917000000e-05 421 1526 1.6041890000000e+00 423 1526 -1.4913157000000e+00 1479 1526 -1.5470819000000e+00 1522 1526 4.4628450000000e+00 1524 1526 -1.6011305000000e+00 1525 1526 -1.7920248000000e+02 1526 1526 -5.0346702000000e+01 1527 1526 9.5433280000000e+00 1530 1526 -1.5344165000000e+00 1573 1526 2.1205997000000e+01 1575 1526 -1.5951116000000e+00 2631 1526 -1.7686457000000e+00 421 1527 2.7117191000000e+00 422 1527 -4.3929488000000e-01 423 1527 -2.5209182000000e+00 1479 1527 -2.6151855000000e+00 1522 1527 7.5439876000000e+00 1523 1527 -1.2221159000000e+00 1524 1527 -2.7065491000000e+00 1525 1527 -3.0292365000000e+02 1526 1527 4.6920720000000e+01 1527 1527 1.6132032000000e+01 1530 1527 -2.5937775000000e+00 1573 1527 3.5846591000000e+01 1574 1527 -5.8070999000000e+00 1575 1527 -2.6963746000000e+00 2631 1527 -2.9897163000000e+00 424 1528 -8.8398968000000e-04 426 1528 -9.2257162000000e-06 1480 1528 -7.6570254000000e-04 1482 1528 -7.9912181000000e-06 1525 1528 -8.0443630000000e-02 1527 1528 -8.8651167000000e-06 1528 1528 2.4846584000000e+02 1530 1528 6.3445574000000e-04 1531 1528 -7.6536868000000e-04 1533 1528 -7.9877338000000e-06 1576 1528 -7.2952815000000e-02 1578 1528 -8.6533326000000e-06 2632 1528 -4.6164921000000e-02 2634 1528 -1.0907693000000e-05 424 1529 1.3215054000000e+00 426 1529 -1.5915783000000e+00 1482 1529 -1.4497408000000e+00 1525 1529 4.9241295000000e+00 1527 1529 -1.5344165000000e+00 1528 1529 -1.6654788000000e+02 1529 1529 -4.7265374000000e+01 1530 1529 9.3684860000000e+00 1533 1529 -1.4015808000000e+00 1576 1529 1.7675979000000e+01 1578 1529 -1.4979855000000e+00 2634 1529 -1.8879020000000e+00 424 1530 2.2338727000000e+00 425 1530 -3.6188685000000e-01 426 1530 -2.6904039000000e+00 1482 1530 -2.4506419000000e+00 1525 1530 8.3237484000000e+00 1526 1530 -1.3484453000000e+00 1527 1530 -2.5937775000000e+00 1528 1530 -2.8153254000000e+02 1529 1530 4.3584773000000e+01 1530 1530 1.5836487000000e+01 1533 1530 -2.3692308000000e+00 1576 1530 2.9879475000000e+01 1577 1530 -4.8404679000000e+00 1578 1530 -2.5321947000000e+00 2634 1530 -3.1913095000000e+00 427 1531 -9.7629545000000e-04 429 1531 -1.0189061000000e-05 1483 1531 -6.8368851000000e-04 1485 1531 -7.1352826000000e-06 1528 1531 -9.2297563000000e-02 1530 1531 -7.9877338000000e-06 1531 1531 2.2143450000000e+02 1533 1531 5.6275922000000e-04 1579 1531 -1.7879426000000e-02 1581 1531 -7.7108176000000e-06 2635 1531 -4.7265566000000e-02 2637 1531 -1.2053366000000e-05 427 1532 1.1575908000000e+00 429 1532 -1.7831636000000e+00 1485 1532 -1.3050280000000e+00 1528 1532 4.5828135000000e+00 1530 1532 -1.4015808000000e+00 1531 1532 -1.4260298000000e+02 1532 1532 -4.2130994000000e+01 1533 1532 7.9625911000000e+00 1579 1532 9.7432456000000e+00 1581 1532 -1.3531654000000e+00 2637 1532 -2.1149439000000e+00 427 1533 1.9567904000000e+00 428 1533 -3.1700217000000e-01 429 1533 -3.0142581000000e+00 1485 1533 -2.2060178000000e+00 1528 1533 7.7467837000000e+00 1529 1533 -1.2549874000000e+00 1530 1533 -2.3692308000000e+00 1531 1533 -2.4105594000000e+02 1532 1533 3.7240289000000e+01 1533 1533 1.3459956000000e+01 1579 1533 1.6469973000000e+01 1580 1533 -2.6681535000000e+00 1581 1533 -2.2873895000000e+00 2637 1533 -3.5750987000000e+00 1534 1534 1.0000000000000e+00 1535 1535 1.0000000000000e+00 1536 1536 1.0000000000000e+00 1537 1537 1.0000000000000e+00 1538 1538 1.0000000000000e+00 1539 1539 1.0000000000000e+00 1540 1540 1.0000000000000e+00 1541 1541 1.0000000000000e+00 1542 1542 1.0000000000000e+00 1543 1543 1.0000000000000e+00 1544 1544 1.0000000000000e+00 1545 1545 1.0000000000000e+00 1546 1546 1.0000000000000e+00 1547 1547 1.0000000000000e+00 1548 1548 1.0000000000000e+00 445 1549 -1.1469225000000e-03 447 1549 -1.1969802000000e-05 1501 1549 -7.1538059000000e-02 1503 1549 -7.7799852000000e-06 1549 1549 1.9983026000000e+02 1551 1549 5.1535618000000e-04 1552 1549 -4.3887336000000e-02 1554 1549 -7.5037232000000e-06 1597 1549 -6.4507151000000e-04 1599 1549 -6.7322581000000e-06 2653 1549 -4.8488816000000e-02 2655 1549 -1.4188647000000e-05 445 1550 1.0287243000000e+00 447 1550 -1.9802948000000e+00 1503 1550 -1.2892139000000e+00 1549 1550 -1.2404451000000e+02 1550 1550 -3.8042021000000e+01 1551 1550 7.9546088000000e+00 1552 1550 6.9714899000000e-01 1554 1550 -1.2435723000000e+00 1597 1550 7.6305992000000e+00 1599 1550 -1.0858122000000e+00 2655 1550 -2.3514563000000e+00 445 1551 1.7389544000000e+00 446 1551 -2.8170320000000e-01 447 1551 -3.3474880000000e+00 1503 1551 -2.1792857000000e+00 1549 1551 -2.0968470000000e+02 1550 1551 3.2281529000000e+01 1551 1551 1.3446461000000e+01 1552 1551 1.1784598000000e+00 1553 1551 -1.9090548000000e-01 1554 1551 -2.1021332000000e+00 1597 1551 1.2898756000000e+01 1598 1551 -2.0895436000000e+00 1599 1551 -1.8354556000000e+00 2655 1551 -3.9748983000000e+00 448 1552 -1.0671973000000e-03 450 1552 -1.1137754000000e-05 1504 1552 -6.2085766000000e-03 1506 1552 -8.2935881000000e-06 1549 1552 -7.1899175000000e-04 1551 1552 -7.5037232000000e-06 1552 1552 2.1597555000000e+02 1554 1552 5.6090580000000e-04 1555 1552 -6.1745967000000e-02 1557 1552 -8.1998813000000e-06 1600 1552 -7.1997856000000e-04 1602 1552 -7.5140220000000e-06 2656 1552 -4.6791177000000e-02 2658 1552 -1.3190472000000e-05 448 1553 1.2852983000000e+00 450 1553 -1.8368744000000e+00 1506 1553 -1.3712112000000e+00 1551 1553 -1.2435723000000e+00 1552 1553 -1.4018058000000e+02 1553 1553 -4.1122058000000e+01 1554 1553 9.1927650000000e+00 1555 1553 3.8809383000000e+00 1557 1553 -1.3559021000000e+00 1600 1553 1.1021295000000e+01 1602 1553 -1.1995306000000e+00 2658 1553 -2.1810716000000e+00 448 1554 2.1726682000000e+00 449 1554 -3.5196233000000e-01 450 1554 -3.1050525000000e+00 1506 1554 -2.3178955000000e+00 1551 1554 -2.1021332000000e+00 1552 1554 -2.3696125000000e+02 1553 1554 3.6574131000000e+01 1554 1554 1.5539449000000e+01 1555 1554 6.5603381000000e+00 1556 1554 -1.0627448000000e+00 1557 1554 -2.2920168000000e+00 1600 1554 1.8630397000000e+01 1601 1554 -3.0180392000000e+00 1602 1554 -2.0276865000000e+00 2658 1554 -3.6868835000000e+00 451 1555 -9.8095071000000e-04 453 1555 -1.0237645000000e-05 1507 1555 -8.2605548000000e-04 1509 1555 -8.6210888000000e-06 1552 1555 -7.8569623000000e-04 1554 1555 -8.1998813000000e-06 1555 1555 2.3762407000000e+02 1557 1555 6.1174842000000e-04 1558 1555 -9.6016617000000e-02 1560 1555 -8.9917060000000e-06 1603 1555 -3.8034348000000e-02 1605 1555 -8.0120757000000e-06 2659 1555 -4.2697007000000e-02 2661 1555 -1.2107049000000e-05 451 1556 1.8502484000000e+00 453 1556 -1.6671745000000e+00 1509 1556 -1.4735359000000e+00 1554 1556 -1.3559021000000e+00 1555 1556 -1.6037733000000e+02 1556 1556 -4.5233550000000e+01 1557 1556 9.2621788000000e+00 1558 1556 6.5768912000000e+00 1560 1556 -1.4703690000000e+00 1603 1556 1.5556959000000e+01 1605 1556 -1.3103950000000e+00 2661 1556 -1.9797396000000e+00 451 1557 3.1276573000000e+00 452 1557 -5.0666325000000e-01 453 1557 -2.8181894000000e+00 1509 1557 -2.4908634000000e+00 1554 1557 -2.2920168000000e+00 1555 1557 -2.7110161000000e+02 1556 1557 4.1924961000000e+01 1557 1557 1.5656777000000e+01 1558 1557 1.1117568000000e+01 1559 1557 -1.8009847000000e+00 1560 1557 -2.4855097000000e+00 1603 1557 2.6297461000000e+01 1604 1557 -4.2600436000000e+00 1605 1557 -2.2150898000000e+00 2661 1557 -3.3465496000000e+00 454 1558 -9.3784308000000e-04 456 1558 -9.7877547000000e-06 1510 1558 -8.8034279000000e-04 1512 1558 -9.1876557000000e-06 1555 1558 -8.6156728000000e-04 1557 1558 -8.9917060000000e-06 1558 1558 2.5387027000000e+02 1560 1558 6.5172112000000e-04 1561 1558 -1.1131295000000e-01 1563 1558 -9.7550158000000e-06 1606 1558 -8.6572045000000e-02 1608 1558 -8.9907933000000e-06 2662 1558 -3.5557201000000e-02 2664 1558 -1.1539199000000e-05 454 1559 2.8964717000000e+00 456 1559 -1.5621511000000e+00 1512 1559 -1.5561203000000e+00 1557 1559 -1.4703690000000e+00 1558 1559 -1.7753410000000e+02 1559 1559 -4.8317530000000e+01 1560 1559 9.4613899000000e+00 1561 1559 7.1354518000000e+00 1563 1559 -1.5677348000000e+00 1606 1559 2.1809515000000e+01 1608 1559 -1.4451929000000e+00 2664 1559 -1.8544138000000e+00 454 1560 4.8961958000000e+00 455 1560 -7.9314774000000e-01 456 1560 -2.6406602000000e+00 1512 1560 -2.6304658000000e+00 1557 1560 -2.4855097000000e+00 1558 1560 -3.0010364000000e+02 1559 1560 4.6486840000000e+01 1560 1560 1.5993531000000e+01 1561 1560 1.2061768000000e+01 1562 1560 -1.9539178000000e+00 1563 1560 -2.6500988000000e+00 1606 1560 3.6866804000000e+01 1607 1560 -5.9721515000000e+00 1608 1560 -2.4429541000000e+00 2664 1560 -3.1347010000000e+00 457 1561 -9.0089319000000e-04 459 1561 -9.4021289000000e-06 1513 1561 -9.1820244000000e-04 1515 1561 -9.5827761000000e-06 1558 1561 -9.3470610000000e-04 1560 1561 -9.7550158000000e-06 1561 1561 2.7005098000000e+02 1563 1561 6.9134172000000e-04 1564 1561 -4.9570185000000e-02 1566 1561 -1.0246668000000e-05 1609 1561 -1.4764679000000e-01 1611 1561 -9.9586297000000e-06 2665 1561 -2.6542630000000e-02 2667 1561 -1.1035480000000e-05 457 1562 4.2818111000000e+00 459 1562 -1.4688418000000e+00 1515 1562 -1.6075376000000e+00 1560 1562 -1.5677348000000e+00 1561 1562 -1.9255353000000e+02 1562 1562 -5.1400549000000e+01 1563 1562 9.5838566000000e+00 1564 1562 3.9993039000000e+00 1566 1562 -1.6182239000000e+00 1609 1562 2.9278995000000e+01 1611 1562 -1.5730491000000e+00 2667 1562 -1.7427167000000e+00 457 1563 7.2379693000000e+00 458 1563 -1.1724858000000e+00 459 1563 -2.4829287000000e+00 1515 1563 -2.7173801000000e+00 1560 1563 -2.6500988000000e+00 1561 1563 -3.2549230000000e+02 1562 1563 5.0465801000000e+01 1563 1563 1.6200543000000e+01 1564 1563 6.7604194000000e+00 1565 1563 -1.0951270000000e+00 1566 1563 -2.7354441000000e+00 1609 1563 4.9493185000000e+01 1610 1563 -8.0174499000000e+00 1611 1563 -2.6590806000000e+00 2667 1563 -2.9458861000000e+00 460 1564 -9.1065197000000e-04 462 1564 -9.5039760000000e-06 1516 1564 -9.2322343000000e-04 1518 1564 -9.6351775000000e-06 1561 1564 -9.8181522000000e-04 1563 1564 -1.0246668000000e-05 1564 1564 2.7005242000000e+02 1566 1564 6.9243691000000e-04 1567 1564 -9.8558489000000e-04 1569 1564 -1.0286010000000e-05 1612 1564 -2.0590679000000e-01 1614 1564 -1.0280249000000e-05 2668 1564 -1.9502765000000e-02 2670 1564 -1.1119317000000e-05 460 1565 5.4598407000000e+00 462 1565 -1.4671910000000e+00 1518 1565 -1.6086679000000e+00 1563 1565 -1.6182239000000e+00 1564 1565 -1.9454466000000e+02 1565 1565 -5.1401676000000e+01 1566 1565 9.6671848000000e+00 1569 1565 -1.6181589000000e+00 1612 1565 3.4093072000000e+01 1614 1565 -1.6091451000000e+00 2670 1565 -1.7400448000000e+00 460 1566 9.2293147000000e+00 461 1566 -1.4950565000000e+00 462 1566 -2.4801396000000e+00 1518 1566 -2.7192922000000e+00 1563 1566 -2.7354441000000e+00 1564 1566 -3.2885829000000e+02 1565 1566 5.1007865000000e+01 1566 1566 1.6341406000000e+01 1569 1566 -2.7353340000000e+00 1612 1566 5.7630928000000e+01 1613 1566 -9.3356331000000e+00 1614 1566 -2.7200988000000e+00 2670 1566 -2.9413717000000e+00 463 1567 -9.0248425000000e-04 465 1567 -9.4187340000000e-06 1519 1567 -9.2151861000000e-04 1521 1567 -9.6173852000000e-06 1564 1567 -2.4568362000000e-02 1566 1567 -1.0286010000000e-05 1567 1567 2.7006275000000e+02 1569 1567 6.9209336000000e-04 1570 1567 -9.7191607000000e-04 1572 1567 -1.0143356000000e-05 1615 1567 -1.8675828000000e-01 1617 1567 -1.0220960000000e-05 2671 1567 -2.4154394000000e-02 2673 1567 -1.1043669000000e-05 463 1568 4.6256579000000e+00 465 1568 -1.4648449000000e+00 1521 1568 -1.6104834000000e+00 1564 1568 2.3189631000000e+00 1566 1568 -1.6181589000000e+00 1567 1568 -1.9259145000000e+02 1568 1568 -5.1400420000000e+01 1569 1568 9.6626938000000e+00 1572 1568 -1.6179695000000e+00 1615 1568 3.0653316000000e+01 1617 1568 -1.6082163000000e+00 2673 1568 -1.7372681000000e+00 463 1569 7.8192072000000e+00 464 1569 -1.2666381000000e+00 465 1569 -2.4761723000000e+00 1521 1569 -2.7223596000000e+00 1564 1569 3.9199728000000e+00 1565 1569 -6.3499882000000e-01 1566 1569 -2.7353340000000e+00 1567 1569 -3.2555639000000e+02 1568 1569 5.0476322000000e+01 1569 1569 1.6333809000000e+01 1572 1569 -2.7350156000000e+00 1615 1569 5.1816332000000e+01 1616 1569 -8.3937590000000e+00 1617 1569 -2.7185272000000e+00 2673 1569 -2.9366758000000e+00 466 1570 -8.8562662000000e-04 468 1570 -9.2428001000000e-06 1522 1570 -9.1414414000000e-04 1524 1570 -9.5404218000000e-06 1567 1570 -7.6561930000000e-02 1569 1570 -1.0143356000000e-05 1570 1570 2.7010278000000e+02 1572 1570 6.9121367000000e-04 1573 1570 -9.5611433000000e-04 1575 1570 -9.9784417000000e-06 1618 1570 -1.6525313000000e-01 1620 1570 -1.0082749000000e-05 2674 1570 -3.2290073000000e-02 2676 1570 -1.0869548000000e-05 466 1571 3.3381173000000e+00 468 1571 -1.4618491000000e+00 1524 1571 -1.6117570000000e+00 1567 1571 5.8761202000000e+00 1569 1571 -1.6179695000000e+00 1570 1571 -1.9042826000000e+02 1571 1571 -5.1399319000000e+01 1572 1571 9.6569757000000e+00 1575 1571 -1.6173807000000e+00 1618 1571 2.6218808000000e+01 1620 1571 -1.6085433000000e+00 2676 1571 -1.7337240000000e+00 466 1572 5.6427535000000e+00 467 1572 -9.1408041000000e-01 468 1572 -2.4711096000000e+00 1524 1572 -2.7245140000000e+00 1567 1572 9.9329935000000e+00 1568 1572 -1.6090646000000e+00 1569 1572 -2.7350156000000e+00 1570 1572 -3.2189992000000e+02 1571 1572 4.9887176000000e+01 1572 1572 1.6324150000000e+01 1575 1572 -2.7340189000000e+00 1618 1572 4.4320273000000e+01 1619 1572 -7.1795256000000e+00 1620 1572 -2.7190816000000e+00 2676 1572 -2.9306871000000e+00 469 1573 -8.6975225000000e-04 471 1573 -9.0771279000000e-06 1525 1573 -8.9459169000000e-04 1527 1573 -9.3363636000000e-06 1570 1573 -9.4315298000000e-02 1572 1573 -9.9784417000000e-06 1573 1573 2.7010058000000e+02 1575 1573 6.8985677000000e-04 1576 1573 -9.0942543000000e-04 1578 1573 -9.4911753000000e-06 1621 1573 -1.3796283000000e-01 1623 1573 -9.9224252000000e-06 2677 1573 -3.8943053000000e-02 2679 1573 -1.0703731000000e-05 469 1574 2.3525033000000e+00 471 1574 -1.4625507000000e+00 1527 1574 -1.5951116000000e+00 1570 1574 6.8457526000000e+00 1572 1574 -1.6173807000000e+00 1573 1574 -1.8773039000000e+02 1574 1574 -5.1398707000000e+01 1575 1574 9.5914529000000e+00 1578 1574 -1.5672576000000e+00 1621 1574 2.3535825000000e+01 1623 1574 -1.6085332000000e+00 2679 1574 -1.7348672000000e+00 469 1575 3.9766696000000e+00 470 1575 -6.4419486000000e-01 471 1575 -2.4722944000000e+00 1527 1575 -2.6963746000000e+00 1570 1575 1.1572054000000e+01 1571 1575 -1.8745984000000e+00 1572 1575 -2.7340189000000e+00 1573 1575 -3.1733928000000e+02 1574 1575 4.9150588000000e+01 1575 1575 1.6213383000000e+01 1578 1575 -2.6492923000000e+00 1621 1575 3.9784937000000e+01 1622 1575 -6.4449045000000e+00 1623 1575 -2.7190631000000e+00 2679 1575 -2.9326171000000e+00 472 1576 -9.0582650000000e-04 474 1576 -9.4536151000000e-06 1528 1576 -8.2914502000000e-04 1530 1576 -8.6533326000000e-06 1573 1576 -1.2133851000000e-01 1575 1576 -9.4911753000000e-06 1576 1576 2.5395488000000e+02 1578 1576 6.4999981000000e-04 1579 1576 -8.1695519000000e-04 1581 1576 -8.5261140000000e-06 1624 1576 -1.5291237000000e-01 1626 1576 -9.2566637000000e-06 2680 1576 -4.2703690000000e-02 2682 1576 -1.1163654000000e-05 472 1577 1.8001589000000e+00 474 1577 -1.5542434000000e+00 1530 1577 -1.4979855000000e+00 1573 1577 7.3708350000000e+00 1575 1577 -1.5672576000000e+00 1576 1577 -1.7841532000000e+02 1577 1577 -4.8316631000000e+01 1578 1577 9.4500405000000e+00 1581 1577 -1.4529925000000e+00 1624 1577 2.3550095000000e+01 1626 1577 -1.5287703000000e+00 2682 1577 -1.8433836000000e+00 472 1578 3.0429885000000e+00 473 1578 -4.9294985000000e-01 474 1578 -2.6272931000000e+00 1530 1578 -2.5321947000000e+00 1573 1578 1.2459659000000e+01 1574 1578 -2.0184063000000e+00 1575 1578 -2.6492923000000e+00 1576 1578 -3.0159326000000e+02 1577 1578 4.6731329000000e+01 1578 1578 1.5974347000000e+01 1581 1578 -2.4561369000000e+00 1624 1578 3.9809080000000e+01 1625 1578 -6.4488840000000e+00 1626 1578 -2.5842333000000e+00 2682 1578 -3.1160556000000e+00 475 1579 -9.5879409000000e-04 477 1579 -1.0006409000000e-05 1531 1579 -7.3883512000000e-04 1533 1579 -7.7108176000000e-06 1576 1579 -1.4722774000000e-01 1578 1579 -8.5261140000000e-06 1579 1579 2.3224678000000e+02 1581 1579 5.8100696000000e-04 2683 1579 -4.5977340000000e-02 2685 1579 -1.1828495000000e-05 475 1580 1.3378595000000e+00 477 1580 -1.6997381000000e+00 1533 1580 -1.3531654000000e+00 1576 1580 1.1432940000000e+01 1578 1580 -1.4529925000000e+00 1579 1580 -1.4606883000000e+02 1580 1580 -4.4202421000000e+01 1581 1580 6.5265189000000e+00 2685 1580 -2.0156766000000e+00 475 1581 2.2615161000000e+00 476 1581 -3.6636200000000e-01 477 1581 -2.8732354000000e+00 1533 1581 -2.2873895000000e+00 1576 1581 1.9326230000000e+01 1577 1581 -3.1308183000000e+00 1578 1581 -2.4561369000000e+00 1579 1581 -2.4691459000000e+02 1580 1581 3.8060785000000e+01 1581 1581 1.1032421000000e+01 2685 1581 -3.4072979000000e+00 1582 1582 1.0000000000000e+00 1583 1583 1.0000000000000e+00 1584 1584 1.0000000000000e+00 1585 1585 1.0000000000000e+00 1586 1586 1.0000000000000e+00 1587 1587 1.0000000000000e+00 1588 1588 1.0000000000000e+00 1589 1589 1.0000000000000e+00 1590 1590 1.0000000000000e+00 1591 1591 1.0000000000000e+00 1592 1592 1.0000000000000e+00 1593 1593 1.0000000000000e+00 1594 1594 1.0000000000000e+00 1595 1595 1.0000000000000e+00 1596 1596 1.0000000000000e+00 493 1597 -1.4028493000000e-03 495 1597 -1.4640770000000e-05 1549 1597 -1.2626206000000e-02 1551 1597 -6.7322581000000e-06 1597 1597 1.6737565000000e+02 1599 1597 4.4266306000000e-04 1600 1597 -4.1726548000000e-02 1602 1597 -6.5970170000000e-06 1645 1597 -5.6705978000000e-04 1647 1597 -5.9180924000000e-06 2701 1597 -4.8243544000000e-02 2703 1597 -1.7355340000000e-05 493 1598 1.0597904000000e+00 495 1598 -2.3587909000000e+00 1551 1598 -1.0858122000000e+00 1597 1598 -1.0603673000000e+02 1598 1598 -3.1887467000000e+01 1599 1598 8.2435414000000e+00 1600 1598 2.8951741000000e+00 1602 1598 -1.0641238000000e+00 1645 1598 6.0116601000000e+00 1647 1598 -9.3182338000000e-01 2703 1598 -2.7994161000000e+00 493 1599 1.7914685000000e+00 494 1599 -2.9020548000000e-01 495 1599 -3.9872974000000e+00 1551 1599 -1.8354556000000e+00 1597 1599 -1.7924437000000e+02 1598 1599 2.7588098000000e+01 1599 1599 1.3934873000000e+01 1600 1599 4.8939990000000e+00 1601 1599 -7.9279391000000e-01 1602 1599 -1.7987936000000e+00 1645 1599 1.0162103000000e+01 1646 1599 -1.6461903000000e+00 1647 1599 -1.5751531000000e+00 2703 1599 -4.7321305000000e+00 496 1600 -1.2576456000000e-03 498 1600 -1.3125358000000e-05 1552 1600 -9.2589174000000e-03 1554 1600 -7.5140220000000e-06 1597 1600 -6.3211298000000e-04 1599 1600 -6.5970170000000e-06 1600 1600 1.8902105000000e+02 1602 1600 4.9862145000000e-04 1603 1600 -9.5628774000000e-02 1605 1600 -7.3856317000000e-06 1648 1600 -1.4988432000000e-02 1650 1600 -6.5290539000000e-06 2704 1600 -4.4944929000000e-02 2706 1600 -1.5540863000000e-05 496 1601 1.5156651000000e+00 498 1601 -2.0902235000000e+00 1554 1601 -1.1995306000000e+00 1599 1601 -1.0641238000000e+00 1600 1601 -1.2523525000000e+02 1601 1601 -3.6002030000000e+01 1602 1601 9.0609038000000e+00 1603 1601 6.5392851000000e+00 1605 1601 -1.1792028000000e+00 1648 1601 8.7142602000000e+00 1650 1601 -1.0425703000000e+00 2706 1601 -2.4812165000000e+00 496 1602 2.5620804000000e+00 497 1602 -4.1503644000000e-01 498 1602 -3.5333138000000e+00 1554 1602 -2.0276865000000e+00 1599 1602 -1.7987936000000e+00 1600 1602 -2.1169766000000e+02 1601 1602 3.2657959000000e+01 1602 1602 1.5316551000000e+01 1603 1602 1.1054008000000e+01 1604 1602 -1.7906604000000e+00 1605 1602 -1.9933245000000e+00 1648 1602 1.4730585000000e+01 1649 1602 -2.3862365000000e+00 1650 1602 -1.7623608000000e+00 2706 1602 -4.1942484000000e+00 499 1603 -1.1872176000000e-03 501 1603 -1.2390340000000e-05 1555 1603 -7.6770106000000e-04 1557 1603 -8.0120757000000e-06 1600 1603 -7.0767646000000e-04 1602 1603 -7.3856317000000e-06 1603 1603 2.0524886000000e+02 1605 1603 5.3797809000000e-04 1606 1603 -1.2557096000000e-01 1608 1603 -8.3489597000000e-06 1651 1603 -4.2672522000000e-02 1653 1603 -7.3950702000000e-06 2707 1603 -3.6136438000000e-02 2709 1603 -1.4627561000000e-05 499 1604 2.7846523000000e+00 501 1604 -1.9272396000000e+00 1557 1604 -1.3103950000000e+00 1602 1604 -1.1792028000000e+00 1603 1604 -1.4376079000000e+02 1604 1604 -3.9087761000000e+01 1605 1604 9.1712597000000e+00 1606 1604 1.0042669000000e+01 1608 1604 -1.3057448000000e+00 1651 1604 1.3170317000000e+01 1653 1604 -1.1567119000000e+00 2709 1604 -2.2875832000000e+00 499 1605 4.7071732000000e+00 500 1605 -7.6251491000000e-01 501 1605 -3.2578037000000e+00 1557 1605 -2.2150898000000e+00 1602 1605 -1.9933245000000e+00 1603 1605 -2.4301308000000e+02 1604 1605 3.7590468000000e+01 1605 1605 1.5503089000000e+01 1606 1605 1.6976116000000e+01 1607 1605 -2.7499606000000e+00 1608 1605 -2.2072296000000e+00 1651 1605 2.2263089000000e+01 1652 1605 -3.6063975000000e+00 1653 1605 -1.9553045000000e+00 2709 1605 -3.8669288000000e+00 502 1606 -1.0819594000000e-03 504 1606 -1.1291817000000e-05 1558 1606 -8.6147983000000e-04 1560 1606 -8.9907933000000e-06 1603 1606 -7.9998062000000e-04 1605 1606 -8.3489597000000e-06 1606 1606 2.3233074000000e+02 1608 1606 6.0306568000000e-04 1609 1606 -1.5408543000000e-01 1611 1606 -9.6579554000000e-06 1654 1606 -1.3601395000000e-01 1656 1606 -8.5524443000000e-06 2710 1606 -1.9913327000000e-02 2712 1606 -1.3258716000000e-05 502 1607 5.1966535000000e+00 504 1607 -1.6980784000000e+00 1560 1607 -1.4451929000000e+00 1605 1607 -1.3057448000000e+00 1606 1607 -1.7083276000000e+02 1607 1607 -4.4233502000000e+01 1608 1607 9.2379422000000e+00 1609 1607 1.1851465000000e+01 1611 1607 -1.4681910000000e+00 1654 1607 2.0530332000000e+01 1656 1607 -1.3003019000000e+00 2712 1607 -2.0154729000000e+00 502 1608 8.7844231000000e+00 503 1608 -1.4229619000000e+00 504 1608 -2.8704318000000e+00 1560 1608 -2.4429541000000e+00 1605 1608 -2.2072296000000e+00 1606 1608 -2.8877570000000e+02 1607 1608 4.4762455000000e+01 1608 1608 1.5615816000000e+01 1609 1608 2.0033716000000e+01 1610 1608 -3.2452005000000e+00 1611 1608 -2.4818300000000e+00 1654 1608 3.4704472000000e+01 1655 1608 -5.6216716000000e+00 1656 1608 -2.1980304000000e+00 2712 1608 -3.4069554000000e+00 505 1609 -2.6456252000000e-02 507 1609 -1.0330459000000e-05 1561 1609 -9.5421598000000e-04 1563 1609 -9.9586297000000e-06 1606 1609 -9.2540597000000e-04 1608 1609 -9.6579554000000e-06 1609 1609 2.5933862000000e+02 1611 1609 6.6893971000000e-04 1612 1609 -1.0266790000000e-01 1614 1609 -1.0736130000000e-05 1657 1609 -2.1242437000000e-01 1659 1609 -1.0013213000000e-05 2713 1609 -1.1620610000000e-03 2715 1609 -1.2127795000000e-05 505 1610 9.0270468000000e+00 507 1610 -1.5257493000000e+00 1563 1610 -1.5730491000000e+00 1608 1610 -1.4681910000000e+00 1609 1610 -1.9814194000000e+02 1610 1610 -4.9379196000000e+01 1611 1610 9.4479177000000e+00 1612 1610 7.9992192000000e+00 1614 1610 -1.5855539000000e+00 1657 1610 3.2370162000000e+01 1659 1610 -1.4790745000000e+00 2715 1610 -1.8107620000000e+00 505 1611 1.5259307000000e+01 506 1611 -2.4717635000000e+00 507 1611 -2.5791245000000e+00 1563 1611 -2.6590806000000e+00 1608 1611 -2.4818300000000e+00 1609 1611 -3.3493888000000e+02 1610 1611 5.1999266000000e+01 1611 1611 1.5970750000000e+01 1612 1611 1.3521870000000e+01 1613 1611 -2.1903262000000e+00 1614 1611 -2.6802181000000e+00 1657 1611 5.4718480000000e+01 1658 1611 -8.8635174000000e+00 1659 1611 -2.5002256000000e+00 2715 1611 -3.0609100000000e+00 508 1612 -6.7715004000000e-02 510 1612 -1.0068303000000e-05 1564 1612 -9.8503287000000e-04 1566 1612 -1.0280249000000e-05 1609 1612 -1.0287145000000e-03 1611 1612 -1.0736130000000e-05 1612 1612 2.7021955000000e+02 1614 1612 6.9634780000000e-04 1615 1612 -1.0557024000000e-03 1617 1612 -1.1017788000000e-05 1660 1612 -3.6415174000000e-01 1662 1612 -1.1100880000000e-05 2716 1612 -1.1272357000000e-03 2718 1612 -1.1764342000000e-05 508 1613 1.3074018000000e+01 510 1613 -1.4613155000000e+00 1566 1613 -1.6091451000000e+00 1611 1613 -1.5855539000000e+00 1612 1613 -2.1305004000000e+02 1613 1613 -5.1438365000000e+01 1614 1613 9.6248333000000e+00 1617 1613 -1.6186598000000e+00 1660 1613 4.5035434000000e+01 1662 1613 -1.6113632000000e+00 2718 1613 -1.7330264000000e+00 508 1614 2.2100320000000e+01 509 1614 -3.5798534000000e+00 510 1614 -2.4702077000000e+00 1566 1614 -2.7200988000000e+00 1611 1614 -2.6802181000000e+00 1612 1614 -3.6013979000000e+02 1613 1614 5.5982322000000e+01 1614 1614 1.6269814000000e+01 1617 1614 -2.7361804000000e+00 1660 1614 7.6127896000000e+01 1661 1614 -1.2331347000000e+01 1662 1614 -2.7238483000000e+00 2718 1614 -2.9295078000000e+00 511 1615 -3.1451497000000e-02 513 1615 -9.9726638000000e-06 1567 1615 -9.7935191000000e-04 1569 1615 -1.0220960000000e-05 1612 1615 -4.3788619000000e-02 1614 1615 -1.1017788000000e-05 1615 1615 2.7009141000000e+02 1617 1615 6.9600893000000e-04 1618 1615 -1.0320963000000e-03 1620 1615 -1.0771424000000e-05 1663 1615 -2.2408230000000e-01 1665 1615 -1.0960101000000e-05 2719 1615 -1.1200582000000e-03 2721 1615 -1.1689435000000e-05 511 1616 9.5237157000000e+00 513 1616 -1.4651993000000e+00 1569 1616 -1.6082163000000e+00 1612 1616 5.7618926000000e+00 1614 1616 -1.6186598000000e+00 1615 1616 -2.0458147000000e+02 1616 1616 -5.1433248000000e+01 1617 1616 9.6644380000000e+00 1620 1616 -1.6184823000000e+00 1663 1616 3.4348042000000e+01 1665 1616 -1.6104571000000e+00 2721 1616 -1.7376559000000e+00 511 1617 1.6098875000000e+01 512 1617 -2.6077513000000e+00 513 1617 -2.4767708000000e+00 1569 1617 -2.7185272000000e+00 1612 1617 9.7398956000000e+00 1613 1617 -1.5777018000000e+00 1614 1617 -2.7361804000000e+00 1615 1617 -3.4582425000000e+02 1616 1617 5.3676628000000e+01 1617 1617 1.6336756000000e+01 1620 1617 -2.7358825000000e+00 1663 1617 5.8061886000000e+01 1664 1617 -9.4050628000000e+00 1665 1617 -2.7223145000000e+00 2721 1617 -2.9373322000000e+00 514 1618 -9.4927803000000e-04 516 1618 -9.9070950000000e-06 1570 1618 -9.6610888000000e-04 1572 1618 -1.0082749000000e-05 1615 1618 -9.8287232000000e-02 1617 1618 -1.0771424000000e-05 1618 1618 2.7003821000000e+02 1620 1618 6.9496775000000e-04 1621 1618 -1.0100503000000e-03 1623 1618 -1.0541342000000e-05 1666 1618 -1.2446857000000e-01 1668 1618 -1.0709992000000e-05 2722 1618 -1.6260742000000e-02 2724 1618 -1.1586719000000e-05 514 1619 5.8398884000000e+00 516 1619 -1.4678694000000e+00 1572 1619 -1.6085433000000e+00 1615 1619 1.0345519000000e+01 1617 1619 -1.6184823000000e+00 1618 1619 -1.9723158000000e+02 1619 1619 -5.1426699000000e+01 1620 1619 9.6690332000000e+00 1623 1619 -1.6180395000000e+00 1666 1619 2.6089067000000e+01 1668 1619 -1.6094869000000e+00 2724 1619 -1.7408475000000e+00 514 1620 9.8717472000000e+00 515 1620 -1.5990822000000e+00 516 1620 -2.4812864000000e+00 1572 1620 -2.7190816000000e+00 1615 1620 1.7488065000000e+01 1616 1620 -2.8328170000000e+00 1617 1620 -2.7358825000000e+00 1618 1620 -3.3340025000000e+02 1619 1620 5.1680985000000e+01 1620 1620 1.6344532000000e+01 1623 1620 -2.7351320000000e+00 1666 1620 4.4100959000000e+01 1667 1620 -7.1437259000000e+00 1668 1620 -2.7206767000000e+00 2724 1620 -2.9427286000000e+00 517 1621 -9.2465410000000e-04 519 1621 -9.6501086000000e-06 1573 1621 -9.5074694000000e-04 1575 1621 -9.9224252000000e-06 1618 1621 -1.2181232000000e-01 1620 1621 -1.0541342000000e-05 1621 1621 2.7003369000000e+02 1623 1621 6.9347917000000e-04 1624 1621 -9.7504882000000e-04 1626 1621 -1.0176051000000e-05 1669 1621 -7.9817295000000e-02 1671 1621 -1.0486731000000e-05 2725 1621 -3.0551219000000e-02 2727 1621 -1.1345441000000e-05 517 1622 3.6187819000000e+00 519 1622 -1.4681648000000e+00 1575 1622 -1.6085332000000e+00 1618 1622 9.5462132000000e+00 1620 1622 -1.6180395000000e+00 1621 1622 -1.8982629000000e+02 1622 1622 -5.1424648000000e+01 1623 1622 9.6365862000000e+00 1626 1622 -1.5848009000000e+00 1669 1622 2.1701004000000e+01 1671 1622 -1.6099108000000e+00 2727 1622 -1.7413736000000e+00 517 1623 6.1171845000000e+00 518 1623 -9.9091094000000e-01 519 1623 -2.4817839000000e+00 1575 1623 -2.7190631000000e+00 1618 1623 1.6136907000000e+01 1619 1623 -2.6139865000000e+00 1620 1623 -2.7351320000000e+00 1621 1623 -3.2088212000000e+02 1622 1623 4.9659240000000e+01 1623 1623 1.6289676000000e+01 1626 1623 -2.6789474000000e+00 1669 1623 3.6683350000000e+01 1670 1623 -5.9422651000000e+00 1671 1623 -2.7213913000000e+00 2727 1623 -2.9436164000000e+00 520 1624 -9.4686439000000e-04 522 1624 -9.8819052000000e-06 1576 1624 -8.8695501000000e-04 1578 1624 -9.2566637000000e-06 1621 1624 -1.0010991000000e-01 1623 1624 -1.0176051000000e-05 1624 1624 2.5920303000000e+02 1626 1624 6.5708136000000e-04 1672 1624 -5.8725439000000e-02 1674 1624 -1.0028607000000e-05 2728 1624 -3.6772028000000e-02 2730 1624 -1.1644704000000e-05 520 1625 2.6940643000000e+00 522 1625 -1.5292250000000e+00 1578 1625 -1.5287703000000e+00 1621 1625 6.2274337000000e+00 1623 1625 -1.5848009000000e+00 1624 1625 -1.7666489000000e+02 1625 1625 -4.9368903000000e+01 1626 1625 8.0239023000000e+00 1672 1625 1.8983067000000e+01 1674 1625 -1.5621015000000e+00 2730 1625 -1.8134713000000e+00 520 1626 4.5540463000000e+00 521 1626 -7.3770750000000e-01 522 1626 -2.5850020000000e+00 1578 1626 -2.5842333000000e+00 1621 1626 1.0526854000000e+01 1622 1626 -1.7052394000000e+00 1623 1626 -2.6789474000000e+00 1624 1626 -2.9863434000000e+02 1625 1626 4.6145579000000e+01 1626 1626 1.3563604000000e+01 1672 1626 3.2088976000000e+01 1673 1626 -5.1980760000000e+00 1674 1626 -2.6405763000000e+00 2730 1626 -3.0654918000000e+00 1627 1627 1.0000000000000e+00 1628 1628 1.0000000000000e+00 1629 1629 1.0000000000000e+00 1630 1630 1.0000000000000e+00 1631 1631 1.0000000000000e+00 1632 1632 1.0000000000000e+00 1633 1633 1.0000000000000e+00 1634 1634 1.0000000000000e+00 1635 1635 1.0000000000000e+00 1636 1636 1.0000000000000e+00 1637 1637 1.0000000000000e+00 1638 1638 1.0000000000000e+00 1639 1639 1.0000000000000e+00 1640 1640 1.0000000000000e+00 1641 1641 1.0000000000000e+00 1642 1642 1.0000000000000e+00 1643 1643 1.0000000000000e+00 1644 1644 1.0000000000000e+00 541 1645 -1.6444165000000e-03 543 1645 -1.7161875000000e-05 1597 1645 -4.3774437000000e-03 1599 1645 -5.9180924000000e-06 1645 1645 1.4578467000000e+02 1647 1645 3.9539125000000e-04 1648 1645 -5.2525336000000e-02 1650 1645 -5.8435869000000e-06 1693 1645 -1.6373276000000e-03 1695 1645 -5.2194194000000e-06 2749 1645 -4.8402572000000e-02 2751 1645 -2.0336349000000e-05 541 1646 1.0288629000000e+00 543 1646 -2.6992882000000e+00 1599 1646 -9.3182338000000e-01 1645 1646 -9.1799685000000e+01 1646 1646 -2.7783778000000e+01 1647 1646 8.5786460000000e+00 1648 1646 4.2579789000000e+00 1650 1646 -9.2019439000000e-01 1693 1646 2.8539434000000e+00 1695 1646 -8.2194276000000e-01 2751 1646 -3.2022787000000e+00 541 1647 1.7391889000000e+00 542 1647 -2.8173234000000e-01 543 1647 -4.5628743000000e+00 1599 1647 -1.5751531000000e+00 1645 1647 -1.5517811000000e+02 1646 1647 2.3849486000000e+01 1647 1647 1.4501334000000e+01 1648 1647 7.1976838000000e+00 1649 1647 -1.1659574000000e+00 1650 1647 -1.5554957000000e+00 1693 1647 4.8243035000000e+00 1694 1647 -7.8149195000000e-01 1695 1647 -1.3894113000000e+00 2751 1647 -5.4131281000000e+00 544 1648 -1.5090144000000e-03 546 1648 -1.5748757000000e-05 1600 1648 -6.2560088000000e-04 1602 1648 -6.5290539000000e-06 1645 1648 -5.5992081000000e-04 1647 1648 -5.8435869000000e-06 1648 1648 1.6202622000000e+02 1650 1648 4.3815254000000e-04 1651 1648 -1.0683496000000e-01 1653 1648 -6.6625540000000e-06 1696 1648 -1.2933066000000e-02 1698 1648 -5.9343868000000e-06 2752 1648 -4.2824486000000e-02 2754 1648 -1.8637995000000e-05 544 1649 1.8112808000000e+00 546 1649 -2.4314260000000e+00 1602 1649 -1.0425703000000e+00 1647 1649 -9.2019439000000e-01 1648 1649 -1.0877024000000e+02 1649 1649 -3.0872090000000e+01 1650 1649 9.2324532000000e+00 1651 1649 8.8405414000000e+00 1653 1649 -1.0313028000000e+00 1696 1649 5.1659370000000e+00 1698 1649 -9.1863870000000e-01 2754 1649 -2.8848554000000e+00 544 1650 3.0617890000000e+00 545 1650 -4.9597554000000e-01 546 1650 -4.1100826000000e+00 1602 1650 -1.7623608000000e+00 1647 1650 -1.5554957000000e+00 1648 1650 -1.8386522000000e+02 1649 1650 2.8349994000000e+01 1650 1650 1.5606538000000e+01 1651 1650 1.4944051000000e+01 1652 1650 -2.4207689000000e+00 1653 1650 -1.7433142000000e+00 1696 1650 8.7324999000000e+00 1697 1650 -1.4145672000000e+00 1698 1650 -1.5528669000000e+00 2754 1650 -4.8765596000000e+00 547 1651 -1.3821334000000e-03 549 1651 -1.4424569000000e-05 1603 1651 -7.0858084000000e-04 1605 1651 -7.3950702000000e-06 1648 1651 -6.3839260000000e-04 1650 1651 -6.6625540000000e-06 1651 1651 1.8368970000000e+02 1653 1651 4.8940519000000e-04 1654 1651 -1.9026575000000e-01 1656 1651 -7.7383422000000e-06 1699 1651 -3.0179617000000e-02 1701 1651 -6.8637821000000e-06 2755 1651 -2.7383811000000e-02 2757 1651 -1.7008204000000e-05 547 1652 4.0665688000000e+00 549 1652 -2.1501943000000e+00 1605 1652 -1.1567119000000e+00 1650 1652 -1.0313028000000e+00 1651 1652 -1.3193041000000e+02 1652 1652 -3.4991172000000e+01 1653 1652 9.0855690000000e+00 1654 1652 1.4042325000000e+01 1656 1652 -1.1612148000000e+00 1699 1652 8.4795271000000e+00 1701 1652 -1.0300719000000e+00 2757 1652 -2.5521445000000e+00 547 1653 6.8741223000000e+00 548 1653 -1.1135093000000e+00 549 1653 -3.6346854000000e+00 1605 1653 -1.9553045000000e+00 1650 1653 -1.7433142000000e+00 1651 1653 -2.2301501000000e+02 1652 1653 3.4492949000000e+01 1653 1653 1.5358235000000e+01 1654 1653 2.3737128000000e+01 1655 1653 -3.8450744000000e+00 1656 1653 -1.9629160000000e+00 1699 1653 1.4333783000000e+01 1700 1653 -2.3218674000000e+00 1701 1653 -1.7412321000000e+00 2757 1653 -4.3141417000000e+00 550 1654 -3.3803668000000e-02 552 1654 -1.3399561000000e-05 1606 1654 -8.1947810000000e-04 1608 1654 -8.5524443000000e-06 1651 1654 -7.4147247000000e-04 1653 1654 -7.7383422000000e-06 1654 1654 2.0530217000000e+02 1656 1654 5.4275019000000e-04 1657 1654 -1.9002003000000e-01 1659 1654 -9.1776761000000e-06 1702 1654 -5.7100965000000e-02 1704 1654 -8.2919913000000e-06 2758 1654 -1.5092283000000e-03 2760 1654 -1.5750990000000e-05 550 1655 9.7233247000000e+00 552 1655 -1.9272400000000e+00 1608 1655 -1.3003019000000e+00 1653 1655 -1.1612148000000e+00 1654 1655 -1.6066937000000e+02 1655 1655 -3.9109356000000e+01 1656 1655 9.1921782000000e+00 1657 1655 1.8701559000000e+01 1659 1655 -1.3200215000000e+00 1702 1655 1.4512037000000e+01 1704 1655 -1.1927259000000e+00 2760 1655 -2.2862821000000e+00 550 1656 1.6436308000000e+01 551 1656 -2.6623687000000e+00 552 1656 -3.2578065000000e+00 1608 1656 -2.1980304000000e+00 1653 1656 -1.9629160000000e+00 1654 1656 -2.7159550000000e+02 1655 1656 4.2164769000000e+01 1656 1656 1.5538456000000e+01 1657 1656 3.1613115000000e+01 1658 1656 -5.1207224000000e+00 1659 1656 -2.2313643000000e+00 1702 1656 2.4531147000000e+01 1703 1656 -3.9735786000000e+00 1704 1656 -2.0161839000000e+00 2760 1656 -3.8647313000000e+00 553 1657 -1.4724815000000e-01 555 1657 -1.2115562000000e-05 1609 1657 -9.5944604000000e-04 1611 1657 -1.0013213000000e-05 1654 1657 -8.7938657000000e-04 1656 1657 -9.1776761000000e-06 1657 1657 2.3794610000000e+02 1659 1657 6.2205494000000e-04 1660 1657 -2.2289853000000e-01 1662 1657 -1.1041321000000e-05 1705 1657 -1.9544122000000e-01 1707 1657 -9.9884456000000e-06 2761 1657 -1.3508199000000e-03 2763 1657 -1.4097767000000e-05 553 1658 2.0895887000000e+01 555 1658 -1.6625969000000e+00 1611 1658 -1.4790745000000e+00 1656 1658 -1.3200215000000e+00 1657 1658 -2.0170899000000e+02 1658 1658 -4.5295405000000e+01 1659 1658 9.3258634000000e+00 1660 1658 1.6827796000000e+01 1662 1658 -1.5150411000000e+00 1705 1658 2.7679249000000e+01 1707 1658 -1.3707856000000e+00 2763 1658 -1.9732535000000e+00 553 1659 3.5322382000000e+01 554 1659 -5.7213681000000e+00 555 1659 -2.8104518000000e+00 1611 1659 -2.5002256000000e+00 1656 1659 -2.2313643000000e+00 1657 1659 -3.4096864000000e+02 1658 1659 5.3084456000000e+01 1659 1659 1.5764430000000e+01 1660 1659 2.8445687000000e+01 1661 1659 -4.6075103000000e+00 1662 1659 -2.5610236000000e+00 1705 1659 4.6788972000000e+01 1706 1659 -7.5786762000000e+00 1707 1659 -2.3171744000000e+00 2763 1659 -3.3355854000000e+00 556 1660 -3.1161847000000e-01 558 1660 -1.1064451000000e-05 1612 1660 -1.0636641000000e-03 1614 1660 -1.1100880000000e-05 1657 1660 -1.0579573000000e-03 1659 1660 -1.1041321000000e-05 1660 1660 2.7055967000000e+02 1662 1660 7.0111889000000e-04 1663 1660 -1.1344195000000e-03 1665 1660 -1.1839315000000e-05 1708 1660 -4.9982639000000e-01 1710 1660 -1.1934851000000e-05 2764 1660 -1.2195763000000e-03 2766 1660 -1.2728050000000e-05 556 1661 3.7096615000000e+01 558 1661 -1.4650651000000e+00 1614 1661 -1.6113632000000e+00 1659 1661 -1.5150411000000e+00 1660 1661 -2.5296939000000e+02 1661 1661 -5.1474670000000e+01 1662 1661 9.5348012000000e+00 1665 1661 -1.6191856000000e+00 1708 1661 6.0983824000000e+01 1710 1661 -1.5804774000000e+00 2766 1661 -1.7378832000000e+00 556 1662 6.2708117000000e+01 557 1662 -1.0156920000000e+01 558 1662 -2.4765460000000e+00 1614 1662 -2.7238483000000e+00 1659 1662 -2.5610236000000e+00 1660 1662 -4.2761945000000e+02 1661 1662 6.6818708000000e+01 1662 1662 1.6117624000000e+01 1665 1662 -2.7370696000000e+00 1708 1662 1.0308706000000e+02 1709 1662 -1.6697151000000e+01 1710 1662 -2.6716390000000e+00 2766 1662 -2.9377177000000e+00 559 1663 -1.3855821000000e-01 561 1663 -1.0693079000000e-05 1615 1663 -1.0501750000000e-03 1617 1663 -1.0960101000000e-05 1660 1663 -1.8446945000000e-01 1662 1663 -1.1839315000000e-05 1663 1663 2.7028462000000e+02 1665 1663 7.0049918000000e-04 1666 1663 -1.0916982000000e-03 1668 1663 -1.1393456000000e-05 1711 1663 -2.0698907000000e-01 1713 1663 -1.1803048000000e-05 2767 1663 -1.1897661000000e-03 2769 1663 -1.2416937000000e-05 559 1664 2.0050906000000e+01 561 1664 -1.4625411000000e+00 1617 1664 -1.6104571000000e+00 1660 1664 1.6483139000000e+01 1662 1664 -1.6191856000000e+00 1663 1664 -2.2180181000000e+02 1664 1664 -5.1467914000000e+01 1665 1664 9.6658244000000e+00 1668 1664 -1.6189908000000e+00 1711 1664 3.0368874000000e+01 1713 1664 -1.6144318000000e+00 2769 1664 -1.7344354000000e+00 559 1665 3.3894031000000e+01 560 1665 -5.4899961000000e+00 561 1665 -2.4722779000000e+00 1617 1665 -2.7223145000000e+00 1660 1665 2.7863080000000e+01 1661 1665 -4.5131313000000e+00 1662 1665 -2.7370696000000e+00 1663 1665 -3.7493354000000e+02 1664 1665 5.8303482000000e+01 1665 1665 1.6339100000000e+01 1668 1665 -2.7367420000000e+00 1711 1665 5.1335512000000e+01 1712 1665 -8.3150859000000e+00 1713 1665 -2.7290339000000e+00 2769 1665 -2.9318876000000e+00 562 1666 -3.4524809000000e-02 564 1666 -1.0286721000000e-05 1618 1666 -1.0262100000000e-03 1620 1666 -1.0709992000000e-05 1663 1666 -1.9838020000000e-01 1665 1666 -1.1393456000000e-05 1666 1666 2.7011203000000e+02 1668 1666 6.9824186000000e-04 1669 1666 -1.0595532000000e-03 1671 1666 -1.1057976000000e-05 1714 1666 -1.1455620000000e-01 1716 1666 -1.1360162000000e-05 2770 1666 -1.1553500000000e-03 2772 1666 -1.2057755000000e-05 562 1667 9.8107963000000e+00 564 1667 -1.4617749000000e+00 1620 1667 -1.6094869000000e+00 1663 1667 1.8634428000000e+01 1665 1667 -1.6189908000000e+00 1666 1667 -2.0385159000000e+02 1667 1667 -5.1459003000000e+01 1668 1667 9.6625734000000e+00 1671 1667 -1.6185609000000e+00 1714 1667 2.0494516000000e+01 1716 1667 -1.6143877000000e+00 2772 1667 -1.7335935000000e+00 562 1668 1.6584170000000e+01 563 1668 -2.6862973000000e+00 564 1668 -2.4709843000000e+00 1620 1668 -2.7206767000000e+00 1663 1668 3.1499637000000e+01 1664 1668 -5.1022988000000e+00 1665 1668 -2.7367420000000e+00 1666 1668 -3.4459073000000e+02 1667 1668 5.3412258000000e+01 1668 1668 1.6333612000000e+01 1671 1668 -2.7360136000000e+00 1714 1668 3.4643930000000e+01 1715 1668 -5.6116100000000e+00 1716 1668 -2.7289610000000e+00 2772 1668 -2.9304664000000e+00 565 1669 -9.6823731000000e-04 567 1669 -1.0104963000000e-05 1621 1669 -1.0048176000000e-03 1623 1669 -1.0486731000000e-05 1666 1669 -1.6675602000000e-01 1668 1669 -1.1057976000000e-05 1669 1669 2.7004389000000e+02 1671 1669 6.9663137000000e-04 1672 1669 -1.0295369000000e-03 1674 1669 -1.0744713000000e-05 1717 1669 -8.7898661000000e-02 1719 1669 -1.1036116000000e-05 2773 1669 -1.9894113000000e-02 2775 1669 -1.1840431000000e-05 565 1670 5.2180375000000e+00 567 1670 -1.4611605000000e+00 1623 1670 -1.6099108000000e+00 1666 1670 1.3966226000000e+01 1668 1670 -1.6185609000000e+00 1669 1670 -1.9120414000000e+02 1670 1670 -5.1454603000000e+01 1671 1670 9.6458946000000e+00 1674 1670 -1.6020081000000e+00 1717 1670 1.7101421000000e+01 1719 1670 -1.6155050000000e+00 2775 1670 -1.7329727000000e+00 565 1671 8.8205643000000e+00 566 1671 -1.4287813000000e+00 567 1671 -2.4699439000000e+00 1623 1671 -2.7213913000000e+00 1666 1671 2.3608493000000e+01 1667 1671 -3.8241739000000e+00 1668 1671 -2.7360136000000e+00 1669 1671 -3.2321126000000e+02 1670 1671 4.9961416000000e+01 1671 1671 1.6305411000000e+01 1674 1671 -2.7080345000000e+00 1717 1671 2.8908223000000e+01 1718 1671 -4.6826404000000e+00 1719 1671 -2.7308478000000e+00 2775 1671 -2.9294150000000e+00 568 1672 -9.6550868000000e-04 570 1672 -1.0076485000000e-05 1624 1672 -9.6092110000000e-04 1626 1672 -1.0028607000000e-05 1669 1672 -1.2038901000000e-01 1671 1672 -1.0744713000000e-05 1672 1672 2.6457226000000e+02 1674 1672 6.7214879000000e-04 1720 1672 -4.7733116000000e-02 1722 1672 -1.0724002000000e-05 2776 1672 -3.0770786000000e-02 2778 1672 -1.1852882000000e-05 568 1673 3.5314347000000e+00 570 1673 -1.4901284000000e+00 1626 1673 -1.5621015000000e+00 1669 1673 8.4202293000000e+00 1671 1673 -1.6020081000000e+00 1672 1673 -1.7582806000000e+02 1673 1673 -5.0425341000000e+01 1674 1673 8.0261255000000e+00 1720 1673 1.2055848000000e+01 1722 1673 -1.5990651000000e+00 2778 1673 -1.7671616000000e+00 568 1674 5.9695372000000e+00 569 1674 -9.6697473000000e-01 570 1674 -2.5189130000000e+00 1626 1674 -2.6405763000000e+00 1669 1674 1.4233556000000e+01 1670 1674 -2.3056207000000e+00 1671 1674 -2.7080345000000e+00 1672 1674 -2.9721975000000e+02 1673 1674 4.5800144000000e+01 1674 1674 1.3567363000000e+01 1720 1674 2.0379205000000e+01 1721 1674 -3.3011229000000e+00 1722 1674 -2.7030597000000e+00 2778 1674 -2.9872100000000e+00 1675 1675 1.0000000000000e+00 1676 1676 1.0000000000000e+00 1677 1677 1.0000000000000e+00 1678 1678 1.0000000000000e+00 1679 1679 1.0000000000000e+00 1680 1680 1.0000000000000e+00 1681 1681 1.0000000000000e+00 1682 1682 1.0000000000000e+00 1683 1683 1.0000000000000e+00 1684 1684 1.0000000000000e+00 1685 1685 1.0000000000000e+00 1686 1686 1.0000000000000e+00 1687 1687 1.0000000000000e+00 1688 1688 1.0000000000000e+00 1689 1689 1.0000000000000e+00 586 1690 -2.2242274000000e-03 588 1690 -2.3213044000000e-05 1690 1690 1.0797413000000e+02 1692 1690 3.1185895000000e-04 1693 1690 -1.3479570000000e-02 1695 1690 -4.5005320000000e-06 1738 1690 -3.9297606000000e-04 1740 1690 -4.1012760000000e-06 2794 1690 -5.2332926000000e-02 2796 1690 -2.7518009000000e-05 586 1691 5.3852628000000e-01 588 1691 -3.6425216000000e+00 1690 1691 -6.4387337000000e+01 1691 1691 -1.8888764000000e+01 1692 1691 9.3186480000000e+00 1693 1691 1.8825568000000e+00 1695 1691 -7.0652571000000e-01 1740 1691 -6.4747945000000e-01 2796 1691 -4.3198103000000e+00 586 1692 9.1032483000000e-01 587 1692 -1.4746373000000e-01 588 1692 -6.1573185000000e+00 1690 1692 -1.0884036000000e+02 1691 1692 1.9535090000000e+01 1692 1692 1.5752243000000e+01 1693 1692 3.1822740000000e+00 1694 1692 -5.1549731000000e-01 1695 1692 -1.1943111000000e+00 1740 1692 -1.0944993000000e+00 2796 1692 -7.3022073000000e+00 589 1693 -1.8738628000000e-03 591 1693 -1.9556480000000e-05 1645 1693 -5.0011433000000e-04 1647 1693 -5.2194194000000e-06 1690 1693 -4.3123198000000e-04 1692 1693 -4.5005320000000e-06 1693 1693 1.2959451000000e+02 1695 1693 3.6533244000000e-04 1696 1693 -5.6913742000000e-02 1698 1693 -5.2950538000000e-06 1741 1693 -4.3554724000000e-04 1743 1693 -4.5455680000000e-06 2797 1693 -4.9675742000000e-02 2799 1693 -2.3182994000000e-05 589 1694 8.7410339000000e-01 591 1694 -3.0369940000000e+00 1647 1694 -8.2194276000000e-01 1692 1694 -7.0652571000000e-01 1693 1694 -8.0993831000000e+01 1694 1694 -2.4701508000000e+01 1695 1694 9.7001595000000e+00 1696 1694 5.5783043000000e+00 1698 1694 -8.2297257000000e-01 1741 1694 1.8469536000000e-01 1743 1694 -7.0596904000000e-01 2799 1694 -3.6029813000000e+00 589 1695 1.4775837000000e+00 590 1695 -2.3935269000000e-01 591 1695 -5.1337324000000e+00 1647 1695 -1.3894113000000e+00 1692 1695 -1.1943111000000e+00 1693 1695 -1.3691191000000e+02 1694 1695 2.1021639000000e+01 1695 1695 1.6397142000000e+01 1696 1695 9.4295614000000e+00 1697 1695 -1.5274876000000e+00 1698 1695 -1.3911522000000e+00 1741 1695 3.1220889000000e-01 1742 1695 -5.0574491000000e-02 1743 1695 -1.1933695000000e+00 2799 1695 -6.0904761000000e+00 592 1696 -1.7108231000000e-03 594 1696 -1.7854924000000e-05 1648 1696 -5.6862107000000e-04 1650 1696 -5.9343868000000e-06 1693 1696 -5.0736147000000e-04 1695 1696 -5.2950538000000e-06 1696 1696 1.4582182000000e+02 1698 1696 4.0265233000000e-04 1699 1696 -1.0932543000000e-01 1701 1696 -6.0680834000000e-06 1744 1696 -5.2222217000000e-04 1746 1696 -5.4501468000000e-06 2800 1696 -4.2453271000000e-02 2802 1696 -2.1133029000000e-05 592 1697 1.8863610000000e+00 594 1697 -2.7015410000000e+00 1650 1697 -9.1863870000000e-01 1695 1697 -8.2297257000000e-01 1696 1697 -9.7152630000000e+01 1697 1697 -2.7792393000000e+01 1698 1697 9.3935802000000e+00 1699 1697 1.0289578000000e+01 1701 1697 -9.2035445000000e-01 1744 1697 1.3299976000000e+00 1746 1697 -8.2190450000000e-01 2802 1697 -3.2050468000000e+00 592 1698 3.1887047000000e+00 593 1698 -5.1652764000000e-01 594 1698 -4.5666848000000e+00 1650 1698 -1.5528669000000e+00 1695 1698 -1.3911522000000e+00 1696 1698 -1.6422681000000e+02 1697 1698 2.5293396000000e+01 1698 1698 1.5878907000000e+01 1699 1698 1.7393503000000e+01 1700 1698 -2.8175155000000e+00 1701 1698 -1.5557672000000e+00 1744 1698 2.2482280000000e+00 1745 1698 -3.6418296000000e-01 1746 1698 -1.3893474000000e+00 2802 1698 -5.4178110000000e+00 595 1699 -1.6091390000000e-03 597 1699 -1.6793702000000e-05 1651 1699 -6.5767387000000e-04 1653 1699 -6.8637821000000e-06 1696 1699 -5.8143161000000e-04 1698 1699 -6.0680834000000e-06 1699 1699 1.6206276000000e+02 1701 1699 4.4204789000000e-04 1702 1699 -1.9328197000000e-01 1704 1699 -7.2681221000000e-06 1747 1699 -6.1959745000000e-04 1749 1699 -6.4663993000000e-06 2803 1699 -1.9960069000000e-02 2805 1699 -1.9781345000000e-05 595 1700 5.2167878000000e+00 597 1700 -2.4309664000000e+00 1653 1700 -1.0300719000000e+00 1698 1700 -9.2035445000000e-01 1699 1700 -1.1684341000000e+02 1700 1700 -3.0885659000000e+01 1701 1700 9.2656855000000e+00 1702 1700 1.6984846000000e+01 1704 1700 -1.0598049000000e+00 1747 1700 1.7085869000000e+00 1749 1700 -9.3682947000000e-01 2805 1700 -2.8841868000000e+00 595 1701 8.8184523000000e+00 596 1701 -1.4284351000000e+00 597 1701 -4.1093030000000e+00 1653 1701 -1.7412321000000e+00 1698 1701 -1.5557672000000e+00 1699 1701 -1.9751197000000e+02 1700 1701 3.0525937000000e+01 1701 1701 1.5662705000000e+01 1702 1701 2.8711166000000e+01 1703 1701 -4.6507071000000e+00 1704 1701 -1.7914930000000e+00 1747 1701 2.8881934000000e+00 1748 1701 -4.6783688000000e-01 1749 1701 -1.5836155000000e+00 2805 1701 -4.8754260000000e+00 598 1702 -8.2984683000000e-02 600 1702 -1.4670850000000e-05 1654 1702 -7.9452202000000e-04 1656 1702 -8.2919913000000e-06 1699 1702 -6.9641692000000e-04 1701 1702 -7.2681221000000e-06 1702 1702 1.9459037000000e+02 1704 1702 5.1894309000000e-04 1705 1702 -2.9625002000000e-01 1707 1702 -8.9874061000000e-06 1750 1702 -7.6037108000000e-04 1752 1702 -7.9355766000000e-06 2806 1702 -1.6482663000000e-03 2808 1702 -1.7202053000000e-05 598 1703 1.4531280000000e+01 600 1703 -2.0267265000000e+00 1656 1703 -1.1927259000000e+00 1701 1703 -1.0598049000000e+00 1702 1703 -1.5383473000000e+02 1703 1703 -3.7069915000000e+01 1704 1703 9.0252440000000e+00 1705 1703 2.7552567000000e+01 1707 1703 -1.2416079000000e+00 1750 1703 2.4164380000000e-01 1752 1703 -1.0954366000000e+00 2808 1703 -2.4047730000000e+00 598 1704 2.4563675000000e+01 599 1704 -3.9787347000000e+00 600 1704 -3.4259784000000e+00 1656 1704 -2.0161839000000e+00 1701 1704 -1.7914930000000e+00 1702 1704 -2.6004222000000e+02 1703 1704 4.0341763000000e+01 1704 1704 1.5256271000000e+01 1705 1704 4.6574860000000e+01 1706 1704 -7.5440262000000e+00 1707 1704 -2.0988139000000e+00 1750 1704 4.0847468000000e-01 1751 1704 -6.6163242000000e-02 1752 1704 -1.8517261000000e+00 2808 1704 -4.0650283000000e+00 601 1705 -3.7175945000000e-01 603 1705 -1.3821958000000e-05 1657 1705 -9.5707288000000e-04 1659 1705 -9.9884456000000e-06 1702 1705 -8.6115528000000e-04 1704 1705 -8.9874061000000e-06 1705 1705 2.2200070000000e+02 1707 1705 5.8719055000000e-04 1708 1705 -4.5948004000000e-01 1710 1705 -1.1123200000000e-05 1753 1705 -9.1943302000000e-04 1755 1705 -9.5956190000000e-06 2809 1705 -1.5255790000000e-03 2811 1705 -1.5921633000000e-05 601 1706 4.2979748000000e+01 603 1706 -1.7801773000000e+00 1659 1706 -1.3707856000000e+00 1704 1706 -1.2416079000000e+00 1705 1706 -2.1221385000000e+02 1706 1706 -4.2232058000000e+01 1707 1706 9.1999729000000e+00 1708 1706 4.2257388000000e+01 1710 1706 -1.4325391000000e+00 1755 1706 -1.2577860000000e+00 2811 1706 -2.1123227000000e+00 601 1707 7.2652915000000e+01 602 1707 -1.1767451000000e+01 603 1707 -3.0092095000000e+00 1659 1707 -2.3171744000000e+00 1704 1707 -2.0988139000000e+00 1705 1707 -3.5872605000000e+02 1706 1707 5.6042433000000e+01 1707 1707 1.5551625000000e+01 1708 1707 7.1431844000000e+01 1709 1707 -1.1569677000000e+01 1710 1707 -2.4215624000000e+00 1755 1707 -2.1261600000000e+00 2811 1707 -3.5706677000000e+00 604 1708 -1.2680469000000e+00 606 1708 -1.2867217000000e-05 1660 1708 -1.1435735000000e-03 1662 1708 -1.1934851000000e-05 1705 1708 -1.0658028000000e-03 1707 1708 -1.1123200000000e-05 1708 1708 2.6110786000000e+02 1710 1708 6.8404619000000e-04 1711 1708 -1.1789649000000e-03 1713 1708 -1.2304211000000e-05 1756 1708 -1.1386170000000e-03 1758 1708 -1.1883122000000e-05 2812 1708 -1.3844402000000e-03 2814 1708 -1.4448644000000e-05 604 1709 1.3131564000000e+02 606 1709 -1.5208751000000e+00 1662 1709 -1.5804774000000e+00 1707 1709 -1.4325391000000e+00 1708 1709 -3.7165501000000e+02 1709 1709 -4.9462685000000e+01 1710 1709 9.8205637000000e+00 1713 1709 -1.5868194000000e+00 1758 1709 -1.5019716000000e+00 2814 1709 -1.8034786000000e+00 604 1710 2.2197596000000e+02 605 1710 -3.5950514000000e+01 606 1710 -2.5708872000000e+00 1662 1710 -2.6716390000000e+00 1707 1710 -2.4215624000000e+00 1708 1710 -6.2824561000000e+02 1709 1710 9.9286469000000e+01 1710 1710 1.6600677000000e+01 1713 1710 -2.6823581000000e+00 1758 1710 -2.5389328000000e+00 2814 1710 -3.0486002000000e+00 607 1711 -3.1361874000000e-01 609 1711 -1.1318731000000e-05 1663 1711 -1.1309445000000e-03 1665 1711 -1.1803048000000e-05 1708 1711 -4.7911884000000e-01 1710 1711 -1.2304211000000e-05 1711 1711 2.7051663000000e+02 1713 1711 7.0413969000000e-04 1714 1711 -1.1386034000000e-03 1716 1711 -1.1882980000000e-05 1759 1711 -1.1879351000000e-03 1761 1711 -1.2397828000000e-05 2815 1711 -1.2479521000000e-03 2817 1711 -1.3024193000000e-05 607 1712 3.7277203000000e+01 609 1712 -1.4597647000000e+00 1665 1712 -1.6144318000000e+00 1708 1712 4.7530409000000e+01 1710 1712 -1.5868194000000e+00 1711 1712 -2.3966453000000e+02 1712 1712 -5.1497262000000e+01 1713 1712 9.6341451000000e+00 1716 1712 -1.6195096000000e+00 1761 1712 -1.6167865000000e+00 2817 1712 -1.7310373000000e+00 607 1713 6.3013350000000e+01 608 1713 -1.0206158000000e+01 609 1713 -2.4675848000000e+00 1665 1713 -2.7290339000000e+00 1708 1713 8.0345359000000e+01 1709 1713 -1.3013393000000e+01 1710 1713 -2.6823581000000e+00 1711 1713 -4.0512869000000e+02 1712 1713 6.3118938000000e+01 1713 1713 1.6285550000000e+01 1716 1713 -2.7376190000000e+00 1761 1713 -2.7330142000000e+00 2817 1713 -2.9261433000000e+00 610 1714 -7.5290694000000e-02 612 1714 -1.0714810000000e-05 1666 1714 -1.0885080000000e-03 1668 1714 -1.1360162000000e-05 1711 1714 -2.9111676000000e-01 1713 1714 -1.1882980000000e-05 1714 1714 2.7010717000000e+02 1716 1714 7.0134261000000e-04 1717 1714 -1.0989148000000e-03 1719 1714 -1.1468772000000e-05 1762 1714 -1.1510559000000e-03 1764 1714 -1.2012940000000e-05 2818 1714 -1.1995862000000e-03 2820 1714 -1.2519425000000e-05 610 1715 1.3815885000000e+01 612 1715 -1.4603184000000e+00 1668 1715 -1.6143877000000e+00 1711 1715 2.8543428000000e+01 1713 1715 -1.6195096000000e+00 1714 1715 -2.0363473000000e+02 1715 1715 -5.1482107000000e+01 1716 1715 9.6675806000000e+00 1719 1715 -1.6191732000000e+00 1762 1715 6.3963030000000e+00 1764 1715 -1.6165621000000e+00 2820 1715 -1.7318408000000e+00 610 1716 2.3354372000000e+01 611 1716 -3.7828194000000e+00 612 1716 -2.4685221000000e+00 1668 1716 -2.7289610000000e+00 1711 1716 4.8249810000000e+01 1712 1716 -7.8152526000000e+00 1713 1716 -2.7376190000000e+00 1714 1716 -3.4422415000000e+02 1715 1716 5.3294295000000e+01 1716 1716 1.6342077000000e+01 1719 1716 -2.7370489000000e+00 1762 1716 1.0812310000000e+01 1763 1716 -1.7513217000000e+00 1764 1716 -2.7326365000000e+00 2820 1716 -2.9275037000000e+00 613 1717 -1.2372172000000e-03 615 1717 -1.0334473000000e-05 1669 1717 -1.0574586000000e-03 1671 1717 -1.1036116000000e-05 1714 1717 -1.9358587000000e-01 1716 1717 -1.1468772000000e-05 1717 1717 2.7002973000000e+02 1719 1717 6.9906204000000e-04 1720 1717 -1.0680400000000e-03 1722 1717 -1.1146549000000e-05 1765 1717 -7.6600454000000e-02 1767 1717 -1.1452271000000e-05 2821 1717 -1.1850076000000e-02 2823 1717 -1.2257771000000e-05 613 1718 6.5236915000000e+00 615 1718 -1.4590786000000e+00 1671 1718 -1.6155050000000e+00 1714 1718 1.7385177000000e+01 1716 1718 -1.6191732000000e+00 1717 1718 -1.9245925000000e+02 1718 1718 -5.1474884000000e+01 1719 1718 9.6658804000000e+00 1722 1718 -1.6190032000000e+00 1765 1718 1.3660612000000e+01 1767 1718 -1.6169162000000e+00 2823 1718 -1.7304186000000e+00 613 1719 1.1027642000000e+01 614 1719 -1.7862458000000e+00 615 1719 -2.4664250000000e+00 1671 1719 -2.7308478000000e+00 1714 1719 2.9387887000000e+01 1715 1719 -4.7602190000000e+00 1716 1719 -2.7370489000000e+00 1717 1719 -3.2533292000000e+02 1718 1719 5.0253828000000e+01 1719 1719 1.6339196000000e+01 1722 1719 -2.7367630000000e+00 1765 1719 2.3091886000000e+01 1766 1719 -3.7403991000000e+00 1767 1719 -2.7332335000000e+00 2823 1719 -2.9250977000000e+00 616 1720 -9.7247768000000e-04 618 1720 -1.0149217000000e-05 1672 1720 -1.0275524000000e-03 1674 1720 -1.0724002000000e-05 1717 1720 -1.6140711000000e-01 1719 1720 -1.1146549000000e-05 1720 1720 2.6993957000000e+02 1722 1720 6.7529411000000e-04 2824 1720 -2.7057739000000e-02 2826 1720 -1.1922981000000e-05 616 1721 4.0892497000000e+00 618 1721 -1.4602675000000e+00 1674 1721 -1.5990651000000e+00 1717 1721 1.3440870000000e+01 1719 1721 -1.6190032000000e+00 1720 1721 -1.7242606000000e+02 1721 1721 -5.1470763000000e+01 1722 1721 6.4157856000000e+00 2826 1721 -1.7316662000000e+00 616 1722 6.9124677000000e+00 617 1722 -1.1196955000000e+00 618 1722 -2.4684361000000e+00 1674 1722 -2.7030597000000e+00 1717 1722 2.2720447000000e+01 1718 1722 -3.6803039000000e+00 1719 1722 -2.7367630000000e+00 1720 1722 -2.9146900000000e+02 1721 1722 4.4779759000000e+01 1722 1722 1.0845244000000e+01 2826 1722 -2.9272085000000e+00 1723 1723 1.0000000000000e+00 1724 1724 1.0000000000000e+00 1725 1725 1.0000000000000e+00 1726 1726 1.0000000000000e+00 1727 1727 1.0000000000000e+00 1728 1728 1.0000000000000e+00 1729 1729 1.0000000000000e+00 1730 1730 1.0000000000000e+00 1731 1731 1.0000000000000e+00 1732 1732 1.0000000000000e+00 1733 1733 1.0000000000000e+00 1734 1734 1.0000000000000e+00 1735 1735 1.0000000000000e+00 1736 1736 1.0000000000000e+00 1737 1737 1.0000000000000e+00 634 1738 -2.2121759000000e-03 636 1738 -2.3087268000000e-05 1690 1738 -2.2899062000000e-02 1692 1738 -4.1012760000000e-06 1738 1738 1.0799645000000e+02 1740 1738 3.1521981000000e-04 1741 1738 -1.3641424000000e-02 1743 1738 -4.1010484000000e-06 1786 1738 -3.8641520000000e-04 1788 1738 -4.0328039000000e-06 2842 1738 -5.2763589000000e-02 2844 1738 -2.7373634000000e-05 634 1739 4.7833739000000e-01 636 1739 -3.6436389000000e+00 1690 1739 9.6773944000000e-01 1692 1739 -6.4747945000000e-01 1738 1739 -6.6273133000000e+01 1739 1739 -2.0584062000000e+01 1740 1739 9.9100283000000e+00 1741 1739 2.8622958000000e+00 1743 1739 -6.4748607000000e-01 1788 1739 -6.4756021000000e-01 2844 1739 -4.3215522000000e+00 634 1740 8.0858152000000e-01 635 1740 -1.3098277000000e-01 636 1740 -6.1592072000000e+00 1690 1740 1.6358668000000e+00 1691 1740 -2.6499537000000e-01 1692 1740 -1.0944993000000e+00 1738 1740 -1.1202810000000e+02 1739 1740 1.7184991000000e+01 1740 1740 1.6751912000000e+01 1741 1740 4.8384248000000e+00 1742 1740 -7.8378034000000e-01 1743 1740 -1.0945105000000e+00 1788 1740 -1.0946358000000e+00 2844 1740 -7.3051519000000e+00 637 1741 -2.2492247000000e-03 639 1741 -2.3473926000000e-05 1693 1741 -2.3565069000000e-02 1695 1741 -4.5455680000000e-06 1738 1741 -3.9295426000000e-04 1740 1741 -4.1010484000000e-06 1741 1741 1.0803119000000e+02 1743 1741 3.2114201000000e-04 1744 1741 -5.2755570000000e-02 1746 1741 -4.5491599000000e-06 1789 1741 -3.9523853000000e-04 1791 1741 -4.1248881000000e-06 2845 1741 -5.1145261000000e-02 2847 1741 -2.7822909000000e-05 637 1742 7.1202527000000e-01 639 1742 -3.6437574000000e+00 1695 1742 -7.0596904000000e-01 1740 1742 -6.4748607000000e-01 1741 1742 -6.8419519000000e+01 1742 1742 -2.0587619000000e+01 1743 1742 1.0674876000000e+01 1744 1742 5.7477272000000e+00 1746 1742 -7.0659250000000e-01 1791 1742 -6.4748172000000e-01 2847 1742 -4.3212757000000e+00 637 1743 1.2036068000000e+00 638 1743 -1.9497134000000e-01 639 1743 -6.1594038000000e+00 1695 1743 -1.1933695000000e+00 1740 1743 -1.0945105000000e+00 1741 1743 -1.1565628000000e+02 1742 1743 1.7763824000000e+01 1743 1743 1.8044799000000e+01 1744 1743 9.7159521000000e+00 1745 1743 -1.5738796000000e+00 1746 1743 -1.1944232000000e+00 1791 1743 -1.0945024000000e+00 2847 1743 -7.3046794000000e+00 640 1744 -1.9323577000000e-03 642 1744 -2.0166959000000e-05 1696 1744 -2.2917029000000e-02 1698 1744 -5.4501468000000e-06 1741 1744 -4.3589141000000e-04 1743 1744 -4.5491599000000e-06 1744 1744 1.2965391000000e+02 1746 1744 3.6728552000000e-04 1747 1744 -1.0653696000000e-01 1749 1744 -5.5503435000000e-06 1792 1744 -4.4507975000000e-04 1794 1744 -4.6450536000000e-06 2848 1744 -4.5466010000000e-02 2850 1744 -2.3889507000000e-05 640 1745 1.4723184000000e+00 642 1745 -3.0366821000000e+00 1698 1745 -8.2190450000000e-01 1743 1745 -7.0659250000000e-01 1744 1745 -8.5348337000000e+01 1745 1745 -2.4709362000000e+01 1746 1745 9.7140832000000e+00 1747 1745 9.5303947000000e+00 1749 1745 -8.3709780000000e-01 1794 1745 -7.0625909000000e-01 2850 1745 -3.6027696000000e+00 640 1746 2.4888069000000e+00 641 1746 -4.0315204000000e-01 642 1746 -5.1332074000000e+00 1698 1746 -1.3893474000000e+00 1743 1746 -1.1944232000000e+00 1744 1746 -1.4427283000000e+02 1745 1746 2.2194201000000e+01 1746 1746 1.6420685000000e+01 1747 1746 1.6110179000000e+01 1748 1746 -2.6096245000000e+00 1749 1746 -1.4150301000000e+00 1794 1746 -1.1938604000000e+00 2850 1746 -6.0901217000000e+00 643 1747 -1.7307928000000e-03 645 1747 -1.8063337000000e-05 1699 1747 -1.8186795000000e-02 1701 1747 -6.4663993000000e-06 1744 1747 -5.3182282000000e-04 1746 1747 -5.5503435000000e-06 1747 1747 1.5125413000000e+02 1749 1747 4.1747288000000e-04 1750 1747 -1.5298080000000e-01 1752 1747 -6.6764701000000e-06 1795 1747 -5.5931807000000e-04 1797 1747 -5.8372964000000e-06 2851 1747 -2.9380086000000e-02 2853 1747 -2.1328591000000e-05 643 1748 3.7646537000000e+00 645 1748 -2.6045985000000e+00 1701 1748 -9.3682947000000e-01 1746 1748 -8.3709780000000e-01 1747 1748 -1.0444681000000e+02 1748 1748 -2.8831816000000e+01 1749 1748 9.2932034000000e+00 1750 1748 1.3951809000000e+01 1752 1748 -9.6736793000000e-01 1797 1748 -8.5397505000000e-01 2853 1748 -3.0900922000000e+00 643 1749 6.3637670000000e+00 644 1749 -1.0308146000000e+00 645 1749 -4.4028107000000e+00 1701 1749 -1.5836155000000e+00 1746 1749 -1.4150301000000e+00 1747 1749 -1.7655678000000e+02 1748 1749 2.7216494000000e+01 1749 1749 1.5709222000000e+01 1750 1749 2.3584125000000e+01 1751 1749 -3.8201994000000e+00 1752 1749 -1.6352378000000e+00 1797 1749 -1.4435584000000e+00 2853 1749 -5.2234888000000e+00 646 1750 -3.5777127000000e-02 648 1750 -1.6515382000000e-05 1702 1750 -4.7829871000000e-02 1704 1750 -7.9355766000000e-06 1747 1750 -6.3972601000000e-04 1749 1750 -6.6764701000000e-06 1750 1750 1.7290657000000e+02 1752 1750 4.6981893000000e-04 1753 1750 -1.9763276000000e-01 1755 1750 -8.0510325000000e-06 1798 1750 -6.8268354000000e-04 1800 1750 -7.1247943000000e-06 2854 1750 -1.8630208000000e-03 2856 1750 -1.9443328000000e-05 646 1751 9.8677828000000e+00 648 1751 -2.2800486000000e+00 1704 1751 -1.0954366000000e+00 1749 1751 -9.6736793000000e-01 1750 1751 -1.2699346000000e+02 1751 1751 -3.2957137000000e+01 1752 1751 9.1643487000000e+00 1753 1751 1.8014880000000e+01 1755 1751 -1.1115071000000e+00 1800 1751 -1.0013891000000e+00 2856 1751 -2.7048907000000e+00 646 1752 1.6680500000000e+01 647 1752 -2.7018452000000e+00 648 1752 -3.8541941000000e+00 1704 1752 -1.8517261000000e+00 1749 1752 -1.6352378000000e+00 1750 1752 -2.1466975000000e+02 1751 1752 3.3175169000000e+01 1752 1752 1.5491414000000e+01 1753 1752 3.0452353000000e+01 1754 1752 -4.9325587000000e+00 1755 1752 -1.8788916000000e+00 1800 1752 -1.6927482000000e+00 2856 1752 -4.5723473000000e+00 649 1753 -1.6926658000000e-01 651 1753 -1.5045593000000e-05 1705 1753 -1.3140085000000e-01 1707 1753 -9.5956190000000e-06 1750 1753 -7.7143383000000e-04 1752 1753 -8.0510325000000e-06 1753 1753 2.0007792000000e+02 1755 1753 5.3619780000000e-04 1756 1753 -1.8912705000000e-01 1758 1753 -1.0034359000000e-05 1801 1753 -8.3448985000000e-04 1803 1753 -8.7091136000000e-06 2857 1753 -1.6801156000000e-03 2859 1753 -1.7534446000000e-05 649 1754 2.3028724000000e+01 651 1754 -1.9724001000000e+00 1705 1754 7.2474017000000e+00 1707 1754 -1.2577860000000e+00 1752 1754 -1.1115071000000e+00 1753 1754 -1.6054765000000e+02 1754 1754 -3.8115097000000e+01 1755 1754 9.1815998000000e+00 1756 1754 1.5687094000000e+01 1758 1754 -1.3153713000000e+00 1803 1754 -1.1802067000000e+00 2859 1754 -2.3400367000000e+00 649 1755 3.8927728000000e+01 650 1755 -6.3051332000000e+00 651 1755 -3.3341428000000e+00 1705 1755 1.2251000000000e+01 1706 1755 -1.9842972000000e+00 1707 1755 -2.1261600000000e+00 1752 1755 -1.8788916000000e+00 1753 1755 -2.7138957000000e+02 1754 1755 4.2090424000000e+01 1755 1755 1.5520567000000e+01 1756 1755 2.6517446000000e+01 1757 1755 -4.2950369000000e+00 1758 1755 -2.2235022000000e+00 1803 1755 -1.9950201000000e+00 2859 1755 -3.9555957000000e+00 652 1756 -3.4375572000000e-01 654 1756 -1.2833632000000e-05 1708 1756 -4.2269746000000e-01 1710 1756 -1.1883122000000e-05 1753 1756 -9.6147224000000e-04 1755 1756 -1.0034359000000e-05 1756 1756 2.4350342000000e+02 1758 1756 6.4041493000000e-04 1759 1756 -1.1274298000000e-03 1761 1756 -1.1766367000000e-05 1804 1756 -1.0395140000000e-03 1806 1756 -1.0848838000000e-05 2860 1756 -1.4161375000000e-03 2862 1756 -1.4779451000000e-05 652 1757 4.0238110000000e+01 654 1757 -1.6222799000000e+00 1708 1757 3.5046687000000e+01 1710 1757 -1.5019716000000e+00 1755 1757 -1.3153713000000e+00 1756 1757 -2.1463638000000e+02 1757 1757 -4.6361346000000e+01 1758 1757 9.3417448000000e+00 1761 1757 -1.5345715000000e+00 1806 1757 -1.4383759000000e+00 2862 1757 -1.9239522000000e+00 652 1758 6.8018501000000e+01 653 1758 -1.1016657000000e+01 654 1758 -2.7423019000000e+00 1708 1758 5.9242920000000e+01 1709 1758 -9.5953152000000e+00 1710 1758 -2.5389328000000e+00 1755 1758 -2.2235022000000e+00 1756 1758 -3.6282133000000e+02 1757 1758 5.6481337000000e+01 1758 1758 1.5791282000000e+01 1761 1758 -2.5940381000000e+00 1806 1758 -2.4314307000000e+00 2862 1758 -3.2522488000000e+00 655 1759 -1.3674684000000e-01 657 1759 -1.1187730000000e-05 1711 1759 -1.3342204000000e-01 1713 1759 -1.2397828000000e-05 1756 1759 -1.5808714000000e-01 1758 1759 -1.1766367000000e-05 1759 1759 2.7014495000000e+02 1761 1759 7.0391015000000e-04 1762 1759 -1.1531738000000e-03 1764 1759 -1.2035044000000e-05 1807 1759 -1.1615426000000e-03 1809 1759 -1.2122384000000e-05 2863 1759 -1.2461293000000e-03 2865 1759 -1.3005170000000e-05 655 1760 1.9861190000000e+01 657 1760 -1.4592005000000e+00 1711 1760 6.0085957000000e+00 1713 1760 -1.6167865000000e+00 1756 1760 1.5859809000000e+01 1758 1760 -1.5345715000000e+00 1759 1760 -1.9657855000000e+02 1760 1760 -5.1503173000000e+01 1761 1760 9.5834246000000e+00 1764 1760 -1.6197167000000e+00 1809 1760 -1.6168748000000e+00 2865 1760 -1.7304764000000e+00 655 1761 3.3573335000000e+01 656 1761 -5.4378591000000e+00 657 1761 -2.4666309000000e+00 1711 1761 1.0156924000000e+01 1712 1761 -1.6451127000000e+00 1713 1761 -2.7330142000000e+00 1756 1761 2.6809404000000e+01 1757 1761 -4.3423080000000e+00 1758 1761 -2.5940381000000e+00 1759 1761 -3.3229618000000e+02 1760 1761 5.1308508000000e+01 1761 1761 1.6199811000000e+01 1764 1761 -2.7379691000000e+00 1809 1761 -2.7331625000000e+00 2865 1761 -2.9251949000000e+00 658 1762 -4.0112686000000e-02 660 1762 -1.0836605000000e-05 1714 1762 -1.5265340000000e-02 1716 1762 -1.2012940000000e-05 1759 1762 -1.7280484000000e-01 1761 1762 -1.2035044000000e-05 1762 1762 2.6995334000000e+02 1764 1762 7.0276120000000e-04 1765 1762 -1.1303636000000e-03 1767 1762 -1.1796986000000e-05 1810 1762 -1.1496815000000e-03 1812 1762 -1.1998596000000e-05 2866 1762 -1.2169571000000e-03 2868 1762 -1.2700715000000e-05 658 1763 1.0345366000000e+01 660 1763 -1.4584898000000e+00 1716 1763 -1.6165621000000e+00 1759 1763 1.6117870000000e+01 1761 1763 -1.6197167000000e+00 1762 1763 -1.8132328000000e+02 1763 1763 -5.1495627000000e+01 1764 1763 9.6666238000000e+00 1767 1763 -1.6196478000000e+00 1812 1763 -1.6167175000000e+00 2868 1763 -1.7296952000000e+00 658 1764 1.7487807000000e+01 659 1764 -2.8325578000000e+00 660 1764 -2.4654311000000e+00 1716 1764 -2.7326365000000e+00 1759 1764 2.7245647000000e+01 1760 1764 -4.4130674000000e+00 1761 1764 -2.7379691000000e+00 1762 1764 -3.0650887000000e+02 1763 1764 4.7151643000000e+01 1764 1764 1.6340459000000e+01 1767 1764 -2.7378505000000e+00 1812 1764 -2.7328993000000e+00 2868 1764 -2.9238767000000e+00 661 1765 -1.0327461000000e-03 663 1765 -1.0778205000000e-05 1717 1765 -1.0973337000000e-03 1719 1765 -1.1452271000000e-05 1762 1765 -1.0388055000000e-01 1764 1765 -1.1796986000000e-05 1765 1765 2.6984629000000e+02 1767 1765 6.8987731000000e-04 1813 1765 -1.1378693000000e-03 1815 1765 -1.1875319000000e-05 2869 1765 -1.1707371000000e-02 2871 1765 -1.2603672000000e-05 661 1766 6.3924356000000e+00 663 1766 -1.4589556000000e+00 1719 1766 -1.6169162000000e+00 1762 1766 1.0114327000000e+01 1764 1766 -1.6196478000000e+00 1765 1766 -1.7561032000000e+02 1766 1766 -5.1490230000000e+01 1767 1766 8.0486866000000e+00 1813 1766 4.2357121000000e+00 1815 1766 -1.6171003000000e+00 2871 1766 -1.7302744000000e+00 661 1767 1.0805765000000e+01 662 1767 -1.7502718000000e+00 663 1767 -2.4662167000000e+00 1719 1767 -2.7332335000000e+00 1762 1767 1.7097245000000e+01 1763 1767 -2.7693391000000e+00 1764 1767 -2.7378505000000e+00 1765 1767 -2.9685147000000e+02 1766 1767 4.5601587000000e+01 1767 1767 1.3605490000000e+01 1813 1767 7.1600424000000e+00 1814 1767 -1.1597532000000e+00 1815 1767 -2.7335442000000e+00 2871 1767 -2.9248541000000e+00 1768 1768 1.0000000000000e+00 1769 1769 1.0000000000000e+00 1770 1770 1.0000000000000e+00 1771 1771 1.0000000000000e+00 1772 1772 1.0000000000000e+00 1773 1773 1.0000000000000e+00 1774 1774 1.0000000000000e+00 1775 1775 1.0000000000000e+00 1776 1776 1.0000000000000e+00 1777 1777 1.0000000000000e+00 1778 1778 1.0000000000000e+00 1779 1779 1.0000000000000e+00 1780 1780 1.0000000000000e+00 1781 1781 1.0000000000000e+00 1782 1782 1.0000000000000e+00 679 1783 -2.0344545000000e-03 681 1783 -2.1232487000000e-05 1783 1783 1.1337215000000e+02 1785 1783 3.1999143000000e-04 1786 1783 -1.1889087000000e-02 1788 1783 -4.0530144000000e-06 1831 1783 -4.2009502000000e-04 1833 1783 -4.3843017000000e-06 2887 1783 -5.2840465000000e-02 2889 1783 -2.5176046000000e-05 679 1784 4.4623239000000e-01 681 1784 -3.4702348000000e+00 1783 1784 -6.8660562000000e+01 1784 1784 -2.1608517000000e+01 1785 1784 8.9769714000000e+00 1786 1784 3.1445519000000e+00 1788 1784 -6.6272767000000e-01 1833 1784 -7.2523623000000e-01 2889 1784 -4.1163478000000e+00 679 1785 7.5431073000000e-01 680 1785 -1.2219412000000e-01 681 1785 -5.8660810000000e+00 1783 1785 -1.1606375000000e+02 1784 1785 1.7802766000000e+01 1785 1785 1.5174662000000e+01 1786 1785 5.3155474000000e+00 1787 1785 -8.6108879000000e-01 1788 1785 -1.1202741000000e+00 1833 1785 -1.2259385000000e+00 2889 1785 -6.9582695000000e+00 682 1786 -2.1762259000000e-03 684 1786 -2.2712078000000e-05 1738 1786 -3.9250766000000e-02 1740 1786 -4.0328039000000e-06 1783 1786 -3.8835173000000e-04 1785 1786 -4.0530144000000e-06 1786 1786 1.0801808000000e+02 1788 1786 3.1834302000000e-04 1789 1786 -1.7943929000000e-02 1791 1786 -4.0306948000000e-06 1834 1786 -3.8955156000000e-04 1836 1786 -4.0655363000000e-06 2890 1786 -5.2961635000000e-02 2892 1786 -2.6928775000000e-05 682 1787 4.5034387000000e-01 684 1787 -3.6457717000000e+00 1738 1787 2.8889618000000e+00 1740 1787 -6.4756021000000e-01 1785 1787 -6.6272767000000e-01 1786 1787 -6.9213653000000e+01 1787 1787 -2.0583738000000e+01 1788 1787 1.0592832000000e+01 1789 1787 3.9090414000000e+00 1791 1787 -6.4726334000000e-01 1836 1787 -6.6324472000000e-01 2892 1787 -4.3239533000000e+00 682 1788 7.6126127000000e-01 683 1788 -1.2331862000000e-01 684 1788 -6.1628125000000e+00 1738 1788 4.8835010000000e+00 1739 1788 -7.9109055000000e-01 1740 1788 -1.0946358000000e+00 1785 1788 -1.1202741000000e+00 1786 1788 -1.1699876000000e+02 1787 1788 1.7991234000000e+01 1788 1788 1.7906123000000e+01 1789 1788 6.6078435000000e+00 1790 1788 -1.0704211000000e+00 1791 1788 -1.0941339000000e+00 1836 1788 -1.1211489000000e+00 2892 1788 -7.3092107000000e+00 685 1789 -2.2239246000000e-03 687 1789 -2.3209883000000e-05 1741 1789 -3.4935035000000e-02 1743 1789 -4.1248881000000e-06 1786 1789 -3.8621311000000e-04 1788 1789 -4.0306948000000e-06 1789 1789 1.0803820000000e+02 1791 1789 3.1959802000000e-04 1792 1789 -4.8309404000000e-02 1794 1789 -4.1261489000000e-06 1837 1789 -3.8920994000000e-04 1839 1789 -4.0619711000000e-06 2893 1789 -5.2331484000000e-02 2895 1789 -2.7523332000000e-05 685 1790 5.3879822000000e-01 687 1790 -3.6426013000000e+00 1741 1790 1.8403586000000e+00 1743 1790 -6.4748172000000e-01 1788 1790 -6.4726334000000e-01 1789 1790 -6.9988742000000e+01 1790 1790 -2.0588667000000e+01 1791 1790 1.0555334000000e+01 1792 1790 5.6511986000000e+00 1794 1790 -6.4772801000000e-01 1839 1790 -6.4762352000000e-01 2895 1790 -4.3203223000000e+00 685 1791 9.1078393000000e-01 686 1791 -1.4753817000000e-01 687 1791 -6.1574493000000e+00 1741 1791 3.1109401000000e+00 1742 1791 -5.0394217000000e-01 1743 1791 -1.0945024000000e+00 1788 1791 -1.0941339000000e+00 1789 1791 -1.1830889000000e+02 1790 1791 1.8191121000000e+01 1791 1791 1.7842726000000e+01 1792 1791 9.5527798000000e+00 1793 1791 -1.5474577000000e+00 1794 1791 -1.0949187000000e+00 1839 1791 -1.0947419000000e+00 2895 1791 -7.3030692000000e+00 688 1792 -2.2975010000000e-03 690 1792 -2.3977760000000e-05 1744 1792 -3.8165343000000e-02 1746 1792 -4.6450536000000e-06 1789 1792 -3.9535934000000e-04 1791 1792 -4.1261489000000e-06 1792 1792 1.0806751000000e+02 1794 1792 3.2261263000000e-04 1795 1792 -8.2053303000000e-02 1797 1792 -4.7339249000000e-06 1840 1792 -4.0135963000000e-04 1842 1792 -4.1887707000000e-06 2896 1792 -4.9200501000000e-02 2898 1792 -2.8415874000000e-05 688 1793 9.8968364000000e-01 690 1793 -3.6428105000000e+00 1744 1793 1.5903447000000e+00 1746 1793 -7.0625909000000e-01 1791 1793 -6.4772801000000e-01 1792 1793 -7.2373388000000e+01 1793 1793 -2.0592885000000e+01 1794 1793 1.0687176000000e+01 1795 1793 7.8410561000000e+00 1797 1793 -7.1982591000000e-01 1842 1793 -6.4769346000000e-01 2898 1793 -4.3205436000000e+00 688 1794 1.6729612000000e+00 689 1794 -2.7099783000000e-01 690 1794 -6.1578069000000e+00 1744 1794 2.6883187000000e+00 1745 1794 -4.3547246000000e-01 1746 1794 -1.1938604000000e+00 1791 1794 -1.0949187000000e+00 1792 1794 -1.2233997000000e+02 1793 1794 1.8833227000000e+01 1794 1794 1.8065601000000e+01 1795 1794 1.3254521000000e+01 1796 1794 -2.1470590000000e+00 1797 1794 -1.2167937000000e+00 1842 1794 -1.0948610000000e+00 2898 1794 -7.3034469000000e+00 691 1795 -1.9178555000000e-03 693 1795 -2.0015607000000e-05 1747 1795 -5.7493821000000e-02 1749 1795 -5.8372964000000e-06 1792 1795 -4.5359522000000e-04 1794 1795 -4.7339249000000e-06 1795 1795 1.3507698000000e+02 1797 1795 3.8104181000000e-04 1798 1795 -1.1283663000000e-01 1800 1795 -6.0380577000000e-06 1843 1795 -4.8625713000000e-04 1845 1795 -5.0747994000000e-06 2899 1795 -4.0000201000000e-02 2901 1795 -2.3677654000000e-05 691 1796 2.2545016000000e+00 693 1796 -2.9196208000000e+00 1747 1796 2.3427932000000e+00 1749 1796 -8.5397505000000e-01 1794 1796 -7.1982591000000e-01 1795 1796 -9.2422249000000e+01 1796 1796 -2.5745523000000e+01 1797 1796 9.6008817000000e+00 1798 1796 1.0391003000000e+01 1800 1796 -8.8341743000000e-01 1845 1796 -7.5715025000000e-01 2901 1796 -3.4639961000000e+00 691 1797 3.8110069000000e+00 692 1797 -6.1731790000000e-01 693 1797 -4.9353235000000e+00 1747 1797 3.9602548000000e+00 1748 1797 -6.4149352000000e-01 1749 1797 -1.4435584000000e+00 1794 1797 -1.2167937000000e+00 1795 1797 -1.5623046000000e+02 1796 1797 2.4065408000000e+01 1797 1797 1.6229320000000e+01 1798 1797 1.7564939000000e+01 1799 1797 -2.8452196000000e+00 1800 1797 -1.4933278000000e+00 1845 1797 -1.2798859000000e+00 2901 1797 -5.8555350000000e+00 694 1798 -1.6695103000000e-03 696 1798 -1.7423765000000e-05 1750 1798 -9.7878816000000e-02 1752 1798 -7.1247943000000e-06 1795 1798 -5.7855462000000e-04 1797 1798 -6.0380577000000e-06 1798 1798 1.6208701000000e+02 1800 1798 4.4396095000000e-04 1801 1798 -1.3546725000000e-01 1803 1798 -7.5417599000000e-06 1846 1798 -6.2223328000000e-04 1848 1798 -6.4939081000000e-06 2902 1798 -1.9986854000000e-02 2904 1798 -2.0530161000000e-05 694 1799 5.1369605000000e+00 696 1799 -2.4321780000000e+00 1750 1799 5.4105136000000e+00 1752 1799 -1.0013891000000e+00 1797 1799 -8.8341743000000e-01 1798 1799 -1.1526550000000e+02 1799 1799 -3.0899754000000e+01 1800 1799 9.2013852000000e+00 1801 1799 1.1804877000000e+01 1803 1799 -1.0600584000000e+00 1848 1799 -9.3536084000000e-01 2904 1799 -2.8855036000000e+00 694 1800 8.6835180000000e+00 695 1800 -1.4065417000000e+00 696 1800 -4.1113536000000e+00 1750 1800 9.1459321000000e+00 1751 1800 -1.4814428000000e+00 1752 1800 -1.6927482000000e+00 1797 1800 -1.4933278000000e+00 1798 1800 -1.9484480000000e+02 1799 1800 3.0058278000000e+01 1800 1800 1.5554020000000e+01 1801 1800 1.9954964000000e+01 1802 1800 -3.2322717000000e+00 1803 1800 -1.7919227000000e+00 1848 1800 -1.5811340000000e+00 2904 1800 -4.8776553000000e+00 697 1801 -3.6361006000000e-02 699 1801 -1.4957052000000e-05 1753 1801 -1.7438127000000e-01 1755 1801 -8.7091136000000e-06 1798 1801 -7.2263635000000e-04 1800 1801 -7.5417599000000e-06 1801 1801 1.9451755000000e+02 1803 1801 5.2093730000000e-04 1804 1801 -1.1214604000000e-01 1806 1801 -9.4657299000000e-06 1849 1801 -7.7490891000000e-04 1851 1801 -8.0873000000000e-06 2905 1801 -1.6856987000000e-03 2907 1801 -1.7592714000000e-05 697 1802 9.9422740000000e+00 699 1802 -2.0270036000000e+00 1753 1802 1.2361556000000e+01 1755 1802 -1.1802067000000e+00 1800 1802 -1.0600584000000e+00 1801 1802 -1.4259383000000e+02 1802 1802 -3.7084526000000e+01 1803 1802 9.0899510000000e+00 1804 1802 8.8013890000000e+00 1806 1802 -1.2827506000000e+00 1851 1802 -1.1308285000000e+00 2907 1802 -2.4049276000000e+00 697 1803 1.6806408000000e+01 698 1803 -2.7222043000000e+00 699 1803 -3.4264445000000e+00 1753 1803 2.0895960000000e+01 1754 1803 -3.3846061000000e+00 1755 1803 -1.9950201000000e+00 1800 1803 -1.7919227000000e+00 1801 1803 -2.4104046000000e+02 1802 1803 3.7227496000000e+01 1803 1803 1.5365644000000e+01 1804 1803 1.4877859000000e+01 1805 1803 -2.4098289000000e+00 1806 1803 -2.1683601000000e+00 1851 1803 -1.9115514000000e+00 2907 1803 -4.0652867000000e+00 700 1804 -7.6291503000000e-02 702 1804 -1.2512836000000e-05 1756 1804 -2.9356815000000e-01 1758 1804 -1.0848838000000e-05 1801 1804 -9.0698731000000e-04 1803 1804 -9.4657299000000e-06 1804 1804 2.3771689000000e+02 1806 1804 6.2461449000000e-04 1807 1804 -1.0893372000000e-03 1809 1804 -1.1368816000000e-05 1852 1804 -9.7283384000000e-04 1854 1804 -1.0152934000000e-05 2908 1804 -1.4038815000000e-03 2910 1804 -1.4651543000000e-05 700 1805 1.3900146000000e+01 702 1805 -1.6590973000000e+00 1756 1805 2.2350159000000e+01 1758 1805 -1.4383759000000e+00 1803 1805 -1.2827506000000e+00 1804 1805 -1.7251084000000e+02 1805 1805 -4.5327617000000e+01 1806 1805 9.2591950000000e+00 1809 1805 -1.5164090000000e+00 1854 1805 -1.3893235000000e+00 2910 1805 -1.9681342000000e+00 700 1806 2.3496806000000e+01 701 1806 -3.8058128000000e+00 702 1806 -2.8045381000000e+00 1756 1806 3.7780708000000e+01 1757 1806 -6.1193978000000e+00 1758 1806 -2.4314307000000e+00 1803 1806 -2.1683601000000e+00 1804 1806 -2.9161233000000e+02 1805 1806 4.5009350000000e+01 1806 1806 1.5651739000000e+01 1809 1806 -2.5633354000000e+00 1854 1806 -2.3485125000000e+00 2910 1806 -3.3269340000000e+00 703 1807 -3.3713512000000e-02 705 1807 -1.0943588000000e-05 1759 1807 -1.8201594000000e-01 1761 1807 -1.2122384000000e-05 1804 1807 -1.7390544000000e-02 1806 1807 -1.1368816000000e-05 1807 1807 2.6994798000000e+02 1809 1807 7.0255065000000e-04 1810 1807 -1.1518031000000e-03 1812 1807 -1.2020739000000e-05 1855 1807 -1.1382751000000e-03 1857 1807 -1.1879554000000e-05 2911 1807 -1.2300748000000e-03 2913 1807 -1.2837617000000e-05 703 1808 9.7211886000000e+00 705 1808 -1.4597855000000e+00 1759 1808 1.1574085000000e+01 1761 1808 -1.6168748000000e+00 1804 1808 2.9635679000000e+00 1806 1808 -1.5164090000000e+00 1807 1808 -1.7910548000000e+02 1808 1808 -5.1505101000000e+01 1809 1808 9.5663979000000e+00 1812 1808 -1.6197874000000e+00 1857 1808 -1.6165056000000e+00 2913 1808 -1.7312366000000e+00 703 1809 1.6432681000000e+01 704 1809 -2.6616403000000e+00 705 1809 -2.4676190000000e+00 1759 1809 1.9564815000000e+01 1760 1809 -3.1689595000000e+00 1761 1809 -2.7331625000000e+00 1804 1809 5.0096107000000e+00 1805 1809 -8.1141850000000e-01 1806 1809 -2.5633354000000e+00 1807 1809 -3.0275963000000e+02 1808 1809 4.6520833000000e+01 1809 1809 1.6171028000000e+01 1812 1809 -2.7380886000000e+00 1857 1809 -2.7325391000000e+00 2913 1809 -2.9264805000000e+00 706 1810 -8.8675252000000e-03 708 1810 -1.0837763000000e-05 1762 1810 -6.2403481000000e-02 1764 1810 -1.1998596000000e-05 1807 1810 -5.2988615000000e-02 1809 1810 -1.2020739000000e-05 1810 1810 2.6984590000000e+02 1812 1810 6.9097931000000e-04 1813 1810 -1.1396550000000e-03 1815 1810 -1.1893955000000e-05 2914 1810 -6.0311753000000e-03 2916 1810 -1.2854729000000e-05 706 1811 7.2786198000000e+00 708 1811 -1.4604714000000e+00 1762 1811 5.7891668000000e-01 1764 1811 -1.6167175000000e+00 1807 1811 5.1032672000000e+00 1809 1811 -1.6197874000000e+00 1810 1811 -1.6781140000000e+02 1811 1811 -5.1502392000000e+01 1812 1811 8.0545803000000e+00 1815 1811 -1.6197401000000e+00 2916 1811 -1.7320662000000e+00 706 1812 1.2303779000000e+01 707 1812 -1.9928854000000e+00 708 1812 -2.4687808000000e+00 1762 1812 9.7860075000000e-01 1763 1812 -1.5850733000000e-01 1764 1812 -2.7328993000000e+00 1807 1812 8.6265627000000e+00 1808 1812 -1.3972740000000e+00 1809 1812 -2.7380886000000e+00 1810 1812 -2.8366839000000e+02 1811 1812 4.3435542000000e+01 1812 1812 1.3615461000000e+01 1815 1812 -2.7380070000000e+00 2916 1812 -2.9278847000000e+00 709 1813 -1.0390959000000e-03 711 1813 -1.0844475000000e-05 1765 1813 -2.1406402000000e-02 1767 1813 -1.1875319000000e-05 1810 1813 -6.2819843000000e-02 1812 1813 -1.1893955000000e-05 1813 1813 2.6981877000000e+02 1815 1813 6.7868937000000e-04 2917 1813 -1.7018529000000e-02 2919 1813 -1.2707884000000e-05 709 1814 5.5196546000000e+00 711 1814 -1.4591348000000e+00 1767 1814 -1.6171003000000e+00 1810 1814 5.2919592000000e+00 1812 1814 -1.6197401000000e+00 1813 1814 -1.6566496000000e+02 1814 1814 -5.1500595000000e+01 1815 1814 6.4322654000000e+00 2919 1814 -1.7304932000000e+00 709 1815 9.3304182000000e+00 710 1815 -1.5112923000000e+00 711 1815 -2.4665199000000e+00 1767 1815 -2.7335442000000e+00 1810 1815 8.9455222000000e+00 1811 1815 -1.4489489000000e+00 1812 1815 -2.7380070000000e+00 1813 1815 -2.8003986000000e+02 1814 1815 4.2852774000000e+01 1815 1815 1.0873094000000e+01 2919 1815 -2.9252241000000e+00 1816 1816 1.0000000000000e+00 1817 1817 1.0000000000000e+00 1818 1818 1.0000000000000e+00 1819 1819 1.0000000000000e+00 1820 1820 1.0000000000000e+00 1821 1821 1.0000000000000e+00 1822 1822 1.0000000000000e+00 1823 1823 1.0000000000000e+00 1824 1824 1.0000000000000e+00 1825 1825 1.0000000000000e+00 1826 1826 1.0000000000000e+00 1827 1827 1.0000000000000e+00 1828 1828 1.0000000000000e+00 1829 1829 1.0000000000000e+00 1830 1830 1.0000000000000e+00 727 1831 -1.7627555000000e-03 729 1831 -1.8396914000000e-05 1783 1831 -1.5354290000000e-02 1785 1831 -4.3843017000000e-06 1831 1831 1.2956429000000e+02 1833 1831 3.5694669000000e-04 1834 1831 -4.2519978000000e-04 1836 1831 -4.4375773000000e-06 1879 1831 -4.6811103000000e-04 1881 1831 -4.8854185000000e-06 2935 1831 -5.2523826000000e-02 2937 1831 -2.1820208000000e-05 727 1832 4.7361598000000e-01 729 1832 -3.0418515000000e+00 1783 1832 2.1429853000000e+00 1785 1832 -7.2523623000000e-01 1831 1832 -7.9601512000000e+01 1832 1832 -2.4693282000000e+01 1833 1832 8.9252988000000e+00 1834 1832 2.6163863000000e+00 1836 1832 -7.2388289000000e-01 1881 1832 -8.2228962000000e-01 2937 1832 -3.6092681000000e+00 727 1833 8.0059990000000e-01 728 1833 -1.2969360000000e-01 729 1833 -5.1419423000000e+00 1783 1833 3.6224997000000e+00 1784 1833 -5.8682873000000e-01 1785 1833 -1.2259385000000e+00 1831 1833 -1.3455832000000e+02 1832 1833 2.0661564000000e+01 1833 1833 1.5087315000000e+01 1834 1833 4.4227367000000e+00 1835 1833 -7.1646354000000e-01 1836 1833 -1.2236508000000e+00 1881 1833 -1.3899972000000e+00 2937 1833 -6.1011032000000e+00 730 1834 -2.0406251000000e-03 732 1834 -2.1296887000000e-05 1786 1834 -3.6654252000000e-02 1788 1834 -4.0655363000000e-06 1831 1834 -1.2541000000000e-02 1833 1834 -4.4375773000000e-06 1834 1834 1.1342234000000e+02 1836 1834 3.2863431000000e-04 1837 1834 -1.7241399000000e-02 1839 1834 -4.0635890000000e-06 1882 1834 -4.1884696000000e-04 1884 1834 -4.3712764000000e-06 2938 1834 -5.2799427000000e-02 2940 1834 -2.5256853000000e-05 730 1835 4.6115962000000e-01 732 1835 -3.4731796000000e+00 1786 1835 2.7094703000000e+00 1788 1835 -6.6324472000000e-01 1833 1835 -7.2388289000000e-01 1834 1835 -7.2226180000000e+01 1835 1835 -2.1612590000000e+01 1836 1835 1.0370998000000e+01 1837 1835 3.9914205000000e+00 1839 1835 -6.6297106000000e-01 1884 1835 -7.2501701000000e-01 2940 1835 -4.1202759000000e+00 730 1836 7.7954422000000e-01 731 1836 -1.2628154000000e-01 732 1836 -5.8710629000000e+00 1786 1836 4.5800887000000e+00 1787 1836 -7.4194717000000e-01 1788 1836 -1.1211489000000e+00 1833 1836 -1.2236508000000e+00 1834 1836 -1.2209113000000e+02 1835 1836 1.8769138000000e+01 1836 1836 1.7531134000000e+01 1837 1836 6.7470971000000e+00 1838 1836 -1.0929897000000e+00 1839 1836 -1.1206863000000e+00 1884 1836 -1.2255687000000e+00 2940 1836 -6.9649144000000e+00 733 1837 -2.1901939000000e-03 735 1837 -2.2857855000000e-05 1789 1837 -3.6900348000000e-02 1791 1837 -4.0619711000000e-06 1834 1837 -3.8936497000000e-04 1836 1837 -4.0635890000000e-06 1837 1837 1.0803430000000e+02 1839 1837 3.1865465000000e-04 1840 1837 -4.1747791000000e-02 1842 1837 -4.0605177000000e-06 1885 1837 -3.8233605000000e-04 1887 1837 -3.9902320000000e-06 2941 1837 -5.2785699000000e-02 2943 1837 -2.7102875000000e-05 733 1838 4.7214194000000e-01 735 1838 -3.6432492000000e+00 1789 1838 2.6576715000000e+00 1791 1838 -6.4762352000000e-01 1836 1838 -6.6297106000000e-01 1837 1838 -7.0405894000000e+01 1838 1838 -2.0588468000000e+01 1839 1838 1.0572209000000e+01 1840 1838 5.3173207000000e+00 1842 1838 -6.4743079000000e-01 1887 1838 -6.4753076000000e-01 2943 1838 -4.3210899000000e+00 733 1839 7.9810807000000e-01 734 1839 -1.2928706000000e-01 735 1839 -6.1585434000000e+00 1789 1839 4.4925241000000e+00 1790 1839 -7.2775254000000e-01 1791 1839 -1.0947419000000e+00 1836 1839 -1.1206863000000e+00 1837 1839 -1.1901402000000e+02 1838 1839 1.8306083000000e+01 1839 1839 1.7871250000000e+01 1840 1839 8.9883915000000e+00 1841 1839 -1.4560467000000e+00 1842 1839 -1.0944161000000e+00 1887 1839 -1.0945853000000e+00 2943 1839 -7.3043660000000e+00 736 1840 -2.2595035000000e-03 738 1840 -2.3581201000000e-05 1792 1840 -4.3447644000000e-02 1794 1840 -4.1887707000000e-06 1837 1840 -3.8907069000000e-04 1839 1840 -4.0605177000000e-06 1840 1840 1.0804453000000e+02 1842 1840 3.2079552000000e-04 1843 1840 -5.1357459000000e-02 1845 1840 -4.3870749000000e-06 1888 1840 -3.9332922000000e-04 1890 1840 -4.1049617000000e-06 2944 1840 -5.1639411000000e-02 2946 1840 -2.7951990000000e-05 736 1841 6.4480901000000e-01 738 1841 -3.6444874000000e+00 1792 1841 2.9892049000000e+00 1794 1841 -6.4769346000000e-01 1839 1841 -6.4743079000000e-01 1840 1841 -7.2357808000000e+01 1841 1841 -2.0592914000000e+01 1842 1841 1.0590126000000e+01 1843 1841 6.7714276000000e+00 1845 1841 -6.7841061000000e-01 1890 1841 -6.4774506000000e-01 2946 1841 -4.3220435000000e+00 736 1842 1.0899851000000e+00 737 1842 -1.7656524000000e-01 738 1842 -6.1606414000000e+00 1792 1842 5.0529519000000e+00 1793 1842 -8.1852092000000e-01 1794 1842 -1.0948610000000e+00 1839 1842 -1.0944161000000e+00 1840 1842 -1.2231364000000e+02 1841 1842 1.8829160000000e+01 1842 1842 1.7901548000000e+01 1843 1842 1.1446421000000e+01 1844 1842 -1.8541905000000e+00 1845 1842 -1.1467853000000e+00 1890 1842 -1.0949482000000e+00 2946 1842 -7.3059823000000e+00 739 1843 -2.1297054000000e-03 741 1843 -2.2226569000000e-05 1795 1843 -7.9778375000000e-02 1797 1843 -5.0747994000000e-06 1840 1843 -4.2036074000000e-04 1842 1843 -4.3870749000000e-06 1843 1843 1.1890076000000e+02 1845 1843 3.4570613000000e-04 1846 1843 -9.3184508000000e-02 1848 1843 -5.3491131000000e-06 1891 1843 -4.3647705000000e-04 1893 1843 -4.5552719000000e-06 2947 1843 -4.7033577000000e-02 2949 1843 -2.6336006000000e-05 739 1844 1.2772920000000e+00 741 1844 -3.3123752000000e+00 1795 1844 4.1842642000000e+00 1797 1844 -7.5715025000000e-01 1842 1844 -6.7841061000000e-01 1843 1844 -8.1623769000000e+01 1844 1844 -2.2658386000000e+01 1845 1844 1.0173885000000e+01 1846 1844 8.0234414000000e+00 1848 1844 -7.9812720000000e-01 1893 1844 -6.9594388000000e-01 2949 1844 -3.9293287000000e+00 739 1845 2.1591329000000e+00 740 1845 -3.4974716000000e-01 741 1845 -5.5992353000000e+00 1795 1845 7.0730753000000e+00 1796 1845 -1.1457322000000e+00 1797 1845 -1.2798859000000e+00 1842 1845 -1.1467853000000e+00 1843 1845 -1.3797673000000e+02 1844 1845 2.1252222000000e+01 1845 1845 1.7197926000000e+01 1846 1845 1.3562817000000e+01 1847 1845 -2.1969729000000e+00 1848 1845 -1.3491533000000e+00 1893 1845 -1.1764226000000e+00 2949 1845 -6.6421333000000e+00 742 1846 -1.7438404000000e-03 744 1846 -1.8199507000000e-05 1798 1846 -1.0881623000000e-01 1800 1846 -6.4939081000000e-06 1843 1846 -5.1254132000000e-04 1845 1846 -5.3491131000000e-06 1846 1846 1.5129408000000e+02 1848 1846 4.1790688000000e-04 1849 1846 -1.0388809000000e-01 1851 1846 -6.9062408000000e-06 1894 1846 -5.6426636000000e-04 1896 1846 -5.8889390000000e-06 2950 1846 -3.7777033000000e-02 2952 1846 -2.1524741000000e-05 742 1847 2.5773871000000e+00 744 1847 -2.6129498000000e+00 1798 1847 6.7675836000000e+00 1800 1847 -9.3536084000000e-01 1845 1847 -7.9812720000000e-01 1846 1847 -1.0485422000000e+02 1847 1847 -2.8841163000000e+01 1848 1847 9.3164495000000e+00 1849 1847 8.7920353000000e+00 1851 1847 -9.9479200000000e-01 1896 1847 -8.7164905000000e-01 2952 1847 -3.1003240000000e+00 742 1848 4.3568151000000e+00 743 1848 -7.0572155000000e-01 744 1848 -4.4169304000000e+00 1798 1848 1.1439923000000e+01 1799 1848 -1.8530510000000e+00 1800 1848 -1.5811340000000e+00 1845 1848 -1.3491533000000e+00 1846 1848 -1.7724558000000e+02 1847 1848 2.7304935000000e+01 1848 1848 1.5748525000000e+01 1849 1848 1.4862056000000e+01 1850 1848 -2.4073717000000e+00 1851 1848 -1.6815964000000e+00 1896 1848 -1.4734355000000e+00 2952 1848 -5.2407877000000e+00 745 1849 -1.4815586000000e-03 747 1849 -1.5462216000000e-05 1801 1849 -1.5796506000000e-01 1803 1849 -8.0873000000000e-06 1846 1849 -6.6174218000000e-04 1848 1849 -6.9062408000000e-06 1849 1849 1.8368457000000e+02 1851 1849 4.9431217000000e-04 1852 1849 -9.6520723000000e-02 1854 1849 -8.7060903000000e-06 1897 1849 -7.3050679000000e-04 1899 1849 -7.6238993000000e-06 2953 1849 -2.4271380000000e-02 2955 1849 -1.8212201000000e-05 745 1850 4.5255625000000e+00 747 1850 -2.1468502000000e+00 1801 1850 1.0780072000000e+01 1803 1850 -1.1308285000000e+00 1848 1850 -9.9479200000000e-01 1849 1850 -1.2856659000000e+02 1850 1850 -3.5024614000000e+01 1851 1850 9.1376521000000e+00 1852 1850 7.9663073000000e+00 1854 1850 -1.2173762000000e+00 1899 1850 -1.0973587000000e+00 2955 1850 -2.5465029000000e+00 745 1851 7.6500063000000e+00 746 1851 -1.2391313000000e+00 747 1851 -3.6290334000000e+00 1801 1851 1.8222623000000e+01 1802 1851 -2.9516605000000e+00 1803 1851 -1.9115514000000e+00 1848 1851 -1.6815964000000e+00 1849 1851 -2.1732884000000e+02 1850 1851 3.3487759000000e+01 1851 1851 1.5446279000000e+01 1852 1851 1.3466238000000e+01 1853 1851 -2.1812317000000e+00 1854 1851 -2.0578516000000e+00 1899 1851 -1.8549738000000e+00 2955 1851 -4.3046060000000e+00 748 1852 -1.2303848000000e-03 750 1852 -1.2840853000000e-05 1804 1852 -2.0536677000000e-01 1806 1852 -1.0152934000000e-05 1849 1852 -8.3420016000000e-04 1851 1852 -8.7060903000000e-06 1852 1852 2.2682106000000e+02 1854 1852 5.9753006000000e-04 1855 1852 -4.3583597000000e-02 1857 1852 -1.0807959000000e-05 1900 1852 -9.2131834000000e-04 1902 1852 -9.6152951000000e-06 2956 1852 -1.5524926000000e-02 2958 1852 -1.5067541000000e-05 748 1853 5.9457629000000e+00 750 1853 -1.7380630000000e+00 1804 1853 1.3685122000000e+01 1806 1853 -1.3893235000000e+00 1851 1853 -1.2173762000000e+00 1852 1853 -1.5211895000000e+02 1853 1853 -4.3268319000000e+01 1854 1853 9.2315550000000e+00 1855 1853 2.4221967000000e+00 1857 1853 -1.4789555000000e+00 1902 1853 -1.3411889000000e+00 2958 1853 -2.0617751000000e+00 748 1854 1.0050718000000e+01 749 1854 -1.6279674000000e+00 750 1854 -2.9380216000000e+00 1804 1854 2.3133330000000e+01 1805 1854 -3.7470265000000e+00 1806 1854 -2.3485125000000e+00 1851 1854 -2.0578516000000e+00 1852 1854 -2.5714188000000e+02 1853 1854 3.9525830000000e+01 1854 1854 1.5605019000000e+01 1855 1854 4.0944812000000e+00 1856 1854 -6.6320456000000e-01 1857 1854 -2.5000264000000e+00 1902 1854 -2.2671456000000e+00 2958 1854 -3.4852246000000e+00 751 1855 -1.0395741000000e-03 753 1855 -1.0849465000000e-05 1807 1855 -1.7507871000000e-01 1809 1855 -1.1879554000000e-05 1852 1855 -1.0355970000000e-03 1854 1855 -1.0807959000000e-05 1855 1855 2.6990596000000e+02 1857 1855 6.8922445000000e-04 1903 1855 -1.1115532000000e-03 1905 1855 -1.1600672000000e-05 2959 1855 -1.9985788000000e-02 2961 1855 -1.2725786000000e-05 751 1856 5.1931919000000e+00 753 1856 -1.4599415000000e+00 1807 1856 1.0116538000000e+01 1809 1856 -1.6165056000000e+00 1854 1856 -1.4789555000000e+00 1855 1856 -1.7015155000000e+02 1856 1856 -5.1508807000000e+01 1857 1856 7.8930001000000e+00 1905 1856 -1.6001767000000e+00 2961 1856 -1.7316203000000e+00 751 1857 8.7785651000000e+00 752 1857 -1.4219055000000e+00 753 1857 -2.4678833000000e+00 1807 1857 1.7100984000000e+01 1808 1857 -2.7699267000000e+00 1809 1857 -2.7325391000000e+00 1854 1857 -2.5000264000000e+00 1855 1857 -2.8762397000000e+02 1856 1857 4.4061014000000e+01 1857 1857 1.3342320000000e+01 1905 1857 -2.7049376000000e+00 2961 1857 -2.9271289000000e+00 1858 1858 1.0000000000000e+00 1859 1859 1.0000000000000e+00 1860 1860 1.0000000000000e+00 1861 1861 1.0000000000000e+00 1862 1862 1.0000000000000e+00 1863 1863 1.0000000000000e+00 1864 1864 1.0000000000000e+00 1865 1865 1.0000000000000e+00 1866 1866 1.0000000000000e+00 1867 1867 1.0000000000000e+00 1868 1868 1.0000000000000e+00 1869 1869 1.0000000000000e+00 1870 1870 1.0000000000000e+00 1871 1871 1.0000000000000e+00 1872 1872 1.0000000000000e+00 1873 1873 1.0000000000000e+00 1874 1874 1.0000000000000e+00 1875 1875 1.0000000000000e+00 772 1876 -1.3682081000000e-03 774 1876 -1.4279239000000e-05 1876 1876 1.6193772000000e+02 1878 1876 4.2113976000000e-04 1879 1876 -5.2298365000000e-04 1881 1876 -5.4580940000000e-06 1924 1876 -5.7036811000000e-03 1926 1876 -5.6985528000000e-06 2980 1876 -5.1615507000000e-02 2982 1876 -1.6926631000000e-05 772 1877 5.5238695000000e-01 774 1877 -2.4305303000000e+00 1876 1877 -9.6325749000000e+01 1877 1877 -3.0856113000000e+01 1878 1877 7.2066814000000e+00 1879 1877 2.7981439000000e+00 1881 1877 -9.1859475000000e-01 1926 1877 -9.7071914000000e-01 2982 1877 -2.8833788000000e+00 772 1878 9.3375490000000e-01 773 1878 -1.5126664000000e-01 774 1878 -4.1085685000000e+00 1876 1878 -1.6282905000000e+02 1877 1878 2.4983323000000e+01 1878 1878 1.2182174000000e+01 1879 1878 4.7299825000000e+00 1880 1878 -7.6624879000000e-01 1881 1878 -1.5527926000000e+00 1926 1878 -1.6409036000000e+00 2982 1878 -4.8740636000000e+00 775 1879 -1.5401932000000e-03 777 1879 -1.6074153000000e-05 1831 1879 -2.5316249000000e-02 1833 1879 -4.8854185000000e-06 1876 1879 -7.7146665000000e-03 1878 1879 -5.4580940000000e-06 1879 1879 1.4577699000000e+02 1881 1879 3.9679183000000e-04 1882 1879 -4.7447408000000e-04 1884 1879 -4.9518262000000e-06 1927 1879 -5.4925528000000e-03 1929 1879 -5.4636132000000e-06 2983 1879 -5.2014773000000e-02 2985 1879 -1.9060727000000e-05 775 1880 5.2312342000000e-01 777 1880 -2.7035268000000e+00 1831 1880 3.6040503000000e+00 1833 1880 -8.2228962000000e-01 1878 1880 -9.1859475000000e-01 1879 1880 -9.0858930000000e+01 1880 1880 -2.7776287000000e+01 1881 1880 9.3962922000000e+00 1882 1880 3.0620254000000e+00 1884 1880 -8.2121591000000e-01 1929 1880 -9.1952951000000e-01 2985 1880 -3.2080206000000e+00 775 1881 8.8428709000000e-01 776 1881 -1.4325203000000e-01 777 1881 -4.5700380000000e+00 1831 1881 6.0922817000000e+00 1832 1881 -9.8693260000000e-01 1833 1881 -1.3899972000000e+00 1878 1881 -1.5527926000000e+00 1879 1881 -1.5358782000000e+02 1880 1881 2.3611475000000e+01 1881 1881 1.5883482000000e+01 1882 1881 5.1760440000000e+00 1883 1881 -8.3850459000000e-01 1884 1881 -1.3881823000000e+00 1929 1881 -1.5543716000000e+00 2985 1881 -5.4228342000000e+00 778 1882 -1.7572603000000e-03 780 1882 -1.8339563000000e-05 1834 1882 -1.4385499000000e-02 1836 1882 -4.3712764000000e-06 1879 1882 -5.2273750000000e-03 1881 1882 -4.9518262000000e-06 1882 1882 1.2957379000000e+02 1884 1882 3.6139659000000e-04 1885 1882 -8.5518109000000e-03 1887 1882 -4.2522785000000e-06 1930 1882 -4.5146567000000e-04 1932 1882 -4.7117000000000e-06 2986 1882 -5.2447066000000e-02 2988 1882 -2.1750669000000e-05 778 1883 4.7974413000000e-01 780 1883 -3.0402072000000e+00 1834 1883 3.0947403000000e+00 1836 1883 -7.2501701000000e-01 1881 1883 -8.2121591000000e-01 1882 1883 -8.1877839000000e+01 1883 1883 -2.4695931000000e+01 1884 1883 9.6944012000000e+00 1885 1883 3.9384884000000e+00 1887 1883 -7.0530200000000e-01 1932 1883 -7.9257688000000e-01 2988 1883 -3.6073107000000e+00 778 1884 8.1095948000000e-01 779 1884 -1.3137192000000e-01 780 1884 -5.1391662000000e+00 1834 1884 5.2313490000000e+00 1835 1884 -8.4745588000000e-01 1836 1884 -1.2255687000000e+00 1881 1884 -1.3881823000000e+00 1882 1884 -1.3840630000000e+02 1883 1884 2.1278445000000e+01 1884 1884 1.6387415000000e+01 1885 1884 6.6576208000000e+00 1886 1884 -1.0785057000000e+00 1887 1884 -1.1922425000000e+00 1932 1884 -1.3397720000000e+00 2988 1884 -6.0977979000000e+00 781 1885 -2.1547261000000e-03 783 1885 -2.2487696000000e-05 1837 1885 -2.1837092000000e-02 1839 1885 -3.9902320000000e-06 1882 1885 -4.0744482000000e-04 1884 1885 -4.2522785000000e-06 1885 1885 1.0800479000000e+02 1887 1885 3.1791075000000e-04 1888 1885 -2.4076337000000e-02 1890 1885 -3.9845664000000e-06 1933 1885 -3.8464484000000e-04 1935 1885 -4.0143276000000e-06 2989 1885 -5.2925043000000e-02 2991 1885 -2.6665641000000e-05 781 1886 4.5923005000000e-01 783 1886 -3.6481002000000e+00 1837 1886 3.0465115000000e+00 1839 1886 -6.4753076000000e-01 1884 1886 -7.0530200000000e-01 1885 1886 -7.0290947000000e+01 1886 1886 -2.0585626000000e+01 1887 1886 1.0639977000000e+01 1888 1886 4.8224163000000e+00 1890 1886 -6.4663870000000e-01 1935 1886 -6.6305749000000e-01 2991 1886 -4.3270355000000e+00 781 1887 7.7628199000000e-01 782 1887 -1.2575274000000e-01 783 1887 -6.1667448000000e+00 1837 1887 5.1498198000000e+00 1838 1887 -8.3423801000000e-01 1839 1887 -1.0945853000000e+00 1884 1887 -1.1922425000000e+00 1885 1887 -1.1881974000000e+02 1886 1887 1.8281811000000e+01 1887 1887 1.7985806000000e+01 1888 1887 8.1518075000000e+00 1889 1887 -1.3205409000000e+00 1890 1887 -1.0930774000000e+00 1935 1887 -1.1208317000000e+00 2991 1887 -7.3144156000000e+00 784 1888 -2.2167704000000e-03 786 1888 -2.3135219000000e-05 1840 1888 -3.9496526000000e-02 1842 1888 -4.1049617000000e-06 1885 1888 -3.8179319000000e-04 1887 1888 -3.9845664000000e-06 1888 1888 1.0802336000000e+02 1890 1888 3.1938638000000e-04 1891 1888 -3.1541777000000e-02 1893 1888 -4.1991334000000e-06 1936 1888 -3.8492957000000e-04 1938 1888 -4.0172991000000e-06 2992 1888 -5.2634792000000e-02 2994 1888 -2.7427728000000e-05 784 1889 5.0941971000000e-01 786 1889 -3.6492619000000e+00 1840 1889 3.5366700000000e+00 1842 1889 -6.4774506000000e-01 1887 1889 -6.4663870000000e-01 1888 1889 -7.1838586000000e+01 1889 1889 -2.0591437000000e+01 1890 1889 1.0583862000000e+01 1891 1889 5.8379544000000e+00 1893 1889 -6.6265230000000e-01 1938 1889 -6.4743050000000e-01 2994 1889 -4.3278193000000e+00 784 1890 8.6112308000000e-01 785 1890 -1.3949396000000e-01 786 1890 -6.1687123000000e+00 1840 1890 5.9783870000000e+00 1841 1890 -9.6844330000000e-01 1842 1890 -1.0949482000000e+00 1887 1890 -1.0930774000000e+00 1888 1890 -1.2143595000000e+02 1889 1890 1.8690919000000e+01 1890 1890 1.7890960000000e+01 1891 1890 9.8684780000000e+00 1892 1890 -1.5986020000000e+00 1893 1890 -1.1201474000000e+00 1938 1890 -1.0944165000000e+00 2994 1890 -7.3157458000000e+00 787 1891 -2.1803832000000e-03 789 1891 -2.2755466000000e-05 1843 1891 -6.1991313000000e-02 1845 1891 -4.5552719000000e-06 1888 1891 -4.0235257000000e-04 1890 1891 -4.1991334000000e-06 1891 1891 1.1344473000000e+02 1893 1891 3.3287716000000e-04 1894 1891 -4.5095527000000e-02 1896 1891 -4.9208480000000e-06 1939 1891 -4.1622535000000e-04 1941 1891 -4.3439161000000e-06 2995 1891 -5.0597208000000e-02 2997 1891 -2.6957113000000e-05 787 1892 7.8845270000000e-01 789 1892 -3.4736169000000e+00 1843 1892 4.6147383000000e+00 1845 1892 -6.9594388000000e-01 1890 1892 -6.6265230000000e-01 1891 1892 -7.7174379000000e+01 1892 1892 -2.1627893000000e+01 1893 1892 1.0384961000000e+01 1894 1892 6.7286829000000e+00 1896 1892 -7.5184989000000e-01 1941 1892 -6.8011853000000e-01 2997 1892 -4.1183464000000e+00 787 1893 1.3327994000000e+00 788 1893 -2.1589688000000e-01 789 1893 -5.8717972000000e+00 1843 1893 7.8007472000000e+00 1844 1893 -1.2636238000000e+00 1845 1893 -1.1764226000000e+00 1890 1893 -1.1201474000000e+00 1891 1893 -1.3045548000000e+02 1892 1893 2.0085606000000e+01 1893 1893 1.7554727000000e+01 1894 1893 1.1374157000000e+01 1895 1893 -1.8424714000000e+00 1896 1893 -1.2709260000000e+00 1941 1893 -1.1496714000000e+00 2997 1893 -6.9616488000000e+00 790 1894 -1.8180626000000e-03 792 1894 -1.8974124000000e-05 1846 1894 -1.2712021000000e-01 1848 1894 -5.8889390000000e-06 1891 1894 -4.7150582000000e-04 1893 1894 -4.9208480000000e-06 1894 1894 1.4053661000000e+02 1896 1894 3.9251933000000e-04 1897 1894 -1.1247037000000e-01 1899 1894 -6.4451798000000e-06 1942 1894 -5.2983208000000e-04 1944 1894 -5.5295673000000e-06 2998 1894 -4.5817235000000e-02 3000 1894 -2.2481667000000e-05 790 1895 1.4265019000000e+00 792 1895 -2.8041797000000e+00 1846 1895 6.7410271000000e+00 1848 1895 -8.7164905000000e-01 1893 1895 -7.5184989000000e-01 1894 1895 -9.6260607000000e+01 1895 1895 -2.6784777000000e+01 1896 1895 9.5539122000000e+00 1897 1895 7.5749029000000e+00 1899 1895 -9.5401471000000e-01 1944 1895 -8.4152480000000e-01 3000 1895 -3.3276778000000e+00 790 1896 2.4113587000000e+00 791 1896 -3.9060161000000e-01 792 1896 -4.7401854000000e+00 1846 1896 1.1395032000000e+01 1847 1896 -1.8458133000000e+00 1848 1896 -1.4734355000000e+00 1893 1896 -1.2709260000000e+00 1894 1896 -1.6271893000000e+02 1895 1896 2.5043815000000e+01 1896 1896 1.6149932000000e+01 1897 1896 1.2804616000000e+01 1898 1896 -2.0741433000000e+00 1899 1896 -1.6126664000000e+00 1944 1896 -1.4225135000000e+00 3000 1896 -5.6251066000000e+00 793 1897 -1.4398869000000e-03 795 1897 -1.5027311000000e-05 1849 1897 -1.4525831000000e-01 1851 1897 -7.6238993000000e-06 1894 1897 -6.1756424000000e-04 1896 1897 -6.4451798000000e-06 1897 1897 1.8371826000000e+02 1899 1897 4.9185286000000e-04 1900 1897 -1.2848283000000e-01 1902 1897 -8.3665884000000e-06 1945 1897 -7.0272142000000e-04 1947 1897 -7.3339187000000e-06 3001 1897 -3.9784889000000e-02 3003 1897 -1.7755663000000e-05 793 1898 2.2860263000000e+00 795 1898 -2.1546054000000e+00 1849 1898 9.4717085000000e+00 1851 1898 -1.0973587000000e+00 1896 1898 -9.5401471000000e-01 1897 1898 -1.2836321000000e+02 1898 1898 -3.5025750000000e+01 1899 1898 9.0671103000000e+00 1900 1898 1.1312072000000e+01 1902 1898 -1.2043097000000e+00 1947 1898 -1.0972324000000e+00 3003 1898 -2.5556453000000e+00 793 1899 3.8642962000000e+00 794 1899 -6.2594283000000e-01 795 1899 -3.6421424000000e+00 1849 1899 1.6010965000000e+01 1850 1899 -2.5934732000000e+00 1851 1899 -1.8549738000000e+00 1896 1899 -1.6126664000000e+00 1897 1899 -2.1698503000000e+02 1898 1899 3.3430196000000e+01 1899 1899 1.5327034000000e+01 1900 1899 1.9121914000000e+01 1901 1899 -3.0973879000000e+00 1902 1899 -2.0357636000000e+00 1947 1899 -1.8547602000000e+00 3003 1899 -4.3200606000000e+00 796 1900 -1.2311274000000e-03 798 1900 -1.2848602000000e-05 1852 1900 -1.4077561000000e-01 1854 1900 -9.6152951000000e-06 1897 1900 -8.0166977000000e-04 1899 1900 -8.3665884000000e-06 1900 1900 2.2139825000000e+02 1902 1900 5.7404826000000e-04 1903 1900 -6.7449494000000e-02 1905 1900 -1.0368966000000e-05 3004 1900 -3.2199498000000e-02 3006 1900 -1.5150297000000e-05 796 1901 3.3587507000000e+00 798 1901 -1.7813940000000e+00 1852 1901 7.7545697000000e+00 1854 1901 -1.3411889000000e+00 1899 1901 -1.2043097000000e+00 1900 1901 -1.4289282000000e+02 1901 1901 -4.2241754000000e+01 1902 1901 7.8912239000000e+00 1903 1901 4.8152646000000e+00 1905 1901 -1.4463522000000e+00 3006 1901 -2.1132209000000e+00 796 1902 5.6776321000000e+00 797 1902 -9.1964831000000e-01 798 1902 -3.0112683000000e+00 1852 1902 1.3108325000000e+01 1853 1902 -2.1232529000000e+00 1854 1902 -2.2671456000000e+00 1899 1902 -2.0357636000000e+00 1900 1902 -2.4154602000000e+02 1901 1902 3.7042029000000e+01 1902 1902 1.3339323000000e+01 1903 1902 8.1397233000000e+00 1904 1902 -1.3184515000000e+00 1905 1902 -2.4449138000000e+00 3006 1902 -3.5721885000000e+00 799 1903 -1.0423520000000e-03 801 1903 -1.0878457000000e-05 1855 1903 -1.4048118000000e-01 1857 1903 -1.1600672000000e-05 1900 1903 -9.9353355000000e-04 1902 1903 -1.0368966000000e-05 1903 1903 2.6448201000000e+02 1905 1903 6.6438031000000e-04 3007 1903 -3.1922291000000e-02 3009 1903 -1.2812511000000e-05 799 1904 3.3795222000000e+00 801 1904 -1.4898504000000e+00 1855 1904 6.5452608000000e+00 1857 1904 -1.6001767000000e+00 1902 1904 -1.4463522000000e+00 1903 1904 -1.6166186000000e+02 1904 1904 -5.0484398000000e+01 1905 1904 6.3093915000000e+00 3009 1904 -1.7673253000000e+00 799 1905 5.7127422000000e+00 800 1905 -9.2532827000000e-01 801 1905 -2.5184421000000e+00 1855 1905 1.1064105000000e+01 1856 1905 -1.7921216000000e+00 1857 1905 -2.7049376000000e+00 1902 1905 -2.4449138000000e+00 1903 1905 -2.7327311000000e+02 1904 1905 4.1773412000000e+01 1905 1905 1.0665392000000e+01 3009 1905 -2.9874848000000e+00 1906 1906 1.0000000000000e+00 1907 1907 1.0000000000000e+00 1908 1908 1.0000000000000e+00 1909 1909 1.0000000000000e+00 1910 1910 1.0000000000000e+00 1911 1911 1.0000000000000e+00 1912 1912 1.0000000000000e+00 1913 1913 1.0000000000000e+00 1914 1914 1.0000000000000e+00 1915 1915 1.0000000000000e+00 1916 1916 1.0000000000000e+00 1917 1917 1.0000000000000e+00 1918 1918 1.0000000000000e+00 1919 1919 1.0000000000000e+00 1920 1920 1.0000000000000e+00 1921 1921 1.0000000000000e+00 1922 1922 1.0000000000000e+00 1923 1923 1.0000000000000e+00 820 1924 -1.3598413000000e-03 822 1924 -1.4191919000000e-05 1876 1924 -5.4602393000000e-04 1878 1924 -5.6985528000000e-06 1924 1924 1.6194470000000e+02 1926 1924 4.2684968000000e-04 1927 1924 -5.4574734000000e-04 1929 1924 -5.6956662000000e-06 1972 1924 -8.8439480000000e-03 1974 1924 -5.6667857000000e-06 3028 1924 -5.1505774000000e-02 3030 1924 -1.6818596000000e-05 820 1925 5.6215850000000e-01 822 1925 -2.4292229000000e+00 1876 1925 1.3611340000000e+00 1878 1925 -9.7071914000000e-01 1924 1925 -9.6497379000000e+01 1925 1925 -3.0852941000000e+01 1926 1925 8.2246738000000e+00 1927 1925 1.5944959000000e+00 1929 1925 -9.6938615000000e-01 1974 1925 -9.7074826000000e-01 3030 1925 -2.8811403000000e+00 820 1926 9.5027273000000e-01 821 1926 -1.5394300000000e-01 822 1926 -4.1063585000000e+00 1876 1926 2.3008609000000e+00 1877 1926 -3.7273661000000e-01 1878 1926 -1.6409036000000e+00 1924 1926 -1.6311917000000e+02 1925 1926 2.5038158000000e+01 1926 1926 1.3902989000000e+01 1927 1926 2.6953358000000e+00 1928 1926 -4.3664106000000e-01 1929 1926 -1.6386503000000e+00 1974 1926 -1.6409528000000e+00 3030 1926 -4.8702796000000e+00 823 1927 -1.3713259000000e-03 825 1927 -1.4311777000000e-05 1879 1927 -5.2351249000000e-04 1881 1927 -5.4636132000000e-06 1924 1927 -8.0473167000000e-03 1926 1927 -5.6956662000000e-06 1927 1927 1.6194053000000e+02 1929 1927 4.3210605000000e-04 1930 1927 -5.0176739000000e-04 1932 1927 -5.2366715000000e-06 1975 1927 -5.4167195000000e-04 1977 1927 -5.6531335000000e-06 3031 1927 -5.1855591000000e-02 3033 1927 -1.6968364000000e-05 823 1928 5.2784843000000e-01 825 1928 -2.4336098000000e+00 1879 1928 2.5778537000000e+00 1881 1928 -9.1952951000000e-01 1926 1928 -9.6938615000000e-01 1927 1928 -9.8694245000000e+01 1928 1928 -3.0856855000000e+01 1929 1928 9.0656151000000e+00 1930 1928 2.6143063000000e+00 1932 1928 -8.8078221000000e-01 1977 1928 -9.7084846000000e-01 3033 1928 -2.8880003000000e+00 823 1929 8.9227438000000e-01 824 1929 -1.4454689000000e-01 825 1929 -4.1137712000000e+00 1879 1929 4.3576008000000e+00 1880 1929 -7.0592372000000e-01 1881 1929 -1.5543716000000e+00 1926 1929 -1.6386503000000e+00 1927 1929 -1.6683264000000e+02 1928 1929 2.5630146000000e+01 1929 1929 1.5324507000000e+01 1930 1929 4.4192202000000e+00 1931 1929 -7.1590595000000e-01 1932 1929 -1.4888732000000e+00 1977 1929 -1.6411213000000e+00 3033 1929 -4.8818723000000e+00 826 1930 -1.6636560000000e-03 828 1930 -1.7362667000000e-05 1882 1930 -1.2450066000000e-02 1884 1930 -4.7117000000000e-06 1927 1930 -2.3695041000000e-02 1929 1930 -5.2366715000000e-06 1930 1930 1.3498291000000e+02 1932 1930 3.7268180000000e-04 1933 1930 -1.9379559000000e-03 1935 1930 -4.3848042000000e-06 1978 1930 -4.5528563000000e-04 1980 1930 -4.7515669000000e-06 3034 1930 -5.2252131000000e-02 3036 1930 -2.0589990000000e-05 826 1931 4.9816244000000e-01 828 1931 -2.9189937000000e+00 1882 1931 2.8246275000000e+00 1884 1931 -7.9257688000000e-01 1929 1931 -8.8078221000000e-01 1930 1931 -8.4221274000000e+01 1931 1931 -2.5721199000000e+01 1932 1931 9.6051625000000e+00 1933 1931 3.4298592000000e+00 1935 1931 -7.3761286000000e-01 1980 1931 -8.0898352000000e-01 3036 1931 -3.4633279000000e+00 826 1932 8.4209378000000e-01 827 1932 -1.3641669000000e-01 828 1932 -4.9342670000000e+00 1882 1932 4.7747504000000e+00 1883 1932 -7.7349535000000e-01 1884 1932 -1.3397720000000e+00 1929 1932 -1.4888732000000e+00 1930 1932 -1.4236764000000e+02 1931 1932 2.1881898000000e+01 1932 1932 1.6236566000000e+01 1933 1932 5.7978341000000e+00 1934 1932 -9.3923186000000e-01 1935 1932 -1.2468608000000e+00 1980 1932 -1.3675057000000e+00 3036 1932 -5.8544095000000e+00 829 1933 -2.0178442000000e-03 831 1933 -2.1059135000000e-05 1885 1933 -1.6712968000000e-02 1887 1933 -4.0143276000000e-06 1930 1933 -4.2014317000000e-04 1932 1933 -4.3848042000000e-06 1933 1933 1.1338744000000e+02 1935 1933 3.2763065000000e-04 1936 1933 -1.3111279000000e-02 1938 1933 -4.0079459000000e-06 1981 1933 -3.8802292000000e-04 1983 1933 -4.0495827000000e-06 3037 1933 -5.2868056000000e-02 3039 1933 -2.4974195000000e-05 829 1934 4.5515115000000e-01 831 1934 -3.4774202000000e+00 1885 1934 2.9823913000000e+00 1887 1934 -6.6305749000000e-01 1932 1934 -7.3761286000000e-01 1933 1934 -7.2722891000000e+01 1934 1934 -2.1611440000000e+01 1935 1934 1.0346880000000e+01 1936 1934 4.2195423000000e+00 1938 1934 -6.6202847000000e-01 1983 1934 -6.7953492000000e-01 3039 1934 -4.1247997000000e+00 829 1935 7.6938705000000e-01 830 1935 -1.2463713000000e-01 831 1935 -5.8782276000000e+00 1885 1935 5.0414313000000e+00 1886 1935 -8.1668844000000e-01 1887 1935 -1.1208317000000e+00 1932 1935 -1.2468608000000e+00 1933 1935 -1.2293071000000e+02 1934 1935 1.8908185000000e+01 1935 1935 1.7490356000000e+01 1936 1935 7.1327105000000e+00 1937 1935 -1.1554659000000e+00 1938 1935 -1.1190923000000e+00 1983 1935 -1.1486850000000e+00 3039 1935 -6.9725578000000e+00 832 1936 -2.1727911000000e-03 834 1936 -2.2676231000000e-05 1888 1936 -2.7603420000000e-02 1890 1936 -4.0172991000000e-06 1933 1936 -3.8403337000000e-04 1935 1936 -4.0079459000000e-06 1936 1936 1.0800416000000e+02 1938 1936 3.1814256000000e-04 1939 1936 -2.0496111000000e-02 1941 1936 -4.1087426000000e-06 1984 1936 -3.7683306000000e-04 1986 1936 -3.9328003000000e-06 3040 1936 -5.2989792000000e-02 3042 1936 -2.6884237000000e-05 832 1937 4.6107399000000e-01 834 1937 -3.6531824000000e+00 1888 1937 3.6138554000000e+00 1890 1937 -6.4743050000000e-01 1935 1937 -6.6202847000000e-01 1936 1937 -7.1102064000000e+01 1937 1937 -2.0588297000000e+01 1938 1937 1.0606735000000e+01 1939 1937 5.0681113000000e+00 1941 1937 -6.6219948000000e-01 1986 1937 -6.4715713000000e-01 3042 1937 -4.3324235000000e+00 832 1938 7.7939948000000e-01 833 1938 -1.2625714000000e-01 834 1938 -6.1753395000000e+00 1888 1938 6.1088611000000e+00 1889 1938 -9.8959181000000e-01 1890 1938 -1.0944165000000e+00 1935 1938 -1.1190923000000e+00 1936 1938 -1.2019093000000e+02 1937 1938 1.8497248000000e+01 1938 1938 1.7929624000000e+01 1939 1938 8.5671354000000e+00 1940 1938 -1.3878147000000e+00 1941 1938 -1.1193820000000e+00 1986 1938 -1.0939544000000e+00 3042 1938 -7.3235287000000e+00 835 1939 -2.1290183000000e-03 837 1939 -2.2219399000000e-05 1891 1939 -4.0318724000000e-02 1893 1939 -4.3439161000000e-06 1936 1939 -3.9369150000000e-04 1938 1939 -4.1087426000000e-06 1939 1939 1.1341229000000e+02 1941 1939 3.3117479000000e-04 1942 1939 -2.9311834000000e-02 1944 1939 -4.7987089000000e-06 1987 1939 -4.0538554000000e-04 1989 1939 -4.2307869000000e-06 3043 1939 -5.2052241000000e-02 3045 1939 -2.6331117000000e-05 835 1940 5.8499962000000e-01 837 1940 -3.4773703000000e+00 1891 1940 4.5827496000000e+00 1893 1940 -6.8011853000000e-01 1938 1940 -6.6219948000000e-01 1939 1940 -7.6112701000000e+01 1940 1940 -2.1624608000000e+01 1941 1940 1.0374867000000e+01 1942 1940 5.8976992000000e+00 1944 1940 -7.5135589000000e-01 1989 1940 -6.7902624000000e-01 3045 1940 -4.1223643000000e+00 835 1941 9.8888256000000e-01 836 1941 -1.6018912000000e-01 837 1941 -5.8781421000000e+00 1891 1941 7.7466736000000e+00 1892 1941 -1.2548840000000e+00 1893 1941 -1.1496714000000e+00 1938 1941 -1.1193820000000e+00 1939 1941 -1.2866081000000e+02 1940 1941 1.9803364000000e+01 1941 1941 1.7537663000000e+01 1942 1941 9.9694632000000e+00 1943 1941 -1.6149535000000e+00 1944 1941 -1.2700910000000e+00 1989 1941 -1.1478251000000e+00 3045 1941 -6.9684400000000e+00 838 1942 -1.7730079000000e-03 840 1942 -1.8503913000000e-05 1894 1942 -6.7527563000000e-02 1896 1942 -5.5295673000000e-06 1939 1942 -4.5980269000000e-04 1941 1942 -4.7987089000000e-06 1942 1942 1.4038514000000e+02 1944 1942 3.9070966000000e-04 1945 1942 -1.2654397000000e-02 1947 1942 -6.2646258000000e-06 1990 1942 -5.2024449000000e-04 1992 1942 -5.4295069000000e-06 3046 1942 -4.9917517000000e-02 3048 1942 -2.1910194000000e-05 838 1943 8.6180402000000e-01 840 1943 -2.8132636000000e+00 1894 1943 6.5958573000000e+00 1896 1943 -8.4152480000000e-01 1941 1943 -7.5135589000000e-01 1942 1943 -9.2621167000000e+01 1943 1943 -2.6781272000000e+01 1944 1943 9.5378830000000e+00 1945 1943 4.6401891000000e+00 1947 1943 -9.5341677000000e-01 1992 1943 -8.4106769000000e-01 3048 1943 -3.3342396000000e+00 838 1944 1.4567935000000e+00 839 1944 -2.3598159000000e-01 840 1944 -4.7555408000000e+00 1894 1944 1.1149637000000e+01 1895 1944 -1.8060961000000e+00 1896 1944 -1.4225135000000e+00 1941 1944 -1.2700910000000e+00 1942 1944 -1.5656682000000e+02 1943 1944 2.4056464000000e+01 1944 1944 1.6122836000000e+01 1945 1944 7.8437756000000e+00 1946 1944 -1.2705895000000e+00 1947 1944 -1.6116557000000e+00 1992 1944 -1.4217408000000e+00 3048 1944 -5.6361987000000e+00 841 1945 -1.3791639000000e-03 843 1945 -1.4393578000000e-05 1897 1945 -2.0282098000000e-01 1899 1945 -7.3339187000000e-06 1942 1945 -6.0026392000000e-04 1944 1945 -6.2646258000000e-06 1945 1945 1.8365159000000e+02 1947 1945 4.8141925000000e-04 1993 1945 -6.8042328000000e-04 1995 1945 -7.1012052000000e-06 3049 1945 -4.7987493000000e-02 3051 1945 -1.7045630000000e-05 841 1946 1.0974181000000e+00 843 1946 -2.1496197000000e+00 1897 1946 1.1971675000000e+01 1899 1946 -1.0972324000000e+00 1944 1946 -9.5341677000000e-01 1945 1946 -1.1835743000000e+02 1946 1946 -3.5029675000000e+01 1947 1946 7.8370049000000e+00 1995 1946 -1.0825693000000e+00 3051 1946 -2.5502210000000e+00 841 1947 1.8550741000000e+00 842 1947 -3.0049472000000e-01 843 1947 -3.6337143000000e+00 1897 1947 2.0236903000000e+01 1898 1947 -3.2780807000000e+00 1899 1947 -1.8547602000000e+00 1944 1947 -1.6116557000000e+00 1945 1947 -2.0007125000000e+02 1946 1947 3.0681916000000e+01 1947 1947 1.3247663000000e+01 1995 1947 -1.8299736000000e+00 3051 1947 -4.3108899000000e+00 1948 1948 1.0000000000000e+00 1949 1949 1.0000000000000e+00 1950 1950 1.0000000000000e+00 1951 1951 1.0000000000000e+00 1952 1952 1.0000000000000e+00 1953 1953 1.0000000000000e+00 1954 1954 1.0000000000000e+00 1955 1955 1.0000000000000e+00 1956 1956 1.0000000000000e+00 1957 1957 1.0000000000000e+00 1958 1958 1.0000000000000e+00 1959 1959 1.0000000000000e+00 1960 1960 1.0000000000000e+00 1961 1961 1.0000000000000e+00 1962 1962 1.0000000000000e+00 1963 1963 1.0000000000000e+00 1964 1964 1.0000000000000e+00 1965 1965 1.0000000000000e+00 1966 1966 1.0000000000000e+00 1967 1967 1.0000000000000e+00 1968 1968 1.0000000000000e+00 1969 1969 1.0000000000000e+00 1970 1970 1.0000000000000e+00 1971 1971 1.0000000000000e+00 868 1972 -1.3515598000000e-03 870 1972 -1.4105490000000e-05 1924 1972 -5.4298008000000e-04 1926 1972 -5.6667857000000e-06 1972 1972 1.6194398000000e+02 1974 1972 4.2654555000000e-04 1975 1972 -5.4097895000000e-04 1977 1972 -5.6459011000000e-06 2020 1972 -4.0204471000000e-03 2022 1972 -5.6321296000000e-06 3076 1972 -5.1494177000000e-02 3078 1972 -1.6715752000000e-05 868 1973 5.6322181000000e-01 870 1973 -2.4295537000000e+00 1924 1973 1.5190409000000e+00 1926 1973 -9.7074826000000e-01 1972 1973 -9.6038303000000e+01 1973 1973 -3.0849071000000e+01 1974 1973 8.2257191000000e+00 1975 1973 9.7113107000000e-01 1977 1973 -9.6953747000000e-01 2022 1973 -9.7089198000000e-01 3078 1973 -2.8815324000000e+00 868 1974 9.5207014000000e-01 869 1974 -1.5423474000000e-01 870 1974 -4.1069176000000e+00 1924 1974 2.5677867000000e+00 1925 1974 -4.1597978000000e-01 1926 1974 -1.6409528000000e+00 1972 1974 -1.6234315000000e+02 1973 1974 2.4921984000000e+01 1974 1974 1.3904756000000e+01 1975 1974 1.6416000000000e+00 1976 1974 -2.6593812000000e-01 1977 1974 -1.6389061000000e+00 2022 1974 -1.6411958000000e+00 3078 1974 -4.8709424000000e+00 871 1975 -1.3581805000000e-03 873 1975 -1.4174587000000e-05 1927 1975 -8.0863543000000e-03 1929 1975 -5.6531335000000e-06 1972 1975 -2.3869829000000e-02 1974 1975 -5.6459011000000e-06 1975 1975 1.6197244000000e+02 1977 1975 4.3178912000000e-04 1978 1975 -4.9605957000000e-04 1980 1975 -5.1771021000000e-06 2023 1975 -5.9434076000000e-03 2025 1975 -5.5576398000000e-06 3079 1975 -5.1778327000000e-02 3081 1975 -1.6804275000000e-05 871 1976 5.3125815000000e-01 873 1976 -2.4321006000000e+00 1927 1976 2.1436200000000e+00 1929 1976 -9.7084846000000e-01 1974 1976 -9.6953747000000e-01 1975 1976 -9.7548639000000e+01 1976 1976 -3.0853874000000e+01 1977 1976 9.0974374000000e+00 1978 1976 1.8954181000000e+00 1980 1976 -8.8134172000000e-01 2025 1976 -9.5439186000000e-01 3081 1976 -2.8857599000000e+00 871 1977 8.9803826000000e-01 872 1977 -1.4548135000000e-01 873 1977 -4.1112205000000e+00 1927 1977 3.6235731000000e+00 1928 1977 -5.8701546000000e-01 1929 1977 -1.6411213000000e+00 1974 1977 -1.6389061000000e+00 1975 1977 -1.6489613000000e+02 1976 1977 2.5323854000000e+01 1977 1977 1.5378299000000e+01 1978 1977 3.2040130000000e+00 1979 1977 -5.1904706000000e-01 1980 1977 -1.4898192000000e+00 2025 1977 -1.6133028000000e+00 3081 1977 -4.8780844000000e+00 874 1978 -1.6429276000000e-03 876 1978 -1.7146335000000e-05 1930 1978 -5.5463550000000e-03 1932 1978 -4.7515669000000e-06 1975 1978 -2.2403983000000e-02 1977 1978 -5.1771021000000e-06 1978 1978 1.3497725000000e+02 1980 1978 3.7205450000000e-04 1981 1978 -4.2127940000000e-04 1983 1978 -4.3966624000000e-06 2026 1978 -4.4144999000000e-04 2028 1978 -4.6071718000000e-06 3082 1978 -5.2196358000000e-02 3084 1978 -2.0331213000000e-05 874 1979 4.9785899000000e-01 876 1979 -2.9175561000000e+00 1930 1979 2.4475345000000e+00 1932 1979 -8.0898352000000e-01 1977 1979 -8.8134172000000e-01 1978 1979 -8.3065857000000e+01 1979 1979 -2.5717348000000e+01 1980 1979 9.6022467000000e+00 1981 1979 2.6464787000000e+00 1983 1979 -7.3769417000000e-01 2028 1979 -7.9248720000000e-01 3084 1979 -3.4613003000000e+00 874 1980 8.4158084000000e-01 875 1980 -1.3633455000000e-01 876 1980 -4.9318369000000e+00 1930 1980 4.1373122000000e+00 1931 1980 -6.7023700000000e-01 1932 1980 -1.3675057000000e+00 1977 1980 -1.4898192000000e+00 1978 1980 -1.4041452000000e+02 1979 1980 2.1575094000000e+01 1980 1980 1.6231637000000e+01 1981 1980 4.4736076000000e+00 1982 1980 -7.2471622000000e-01 1983 1980 -1.2469982000000e+00 2028 1980 -1.3396204000000e+00 3084 1980 -5.8509821000000e+00 877 1981 -1.9853381000000e-03 879 1981 -2.0719887000000e-05 1933 1981 -8.6747483000000e-03 1935 1981 -4.0495827000000e-06 1978 1981 -3.2578681000000e-03 1980 1981 -4.3966624000000e-06 1981 1981 1.1337756000000e+02 1983 1981 3.2671386000000e-04 1984 1981 -4.1423520000000e-03 1986 1981 -3.9426131000000e-06 2029 1981 -3.7298957000000e-04 2031 1981 -3.8926879000000e-06 3085 1981 -5.2842909000000e-02 3087 1981 -2.4571963000000e-05 877 1982 4.4971537000000e-01 879 1982 -3.4760615000000e+00 1933 1982 2.7778289000000e+00 1935 1982 -6.7953492000000e-01 1980 1982 -7.3769417000000e-01 1981 1982 -7.1634305000000e+01 1982 1982 -2.1607397000000e+01 1983 1982 1.0343291000000e+01 1984 1982 3.3352763000000e+00 1986 1982 -6.6160067000000e-01 2031 1982 -6.6299625000000e-01 3087 1982 -4.1229794000000e+00 877 1983 7.6019829000000e-01 878 1983 -1.2314977000000e-01 879 1983 -5.8759299000000e+00 1933 1983 4.6956385000000e+00 1934 1983 -7.6067890000000e-01 1935 1983 -1.1486850000000e+00 1980 1983 -1.2469982000000e+00 1981 1983 -1.2109054000000e+02 1982 1983 1.8620214000000e+01 1983 1983 1.7484288000000e+01 1984 1983 5.6379468000000e+00 1985 1983 -9.1332988000000e-01 1986 1983 -1.1183689000000e+00 2031 1983 -1.1207281000000e+00 3087 1983 -6.9694796000000e+00 880 1984 -2.1301373000000e-03 882 1984 -2.2231077000000e-05 1936 1984 -1.7026601000000e-02 1938 1984 -3.9328003000000e-06 1981 1984 -3.7777331000000e-04 1983 1984 -3.9426131000000e-06 1984 1984 1.0798437000000e+02 1986 1984 3.1684869000000e-04 1987 1984 -6.5332251000000e-03 1989 1984 -4.0245300000000e-06 2032 1984 -3.6867044000000e-04 2034 1984 -3.8476115000000e-06 3088 1984 -5.3129053000000e-02 3090 1984 -2.6355745000000e-05 880 1985 4.4145583000000e-01 882 1985 -3.6567886000000e+00 1936 1985 3.5077310000000e+00 1938 1985 -6.4715713000000e-01 1983 1985 -6.6160067000000e-01 1984 1985 -7.0246557000000e+01 1985 1985 -2.0583992000000e+01 1986 1985 1.0613731000000e+01 1987 1985 4.3322745000000e+00 1989 1985 -6.6227664000000e-01 2034 1985 -6.4698723000000e-01 3090 1985 -4.3366092000000e+00 880 1986 7.4623694000000e-01 881 1986 -1.2088658000000e-01 882 1986 -6.1814354000000e+00 1936 1986 5.9294684000000e+00 1937 1986 -9.6054362000000e-01 1938 1986 -1.0939544000000e+00 1983 1986 -1.1183689000000e+00 1984 1986 -1.1874478000000e+02 1985 1986 1.8273817000000e+01 1986 1986 1.7941450000000e+01 1987 1986 7.3232768000000e+00 1988 1986 -1.1863335000000e+00 1989 1986 -1.1195124000000e+00 2034 1986 -1.0936672000000e+00 3090 1986 -7.3306042000000e+00 883 1987 -2.0781249000000e-03 885 1987 -2.1688252000000e-05 1939 1987 -3.2182024000000e-02 1941 1987 -4.2307869000000e-06 1984 1987 -3.8562242000000e-04 1986 1987 -4.0245300000000e-06 1987 1987 1.1343962000000e+02 1989 1987 3.2966748000000e-04 1990 1987 -5.9885713000000e-02 1992 1987 -4.6855457000000e-06 2035 1987 -4.0055791000000e-04 2037 1987 -4.1804036000000e-06 3091 1987 -5.2581036000000e-02 3093 1987 -2.5718390000000e-05 883 1988 5.1242768000000e-01 885 1988 -3.4803075000000e+00 1939 1988 4.4354063000000e+00 1941 1988 -6.7902624000000e-01 1986 1988 -6.6227664000000e-01 1987 1988 -7.7100192000000e+01 1988 1988 -2.1620543000000e+01 1989 1988 1.0397991000000e+01 1990 1988 7.0993032000000e+00 1992 1988 -7.5202197000000e-01 2037 1988 -6.9450959000000e-01 3093 1988 -4.1274186000000e+00 883 1989 8.6620710000000e-01 884 1989 -1.4031909000000e-01 885 1989 -5.8831074000000e+00 1939 1989 7.4976051000000e+00 1940 1989 -1.2145561000000e+00 1941 1989 -1.1478251000000e+00 1986 1989 -1.1195124000000e+00 1987 1989 -1.3033007000000e+02 1988 1989 2.0084135000000e+01 1989 1989 1.7576753000000e+01 1990 1989 1.2000653000000e+01 1991 1989 -1.9440162000000e+00 1992 1989 -1.2712170000000e+00 2037 1989 -1.1739984000000e+00 3093 1989 -6.9769843000000e+00 886 1990 -1.7388043000000e-03 888 1990 -1.8146949000000e-05 1942 1990 -5.7052761000000e-03 1944 1990 -5.4295069000000e-06 1987 1990 -4.4895961000000e-04 1989 1990 -4.6855457000000e-06 1990 1990 1.4033051000000e+02 1992 1990 3.8410423000000e-04 1993 1990 -1.1692933000000e-02 1995 1990 -6.0745924000000e-06 3094 1990 -5.1128589000000e-02 3096 1990 -2.1493975000000e-05 886 1991 6.7593607000000e-01 888 1991 -2.8086301000000e+00 1942 1991 4.1559287000000e+00 1944 1991 -8.4106769000000e-01 1989 1991 -7.5202197000000e-01 1990 1991 -8.9553894000000e+01 1991 1991 -2.6774330000000e+01 1992 1991 8.6749636000000e+00 1993 1991 4.1888701000000e+00 1995 1991 -9.4098208000000e-01 3096 1991 -3.3292502000000e+00 886 1992 1.1426023000000e+00 887 1992 -1.8508882000000e-01 888 1992 -4.7477083000000e+00 1942 1992 7.0251819000000e+00 1943 1992 -1.1380010000000e+00 1944 1992 -1.4217408000000e+00 1989 1992 -1.2712170000000e+00 1990 1992 -1.5138190000000e+02 1991 1992 2.3233965000000e+01 1992 1992 1.4664157000000e+01 1993 1992 7.0808660000000e+00 1994 1992 -1.1470212000000e+00 1995 1992 -1.5906361000000e+00 3096 1992 -5.6277646000000e+00 889 1993 -1.3947605000000e-03 891 1993 -1.4556352000000e-05 1945 1993 -8.2597725000000e-03 1947 1993 -7.1012052000000e-06 1990 1993 -5.8205529000000e-04 1992 1993 -6.0745924000000e-06 1993 1993 1.7807479000000e+02 1995 1993 4.6162173000000e-04 3097 1993 -5.0210142000000e-02 3099 1993 -1.7234427000000e-05 889 1994 7.8644259000000e-01 891 1994 -2.2165275000000e+00 1945 1994 5.7988949000000e+00 1947 1994 -1.0825693000000e+00 1992 1994 -9.4098208000000e-01 1993 1994 -1.0879048000000e+02 1994 1994 -3.3989894000000e+01 1995 1994 6.8709941000000e+00 3099 1994 -2.6270897000000e+00 889 1995 1.3294014000000e+00 890 1995 -2.1534613000000e-01 891 1995 -3.7468149000000e+00 1945 1995 9.8024438000000e+00 1946 1995 -1.5878712000000e+00 1947 1995 -1.8299736000000e+00 1992 1995 -1.5906361000000e+00 1993 1995 -1.8389928000000e+02 1994 1995 2.8136886000000e+01 1995 1995 1.1614721000000e+01 3099 1995 -4.4408299000000e+00 1996 1996 1.0000000000000e+00 1997 1997 1.0000000000000e+00 1998 1998 1.0000000000000e+00 1999 1999 1.0000000000000e+00 2000 2000 1.0000000000000e+00 2001 2001 1.0000000000000e+00 2002 2002 1.0000000000000e+00 2003 2003 1.0000000000000e+00 2004 2004 1.0000000000000e+00 2005 2005 1.0000000000000e+00 2006 2006 1.0000000000000e+00 2007 2007 1.0000000000000e+00 2008 2008 1.0000000000000e+00 2009 2009 1.0000000000000e+00 2010 2010 1.0000000000000e+00 2011 2011 1.0000000000000e+00 2012 2012 1.0000000000000e+00 2013 2013 1.0000000000000e+00 2014 2014 1.0000000000000e+00 2015 2015 1.0000000000000e+00 2016 2016 1.0000000000000e+00 2017 2017 1.0000000000000e+00 2018 2018 1.0000000000000e+00 2019 2019 1.0000000000000e+00 916 2020 -1.3447343000000e-03 918 2020 -1.4034255000000e-05 1972 2020 -5.3965939000000e-04 1974 2020 -5.6321296000000e-06 2020 2020 1.6194250000000e+02 2022 2020 4.2059232000000e-04 2023 2020 -5.2827979000000e-04 2025 2020 -5.5133669000000e-06 3124 2020 -5.1491502000000e-02 3126 2020 -1.6632414000000e-05 916 2021 5.5729081000000e-01 918 2021 -2.4280655000000e+00 1972 2021 1.0590800000000e+00 1974 2021 -9.7089198000000e-01 2020 2021 -9.4979557000000e+01 2021 2021 -3.0846670000000e+01 2022 2021 7.2356360000000e+00 2023 2021 3.7497811000000e-01 2025 2021 -9.5329954000000e-01 3126 2021 -2.8799247000000e+00 916 2022 9.4204439000000e-01 917 2022 -1.5261097000000e-01 918 2022 -4.1044020000000e+00 1972 2022 1.7902689000000e+00 1973 2022 -2.9002313000000e-01 1974 2022 -1.6411958000000e+00 2020 2022 -1.6055344000000e+02 2021 2022 2.4637981000000e+01 2022 2022 1.2231119000000e+01 2023 2022 6.3386300000000e-01 2024 2022 -1.0268565000000e-01 2025 2022 -1.6114575000000e+00 3126 2022 -4.8682248000000e+00 919 2023 -1.3945990000000e-03 921 2023 -1.4554666000000e-05 1975 2023 -5.3252193000000e-04 1977 2023 -5.5576398000000e-06 2020 2023 -2.1480390000000e-02 2022 2023 -5.5133669000000e-06 2023 2023 1.5656494000000e+02 2025 2023 4.1907539000000e-04 2026 2023 -4.7280605000000e-04 2028 2023 -4.9344178000000e-06 2071 2023 -4.8938068000000e-04 2073 2023 -5.1073982000000e-06 3127 2023 -5.1839685000000e-02 3129 2023 -1.7256323000000e-05 919 2024 5.2039201000000e-01 921 2024 -2.5147666000000e+00 1975 2024 1.6215986000000e+00 1977 2024 -9.5439186000000e-01 2022 2024 -9.5329954000000e-01 2023 2024 -9.3134441000000e+01 2024 2024 -2.9821783000000e+01 2025 2024 9.1453456000000e+00 2026 2024 1.1083786000000e+00 2028 2024 -8.4869448000000e-01 2073 2024 -8.8708335000000e-01 3129 2024 -2.9837693000000e+00 919 2025 8.7967001000000e-01 920 2025 -1.4250631000000e-01 921 2025 -4.2509584000000e+00 1975 2025 2.7411483000000e+00 1976 2025 -4.4406532000000e-01 1977 2025 -1.6133028000000e+00 2022 2025 -1.6114575000000e+00 2023 2025 -1.5743434000000e+02 2024 2025 2.4170331000000e+01 2025 2025 1.5459282000000e+01 2026 2025 1.8736018000000e+00 2027 2025 -3.0352301000000e-01 2028 2025 -1.4346321000000e+00 2073 2025 -1.4995246000000e+00 3129 2025 -5.0437600000000e+00 922 2026 -1.6936419000000e-03 924 2026 -1.7675613000000e-05 1978 2026 -2.7509738000000e-03 1980 2026 -4.6071718000000e-06 2023 2026 -2.8855918000000e-02 2025 2026 -4.9344178000000e-06 2026 2026 1.2958883000000e+02 2028 2026 3.5951497000000e-04 2029 2026 -3.9681458000000e-04 2031 2026 -4.1413365000000e-06 2074 2026 -4.0048567000000e-04 2076 2026 -4.1796496000000e-06 3130 2026 -5.2323006000000e-02 3132 2026 -2.0957870000000e-05 922 2027 4.8137961000000e-01 924 2027 -3.0387763000000e+00 1978 2027 2.0158029000000e+00 1980 2027 -7.9248720000000e-01 2025 2027 -8.4869448000000e-01 2026 2027 -7.8577491000000e+01 2027 2027 -2.4685307000000e+01 2028 2027 9.7176880000000e+00 2029 2027 1.7006406000000e+00 2031 2027 -7.0527590000000e-01 2076 2027 -7.2489488000000e-01 3132 2027 -3.6047923000000e+00 922 2028 8.1372409000000e-01 923 2028 -1.3182259000000e-01 924 2028 -5.1367475000000e+00 1978 2028 3.4075133000000e+00 1979 2028 -5.5201418000000e-01 1980 2028 -1.3396204000000e+00 2025 2028 -1.4346321000000e+00 2026 2028 -1.3282739000000e+02 2027 2028 2.0401186000000e+01 2028 2028 1.6426779000000e+01 2029 2028 2.8747629000000e+00 2030 2028 -4.6570909000000e-01 2031 2028 -1.1921984000000e+00 2076 2028 -1.2253623000000e+00 3132 2028 -6.0935410000000e+00 925 2029 -2.0526183000000e-03 927 2029 -2.1422054000000e-05 1981 2029 -1.0229231000000e-02 1983 2029 -3.8926879000000e-06 2026 2029 -1.1539562000000e-02 2028 2029 -4.1413365000000e-06 2029 2029 1.0799165000000e+02 2031 2029 3.1497476000000e-04 2032 2029 -3.6857629000000e-04 2034 2029 -3.8466289000000e-06 2077 2029 -3.5959229000000e-04 2079 2029 -3.7528679000000e-06 3133 2029 -5.2937329000000e-02 3135 2029 -2.5405001000000e-05 925 2030 4.3884976000000e-01 927 2030 -3.6479617000000e+00 1981 2030 2.4661872000000e+00 1983 2030 -6.6299625000000e-01 2028 2030 -7.0527590000000e-01 2029 2030 -6.6997482000000e+01 2030 2030 -2.0575274000000e+01 2031 2030 1.0639110000000e+01 2032 2030 2.1151711000000e+00 2034 2030 -6.4674675000000e-01 2079 2030 -6.4714282000000e-01 3135 2030 -4.3266793000000e+00 925 2031 7.4183114000000e-01 926 2031 -1.2017539000000e-01 927 2031 -6.1665103000000e+00 1981 2031 4.1688401000000e+00 1982 2031 -6.7534503000000e-01 1983 2031 -1.1207281000000e+00 2028 2031 -1.1921984000000e+00 2029 2031 -1.1325247000000e+02 2030 2031 1.7405884000000e+01 2031 2031 1.7984341000000e+01 2032 2031 3.5754831000000e+00 2033 2031 -5.7922216000000e-01 2034 2031 -1.0932600000000e+00 2079 2031 -1.0939295000000e+00 3135 2031 -7.3138141000000e+00 928 2032 -2.0800183000000e-03 930 2032 -2.1708012000000e-05 1984 2032 -1.7480067000000e-02 1986 2032 -3.8476115000000e-06 2029 2032 -4.1808220000000e-03 2031 2032 -3.8466289000000e-06 2032 2032 1.0798712000000e+02 2034 2032 3.1546660000000e-04 2035 2032 -4.6396661000000e-04 2037 2032 -4.0290025000000e-06 2080 2032 -3.6280034000000e-04 2082 2032 -3.7863485000000e-06 3136 2032 -5.3056770000000e-02 3138 2032 -2.5735744000000e-05 928 2033 4.2656881000000e-01 930 2033 -3.6489216000000e+00 1984 2033 3.5522180000000e+00 1986 2033 -6.4698723000000e-01 2031 2033 -6.4674675000000e-01 2032 2033 -6.8038213000000e+01 2033 2033 -2.0579659000000e+01 2034 2033 1.0596529000000e+01 2035 2033 2.0882388000000e+00 2037 2033 -6.7748189000000e-01 2082 2033 -6.4687038000000e-01 3138 2033 -4.3272116000000e+00 928 2034 7.2107192000000e-01 929 2034 -1.1681147000000e-01 930 2034 -6.1681371000000e+00 1984 2034 6.0046692000000e+00 1985 2034 -9.7273828000000e-01 1986 2034 -1.0936672000000e+00 2031 2034 -1.0932600000000e+00 2032 2034 -1.1501180000000e+02 2033 2034 1.7679983000000e+01 2034 2034 1.7912372000000e+01 2035 2034 3.5299588000000e+00 2036 2034 -5.7184267000000e-01 2037 2034 -1.1452154000000e+00 2082 2034 -1.0934697000000e+00 3138 2034 -7.3147185000000e+00 931 2035 -1.9161989000000e-03 933 2035 -1.9998318000000e-05 1987 2035 -2.5132937000000e-02 1989 2035 -4.1804036000000e-06 2032 2035 -3.8605096000000e-04 2034 2035 -4.0290025000000e-06 2035 2035 1.1877676000000e+02 2037 2035 3.3397726000000e-04 2083 2035 -4.1260535000000e-04 2085 2035 -4.3061361000000e-06 3139 2035 -5.2823657000000e-02 3141 2035 -2.3699441000000e-05 931 2036 4.4637846000000e-01 933 2036 -3.3203392000000e+00 1987 2036 6.2154245000000e+00 1989 2036 -6.9450959000000e-01 2034 2036 -6.7748189000000e-01 2035 2036 -7.4824506000000e+01 2036 2036 -2.2641647000000e+01 2037 2036 9.3592333000000e+00 2085 2036 -7.2755535000000e-01 3141 2036 -3.9368051000000e+00 931 2037 7.5455772000000e-01 932 2037 -1.2223526000000e-01 933 2037 -5.6126982000000e+00 1987 2037 1.0506548000000e+01 1988 2037 -1.7020177000000e+00 1989 2037 -1.1739984000000e+00 2034 2037 -1.1452154000000e+00 2035 2037 -1.2648328000000e+02 2036 2037 1.9433192000000e+01 2037 2037 1.5820839000000e+01 2085 2037 -1.2298587000000e+00 3141 2037 -6.6547709000000e+00 2038 2038 1.0000000000000e+00 2039 2039 1.0000000000000e+00 2040 2040 1.0000000000000e+00 2041 2041 1.0000000000000e+00 2042 2042 1.0000000000000e+00 2043 2043 1.0000000000000e+00 2044 2044 1.0000000000000e+00 2045 2045 1.0000000000000e+00 2046 2046 1.0000000000000e+00 2047 2047 1.0000000000000e+00 2048 2048 1.0000000000000e+00 2049 2049 1.0000000000000e+00 2050 2050 1.0000000000000e+00 2051 2051 1.0000000000000e+00 2052 2052 1.0000000000000e+00 2053 2053 1.0000000000000e+00 2054 2054 1.0000000000000e+00 2055 2055 1.0000000000000e+00 2056 2056 1.0000000000000e+00 2057 2057 1.0000000000000e+00 2058 2058 1.0000000000000e+00 2059 2059 1.0000000000000e+00 2060 2060 1.0000000000000e+00 2061 2061 1.0000000000000e+00 2062 2062 1.0000000000000e+00 2063 2063 1.0000000000000e+00 2064 2064 1.0000000000000e+00 2065 2065 1.0000000000000e+00 2066 2066 1.0000000000000e+00 2067 2067 1.0000000000000e+00 2068 2068 1.0000000000000e+00 2069 2069 1.0000000000000e+00 2070 2070 1.0000000000000e+00 967 2071 -1.5486360000000e-03 969 2071 -1.6162266000000e-05 2023 2071 -1.3177635000000e-03 2025 2071 -5.1073982000000e-06 2071 2071 1.4035733000000e+02 2073 2071 3.7303392000000e-04 2074 2071 -4.1502002000000e-04 2076 2071 -4.3313367000000e-06 3175 2071 -5.2088389000000e-02 3177 2071 -1.9158914000000e-05 967 2072 4.9811720000000e-01 969 2072 -2.8052857000000e+00 2023 2072 9.6498412000000e-01 2025 2072 -8.8708335000000e-01 2071 2072 -8.2325452000000e+01 2072 2072 -2.6735187000000e+01 2073 2072 7.7740211000000e+00 2074 2072 2.7443005000000e-01 2076 2072 -7.5114428000000e-01 3177 2072 -3.3275135000000e+00 967 2073 8.4201672000000e-01 968 2073 -1.3640684000000e-01 969 2073 -4.7420516000000e+00 2023 2073 1.6312080000000e+00 2024 2073 -2.6425593000000e-01 2025 2073 -1.4995246000000e+00 2071 2073 -1.3916285000000e+02 2072 2073 2.1352282000000e+01 2073 2073 1.3141196000000e+01 2074 2073 4.6389624000000e-01 2075 2073 -7.5151254000000e-02 2076 2073 -1.2697334000000e+00 3177 2073 -5.6248248000000e+00 970 2074 -1.9188510000000e-03 972 2074 -2.0025997000000e-05 2026 2074 -9.1575328000000e-04 2028 2074 -4.1796496000000e-06 2071 2074 -2.5369610000000e-02 2073 2074 -4.3313367000000e-06 2074 2074 1.1339891000000e+02 2076 2074 3.2508782000000e-04 2077 2074 -3.6819004000000e-04 2079 2074 -3.8425978000000e-06 2122 2074 -4.2051555000000e-04 2124 2074 -3.8229533000000e-06 3178 2074 -5.2643162000000e-02 3180 2074 -2.3743447000000e-05 970 2075 4.5778494000000e-01 972 2075 -3.4716727000000e+00 2026 2075 1.4703649000000e+00 2028 2075 -7.2489488000000e-01 2073 2075 -7.5114428000000e-01 2074 2075 -6.7964341000000e+01 2075 2075 -2.1597166000000e+01 2076 2075 1.0393410000000e+01 2077 2075 9.5055489000000e-01 2079 2075 -6.6255674000000e-01 2124 2075 -6.6299206000000e-01 3180 2075 -4.1177292000000e+00 970 2076 7.7383966000000e-01 971 2076 -1.2536194000000e-01 972 2076 -5.8685156000000e+00 2026 2076 2.4855048000000e+00 2027 2076 -4.0265152000000e-01 2028 2076 -1.2253623000000e+00 2073 2076 -1.2697334000000e+00 2074 2076 -1.1488692000000e+02 2075 2076 1.7640585000000e+01 2076 2076 1.7569019000000e+01 2077 2076 1.6068180000000e+00 2078 2076 -2.6030434000000e-01 2079 2076 -1.1199859000000e+00 2124 2076 -1.1207218000000e+00 3180 2076 -6.9606094000000e+00 973 2077 -2.0263996000000e-03 975 2077 -2.1148424000000e-05 2029 2077 -4.2983185000000e-03 2031 2077 -3.7528679000000e-06 2074 2077 -1.4398817000000e-02 2076 2077 -3.8425978000000e-06 2077 2077 1.0799211000000e+02 2079 2077 3.1387052000000e-04 2080 2077 -3.6281552000000e-04 2082 2077 -3.7865069000000e-06 2125 2077 -5.7231082000000e-04 2127 2077 -3.7528929000000e-06 3181 2077 -5.2986287000000e-02 3183 2077 -2.5073077000000e-05 973 2078 4.1947629000000e-01 975 2078 -3.6451450000000e+00 2029 2078 1.9446345000000e+00 2031 2078 -6.4714282000000e-01 2076 2078 -6.6255674000000e-01 2077 2078 -6.5831628000000e+01 2078 2078 -2.0572200000000e+01 2079 2078 1.0574418000000e+01 2080 2078 1.4859701000000e+00 2082 2078 -6.4683245000000e-01 2127 2078 -6.4709638000000e-01 3183 2078 -4.3233388000000e+00 973 2079 7.0908224000000e-01 974 2079 -1.1487093000000e-01 975 2079 -6.1617491000000e+00 2029 2079 3.2872081000000e+00 2030 2079 -5.3252586000000e-01 2031 2079 -1.0939295000000e+00 2076 2079 -1.1199859000000e+00 2077 2079 -1.1128171000000e+02 2078 2079 1.7094281000000e+01 2079 2079 1.7874985000000e+01 2080 2079 2.5118822000000e+00 2081 2079 -4.0692347000000e-01 2082 2079 -1.0934048000000e+00 2127 2079 -1.0938507000000e+00 3183 2079 -7.3081667000000e+00 976 2080 -2.0472526000000e-03 978 2080 -2.1366055000000e-05 2032 2080 -4.3670855000000e-03 2034 2080 -3.7863485000000e-06 2077 2080 -4.2436261000000e-03 2079 2080 -3.7865069000000e-06 2080 2080 1.0797900000000e+02 2082 2080 3.1484536000000e-04 2083 2080 -3.9241329000000e-04 2085 2080 -4.0954026000000e-06 2128 2080 -8.9023778000000e-04 2130 2080 -3.9670213000000e-06 3184 2080 -5.3021985000000e-02 3186 2080 -2.5330574000000e-05 976 2081 4.2670123000000e-01 978 2081 -3.6487932000000e+00 2032 2081 2.5733037000000e+00 2034 2081 -6.4687038000000e-01 2079 2081 -6.4683245000000e-01 2080 2081 -6.6940390000000e+01 2081 2081 -2.0575438000000e+01 2082 2081 1.0641571000000e+01 2083 2081 1.9633149000000e+00 2085 2081 -6.9187750000000e-01 2130 2081 -6.7766514000000e-01 3186 2081 -4.3272245000000e+00 976 2082 7.2129575000000e-01 977 2082 -1.1684882000000e-01 978 2082 -6.1679201000000e+00 2032 2082 4.3499125000000e+00 2033 2082 -7.0467922000000e-01 2034 2082 -1.0934697000000e+00 2079 2082 -1.0934048000000e+00 2080 2082 -1.1315604000000e+02 2081 2082 1.7389873000000e+01 2082 2082 1.7988511000000e+01 2083 2082 3.3187875000000e+00 2084 2082 -5.3763854000000e-01 2085 2082 -1.1695497000000e+00 2130 2082 -1.1455251000000e+00 3186 2082 -7.3147403000000e+00 979 2083 -1.8007609000000e-03 981 2083 -1.8793556000000e-05 2035 2083 -9.1781122000000e-03 2037 2083 -4.3061361000000e-06 2080 2083 -4.3665315000000e-03 2082 2083 -4.0954026000000e-06 2083 2083 1.2416444000000e+02 2085 2083 3.3985653000000e-04 3187 2083 -5.2728554000000e-02 3189 2083 -2.2272105000000e-05 979 2084 4.3795089000000e-01 981 2084 -3.1730689000000e+00 2035 2084 3.0722658000000e+00 2037 2084 -7.2755535000000e-01 2082 2084 -6.9187750000000e-01 2083 2084 -7.4777714000000e+01 2084 2084 -2.3666192000000e+01 2085 2084 8.3579258000000e+00 3189 2084 -3.7627684000000e+00 979 2085 7.4031168000000e-01 980 2085 -1.1992867000000e-01 981 2085 -5.3637519000000e+00 2035 2085 5.1933545000000e+00 2036 2085 -8.4131068000000e-01 2037 2085 -1.2298587000000e+00 2082 2085 -1.1695497000000e+00 2083 2085 -1.2640416000000e+02 2084 2085 1.9383922000000e+01 2085 2085 1.4128229000000e+01 3189 2085 -6.3605797000000e+00 2086 2086 1.0000000000000e+00 2087 2087 1.0000000000000e+00 2088 2088 1.0000000000000e+00 2089 2089 1.0000000000000e+00 2090 2090 1.0000000000000e+00 2091 2091 1.0000000000000e+00 2092 2092 1.0000000000000e+00 2093 2093 1.0000000000000e+00 2094 2094 1.0000000000000e+00 2095 2095 1.0000000000000e+00 2096 2096 1.0000000000000e+00 2097 2097 1.0000000000000e+00 2098 2098 1.0000000000000e+00 2099 2099 1.0000000000000e+00 2100 2100 1.0000000000000e+00 2101 2101 1.0000000000000e+00 2102 2102 1.0000000000000e+00 2103 2103 1.0000000000000e+00 2104 2104 1.0000000000000e+00 2105 2105 1.0000000000000e+00 2106 2106 1.0000000000000e+00 2107 2107 1.0000000000000e+00 2108 2108 1.0000000000000e+00 2109 2109 1.0000000000000e+00 2110 2110 1.0000000000000e+00 2111 2111 1.0000000000000e+00 2112 2112 1.0000000000000e+00 2113 2113 1.0000000000000e+00 2114 2114 1.0000000000000e+00 2115 2115 1.0000000000000e+00 2116 2116 1.0000000000000e+00 2117 2117 1.0000000000000e+00 2118 2118 1.0000000000000e+00 2119 2119 1.0000000000000e+00 2120 2120 1.0000000000000e+00 2121 2121 1.0000000000000e+00 1018 2122 -1.9994199000000e-03 1020 2122 -2.0866851000000e-05 2074 2122 -3.6630774000000e-04 2076 2122 -3.8229533000000e-06 2122 2122 1.0798444000000e+02 2124 2122 3.0936880000000e-04 2125 2122 -3.5610536000000e-04 2127 2122 -3.7164766000000e-06 2170 2122 -5.2512808000000e-03 2172 2122 -3.7048953000000e-06 3226 2122 -5.2989099000000e-02 3228 2122 -2.4741284000000e-05 1018 2123 4.1131826000000e-01 1020 2123 -3.6438231000000e+00 2074 2123 1.1718104000000e+00 2076 2123 -6.6299206000000e-01 2122 2123 -6.4108336000000e+01 2123 2123 -2.0566613000000e+01 2124 2123 9.9250470000000e+00 2125 2123 5.3596728000000e-01 2127 2123 -6.4700011000000e-01 2172 2123 -6.4715796000000e-01 3228 2123 -4.3217700000000e+00 1018 2124 6.9529239000000e-01 1019 2124 -1.1263776000000e-01 1020 2124 -6.1595186000000e+00 2074 2124 1.9808284000000e+00 2075 2124 -3.2089530000000e-01 2076 2124 -1.1207218000000e+00 2122 2124 -1.0836873000000e+02 2123 2124 1.6636125000000e+01 2124 2124 1.6777299000000e+01 2125 2124 9.0599909000000e-01 2126 2124 -1.4677236000000e-01 2127 2124 -1.0936890000000e+00 2172 2124 -1.0939558000000e+00 3228 2124 -7.3055200000000e+00 1021 2125 -2.0057856000000e-03 1023 2125 -2.0933286000000e-05 2077 2125 -3.5959469000000e-04 2079 2125 -3.7528929000000e-06 2122 2125 -1.3898480000000e-02 2124 2125 -3.7164766000000e-06 2125 2125 1.0799500000000e+02 2127 2125 3.1337447000000e-04 2128 2125 -3.7552166000000e-04 2130 2125 -3.9191139000000e-06 2173 2125 -4.7921739000000e-03 2175 2125 -3.7167668000000e-06 3229 2125 -5.3004344000000e-02 3231 2125 -2.4821271000000e-05 1021 2126 4.0990778000000e-01 1023 2126 -3.6437176000000e+00 2077 2126 1.5360070000000e+00 2079 2126 -6.4709638000000e-01 2124 2126 -6.4700011000000e-01 2125 2126 -6.4988562000000e+01 2126 2126 -2.0569350000000e+01 2127 2126 1.0586380000000e+01 2128 2126 1.0571098000000e+00 2130 2126 -6.7798617000000e-01 2175 2126 -6.4705268000000e-01 3231 2126 -4.3212217000000e+00 1021 2127 6.9290745000000e-01 1022 2127 -1.1225128000000e-01 1023 2127 -6.1593344000000e+00 2077 2127 2.5964637000000e+00 2078 2127 -4.2062815000000e-01 2079 2127 -1.0938507000000e+00 2124 2127 -1.0936890000000e+00 2125 2127 -1.0985656000000e+02 2126 2127 1.6870519000000e+01 2127 2127 1.7895203000000e+01 2128 2127 1.7869368000000e+00 2129 2127 -2.8948447000000e-01 2130 2127 -1.1460667000000e+00 2175 2127 -1.0937772000000e+00 3231 2127 -7.3045892000000e+00 1024 2128 -1.8360530000000e-03 1026 2128 -1.9161880000000e-05 2080 2128 -3.8011205000000e-04 2082 2128 -3.9670213000000e-06 2125 2128 -4.1560972000000e-03 2127 2128 -3.9191139000000e-06 2128 2128 1.1876910000000e+02 2130 2128 3.2753322000000e-04 3232 2128 -5.2835255000000e-02 3234 2128 -2.2719784000000e-05 1024 2129 4.1682311000000e-01 1026 2129 -3.3137845000000e+00 2080 2129 2.1087471000000e+00 2082 2129 -6.7766514000000e-01 2127 2129 -6.7798617000000e-01 2128 2129 -7.0706098000000e+01 2129 2129 -2.2628834000000e+01 2130 2129 8.6024284000000e+00 3234 2129 -3.9304561000000e+00 1024 2130 7.0459778000000e-01 1025 2130 -1.1414460000000e-01 1026 2130 -5.6016213000000e+00 2080 2130 3.5646261000000e+00 2081 2130 -5.7746821000000e-01 2082 2130 -1.1455251000000e+00 2127 2130 -1.1460667000000e+00 2128 2130 -1.1952159000000e+02 2129 2130 1.8337250000000e+01 2130 2130 1.4541544000000e+01 3234 2130 -6.6440430000000e+00 2131 2131 1.0000000000000e+00 2132 2132 1.0000000000000e+00 2133 2133 1.0000000000000e+00 2134 2134 1.0000000000000e+00 2135 2135 1.0000000000000e+00 2136 2136 1.0000000000000e+00 2137 2137 1.0000000000000e+00 2138 2138 1.0000000000000e+00 2139 2139 1.0000000000000e+00 2140 2140 1.0000000000000e+00 2141 2141 1.0000000000000e+00 2142 2142 1.0000000000000e+00 2143 2143 1.0000000000000e+00 2144 2144 1.0000000000000e+00 2145 2145 1.0000000000000e+00 2146 2146 1.0000000000000e+00 2147 2147 1.0000000000000e+00 2148 2148 1.0000000000000e+00 2149 2149 1.0000000000000e+00 2150 2150 1.0000000000000e+00 2151 2151 1.0000000000000e+00 2152 2152 1.0000000000000e+00 2153 2153 1.0000000000000e+00 2154 2154 1.0000000000000e+00 2155 2155 1.0000000000000e+00 2156 2156 1.0000000000000e+00 2157 2157 1.0000000000000e+00 2158 2158 1.0000000000000e+00 2159 2159 1.0000000000000e+00 2160 2160 1.0000000000000e+00 2161 2161 1.0000000000000e+00 2162 2162 1.0000000000000e+00 2163 2163 1.0000000000000e+00 2164 2164 1.0000000000000e+00 2165 2165 1.0000000000000e+00 2166 2166 1.0000000000000e+00 2167 2167 1.0000000000000e+00 2168 2168 1.0000000000000e+00 2169 2169 1.0000000000000e+00 1066 2170 -1.9891465000000e-03 1068 2170 -2.0759632000000e-05 2122 2170 -3.5499566000000e-04 2124 2170 -3.7048953000000e-06 2170 2170 1.0798140000000e+02 2172 2170 3.0528560000000e-04 2173 2170 -3.5354396000000e-04 2175 2170 -3.6897447000000e-06 3274 2170 -5.3043057000000e-02 3276 2170 -2.4614233000000e-05 1066 2171 3.9883469000000e-01 1068 2171 -3.6426386000000e+00 2122 2171 7.6395676000000e-01 2124 2171 -6.4715796000000e-01 2170 2171 -6.3334227000000e+01 2171 2171 -2.0564573000000e+01 2172 2171 9.2594774000000e+00 2173 2171 1.7939655000000e-01 2175 2171 -6.4701297000000e-01 3276 2171 -4.3203650000000e+00 1066 2172 6.7419016000000e-01 1067 2172 -1.0921948000000e-01 1068 2172 -6.1575162000000e+00 2122 2172 1.2913925000000e+00 2123 2172 -2.0920688000000e-01 2124 2172 -1.0939558000000e+00 2170 2172 -1.0706018000000e+02 2171 2172 1.6429162000000e+01 2172 2172 1.5652221000000e+01 2173 2172 3.0325193000000e-01 2174 2172 -4.9127116000000e-02 2175 2172 -1.0937107000000e+00 3276 2172 -7.3031450000000e+00 1069 2173 -1.9913866000000e-03 1071 2173 -2.0783011000000e-05 2125 2173 -3.5613316000000e-04 2127 2173 -3.7167668000000e-06 2170 2173 -1.4356213000000e-02 2172 2173 -3.6897447000000e-06 2173 2173 1.0799313000000e+02 2175 2173 3.0534932000000e-04 3277 2173 -5.3060893000000e-02 3279 2173 -2.4644423000000e-05 1069 2174 3.9904024000000e-01 1071 2174 -3.6436564000000e+00 2125 2174 1.1204141000000e+00 2127 2174 -6.4705268000000e-01 2172 2174 -6.4701297000000e-01 2173 2174 -6.3508591000000e+01 2174 2174 -2.0566709000000e+01 2175 2174 9.2615989000000e+00 3279 2174 -4.3215731000000e+00 1069 2175 6.7453723000000e-01 1070 2175 -1.0927570000000e-01 1071 2175 -6.1592331000000e+00 2125 2175 1.8939468000000e+00 2126 2175 -3.0682126000000e-01 2127 2175 -1.0937772000000e+00 2172 2175 -1.0937107000000e+00 2173 2175 -1.0735486000000e+02 2174 2175 1.6471721000000e+01 2175 2175 1.5655799000000e+01 3279 2175 -7.3051832000000e+00 2176 2176 1.0000000000000e+00 2177 2177 1.0000000000000e+00 2178 2178 1.0000000000000e+00 2179 2179 1.0000000000000e+00 2180 2180 1.0000000000000e+00 2181 2181 1.0000000000000e+00 2182 2182 1.0000000000000e+00 2183 2183 1.0000000000000e+00 2184 2184 1.0000000000000e+00 2185 2185 1.0000000000000e+00 2186 2186 1.0000000000000e+00 2187 2187 1.0000000000000e+00 2188 2188 1.0000000000000e+00 2189 2189 1.0000000000000e+00 2190 2190 1.0000000000000e+00 2191 2191 1.0000000000000e+00 2192 2192 1.0000000000000e+00 2193 2193 1.0000000000000e+00 2194 2194 1.0000000000000e+00 2195 2195 1.0000000000000e+00 2196 2196 1.0000000000000e+00 2197 2197 1.0000000000000e+00 2198 2198 1.0000000000000e+00 2199 2199 1.0000000000000e+00 2200 2200 1.0000000000000e+00 2201 2201 1.0000000000000e+00 2202 2202 1.0000000000000e+00 2203 2203 1.0000000000000e+00 2204 2204 1.0000000000000e+00 2205 2205 1.0000000000000e+00 2206 2206 1.0000000000000e+00 2207 2207 1.0000000000000e+00 2208 2208 1.0000000000000e+00 2209 2209 1.0000000000000e+00 2210 2210 1.0000000000000e+00 2211 2211 1.0000000000000e+00 2212 2212 1.0000000000000e+00 2213 2213 1.0000000000000e+00 2214 2214 1.0000000000000e+00 2215 2215 1.0000000000000e+00 2216 2216 1.0000000000000e+00 2217 2217 1.0000000000000e+00 2218 2218 1.0000000000000e+00 2219 2219 1.0000000000000e+00 2220 2220 1.0000000000000e+00 2221 2221 1.0000000000000e+00 2222 2222 1.0000000000000e+00 2223 2223 1.0000000000000e+00 2224 2224 1.0000000000000e+00 2225 2225 1.0000000000000e+00 2226 2226 1.0000000000000e+00 2227 2227 1.0000000000000e+00 2228 2228 1.0000000000000e+00 2229 2229 1.0000000000000e+00 2230 2230 1.0000000000000e+00 2231 2231 1.0000000000000e+00 2232 2232 1.0000000000000e+00 2233 2233 1.0000000000000e+00 2234 2234 1.0000000000000e+00 2235 2235 1.0000000000000e+00 2236 2236 1.0000000000000e+00 2237 2237 1.0000000000000e+00 2238 2238 1.0000000000000e+00 2239 2239 1.0000000000000e+00 2240 2240 1.0000000000000e+00 2241 2241 1.0000000000000e+00 2242 2242 1.0000000000000e+00 2243 2243 1.0000000000000e+00 2244 2244 1.0000000000000e+00 2245 2245 1.0000000000000e+00 2246 2246 1.0000000000000e+00 2247 2247 1.0000000000000e+00 2248 2248 1.0000000000000e+00 2249 2249 1.0000000000000e+00 2250 2250 1.0000000000000e+00 2251 2251 1.0000000000000e+00 2252 2252 1.0000000000000e+00 2253 2253 1.0000000000000e+00 2254 2254 1.0000000000000e+00 2255 2255 1.0000000000000e+00 2256 2256 1.0000000000000e+00 2257 2257 1.0000000000000e+00 2258 2258 1.0000000000000e+00 2259 2259 1.0000000000000e+00 2260 2260 1.0000000000000e+00 2261 2261 1.0000000000000e+00 2262 2262 1.0000000000000e+00 2263 2263 1.0000000000000e+00 2264 2264 1.0000000000000e+00 2265 2265 1.0000000000000e+00 2266 2266 1.0000000000000e+00 2267 2267 1.0000000000000e+00 2268 2268 1.0000000000000e+00 2269 2269 1.0000000000000e+00 2270 2270 1.0000000000000e+00 2271 2271 1.0000000000000e+00 2272 2272 1.0000000000000e+00 2273 2273 1.0000000000000e+00 2274 2274 1.0000000000000e+00 2275 2275 1.0000000000000e+00 2276 2276 1.0000000000000e+00 2277 2277 1.0000000000000e+00 2278 2278 1.0000000000000e+00 2279 2279 1.0000000000000e+00 2280 2280 1.0000000000000e+00 2281 2281 1.0000000000000e+00 2282 2282 1.0000000000000e+00 2283 2283 1.0000000000000e+00 2284 2284 1.0000000000000e+00 2285 2285 1.0000000000000e+00 2286 2286 1.0000000000000e+00 2287 2287 1.0000000000000e+00 2288 2288 1.0000000000000e+00 2289 2289 1.0000000000000e+00 2290 2290 1.0000000000000e+00 2291 2291 1.0000000000000e+00 2292 2292 1.0000000000000e+00 2293 2293 1.0000000000000e+00 2294 2294 1.0000000000000e+00 2295 2295 1.0000000000000e+00 2296 2296 1.0000000000000e+00 2297 2297 1.0000000000000e+00 2298 2298 1.0000000000000e+00 2299 2299 1.0000000000000e+00 2300 2300 1.0000000000000e+00 2301 2301 1.0000000000000e+00 2302 2302 1.0000000000000e+00 2303 2303 1.0000000000000e+00 2304 2304 1.0000000000000e+00 2305 2305 1.0000000000000e+00 2306 2306 1.0000000000000e+00 2307 2307 1.0000000000000e+00 2308 2308 1.0000000000000e+00 2309 2309 1.0000000000000e+00 2310 2310 1.0000000000000e+00 2311 2311 1.0000000000000e+00 2312 2312 1.0000000000000e+00 2313 2313 1.0000000000000e+00 2314 2314 1.0000000000000e+00 2315 2315 1.0000000000000e+00 2316 2316 1.0000000000000e+00 2317 2317 1.0000000000000e+00 2318 2318 1.0000000000000e+00 2319 2319 1.0000000000000e+00 2320 2320 1.0000000000000e+00 2321 2321 1.0000000000000e+00 2322 2322 1.0000000000000e+00 2323 2323 1.0000000000000e+00 2324 2324 1.0000000000000e+00 2325 2325 1.0000000000000e+00 2326 2326 1.0000000000000e+00 2327 2327 1.0000000000000e+00 2328 2328 1.0000000000000e+00 2329 2329 1.0000000000000e+00 2330 2330 1.0000000000000e+00 2331 2331 1.0000000000000e+00 2332 2332 1.0000000000000e+00 2333 2333 1.0000000000000e+00 2334 2334 1.0000000000000e+00 2335 2335 1.0000000000000e+00 2336 2336 1.0000000000000e+00 2337 2337 1.0000000000000e+00 2338 2338 1.0000000000000e+00 2339 2339 1.0000000000000e+00 2340 2340 1.0000000000000e+00 2341 2341 1.0000000000000e+00 2342 2342 1.0000000000000e+00 2343 2343 1.0000000000000e+00 1240 2344 -2.5971423000000e+00 1242 2344 -1.7988385000000e-01 2344 2344 2.0608732000000e+02 2346 2344 4.2725065000000e-01 2347 2344 -4.3744598000000e-01 2349 2344 -8.1460968000000e-02 2392 2344 -4.1557028000000e+00 2394 2344 -8.6020643000000e-02 1240 2345 6.7813736000000e+00 1242 2345 -9.0410623000000e-01 2344 2345 -1.3475629000000e+02 2345 2345 -2.7720556000000e+01 2346 2345 1.7489967000000e+00 2347 2345 4.4770925000000e-01 2349 2345 -4.0941591000000e-01 2392 2345 1.3190091000000e+01 2394 2345 -4.3240035000000e-01 1240 2346 1.1463234000000e+01 1241 2346 -1.0989584000000e+00 1242 2346 -1.5283012000000e+00 2344 2346 -2.2779204000000e+02 2345 2346 2.5292823000000e+01 2346 2346 2.9565041000000e+00 2347 2346 7.5680772000000e-01 2348 2346 -7.2553717000000e-02 2349 2346 -6.9207666000000e-01 2392 2346 2.2296530000000e+01 2393 2346 -2.1375259000000e+00 2394 2346 -7.3092956000000e-01 1243 2347 -1.5646243000000e+00 1245 2347 -9.5840005000000e-02 2344 2347 -5.9736957000000e-01 2346 2347 -8.1460968000000e-02 2347 2347 1.9213530000000e+02 2349 2347 3.3537638000000e-01 2350 2347 -2.9022544000000e-01 2352 2347 -3.8350367000000e-02 2395 2347 -2.4885005000000e+00 2397 2347 -4.0056499000000e-02 1243 2348 5.7342234000000e+00 1245 2348 -1.3780428000000e+00 2346 2348 -4.0941591000000e-01 2347 2348 -1.2662709000000e+02 2348 2348 -2.8872728000000e+01 2349 2348 2.9181068000000e+00 2350 2348 2.5214740000000e-01 2352 2348 -5.5141574000000e-01 2395 2348 1.3032447000000e+01 2397 2348 -5.7602974000000e-01 1243 2349 9.6931234000000e+00 1244 2349 -1.0942175000000e+00 1245 2349 -2.3294416000000e+00 2346 2349 -6.9207666000000e-01 2347 2349 -2.1405027000000e+02 2348 2349 2.6519672000000e+01 2349 2349 4.9327643000000e+00 2350 2349 4.2622967000000e-01 2351 2349 -4.8115337000000e-02 2352 2349 -9.3211241000000e-01 2395 2349 2.2030033000000e+01 2396 2349 -2.4868810000000e+00 2397 2349 -9.7371988000000e-01 1246 2350 -9.9109871000000e-01 1248 2350 -4.8389152000000e-02 2347 2350 -4.3030649000000e-01 2349 2350 -3.8350367000000e-02 2350 2350 1.7850343000000e+02 2352 2350 1.8406498000000e-01 2398 2350 -1.5899806000000e+00 2400 2350 -1.7817074000000e-02 1246 2351 4.9601271000000e+00 1248 2351 -1.8565169000000e+00 2349 2351 -5.5141574000000e-01 2350 2351 -1.1776387000000e+02 2351 2351 -2.9017221000000e+01 2352 2351 3.0948062000000e+00 2398 2351 1.1924609000000e+01 2400 2351 -6.8365407000000e-01 1246 2352 8.3845988000000e+00 1247 2352 -1.0812350000000e+00 1248 2352 -3.1382562000000e+00 2349 2352 -9.3211241000000e-01 2350 2352 -1.9906804000000e+02 2351 2352 2.6676978000000e+01 2352 2352 5.2314596000000e+00 2398 2352 2.0157360000000e+01 2399 2352 -2.5993900000000e+00 2400 2352 -1.1556488000000e+00 2353 2353 1.0000000000000e+00 2354 2354 1.0000000000000e+00 2355 2355 1.0000000000000e+00 2356 2356 1.0000000000000e+00 2357 2357 1.0000000000000e+00 2358 2358 1.0000000000000e+00 2359 2359 1.0000000000000e+00 2360 2360 1.0000000000000e+00 2361 2361 1.0000000000000e+00 2362 2362 1.0000000000000e+00 2363 2363 1.0000000000000e+00 2364 2364 1.0000000000000e+00 2365 2365 1.0000000000000e+00 2366 2366 1.0000000000000e+00 2367 2367 1.0000000000000e+00 1264 2368 -1.0598457000000e+00 1266 2368 -5.6946019000000e-02 2368 2368 2.9681124000000e+02 2370 2368 1.9437580000000e-01 2416 2368 -3.2797939000000e+00 2418 2368 -5.7327535000000e-02 1264 2369 4.3202257000000e+00 1266 2369 -9.0660211000000e-01 2368 2369 -1.8942500000000e+02 2369 2369 -4.5507683000000e+01 2370 2369 1.8244089000000e+00 2416 2369 1.6991600000000e+01 2418 2369 -9.1275390000000e-01 1264 2370 7.3029095000000e+00 1265 2370 -8.4853454000000e-01 1266 2370 -1.5325202000000e+00 2368 2370 -3.2020402000000e+02 2369 2370 4.0208884000000e+01 2370 2370 3.0839808000000e+00 2416 2370 2.8722601000000e+01 2417 2370 -3.3373163000000e+00 2418 2370 -1.5429192000000e+00 2371 2371 1.0000000000000e+00 2372 2372 1.0000000000000e+00 2373 2373 1.0000000000000e+00 2374 2374 1.0000000000000e+00 2375 2375 1.0000000000000e+00 2376 2376 1.0000000000000e+00 2377 2377 1.0000000000000e+00 2378 2378 1.0000000000000e+00 2379 2379 1.0000000000000e+00 2380 2380 1.0000000000000e+00 2381 2381 1.0000000000000e+00 2382 2382 1.0000000000000e+00 1279 2383 -1.6396503000000e+00 1281 2383 -1.0601787000000e-01 2383 2383 2.7574247000000e+02 2385 2383 3.6499262000000e-01 2386 2383 -6.1507789000000e-01 2388 2383 -8.6551270000000e-02 2431 2383 -4.4085565000000e+00 2433 2383 -9.2258094000000e-02 1279 2384 5.0504538000000e+00 1281 2384 -7.6576743000000e-01 2383 2384 -1.7744806000000e+02 2384 2384 -3.8965438000000e+01 2385 2384 2.0616847000000e+00 2386 2384 9.0536898000000e-01 2388 2384 -6.2514227000000e-01 2431 2384 1.6821468000000e+01 2433 2384 -6.6644976000000e-01 1279 2385 8.5372823000000e+00 1280 2385 -8.6332697000000e-01 1281 2385 -1.2944525000000e+00 2383 2385 -2.9995803000000e+02 2384 2385 3.4751750000000e+01 2385 2385 3.4850699000000e+00 2386 2385 1.5304349000000e+00 2387 2385 -1.5476419000000e-01 2388 2385 -1.0567399000000e+00 2431 2385 2.8434994000000e+01 2432 2385 -2.8754695000000e+00 2433 2385 -1.1265661000000e+00 1282 2386 -9.3051390000000e-01 1284 2386 -5.0587676000000e-02 2383 2386 -7.8096942000000e-01 2385 2386 -8.6551270000000e-02 2386 2386 2.5031789000000e+02 2388 2386 2.8883617000000e-01 2389 2386 -3.2579693000000e-01 2391 2386 -3.4705689000000e-02 2434 2386 -2.6040483000000e+00 2436 2386 -3.7153598000000e-02 1282 2387 4.0955182000000e+00 1284 2387 -1.1961635000000e+00 2385 2387 -6.2514227000000e-01 2386 2387 -1.6186823000000e+02 2387 2387 -3.9385424000000e+01 2388 2387 3.5248979000000e+00 2389 2387 3.9373351000000e-01 2391 2387 -8.2061419000000e-01 2434 2387 1.6163394000000e+01 2436 2387 -8.7860497000000e-01 1282 2388 6.9230640000000e+00 1283 2388 -8.4521630000000e-01 1284 2388 -2.0219947000000e+00 2385 2388 -1.0567399000000e+00 2386 2388 -2.7362206000000e+02 2387 2388 3.5440174000000e+01 2388 2388 5.9584868000000e+00 2389 2388 6.6556713000000e-01 2390 2388 -8.1257112000000e-02 2391 2388 -1.3871662000000e+00 2434 2388 2.7322602000000e+01 2435 2388 -3.3357352000000e+00 2436 2388 -1.4851938000000e+00 1285 2389 -8.4718938000000e-01 1287 2389 -2.5902910000000e-02 2386 2389 -5.5655431000000e-01 2388 2389 -3.4705689000000e-02 2389 2389 2.3133653000000e+02 2391 2389 1.7179654000000e-01 2392 2389 -2.9991573000000e-01 2394 2389 -1.5280895000000e-02 2437 2389 -1.5088876000000e+00 2439 2389 -1.6257926000000e-02 1285 2390 4.2913868000000e+00 1287 2390 -1.5525563000000e+00 2388 2390 -8.2061419000000e-01 2389 2390 -1.5005877000000e+02 2390 2390 -3.8687284000000e+01 2391 2390 4.2679152000000e+00 2392 2390 1.5790958000000e-01 2394 2390 -9.1589138000000e-01 2437 2390 1.4485912000000e+01 2439 2390 -9.7455670000000e-01 1285 2391 7.2541553000000e+00 1286 2391 -9.5604276000000e-01 1287 2391 -2.6244395000000e+00 2388 2391 -1.3871662000000e+00 2389 2391 -2.5365918000000e+02 2390 2391 3.4830996000000e+01 2391 2391 7.2144801000000e+00 2392 2391 2.6693018000000e-01 2393 2391 -3.5179377000000e-02 2394 2391 -1.5482218000000e+00 2437 2391 2.4486970000000e+01 2438 2391 -3.2271970000000e+00 2439 2391 -1.6473896000000e+00 1288 2392 -4.4712793000000e-01 1290 2392 -1.0826631000000e-02 2344 2392 -2.9355577000000e+00 2346 2392 -8.6020643000000e-02 2389 2392 -5.2147888000000e-01 2391 2392 -1.5280895000000e-02 2392 2392 2.1531326000000e+02 2394 2392 1.2170622000000e-01 2395 2392 -1.0698811000000e-01 2397 2392 -3.1350724000000e-03 2440 2392 -7.3065393000000e-01 2442 2392 -5.8063662000000e-03 1288 2393 1.7302139000000e+00 1290 2393 -1.9560092000000e+00 2346 2393 -4.3240035000000e-01 2391 2393 -9.1589138000000e-01 2392 2393 -1.3496158000000e+02 2393 2393 -3.7418826000000e+01 2394 2393 5.3905033000000e+00 2397 2393 -1.0329256000000e+00 2440 2393 1.2199921000000e+01 2442 2393 -1.0491197000000e+00 1288 2394 2.9247536000000e+00 1289 2394 -4.1335937000000e-01 1290 2394 -3.3064380000000e+00 2346 2394 -7.3092956000000e-01 2391 2394 -1.5482218000000e+00 2392 2394 -2.2813906000000e+02 2393 2394 3.2922321000000e+01 2394 2394 9.1121048000000e+00 2397 2394 -1.7460565000000e+00 2440 2394 2.0622746000000e+01 2441 2394 -2.9146405000000e+00 2442 2394 -1.7734320000000e+00 1291 2395 -2.9366187000000e-01 1293 2395 -6.8230113000000e-03 2347 2395 -1.3669761000000e+00 2349 2395 -4.0056499000000e-02 2392 2395 -1.8661935000000e-01 2394 2395 -3.1350724000000e-03 2395 2395 1.9551180000000e+02 2397 2395 5.6089800000000e-02 2398 2395 -8.3317449000000e-02 2400 2395 -2.4414511000000e-03 2443 2395 -5.5883715000000e-01 2445 2395 -3.0823466000000e-03 1291 2396 1.3289956000000e+00 1293 2396 -2.2480915000000e+00 2349 2396 -5.7602974000000e-01 2392 2396 1.8415965000000e+00 2394 2396 -1.0329256000000e+00 2395 2396 -1.2451462000000e+02 2396 2396 -3.4875408000000e+01 2397 2396 5.8534598000000e+00 2400 2396 -9.7684548000000e-01 2443 2396 1.0400277000000e+01 2445 2396 -1.0156925000000e+00 1291 2397 2.2465328000000e+00 1292 2397 -3.3455223000000e-01 1293 2397 -3.8001718000000e+00 2349 2397 -9.7371988000000e-01 2392 2397 3.1130329000000e+00 2393 2397 -4.6359086000000e-01 2394 2397 -1.7460565000000e+00 2395 2397 -2.1047939000000e+02 2396 2397 3.0994421000000e+01 2397 2397 9.8946836000000e+00 2400 2397 -1.6512596000000e+00 2443 2397 1.7580618000000e+01 2444 2397 -2.6180942000000e+00 2445 2397 -1.7169257000000e+00 1294 2398 -3.8461282000000e-01 1296 2398 -6.1008077000000e-03 2350 2398 -1.0074344000000e+00 2352 2398 -1.7817074000000e-02 2395 2398 -1.8152092000000e-01 2397 2398 -2.4414511000000e-03 2398 2398 1.8327200000000e+02 2400 2398 2.9297710000000e-02 2446 2398 -3.7470591000000e-01 2448 2398 -2.4309867000000e-03 1294 2399 1.4905014000000e+00 1296 2399 -2.4410548000000e+00 2352 2399 -6.8365407000000e-01 2395 2399 1.6902004000000e+00 2397 2399 -9.7684548000000e-01 2398 2399 -1.1646374000000e+02 2399 2399 -3.2951383000000e+01 2400 2399 5.0780055000000e+00 2446 2399 9.0636068000000e+00 2448 2399 -9.7278993000000e-01 1294 2400 2.5195436000000e+00 1295 2400 -3.6847132000000e-01 1296 2400 -4.1263590000000e+00 2352 2400 -1.1556488000000e+00 2395 2400 2.8571148000000e+00 2396 2400 -4.1783950000000e-01 2397 2400 -1.6512596000000e+00 2398 2400 -1.9687031000000e+02 2399 2400 2.9082529000000e+01 2400 2400 8.5838604000000e+00 2446 2400 1.5321121000000e+01 2447 2400 -2.2406414000000e+00 2448 2400 -1.6444041000000e+00 2401 2401 1.0000000000000e+00 2402 2402 1.0000000000000e+00 2403 2403 1.0000000000000e+00 2404 2404 1.0000000000000e+00 2405 2405 1.0000000000000e+00 2406 2406 1.0000000000000e+00 2407 2407 1.0000000000000e+00 2408 2408 1.0000000000000e+00 2409 2409 1.0000000000000e+00 2410 2410 1.0000000000000e+00 2411 2411 1.0000000000000e+00 2412 2412 1.0000000000000e+00 2413 2413 1.0000000000000e+00 2414 2414 1.0000000000000e+00 2415 2415 1.0000000000000e+00 1312 2416 -3.0967807000000e-01 1314 2416 -6.8032816000000e-03 2368 2416 -1.9563709000000e+00 2370 2416 -5.7327535000000e-02 2416 2416 2.9596269000000e+02 2418 2416 8.1607565000000e-02 2419 2416 -3.3311843000000e-01 2421 2416 -9.7613690000000e-03 2464 2416 -9.1982911000000e-01 2466 2416 -6.8459793000000e-03 1312 2417 1.7834780000000e+00 1314 2417 -1.4328639000000e+00 2370 2417 -9.1275390000000e-01 2416 2417 -1.8566944000000e+02 2417 2417 -5.2249143000000e+01 2418 2417 5.1741385000000e+00 2421 2417 -1.3807167000000e+00 2464 2417 1.5807417000000e+01 2466 2417 -1.4419946000000e+00 1312 2418 3.0147912000000e+00 1313 2418 -4.3302307000000e-01 1314 2418 -2.4221131000000e+00 2370 2418 -1.5429192000000e+00 2416 2418 -3.1385562000000e+02 2417 2418 4.5541410000000e+01 2418 2418 8.7463620000000e+00 2421 2418 -2.3339618000000e+00 2464 2418 2.6720858000000e+01 2465 2418 -3.8379931000000e+00 2466 2418 -2.4375476000000e+00 1315 2419 -4.7974428000000e-01 1317 2419 -9.6598344000000e-03 2416 2419 -3.4809373000000e-01 2418 2419 -9.7613690000000e-03 2419 2419 2.9481710000000e+02 2421 2419 1.1867912000000e-01 2422 2419 -2.3723633000000e-01 2424 2419 -9.7613843000000e-03 2467 2419 -1.3068024000000e+00 2469 2419 -9.7302577000000e-03 1315 2420 2.8271925000000e+00 1317 2420 -1.3664069000000e+00 2416 2420 6.3114563000000e-01 2418 2420 -1.3807167000000e+00 2419 2420 -1.8761480000000e+02 2420 2420 -5.1494702000000e+01 2421 2420 5.4655191000000e+00 2424 2420 -1.3361793000000e+00 2467 2420 1.6075890000000e+01 2469 2420 -1.3764911000000e+00 1315 2421 4.7790828000000e+00 1316 2421 -6.8126319000000e-01 1317 2421 -2.3097726000000e+00 2416 2421 1.0668878000000e+00 2417 2421 -1.5208596000000e-01 2418 2421 -2.3339618000000e+00 2419 2421 -3.1714383000000e+02 2420 2421 4.5386677000000e+01 2421 2421 9.2389084000000e+00 2424 2421 -2.2586774000000e+00 2467 2421 2.7174665000000e+01 2468 2421 -3.8737766000000e+00 2469 2421 -2.3268189000000e+00 1318 2422 -5.3440022000000e-01 1320 2422 -1.2395542000000e-02 2419 2422 -2.2070197000000e-01 2421 2422 -9.7613843000000e-03 2422 2422 2.9491118000000e+02 2424 2422 1.2905618000000e-01 2425 2422 -3.3024883000000e-01 2427 2422 -1.4606511000000e-02 2470 2422 -1.3780511000000e+00 2472 2422 -1.2496808000000e-02 1318 2423 3.2197658000000e+00 1320 2423 -1.3213394000000e+00 2419 2423 2.3582194000000e-01 2421 2423 -1.3361793000000e+00 2422 2423 -1.8821336000000e+02 2423 2423 -5.0966088000000e+01 2424 2423 5.2984249000000e+00 2427 2423 -1.3029946000000e+00 2470 2423 1.6674148000000e+01 2472 2423 -1.3322460000000e+00 1318 2424 5.4426922000000e+00 1319 2424 -7.5084820000000e-01 1320 2424 -2.2335922000000e+00 2419 2424 3.9863340000000e-01 2420 2424 -5.4993585000000e-02 2421 2424 -2.2586774000000e+00 2422 2424 -3.1815586000000e+02 2423 2424 4.4963881000000e+01 2424 2424 8.9564554000000e+00 2427 2424 -2.2025800000000e+00 2470 2424 2.8185979000000e+01 2471 2424 -3.8884051000000e+00 2472 2424 -2.2520286000000e+00 1321 2425 -5.8237589000000e-01 1323 2425 -1.4442702000000e-02 2422 2425 -3.4512318000000e-01 2424 2425 -1.4606511000000e-02 2425 2425 2.9515983000000e+02 2427 2425 1.3803140000000e-01 2428 2425 -3.3017192000000e-01 2430 2425 -1.4603109000000e-02 2473 2425 -1.4531784000000e+00 2475 2425 -1.4561047000000e-02 1321 2426 3.2091214000000e+00 1323 2426 -1.2884342000000e+00 2422 2426 2.4120100000000e-01 2424 2426 -1.3029946000000e+00 2425 2426 -1.8867034000000e+02 2426 2426 -5.0571975000000e+01 2427 2426 5.1990686000000e+00 2430 2426 -1.3029156000000e+00 2473 2426 1.7134703000000e+01 2475 2426 -1.2991028000000e+00 1321 2427 5.4246936000000e+00 1322 2427 -7.2975635000000e-01 1323 2427 -2.1779671000000e+00 2422 2427 4.0772578000000e-01 2423 2427 -5.4849268000000e-02 2424 2427 -2.2025800000000e+00 2425 2427 -3.1892805000000e+02 2426 2427 4.4643506000000e+01 2427 2427 8.7884993000000e+00 2430 2427 -2.2024485000000e+00 2473 2427 2.8964476000000e+01 2474 2427 -3.8964426000000e+00 2475 2427 -2.1960012000000e+00 1324 2428 -5.4870071000000e-01 1326 2428 -1.4434007000000e-02 2425 2428 -3.4452271000000e-01 2427 2428 -1.4603109000000e-02 2428 2428 2.9519042000000e+02 2430 2428 1.3772053000000e-01 2431 2428 -3.9655657000000e-01 2433 2428 -1.4302015000000e-02 2476 2428 -1.4513846000000e+00 2478 2428 -1.4563380000000e-02 1324 2429 2.6632591000000e+00 1326 2429 -1.2878855000000e+00 2425 2429 2.3108844000000e-01 2427 2429 -1.3029156000000e+00 2428 2429 -1.8840910000000e+02 2429 2429 -5.0572276000000e+01 2430 2429 5.1720305000000e+00 2431 2429 3.2512559000000e-01 2433 2429 -1.2760733000000e+00 2476 2429 1.7104165000000e+01 2478 2429 -1.2995346000000e+00 1324 2430 4.5019731000000e+00 1325 2430 -6.0564353000000e-01 1326 2430 -2.1770417000000e+00 2425 2430 3.9063189000000e-01 2426 2430 -5.2551108000000e-02 2427 2430 -2.2024485000000e+00 2428 2430 -3.1848675000000e+02 2429 2430 4.4584784000000e+01 2430 2430 8.7428003000000e+00 2431 2430 5.4959229000000e-01 2432 2430 -7.3935807000000e-02 2433 2430 -2.1570743000000e+00 2476 2430 2.8912880000000e+01 2477 2430 -3.8896053000000e+00 2478 2430 -2.1967333000000e+00 1327 2431 -3.4095124000000e-01 1329 2431 -8.2969956000000e-03 2383 2431 -3.1484183000000e+00 2385 2431 -9.2258094000000e-02 2428 2431 -4.8807342000000e-01 2430 2431 -1.4302015000000e-02 2431 2431 2.8583675000000e+02 2433 2431 1.2751677000000e-01 2434 2431 -1.3435734000000e-01 2436 2431 -3.9370728000000e-03 2479 2431 -9.7714131000000e-01 2481 2431 -7.8713173000000e-03 1327 2432 1.2994774000000e+00 1329 2432 -1.4623719000000e+00 2385 2432 -6.6644976000000e-01 2430 2432 -1.2760733000000e+00 2431 2432 -1.7893272000000e+02 2432 2432 -4.9860319000000e+01 2433 2432 6.2021635000000e+00 2436 2432 -1.4042632000000e+00 2479 2432 1.6275427000000e+01 2481 2432 -1.3874621000000e+00 1327 2433 2.1966357000000e+00 1328 2433 -3.0957355000000e-01 1329 2433 -2.4719924000000e+00 2385 2433 -1.1265661000000e+00 2430 2433 -2.1570743000000e+00 2431 2433 -3.0246773000000e+02 2432 2433 4.3576472000000e+01 2433 2433 1.0484134000000e+01 2436 2433 -2.3737664000000e+00 2479 2433 2.7511970000000e+01 2480 2433 -3.8772832000000e+00 2481 2433 -2.3453649000000e+00 1330 2434 -2.9504895000000e-01 1332 2434 -4.6541406000000e-03 2386 2434 -2.1007833000000e+00 2388 2434 -3.7153598000000e-02 2431 2434 -2.6304068000000e-01 2433 2434 -3.9370728000000e-03 2434 2434 2.6662637000000e+02 2436 2434 5.2795262000000e-02 2437 2434 -1.3656872000000e-01 2439 2434 -2.4152988000000e-03 2482 2434 -6.3341179000000e-01 2484 2434 -3.8897599000000e-03 1330 2435 1.1842029000000e+00 1332 2435 -1.6601180000000e+00 2388 2435 -8.7860497000000e-01 2431 2435 1.5518434000000e+00 2433 2435 -1.4042632000000e+00 2434 2435 -1.6978536000000e+02 2435 2435 -4.7687417000000e+01 2436 2435 6.6794454000000e+00 2439 2435 -1.3435779000000e+00 2482 2435 1.5780879000000e+01 2484 2435 -1.3875787000000e+00 1330 2436 2.0017766000000e+00 1331 2436 -2.8967534000000e-01 1332 2436 -2.8062634000000e+00 2388 2436 -1.4851938000000e+00 2431 2436 2.6232360000000e+00 2432 2436 -3.7960619000000e-01 2433 2436 -2.3737664000000e+00 2434 2436 -2.8700517000000e+02 2435 2436 4.2190864000000e+01 2436 2436 1.1290933000000e+01 2439 2436 -2.2711827000000e+00 2482 2436 2.6675998000000e+01 2483 2436 -3.8602604000000e+00 2484 2436 -2.3455630000000e+00 1333 2437 -2.2019369000000e-01 1335 2437 -3.3956081000000e-03 2389 2437 -9.1927516000000e-01 2391 2437 -1.6257926000000e-02 2434 2437 -1.8953279000000e-01 2436 2437 -2.4152988000000e-03 2437 2437 2.4169261000000e+02 2439 2437 2.6043391000000e-02 2440 2437 -5.3069369000000e-02 2442 2437 -9.3856322000000e-04 2485 2437 -5.1077148000000e-01 2487 2437 -2.3842212000000e-03 1333 2438 1.1119848000000e+00 1335 2438 -1.8889917000000e+00 2391 2438 -9.7455670000000e-01 2434 2438 2.0469679000000e+00 2436 2438 -1.3435779000000e+00 2437 2438 -1.5535403000000e+02 2438 2438 -4.3939068000000e+01 2439 2438 6.8279238000000e+00 2442 2438 -1.2894421000000e+00 2485 2438 1.4375670000000e+01 2487 2438 -1.3264689000000e+00 1333 2439 1.8796978000000e+00 1334 2439 -2.8178126000000e-01 1335 2439 -3.1931494000000e+00 2391 2439 -1.6473896000000e+00 2434 2439 3.4601925000000e+00 2435 2439 -5.1870963000000e-01 2436 2439 -2.2711827000000e+00 2437 2439 -2.6261028000000e+02 2438 2439 3.9136646000000e+01 2439 2439 1.1541916000000e+01 2442 2439 -2.1796728000000e+00 2485 2439 2.4300617000000e+01 2486 2439 -3.6428508000000e+00 2487 2439 -2.2422615000000e+00 1336 2440 -1.5634686000000e-01 1338 2440 -1.5465596000000e-03 2392 2440 -5.5635440000000e-01 2394 2440 -5.8063662000000e-03 2437 2440 -1.1556991000000e-01 2439 2440 -9.3856322000000e-04 2440 2440 2.2336393000000e+02 2442 2440 1.0440761000000e-02 2443 2440 -6.2428621000000e-02 2445 2440 -6.5153333000000e-04 2488 2440 -2.2303952000000e-01 2490 2440 -9.2559310000000e-04 1336 2441 7.9859598000000e-01 1338 2441 -2.1248446000000e+00 2394 2441 -1.0491197000000e+00 2437 2441 2.4947264000000e+00 2439 2441 -1.2894421000000e+00 2440 2441 -1.4421959000000e+02 2441 2441 -4.1297090000000e+01 2442 2441 6.9523798000000e+00 2445 2441 -1.2125901000000e+00 2488 2441 1.3195320000000e+01 2490 2441 -1.2717896000000e+00 1336 2442 1.3499466000000e+00 1337 2442 -2.0421983000000e-01 1338 2442 -3.5918374000000e+00 2394 2442 -1.7734320000000e+00 2437 2442 4.2170855000000e+00 2438 2442 -6.3796040000000e-01 2439 2442 -2.1796728000000e+00 2440 2442 -2.4378879000000e+02 2441 2442 3.6812861000000e+01 2442 2442 1.1752301000000e+01 2445 2442 -2.0497609000000e+00 2488 2442 2.2305368000000e+01 2489 2442 -3.3743546000000e+00 2490 2442 -2.1498331000000e+00 1339 2443 -1.2770622000000e-01 1341 2443 -1.2616964000000e-03 2395 2443 -2.9534429000000e-01 2397 2443 -3.0823466000000e-03 2440 2443 -9.3203764000000e-02 2442 2443 -6.5153333000000e-04 2443 2443 2.0543003000000e+02 2445 2443 6.5246799000000e-03 2446 2443 -3.5684063000000e-02 2448 2443 -3.7241503000000e-04 2491 2443 -1.7500042000000e-01 2493 2443 -6.4179336000000e-04 1339 2444 6.7186696000000e-01 1341 2444 -2.3482642000000e+00 2397 2444 -1.0156925000000e+00 2440 2444 3.0248844000000e+00 2442 2444 -1.2125901000000e+00 2443 2444 -1.3262705000000e+02 2444 2444 -3.8253343000000e+01 2445 2444 6.9288974000000e+00 2448 2444 -1.1534979000000e+00 2491 2444 1.1284571000000e+01 2493 2444 -1.1945971000000e+00 1339 2445 1.1357231000000e+00 1340 2445 -1.7486584000000e-01 1341 2445 -3.9695031000000e+00 2397 2445 -1.7169257000000e+00 2440 2445 5.1132610000000e+00 2441 2445 -7.8728226000000e-01 2442 2445 -2.0497609000000e+00 2443 2445 -2.2419261000000e+02 2444 2445 3.4089825000000e+01 2445 2445 1.1712602000000e+01 2448 2445 -1.9498729000000e+00 2491 2445 1.9075426000000e+01 2492 2445 -2.9370187000000e+00 2493 2445 -2.0193456000000e+00 1342 2446 -8.5011201000000e-02 1344 2446 -8.2063256000000e-04 2398 2446 -2.3293228000000e-01 2400 2446 -2.4309867000000e-03 2443 2446 -6.6743872000000e-02 2445 2446 -3.7241503000000e-04 2446 2446 1.9346372000000e+02 2448 2446 4.4624599000000e-03 2494 2446 -7.4440291000000e-02 2496 2446 -3.6626510000000e-04 1342 2447 6.2918306000000e-01 1344 2447 -2.5418704000000e+00 2400 2447 -9.7278993000000e-01 2443 2447 3.0489591000000e+00 2445 2447 -1.1534979000000e+00 2446 2447 -1.2100872000000e+02 2447 2447 -3.6306218000000e+01 2448 2447 5.8067595000000e+00 2494 2447 6.4090076000000e+00 2496 2447 -1.1345621000000e+00 1342 2448 1.0635711000000e+00 1343 2448 -1.6709874000000e-01 1344 2448 -4.2967777000000e+00 2400 2448 -1.6444041000000e+00 2443 2448 5.1539605000000e+00 2444 2448 -8.0974397000000e-01 2445 2448 -1.9498729000000e+00 2446 2448 -2.0455313000000e+02 2447 2448 3.1328710000000e+01 2448 2448 9.8157463000000e+00 2494 2448 1.0833787000000e+01 2495 2448 -1.7021073000000e+00 2496 2448 -1.9178638000000e+00 2449 2449 1.0000000000000e+00 2450 2450 1.0000000000000e+00 2451 2451 1.0000000000000e+00 2452 2452 1.0000000000000e+00 2453 2453 1.0000000000000e+00 2454 2454 1.0000000000000e+00 2455 2455 1.0000000000000e+00 2456 2456 1.0000000000000e+00 2457 2457 1.0000000000000e+00 2458 2458 1.0000000000000e+00 2459 2459 1.0000000000000e+00 2460 2460 1.0000000000000e+00 2461 2461 1.0000000000000e+00 2462 2462 1.0000000000000e+00 2463 2463 1.0000000000000e+00 1360 2464 -9.8766101000000e-02 1362 2464 -9.2950667000000e-04 2416 2464 -6.5596805000000e-01 2418 2464 -6.8459793000000e-03 2464 2464 2.9352001000000e+02 2466 2464 1.0396617000000e-02 2467 2464 -9.3000819000000e-02 2469 2464 -9.4227837000000e-04 2512 2464 -2.5620509000000e-01 2514 2464 -9.4049579000000e-04 1360 2465 9.5313717000000e-01 1362 2465 -1.6372305000000e+00 2418 2465 -1.4419946000000e+00 2464 2465 -1.8558381000000e+02 2465 2465 -5.0099419000000e+01 2466 2465 6.4016278000000e+00 2467 2465 2.7167489000000e-01 2469 2465 -1.6596434000000e+00 2512 2465 1.6314945000000e+01 2514 2465 -1.6566787000000e+00 1360 2466 1.6111831000000e+00 1361 2466 -2.4736688000000e-01 1362 2466 -2.7675744000000e+00 2418 2466 -2.4375476000000e+00 2464 2466 -3.1371087000000e+02 2465 2466 5.5228420000000e+01 2466 2466 1.0821312000000e+01 2467 2466 4.5923923000000e-01 2468 2466 -7.0507554000000e-02 2469 2466 -2.8054613000000e+00 2512 2466 2.7578783000000e+01 2513 2466 -4.2342038000000e+00 2514 2466 -2.8004497000000e+00 1363 2467 -1.1706066000000e-01 1365 2467 -1.1066138000000e-03 2419 2467 -9.3233383000000e-01 2421 2467 -9.7302577000000e-03 2464 2467 -9.0287229000000e-02 2466 2467 -9.4227837000000e-04 2467 2467 2.9394698000000e+02 2469 2467 1.4768954000000e-02 2470 2467 -1.1206181000000e-01 2472 2467 -1.1217214000000e-03 2515 2467 -2.7705098000000e-01 2517 2467 -1.1192633000000e-03 1363 2468 1.0766425000000e+00 1365 2468 -1.6200209000000e+00 2421 2468 -1.3764911000000e+00 2466 2468 -1.6596434000000e+00 2467 2468 -1.8620080000000e+02 2468 2468 -5.4424641000000e+01 2469 2468 7.9428916000000e+00 2470 2468 4.0444868000000e-01 2472 2468 -1.6420458000000e+00 2515 2468 1.6672940000000e+01 2517 2468 -1.6386315000000e+00 1363 2469 1.8199554000000e+00 1364 2469 -2.7645389000000e-01 1365 2469 -2.7384818000000e+00 2421 2469 -2.3268189000000e+00 2466 2469 -2.8054613000000e+00 2467 2469 -3.1475365000000e+02 2468 2469 4.7565742000000e+01 2469 2469 1.3426657000000e+01 2470 2469 6.8367964000000e-01 2471 2469 -1.0385194000000e-01 2472 2469 -2.7757126000000e+00 2515 2469 2.8183922000000e+01 2516 2469 -4.2811790000000e+00 2517 2469 -2.7699410000000e+00 1366 2470 -1.2019010000000e-01 1368 2470 -1.6294661000000e-03 2422 2470 -7.0660953000000e-01 2424 2470 -1.2496808000000e-02 2467 2470 -6.3425720000000e-02 2469 2470 -1.1217214000000e-03 2470 2470 2.9394226000000e+02 2472 2470 1.9313937000000e-02 2473 2470 -9.9581074000000e-02 2475 2470 -1.6515049000000e-03 2518 2470 -5.3094432000000e-01 2520 2470 -1.6469005000000e-03 1366 2471 1.1063236000000e+00 1368 2471 -1.5896856000000e+00 2424 2471 -1.3322460000000e+00 2469 2471 -1.6420458000000e+00 2470 2471 -1.8614785000000e+02 2471 2471 -5.4087451000000e+01 2472 2471 7.7879090000000e+00 2473 2471 2.3826939000000e-01 2475 2471 -1.6111141000000e+00 2518 2471 1.6752403000000e+01 2520 2471 -1.6067971000000e+00 1366 2472 1.8701294000000e+00 1367 2472 -2.8829951000000e-01 1368 2472 -2.6872046000000e+00 2424 2472 -2.2520286000000e+00 2469 2472 -2.7757126000000e+00 2470 2472 -3.1466433000000e+02 2471 2472 4.7365100000000e+01 2472 2472 1.3164680000000e+01 2473 2472 4.0277057000000e-01 2474 2472 -6.2091190000000e-02 2475 2472 -2.7234273000000e+00 2518 2472 2.8318262000000e+01 2519 2472 -4.3655487000000e+00 2520 2472 -2.7161298000000e+00 1369 2473 -1.3991115000000e-01 1371 2473 -2.0021021000000e-03 2425 2473 -8.2332821000000e-01 2427 2473 -1.4561047000000e-02 2470 2473 -9.3381374000000e-02 2472 2473 -1.6515049000000e-03 2473 2473 2.9418307000000e+02 2475 2473 2.3420341000000e-02 2476 2473 -1.3599737000000e-01 2478 2473 -2.4051940000000e-03 2521 2473 -5.6806606000000e-01 2523 2473 -2.0241031000000e-03 1369 2474 1.0531180000000e+00 1371 2474 -1.5754464000000e+00 2427 2474 -1.2991028000000e+00 2472 2474 -1.6111141000000e+00 2473 2474 -1.8645872000000e+02 2474 2474 -5.3928425000000e+01 2475 2474 7.6666907000000e+00 2478 2474 -1.5821610000000e+00 2521 2474 1.7353461000000e+01 2523 2474 -1.5928640000000e+00 1369 2475 1.7801893000000e+00 1370 2475 -2.7197895000000e-01 1371 2475 -2.6631324000000e+00 2427 2475 -2.1960012000000e+00 2472 2475 -2.7234273000000e+00 2473 2475 -3.1518956000000e+02 2474 2475 4.7280929000000e+01 2475 2475 1.2959767000000e+01 2478 2475 -2.6744850000000e+00 2521 2475 2.9334266000000e+01 2522 2475 -4.4817162000000e+00 2523 2475 -2.6925751000000e+00 1372 2476 -1.5717120000000e-01 1374 2476 -2.3738115000000e-03 2428 2476 -8.2346008000000e-01 2430 2476 -1.4563380000000e-02 2473 2476 -1.4350652000000e-01 2475 2476 -2.4051940000000e-03 2476 2476 2.9422033000000e+02 2478 2476 2.3826699000000e-02 2479 2476 -7.3488376000000e-02 2481 2476 -1.2996855000000e-03 2524 2476 -5.9882884000000e-01 2526 2476 -2.3994175000000e-03 1372 2477 9.1004946000000e-01 1374 2477 -1.5615681000000e+00 2430 2477 -1.2995346000000e+00 2473 2477 2.8805878000000e-01 2475 2477 -1.5821610000000e+00 2476 2477 -1.8697054000000e+02 2477 2477 -5.3769714000000e+01 2478 2477 7.6521091000000e+00 2481 2477 -1.6243419000000e+00 2524 2477 1.7718613000000e+01 2526 2477 -1.5785190000000e+00 1372 2478 1.5383476000000e+00 1373 2478 -2.3291596000000e-01 1374 2478 -2.6396747000000e+00 2430 2478 -2.1967333000000e+00 2473 2478 4.8693456000000e-01 2474 2478 -7.3725097000000e-02 2475 2478 -2.6744850000000e+00 2476 2478 -3.1605500000000e+02 2477 2478 4.7247887000000e+01 2478 2478 1.2935123000000e+01 2481 2478 -2.7457858000000e+00 2524 2478 2.9951544000000e+01 2525 2478 -4.5348610000000e+00 2526 2478 -2.6683286000000e+00 1375 2479 -1.3041278000000e-01 1377 2479 -1.2818297000000e-03 2431 2479 -7.5421388000000e-01 2433 2479 -7.8713173000000e-03 2476 2479 -1.3407438000000e-01 2478 2479 -1.2996855000000e-03 2479 2479 2.9384226000000e+02 2481 2479 1.3481846000000e-02 2482 2479 -9.3191329000000e-02 2484 2479 -9.7258687000000e-04 2527 2479 -3.0950011000000e-01 2529 2479 -1.2972209000000e-03 1375 2480 7.4406680000000e-01 1377 2480 -1.6021115000000e+00 2433 2480 -1.3874621000000e+00 2476 2480 8.9881285000000e-01 2478 2480 -1.6243419000000e+00 2479 2480 -1.8788211000000e+02 2480 2480 -5.4236743000000e+01 2481 2480 7.8435408000000e+00 2484 2480 -1.6021489000000e+00 2527 2480 1.8189066000000e+01 2529 2480 -1.6214392000000e+00 1375 2481 1.2577697000000e+00 1376 2481 -1.8902202000000e-01 1377 2481 -2.7082075000000e+00 2433 2481 -2.3453649000000e+00 2476 2481 1.5193522000000e+00 2477 2481 -2.2833356000000e-01 2478 2481 -2.7457858000000e+00 2479 2481 -3.1759570000000e+02 2480 2481 4.7803050000000e+01 2481 2481 1.3258715000000e+01 2484 2481 -2.7082724000000e+00 2527 2481 3.0746777000000e+01 2528 2481 -4.6207335000000e+00 2529 2481 -2.7408791000000e+00 1378 2482 -1.0800179000000e-01 1380 2482 -1.0533314000000e-03 2434 2482 -3.7270901000000e-01 2436 2482 -3.8897599000000e-03 2479 2482 -1.1099011000000e-01 2481 2482 -9.7258687000000e-04 2482 2482 2.7579034000000e+02 2484 2482 8.1467754000000e-03 2485 2482 -5.3900889000000e-02 2487 2482 -5.6253407000000e-04 2530 2482 -2.7171014000000e-01 2532 2482 -9.7113407000000e-04 1378 2483 6.9758497000000e-01 1380 2483 -1.7352467000000e+00 2436 2483 -1.3875787000000e+00 2479 2483 1.7518766000000e+00 2481 2483 -1.6021489000000e+00 2482 2483 -1.7796595000000e+02 2483 2483 -5.1274641000000e+01 2484 2483 7.8678110000000e+00 2487 2483 -1.5372026000000e+00 2530 2483 1.7552672000000e+01 2532 2483 -1.5999259000000e+00 1378 2484 1.1791976000000e+00 1379 2484 -1.8038458000000e-01 1380 2484 -2.9332610000000e+00 2436 2484 -2.3455630000000e+00 2479 2484 2.9613722000000e+00 2480 2484 -4.5300793000000e-01 2481 2484 -2.7082724000000e+00 2482 2484 -3.0083364000000e+02 2483 2484 4.5592825000000e+01 2484 2484 1.3299746000000e+01 2487 2484 -2.5984856000000e+00 2530 2484 2.9671036000000e+01 2531 2484 -4.5388468000000e+00 2532 2484 -2.7045147000000e+00 1381 2485 -7.2669536000000e-02 1383 2485 -6.9405673000000e-04 2437 2485 -2.2845131000000e-01 2439 2485 -2.3842212000000e-03 2482 2485 -7.8869753000000e-02 2484 2485 -5.6253407000000e-04 2485 2485 2.5793638000000e+02 2487 2485 5.0683106000000e-03 2488 2485 -2.2847552000000e-02 2490 2485 -2.3844739000000e-04 2533 2485 -2.0865268000000e-01 2535 2485 -5.5588756000000e-04 1381 2486 6.0934250000000e-01 1383 2486 -1.8967026000000e+00 2439 2486 -1.3264689000000e+00 2482 2486 2.4509331000000e+00 2484 2486 -1.5372026000000e+00 2485 2486 -1.6719294000000e+02 2486 2486 -4.8357234000000e+01 2487 2486 7.7299432000000e+00 2490 2486 -1.4449656000000e+00 2533 2486 1.6255375000000e+01 2535 2486 -1.5192191000000e+00 1381 2487 1.0300319000000e+00 1382 2487 -1.6116763000000e-01 1383 2487 -3.2061840000000e+00 2439 2487 -2.2422615000000e+00 2482 2487 4.1430546000000e+00 2483 2487 -6.4825788000000e-01 2484 2487 -2.5984856000000e+00 2485 2487 -2.8262276000000e+02 2486 2487 4.3219585000000e+01 2487 2487 1.3066689000000e+01 2490 2487 -2.4425698000000e+00 2533 2487 2.7478068000000e+01 2534 2487 -4.2994544000000e+00 2535 2487 -2.5680863000000e+00 1384 2488 -1.0509246000000e-03 1386 2488 -1.0967924000000e-05 2440 2488 -8.8688480000000e-02 2442 2488 -9.2559310000000e-04 2485 2488 -5.4919468000000e-02 2487 2488 -2.3844739000000e-04 2488 2488 2.3420959000000e+02 2490 2488 1.9744794000000e-03 2491 2488 -6.4639159000000e-04 2493 2488 -6.7460351000000e-06 2536 2488 -1.3424802000000e-01 2538 2488 -2.3272242000000e-04 1384 2489 4.9940552000000e-01 1386 2489 -2.1277579000000e+00 2442 2489 -1.2717896000000e+00 2485 2489 3.1495184000000e+00 2487 2489 -1.4449656000000e+00 2488 2489 -1.5324261000000e+02 2489 2489 -4.4241303000000e+01 2490 2489 7.6061764000000e+00 2493 2489 -1.3462969000000e+00 2536 2489 1.5161974000000e+01 2538 2489 -1.4104398000000e+00 1384 2490 8.4419509000000e-01 1385 2490 -1.3465477000000e-01 1386 2490 -3.5967619000000e+00 2442 2490 -2.1498331000000e+00 2485 2490 5.3239458000000e+00 2486 2490 -8.4920502000000e-01 2487 2490 -2.4425698000000e+00 2488 2490 -2.5904131000000e+02 2489 2490 3.9933058000000e+01 2490 2490 1.2857479000000e+01 2493 2490 -2.2757787000000e+00 2536 2490 2.5629800000000e+01 2537 2490 -4.0881248000000e+00 2538 2490 -2.3842075000000e+00 1387 2491 -1.1114540000000e-03 1389 2491 -1.1599637000000e-05 2443 2491 -6.1495356000000e-02 2445 2491 -6.4179336000000e-04 2488 2491 -4.4340814000000e-02 2490 2491 -6.7460351000000e-06 2491 2491 2.1659033000000e+02 2493 2491 1.1787646000000e-03 2494 2491 -5.7061594000000e-04 2496 2491 -5.9552061000000e-06 2539 2491 -9.8060401000000e-02 2541 2491 -6.5671194000000e-06 1387 2492 3.8041292000000e-01 1389 2492 -2.3371655000000e+00 2445 2492 -1.1945971000000e+00 2488 2492 4.1481179000000e+00 2490 2492 -1.3462969000000e+00 2491 2492 -1.4447455000000e+02 2492 2492 -4.1136159000000e+01 2493 2492 7.4343623000000e+00 2496 2492 -1.2409730000000e+00 2539 2492 1.5597252000000e+01 2541 2492 -1.3107487000000e+00 1387 2493 6.4304949000000e-01 1388 2493 -1.0418182000000e-01 1389 2493 -3.9507414000000e+00 2445 2493 -2.0193456000000e+00 2488 2493 7.0119733000000e+00 2489 2493 -1.1360247000000e+00 2490 2493 -2.2757787000000e+00 2491 2493 -2.4421959000000e+02 2492 2493 3.7924460000000e+01 2493 2493 1.2567038000000e+01 2496 2493 -2.0977408000000e+00 2539 2493 2.6365575000000e+01 2540 2493 -4.2715430000000e+00 2541 2493 -2.2156878000000e+00 1390 2494 -1.1669028000000e-03 1392 2494 -1.2178326000000e-05 2446 2494 -3.5094789000000e-02 2448 2494 -3.6626510000000e-04 2491 2494 -1.0328185000000e-01 2493 2494 -5.9552061000000e-06 2494 2494 1.9898050000000e+02 2496 2494 8.4945259000000e-04 1390 2495 3.7138614000000e-01 1392 2495 -2.5446960000000e+00 2448 2495 -1.1345621000000e+00 2491 2495 7.5228875000000e+00 2493 2495 -1.2409730000000e+00 2494 2495 -1.2216176000000e+02 2495 2495 -3.7800226000000e+01 2496 2495 4.9244403000000e+00 1390 2496 6.2779113000000e-01 1391 2496 -1.0171182000000e-01 1392 2496 -4.3015541000000e+00 2448 2496 -1.9178638000000e+00 2491 2496 1.2716689000000e+01 2492 2496 -2.0602993000000e+00 2493 2496 -2.0977408000000e+00 2494 2496 -2.0650224000000e+02 2495 2496 3.1949098000000e+01 2496 2496 8.3242739000000e+00 2497 2497 1.0000000000000e+00 2498 2498 1.0000000000000e+00 2499 2499 1.0000000000000e+00 2500 2500 1.0000000000000e+00 2501 2501 1.0000000000000e+00 2502 2502 1.0000000000000e+00 2503 2503 1.0000000000000e+00 2504 2504 1.0000000000000e+00 2505 2505 1.0000000000000e+00 2506 2506 1.0000000000000e+00 2507 2507 1.0000000000000e+00 2508 2508 1.0000000000000e+00 2509 2509 1.0000000000000e+00 2510 2510 1.0000000000000e+00 2511 2511 1.0000000000000e+00 1408 2512 -8.9071880000000e-04 1410 2512 -9.2959444000000e-06 2464 2512 -9.0116425000000e-02 2466 2512 -9.4049579000000e-04 2512 2512 2.9264749000000e+02 2514 2512 2.0997959000000e-03 2515 2512 -2.8238988000000e-02 2517 2512 -2.2707097000000e-04 2560 2512 -1.3122752000000e-01 2562 2512 -2.2629472000000e-04 1408 2513 6.1242007000000e-01 1410 2513 -1.7083509000000e+00 2466 2513 -1.6566787000000e+00 2512 2513 -1.8638173000000e+02 2513 2513 -5.0801262000000e+01 2514 2513 6.8260786000000e+00 2515 2513 6.3495161000000e-01 2517 2513 -1.7302944000000e+00 2560 2513 1.7114212000000e+01 2562 2513 -1.7245833000000e+00 1408 2514 1.0352349000000e+00 1409 2514 -1.6566752000000e-01 1410 2514 -2.8877963000000e+00 2466 2514 -2.8004497000000e+00 2512 2514 -3.1505967000000e+02 2513 2514 5.6283224000000e+01 2514 2514 1.1538803000000e+01 2515 2514 1.0733222000000e+00 2516 2514 -1.7176259000000e-01 2517 2514 -2.9248897000000e+00 2560 2514 2.8929865000000e+01 2561 2514 -4.6296150000000e+00 2562 2514 -2.9152356000000e+00 1411 2515 -8.9656706000000e-04 1413 2515 -9.3569795000000e-06 2467 2515 -1.0724558000000e-01 2469 2515 -1.1192633000000e-03 2512 2515 -2.1757486000000e-02 2514 2515 -2.2707097000000e-04 2515 2515 2.9274063000000e+02 2517 2515 2.8729248000000e-03 2518 2515 -4.9798591000000e-02 2520 2515 -4.0579256000000e-04 2563 2515 -1.6202618000000e-01 2565 2515 -4.0438183000000e-04 1411 2516 6.8153890000000e-01 1413 2516 -1.6918757000000e+00 2469 2516 -1.6386315000000e+00 2514 2516 -1.7302944000000e+00 2515 2516 -1.8740171000000e+02 2516 2516 -5.5188260000000e+01 2517 2516 8.4867624000000e+00 2518 2516 1.0712380000000e+00 2520 2516 -1.7127767000000e+00 2563 2516 1.7626293000000e+01 2565 2516 -1.7070344000000e+00 1411 2517 1.1520726000000e+00 1412 2517 -1.8249471000000e-01 1413 2517 -2.8599448000000e+00 2469 2517 -2.7699410000000e+00 2514 2517 -2.9248897000000e+00 2515 2517 -3.1678364000000e+02 2516 2517 4.8630497000000e+01 2517 2517 1.4346016000000e+01 2518 2517 1.8108195000000e+00 2519 2517 -2.8684389000000e-01 2520 2517 -2.8952758000000e+00 2563 2517 2.9795467000000e+01 2564 2517 -4.7197678000000e+00 2565 2517 -2.8855691000000e+00 1414 2518 -6.2840163000000e-02 1416 2518 -5.7770378000000e-04 2470 2518 -1.5780271000000e-01 2472 2518 -1.6469005000000e-03 2515 2518 -3.8882232000000e-02 2517 2518 -4.0579256000000e-04 2518 2518 2.9292368000000e+02 2520 2518 4.5149893000000e-03 2521 2518 -6.4822814000000e-02 2523 2518 -5.8459832000000e-04 2566 2518 -1.9865773000000e-01 2568 2518 -5.8251011000000e-04 1414 2519 7.4086655000000e-01 1416 2519 -1.6753377000000e+00 2472 2519 -1.6067971000000e+00 2517 2519 -1.7127767000000e+00 2518 2519 -1.8834113000000e+02 2519 2519 -5.5000471000000e+01 2520 2519 8.3857228000000e+00 2521 2519 8.6492273000000e-01 2523 2519 -1.6952612000000e+00 2566 2519 1.8710595000000e+01 2568 2519 -1.6894219000000e+00 1414 2520 1.2523608000000e+00 1415 2520 -1.9634685000000e-01 1416 2520 -2.8319909000000e+00 2472 2520 -2.7161298000000e+00 2517 2520 -2.8952758000000e+00 2518 2520 -3.1837184000000e+02 2519 2520 4.8683506000000e+01 2520 2520 1.4175224000000e+01 2521 2520 1.4620654000000e+00 2522 2520 -2.2922462000000e-01 2523 2520 -2.8656695000000e+00 2566 2520 3.1628390000000e+01 2567 2520 -4.9587423000000e+00 2568 2520 -2.8557988000000e+00 1417 2521 -7.1349256000000e-02 1419 2521 -6.6569460000000e-04 2473 2521 -1.9394551000000e-01 2475 2521 -2.0241031000000e-03 2518 2521 -5.6015042000000e-02 2520 2521 -5.8459832000000e-04 2521 2521 2.9302351000000e+02 2523 2521 5.3427201000000e-03 2524 2521 -6.5409750000000e-02 2526 2521 -6.7402542000000e-04 2569 2521 -2.3558105000000e-01 2571 2521 -6.7160093000000e-04 1417 2522 7.4808903000000e-01 1419 2522 -1.6656929000000e+00 2475 2522 -1.5928640000000e+00 2520 2522 -1.6952612000000e+00 2521 2522 -1.8867626000000e+02 2522 2522 -5.4906725000000e+01 2523 2522 8.3270121000000e+00 2524 2522 8.0747099000000e-02 2526 2522 -1.6864639000000e+00 2569 2522 1.9821857000000e+01 2571 2522 -1.6806124000000e+00 1417 2523 1.2645688000000e+00 1418 2523 -1.9723372000000e-01 1419 2523 -2.8156854000000e+00 2475 2523 -2.6925751000000e+00 2520 2523 -2.8656695000000e+00 2521 2523 -3.1893814000000e+02 2522 2523 4.8672218000000e+01 2523 2523 1.4075973000000e+01 2524 2523 1.3649481000000e-01 2525 2523 -2.1288979000000e-02 2526 2523 -2.8507966000000e+00 2569 2523 3.3506847000000e+01 2570 2523 -5.2260336000000e+00 2571 2523 -2.8409053000000e+00 1420 2524 -7.9485143000000e-02 1422 2524 -7.5399642000000e-04 2476 2524 -2.2990739000000e-01 2478 2524 -2.3994175000000e-03 2521 2524 -6.4583768000000e-02 2523 2524 -6.7402542000000e-04 2524 2524 2.9310045000000e+02 2526 2524 5.9898177000000e-03 2527 2524 -6.4560309000000e-02 2529 2524 -6.7378059000000e-04 2572 2524 -2.5945883000000e-01 2574 2524 -7.6068636000000e-04 1420 2525 7.1569311000000e-01 1422 2525 -1.6570018000000e+00 2478 2525 -1.5785190000000e+00 2523 2525 -1.6864639000000e+00 2524 2525 -1.8923331000000e+02 2525 2525 -5.4812579000000e+01 2526 2525 8.2862473000000e+00 2529 2525 -1.6863082000000e+00 2572 2525 2.0490641000000e+01 2574 2525 -1.6718474000000e+00 1420 2526 1.2098076000000e+00 1421 2526 -1.8770999000000e-01 1422 2526 -2.8009959000000e+00 2478 2526 -2.6683286000000e+00 2523 2526 -2.8507966000000e+00 2524 2526 -3.1987998000000e+02 2525 2526 4.8719147000000e+01 2526 2526 1.4007069000000e+01 2529 2526 -2.8505336000000e+00 2572 2526 3.4637380000000e+01 2573 2526 -5.3742280000000e+00 2574 2526 -2.8260909000000e+00 1423 2527 -7.0592166000000e-02 1425 2527 -6.6565245000000e-04 2479 2527 -1.2429711000000e-01 2481 2527 -1.2972209000000e-03 2524 2527 -7.5201414000000e-02 2526 2527 -6.7378059000000e-04 2527 2527 2.9295322000000e+02 2529 2527 4.4363327000000e-03 2530 2527 -3.8860587000000e-02 2532 2527 -4.0556666000000e-04 2575 2527 -2.4243745000000e-01 2577 2527 -6.7142407000000e-04 1423 2528 6.7520554000000e-01 1425 2528 -1.6660338000000e+00 2481 2528 -1.6214392000000e+00 2524 2528 1.0464732000000e+00 2526 2528 -1.6863082000000e+00 2527 2528 -1.9024661000000e+02 2528 2528 -5.4906377000000e+01 2529 2528 8.3725627000000e+00 2532 2528 -1.7120399000000e+00 2575 2528 2.0498619000000e+01 2577 2528 -1.6806242000000e+00 1423 2529 1.1413667000000e+00 1424 2529 -1.7801982000000e-01 1425 2529 -2.8162617000000e+00 2481 2529 -2.7408791000000e+00 2524 2529 1.7689573000000e+00 2525 2529 -2.7590558000000e-01 2526 2529 -2.8505336000000e+00 2527 2529 -3.2159269000000e+02 2528 2529 4.9087749000000e+01 2529 2529 1.4152973000000e+01 2532 2529 -2.8940321000000e+00 2575 2529 3.4650845000000e+01 2576 2529 -5.4045176000000e+00 2577 2529 -2.8409252000000e+00 1426 2530 -8.9363099000000e-04 1428 2530 -9.3263373000000e-06 2482 2530 -9.3052124000000e-02 2484 2530 -9.7113407000000e-04 2527 2530 -5.8123209000000e-02 2529 2530 -4.0556666000000e-04 2530 2530 2.9274599000000e+02 2532 2530 2.5066052000000e-03 2533 2530 -8.6187384000000e-04 2535 2530 -8.9949054000000e-06 2578 2530 -1.9353555000000e-01 2580 2530 -4.0452664000000e-04 1426 2531 5.8169256000000e-01 1428 2531 -1.6919846000000e+00 2484 2531 -1.5999259000000e+00 2527 2531 1.8896683000000e+00 2529 2531 -1.7120399000000e+00 2530 2531 -1.9037896000000e+02 2531 2531 -5.5187799000000e+01 2532 2531 8.3957998000000e+00 2535 2531 -1.6778310000000e+00 2578 2531 1.9884307000000e+01 2580 2531 -1.7078690000000e+00 1426 2532 9.8329310000000e-01 1427 2532 -1.5575948000000e-01 1428 2532 -2.8601308000000e+00 2484 2532 -2.7045147000000e+00 2527 2532 3.1942953000000e+00 2528 2532 -5.0599540000000e-01 2529 2532 -2.8940321000000e+00 2530 2532 -3.2181660000000e+02 2531 2532 4.9428946000000e+01 2532 2532 1.4192258000000e+01 2535 2532 -2.8362030000000e+00 2578 2532 3.3612433000000e+01 2579 2532 -5.3244095000000e+00 2580 2532 -2.8869818000000e+00 1429 2533 -9.5612344000000e-04 1431 2533 -9.9785368000000e-06 2485 2533 -5.3264034000000e-02 2487 2533 -5.5588756000000e-04 2530 2533 -3.8332653000000e-02 2532 2533 -8.9949054000000e-06 2533 2533 2.6921187000000e+02 2535 2533 1.2209128000000e-03 2536 2533 -7.7697458000000e-04 2538 2533 -8.1088582000000e-06 2581 2533 -1.1567965000000e-01 2583 2533 -8.7137452000000e-06 1429 2534 4.6451832000000e-01 1431 2534 -1.8794010000000e+00 2487 2534 -1.5192191000000e+00 2530 2534 2.6251845000000e+00 2532 2534 -1.6778310000000e+00 2533 2534 -1.7564264000000e+02 2534 2534 -5.1156974000000e+01 2535 2534 8.2456741000000e+00 2538 2534 -1.5379209000000e+00 2581 2534 1.7977306000000e+01 2583 2534 -1.6256003000000e+00 1429 2535 7.8522103000000e-01 1430 2535 -1.2721097000000e-01 1431 2535 -3.1769365000000e+00 2487 2535 -2.5680863000000e+00 2530 2535 4.4376080000000e+00 2531 2535 -7.1892165000000e-01 2532 2535 -2.8362030000000e+00 2533 2535 -2.9690607000000e+02 2534 2535 4.6023370000000e+01 2535 2535 1.3938478000000e+01 2538 2535 -2.5997015000000e+00 2581 2535 3.0388813000000e+01 2582 2535 -4.9231871000000e+00 2583 2535 -2.7479122000000e+00 1432 2536 -1.0365274000000e-03 1434 2536 -1.0817669000000e-05 2488 2536 -2.2298997000000e-02 2490 2536 -2.3272242000000e-04 2533 2536 -6.6109854000000e-02 2535 2536 -8.1088582000000e-06 2536 2536 2.4579760000000e+02 2538 2536 8.4135438000000e-04 2539 2536 -6.9746052000000e-04 2541 2536 -7.2790136000000e-06 2584 2536 -9.9112757000000e-02 2586 2536 -7.9227719000000e-06 1432 2537 4.3621853000000e-01 1434 2537 -2.0587232000000e+00 2490 2537 -1.4104398000000e+00 2533 2537 2.9155404000000e+00 2535 2537 -1.5379209000000e+00 2536 2537 -1.6074289000000e+02 2537 2537 -4.6711518000000e+01 2538 2537 7.9127908000000e+00 2541 2537 -1.3976821000000e+00 2584 2537 1.6260700000000e+01 2586 2537 -1.5028176000000e+00 1432 2538 7.3738381000000e-01 1433 2538 -1.1946196000000e-01 1434 2538 -3.4800657000000e+00 2490 2538 -2.3842075000000e+00 2533 2538 4.9284294000000e+00 2534 2538 -7.9844421000000e-01 2535 2538 -2.5997015000000e+00 2536 2538 -2.7171979000000e+02 2537 2538 4.2116819000000e+01 2538 2538 1.3375780000000e+01 2541 2538 -2.3626400000000e+00 2584 2538 2.7487088000000e+01 2585 2538 -4.4531237000000e+00 2586 2538 -2.5403629000000e+00 1435 2539 -1.1364253000000e-03 1437 2539 -1.1860249000000e-05 2491 2539 -6.2924825000000e-04 2493 2539 -6.5671194000000e-06 2536 2539 -5.1374736000000e-02 2538 2539 -7.2790136000000e-06 2539 2539 2.2235750000000e+02 2541 2539 5.5257934000000e-04 2587 2539 -8.9255292000000e-02 2589 2539 -7.0906607000000e-06 1435 2540 4.5215280000000e-01 1437 2540 -2.2754922000000e+00 2493 2540 -1.3107487000000e+00 2536 2540 2.4667704000000e+00 2538 2540 -1.3976821000000e+00 2539 2540 -1.4528699000000e+02 2540 2540 -4.2264729000000e+01 2541 2540 6.3503151000000e+00 2587 2540 1.4681026000000e+01 2589 2540 -1.3616800000000e+00 1435 2541 7.6431855000000e-01 1436 2541 -1.2382645000000e-01 1437 2541 -3.8464892000000e+00 2493 2541 -2.2156878000000e+00 2536 2541 4.1698256000000e+00 2537 2541 -6.7554911000000e-01 2538 2541 -2.3626400000000e+00 2539 2541 -2.4559295000000e+02 2540 2541 3.8061162000000e+01 2541 2541 1.0734565000000e+01 2587 2541 2.4816788000000e+01 2588 2541 -4.0205418000000e+00 2589 2541 -2.3017823000000e+00 2542 2542 1.0000000000000e+00 2543 2543 1.0000000000000e+00 2544 2544 1.0000000000000e+00 2545 2545 1.0000000000000e+00 2546 2546 1.0000000000000e+00 2547 2547 1.0000000000000e+00 2548 2548 1.0000000000000e+00 2549 2549 1.0000000000000e+00 2550 2550 1.0000000000000e+00 2551 2551 1.0000000000000e+00 2552 2552 1.0000000000000e+00 2553 2553 1.0000000000000e+00 2554 2554 1.0000000000000e+00 2555 2555 1.0000000000000e+00 2556 2556 1.0000000000000e+00 2557 2557 1.0000000000000e+00 2558 2558 1.0000000000000e+00 2559 2559 1.0000000000000e+00 1456 2560 -9.2582470000000e-04 1458 2560 -9.6623255000000e-06 2512 2560 -2.1683108000000e-02 2514 2560 -2.2629472000000e-04 2560 2560 2.9249089000000e+02 2562 2560 9.3899797000000e-04 2563 2560 -2.1203776000000e-02 2565 2560 -9.7832424000000e-06 2608 2560 -7.1925308000000e-02 2610 2560 -9.3059444000000e-06 1456 2561 5.3099880000000e-01 1458 2561 -1.7328999000000e+00 2514 2561 -1.7245833000000e+00 2560 2561 -1.8766696000000e+02 2561 2561 -5.1030416000000e+01 2562 2561 6.8826972000000e+00 2563 2561 1.1494059000000e+00 2565 2561 -1.7521309000000e+00 2608 2561 1.7993985000000e+01 2610 2561 -1.6668777000000e+00 1456 2562 8.9760037000000e-01 1457 2562 -1.4541384000000e-01 1458 2562 -2.9292939000000e+00 2514 2562 -2.9152356000000e+00 2560 2562 -3.1723224000000e+02 2561 2562 5.6854685000000e+01 2562 2562 1.1634511000000e+01 2563 2562 1.9429557000000e+00 2564 2562 -3.1476442000000e-01 2565 2562 -2.9618020000000e+00 2608 2562 3.0417032000000e+01 2609 2562 -4.9276468000000e+00 2610 2562 -2.8176901000000e+00 1459 2563 -9.2827855000000e-04 1461 2563 -9.6879349000000e-06 2515 2563 -3.8747058000000e-02 2517 2563 -4.0438183000000e-04 2560 2563 -9.3741072000000e-04 2562 2563 -9.7832424000000e-06 2563 2563 2.9252851000000e+02 2565 2563 1.1272212000000e-03 2566 2563 -3.1497905000000e-02 2568 2563 -9.8369999000000e-06 2611 2563 -8.0804250000000e-02 2613 2563 -9.5760031000000e-06 1459 2564 5.7296891000000e-01 1461 2564 -1.7321883000000e+00 2517 2564 -1.7070344000000e+00 2562 2564 -1.7521309000000e+00 2563 2564 -1.8913401000000e+02 2564 2564 -5.5622843000000e+01 2565 2564 8.6554071000000e+00 2566 2564 2.1606308000000e+00 2568 2564 -1.7520569000000e+00 2611 2564 1.8407184000000e+01 2613 2564 -1.7057913000000e+00 1459 2565 9.6854598000000e-01 1460 2565 -1.5690687000000e-01 1461 2565 -2.9280891000000e+00 2517 2565 -2.8855691000000e+00 2562 2565 -2.9618020000000e+00 2563 2565 -3.1971192000000e+02 2564 2565 4.9493657000000e+01 2565 2565 1.4631092000000e+01 2566 2565 3.6523280000000e+00 2567 2565 -5.9168619000000e-01 2568 2565 -2.9616750000000e+00 2611 2565 3.1115484000000e+01 2612 2565 -5.0407855000000e+00 2613 2565 -2.8834677000000e+00 1462 2566 -9.3303617000000e-04 1464 2566 -9.7375877000000e-06 2518 2566 -5.5814953000000e-02 2520 2566 -5.8251011000000e-04 2563 2566 -9.4256166000000e-04 2565 2566 -9.8369999000000e-06 2566 2566 2.9257763000000e+02 2568 2566 1.3058487000000e-03 2569 2566 -3.8248922000000e-02 2571 2566 -9.9264522000000e-06 2614 2566 -1.0616624000000e-01 2616 2566 -9.8771465000000e-06 1462 2567 6.5284766000000e-01 1464 2567 -1.7316471000000e+00 2520 2567 -1.6894219000000e+00 2565 2567 -1.7520569000000e+00 2566 2567 -1.9102779000000e+02 2567 2567 -5.5622856000000e+01 2568 2567 8.6749437000000e+00 2569 2567 1.9808075000000e+00 2571 2567 -1.7520397000000e+00 2614 2567 2.0401092000000e+01 2616 2567 -1.7435727000000e+00 1462 2568 1.1035737000000e+00 1463 2568 -1.7878067000000e-01 1464 2568 -2.9271763000000e+00 2520 2568 -2.8557988000000e+00 2565 2568 -2.9616750000000e+00 2566 2568 -3.2291338000000e+02 2567 2568 5.0011819000000e+01 2568 2568 1.4664123000000e+01 2569 2568 3.3483570000000e+00 2570 2568 -5.4243911000000e-01 2571 2568 -2.9616479000000e+00 2614 2568 3.4486006000000e+01 2615 2568 -5.5867871000000e+00 2616 2568 -2.9473353000000e+00 1465 2569 -9.3950919000000e-04 1467 2569 -9.8051430000000e-06 2521 2569 -6.4351458000000e-02 2523 2569 -6.7160093000000e-04 2566 2569 -9.5113280000000e-04 2568 2569 -9.9264522000000e-06 2569 2569 2.9257699000000e+02 2571 2569 1.3952789000000e-03 2572 2569 -1.7181466000000e-02 2574 2569 -1.0009662000000e-05 2617 2569 -1.1698968000000e-01 2619 2569 -9.9707864000000e-06 1465 2570 7.5794506000000e-01 1467 2570 -1.7325699000000e+00 2523 2570 -1.6806124000000e+00 2568 2570 -1.7520397000000e+00 2569 2570 -1.9181884000000e+02 2570 2570 -5.5621662000000e+01 2571 2570 8.6690385000000e+00 2572 2570 7.5206056000000e-01 2574 2570 -1.7520824000000e+00 2617 2570 2.2314308000000e+01 2619 2570 -1.7455292000000e+00 1465 2571 1.2812295000000e+00 1466 2571 -2.0756036000000e-01 1467 2571 -2.9287341000000e+00 2523 2571 -2.8409053000000e+00 2568 2571 -2.9616479000000e+00 2569 2571 -3.2425036000000e+02 2570 2571 5.0231084000000e+01 2571 2571 1.4654135000000e+01 2572 2571 1.2712824000000e+00 2573 2571 -2.0594892000000e-01 2574 2571 -2.9617180000000e+00 2617 2571 3.7720082000000e+01 2618 2571 -6.1106878000000e+00 2619 2571 -2.9506406000000e+00 1468 2572 -9.4268585000000e-04 1470 2572 -9.8382960000000e-06 2524 2572 -7.2887446000000e-02 2526 2572 -7.6068636000000e-04 2569 2572 -9.5910582000000e-04 2571 2572 -1.0009662000000e-05 2572 2572 2.9258100000000e+02 2574 2572 1.4845354000000e-03 2575 2572 -9.5913579000000e-04 2577 2572 -1.0009975000000e-05 2620 2572 -1.2784603000000e-01 2622 2572 -1.0021305000000e-05 1468 2573 8.0885568000000e-01 1470 2573 -1.7325536000000e+00 2526 2573 -1.6718474000000e+00 2571 2573 -1.7520824000000e+00 2572 2573 -1.9218464000000e+02 2573 2573 -5.5620927000000e+01 2574 2573 8.6602214000000e+00 2577 2573 -1.7520151000000e+00 2620 2573 2.3380365000000e+01 2622 2573 -1.7455184000000e+00 1468 2574 1.3672896000000e+00 1469 2574 -2.2150141000000e-01 1470 2574 -2.9287086000000e+00 2526 2574 -2.8260909000000e+00 2571 2574 -2.9617180000000e+00 2572 2574 -3.2486892000000e+02 2573 2574 5.0332785000000e+01 2574 2574 1.4639234000000e+01 2577 2574 -2.9616042000000e+00 2620 2574 3.9522169000000e+01 2621 2574 -6.4026056000000e+00 2622 2574 -2.9506243000000e+00 1471 2575 -9.3888991000000e-04 1473 2575 -9.7986799000000e-06 2527 2575 -6.4334512000000e-02 2529 2575 -6.7142407000000e-04 2572 2575 -2.0098704000000e-02 2574 2575 -1.0009975000000e-05 2575 2575 2.9258909000000e+02 2577 2575 1.3950558000000e-03 2578 2575 -9.4692422000000e-04 2580 2575 -9.8825296000000e-06 2623 2575 -1.2599173000000e-01 2625 2575 -9.9743272000000e-06 1471 2576 7.6584105000000e-01 1473 2576 -1.7326971000000e+00 2529 2576 -1.6806242000000e+00 2572 2576 1.0386881000000e+00 2574 2576 -1.7520151000000e+00 2575 2576 -1.9300135000000e+02 2576 2576 -5.5621503000000e+01 2577 2576 8.6692625000000e+00 2580 2576 -1.7516908000000e+00 2623 2576 2.3202076000000e+01 2625 2576 -1.7460305000000e+00 1471 2577 1.2945768000000e+00 1472 2577 -2.0972263000000e-01 1473 2577 -2.9289491000000e+00 2529 2577 -2.8409252000000e+00 2572 2577 1.7557971000000e+00 2573 2577 -2.8444074000000e-01 2574 2577 -2.9616042000000e+00 2575 2577 -3.2624926000000e+02 2576 2577 5.0555316000000e+01 2577 2577 1.4654513000000e+01 2580 2577 -2.9610581000000e+00 2623 2577 3.9220762000000e+01 2624 2577 -6.3537996000000e+00 2625 2577 -2.9514879000000e+00 1474 2578 -9.3142427000000e-04 1476 2578 -9.7207651000000e-06 2530 2578 -3.8760933000000e-02 2532 2578 -4.0452664000000e-04 2575 2578 -4.3707890000000e-02 2577 2578 -9.8825296000000e-06 2578 2578 2.9258464000000e+02 2580 2578 1.1273703000000e-03 2581 2578 -9.0379544000000e-04 2583 2578 -9.4324181000000e-06 2626 2578 -1.2432188000000e-01 2628 2578 -9.8495447000000e-06 1474 2579 6.9052184000000e-01 1476 2579 -1.7321429000000e+00 2532 2579 -1.7078690000000e+00 2575 2579 2.5182774000000e+00 2577 2579 -1.7516908000000e+00 2578 2579 -1.9340288000000e+02 2579 2579 -5.5622434000000e+01 2580 2579 8.6410780000000e+00 2583 2579 -1.6970838000000e+00 2626 2579 2.2200415000000e+01 2628 2579 -1.7460864000000e+00 1474 2580 1.1672581000000e+00 1475 2580 -1.8909809000000e-01 1476 2580 -2.9280144000000e+00 2532 2580 -2.8869818000000e+00 2575 2580 4.2568961000000e+00 2576 2580 -6.8962550000000e-01 2577 2580 -2.9610581000000e+00 2578 2580 -3.2692822000000e+02 2579 2580 5.0663406000000e+01 2580 2580 1.4606876000000e+01 2583 2580 -2.8687486000000e+00 2626 2580 3.7527582000000e+01 2627 2580 -6.0795416000000e+00 2628 2580 -2.9515844000000e+00 1477 2581 -9.8194949000000e-04 1479 2581 -1.0248069000000e-05 2533 2581 -8.3493364000000e-04 2535 2581 -8.7137452000000e-06 2578 2581 -6.9271226000000e-02 2580 2581 -9.4324181000000e-06 2581 2581 2.7502451000000e+02 2583 2581 6.8938559000000e-04 2584 2581 -8.4001290000000e-04 2586 2581 -8.7667547000000e-06 2629 2581 -1.2208159000000e-01 2631 2581 -9.3143151000000e-06 1477 2582 6.6369623000000e-01 1479 2582 -1.8415082000000e+00 2535 2582 -1.6256003000000e+00 2578 2582 3.2064503000000e+00 2580 2582 -1.6970838000000e+00 2581 2582 -1.8185558000000e+02 2582 2582 -5.2287970000000e+01 2583 2582 8.4381586000000e+00 2586 2582 -1.5920711000000e+00 2629 2582 2.0074998000000e+01 2631 2582 -1.6760612000000e+00 1477 2583 1.1219114000000e+00 1478 2583 -1.8175342000000e-01 1479 2583 -3.1128835000000e+00 2535 2583 -2.7479122000000e+00 2578 2583 5.4201800000000e+00 2579 2583 -8.7808747000000e-01 2580 2583 -2.8687486000000e+00 2581 2583 -3.0740847000000e+02 2582 2583 4.7632801000000e+01 2583 2583 1.4263855000000e+01 2586 2583 -2.6912369000000e+00 2629 2583 3.3934755000000e+01 2630 2583 -5.4975455000000e+00 2631 2583 -2.8332120000000e+00 1480 2584 -1.0382557000000e-03 1482 2584 -1.0835706000000e-05 2536 2584 -7.5914416000000e-04 2538 2584 -7.9227719000000e-06 2581 2584 -7.6734055000000e-02 2583 2584 -8.7667547000000e-06 2584 2584 2.5747100000000e+02 2586 2584 6.4606008000000e-04 2587 2584 -7.6858040000000e-04 2589 2584 -8.0212528000000e-06 2632 2584 -1.0700336000000e-01 2634 2584 -8.6474752000000e-06 1480 2585 5.8532222000000e-01 1482 2585 -1.9654957000000e+00 2538 2585 -1.5028176000000e+00 2581 2585 3.3975388000000e+00 2583 2585 -1.5920711000000e+00 2584 2585 -1.6914037000000e+02 2585 2585 -4.8953851000000e+01 2586 2585 8.1046240000000e+00 2589 2585 -1.4681644000000e+00 2632 2585 1.7330914000000e+01 2634 2585 -1.5706120000000e+00 1480 2586 9.8942868000000e-01 1481 2586 -1.6029150000000e-01 1482 2586 -3.3224740000000e+00 2538 2586 -2.5403629000000e+00 2581 2586 5.7431995000000e+00 2582 2586 -9.3042188000000e-01 2583 2586 -2.6912369000000e+00 2584 2586 -2.8591488000000e+02 2585 2586 4.4281127000000e+01 2586 2586 1.3700055000000e+01 2589 2586 -2.4817834000000e+00 2632 2586 2.9296178000000e+01 2633 2586 -4.7461009000000e+00 2634 2586 -2.6549625000000e+00 1483 2587 -1.1349350000000e-03 1485 2587 -1.1844695000000e-05 2539 2587 -6.7941293000000e-04 2541 2587 -7.0906607000000e-06 2584 2587 -5.4570200000000e-02 2586 2587 -8.0212528000000e-06 2587 2587 2.3400232000000e+02 2589 2587 5.8182586000000e-04 2635 2587 -5.2806300000000e-02 2637 2587 -7.7235182000000e-06 1483 2588 5.4602781000000e-01 1485 2588 -2.1660390000000e+00 2541 2588 -1.3616800000000e+00 2584 2588 2.6473125000000e+00 2586 2588 -1.4681644000000e+00 2587 2588 -1.5123902000000e+02 2588 2588 -4.4505464000000e+01 2589 2588 6.4147095000000e+00 2635 2588 1.3660367000000e+01 2637 2588 -1.4138587000000e+00 1483 2589 9.2300475000000e-01 1484 2589 -1.4953127000000e-01 1485 2589 -3.6614697000000e+00 2541 2589 -2.3017823000000e+00 2584 2589 4.4750140000000e+00 2585 2589 -7.2497412000000e-01 2586 2589 -2.4817834000000e+00 2587 2589 -2.5565427000000e+02 2588 2589 3.9559654000000e+01 2589 2589 1.0843417000000e+01 2635 2589 2.3091469000000e+01 2636 2589 -3.7409303000000e+00 2637 2589 -2.3899851000000e+00 2590 2590 1.0000000000000e+00 2591 2591 1.0000000000000e+00 2592 2592 1.0000000000000e+00 2593 2593 1.0000000000000e+00 2594 2594 1.0000000000000e+00 2595 2595 1.0000000000000e+00 2596 2596 1.0000000000000e+00 2597 2597 1.0000000000000e+00 2598 2598 1.0000000000000e+00 2599 2599 1.0000000000000e+00 2600 2600 1.0000000000000e+00 2601 2601 1.0000000000000e+00 2602 2602 1.0000000000000e+00 2603 2603 1.0000000000000e+00 2604 2604 1.0000000000000e+00 1501 2605 -1.1247371000000e-03 1503 2605 -1.1738265000000e-05 2605 2605 2.5726183000000e+02 2607 2605 6.3121360000000e-04 2608 2605 -8.7969584000000e-04 2610 2605 -9.1809038000000e-06 2653 2605 -8.0616683000000e-04 2655 2605 -8.4135217000000e-06 1501 2606 5.3992581000000e-01 1503 2606 -1.9859020000000e+00 2605 2606 -1.5570736000000e+02 2606 2606 -4.8977572000000e+01 2607 2606 4.9631555000000e+00 2610 2606 -1.5762532000000e+00 2653 2606 7.3733402000000e+00 2655 2606 -1.3955268000000e+00 1501 2607 9.1268979000000e-01 1502 2607 -1.4785378000000e-01 1503 2607 -3.3569658000000e+00 2605 2607 -2.6320750000000e+02 2606 2607 4.0543038000000e+01 2607 2607 8.3897130000000e+00 2610 2607 -2.6644983000000e+00 2653 2607 1.2463884000000e+01 2654 2607 -2.0191221000000e+00 2655 2607 -2.3589964000000e+00 1504 2608 -1.0585969000000e-03 1506 2608 -1.1047996000000e-05 2560 2608 -8.9167698000000e-04 2562 2608 -9.3059444000000e-06 2605 2608 -2.5480273000000e-02 2607 2608 -9.1809038000000e-06 2608 2608 2.6901524000000e+02 2610 2608 6.7733017000000e-04 2611 2608 -2.6901940000000e-02 2613 2608 -9.5907170000000e-06 2656 2608 -8.5919741000000e-04 2658 2608 -8.9669729000000e-06 1504 2609 6.2262536000000e-01 1506 2609 -1.8943762000000e+00 2562 2609 -1.6668777000000e+00 2605 2609 5.3520116000000e+00 2607 2609 -1.5762532000000e+00 2608 2609 -1.7513816000000e+02 2609 2609 -5.1196925000000e+01 2610 2609 8.2741795000000e+00 2611 2609 1.0732459000000e+00 2613 2609 -1.6465357000000e+00 2656 2609 1.3568905000000e+01 2658 2609 -1.4844173000000e+00 1504 2610 1.0524859000000e+00 1505 2610 -1.7050168000000e-01 1506 2610 -3.2022536000000e+00 2562 2610 -2.8176901000000e+00 2605 2610 9.0470403000000e+00 2606 2610 -1.4656116000000e+00 2607 2610 -2.6644983000000e+00 2608 2610 -2.9605355000000e+02 2609 2610 4.5785790000000e+01 2610 2610 1.3986673000000e+01 2611 2610 1.8142149000000e+00 2612 2610 -2.9390103000000e-01 2613 2610 -2.7833040000000e+00 2656 2610 2.2936876000000e+01 2657 2610 -3.7157514000000e+00 2658 2610 -2.5092590000000e+00 1507 2611 -1.0163523000000e-03 1509 2611 -1.0607112000000e-05 2563 2611 -9.1755346000000e-04 2565 2611 -9.5760031000000e-06 2608 2611 -9.1896332000000e-04 2610 2611 -9.5907170000000e-06 2611 2611 2.8074737000000e+02 2613 2611 7.0571194000000e-04 2614 2611 -5.4088750000000e-02 2616 2611 -1.0025034000000e-05 2659 2611 -3.5101311000000e-02 2661 2611 -9.3148164000000e-06 1507 2612 7.9655881000000e-01 1509 2612 -1.8126331000000e+00 2565 2612 -1.7057913000000e+00 2610 2612 -1.6465357000000e+00 2611 2612 -1.8345941000000e+02 2612 2612 -5.3421482000000e+01 2613 2612 8.4829556000000e+00 2614 2612 3.6783861000000e+00 2616 2612 -1.7166919000000e+00 2659 2612 1.7742896000000e+01 2661 2612 -1.5953361000000e+00 1507 2613 1.3465020000000e+00 1508 2613 -2.1813184000000e-01 1509 2613 -3.0640727000000e+00 2565 2613 -2.8834677000000e+00 2610 2613 -2.7833040000000e+00 2611 2613 -3.1011955000000e+02 2612 2613 4.7973334000000e+01 2613 2613 1.4339579000000e+01 2614 2613 6.2179390000000e+00 2615 2613 -1.0072993000000e+00 2616 2613 -2.9018937000000e+00 2659 2613 2.9992569000000e+01 2660 2613 -4.8587629000000e+00 2661 2613 -2.6967541000000e+00 1510 2614 -9.8266211000000e-04 1512 2614 -1.0255506000000e-05 2566 2614 -9.4640842000000e-04 2568 2614 -9.8771465000000e-06 2611 2614 -9.6057866000000e-04 2613 2614 -1.0025034000000e-05 2614 2614 2.9249122000000e+02 2616 2614 7.3436965000000e-04 2617 2614 -4.9024073000000e-02 2619 2614 -1.0324474000000e-05 2662 2614 -8.9967129000000e-02 2664 2614 -9.9255482000000e-06 1510 2615 1.0708972000000e+00 1512 2615 -1.7366396000000e+00 2568 2615 -1.7435727000000e+00 2613 2615 -1.7166919000000e+00 2614 2615 -1.9487570000000e+02 2615 2615 -5.5647323000000e+01 2616 2615 8.6406706000000e+00 2617 2615 3.8787961000000e+00 2619 2615 -1.7525021000000e+00 2662 2615 2.1966129000000e+01 2664 2615 -1.6850482000000e+00 1510 2616 1.8102447000000e+00 1511 2616 -2.9325594000000e-01 1512 2616 -2.9356156000000e+00 2568 2616 -2.9473353000000e+00 2613 2616 -2.9018937000000e+00 2614 2616 -3.2941788000000e+02 2615 2616 5.1004900000000e+01 2616 2616 1.4606187000000e+01 2617 2616 6.5567169000000e+00 2618 2616 -1.0621747000000e+00 2619 2616 -2.9624295000000e+00 2662 2616 3.7131544000000e+01 2663 2616 -6.0152344000000e+00 2664 2616 -2.8484055000000e+00 1513 2617 -9.8942330000000e-04 1515 2617 -1.0326069000000e-05 2569 2617 -9.5538081000000e-04 2571 2617 -9.9707864000000e-06 2614 2617 -9.8927044000000e-04 2616 2617 -1.0324474000000e-05 2617 2617 2.9254014000000e+02 2619 2617 7.3535632000000e-04 2620 2617 -2.8113285000000e-02 2622 2617 -1.0418811000000e-05 2665 2617 -1.6098640000000e-01 2667 2617 -1.0349907000000e-05 1513 2618 1.4333144000000e+00 1515 2618 -1.7319037000000e+00 2571 2618 -1.7455292000000e+00 2616 2618 -1.7525021000000e+00 2617 2618 -1.9699295000000e+02 2618 2618 -5.5648296000000e+01 2619 2618 8.7298165000000e+00 2620 2618 1.8224452000000e+00 2622 2618 -1.7525012000000e+00 2665 2618 2.5778745000000e+01 2667 2618 -1.7411638000000e+00 1513 2619 2.4228734000000e+00 1514 2619 -3.9249862000000e-01 1515 2619 -2.9276085000000e+00 2571 2619 -2.9506406000000e+00 2616 2619 -2.9624295000000e+00 2617 2619 -3.3299670000000e+02 2618 2619 5.1582022000000e+01 2619 2619 1.4756875000000e+01 2620 2619 3.0806597000000e+00 2621 2619 -4.9905816000000e-01 2622 2619 -2.9624265000000e+00 2665 2619 4.3576367000000e+01 2666 2619 -7.0592488000000e+00 2667 2619 -2.9432618000000e+00 1516 2620 -9.9413888000000e-04 1518 2620 -1.0375283000000e-05 2572 2620 -9.6022143000000e-04 2574 2620 -1.0021305000000e-05 2617 2620 -9.9830961000000e-04 2619 2620 -1.0418811000000e-05 2620 2620 2.9253173000000e+02 2622 2620 7.3561402000000e-04 2623 2620 -9.9942208000000e-04 2625 2620 -1.0430421000000e-05 2668 2620 -1.7947806000000e-01 2670 2620 -1.0399223000000e-05 1516 2621 1.6531461000000e+00 1518 2621 -1.7318990000000e+00 2574 2621 -1.7455184000000e+00 2619 2621 -1.7525012000000e+00 2620 2621 -1.9721627000000e+02 2621 2621 -5.5648176000000e+01 2622 2621 8.7312260000000e+00 2625 2621 -1.7525027000000e+00 2668 2621 2.7604579000000e+01 2670 2621 -1.7425884000000e+00 1516 2622 2.7944782000000e+00 1517 2622 -4.5269632000000e-01 1518 2622 -2.9276020000000e+00 2574 2622 -2.9506243000000e+00 2619 2622 -2.9624265000000e+00 2620 2622 -3.3337438000000e+02 2621 2622 5.1643267000000e+01 2622 2622 1.4759261000000e+01 2625 2622 -2.9624289000000e+00 2668 2622 4.6662780000000e+01 2669 2622 -7.5592177000000e+00 2670 2622 -2.9456714000000e+00 1519 2623 -9.9061269000000e-04 1521 2623 -1.0338482000000e-05 2575 2623 -9.5572009000000e-04 2577 2623 -9.9743272000000e-06 2620 2623 -2.2031607000000e-02 2622 2623 -1.0430421000000e-05 2623 2623 2.9255261000000e+02 2625 2623 7.3543773000000e-04 2626 2623 -9.9135378000000e-04 2628 2623 -1.0346217000000e-05 2671 2623 -1.7989024000000e-01 2673 2623 -1.0381639000000e-05 1519 2624 1.5206748000000e+00 1521 2624 -1.7309160000000e+00 2577 2624 -1.7460305000000e+00 2620 2624 1.2245586000000e+00 2622 2624 -1.7525027000000e+00 2623 2624 -1.9752059000000e+02 2624 2624 -5.5648621000000e+01 2625 2624 8.7326296000000e+00 2628 2624 -1.7524060000000e+00 2671 2624 2.6817401000000e+01 2673 2624 -1.7445577000000e+00 1519 2625 2.5705472000000e+00 1520 2625 -4.1642114000000e-01 1521 2625 -2.9259386000000e+00 2577 2625 -2.9514879000000e+00 2620 2625 2.0699926000000e+00 2621 2625 -3.3533278000000e-01 2622 2625 -2.9624289000000e+00 2623 2625 -3.3388862000000e+02 2624 2625 5.1725673000000e+01 2625 2625 1.4761630000000e+01 2628 2625 -2.9622671000000e+00 2671 2625 4.5332109000000e+01 2672 2625 -7.3436692000000e+00 2673 2625 -2.9489986000000e+00 1522 2626 -9.8257199000000e-04 1524 2626 -1.0254566000000e-05 2578 2626 -9.4376367000000e-04 2580 2626 -9.8495447000000e-06 2623 2626 -4.5424895000000e-02 2625 2626 -1.0346217000000e-05 2626 2626 2.9254806000000e+02 2628 2626 7.3485204000000e-04 2629 2626 -9.7085662000000e-04 2631 2626 -1.0132299000000e-05 2674 2626 -1.5096113000000e-01 2676 2626 -1.0306636000000e-05 1522 2627 1.2302176000000e+00 1524 2627 -1.7320887000000e+00 2580 2627 -1.7460864000000e+00 2623 2627 3.5248492000000e+00 2625 2627 -1.7524060000000e+00 2626 2627 -1.9753514000000e+02 2627 2627 -5.5647836000000e+01 2628 2627 8.7171013000000e+00 2631 2627 -1.7343623000000e+00 2674 2627 2.4820915000000e+01 2676 2627 -1.7459416000000e+00 1522 2628 2.0795599000000e+00 1523 2628 -3.3688403000000e-01 1524 2628 -2.9279228000000e+00 2580 2628 -2.9515844000000e+00 2623 2628 5.9584050000000e+00 2624 2628 -9.6524821000000e-01 2625 2628 -2.9622671000000e+00 2626 2628 -3.3391340000000e+02 2627 2628 5.1731839000000e+01 2628 2628 1.4735386000000e+01 2631 2628 -2.9317638000000e+00 2674 2628 4.1957275000000e+01 2675 2628 -6.7969844000000e+00 2676 2628 -2.9513397000000e+00 1525 2629 -9.9209166000000e-04 1527 2629 -1.0353917000000e-05 2581 2629 -8.9247904000000e-04 2583 2629 -9.3143151000000e-06 2626 2629 -6.7965128000000e-02 2628 2629 -1.0132299000000e-05 2629 2629 2.8669542000000e+02 2631 2629 7.1975809000000e-04 2632 2629 -9.1858604000000e-04 2634 2629 -9.5867796000000e-06 2677 2629 -1.2299397000000e-01 2679 2629 -1.0093614000000e-05 1525 2630 9.7046859000000e-01 1527 2630 -1.7686457000000e+00 2583 2630 -1.6760612000000e+00 2626 2630 4.5542143000000e+00 2628 2630 -1.7343623000000e+00 2629 2630 -1.9256389000000e+02 2630 2630 -5.4535101000000e+01 2631 2630 8.5750910000000e+00 2634 2630 -1.6619487000000e+00 2677 2630 2.2439305000000e+01 2679 2630 -1.7279811000000e+00 1525 2631 1.6404788000000e+00 1526 2631 -2.6575571000000e-01 1527 2631 -2.9897163000000e+00 2583 2631 -2.8332120000000e+00 2626 2631 7.6984380000000e+00 2627 2631 -1.2471382000000e+00 2628 2631 -2.9317638000000e+00 2629 2631 -3.2550975000000e+02 2630 2631 5.0417700000000e+01 2631 2631 1.4495325000000e+01 2634 2631 -2.8093580000000e+00 2677 2631 3.7931372000000e+01 2678 2631 -6.1448394000000e+00 2679 2631 -2.9209771000000e+00 1528 2632 -1.0451533000000e-03 1530 2632 -1.0907693000000e-05 2584 2632 -8.2858378000000e-04 2586 2632 -8.6474752000000e-06 2629 2632 -8.7940613000000e-02 2631 2632 -9.5867796000000e-06 2632 2632 2.6912665000000e+02 2634 2632 6.7637135000000e-04 2635 2632 -8.2768535000000e-04 2637 2632 -8.6380988000000e-06 2680 2632 -7.6916466000000e-02 2682 2632 -9.3597604000000e-06 1528 2633 7.8546443000000e-01 1530 2633 -1.8879020000000e+00 2586 2633 -1.5706120000000e+00 2629 2633 5.1131268000000e+00 2631 2633 -1.6619487000000e+00 2632 2633 -1.7926113000000e+02 2633 2633 -5.1197932000000e+01 2634 2633 8.2670121000000e+00 2637 2633 -1.5179900000000e+00 2680 2633 1.8842384000000e+01 2682 2633 -1.6228397000000e+00 1528 2634 1.3277491000000e+00 1529 2634 -2.1509523000000e-01 1530 2634 -3.1913095000000e+00 2586 2634 -2.6549625000000e+00 2629 2634 8.6432294000000e+00 2630 2634 -1.4002024000000e+00 2631 2634 -2.8093580000000e+00 2632 2634 -3.0302301000000e+02 2633 2634 4.6912740000000e+01 2634 2634 1.3974555000000e+01 2637 2634 -2.5660085000000e+00 2680 2634 3.1851165000000e+01 2681 2634 -5.1598860000000e+00 2682 2634 -2.7432483000000e+00 1531 2635 -1.1549294000000e-03 1533 2635 -1.2053366000000e-05 2587 2635 -7.4005207000000e-04 2589 2635 -7.7235182000000e-06 2632 2635 -1.0315068000000e-01 2634 2635 -8.6380988000000e-06 2635 2635 2.3984529000000e+02 2637 2635 5.9758328000000e-04 2683 2635 -2.0030928000000e-02 2685 2635 -8.3415062000000e-06 1531 2636 6.8019859000000e-01 1533 2636 -2.1149439000000e+00 2589 2636 -1.4138587000000e+00 2632 2636 4.8202674000000e+00 2634 2636 -1.5179900000000e+00 2635 2636 -1.5366395000000e+02 2636 2636 -4.5637013000000e+01 2637 2636 6.5179537000000e+00 2683 2636 1.0444244000000e+01 2685 2636 -1.4660613000000e+00 1531 2637 1.1498069000000e+00 1532 2637 -1.8627016000000e-01 1533 2637 -3.5750987000000e+00 2589 2637 -2.3899851000000e+00 2632 2637 8.1481742000000e+00 2633 2637 -1.3200144000000e+00 2634 2637 -2.5660085000000e+00 2635 2637 -2.5975337000000e+02 2636 2637 4.0130338000000e+01 2637 2637 1.1017941000000e+01 2683 2637 1.7654939000000e+01 2684 2637 -2.8601219000000e+00 2685 2637 -2.4782283000000e+00 2638 2638 1.0000000000000e+00 2639 2639 1.0000000000000e+00 2640 2640 1.0000000000000e+00 2641 2641 1.0000000000000e+00 2642 2642 1.0000000000000e+00 2643 2643 1.0000000000000e+00 2644 2644 1.0000000000000e+00 2645 2645 1.0000000000000e+00 2646 2646 1.0000000000000e+00 2647 2647 1.0000000000000e+00 2648 2648 1.0000000000000e+00 2649 2649 1.0000000000000e+00 2650 2650 1.0000000000000e+00 2651 2651 1.0000000000000e+00 2652 2652 1.0000000000000e+00 1549 2653 -1.3595278000000e-03 1551 2653 -1.4188647000000e-05 2605 2653 -8.3154072000000e-02 2607 2653 -8.4135217000000e-06 2653 2653 2.1644135000000e+02 2655 2653 5.4412163000000e-04 2656 2653 -4.8657587000000e-02 2658 2653 -8.1200792000000e-06 2701 2653 -6.9781846000000e-04 2703 2653 -7.2827492000000e-06 1549 2654 5.9776879000000e-01 1551 2654 -2.3514563000000e+00 2607 2654 -1.3955268000000e+00 2653 2654 -1.3376399000000e+02 2654 2654 -4.1208238000000e+01 2655 2654 6.2743035000000e+00 2656 2654 6.2226571000000e-01 2658 2654 -1.3470069000000e+00 2701 2654 8.2931739000000e+00 2703 2654 -1.1757010000000e+00 1549 2655 1.0104675000000e+00 1550 2655 -1.6369156000000e-01 1551 2655 -3.9748983000000e+00 2607 2655 -2.3589964000000e+00 2653 2655 -2.2611446000000e+02 2654 2655 3.4812190000000e+01 2655 2655 1.0606074000000e+01 2656 2655 1.0518771000000e+00 2657 2655 -1.7039975000000e-01 2658 2655 -2.2769786000000e+00 2701 2655 1.4018770000000e+01 2702 2655 -2.2709827000000e+00 2703 2655 -1.9874033000000e+00 1552 2656 -1.2638846000000e-03 1554 2656 -1.3190472000000e-05 2608 2656 -1.2520418000000e-02 2610 2656 -8.9669729000000e-06 2653 2656 -7.7804975000000e-04 2655 2656 -8.1200792000000e-06 2656 2656 2.3393384000000e+02 2658 2656 5.9443179000000e-04 2659 2656 -6.7042905000000e-02 2661 2656 -8.8708119000000e-06 2704 2656 -7.7850049000000e-04 2706 2656 -8.1247834000000e-06 1552 2657 7.6965209000000e-01 1554 2657 -2.1810716000000e+00 2610 2657 -1.4844173000000e+00 2655 2657 -1.3470069000000e+00 2656 2657 -1.5086242000000e+02 2657 2657 -4.4544210000000e+01 2658 2657 7.7849314000000e+00 2659 2657 3.8661218000000e+00 2661 2657 -1.4686982000000e+00 2704 2657 1.1894484000000e+01 2706 2657 -1.2987530000000e+00 1552 2658 1.3010199000000e+00 1553 2658 -2.1075945000000e-01 1554 2658 -3.6868835000000e+00 2610 2658 -2.5092590000000e+00 2655 2658 -2.2769786000000e+00 2656 2658 -2.5501783000000e+02 2657 2658 3.9359599000000e+01 2658 2658 1.3159646000000e+01 2659 2658 6.5352923000000e+00 2660 2658 -1.0586883000000e+00 2661 2658 -2.4826874000000e+00 2704 2658 2.0106436000000e+01 2705 2658 -3.2571535000000e+00 2706 2658 -2.1954121000000e+00 1555 2659 -1.1600733000000e-03 1557 2659 -1.2107049000000e-05 2611 2659 -8.9252708000000e-04 2613 2659 -9.3148164000000e-06 2656 2659 -8.4998345000000e-04 2658 2659 -8.8708119000000e-06 2659 2659 2.5737405000000e+02 2661 2659 6.5055223000000e-04 2662 2659 -1.0018150000000e-01 2664 2659 -9.7205287000000e-06 2707 2659 -3.2965212000000e-02 2709 2659 -8.6576764000000e-06 1555 2660 1.1539528000000e+00 1557 2660 -1.9797396000000e+00 2613 2660 -1.5953361000000e+00 2658 2660 -1.4686982000000e+00 2659 2660 -1.7192855000000e+02 2660 2660 -4.8997177000000e+01 2661 2660 8.0606971000000e+00 2662 2660 6.4604988000000e+00 2664 2660 -1.5926681000000e+00 2707 2660 1.6546834000000e+01 2709 2660 -1.4187729000000e+00 1555 2661 1.9506405000000e+00 1556 2661 -3.1599334000000e-01 1557 2661 -3.3465496000000e+00 2613 2661 -2.6967541000000e+00 2658 2661 -2.4826874000000e+00 2659 2661 -2.9062782000000e+02 2660 2661 4.4936312000000e+01 2661 2661 1.3625795000000e+01 2662 2661 1.0920820000000e+01 2663 2661 -1.7691144000000e+00 2664 2661 -2.6922443000000e+00 2707 2661 2.7970749000000e+01 2708 2661 -4.5311117000000e+00 2709 2661 -2.3982922000000e+00 1558 2662 -1.1056630000000e-03 1560 2662 -1.1539199000000e-05 2614 2662 -9.5104618000000e-04 2616 2662 -9.9255482000000e-06 2659 2662 -9.3140161000000e-04 2661 2662 -9.7205287000000e-06 2662 2662 2.7497376000000e+02 2664 2662 6.9434127000000e-04 2665 2662 -1.1386525000000e-01 2667 2662 -1.0527775000000e-05 2710 2662 -7.9156590000000e-02 2712 2662 -9.6995821000000e-06 1558 2663 1.8536711000000e+00 1560 2663 -1.8544138000000e+00 2616 2663 -1.6850482000000e+00 2661 2663 -1.5926681000000e+00 2662 2663 -1.8901619000000e+02 2663 2663 -5.2337002000000e+01 2664 2663 8.4010547000000e+00 2665 2663 6.7628026000000e+00 2667 2663 -1.6981766000000e+00 2710 2663 2.2556493000000e+01 2712 2663 -1.5648924000000e+00 1558 2664 3.1334456000000e+00 1559 2664 -5.0759633000000e-01 1560 2664 -3.1347010000000e+00 2616 2664 -2.8484055000000e+00 2661 2664 -2.6922443000000e+00 2662 2664 -3.1951296000000e+02 2663 2664 4.9470820000000e+01 2664 2664 1.4201141000000e+01 2665 2664 1.1431841000000e+01 2666 2664 -1.8518786000000e+00 2667 2664 -2.8705978000000e+00 2710 2664 3.8129496000000e+01 2711 2664 -6.1767123000000e+00 2712 2664 -2.6452942000000e+00 1561 2665 -1.0573977000000e-03 1563 2665 -1.1035480000000e-05 2617 2665 -9.9170737000000e-04 2619 2665 -1.0349907000000e-05 2662 2665 -1.0087504000000e-03 2664 2665 -1.0527775000000e-05 2665 2665 2.9249969000000e+02 2667 2665 7.3764742000000e-04 2668 2665 -4.6634590000000e-02 2670 2665 -1.1034998000000e-05 2713 2665 -1.3131832000000e-01 2715 2665 -1.0721463000000e-05 1561 2666 2.7340495000000e+00 1563 2666 -1.7427167000000e+00 2619 2666 -1.7411638000000e+00 2664 2666 -1.6981766000000e+00 2665 2666 -2.0339245000000e+02 2666 2666 -5.5675534000000e+01 2667 2666 8.6446883000000e+00 2668 2666 3.6380749000000e+00 2670 2666 -1.7529377000000e+00 2713 2666 2.9099360000000e+01 2715 2666 -1.7034650000000e+00 1561 2667 4.6216337000000e+00 1562 2667 -7.4866592000000e-01 1563 2667 -2.9458861000000e+00 2619 2667 -2.9432618000000e+00 2664 2667 -2.8705978000000e+00 2665 2667 -3.4381433000000e+02 2666 2667 5.3266037000000e+01 2667 2667 1.4612973000000e+01 2668 2667 6.1497971000000e+00 2669 2667 -9.9621561000000e-01 2670 2667 -2.9631636000000e+00 2713 2667 4.9189521000000e+01 2714 2667 -7.9682905000000e+00 2715 2667 -2.8795349000000e+00 1564 2668 -1.0654307000000e-03 1566 2668 -1.1119317000000e-05 2620 2668 -9.9643280000000e-04 2622 2668 -1.0399223000000e-05 2665 2668 -1.0573514000000e-03 2667 2668 -1.1034998000000e-05 2668 2668 2.9250316000000e+02 2670 2668 7.3866338000000e-04 2671 2668 -1.0608347000000e-03 2673 2668 -1.1071350000000e-05 2716 2668 -1.8115654000000e-01 2718 2668 -1.1056198000000e-05 1564 2669 3.4190776000000e+00 1566 2669 -1.7400448000000e+00 2622 2669 -1.7425884000000e+00 2667 2669 -1.7529377000000e+00 2668 2669 -2.0414700000000e+02 2669 2669 -5.5676391000000e+01 2670 2669 8.7377492000000e+00 2673 2669 -1.7528667000000e+00 2716 2669 3.2808237000000e+01 2718 2669 -1.7430828000000e+00 1564 2670 5.7796087000000e+00 1565 2670 -9.3624299000000e-01 1566 2670 -2.9413717000000e+00 2622 2670 -2.9456714000000e+00 2667 2670 -2.9631636000000e+00 2668 2670 -3.4509008000000e+02 2669 2670 5.3470185000000e+01 2670 2670 1.4770287000000e+01 2673 2670 -2.9630436000000e+00 2716 2670 5.5459044000000e+01 2717 2670 -8.9838507000000e+00 2718 2670 -2.9465071000000e+00 1567 2671 -1.0581823000000e-03 1569 2671 -1.1043669000000e-05 2623 2671 -9.9474788000000e-04 2625 2671 -1.0381639000000e-05 2668 2671 -2.1878828000000e-02 2670 2671 -1.1071350000000e-05 2671 2671 2.9251661000000e+02 2673 2671 7.3841610000000e-04 2674 2671 -1.0480451000000e-03 2676 2671 -1.0937873000000e-05 2719 2671 -1.7267209000000e-01 2721 2671 -1.1001340000000e-05 1567 2672 2.9525885000000e+00 1569 2672 -1.7372681000000e+00 2625 2672 -1.7445577000000e+00 2668 2672 2.0469226000000e+00 2670 2672 -1.7528667000000e+00 2671 2672 -2.0320912000000e+02 2672 2672 -5.5675291000000e+01 2673 2672 8.7356720000000e+00 2676 2672 -1.7526655000000e+00 2719 2672 3.0288338000000e+01 2721 2672 -1.7420857000000e+00 1567 2673 4.9910519000000e+00 1568 2673 -8.0850686000000e-01 1569 2673 -2.9366758000000e+00 2625 2673 -2.9489986000000e+00 2668 2673 3.4601153000000e+00 2669 2673 -5.6050850000000e-01 2670 2673 -2.9630436000000e+00 2671 2673 -3.4350445000000e+02 2672 2673 5.3216309000000e+01 2673 2673 1.4766772000000e+01 2676 2673 -2.9627057000000e+00 2719 2673 5.1199370000000e+01 2720 2673 -8.2938510000000e+00 2721 2673 -2.9448195000000e+00 1570 2674 -1.0414984000000e-03 1572 2674 -1.0869548000000e-05 2626 2674 -9.8756126000000e-04 2628 2674 -1.0306636000000e-05 2671 2674 -7.4649095000000e-02 2673 2674 -1.0937873000000e-05 2674 2674 2.9256049000000e+02 2676 2674 7.3773362000000e-04 2677 2674 -1.0322977000000e-03 2679 2674 -1.0773526000000e-05 2722 2674 -1.6278700000000e-01 2724 2674 -1.0872520000000e-05 1570 2675 2.1402522000000e+00 1572 2675 -1.7337240000000e+00 2628 2675 -1.7459416000000e+00 2671 2675 5.5504345000000e+00 2673 2675 -1.7526655000000e+00 2674 2675 -2.0241726000000e+02 2675 2675 -5.5674523000000e+01 2676 2675 8.7329503000000e+00 2679 2675 -1.7519398000000e+00 2722 2675 2.6804110000000e+01 2724 2675 -1.7424514000000e+00 1570 2676 3.6178823000000e+00 1571 2676 -5.8606934000000e-01 1572 2676 -2.9306871000000e+00 2628 2676 -2.9513397000000e+00 2671 2676 9.3824543000000e+00 2672 2676 -1.5198860000000e+00 2673 2676 -2.9627057000000e+00 2674 2676 -3.4216613000000e+02 2675 2676 5.3001769000000e+01 2676 2676 1.4762177000000e+01 2679 2676 -2.9614766000000e+00 2722 2676 4.5309667000000e+01 2723 2676 -7.3398205000000e+00 2724 2676 -2.9454398000000e+00 1573 2677 -1.0256101000000e-03 1575 2677 -1.0703731000000e-05 2629 2677 -9.6714994000000e-04 2631 2677 -1.0093614000000e-05 2674 2677 -9.5453332000000e-02 2676 2677 -1.0773526000000e-05 2677 2677 2.9255970000000e+02 2679 2677 7.3650612000000e-04 2680 2677 -9.8283089000000e-04 2682 2677 -1.0257268000000e-05 2725 2677 -1.4086685000000e-01 2727 2677 -1.0713617000000e-05 1573 2678 1.4879109000000e+00 1575 2678 -1.7348672000000e+00 2631 2678 -1.7279811000000e+00 2674 2678 6.7553990000000e+00 2676 2678 -1.7519398000000e+00 2677 2678 -2.0081608000000e+02 2678 2678 -5.5674209000000e+01 2679 2678 8.6610325000000e+00 2682 2678 -1.6975677000000e+00 2725 2678 2.4649625000000e+01 2727 2678 -1.7424488000000e+00 1573 2679 2.5151624000000e+00 1574 2679 -4.0744107000000e-01 1575 2679 -2.9326171000000e+00 2631 2679 -2.9209771000000e+00 2674 2679 1.1419317000000e+01 2675 2679 -1.8498602000000e+00 2676 2679 -2.9614766000000e+00 2677 2679 -3.3945922000000e+02 2678 2679 5.2564782000000e+01 2679 2679 1.4640600000000e+01 2682 2679 -2.8695684000000e+00 2725 2679 4.1667691000000e+01 2726 2679 -6.7499140000000e+00 2727 2679 -2.9454330000000e+00 1576 2680 -1.0696790000000e-03 1578 2680 -1.1163654000000e-05 2632 2680 -8.9683352000000e-04 2634 2680 -9.3597604000000e-06 2677 2680 -1.3019587000000e-01 2679 2680 -1.0257268000000e-05 2680 2680 2.7507258000000e+02 2682 2680 6.9292462000000e-04 2683 2680 -8.8381229000000e-04 2685 2680 -9.2238649000000e-06 2728 2680 -1.6083653000000e-01 2730 2680 -1.0005744000000e-05 1576 2681 1.1161550000000e+00 1578 2681 -1.8433836000000e+00 2634 2681 -1.6228397000000e+00 2677 2681 7.5559522000000e+00 2679 2681 -1.6975677000000e+00 2680 2681 -1.9145418000000e+02 2681 2681 -5.2336375000000e+01 2682 2681 8.3996613000000e+00 2685 2681 -1.5738155000000e+00 2728 2681 2.4937640000000e+01 2730 2681 -1.6561995000000e+00 1576 2682 1.8867484000000e+00 1577 2682 -3.0564480000000e-01 1578 2682 -3.1160556000000e+00 2634 2682 -2.7432483000000e+00 2677 2682 1.2772581000000e+01 2678 2682 -2.0691010000000e+00 2679 2682 -2.8695684000000e+00 2680 2682 -3.2363415000000e+02 2681 2682 5.0140954000000e+01 2682 2682 1.4198786000000e+01 2685 2682 -2.6603763000000e+00 2728 2682 4.2154587000000e+01 2729 2682 -6.8288545000000e+00 2730 2682 -2.7996396000000e+00 1579 2683 -1.1333827000000e-03 1581 2683 -1.1828495000000e-05 2635 2683 -7.9926644000000e-04 2637 2683 -8.3415062000000e-06 2680 2683 -1.6001362000000e-01 2682 2683 -9.2238649000000e-06 2683 2683 2.5155729000000e+02 2685 2683 6.1757781000000e-04 1579 2684 8.0249788000000e-01 1581 2684 -2.0156766000000e+00 2637 2684 -1.4660613000000e+00 2680 2684 1.2057719000000e+01 2682 2684 -1.5738155000000e+00 2683 2684 -1.5727378000000e+02 2684 2684 -4.7880521000000e+01 2685 2684 5.0609096000000e+00 1579 2685 1.3565417000000e+00 1580 2685 -2.1975770000000e-01 1581 2685 -3.4072979000000e+00 2637 2685 -2.4782283000000e+00 2680 2685 2.0382357000000e+01 2681 2685 -3.3019111000000e+00 2682 2685 -2.6603763000000e+00 2683 2685 -2.6585545000000e+02 2684 2685 4.0980820000000e+01 2685 2685 8.5549565000000e+00 2686 2686 1.0000000000000e+00 2687 2687 1.0000000000000e+00 2688 2688 1.0000000000000e+00 2689 2689 1.0000000000000e+00 2690 2690 1.0000000000000e+00 2691 2691 1.0000000000000e+00 2692 2692 1.0000000000000e+00 2693 2693 1.0000000000000e+00 2694 2694 1.0000000000000e+00 2695 2695 1.0000000000000e+00 2696 2696 1.0000000000000e+00 2697 2697 1.0000000000000e+00 2698 2698 1.0000000000000e+00 2699 2699 1.0000000000000e+00 2700 2700 1.0000000000000e+00 1597 2701 -1.6629540000000e-03 1599 2701 -1.7355340000000e-05 2653 2701 -1.7666840000000e-02 2655 2701 -7.2827492000000e-06 2701 2701 1.8127945000000e+02 2703 2701 4.6222261000000e-04 2704 2701 -4.6208187000000e-02 2706 2701 -7.1392325000000e-06 2749 2701 -6.1374639000000e-04 2751 2701 -6.4053350000000e-06 1597 2702 6.3855364000000e-01 1599 2702 -2.7994161000000e+00 2655 2702 -1.1757010000000e+00 2701 2702 -1.1421835000000e+02 2702 2702 -3.4541974000000e+01 2703 2702 6.1408649000000e+00 2704 2702 2.9579518000000e+00 2706 2702 -1.1526676000000e+00 2749 2702 6.5420961000000e+00 2751 2702 -1.0092086000000e+00 1597 2703 1.0794105000000e+00 1598 2703 -1.7485713000000e-01 1599 2703 -4.7321305000000e+00 2655 2703 -1.9874033000000e+00 2701 2703 -1.9307461000000e+02 2702 2703 2.9714594000000e+01 2703 2703 1.0380512000000e+01 2704 2703 5.0001190000000e+00 2705 2703 -8.0998503000000e-01 2706 2703 -1.9484682000000e+00 2749 2703 1.1058753000000e+01 2750 2703 -1.7914423000000e+00 2751 2703 -1.7059653000000e+00 1600 2704 -1.4890944000000e-03 1602 2704 -1.5540863000000e-05 2656 2704 -1.4379690000000e-02 2658 2704 -8.1247834000000e-06 2701 2704 -6.8406698000000e-04 2703 2704 -7.1392325000000e-06 2704 2704 2.0472575000000e+02 2706 2704 5.2461509000000e-04 2707 2704 -1.0061139000000e-01 2709 2704 -7.9893061000000e-06 2752 2704 -1.2523663000000e-02 2754 2704 -7.0613706000000e-06 1600 2705 9.4957271000000e-01 1602 2705 -2.4812165000000e+00 2658 2705 -1.2987530000000e+00 2703 2705 -1.1526676000000e+00 2704 2705 -1.3443133000000e+02 2705 2705 -3.8998572000000e+01 2706 2705 7.3433625000000e+00 2707 2705 6.5601441000000e+00 2709 2705 -1.2772784000000e+00 2752 2705 9.4117655000000e+00 2754 2705 -1.1290759000000e+00 1600 2706 1.6051577000000e+00 1601 2706 -2.6002288000000e-01 1602 2706 -4.1942484000000e+00 2658 2706 -2.1954121000000e+00 2703 2706 -1.9484682000000e+00 2704 2706 -2.2724272000000e+02 2705 2706 3.5048730000000e+01 2706 2706 1.2413219000000e+01 2707 2706 1.1089268000000e+01 2708 2706 -1.7963738000000e+00 2709 2706 -2.1591114000000e+00 2752 2706 1.5909648000000e+01 2753 2706 -2.5772374000000e+00 2754 2706 -1.9085899000000e+00 1603 2707 -1.4015836000000e-03 1605 2707 -1.4627561000000e-05 2659 2707 -8.2956124000000e-04 2661 2707 -8.6576764000000e-06 2704 2707 -7.6551933000000e-04 2706 2707 -7.9893061000000e-06 2707 2707 2.2230395000000e+02 2709 2707 5.6808927000000e-04 2710 2707 -1.2762543000000e-01 2712 2707 -9.0204335000000e-06 2755 2707 -3.9837085000000e-02 2757 2707 -7.9881879000000e-06 1603 2708 1.8125664000000e+00 1605 2708 -2.2875832000000e+00 2661 2708 -1.4187729000000e+00 2706 2708 -1.2772784000000e+00 2707 2708 -1.5295853000000e+02 2708 2708 -4.2340527000000e+01 2709 2708 7.6553068000000e+00 2710 2708 9.6268453000000e+00 2712 2708 -1.4142972000000e+00 2755 2708 1.3936147000000e+01 2757 2708 -1.2526296000000e+00 1603 2709 3.0639608000000e+00 1604 2709 -4.9633165000000e-01 1605 2709 -3.8669288000000e+00 2661 2709 -2.3982922000000e+00 2706 2709 -2.1591114000000e+00 2707 2709 -2.5856097000000e+02 2708 2709 3.9972265000000e+01 2709 2709 1.2940525000000e+01 2710 2709 1.6273212000000e+01 2711 2709 -2.6361010000000e+00 2712 2709 -2.3907268000000e+00 2755 2709 2.3557652000000e+01 2756 2709 -3.8161090000000e+00 2757 2709 -2.1174440000000e+00 1606 2710 -1.2704236000000e-03 1608 2710 -1.3258716000000e-05 2662 2710 -9.2939455000000e-04 2664 2710 -9.6995821000000e-06 2707 2710 -8.6431990000000e-04 2709 2710 -9.0204335000000e-06 2710 2710 2.5163973000000e+02 2712 2710 6.3979946000000e-04 2713 2710 -1.4877012000000e-01 2715 2710 -1.0399190000000e-05 2758 2710 -1.2819117000000e-01 2760 2710 -9.2072237000000e-06 1606 2711 3.3798375000000e+00 1608 2711 -2.0154729000000e+00 2664 2711 -1.5648924000000e+00 2709 2711 -1.4142972000000e+00 2710 2711 -1.7909886000000e+02 2711 2711 -4.7913181000000e+01 2712 2711 7.9985067000000e+00 2713 2711 1.0574914000000e+01 2715 2711 -1.5902782000000e+00 2758 2711 2.0776367000000e+01 2760 2711 -1.4081953000000e+00 1606 2712 5.7132773000000e+00 1607 2712 -9.2547996000000e-01 1608 2712 -3.4069554000000e+00 2664 2712 -2.6452942000000e+00 2709 2712 -2.3907268000000e+00 2710 2712 -3.0274871000000e+02 2711 2712 4.6873893000000e+01 2712 2712 1.3520675000000e+01 2713 2712 1.7875834000000e+01 2714 2712 -2.8956631000000e+00 2715 2712 -2.6882062000000e+00 2758 2712 3.5120371000000e+01 2759 2712 -5.6890638000000e+00 2760 2712 -2.3804134000000e+00 1609 2713 -5.0642588000000e-03 1611 2713 -1.2127795000000e-05 2665 2713 -1.0273091000000e-03 2667 2713 -1.0721463000000e-05 2710 2713 -9.9642962000000e-04 2712 2713 -1.0399190000000e-05 2713 2713 2.8086435000000e+02 2715 2713 7.1210420000000e-04 2716 2713 -9.1822370000000e-02 2718 2713 -1.1503691000000e-05 2761 2713 -1.7873749000000e-01 2763 2713 -1.0725980000000e-05 1609 2714 5.6128305000000e+00 1611 2714 -1.8107620000000e+00 2667 2714 -1.7034650000000e+00 2712 2714 -1.5902782000000e+00 2713 2714 -2.0370738000000e+02 2714 2714 -5.3485001000000e+01 2715 2714 8.4296870000000e+00 2716 2714 6.5513147000000e+00 2718 2714 -1.7174988000000e+00 2761 2714 3.0389582000000e+01 2763 2714 -1.6016877000000e+00 1609 2715 9.4879220000000e+00 1610 2715 -1.5369025000000e+00 1611 2715 -3.0609100000000e+00 2667 2715 -2.8795349000000e+00 2712 2715 -2.6882062000000e+00 2713 2715 -3.4434672000000e+02 2714 2715 5.3357989000000e+01 2715 2715 1.4249535000000e+01 2716 2715 1.1074335000000e+01 2717 2715 -1.7938779000000e+00 2718 2715 -2.9032579000000e+00 2761 2715 5.1370514000000e+01 2762 2715 -8.3212602000000e+00 2763 2715 -2.7074910000000e+00 1612 2716 -2.4425209000000e-02 1614 2716 -1.1764342000000e-05 2668 2716 -1.0593828000000e-03 2670 2716 -1.1056198000000e-05 2713 2716 -1.1022607000000e-03 2715 2716 -1.1503691000000e-05 2716 2716 2.9260413000000e+02 2718 2716 7.4196018000000e-04 2719 2716 -1.1302282000000e-03 2721 2716 -1.1795573000000e-05 2764 2716 -2.9916952000000e-01 2766 2716 -1.1845982000000e-05 1612 2717 7.5049402000000e+00 1614 2717 -1.7330264000000e+00 2670 2717 -1.7430828000000e+00 2715 2717 -1.7174988000000e+00 2716 2717 -2.1477488000000e+02 2717 2717 -5.5713949000000e+01 2718 2717 8.6985085000000e+00 2721 2717 -1.7533842000000e+00 2764 2717 3.9402394000000e+01 2766 2717 -1.7452709000000e+00 1612 2718 1.2686351000000e+01 1613 2718 -2.0549809000000e+00 1614 2718 -2.9295078000000e+00 2670 2718 -2.9465071000000e+00 2715 2718 -2.9032579000000e+00 2716 2718 -3.6305546000000e+02 2717 2718 5.6285871000000e+01 2718 2718 1.4703956000000e+01 2721 2718 -2.9639196000000e+00 2764 2718 6.6605807000000e+01 2765 2718 -1.0789049000000e+01 2766 2718 -2.9502058000000e+00 1615 2719 -7.5910558000000e-03 1617 2719 -1.1689435000000e-05 2671 2719 -1.0541264000000e-03 2673 2719 -1.1001340000000e-05 2716 2719 -3.0381201000000e-02 2718 2719 -1.1795573000000e-05 2719 2719 2.9251143000000e+02 2721 2719 7.4179220000000e-04 2722 2719 -1.1095801000000e-03 2724 2719 -1.1580080000000e-05 2767 2719 -1.8912806000000e-01 2769 2719 -1.1733822000000e-05 1615 2720 5.8632704000000e+00 1617 2720 -1.7376559000000e+00 2673 2720 -1.7420857000000e+00 2716 2720 4.5648266000000e+00 2718 2720 -1.7533842000000e+00 2719 2720 -2.1023215000000e+02 2720 2720 -5.5709291000000e+01 2721 2720 8.7370563000000e+00 2724 2720 -1.7532047000000e+00 2767 2720 3.1930030000000e+01 2769 2720 -1.7444824000000e+00 1615 2721 9.9112681000000e+00 1616 2721 -1.6054733000000e+00 1617 2721 -2.9373322000000e+00 2673 2721 -2.9448195000000e+00 2716 2721 7.7163801000000e+00 2717 2721 -1.2499351000000e+00 2718 2721 -2.9639196000000e+00 2719 2721 -3.5537629000000e+02 2720 2721 5.5053787000000e+01 2721 2721 1.4769114000000e+01 2724 2721 -2.9636172000000e+00 2767 2721 5.3974502000000e+01 2768 2721 -8.7430406000000e+00 2769 2721 -2.9488718000000e+00 1618 2722 -1.1102163000000e-03 1620 2722 -1.1586719000000e-05 2674 2722 -1.0417831000000e-03 2676 2722 -1.0872520000000e-05 2719 2722 -8.4683273000000e-02 2721 2722 -1.1580080000000e-05 2722 2722 2.9248778000000e+02 2724 2722 7.4090287000000e-04 2725 2722 -1.0889092000000e-03 2727 2722 -1.1364349000000e-05 2770 2722 -1.1103176000000e-01 2772 2722 -1.1514036000000e-05 1618 2723 3.7457762000000e+00 1620 2723 -1.7408475000000e+00 2676 2723 -1.7424514000000e+00 2719 2723 9.0636672000000e+00 2721 2723 -1.7532047000000e+00 2722 2723 -2.0660967000000e+02 2723 2723 -5.5703345000000e+01 2724 2723 8.7388936000000e+00 2727 2723 -1.7526895000000e+00 2770 2723 2.5917748000000e+01 2772 2723 -1.7434598000000e+00 1618 2724 6.3318601000000e+00 1619 2724 -1.0256761000000e+00 1620 2724 -2.9427286000000e+00 2676 2724 -2.9454398000000e+00 2719 2724 1.5321223000000e+01 2720 2724 -2.4818319000000e+00 2721 2724 -2.9636172000000e+00 2722 2724 -3.4925298000000e+02 2723 2724 5.4077195000000e+01 2724 2724 1.4772224000000e+01 2727 2724 -2.9627448000000e+00 2770 2724 4.3811362000000e+01 2771 2724 -7.0968508000000e+00 2772 2724 -2.9471445000000e+00 1621 2725 -1.0870975000000e-03 1623 2725 -1.1345441000000e-05 2677 2725 -1.0265574000000e-03 2679 2725 -1.0713617000000e-05 2722 2725 -1.1755392000000e-01 2724 2725 -1.1364349000000e-05 2725 2725 2.9248715000000e+02 2727 2725 7.3968854000000e-04 2728 2725 -1.0525810000000e-03 2730 2725 -1.0985212000000e-05 2773 2725 -7.5843231000000e-02 2775 2725 -1.1305784000000e-05 1621 2726 2.3393978000000e+00 1623 2726 -1.7413736000000e+00 2679 2726 -1.7424488000000e+00 2722 2726 8.9243960000000e+00 2724 2726 -1.7526895000000e+00 2725 2726 -2.0161014000000e+02 2726 2726 -5.5701882000000e+01 2727 2726 8.7033340000000e+00 2730 2726 -1.7166474000000e+00 2773 2726 2.2461520000000e+01 2775 2726 -1.7439346000000e+00 1621 2727 3.9545158000000e+00 1622 2727 -6.4058624000000e-01 1623 2727 -2.9436164000000e+00 2679 2727 -2.9454330000000e+00 2722 2727 1.5085791000000e+01 2723 2727 -2.4437253000000e+00 2724 2727 -2.9627448000000e+00 2725 2727 -3.4080161000000e+02 2726 2727 5.2712667000000e+01 2727 2727 1.4712108000000e+01 2730 2727 -2.9018208000000e+00 2773 2727 3.7968935000000e+01 2774 2727 -6.1505323000000e+00 2775 2727 -2.9479454000000e+00 1624 2728 -1.1157723000000e-03 1626 2728 -1.1644704000000e-05 2680 2728 -9.5873036000000e-04 2682 2728 -1.0005744000000e-05 2725 2728 -1.0373638000000e-01 2727 2728 -1.0985212000000e-05 2728 2728 2.8076162000000e+02 2730 2728 7.0006857000000e-04 2776 2728 -5.8737235000000e-02 2778 2728 -1.0827533000000e-05 1624 2729 1.7290239000000e+00 1626 2729 -1.8134713000000e+00 2682 2729 -1.6561995000000e+00 2725 2729 6.0763390000000e+00 2727 2729 -1.7166474000000e+00 2728 2729 -1.8895409000000e+02 2729 2729 -5.3475766000000e+01 2730 2729 6.8846034000000e+00 2776 2729 1.9981820000000e+01 2778 2729 -1.6922940000000e+00 1624 2730 2.9227420000000e+00 1625 2730 -4.7345444000000e-01 1626 2730 -3.0654918000000e+00 2682 2730 -2.7996396000000e+00 2725 2730 1.0271443000000e+01 2726 2730 -1.6638692000000e+00 2727 2730 -2.9018208000000e+00 2728 2730 -3.1940800000000e+02 2729 2730 4.9342559000000e+01 2730 2730 1.1637733000000e+01 2776 2730 3.3777269000000e+01 2777 2730 -5.4715737000000e+00 2778 2730 -2.8606537000000e+00 2731 2731 1.0000000000000e+00 2732 2732 1.0000000000000e+00 2733 2733 1.0000000000000e+00 2734 2734 1.0000000000000e+00 2735 2735 1.0000000000000e+00 2736 2736 1.0000000000000e+00 2737 2737 1.0000000000000e+00 2738 2738 1.0000000000000e+00 2739 2739 1.0000000000000e+00 2740 2740 1.0000000000000e+00 2741 2741 1.0000000000000e+00 2742 2742 1.0000000000000e+00 2743 2743 1.0000000000000e+00 2744 2744 1.0000000000000e+00 2745 2745 1.0000000000000e+00 2746 2746 1.0000000000000e+00 2747 2747 1.0000000000000e+00 2748 2748 1.0000000000000e+00 1645 2749 -1.9485883000000e-03 1647 2749 -2.0336349000000e-05 2701 2749 -6.8896215000000e-03 2703 2749 -6.4053350000000e-06 2749 2749 1.5788405000000e+02 2751 2749 4.0803991000000e-04 2752 2749 -5.6619370000000e-02 2754 2749 -6.3257706000000e-06 2797 2749 -5.8544193000000e-04 2799 2749 -5.6495585000000e-06 1645 2750 6.3186954000000e-01 1647 2750 -3.2022787000000e+00 2703 2750 -1.0092086000000e+00 2749 2750 -9.8805163000000e+01 2750 2750 -3.0096993000000e+01 2751 2750 6.1019210000000e+00 2752 2750 4.4049677000000e+00 2754 2750 -9.9678295000000e-01 2797 2750 3.1349304000000e+00 2799 2750 -8.9027329000000e-01 1645 2751 1.0681115000000e+00 1646 2751 -1.7302417000000e-01 1647 2751 -5.4131281000000e+00 2703 2751 -1.7059653000000e+00 2749 2751 -1.6702013000000e+02 2750 2751 2.5665630000000e+01 2751 2751 1.0314680000000e+01 2752 2751 7.4461520000000e+00 2753 2751 -1.2062076000000e+00 2754 2751 -1.6849607000000e+00 2797 2751 5.2992825000000e+00 2798 2751 -8.5843462000000e-01 2799 2751 -1.5049169000000e+00 1648 2752 -1.7858554000000e-03 1650 2752 -1.8637995000000e-05 2704 2752 -6.7660641000000e-04 2706 2752 -7.0613706000000e-06 2749 2752 -6.0612268000000e-04 2751 2752 -6.3257706000000e-06 2752 2752 1.7547880000000e+02 2754 2752 4.5601491000000e-04 2755 2752 -1.1110441000000e-01 2757 2752 -7.2066013000000e-06 2800 2752 -1.2406400000000e-02 2802 2752 -6.4187999000000e-06 1648 2753 1.1698018000000e+00 1650 2753 -2.8848554000000e+00 2706 2753 -1.1290759000000e+00 2751 2753 -9.9678295000000e-01 2752 2753 -1.1634166000000e+02 2753 2753 -3.3442061000000e+01 2754 2753 7.1265019000000e+00 2755 2753 8.8524187000000e+00 2757 2753 -1.1170418000000e+00 2800 2753 5.6171805000000e+00 2802 2753 -9.9499262000000e-01 1648 2754 1.9774329000000e+00 1649 2754 -3.2032228000000e-01 1650 2754 -4.8765596000000e+00 2706 2754 -1.9085899000000e+00 2751 2754 -1.6849607000000e+00 2752 2754 -1.9666394000000e+02 2753 2754 3.0310371000000e+01 2754 2754 1.2046637000000e+01 2755 2754 1.4964129000000e+01 2756 2754 -2.4240235000000e+00 2757 2754 -1.8882474000000e+00 2800 2754 9.4952819000000e+00 2801 2754 -1.5381307000000e+00 2802 2754 -1.6819355000000e+00 1651 2755 -1.6296921000000e-03 1653 2755 -1.7008204000000e-05 2707 2755 -7.6541219000000e-04 2709 2755 -7.9881879000000e-06 2752 2755 -6.9052212000000e-04 2754 2755 -7.2066013000000e-06 2755 2755 1.9894931000000e+02 2757 2755 5.1304880000000e-04 2758 2755 -1.8796678000000e-01 2760 2755 -8.3498387000000e-06 2803 2755 -2.8417687000000e-02 2805 2755 -7.4056227000000e-06 1651 2756 2.6875379000000e+00 1653 2756 -2.5521445000000e+00 2709 2756 -1.2526296000000e+00 2754 2756 -1.1170418000000e+00 2755 2756 -1.3896930000000e+02 2756 2756 -3.7903255000000e+01 2757 2756 7.2995082000000e+00 2758 2756 1.3123630000000e+01 2760 2756 -1.2577767000000e+00 2803 2756 9.0322981000000e+00 2805 2756 -1.1156610000000e+00 1651 2757 4.5430105000000e+00 1652 2757 -7.3590446000000e-01 1653 2757 -4.3141417000000e+00 2709 2757 -2.1174440000000e+00 2754 2757 -1.8882474000000e+00 2755 2757 -2.3491353000000e+02 2756 2757 3.6293837000000e+01 2757 2757 1.2339081000000e+01 2758 2757 2.2184168000000e+01 2759 2757 -3.5935266000000e+00 2760 2757 -2.1261440000000e+00 2803 2757 1.5268185000000e+01 2804 2757 -2.4732336000000e+00 2805 2757 -1.8859120000000e+00 1654 2758 -1.1397067000000e-02 1656 2758 -1.5750990000000e-05 2710 2758 -8.8221776000000e-04 2712 2758 -9.2072237000000e-06 2755 2758 -8.0006484000000e-04 2757 2758 -8.3498387000000e-06 2758 2758 2.2233358000000e+02 2760 2758 5.7188245000000e-04 2761 2758 -1.6313315000000e-01 2763 2758 -9.8498578000000e-06 2806 2758 -4.7986726000000e-02 2808 2758 -8.8984680000000e-06 1654 2759 6.2010410000000e+00 1656 2759 -2.2862821000000e+00 2712 2759 -1.4081953000000e+00 2757 2759 -1.2577767000000e+00 2758 2759 -1.6380015000000e+02 2759 2759 -4.2362572000000e+01 2760 2759 7.6785119000000e+00 2761 2759 1.5538893000000e+01 2763 2759 -1.4297386000000e+00 2806 2759 1.4508479000000e+01 2808 2759 -1.2917639000000e+00 1654 2760 1.0482240000000e+01 1655 2760 -1.6979338000000e+00 1656 2760 -3.8647313000000e+00 2712 2760 -2.3804134000000e+00 2757 2760 -2.1261440000000e+00 2758 2760 -2.7688778000000e+02 2759 2760 4.2884400000000e+01 2760 2760 1.2979755000000e+01 2761 2760 2.6266945000000e+01 2762 2760 -4.2547715000000e+00 2763 2760 -2.4168301000000e+00 2806 2760 2.4525133000000e+01 2807 2760 -3.9726294000000e+00 2808 2760 -2.1835977000000e+00 1657 2761 -6.8801674000000e-02 1659 2761 -1.4097767000000e-05 2713 2761 -1.0277419000000e-03 2715 2761 -1.0725980000000e-05 2758 2761 -9.4379367000000e-04 2760 2761 -9.8498578000000e-06 2761 2761 2.5758060000000e+02 2763 2761 6.5892147000000e-04 2764 2761 -1.8589673000000e-01 2766 2761 -1.1723957000000e-05 2809 2761 -1.5404578000000e-01 2811 2761 -1.0604971000000e-05 1657 2762 1.1863207000000e+01 1659 2762 -1.9732535000000e+00 2715 2762 -1.6016877000000e+00 2760 2762 -1.4297386000000e+00 2761 2762 -1.9628414000000e+02 2762 2762 -4.9059757000000e+01 2763 2762 8.1355860000000e+00 2764 2762 1.2169841000000e+01 2766 2762 -1.6408829000000e+00 2809 2762 2.4571690000000e+01 2811 2762 -1.4845134000000e+00 1657 2763 2.0053552000000e+01 1658 2763 -3.2482342000000e+00 1659 2763 -3.3355854000000e+00 2715 2763 -2.7074910000000e+00 2760 2763 -2.4168301000000e+00 2761 2763 -3.3179848000000e+02 2762 2763 5.1446462000000e+01 2763 2763 1.3752387000000e+01 2764 2763 2.0571884000000e+01 2765 2763 -3.3321924000000e+00 2766 2763 -2.7737464000000e+00 2809 2763 4.1535956000000e+01 2810 2763 -6.7279109000000e+00 2811 2763 -2.5094197000000e+00 1660 2764 -1.1943183000000e-01 1662 2764 -1.2728050000000e-05 2716 2764 -1.1350583000000e-03 2718 2764 -1.1845982000000e-05 2761 2764 -1.1233661000000e-03 2763 2764 -1.1723957000000e-05 2764 2764 2.9273776000000e+02 2766 2764 7.4540679000000e-04 2767 2764 -1.2031711000000e-03 2769 2764 -1.2556838000000e-05 2812 2764 -3.7509276000000e-01 2814 2764 -1.2533584000000e-05 1660 2765 1.6863026000000e+01 1662 2765 -1.7378832000000e+00 2718 2765 -1.7452709000000e+00 2763 2765 -1.6408829000000e+00 2764 2765 -2.3456261000000e+02 2765 2765 -5.5748297000000e+01 2766 2765 8.5957874000000e+00 2769 2765 -1.7538992000000e+00 2812 2765 4.9880579000000e+01 2814 2765 -1.7115905000000e+00 1660 2766 2.8505260000000e+01 1661 2766 -4.6171404000000e+00 1662 2766 -2.9377177000000e+00 2718 2766 -2.9502058000000e+00 2763 2766 -2.7737464000000e+00 2764 2766 -3.9650463000000e+02 2765 2766 6.1616126000000e+01 2766 2766 1.4530315000000e+01 2769 2766 -2.9647895000000e+00 2812 2766 8.4318130000000e+01 2813 2766 -1.3657432000000e+01 2814 2766 -2.8932726000000e+00 1663 2767 -6.0944376000000e-02 1665 2767 -1.2416937000000e-05 2719 2767 -1.1243114000000e-03 2721 2767 -1.1733822000000e-05 2764 2767 -1.4093544000000e-01 2766 2767 -1.2556838000000e-05 2767 2767 2.9261218000000e+02 2769 2767 7.4542913000000e-04 2770 2767 -1.1687854000000e-03 2772 2767 -1.2197973000000e-05 2815 2767 -1.6354702000000e-01 2817 2767 -1.2518373000000e-05 1663 2768 1.1099187000000e+01 1665 2768 -1.7344354000000e+00 2721 2768 -1.7444824000000e+00 2764 2768 1.2060554000000e+01 2766 2768 -1.7538992000000e+00 2767 2768 -2.1790806000000e+02 2768 2768 -5.5744062000000e+01 2769 2768 8.7415519000000e+00 2772 2768 -1.7537264000000e+00 2815 2768 2.6923069000000e+01 2817 2768 -1.7487497000000e+00 1663 2769 1.8762053000000e+01 1664 2769 -3.0390354000000e+00 1665 2769 -2.9318876000000e+00 2721 2769 -2.9488718000000e+00 2764 2769 2.0387148000000e+01 2765 2769 -3.3022646000000e+00 2766 2769 -2.9647895000000e+00 2767 2769 -3.6835155000000e+02 2768 2769 5.7067662000000e+01 2769 2769 1.4776712000000e+01 2772 2769 -2.9644990000000e+00 2815 2769 4.5510728000000e+01 2816 2769 -7.3717256000000e+00 2817 2769 -2.9560846000000e+00 1666 2770 -9.7364176000000e-03 1668 2770 -1.2057755000000e-05 2722 2770 -1.1032519000000e-03 2724 2770 -1.1514036000000e-05 2767 2770 -1.6315817000000e-01 2769 2770 -1.2197973000000e-05 2770 2770 2.9253163000000e+02 2772 2770 7.4382185000000e-04 2773 2770 -1.1401135000000e-03 2775 2770 -1.1898740000000e-05 2818 2770 -1.0412500000000e-01 2820 2770 -1.2162317000000e-05 1666 2771 6.0604122000000e+00 1668 2771 -1.7335935000000e+00 2724 2771 -1.7434598000000e+00 2767 2771 1.5094148000000e+01 2769 2771 -1.7537264000000e+00 2770 2771 -2.0922440000000e+02 2771 2771 -5.5737111000000e+01 2772 2771 8.7390582000000e+00 2775 2771 -1.7532679000000e+00 2818 2771 2.0234483000000e+01 2820 2771 -1.7487549000000e+00 1666 2772 1.0244521000000e+01 1667 2772 -1.6594169000000e+00 1668 2772 -2.9304664000000e+00 2724 2772 -2.9471445000000e+00 2767 2772 2.5515148000000e+01 2768 2772 -4.1329672000000e+00 2769 2772 -2.9644990000000e+00 2770 2772 -3.5367293000000e+02 2771 2772 5.4708381000000e+01 2772 2772 1.4772502000000e+01 2775 2772 -2.9637219000000e+00 2818 2772 3.4204370000000e+01 2819 2772 -5.5404554000000e+00 2820 2772 -2.9560952000000e+00 1669 2773 -1.1345264000000e-03 1671 2773 -1.1840431000000e-05 2725 2773 -1.0832977000000e-03 2727 2773 -1.1305784000000e-05 2770 2773 -1.5298635000000e-01 2772 2773 -1.1898740000000e-05 2773 2773 2.9249952000000e+02 2775 2773 7.4248403000000e-04 2776 2773 -1.1102413000000e-03 2778 2773 -1.1586981000000e-05 2821 2773 -8.7072756000000e-02 2823 2773 -1.1875363000000e-05 1669 2774 3.3681829000000e+00 1671 2774 -1.7329727000000e+00 2727 2774 -1.7439346000000e+00 2770 2774 1.2407653000000e+01 2772 2774 -1.7532679000000e+00 2773 2774 -2.0133903000000e+02 2774 2774 -5.5733785000000e+01 2775 2774 8.7217496000000e+00 2778 2774 -1.7353310000000e+00 2821 2774 1.7722819000000e+01 2823 2774 -1.7499893000000e+00 1669 2775 5.6935723000000e+00 1670 2775 -9.2226603000000e-01 1671 2775 -2.9294150000000e+00 2727 2775 -2.9479454000000e+00 2770 2775 2.0973881000000e+01 2771 2775 -3.3974275000000e+00 2772 2775 -2.9637219000000e+00 2773 2775 -3.4034325000000e+02 2774 2775 5.2558623000000e+01 2775 2775 1.4743237000000e+01 2778 2775 -2.9334035000000e+00 2821 2775 2.9958631000000e+01 2822 2775 -4.8528105000000e+00 2823 2775 -2.9581798000000e+00 1672 2776 -1.1357195000000e-03 1674 2776 -1.1852882000000e-05 2728 2776 -1.0374725000000e-03 2730 2776 -1.0827533000000e-05 2773 2776 -1.2009796000000e-01 2775 2776 -1.1586981000000e-05 2776 2776 2.8658158000000e+02 2778 2776 7.1611912000000e-04 2824 2776 -4.8588756000000e-02 2826 2776 -1.1565613000000e-05 1672 2777 2.2946266000000e+00 1674 2777 -1.7671616000000e+00 2730 2777 -1.6922940000000e+00 2773 2777 8.0019043000000e+00 2775 2777 -1.7353310000000e+00 2776 2777 -1.8742792000000e+02 2777 2777 -5.4619660000000e+01 2778 2777 6.9332076000000e+00 2824 2777 1.2648323000000e+01 2826 2777 -1.7322918000000e+00 1672 2778 3.8788368000000e+00 1673 2778 -6.2831477000000e-01 1674 2778 -2.9872100000000e+00 2730 2778 -2.8606537000000e+00 2773 2778 1.3526419000000e+01 2774 2778 -2.1910817000000e+00 2775 2778 -2.9334035000000e+00 2776 2778 -3.1682815000000e+02 2777 2778 4.8800221000000e+01 2778 2778 1.1719894000000e+01 2824 2778 2.1380725000000e+01 2825 2778 -3.4633644000000e+00 2826 2778 -2.9282661000000e+00 2779 2779 1.0000000000000e+00 2780 2780 1.0000000000000e+00 2781 2781 1.0000000000000e+00 2782 2782 1.0000000000000e+00 2783 2783 1.0000000000000e+00 2784 2784 1.0000000000000e+00 2785 2785 1.0000000000000e+00 2786 2786 1.0000000000000e+00 2787 2787 1.0000000000000e+00 2788 2788 1.0000000000000e+00 2789 2789 1.0000000000000e+00 2790 2790 1.0000000000000e+00 2791 2791 1.0000000000000e+00 2792 2792 1.0000000000000e+00 2793 2793 1.0000000000000e+00 1690 2794 -2.6367206000000e-03 1692 2794 -2.7518009000000e-05 2794 2794 1.1691798000000e+02 2796 2794 3.1040631000000e-04 2797 2794 -1.5879240000000e-02 2799 2794 -4.8749114000000e-06 2842 2794 -4.2567276000000e-04 2844 2794 -4.4425135000000e-06 1690 2795 3.0894644000000e-01 1692 2795 -4.3198103000000e+00 2794 2795 -6.9421330000000e+01 2795 2795 -2.2297074000000e+01 2796 2795 5.7891290000000e+00 2797 2795 1.9807205000000e+00 2799 2795 -7.6539824000000e-01 2844 2795 -7.0141742000000e-01 1690 2796 5.2224306000000e-01 1691 2796 -8.4598286000000e-02 1692 2796 -7.3022073000000e+00 2794 2796 -1.1734982000000e+02 2795 2796 1.7972447000000e+01 2796 2796 9.7859437000000e+00 2797 2796 3.3482100000000e+00 2798 2796 -5.4237739000000e-01 2799 2796 -1.2938292000000e+00 2844 2796 -1.1856760000000e+00 1693 2797 -2.2213481000000e-03 1695 2797 -2.3182994000000e-05 2749 2797 -5.4132940000000e-04 2751 2797 -5.6495585000000e-06 2794 2797 -4.6710426000000e-04 2796 2797 -4.8749114000000e-06 2797 2797 1.4034169000000e+02 2799 2797 3.7264749000000e-04 2800 2797 -6.1160249000000e-02 2802 2797 -5.7321406000000e-06 2845 2797 -4.7157255000000e-04 2847 2797 -4.9215445000000e-06 1693 2798 5.3417080000000e-01 1695 2798 -3.6029813000000e+00 2751 2798 -8.9027329000000e-01 2796 2798 -7.6539824000000e-01 2797 2798 -8.7160026000000e+01 2798 2798 -2.6758321000000e+01 2799 2798 6.9178904000000e+00 2800 2798 5.8331968000000e+00 2802 2798 -8.9151591000000e-01 2845 2798 2.3724452000000e-01 2847 2798 -7.6471706000000e-01 1693 2799 9.0296180000000e-01 1694 2799 -1.4627021000000e-01 1695 2799 -6.0904761000000e+00 2751 2799 -1.5049169000000e+00 2796 2799 -1.2938292000000e+00 2797 2799 -1.4733522000000e+02 2798 2799 2.2617766000000e+01 2799 2799 1.1693996000000e+01 2800 2799 9.8604302000000e+00 2801 2799 -1.5972850000000e+00 2802 2799 -1.5070176000000e+00 2845 2799 4.0103791000000e-01 2846 2799 -6.4963886000000e-02 2847 2799 -1.2926770000000e+00 1696 2800 -2.0249245000000e-03 1698 2800 -2.1133029000000e-05 2752 2800 -6.1503657000000e-04 2754 2800 -6.4187999000000e-06 2797 2800 -5.4924225000000e-04 2799 2800 -5.7321406000000e-06 2800 2800 1.5792382000000e+02 2802 2800 4.1507500000000e-04 2803 2800 -1.1209667000000e-01 2805 2800 -6.5647585000000e-06 2848 2800 -5.6517062000000e-04 2850 2800 -5.8983763000000e-06 1696 2801 1.2295079000000e+00 1698 2801 -3.2050468000000e+00 2754 2801 -9.9499262000000e-01 2799 2801 -8.9151591000000e-01 2800 2801 -1.0373876000000e+02 2801 2801 -3.0106230000000e+01 2802 2801 6.9820971000000e+00 2803 2801 1.0342836000000e+01 2805 2801 -9.9693289000000e-01 2848 2801 1.5461141000000e+00 2850 2801 -8.9022740000000e-01 1696 2802 2.0783602000000e+00 1697 2802 -3.3666692000000e-01 1698 2802 -5.4178110000000e+00 2754 2802 -1.6819355000000e+00 2799 2802 -1.5070176000000e+00 2800 2802 -1.7536000000000e+02 2801 2802 2.6993128000000e+01 2802 2802 1.1802536000000e+01 2803 2802 1.7483529000000e+01 2804 2802 -2.8321010000000e+00 2805 2802 -1.6852153000000e+00 2848 2802 2.6135512000000e+00 2849 2802 -4.2336080000000e-01 2850 2802 -1.5048404000000e+00 1699 2803 -1.8954089000000e-03 1701 2803 -1.9781345000000e-05 2755 2803 -7.0959196000000e-04 2757 2803 -7.4056227000000e-06 2800 2803 -6.2902203000000e-04 2802 2803 -6.5647585000000e-06 2803 2803 1.7552542000000e+02 2805 2803 4.5895273000000e-04 2806 2803 -1.8490299000000e-01 2808 2803 -7.8425031000000e-06 2851 2803 -6.6915747000000e-04 2853 2803 -6.9836301000000e-06 1699 2804 3.4299646000000e+00 1701 2804 -2.8841868000000e+00 2757 2804 -1.1156610000000e+00 2802 2804 -9.9693289000000e-01 2803 2804 -1.2191790000000e+02 2804 2804 -3.3456331000000e+01 2805 2804 7.1631975000000e+00 2806 2804 1.5575259000000e+01 2808 2804 -1.1479232000000e+00 2851 2804 2.2306585000000e+00 2853 2804 -1.0147341000000e+00 1699 2805 5.7980083000000e+00 1700 2805 -9.3917852000000e-01 1701 2805 -4.8754260000000e+00 2757 2805 -1.8859120000000e+00 2802 2805 -1.6852153000000e+00 2803 2805 -2.0608989000000e+02 2804 2805 3.1800895000000e+01 2805 2805 1.2108662000000e+01 2806 2805 2.6328400000000e+01 2807 2805 -4.2647520000000e+00 2808 2805 -1.9404481000000e+00 2851 2805 3.7707026000000e+00 2852 2805 -6.1078954000000e-01 2853 2805 -1.7153054000000e+00 1702 2806 -3.7829768000000e-02 1704 2806 -1.7202053000000e-05 2758 2806 -8.5263341000000e-04 2760 2806 -8.8984680000000e-06 2803 2806 -7.5145296000000e-04 2805 2806 -7.8425031000000e-06 2806 2806 2.1068091000000e+02 2808 2806 5.4456009000000e-04 2809 2806 -2.4297827000000e-01 2811 2806 -9.6193652000000e-06 2854 2806 -8.1726223000000e-04 2856 2806 -8.5293184000000e-06 1702 2807 8.7724127000000e+00 1704 2807 -2.4047730000000e+00 2760 2807 -1.2917639000000e+00 2805 2807 -1.1479232000000e+00 2806 2807 -1.5312802000000e+02 2807 2807 -4.0153071000000e+01 2808 2807 7.3802059000000e+00 2809 2807 2.1768511000000e+01 2811 2807 -1.3447723000000e+00 2854 2807 1.7769103000000e+00 2856 2807 -1.1864595000000e+00 1702 2808 1.4828886000000e+01 1703 2808 -2.4019494000000e+00 1704 2808 -4.0650283000000e+00 2760 2808 -2.1835977000000e+00 2805 2808 -1.9404481000000e+00 2806 2808 -2.5884760000000e+02 2807 2808 4.0015170000000e+01 2808 2808 1.2475499000000e+01 2809 2808 3.6797491000000e+01 2810 2808 -5.9603741000000e+00 2811 2808 -2.2732032000000e+00 2854 2808 3.0036892000000e+00 2855 2808 -4.8653076000000e-01 2856 2808 -2.0055911000000e+00 1705 2809 -1.5567512000000e-01 1707 2809 -1.5921633000000e-05 2761 2809 -1.0161471000000e-03 2763 2809 -1.0604971000000e-05 2806 2809 -9.2170833000000e-04 2808 2809 -9.6193652000000e-06 2809 2809 2.4012212000000e+02 2811 2809 6.1893949000000e-04 2812 2809 -3.5472890000000e-01 2814 2809 -1.1694541000000e-05 2857 2809 -9.7819414000000e-04 2859 2809 -1.0208877000000e-05 1705 2810 2.0388768000000e+01 1707 2810 -2.1123227000000e+00 2763 2810 -1.4845134000000e+00 2808 2810 -1.3447723000000e+00 2809 2810 -1.8900300000000e+02 2810 2810 -4.5739429000000e+01 2811 2810 7.8605356000000e+00 2812 2810 3.1038869000000e+01 2814 2810 -1.5515063000000e+00 2859 2810 -1.3622756000000e+00 1705 2811 3.4465149000000e+01 1706 2811 -5.5823791000000e+00 1707 2811 -3.5706677000000e+00 2763 2811 -2.5094197000000e+00 2808 2811 -2.2732032000000e+00 2809 2811 -3.1949044000000e+02 2810 2811 4.9546697000000e+01 2811 2811 1.3287442000000e+01 2812 2811 5.2468065000000e+01 2813 2811 -8.4983418000000e+00 2814 2811 -2.6226644000000e+00 2859 2811 -2.3027894000000e+00 1708 2812 -2.9914070000000e-01 1710 2812 -1.4448644000000e-05 2764 2812 -1.2009430000000e-03 2766 2812 -1.2533584000000e-05 2809 2812 -1.1205475000000e-03 2811 2812 -1.1694541000000e-05 2812 2812 2.8189826000000e+02 2814 2812 7.2416564000000e-04 2815 2812 -1.2390640000000e-03 2817 2812 -1.2931432000000e-05 2860 2812 -1.1974085000000e-03 2862 2812 -1.2496697000000e-05 1708 2813 3.4530089000000e+01 1710 2813 -1.8034786000000e+00 2766 2813 -1.7115905000000e+00 2811 2813 -1.5515063000000e+00 2812 2813 -3.0295866000000e+02 2813 2813 -5.3561180000000e+01 2814 2813 8.8391322000000e+00 2817 2813 -1.7187497000000e+00 2862 2813 -1.6266867000000e+00 1708 2814 5.8369661000000e+01 1709 2814 -9.4537851000000e+00 1710 2814 -3.0486002000000e+00 2766 2814 -2.8932726000000e+00 2811 2814 -2.6226644000000e+00 2812 2814 -5.1212130000000e+02 2813 2814 8.0335994000000e+01 2814 2814 1.4941665000000e+01 2817 2814 -2.9053725000000e+00 2862 2814 -2.7497511000000e+00 1711 2815 -1.2091038000000e-01 1713 2815 -1.3024193000000e-05 2767 2815 -1.1994854000000e-03 2769 2815 -1.2518373000000e-05 2812 2815 -3.5400654000000e-01 2814 2815 -1.2931432000000e-05 2815 2815 2.9269180000000e+02 2817 2815 7.4833530000000e-04 2818 2815 -1.2151085000000e-03 2820 2815 -1.2681422000000e-05 2863 2815 -1.2612720000000e-03 2865 2815 -1.3163206000000e-05 1711 2816 1.6989522000000e+01 1713 2816 -1.7310373000000e+00 2769 2816 -1.7487497000000e+00 2812 2816 3.5445146000000e+01 2814 2816 -1.7187497000000e+00 2815 2816 -2.2021925000000e+02 2816 2816 -5.5772693000000e+01 2817 2816 8.7103667000000e+00 2820 2816 -1.7542574000000e+00 2865 2816 -1.7513011000000e+00 1711 2817 2.8719068000000e+01 1712 2817 -4.6516829000000e+00 1713 2817 -2.9261433000000e+00 2769 2817 -2.9560846000000e+00 2812 2817 5.9916433000000e+01 2813 2817 -9.7047802000000e+00 2814 2817 -2.9053725000000e+00 2815 2817 -3.7225837000000e+02 2816 2817 5.7627715000000e+01 2817 2817 1.4723995000000e+01 2820 2817 -2.9653966000000e+00 2865 2817 -2.9603970000000e+00 1714 2818 -2.9539221000000e-02 1716 2818 -1.2519425000000e-05 2770 2818 -1.1653689000000e-03 2772 2818 -1.2162317000000e-05 2815 2818 -2.2278842000000e-01 2817 2818 -1.2681422000000e-05 2818 2818 2.9248278000000e+02 2820 2818 7.4634292000000e-04 2821 2818 -1.1808282000000e-03 2823 2818 -1.2323657000000e-05 2866 2818 -1.7655237000000e-03 2868 2818 -1.2658465000000e-05 1714 2819 8.0014028000000e+00 1716 2819 -1.7318408000000e+00 2772 2819 -1.7487549000000e+00 2815 2819 2.1807030000000e+01 2817 2819 -1.7542574000000e+00 2818 2819 -2.0609693000000e+02 2819 2819 -5.5761113000000e+01 2820 2819 8.7461764000000e+00 2823 2819 -1.7539435000000e+00 2866 2819 8.4869924000000e+00 2868 2819 -1.7511135000000e+00 1714 2820 1.3525571000000e+01 1715 2820 -2.1908251000000e+00 1716 2820 -2.9275037000000e+00 2772 2820 -2.9560952000000e+00 2815 2820 3.6862603000000e+01 2816 2820 -5.9708767000000e+00 2817 2820 -2.9653966000000e+00 2818 2820 -3.4838625000000e+02 2819 2820 5.3791450000000e+01 2820 2820 1.4784534000000e+01 2823 2820 -2.9648641000000e+00 2866 2820 1.4346412000000e+01 2867 2820 -2.3237821000000e+00 2868 2820 -2.9600823000000e+00 1717 2821 -1.1745151000000e-03 1719 2821 -1.2257771000000e-05 2773 2821 -1.1378735000000e-03 2775 2821 -1.1875363000000e-05 2818 2821 -1.7018751000000e-01 2820 2821 -1.2323657000000e-05 2821 2821 2.9248926000000e+02 2823 2821 7.4475699000000e-04 2824 2821 -1.1509821000000e-03 2826 2821 -1.2012170000000e-05 2869 2821 -8.2800114000000e-02 2871 2821 -1.2305913000000e-05 1717 2822 4.1569139000000e+00 1719 2822 -1.7304186000000e+00 2775 2822 -1.7499893000000e+00 2818 2822 1.4942885000000e+01 2820 2822 -1.7539435000000e+00 2821 2822 -2.0168972000000e+02 2822 2822 -5.5755356000000e+01 2823 2822 8.7459120000000e+00 2826 2822 -1.7537806000000e+00 2869 2822 1.4779875000000e+01 2871 2822 -1.7515163000000e+00 1717 2823 7.0268425000000e+00 1718 2823 -1.1382070000000e+00 1719 2823 -2.9250977000000e+00 2775 2823 -2.9581798000000e+00 2818 2823 2.5259436000000e+01 2819 2823 -4.0915200000000e+00 2820 2823 -2.9648641000000e+00 2821 2823 -3.4093608000000e+02 2822 2823 5.2600284000000e+01 2823 2823 1.4784082000000e+01 2826 2823 -2.9645908000000e+00 2869 2823 2.4983885000000e+01 2870 2823 -4.0468861000000e+00 2871 2823 -2.9607612000000e+00 1720 2824 -1.1424362000000e-03 1722 2824 -1.1922981000000e-05 2776 2824 -1.1081939000000e-03 2778 2824 -1.1565613000000e-05 2821 2824 -1.5942759000000e-01 2823 2824 -1.2012170000000e-05 2824 2824 2.9239877000000e+02 2826 2824 7.1946840000000e-04 1720 2825 2.6606893000000e+00 1722 2825 -1.7316662000000e+00 2778 2825 -1.7322918000000e+00 2821 2825 1.3042016000000e+01 2823 2825 -1.7537806000000e+00 2824 2825 -1.8351822000000e+02 2825 2825 -5.5751694000000e+01 2826 2825 5.2240006000000e+00 1720 2826 4.4976292000000e+00 1721 2826 -7.2853764000000e-01 1722 2826 -2.9272085000000e+00 2778 2826 -2.9282661000000e+00 2821 2826 2.2046224000000e+01 2822 2826 -3.5711044000000e+00 2823 2826 -2.9645908000000e+00 2824 2826 -3.1021919000000e+02 2825 2826 4.7634733000000e+01 2826 2826 8.8306505000000e+00 2827 2827 1.0000000000000e+00 2828 2828 1.0000000000000e+00 2829 2829 1.0000000000000e+00 2830 2830 1.0000000000000e+00 2831 2831 1.0000000000000e+00 2832 2832 1.0000000000000e+00 2833 2833 1.0000000000000e+00 2834 2834 1.0000000000000e+00 2835 2835 1.0000000000000e+00 2836 2836 1.0000000000000e+00 2837 2837 1.0000000000000e+00 2838 2838 1.0000000000000e+00 2839 2839 1.0000000000000e+00 2840 2840 1.0000000000000e+00 2841 2841 1.0000000000000e+00 1738 2842 -2.6228869000000e-03 1740 2842 -2.7373634000000e-05 2794 2842 -2.4738193000000e-02 2796 2842 -4.4425135000000e-06 2842 2842 1.1694008000000e+02 2844 2842 3.1419533000000e-04 2845 2842 -1.4510170000000e-02 2847 2842 -4.4423605000000e-06 2890 2842 -4.1857439000000e-04 2892 2842 -4.3684318000000e-06 1738 2843 2.6728897000000e-01 1740 2843 -4.3215522000000e+00 2794 2843 1.0415918000000e+00 2796 2843 -7.0141742000000e-01 2842 2843 -7.1513262000000e+01 2843 2843 -2.2298278000000e+01 2844 2843 6.4284232000000e+00 2845 2843 3.0743413000000e+00 2847 2843 -7.0143927000000e-01 2892 2843 -7.0151062000000e-01 1738 2844 4.5182528000000e-01 1739 2844 -7.3191547000000e-02 1740 2844 -7.3051519000000e+00 2794 2844 1.7607067000000e+00 2795 2844 -2.8521833000000e-01 2796 2844 -1.1856760000000e+00 2842 2844 -1.2088602000000e+02 2843 2844 1.8542426000000e+01 2844 2844 1.0866607000000e+01 2845 2844 5.1968665000000e+00 2846 2844 -8.4184466000000e-01 2847 2844 -1.1857129000000e+00 2892 2844 -1.1858335000000e+00 1741 2845 -2.6659355000000e-03 1743 2845 -2.7822909000000e-05 2797 2845 -2.7018673000000e-02 2799 2845 -4.9215445000000e-06 2842 2845 -4.2565810000000e-04 2844 2845 -4.4423605000000e-06 2845 2845 1.1698186000000e+02 2847 2845 3.2014905000000e-04 2848 2845 -5.7738694000000e-02 2850 2845 -4.9258151000000e-06 2893 2845 -4.2805601000000e-04 2895 2845 -4.4673862000000e-06 1741 2846 4.3056606000000e-01 1743 2846 -4.3212757000000e+00 2799 2846 -7.6471706000000e-01 2844 2846 -7.0143927000000e-01 2845 2846 -7.3655198000000e+01 2846 2846 -2.2302114000000e+01 2847 2846 7.2568081000000e+00 2848 2846 6.0999914000000e+00 2850 2846 -7.6545108000000e-01 2895 2846 -7.0141963000000e-01 1741 2847 7.2782837000000e-01 1742 2847 -1.1790039000000e-01 1743 2847 -7.3046794000000e+00 2799 2847 -1.2926770000000e+00 2844 2847 -1.1857129000000e+00 2845 2847 -1.2450666000000e+02 2846 2847 1.9119340000000e+01 2847 2847 1.2266901000000e+01 2848 2847 1.0311418000000e+01 2849 2847 -1.6703392000000e+00 2850 2847 -1.2939176000000e+00 2895 2847 -1.1856792000000e+00 1744 2848 -2.2890448000000e-03 1746 2848 -2.3889507000000e-05 2800 2848 -2.5381719000000e-02 2802 2848 -5.8983763000000e-06 2845 2848 -4.7198175000000e-04 2847 2848 -4.9258151000000e-06 2848 2848 1.4040886000000e+02 2850 2848 3.7403923000000e-04 2851 2848 -1.1256435000000e-01 2853 2848 -6.0074212000000e-06 2896 2848 -4.8193290000000e-04 2898 2848 -5.0296698000000e-06 1744 2849 9.5493991000000e-01 1746 2849 -3.6027696000000e+00 2802 2849 -8.9022740000000e-01 2847 2849 -7.6545108000000e-01 2848 2849 -9.1323808000000e+01 2849 2849 -2.6766776000000e+01 2850 2849 6.9332679000000e+00 2851 2849 9.8254101000000e+00 2853 2849 -9.0677263000000e-01 2898 2849 -7.6503890000000e-01 1744 2850 1.6142304000000e+00 1745 2850 -2.6148297000000e-01 1746 2850 -6.0901217000000e+00 2802 2850 -1.5048404000000e+00 2847 2850 -1.2939176000000e+00 2848 2850 -1.5437376000000e+02 2849 2850 2.3736591000000e+01 2850 2850 1.1719995000000e+01 2851 2850 1.6608873000000e+01 2852 2850 -2.6904074000000e+00 2853 2850 -1.5328084000000e+00 2898 2850 -1.2932218000000e+00 1747 2851 -2.0436630000000e-03 1749 2851 -2.1328591000000e-05 2803 2851 -1.7076097000000e-02 2805 2851 -6.9836301000000e-06 2848 2851 -5.7561908000000e-04 2850 2851 -6.0074212000000e-06 2851 2851 1.6381310000000e+02 2853 2851 4.3085910000000e-04 2854 2851 -1.5171947000000e-01 2856 2851 -7.2108945000000e-06 2899 2851 -6.0504245000000e-04 2901 2851 -6.3144968000000e-06 1747 2852 2.5176735000000e+00 1749 2852 -3.0900922000000e+00 2805 2852 -1.0147341000000e+00 2850 2852 -9.0677263000000e-01 2851 2852 -1.0996184000000e+02 2852 2852 -3.1231894000000e+01 2853 2852 6.9879250000000e+00 2854 2852 1.3482684000000e+01 2856 2852 -1.0478604000000e+00 2901 2852 -9.2495411000000e-01 1747 2853 4.2558728000000e+00 1748 2853 -6.8937538000000e-01 1749 2853 -5.2234888000000e+00 2805 2853 -1.7153054000000e+00 2850 2853 -1.5328084000000e+00 2851 2853 -1.8587939000000e+02 2852 2853 2.8617763000000e+01 2853 2853 1.1812382000000e+01 2854 2853 2.2791115000000e+01 2855 2853 -3.6917533000000e+00 2856 2853 -1.7713021000000e+00 2901 2853 -1.5635414000000e+00 1750 2854 -1.4069406000000e-02 1752 2854 -1.9443328000000e-05 2806 2854 -3.9305704000000e-02 2808 2854 -8.5293184000000e-06 2851 2854 -6.9093349000000e-04 2853 2854 -7.2108945000000e-06 2854 2854 1.8724325000000e+02 2856 2854 4.8926994000000e-04 2857 2854 -1.7655716000000e-01 2859 2854 -8.6535764000000e-06 2902 2854 -7.3661529000000e-04 2904 2854 -7.6876504000000e-06 1750 2855 6.4125036000000e+00 1752 2855 -2.7048907000000e+00 2808 2855 -1.1864595000000e+00 2853 2855 -1.0478604000000e+00 2854 2855 -1.2924567000000e+02 2855 2855 -3.5699346000000e+01 2856 2855 7.2317654000000e+00 2857 2855 1.5457157000000e+01 2859 2855 -1.2038711000000e+00 2904 2855 -1.0846679000000e+00 1750 2856 1.0839696000000e+01 1751 2856 -1.7557832000000e+00 1752 2856 -4.5723473000000e+00 2808 2856 -2.0055911000000e+00 2853 2856 -1.7713021000000e+00 2854 2856 -2.1847689000000e+02 2855 2856 3.3669408000000e+01 2856 2856 1.2224575000000e+01 2857 2856 2.6128778000000e+01 2858 2856 -4.2322654000000e+00 2859 2856 -2.0350237000000e+00 2904 2856 -1.8335227000000e+00 1753 2857 -8.5146637000000e-02 1755 2857 -1.7534446000000e-05 2809 2857 -9.1496839000000e-02 2811 2857 -1.0208877000000e-05 2854 2857 -8.2916838000000e-04 2856 2857 -8.6535764000000e-06 2857 2857 2.1655768000000e+02 2859 2857 5.6258459000000e-04 2860 2857 -1.5399105000000e-01 2862 2857 -1.0675720000000e-05 2905 2857 -8.9608978000000e-04 2907 2857 -9.3519983000000e-06 1753 2858 1.3430198000000e+01 1755 2858 -2.3400367000000e+00 2809 2858 2.5196135000000e+00 2811 2858 -1.3622756000000e+00 2856 2858 -1.2038711000000e+00 2857 2858 -1.5139205000000e+02 2858 2858 -4.1283654000000e+01 2859 2858 7.6138360000000e+00 2860 2858 1.1298069000000e+01 2862 2858 -1.4246489000000e+00 2907 2858 -1.2783576000000e+00 1753 2859 2.2702394000000e+01 1754 2859 -3.6771606000000e+00 1755 2859 -3.9555957000000e+00 2809 2859 4.2591523000000e+00 2810 2859 -6.8986500000000e-01 2811 2859 -2.3027894000000e+00 2856 2859 -2.0350237000000e+00 2857 2859 -2.5591297000000e+02 2858 2859 3.9447704000000e+01 2859 2859 1.2870422000000e+01 2860 2859 1.9098244000000e+01 2861 2859 -3.0933880000000e+00 2862 2859 -2.4082250000000e+00 2907 2859 -2.1609341000000e+00 1756 2860 -1.3871496000000e-01 1758 2860 -1.4779451000000e-05 2812 2860 -3.0534456000000e-01 2814 2860 -1.2496697000000e-05 2857 2860 -1.0229261000000e-03 2859 2860 -1.0675720000000e-05 2860 2860 2.6342252000000e+02 2862 2860 6.7765910000000e-04 2863 2860 -1.1970207000000e-03 2865 2860 -1.2492650000000e-05 2908 2860 -1.1113436000000e-03 2910 2860 -1.1598485000000e-05 1756 2861 1.8730508000000e+01 1758 2861 -1.9239522000000e+00 2812 2861 2.2650621000000e+01 2814 2861 -1.6266867000000e+00 2859 2861 -1.4246489000000e+00 2860 2861 -1.9236509000000e+02 2861 2861 -5.0211097000000e+01 2862 2861 8.2011099000000e+00 2865 2861 -1.6622378000000e+00 2910 2861 -1.5579331000000e+00 1756 2862 3.1662050000000e+01 1757 2862 -5.1282795000000e+00 1758 2862 -3.2522488000000e+00 2812 2862 3.8288610000000e+01 2813 2862 -6.2015787000000e+00 2814 2862 -2.7497511000000e+00 2859 2862 -2.4082250000000e+00 2860 2862 -3.2517394000000e+02 2861 2862 5.0228609000000e+01 2862 2862 1.3863152000000e+01 2865 2862 -2.8098445000000e+00 2910 2862 -2.6335301000000e+00 1759 2863 -6.1195760000000e-02 1761 2863 -1.3005170000000e-05 2815 2863 -8.4129370000000e-02 2817 2863 -1.3163206000000e-05 2860 2863 -1.1019069000000e-01 2862 2863 -1.2492650000000e-05 2863 2863 2.9246116000000e+02 2865 2863 7.4854041000000e-04 2866 2863 -1.2344464000000e-03 2868 2863 -1.2883241000000e-05 2911 2863 -1.2445215000000e-03 2913 2863 -1.2988390000000e-05 1759 2864 1.1111017000000e+01 1761 2864 -1.7304764000000e+00 2815 2864 5.6564743000000e-01 2817 2864 -1.7513011000000e+00 2860 2864 1.1669962000000e+01 2862 2864 -1.6622378000000e+00 2863 2864 -1.9111799000000e+02 2864 2864 -5.5782280000000e+01 2865 2864 8.6562392000000e+00 2868 2864 -1.7545128000000e+00 2913 2864 -1.7514355000000e+00 1759 2865 1.8782047000000e+01 1760 2865 -3.0421668000000e+00 1761 2865 -2.9251949000000e+00 2815 2865 9.5616964000000e-01 2816 2865 -1.5487277000000e-01 2817 2865 -2.9603970000000e+00 2860 2865 1.9726888000000e+01 2861 2865 -3.1952047000000e+00 2862 2865 -2.8098445000000e+00 2863 2865 -3.2306559000000e+02 2864 2865 4.9636495000000e+01 2865 2865 1.4632498000000e+01 2868 2865 -2.9658283000000e+00 2913 2865 -2.9606246000000e+00 1762 2866 -1.3869516000000e-02 1764 2866 -1.2700715000000e-05 2818 2866 -1.2129088000000e-03 2820 2866 -1.2658465000000e-05 2863 2866 -1.3924076000000e-01 2865 2866 -1.2883241000000e-05 2866 2866 2.9236641000000e+02 2868 2866 7.4779983000000e-04 2869 2866 -1.2146362000000e-03 2871 2866 -1.2676493000000e-05 2914 2866 -1.2346491000000e-03 2916 2866 -1.2885356000000e-05 1762 2867 6.4520954000000e+00 1764 2867 -1.7296952000000e+00 2820 2867 -1.7511135000000e+00 2863 2867 1.2739216000000e+01 2865 2867 -1.7545128000000e+00 2866 2867 -1.8808195000000e+02 2867 2867 -5.5776604000000e+01 2868 2867 8.7473522000000e+00 2871 2867 -1.7544652000000e+00 2914 2867 1.1109602000000e+00 2916 2867 -1.7512923000000e+00 1762 2868 1.0906622000000e+01 1763 2868 -1.7665969000000e+00 1764 2868 -2.9238767000000e+00 2820 2868 -2.9600823000000e+00 2863 2868 2.1534371000000e+01 2864 2868 -3.4880233000000e+00 2865 2868 -2.9658283000000e+00 2866 2868 -3.1793373000000e+02 2867 2868 4.8820171000000e+01 2868 2868 1.4786522000000e+01 2871 2868 -2.9657462000000e+00 2914 2868 1.8779672000000e+00 2915 2868 -3.0418317000000e-01 2916 2868 -2.9603845000000e+00 1765 2869 -1.2076586000000e-03 1767 2869 -1.2603672000000e-05 2821 2869 -1.1791280000000e-03 2823 2869 -1.2305913000000e-05 2866 2869 -8.9047699000000e-02 2868 2869 -1.2676493000000e-05 2869 2869 2.9230729000000e+02 2871 2869 7.3435172000000e-04 2917 2869 -1.2243854000000e-03 2919 2869 -1.2778240000000e-05 1765 2870 4.1746113000000e+00 1767 2870 -1.7302744000000e+00 2823 2870 -1.7515163000000e+00 2866 2870 8.6450985000000e+00 2868 2870 -1.7544652000000e+00 2869 2870 -1.8572204000000e+02 2870 2870 -5.5771995000000e+01 2871 2870 6.9942460000000e+00 2917 2870 5.1159495000000e+00 2919 2870 -1.7517190000000e+00 1765 2871 7.0567586000000e+00 1766 2871 -1.1430303000000e+00 1767 2871 -2.9248541000000e+00 2823 2871 -2.9607612000000e+00 2866 2871 1.4613665000000e+01 2867 2871 -2.3670729000000e+00 2868 2871 -2.9657462000000e+00 2869 2871 -3.1394434000000e+02 2870 2871 4.8186100000000e+01 2871 2871 1.1823066000000e+01 2917 2871 8.6479957000000e+00 2918 2871 -1.4007736000000e+00 2919 2871 -2.9611039000000e+00 2872 2872 1.0000000000000e+00 2873 2873 1.0000000000000e+00 2874 2874 1.0000000000000e+00 2875 2875 1.0000000000000e+00 2876 2876 1.0000000000000e+00 2877 2877 1.0000000000000e+00 2878 2878 1.0000000000000e+00 2879 2879 1.0000000000000e+00 2880 2880 1.0000000000000e+00 2881 2881 1.0000000000000e+00 2882 2882 1.0000000000000e+00 2883 2883 1.0000000000000e+00 2884 2884 1.0000000000000e+00 2885 2885 1.0000000000000e+00 2886 2886 1.0000000000000e+00 1783 2887 -2.4123184000000e-03 1785 2887 -2.5176046000000e-05 2887 2887 1.2276367000000e+02 2889 2887 3.2155676000000e-04 2890 2887 -1.2450511000000e-02 2892 2887 -4.3893722000000e-06 2935 2887 -4.5507138000000e-04 2937 2887 -4.7493308000000e-06 1783 2888 2.3967335000000e-01 1785 2888 -4.1163478000000e+00 2887 2888 -7.4141000000000e+01 2888 2888 -2.3407988000000e+01 2889 2888 5.6225115000000e+00 2890 2888 3.4073757000000e+00 2892 2888 -7.1792217000000e-01 2937 2888 -7.8561509000000e-01 1783 2889 4.0514354000000e-01 1784 2889 -6.5630999000000e-02 1785 2889 -6.9582695000000e+00 2887 2889 -1.2532787000000e+02 2888 2889 1.9223281000000e+01 2889 2889 9.5042871000000e+00 2890 2889 5.7598242000000e+00 2891 2889 -9.3305935000000e-01 2892 2889 -1.2135748000000e+00 2937 2889 -1.3280030000000e+00 1786 2890 -2.5802613000000e-03 1788 2890 -2.6928775000000e-05 2842 2890 -4.2487643000000e-02 2844 2890 -4.3684318000000e-06 2887 2890 -4.2058086000000e-04 2889 2890 -4.3893722000000e-06 2890 2890 1.1696348000000e+02 2892 2890 3.1802070000000e-04 2893 2890 -1.9335764000000e-02 2895 2890 -4.3661119000000e-06 2938 2890 -4.2194337000000e-04 2940 2890 -4.4035919000000e-06 1786 2891 2.4644381000000e-01 1788 2891 -4.3239533000000e+00 2842 2891 3.1262924000000e+00 2844 2891 -7.0151062000000e-01 2889 2891 -7.1792217000000e-01 2890 2891 -7.4727793000000e+01 2891 2891 -2.2297929000000e+01 2892 2891 7.1655433000000e+00 2893 2891 4.2244279000000e+00 2895 2891 -7.0118328000000e-01 2940 2891 -7.1847045000000e-01 1786 2892 4.1658861000000e-01 1787 2892 -6.7484236000000e-02 1788 2892 -7.3092107000000e+00 2842 2892 5.2846847000000e+00 2843 2892 -8.5607937000000e-01 2844 2892 -1.1858335000000e+00 2889 2892 -1.2135748000000e+00 2890 2892 -1.2631986000000e+02 2891 2892 1.9423783000000e+01 2892 2892 1.2112634000000e+01 2893 2892 7.1409730000000e+00 2894 2892 -1.1567842000000e+00 2895 2892 -1.1852802000000e+00 2940 2892 -1.2145024000000e+00 1789 2893 -2.6372306000000e-03 1791 2893 -2.7523332000000e-05 2845 2893 -3.7647060000000e-02 2847 2893 -4.4673862000000e-06 2890 2893 -4.1835211000000e-04 2892 2893 -4.3661119000000e-06 2893 2893 1.1698538000000e+02 2895 2893 3.1879142000000e-04 2896 2893 -5.1812949000000e-02 2898 2893 -4.4687159000000e-06 2941 2893 -4.2164408000000e-04 2943 2893 -4.4004684000000e-06 1789 2894 3.0979913000000e-01 1791 2894 -4.3203223000000e+00 2845 2894 1.9741084000000e+00 2847 2894 -7.0141963000000e-01 2892 2894 -7.0118328000000e-01 2893 2894 -7.5477566000000e+01 2894 2894 -2.2303262000000e+01 2895 2894 7.1286849000000e+00 2896 2894 6.0705380000000e+00 2898 2894 -7.0168061000000e-01 2943 2894 -7.0157335000000e-01 1789 2895 5.2368419000000e-01 1790 2895 -8.4831764000000e-02 1791 2895 -7.3030692000000e+00 2845 2895 3.3370312000000e+00 2846 2895 -5.4056672000000e-01 2847 2895 -1.1856792000000e+00 2892 2895 -1.1852802000000e+00 2893 2895 -1.2758722000000e+02 2894 2895 1.9615711000000e+01 2895 2895 1.2050324000000e+01 2896 2895 1.0261632000000e+01 2897 2895 -1.6622850000000e+00 2898 2895 -1.1861203000000e+00 2943 2895 -1.1859389000000e+00 1792 2896 -2.7227522000000e-03 1794 2896 -2.8415874000000e-05 2848 2896 -4.2281181000000e-02 2850 2896 -5.0296698000000e-06 2893 2896 -4.2818342000000e-04 2895 2896 -4.4687159000000e-06 2896 2896 1.1702233000000e+02 2898 2896 3.2114696000000e-04 2899 2896 -8.8994729000000e-02 2901 2896 -5.1260958000000e-06 2944 2896 -4.3471186000000e-04 2946 2896 -4.5368496000000e-06 1792 2897 6.2673462000000e-01 1794 2897 -4.3205436000000e+00 2848 2897 1.6309355000000e+00 2850 2897 -7.6503890000000e-01 2895 2897 -7.0168061000000e-01 2896 2897 -7.7644013000000e+01 2897 2897 -2.2307808000000e+01 2898 2897 7.2711835000000e+00 2899 2897 8.2697436000000e+00 2901 2897 -7.7976354000000e-01 2946 2897 -7.0164907000000e-01 1792 2898 1.0594322000000e+00 1793 2898 -1.7161420000000e-01 1794 2898 -7.3034469000000e+00 2848 2898 2.7569334000000e+00 2849 2898 -4.4658727000000e-01 2850 2898 -1.2932218000000e+00 2895 2898 -1.1861203000000e+00 2896 2898 -1.3124944000000e+02 2897 2898 2.0197250000000e+01 2898 2898 1.2291208000000e+01 2899 2898 1.3979175000000e+01 2900 2898 -2.2644440000000e+00 2901 2898 -1.3181123000000e+00 2946 2898 -1.1860676000000e+00 1795 2899 -2.2687455000000e-03 1797 2899 -2.3677654000000e-05 2851 2899 -6.0381371000000e-02 2853 2899 -6.3144968000000e-06 2896 2899 -4.9117225000000e-04 2898 2899 -5.1260958000000e-06 2899 2899 1.4628593000000e+02 2901 2899 3.8911555000000e-04 2902 2899 -1.1778417000000e-01 2904 2899 -6.5322551000000e-06 2947 2899 -5.2642474000000e-04 2949 2899 -5.4940068000000e-06 1795 2900 1.4991793000000e+00 1797 2900 -3.4639961000000e+00 2851 2900 2.1842910000000e+00 2853 2900 -9.2495411000000e-01 2898 2900 -7.7976354000000e-01 2899 2900 -9.8102872000000e+01 2900 2900 -2.7889063000000e+01 2901 2900 6.9489161000000e+00 2902 2900 1.0529944000000e+01 2904 2900 -9.5692617000000e-01 2949 2900 -8.2013940000000e-01 1795 2901 2.5342110000000e+00 1796 2901 -4.1049921000000e-01 1797 2901 -5.8555350000000e+00 2851 2901 3.6923229000000e+00 2852 2901 -5.9809366000000e-01 2853 2901 -1.5635414000000e+00 2898 2901 -1.3181123000000e+00 2899 2901 -1.6583299000000e+02 2900 2901 2.5522133000000e+01 2901 2901 1.1746441000000e+01 2902 2901 1.7799806000000e+01 2903 2901 -2.8832664000000e+00 2904 2901 -1.6175869000000e+00 2949 2901 -1.3863628000000e+00 1798 2902 -1.9671590000000e-03 1800 2902 -2.0530161000000e-05 2854 2902 -9.4353779000000e-02 2856 2902 -7.6876504000000e-06 2899 2902 -6.2590762000000e-04 2901 2902 -6.5322551000000e-06 2902 2902 1.7555154000000e+02 2904 2902 4.6028580000000e-04 2905 2902 -1.3385002000000e-01 2907 2902 -8.1373237000000e-06 2950 2902 -6.7278096000000e-04 2952 2902 -7.0214465000000e-06 1798 2903 3.4378157000000e+00 1800 2903 -2.8855036000000e+00 2854 2903 4.5815569000000e+00 2856 2903 -1.0846679000000e+00 2901 2903 -9.5692617000000e-01 2902 2903 -1.1978282000000e+02 2903 2903 -3.3471603000000e+01 2904 2903 7.0921696000000e+00 2905 2903 1.1103122000000e+01 2907 2903 -1.1481787000000e+00 2952 2903 -1.0131270000000e+00 1798 2904 5.8112836000000e+00 1799 2904 -9.4130456000000e-01 1800 2904 -4.8776553000000e+00 2854 2904 7.7446637000000e+00 2855 2904 -1.2544711000000e+00 2856 2904 -1.8335227000000e+00 2901 2904 -1.6175869000000e+00 2902 2904 -2.0248088000000e+02 2903 2904 3.1177756000000e+01 2904 2904 1.1988602000000e+01 2905 2904 1.8768717000000e+01 2906 2904 -3.0401336000000e+00 2907 2904 -1.9408812000000e+00 2952 2904 -1.7125898000000e+00 1801 2905 -1.3655556000000e-02 1803 2905 -1.7592714000000e-05 2857 2905 -1.4965754000000e-01 2859 2905 -9.3519983000000e-06 2902 2905 -7.7970208000000e-04 2904 2905 -8.1373237000000e-06 2905 2905 2.1065174000000e+02 2907 2905 5.4643995000000e-04 2908 2905 -1.0697527000000e-01 2910 2905 -1.0164005000000e-05 2953 2905 -8.3633053000000e-04 2955 2905 -8.7283238000000e-06 1801 2906 6.3913273000000e+00 1803 2906 -2.4049276000000e+00 2857 2906 9.4506934000000e+00 2859 2906 -1.2783576000000e+00 2904 2906 -1.1481787000000e+00 2905 2906 -1.4406601000000e+02 2906 2906 -4.0169576000000e+01 2907 2906 7.4502841000000e+00 2908 2906 7.4370771000000e+00 2910 2906 -1.3893702000000e+00 2955 2906 -1.2249288000000e+00 1801 2907 1.0803892000000e+01 1802 2907 -1.7499627000000e+00 1803 2907 -4.0652867000000e+00 2857 2907 1.5975441000000e+01 2858 2907 -2.5876255000000e+00 2859 2907 -2.1609341000000e+00 2904 2907 -1.9408812000000e+00 2905 2907 -2.4352901000000e+02 2906 2907 3.7492727000000e+01 2907 2907 1.2593953000000e+01 2908 2907 1.2571626000000e+01 2909 2907 -2.0362919000000e+00 2910 2907 -2.3485896000000e+00 2955 2907 -2.0706186000000e+00 1804 2908 -3.1731369000000e-02 1806 2908 -1.4651543000000e-05 2860 2908 -2.3081970000000e-01 2862 2908 -1.1598485000000e-05 2905 2908 -9.7389460000000e-04 2907 2908 -1.0164005000000e-05 2908 2908 2.5739641000000e+02 2910 2908 6.6144089000000e-04 2911 2908 -1.1671148000000e-03 2913 2908 -1.2180538000000e-05 2956 2908 -1.0475229000000e-03 2958 2908 -1.0932423000000e-05 1804 2909 8.1999829000000e+00 1806 2909 -1.9681342000000e+00 2860 2909 1.5533079000000e+01 2862 2909 -1.5579331000000e+00 2907 2909 -1.3893702000000e+00 2908 2909 -1.7136108000000e+02 2909 2909 -4.9096209000000e+01 2910 2909 8.0683912000000e+00 2913 2909 -1.6425735000000e+00 2958 2909 -1.5048543000000e+00 1804 2910 1.3861251000000e+01 1805 2910 -2.2451493000000e+00 1806 2910 -3.3269340000000e+00 2860 2910 2.6257116000000e+01 2861 2910 -4.2529456000000e+00 2862 2910 -2.6335301000000e+00 2907 2910 -2.3485896000000e+00 2908 2910 -2.8966876000000e+02 2909 2910 4.4531218000000e+01 2910 2910 1.3638805000000e+01 2913 2910 -2.7766044000000e+00 2958 2910 -2.5438056000000e+00 1807 2911 -9.9412422000000e-03 1809 2911 -1.2837617000000e-05 2863 2911 -1.4530947000000e-01 2865 2911 -1.2988390000000e-05 2908 2911 -1.7789741000000e-03 2910 2911 -1.2180538000000e-05 2911 2911 2.9235758000000e+02 2913 2911 7.4769519000000e-04 2914 2911 -1.2369273000000e-03 2916 2911 -1.2909133000000e-05 2959 2911 -1.2251659000000e-03 2961 2911 -1.2786386000000e-05 1807 2912 6.0694391000000e+00 1809 2912 -1.7312366000000e+00 2863 2912 7.4327847000000e+00 2865 2912 -1.7514355000000e+00 2908 2912 2.1251653000000e+00 2910 2912 -1.6425735000000e+00 2911 2912 -1.8339221000000e+02 2912 2912 -5.5787051000000e+01 2913 2912 8.6371571000000e+00 2916 2912 -1.7546171000000e+00 2961 2912 -1.7510167000000e+00 1807 2913 1.0259773000000e+01 1808 2913 -1.6618126000000e+00 1809 2913 -2.9264805000000e+00 2863 2913 1.2564371000000e+01 2864 2913 -2.0350968000000e+00 2865 2913 -2.9606246000000e+00 2908 2913 3.5923771000000e+00 2909 2913 -5.8187035000000e-01 2910 2913 -2.7766044000000e+00 2911 2913 -3.1000599000000e+02 2912 2913 4.7510016000000e+01 2913 2913 1.4600243000000e+01 2916 2913 -2.9660047000000e+00 2961 2913 -2.9599166000000e+00 1810 2914 -1.2317144000000e-03 1812 2914 -1.2854729000000e-05 2866 2914 -4.9930138000000e-02 2868 2914 -1.2885356000000e-05 2911 2914 -4.3702887000000e-02 2913 2914 -1.2909133000000e-05 2914 2914 2.9229690000000e+02 2916 2914 7.3543728000000e-04 2917 2914 -1.2263071000000e-03 2919 2914 -1.2798296000000e-05 1810 2915 4.7417388000000e+00 1812 2915 -1.7320662000000e+00 2868 2915 -1.7512923000000e+00 2911 2915 4.1803082000000e+00 2913 2915 -1.7546171000000e+00 2914 2915 -1.7669016000000e+02 2915 2915 -5.5784865000000e+01 2916 2915 6.9988269000000e+00 2919 2915 -1.7545746000000e+00 1810 2916 8.0154353000000e+00 1811 2916 -1.2982959000000e+00 1812 2916 -2.9278847000000e+00 2868 2916 -2.9603845000000e+00 2911 2916 7.0663930000000e+00 2912 2916 -1.1445752000000e+00 2913 2916 -2.9660047000000e+00 2914 2916 -2.9867705000000e+02 2915 2916 4.5680730000000e+01 2916 2916 1.1830815000000e+01 2919 2916 -2.9659313000000e+00 1813 2917 -1.2176441000000e-03 1815 2917 -1.2707884000000e-05 2869 2917 -1.7815582000000e-02 2871 2917 -1.2778240000000e-05 2914 2917 -5.6888197000000e-02 2916 2917 -1.2798296000000e-05 2917 2917 2.9227822000000e+02 2919 2917 7.2226879000000e-04 1813 2918 3.6538981000000e+00 1815 2918 -1.7304932000000e+00 2871 2918 -1.7517190000000e+00 2914 2918 4.6340972000000e+00 2916 2918 -1.7545746000000e+00 2917 2918 -1.7605817000000e+02 2918 2918 -5.5783494000000e+01 2919 2918 5.2430629000000e+00 1813 2919 6.1765459000000e+00 1814 2919 -1.0004495000000e+00 1815 2919 -2.9252241000000e+00 2871 2919 -2.9611039000000e+00 2914 2919 7.8334735000000e+00 2915 2919 -1.2688313000000e+00 2916 2919 -2.9659313000000e+00 2917 2919 -2.9760857000000e+02 2918 2919 4.5511484000000e+01 2919 2919 8.8628684000000e+00 2920 2920 1.0000000000000e+00 2921 2921 1.0000000000000e+00 2922 2922 1.0000000000000e+00 2923 2923 1.0000000000000e+00 2924 2924 1.0000000000000e+00 2925 2925 1.0000000000000e+00 2926 2926 1.0000000000000e+00 2927 2927 1.0000000000000e+00 2928 2928 1.0000000000000e+00 2929 2929 1.0000000000000e+00 2930 2930 1.0000000000000e+00 2931 2931 1.0000000000000e+00 2932 2932 1.0000000000000e+00 2933 2933 1.0000000000000e+00 2934 2934 1.0000000000000e+00 1831 2935 -2.0907687000000e-03 1833 2935 -2.1820208000000e-05 2887 2935 -1.5280454000000e-02 2889 2935 -4.7493308000000e-06 2935 2935 1.4030494000000e+02 2937 2935 3.6494319000000e-04 2938 2935 -4.6051907000000e-04 2940 2935 -4.8061854000000e-06 2983 2935 -5.0706768000000e-04 2985 2935 -5.2919878000000e-06 1831 2936 2.4986659000000e-01 1833 2936 -3.6092681000000e+00 2887 2936 2.3300809000000e+00 2889 2936 -7.8561509000000e-01 2935 2936 -8.5988916000000e+01 2936 2936 -2.6749432000000e+01 2937 2936 6.0726827000000e+00 2938 2936 2.8408732000000e+00 2940 2936 -7.8409278000000e-01 2985 2936 -8.9070618000000e-01 1831 2937 4.2237423000000e-01 1832 2937 -6.8422734000000e-02 1833 2937 -6.1011032000000e+00 2887 2937 3.9387665000000e+00 2888 2937 -6.3806251000000e-01 2889 2937 -1.3280030000000e+00 2935 2937 -1.4535558000000e+02 2936 2937 2.2319922000000e+01 2937 2937 1.0265257000000e+01 2938 2937 4.8022092000000e+00 2939 2937 -7.7793632000000e-01 2940 2937 -1.3254297000000e+00 2985 2937 -1.5056487000000e+00 1834 2938 -2.4200611000000e-03 1836 2938 -2.5256853000000e-05 2890 2938 -3.9294061000000e-02 2892 2938 -4.4035919000000e-06 2935 2938 -1.4951867000000e-02 2937 2938 -4.8061854000000e-06 2938 2938 1.2281904000000e+02 2940 2938 3.3084145000000e-04 2941 2938 -1.8239248000000e-02 2943 2938 -4.4015426000000e-06 2986 2938 -4.5364268000000e-04 2988 2938 -4.7344203000000e-06 1834 2939 2.4940594000000e-01 1836 2939 -4.1202759000000e+00 2890 2939 2.9376635000000e+00 2892 2939 -7.1847045000000e-01 2937 2939 -7.8409278000000e-01 2938 2939 -7.7998744000000e+01 2939 2939 -2.3412403000000e+01 2940 2939 7.1290163000000e+00 2941 2939 4.3238292000000e+00 2943 2939 -7.1818374000000e-01 2988 2939 -7.8536504000000e-01 1834 2940 4.2159580000000e-01 1835 2940 -6.8296022000000e-02 1836 2940 -6.9649144000000e+00 2890 2940 4.9658263000000e+00 2891 2940 -8.0443445000000e-01 2892 2940 -1.2145024000000e+00 2937 2940 -1.3254297000000e+00 2938 2940 -1.3184908000000e+02 2939 2940 2.0268814000000e+01 2940 2940 1.2050888000000e+01 2941 2940 7.3090009000000e+00 2942 2940 -1.1840149000000e+00 2943 2940 -1.2140178000000e+00 2988 2940 -1.3275811000000e+00 1837 2941 -2.5969432000000e-03 1839 2941 -2.7102875000000e-05 2893 2941 -3.9896689000000e-02 2895 2941 -4.4004684000000e-06 2938 2941 -4.2174700000000e-04 2940 2941 -4.4015426000000e-06 2941 2941 1.1698109000000e+02 2943 2941 3.1818732000000e-04 2944 2941 -4.5028381000000e-02 2946 2941 -4.3990367000000e-06 2989 2941 -4.1409852000000e-04 2991 2941 -4.3217195000000e-06 1837 2942 2.6194740000000e-01 1839 2942 -4.3210899000000e+00 2893 2942 2.8713325000000e+00 2895 2942 -7.0157335000000e-01 2940 2942 -7.1818374000000e-01 2941 2942 -7.5997533000000e+01 2942 2942 -2.2303045000000e+01 2943 2942 7.1462039000000e+00 2944 2942 5.7407411000000e+00 2946 2942 -7.0138732000000e-01 2991 2942 -7.0146394000000e-01 1837 2943 4.4279562000000e-01 1838 2943 -7.1729294000000e-02 1839 2943 -7.3043660000000e+00 2893 2943 4.8536977000000e+00 2894 2943 -7.8625959000000e-01 2895 2943 -1.1859389000000e+00 2940 2943 -1.2140178000000e+00 2941 2943 -1.2846615000000e+02 2942 2943 1.9758867000000e+01 2943 2943 1.2079937000000e+01 2944 2943 9.7041432000000e+00 2945 2943 -1.5719925000000e+00 2946 2943 -1.1856244000000e+00 2991 2943 -1.1857538000000e+00 1840 2944 -2.6783038000000e-03 1842 2944 -2.7951990000000e-05 2896 2944 -4.6667797000000e-02 2898 2944 -4.5368496000000e-06 2941 2944 -4.2150690000000e-04 2943 2944 -4.3990367000000e-06 2944 2944 1.1699333000000e+02 2946 2944 3.1965121000000e-04 2947 2944 -5.5637401000000e-02 2949 2944 -4.7515607000000e-06 2992 2944 -4.2604735000000e-04 2994 2944 -4.4464229000000e-06 1840 2945 3.8406668000000e-01 1842 2945 -4.3220435000000e+00 2896 2945 3.1988388000000e+00 2898 2945 -7.0164907000000e-01 2943 2945 -7.0138732000000e-01 2944 2945 -7.7946499000000e+01 2945 2945 -2.2307860000000e+01 2946 2945 7.1642056000000e+00 2947 2945 7.2469567000000e+00 2949 2945 -7.3491268000000e-01 2994 2945 -7.0170517000000e-01 1840 2946 6.4922631000000e-01 1841 2946 -1.0516732000000e-01 1842 2946 -7.3059823000000e+00 2896 2946 5.4073170000000e+00 2897 2946 -8.7592417000000e-01 2898 2946 -1.1860676000000e+00 2943 2946 -1.1856244000000e+00 2944 2946 -1.3176076000000e+02 2945 2946 2.0280237000000e+01 2946 2946 1.2110372000000e+01 2947 2946 1.2250255000000e+01 2948 2946 -1.9844028000000e+00 2949 2946 -1.2422964000000e+00 2994 2946 -1.1861624000000e+00 1843 2947 -2.5234634000000e-03 1845 2947 -2.6336006000000e-05 2899 2947 -8.6060744000000e-02 2901 2947 -5.4940068000000e-06 2944 2947 -4.5528504000000e-04 2946 2947 -4.7515607000000e-06 2947 2947 1.2875970000000e+02 2949 2947 3.4823164000000e-04 2950 2947 -1.0110620000000e-01 2952 2947 -5.7909466000000e-06 2995 2947 -4.7264122000000e-04 2997 2947 -4.9326976000000e-06 1843 2948 8.2261853000000e-01 1845 2948 -3.9293287000000e+00 2899 2948 4.3492109000000e+00 2901 2948 -8.2013940000000e-01 2946 2948 -7.3491268000000e-01 2947 2948 -8.7385812000000e+01 2948 2948 -2.4545170000000e+01 2949 2948 7.1055679000000e+00 2950 2948 8.3950323000000e+00 2952 2948 -8.6451796000000e-01 2997 2948 -7.5390765000000e-01 1843 2949 1.3905535000000e+00 1844 2949 -2.2524889000000e-01 1845 2949 -6.6421333000000e+00 2899 2949 7.3519017000000e+00 2900 2949 -1.1908982000000e+00 2901 2949 -1.3863628000000e+00 2946 2949 -1.2422964000000e+00 2947 2949 -1.4771689000000e+02 2948 2949 2.2741959000000e+01 2949 2949 1.2011246000000e+01 2950 2949 1.4190954000000e+01 2951 2949 -2.2987224000000e+00 2952 2949 -1.4613803000000e+00 2997 2949 -1.2744047000000e+00 1846 2950 -2.0624577000000e-03 1848 2950 -2.1524741000000e-05 2902 2950 -1.1252369000000e-01 2904 2950 -7.0214465000000e-06 2947 2950 -5.5487692000000e-04 2949 2950 -5.7909466000000e-06 2950 2950 1.6385552000000e+02 2952 2950 4.3118608000000e-04 2953 2950 -1.0965209000000e-01 2955 2950 -7.4674546000000e-06 2998 2950 -6.1070402000000e-04 3000 2950 -6.3735834000000e-06 1846 2951 1.7105763000000e+00 1848 2951 -3.1003240000000e+00 2902 2951 6.6823870000000e+00 2904 2951 -1.0131270000000e+00 2949 2951 -8.6451796000000e-01 2950 2951 -1.1119055000000e+02 2951 2951 -3.1242159000000e+01 2952 2951 7.0031835000000e+00 2953 2951 8.8505135000000e+00 2955 2951 -1.0775222000000e+00 3000 2951 -9.4417640000000e-01 1846 2952 2.8915581000000e+00 1847 2952 -4.6837824000000e-01 1848 2952 -5.2407877000000e+00 2902 2952 1.1295907000000e+01 2903 2952 -1.8297253000000e+00 2904 2952 -1.7125898000000e+00 2949 2952 -1.4613803000000e+00 2950 2952 -1.8795651000000e+02 2951 2952 2.8928800000000e+01 2952 2952 1.1838180000000e+01 2953 2952 1.4960908000000e+01 2954 2952 -2.4233868000000e+00 2955 2952 -1.8214435000000e+00 3000 2952 -1.5960358000000e+00 1849 2953 -1.7450567000000e-03 1851 2953 -1.8212201000000e-05 2905 2953 -1.5418602000000e-01 2907 2953 -8.7283238000000e-06 2950 2953 -7.1551657000000e-04 2952 2953 -7.4674546000000e-06 2953 2953 1.9895003000000e+02 2955 2953 5.1713859000000e-04 2956 2953 -1.0189083000000e-01 2958 2953 -9.3955150000000e-06 3001 2953 -7.8983668000000e-04 3003 2953 -8.2430930000000e-06 1849 2954 2.9953742000000e+00 1851 2954 -2.5465029000000e+00 2905 2954 9.8630409000000e+00 2907 2954 -1.2249288000000e+00 2952 2954 -1.0775222000000e+00 2953 2954 -1.3466501000000e+02 2954 2954 -3.7939422000000e+01 2955 2954 7.3605572000000e+00 2956 2954 7.7318862000000e+00 2958 2954 -1.3185876000000e+00 3003 2954 -1.1887451000000e+00 1849 2955 5.0633777000000e+00 1850 2955 -8.2015700000000e-01 1851 2955 -4.3046060000000e+00 2905 2955 1.6672475000000e+01 2906 2955 -2.7005780000000e+00 2907 2955 -2.0706186000000e+00 2952 2955 -1.8214435000000e+00 2953 2955 -2.2763761000000e+02 2954 2955 3.5024388000000e+01 2955 2955 1.2442280000000e+01 2956 2955 1.3069973000000e+01 2957 2955 -2.1170510000000e+00 2958 2955 -2.2289392000000e+00 3003 2955 -2.0094537000000e+00 1852 2956 -1.4437416000000e-03 1854 2956 -1.5067541000000e-05 2908 2956 -1.8899141000000e-01 2910 2956 -1.0932423000000e-05 2953 2956 -9.0025946000000e-04 2955 2956 -9.3955150000000e-06 2956 2956 2.4568578000000e+02 2958 2956 6.3195050000000e-04 2959 2956 -5.3626918000000e-02 2961 2956 -1.1637965000000e-05 3004 2956 -9.9467506000000e-04 3006 2956 -1.0380879000000e-05 1852 2957 3.8277950000000e+00 1854 2957 -2.0617751000000e+00 2908 2957 1.1347922000000e+01 2910 2957 -1.5048543000000e+00 2955 2957 -1.3185876000000e+00 2956 2957 -1.5857358000000e+02 2957 2957 -4.6867737000000e+01 2958 2957 7.9452507000000e+00 2959 2957 2.4842690000000e+00 2961 2957 -1.6019820000000e+00 3006 2957 -1.4527757000000e+00 1852 2958 6.4705046000000e+00 1853 2958 -1.0480660000000e+00 1854 2958 -3.4852246000000e+00 2908 2958 1.9182526000000e+01 2909 2958 -3.1071076000000e+00 2910 2958 -2.5438056000000e+00 2955 2958 -2.2289392000000e+00 2956 2958 -2.6805278000000e+02 2957 2958 4.1131714000000e+01 2958 2958 1.3430650000000e+01 2959 2958 4.1994083000000e+00 2960 2958 -6.8020307000000e-01 2961 2958 -2.7079903000000e+00 3006 2958 -2.4557720000000e+00 1855 2959 -1.2193593000000e-03 1857 2959 -1.2725786000000e-05 2911 2959 -1.6186938000000e-01 2913 2959 -1.2786386000000e-05 2956 2959 -1.1151265000000e-03 2958 2959 -1.1637965000000e-05 2959 2959 2.9235799000000e+02 2961 2959 7.3364169000000e-04 3007 2959 -1.1991036000000e-03 3009 2959 -1.2514388000000e-05 1855 2960 3.3656994000000e+00 1857 2960 -1.7316203000000e+00 2911 2960 8.2236014000000e+00 2913 2960 -1.7510167000000e+00 2958 2960 -1.6019820000000e+00 2959 2960 -1.7934679000000e+02 2960 2960 -5.5792557000000e+01 2961 2960 6.8241964000000e+00 3009 2960 -1.7332974000000e+00 1855 2961 5.6893743000000e+00 1856 2961 -9.2153890000000e-01 1857 2961 -2.9271289000000e+00 2911 2961 1.3901166000000e+01 2912 2961 -2.2516474000000e+00 2913 2961 -2.9599166000000e+00 2958 2961 -2.7079903000000e+00 2959 2961 -3.0316761000000e+02 2960 2961 4.6389658000000e+01 2961 2961 1.1535616000000e+01 3009 2961 -2.9299642000000e+00 2962 2962 1.0000000000000e+00 2963 2963 1.0000000000000e+00 2964 2964 1.0000000000000e+00 2965 2965 1.0000000000000e+00 2966 2966 1.0000000000000e+00 2967 2967 1.0000000000000e+00 2968 2968 1.0000000000000e+00 2969 2969 1.0000000000000e+00 2970 2970 1.0000000000000e+00 2971 2971 1.0000000000000e+00 2972 2972 1.0000000000000e+00 2973 2973 1.0000000000000e+00 2974 2974 1.0000000000000e+00 2975 2975 1.0000000000000e+00 2976 2976 1.0000000000000e+00 2977 2977 1.0000000000000e+00 2978 2978 1.0000000000000e+00 2979 2979 1.0000000000000e+00 1876 2980 -1.6218760000000e-03 1878 2980 -1.6926631000000e-05 2980 2980 1.7537941000000e+02 2982 2980 4.3935417000000e-04 2983 2980 -5.6647007000000e-04 2985 2980 -5.9119379000000e-06 3028 2980 -6.1556137000000e-03 3030 2980 -6.1714783000000e-06 1876 2981 2.8576449000000e-01 1878 2981 -2.8833788000000e+00 2980 2981 -1.0405696000000e+02 2981 2981 -3.3424919000000e+01 2982 2981 4.9336497000000e+00 2983 2981 3.0445818000000e+00 2985 2981 -9.9495519000000e-01 3030 2981 -1.0515702000000e+00 1876 2982 4.8305630000000e-01 1877 2982 -7.8254280000000e-02 1878 2982 -4.8740636000000e+00 2980 2982 -1.7589789000000e+02 2981 2982 2.6990414000000e+01 2982 2982 8.3398415000000e+00 2983 2982 5.1465611000000e+00 2984 2982 -8.3373394000000e-01 2985 2982 -1.6818723000000e+00 3030 2982 -1.7775743000000e+00 1879 2983 -1.8263607000000e-03 1881 2983 -1.9060727000000e-05 2935 2983 -2.5935914000000e-02 2937 2983 -5.2919878000000e-06 2980 2983 -1.0039632000000e-02 2982 2983 -5.9119379000000e-06 2983 2983 1.5787298000000e+02 2985 2983 4.1085346000000e-04 2986 2983 -5.1382266000000e-04 2988 2983 -5.3624858000000e-06 3031 2983 -7.6890951000000e-03 3033 2983 -5.9184280000000e-06 1879 2984 2.7351888000000e-01 1881 2984 -3.2080206000000e+00 2935 2984 3.9182695000000e+00 2937 2984 -8.9070618000000e-01 2982 2984 -9.9495519000000e-01 2983 2984 -9.8166516000000e+01 2984 2984 -3.0088923000000e+01 2985 2984 6.9825585000000e+00 2986 2984 3.3297181000000e+00 2988 2984 -8.8944881000000e-01 3033 2984 -9.9605394000000e-01 1879 2985 4.6235599000000e-01 1880 2985 -7.4900371000000e-02 1881 2985 -5.4228342000000e+00 2935 2985 6.6234381000000e+00 2936 2985 -1.0729783000000e+00 2937 2985 -1.5056487000000e+00 2982 2985 -1.6818723000000e+00 2983 2985 -1.6594056000000e+02 2984 2985 2.5511811000000e+01 2985 2985 1.1803310000000e+01 2986 2985 5.6285516000000e+00 2987 2985 -9.1180951000000e-01 2988 2985 -1.5035232000000e+00 3033 2985 -1.6837284000000e+00 1882 2986 -2.0841056000000e-03 1884 2986 -2.1750669000000e-05 2938 2986 -1.4222408000000e-02 2940 2986 -4.7344203000000e-06 2983 2986 -7.1571804000000e-03 2985 2986 -5.3624858000000e-06 2986 2986 1.4031504000000e+02 2988 2986 3.6982836000000e-04 2989 2986 -7.4921983000000e-03 2991 2986 -4.6053461000000e-06 3034 2986 -4.8897810000000e-04 3036 2986 -5.1031967000000e-06 1882 2987 2.5395958000000e-01 1884 2987 -3.6073107000000e+00 2938 2987 3.3601425000000e+00 2940 2987 -7.8536504000000e-01 2985 2987 -8.8944881000000e-01 2986 2987 -8.8453895000000e+01 2987 2987 -2.6752309000000e+01 2988 2987 6.9076900000000e+00 2989 2987 4.2756307000000e+00 2991 2987 -7.6397796000000e-01 3036 2987 -8.5858568000000e-01 1882 2988 4.2929328000000e-01 1883 2988 -6.9543659000000e-02 1884 2988 -6.0977979000000e+00 2938 2988 5.6799849000000e+00 2939 2988 -9.2013306000000e-01 2940 2988 -1.3275811000000e+00 2985 2988 -1.5035232000000e+00 2986 2988 -1.4952246000000e+02 2987 2988 2.2987933000000e+01 2988 2988 1.1676758000000e+01 2989 2988 7.2275262000000e+00 2990 2988 -1.1708281000000e+00 2991 2988 -1.2914283000000e+00 3036 2988 -1.4513532000000e+00 1885 2989 -2.5550484000000e-03 1887 2989 -2.6665641000000e-05 2941 2989 -2.3639000000000e-02 2943 2989 -4.3217195000000e-06 2986 2989 -4.4127505000000e-04 2988 2989 -4.6053461000000e-06 2989 2989 1.1694917000000e+02 2991 2989 3.1781661000000e-04 2992 2989 -2.6024437000000e-02 2994 2989 -4.3157520000000e-06 3037 2989 -4.1664047000000e-04 3039 2989 -4.3482484000000e-06 1885 2990 2.5126827000000e-01 1887 2990 -4.3270355000000e+00 2941 2990 3.2985162000000e+00 2943 2990 -7.0146394000000e-01 2988 2990 -7.6397796000000e-01 2989 2990 -7.5896088000000e+01 2990 2990 -2.2299969000000e+01 2991 2990 7.2137900000000e+00 2992 2990 5.2184149000000e+00 2994 2990 -7.0052491000000e-01 3039 2990 -7.1828335000000e-01 1885 2991 4.2474358000000e-01 1886 2991 -6.8805773000000e-02 1887 2991 -7.3144156000000e+00 2941 2991 5.5758076000000e+00 2942 2991 -9.0324552000000e-01 2943 2991 -1.1857538000000e+00 2988 2991 -1.2914283000000e+00 2989 2991 -1.2829465000000e+02 2990 2991 1.9738918000000e+01 2991 2991 1.2194183000000e+01 2992 2991 8.8212022000000e+00 2993 2991 -1.4289789000000e+00 2994 2991 -1.1841664000000e+00 3039 2991 -1.2141856000000e+00 1888 2992 -2.6280701000000e-03 1890 2992 -2.7427728000000e-05 2944 2992 -4.2629391000000e-02 2946 2992 -4.4464229000000e-06 2989 2992 -4.1352672000000e-04 2991 2992 -4.3157520000000e-06 2992 2992 1.1696963000000e+02 2994 2992 3.1865200000000e-04 2995 2992 -3.4250593000000e-02 2997 2992 -4.5489783000000e-06 3040 2992 -4.1695912000000e-04 3042 2992 -4.3515740000000e-06 1888 2993 2.8803691000000e-01 1890 2993 -4.3278193000000e+00 2944 2993 3.8156956000000e+00 2946 2993 -7.0170517000000e-01 2991 2993 -7.0052491000000e-01 2992 2993 -7.7511946000000e+01 2993 2993 -2.2306268000000e+01 2994 2993 7.1518615000000e+00 2995 2993 6.2892341000000e+00 2997 2993 -7.1794048000000e-01 3042 2993 -7.0136448000000e-01 1888 2994 4.8689758000000e-01 1889 2994 -7.8872904000000e-02 1890 2994 -7.3157458000000e+00 2944 2994 6.4500519000000e+00 2945 2994 -1.0448487000000e+00 2946 2994 -1.1861624000000e+00 2991 2994 -1.1841664000000e+00 2992 2994 -1.3102619000000e+02 2993 2994 2.0165486000000e+01 2994 2994 1.2089506000000e+01 2995 2994 1.0631321000000e+01 2996 2994 -1.7221757000000e+00 2997 2994 -1.2136066000000e+00 3042 2994 -1.1855865000000e+00 1891 2995 -2.5829767000000e-03 1893 2995 -2.6957113000000e-05 2947 2995 -6.6907064000000e-02 2949 2995 -4.9326976000000e-06 2992 2995 -4.3587400000000e-04 2994 2995 -4.5489783000000e-06 2995 2995 1.2284613000000e+02 2997 2995 3.3371446000000e-04 2998 2995 -5.0043636000000e-02 3000 2995 -5.3283485000000e-06 3043 2995 -4.5087345000000e-04 3045 2995 -4.7055193000000e-06 1891 2996 4.8005106000000e-01 1893 2996 -4.1183464000000e+00 2947 2996 4.9292198000000e+00 2949 2996 -7.5390765000000e-01 2994 2996 -7.1794048000000e-01 2995 2996 -8.3034678000000e+01 2996 2996 -2.3428959000000e+01 2997 2996 7.1440394000000e+00 2998 2996 7.1609685000000e+00 3000 2996 -8.1443468000000e-01 3045 2996 -7.3677436000000e-01 1891 2997 8.1147783000000e-01 1892 2997 -1.3144930000000e-01 1893 2997 -6.9616488000000e+00 2947 2997 8.3323483000000e+00 2948 2997 -1.3497365000000e+00 2949 2997 -1.2744047000000e+00 2994 2997 -1.2136066000000e+00 2995 2997 -1.4036174000000e+02 2996 2997 2.1606154000000e+01 2997 2997 1.2076278000000e+01 2998 2997 1.2104894000000e+01 2999 2997 -1.9608419000000e+00 3000 2997 -1.3767196000000e+00 3045 2997 -1.2454426000000e+00 1894 2998 -2.1541484000000e-03 1896 2998 -2.2481667000000e-05 2950 2998 -1.3618978000000e-01 2952 2998 -6.3735834000000e-06 2995 2998 -5.1055170000000e-04 2997 2998 -5.3283485000000e-06 2998 2998 1.5220095000000e+02 3000 2998 4.0278264000000e-04 3001 2998 -1.2365296000000e-01 3003 2998 -6.9744586000000e-06 3046 2998 -5.7371574000000e-04 3048 2998 -5.9875571000000e-06 1894 2999 9.1064474000000e-01 1896 2999 -3.3276778000000e+00 2950 2999 7.0395525000000e+00 2952 2999 -9.4417640000000e-01 2997 2999 -8.1443468000000e-01 2998 2999 -1.0306843000000e+02 2999 2999 -2.9014860000000e+01 3000 2999 7.0343971000000e+00 3001 2999 7.8874247000000e+00 3003 2999 -1.0332217000000e+00 3048 2999 -9.1161978000000e-01 1894 3000 1.5393539000000e+00 1895 3000 -2.4935089000000e-01 1896 3000 -5.6251066000000e+00 2950 3000 1.1899659000000e+01 2951 3000 -1.9275560000000e+00 2952 3000 -1.5960358000000e+00 2997 3000 -1.3767196000000e+00 2998 3000 -1.7422688000000e+02 2999 3000 2.6803302000000e+01 3000 3000 1.1890944000000e+01 3001 3000 1.3332903000000e+01 3002 3000 -2.1597186000000e+00 3003 3000 -1.7465580000000e+00 3048 3000 -1.5410021000000e+00 1897 3001 -1.7013121000000e-03 1899 3001 -1.7755663000000e-05 2953 3001 -1.5016361000000e-01 2955 3001 -8.2430930000000e-06 2998 3001 -6.6827867000000e-04 3000 3001 -6.9744586000000e-06 3001 3001 1.9898128000000e+02 3003 3001 5.1503403000000e-04 3004 3001 -1.3871730000000e-01 3006 3001 -9.0451660000000e-06 3049 3001 -7.6061183000000e-04 3051 3001 -7.9380892000000e-06 1897 3002 1.4824585000000e+00 1899 3002 -2.5556453000000e+00 2953 3002 9.5520967000000e+00 2955 3002 -1.1887451000000e+00 3000 3002 -1.0332217000000e+00 3001 3002 -1.3676547000000e+02 3002 3002 -3.7941031000000e+01 3003 3002 7.2749930000000e+00 3004 3002 1.1658090000000e+01 3006 3002 -1.3044628000000e+00 3051 3002 -1.1886468000000e+00 1897 3003 2.5059465000000e+00 1898 3003 -4.0591642000000e-01 1899 3003 -4.3200606000000e+00 2953 3003 1.6146856000000e+01 2954 3003 -2.6154883000000e+00 2955 3003 -2.0094537000000e+00 3000 3003 -1.7465580000000e+00 3001 3003 -2.3118823000000e+02 3002 3003 3.5596443000000e+01 3003 3003 1.2297642000000e+01 3004 3003 1.9706825000000e+01 3005 3003 -3.1921367000000e+00 3006 3003 -2.2050628000000e+00 3051 3003 -2.0092868000000e+00 1900 3004 -1.4516712000000e-03 1902 3004 -1.5150297000000e-05 2956 3004 -1.4127870000000e-01 2958 3004 -1.0380879000000e-05 3001 3004 -8.6668972000000e-04 3003 3004 -9.0451660000000e-06 3004 3004 2.3981230000000e+02 3006 3004 6.0661304000000e-04 3007 3004 -7.7472854000000e-02 3009 3004 -1.1193885000000e-05 1900 3005 2.1898569000000e+00 1902 3005 -2.1132209000000e+00 2956 3005 7.2084319000000e+00 2958 3005 -1.4527757000000e+00 3003 3005 -1.3044628000000e+00 3004 3005 -1.5184615000000e+02 3005 3005 -4.5756514000000e+01 3006 3005 6.4422035000000e+00 3007 3005 4.8956587000000e+00 3009 3005 -1.5665916000000e+00 1900 3006 3.7017341000000e+00 1901 3006 -5.9959884000000e-01 1902 3006 -3.5721885000000e+00 2956 3006 1.2185133000000e+01 2957 3006 -1.9737214000000e+00 2958 3006 -2.4557720000000e+00 3003 3006 -2.2050628000000e+00 3004 3006 -2.5668073000000e+02 3005 3006 3.9333292000000e+01 3006 3006 1.0889900000000e+01 3007 3006 8.2756215000000e+00 3008 3006 -1.3404672000000e+00 3009 3006 -2.6481665000000e+00 1903 3007 -1.2276692000000e-03 1905 3007 -1.2812511000000e-05 2959 3007 -1.4085507000000e-01 2961 3007 -1.2514388000000e-05 3004 3007 -1.0725757000000e-03 3006 3007 -1.1193885000000e-05 3007 3007 2.8648462000000e+02 3009 3007 7.0680430000000e-04 1903 3008 2.1925545000000e+00 1905 3008 -1.7673253000000e+00 2959 3008 5.8715541000000e+00 2961 3008 -1.7332974000000e+00 3006 3008 -1.5665916000000e+00 3007 3008 -1.7245683000000e+02 3008 3008 -5.4683742000000e+01 3009 3008 5.0733718000000e+00 1903 3009 3.7062920000000e+00 1904 3009 -6.0033301000000e-01 1905 3009 -2.9874848000000e+00 2959 3009 9.9252692000000e+00 2960 3009 -1.6076626000000e+00 2961 3009 -2.9299642000000e+00 3006 3009 -2.6481665000000e+00 3007 3009 -2.9152085000000e+02 3008 3009 4.4540689000000e+01 3009 3009 8.5760242000000e+00 3010 3010 1.0000000000000e+00 3011 3011 1.0000000000000e+00 3012 3012 1.0000000000000e+00 3013 3013 1.0000000000000e+00 3014 3014 1.0000000000000e+00 3015 3015 1.0000000000000e+00 3016 3016 1.0000000000000e+00 3017 3017 1.0000000000000e+00 3018 3018 1.0000000000000e+00 3019 3019 1.0000000000000e+00 3020 3020 1.0000000000000e+00 3021 3021 1.0000000000000e+00 3022 3022 1.0000000000000e+00 3023 3023 1.0000000000000e+00 3024 3024 1.0000000000000e+00 3025 3025 1.0000000000000e+00 3026 3026 1.0000000000000e+00 3027 3027 1.0000000000000e+00 1924 3028 -1.6115242000000e-03 1926 3028 -1.6818596000000e-05 2980 3028 -5.9133870000000e-04 2982 3028 -6.1714783000000e-06 3028 3028 1.7538712000000e+02 3030 3028 4.4563921000000e-04 3031 3028 -5.9091291000000e-04 3033 3028 -6.1670345000000e-06 3076 3028 -9.5763281000000e-03 3078 3028 -6.1369889000000e-06 1924 3029 2.9148652000000e-01 1926 3029 -2.8811403000000e+00 2980 3029 1.4767022000000e+00 2982 3029 -1.0515702000000e+00 3028 3029 -1.0423432000000e+02 3029 3029 -3.3421480000000e+01 3030 3029 6.0380010000000e+00 3031 3029 1.7347769000000e+00 3033 3029 -1.0499448000000e+00 3078 3029 -1.0516017000000e+00 1924 3030 4.9272882000000e-01 1925 3030 -7.9821473000000e-02 1926 3030 -4.8702796000000e+00 2980 3030 2.4962175000000e+00 2981 3030 -4.0438421000000e-01 2982 3030 -1.7775743000000e+00 3028 3030 -1.7619769000000e+02 3029 3030 2.7047472000000e+01 3030 3030 1.0206637000000e+01 3031 3030 2.9324669000000e+00 3032 3030 -4.7505609000000e-01 3033 3030 -1.7748266000000e+00 3078 3030 -1.7776276000000e+00 1927 3031 -1.6258747000000e-03 1929 3031 -1.6968364000000e-05 2983 3031 -5.6709193000000e-04 2985 3031 -5.9184280000000e-06 3028 3031 -8.6361060000000e-03 3030 3031 -6.1670345000000e-06 3031 3031 1.7538214000000e+02 3033 3031 4.5119202000000e-04 3034 3031 -5.4331590000000e-04 3036 3031 -5.6702906000000e-06 3079 3031 -5.8681485000000e-04 3081 3031 -6.1242653000000e-06 1927 3032 2.7089122000000e-01 1929 3032 -2.8880003000000e+00 2983 3032 2.8009460000000e+00 2985 3032 -9.9605394000000e-01 3030 3032 -1.0499448000000e+00 3031 3032 -1.0664585000000e+02 3032 3032 -3.3425726000000e+01 3033 3032 6.9433508000000e+00 3034 3032 2.8484679000000e+00 3036 3032 -9.5388098000000e-01 3081 3032 -1.0517250000000e+00 1927 3033 4.5791421000000e-01 1928 3033 -7.4181320000000e-02 1929 3033 -4.8818723000000e+00 2983 3033 4.7347159000000e+00 2984 3033 -7.6701587000000e-01 2985 3033 -1.6837284000000e+00 3030 3033 -1.7748266000000e+00 3031 3033 -1.8027402000000e+02 3032 3033 2.7697435000000e+01 3033 3033 1.1737033000000e+01 3034 3033 4.8150467000000e+00 3035 3033 -7.8002927000000e-01 3036 3033 -1.6124393000000e+00 3081 3033 -1.7778344000000e+00 1930 3034 -1.9728916000000e-03 1932 3034 -2.0589990000000e-05 2986 3034 -1.3010801000000e-02 2988 3034 -5.1031967000000e-06 3031 3034 -2.8402342000000e-02 3033 3034 -5.6702906000000e-06 3034 3034 1.4617753000000e+02 3036 3034 3.8329670000000e-04 3037 3034 -4.6348563000000e-04 3039 3034 -4.8371457000000e-06 3082 3034 -4.9312692000000e-04 3084 3034 -5.1464957000000e-06 1930 3035 2.6262155000000e-01 1932 3035 -3.4633279000000e+00 2986 3035 3.0645876000000e+00 2988 3035 -8.5858568000000e-01 3033 3035 -9.5388098000000e-01 3034 3035 -9.0982103000000e+01 3035 3035 -2.7862876000000e+01 3036 3035 6.9542530000000e+00 3037 3035 3.7281401000000e+00 3039 3035 -7.9895138000000e-01 3084 3035 -8.7638198000000e-01 1930 3036 4.4393547000000e-01 1931 3036 -7.1916234000000e-02 1932 3036 -5.8544095000000e+00 2986 3036 5.1803789000000e+00 2987 3036 -8.3920606000000e-01 2988 3036 -1.4513532000000e+00 3033 3036 -1.6124393000000e+00 3034 3036 -1.5379615000000e+02 3035 3036 2.3639133000000e+01 3036 3036 1.1755468000000e+01 3037 3036 6.3020480000000e+00 3038 3036 -1.0209131000000e+00 3039 3036 -1.3505474000000e+00 3084 3036 -1.4814361000000e+00 1933 3037 -2.3929774000000e-03 1935 3037 -2.4974195000000e-05 2989 3037 -1.7678043000000e-02 2991 3037 -4.3482484000000e-06 3034 3037 -6.3985924000000e-04 3036 3037 -4.8371457000000e-06 3037 3037 1.2277994000000e+02 3039 3037 3.3012322000000e-04 3040 3037 -1.3774656000000e-02 3042 3037 -4.3414042000000e-06 3085 3037 -4.2021413000000e-04 3087 3037 -4.3855448000000e-06 1933 3038 2.4566396000000e-01 1935 3038 -4.1247997000000e+00 2989 3038 3.2319114000000e+00 2991 3038 -7.1828335000000e-01 3036 3038 -7.9895138000000e-01 3037 3038 -7.8539113000000e+01 3038 3038 -2.3411151000000e+01 3039 3038 7.0979949000000e+00 3040 3038 4.5718862000000e+00 3042 3038 -7.1717987000000e-01 3087 3038 -7.3615276000000e-01 1933 3039 4.1527015000000e-01 1934 3039 -6.7271826000000e-02 1935 3039 -6.9725578000000e+00 2989 3039 5.4632203000000e+00 2990 3039 -8.8501622000000e-01 2991 3039 -1.2141856000000e+00 3036 3039 -1.3505474000000e+00 3037 3039 -1.3276245000000e+02 3038 3039 2.0420065000000e+01 3039 3039 1.1998445000000e+01 3040 3039 7.7283124000000e+00 3041 3039 -1.2519506000000e+00 3042 3039 -1.2123202000000e+00 3087 3039 -1.2443918000000e+00 1936 3040 -2.5759938000000e-03 1938 3040 -2.6884237000000e-05 2992 3040 -2.9847192000000e-02 2994 3040 -4.3515740000000e-06 3037 3040 -4.1598466000000e-04 3039 3040 -4.3414042000000e-06 3040 3040 1.1694874000000e+02 3042 3040 3.1784780000000e-04 3043 3040 -2.2480601000000e-02 3045 3040 -4.4513079000000e-06 3088 3040 -4.0819198000000e-04 3090 3040 -4.2600762000000e-06 1936 3041 2.5344182000000e-01 1938 3041 -4.3324235000000e+00 2992 3041 3.9093144000000e+00 2994 3041 -7.0136448000000e-01 3039 3041 -7.1717987000000e-01 3040 3041 -7.6761331000000e+01 3041 3041 -2.2302868000000e+01 3042 3041 7.1720149000000e+00 3043 3041 5.4747474000000e+00 3045 3041 -7.1747312000000e-01 3090 3041 -7.0106833000000e-01 1936 3042 4.2841805000000e-01 1937 3042 -6.9400666000000e-02 1938 3042 -7.3235287000000e+00 2992 3042 6.6083050000000e+00 2993 3042 -1.0704982000000e+00 2994 3042 -1.1855865000000e+00 3039 3042 -1.2123202000000e+00 3040 3042 -1.2975735000000e+02 3041 3042 1.9968614000000e+01 3042 3042 1.2123573000000e+01 3043 3042 9.2545130000000e+00 3044 3042 -1.4991650000000e+00 3045 3042 -1.2128166000000e+00 3090 3042 -1.1850859000000e+00 1939 3043 -2.5229950000000e-03 1941 3043 -2.6331117000000e-05 2995 3043 -4.3417094000000e-02 2997 3043 -4.7055193000000e-06 3040 3043 -4.2651542000000e-04 3042 3043 -4.4513079000000e-06 3043 3043 1.2281008000000e+02 3045 3043 3.3250862000000e-04 3046 3043 -3.3660399000000e-02 3048 3043 -5.1997375000000e-06 3091 3043 -4.3909792000000e-04 3093 3043 -4.5826245000000e-06 1939 3044 3.3584186000000e-01 1941 3044 -4.1223643000000e+00 2995 3044 4.9387264000000e+00 2997 3044 -7.3677436000000e-01 3042 3044 -7.1747312000000e-01 3043 3044 -8.2076518000000e+01 3044 3044 -2.3425410000000e+01 3045 3044 7.1290006000000e+00 3046 3044 6.3323798000000e+00 3048 3044 -8.1418837000000e-01 3093 3044 -7.3556628000000e-01 1939 3045 5.6770671000000e-01 1940 3045 -9.1962831000000e-02 1941 3045 -6.9684400000000e+00 2995 3045 8.3484175000000e+00 2996 3045 -1.3523605000000e+00 2997 3045 -1.2454426000000e+00 3042 3045 -1.2128166000000e+00 3043 3045 -1.3874205000000e+02 3044 3045 2.1352934000000e+01 3045 3045 1.2050855000000e+01 3046 3045 1.0704248000000e+01 3047 3045 -1.7339814000000e+00 3048 3045 -1.3763031000000e+00 3093 3045 -1.2434005000000e+00 1942 3046 -2.0993909000000e-03 1944 3046 -2.1910194000000e-05 2998 3046 -7.2043370000000e-02 3000 3046 -5.9875571000000e-06 3043 3046 -4.9822845000000e-04 3045 3046 -5.1997375000000e-06 3046 3046 1.5203491000000e+02 3048 3046 4.0139243000000e-04 3049 3046 -1.7673544000000e-02 3051 3046 -6.7841610000000e-06 3094 3046 -5.6341016000000e-04 3096 3046 -5.8800034000000e-06 1942 3047 5.1172148000000e-01 1944 3047 -3.3342396000000e+00 2998 3047 7.0358413000000e+00 3000 3047 -9.1161978000000e-01 3045 3047 -8.1418837000000e-01 3046 3047 -9.9703530000000e+01 3047 3047 -2.9011120000000e+01 3048 3047 7.0073651000000e+00 3049 3047 4.9196764000000e+00 3051 3047 -1.0329272000000e+00 3096 3047 -9.1112511000000e-01 1942 3048 8.6501399000000e-01 1943 3048 -1.4012105000000e-01 1944 3048 -5.6361987000000e+00 2998 3048 1.1893386000000e+01 2999 3048 -1.9265743000000e+00 3000 3048 -1.5410021000000e+00 3045 3048 -1.3763031000000e+00 3046 3048 -1.6853885000000e+02 3047 3048 2.5891734000000e+01 3048 3048 1.1845249000000e+01 3049 3048 8.3162210000000e+00 3050 3048 -1.3471200000000e+00 3051 3048 -1.7460601000000e+00 3096 3048 -1.5401659000000e+00 1945 3049 -1.6332782000000e-03 1947 3049 -1.7045630000000e-05 3001 3049 -2.1583579000000e-01 3003 3049 -7.9380892000000e-06 3046 3049 -6.5004474000000e-04 3048 3049 -6.7841610000000e-06 3049 3049 1.9890370000000e+02 3051 3049 5.0451300000000e-04 3097 3049 -7.3674286000000e-04 3099 3049 -7.6889818000000e-06 1945 3050 6.5701978000000e-01 1947 3050 -2.5502210000000e+00 3001 3050 1.2586195000000e+01 3003 3050 -1.1886468000000e+00 3048 3050 -1.0329272000000e+00 3049 3050 -1.2731025000000e+02 3050 3050 -3.7945497000000e+01 3051 3050 5.9488665000000e+00 3099 3050 -1.1727986000000e+00 1945 3051 1.1106253000000e+00 1946 3051 -1.7990509000000e-01 1947 3051 -4.3108899000000e+00 3001 3051 2.1275686000000e+01 3002 3051 -3.4463504000000e+00 3003 3051 -2.0092868000000e+00 3048 3051 -1.7460601000000e+00 3049 3051 -2.1520507000000e+02 3050 3051 3.2997687000000e+01 3051 3051 1.0055958000000e+01 3099 3051 -1.9824976000000e+00 3052 3052 1.0000000000000e+00 3053 3053 1.0000000000000e+00 3054 3054 1.0000000000000e+00 3055 3055 1.0000000000000e+00 3056 3056 1.0000000000000e+00 3057 3057 1.0000000000000e+00 3058 3058 1.0000000000000e+00 3059 3059 1.0000000000000e+00 3060 3060 1.0000000000000e+00 3061 3061 1.0000000000000e+00 3062 3062 1.0000000000000e+00 3063 3063 1.0000000000000e+00 3064 3064 1.0000000000000e+00 3065 3065 1.0000000000000e+00 3066 3066 1.0000000000000e+00 3067 3067 1.0000000000000e+00 3068 3068 1.0000000000000e+00 3069 3069 1.0000000000000e+00 3070 3070 1.0000000000000e+00 3071 3071 1.0000000000000e+00 3072 3072 1.0000000000000e+00 3073 3073 1.0000000000000e+00 3074 3074 1.0000000000000e+00 3075 3075 1.0000000000000e+00 1972 3076 -1.6016700000000e-03 1974 3076 -1.6715752000000e-05 3028 3076 -5.8803400000000e-04 3030 3076 -6.1369889000000e-06 3076 3076 1.7538637000000e+02 3078 3076 4.4541420000000e-04 3079 3076 -5.8597202000000e-04 3081 3076 -6.1154691000000e-06 3124 3076 -4.3665739000000e-03 3126 3076 -6.0994334000000e-06 1972 3077 2.9235146000000e-01 1974 3077 -2.8815324000000e+00 3028 3077 1.6458959000000e+00 3030 3077 -1.0516017000000e+00 3076 3077 -1.0373450000000e+02 3077 3077 -3.3417286000000e+01 3078 3077 6.0387736000000e+00 3079 3077 1.0591455000000e+00 3081 3077 -1.0501400000000e+00 3126 3077 -1.0517574000000e+00 1972 3078 4.9419092000000e-01 1973 3078 -8.0058621000000e-02 1974 3078 -4.8709424000000e+00 3028 3078 2.7822224000000e+00 3029 3078 -4.5071831000000e-01 3030 3078 -1.7776276000000e+00 3076 3078 -1.7535280000000e+02 3077 3078 2.6920936000000e+01 3078 3078 1.0207943000000e+01 3079 3078 1.7903796000000e+00 3080 3078 -2.9004039000000e-01 3081 3078 -1.7751567000000e+00 3126 3078 -1.7778907000000e+00 1975 3079 -1.6101520000000e-03 1977 3079 -1.6804275000000e-05 3031 3079 -8.7696541000000e-03 3033 3079 -6.1242653000000e-06 3076 3079 -2.5780045000000e-02 3078 3079 -6.1154691000000e-06 3079 3079 1.7541622000000e+02 3081 3079 4.5101433000000e-04 3082 3079 -5.3715474000000e-04 3084 3079 -5.6059899000000e-06 3127 3079 -5.8534991000000e-03 3129 3079 -6.0209255000000e-06 1975 3080 2.7282565000000e-01 1977 3080 -2.8857599000000e+00 3031 3080 2.3230251000000e+00 3033 3080 -1.0517250000000e+00 3078 3080 -1.0501400000000e+00 3079 3080 -1.0539655000000e+02 3080 3080 -3.3422495000000e+01 3081 3080 6.9798114000000e+00 3082 3080 2.0706710000000e+00 3084 3080 -9.5452483000000e-01 3129 3080 -1.0339173000000e+00 1975 3081 4.6118410000000e-01 1976 3081 -7.4711409000000e-02 1977 3081 -4.8780844000000e+00 3031 3081 3.9268383000000e+00 3032 3081 -6.3614422000000e-01 3033 3081 -1.7778344000000e+00 3078 3081 -1.7751567000000e+00 3079 3081 -1.7816218000000e+02 3080 3081 2.7363394000000e+01 3081 3081 1.1798665000000e+01 3082 3081 3.5002593000000e+00 3083 3081 -5.6703886000000e-01 3084 3081 -1.6135274000000e+00 3129 3081 -1.7477327000000e+00 1978 3082 -1.9480962000000e-03 1980 3082 -2.0331213000000e-05 3034 3082 -6.0100663000000e-03 3036 3082 -5.1464957000000e-06 3079 3082 -2.7000336000000e-02 3081 3082 -5.6059899000000e-06 3082 3082 1.4617357000000e+02 3084 3082 3.8278450000000e-04 3085 3082 -4.5616848000000e-04 3087 3082 -4.7607806000000e-06 3130 3082 -4.7816925000000e-04 3132 3082 -4.9903907000000e-06 1978 3083 2.6258576000000e-01 1980 3083 -3.4613003000000e+00 3034 3083 2.6515217000000e+00 3036 3083 -8.7638198000000e-01 3081 3083 -9.5452483000000e-01 3082 3083 -8.9727004000000e+01 3083 3083 -2.7858703000000e+01 3084 3083 6.9529221000000e+00 3085 3083 2.8803403000000e+00 3087 3083 -7.9904805000000e-01 3132 3083 -8.5854366000000e-01 1978 3084 4.4387497000000e-01 1979 3084 -7.1906941000000e-02 1980 3084 -5.8509821000000e+00 3034 3084 4.4821323000000e+00 3035 3084 -7.2609731000000e-01 3036 3084 -1.4814361000000e+00 3081 3084 -1.6135274000000e+00 3082 3084 -1.5167453000000e+02 3083 3084 2.3305832000000e+01 3084 3084 1.1753218000000e+01 3085 3084 4.8689272000000e+00 3086 3084 -7.8875738000000e-01 3087 3084 -1.3507108000000e+00 3132 3084 -1.4512822000000e+00 1981 3085 -2.3544364000000e-03 1983 3085 -2.4571963000000e-05 3037 3085 -9.3922807000000e-03 3039 3085 -4.3855448000000e-06 3082 3085 -5.3424284000000e-03 3084 3085 -4.7607806000000e-06 3085 3085 1.2277133000000e+02 3087 3085 3.2944068000000e-04 3088 3085 -4.0755025000000e-03 3090 3085 -4.2696781000000e-06 3133 3085 -4.0399608000000e-04 3135 3085 -4.2162858000000e-06 1981 3086 2.4204843000000e-01 1983 3086 -4.1229794000000e+00 3037 3086 3.0086929000000e+00 3039 3086 -7.3615276000000e-01 3084 3086 -7.9904805000000e-01 3085 3086 -7.7362189000000e+01 3086 3086 -2.3406774000000e+01 3087 3086 7.0957632000000e+00 3088 3086 3.6156603000000e+00 3090 3086 -7.1672088000000e-01 3135 3086 -7.1823623000000e-01 1981 3087 4.0915839000000e-01 1982 3087 -6.6282403000000e-02 1983 3087 -6.9694796000000e+00 3037 3087 5.0858910000000e+00 3038 3087 -8.2389872000000e-01 3039 3087 -1.2443918000000e+00 3084 3087 -1.3507108000000e+00 3085 3087 -1.3077296000000e+02 3086 3087 2.0108738000000e+01 3087 3087 1.1994671000000e+01 3088 3087 6.1119084000000e+00 3089 3087 -9.9011034000000e-01 3090 3087 -1.2115442000000e+00 3135 3087 -1.2141058000000e+00 1984 3088 -2.5253548000000e-03 1986 3088 -2.6355745000000e-05 3040 3088 -1.8423678000000e-02 3042 3088 -4.2600762000000e-06 3085 3088 -4.0911202000000e-04 3087 3088 -4.2696781000000e-06 3088 3088 1.1692724000000e+02 3090 3088 3.1697125000000e-04 3091 3088 -7.4196533000000e-03 3093 3088 -4.3598154000000e-06 3136 3088 -3.9935147000000e-04 3138 3088 -4.1678126000000e-06 1984 3089 2.3972266000000e-01 1986 3089 -4.3366092000000e+00 3040 3089 3.7977394000000e+00 3042 3089 -7.0106833000000e-01 3087 3089 -7.1672088000000e-01 3088 3089 -7.5851741000000e+01 3089 3089 -2.2298205000000e+01 3090 3089 7.1752949000000e+00 3091 3089 4.6838793000000e+00 3093 3089 -7.1750870000000e-01 3138 3089 -7.0088425000000e-01 1984 3090 4.0522718000000e-01 1985 3090 -6.5644740000000e-02 1986 3090 -7.3306042000000e+00 3040 3090 6.4196986000000e+00 3041 3090 -1.0399585000000e+00 3042 3090 -1.1850859000000e+00 3087 3090 -1.2115442000000e+00 3088 3090 -1.2821978000000e+02 3089 3090 1.9731273000000e+01 3090 3090 1.2129118000000e+01 3091 3090 7.9176295000000e+00 3092 3090 -1.2826157000000e+00 3093 3090 -1.2128767000000e+00 3138 3090 -1.1847747000000e+00 1987 3091 -2.4642846000000e-03 1989 3091 -2.5718390000000e-05 3043 3091 -3.4769833000000e-02 3045 3091 -4.5826245000000e-06 3088 3091 -4.1774879000000e-04 3090 3091 -4.3598154000000e-06 3091 3091 1.2283951000000e+02 3093 3091 3.3150008000000e-04 3094 3091 -6.7005388000000e-02 3096 3091 -5.0763157000000e-06 3139 3091 -4.3380501000000e-04 3141 3091 -4.5273854000000e-06 1987 3092 2.8433118000000e-01 1989 3092 -4.1274186000000e+00 3043 3092 4.7955485000000e+00 3045 3092 -7.3556628000000e-01 3090 3092 -7.1750870000000e-01 3091 3092 -8.3210913000000e+01 3092 3092 -2.3421014000000e+01 3093 3092 7.1502657000000e+00 3094 3092 7.6551978000000e+00 3096 3092 -8.1481601000000e-01 3141 3092 -7.5232399000000e-01 1987 3093 4.8063314000000e-01 1988 3093 -7.7858981000000e-02 1989 3093 -6.9769843000000e+00 3043 3093 8.1063905000000e+00 3044 3093 -1.3131747000000e+00 3045 3093 -1.2434005000000e+00 3090 3093 -1.2128767000000e+00 3091 3093 -1.4065965000000e+02 3092 3093 2.1674765000000e+01 3093 3093 1.2086803000000e+01 3094 3093 1.2940339000000e+01 3095 3093 -2.0962386000000e+00 3096 3093 -1.3773642000000e+00 3141 3093 -1.2717276000000e+00 1990 3094 -2.0595097000000e-03 1992 3094 -2.1493975000000e-05 3046 3094 -5.8206311000000e-03 3048 3094 -5.8800034000000e-06 3091 3094 -4.8640242000000e-04 3093 3094 -5.0763157000000e-06 3094 3094 1.5197500000000e+02 3096 3094 3.9466216000000e-04 3097 3094 -1.6491555000000e-02 3099 3094 -6.5805009000000e-06 1990 3095 3.8066337000000e-01 1992 3095 -3.3292502000000e+00 3046 3095 4.4665247000000e+00 3048 3095 -9.1112511000000e-01 3093 3095 -8.1481601000000e-01 3094 3095 -9.6579452000000e+01 3095 3095 -2.9003616000000e+01 3096 3095 6.0781023000000e+00 3097 3095 4.4853469000000e+00 3099 3095 -1.0196493000000e+00 1990 3096 6.4347336000000e-01 1991 3096 -1.0423552000000e-01 1992 3096 -5.6277646000000e+00 3046 3096 7.5502134000000e+00 3047 3096 -1.2230505000000e+00 3048 3096 -1.5401659000000e+00 3093 3096 -1.3773642000000e+00 3094 3096 -1.6325790000000e+02 3095 3096 2.5055078000000e+01 3096 3096 1.0274423000000e+01 3097 3096 7.5820305000000e+00 3098 3096 -1.2282045000000e+00 3099 3096 -1.7236152000000e+00 1993 3097 -1.6513683000000e-03 1995 3097 -1.7234427000000e-05 3049 3097 -8.5913082000000e-03 3051 3097 -7.6889818000000e-06 3094 3097 -6.3053043000000e-04 3096 3097 -6.5805009000000e-06 3097 3097 1.9286305000000e+02 3099 3097 4.8288283000000e-04 1993 3098 4.3902760000000e-01 1995 3098 -2.6270897000000e+00 3049 3098 6.1762049000000e+00 3051 3098 -1.1727986000000e+00 3096 3098 -1.0196493000000e+00 3097 3098 -1.1734177000000e+02 3098 3098 -3.6819304000000e+01 3099 3098 4.8236805000000e+00 1993 3099 7.4213181000000e-01 1994 3099 -1.2021593000000e-01 1995 3099 -4.4408299000000e+00 3049 3099 1.0440251000000e+01 3050 3099 -1.6911879000000e+00 3051 3099 -1.9824976000000e+00 3096 3099 -1.7236152000000e+00 3097 3099 -1.9835441000000e+02 3098 3099 3.0348281000000e+01 3099 3099 8.1539458000000e+00 3100 3100 1.0000000000000e+00 3101 3101 1.0000000000000e+00 3102 3102 1.0000000000000e+00 3103 3103 1.0000000000000e+00 3104 3104 1.0000000000000e+00 3105 3105 1.0000000000000e+00 3106 3106 1.0000000000000e+00 3107 3107 1.0000000000000e+00 3108 3108 1.0000000000000e+00 3109 3109 1.0000000000000e+00 3110 3110 1.0000000000000e+00 3111 3111 1.0000000000000e+00 3112 3112 1.0000000000000e+00 3113 3113 1.0000000000000e+00 3114 3114 1.0000000000000e+00 3115 3115 1.0000000000000e+00 3116 3116 1.0000000000000e+00 3117 3117 1.0000000000000e+00 3118 3118 1.0000000000000e+00 3119 3119 1.0000000000000e+00 3120 3120 1.0000000000000e+00 3121 3121 1.0000000000000e+00 3122 3122 1.0000000000000e+00 3123 3123 1.0000000000000e+00 2020 3124 -1.5936846000000e-03 2022 3124 -1.6632414000000e-05 3076 3124 -5.8443551000000e-04 3078 3124 -6.0994334000000e-06 3124 3124 1.7538475000000e+02 3126 3124 4.3905139000000e-04 3127 3124 -5.7225107000000e-04 3129 3124 -5.9722711000000e-06 2020 3125 2.8891914000000e-01 2022 3125 -2.8799247000000e+00 3076 3125 1.1461200000000e+00 3078 3125 -1.0517574000000e+00 3124 3125 -1.0259257000000e+02 3125 3125 -3.3414684000000e+01 3126 3125 4.9679571000000e+00 3127 3125 4.1685342000000e-01 3129 3125 -1.0325340000000e+00 2020 3126 4.8838892000000e-01 2021 3126 -7.9118903000000e-02 2022 3126 -4.8682248000000e+00 3076 3126 1.9374013000000e+00 3077 3126 -3.1385861000000e-01 3078 3126 -1.7778907000000e+00 3124 3126 -1.7342248000000e+02 3125 3126 2.6614646000000e+01 3126 3126 8.3978347000000e+00 3127 3126 7.0464903000000e-01 3128 3126 -1.1415300000000e-01 3129 3126 -1.7453955000000e+00 2023 3127 -1.6534664000000e-03 2025 3127 -1.7256323000000e-05 3079 3127 -5.7691304000000e-04 3081 3127 -6.0209255000000e-06 3124 3127 -2.3788469000000e-02 3126 3127 -5.9722711000000e-06 3127 3127 1.6955904000000e+02 3129 3127 4.3679250000000e-04 3130 3127 -5.1198579000000e-04 3132 3127 -5.3433153000000e-06 3175 3127 -5.3019016000000e-04 3177 3127 -5.5333043000000e-06 2023 3128 2.6840621000000e-01 2025 3128 -2.9837693000000e+00 3079 3128 1.7520136000000e+00 3081 3128 -1.0339173000000e+00 3126 3128 -1.0325340000000e+00 3127 3128 -1.0061618000000e+02 3128 3128 -3.2304568000000e+01 3129 3128 6.9340649000000e+00 3130 3128 1.2181112000000e+00 3132 3128 -9.1916787000000e-01 3177 3128 -9.6105850000000e-01 2023 3129 4.5371354000000e-01 2024 3129 -7.3501466000000e-02 2025 3129 -5.0437600000000e+00 3079 3129 2.9616017000000e+00 3080 3129 -4.7977864000000e-01 3081 3129 -1.7477327000000e+00 3126 3129 -1.7453955000000e+00 3127 3129 -1.7008148000000e+02 3128 3129 2.6113754000000e+01 3129 3129 1.1721336000000e+01 3130 3129 2.0590938000000e+00 3131 3129 -3.3357259000000e-01 3132 3129 -1.5537603000000e+00 3177 3129 -1.6245722000000e+00 2026 3130 -2.0081412000000e-03 2028 3130 -2.0957870000000e-05 3082 3130 -3.4615309000000e-03 3084 3130 -4.9903907000000e-06 3127 3130 -3.3882048000000e-02 3129 3130 -5.3433153000000e-06 3130 3130 1.4033621000000e+02 3132 3130 3.6857606000000e-04 3133 3130 -4.2975731000000e-04 3135 3130 -4.4851417000000e-06 3178 3130 -4.3381469000000e-04 3180 3130 -4.5274864000000e-06 2026 3131 2.5495473000000e-01 2028 3131 -3.6047923000000e+00 3082 3131 2.1794546000000e+00 3084 3131 -8.5854366000000e-01 3129 3131 -9.1916787000000e-01 3130 3131 -8.4868844000000e+01 3131 3131 -2.6740796000000e+01 3132 3131 6.9347739000000e+00 3133 3131 1.8542489000000e+00 3135 3131 -7.6395798000000e-01 3180 3131 -7.8531531000000e-01 2026 3132 4.3097547000000e-01 2027 3132 -6.9817658000000e-02 2028 3132 -6.0935410000000e+00 3082 3132 3.6841500000000e+00 3083 3132 -5.9682916000000e-01 3084 3132 -1.4512822000000e+00 3129 3132 -1.5537603000000e+00 3130 3132 -1.4346229000000e+02 3131 3132 2.2034918000000e+01 3132 3132 1.1722541000000e+01 3133 3132 3.1344224000000e+00 3134 3132 -5.0777376000000e-01 3135 3132 -1.2913946000000e+00 3180 3132 -1.3274970000000e+00 2029 3133 -2.4342564000000e-03 2031 3133 -2.5405001000000e-05 3085 3133 -1.1494214000000e-02 3087 3133 -4.2162858000000e-06 3130 3133 -1.4244710000000e-02 3132 3133 -4.4851417000000e-06 3133 3133 1.1693718000000e+02 3135 3133 3.1589702000000e-04 3136 3133 -3.9926474000000e-04 3138 3133 -4.1669075000000e-06 3181 3133 -3.8956671000000e-04 3183 3133 -4.0656945000000e-06 2029 3134 2.3759323000000e-01 2031 3134 -4.3266793000000e+00 3085 3134 2.6689809000000e+00 3087 3134 -7.1823623000000e-01 3132 3134 -7.6395798000000e-01 3133 3134 -7.2342964000000e+01 3134 3134 -2.2288761000000e+01 3135 3134 7.2130763000000e+00 3136 3134 2.2927909000000e+00 3138 3134 -7.0065061000000e-01 3183 3134 -7.0105282000000e-01 2029 3135 4.0162735000000e-01 2030 3135 -6.5062949000000e-02 2031 3135 -7.3138141000000e+00 3085 3135 4.5116426000000e+00 3086 3135 -7.3087850000000e-01 3087 3135 -1.2141058000000e+00 3132 3135 -1.2913946000000e+00 3133 3135 -1.2228847000000e+02 3134 3135 1.8794041000000e+01 3135 3135 1.2192977000000e+01 3136 3135 3.8757313000000e+00 3137 3135 -6.2786194000000e-01 3138 3135 -1.1843791000000e+00 3183 3135 -1.1850588000000e+00 2032 3136 -2.4659475000000e-03 2034 3136 -2.5735744000000e-05 3088 3136 -1.8922096000000e-02 3090 3136 -4.1678126000000e-06 3133 3136 -4.5151370000000e-03 3135 3136 -4.1669075000000e-06 3136 3136 1.1693079000000e+02 3138 3136 3.1609362000000e-04 3139 3136 -1.3475450000000e-03 3141 3136 -4.3649100000000e-06 3184 3136 -3.9297458000000e-04 3186 3136 -4.1012605000000e-06 2032 3137 2.2961507000000e-01 2034 3137 -4.3272116000000e+00 3088 3137 3.8466372000000e+00 3090 3137 -7.0088425000000e-01 3135 3137 -7.0065061000000e-01 3136 3137 -7.3470486000000e+01 3137 3137 -2.2293510000000e+01 3138 3137 7.1659987000000e+00 3139 3137 2.2572397000000e+00 3141 3137 -7.3402094000000e-01 3186 3137 -7.0072984000000e-01 2032 3138 3.8814131000000e-01 2033 3138 -6.2877724000000e-02 2034 3138 -7.3147185000000e+00 3088 3138 6.5023555000000e+00 3089 3138 -1.0533620000000e+00 3090 3138 -1.1847747000000e+00 3135 3138 -1.1843791000000e+00 3136 3138 -1.2419451000000e+02 3137 3138 1.9090994000000e+01 3138 3138 1.2113403000000e+01 3139 3138 3.8156380000000e+00 3140 3138 -6.1812187000000e-01 3141 3138 -1.2407890000000e+00 3186 3138 -1.1845137000000e+00 2035 3139 -2.2708331000000e-03 2037 3139 -2.3699441000000e-05 3091 3139 -2.6702316000000e-02 3093 3139 -4.5273854000000e-06 3136 3139 -4.1823695000000e-04 3138 3139 -4.3649100000000e-06 3139 3139 1.2861869000000e+02 3141 3139 3.3816896000000e-04 3187 3139 -4.4700789000000e-04 3189 3139 -4.6651766000000e-06 2035 3140 2.3735622000000e-01 2037 3140 -3.9368051000000e+00 3091 3140 6.7264661000000e+00 3093 3140 -7.5232399000000e-01 3138 3140 -7.3402094000000e-01 3139 3140 -8.0808617000000e+01 3140 3140 -2.4527093000000e+01 3141 3140 6.2140349000000e+00 3189 3140 -7.8813147000000e-01 2035 3141 4.0122669000000e-01 2036 3141 -6.4997097000000e-02 2037 3141 -6.6547709000000e+00 3091 3141 1.1370411000000e+01 3092 3141 -1.8419604000000e+00 3093 3141 -1.2717276000000e+00 3138 3141 -1.2407890000000e+00 3139 3141 -1.3659880000000e+02 3140 3141 2.0987143000000e+01 3141 3141 1.0504199000000e+01 3189 3141 -1.3322566000000e+00 3142 3142 1.0000000000000e+00 3143 3143 1.0000000000000e+00 3144 3144 1.0000000000000e+00 3145 3145 1.0000000000000e+00 3146 3146 1.0000000000000e+00 3147 3147 1.0000000000000e+00 3148 3148 1.0000000000000e+00 3149 3149 1.0000000000000e+00 3150 3150 1.0000000000000e+00 3151 3151 1.0000000000000e+00 3152 3152 1.0000000000000e+00 3153 3153 1.0000000000000e+00 3154 3154 1.0000000000000e+00 3155 3155 1.0000000000000e+00 3156 3156 1.0000000000000e+00 3157 3157 1.0000000000000e+00 3158 3158 1.0000000000000e+00 3159 3159 1.0000000000000e+00 3160 3160 1.0000000000000e+00 3161 3161 1.0000000000000e+00 3162 3162 1.0000000000000e+00 3163 3163 1.0000000000000e+00 3164 3164 1.0000000000000e+00 3165 3165 1.0000000000000e+00 3166 3166 1.0000000000000e+00 3167 3167 1.0000000000000e+00 3168 3168 1.0000000000000e+00 3169 3169 1.0000000000000e+00 3170 3170 1.0000000000000e+00 3171 3171 1.0000000000000e+00 3172 3172 1.0000000000000e+00 3173 3173 1.0000000000000e+00 3174 3174 1.0000000000000e+00 2071 3175 -1.8357689000000e-03 2073 3175 -1.9158914000000e-05 3127 3175 -3.0789269000000e-03 3129 3175 -5.5333043000000e-06 3175 3175 1.5200117000000e+02 3177 3175 3.8501504000000e-04 3178 3175 -4.4948165000000e-04 3180 3175 -4.6909939000000e-06 2071 3176 2.6104710000000e-01 2073 3176 -3.3275135000000e+00 3127 3176 1.0344195000000e+00 3129 3176 -9.6105850000000e-01 3175 3176 -8.8913889000000e+01 3176 3176 -2.8961215000000e+01 3177 3176 5.1054270000000e+00 3178 3176 3.1225563000000e-01 3180 3176 -8.1361201000000e-01 2071 3177 4.4127371000000e-01 2072 3177 -7.1486405000000e-02 2073 3177 -5.6248248000000e+00 3127 3177 1.7485815000000e+00 3128 3177 -2.8327046000000e-01 3129 3177 -1.6245722000000e+00 3175 3177 -1.5029994000000e+02 3176 3177 2.3061769000000e+01 3177 3177 8.6302077000000e+00 3178 3177 5.2783656000000e-01 3179 3177 -8.5509590000000e-02 3180 3177 -1.3753288000000e+00 2074 3178 -2.2750497000000e-03 2076 3178 -2.3743447000000e-05 3130 3178 -2.3480074000000e-03 3132 3178 -4.5274864000000e-06 3175 3178 -2.9814492000000e-02 3177 3178 -4.6909939000000e-06 3178 3178 1.2279692000000e+02 3180 3178 3.2847402000000e-04 3181 3178 -3.9887265000000e-04 3183 3178 -4.1628155000000e-06 3226 3178 -3.9392972000000e-04 3228 3178 -4.1112288000000e-06 2074 3179 2.4712686000000e-01 2076 3179 -4.1177292000000e+00 3130 3179 1.5845342000000e+00 3132 3179 -7.8531531000000e-01 3177 3179 -8.1361201000000e-01 3178 3179 -7.3378153000000e+01 3179 3179 -2.3395689000000e+01 3180 3179 7.1552419000000e+00 3181 3179 1.0353616000000e+00 3183 3179 -7.1773490000000e-01 3228 3179 -7.1822949000000e-01 2074 3180 4.1774324000000e-01 2075 3180 -6.7674367000000e-02 2076 3180 -6.9606094000000e+00 3130 3180 2.6784966000000e+00 3131 3180 -4.3391621000000e-01 3132 3180 -1.3274970000000e+00 3177 3180 -1.3753288000000e+00 3178 3180 -1.2403843000000e+02 3179 3180 1.9045226000000e+01 3180 3180 1.2095220000000e+01 3181 3180 1.7501753000000e+00 3182 3180 -2.8352823000000e-01 3183 3180 -1.2132591000000e+00 3228 3180 -1.2140951000000e+00 2077 3181 -2.4024521000000e-03 2079 3181 -2.5073077000000e-05 3133 3181 -4.6378412000000e-03 3135 3181 -4.0656945000000e-06 3178 3181 -1.5979302000000e-02 3180 3181 -4.1628155000000e-06 3181 3181 1.1693584000000e+02 3183 3181 3.1502718000000e-04 3184 3181 -3.9303164000000e-04 3186 3181 -4.1018560000000e-06 3229 3181 -6.3020376000000e-04 3231 3181 -4.0657214000000e-06 2077 3182 2.2554864000000e-01 2079 3182 -4.3233388000000e+00 3133 3182 2.1047377000000e+00 3135 3182 -7.0105282000000e-01 3180 3182 -7.1773490000000e-01 3181 3182 -7.1087844000000e+01 3182 3182 -2.2285431000000e+01 3183 3182 7.1463879000000e+00 3184 3182 1.6093254000000e+00 3186 3182 -7.0076116000000e-01 3231 3182 -7.0100227000000e-01 2077 3183 3.8126714000000e-01 2078 3183 -6.1765073000000e-02 2079 3183 -7.3081667000000e+00 3133 3183 3.5578461000000e+00 3134 3183 -5.7636917000000e-01 3135 3183 -1.1850588000000e+00 3180 3183 -1.2132591000000e+00 3181 3183 -1.2016681000000e+02 3182 3183 1.8458632000000e+01 3183 3183 1.2080246000000e+01 3184 3183 2.7204018000000e+00 3185 3183 -4.4070362000000e-01 3186 3183 -1.1845658000000e+00 3231 3183 -1.1849736000000e+00 2080 3184 -2.4271249000000e-03 2082 3184 -2.5330574000000e-05 3136 3184 -4.7311540000000e-03 3138 3184 -4.1012605000000e-06 3181 3184 -4.6023346000000e-03 3183 3184 -4.1018560000000e-06 3184 3184 1.1692209000000e+02 3186 3184 3.1582529000000e-04 3187 3184 -4.2520237000000e-04 3189 3184 -4.4376044000000e-06 3232 3184 -1.8415784000000e-03 3234 3184 -4.2967900000000e-06 2080 3185 2.2919201000000e-01 2082 3185 -4.3272245000000e+00 3136 3185 2.7875323000000e+00 3138 3185 -7.0072984000000e-01 3183 3185 -7.0076116000000e-01 3184 3185 -7.2281303000000e+01 3185 3185 -2.2288936000000e+01 3186 3185 7.2148813000000e+00 3187 3185 2.1212159000000e+00 3189 3185 -7.4960785000000e-01 3234 3185 -7.3405848000000e-01 2080 3186 3.8742616000000e-01 2081 3186 -6.2762455000000e-02 2082 3186 -7.3147403000000e+00 3136 3186 4.7120446000000e+00 3137 3186 -7.6334412000000e-01 3138 3186 -1.1845137000000e+00 3183 3186 -1.1845658000000e+00 3184 3186 -1.2218432000000e+02 3185 3186 1.8776741000000e+01 3186 3186 1.2196034000000e+01 3187 3186 3.5857033000000e+00 3188 3186 -5.8087853000000e-01 3189 3186 -1.2671371000000e+00 3234 3186 -1.2408525000000e+00 2083 3187 -2.1340685000000e-03 2085 3187 -2.2272105000000e-05 3139 3187 -9.4670244000000e-03 3141 3187 -4.6651766000000e-06 3184 3187 -3.4153136000000e-03 3186 3187 -4.4376044000000e-06 3187 3187 1.3445432000000e+02 3189 3187 3.4596464000000e-04 2083 3188 2.2916280000000e-01 2085 3188 -3.7627684000000e+00 3139 3188 3.3285979000000e+00 3141 3188 -7.8813147000000e-01 3186 3188 -7.4960785000000e-01 3187 3188 -8.0766249000000e+01 3188 3188 -2.5636890000000e+01 3189 3188 5.3033841000000e+00 2083 3189 3.8737656000000e-01 2084 3189 -6.2754044000000e-02 2085 3189 -6.3605797000000e+00 3139 3189 5.6266585000000e+00 3140 3189 -9.1150468000000e-01 3141 3189 -1.3322566000000e+00 3186 3189 -1.2671371000000e+00 3187 3189 -1.3652718000000e+02 3188 3189 2.0936337000000e+01 3189 3189 8.9648357000000e+00 3190 3190 1.0000000000000e+00 3191 3191 1.0000000000000e+00 3192 3192 1.0000000000000e+00 3193 3193 1.0000000000000e+00 3194 3194 1.0000000000000e+00 3195 3195 1.0000000000000e+00 3196 3196 1.0000000000000e+00 3197 3197 1.0000000000000e+00 3198 3198 1.0000000000000e+00 3199 3199 1.0000000000000e+00 3200 3200 1.0000000000000e+00 3201 3201 1.0000000000000e+00 3202 3202 1.0000000000000e+00 3203 3203 1.0000000000000e+00 3204 3204 1.0000000000000e+00 3205 3205 1.0000000000000e+00 3206 3206 1.0000000000000e+00 3207 3207 1.0000000000000e+00 3208 3208 1.0000000000000e+00 3209 3209 1.0000000000000e+00 3210 3210 1.0000000000000e+00 3211 3211 1.0000000000000e+00 3212 3212 1.0000000000000e+00 3213 3213 1.0000000000000e+00 3214 3214 1.0000000000000e+00 3215 3215 1.0000000000000e+00 3216 3216 1.0000000000000e+00 3217 3217 1.0000000000000e+00 3218 3218 1.0000000000000e+00 3219 3219 1.0000000000000e+00 3220 3220 1.0000000000000e+00 3221 3221 1.0000000000000e+00 3222 3222 1.0000000000000e+00 3223 3223 1.0000000000000e+00 3224 3224 1.0000000000000e+00 3225 3225 1.0000000000000e+00 2122 3226 -2.3706604000000e-03 2124 3226 -2.4741284000000e-05 3178 3226 -7.0890245000000e-04 3180 3226 -4.1112288000000e-06 3226 3226 1.1692746000000e+02 3228 3226 3.1045107000000e-04 3229 3226 -3.8566782000000e-04 3231 3226 -4.0250039000000e-06 3274 3226 -5.7017845000000e-03 3276 3226 -4.0132230000000e-06 2122 3227 2.2026949000000e-01 2124 3227 -4.3217700000000e+00 3178 3227 1.2629601000000e+00 3180 3227 -7.1822949000000e-01 3226 3227 -6.9220622000000e+01 3227 3227 -2.2279374000000e+01 3228 3227 6.4444803000000e+00 3229 3227 5.8085413000000e-01 3231 3227 -7.0091648000000e-01 3276 3227 -7.0106907000000e-01 2122 3228 3.7234355000000e-01 2123 3228 -6.0319866000000e-02 2124 3228 -7.3055200000000e+00 3178 3228 2.1349078000000e+00 3179 3228 -3.4585627000000e-01 3180 3228 -1.2140951000000e+00 3226 3228 -1.1701054000000e+02 3227 3228 1.7962197000000e+01 3228 3228 1.0893749000000e+01 3229 3228 9.8187582000000e-01 3230 3228 -1.5906444000000e-01 3231 3228 -1.1848292000000e+00 3276 3228 -1.1850872000000e+00 2125 3229 -2.3783246000000e-03 2127 3229 -2.4821271000000e-05 3181 3229 -3.8956930000000e-04 3183 3229 -4.0657214000000e-06 3226 3229 -1.5054090000000e-02 3228 3229 -4.0250039000000e-06 3229 3229 1.1693855000000e+02 3231 3229 3.1474105000000e-04 3232 3229 -4.0678672000000e-04 3234 3229 -4.2454102000000e-06 3277 3229 -5.2020450000000e-03 3279 3229 -4.0252116000000e-06 2125 3230 2.1891350000000e-01 2127 3230 -4.3212217000000e+00 3181 3230 1.6629280000000e+00 3183 3230 -7.0100227000000e-01 3228 3230 -7.0091648000000e-01 3229 3230 -7.0175975000000e+01 3230 3230 -2.2282337000000e+01 3231 3230 7.1610951000000e+00 3232 3230 1.1416356000000e+00 3234 3230 -7.3450310000000e-01 3279 3230 -7.0095502000000e-01 2125 3231 3.7005118000000e-01 2126 3231 -5.9948420000000e-02 2127 3231 -7.3045892000000e+00 3181 3231 2.8110119000000e+00 3182 3231 -4.5538492000000e-01 3183 3231 -1.1849736000000e+00 3228 3231 -1.1848292000000e+00 3229 3231 -1.1862540000000e+02 3230 3231 1.8216588000000e+01 3231 3231 1.2105109000000e+01 3232 3231 1.9298198000000e+00 3233 3231 -3.1263150000000e-01 3234 3231 -1.2416034000000e+00 3279 3231 -1.1848937000000e+00 2128 3232 -2.1769643000000e-03 2130 3232 -2.2719784000000e-05 3184 3232 -4.1170983000000e-04 3186 3232 -4.2967900000000e-06 3229 3232 -3.6404805000000e-03 3231 3232 -4.2454102000000e-06 3232 3232 1.2861005000000e+02 3234 3232 3.3217568000000e-04 2128 3233 2.1844699000000e-01 2130 3233 -3.9304561000000e+00 3184 3233 2.2861829000000e+00 3186 3233 -7.3405848000000e-01 3231 3233 -7.3450310000000e-01 3232 3233 -7.6368722000000e+01 3233 3233 -2.4513213000000e+01 3234 3233 5.4017650000000e+00 2128 3234 3.6926279000000e-01 2129 3234 -5.9820451000000e-02 2130 3234 -6.6440430000000e+00 3184 3234 3.8645636000000e+00 3185 3234 -6.2605803000000e-01 3186 3234 -1.2408525000000e+00 3231 3234 -1.2416034000000e+00 3232 3234 -1.2909369000000e+02 3233 3234 1.9805802000000e+01 3234 3234 9.1311429000000e+00 3235 3235 1.0000000000000e+00 3236 3236 1.0000000000000e+00 3237 3237 1.0000000000000e+00 3238 3238 1.0000000000000e+00 3239 3239 1.0000000000000e+00 3240 3240 1.0000000000000e+00 3241 3241 1.0000000000000e+00 3242 3242 1.0000000000000e+00 3243 3243 1.0000000000000e+00 3244 3244 1.0000000000000e+00 3245 3245 1.0000000000000e+00 3246 3246 1.0000000000000e+00 3247 3247 1.0000000000000e+00 3248 3248 1.0000000000000e+00 3249 3249 1.0000000000000e+00 3250 3250 1.0000000000000e+00 3251 3251 1.0000000000000e+00 3252 3252 1.0000000000000e+00 3253 3253 1.0000000000000e+00 3254 3254 1.0000000000000e+00 3255 3255 1.0000000000000e+00 3256 3256 1.0000000000000e+00 3257 3257 1.0000000000000e+00 3258 3258 1.0000000000000e+00 3259 3259 1.0000000000000e+00 3260 3260 1.0000000000000e+00 3261 3261 1.0000000000000e+00 3262 3262 1.0000000000000e+00 3263 3263 1.0000000000000e+00 3264 3264 1.0000000000000e+00 3265 3265 1.0000000000000e+00 3266 3266 1.0000000000000e+00 3267 3267 1.0000000000000e+00 3268 3268 1.0000000000000e+00 3269 3269 1.0000000000000e+00 3270 3270 1.0000000000000e+00 3271 3271 1.0000000000000e+00 3272 3272 1.0000000000000e+00 3273 3273 1.0000000000000e+00 2170 3274 -2.3584866000000e-03 2172 3274 -2.4614233000000e-05 3226 3274 -3.8453900000000e-04 3228 3274 -4.0132230000000e-06 3274 3274 1.1692377000000e+02 3276 3274 3.0618521000000e-04 3277 3274 -3.8294690000000e-04 3279 3274 -3.9966072000000e-06 2170 3275 2.1207041000000e-01 2172 3275 -4.3203650000000e+00 3226 3275 8.2629021000000e-01 3228 3275 -7.0106907000000e-01 3274 3275 -6.8392282000000e+01 3275 3275 -2.2277164000000e+01 3276 3275 5.7248404000000e+00 3277 3275 1.9435409000000e-01 3279 3275 -7.0091203000000e-01 2170 3276 3.5848382000000e-01 2171 3276 -5.8074741000000e-02 2172 3276 -7.3031450000000e+00 3226 3276 1.3967610000000e+00 3227 3276 -2.2627669000000e-01 3228 3276 -1.1850872000000e+00 3274 3276 -1.1561031000000e+02 3275 3276 1.7740800000000e+01 3276 3276 9.6772702000000e+00 3277 3276 3.2853615000000e-01 3278 3276 -5.3223188000000e-02 3279 3276 -1.1848217000000e+00 2173 3277 -2.3613793000000e-03 2175 3277 -2.4644423000000e-05 3229 3277 -3.8568773000000e-04 3231 3277 -4.0252116000000e-06 3274 3277 -1.5551920000000e-02 3276 3277 -3.9966072000000e-06 3277 3277 1.1693647000000e+02 3279 3277 3.0622550000000e-04 2173 3278 2.1205822000000e-01 2175 3278 -4.3215731000000e+00 3229 3278 1.2126517000000e+00 3231 3278 -7.0095502000000e-01 3276 3278 -7.0091203000000e-01 3277 3278 -6.8581138000000e+01 3278 3278 -2.2279477000000e+01 3279 3278 5.7259355000000e+00 2173 3279 3.5846302000000e-01 2174 3279 -5.8071371000000e-02 2175 3279 -7.3051832000000e+00 3229 3279 2.0498654000000e+00 3230 3279 -3.3208026000000e-01 3231 3279 -1.1848937000000e+00 3276 3279 -1.1848217000000e+00 3277 3279 -1.1592949000000e+02 3278 3279 1.7786906000000e+01 3279 3279 9.6791167000000e+00 3280 3280 1.0000000000000e+00 3281 3281 1.0000000000000e+00 3282 3282 1.0000000000000e+00 3283 3283 1.0000000000000e+00 3284 3284 1.0000000000000e+00 3285 3285 1.0000000000000e+00 3286 3286 1.0000000000000e+00 3287 3287 1.0000000000000e+00 3288 3288 1.0000000000000e+00 3289 3289 1.0000000000000e+00 3290 3290 1.0000000000000e+00 3291 3291 1.0000000000000e+00 3292 3292 1.0000000000000e+00 3293 3293 1.0000000000000e+00 3294 3294 1.0000000000000e+00 3295 3295 1.0000000000000e+00 3296 3296 1.0000000000000e+00 3297 3297 1.0000000000000e+00 3298 3298 1.0000000000000e+00 3299 3299 1.0000000000000e+00 3300 3300 1.0000000000000e+00 3301 3301 1.0000000000000e+00 3302 3302 1.0000000000000e+00 3303 3303 1.0000000000000e+00 3304 3304 1.0000000000000e+00 3305 3305 1.0000000000000e+00 3306 3306 1.0000000000000e+00 3307 3307 1.0000000000000e+00 3308 3308 1.0000000000000e+00 3309 3309 1.0000000000000e+00 3310 3310 1.0000000000000e+00 3311 3311 1.0000000000000e+00 3312 3312 1.0000000000000e+00 lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/sherman5_rhs1.mtx100666 0 0 164622 10354206632 20216 0ustar usergroup%%MatrixMarket matrix array real general % RBTitle: 1U FULLY IMPLICIT BLACK OIL SIMULATOR 16 BY 23 BY 3 GRID, THREE UNK % RBKey: SHERMAN5 % Right-hand-side: 1 3312 1 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.73007589E+00 -0.47791410E+01 -0.80786603E+01 -0.10735529E+01 -0.45423119E+01 -0.76783303E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.12875379E+01 -0.42729598E+01 -0.72230115E+01 -0.86232178E+00 -0.44841105E+01 -0.75799067E+01 -0.73193270E+00 -0.44916564E+01 -0.75926988E+01 -0.51603338E+00 -0.45085547E+01 -0.76212363E+01 -0.61948008E+00 -0.43775531E+01 -0.73998181E+01 -0.68304074E+00 -0.42793760E+01 -0.72338543E+01 -0.71426769E+00 -0.41984834E+01 -0.70971163E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.35601016E+00 -0.15060889E+01 -0.25458927E+01 0.64500903E+00 -0.16689431E+01 -0.28211711E+01 -0.21215130E+00 -0.52607998E+01 -0.88928567E+01 -0.22257718E+00 -0.52416289E+01 -0.88604592E+01 0.83707514E+00 -0.17437449E+01 -0.29476284E+01 0.38187663E+00 -0.13952795E+01 -0.23586135E+01 0.19964828E+00 -0.11927143E+01 -0.20161661E+01 0.92284651E-01 -0.10434371E+01 -0.17638169E+01 0.67937173E-01 -0.95358111E+00 -0.16119355E+01 0.45402680E-01 -0.85441984E+00 -0.14443376E+01 0.28001318E-01 -0.79615742E+00 -0.13458247E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.19607089E-01 -0.13666893E+01 -0.23102515E+01 0.41824926E-01 -0.13828718E+01 -0.23376242E+01 0.54009602E-01 -0.13798434E+01 -0.23324877E+01 0.54886968E-01 -0.13858378E+01 -0.23426572E+01 0.41994337E-01 -0.13663276E+01 -0.23096417E+01 0.34842476E-01 -0.13133247E+01 -0.22200348E+01 0.21929996E-01 -0.12106125E+01 -0.20464221E+01 0.14816440E-01 -0.11068098E+01 -0.18709649E+01 0.71735406E-02 -0.10058716E+01 -0.17003275E+01 0.46638650E-02 -0.92740099E+00 -0.15676581E+01 0.26555312E-02 -0.85507323E+00 -0.14454159E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.36676090E-02 -0.13998433E+01 -0.23662951E+01 0.47453482E-02 -0.13948700E+01 -0.23579180E+01 0.72339044E-02 -0.14109662E+01 -0.23850976E+01 0.77620945E-02 -0.13957068E+01 -0.23593177E+01 0.74975053E-02 -0.14068059E+01 -0.23780657E+01 0.65886737E-02 -0.13862602E+01 -0.23433394E+01 0.38731180E-02 -0.13098881E+01 -0.22142374E+01 0.19912716E-02 -0.12089198E+01 -0.20435172E+01 0.34457596E-03 -0.11017995E+01 -0.18624857E+01 -0.17084600E-04 -0.10031355E+01 -0.16956826E+01 -0.41829973E-04 -0.89521077E+00 -0.15132649E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.18117608E-04 -0.14382016E+01 -0.24311360E+01 -0.19541025E-04 -0.14512249E+01 -0.24531659E+01 -0.41104053E-05 -0.14412508E+01 -0.24362913E+01 0.35810686E-03 -0.14474765E+01 -0.24468168E+01 0.86262602E-03 -0.14377778E+01 -0.24304205E+01 0.61385471E-05 -0.14467032E+01 -0.24455055E+01 -0.55054371E-05 -0.14303970E+01 -0.24179451E+01 -0.18857532E-04 -0.13150356E+01 -0.22229503E+01 -0.19545600E-04 -0.11872204E+01 -0.20068795E+01 -0.26680571E-04 -0.10736020E+01 -0.18148355E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.16404615E-04 -0.14868600E+01 -0.25133882E+01 -0.92369949E-05 -0.14778511E+01 -0.24981171E+01 -0.23710578E-04 -0.14851980E+01 -0.25105803E+01 -0.10057016E-04 -0.14792956E+01 -0.25006310E+01 -0.66869617E-05 -0.14893809E+01 -0.25176509E+01 -0.49755106E-05 -0.14752451E+01 -0.24937695E+01 -0.95114750E-05 -0.14824034E+01 -0.25058580E+01 -0.64772759E-05 -0.13795586E+01 -0.23320204E+01 -0.24176065E-04 -0.12904761E+01 -0.21814234E+01 -0.17189726E-04 -0.11638123E+01 -0.19673279E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.28471641E-04 -0.13773314E+01 -0.23282318E+01 0.95816722E-06 -0.14072786E+01 -0.23788637E+01 -0.12076326E-04 -0.14714681E+01 -0.24874129E+01 -0.10807086E-04 -0.15207585E+01 -0.25706943E+01 -0.11161304E-04 -0.15263816E+01 -0.25801916E+01 -0.20055691E-04 -0.15181462E+01 -0.25662770E+01 -0.26852077E-04 -0.15227043E+01 -0.25739554E+01 -0.19050641E-04 -0.15127609E+01 -0.25571761E+01 -0.19715413E-04 -0.14913835E+01 -0.25210167E+01 0.33878064E-05 -0.13892753E+01 -0.23484356E+01 -0.34576010E-04 -0.12239378E+01 -0.20689494E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.56398446E-04 -0.11405498E+01 -0.19279831E+01 -0.15864107E-04 -0.12545651E+01 -0.21207178E+01 -0.34396076E-04 -0.13648443E+01 -0.23071364E+01 -0.21986729E-04 -0.14743089E+01 -0.24921774E+01 0.52056130E-05 -0.15736459E+01 -0.26600491E+01 -0.13752350E-05 -0.15813178E+01 -0.26730676E+01 -0.46498680E-05 -0.15685133E+01 -0.26514487E+01 -0.19054566E-04 -0.15681498E+01 -0.26508067E+01 -0.12723450E-04 -0.15526272E+01 -0.26245537E+01 -0.41287490E-04 -0.14520409E+01 -0.24545388E+01 -0.67649937E-04 -0.12879069E+01 -0.21771004E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.33357966E-04 -0.98516893E+00 -0.16653495E+01 -0.49860107E-04 -0.11012408E+01 -0.18615406E+01 -0.29121356E-04 -0.12150149E+01 -0.20538326E+01 -0.64973913E-04 -0.13596684E+01 -0.22983959E+01 -0.47182663E-04 -0.15436715E+01 -0.26094265E+01 -0.67505641E-04 -0.15979560E+01 -0.27012088E+01 -0.28856358E-04 -0.16156942E+01 -0.27311742E+01 0.66711107E-05 -0.16110310E+01 -0.27232994E+01 -0.88580379E-05 -0.16122189E+01 -0.27252734E+01 -0.18625635E-04 -0.15272640E+01 -0.25816878E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.41683819E-04 -0.86574634E+00 -0.14634723E+01 -0.38333279E-04 -0.97176765E+00 -0.16426802E+01 -0.57507505E-04 -0.10931890E+01 -0.18479170E+01 0.68280592E-05 -0.12635463E+01 -0.21359138E+01 -0.10174167E-03 -0.14315321E+01 -0.24198258E+01 -0.66316080E-04 -0.16799063E+01 -0.28397741E+01 -0.74049959E-04 -0.16408147E+01 -0.27736115E+01 -0.53376426E-04 -0.16438845E+01 -0.27788402E+01 -0.48810071E-04 -0.16228442E+01 -0.27432591E+01 -0.73584354E-04 -0.15841441E+01 -0.26778375E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.48118420E-05 -0.66277511E+00 -0.11203550E+01 -0.18260330E-04 -0.79174586E+00 -0.13383640E+01 -0.22777606E-04 -0.88713826E+00 -0.14996240E+01 -0.42816896E-04 -0.99285880E+00 -0.16783249E+01 -0.57540209E-04 -0.11913010E+01 -0.20137940E+01 -0.12622011E-03 -0.13789037E+01 -0.23308702E+01 -0.10976066E-02 -0.65360711E+00 -0.11050275E+01 -0.13944407E-03 -0.16889513E+01 -0.28550835E+01 -0.39006204E-04 -0.16721192E+01 -0.28265820E+01 -0.49153549E-04 -0.16707199E+01 -0.28242130E+01 -0.80289801E-04 -0.16295539E+01 -0.27545982E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.94335240E-05 -0.66738691E+00 -0.11281508E+01 -0.24013672E-04 -0.65966426E+00 -0.11151072E+01 -0.33650011E-04 -0.79829526E+00 -0.13494442E+01 -0.25928102E-04 -0.93667321E+00 -0.15833201E+01 -0.32623966E-04 -0.10845518E+01 -0.18333416E+01 -0.55343833E-04 -0.12528916E+01 -0.21178357E+01 -0.79205561E-04 -0.15505039E+01 -0.26210261E+01 -0.38003714E-04 -0.17022137E+01 -0.28773975E+01 -0.48634295E-04 -0.17002884E+01 -0.28741819E+01 -0.10361308E-04 -0.16898889E+01 -0.28566784E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.59119322E-05 -0.70017737E+00 -0.11835785E+01 -0.14543802E-04 -0.66353971E+00 -0.11216505E+01 -0.27038167E-04 -0.66683954E+00 -0.11272254E+01 -0.24881679E-04 -0.66659284E+00 -0.11268136E+01 -0.22336300E-04 -0.84891238E+00 -0.14349973E+01 -0.29986663E-04 -0.10174238E+01 -0.17198650E+01 -0.30273510E-04 -0.12378458E+01 -0.20924453E+01 -0.33218393E-04 -0.15112191E+01 -0.25545802E+01 -0.12291160E-04 -0.17294887E+01 -0.29234863E+01 -0.55390439E-04 -0.16986944E+01 -0.28714782E+01 -0.67921277E-04 -0.16955332E+01 -0.28660843E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.22892619E-05 -0.79970068E+00 -0.13518220E+01 -0.34042565E-04 -0.69427548E+00 -0.11736054E+01 -0.29322870E-04 -0.66133833E+00 -0.11179188E+01 -0.18520892E-04 -0.67574534E+00 -0.11422847E+01 -0.44095333E-04 -0.73570177E+00 -0.12436208E+01 -0.13631124E-04 -0.96566424E+00 -0.16323655E+01 -0.18403631E-04 -0.11684261E+01 -0.19751242E+01 -0.30182810E-04 -0.14573423E+01 -0.24635024E+01 -0.21977258E-04 -0.17288422E+01 -0.29224149E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.96096956E-05 -0.98866951E+00 -0.16712469E+01 -0.25788017E-04 -0.89318277E+00 -0.15098393E+01 -0.17901886E-04 -0.79396960E+00 -0.13421295E+01 -0.15515695E-04 -0.66932056E+00 -0.11314188E+01 -0.20788614E-04 -0.66957888E+00 -0.11318615E+01 -0.29950432E-04 -0.71221837E+00 -0.12039388E+01 -0.79763861E-04 -0.86679264E+00 -0.14652332E+01 0.62146229E-05 -0.11891561E+01 -0.20101667E+01 -0.60913855E-04 -0.14057552E+01 -0.23763045E+01 -0.59914479E-04 -0.16912205E+01 -0.28588373E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.73316461E-05 -0.99293752E+00 -0.16784616E+01 -0.65075077E-05 -0.99357334E+00 -0.16795566E+01 -0.24474551E-04 -0.82784379E+00 -0.13993893E+01 -0.18857208E-04 -0.69572056E+00 -0.11760444E+01 -0.19047106E-04 -0.67271434E+00 -0.11371597E+01 -0.19226591E-04 -0.70880567E+00 -0.11981386E+01 -0.33449801E-04 -0.88789729E+00 -0.15009068E+01 -0.11609816E-03 -0.11333208E+01 -0.19157639E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.37105963E-05 -0.98969264E+00 -0.16729764E+01 -0.14729875E-04 -0.99001307E+00 -0.16735492E+01 -0.19591296E-04 -0.82089647E+00 -0.13876453E+01 -0.93112312E-05 -0.70053389E+00 -0.11841959E+01 -0.10793624E-04 -0.66765328E+00 -0.11286039E+01 -0.40392857E-04 -0.70163762E+00 -0.11860383E+01 0.11634927E-04 -0.89600441E+00 -0.15146117E+01 -0.99461805E-05 -0.11367258E+01 -0.19215158E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.15589030E-05 -0.99061413E+00 -0.16745341E+01 -0.25002085E-06 -0.95293809E+00 -0.16108464E+01 -0.18340935E-04 -0.79103403E+00 -0.13371649E+01 -0.12199068E-04 -0.65779221E+00 -0.11119297E+01 -0.17449818E-04 -0.66517975E+00 -0.11244218E+01 -0.15437209E-04 -0.73064797E+00 -0.12350862E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.15361566E-05 -0.85824196E+00 -0.14507853E+01 -0.12983907E-04 -0.68618697E+00 -0.11599307E+01 -0.12926853E-04 -0.65903822E+00 -0.11140329E+01 -0.10409705E-04 -0.65942056E+00 -0.11146858E+01 -0.12116367E-04 -0.76283043E+00 -0.12895077E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.53194151E-05 -0.65811632E+00 -0.11124798E+01 -0.16225085E-04 -0.65181712E+00 -0.11018309E+01 -0.12175012E-04 -0.72381679E+00 -0.12235406E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.93218916E-06 -0.65479993E+00 -0.11068738E+01 -0.11427151E-04 -0.65261348E+00 -0.11031850E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.11374207E+01 -0.35988748E+01 -0.60835282E+01 -0.81269119E+00 -0.37569236E+01 -0.63507039E+01 -0.86204067E+00 -0.37062973E+01 -0.62651237E+01 -0.86132270E+00 -0.36842788E+01 -0.62279049E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.41876580E+00 -0.43708098E+01 -0.73884170E+01 -0.57469749E+00 -0.42656638E+01 -0.72106682E+01 -0.63737822E+00 -0.42206050E+01 -0.71345108E+01 -0.64582562E+00 -0.42103360E+01 -0.71171524E+01 -0.58794794E+00 -0.42355747E+01 -0.71598159E+01 -0.46057242E+00 -0.42666316E+01 -0.72122914E+01 -0.49824978E+00 -0.42016028E+01 -0.71023894E+01 0.21671793E+00 -0.58070052E+00 -0.98161902E+00 0.11361062E+00 -0.48930719E+00 -0.82712555E+00 0.60520075E-01 -0.42085475E+00 -0.71141235E+00 0.30968605E-01 -0.38103848E+00 -0.64410745E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.47423322E-01 -0.65342197E+00 -0.11045445E+01 0.12746087E+00 -0.70065447E+00 -0.11843766E+01 0.16209582E+00 -0.71631155E+00 -0.12108532E+01 0.16496496E+00 -0.71845553E+00 -0.12144852E+01 0.12210256E+00 -0.68999000E+00 -0.11663594E+01 0.79605960E-01 -0.64335472E+00 -0.10875327E+01 0.44568974E-01 -0.58333030E+00 -0.98606204E+00 0.14726045E-01 -0.51951564E+00 -0.87819327E+00 0.60058456E-02 -0.47233539E+00 -0.79843672E+00 0.39690732E-02 -0.43482169E+00 -0.73502610E+00 0.30008818E-02 -0.40397232E+00 -0.68287481E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.64757041E-02 -0.65788842E+00 -0.11120946E+01 0.68846046E-02 -0.65510621E+00 -0.11073899E+01 0.78823979E-02 -0.65845485E+00 -0.11130522E+01 0.89068724E-02 -0.65354439E+00 -0.11047603E+01 0.88172434E-02 -0.65672103E+00 -0.11101216E+01 0.68877520E-02 -0.65015083E+00 -0.10989916E+01 0.37512450E-02 -0.61314243E+00 -0.10364566E+01 0.23534657E-02 -0.56977568E+00 -0.96315275E+00 0.12966358E-02 -0.51846792E+00 -0.87641939E+00 0.59107988E-03 -0.47296938E+00 -0.79951156E+00 0.24698769E-04 -0.42305505E+00 -0.71513230E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.69521364E-03 -0.67645089E+00 -0.11434726E+01 0.11916901E-02 -0.68104524E+00 -0.11512495E+01 0.20687820E-02 -0.67814869E+00 -0.11463429E+01 0.22345994E-02 -0.67940676E+00 -0.11484613E+01 0.23542486E-02 -0.67541762E+00 -0.11417263E+01 0.17995186E-02 -0.67841717E+00 -0.11467999E+01 0.11005083E-02 -0.67336022E+00 -0.11382489E+01 0.18317815E-03 -0.61788539E+00 -0.10444794E+01 -0.23565402E-05 -0.55906796E+00 -0.94504933E+00 -0.22613593E-05 -0.50507304E+00 -0.85377435E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.39444853E-06 -0.69842407E+00 -0.11806161E+01 -0.11278175E-05 -0.69505700E+00 -0.11749439E+01 0.17555177E-04 -0.69741390E+00 -0.11789090E+01 0.17626733E-03 -0.69548116E+00 -0.11756298E+01 0.37656054E-03 -0.69884659E+00 -0.11813309E+01 0.18953378E-03 -0.69366649E+00 -0.11725707E+01 0.19224752E-05 -0.69573161E+00 -0.11760656E+01 0.72776430E-07 -0.64863065E+00 -0.10964368E+01 -0.37043390E-05 -0.60671845E+00 -0.10255977E+01 -0.36241908E-05 -0.54781537E+00 -0.92601912E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.19012713E-04 -0.64575511E+00 -0.10915739E+01 0.51958204E-05 -0.66149195E+00 -0.11181860E+01 0.41671327E-05 -0.69065903E+00 -0.11674826E+01 0.20589718E-05 -0.71540506E+00 -0.12093218E+01 -0.41078028E-05 -0.71694651E+00 -0.12119179E+01 -0.19347201E-05 -0.71415345E+00 -0.12072059E+01 -0.23046668E-05 -0.71538948E+00 -0.12093029E+01 -0.15559414E-05 -0.71176873E+00 -0.12031754E+01 -0.73063887E-07 -0.70022290E+00 -0.11836332E+01 0.62054871E-05 -0.65305800E+00 -0.11039304E+01 -0.72453857E-05 -0.57615041E+00 -0.97392807E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.16038825E-04 -0.53943966E+00 -0.91187777E+00 -0.10430093E-05 -0.58970937E+00 -0.99684495E+00 -0.49696521E-05 -0.64340420E+00 -0.10876054E+01 -0.22329447E-05 -0.69263650E+00 -0.11708354E+01 0.10760681E-04 -0.73892071E+00 -0.12490696E+01 0.50173076E-05 -0.74118669E+00 -0.12529037E+01 0.68646709E-05 -0.73670040E+00 -0.12453183E+01 -0.13448756E-05 -0.73624371E+00 -0.12445482E+01 0.40206064E-05 -0.73075910E+00 -0.12352771E+01 -0.90326372E-05 -0.68330929E+00 -0.11550697E+01 -0.19861518E-04 -0.60926912E+00 -0.10299216E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.46458303E-05 -0.46478996E+00 -0.78568709E+00 -0.11749638E-04 -0.52107741E+00 -0.88083010E+00 -0.27788905E-05 -0.57184261E+00 -0.96663572E+00 -0.16167461E-04 -0.64224198E+00 -0.10856490E+01 -0.41299555E-05 -0.72606644E+00 -0.12273160E+01 -0.13886318E-04 -0.75255815E+00 -0.12721290E+01 -0.92050466E-05 -0.75848577E+00 -0.12821369E+01 0.79349533E-05 -0.75643700E+00 -0.12786842E+01 -0.24503081E-05 -0.75643239E+00 -0.12786750E+01 -0.17133109E-05 -0.71868438E+00 -0.12148642E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.87522032E-05 -0.40997152E+00 -0.69301945E+00 -0.81547734E-05 -0.45879548E+00 -0.77554885E+00 -0.13747454E-04 -0.51738513E+00 -0.87459035E+00 0.77440868E-05 -0.59198985E+00 -0.10007045E+01 -0.21312925E-04 -0.67509196E+00 -0.11411619E+01 0.56932475E-05 -0.78494207E+00 -0.13268755E+01 -0.13946572E-04 -0.77182693E+00 -0.13046697E+01 -0.11045417E-04 -0.77288926E+00 -0.13064968E+01 -0.11674239E-04 -0.76545634E+00 -0.12939092E+01 -0.19866208E-04 -0.74732760E+00 -0.12632829E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.34535457E-05 -0.31336739E+00 -0.52971623E+00 0.24296697E-06 -0.37415911E+00 -0.63247865E+00 -0.22256012E-05 -0.41950437E+00 -0.70913135E+00 -0.10299729E-04 -0.46842439E+00 -0.79182793E+00 -0.11236372E-04 -0.56268915E+00 -0.95117478E+00 -0.17455445E-04 -0.64775557E+00 -0.10949579E+01 -0.50071338E-04 -0.72985406E+00 -0.12337681E+01 -0.10169126E-04 -0.79241794E+00 -0.13395053E+01 -0.54241855E-05 -0.78673965E+00 -0.13299096E+01 -0.27368962E-05 -0.78572068E+00 -0.13281721E+01 -0.21514621E-04 -0.77033882E+00 -0.13021807E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.22923616E-05 -0.31547640E+00 -0.53328130E+00 -0.40516783E-05 -0.31265450E+00 -0.52851059E+00 -0.57661815E-05 -0.37775848E+00 -0.63856463E+00 -0.25586938E-05 -0.44268374E+00 -0.74831429E+00 -0.49584183E-05 -0.51081530E+00 -0.86348621E+00 -0.66552786E-05 -0.59014282E+00 -0.99756439E+00 -0.39262067E-05 -0.72695048E+00 -0.12288458E+01 0.21200911E-05 -0.80108884E+00 -0.13541672E+01 -0.10099852E-04 -0.79986012E+00 -0.13520873E+01 0.49990834E-05 -0.79593480E+00 -0.13454764E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.21803910E-05 -0.33082342E+00 -0.55923432E+00 0.27233588E-06 -0.31431008E+00 -0.53131064E+00 -0.19962890E-05 -0.31593264E+00 -0.53405116E+00 -0.37438644E-05 -0.31593646E+00 -0.53406066E+00 -0.61062647E-06 -0.40074212E+00 -0.67742088E+00 -0.43291055E-05 -0.48068105E+00 -0.81254646E+00 -0.50593711E-05 -0.58274882E+00 -0.98507711E+00 -0.29719517E-05 -0.71178735E+00 -0.12032092E+01 -0.94859199E-06 -0.81300493E+00 -0.13743075E+01 -0.12937396E-04 -0.80142190E+00 -0.13547251E+01 -0.17955245E-04 -0.80004249E+00 -0.13523941E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.34550382E-05 -0.37763105E+00 -0.63835282E+00 -0.66919980E-05 -0.32900294E+00 -0.55614735E+00 -0.28111336E-05 -0.31413021E+00 -0.53100365E+00 -0.88323442E-06 -0.31961926E+00 -0.54028648E+00 -0.10614214E-04 -0.34939198E+00 -0.59060352E+00 0.10594819E-05 -0.45497981E+00 -0.76910013E+00 -0.46984886E-05 -0.55102613E+00 -0.93145259E+00 -0.48102490E-05 -0.68564782E+00 -0.11590213E+01 -0.95605717E-06 -0.81497777E+00 -0.13776385E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.19850434E-05 -0.46652454E+00 -0.78861308E+00 -0.34539835E-05 -0.42162136E+00 -0.71271825E+00 -0.68278058E-06 -0.37578995E+00 -0.63523639E+00 -0.98047378E-06 -0.31653168E+00 -0.53506158E+00 -0.16492219E-05 -0.31753365E+00 -0.53676042E+00 -0.51517036E-05 -0.33705691E+00 -0.56976425E+00 -0.22231837E-04 -0.41263982E+00 -0.69752866E+00 0.84971603E-05 -0.55866818E+00 -0.94437437E+00 -0.15677310E-04 -0.66436600E+00 -0.11230482E+01 -0.13341378E-04 -0.79867406E+00 -0.13500775E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.23323241E-05 -0.46751943E+00 -0.79029484E+00 0.10315786E-04 -0.46854070E+00 -0.79201667E+00 -0.33532295E-05 -0.39108471E+00 -0.66109043E+00 -0.16521591E-06 -0.32960973E+00 -0.55717415E+00 -0.12620752E-05 -0.31825347E+00 -0.53797677E+00 -0.22622202E-05 -0.33569787E+00 -0.56745673E+00 -0.64161669E-05 -0.41959159E+00 -0.70927964E+00 -0.31584037E-04 -0.54021088E+00 -0.91317481E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.60439200E-05 -0.46607089E+00 -0.78784623E+00 -0.20541069E-05 -0.46682901E+00 -0.78912858E+00 -0.17550235E-05 -0.38831959E+00 -0.65641592E+00 0.19694874E-05 -0.33082038E+00 -0.55921016E+00 0.14344787E-05 -0.31605076E+00 -0.53425337E+00 -0.84770233E-05 -0.33268918E+00 -0.56236811E+00 0.89194562E-05 -0.42185938E+00 -0.71311363E+00 0.26511716E-06 -0.53598003E+00 -0.90603132E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.54260049E-05 -0.46620085E+00 -0.78806591E+00 0.27218236E-05 -0.44965874E+00 -0.76011034E+00 -0.12675630E-05 -0.37355368E+00 -0.63145550E+00 0.86251805E-06 -0.31144821E+00 -0.52647519E+00 -0.94779313E-06 -0.31461331E+00 -0.53182295E+00 -0.12677737E-05 -0.34610251E+00 -0.58504794E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.77216518E-05 -0.40432863E+00 -0.68347667E+00 -0.65683610E-07 -0.32459688E+00 -0.54869865E+00 0.38143907E-06 -0.31162344E+00 -0.52676415E+00 0.10659711E-05 -0.31201245E+00 -0.52742629E+00 -0.31393068E-07 -0.36084677E+00 -0.60998104E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.30716571E-05 -0.31077867E+00 -0.52534027E+00 -0.43111039E-06 -0.30882335E+00 -0.52203278E+00 0.12214547E-05 -0.34230789E+00 -0.57863771E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.46257771E-05 -0.30947873E+00 -0.52314285E+00 0.11230187E-05 -0.30889848E+00 -0.52216158E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.15262064E+01 -0.33090381E+01 -0.55935980E+01 -0.10995579E+01 -0.35566602E+01 -0.60121910E+01 -0.95196898E+00 -0.36325096E+01 -0.61403943E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.71494664E+00 -0.41858508E+01 -0.70757623E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.10504815E+01 -0.38935606E+01 -0.65816757E+01 -0.65785838E+00 -0.41074444E+01 -0.69432242E+01 -0.57144652E+00 -0.41371735E+01 -0.69934691E+01 0.41099112E+00 -0.69170369E+00 -0.11692564E+01 0.16529191E+00 -0.51152301E+00 -0.86468364E+00 0.62338300E-01 -0.42756221E+00 -0.72275117E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.19487414E+00 -0.78161394E+00 -0.13212404E+01 -0.21719217E+00 -0.46521428E+01 -0.78639731E+01 -0.22592071E+00 -0.46393976E+01 -0.78424377E+01 -0.23935866E+00 -0.46285000E+01 -0.78240151E+01 -0.24464477E+00 -0.46217358E+01 -0.78125822E+01 0.37947245E+00 -0.85786354E+00 -0.14501260E+01 0.13127482E+00 -0.67509707E+00 -0.11411847E+01 0.48557227E-01 -0.57819252E+00 -0.97736893E+00 0.13526292E-01 -0.51461205E+00 -0.86990111E+00 0.61471090E-02 -0.47132774E+00 -0.79673015E+00 0.49468496E-02 -0.43830867E+00 -0.74091705E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.15593223E-01 -0.71408510E+00 -0.12070895E+01 0.26556009E-01 -0.71720185E+00 -0.12123663E+01 0.33724910E-01 -0.72368244E+00 -0.12233129E+01 0.40136961E-01 -0.72143388E+00 -0.12195293E+01 0.38753434E-01 -0.72356315E+00 -0.12231114E+01 0.18237140E-01 -0.70780665E+00 -0.11964704E+01 0.79213715E-02 -0.66372107E+00 -0.11219548E+01 0.49058533E-02 -0.61682435E+00 -0.10426771E+01 0.18340632E-02 -0.56160525E+00 -0.94933894E+00 0.15584380E-02 -0.51443330E+00 -0.86959745E+00 0.32433237E-03 -0.45990383E+00 -0.77742144E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.20026106E-02 -0.73284130E+00 -0.12387949E+01 0.21106504E-02 -0.73617889E+00 -0.12444157E+01 0.31036832E-02 -0.73192112E+00 -0.12372398E+01 0.39019721E-02 -0.73361373E+00 -0.12401391E+01 0.47250335E-02 -0.72988246E+00 -0.12337936E+01 0.17903180E-02 -0.73172469E+00 -0.12369094E+01 0.16765488E-02 -0.72839585E+00 -0.12312815E+01 0.14747603E-02 -0.67142582E+00 -0.11349873E+01 0.47992153E-03 -0.60735601E+00 -0.10266754E+01 -0.21995421E-05 -0.54837970E+00 -0.92698122E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.37540469E-03 -0.75821003E+00 -0.12816782E+01 0.75929842E-03 -0.75484646E+00 -0.12760103E+01 0.12721476E-02 -0.75757842E+00 -0.12806112E+01 0.17610847E-02 -0.75572739E+00 -0.12774873E+01 0.21797866E-02 -0.75948931E+00 -0.12838413E+01 0.18340514E-02 -0.75382956E+00 -0.12742610E+01 0.95625940E-03 -0.75576823E+00 -0.12775516E+01 0.95307621E-05 -0.70377734E+00 -0.11896828E+01 0.18464373E-05 -0.65871648E+00 -0.11134952E+01 0.44716180E-05 -0.59489957E+00 -0.10056409E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.17576459E-04 -0.70136215E+00 -0.11855891E+01 0.12008442E-04 -0.71811897E+00 -0.12139083E+01 0.12018808E-04 -0.74951824E+00 -0.12669860E+01 0.93681519E-05 -0.77657870E+00 -0.13127299E+01 0.16778629E-05 -0.77794654E+00 -0.13150384E+01 0.44673968E-05 -0.77491752E+00 -0.13099213E+01 0.15071943E-05 -0.77637248E+00 -0.13124036E+01 0.48165762E-05 -0.77243688E+00 -0.13057289E+01 0.10478180E-04 -0.75998537E+00 -0.12846952E+01 0.13107010E-04 -0.70906833E+00 -0.11986107E+01 -0.50722414E-05 -0.62548585E+00 -0.10573175E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.12419986E-04 -0.58595184E+00 -0.99048779E+00 0.48147855E-05 -0.64045010E+00 -0.10826171E+01 -0.25142174E-05 -0.69877984E+00 -0.11812119E+01 0.43019547E-05 -0.75183846E+00 -0.12709097E+01 0.16630537E-04 -0.80204649E+00 -0.13557728E+01 0.12346482E-04 -0.80415182E+00 -0.13593403E+01 0.67621486E-05 -0.79931157E+00 -0.13511575E+01 0.51967287E-05 -0.79893118E+00 -0.13505158E+01 0.89498202E-05 -0.79328363E+00 -0.13409688E+01 -0.33266488E-05 -0.74180317E+00 -0.12539472E+01 -0.15233154E-04 -0.66154749E+00 -0.11182700E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.19223968E-05 -0.50530184E+00 -0.85416090E+00 -0.61814809E-05 -0.56649563E+00 -0.95760501E+00 -0.22013850E-05 -0.62106131E+00 -0.10498414E+01 -0.10310776E-04 -0.69739357E+00 -0.11788763E+01 -0.23673627E-05 -0.78808910E+00 -0.13321802E+01 -0.63241010E-05 -0.81636590E+00 -0.13799877E+01 0.41924869E-05 -0.82277577E+00 -0.13908122E+01 0.15804959E-04 -0.82081299E+00 -0.13875044E+01 0.17387077E-04 -0.82106924E+00 -0.13879656E+01 0.45349850E-05 -0.78004278E+00 -0.13185844E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 -0.51280017E-05 -0.44622403E+00 -0.75429165E+00 -0.25244722E-05 -0.49903143E+00 -0.84356416E+00 -0.88417906E-05 -0.56253212E+00 -0.95090892E+00 0.15206261E-04 -0.64274428E+00 -0.10864996E+01 -0.19964766E-04 -0.73232426E+00 -0.12379073E+01 0.19901317E-04 -0.85106672E+00 -0.14386503E+01 -0.65841589E-05 -0.83701939E+00 -0.14148842E+01 -0.39377926E-05 -0.83856117E+00 -0.14175079E+01 -0.74456242E-05 -0.83089133E+00 -0.14045317E+01 -0.14641721E-04 -0.81118722E+00 -0.13712309E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.10031318E-04 -0.34175735E+00 -0.57770662E+00 0.52204219E-05 -0.40770908E+00 -0.68918729E+00 0.43838974E-05 -0.45671306E+00 -0.77202937E+00 -0.12448984E-05 -0.50938593E+00 -0.86107302E+00 -0.35282645E-05 -0.61147283E+00 -0.10336386E+01 -0.92237562E-05 -0.70257277E+00 -0.11876224E+01 -0.19790747E-04 -0.79155376E+00 -0.13380632E+01 -0.12311129E-04 -0.85899104E+00 -0.14520437E+01 0.24987754E-05 -0.85350853E+00 -0.14427760E+01 -0.48216252E-05 -0.85269814E+00 -0.14414079E+01 -0.15858060E-04 -0.83627770E+00 -0.14136442E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.90615401E-05 -0.34417517E+00 -0.58179372E+00 -0.22372602E-07 -0.34086435E+00 -0.57619304E+00 0.62647501E-06 -0.41160313E+00 -0.69577591E+00 0.47173876E-05 -0.48184793E+00 -0.81451995E+00 0.20263113E-05 -0.55529347E+00 -0.93867174E+00 -0.31757637E-05 -0.64052595E+00 -0.10827418E+01 0.76586851E-05 -0.78831985E+00 -0.13325834E+01 0.14396884E-05 -0.86912419E+00 -0.14691915E+01 -0.29478576E-05 -0.86794837E+00 -0.14671827E+01 0.31289099E-06 -0.86401590E+00 -0.14605308E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.87405669E-05 -0.36063124E+00 -0.60961186E+00 0.66210980E-05 -0.34285397E+00 -0.57956141E+00 0.16397731E-05 -0.34464530E+00 -0.58258152E+00 0.20268795E-05 -0.34443634E+00 -0.58223663E+00 0.45575515E-05 -0.43651951E+00 -0.73788988E+00 0.26015813E-05 -0.52291758E+00 -0.88394325E+00 0.53487280E-06 -0.63317006E+00 -0.10702990E+01 0.56459683E-05 -0.77282508E+00 -0.13063867E+01 0.62247018E-05 -0.88255714E+00 -0.14919108E+01 -0.61726221E-05 -0.86985659E+00 -0.14704068E+01 -0.17331946E-04 -0.86850716E+00 -0.14681238E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.14162502E-04 -0.41144323E+00 -0.69550083E+00 -0.11975233E-05 -0.35867596E+00 -0.60630658E+00 0.22588616E-05 -0.34272098E+00 -0.57933422E+00 0.56065710E-05 -0.34865306E+00 -0.58936467E+00 -0.48043723E-05 -0.38072807E+00 -0.64358021E+00 0.82632406E-05 -0.49521199E+00 -0.83710889E+00 0.37626127E-05 -0.59891220E+00 -0.10124041E+01 0.21057070E-05 -0.74460432E+00 -0.12586812E+01 0.12678650E-04 -0.88531777E+00 -0.14965587E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.85396360E-05 -0.50760401E+00 -0.85805382E+00 -0.18473856E-05 -0.45894137E+00 -0.77579345E+00 0.57245816E-05 -0.40948922E+00 -0.69220165E+00 0.42157353E-05 -0.34518905E+00 -0.58350421E+00 0.47307198E-05 -0.34642022E+00 -0.58559044E+00 -0.70538838E-06 -0.36749160E+00 -0.62120511E+00 -0.17704109E-04 -0.44920918E+00 -0.75934523E+00 0.14319676E-04 -0.60747806E+00 -0.10268680E+01 -0.10025376E-04 -0.72165070E+00 -0.12198814E+01 -0.29572064E-05 -0.86753038E+00 -0.14664712E+01 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.85821419E-05 -0.50854347E+00 -0.85964188E+00 0.16493335E-04 -0.51003093E+00 -0.86216342E+00 0.24876358E-05 -0.42590887E+00 -0.71995724E+00 0.59709092E-05 -0.35943482E+00 -0.60758471E+00 0.49496341E-05 -0.34715486E+00 -0.58683164E+00 0.42827298E-05 -0.36596509E+00 -0.61862629E+00 -0.57452087E-06 -0.45678338E+00 -0.77214869E+00 -0.26366656E-04 -0.58794746E+00 -0.99385686E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.12565208E-04 -0.50695871E+00 -0.85696300E+00 0.46891907E-05 -0.50808141E+00 -0.85886385E+00 0.41420104E-05 -0.42289361E+00 -0.71486018E+00 0.80703502E-05 -0.36065842E+00 -0.60965826E+00 0.77446881E-05 -0.34474650E+00 -0.58276050E+00 -0.25735036E-05 -0.36269755E+00 -0.61310652E+00 0.16030019E-04 -0.45925201E+00 -0.77632187E+00 0.99968945E-05 -0.58320085E+00 -0.98583832E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.11964946E-04 -0.50713051E+00 -0.85725341E+00 0.99516441E-05 -0.48943012E+00 -0.82733309E+00 0.46683721E-05 -0.40693178E+00 -0.68787787E+00 0.39080770E-05 -0.33966027E+00 -0.57416086E+00 0.50132371E-05 -0.34315556E+00 -0.58007083E+00 0.78247889E-05 -0.37733096E+00 -0.63783911E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.99089532E-05 -0.44026646E+00 -0.74422855E+00 0.54465978E-05 -0.35375295E+00 -0.59798408E+00 0.48361284E-05 -0.33992768E+00 -0.57461634E+00 0.68805448E-05 -0.34022345E+00 -0.57511425E+00 0.98595301E-05 -0.39338020E+00 -0.66496888E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.92026895E-05 -0.33896389E+00 -0.57298455E+00 0.35225491E-05 -0.33682498E+00 -0.56935837E+00 0.76078588E-05 -0.37324699E+00 -0.63093700E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.10923226E-04 -0.33757462E+00 -0.57063614E+00 0.59470629E-05 -0.33692929E+00 -0.56954298E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 0.00000000E+00 lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/sparselib.c100666 0 0 51212 11141443436 17103 0ustar usergroup #include #include #include #include #include "commonlib.h" #include "myblas.h" #include "sparselib.h" sparseMatrix *createMatrix(int dimLimit, int lenLimit, int initVectors) { int initsize; sparseMatrix *matrix; if(initVectors < 0) initVectors = 0; if(initVectors == 0) initsize = MIN(INITIALSIZE, dimLimit); else initsize = MAX(INITIALSIZE, initVectors); CALLOC(matrix, 1); matrix->limit = dimLimit; matrix->limitVector = lenLimit; resizeMatrix(matrix, initsize); while(initVectors > 0) { initVectors--; appendMatrix(matrix, createVector(lenLimit, 2)); } return(matrix); } void resizeMatrix(sparseMatrix *matrix, int newSize) { int oldSize; if(matrix == NULL) oldSize = 0; else oldSize = matrix->size; while(oldSize>newSize) { oldSize--; freeVector(matrix->list[oldSize]); return; } REALLOC(matrix->list, newSize); while(oldSizelist[oldSize] = NULL; oldSize++; } if(newSize>0) matrix->size = newSize; } int appendMatrix(sparseMatrix *matrix, sparseVector *newVector) { if(matrix->count == matrix->size) resizeMatrix(matrix, matrix->size + 10); matrix->list[matrix->count] = newVector; matrix->count++; putDiagonalIndex(newVector, matrix->count); return(matrix->count); } int NZcountMatrix(sparseMatrix *matrix) { int i, nz; nz = 0; for(i = 0; i < matrix->count; i++) nz += matrix->list[i]->count; return( nz ); } void freeMatrix(sparseMatrix *matrix) { resizeMatrix(matrix, 0); FREE(matrix); } void printMatrix(int n, sparseMatrix *matrix, int modulo, MYBOOL showEmpty) { int i; for(i = 1; i<=matrix->count; i++) if(matrix->list[i-1] != NULL) { if(showEmpty || matrix->list[i-1]->count>0) printVector(n, matrix->list[i-1], modulo); } } sparseVector *createVector(int dimLimit, int initSize) { sparseVector *newitem; CALLOC(newitem, 1); newitem->limit = dimLimit; initSize = resizeVector(newitem, initSize); return(newitem); } sparseVector *cloneVector(sparseVector *sparse) { sparseVector *hold; hold = createVector(sparse->limit, sparse->count); hold->count = sparse->count; MEMCOPY(&hold->value[0], &sparse->value[0], (sparse->count+1)); MEMCOPY(&hold->index[0], &sparse->index[0], (sparse->count+1)); return(hold); } int redimensionVector(sparseVector *sparse, int newDim) { int olddim, i; olddim = sparse->limit; sparse->limit = newDim; if(lastIndex(sparse)>newDim) { i = sparse->count; while(i>0 && sparse->index[i]>newDim) i--; sparse->count = i; resizeVector(sparse, sparse->count); } return(olddim); } int resizeVector(sparseVector *sparse, int newSize) { int oldsize; oldsize = sparse->size; REALLOC(sparse->value, (newSize+1)); REALLOC(sparse->index, (newSize+1)); sparse->size = newSize; return(oldsize); } void moveVector(sparseVector *sparse, int destPos, int sourcePos, int itemCount) { int i; if(itemCount <= 0 || sourcePos == destPos) return; #if defined DOFASTMATH if(TRUE) { MEMMOVE(&sparse->value[destPos], &sparse->value[sourcePos], itemCount); MEMMOVE(&sparse->index[destPos], &sparse->index[sourcePos], itemCount); } else { int *idxPtr1, *idxPtr2; double *valPtr1, *valPtr2; for(i = 1, idxPtr1 = sparse->index+destPos, idxPtr2 = sparse->index+sourcePos, valPtr1 = sparse->value+destPos, valPtr2 = sparse->value+sourcePos; i<=itemCount; i++, idxPtr1++, idxPtr2++, valPtr1++, valPtr2++) { *idxPtr1 = *idxPtr2; *valPtr1 = *valPtr2; } } #else for(i = 1; i<=itemCount; i++) { sparse->value[destPos] = sparse->value[sourcePos]; sparse->index[destPos] = sparse->index[sourcePos]; destPos++; sourcePos++; } #endif } void rotateVector(sparseVector *sparse, int startPos, int chainSize, int stepDelta) { /* int idxHold; */ /* double valHold; */ } void swapVector(sparseVector *sparse1, sparseVector *sparse2) { int n, m, *idx; REAL *val; n = sparse1->count; sparse1->count = sparse2->count; sparse2->count = n; n = sparse1->size; sparse1->size = sparse2->size; sparse2->size = n; n = sparse1->limit; sparse1->limit = sparse2->limit; sparse2->limit = n; idx = sparse1->index; sparse1->index = sparse2->index; sparse2->index = idx; val = sparse1->value; sparse1->value = sparse2->value; sparse2->value = val; n = getDiagonalIndex(sparse1); m = getDiagonalIndex(sparse2); putDiagonalIndex(sparse1, m); putDiagonalIndex(sparse2, n); } void freeVector(sparseVector *sparse) { if(sparse != NULL) { FREE(sparse->value); FREE(sparse->index); FREE(sparse); } } MYBOOL verifyVector(sparseVector *sparse) { int i, n, k1, k2, kd; int err = 0; double vd; n = sparse->count; kd = sparse->index[0]; vd = sparse->value[0]; if(n <= 1) return(TRUE); k1 = 0; k2 = sparse->index[1]; if(k2 == kd && sparse->value[1] != vd) err = 2; for(i = 2; i <= n && err == 0; i++) { k1 = k2; k2 = sparse->index[i]; if(k1 >= k2) err = 1; if(k2 == kd && sparse->value[i] != vd) err = 2; } if(err == 0) return(TRUE); else if(err == 1) printf("Invalid sparse vector index order"); else if(err == 2) printf("Invalid sparse vector diagonal value"); return(FALSE); } int firstIndex(sparseVector *sparse) { return(sparse->index[1]); } int lastIndex(sparseVector *sparse) { return(sparse->index[sparse->count]); } int getDiagonalIndex(sparseVector *sparse) { return(sparse->index[0]); } int putDiagonalIndex(sparseVector *sparse, int index) { int oldindex; oldindex = sparse->index[0]; if(index > 0) { sparse->index[0] = 0; /* Must temporarily set to zero to force vector search in getItem */ sparse->value[0] = getItem(sparse, index); } else sparse->value[0] = 0; sparse->index[0] = index; return(oldindex); } MYBOOL putDiagonal(sparseVector *sparse, REAL value) { if(sparse->index[0]>0) { putItem(sparse, sparse->index[0], value); return(TRUE); } else return(FALSE); } REAL getDiagonal(sparseVector *sparse) { return(sparse->value[0]); } REAL getItem(sparseVector *sparse, int targetIndex) { /* First check if we want the diagonal element */ if(targetIndex == sparse->index[0]) return(sparse->value[0]); /* If not, search for the variable's position in the index list */ targetIndex = findIndex(targetIndex, sparse->index, sparse->count, BLAS_BASE); if(targetIndex < 0) return(0); else return(sparse->value[targetIndex]); } REAL addtoItem(sparseVector *sparse, int targetIndex, REAL value) { int idx; if(targetIndex > 0) idx = findIndex(targetIndex, sparse->index, sparse->count, BLAS_BASE); else { idx = -targetIndex; if(idx > sparse->count) /* Index error; ignore item */ return(0.0); } if(idx <=0 ) value = putItem(sparse, targetIndex, value); else { value += sparse->value[idx]; putItem(sparse, -idx, value); } return(value); } REAL putItem(sparseVector *sparse, int targetIndex, REAL value) { REAL last = 0.0; int posIndex; if(targetIndex < 0) { posIndex = -targetIndex; if(posIndex > sparse->count) return(last); targetIndex = sparse->index[posIndex]; } else posIndex = findIndex(targetIndex, sparse->index, sparse->count, BLAS_BASE); if(fabs(value) < MACHINEPREC) value = 0; if(targetIndex == sparse->index[0]) sparse->value[0] = value; if(posIndex < 0) { if(value != 0) { if(sparse->count == sparse->size) resizeVector(sparse, sparse->size + RESIZEDELTA); posIndex = -posIndex; sparse->count++; if(posIndex < sparse->count) moveVector(sparse, posIndex+1, posIndex, sparse->count-posIndex); sparse->value[posIndex] = value; sparse->index[posIndex] = targetIndex; } } else { if(value == 0) { last = sparse->value[posIndex]; if(sparse->count > posIndex) moveVector(sparse, posIndex, posIndex+1, sparse->count-posIndex); sparse->count--; } else { sparse->value[posIndex] = value; sparse->index[posIndex] = targetIndex; } } #ifdef DEBUG_SPARSELIB verifyVector(sparse); #endif return(last); } void swapItems(sparseVector *sparse, int firstIndex, int secondIndex) { int i,j,ki,kj; REAL hold; if(firstIndex == secondIndex) return; if(firstIndex > secondIndex) { i = firstIndex; firstIndex = secondIndex; secondIndex = i; } if(FALSE) { i = 1; ki = 0; while(i <= sparse->count && (ki = sparse->index[i])count && (kj = sparse->index[j])index, sparse->count, BLAS_BASE); if(i < 0) i = -i; j = findIndex(secondIndex, sparse->index, sparse->count, BLAS_BASE); if(j < 0) j = -j; } if(i > sparse->count) ki = 0; else ki = sparse->index[i]; if(j > sparse->count) kj = 0; else kj = sparse->index[j]; if(ki == firstIndex && kj == secondIndex) { /* Found both -> swap in place */ hold = sparse->value[i]; sparse->value[i] = sparse->value[j]; sparse->value[j] = hold; if(sparse->index[0] == firstIndex) sparse->value[0] = sparse->value[i]; else if(sparse->index[0] == secondIndex) sparse->value[0] = sparse->value[j]; } else if(ki == firstIndex) { /* Found first, but not the second -> shift left */ j--; if(i < j) { hold = sparse->value[i]; moveVector(sparse, i, i+1, j-i); sparse->value[j] = hold; } sparse->index[j] = secondIndex; if(sparse->index[0] == firstIndex) sparse->value[0] = 0; else if(sparse->index[0] == secondIndex) sparse->value[0] = sparse->value[j]; } else if(kj == secondIndex) { /* Found second, but not the first -> shift right */ if(i < j) { hold = sparse->value[j]; moveVector(sparse, i+1, i, j-i); sparse->value[i] = hold; } sparse->index[i] = firstIndex; if(sparse->index[0] == firstIndex) sparse->value[0] = sparse->value[i]; else if(sparse->index[0] == secondIndex) sparse->value[0] = 0; } #ifdef DEBUG_SPARSELIB verifyVector(sparse); #endif } void clearVector(sparseVector *sparse, int indexStart, int indexEnd) { int i; i = sparse->count; if(i==0) return; if(indexStart<=0) indexStart=sparse->index[1]; if(indexEnd<=0) indexEnd=sparse->index[i]; if(indexStart>indexEnd) return; if(sparse->index[0]>=indexStart && sparse->index[0]<=indexEnd) { sparse->value[0] = 0; } if(indexStart<=sparse->index[1] && indexEnd>=sparse->index[i]) sparse->count = 0; else { while(i>0 && sparse->index[i]>indexEnd) i--; indexEnd = i; while(i>0 && sparse->index[i]>=indexStart) i--; indexStart = i+1; if(indexEnd>=indexStart) { i = sparse->count-indexEnd; moveVector(sparse, indexStart, indexEnd+1, i); sparse->count -= indexEnd-indexStart+1; } } #ifdef DEBUG_SPARSELIB verifyVector(sparse); #endif } int getVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd, MYBOOL doClear) { int i,k; i = 1; while(i<=sparse->count && sparse->index[i]count && (k=sparse->index[i])<=indexEnd) { while(indexStartvalue[i]; indexStart++; i++; } while(indexStart<=indexEnd) { dense[indexStart] = 0; indexStart++; } k = sparse->count; if(doClear) { sparse->count = 0; sparse->value[0] = 0; } return(k); } void putVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd) { int i,n; n = sparse->count; if(indexStart<=0) indexStart=sparse->index[1]; if(indexEnd<=0) indexEnd=sparse->index[n]; if(n==0 || sparse->index[n]index[0]; if(i>=indexStart && i<=indexEnd) sparse->value[0] = 0; for(i = indexStart; i<=indexEnd; i++) { if(dense[i] == 0) continue; if(sparse->size == sparse->count) resizeVector(sparse, sparse->size + RESIZEDELTA); sparse->count++; sparse->value[sparse->count] = dense[i]; sparse->index[sparse->count] = i; if(i == sparse->index[0]) sparse->value[0] = dense[i]; } } else { while(indexStart <= indexEnd) { putItem(sparse, indexStart, dense[indexStart]); indexStart++; } } #ifdef DEBUG_SPARSELIB verifyVector(sparse); #endif } void fillVector(sparseVector *sparse, int count, REAL value) { int i; if(sparse->count > 0) clearVector(sparse, 0, 0); for(i = 1; i<=count; i++) putItem(sparse, i, value); } REAL dotVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd) { int i, n; long REAL sum; n = sparse->count; sum = 0; if(n > 0) { if(indexStart<=0) indexStart=sparse->index[1]; if(indexEnd<=0) indexEnd=sparse->index[n]; if(indexStart > 1) { i = findIndex(indexStart, sparse->index, sparse->count, BLAS_BASE); if(i < 0) { i = -i; if(i > n) return(sum); } } else i = 1; /* CPU intensive loop; provide alternative evaluation models */ #if defined DOFASTMATH { /* Do fast pointer arithmetic */ int *indexptr; REAL *valueptr; /* for(i = 1, indexptr = sparse->index + 1; i <= n && (*indexptr) < indexStart; i++, indexptr++); */ indexptr = sparse->index + i; for(valueptr = sparse->value + i; i <= n && (*indexptr) <= indexEnd; i++, indexptr++, valueptr++) sum += (*valueptr) * dense[(*indexptr)]; } #else { /* Do traditional indexed access */ int k; /* i = 1; */ /* while(i<=n && sparse->index[i]index[i])<=indexEnd) { sum += sparse->value[i] * dense[k]; i++; } } #endif } return(sum); } void daxpyVector1(sparseVector *sparse, REAL scalar, REAL *dense, int indexStart, int indexEnd) { int i, n; if(scalar == 0) return; n = sparse->count; if(indexStart<=0) indexStart=sparse->index[1]; if(indexEnd<=0) indexEnd=sparse->index[n]; /* CPU intensive loop; provide alternative evaluation models */ #if defined DOFASTMATH { /* Do fast pointer arithmetic */ int *indexptr; REAL *valueptr; for(i = 1, indexptr = sparse->index + 1; i <= n && (*indexptr) < indexStart; i++, indexptr++); for(valueptr = sparse->value + i; i <= n && (*indexptr) <= indexEnd; i++, indexptr++, valueptr++) dense[(*indexptr)] += (*valueptr) * scalar; } #else { /* Do traditional indexed access */ int k; for(i = 1; i<= n; i++) { k = sparse->index[i]; if(kindexEnd) break; dense[k] += sparse->value[i] * scalar; } } #endif } void daxpyVector2(REAL *dense, REAL scalar, sparseVector *sparse, int indexStart, int indexEnd) { sparseVector *hold; hold = createVector(sparse->limit, sparse->count); putDiagonalIndex(hold, getDiagonalIndex(sparse)); putVector(hold, dense, indexStart, indexEnd); daxpyVector3(hold, scalar, sparse, indexStart, indexEnd); freeVector(hold); } void daxpyVector3(sparseVector *sparse1, REAL scalar, sparseVector *sparse2, int indexStart, int indexEnd) { int i1, i2, k, p1, p2, c1, c2; sparseVector *hold; if(sparse1->count == 0) return; /* Spool to start positions */ i1 = 1; c1 = sparse1->count; while(i1 <= c1 && sparse1->index[i1] < indexStart) i1++; if(i1 <= c1) p1 = sparse1->index[i1]; else p1 = indexEnd+1; i2 = 1; c2 = sparse2->count; while(i2 <= c2 && sparse2->index[i2] < indexStart) i2++; if(i2 <= c2) p2 = sparse2->index[i2]; else p2 = indexEnd+1; /* Create a temporary vector */ k = c1+c2; if(k > 0) { hold = createVector(MAX(sparse1->limit, sparse2->limit), k); putDiagonalIndex(hold, getDiagonalIndex(sparse2)); } else hold = sparse2; /* Loop over all items in both vectors */ while((i1 <= c1 && p1 <= indexEnd) || (i2 <= c2 && p2 <= indexEnd)) { k = 0; /* Add/spool exclusive right-vector items */ while(i2 <= c2 && p2 < p1) { if(hold != sparse2) putItem(hold, p2, sparse2->value[i2]); i2++; if(i2 <= c2) p2 = sparse2->index[i2]; else p2 = indexEnd+1; k++; } /* Add equal-indexed items */ while(i1 <= c1 && i2 <= c2 && p1 == p2) { /* if(hold != sparse2) */ putItem(hold, p1, scalar*sparse1->value[i1]+sparse2->value[i2]); /* else addtoItem(sparse2, -i2, scalar*sparse1->value[i1]); */ i1++; if(i1 <= c1) p1 = sparse1->index[i1]; else p1 = indexEnd+1; i2++; if(i2 <= c2) p2 = sparse2->index[i2]; else p2 = indexEnd+1; k++; } /* Add exclusive left-vector items */ while(i1 <= c1 && p1 < p2) { putItem(hold, p1, scalar*sparse1->value[i1]); /* if(hold == sparse2) c2++; */ i1++; if(i1 <= c1) p1 = sparse1->index[i1]; else p1 = indexEnd+1; k++; } if(k == 0) break; } /* if(hold != sparse2) */ { swapVector(hold, sparse2); freeVector(hold); } #ifdef DEBUG_SPARSELIB verifyVector(sparse2); #endif } void dswapVector1(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd) { int i, d, n; REAL *x; if(indexStart <= 0) indexStart = 1; n = lastIndex(sparse); if(indexEnd <= 0) indexEnd = n; CALLOC(x, (MAX(indexEnd,n)+1)); getVector(sparse, x, indexStart, n, FALSE); d = getDiagonalIndex(sparse); clearVector(sparse, indexStart, n); for(i = indexStart; i<=indexEnd; i++) { if(dense[i] != 0) putItem(sparse, i, dense[i]); } for(i = indexEnd+1; i<=n; i++) { if(x[i] != 0) putItem(sparse, i, x[i]); } MEMCOPY(&dense[indexStart], &x[indexStart], (indexEnd-indexStart+1)); #ifdef DEBUG_SPARSELIB verifyVector(sparse); #endif FREE(x); } void dswapVector2(REAL *dense, sparseVector *sparse, int indexStart, int indexEnd) { dswapVector1(sparse, dense, indexStart, indexEnd); } void dswapVector3(sparseVector *sparse1, sparseVector *sparse2, int indexStart, int indexEnd) { REAL *dense1, *dense2; if(indexStart<=0) indexStart = 1; if(indexEnd<=0) indexEnd = MAX(lastIndex(sparse1), lastIndex(sparse2)); if(indexStart <= firstIndex(sparse1) && indexStart <= firstIndex(sparse2) && indexEnd >= lastIndex(sparse1) && indexEnd >= lastIndex(sparse2)) { swapVector(sparse1, sparse2); } else { CALLOC(dense1, (indexEnd+1)); CALLOC(dense2, (indexEnd+1)); getVector(sparse1, dense1, indexStart, indexEnd, TRUE); getVector(sparse2, dense2, indexStart, indexEnd, TRUE); clearVector(sparse1, indexStart, indexEnd); clearVector(sparse2, indexStart, indexEnd); putVector(sparse1, dense2, indexStart, indexEnd); putVector(sparse2, dense1, indexStart, indexEnd); FREE(dense1); FREE(dense2); } } int idamaxVector(sparseVector *sparse, int is, REAL *maxValue) { int i, n, imax; REAL xmax; n = sparse->count; imax = 1; if(n == 0) xmax = 0; else { xmax = fabs(sparse->value[imax]); /* CPU intensive loop; provide alternative evaluation models */ #if defined DOFASTMATH { /* Do fast pointer arithmetic */ int *indexptr; REAL *valueptr; for(i = 1, indexptr = sparse->index + 1; i <= n && (*indexptr) <= is; i++, indexptr++); for(valueptr = sparse->value + i; i <= n; i++, indexptr++, valueptr++) { if((*valueptr)>xmax) { xmax = (*valueptr); imax = (*indexptr); } } } #else { REAL xtest; /* Do traditional indexed access */ i = 1; while(i <= n && sparse->index[i] <= is) i++; for(; i<=n; i++) { xtest = fabs(sparse->value[i]); if(xtest>xmax) { xmax = xtest; imax = sparse->index[i]; } } } #endif } if(maxValue != NULL) (*maxValue) = sparse->index[imax]; return(imax); } void printVector(int n, sparseVector *sparse, int modulo ) { int i,j,k; if(sparse == NULL) return; if (modulo <= 0) modulo = 5; for (i = 1, j = 1; j<=n; i++, j++) { if(i<=sparse->count) k = sparse->index[i]; else k = n+1; while (j < k) { if(mod(j, modulo) == 1) printf("\n%2d:%12g", j, 0.0); else printf(" %2d:%12g", j, 0.0); j++; } if(k<=n) { if(mod(j, modulo) == 1) printf("\n%2d:%12g", k, sparse->value[i]); else printf(" %2d:%12g", k, sparse->value[i]); } } if(mod(j, modulo) != 0) printf("\n"); } lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/sparselib.h100666 0 0 5637 11141443437 17103 0ustar usergroup #include "commonlib.h" /*#define DEBUG_SPARSELIB*/ #define INITIALSIZE 10 #define RESIZEDELTA 4 #ifndef SPARSELIB #define SPARSELIB typedef struct _sparseVector { int limit; int size; int count; int *index; REAL *value; } sparseVector; typedef struct _sparseMatrix { int limit; int size; int count; int limitVector; sparseVector **list; } sparseMatrix; #endif #ifdef __cplusplus extern "C" { #endif sparseMatrix *createMatrix(int dimLimit, int lenLimit, int initVectors); void resizeMatrix(sparseMatrix *matrix, int newSize); int appendMatrix(sparseMatrix *matrix, sparseVector *newVector); int NZcountMatrix(sparseMatrix *matrix); void freeMatrix(sparseMatrix *matrix); void printMatrix(int n, sparseMatrix *matrix, int modulo, MYBOOL showEmpty); sparseVector *createVector(int dimLimit, int initSize); sparseVector *cloneVector(sparseVector *sparse); int redimensionVector(sparseVector *sparse, int newDim); int resizeVector(sparseVector *sparse, int newSize); void moveVector(sparseVector *sparse, int destPos, int sourcePos, int itemCount); void rotateVector(sparseVector *sparse, int startPos, int chainSize, int stepDelta); void swapVector(sparseVector *sparse1, sparseVector *sparse2); void freeVector(sparseVector *sparse); void printVector(int n, sparseVector *sparse, int modulo); MYBOOL verifyVector(sparseVector *sparse); int firstIndex(sparseVector *sparse); int lastIndex(sparseVector *sparse); int getDiagonalIndex(sparseVector *sparse); int putDiagonalIndex(sparseVector *sparse, int index); MYBOOL putDiagonal(sparseVector *sparse, REAL value); REAL getDiagonal(sparseVector *sparse); REAL getItem(sparseVector *sparse, int targetIndex); REAL putItem(sparseVector *sparse, int targetIndex, REAL value); REAL addtoItem(sparseVector *sparse, int targetIndex, REAL value); void swapItems(sparseVector *sparse, int firstIndex, int secondIndex); void clearVector(sparseVector *sparse, int indexStart, int indexEnd); int getVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd, MYBOOL doClear); void putVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd); void fillVector(sparseVector *sparse, int count, REAL value); REAL dotVector(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd); void daxpyVector1(sparseVector *sparse, REAL scalar, REAL *dense, int indexStart, int indexEnd); void daxpyVector2(REAL *dense, REAL scalar, sparseVector *sparse, int indexStart, int indexEnd); void daxpyVector3(sparseVector *sparse1, REAL scalar, sparseVector *sparse2, int indexStart, int indexEnd); void dswapVector1(sparseVector *sparse, REAL *dense, int indexStart, int indexEnd); void dswapVector2(REAL *dense, sparseVector *sparse, int indexStart, int indexEnd); void dswapVector3(sparseVector *sparse1, sparseVector *sparse2, int indexStart, int indexEnd); int idamaxVector(sparseVector *sparse, int is, REAL *maxValue); #ifdef __cplusplus } #endif lp_solve_5.5/bfp/bfp_LUSOL/LUSOL/Victoria1850.RUA100666 0 0 617212 10354206632 17452 0ustar usergroup1UNSYMMETRIC MATRIX MAHINDAS ST ERTAR 24OCT84 MAHINDAS 2488 126 769 1537 56 RUA 1258 1258 7682 0 (10I8) (10I8) (1P5D16.8) (1P5D16.8) M 55 162 1 37 74 111 148 185 222 259 296 317 337 351 366 378 394 407 422 434 444 456 466 478 486 497 511 526 541 556 572 589 611 624 638 655 670 683 697 709 720 730 742 756 777 789 801 815 827 852 862 874 881 885 889 891 893 895 897 899 901 903 905 907 909 911 913 915 917 919 921 923 925 927 929 931 933 935 937 939 941 943 945 947 949 951 953 955 957 959 961 963 965 967 969 971 973 975 977 979 981 983 985 986 987 989 991 993 995 997 999 1001 1003 1005 1007 1009 1011 1013 1015 1017 1019 1021 1023 1025 1027 1029 1031 1033 1035 1037 1039 1041 1043 1045 1047 1049 1051 1053 1055 1057 1059 1061 1063 1065 1067 1069 1071 1073 1075 1077 1079 1081 1083 1085 1087 1089 1091 1093 1095 1097 1099 1101 1103 1105 1107 1109 1111 1113 1115 1117 1119 1121 1123 1125 1127 1129 1131 1133 1135 1137 1139 1141 1143 1145 1147 1149 1151 1153 1155 1157 1159 1161 1163 1165 1167 1169 1171 1173 1175 1177 1179 1181 1183 1185 1187 1189 1191 1193 1195 1197 1199 1201 1203 1205 1207 1209 1211 1213 1215 1217 1219 1221 1223 1225 1227 1229 1231 1233 1235 1237 1239 1241 1243 1245 1247 1249 1251 1253 1255 1257 1259 1261 1263 1265 1267 1269 1271 1273 1275 1277 1279 1281 1283 1285 1287 1289 1291 1293 1295 1297 1299 1301 1303 1305 1307 1309 1311 1313 1315 1317 1319 1321 1323 1325 1327 1329 1331 1333 1335 1337 1339 1341 1343 1345 1347 1349 1351 1353 1355 1357 1359 1361 1363 1365 1367 1369 1371 1373 1375 1377 1379 1381 1383 1385 1387 1389 1391 1393 1395 1397 1399 1401 1403 1405 1407 1409 1411 1413 1415 1417 1419 1421 1423 1425 1427 1429 1431 1433 1435 1437 1439 1441 1443 1445 1447 1448 1449 1450 1452 1454 1455 1457 1458 1460 1462 1464 1466 1468 1469 1471 1473 1475 1477 1479 1481 1483 1485 1487 1488 1489 1491 1492 1493 1494 1496 1498 1500 1502 1504 1506 1508 1510 1512 1514 1516 1518 1520 1522 1524 1525 1526 1528 1530 1531 1533 1535 1536 1537 1538 1539 1540 1541 1543 1545 1547 1549 1550 1552 1554 1556 1558 1560 1561 1562 1564 1566 1568 1570 1572 1574 1576 1578 1579 1581 1583 1584 1585 1586 1588 1590 1592 1594 1596 1598 1600 1602 1604 1605 1607 1609 1611 1613 1615 1617 1619 1621 1623 1625 1627 1629 1630 1632 1634 1637 1640 1643 1646 1649 1652 1655 1658 1661 1664 1667 1670 1673 1676 1679 1682 1685 1688 1691 1694 1697 1700 1703 1706 1709 1712 1715 1718 1721 1724 1727 1730 1733 1736 1739 1742 1745 1748 1751 1754 1757 1760 1763 1766 1769 1772 1775 1778 1781 1784 1787 1790 1793 1796 1801 1806 1811 1816 1821 1826 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1865 1866 1868 1870 1871 1872 1873 1875 1876 1877 1878 1879 1881 1882 1883 1885 1887 1888 1890 1891 1892 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1914 1915 1916 1917 1918 1919 1920 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1954 1956 1958 1960 1962 1964 1966 1968 1970 1972 1974 1976 1978 1980 1982 1984 1986 1988 1990 1992 1994 1996 1998 2000 2002 2004 2006 2008 2010 2012 2014 2016 2018 2020 2022 2024 2026 2028 2030 2032 2034 2036 2038 2040 2042 2044 2046 2048 2050 2052 2054 2056 2058 2060 2062 2064 2066 2068 2070 2071 2073 2075 2077 2079 2081 2083 2085 2087 2089 2091 2093 2095 2097 2099 2101 2103 2105 2107 2109 2111 2113 2115 2117 2119 2121 2123 2125 2127 2129 2131 2133 2135 2137 2139 2140 2142 2144 2146 2147 2148 2149 2150 2151 2152 2153 2155 2156 2157 2166 2174 2181 2196 2199 2202 2205 2208 2211 2214 2217 2220 2223 2226 2229 2232 2235 2238 2241 2244 2247 2250 2253 2256 2259 2262 2265 2268 2271 2274 2277 2280 2283 2286 2289 2292 2295 2298 2301 2304 2307 2310 2313 2316 2319 2322 2325 2328 2331 2334 2337 2340 2343 2345 2347 2348 2442 2536 2630 2727 2824 2915 3014 3110 3208 3306 3323 3329 3338 3359 3367 3374 3380 3401 3407 3413 3419 3425 3431 3438 3445 3457 3464 3469 3477 3483 3511 3551 3572 3578 3587 3601 3610 3628 3667 3682 3688 3698 3720 3757 3763 3772 3871 3971 3979 4032 4037 4041 4045 4050 4055 4067 4079 4095 4104 4106 4114 4121 4126 4131 4136 4141 4149 4155 4160 4166 4171 4179 4184 4189 4195 4200 4207 4212 4221 4232 4238 4241 4246 4252 4271 4279 4300 4305 4310 4319 4325 4349 4386 4395 4397 4405 4420 4442 4444 4446 4448 4450 4452 4454 4456 4459 4461 4463 4666 4671 4676 4681 4686 4691 4696 4701 4706 4711 4716 4721 4726 4731 4736 4741 4746 4751 4756 4761 4766 4771 4776 4781 4786 4791 4796 4801 4806 4811 4816 4821 4826 4831 4836 4841 4846 4851 4856 4861 4866 4871 4876 4881 4886 4891 4896 4901 4906 4910 4914 4916 4918 4922 4926 4930 4934 4938 4942 4946 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4996 4998 5000 5055 5110 5112 5167 5169 5224 5279 5334 5389 5444 5446 5501 5556 5611 5666 5721 5776 5831 5886 5941 5943 5998 6053 6055 6057 6059 6114 6169 6224 6279 6334 6389 6444 6499 6554 6609 6664 6719 6774 6829 6884 6886 6888 6943 6998 7000 7055 7110 7112 7114 7116 7119 7122 7125 7128 7131 7133 7136 7139 7142 7145 7148 7151 7154 7157 7160 7163 7166 7169 7172 7175 7178 7181 7184 7186 7189 7192 7195 7198 7201 7204 7207 7210 7213 7216 7219 7222 7225 7228 7231 7234 7236 7239 7242 7245 7247 7250 7252 7254 7256 7258 7260 7263 7265 7267 7278 7315 7321 7329 7331 7333 7335 7337 7339 7341 7343 7345 7347 7349 7351 7353 7355 7357 7359 7361 7363 7365 7367 7369 7371 7373 7375 7377 7379 7381 7383 7385 7387 7389 7391 7393 7395 7397 7399 7401 7403 7405 7407 7409 7411 7413 7415 7417 7418 7419 7420 7421 7422 7423 7424 7426 7428 7430 7432 7434 7436 7438 7440 7442 7444 7446 7448 7450 7452 7454 7456 7458 7460 7462 7464 7466 7468 7470 7472 7474 7476 7478 7480 7482 7484 7486 7488 7490 7492 7494 7496 7498 7500 7502 7504 7506 7508 7510 7512 7514 7515 7516 7517 7518 7519 7520 7521 7523 7568 7569 7571 7573 7574 7577 7579 7634 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 1 53 105 157 158 159 160 161 162 163 164 165 166 986 987 988 989 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 2 54 106 167 168 169 170 171 172 173 174 175 176 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 3 55 107 177 178 179 180 181 182 183 184 185 186 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 4 56 108 187 188 189 190 191 192 193 194 195 196 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 5 57 109 197 198 199 200 201 202 203 204 205 206 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 6 58 110 207 208 209 210 211 212 213 214 215 216 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 7 59 111 217 218 219 220 221 222 223 224 225 226 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 8 60 112 227 228 229 230 231 232 233 234 235 236 986 987 988 989 990 991 992 996 999 1003 1016 1017 1018 1029 1032 1033 1035 1200 1201 1202 1229 1231 1236 1242 9 61 113 237 986 987 989 994 1016 1017 1018 1020 1024 1029 1032 1033 1035 1199 1231 1237 1242 10 62 114 238 988 989 990 992 1021 1024 1025 1032 1033 1035 1202 1203 1234 1236 1237 1238 11 63 115 239 993 999 1016 1017 1024 1032 1033 1035 1206 1237 12 64 116 240 993 995 1001 1016 1024 1032 1033 1035 1206 1212 1237 13 65 117 241 1024 1025 1029 1031 1032 1033 1035 1237 14 66 118 242 995 999 1016 1017 1022 1024 1029 1032 1033 1035 1214 1237 15 67 119 243 992 1021 1024 1029 1032 1033 1035 1205 1237 16 68 120 244 1016 1023 1024 1029 1032 1033 1035 1229 1236 1237 1242 17 69 121 245 1017 1023 1024 1028 1032 1033 1035 1237 18 70 122 246 1003 1016 1017 1032 1033 1035 19 71 123 247 1017 1023 1024 1032 1033 1035 1219 1237 20 72 124 248 1016 1024 1032 1033 1035 1237 21 73 125 249 1025 1027 1028 1029 1032 1033 1035 1221 22 74 126 250 1028 1032 1033 1035 23 75 127 251 1024 1028 1032 1033 1035 1223 1237 24 76 128 252 1017 1024 1028 1029 1032 1033 1035 1231 1237 1241 25 77 129 253 999 1017 1023 1024 1028 1029 1032 1033 1035 1225 1237 26 78 130 254 1017 1018 1023 1024 1028 1029 1032 1033 1035 1226 1237 27 79 131 255 1017 1023 1024 1025 1028 1029 1031 1032 1033 1035 1237 28 80 132 256 999 1017 1023 1024 1028 1032 1033 1035 1228 1229 1236 1237 29 81 133 257 999 1016 1017 1021 1024 1028 1029 1032 1033 1035 1229 1236 1237 30 82 134 258 993 995 998 999 1016 1017 1022 1024 1032 1033 1035 1206 1211 1212 1230 1231 1236 1237 31 83 135 259 1017 1018 1024 1029 1032 1033 1035 1231 1237 32 84 136 260 994 995 1017 1021 1024 1029 1032 1033 1035 1237 33 85 137 261 990 992 994 996 1003 1017 1020 1021 1024 1032 1033 1035 1237 34 86 138 262 992 994 1020 1024 1026 1032 1033 1035 1203 1234 1237 35 87 139 263 995 999 1017 1024 1032 1033 1035 1235 1237 36 88 140 264 996 1017 1023 1024 1029 1032 1033 1035 1236 1237 37 89 141 265 1023 1024 1029 1031 1032 1033 1035 1237 38 90 142 266 1024 1025 1029 1032 1033 1035 1237 39 91 143 267 1024 1026 1032 1033 1035 1237 40 92 144 268 1025 1027 1029 1031 1032 1033 1035 1240 41 93 145 269 1016 1024 1028 1029 1031 1032 1033 1035 1237 1241 42 94 146 270 994 996 1003 1016 1017 1018 1020 1021 1022 1024 1027 1028 1032 1033 1035 1237 1242 43 95 147 271 1010 1024 1029 1032 1033 1035 1223 1237 44 96 148 272 1017 1024 1032 1033 1035 1039 1223 1237 45 97 149 273 1017 1024 1028 1029 1032 1033 1035 1237 1241 1242 46 98 150 274 1003 1017 1018 1023 1032 1033 1035 1236 47 99 151 275 1000 1010 1014 1016 1017 1018 1023 1025 1028 1029 1030 1032 1033 1035 1213 1227 1229 1231 1236 1238 1241 48 100 152 276 1003 1017 1032 1033 1216 1236 49 101 153 277 1014 1016 1017 1025 1030 1032 1033 1035 50 102 154 278 1032 1033 1250 51 103 155 279 52 104 156 280 1 1094 2 1094 3 1094 4 1094 5 1094 6 1094 7 1094 8 1094 9 1094 10 1094 11 1094 12 1094 13 1094 14 1094 15 1094 16 1094 17 1094 18 1094 19 1094 20 1094 21 1094 22 1094 23 1094 24 1094 25 1094 26 1094 27 1094 28 1094 29 1094 30 1094 31 1094 32 1094 33 1094 34 1094 35 1094 36 1094 37 1094 38 1094 39 1094 40 1094 41 1094 42 1094 43 1094 44 1094 45 1094 46 1094 47 1094 48 1094 49 50 51 1094 52 1094 53 1095 54 1096 55 1097 56 1098 57 1099 58 1100 59 1101 60 1102 61 1103 62 1104 63 1105 64 1106 65 1107 66 1108 67 1109 68 1110 69 1111 70 1112 71 1113 72 1114 73 1115 74 1116 75 1117 76 1118 77 1119 78 1120 79 1121 80 1122 81 1123 82 1124 83 1125 84 1126 85 1127 86 1128 87 1129 88 1130 89 1131 90 1132 91 1133 92 1134 93 1135 94 1136 95 1137 96 1138 97 1139 98 1140 99 1141 100 1142 101 1143 102 1144 103 1145 104 1146 105 1147 106 1148 107 1149 108 1150 109 1151 110 1152 111 1153 112 1154 113 1155 114 1156 115 1157 116 1158 117 1159 118 1160 119 1161 120 1162 121 1163 122 1164 123 1165 124 1166 125 1167 126 1168 127 1169 128 1170 129 1171 130 1172 131 1173 132 1174 133 1175 134 1176 135 1177 136 1178 137 1179 138 1180 139 1181 140 1182 141 1183 142 1184 143 1185 144 1186 145 1187 146 1188 147 1189 148 1190 149 1191 150 1192 151 1193 152 1194 153 1195 154 1196 155 1197 156 1198 157 1040 158 1041 159 1042 160 1043 161 1044 162 1045 163 1046 164 1047 165 1048 166 1049 167 1040 168 1041 169 1042 170 1043 171 1044 172 1045 173 1046 174 1047 175 1048 176 1049 177 1040 178 1041 179 1042 180 1043 181 1044 182 1045 183 1046 184 1047 185 1048 186 1049 187 1040 188 1041 189 1042 190 1043 191 1044 192 1045 193 1046 194 1047 195 1048 196 1049 197 1040 198 1041 199 1042 200 1043 201 1044 202 1045 203 1046 204 1047 205 1048 206 1049 207 1040 208 1041 209 1042 210 1043 211 1044 212 1045 213 1046 214 1047 215 1048 216 1049 217 1040 218 1041 219 1042 220 1043 221 1044 222 1045 223 1046 224 1047 225 1048 226 1049 227 1040 228 1041 229 1042 230 1043 231 1044 232 1045 233 1046 234 1047 235 1048 236 1049 237 1050 238 1051 239 1052 240 1053 241 1054 242 1055 243 1056 244 1057 245 1058 246 1059 247 1060 248 1061 249 1062 250 1063 251 1064 252 1065 253 1066 254 1067 255 1068 256 1069 257 1070 258 1071 259 1072 260 1073 261 1074 262 1075 263 1076 264 1077 265 1078 266 1079 267 1080 268 1081 269 1082 270 1083 271 1084 272 1085 273 1086 274 1087 275 1088 276 1089 277 1090 278 1091 279 1092 280 1093 285 286 287 288 989 289 990 290 291 992 292 293 994 294 995 295 996 296 997 297 998 298 299 1000 300 1001 301 1002 302 1003 303 1004 304 1005 305 1006 306 1007 307 1008 308 309 310 1011 311 312 313 314 1015 315 1016 316 1017 317 1018 318 1019 319 1020 320 1021 321 1022 322 1023 323 1024 324 1025 325 1026 326 1027 327 1028 328 1029 329 330 331 1032 332 1033 333 334 1035 335 1036 336 337 338 339 340 341 342 1202 343 1203 344 1204 345 1205 346 347 1207 348 1208 349 1209 350 1210 351 1211 352 353 354 1214 355 1215 356 1216 357 1217 358 1218 359 1219 360 1220 361 1221 362 363 1223 364 1224 365 366 367 368 1228 369 1229 370 1230 371 1231 372 1232 373 1233 374 1234 375 1235 376 1236 377 378 1238 379 1239 380 1240 381 1241 382 1242 383 1243 384 1244 385 1245 386 1246 387 1247 388 1248 389 1249 390 391 1251 392 1252 285 339 447 286 340 448 287 341 449 288 342 450 289 343 451 290 344 452 291 345 453 292 346 454 293 347 455 294 348 456 295 349 457 296 350 458 297 351 459 298 352 460 299 353 461 300 354 462 301 355 463 302 356 464 303 357 465 304 358 466 305 359 467 306 360 468 307 361 469 308 362 470 309 363 471 310 364 472 311 365 473 312 366 474 313 367 475 314 368 476 315 369 477 316 370 478 317 371 479 318 372 480 319 373 481 320 374 482 321 375 483 322 376 484 323 377 485 324 378 486 325 379 487 326 380 488 327 381 489 328 382 490 329 383 491 330 384 492 331 385 493 332 386 494 333 387 495 334 388 496 335 389 497 336 390 498 337 391 499 338 392 500 501 986 1032 1033 1254 505 990 1032 1033 1254 508 993 1032 1033 1254 514 999 1032 1033 1254 516 1001 1032 1033 1254 534 1019 1032 1033 1254 546 1031 1032 1033 1254 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 1003 573 574 575 576 577 578 579 580 581 582 583 584 585 586 1017 587 588 1019 589 1020 590 591 592 593 1024 594 595 596 597 598 1029 599 600 601 1032 602 1033 603 604 1035 605 606 607 1038 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 1216 627 628 629 630 631 632 633 1223 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 1242 653 654 655 656 657 658 659 660 661 662 986 1040 987 1041 988 1042 989 1043 990 1044 991 1045 992 1046 993 1047 994 1048 995 1049 996 1050 997 1051 998 1052 999 1053 1000 1054 1001 1055 1002 1056 1003 1057 1004 1058 1005 1059 1006 1060 1007 1061 1008 1062 1009 1063 1010 1064 1011 1065 1012 1066 1013 1067 1014 1068 1015 1069 1016 1070 1017 1071 1018 1072 1019 1073 1020 1074 1021 1075 1022 1076 1023 1077 1024 1078 1025 1079 1026 1080 1027 1081 1028 1082 1029 1083 1030 1084 1031 1085 1032 1086 1033 1087 1034 1088 1035 1089 1036 1090 1037 1091 1038 1092 1039 1093 1199 1253 1200 1253 1201 1253 1202 1253 1203 1253 1204 1205 1253 1206 1253 1207 1253 1208 1253 1209 1253 1210 1253 1211 1253 1212 1253 1213 1253 1214 1253 1215 1253 1216 1253 1217 1253 1218 1253 1219 1253 1220 1253 1221 1253 1222 1253 1223 1253 1224 1253 1225 1253 1226 1253 1227 1253 1228 1253 1229 1253 1230 1253 1231 1253 1232 1253 1233 1253 1234 1253 1235 1253 1236 1253 1237 1253 1238 1253 1239 1240 1253 1241 1253 1242 1253 1243 1244 1245 1246 1247 1248 1249 1250 1253 1251 1252 281 1011 1032 1033 1034 1224 1231 1241 1242 282 1011 1032 1033 1034 1224 1241 1242 283 1011 1032 1033 1034 1224 1241 284 1009 1011 1012 1013 1028 1032 1033 1034 1221 1222 1224 1225 1241 1242 281 925 977 281 926 977 281 927 977 281 928 977 281 929 977 281 930 977 281 931 977 281 932 977 282 933 977 282 934 977 282 935 977 282 936 977 282 937 977 282 938 977 282 939 977 282 940 977 282 941 977 282 942 977 282 943 977 282 944 977 282 945 977 282 946 977 282 947 977 282 948 977 282 949 977 282 950 977 282 951 977 282 952 977 282 953 977 282 954 977 282 955 977 282 956 977 282 957 977 282 958 977 282 959 977 282 960 977 282 961 977 282 962 977 282 963 977 282 964 977 282 965 977 282 966 977 283 967 977 283 968 977 284 969 978 284 970 979 284 971 980 284 972 981 284 973 982 974 983 975 984 976 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 339 393 664 665 666 667 668 669 670 671 672 774 986 1199 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 340 394 664 665 666 667 668 669 670 671 672 775 987 1200 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 341 395 664 665 666 667 668 669 670 671 673 776 988 1201 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 288 342 396 664 665 666 667 668 669 670 671 672 673 777 989 1202 1256 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 289 343 397 664 665 666 667 668 669 670 671 673 696 778 990 1203 1256 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 344 398 664 665 666 667 668 669 670 671 779 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 291 345 399 664 665 666 667 668 669 670 671 673 678 696 697 780 992 1205 1256 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 346 400 664 665 666 667 668 669 670 671 674 675 693 781 993 1206 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 293 347 401 664 665 666 667 668 669 670 671 672 695 696 697 705 782 1256 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 294 348 402 664 665 666 667 668 669 670 671 675 677 693 695 698 783 1256 295 349 403 664 665 666 667 668 669 670 671 672 696 699 705 784 1256 296 350 404 673 785 1256 297 351 405 674 693 786 998 1211 1256 352 406 664 665 666 667 668 669 670 671 674 675 677 688 691 692 693 698 787 999 1212 353 407 676 710 788 1000 1213 1256 300 354 408 675 677 789 1256 301 355 409 678 790 1256 302 356 410 664 665 666 667 668 669 670 671 679 681 696 705 709 711 791 1003 1216 1256 303 357 411 680 792 1256 304 358 412 681 793 1256 305 359 413 682 794 1256 306 360 414 683 795 1256 307 361 415 684 796 1256 362 416 685 719 797 1009 1222 309 686 706 710 798 1010 1223 310 364 418 687 716 717 718 719 799 1011 1224 1256 365 419 688 719 800 1012 1225 366 420 689 719 801 367 421 690 710 712 802 1014 1227 314 368 422 691 803 1256 315 369 423 664 665 666 667 668 669 670 671 672 674 675 677 679 681 683 692 693 704 705 710 712 804 1016 1229 1256 316 370 424 664 665 666 667 668 669 670 671 672 674 677 680 681 682 687 688 689 690 691 692 693 694 695 696 698 699 705 707 708 709 710 711 712 805 1017 1230 1256 317 371 425 664 665 666 667 668 669 670 671 672 689 694 705 709 710 806 1018 1231 1256 318 372 426 695 807 1256 319 373 427 672 696 697 705 808 1256 320 374 428 673 678 692 695 696 697 705 809 1021 1234 1256 321 375 429 677 693 698 705 810 1256 322 376 430 679 680 682 688 689 690 691 699 700 709 710 811 1023 1236 1256 377 431 672 673 674 675 676 677 678 679 680 682 683 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 704 705 706 707 708 812 1024 1237 1256 324 378 432 673 676 684 690 701 703 710 712 813 1025 1238 1256 379 433 697 702 814 1256 326 380 434 684 703 705 815 1027 1240 1256 327 381 435 680 684 685 686 687 688 689 690 691 692 704 705 708 710 719 816 1028 1241 1256 328 382 436 664 665 666 667 668 669 670 671 672 676 677 678 679 684 687 688 689 690 692 694 695 699 700 701 703 704 705 706 708 710 817 1029 1242 1256 383 437 706 710 712 818 384 438 676 690 700 703 704 707 819 385 439 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 716 717 718 719 774 775 776 777 778 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 796 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 815 816 817 819 820 1256 386 440 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 716 717 718 719 774 775 776 777 778 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 815 816 817 819 821 1256 387 441 710 716 717 718 719 822 388 442 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 823 1256 389 443 712 824 1256 390 444 713 825 391 445 714 826 392 446 707 715 827 339 672 720 986 1199 340 664 665 666 667 668 669 670 671 721 987 1200 341 664 665 666 667 668 669 670 671 722 988 1201 288 342 396 664 665 666 667 668 669 670 671 673 723 989 1202 1256 289 343 397 673 697 724 990 1203 1256 344 725 291 345 399 678 726 992 1205 1256 346 674 675 693 727 993 1206 293 347 401 728 1256 294 348 402 729 1256 295 349 403 730 1256 296 350 404 731 1256 297 351 405 693 732 998 1211 1256 352 675 693 733 999 1212 353 710 734 1000 1213 300 354 408 677 735 1256 301 355 409 736 1256 302 356 410 711 737 1003 1216 1256 303 357 411 738 1256 304 358 412 739 1256 305 359 413 682 740 1256 306 360 414 741 1256 307 361 415 684 719 742 1256 362 719 743 1009 1222 309 417 686 706 707 744 1010 1223 1256 310 364 418 716 717 718 719 745 1011 1224 1256 365 688 719 746 1012 1225 366 689 747 367 710 748 1014 1227 314 368 422 691 749 1256 315 369 423 664 665 666 667 668 669 670 671 679 691 692 710 750 1016 1229 1256 316 370 424 693 751 1017 1230 1256 317 371 425 664 665 666 667 668 669 670 671 672 687 693 694 710 716 752 1018 1231 1256 318 372 426 753 1256 319 373 427 754 1256 320 374 428 673 697 755 1021 1234 1256 321 375 429 698 756 1256 322 376 430 664 665 666 667 668 669 670 671 673 679 691 692 693 699 709 710 711 757 1023 1236 1256 377 672 673 674 675 676 677 678 679 680 682 683 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 704 705 706 707 708 758 1024 1237 324 378 432 673 710 759 1025 1238 1256 379 760 326 380 434 703 761 1027 1240 1256 327 381 435 687 704 708 710 716 717 718 719 762 1028 1241 1256 328 382 436 664 665 666 667 668 669 670 671 672 679 705 708 716 717 719 763 1029 1242 1256 383 764 384 765 385 766 386 767 387 768 388 769 389 770 390 713 771 391 772 392 773 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 154 155 156 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 714 715 1258 1 53 105 664 828 2 54 106 665 829 3 55 107 666 830 4 56 108 667 831 5 57 109 668 832 6 58 110 669 833 7 59 111 670 834 8 60 112 671 835 9 61 113 672 836 10 62 114 673 837 11 63 115 674 838 12 64 116 675 839 13 65 117 676 840 14 66 118 677 841 15 67 119 678 842 16 68 120 679 843 17 69 121 680 844 18 70 122 681 845 19 71 123 682 846 20 72 124 683 847 21 73 125 684 848 22 74 126 685 849 23 75 127 686 850 24 76 128 687 851 25 77 129 688 852 26 78 130 689 853 27 79 131 690 854 28 80 132 691 855 29 81 133 692 856 30 82 134 693 857 31 83 135 694 858 32 84 136 695 859 33 85 137 696 860 34 86 138 697 861 35 87 139 698 862 36 88 140 699 863 37 89 141 700 864 38 90 142 701 865 39 91 143 702 866 40 92 144 703 867 41 93 145 704 868 42 94 146 705 869 43 95 147 706 870 44 96 148 707 871 45 97 149 708 872 46 98 150 709 873 47 99 151 710 874 48 100 152 711 875 49 153 712 876 50 102 154 877 103 878 104 879 1 53 105 664 2 54 106 665 3 55 107 666 4 56 108 667 5 57 109 668 6 58 110 669 7 59 111 670 8 60 112 671 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 393 447 394 448 395 449 396 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 397 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 398 452 399 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 400 454 401 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 402 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 403 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 404 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 405 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 406 460 407 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 408 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 409 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 410 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 411 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 412 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 413 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 414 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 415 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 416 470 417 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 418 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 419 473 420 474 421 475 422 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 423 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 424 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 425 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 426 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 427 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 428 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 429 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 430 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 431 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 432 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 433 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 434 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 435 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 436 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 437 491 438 492 439 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 440 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 441 495 442 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 443 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 444 498 445 499 446 500 501 774 1254 502 775 1254 503 776 1254 504 777 1254 505 778 1254 506 779 507 780 1254 508 781 1254 509 782 1254 510 783 1254 511 784 1254 512 785 1254 513 786 1254 514 787 1254 515 788 1254 516 789 1254 517 790 1254 518 791 1254 519 792 1254 520 793 1254 521 794 1254 522 795 1254 523 796 1254 524 797 525 798 1254 526 799 1254 527 800 1254 528 801 1254 529 802 1254 530 803 1254 531 804 1254 532 805 1254 533 806 1254 534 807 1254 535 808 1254 536 809 1254 537 810 1254 538 811 1254 539 812 1254 540 813 1254 541 814 542 815 1254 543 816 1254 544 817 1254 545 818 546 819 1254 547 820 548 821 549 822 550 823 551 824 552 825 1254 553 826 554 827 716 828 829 830 831 832 833 834 835 977 1257 717 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 977 1257 718 870 871 879 977 1257 719 872 873 874 875 876 877 878 880 925 881 926 882 927 883 928 884 929 885 930 886 931 887 932 888 933 889 934 890 935 891 936 892 937 893 938 894 939 895 940 896 941 897 942 898 943 899 944 900 945 901 946 902 947 903 948 904 949 905 950 906 951 907 952 908 953 909 954 910 955 911 956 912 957 913 958 914 959 915 960 916 961 917 962 918 963 919 964 920 965 921 966 922 967 923 968 969 970 971 972 973 974 975 924 976 828 880 829 881 830 882 831 883 832 884 833 885 834 886 835 887 836 888 837 889 838 890 839 891 840 892 841 893 842 894 843 895 844 896 845 897 846 898 847 899 848 900 849 901 850 902 851 903 852 904 853 905 854 906 855 907 856 908 857 909 858 910 859 911 860 912 861 913 862 914 863 915 864 916 865 917 866 918 867 919 868 920 869 921 870 922 871 923 872 873 874 875 876 877 878 879 924 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 1094 1253 1255 1254 1255 1255 663 1256 1258 985 1257 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 663 977 985 775 776 777 779 780 782 783 784 785 786 788 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 808 809 810 811 812 813 814 815 816 817 818 820 821 822 823 824 825 826 827 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -5.93589153D-03 -8.27388279D-03 -8.60892702D-03 -1.37353456D-03 -4.92890272D-03 -1.55171787D-04 -1.30801986D-04 -8.56874278D-04 -1.83234370D-04 -1.37678441D-03 -9.81827034D-04 -3.93233960D-03 -3.73784045D-04 -6.89376247D-05 -1.66634141D-04 -1.05326253D-04 -1.00132599D-02 -9.98593494D-03 -5.46094589D-03 -7.06019695D-04 -2.78090150D-03 -2.38090535D-04 -1.64178631D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -6.19863123D-02 -7.16687143D-02 -6.68680817D-02 -1.15005681D-02 -1.90558087D-04 -7.38000050D-02 -2.59988802D-03 -1.93114602D-03 -3.63798230D-03 -1.55267026D-03 -9.03802924D-03 -6.42052805D-03 -3.30437534D-02 -3.13421409D-03 -5.57913794D-04 -1.34995126D-03 -6.88492961D-04 -7.00013712D-02 -7.00070336D-02 -3.82313095D-02 -8.13334715D-03 -1.48213431D-02 -2.86629447D-03 -5.33711677D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -6.43365784D-03 -1.46014765D-01 -1.32799476D-01 -4.80291620D-02 -1.27418283D-02 -2.09978819D-01 -6.17644563D-03 -3.45171918D-03 -9.97103006D-03 -2.30328832D-03 -1.80562958D-02 -1.28339566D-02 -4.90272008D-02 -4.65024495D-03 -8.43684305D-04 -2.04204884D-03 -1.37659872D-03 -1.69996798D-01 -1.70007035D-01 -9.28501487D-02 -3.88781494D-03 -4.44640294D-02 -6.44817576D-03 -9.85071808D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -9.52748433D-02 -1.84948742D-01 -2.01589674D-01 -2.73518991D-02 -4.88014601D-04 -1.38668075D-01 -6.40007528D-03 -4.22320887D-03 -2.66946550D-03 -2.67779361D-03 -1.42026180D-02 -1.00969886D-02 -5.69765754D-02 -5.40477782D-03 -9.67531581D-04 -2.34273169D-03 -1.08307914D-03 -1.80010065D-01 -1.79992974D-01 -9.83157754D-02 -1.23726027D-02 -1.11134751D-02 -4.53819009D-03 -7.38803856D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -8.71037971D-03 -1.18917592D-01 -1.02624908D-01 -3.30613479D-02 -6.81361323D-03 -1.36338934D-01 -3.95535911D-03 -2.64995149D-03 -1.38095417D-03 -1.48837746D-03 -6.73240982D-03 -4.78634099D-03 -3.16886082D-02 -3.00652371D-03 -5.41481015D-04 -1.31053664D-03 -5.13465493D-04 -1.29989490D-01 -1.29992962D-01 -7.10063577D-02 -3.18179536D-03 -6.48370478D-03 -2.38879793D-03 -4.10446571D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.51121563D-03 -2.03185737D-01 -1.92379743D-01 -5.52012399D-02 -2.22557895D-02 -2.92612076D-01 -2.19613705D-02 -5.13518928D-03 -1.95196667D-03 -2.93014268D-03 -1.19892228D-02 -8.52459297D-03 -6.23729564D-02 -5.91553887D-03 -1.05771166D-03 -2.56029260D-03 -9.14247415D-04 -2.39998177D-01 -2.40014061D-01 -1.31086141D-01 -3.88781494D-03 -8.33763927D-03 -4.29878384D-03 -7.38803856D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -9.12127737D-03 -9.66502652D-02 -8.96248892D-02 -1.80861093D-02 -2.58647744D-03 -3.19746435D-02 -8.87065381D-03 -2.36170273D-03 -8.52607656D-04 -6.57393481D-04 -4.91426373D-03 -3.49397887D-03 -1.39749302D-02 -1.32565643D-03 -2.53706501D-04 -6.14048797D-04 -3.74643947D-04 -1.10008687D-01 -1.09985933D-01 -6.00797832D-02 -1.76975597D-03 -3.70280328D-03 -1.67189550D-03 -2.46267952D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.72779313D-03 -7.32349306D-02 -6.92287683D-02 -3.76125723D-02 -6.32327469D-03 -1.11695595D-01 -2.23021419D-03 -1.86090055D-03 -2.39640358D-04 -1.08172570D-03 -4.17646533D-03 -2.96730525D-03 -2.30374597D-02 -2.18466320D-03 -3.89978552D-04 -9.44000029D-04 -3.18302133D-04 -8.99821669D-02 -9.00140628D-02 -4.91578877D-02 -1.41517725D-03 -9.26967128D-04 -1.43248949D-03 -2.87443749D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -5.39141834D-01 -7.24108219D-02 -2.70749658D-01 -1.21773174D-02 -4.69028950D-03 -1.54549666D-02 -1.32671088D-01 -5.41632026D-02 -2.29070000D-02 -1.02059292D-02 -2.30139447D-03 -5.57160983D-03 -7.13856425D-04 -1.00000000D+00 -4.73746061D-01 -3.32121551D-02 -4.78609577D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.28765732D-01 -3.11814636D-01 -2.33154781D-02 -7.09880516D-02 -4.69889343D-02 -3.15410877D-03 -1.07982764D-02 -5.53905789D-04 -1.34165853D-03 -2.59249733D-04 -1.31625205D-01 -1.44391209D-01 -5.64676113D-02 -2.39616428D-02 -5.95942466D-03 -1.50985867D-01 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -6.88045193D-03 -1.94378905D-02 -4.44655260D-03 -2.45325267D-04 -5.37030539D-03 -1.53506466D-04 -3.71707312D-04 -7.68649334D-05 -9.63710174D-02 -7.38798082D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -9.01386291D-02 -1.22320458D-01 -3.04286312D-02 -8.37532878D-02 -4.68578050D-03 -1.73666712D-03 -4.20468301D-03 -6.42606348D-04 -6.97601080D-01 -3.87774557D-01 -6.43205643D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -5.67285763D-03 -8.43898356D-02 -7.12952465D-02 -2.18436681D-03 -2.09217687D-04 -5.06146345D-04 -1.28947213D-04 -3.80237587D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.41041323D-03 -1.25423633D-02 -1.31881451D-02 -1.33477459D-02 -5.36979139D-01 -5.27575752D-03 -1.30613148D-01 -6.97793090D-04 -1.68956094D-03 -2.89647200D-04 -3.43984067D-01 -5.14919870D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.01745531D-01 -2.69539990D-02 -4.38700983D-04 -3.81027572D-02 -2.16832879D-04 -5.24975592D-04 -9.08051734D-05 -4.47068959D-02 -6.04115834D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.70154739D-02 -5.44804186D-02 -2.94610416D-03 -3.52424942D-03 -5.30659396D-04 -1.28507311D-03 -3.73675866D-04 -1.34332012D-02 -1.33385956D-01 -3.07743694D-03 -3.23741399D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -5.22729533D-04 -4.91144974D-03 -1.17239055D-04 -4.91660368D-03 -4.84968186D-05 -1.17170734D-04 -3.02038534D-05 -1.20823162D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.84873845D-02 -9.48597852D-04 -1.18245208D-03 -3.76752141D-05 -9.16097561D-05 -2.07167450D-05 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -7.71998952D-04 -1.67202950D-02 -6.54269592D-04 -8.01600327D-05 -1.94536580D-04 -4.97589099D-05 -2.03145415D-01 -7.49814324D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.93997468D-02 -3.02552417D-05 -1.28256052D-05 -3.05365866D-05 -9.09987830D-06 -3.55362245D-05 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -4.90518920D-02 -3.67200300D-02 -2.71796845D-02 -3.59273776D-02 -2.38876892D-04 -5.77658531D-04 -1.04939027D-04 -5.05565293D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.21411122D-03 -6.01200236D-06 -1.42439021D-05 -3.67867437D-06 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.47935274D-04 -2.35384447D-03 -3.32664131D-05 -7.99024419D-05 -1.47146975D-05 -1.36343017D-01 -3.37594131D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.82508340D-03 -9.35265142D-03 -3.97599563D-02 -5.92482509D-03 -5.05008211D-04 -1.22273166D-03 -7.55212503D-03 -3.74332629D-03 -9.20388196D-03 -9.66170877D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -5.53583428D-02 -1.56889856D-02 -1.50773702D-02 -8.01763905D-04 -3.58140953D-02 -3.03902687D-03 -5.37873828D-04 -1.30273169D-03 -3.15010693D-04 -7.46915162D-01 -9.20388207D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.96155044D-03 -2.13435292D-02 -3.22694657D-03 -3.08981654D-03 -8.41127534D-04 -1.17707148D-03 -4.40880176D-05 -1.06243904D-04 -6.73778268D-05 -1.00000000D+00 -3.56072956D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -6.53464487D-03 -4.78093931D-03 -2.98770494D-04 -1.25943303D-01 -7.90266134D-03 -1.20934229D-02 -8.96510552D-04 -1.88376071D-04 -4.56000009D-04 -1.34755654D-04 -3.02057917D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.42344381D-02 -7.49491062D-03 -5.08867763D-02 -1.53167162D-03 -4.46431991D-03 -4.15228977D-04 -1.00536586D-03 -2.18397094D-04 -1.15931267D-02 -1.34739932D-02 -2.05113031D-02 -1.80524017D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.25418378D-04 -3.57041694D-03 -2.39277597D-05 -1.42107746D-02 -2.45445641D-03 -6.50260481D-04 -9.39567667D-03 -1.57514456D-04 -3.81170743D-04 -7.84138465D-05 -1.52073503D-01 -1.34146260D-02 -2.97793560D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.39835760D-01 -5.19003533D-02 -4.34840858D-01 -3.61280963D-02 -8.04134309D-02 -1.93728089D-01 -1.11547887D-01 -1.16482680D-03 -3.34107014D-03 -8.08946323D-03 -1.76595734D-03 -2.06027895D-01 -3.05439346D-03 -6.12225473D-01 -1.51701225D-02 -9.47329998D-02 -3.37812342D-02 -1.57425471D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.20819050D-03 -2.20815986D-02 -1.26315630D-03 -6.98581478D-03 -1.08616841D-04 -2.63512193D-04 -4.74355365D-05 -1.68003932D-01 -1.38235907D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.79240662D-02 -3.79112288D-02 -3.78637087D-05 -2.06161980D-02 -1.18751824D-03 -9.24244896D-03 -3.09818512D-04 -7.49756116D-04 -1.13651680D-04 -1.90118793D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.03008263D-01 -3.86701792D-01 -2.99895387D-02 -5.25375903D-02 -1.23860007D-02 -5.47971984D-04 -8.51425901D-02 -6.35736883D-02 -1.41821441D-03 -8.42481910D-04 -2.03999993D-03 -3.50635761D-04 -2.42357049D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.66872039D-01 -3.37420292D-02 -8.80064443D-02 -3.89158027D-03 -6.62715316D-01 -5.41481015D-04 -1.31102442D-03 -2.28077814D-04 -1.27128080D-01 -8.09310284D-03 -7.43773161D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.97079161D-02 -5.42924087D-03 -2.06804206D-03 -3.53608117D-03 -2.03606483D-04 -4.92780469D-04 -9.89369801D-05 -3.20892364D-01 -4.84358752D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.22674100D-01 -1.09305168D-02 -2.05520347D-01 -4.30607721D-02 -4.88937367D-03 -2.13786797D-03 -5.17551228D-03 -9.38836427D-04 -4.67726886D-01 -4.98075709D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.56573432D-03 -9.37912439D-04 -9.42864418D-02 -1.70647688D-02 -3.70740134D-04 -8.98439030D-04 -2.28465040D-04 -6.78741897D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -2.07248400D-03 -2.02045768D-01 -6.14770278D-02 -2.10019280D-04 -5.07902412D-04 -1.28366373D-04 -1.47830695D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.40371451D-04 -2.59070516D-01 -6.81360279D-06 -1.66829268D-05 -6.38927668D-06 -6.04115834D-04 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.57857910D-02 -4.08238396D-02 -5.86399846D-02 -1.60451792D-02 -3.32263327D-04 -8.04975629D-04 -1.56246853D-04 -7.34207183D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -4.65537570D-02 -1.24538131D-02 -4.12854701D-01 -3.76570015D-03 -4.29942692D-03 -2.45209527D-03 -5.93648758D-03 -1.22170709D-03 -2.08562091D-02 -1.58014163D-01 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.14314887D-02 -3.47981751D-02 -4.16617095D-03 -1.12184873D-02 -1.80052444D-02 -2.45015007D-02 -1.56204402D-02 -2.99912523D-02 -2.06400584D-02 -3.67979356D-03 -4.41914909D-02 -4.77933232D-03 -4.08415362D-04 -9.88682965D-04 -1.65540347D-04 -6.01272890D-03 -3.15532461D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.85339358D-02 -1.16104481D-03 -4.73614549D-04 -9.61920341D-06 -2.31219510D-05 -4.22079465D-05 -3.23306620D-02 -1.04121130D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -4.53286432D-03 -1.78381115D-01 -3.97593743D-04 -9.62439051D-04 -1.75821269D-03 -1.00000000D+00 -4.71103936D-01 -3.14317912D-01 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -4.37515154D-02 -5.10670662D-01 -1.60897091D-01 -7.86571670D-03 -2.05049361D-03 -4.96419519D-03 -1.57118123D-03 -5.00001788D-01 -6.21112846D-02 -4.10499051D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -6.98079586D-01 -1.94451973D-01 -8.52652192D-02 -3.07986289D-02 -7.04887230D-03 -1.70657560D-02 -2.77327120D-01 -1.43419951D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -7.45730400D-01 -6.41808689D-01 -9.49445844D-01 -1.16051726D-01 -7.41642267D-02 -1.46283031D-01 -1.69224694D-01 -1.78926215D-01 -1.40577674D-01 -1.35398041D-02 -9.27194357D-01 -4.80118487D-03 -1.16230240D-02 -3.06480043D-02 -1.00000000D+00 -1.00000000D+00 -1.75491393D-01 -1.90357510D-02 -2.82683177D-03 -2.79957622D-01 -4.48854752D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.33129418D-01 -1.00396676D-02 -3.90780158D-04 -9.46048764D-04 -6.60542548D-02 -1.13310050D-02 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -3.76148261D-02 -4.02495340D-02 -2.78500728D-02 -4.21503261D-02 -7.28056729D-02 -2.98596104D-04 -7.22439028D-04 -2.63993279D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -8.09095241D-03 -9.52975638D-03 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -3.56158568D-03 1.00000000D+00 -3.36924791D-02 1.00000000D+00 -9.01731327D-02 1.00000000D+00 -5.66755012D-02 1.00000000D+00 -2.80031972D-02 1.00000000D+00 -4.98667546D-02 1.00000000D+00 -2.37598270D-02 1.00000000D+00 -1.64391100D-02 1.00000000D+00 -2.31136009D-03 1.00000000D+00 -2.48041283D-03 1.00000000D+00 -1.27226813D-03 1.00000000D+00 -5.37730055D-03 1.00000000D+00 -2.57951277D-03 1.00000000D+00 -1.56978657D-03 1.00000000D+00 -2.18602782D-03 1.00000000D+00 -8.61218385D-03 1.00000000D+00 -6.97780051D-04 1.00000000D+00 -5.19145164D-04 1.00000000D+00 -1.32793898D-03 1.00000000D+00 -2.91506789D-04 1.00000000D+00 -1.51601026D-03 1.00000000D+00 -9.04286790D-05 1.00000000D+00 -1.42273973D-04 1.00000000D+00 -7.39766378D-03 1.00000000D+00 -8.19738582D-03 1.00000000D+00 -2.08459608D-03 1.00000000D+00 -3.65354470D-03 1.00000000D+00 -4.88446048D-03 1.00000000D+00 -1.22504996D-03 1.00000000D+00 -4.36096154D-02 1.00000000D+00 -6.93262264D-04 1.00000000D+00 -1.65846641D-03 1.00000000D+00 -8.10870528D-03 1.00000000D+00 -3.22366226D-03 1.00000000D+00 -1.27204950D-03 1.00000000D+00 -1.30607868D-02 1.00000000D+00 -1.65249128D-03 1.00000000D+00 -1.77341502D-03 1.00000000D+00 -3.16500373D-04 1.00000000D+00 -2.04896391D-03 1.00000000D+00 -2.36979984D-02 1.00000000D+00 -1.35482708D-03 1.00000000D+00 -1.56581530D-03 1.00000000D+00 -5.38427010D-02 1.00000000D+00 -2.21645720D-02 1.00000000D+00 -1.42507151D-01 1.00000000D+00 -4.82241735D-02 1.00000000D+00 -1.79205015D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 -5.76346964D-02 1.00000000D+00 -3.17968652D-02 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.78465787D-02 1.00000000D+00 -5.69905678D-04 1.00000000D+00 -4.49396856D-03 1.00000000D+00 -5.19715795D-05 1.00000000D+00 -1.39432741D-05 1.00000000D+00 -3.59829981D-03 1.00000000D+00 -2.16023461D-03 1.00000000D+00 -2.96454262D-02 1.00000000D+00 -4.90016444D-03 1.00000000D+00 -1.30853141D-02 1.00000000D+00 -2.92256594D-01 1.00000000D+00 -4.58589569D-02 1.00000000D+00 -2.51878798D-02 1.00000000D+00 -7.07555935D-03 1.00000000D+00 -3.27899330D-03 1.00000000D+00 -6.71901256D-02 1.00000000D+00 -4.52964678D-02 1.00000000D+00 -1.56934559D-01 1.00000000D+00 -5.25400750D-02 1.00000000D+00 -8.18570703D-02 1.00000000D+00 -3.68810818D-02 1.00000000D+00 -1.44300938D-01 1.00000000D+00 -7.79947191D-02 1.00000000D+00 -2.54118741D-01 1.00000000D+00 -2.48348296D-01 1.00000000D+00 -2.14205191D-01 1.00000000D+00 -1.20531969D-01 1.00000000D+00 -4.81847942D-01 1.00000000D+00 -1.67683020D-01 1.00000000D+00 -2.87884384D-01 1.00000000D+00 -5.31182885D-01 1.00000000D+00 -3.48290294D-01 1.00000000D+00 -6.13069355D-01 1.00000000D+00 -2.59709395D-02 1.00000000D+00 -8.81912094D-03 1.00000000D+00 -1.31283581D-01 1.00000000D+00 -1.15888983D-01 1.00000000D+00 -1.19731724D-01 1.00000000D+00 -1.63664266D-01 1.00000000D+00 -1.43314779D-01 1.00000000D+00 -4.88956943D-02 1.00000000D+00 -1.82706028D-01 1.00000000D+00 -6.37331307D-02 1.00000000D+00 -1.64185643D-01 1.00000000D+00 -1.31180644D-01 1.00000000D+00 -1.37433782D-01 1.00000000D+00 -7.62486756D-02 1.00000000D+00 -6.59873635D-02 1.00000000D+00 -1.53722018D-01 1.00000000D+00 -1.00952752D-01 1.00000000D+00 -1.59418490D-02 1.00000000D+00 -1.75022557D-01 1.00000000D+00 -1.48241401D-01 1.00000000D+00 -2.95332223D-01 1.00000000D+00 -4.35067326D-01 1.00000000D+00 -2.99447656D-01 1.00000000D+00 -4.29889739D-01 1.00000000D+00 -9.46358740D-02 1.00000000D+00 -2.62589782D-01 1.00000000D+00 -1.57239005D-01 1.00000000D+00 -4.79257405D-02 1.00000000D+00 -6.81549832D-02 1.00000000D+00 -4.14365530D-02 1.00000000D+00 -3.13165896D-02 1.00000000D+00 -4.82902043D-02 1.00000000D+00 -3.12532112D-02 1.00000000D+00 -1.65843651D-01 1.00000000D+00 -3.94780114D-02 1.00000000D+00 -1.06069766D-01 1.00000000D+00 -1.06182404D-01 1.00000000D+00 -9.06958152D-03 1.00000000D+00 -3.50963511D-02 1.00000000D+00 -2.58430243D-02 1.00000000D+00 -2.21948341D-01 1.00000000D+00 -1.25001445D-01 1.00000000D+00 -1.15588143D-01 1.00000000D+00 -4.41402867D-02 1.00000000D+00 -1.17391003D-02 1.00000000D+00 -8.88309106D-02 1.00000000D+00 -1.09484315D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -3.03959493D-02 1.00000000D+00 -3.56015950D-01 1.00000000D+00 1.00000000D+00 -2.09159389D-01 1.00000000D+00 1.00000000D+00 -8.19865763D-01 1.00000000D+00 -6.45634174D-01 1.00000000D+00 -6.39332294D-01 1.00000000D+00 -9.97142851D-01 1.00000000D+00 -5.00000000D-01 1.00000000D+00 1.00000000D+00 -2.51026601D-01 1.00000000D+00 -5.73770761D-01 1.00000000D+00 -9.99197245D-01 1.00000000D+00 -6.12838604D-02 1.00000000D+00 -9.79579866D-01 1.00000000D+00 -9.41222906D-01 1.00000000D+00 -9.82795656D-01 1.00000000D+00 -9.99544799D-01 1.00000000D+00 -9.98440027D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 -6.87208250D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -9.37243104D-01 1.00000000D+00 -3.05369467D-01 1.00000000D+00 -2.44393930D-01 1.00000000D+00 -5.99167570D-02 1.00000000D+00 -4.09031749D-01 1.00000000D+00 -6.54813766D-01 1.00000000D+00 -7.75436103D-01 1.00000000D+00 -5.67775071D-02 1.00000000D+00 -3.49151224D-01 1.00000000D+00 -1.00001134D-01 1.00000000D+00 -6.01657480D-02 1.00000000D+00 -7.82141462D-02 1.00000000D+00 -8.72963190D-01 1.00000000D+00 -7.58721083D-02 1.00000000D+00 -6.22733496D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 -7.42725551D-01 1.00000000D+00 -7.90000021D-01 1.00000000D+00 1.00000000D+00 -6.62945509D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -3.22186440D-01 1.00000000D+00 -7.28480697D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -9.55293119D-01 1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -9.96945620D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 -6.56015933D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -8.67891490D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -7.96854556D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -8.03196490D-01 1.00000000D+00 1.00000000D+00 -2.34577850D-01 1.00000000D+00 -1.01583153D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -9.88406897D-01 1.00000000D+00 -6.10173583D-01 1.00000000D+00 -9.84829903D-01 1.00000000D+00 -1.45812437D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -9.35439289D-01 1.00000000D+00 -6.79107606D-01 1.00000000D+00 -2.54835814D-01 1.00000000D+00 1.00000000D+00 -5.69056511D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -9.26579297D-01 1.00000000D+00 -3.86048704D-02 1.00000000D+00 -4.91169512D-01 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 5.00000007D-02 -2.69156814D-01 -4.65328991D-03 -6.22985372D-03 -3.80239636D-02 5.00000007D-02 -4.66260761D-01 -1.84849033D-03 -2.47492688D-03 -1.51058435D-02 5.60000002D-01 -7.63145924D-01 -1.06123865D-01 -9.68712196D-03 -2.16793314D-01 2.39999995D-01 -8.15083683D-01 -1.05610844D-02 -1.41391223D-02 -8.62984210D-02 5.00000007D-02 -3.95800620D-01 -1.64448307D-03 -2.20156088D-03 -1.34372637D-02 5.00000007D-02 -5.11013329D-01 -1.36712939D-03 -1.83034141D-03 -1.11717703D-02 5.00000007D-02 -9.59510028D-01 -2.95934808D-02 -3.96195129D-02 -2.41819128D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -2.76298150D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -3.40405246D-03 1.00000000D+00 1.00000000D+00 -7.99549520D-02 1.00000000D+00 -3.64257284D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -6.36040792D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.25452146D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.37514537D-02 1.00000000D+00 -2.57521961D-03 1.00000000D+00 1.00000000D+00 -1.06875168D-03 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -6.60542548D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.25644520D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -7.15435967D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -2.12379946D-05 1.00000000D+00 -1.38877379D-03 1.00000000D+00 -1.69529160D-03 1.00000000D+00 -1.30305747D-02 1.00000000D+00 -7.15932772D-02 1.00000000D+00 1.00000000D+00 -1.56391002D-02 1.00000000D+00 -1.96913686D-02 1.00000000D+00 -4.65031248D-04 1.00000000D+00 -6.46045059D-02 1.00000000D+00 -1.41096707D-05 1.00000000D+00 -2.13194918D-02 1.00000000D+00 -4.82018702D-02 1.00000000D+00 -1.17546050D-02 1.00000000D+00 -7.12832334D-05 1.00000000D+00 -2.90225632D-03 1.00000000D+00 -4.32887627D-03 1.00000000D+00 -1.61347762D-02 1.00000000D+00 -3.65646253D-03 1.00000000D+00 -1.12061657D-03 1.00000000D+00 -1.28508243D-03 1.00000000D+00 -7.21944845D-04 1.00000000D+00 -3.12227919D-03 1.00000000D+00 -4.79361363D-04 1.00000000D+00 -3.76875186D-03 1.00000000D+00 -9.84223001D-03 1.00000000D+00 -1.19829318D-03 1.00000000D+00 -8.72301025D-05 1.00000000D+00 -2.48197932D-03 1.00000000D+00 -2.69700470D-03 1.00000000D+00 -2.04223525D-02 1.00000000D+00 -1.21343024D-01 1.00000000D+00 -1.30022084D-02 1.00000000D+00 -6.75853249D-03 1.00000000D+00 -1.29593657D-02 1.00000000D+00 -4.72033173D-02 1.00000000D+00 -2.85191718D-03 1.00000000D+00 -5.33207394D-02 1.00000000D+00 -2.06797067D-02 1.00000000D+00 -9.44649801D-03 1.00000000D+00 1.00000000D+00 -3.70004075D-03 1.00000000D+00 -5.03387488D-02 1.00000000D+00 -2.59307083D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -2.88725168D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 -5.48067629D-01 -7.43604545D-03 -4.82097548D-03 -1.31497085D-01 -2.47637033D-01 -2.29462353D-03 -1.01192757D-01 -2.62266193D-02 1.00000000D+00 -2.13327646D-01 -3.71461594D-03 -3.46439029D-03 -1.28691241D-01 -3.02950412D-01 -8.93040746D-03 -2.01682709D-02 1.00000000D+00 -8.31404980D-03 -2.52504105D-04 -1.63707315D-04 -3.93955124D-04 -6.25510290D-02 -1.97172053D-02 1.00000000D+00 -1.00000000D+00 -4.02082577D-02 -9.67077792D-01 -9.97612417D-01 -5.00000529D-02 -4.88695642D-03 -2.11219513D-03 -7.39417732D-01 -1.46247000D-01 -1.00000000D+00 -2.85278380D-01 -2.53084838D-01 -4.69926745D-01 -1.97006494D-01 -3.99474278D-02 -5.00000007D-02 6.67069061D-03 -1.31836802D-01 -9.00000036D-02 2.20149979D-02 -2.42864177D-01 -5.00000007D-02 4.05550972D-02 -1.81239873D-01 -9.00000036D-02 3.02646551D-02 -9.38324183D-02 -7.00000003D-02 1.56687703D-02 -1.79161012D-01 -7.00000003D-02 2.99175121D-02 -6.24370202D-02 -7.00000003D-02 1.04261544D-02 -6.86812699D-02 -7.00000003D-02 1.14688613D-02 -6.83486238D-02 -1.29999995D-01 8.17558262D-03 -5.05733937D-02 -7.99999982D-02 6.04938250D-03 -3.38348635D-02 -1.00000001D-01 4.04718798D-03 -4.25351672D-02 -7.99999982D-02 5.08788275D-03 -1.93547402D-02 -1.09999999D-01 2.31513497D-03 -2.32370030D-02 -1.80000007D-01 2.77951523D-03 -9.78440326D-03 -1.40000001D-01 1.17037038D-03 -6.17706440D-02 -1.29999995D-01 7.38875149D-03 -7.21712539D-04 -1.29999995D-01 8.63283058D-05 -1.98470941D-03 -1.29999995D-01 2.37402841D-04 -2.72782869D-03 -1.29999995D-01 3.26291716D-04 -1.98165141D-03 -1.00000001D-01 2.37037035D-04 -7.97706377D-03 -1.40000001D-01 9.54183808D-04 -9.46483167D-04 -1.40000001D-01 1.13214446D-04 -1.12079515D-03 -1.29999995D-01 1.34064932D-04 -5.94709478D-02 -9.00000036D-02 7.11367186D-03 -2.49847099D-02 -1.09999999D-01 2.98856874D-03 -7.44204894D-02 -1.09999999D-01 8.90187453D-03 -1.95565750D-03 -1.50000006D-01 2.33927756D-04 -1.74281336D-02 -1.29999995D-01 2.08468223D-03 -1.33516816D-02 -1.40000001D-01 1.59707363D-03 -4.67324145D-02 -1.09999999D-01 5.58994059D-03 -6.00917451D-03 -1.40000001D-01 7.18792842D-04 -1.12645263D-02 -1.00000001D-01 1.34741655D-03 -1.53486235D-02 -1.19999997D-01 1.83593959D-03 -4.24143746D-02 -1.40000001D-01 5.07343374D-03 -1.16284406D-02 -7.99999982D-02 1.39094645D-03 -8.41406733D-02 -1.09999999D-01 1.00645637D-02 -1.31145254D-01 -2.00000003D-01 1.56870596D-02 -8.49541277D-03 -1.19999997D-01 1.01618655D-03 -3.09327221D-03 -5.99999987D-02 3.70004564D-04 -7.79969431D-03 -1.50000006D-01 9.32967523D-04 -7.35229328D-02 -1.19999997D-01 8.79451260D-03 -3.98944952D-02 -1.29999995D-01 4.77201631D-03 -1.77741945D-02 -2.00000003D-01 1.00777317D-04 -9.82225835D-01 -2.00000003D-01 5.56909014D-03 -7.99999982D-02 -1.59999996D-01 1.00000000D+00 -3.60000014D-01 -1.09999999D-01 1.00000000D+00 -7.99999982D-02 -2.00000003D-01 1.00000000D+00 -2.39999995D-01 -1.50000006D-01 1.00000000D+00 -2.39999995D-01 -1.50000006D-01 1.00000000D+00 -1.59999996D-01 1.00000000D+00 -1.19999997D-01 1.00000000D+00 -2.00000003D-01 -2.03827190D+00 2.50722790D+00 2.50722790D+00 2.50722790D+00 2.50722790D+00 2.50722790D+00 2.50722790D+00 5.74199595D-02 8.89650881D-01 8.89650881D-01 -6.84651732D-01 7.57262707D-01 7.57262707D-01 7.57262707D-01 7.57262707D-01 7.57262707D-01 7.57262707D-01 1.71273291D-01 7.57262707D-01 2.98174381D-01 -1.73215106D-01 -1.73215106D-01 -1.73215106D-01 -1.73215106D-01 -1.73215106D-01 -1.73215106D-01 -1.73215106D-01 6.30014949D-03 9.76129770D-02 9.76129770D-02 -7.40123630D-01 7.12008893D-01 2.81816572D-01 7.12008893D-01 7.12008893D-01 7.12008893D-01 7.12008893D-01 1.61038041D-01 7.12008893D-01 2.80355543D-01 -2.82574105D+00 1.02045894D+00 1.02045894D+00 1.02045894D+00 1.02045894D+00 3.05909496D-02 1.02045894D+00 1.67414490D-02 9.93608907D-02 9.93608907D-02 -3.01978122D-02 -3.01978122D-02 -3.01978122D-02 -3.01978122D-02 -3.01978122D-02 4.75290697D-03 -3.01978122D-02 2.60111387D-03 1.54376719D-02 1.54376719D-02 -1.69090942D-01 -1.69090942D-01 -1.69090942D-01 -1.69090942D-01 -1.69090942D-01 -1.69090942D-01 -1.69090942D-01 1.60707850D-02 9.53804851D-02 9.53804851D-02 -1.24394380D-01 -1.24394380D-01 -1.24394380D-01 -1.24394380D-01 -1.24394380D-01 9.98765975D-03 -1.24394380D-01 5.46592707D-03 3.24404053D-02 3.24404053D-02 -5.00000000D-01 -1.00000000D+00 1.10741682D-01 2.62503922D-01 1.54968342D-02 3.03868353D-01 5.55011146D-02 1.02592101D-02 7.57173747D-02 1.59322936D-02 -6.12610757D-01 -8.69999826D-01 8.81728047D-05 -4.99836445D-01 1.04071647D-02 -6.39951527D-02 -6.39951527D-02 -6.39951527D-02 -6.39951527D-02 -6.39951527D-02 -6.39951527D-02 2.38342502D-04 3.69282067D-03 3.69282067D-03 1.54453237D-02 -7.84192756D-02 -7.84192756D-02 -7.84192756D-02 -7.84192756D-02 -7.84192756D-02 -7.84192756D-02 2.84985313D-03 1.26002580D-02 4.96138772D-03 -8.80930871D-02 -8.80930871D-02 -8.80930871D-02 -8.80930871D-02 -8.80930871D-02 -8.80930871D-02 -8.80930871D-02 3.20410589D-03 4.96436357D-02 4.96436357D-02 6.06838651D-02 -2.36646697D-01 1.95946172D-02 -2.36646697D-01 -2.36646697D-01 -2.36646697D-01 -2.36646697D-01 1.11969244D-02 4.95057516D-02 1.94930322D-02 4.95642304D-01 -4.30728585D-01 -4.30728585D-01 -4.30728585D-01 -4.30728585D-01 1.48581862D-02 -4.30728585D-01 8.13141000D-03 4.82601114D-02 4.82601114D-02 -4.30944450D-02 -4.30944450D-02 -4.30944450D-02 -4.30944450D-02 -4.30944450D-02 6.78273896D-03 -4.30944450D-02 3.71197611D-03 2.20306665D-02 2.20306665D-02 -3.12564522D-02 -3.12564522D-02 -3.12564522D-02 -3.12564522D-02 -3.12564522D-02 -3.12564522D-02 -3.12564522D-02 2.97068362D-03 1.76310781D-02 1.76310781D-02 -6.25699833D-02 -6.25699833D-02 -6.25699833D-02 -6.25699833D-02 -6.25699833D-02 5.02376119D-03 -6.25699833D-02 2.74934387D-03 1.63174197D-02 1.63174197D-02 -5.00000000D-01 -1.00000000D+00 -9.31064598D-03 -3.82446544D-03 -1.13382936D-04 1.48005467D-02 1.14515871D-02 -2.79633701D-03 -7.22729228D-03 -1.07579976D-02 -1.06948726D-02 -8.69891703D-01 4.07628454D-02 -4.54577208D-01 6.21434972D-02 -3.82129312D-01 -3.82129312D-01 -3.82129312D-01 -3.82129312D-01 -3.82129312D-01 -3.82129312D-01 1.42319617D-03 2.20506545D-02 2.20506545D-02 6.42392877D-03 -3.26156914D-02 -3.26156914D-02 -3.26156914D-02 -3.26156914D-02 -3.26156914D-02 -3.26156914D-02 1.18529436D-03 5.24062570D-03 2.06351141D-03 -3.60557176D-02 -3.60557176D-02 -3.60557176D-02 -3.60557176D-02 -3.60557176D-02 -3.60557176D-02 -3.60557176D-02 1.31141208D-03 2.03187000D-02 2.03187000D-02 3.20153944D-02 2.61180811D-02 -5.10462344D-01 2.61180811D-02 2.61180811D-02 2.61180811D-02 2.61180811D-02 5.90723613D-03 2.61180811D-02 1.02840699D-02 1.30923346D-01 -1.13776460D-01 -1.13776460D-01 -1.13776460D-01 -1.13776460D-01 3.92477307D-03 -1.13776460D-01 2.14790273D-03 1.27478531D-02 1.27478531D-02 -2.76396852D-02 -2.76396852D-02 -2.76396852D-02 -2.76396852D-02 -2.76396852D-02 4.35027713D-03 -2.76396852D-02 2.38076760D-03 1.41299125D-02 1.41299125D-02 -1.43900374D-02 -1.43900374D-02 -1.43900374D-02 -1.43900374D-02 -1.43900374D-02 -1.43900374D-02 -1.43900374D-02 1.36766164D-03 8.11710395D-03 8.11710395D-03 -3.48886102D-02 -3.48886102D-02 -3.48886102D-02 -3.48886102D-02 -3.48886102D-02 2.80121644D-03 -3.48886102D-02 1.53301610D-03 9.09848697D-03 9.09848697D-03 -5.00000000D-01 -1.00000000D+00 -3.76588060D-03 -4.67685144D-03 -2.74560135D-03 2.82335691D-02 -5.28713875D-03 -3.31864133D-03 -9.25511029D-03 -9.26723704D-03 -3.04701719D-02 -8.70137990D-01 6.51841611D-02 -4.23311949D-01 5.24101779D-04 -3.22277728D-03 -3.22277728D-03 -3.22277728D-03 -3.22277728D-03 -3.22277728D-03 -3.22277728D-03 1.20028599D-05 1.85969388D-04 1.85969388D-04 1.31599407D-03 -6.68158941D-03 -6.68158941D-03 -6.68158941D-03 -6.68158941D-03 -6.68158941D-03 -6.68158941D-03 2.42817172D-04 1.07358478D-03 4.22727084D-04 -8.56701881D-02 -8.56701881D-02 -8.56701881D-02 -8.56701881D-02 -8.56701881D-02 -8.56701881D-02 -8.56701881D-02 3.11598089D-03 4.82782498D-02 4.82782498D-02 2.49884813D-03 -9.74466838D-03 8.06869706D-04 -9.74466838D-03 -9.74466838D-03 -9.74466838D-03 -9.74466838D-03 4.61068412D-04 2.03855429D-03 8.02686671D-04 2.45963693D-01 -2.13750109D-01 -2.13750109D-01 -2.13750109D-01 -2.13750109D-01 7.37341121D-03 -2.13750109D-01 4.03523212D-03 2.39491984D-02 2.39491984D-02 -4.01567370D-02 -4.01567370D-02 -4.01567370D-02 -4.01567370D-02 -4.01567370D-02 6.32036664D-03 -4.01567370D-02 3.45893437D-03 2.05288567D-02 2.05288567D-02 -7.93116167D-03 -7.93116167D-03 -7.93116167D-03 -7.93116167D-03 -7.93116167D-03 -7.93116167D-03 -7.93116167D-03 7.53795495D-04 4.47379425D-03 4.47379425D-03 -2.18512505D-01 -2.18512505D-01 -2.18512505D-01 -2.18512505D-01 -2.18512505D-01 1.75444297D-02 -2.18512505D-01 9.60150547D-03 5.69851622D-02 5.69851622D-02 4.71892297D-01 -2.81077065D-02 -5.62154129D-02 -8.82008986D-04 -3.62094084D-04 7.52938213D-03 -6.91006426D-05 1.29995495D-02 1.31666847D-02 1.85310841D-03 2.87142098D-02 -2.20831167D-02 -5.38090281D-02 -8.70029628D-01 1.52490258D-01 -9.62755829D-02 -1.12710521D-04 4.49230138D-04 -2.76238052D-03 -2.76238052D-03 -2.76238052D-03 -2.76238052D-03 -2.76238052D-03 -2.76238052D-03 1.02881659D-05 1.59402334D-04 1.59402334D-04 1.94844441D-03 -9.89267789D-03 -9.89267789D-03 -9.89267789D-03 -9.89267789D-03 -9.89267789D-03 -9.89267789D-03 3.59512109D-04 1.58953632D-03 6.25884510D-04 -2.67490625D-01 -2.67490625D-01 -2.67490625D-01 -2.67490625D-01 -2.67490625D-01 -2.67490625D-01 -2.67490625D-01 9.72912088D-03 1.50740623D-01 1.50740623D-01 2.71101436D-03 -1.05720451D-02 8.75377445D-04 -1.05720451D-02 -1.05720451D-02 -1.05720451D-02 -1.05720451D-02 5.00215683D-04 2.21163896D-03 8.70839227D-04 6.27855837D-01 -5.45626283D-01 -5.45626283D-01 -5.45626283D-01 -5.45626283D-01 1.88216381D-02 -5.45626283D-01 1.03004798D-02 6.11335933D-02 6.11335933D-02 -1.88998535D-01 -1.88998535D-01 -1.88998535D-01 -1.88998535D-01 -1.88998535D-01 2.97469385D-02 -1.88998535D-01 1.62795484D-02 9.66195017D-02 9.66195017D-02 -3.90729122D-02 -3.90729122D-02 -3.90729122D-02 -3.90729122D-02 -3.90729122D-02 -3.90729122D-02 -3.90729122D-02 3.71357752D-03 2.20401697D-02 2.20401697D-02 -3.93182158D-01 -3.93182158D-01 -3.93182158D-01 -3.93182158D-01 -3.93182158D-01 3.15687060D-02 -3.93182158D-01 1.72765423D-02 1.02536693D-01 1.02536693D-01 1.67131245D+00 -3.28687608D-01 -1.64343804D-01 2.97306397D-05 8.07423727D-04 2.75007710D-02 1.33185962D-03 3.93917151D-02 7.23160058D-02 2.04517543D-02 5.90625890D-02 -1.28545640D-02 -4.63634431D-02 -8.70002031D-01 4.37857695D-02 -1.76200569D-02 -4.21766937D-03 4.55968589D-01 -2.80381632D+00 -2.80381632D+00 -2.80381632D+00 -2.80381632D+00 -2.80381632D+00 -2.80381632D+00 1.04424879D-02 1.61793381D-01 1.61793381D-01 1.57031372D-01 -7.97282577D-01 -7.97282577D-01 -7.97282577D-01 -7.97282577D-01 -7.97282577D-01 -7.97282577D-01 2.89742295D-02 1.28105819D-01 5.04420325D-02 -9.07425106D-01 -9.07425106D-01 -9.07425106D-01 -9.07425106D-01 -9.07425106D-01 -9.07425106D-01 -9.07425106D-01 3.30047049D-02 5.11366904D-01 5.11366904D-01 1.58726871D-01 -6.18981421D-01 5.12523726D-02 -6.18981421D-01 -6.18981421D-01 -6.18981421D-01 -6.18981421D-01 2.92870700D-02 1.29488990D-01 5.09866662D-02 7.75558501D-02 7.75558501D-02 7.75558501D-02 7.75558501D-02 7.75558501D-02 -1.12975061D-01 7.75558501D-02 1.27236603D-03 7.55152293D-03 7.55152293D-03 8.05267543D-02 8.05267543D-02 8.05267543D-02 8.05267543D-02 8.05267543D-02 -1.12885997D-01 8.05267543D-02 1.32110610D-03 7.84079637D-03 7.84079637D-03 -9.94591713D-02 -9.94591713D-02 -9.94591713D-02 -9.94591713D-02 -9.94591713D-02 -9.94591713D-02 -9.94591713D-02 9.45282448D-03 5.61027341D-02 5.61027341D-02 1.14812307D-01 1.14812307D-01 1.14812307D-01 1.14812307D-01 1.14812307D-01 -1.11858197D-01 1.14812307D-01 1.88358827D-03 1.11791408D-02 1.11791408D-02 -2.00000000D+00 -1.00000000D+00 -1.11589003D-02 -6.79647923D-03 1.94025785D-03 -4.64311987D-03 1.36367977D-03 4.70969081D-03 -1.26966089D-03 7.61918724D-03 -1.00000000D+00 1.06317788D-01 -6.53763413D-01 -6.53763413D-01 -6.53763413D-01 -6.53763413D-01 -6.53763413D-01 -6.53763413D-01 2.43486557D-03 3.77252176D-02 3.77252176D-02 4.11161855D-02 -2.08755851D-01 -2.08755851D-01 -2.08755851D-01 -2.08755851D-01 -2.08755851D-01 -2.08755851D-01 7.58644473D-03 3.35424840D-02 1.32074496D-02 -1.98312685D-01 -1.98312685D-01 -1.98312685D-01 -1.98312685D-01 -1.98312685D-01 -1.98312685D-01 -1.98312685D-01 7.21299369D-03 1.11756369D-01 1.11756369D-01 5.44188842D-02 -2.12215364D-01 1.75716747D-02 -2.12215364D-01 -2.12215364D-01 -2.12215364D-01 -2.12215364D-01 1.00409575D-02 4.43947949D-02 1.74805783D-02 5.57472408D-01 -4.84460890D-01 -4.84460890D-01 -4.84460890D-01 -4.84460890D-01 1.67117082D-02 -4.84460890D-01 9.14578326D-03 5.42804413D-02 5.42804413D-02 -2.85272539D-01 -2.85272539D-01 -2.85272539D-01 -2.85272539D-01 -2.85272539D-01 4.48997393D-02 -2.85272539D-01 2.45721899D-02 1.45836532D-01 1.45836532D-01 -2.04982370D-01 -2.04982370D-01 -2.04982370D-01 -2.04982370D-01 -2.04982370D-01 -2.04982370D-01 -2.04982370D-01 1.94819868D-02 1.15626052D-01 1.15626052D-01 -2.12087378D-01 -2.12087378D-01 -2.12087378D-01 -2.12087378D-01 -2.12087378D-01 1.70285534D-02 -2.12087378D-01 9.31918249D-03 5.53095713D-02 5.53095713D-02 1.46780527D+00 -5.32194793D-01 -2.66097397D-01 6.53083064D-03 1.70512833D-02 2.03899294D-02 2.67378725D-02 3.49783003D-02 1.09160982D-01 1.07301265D-01 3.18611152D-02 -5.97859584D-02 -3.35545868D-01 -2.65876949D-01 -1.57820597D-01 -8.70056510D-01 4.26713973D-02 -7.06640184D-02 -3.78513522D-03 1.96210727D-01 1.96210727D-01 1.96210727D-01 1.96210727D-01 1.96210727D-01 1.96210727D-01 1.96210727D-01 -9.96064246D-02 6.96223304D-02 6.96223304D-02 1.89191252D-01 1.54341772D-01 1.54341772D-01 1.54341772D-01 1.54341772D-01 1.54341772D-01 1.54341772D-01 -2.62691885D-01 1.54341772D-01 6.07725158D-02 1.69322357D-01 1.69322357D-01 1.69322357D-01 1.69322357D-01 1.69322357D-01 1.69322357D-01 1.69322357D-01 -1.00222215D-01 6.00814112D-02 6.00814112D-02 7.46707991D-02 6.09162562D-02 2.41109487D-02 6.09162562D-02 6.09162562D-02 6.09162562D-02 6.09162562D-02 -2.83822298D-01 6.09162562D-02 2.39859503D-02 4.64772396D-02 4.64772396D-02 4.64772396D-02 4.64772396D-02 4.64772396D-02 1.39327801D-03 4.64772396D-02 -6.23375066D-02 4.52543469D-03 4.52543469D-03 3.17638852D-02 3.17638852D-02 3.17638852D-02 3.17638852D-02 3.17638852D-02 9.52206377D-04 3.17638852D-02 -6.25788867D-02 3.09281261D-03 3.09281261D-03 2.72320695D-02 2.72320695D-02 2.72320695D-02 2.72320695D-02 2.72320695D-02 2.72320695D-02 2.72320695D-02 -6.26532361D-02 2.65155477D-03 2.65155477D-03 1.45535357D-02 1.45535357D-02 1.45535357D-02 1.45535357D-02 1.45535357D-02 4.36280679D-04 1.45535357D-02 -6.28612414D-02 1.41706085D-03 1.41706085D-03 -5.00000000D-01 -1.00000000D+00 5.67007899D-01 3.68021756D-01 5.04498124D-01 1.71694726D-01 1.87478885D-01 1.48706645D-01 1.58462361D-01 5.24044745D-02 -1.57417119D-01 -2.47411415D-01 -1.41924486D-01 -8.90000045D-01 2.39348169D-02 -3.44784945D-01 2.74278283D-01 2.74278283D-01 2.74278283D-01 2.74278283D-01 2.74278283D-01 2.74278283D-01 2.74278283D-01 6.28145831D-03 -2.69419193D-01 -2.69419193D-01 1.52858287D-01 1.24701418D-01 1.24701418D-01 1.24701418D-01 1.24701418D-01 1.24701418D-01 1.24701418D-01 2.82042436D-02 -1.19109857D+00 4.91015427D-02 4.98320878D-01 4.98320878D-01 4.98320878D-01 4.98320878D-01 4.98320878D-01 4.98320878D-01 4.98320878D-01 1.14124306D-02 -3.29651117D-01 -3.29651117D-01 2.46326566D-01 2.00952619D-01 7.95380175D-02 2.00952619D-01 2.00952619D-01 2.00952619D-01 2.00952619D-01 4.54503000D-02 -1.11484730D+00 7.91256726D-02 3.50749463D-01 3.50749463D-01 3.50749463D-01 3.50749463D-01 3.50749463D-01 1.05146412D-02 3.50749463D-01 5.75432694D-03 -3.40347946D-01 3.41520645D-02 2.85520315D-01 2.85520315D-01 2.85520315D-01 2.85520315D-01 2.85520315D-01 8.55922513D-03 2.85520315D-01 4.68419027D-03 -3.46699238D-01 2.78007798D-02 2.37027302D-01 2.37027302D-01 2.37027302D-01 2.37027302D-01 2.37027302D-01 2.37027302D-01 2.37027302D-01 3.88862356D-03 -3.51420939D-01 2.30790731D-02 3.56762469D-01 3.56762469D-01 3.56762469D-01 3.56762469D-01 3.56762469D-01 1.06948968D-02 3.56762469D-01 5.85297495D-03 -3.39762479D-01 3.47375460D-02 7.39657879D-03 -1.99260342D+00 -9.96301711D-01 5.11565208D-02 6.72518909D-02 9.58291367D-02 1.28103361D-01 2.38389209D-01 2.25222245D-01 2.32392117D-01 2.16449484D-01 -1.55363604D-02 -2.75162965D-01 -6.60882518D-02 -1.02282472D-01 -1.53743282D-01 -8.90000701D-01 -4.75550555D-02 9.31972265D-01 9.31972265D-01 9.31972265D-01 9.31972265D-01 9.31972265D-01 9.31972265D-01 9.31972265D-01 2.13438161D-02 -9.15461600D-01 -9.15461600D-01 1.19320869D-01 9.73416790D-02 9.73416790D-02 9.73416790D-02 9.73416790D-02 9.73416790D-02 9.73416790D-02 2.20161770D-02 9.73416790D-02 -4.79771465D-01 1.08861959D+00 1.08861959D+00 1.08861959D+00 1.08861959D+00 1.08861959D+00 1.08861959D+00 1.08861959D+00 2.49313172D-02 -7.20147789D-01 -7.20147789D-01 1.08071260D-01 8.81642774D-02 3.48958485D-02 8.81642774D-02 8.81642774D-02 8.81642774D-02 8.81642774D-02 1.99404843D-02 8.81642774D-02 -4.83385086D-01 2.93100953D-01 2.93100953D-01 2.93100953D-01 2.93100953D-01 2.93100953D-01 8.78647529D-03 2.93100953D-01 4.80855675D-03 2.85388995D-02 -3.45961124D-01 2.17549220D-01 2.17549220D-01 2.17549220D-01 2.17549220D-01 2.17549220D-01 6.52161241D-03 2.17549220D-01 3.56906978D-03 2.11825129D-02 -3.53317499D-01 3.01923811D-01 3.01923811D-01 3.01923811D-01 3.01923811D-01 3.01923811D-01 3.01923811D-01 3.01923811D-01 4.95330291D-03 2.93979701D-02 -3.45102042D-01 5.59506476D-01 5.59506476D-01 5.59506476D-01 5.59506476D-01 5.59506476D-01 1.67726837D-02 5.59506476D-01 9.17915348D-03 5.44784926D-02 -3.20021540D-01 6.95431352D-01 -1.30456865D+00 -6.52284324D-01 1.73825145D-01 1.33323938D-01 2.09345996D-01 1.42736718D-01 1.99208006D-01 1.71605751D-01 2.96019554D-01 3.39455217D-01 -2.33187303D-01 -1.43305426D-02 -3.65852825D-02 -3.50010514D-01 -3.68325382D-01 -8.90000045D-01 -4.76517156D-02 4.57370246D-04 -2.09954262D+00 -9.99782205D-01 -1.07030303D-03 -1.93744991D-03 -1.54613005D-03 -2.59090355D-03 -3.22100311D-03 -3.45216854D-03 -4.05561412D-03 -3.55400215D-03 1.00000000D+00 -9.07458216D-02 -1.16984315D-01 -1.33410409D-01 -8.70000362D-01 -2.90658250D-02 9.00660157D-01 -1.19933975D+00 -5.71114182D-01 1.00000000D+00 -8.70074153D-01 -2.14263145D-02 2.60216546D+00 -2.97834694D-01 -1.02701619D-01 1.00000000D+00 -1.92899816D-02 -8.69974673D-01 3.76543887D-02 -8.59325007D-03 -2.32234877D-03 -2.00000000D+00 -1.00000000D+00 -5.97090367D-03 -3.10818246D-03 -3.80347972D-03 -1.39464473D-03 -1.42943056D-03 -1.11747673D-03 -1.24684128D-03 -3.89749010D-04 -1.62022635D-01 1.00000000D+00 -3.91151533D-02 -1.34885684D-01 -1.17574222D-01 -2.08823266D-03 -1.33590531D-02 -3.53096239D-02 -8.69999945D-01 4.84563895D-02 -4.03310657D-01 -1.39999998D+00 -1.00000000D+00 1.00000000D+00 -2.96438169D-02 -8.69649827D-01 1.07462266D-02 -1.38558960D+00 -9.52560804D-04 1.24517657D-01 -1.07548237D+00 -8.96235287D-01 -9.75699630D-03 1.00000000D+00 -8.69999290D-01 -7.12292502D-03 7.48468280D-01 -1.25153172D+00 -6.25765860D-01 1.00000000D+00 -8.69565189D-01 -5.48300613D-03 1.67540276D+00 -3.24597210D-01 -1.62298605D-01 -5.64882183D-04 -5.86885144D-04 -3.88702523D-04 -6.18933933D-04 -6.81592501D-04 -7.42134813D-04 -4.25319507D-04 -7.78341491D-04 1.00000000D+00 -3.24237466D-01 -8.06020573D-03 -6.01767702D-03 -4.23720069D-02 -1.60365067D-02 -8.70012224D-01 4.07752655D-02 -1.11877225D-01 -1.04968902D-03 6.68755710D-01 -5.31244338D-01 -4.42703605D-01 1.00000000D+00 -8.70578110D-01 -1.33256649D-03 6.27053499D-01 -1.37294650D+00 -6.86473250D-01 1.00000000D+00 -8.69837284D-01 -9.19193670D-04 1.86955050D-01 -1.01304495D+00 -8.44204128D-01 1.00000000D+00 -8.69710445D-01 -2.45653326D-03 7.21822023D-01 -1.27817798D+00 -6.39088988D-01 1.00000000D+00 -8.88888896D-01 -4.83603566D-04 1.05930507D-01 -3.94069493D-01 -7.88138986D-01 1.00000000D+00 -8.70722413D-01 -4.03519627D-03 -5.00000000D-01 -1.00000000D+00 1.00000000D+00 -1.44721544D-03 -1.00000000D+00 2.69034058D-01 -2.30965927D-01 1.20000005D+00 1.00000000D+00 -6.98827021D-03 -4.22448991D-03 -8.70033681D-01 1.82339847D-02 -6.98937196D-03 1.51235133D-01 -3.48764867D-01 -6.97529733D-01 1.00000000D+00 -2.95740426D-01 -1.60700306D-01 -1.32129028D-01 -5.11926599D-03 -8.70001733D-01 7.98794478D-02 -2.72300512D-01 -9.32077994D-04 -5.00000000D-01 -1.00000000D+00 1.00000000D+00 -1.44242674D-01 -8.69969308D-01 4.20977129D-03 -1.25440717D-01 -5.00000000D-01 -1.00000000D+00 1.00000000D+00 -3.19625288D-02 -8.68035197D-01 -1.29999995D+00 -1.00000000D+00 1.00000000D+00 -5.91685250D-02 -1.59905537D-03 -8.69984448D-01 1.75757363D-01 -1.11488414D+00 2.00484842D-01 -1.69951510D+00 -8.94481659D-01 1.00000000D+00 -8.69993567D-01 -1.05654960D-02 1.61500096D+00 -3.84999037D-01 -1.92499518D-01 -1.03561732D-03 -8.33546976D-04 -7.43498676D-04 -8.00973328D-04 -7.52254389D-04 -7.40913558D-04 -7.75766151D-04 -7.33237015D-04 -4.31161869D-04 -4.00092453D-03 -9.04091913D-03 -4.43976279D-03 -4.15170519D-03 -4.05931100D-03 -3.40312958D-01 9.96429563D-01 -3.20973806D-03 -3.86491860D-03 -3.95374373D-03 -5.08075068D-03 -1.20204582D-03 -8.69974256D-01 2.71766007D-01 -1.29452288D-01 -1.27621123D-03 2.23066592D+00 -1.16933417D+00 -3.43921810D-01 -1.85023677D-02 -1.48349488D-02 -1.32394843D-02 -1.42659442D-02 -1.33985188D-02 -1.31980311D-02 -1.38182044D-02 -1.30513879D-02 -3.55932601D-02 -5.53016691D-03 -1.12575263D-01 -4.02331427D-02 -1.26768902D-01 -3.23383622D-02 -1.40888244D-02 -1.03382498D-01 -6.01734221D-02 -1.15011364D-01 -6.96121082D-02 -5.99461142D-04 8.06271911D-01 -1.01612881D-01 -4.95907036D-04 -2.17979099D-03 -3.63733061D-02 -2.40057558D-02 -1.58976257D-01 -5.14993165D-03 -6.66899681D-02 -7.21485987D-02 -8.13447908D-02 -7.39258807D-03 -2.08374932D-02 -8.69999588D-01 2.35442594D-02 -4.97347564D-02 -2.55885925D-02 2.04773259D+00 -3.52267474D-01 -1.46778107D-01 -1.61040970D-03 -1.65919599D-03 -1.09910860D-03 -1.74943579D-03 -1.92774378D-03 -2.09857640D-03 -1.20108563D-03 -2.20202422D-03 -6.64001377D-03 -1.42286755D-02 9.77918148D-01 -4.70131030D-03 -6.87512336D-04 -3.48676136D-03 -8.70021164D-01 6.68438077D-01 -2.79838085D-01 -1.36331830D-04 2.33849168D-01 -2.66150832D-01 -5.32301664D-01 1.00000000D+00 -8.70003164D-01 -3.26989894D-03 2.91807085D-01 -8.08192909D-01 -7.34720826D-01 -3.13579403D-02 9.14857388D-01 -1.21057041D-01 -3.46712917D-02 -8.69999170D-01 -1.72352381D-02 1.14481020D+00 -8.55189800D-01 -4.27594900D-01 -4.18436378D-02 -9.39895660D-02 -6.50645867D-02 -4.93461937D-02 -4.62170057D-02 1.00000000D+00 -4.83944751D-02 -8.69988739D-01 5.37051633D-02 -4.83965762D-02 -1.48378145D-02 1.42642903D+00 -5.73570967D-01 -2.86785483D-01 -2.57495135D-01 -6.34217123D-03 1.00000000D+00 -1.03614554D-02 -8.70010138D-01 -3.37993901D-04 4.85329628D-01 -1.51467037D+00 -7.57335186D-01 -1.51637703D-01 -1.72124177D-01 -3.18911761D-01 -4.52379622D-02 -4.50736023D-02 -3.83139811D-02 -2.15203106D-01 7.94479668D-01 -1.68030038D-02 -5.20322053D-03 -8.45131576D-02 -8.70004654D-01 2.90093929D-01 -6.60795033D-01 -1.66454222D-02 -5.00000000D-01 -1.00000000D+00 -3.66790360D-03 -1.06854446D-03 -8.41675978D-03 -8.81052285D-04 -1.08826561D-02 -3.09364079D-03 -5.81978704D-04 -1.25210162D-03 -6.27377944D-04 -1.90549623D-03 -4.55192028D-04 -4.03084466D-03 -5.01968898D-03 -3.67323461D-04 -6.59003854D-03 -3.65600252D-04 -9.89085878D-04 -4.27527772D-03 -8.09862686D-05 -4.04128386D-03 -1.08135282D-03 -3.92236834D-04 -1.48049882D-03 -4.32409951D-03 -6.57516345D-03 9.99062061D-01 -3.75950173D-03 -4.98532085D-03 -1.80093071D-03 -2.25895038D-03 -5.07186539D-03 -1.40905408D-02 -5.41200675D-02 -8.70759308D-01 2.29801148D-01 -2.15929925D-01 -7.27965671D-04 1.27107942D+00 -1.28920481D-01 -9.20860618D-02 -2.01665331D-03 -8.92450362D-02 -4.87057231D-02 -8.49580914D-02 7.97954261D-01 -1.26410509D-02 -7.52177229D-03 -1.20873482D-03 -8.69994819D-01 1.69435248D-01 -1.62539542D-01 -2.41443879D-04 -2.00000000D+00 -1.00000000D+00 -1.72134973D-02 7.40929484D-01 -1.00000000D+00 -3.88732915D-05 3.33289057D-01 -9.66710925D-01 -7.43623793D-01 -4.55313362D-02 9.59176183D-01 -1.86752286D-02 -8.70153308D-01 1.95702668D-02 -6.02502711D-02 -4.37467685D-03 8.34249258D-02 -4.16575074D-01 -8.33150148D-01 -1.81939617D-01 -3.38542223D-01 -3.96428585D-01 -1.88573435D-01 -1.47568300D-01 -1.13464832D-01 -1.24057271D-02 -6.68724552D-02 -1.99355744D-02 -7.83251971D-03 5.87145507D-01 -2.02887654D-02 -1.17915452D-01 -7.41321817D-02 -2.36270837D-02 -8.69995236D-01 7.48817250D-02 -1.90253779D-01 -3.81938345D-03 1.04966235D+00 -1.50337696D-01 -1.25281408D-01 -7.97772198D-04 -8.20181100D-04 -5.43315487D-04 -8.64872884D-04 -9.53199051D-04 -1.03727891D-03 -5.93783450D-04 -1.08829024D-03 -2.66206125D-03 -2.22796991D-01 -1.24763541D-01 -8.23399574D-02 -2.43991031D-03 -1.05415531D-01 -5.18004317D-03 -2.26804917D-03 -4.08953428D-03 -2.41064783D-02 -2.66595520D-02 -3.64078544D-02 -1.37097631D-02 -1.21616852D-03 -1.53590724D-01 -1.81663513D-01 -1.38760403D-01 -8.87066359D-04 1.00000000D+00 -3.37022962D-03 -1.35791150D-03 -1.68195146D-03 -8.69997799D-01 3.93045694D-02 -4.44007665D-02 -7.38454866D-04 -2.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.61861870D-02 -8.67007475D-04 -1.00000000D+00 -5.00000000D-01 -1.00000000D+00 -5.30493185D-02 -1.38881821D-02 -2.16033772D-01 -2.95067728D-01 -7.87093677D-03 1.00000000D+00 -8.70000243D-01 -2.00000000D+00 -1.00000000D+00 -8.52278376D-04 -8.45697825D-04 -5.70983102D-04 -8.96822661D-04 -9.94418398D-04 -1.07432459D-03 -6.58257341D-04 -1.12529914D-03 -3.47715081D-03 -1.77065760D-03 -2.27015419D-03 -3.08119413D-03 -3.78716434D-03 -3.86095257D-03 -2.71422835D-03 -2.12809048D-03 -2.44879792D-03 -2.64982809D-03 -2.20288569D-03 -1.82076811D-03 -4.05994570D-03 -2.67857150D-03 -3.63652292D-03 -2.55754474D-03 -2.32522679D-03 -8.87275673D-04 -2.17509014D-03 -2.53010611D-03 -2.58888165D-03 -2.19188794D-03 -3.27900588D-03 -2.66205659D-03 -2.19861837D-03 -1.94378418D-03 -2.34935014D-03 -3.08026723D-03 -3.49826226D-03 -3.59485205D-03 -9.41671722D-04 -4.55429452D-03 -3.34591372D-03 -2.36574560D-03 -3.96497606D-04 -2.96347367D-04 9.97949481D-01 -1.71580527D-03 -3.45474901D-03 -1.88774109D-04 -1.46566963D-04 -4.98844869D-03 -2.03209203D-02 -1.41712539D-02 -2.03225799D-02 -3.15105310D-03 -1.99997593D-02 -2.00722013D-02 -2.00752821D-02 -1.99858136D-02 -1.99983530D-02 -1.99913085D-02 -7.99998567D-02 -8.00038800D-02 -7.99991563D-02 -2.00005732D-02 -1.98985543D-02 -2.00221576D-02 -1.99998934D-02 -1.94552504D-02 -2.00004857D-02 -2.17391308D-02 -1.99947488D-02 -1.98446941D-02 -2.00250316D-02 -2.00445447D-02 -1.90114081D-02 -1.99775547D-02 -1.99930165D-02 -2.00082418D-02 -2.05278583D-02 -1.99066866D-02 -2.00088024D-02 -2.00148020D-02 -2.00016722D-02 -1.99828986D-02 -1.99990626D-02 -2.00033169D-02 -1.99887399D-02 -1.99961830D-02 -1.99976135D-02 -1.93861071D-02 -1.99948251D-02 -1.98376905D-02 -2.00031791D-02 -1.99988130D-02 -1.99998822D-02 -1.00000000D+00 -5.10172583D-02 -2.00000000D+00 -1.00000000D+00 -8.46332218D-03 -8.40655249D-03 -5.67755196D-03 -8.92104488D-03 -9.88750812D-03 -1.06834034D-02 -6.54513668D-03 -1.11905383D-02 -3.45831774D-02 -1.76194515D-02 -2.25829966D-02 -3.06469649D-02 -3.76394801D-02 -3.84055004D-02 -2.69967895D-02 -2.11716071D-02 -2.43058372D-02 -2.64700912D-02 -2.19627712D-02 -1.78093892D-02 -4.03337888D-02 -2.60714293D-02 -3.58832814D-02 -2.54394505D-02 -2.31361799D-02 -8.78402870D-03 -2.16305777D-02 -2.51667406D-02 -2.57373042D-02 -2.18023974D-02 -3.26811634D-02 -2.64655948D-02 -2.18711272D-02 -1.93342511D-02 -2.33593863D-02 -3.06346249D-02 -3.48275639D-02 -3.57152671D-02 -9.47211031D-03 -4.53286879D-02 -3.32781151D-02 -2.35274453D-02 -3.91541375D-03 -2.94704316D-03 -2.03939229D-02 9.82934237D-01 -3.43588740D-02 -1.87747960D-03 -1.45681656D-03 -2.41378937D-02 -5.41237667D-02 -5.42966351D-02 -5.41290306D-02 -5.59503818D-03 -1.10000402D-01 -1.10036097D-01 -1.09786704D-01 -1.09984562D-01 -1.09999612D-01 -1.09952196D-01 -3.00000962D-02 -2.99953986D-02 -3.00008152D-02 -1.09999068D-01 -1.10027306D-01 -1.10003166D-01 -1.10000178D-01 -1.10894933D-01 -1.10000238D-01 -1.08695649D-01 -1.09992996D-01 -1.09577231D-01 -1.10137671D-01 -1.10244997D-01 -1.11111112D-01 -1.10266164D-01 -1.09988779D-01 -1.10005237D-01 -1.10022433D-01 -1.11436948D-01 -1.10108867D-01 -1.09997630D-01 -1.10010929D-01 -1.09998740D-01 -1.09995946D-01 -1.09997772D-01 -1.09997511D-01 -1.10022523D-01 -1.09993681D-01 -1.09997720D-01 -1.09854601D-01 -1.10010341D-01 -1.10009015D-01 -1.10001586D-01 -1.10003375D-01 -1.09999895D-01 -1.00000000D+00 -2.22929522D-01 -2.00000000D+00 -1.00000000D+00 1.00000000D+00 -4.99400884D-01 -6.82299674D-01 -4.40645143D-02 -6.62580967D-01 -1.00000000D+00 -2.00000000D+00 -1.00000000D+00 -2.69557815D-03 -2.16041761D-03 -1.92859373D-03 -2.07822118D-03 -1.95203384D-03 -1.92230428D-03 -2.01220834D-03 -1.90132763D-03 -2.23271595D-03 -1.71556475D-03 -2.35313643D-03 -2.36013927D-03 -4.83189942D-03 -3.31762480D-03 -2.35300022D-03 -3.10212583D-03 -3.15712788D-03 -3.01629351D-03 -2.83070817D-03 -2.67425319D-03 -3.69209819D-03 -3.39285703D-03 -3.32982815D-03 -7.91742802D-02 -2.81903427D-03 -2.80701765D-03 -3.22098448D-03 -2.75478722D-03 -2.66793137D-03 -2.39829789D-03 -2.96441489D-03 -2.02150992D-03 -1.89424248D-03 -1.69487623D-03 -2.36322428D-03 -2.80019036D-03 -4.46264818D-03 -4.54844814D-03 -1.82795106D-03 -4.43343259D-03 -3.45091801D-03 -1.98499765D-03 -3.60151986D-03 -2.71283323D-03 -3.25249461D-03 -1.39743254D-01 -4.56520617D-02 1.00000000D+00 -2.68247048D-03 -1.00000000D+00 -9.42663550D-02 -2.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.39938340D-01 -2.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -2.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.00000000D+00 -2.00000000D+00 -1.00000000D+00 -2.60716975D-01 1.00000000D+00 -1.00000000D+00 5.00000000D-01 -2.00441820D-04 1.00000000D+00 -8.81728047D-05 4.99836445D-01 5.00000000D-01 -1.08516833D-03 -9.30146081D-04 -1.00851082D-03 -1.46263081D-03 -2.09262152D-03 -2.13684351D-03 -2.50200182D-03 -2.27604178D-03 1.00000000D+00 -4.07628454D-02 4.54577208D-01 5.00000000D-01 -1.40725030D-03 -1.20961515D-03 -1.31149800D-03 -1.90175441D-03 -2.72121769D-03 -2.77883280D-03 -3.25281033D-03 -2.96070473D-03 1.00000000D+00 -6.51841611D-02 4.23311949D-01 -4.71892297D-01 2.81077027D-02 -9.43784595D-01 -5.77269914D-03 -4.95510874D-03 -5.37293730D-03 -7.79202906D-03 -1.11498525D-02 -1.13844210D-02 -1.33284107D-02 -1.21284807D-02 -3.59768905D-02 1.00000000D+00 -1.52490258D-01 9.62755829D-02 -1.89226482D-03 -1.67131233D+00 3.28687668D-01 -8.35656166D-01 -1.97824225D-01 -1.95589870D-01 1.00000000D+00 -4.37857695D-02 1.76200569D-02 -2.14460250D-02 2.00000000D+00 1.00000000D+00 -1.46780527D+00 5.32194734D-01 -7.33902633D-01 -8.90327096D-02 1.00000000D+00 -4.26713973D-02 7.06640184D-02 -1.04394881D-02 5.00000000D-01 -1.53060555D-01 -1.32922277D-01 -1.45159997D-02 1.00000000D+00 -2.39348169D-02 3.44784945D-01 -7.39663653D-03 1.99260342D+00 -3.69831827D-03 1.00000000D+00 -1.76526592D-04 -6.95431292D-01 1.30456877D+00 -3.47715646D-01 1.00000000D+00 -2.54018791D-02 -4.57389804D-04 2.09954262D+00 -2.17804685D-04 1.00000000D+00 -6.33205173D-06 -9.00660157D-01 1.19933975D+00 -4.28885818D-01 1.00000000D+00 -1.60903763D-02 -2.60216546D+00 2.97834665D-01 -8.97298396D-01 -5.93723962D-04 1.00000000D+00 -3.76543887D-02 8.59325007D-03 -2.02902332D-02 2.00000000D+00 -4.65898141D-02 -2.71990262D-02 1.00000000D+00 -4.84563895D-02 4.03310657D-01 1.39999998D+00 -3.08300077D-04 1.00000000D+00 -1.07462266D-02 1.38558960D+00 -1.24517642D-01 1.07548237D+00 -1.03764698D-01 -3.48328426D-02 1.00000000D+00 -8.24680901D-04 -7.48468280D-01 1.25153172D+00 -3.74234140D-01 1.00000000D+00 -3.27906664D-03 -1.67540276D+00 3.24597239D-01 -8.37701380D-01 -2.89995759D-03 1.00000000D+00 -4.07752655D-02 1.11877225D-01 -5.41795138D-03 -6.68755710D-01 5.31244338D-01 -5.57296395D-01 1.00000000D+00 -1.67749810D-03 -6.27053499D-01 1.37294650D+00 -3.13526750D-01 1.00000000D+00 -4.19815013D-04 -1.86955050D-01 1.01304495D+00 -1.55795872D-01 -4.62385714D-02 1.00000000D+00 -4.53347369D-04 -7.21822023D-01 1.27817798D+00 -3.60911012D-01 1.00000000D+00 -2.73104146D-04 -1.05930492D-01 3.94069523D-01 -2.11860985D-01 -1.68937333D-02 -1.85398629D-03 1.00000000D+00 -1.08470803D-03 5.00000000D-01 -1.68574753D-03 1.00000000D+00 -2.69034058D-01 2.30965927D-01 -1.20000005D+00 -1.00000000D+00 -3.55678231D-01 -3.18024121D-02 -8.37958045D-03 1.00000000D+00 -1.82339847D-02 6.98937196D-03 -3.84520710D-04 -1.51235133D-01 3.48764867D-01 -3.02470267D-01 -3.91993411D-02 -6.69464841D-02 -2.91612893D-01 -1.06548648D-02 1.00000000D+00 -7.98794478D-02 2.72300512D-01 -4.04177612D-04 5.00000000D-01 -2.50663608D-02 -1.26683037D-03 1.00000000D+00 -4.20977129D-03 1.25440717D-01 5.00000000D-01 -9.76003241D-03 1.00000000D+00 1.29999995D+00 -9.82436165D-03 1.00000000D+00 -1.75757363D-01 1.11488414D+00 -2.00484797D-01 1.69951510D+00 -1.05518319D-01 -1.29680149D-03 1.00000000D+00 -1.24636805D-03 -1.61500096D+00 3.84999037D-01 -8.07500482D-01 -1.11489906D-03 -1.57474761D-03 -3.36079829D-04 -1.46485993D-03 -7.46365869D-04 -5.04391151D-04 -5.86504175D-04 -5.21592912D-04 -6.88093295D-03 -1.04867527D-02 -3.19255888D-01 -1.61293726D-02 1.00000000D+00 -2.71766007D-01 1.29452288D-01 -5.35347452D-03 -2.23066592D+00 1.16933429D+00 -6.56078160D-01 -7.18148332D-03 1.00000000D+00 -2.35442594D-02 4.97347564D-02 -4.88137603D-02 -2.04773259D+00 3.52267474D-01 -8.53221893D-01 -2.72035366D-03 -1.77766650D-03 -2.38104025D-03 -8.15090723D-04 -9.42158105D-04 -6.70078967D-04 -7.60167604D-04 -2.11644132D-04 -5.66360168D-02 -1.50002027D-03 -4.91754897D-03 -4.01309192D-01 -1.08380883D-03 -4.96166467D-04 1.00000000D+00 -6.68438077D-01 2.79838085D-01 -7.92497536D-04 -2.33849168D-01 2.66150832D-01 -4.67698336D-01 1.00000000D+00 -2.87304446D-03 -2.91807055D-01 8.08192968D-01 -2.65279144D-01 1.00000000D+00 -6.22297544D-03 -1.14481020D+00 8.55189800D-01 -5.72405100D-01 -5.58000579D-02 -8.98083020D-03 1.00000000D+00 -5.37051633D-02 4.83965762D-02 -1.98628195D-02 -1.42642903D+00 5.73570967D-01 -7.13214517D-01 -6.67206198D-02 1.00000000D+00 -8.40566121D-04 -4.85329628D-01 1.51467037D+00 -2.42664814D-01 -8.96874291D-04 -1.32383301D-03 -1.32967182D-03 -1.28170592D-03 -1.33668678D-03 -1.33038755D-03 -1.32171414D-03 -1.25945604D-03 -2.33388562D-02 -1.62985370D-01 -3.80810276D-02 -6.71791732D-02 -6.75262418D-03 -2.05335543D-01 -1.06370752D-03 -6.19772589D-04 -1.66779512D-03 1.00000000D+00 -2.90093929D-01 6.60795033D-01 -5.33351488D-03 5.00000000D-01 -5.65960491D-03 -2.14861985D-03 -1.23228477D-02 -1.28709001D-03 -7.76296109D-03 -3.21339467D-03 -8.52899859D-04 -1.39193831D-03 -6.88091968D-04 -2.32404447D-03 -5.68990072D-04 -4.16228548D-03 -5.25717530D-03 -4.48758365D-04 -8.08227435D-03 -3.93367372D-04 -1.24063122D-03 -5.52031258D-03 -1.16483490D-04 -4.70676506D-03 -1.84243242D-03 -7.13348098D-04 -3.01135471D-03 -6.30347338D-03 -8.09392985D-03 -7.22343859D-04 -2.85392837D-03 -9.41671710D-03 -3.20973643D-03 -3.92820593D-03 -4.84057469D-03 -2.64233109D-02 -5.63934073D-02 1.00000000D+00 -2.29801148D-01 2.15929925D-01 -1.27107942D+00 1.28920510D-01 -9.07913923D-01 -2.93939412D-02 -1.22682666D-02 1.00000000D+00 -1.69435248D-01 1.62539542D-01 -2.38049356D-03 2.00000000D+00 1.00000000D+00 -3.33289027D-01 9.66710985D-01 -2.56376177D-01 -2.38482412D-02 1.00000000D+00 -1.95702668D-02 6.02502711D-02 -1.50823966D-03 -8.34249184D-02 4.16575074D-01 -1.66849837D-01 -1.41137898D-01 -6.21925406D-02 -1.79157741D-02 -9.31619946D-03 -7.97656104D-02 -9.82721709D-03 -4.57741946D-01 -8.74001831D-02 1.00000000D+00 -7.48817250D-02 1.90253779D-01 -7.64884287D-04 -1.04966235D+00 1.50337681D-01 -8.74718606D-01 -3.10189673D-03 -1.23634702D-03 -1.01881835D-03 -1.04654080D-03 -1.15193555D-03 -1.14678754D-03 -9.76467039D-04 -1.26755168D-03 -1.10509451D-02 -1.98407471D-02 -2.79315859D-02 -6.27332646D-03 -1.09529030D-02 -1.17584094D-02 -1.94125865D-02 1.00000000D+00 -3.93045694D-02 4.44007665D-02 -5.15591446D-03 2.00000000D+00 1.00000000D+00 5.00000000D-01 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 -9.70873654D-01 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.00000000D+00 1.00000000D+00 2.06969410D-01 1.42192304D-01 9.91375148D-02 1.21215612D-01 1.07199252D-01 9.79955196D-02 8.66832137D-02 1.13363981D-01 5.14388204D-01 3.99175406D-01 2.79817909D-01 3.77357244D-01 4.94234264D-02 3.67496192D-01 8.83079469D-02 2.73117274D-01 1.62650615D-01 1.08350277D-01 1.78367764D-01 1.42301500D-01 1.99999988D-01 1.57062501D-01 3.46346229D-01 1.68499485D-01 1.43396467D-01 2.21011877D-01 1.31137341D-01 2.03243569D-01 2.62830466D-01 2.20662773D-01 2.05521852D-01 3.04139465D-01 2.50172228D-01 3.27778846D-01 3.86875868D-01 2.86146790D-01 3.49301606D-01 2.04914153D-01 1.63164020D-01 1.44504279D-01 1.19339019D-01 4.49773788D-01 1.22339576D-01 1.75039321D-01 3.13483953D-01 2.35000014D-01 1.18269891D-01 9.08070803D-03 5.00000000D-01 2.50000000D-01 -2.93030590D-01 -3.57807696D-01 -4.00862485D-01 -3.78784388D-01 -3.92800748D-01 -4.02004480D-01 -4.13316786D-01 -3.86636019D-01 -1.85611829D-01 -1.00824602D-01 -2.20182091D-01 -2.22642779D-01 -4.50576574D-01 -1.32503808D-01 -4.11692053D-01 -4.26882714D-01 -3.37349385D-01 -3.91649723D-01 -4.21632260D-01 -3.57698500D-01 -5.00000000D-01 -5.42937458D-01 -2.53653795D-01 -4.31500524D-01 -3.56603533D-01 -2.78988123D-01 -3.68862659D-01 -3.96756440D-01 -2.37169534D-01 -3.79337251D-01 -2.94478148D-01 -3.95860523D-01 -4.49827760D-01 -1.72221169D-01 -2.13124171D-01 -3.13853234D-01 -1.50698408D-01 -2.95085847D-01 -3.36835980D-01 -3.55495721D-01 -3.80660981D-01 -1.50226235D-01 -3.77660424D-01 -3.24960679D-01 -1.86516061D-01 -2.64999986D-01 -3.81730109D-01 -4.90919292D-01 -2.50000000D-01 -5.00000000D-01 -5.00000000D-01 -2.93030590D-01 -3.57807696D-01 -4.00862485D-01 -3.78784388D-01 -3.92800748D-01 -4.02004480D-01 -4.13316786D-01 -3.86636019D-01 -1.85611829D-01 -1.00824602D-01 -2.20182091D-01 -2.22642779D-01 -4.50576574D-01 -1.32503808D-01 -4.11692053D-01 -4.26882714D-01 -3.37349385D-01 -3.91649723D-01 -4.21632260D-01 -3.57698500D-01 -5.00000000D-01 -5.42937458D-01 -2.53653795D-01 -4.31500524D-01 -3.56603533D-01 -2.78988123D-01 -3.68862659D-01 -3.96756440D-01 -2.37169534D-01 -3.79337251D-01 -2.94478148D-01 -3.95860523D-01 -4.49827760D-01 -1.72221169D-01 -2.13124171D-01 -3.13853234D-01 -1.50698408D-01 -2.95085847D-01 -3.36835980D-01 -3.55495721D-01 -3.80660981D-01 -1.50226235D-01 -3.77660424D-01 -3.24960679D-01 -1.86516061D-01 -2.64999986D-01 -3.81730109D-01 -4.90919292D-01 -2.50000000D-01 -5.00000000D-01 -5.00000000D-01 -4.84386444D-01 -5.61829507D-01 -6.71342134D-01 -5.77910066D-01 -5.65740168D-01 -5.57189345D-01 -6.78157926D-01 -5.21830022D-01 -3.84170078D-02 -8.72260258D-02 -2.06981167D-01 -1.04951881D-01 -5.13661385D-01 -9.55502614D-02 -3.01023483D-01 -3.79936486D-01 -3.87598157D-01 -4.01674479D-01 -4.01453912D-01 -4.55248922D-01 -2.83446878D-01 -4.43214297D-01 -1.71091840D-01 -4.12138194D-01 -3.89837623D-01 -4.61512387D-01 -4.64076310D-01 -3.27409387D-01 -2.21497595D-01 -3.14730257D-01 -2.30232194D-01 -1.56761721D-01 -2.32789949D-01 -1.27302766D-01 -1.61466956D-01 -2.07014278D-01 -1.71532094D-01 -3.33930194D-01 -4.81194258D-01 -3.08955878D-01 -3.55723470D-01 -8.63323063D-02 -7.10011542D-01 -4.41480815D-01 -2.43827671D-01 -3.81600082D-01 -3.81729990D-01 -9.52321470D-01 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 -1.75656468D-01 3.24343532D-01 -1.75656468D-01 -2.90364295D-01 -2.50000000D+00 -7.48264492D-02 4.25173551D-01 -7.48264492D-02 -1.17492460D-01 -2.70000005D+00 -5.77010401D-02 4.42298949D-01 -5.77010401D-02 -9.66344848D-02 -2.50000000D+00 -6.47369847D-02 4.35263008D-01 -6.47369847D-02 -9.87690017D-02 -2.70000005D+00 -7.03428686D-02 4.29657131D-01 -7.03428686D-02 -1.01312913D-01 -2.90000010D+00 -7.71906078D-02 4.22809392D-01 -7.71906078D-02 -1.06988318D-01 -2.90000010D+00 -5.80480322D-02 4.41951960D-01 -5.80480322D-02 -9.52434912D-02 -2.90000010D+00 -8.63306150D-02 4.13669378D-01 -8.63306150D-02 -1.16517611D-01 -2.90000010D+00 -5.14388204D-01 1.85611799D-01 -5.14388204D-01 -1.06465489D-01 -2.40000010D+00 -3.99175406D-01 1.00824594D-01 -3.99175406D-01 -3.45337152D-01 -1.50000000D+00 -2.79817909D-01 2.20182091D-01 -2.79817909D-01 -2.63041526D-01 -2.40000010D+00 -3.77357244D-01 2.22642779D-01 -3.77357244D-01 -1.77882954D-01 -1.89999998D+00 -4.94234152D-02 4.50576574D-01 -4.94234152D-02 -5.63431382D-02 -1.60000002D+00 -3.67496192D-01 1.32503808D-01 -3.67496192D-01 -2.65006363D-01 -2.09999990D+00 -8.83079469D-02 4.11692053D-01 -8.83079469D-02 -6.45695329D-02 -1.79999995D+00 -2.73117244D-01 4.26882774D-01 -2.73117244D-01 -2.43081301D-01 -1.79999995D+00 -1.62650600D-01 3.37349415D-01 -1.62650600D-01 -1.86877683D-01 -1.79999995D+00 -1.08350284D-01 3.91649723D-01 -1.08350284D-01 -1.11123636D-01 -1.79999995D+00 -1.78367749D-01 4.21632290D-01 -1.78367749D-01 -1.69831485D-01 -1.79999995D+00 -1.42301500D-01 3.57698500D-01 -1.42301500D-01 -1.81109533D-01 -1.79999995D+00 -2.00000003D-01 5.00000000D-01 -2.00000003D-01 -1.13378748D-01 -1.89999998D+00 -1.57062501D-01 5.42937458D-01 -1.57062501D-01 -1.28214285D-01 -1.89999998D+00 -3.46346229D-01 2.53653795D-01 -3.46346229D-01 -2.33613744D-01 -1.79999995D+00 -1.68499500D-01 4.31500524D-01 -1.68499500D-01 -1.60938576D-01 -2.20000005D+00 -1.43396482D-01 3.56603533D-01 -1.43396482D-01 -1.56760484D-01 -2.59999990D+00 -2.21011877D-01 2.78988123D-01 -2.21011877D-01 -3.65605980D-01 -2.59999990D+00 -1.31137356D-01 3.68862659D-01 -1.31137356D-01 -1.64987534D-01 -2.20000005D+00 -2.03243569D-01 3.96756440D-01 -2.03243569D-01 -1.67719662D-01 -1.50000000D+00 -2.62830466D-01 2.37169534D-01 -2.62830466D-01 -2.45462865D-01 -3.00000000D+00 -2.20662788D-01 3.79337251D-01 -2.20662788D-01 -1.83080494D-01 -1.89999998D+00 -2.05521852D-01 2.94478148D-01 -2.05521852D-01 -1.60683393D-01 -2.40000010D+00 -3.04139495D-01 3.95860523D-01 -3.04139495D-01 -1.20439976D-01 -2.40000010D+00 -2.50172228D-01 4.49827760D-01 -2.50172228D-01 -1.29466400D-01 -2.40000010D+00 -3.27778846D-01 1.72221154D-01 -3.27778846D-01 -2.42288172D-01 -2.40000010D+00 -3.86875868D-01 2.13124156D-01 -3.86875868D-01 -2.93104559D-01 -1.89999998D+00 -2.86146790D-01 3.13853234D-01 -2.86146790D-01 -1.88739419D-01 -2.20000005D+00 -3.49301606D-01 1.50698394D-01 -3.49301606D-01 -3.97591680D-01 -1.70000005D+00 -2.04914153D-01 2.95085847D-01 -2.04914153D-01 -2.31888533D-01 -2.20000005D+00 -1.63164020D-01 3.36835980D-01 -1.63164020D-01 -2.33091459D-01 -2.90000010D+00 -1.44504279D-01 3.55495721D-01 -1.44504279D-01 -1.25586450D-01 -2.20000005D+00 -1.19339012D-01 3.80660981D-01 -1.19339012D-01 -1.11520983D-01 -2.59999990D+00 -4.49773788D-01 1.50226235D-01 -4.49773788D-01 -2.58476883D-01 -1.79999995D+00 -1.22339584D-01 3.77660424D-01 -1.22339584D-01 -2.30001658D-01 -1.70000005D+00 -1.75039321D-01 3.24960679D-01 -1.75039321D-01 -2.37802625D-01 -1.70000005D+00 -3.13483924D-01 1.86516076D-01 -3.13483924D-01 -4.09809500D-01 -1.60000002D+00 -2.34999999D-01 2.65000015D-01 -2.34999999D-01 -3.38400066D-01 -1.60000002D+00 -1.18269883D-01 3.81730109D-01 -1.18269883D-01 -1.18269853D-01 -1.60000002D+00 -9.08071082D-03 4.90919292D-01 -9.08071082D-03 -1.76154319D-02 -1.50000000D+00 -5.00000000D-01 -5.00000000D-01 -9.69999790D-01 -1.50000000D+00 -2.50000000D-01 2.50000000D-01 -2.50000000D-01 -1.60000002D+00 5.00000000D-01 -1.70000005D+00 5.00000000D-01 -1.70000005D+00 -3.13129500D-02 -3.13129500D-02 4.68687057D-01 -5.17610461D-02 -6.73658550D-02 -6.73658550D-02 4.32634145D-01 -1.05777845D-01 -4.14364599D-02 -4.14364599D-02 4.58563536D-01 -6.93954676D-02 -5.64786419D-02 -5.64786419D-02 4.43521351D-01 -8.61692801D-02 -3.68563868D-02 -3.68563868D-02 4.63143617D-01 -5.30832484D-02 -2.08049174D-02 -2.08049174D-02 4.79195088D-01 -2.88361926D-02 -2.86351871D-02 -2.86351871D-02 4.71364826D-01 -4.69837673D-02 -2.70333719D-02 -2.70333719D-02 4.72966641D-01 -3.64860594D-02 6.99999988D-01 5.00000000D-01 5.00000000D-01 6.00000024D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 6.99999988D-01 5.00000000D-01 5.00000000D-01 6.00000024D-01 5.00000000D-01 6.99999988D-01 6.99999988D-01 6.00000024D-01 6.00000024D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 6.00000024D-01 5.00000000D-01 6.00000024D-01 5.00000000D-01 6.99999988D-01 6.99999988D-01 5.00000000D-01 6.00000024D-01 6.00000024D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 6.00000024D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 5.00000000D-01 1.00000000D+00 2.17519850D-01 1.00000000D+00 2.17519850D-01 1.00000000D+00 2.17519850D-01 1.00000000D+00 7.78065412D-04 7.78065412D-04 7.78065412D-04 2.18297914D-01 7.78065412D-04 1.94401259D-03 7.78065412D-04 2.30427063D-03 1.10379385D-03 1.24306313D-03 7.78065412D-04 7.78065412D-04 2.30427063D-03 1.64245476D-03 1.48016575D-03 1.94401259D-03 7.78065412D-04 1.48016575D-03 1.48016575D-03 1.48016575D-03 1.94401259D-03 1.94401259D-03 1.48016575D-03 1.94401259D-03 1.94401259D-03 1.48016575D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.48016575D-03 1.94401259D-03 2.30427063D-03 1.48016575D-03 1.24306313D-03 7.78065412D-04 7.78065412D-04 1.64245476D-03 9.62222868D-04 9.62222868D-04 1.48016575D-03 7.78065412D-04 1.94401259D-03 1.48016575D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.44678715D-03 1.94401259D-03 1.94401259D-03 1.94401259D-03 1.00000000D+00 9.95924044D-03 9.95924044D-03 9.95924044D-03 9.95924044D-03 2.27479085D-01 2.48833690D-02 9.95924044D-03 2.94946730D-02 1.41285667D-02 1.59112141D-02 9.95924044D-03 9.95924044D-03 2.94946730D-02 2.10234281D-02 1.89461298D-02 2.48833690D-02 9.95924044D-03 1.89461298D-02 1.89461298D-02 1.89461298D-02 2.48833690D-02 2.48833690D-02 1.89461298D-02 2.48833690D-02 2.48833690D-02 1.89461298D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 1.89461298D-02 2.48833690D-02 2.94946730D-02 1.89461298D-02 1.59112141D-02 9.95924044D-03 9.95924044D-03 2.10234281D-02 1.23164579D-02 1.23164579D-02 1.89461298D-02 9.95924044D-03 2.48833690D-02 1.89461298D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 1.85188837D-02 2.48833690D-02 2.48833690D-02 2.48833690D-02 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.52011142D-03 5.52011142D-03 5.52011142D-03 5.52011142D-03 5.52011142D-03 1.37921125D-02 2.23039955D-01 1.63480211D-02 7.83104450D-03 8.81911349D-03 5.52011142D-03 5.52011142D-03 1.63480211D-02 1.16526615D-02 1.05012767D-02 1.37921125D-02 5.52011142D-03 1.05012767D-02 1.05012767D-02 1.05012767D-02 1.37921125D-02 1.37921125D-02 1.05012767D-02 1.37921125D-02 1.37921125D-02 1.05012767D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.05012767D-02 1.37921125D-02 1.63480211D-02 1.05012767D-02 8.81911349D-03 5.52011142D-03 5.52011142D-03 1.16526615D-02 6.82664663D-03 6.82664663D-03 1.05012767D-02 5.52011142D-03 1.37921125D-02 1.05012767D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.02644665D-02 1.37921125D-02 1.37921125D-02 1.37921125D-02 1.00000000D+00 6.44193411D-01 1.00000000D+00 1.63674168D-02 1.63674168D-02 1.63674168D-02 1.63674168D-02 1.63674168D-02 4.08943295D-02 1.63674168D-02 4.84727360D-02 3.31801593D-01 2.61491276D-02 1.63674168D-02 1.63674168D-02 4.84727360D-02 3.45507450D-02 3.11368294D-02 4.08943295D-02 1.63674168D-02 3.11368294D-02 3.11368294D-02 3.11368294D-02 4.08943295D-02 4.08943295D-02 3.11368294D-02 4.08943295D-02 4.08943295D-02 3.11368294D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 3.11368294D-02 4.08943295D-02 4.84727360D-02 3.11368294D-02 2.61491276D-02 1.63674168D-02 1.63674168D-02 3.45507450D-02 2.02413611D-02 2.02413611D-02 3.11368294D-02 1.63674168D-02 4.08943295D-02 3.11368294D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 3.04346774D-02 4.08943295D-02 4.08943295D-02 4.08943295D-02 1.00000000D+00 2.36398429D-02 2.36398429D-02 2.36398429D-02 2.36398429D-02 2.36398429D-02 5.90646379D-02 2.36398429D-02 7.00103045D-02 3.35364044D-02 3.85284722D-01 2.36398429D-02 2.36398429D-02 7.00103045D-02 4.99024540D-02 4.49716561D-02 5.90646379D-02 2.36398429D-02 4.49716561D-02 4.49716561D-02 4.49716561D-02 5.90646379D-02 5.90646379D-02 4.49716561D-02 5.90646379D-02 5.90646379D-02 4.49716561D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 4.49716561D-02 5.90646379D-02 7.00103045D-02 4.49716561D-02 3.77677977D-02 2.36398429D-02 2.36398429D-02 4.99024540D-02 2.92350724D-02 2.92350724D-02 4.49716561D-02 2.36398429D-02 5.90646379D-02 4.49716561D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 4.39575128D-02 5.90646379D-02 5.90646379D-02 5.90646379D-02 1.00000000D+00 1.12819523D-02 1.12819523D-02 1.12819523D-02 1.12819523D-02 1.12819523D-02 2.81881951D-02 1.12819523D-02 3.34119350D-02 1.60050169D-02 1.80244222D-02 2.28801802D-01 1.12819523D-02 3.34119350D-02 2.38156039D-02 2.14624126D-02 2.81881951D-02 1.12819523D-02 2.14624126D-02 2.14624126D-02 2.14624126D-02 2.81881951D-02 2.81881951D-02 2.14624126D-02 2.81881951D-02 2.81881951D-02 2.14624126D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.14624126D-02 2.81881951D-02 3.34119350D-02 2.14624126D-02 1.80244222D-02 1.12819523D-02 1.12819523D-02 2.38156039D-02 1.39522376D-02 1.39522376D-02 2.14624126D-02 1.12819523D-02 2.81881951D-02 2.14624126D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 2.09784228D-02 2.81881951D-02 2.81881951D-02 2.81881951D-02 1.00000000D+00 1.45590007D-02 1.45590007D-02 1.45590007D-02 1.45590007D-02 1.45590007D-02 3.63759659D-02 1.45590007D-02 4.31170389D-02 2.06539650D-02 2.32599434D-02 1.45590007D-02 2.32078850D-01 4.31170389D-02 3.07332780D-02 2.76965592D-02 3.63759659D-02 1.45590007D-02 2.76965592D-02 2.76965592D-02 2.76965592D-02 3.63759659D-02 3.63759659D-02 2.76965592D-02 3.63759659D-02 3.63759659D-02 2.76965592D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 2.76965592D-02 3.63759659D-02 4.31170389D-02 2.76965592D-02 2.32599434D-02 1.45590007D-02 1.45590007D-02 3.07332780D-02 1.80049166D-02 1.80049166D-02 2.76965592D-02 1.45590007D-02 3.63759659D-02 2.76965592D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 2.70719863D-02 3.63759659D-02 3.63759659D-02 3.63759659D-02 1.00000000D+00 3.99022875D-03 3.99022875D-03 3.99022875D-03 3.99022875D-03 3.99022875D-03 9.96967033D-03 3.99022875D-03 1.18172178D-02 5.66069456D-03 6.37492212D-03 3.99022875D-03 3.99022875D-03 6.56010628D-01 8.42316169D-03 7.59087969D-03 9.96967033D-03 3.99022875D-03 7.59087969D-03 7.59087969D-03 7.59087969D-03 9.96967033D-03 9.96967033D-03 7.59087969D-03 9.96967033D-03 9.96967033D-03 7.59087969D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 7.59087969D-03 9.96967033D-03 1.18172178D-02 7.59087969D-03 6.37492212D-03 3.99022875D-03 3.99022875D-03 8.42316169D-03 4.93466202D-03 4.93466202D-03 7.59087969D-03 3.99022875D-03 9.96967033D-03 7.59087969D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 7.41970027D-03 9.96967033D-03 9.96967033D-03 9.96967033D-03 1.00000000D+00 4.59172845D-01 1.00000000D+00 2.76930194D-04 2.76930194D-04 2.76930194D-04 2.76930194D-04 2.76930194D-04 6.91915862D-04 2.76930194D-04 8.20139423D-04 3.92863934D-04 4.42432880D-04 2.76930194D-04 2.76930194D-04 8.20139423D-04 5.84584952D-04 4.14329380D-01 6.91915862D-04 2.76930194D-04 5.26822812D-04 5.26822812D-04 5.26822812D-04 6.91915862D-04 6.91915862D-04 5.26822812D-04 6.91915862D-04 6.91915862D-04 5.26822812D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 5.26822812D-04 6.91915862D-04 8.20139423D-04 5.26822812D-04 4.42432880D-04 2.76930194D-04 2.76930194D-04 5.84584952D-04 3.42475803D-04 3.42475803D-04 5.26822812D-04 2.76930194D-04 6.91915862D-04 5.26822812D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 5.14942629D-04 6.91915862D-04 6.91915862D-04 6.91915862D-04 1.00000000D+00 1.79941696D-03 1.79941696D-03 1.79941696D-03 1.79941696D-03 1.79941696D-03 4.49588103D-03 1.79941696D-03 5.32904267D-03 2.55272305D-03 2.87480839D-03 1.79941696D-03 1.79941696D-03 5.32904267D-03 3.79847386D-03 3.42315156D-03 5.47973752D-01 1.79941696D-03 3.42315156D-03 3.42315156D-03 3.42315156D-03 4.49588103D-03 4.49588103D-03 3.42315156D-03 4.49588103D-03 4.49588103D-03 3.42315156D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 3.42315156D-03 4.49588103D-03 5.32904267D-03 3.42315156D-03 2.87480839D-03 1.79941696D-03 1.79941696D-03 3.79847386D-03 2.22531473D-03 2.22531473D-03 3.42315156D-03 1.79941696D-03 4.49588103D-03 3.42315156D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 3.34595726D-03 4.49588103D-03 4.49588103D-03 4.49588103D-03 1.00000000D+00 3.40027385D-03 3.40027385D-03 3.40027385D-03 3.40027385D-03 3.40027385D-03 8.49565491D-03 3.40027385D-03 1.00700418D-02 4.82376106D-03 5.43239061D-03 3.40027385D-03 3.40027385D-03 1.00700418D-02 7.17779715D-03 6.46856846D-03 8.49565491D-03 2.20920131D-01 6.46856846D-03 6.46856846D-03 6.46856846D-03 8.49565491D-03 8.49565491D-03 6.46856846D-03 8.49565491D-03 8.49565491D-03 6.46856846D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 6.46856846D-03 8.49565491D-03 1.00700418D-02 6.46856846D-03 5.43239061D-03 3.40027385D-03 3.40027385D-03 7.17779715D-03 4.20507230D-03 4.20507230D-03 6.46856846D-03 3.40027385D-03 8.49565491D-03 6.46856846D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 6.32269774D-03 8.49565491D-03 8.49565491D-03 8.49565491D-03 1.00000000D+00 1.88028405D-03 1.88028405D-03 1.88028405D-03 1.88028405D-03 1.88028405D-03 4.69792867D-03 1.88028405D-03 5.56853367D-03 2.66744406D-03 3.00400425D-03 1.88028405D-03 1.88028405D-03 5.56853367D-03 3.96917993D-03 3.57698998D-03 4.69792867D-03 1.88028405D-03 4.17379558D-01 3.57698998D-03 3.57698998D-03 4.69792867D-03 4.69792867D-03 3.57698998D-03 4.69792867D-03 4.69792867D-03 3.57698998D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 3.57698998D-03 4.69792867D-03 5.56853367D-03 3.57698998D-03 3.00400425D-03 1.88028405D-03 1.88028405D-03 3.96917993D-03 2.32532178D-03 2.32532178D-03 3.57698998D-03 1.88028405D-03 4.69792867D-03 3.57698998D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 3.49632674D-03 4.69792867D-03 4.69792867D-03 4.69792867D-03 1.00000000D+00 8.75091413D-04 8.75091413D-04 8.75091413D-04 8.75091413D-04 8.75091413D-04 2.18643411D-03 8.75091413D-04 2.59161694D-03 1.24143891D-03 1.39807514D-03 8.75091413D-04 8.75091413D-04 2.59161694D-03 1.84727146D-03 1.66474504D-03 2.18643411D-03 8.75091413D-04 1.66474504D-03 4.15467322D-01 1.66474504D-03 2.18643411D-03 2.18643411D-03 1.66474504D-03 2.18643411D-03 2.18643411D-03 1.66474504D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 1.66474504D-03 2.18643411D-03 2.59161694D-03 1.66474504D-03 1.39807514D-03 8.75091413D-04 8.75091413D-04 1.84727146D-03 1.08221371D-03 1.08221371D-03 1.66474504D-03 8.75091413D-04 2.18643411D-03 1.66474504D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 1.62720389D-03 2.18643411D-03 2.18643411D-03 2.18643411D-03 1.00000000D+00 3.89279012D-04 3.89279012D-04 3.89279012D-04 3.89279012D-04 3.89279012D-04 9.72621783D-04 3.89279012D-04 1.15286477D-03 5.52246405D-04 6.21925166D-04 3.89279012D-04 3.89279012D-04 1.15286477D-03 8.21747351D-04 7.40551506D-04 9.72621783D-04 3.89279012D-04 7.40551506D-04 7.40551506D-04 4.14543122D-01 9.72621783D-04 9.72621783D-04 7.40551506D-04 9.72621783D-04 9.72621783D-04 7.40551506D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 7.40551506D-04 9.72621783D-04 1.15286477D-03 7.40551506D-04 6.21925166D-04 3.89279012D-04 3.89279012D-04 8.21747351D-04 4.81416093D-04 4.81416093D-04 7.40551506D-04 3.89279012D-04 9.72621783D-04 7.40551506D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 7.23851670D-04 9.72621783D-04 9.72621783D-04 9.72621783D-04 1.00000000D+00 6.58825913D-04 6.58825913D-04 6.58825913D-04 6.58825913D-04 6.58825913D-04 1.64609030D-03 6.58825913D-04 1.95113849D-03 9.34636162D-04 1.05256215D-03 6.58825913D-04 6.58825913D-04 1.95113849D-03 1.39074656D-03 1.25332864D-03 1.64609030D-03 6.58825913D-04 1.25332864D-03 1.25332864D-03 1.25332864D-03 5.45123994D-01 1.64609030D-03 1.25332864D-03 1.64609030D-03 1.64609030D-03 1.25332864D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.25332864D-03 1.64609030D-03 1.95113849D-03 1.25332864D-03 1.05256215D-03 6.58825913D-04 6.58825913D-04 1.39074656D-03 8.14761093D-04 8.14761093D-04 1.25332864D-03 6.58825913D-04 1.64609030D-03 1.25332864D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.22506532D-03 1.64609030D-03 1.64609030D-03 1.64609030D-03 1.00000000D+00 1.71326144D-04 1.71326144D-04 1.71326144D-04 1.71326144D-04 1.71326144D-04 4.28061961D-04 1.71326144D-04 5.07389021D-04 2.43049974D-04 2.73716345D-04 1.71326144D-04 1.71326144D-04 5.07389021D-04 3.61660408D-04 3.25925212D-04 4.28061961D-04 1.71326144D-04 3.25925212D-04 3.25925212D-04 3.25925212D-04 4.28061961D-04 5.43905973D-01 3.25925212D-04 4.28061961D-04 4.28061961D-04 3.25925212D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 3.25925212D-04 4.28061961D-04 5.07389021D-04 3.25925212D-04 2.73716345D-04 1.71326144D-04 1.71326144D-04 3.61660408D-04 2.11876730D-04 2.11876730D-04 3.25925212D-04 1.71326144D-04 4.28061961D-04 3.25925212D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 3.18575389D-04 4.28061961D-04 4.28061961D-04 4.28061961D-04 1.00000000D+00 1.48846791D-03 1.48846791D-03 1.48846791D-03 1.48846791D-03 1.48846791D-03 3.71896802D-03 1.48846791D-03 4.40815510D-03 2.11159862D-03 2.37802579D-03 1.48846791D-03 1.48846791D-03 4.40815510D-03 3.14207654D-03 2.83161202D-03 3.71896802D-03 1.48846791D-03 2.83161202D-03 2.83161202D-03 2.83161202D-03 3.71896802D-03 3.71896802D-03 4.16634172D-01 3.71896802D-03 3.71896802D-03 2.83161202D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 2.83161202D-03 3.71896802D-03 4.40815510D-03 2.83161202D-03 2.37802579D-03 1.48846791D-03 1.48846791D-03 3.14207654D-03 1.84076803D-03 1.84076803D-03 2.83161202D-03 1.48846791D-03 3.71896802D-03 2.83161202D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 2.76775728D-03 3.71896802D-03 3.71896802D-03 3.71896802D-03 1.00000000D+00 5.43477893D-01 1.00000000D+00 8.70593140D-05 8.70593140D-05 8.70593140D-05 8.70593140D-05 8.70593140D-05 2.17519526D-04 8.70593140D-05 2.57829524D-04 1.23505743D-04 1.39088850D-04 8.70593140D-05 8.70593140D-05 2.57829524D-04 1.83777607D-04 1.65618767D-04 2.17519526D-04 8.70593140D-05 1.65618767D-04 1.65618767D-04 1.65618767D-04 2.17519526D-04 2.17519526D-04 1.65618767D-04 2.17519526D-04 5.43695390D-01 1.65618767D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 1.65618767D-04 2.17519526D-04 2.57829524D-04 1.65618767D-04 1.39088850D-04 8.70593140D-05 8.70593140D-05 1.83777607D-04 1.07665073D-04 1.07665073D-04 1.65618767D-04 8.70593140D-05 2.17519526D-04 1.65618767D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 1.61883960D-04 2.17519526D-04 2.17519526D-04 2.17519526D-04 1.00000000D+00 3.88478627D-04 3.88478627D-04 3.88478627D-04 3.88478627D-04 3.88478627D-04 9.70622001D-04 3.88478627D-04 1.15049444D-03 5.51110948D-04 6.20646402D-04 3.88478627D-04 3.88478627D-04 1.15049444D-03 8.20057758D-04 7.39028910D-04 9.70622001D-04 3.88478627D-04 7.39028910D-04 7.39028910D-04 7.39028910D-04 9.70622001D-04 9.70622001D-04 7.39028910D-04 9.70622001D-04 9.70622001D-04 4.14541602D-01 9.70622001D-04 9.70622001D-04 9.70622001D-04 7.39028910D-04 9.70622001D-04 1.15049444D-03 7.39028910D-04 6.20646402D-04 3.88478627D-04 3.88478627D-04 8.20057758D-04 4.80426272D-04 4.80426272D-04 7.39028910D-04 3.88478627D-04 9.70622001D-04 7.39028910D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 7.22363358D-04 9.70622001D-04 9.70622001D-04 9.70622001D-04 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 3.43396631D-03 3.43396631D-03 3.43396631D-03 3.43396631D-03 3.43396631D-03 8.57983623D-03 3.43396631D-03 1.01698246D-02 4.87155840D-03 5.48621872D-03 3.43396631D-03 3.43396631D-03 1.01698246D-02 7.24892039D-03 6.53266395D-03 8.57983623D-03 3.43396631D-03 6.53266395D-03 6.53266395D-03 6.53266395D-03 8.57983623D-03 8.57983623D-03 6.53266395D-03 8.57983623D-03 8.57983623D-03 6.53266395D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 4.20335233D-01 8.57983623D-03 1.01698246D-02 6.53266395D-03 5.48621872D-03 3.43396631D-03 3.43396631D-03 7.24892039D-03 4.24673967D-03 4.24673967D-03 6.53266395D-03 3.43396631D-03 8.57983623D-03 6.53266395D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 6.38534827D-03 8.57983623D-03 8.57983623D-03 8.57983623D-03 1.00000000D+00 1.50102680D-03 1.50102680D-03 1.50102680D-03 1.50102680D-03 1.50102680D-03 3.75034660D-03 1.50102680D-03 4.44534887D-03 2.12941528D-03 2.39809020D-03 1.50102680D-03 1.50102680D-03 4.44534887D-03 3.16858804D-03 2.85550370D-03 3.75034660D-03 1.50102680D-03 2.85550370D-03 2.85550370D-03 2.85550370D-03 3.75034660D-03 3.75034660D-03 2.85550370D-03 3.75034660D-03 3.75034660D-03 2.85550370D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 2.85550370D-03 5.47228217D-01 4.44534887D-03 2.85550370D-03 2.39809020D-03 1.50102680D-03 1.50102680D-03 3.16858804D-03 1.85629935D-03 1.85629935D-03 2.85550370D-03 1.50102680D-03 3.75034660D-03 2.85550370D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 2.79111019D-03 3.75034660D-03 3.75034660D-03 3.75034660D-03 1.00000000D+00 1.31290816D-02 1.31290816D-02 1.31290816D-02 1.31290816D-02 1.31290816D-02 3.28032821D-02 1.31290816D-02 3.88822779D-02 1.86254252D-02 2.09754556D-02 1.31290816D-02 1.31290816D-02 3.88822779D-02 2.77147945D-02 2.49763280D-02 3.28032821D-02 1.31290816D-02 2.49763280D-02 2.49763280D-02 2.49763280D-02 3.28032821D-02 3.28032821D-02 2.49763280D-02 3.28032821D-02 3.28032821D-02 2.49763280D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 2.49763280D-02 3.28032821D-02 6.83075666D-01 2.49763280D-02 2.09754556D-02 1.31290816D-02 1.31290816D-02 2.77147945D-02 1.62365567D-02 1.62365567D-02 2.49763280D-02 1.31290816D-02 3.28032821D-02 2.49763280D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 2.44130976D-02 3.28032821D-02 3.28032821D-02 3.28032821D-02 1.00000000D+00 2.70030956D-04 2.70030956D-04 2.70030956D-04 2.70030956D-04 2.70030956D-04 6.74678013D-04 2.70030956D-04 7.99707079D-04 3.83076462D-04 4.31410444D-04 2.70030956D-04 2.70030956D-04 7.99707079D-04 5.70021046D-04 5.13697974D-04 6.74678013D-04 2.70030956D-04 5.13697974D-04 5.13697974D-04 5.13697974D-04 6.74678013D-04 6.74678013D-04 5.13697974D-04 6.74678013D-04 6.74678013D-04 5.13697974D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 5.13697974D-04 6.74678013D-04 7.99707079D-04 4.14316267D-01 4.31410444D-04 2.70030956D-04 2.70030956D-04 5.70021046D-04 3.33943637D-04 3.33943637D-04 5.13697974D-04 2.70030956D-04 6.74678013D-04 5.13697974D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 5.02113777D-04 6.74678013D-04 6.74678013D-04 6.74678013D-04 1.00000000D+00 1.98783097D-03 1.98783097D-03 1.98783097D-03 1.98783097D-03 1.98783097D-03 4.96663759D-03 1.98783097D-03 5.88703807D-03 2.82001449D-03 3.17582488D-03 1.98783097D-03 1.98783097D-03 5.88703807D-03 4.19620611D-03 3.78158386D-03 4.96663759D-03 1.98783097D-03 3.78158386D-03 3.78158386D-03 3.78158386D-03 4.96663759D-03 4.96663759D-03 3.78158386D-03 4.96663759D-03 4.96663759D-03 3.78158386D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 3.78158386D-03 4.96663759D-03 5.88703807D-03 3.78158386D-03 3.50692749D-01 1.98783097D-03 1.98783097D-03 4.19620611D-03 2.45832372D-03 2.45832372D-03 3.78158386D-03 1.98783097D-03 4.96663759D-03 3.78158386D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 3.69630684D-03 4.96663759D-03 4.96663759D-03 4.96663759D-03 1.00000000D+00 9.10336524D-03 9.10336524D-03 9.10336524D-03 9.10336524D-03 9.10336524D-03 2.27449480D-02 9.10336524D-03 2.69599687D-02 1.29143884D-02 1.45438388D-02 9.10336524D-03 9.10336524D-03 2.69599687D-02 1.92167219D-02 1.73179395D-02 2.27449480D-02 9.10336524D-03 1.73179395D-02 1.73179395D-02 1.73179395D-02 2.27449480D-02 2.27449480D-02 1.73179395D-02 2.27449480D-02 2.27449480D-02 1.73179395D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 1.73179395D-02 2.27449480D-02 2.69599687D-02 1.73179395D-02 1.45438388D-02 2.26623222D-01 9.10336524D-03 1.92167219D-02 1.12580080D-02 1.12580080D-02 1.73179395D-02 9.10336524D-03 2.27449480D-02 1.73179395D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 1.69274099D-02 2.27449480D-02 2.27449480D-02 2.27449480D-02 1.00000000D+00 1.34661812D-02 1.34661812D-02 1.34661812D-02 1.34661812D-02 1.34661812D-02 3.36455368D-02 1.34661812D-02 3.98806147D-02 1.91036500D-02 2.15140190D-02 1.34661812D-02 1.34661812D-02 3.98806147D-02 2.84263939D-02 2.56176181D-02 3.36455368D-02 1.34661812D-02 2.56176181D-02 2.56176181D-02 2.56176181D-02 3.36455368D-02 3.36455368D-02 2.56176181D-02 3.36455368D-02 3.36455368D-02 2.56176181D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 2.56176181D-02 3.36455368D-02 3.98806147D-02 2.56176181D-02 2.15140190D-02 1.34661812D-02 2.30986029D-01 2.84263939D-02 1.66534446D-02 1.66534446D-02 2.56176181D-02 1.34661812D-02 3.36455368D-02 2.56176181D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 2.50399243D-02 3.36455368D-02 3.36455368D-02 3.36455368D-02 1.00000000D+00 3.16114078D-04 3.16114078D-04 3.16114078D-04 3.16114078D-04 3.16114078D-04 7.89817655D-04 3.16114078D-04 9.36184078D-04 4.48451785D-04 5.05034404D-04 3.16114078D-04 3.16114078D-04 9.36184078D-04 6.67300075D-04 6.01364998D-04 7.89817655D-04 3.16114078D-04 6.01364998D-04 6.01364998D-04 6.01364998D-04 7.89817655D-04 7.89817655D-04 6.01364998D-04 7.89817655D-04 7.89817655D-04 6.01364998D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 6.01364998D-04 7.89817655D-04 9.36184078D-04 6.01364998D-04 5.05034404D-04 3.16114078D-04 3.16114078D-04 4.59840149D-01 3.90934001D-04 3.90934001D-04 6.01364998D-04 3.16114078D-04 7.89817655D-04 6.01364998D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 5.87803836D-04 7.89817655D-04 7.89817655D-04 7.89817655D-04 1.00000000D+00 7.96811283D-03 7.96811283D-03 7.96811283D-03 7.96811283D-03 7.96811283D-03 1.99084971D-02 7.96811283D-03 2.35978737D-02 1.13038765D-02 1.27301235D-02 7.96811283D-03 7.96811283D-03 2.35978737D-02 1.68202631D-02 1.51582742D-02 1.99084971D-02 7.96811283D-03 1.51582742D-02 1.51582742D-02 1.51582742D-02 1.99084971D-02 1.99084971D-02 1.51582742D-02 1.99084971D-02 1.99084971D-02 1.51582742D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.51582742D-02 1.99084971D-02 2.35978737D-02 1.51582742D-02 1.27301235D-02 7.96811283D-03 7.96811283D-03 1.68202631D-02 2.78857887D-01 9.85405780D-03 1.51582742D-02 7.96811283D-03 1.99084971D-02 1.51582742D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.48164472D-02 1.99084971D-02 1.99084971D-02 1.99084971D-02 1.00000000D+00 2.63912370D-04 2.63912370D-04 2.63912370D-04 2.63912370D-04 2.63912370D-04 6.59390527D-04 2.63912370D-04 7.81586568D-04 3.74396332D-04 4.21635137D-04 2.63912370D-04 2.63912370D-04 7.81586568D-04 5.57104941D-04 5.02058130D-04 6.59390527D-04 2.63912370D-04 5.02058130D-04 5.02058130D-04 5.02058130D-04 6.59390527D-04 6.59390527D-04 5.02058130D-04 6.59390527D-04 6.59390527D-04 5.02058130D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 5.02058130D-04 6.59390527D-04 7.81586568D-04 5.02058130D-04 4.21635137D-04 2.63912370D-04 2.63912370D-04 5.57104941D-04 3.26376816D-04 2.69330204D-01 5.02058130D-04 2.63912370D-04 6.59390527D-04 5.02058130D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 4.90736391D-04 6.59390527D-04 6.59390527D-04 6.59390527D-04 1.00000000D+00 7.62254349D-04 7.62254349D-04 7.62254349D-04 7.62254349D-04 7.62254349D-04 1.90450845D-03 7.62254349D-04 2.25744559D-03 1.08136376D-03 1.21780287D-03 7.62254349D-04 7.62254349D-04 2.25744559D-03 1.60907849D-03 1.45008741D-03 1.90450845D-03 7.62254349D-04 1.45008741D-03 1.45008741D-03 1.45008741D-03 1.90450845D-03 1.90450845D-03 1.45008741D-03 1.90450845D-03 1.90450845D-03 1.45008741D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.45008741D-03 1.90450845D-03 2.25744559D-03 1.45008741D-03 1.21780287D-03 7.62254349D-04 7.62254349D-04 1.60907849D-03 9.42669634D-04 9.42669634D-04 4.15252656D-01 7.62254349D-04 1.90450845D-03 1.45008741D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.41738704D-03 1.90450845D-03 1.90450845D-03 1.90450845D-03 1.00000000D+00 1.50854530D-05 1.50854530D-05 1.50854530D-05 1.50854530D-05 1.50854530D-05 3.76913194D-05 1.50854530D-05 4.46761514D-05 2.14008123D-05 2.41010202D-05 1.50854530D-05 1.50854530D-05 4.46761514D-05 3.18445891D-05 2.86980667D-05 3.76913194D-05 1.50854530D-05 2.86980667D-05 2.86980667D-05 2.86980667D-05 3.76913194D-05 3.76913194D-05 2.86980667D-05 3.76913194D-05 3.76913194D-05 2.86980667D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 2.86980667D-05 3.76913194D-05 4.46761514D-05 2.86980667D-05 2.41010202D-05 1.50854530D-05 1.50854530D-05 3.18445891D-05 1.86559755D-05 1.86559755D-05 2.86980667D-05 2.17534930D-01 3.76913194D-05 2.86980667D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 2.80509066D-05 3.76913194D-05 3.76913194D-05 3.76913194D-05 1.00000000D+00 1.33195089D-03 1.33195089D-03 1.33195089D-03 1.33195089D-03 1.33195089D-03 3.32790706D-03 1.33195089D-03 3.94462375D-03 1.88955734D-03 2.12796894D-03 1.33195089D-03 1.33195089D-03 3.94462375D-03 2.81167752D-03 2.53385911D-03 3.32790706D-03 1.33195089D-03 2.53385911D-03 2.53385911D-03 2.53385911D-03 3.32790706D-03 3.32790706D-03 2.53385911D-03 3.32790706D-03 3.32790706D-03 2.53385911D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 2.53385911D-03 3.32790706D-03 3.94462375D-03 2.53385911D-03 2.12796894D-03 1.33195089D-03 1.33195089D-03 2.81167752D-03 1.64720556D-03 1.64720556D-03 2.53385911D-03 1.33195089D-03 5.46805799D-01 2.53385911D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 2.47671921D-03 3.32790706D-03 3.32790706D-03 3.32790706D-03 1.00000000D+00 1.33274659D-03 1.33274659D-03 1.33274659D-03 1.33274659D-03 1.33274659D-03 3.32989520D-03 1.33274659D-03 3.94698046D-03 1.89068634D-03 2.12924019D-03 1.33274659D-03 1.33274659D-03 3.94698046D-03 2.81335716D-03 2.53537297D-03 3.32989520D-03 1.33274659D-03 2.53537297D-03 2.53537297D-03 2.53537297D-03 3.32989520D-03 3.32989520D-03 2.53537297D-03 3.32989520D-03 3.32989520D-03 2.53537297D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 2.53537297D-03 3.32989520D-03 3.94698046D-03 2.53537297D-03 2.12924019D-03 1.33274659D-03 1.33274659D-03 2.81335716D-03 1.64818950D-03 1.64818950D-03 2.53537297D-03 1.33274659D-03 3.32989520D-03 4.16337937D-01 3.32989520D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 2.47819885D-03 3.32989520D-03 3.32989520D-03 3.32989520D-03 1.00000000D+00 1.33454381D-03 1.33454381D-03 1.33454381D-03 1.33454381D-03 1.33454381D-03 3.33438558D-03 1.33454381D-03 3.95230297D-03 1.89323595D-03 2.13211169D-03 1.33454381D-03 1.33454381D-03 3.95230297D-03 2.81715114D-03 2.53879209D-03 3.33438558D-03 1.33454381D-03 2.53879209D-03 2.53879209D-03 2.53879209D-03 3.33438558D-03 3.33438558D-03 2.53879209D-03 3.33438558D-03 3.33438558D-03 2.53879209D-03 3.33438558D-03 3.33438558D-03 3.33438558D-03 2.53879209D-03 3.33438558D-03 3.95230297D-03 2.53879209D-03 2.13211169D-03 1.33454381D-03 1.33454381D-03 2.81715114D-03 1.65041210D-03 1.65041210D-03 2.53879209D-03 1.33454381D-03 3.33438558D-03 2.53879209D-03 5.46812296D-01 3.33438558D-03 3.33438558D-03 3.33438558D-03 3.33438558D-03 3.33438558D-03 3.33438558D-03 2.48154067D-03 3.33438558D-03 3.33438558D-03 3.33438558D-03 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 1.15508148D-02 1.15508148D-02 1.15508148D-02 1.15508148D-02 1.15508148D-02 2.88599506D-02 1.15508148D-02 3.42081785D-02 1.63864344D-02 1.84539650D-02 1.15508148D-02 1.15508148D-02 3.42081785D-02 2.43831556D-02 2.19738856D-02 2.88599506D-02 1.15508148D-02 2.19738856D-02 2.19738856D-02 2.19738856D-02 2.88599506D-02 2.88599506D-02 2.19738856D-02 2.88599506D-02 2.88599506D-02 2.19738856D-02 2.88599506D-02 2.88599506D-02 2.88599506D-02 2.19738856D-02 2.88599506D-02 3.42081785D-02 2.19738856D-02 1.84539650D-02 1.15508148D-02 1.15508148D-02 2.43831556D-02 1.42847355D-02 1.42847355D-02 2.19738856D-02 1.15508148D-02 2.88599506D-02 2.19738856D-02 2.88599506D-02 2.88599506D-02 2.88599506D-02 5.72337866D-01 2.88599506D-02 2.88599506D-02 2.88599506D-02 2.14783605D-02 2.88599506D-02 2.88599506D-02 2.88599506D-02 1.00000000D+00 5.04734591D-02 5.04734591D-02 5.04734591D-02 5.04734591D-02 5.04734591D-02 1.26108989D-01 5.04734591D-02 1.49479091D-01 7.16036186D-02 8.06380734D-02 5.04734591D-02 5.04734591D-02 1.49479091D-01 1.06546797D-01 9.60190371D-02 1.26108989D-01 5.04734591D-02 9.60190371D-02 9.60190371D-02 9.60190371D-02 1.26108989D-01 1.26108989D-01 9.60190371D-02 1.26108989D-01 1.26108989D-01 9.60190371D-02 1.26108989D-01 1.26108989D-01 1.26108989D-01 9.60190371D-02 1.26108989D-01 1.49479091D-01 9.60190371D-02 8.06380734D-02 5.04734591D-02 5.04734591D-02 1.06546797D-01 6.24198392D-02 6.24198392D-02 9.60190371D-02 5.04734591D-02 1.26108989D-01 9.60190371D-02 1.26108989D-01 1.26108989D-01 1.26108989D-01 1.26108989D-01 6.69586897D-01 1.26108989D-01 1.26108989D-01 9.38537493D-02 1.26108989D-01 1.26108989D-01 1.26108989D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 2.13428419D-02 2.13428419D-02 2.13428419D-02 2.13428419D-02 2.13428419D-02 5.33255301D-02 2.13428419D-02 6.32076487D-02 3.02777849D-02 3.40980291D-02 2.13428419D-02 2.13428419D-02 6.32076487D-02 4.50536050D-02 4.06019129D-02 5.33255301D-02 2.13428419D-02 4.06019129D-02 4.06019129D-02 4.06019129D-02 5.33255301D-02 5.33255301D-02 4.06019129D-02 5.33255301D-02 5.33255301D-02 4.06019129D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 4.06019129D-02 5.33255301D-02 6.32076487D-02 4.06019129D-02 3.40980291D-02 2.13428419D-02 2.13428419D-02 4.50536050D-02 2.63944026D-02 2.63944026D-02 4.06019129D-02 2.13428419D-02 5.33255301D-02 4.06019129D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 5.96803427D-01 3.96863185D-02 5.33255301D-02 5.33255301D-02 5.33255301D-02 1.00000000D+00 4.13307510D-02 4.13307510D-02 4.13307510D-02 4.13307510D-02 4.13307510D-02 1.03265740D-01 4.13307510D-02 1.22402608D-01 5.86334132D-02 6.60313815D-02 4.13307510D-02 4.13307510D-02 1.22402608D-01 8.72470215D-02 7.86262453D-02 1.03265740D-01 4.13307510D-02 7.86262453D-02 7.86262453D-02 7.86262453D-02 1.03265740D-01 1.03265740D-01 7.86262453D-02 1.03265740D-01 1.03265740D-01 7.86262453D-02 1.03265740D-01 1.03265740D-01 1.03265740D-01 7.86262453D-02 1.03265740D-01 1.22402608D-01 7.86262453D-02 6.60313815D-02 4.13307510D-02 4.13307510D-02 8.72470215D-02 5.11131771D-02 5.11131771D-02 7.86262453D-02 4.13307510D-02 1.03265740D-01 7.86262453D-02 1.03265740D-01 1.03265740D-01 1.03265740D-01 1.03265740D-01 1.03265740D-01 1.03265740D-01 1.03265740D-01 4.81324255D-01 1.03265740D-01 1.03265740D-01 1.03265740D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 5.43477893D-01 1.00000000D+00 1.00000000D+00 -3.80239636D-02 1.00000000D+00 1.00000000D+00 -4.53596498D-04 1.00000000D+00 1.00000000D+00 -1.04409068D-04 1.00000000D+00 1.00000000D+00 -1.56986958D-03 1.00000000D+00 1.00000000D+00 -1.51058435D-02 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -6.02873974D-04 1.00000000D+00 1.00000000D+00 -2.16793314D-01 1.00000000D+00 1.00000000D+00 -5.40687004D-03 1.00000000D+00 1.00000000D+00 -2.17261910D-02 1.00000000D+00 1.00000000D+00 -1.60277095D-02 1.00000000D+00 1.00000000D+00 -1.67879829D-04 1.00000000D+00 1.00000000D+00 -8.27674405D-04 1.00000000D+00 1.00000000D+00 -8.62984210D-02 1.00000000D+00 1.00000000D+00 -3.36676676D-05 1.00000000D+00 1.00000000D+00 -1.34372637D-02 1.00000000D+00 1.00000000D+00 -1.20522391D-05 1.00000000D+00 1.00000000D+00 -1.49709766D-03 1.00000000D+00 1.00000000D+00 -7.59160030D-05 1.00000000D+00 1.00000000D+00 -1.57006609D-04 1.00000000D+00 1.00000000D+00 -1.17640331D-04 1.00000000D+00 1.00000000D+00 -5.89511671D-07 1.00000000D+00 1.00000000D+00 -1.72268410D-05 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -5.83616551D-04 1.00000000D+00 1.00000000D+00 -4.50151134D-03 1.00000000D+00 1.00000000D+00 -1.43061380D-03 1.00000000D+00 1.00000000D+00 -2.23359420D-05 1.00000000D+00 1.00000000D+00 -2.10586673D-04 1.00000000D+00 1.00000000D+00 -1.93471182D-03 1.00000000D+00 1.00000000D+00 -1.85886130D-03 1.00000000D+00 1.00000000D+00 -1.56698748D-02 1.00000000D+00 1.00000000D+00 -1.45537336D-03 1.00000000D+00 1.00000000D+00 -1.11717703D-02 1.00000000D+00 1.00000000D+00 -4.73823305D-03 1.00000000D+00 1.00000000D+00 -1.16330304D-03 1.00000000D+00 1.00000000D+00 -4.46149008D-03 1.00000000D+00 1.00000000D+00 -1.20798806D-02 1.00000000D+00 1.00000000D+00 -4.05453029D-05 1.00000000D+00 1.00000000D+00 -2.53228028D-03 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -7.26409417D-05 1.00000000D+00 1.00000000D+00 -4.11937665D-03 1.00000000D+00 1.00000000D+00 -6.60947384D-03 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -2.41819128D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -2.65067309D-01 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 2.50000000D+00 2.70000005D+00 2.50000000D+00 2.70000005D+00 2.90000010D+00 2.90000010D+00 2.90000010D+00 2.90000010D+00 1.66986734D-01 -5.71339190D-01 1.00000000D+00 2.40000010D+00 1.50000000D+00 2.40000010D+00 1.89999998D+00 1.60000002D+00 2.09999990D+00 1.79999995D+00 1.79999995D+00 1.79999995D+00 1.79999995D+00 1.79999995D+00 1.79999995D+00 1.89999998D+00 1.89999998D+00 1.79999995D+00 2.20000005D+00 2.59999990D+00 2.59999990D+00 2.20000005D+00 1.50000000D+00 3.00000000D+00 1.89999998D+00 2.40000010D+00 2.40000010D+00 2.40000010D+00 2.40000010D+00 1.89999998D+00 2.20000005D+00 1.70000005D+00 2.20000005D+00 2.90000010D+00 2.20000005D+00 2.59999990D+00 1.79999995D+00 1.19615935D-01 -4.09261674D-01 1.00000000D+00 1.70000005D+00 1.70000005D+00 1.70000005D+00 5.66986762D-03 -1.93992499D-02 1.00000000D+00 1.60000002D+00 1.60000002D+00 1.60000002D+00 1.50000000D+00 1.50000000D+00 1.60000002D+00 1.70000005D+00 -6.00000000D+01 1.00000000D+00 -3.60000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -3.60000000D+01 1.00000000D+00 -4.10000000D+01 1.00000000D+00 -4.10000000D+01 1.00000000D+00 -4.10000000D+01 1.00000000D+00 -4.10000000D+01 1.00000000D+00 -1.90000000D+01 1.00000000D+00 -3.30000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -3.20000000D+01 1.00000000D+00 -2.60000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -3.10000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -3.10000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -4.10000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -2.80000000D+01 1.00000000D+00 -2.80000000D+01 1.00000000D+00 -3.10000000D+01 1.00000000D+00 -2.30000000D+01 1.00000000D+00 -1.50000000D+01 1.00000000D+00 -4.50000000D+01 1.00000000D+00 -1.50000000D+01 1.00000000D+00 -4.90000000D+01 1.00000000D+00 -2.60000000D+01 1.00000000D+00 -1.50000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -6.00000000D+01 1.00000000D+00 -8.00000000D+00 1.00000000D+00 -2.50000000D+01 1.00000000D+00 -9.00000000D+00 1.00000000D+00 -3.10000000D+01 1.00000000D+00 -2.10000000D+01 1.00000000D+00 -3.00000000D+01 1.00000000D+00 -8.00000000D+00 1.00000000D+00 -8.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -8.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.36076880D+07 1.00000000D+00 -1.52668730D+07 1.00000000D+02 1.00000000D+00 1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 -4.95945245D-01 -4.95945245D-01 -4.95945245D-01 -4.95945245D-01 -4.95945245D-01 -1.23912954D+00 -4.95945245D-01 -1.46876097D+00 -7.03567266D-01 -7.92338610D-01 -4.95945245D-01 -4.95945245D-01 -1.46876097D+00 -1.04691410D+00 -9.43469822D-01 -1.23912954D+00 -4.95945245D-01 -9.43469822D-01 -9.43469822D-01 -9.43469822D-01 -1.23912954D+00 -1.23912954D+00 -9.43469822D-01 -1.23912954D+00 -1.23912954D+00 -9.43469822D-01 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -9.43469822D-01 -1.23912954D+00 -1.46876097D+00 -9.43469822D-01 -7.92338610D-01 -4.95945245D-01 -4.95945245D-01 -1.04691410D+00 -6.13328755D-01 -6.13328755D-01 -9.43469822D-01 -4.95945245D-01 -1.23912954D+00 -9.43469822D-01 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -9.22194004D-01 -1.23912954D+00 -1.23912954D+00 -1.23912954D+00 -1.00000000D+00 -2.92272508D-01 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 -1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00 1.00000000D+00