NEURON
matlab.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3 **
4 ** Copyright (C) 1993 David E. Steward & Zbigniew Leyk, all rights reserved.
5 **
6 ** Meschach Library
7 **
8 ** This Meschach Library is provided "as is" without any express
9 ** or implied warranty of any kind with respect to this software.
10 ** In particular the authors shall not be liable for any direct,
11 ** indirect, special, incidental or consequential damages arising
12 ** in any way from use of the software.
13 **
14 ** Everyone is granted permission to copy, modify and redistribute this
15 ** Meschach Library, provided:
16 ** 1. All copies contain this copyright notice.
17 ** 2. All modified copies shall carry a notice stating who
18 ** made the last modification and the date of such modification.
19 ** 3. No charge is made for this software or works derived from it.
20 ** This clause shall not be construed as constraining other software
21 ** distributed on the same medium as this software, nor is a
22 ** distribution fee considered a charge.
23 **
24 ***************************************************************************/
25 
26 
27 /* matlab.h -- Header file for matlab.c, spmatlab.c and zmatlab.c
28  for save/load formats */
29 
30 #ifndef MATLAB_DEF
31 
32 #define MATLAB_DEF
33 
34 /* structure required by MATLAB */
35 typedef struct {
36  long type; /* matrix type */
37  long m; /* # rows */
38  long n; /* # cols */
39  long imag; /* is complex? */
40  long namlen; /* length of variable name */
41  } matlab;
42 
43 /* macros for matrix storage type */
44 #define INTEL 0 /* for 80x87 format */
45 #define PC INTEL
46 #define MOTOROLA 1 /* 6888x format */
47 #define SUN MOTOROLA
48 #define APOLLO MOTOROLA
49 #undef MAC
50 #define MAC MOTOROLA
51 #define VAX_D 2
52 #define VAX_G 3
53 
54 #define COL_ORDER 0
55 #define ROW_ORDER 1
56 
57 #define DOUBLE_PREC 0 /* double precision */
58 #define SINGLE_PREC 1 /* single precision */
59 #define INT_32 2 /* 32 bit integers (signed) */
60 #define INT_16 3 /* 16 bit integers (signed) */
61 #define INT_16u 4 /* 16 bit integers (unsigned) */
62 /* end of macros for matrix storage type */
63 
64 #ifndef MACH_ID
65 #define MACH_ID MOTOROLA
66 #endif
67 
68 #define ORDER ROW_ORDER
69 
70 #if REAL == DOUBLE
71 #define PRECISION DOUBLE_PREC
72 #elif REAL == FLOAT
73 #define PRECISION SINGLE_PREC
74 #endif
75 
76 
77 /* prototypes */
78 
79 #ifdef ANSI_C
80 
81 MAT *m_save(FILE *,MAT *,char *);
82 MAT *m_load(FILE *,char **);
83 VEC *v_save(FILE *,VEC *,char *);
84 double d_save(FILE *,double,char *);
85 
86 #else
87 
88 extern MAT *m_save(), *m_load();
89 extern VEC *v_save();
90 extern double d_save();
91 #endif
92 
93 /* complex variant */
94 #ifdef COMPLEX
95 #include "zmatrix.h"
96 
97 #ifdef ANSI_C
98 extern ZMAT *zm_save(FILE *fp,ZMAT *A,char *name);
99 extern ZVEC *zv_save(FILE *fp,ZVEC *x,char *name);
100 extern complex z_save(FILE *fp,complex z,char *name);
101 extern ZMAT *zm_load(FILE *fp,char **name);
102 
103 #else
104 
105 extern ZMAT *zm_save();
106 extern ZVEC *zv_save();
107 extern complex z_save();
108 extern ZMAT *zm_load();
109 
110 #endif
111 
112 #endif
113 
114 #endif
complex z_save(FILE *fp, complex z, char *name)
Definition: zmatlab.c:128
long imag
Definition: matlab.h:39
Definition: zmatrix.h:50
Definition: zmatrix.h:44
double d_save()
Definition: matrix.h:67
VEC * v_save()
static Frame * fp
Definition: code.cpp:154
char * name
Definition: init.cpp:16
long type
Definition: matlab.h:36
ZMAT * zm_save(FILE *fp, ZMAT *A, char *name)
Definition: zmatlab.c:45
#define A(i)
Definition: multisplit.cpp:61
ZVEC * zv_save(FILE *fp, ZVEC *x, char *name)
Definition: zmatlab.c:93
ZMAT * zm_load(FILE *fp, char **name)
Definition: zmatlab.c:158
VEC * x
Definition: iter.h:64
long m
Definition: matlab.h:37
Definition: matlab.h:35
MAT * m_save()
MAT * m_load()
Definition: matrix.h:73
long namlen
Definition: matlab.h:40
long n
Definition: matlab.h:38