#include <stdio.h>
#include <malloc.h>
Go to the source code of this file.
Classes | |
struct | AllocationRecord |
struct | FillinListNodeStruct |
struct | MatrixElement |
struct | MatrixFrame |
Defines | |
#define | ABORT() |
#define | ABSS(a) ((a) < 0.0 ? -(a) : (a)) |
#define | ALLOC(type, number) ((type *)malloc((unsigned)(sizeof(type)*(number)))) |
#define | ASSERT(condition) if (!(condition)) ABORT() |
#define | BOOLEAN int |
#define | CALLOC(ptr, type, number) |
#define | CMPLX_1_NORM(a) (ABSS((a).Real) + ABSS((a).Imag)) |
#define | CMPLX_2_NORM(a) (sqrt((a).Real*(a).Real + (a).Imag*(a).Imag)) |
#define | CMPLX_ADD(to, from_a, from_b) { (to).Real = (from_a).Real + (from_b).Real; (to).Imag = (from_a).Imag + (from_b).Imag; } |
#define | CMPLX_ADD_ASSIGN(to, from) { (to).Real += (from).Real; (to).Imag += (from).Imag; } |
#define | CMPLX_ASSIGN(to, from) { (to).Real = (from).Real; (to).Imag = (from).Imag; } |
#define | CMPLX_CONJ(a) (a).Imag = -(a).Imag |
#define | CMPLX_CONJ_ASSIGN(to, from) { (to).Real = (from).Real; (to).Imag = -(from).Imag; } |
#define | CMPLX_CONJ_MULT(to, from_a, from_b) |
#define | CMPLX_CONJ_MULT_ADD(to, mult_a, mult_b, add) |
#define | CMPLX_CONJ_MULT_ADD_ASSIGN(to, from_a, from_b) |
#define | CMPLX_CONJ_MULT_SUBT_ASSIGN(to, from_a, from_b) |
#define | CMPLX_CONJ_NEGATE_ASSIGN(to, from) { (to).Real = -(from).Real; (to).Imag = (from).Imag; } |
#define | CMPLX_DIV(to, num, den) |
#define | CMPLX_DIV_ASSIGN(num, den) |
#define | CMPLX_INF_NORM(a) (MAX (ABSS((a).Real),ABSS((a).Imag))) |
#define | CMPLX_MULT(to, from_a, from_b) |
#define | CMPLX_MULT_ADD(to, mult_a, mult_b, add) |
#define | CMPLX_MULT_ADD_ASSIGN(to, from_a, from_b) |
#define | CMPLX_MULT_ASSIGN(to, from) |
#define | CMPLX_MULT_SUBT(to, mult_a, mult_b, subt) |
#define | CMPLX_MULT_SUBT_ASSIGN(to, from_a, from_b) |
#define | CMPLX_NEGATE(a) { (a).Real = -(a).Real; (a).Imag = -(a).Imag; } |
#define | CMPLX_NEGATE_ASSIGN(to, from) { (to).Real = -(from).Real; (to).Imag = -(from).Imag; } |
#define | CMPLX_RECIPROCAL(to, den) |
#define | CMPLX_SUBT(to, from_a, from_b) { (to).Real = (from_a).Real - (from_b).Real; (to).Imag = (from_a).Imag - (from_b).Imag; } |
#define | CMPLX_SUBT_ASSIGN(to, from) { (to).Real -= (from).Real; (to).Imag -= (from).Imag; } |
#define | ELEMENT_MAG(ptr) ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real) |
#define | FREE(ptr) { if ((ptr) != NULL) free((char *)(ptr)); (ptr) = NULL; } |
#define | IS_FACTORED(matrix) ((matrix)->Factored && !(matrix)->NeedsOrdering) |
#define | IS_SPARSE(matrix) ((matrix) != NULL && (matrix)->ID == SPARSE_ID) |
#define | IS_VALID(matrix) ((matrix) != NULL && (matrix)->ID == SPARSE_ID && (matrix)->Error >= spOKAY && (matrix)->Error < spFATAL) |
#define | LINT NO |
#define | MAX(a, b) ((a) > (b) ? (a) : (b)) |
#define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
#define | REALLOC(ptr, type, number) ptr = (type *)realloc((char *)ptr,(unsigned)(sizeof(type)*(number))) |
#define | SCLR_MULT(to, sclr, cmplx) { (to).Real = (sclr) * (cmplx).Real; (to).Imag = (sclr) * (cmplx).Imag; } |
#define | SCLR_MULT_ASSIGN(to, sclr) { (to).Real *= (sclr); (to).Imag *= (sclr); } |
#define | SPARSE_ID 0x772773 |
#define | SQR(a) ((a)*(a)) |
#define | SWAP(type, a, b) {type swapx; swapx = a; a = b; b = swapx;} |
Typedefs | |
typedef struct AllocationRecord * | AllocationListPtr |
typedef ElementPtr * | ArrayOfElementPtrs |
typedef struct MatrixElement * | ElementPtr |
typedef struct MatrixFrame * | MatrixPtr |
#define ABORT | ( | ) |
#define ABSS | ( | a | ) | ((a) < 0.0 ? -(a) : (a)) |
Definition at line 87 of file spdefs.h.
Referenced by CountTwins(), RealRowColElimination(), spCondition(), spDeterminant(), spLargestElement(), and spNorm().
Definition at line 292 of file spdefs.h.
Referenced by AllocateBlockOfAllocationList(), CheckOutComplexArray(), CreateInternalVectors(), EnlargeVectors(), InitializeElementBlocks(), spcGetElement(), spcGetFillin(), spCondition(), and spCreate().
#define ASSERT | ( | condition | ) | if (!(condition)) ABORT() |
Definition at line 277 of file spdefs.h.
Referenced by spClear(), spCondition(), spDestroy(), spDeterminant(), spElementCount(), spError(), spFactor(), spFileStats(), spFileVector(), spGetElement(), spGetSize(), spLargestElement(), spMNA_Preorder(), spMultiply(), spMultTransposed(), spNorm(), spOrderAndFactor(), spPartition(), spPrint(), spPseudoCondition(), spRoundoff(), spScale(), spSolveTransposed(), spStripFills(), and spWhereSingular().
#define BOOLEAN int |
Definition at line 77 of file spdefs.h.
Referenced by CreateInternalVectors(), main(), spMNA_Preorder(), and spPartition().
#define CALLOC | ( | ptr, | |||
type, | |||||
number | ) |
#define CMPLX_1_NORM | ( | a | ) | (ABSS((a).Real) + ABSS((a).Imag)) |
Definition at line 111 of file spdefs.h.
Referenced by spLargestElement().
#define CMPLX_2_NORM | ( | a | ) | (sqrt((a).Real*(a).Real + (a).Imag*(a).Imag)) |
#define CMPLX_ADD | ( | to, | |||
from_a, | |||||
from_b | ) | { (to).Real = (from_a).Real + (from_b).Real; (to).Imag = (from_a).Imag + (from_b).Imag; } |
#define CMPLX_ADD_ASSIGN | ( | to, | |||
from | ) | { (to).Real += (from).Real; (to).Imag += (from).Imag; } |
#define CMPLX_ASSIGN | ( | to, | |||
from | ) | { (to).Real = (from).Real; (to).Imag = (from).Imag; } |
#define CMPLX_CONJ_ASSIGN | ( | to, | |||
from | ) | { (to).Real = (from).Real; (to).Imag = -(from).Imag; } |
#define CMPLX_CONJ_MULT | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_CONJ_MULT_ADD | ( | to, | |||
mult_a, | |||||
mult_b, | |||||
add | ) |
#define CMPLX_CONJ_MULT_ADD_ASSIGN | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_CONJ_MULT_SUBT_ASSIGN | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_CONJ_NEGATE_ASSIGN | ( | to, | |||
from | ) | { (to).Real = -(from).Real; (to).Imag = (from).Imag; } |
#define CMPLX_DIV | ( | to, | |||
num, | |||||
den | ) |
{ double r_, s_; \ if (((den).Real >= (den).Imag && (den).Real > -(den).Imag) || \ ((den).Real < (den).Imag && (den).Real <= -(den).Imag)) \ { r_ = (den).Imag / (den).Real; \ s_ = (den).Real + r_*(den).Imag; \ (to).Real = ((num).Real + r_*(num).Imag)/s_; \ (to).Imag = ((num).Imag - r_*(num).Real)/s_; \ } \ else \ { r_ = (den).Real / (den).Imag; \ s_ = (den).Imag + r_*(den).Real; \ (to).Real = (r_*(num).Real + (num).Imag)/s_; \ (to).Imag = (r_*(num).Imag - (num).Real)/s_; \ } \ }
#define CMPLX_DIV_ASSIGN | ( | num, | |||
den | ) |
{ double r_, s_, t_; \ if (((den).Real >= (den).Imag && (den).Real > -(den).Imag) || \ ((den).Real < (den).Imag && (den).Real <= -(den).Imag)) \ { r_ = (den).Imag / (den).Real; \ s_ = (den).Real + r_*(den).Imag; \ t_ = ((num).Real + r_*(num).Imag)/s_; \ (num).Imag = ((num).Imag - r_*(num).Real)/s_; \ (num).Real = t_; \ } \ else \ { r_ = (den).Real / (den).Imag; \ s_ = (den).Imag + r_*(den).Real; \ t_ = (r_*(num).Real + (num).Imag)/s_; \ (num).Imag = (r_*(num).Imag - (num).Real)/s_; \ (num).Real = t_; \ } \ }
#define CMPLX_INF_NORM | ( | a | ) | (MAX (ABSS((a).Real),ABSS((a).Imag))) |
#define CMPLX_MULT | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_MULT_ADD | ( | to, | |||
mult_a, | |||||
mult_b, | |||||
add | ) |
#define CMPLX_MULT_ADD_ASSIGN | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_MULT_ASSIGN | ( | to, | |||
from | ) |
{ double to_real_ = (to).Real; \
(to).Real = to_real_ * (from).Real - (to).Imag * (from).Imag; \
(to).Imag = to_real_ * (from).Imag + (to).Imag * (from).Real; }
Definition at line 142 of file spdefs.h.
Referenced by spDeterminant().
#define CMPLX_MULT_SUBT | ( | to, | |||
mult_a, | |||||
mult_b, | |||||
subt | ) |
#define CMPLX_MULT_SUBT_ASSIGN | ( | to, | |||
from_a, | |||||
from_b | ) |
#define CMPLX_NEGATE | ( | a | ) | { (a).Real = -(a).Real; (a).Imag = -(a).Imag; } |
Definition at line 108 of file spdefs.h.
Referenced by spDeterminant().
#define CMPLX_NEGATE_ASSIGN | ( | to, | |||
from | ) | { (to).Real = -(from).Real; (to).Imag = -(from).Imag; } |
#define CMPLX_RECIPROCAL | ( | to, | |||
den | ) |
{ double r_; \ if (((den).Real >= (den).Imag && (den).Real > -(den).Imag) || \ ((den).Real < (den).Imag && (den).Real <= -(den).Imag)) \ { r_ = (den).Imag / (den).Real; \ (to).Imag = -r_*((to).Real = 1.0/((den).Real + r_*(den).Imag)); \ } \ else \ { r_ = (den).Real / (den).Imag; \ (to).Real = -r_*((to).Imag = -1.0/((den).Imag + r_*(den).Real));\ } \ }
Definition at line 253 of file spdefs.h.
Referenced by spDeterminant(), and spLargestElement().
#define CMPLX_SUBT | ( | to, | |||
from_a, | |||||
from_b | ) | { (to).Real = (from_a).Real - (from_b).Real; (to).Imag = (from_a).Imag - (from_b).Imag; } |
#define CMPLX_SUBT_ASSIGN | ( | to, | |||
from | ) | { (to).Real -= (from).Real; (to).Imag -= (from).Imag; } |
#define ELEMENT_MAG | ( | ptr | ) | ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real) |
Definition at line 99 of file spdefs.h.
Referenced by FindBiggestInColExclude(), FindLargestInCol(), QuicklySearchDiagonal(), SearchDiagonal(), SearchEntireMatrix(), SearchForSingleton(), spFileStats(), spOrderAndFactor(), spPrint(), and spPseudoCondition().
#define FREE | ( | ptr | ) | { if ((ptr) != NULL) free((char *)(ptr)); (ptr) = NULL; } |
Definition at line 294 of file spdefs.h.
Referenced by EnlargeMatrix(), RecordAllocation(), spCondition(), spDestroy(), and spPrint().
Definition at line 82 of file spdefs.h.
Referenced by spCondition(), spDeterminant(), spNorm(), spPseudoCondition(), spRoundoff(), and spSolveTransposed().
Definition at line 80 of file spdefs.h.
Referenced by spClear(), spCondition(), spDestroy(), spDeterminant(), spElementCount(), spFileStats(), spFileVector(), spGetElement(), spGetSize(), spLargestElement(), spMultiply(), spMultTransposed(), spNorm(), spPartition(), spPrint(), spPseudoCondition(), spRoundoff(), spStripFills(), and spWhereSingular().
#define IS_VALID | ( | matrix | ) | ((matrix) != NULL && (matrix)->ID == SPARSE_ID && (matrix)->Error >= spOKAY && (matrix)->Error < spFATAL) |
Definition at line 81 of file spdefs.h.
Referenced by spFactor(), spMNA_Preorder(), spOrderAndFactor(), spScale(), and spSolveTransposed().
#define MAX | ( | a, | |||
b | ) | ((a) > (b) ? (a) : (b)) |
Definition at line 83 of file spdefs.h.
Referenced by DGETF2(), DGETRF(), DPOTF2(), DPOTRF(), EnlargeMatrix(), EnlargeVectors(), InterpretCommandLine(), QuicklySearchDiagonal(), ReadMatrixFromFile(), spCondition(), spCreate(), spGetElement(), ZGETF2(), ZGETRF(), ZPOTF2(), and ZSYR().
#define MIN | ( | a, | |||
b | ) | ((a) < (b) ? (a) : (b)) |
Definition at line 84 of file spdefs.h.
Referenced by DGETF2(), DGETRF(), DPOTRF(), ILAENV(), main(), ReadMatrixFromFile(), spCondition(), spFileStats(), ZGETF2(), and ZGETRF().
#define REALLOC | ( | ptr, | |||
type, | |||||
number | ) | ptr = (type *)realloc((char *)ptr,(unsigned)(sizeof(type)*(number))) |
Definition at line 293 of file spdefs.h.
Referenced by EnlargeMatrix().
#define SCLR_MULT | ( | to, | |||
sclr, | |||||
cmplx | ) | { (to).Real = (sclr) * (cmplx).Real; (to).Imag = (sclr) * (cmplx).Imag; } |
#define SCLR_MULT_ASSIGN | ( | to, | |||
sclr | ) | { (to).Real *= (sclr); (to).Imag *= (sclr); } |
#define SPARSE_ID 0x772773 |
Definition at line 79 of file spdefs.h.
Referenced by spCreate(), and spError().
#define SQR | ( | a | ) | ((a)*(a)) |
Definition at line 90 of file spdefs.h.
Referenced by spCondition(), and spRoundoff().
Definition at line 93 of file spdefs.h.
Referenced by ExchangeRowsAndCols(), spcColExchange(), spcRowExchange(), and SwapCols().
typedef struct AllocationRecord* AllocationListPtr |
typedef ElementPtr* ArrayOfElementPtrs |
typedef struct MatrixElement* ElementPtr |
typedef struct MatrixFrame* MatrixPtr |