📄 spconfig.h
字号:
* FORTRAN * This specifies that the FORTRAN interface routines should be * compiled. When interfacing to FORTRAN programs, the ARRAY_OFFSET * options should be set to NO. * DEBUG * This specifies that additional error checking will be compiled. * The type of error checked are those that are common when the * matrix routines are first integrated into a user's program. Once * the routines have been integrated in and are running smoothly, this * option should be turned off. * spCOMPATIBILITY * This specifies that Sparse1.3 should be configured to be upward * compatible from Sparse1.2. This option is not suggested for use * in new software. Sparse1.3, when configured to be compatible with * Sparse1.2, is not completely compatible. In particular, if * recompiling the calling program, it is necessary to change the * of the Sparse include files. This option will go away in future * versions of Sparse. [0] *//* Begin options. */#define REAL YES#define EXPANDABLE YES#define TRANSLATE YES#define INITIALIZE NO#define DIAGONAL_PIVOTING YES#define ARRAY_OFFSET YES#define MODIFIED_MARKOWITZ NO#define DELETE NO#define STRIP NO#define MODIFIED_NODAL YES#define QUAD_ELEMENT NO#define TRANSPOSE YES#define SCALING NO#define DOCUMENTATION YES#define MULTIPLICATION YES#define DETERMINANT YES#define DETERMINANT2 YES#define STABILITY NO#define CONDITION NO#define PSEUDOCONDITION NO#define FORTRAN NO#ifdef HAS_MINDATA# define DEBUG NO#else# define DEBUG YES#endif/* * The following options affect Sparse exports and so are exported as a * side effect. For this reason they use the `sp' prefix. The boolean * constants YES an NO are not defined in spMatrix.h to avoid conflicts * with user code, so use 0 for NO and 1 for YES. */#endif /* spINSIDE_SPARSE */#define spCOMPLEX 1#define spSEPARATED_COMPLEX_VECTORS 1#define spCOMPATIBILITY 0#ifdef spINSIDE_SPARSE/* * MATRIX CONSTANTS * * These constants are used throughout the sparse matrix routines. They * should be set to suit the type of matrix being solved. Recommendations * are given in brackets. * * Some terminology should be defined. The Markowitz row count is the number * of non-zero elements in a row excluding the one being considered as pivot. * There is one Markowitz row count for every row. The Markowitz column * is defined similarly for columns. The Markowitz product for an element * is the product of its row and column counts. It is a measure of how much * work would be required on the next step of the factorization if that * element were chosen to be pivot. A small Markowitz product is desirable. * * >>> Constants descriptions: * DEFAULT_THRESHOLD * The relative threshold used if the user enters an invalid * threshold. Also the threshold used by spFactor() when * calling spOrderAndFactor(). The default threshold should * not be less than or equal to zero nor larger than one. [0.001] * DIAG_PIVOTING_AS_DEFAULT * This indicates whether spOrderAndFactor() should use diagonal * pivoting as default. This issue only arises when * spOrderAndFactor() is called from spFactor(). * SPACE_FOR_ELEMENTS * This number multiplied by the size of the matrix equals the number * of elements for which memory is initially allocated in * spCreate(). [6] * SPACE_FOR_FILL_INS * This number multiplied by the size of the matrix equals the number * of elements for which memory is initially allocated and specifically * reserved for fill-ins in spCreate(). [4] * ELEMENTS_PER_ALLOCATION * The number of matrix elements requested from the malloc utility on * each call to it. Setting this value greater than 1 reduces the * amount of overhead spent in this system call. On a virtual memory * machine, its good to allocate slightly less than a page worth of * elements at a time (or some multiple thereof). * [For the VAX, for real only use 41, otherwise use 31] * MINIMUM_ALLOCATED_SIZE * The minimum allocated size of a matrix. Note that this does not * limit the minimum size of a matrix. This just prevents having to * resize a matrix many times if the matrix is expandable, large and * allocated with an estimated size of zero. This number should not * be less than one. * EXPANSION_FACTOR * The amount the allocated size of the matrix is increased when it * is expanded. * MAX_MARKOWITZ_TIES * This number is used for two slightly different things, both of which * relate to the search for the best pivot. First, it is the maximum * number of elements that are Markowitz tied that will be sifted * through when trying to find the one that is numerically the best. * Second, it creates an upper bound on how large a Markowitz product * can be before it eliminates the possibility of early termination * of the pivot search. In other words, if the product of the smallest * Markowitz product yet found and TIES_MULTIPLIER is greater than * MAX_MARKOWITZ_TIES, then no early termination takes place. * Set MAX_MARKOWITZ_TIES to some small value if no early termination of * the pivot search is desired. An array of RealNumbers is allocated * of size MAX_MARKOWITZ_TIES so it must be positive and shouldn't * be too large. Active when MODIFIED_MARKOWITZ is 1 (true). [100] * TIES_MULTIPLIER * Specifies the number of Markowitz ties that are allowed to occur * before the search for the pivot is terminated early. Set to some * large value if no early termination of the pivot search is desired. * This number is multiplied times the Markowitz product to determine * how many ties are required for early termination. This means that * more elements will be searched before early termination if a large * number of fill-ins could be created by accepting what is currently * considered the best choice for the pivot. Active when * MODIFIED_MARKOWITZ is 1 (true). Setting this number to zero * effectively eliminates all pivoting, which should be avoided. * This number must be positive. TIES_MULTIPLIER is also used when * diagonal pivoting breaks down. [5] * DEFAULT_PARTITION * Which partition mode is used by spPartition() as default. * Possibilities include * spDIRECT_PARTITION -- each row used direct addressing, best for * a few relatively dense matrices. * spINDIRECT_PARTITION -- each row used indirect addressing, best * for a few very sparse matrices. * spAUTO_PARTITION -- direct or indirect addressing is chosen on * a row-by-row basis, carries a large overhead, but speeds up * both dense and sparse matrices, best if there is a large * number of matrices that can use the same ordering. *//* Begin constants. */#define DEFAULT_THRESHOLD 1.0e-3#define DIAG_PIVOTING_AS_DEFAULT YES#define SPACE_FOR_ELEMENTS 6#define SPACE_FOR_FILL_INS 4#define ELEMENTS_PER_ALLOCATION 31#define MINIMUM_ALLOCATED_SIZE 6#define EXPANSION_FACTOR 1.5#define MAX_MARKOWITZ_TIES 100#define TIES_MULTIPLIER 5#define DEFAULT_PARTITION spAUTO_PARTITION/* * PRINTER WIDTH * * This macro characterize the printer for the spPrint() routine. * * >>> Macros: * PRINTER_WIDTH * The number of characters per page width. Set to 80 for terminal, * 132 for line printer. *//* Begin printer constants. */#define PRINTER_WIDTH 80/* * MACHINE CONSTANTS * * These numbers must be updated when the program is ported to a new machine. *//* Begin machine constants. *//* * Grab from Spice include files */#include "spice.h"#define MACHINE_RESOLUTION DBL_EPSILON#define LARGEST_REAL DBL_MAX#define SMALLEST_REAL DBL_MIN#define LARGEST_SHORT_INTEGER SHRT_MAX#define LARGEST_LONG_INTEGER LONG_MAX/* * ANNOTATION * * This macro changes the amount of annotation produced by the matrix * routines. The annotation is used as a debugging aid. Change the number * associated with ANNOTATE to change the amount of annotation produced by * the program. *//* Begin annotation definitions. */#define ANNOTATE NONE#define NONE 0#define ON_STRANGE_BEHAVIOR 1#define FULL 2#endif /* spINSIDE_SPARSE */#endif /* spCONFIG_DEFS */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -