NEURON
spdefs.h File Reference
#include <stdio.h>
#include "spmatrix.h"
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  MatrixElement
 
struct  AllocationRecord
 
struct  FillinListNodeStruct
 
struct  MatrixFrame
 

Macros

#define LINT   NO
 
#define BOOLEAN   int
 
#define NO   0
 
#define YES   1
 
#define NOT   !
 
#define AND   &&
 
#define OR   ||
 
#define NULL   0
 
#define SPARSE_ID   0x772773 /* Arbitrary (is Sparse on phone). */
 
#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 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)
 
#define ELEMENT_MAG(ptr)   ((ptr)->Real < 0.0 ? -(ptr)->Real : (ptr)->Real)
 
#define ASSERT(condition)
 
#define ABORT()
 
#define ALLOC(type, number)   ((type*)malloc((unsigned)(sizeof(type) * (number))))
 
#define REALLOC(ptr, type, number)    ptr = (type*)realloc((char*)ptr, (unsigned)(sizeof(type) * (number)))
 
#define FREE(ptr)
 
#define CALLOC(ptr, type, number)
 

Typedefs

typedef spREAL RealNumber
 
typedef spREALRealVector
 
typedef struct MatrixElementElementPtr
 
typedef ElementPtrArrayOfElementPtrs
 
typedef struct AllocationRecordAllocationListPtr
 
typedef struct MatrixFrameMatrixPtr
 

Macro Definition Documentation

◆ ABORT

#define ABORT ( )

Definition at line 164 of file spdefs.h.

◆ ABS

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

Definition at line 119 of file spdefs.h.

◆ ALLOC

#define ALLOC (   type,
  number 
)    ((type*)malloc((unsigned)(sizeof(type) * (number))))

Definition at line 173 of file spdefs.h.

◆ AND

#define AND   &&

Definition at line 100 of file spdefs.h.

◆ ASSERT

#define ASSERT (   condition)

Definition at line 151 of file spdefs.h.

◆ BOOLEAN

#define BOOLEAN   int

Definition at line 96 of file spdefs.h.

◆ CALLOC

#define CALLOC (   ptr,
  type,
  number 
)
Value:
{ \
int i; \
ptr = ALLOC(type, number); \
if (ptr != (type*)NULL) \
for (i = (number)-1; i >= 0; i--) \
ptr[i] = (type)0; \
}
#define i
Definition: md1redef.h:19
short type
Definition: cabvars.h:10
#define NULL
Definition: spdefs.h:105
#define ALLOC(type, number)
Definition: spdefs.h:173

Definition at line 187 of file spdefs.h.

◆ ELEMENT_MAG

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

Definition at line 134 of file spdefs.h.

◆ FREE

#define FREE (   ptr)
Value:
{ \
if ((ptr) != NULL) { \
char* p = (char*)(ptr); \
(ptr) = NULL; \
free(p); \
} \
}
size_t p

Definition at line 177 of file spdefs.h.

◆ IS_FACTORED

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

Definition at line 111 of file spdefs.h.

◆ IS_SPARSE

#define IS_SPARSE (   matrix)    ((matrix) != NULL && (matrix)->ID == SPARSE_ID)

Definition at line 109 of file spdefs.h.

◆ IS_VALID

#define IS_VALID (   matrix)    ((matrix) != NULL && (matrix)->ID == SPARSE_ID && (matrix)->Error >= spOKAY && (matrix)->Error < spFATAL)

Definition at line 110 of file spdefs.h.

◆ LINT

#define LINT   NO

Definition at line 81 of file spdefs.h.

◆ MAX

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

Definition at line 115 of file spdefs.h.

◆ MIN

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

Definition at line 116 of file spdefs.h.

◆ NO

#define NO   0

Definition at line 97 of file spdefs.h.

◆ NOT

#define NOT   !

Definition at line 99 of file spdefs.h.

◆ NULL

#define NULL   0

Definition at line 105 of file spdefs.h.

◆ OR

#define OR   ||

Definition at line 101 of file spdefs.h.

◆ REALLOC

#define REALLOC (   ptr,
  type,
  number 
)     ptr = (type*)realloc((char*)ptr, (unsigned)(sizeof(type) * (number)))

Definition at line 174 of file spdefs.h.

◆ SPARSE_ID

#define SPARSE_ID   0x772773 /* Arbitrary (is Sparse on phone). */

Definition at line 108 of file spdefs.h.

◆ SQR

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

Definition at line 122 of file spdefs.h.

◆ SWAP

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

Definition at line 125 of file spdefs.h.

◆ YES

#define YES   1

Definition at line 98 of file spdefs.h.

Typedef Documentation

◆ AllocationListPtr

Definition at line 280 of file spdefs.h.

◆ ArrayOfElementPtrs

Definition at line 256 of file spdefs.h.

◆ ElementPtr

typedef struct MatrixElement* ElementPtr

Definition at line 255 of file spdefs.h.

◆ MatrixPtr

typedef struct MatrixFrame* MatrixPtr

Definition at line 549 of file spdefs.h.

◆ RealNumber

typedef spREAL RealNumber

Definition at line 202 of file spdefs.h.

◆ RealVector

typedef spREAL * RealVector

Definition at line 202 of file spdefs.h.