spDefs.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ComplexNumber
struct  MatrixElement
struct  AllocationRecord
struct  FillinListNodeStruct
struct  MatrixFrame

Defines

#define LINT   NO
#define SPBOOLEAN   int
#define NO   0
#define YES   1
#define NOT   !
#define AND   &&
#define OR   ||
#define NULL   0
#define SPARSE_ID   0x772773
#define IS_SPARSE(matrix)
#define IS_VALID(matrix)
#define IS_FACTORED(matrix)   ((matrix)->Factored && !(matrix)->NeedsOrdering)
#define MAX(a, b)   ((a) > (b) ? (a) : (b))
#define MIN(a, b)   ((a) < (b) ? (a) : (b))
#define ABS(a)   ((a) < 0.0 ? -(a) : (a))
#define SQR(a)   ((a)*(a))
#define SWAP(type, a, b)   {type swapx; swapx = a; a = b; b = swapx;}
#define ELEMENT_MAG(ptr)   ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real)
#define CMPLX_ASSIGN(to, from)
#define CMPLX_CONJ_ASSIGN(to, from)
#define CMPLX_NEGATE_ASSIGN(to, from)
#define CMPLX_CONJ_NEGATE_ASSIGN(to, from)
#define CMPLX_CONJ(a)   (a).Imag = -(a).Imag
#define CMPLX_NEGATE(a)
#define CMPLX_1_NORM(a)   (ABS((a).Real) + ABS((a).Imag))
#define CMPLX_INF_NORM(a)   (MAX (ABS((a).Real),ABS((a).Imag)))
#define CMPLX_2_NORM(a)   (sqrt((a).Real*(a).Real + (a).Imag*(a).Imag))
#define CMPLX_ADD(to, from_a, from_b)
#define CMPLX_SUBT(to, from_a, from_b)
#define CMPLX_ADD_ASSIGN(to, from)
#define CMPLX_SUBT_ASSIGN(to, from)
#define SCLR_MULT(to, sclr, cmplx)
#define SCLR_MULT_ASSIGN(to, sclr)
#define CMPLX_MULT(to, from_a, from_b)
#define CMPLX_MULT_ASSIGN(to, from)
#define CMPLX_CONJ_MULT(to, from_a, from_b)
#define CMPLX_MULT_ADD(to, mult_a, mult_b, add)
#define CMPLX_MULT_SUBT(to, mult_a, mult_b, subt)
#define CMPLX_CONJ_MULT_ADD(to, mult_a, mult_b, add)
#define CMPLX_MULT_ADD_ASSIGN(to, from_a, from_b)
#define CMPLX_MULT_SUBT_ASSIGN(to, from_a, from_b)
#define CMPLX_CONJ_MULT_ADD_ASSIGN(to, from_a, from_b)
#define CMPLX_CONJ_MULT_SUBT_ASSIGN(to, from_a, from_b)
#define CMPLX_DIV(to, num, den)
#define CMPLX_DIV_ASSIGN(num, den)
#define CMPLX_RECIPROCAL(to, den)
#define ASSERT(condition)
#define ABORT()
#define IMAG_VECTORS
#define IMAG_RHS

Typedefs

typedef spREAL RealNumber
typedef spREAL * RealVector
typedef struct ComplexNumberComplexVector
typedef MatrixElementElementPtr
typedef ElementPtrArrayOfElementPtrs
typedef AllocationRecordAllocationListPtr
typedef MatrixFrameMatrixPtr


Define Documentation

 
#define ABORT (  ) 

Definition at line 392 of file spDefs.h.

#define ABS ( a   )     ((a) < 0.0 ? -(a) : (a))

Definition at line 131 of file spDefs.h.

#define AND   &&

Definition at line 108 of file spDefs.h.

Referenced by ComplexRowColElimination(), CountMarkowitz(), CreateFillin(), ExchangeColElements(), ExchangeRowElements(), ExchangeRowsAndCols(), FindBiggestInColExclude(), MarkowitzProducts(), RealRowColElimination(), scheduler(), SearchEntireMatrix(), SearchForSingleton(), spCreate(), spFactor(), spGetElement(), spOrderAndFactor(), spSetComplex(), spSetReal(), and UpdateMarkowitzNumbers().

#define ASSERT ( condition   ) 

Definition at line 380 of file spDefs.h.

Referenced by spClear(), spDestroy(), spElementCount(), spError(), spFactor(), spFillinCount(), spGetElement(), spGetSize(), spOrderAndFactor(), spPartition(), spSetComplex(), spSetReal(), and spWhereSingular().

#define CMPLX_1_NORM ( a   )     (ABS((a).Real) + ABS((a).Imag))

Definition at line 170 of file spDefs.h.

#define CMPLX_2_NORM ( a   )     (sqrt((a).Real*(a).Real + (a).Imag*(a).Imag))

Definition at line 176 of file spDefs.h.

#define CMPLX_ADD ( to,
from_a,
from_b   ) 

Value:

{   (to).Real = (from_a).Real + (from_b).Real;  \
    (to).Imag = (from_a).Imag + (from_b).Imag;  \
}

Definition at line 179 of file spDefs.h.

#define CMPLX_ADD_ASSIGN ( to,
from   ) 

Value:

{   (to).Real += (from).Real;           \
    (to).Imag += (from).Imag;           \
}

Definition at line 191 of file spDefs.h.

#define CMPLX_ASSIGN ( to,
from   ) 

Value:

{   (to).Real = (from).Real;    \
    (to).Imag = (from).Imag;    \
}

Definition at line 147 of file spDefs.h.

#define CMPLX_CONJ ( a   )     (a).Imag = -(a).Imag

Definition at line 163 of file spDefs.h.

#define CMPLX_CONJ_ASSIGN ( to,
from   ) 

Value:

{   (to).Real = (from).Real;            \
    (to).Imag = -(from).Imag;           \
}

Definition at line 151 of file spDefs.h.

#define CMPLX_CONJ_MULT ( to,
from_a,
from_b   ) 

Value:

{   (to).Real = (from_a).Real * (from_b).Real + \
                (from_a).Imag * (from_b).Imag;  \
    (to).Imag = (from_a).Real * (from_b).Imag - \
                (from_a).Imag * (from_b).Real;  \
}

Definition at line 233 of file spDefs.h.

#define CMPLX_CONJ_MULT_ADD ( to,
mult_a,
mult_b,
add   ) 

Value:

{   (to).Real = (mult_a).Real * (mult_b).Real +                 \
                (mult_a).Imag * (mult_b).Imag + (add).Real;     \
    (to).Imag = (mult_a).Real * (mult_b).Imag -                 \
                (mult_a).Imag * (mult_b).Real + (add).Imag;     \
}

Definition at line 261 of file spDefs.h.

#define CMPLX_CONJ_MULT_ADD_ASSIGN ( to,
from_a,
from_b   ) 

Value:

{   (to).Real += (from_a).Real * (from_b).Real +        \
                 (from_a).Imag * (from_b).Imag;         \
    (to).Imag += (from_a).Real * (from_b).Imag -        \
                 (from_a).Imag * (from_b).Real;         \
}

Definition at line 289 of file spDefs.h.

#define CMPLX_CONJ_MULT_SUBT_ASSIGN ( to,
from_a,
from_b   ) 

Value:

{   (to).Real -= (from_a).Real * (from_b).Real +        \
                 (from_a).Imag * (from_b).Imag;         \
    (to).Imag -= (from_a).Real * (from_b).Imag -        \
                 (from_a).Imag * (from_b).Real;         \
}

Definition at line 299 of file spDefs.h.

#define CMPLX_CONJ_NEGATE_ASSIGN ( to,
from   ) 

Value:

{   (to).Real = -(from).Real;                   \
    (to).Imag = (from).Imag;                    \
}

Definition at line 159 of file spDefs.h.

#define CMPLX_DIV ( to,
num,
den   ) 

Value:

{   RealNumber  r_, s_;                                                 \
    if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR      \
        ((den).Real < (den).Imag AND (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_;                    \
    }                                                                   \
}

Definition at line 311 of file spDefs.h.

#define CMPLX_DIV_ASSIGN ( num,
den   ) 

Value:

{   RealNumber  r_, s_, t_;                                             \
    if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR      \
        ((den).Real < (den).Imag AND (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_;                                                \
    }                                                                   \
}

Definition at line 329 of file spDefs.h.

#define CMPLX_INF_NORM ( a   )     (MAX (ABS((a).Real),ABS((a).Imag)))

Definition at line 173 of file spDefs.h.

#define CMPLX_MULT ( to,
from_a,
from_b   ) 

Value:

{   (to).Real = (from_a).Real * (from_b).Real - \
                (from_a).Imag * (from_b).Imag;  \
    (to).Imag = (from_a).Real * (from_b).Imag + \
                (from_a).Imag * (from_b).Real;  \
}

Definition at line 215 of file spDefs.h.

#define CMPLX_MULT_ADD ( to,
mult_a,
mult_b,
add   ) 

Value:

{   (to).Real = (mult_a).Real * (mult_b).Real -                 \
                (mult_a).Imag * (mult_b).Imag + (add).Real;     \
    (to).Imag = (mult_a).Real * (mult_b).Imag +                 \
                (mult_a).Imag * (mult_b).Real + (add).Imag;     \
}

Definition at line 242 of file spDefs.h.

#define CMPLX_MULT_ADD_ASSIGN ( to,
from_a,
from_b   ) 

Value:

{   (to).Real += (from_a).Real * (from_b).Real -        \
                 (from_a).Imag * (from_b).Imag;         \
    (to).Imag += (from_a).Real * (from_b).Imag +        \
                 (from_a).Imag * (from_b).Real;         \
}

Definition at line 270 of file spDefs.h.

#define CMPLX_MULT_ASSIGN ( to,
from   ) 

Value:

{   RealNumber 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 223 of file spDefs.h.

Referenced by ComplexRowColElimination().

#define CMPLX_MULT_SUBT ( to,
mult_a,
mult_b,
subt   ) 

Value:

{   (to).Real = (subt).Real - (mult_a).Real * (mult_b).Real +   \
                              (mult_a).Imag * (mult_b).Imag;    \
    (to).Imag = (subt).Imag - (mult_a).Real * (mult_b).Imag -   \
                              (mult_a).Imag * (mult_b).Real;    \
}

Definition at line 251 of file spDefs.h.

#define CMPLX_MULT_SUBT_ASSIGN ( to,
from_a,
from_b   ) 

Value:

{   (to).Real -= (from_a).Real * (from_b).Real -        \
                 (from_a).Imag * (from_b).Imag;         \
    (to).Imag -= (from_a).Real * (from_b).Imag +        \
                 (from_a).Imag * (from_b).Real;         \
}

Definition at line 279 of file spDefs.h.

Referenced by ComplexRowColElimination().

#define CMPLX_NEGATE ( a   ) 

Value:

{   (a).Real = -(a).Real;       \
    (a).Imag = -(a).Imag;       \
}

Definition at line 164 of file spDefs.h.

#define CMPLX_NEGATE_ASSIGN ( to,
from   ) 

Value:

{   (to).Real = -(from).Real;           \
    (to).Imag = -(from).Imag;           \
}

Definition at line 155 of file spDefs.h.

#define CMPLX_RECIPROCAL ( to,
den   ) 

Value:

{   RealNumber  r_;                                                     \
    if (((den).Real >= (den).Imag AND (den).Real > -(den).Imag) OR      \
        ((den).Real < (den).Imag AND (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 349 of file spDefs.h.

Referenced by ComplexRowColElimination().

#define CMPLX_SUBT ( to,
from_a,
from_b   ) 

Value:

{   (to).Real = (from_a).Real - (from_b).Real;  \
    (to).Imag = (from_a).Imag - (from_b).Imag;  \
}

Definition at line 185 of file spDefs.h.

#define CMPLX_SUBT_ASSIGN ( to,
from   ) 

Value:

{   (to).Real -= (from).Real;           \
    (to).Imag -= (from).Imag;           \
}

Definition at line 197 of file spDefs.h.

#define ELEMENT_MAG ( ptr   )     ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real)

Definition at line 143 of file spDefs.h.

Referenced by ComplexRowColElimination(), FindBiggestInColExclude(), FindLargestInCol(), SearchEntireMatrix(), SearchForSingleton(), and spOrderAndFactor().

#define IMAG_RHS

Definition at line 412 of file spDefs.h.

#define IMAG_VECTORS

Definition at line 411 of file spDefs.h.

#define IS_FACTORED ( matrix   )     ((matrix)->Factored && !(matrix)->NeedsOrdering)

Definition at line 123 of file spDefs.h.

#define IS_SPARSE ( matrix   ) 

Value:

((matrix) != NULL &&            \
                                 (matrix)->ID == SPARSE_ID)

Definition at line 117 of file spDefs.h.

Referenced by spClear(), spDestroy(), spElementCount(), spFillinCount(), spGetElement(), spGetSize(), spPartition(), spSetComplex(), spSetReal(), and spWhereSingular().

#define IS_VALID ( matrix   ) 

Value:

((matrix) != NULL &&            \
                                 (matrix)->ID == SPARSE_ID &&   \
                                 (matrix)->Error >= spOKAY &&   \
                                 (matrix)->Error < spFATAL)

Definition at line 119 of file spDefs.h.

Referenced by spFactor(), and spOrderAndFactor().

#define LINT   NO

Definition at line 86 of file spDefs.h.

#define MAX ( a,
b   )     ((a) > (b) ? (a) : (b))

Definition at line 127 of file spDefs.h.

#define MIN ( a,
b   )     ((a) < (b) ? (a) : (b))

Definition at line 128 of file spDefs.h.

#define NO   0

Definition at line 105 of file spDefs.h.

#define NOT   !

Definition at line 107 of file spDefs.h.

Referenced by ExchangeRowsAndCols(), spCreate(), spFactor(), and spOrderAndFactor().

#define NULL   0

Definition at line 113 of file spDefs.h.

#define OR   ||

Definition at line 109 of file spDefs.h.

Referenced by ComplexRowColElimination(), CountMarkowitz(), cpass2(), critical_events(), MarkowitzProducts(), paksazi(), RealRowColElimination(), scheduler(), spcColExchange(), spClear(), spCreate(), spcRowExchange(), spGetElement(), spWhereSingular(), and UpdateMarkowitzNumbers().

#define SCLR_MULT ( to,
sclr,
cmplx   ) 

Value:

{   (to).Real = (sclr) * (cmplx).Real;  \
    (to).Imag = (sclr) * (cmplx).Imag;  \
}

Definition at line 203 of file spDefs.h.

#define SCLR_MULT_ASSIGN ( to,
sclr   ) 

Value:

{   (to).Real *= (sclr);                \
    (to).Imag *= (sclr);                \
}

Definition at line 209 of file spDefs.h.

#define SPARSE_ID   0x772773

Definition at line 116 of file spDefs.h.

Referenced by spCreate(), and spError().

#define SPBOOLEAN   int

Definition at line 104 of file spDefs.h.

Referenced by CreateInternalVectors(), and spPartition().

#define SQR ( a   )     ((a)*(a))

Definition at line 134 of file spDefs.h.

#define SWAP ( type,
a,
b   )     {type swapx; swapx = a; a = b; b = swapx;}

Definition at line 137 of file spDefs.h.

Referenced by ExchangeRowsAndCols(), mgeti(), mputi(), spcColExchange(), and spcRowExchange().

#define YES   1

Definition at line 106 of file spDefs.h.


Typedef Documentation

typedef struct AllocationRecord* AllocationListPtr

Definition at line 541 of file spDefs.h.

typedef ElementPtr* ArrayOfElementPtrs

Definition at line 510 of file spDefs.h.

typedef struct ComplexNumber * ComplexVector

typedef struct MatrixElement* ElementPtr

Definition at line 509 of file spDefs.h.

typedef struct MatrixFrame* MatrixPtr

Definition at line 829 of file spDefs.h.

typedef spREAL RealNumber

Definition at line 422 of file spDefs.h.

typedef spREAL * RealVector

Definition at line 422 of file spDefs.h.


Generated on Sun Mar 4 16:12:44 2007 for Scilab [trunk] by  doxygen 1.5.1