NEURON
zmatrix.h File Reference
#include "matrix.h"

Go to the source code of this file.

Classes

struct  complex
 
struct  ZVEC
 
struct  ZMAT
 

Macros

#define ZVNULL   ((ZVEC *)NULL)
 
#define ZMNULL   ((ZMAT *)NULL)
 
#define Z_CONJ   1
 
#define Z_NOCONJ   0
 
#define zv_copy(x, y)   _zv_copy(x,y,0)
 
#define zm_copy(A, B)   _zm_copy(A,B,0,0)
 
#define z_input()   z_finput(stdin)
 
#define zv_input(x)   zv_finput(stdin,x)
 
#define zm_input(A)   zm_finput(stdin,A)
 
#define z_output(z)   z_foutput(stdout,z)
 
#define zv_output(x)   zv_foutput(stdout,x)
 
#define zm_output(A)   zm_foutput(stdout,A)
 
#define ZV_FREE(x)   ( zv_free(x), (x) = ZVNULL )
 
#define ZM_FREE(A)   ( zm_free(A), (A) = ZMNULL )
 
#define zin_prod(x, y)   _zin_prod(x,y,0,Z_CONJ)
 
#define zv_norm1(x)   _zv_norm1(x,VNULL)
 
#define zv_norm2(x)   _zv_norm2(x,VNULL)
 
#define zv_norm_inf(x)   _zv_norm_inf(x,VNULL)
 

Functions

int zv_get_vars (int dim,...)
 
int zm_get_vars (int m, int n,...)
 
int zv_resize_vars (int new_dim,...)
 
int zm_resize_vars (int m, int n,...)
 
int zv_free_vars (ZVEC **,...)
 
int zm_free_vars (ZMAT **,...)
 
ZMAT_zm_copy (ZMAT *in, ZMAT *out, u_int i0, u_int j0)
 
ZMATzm_move (ZMAT *, int, int, int, int, ZMAT *, int, int)
 
ZMATzvm_move (ZVEC *, int, ZMAT *, int, int, int, int)
 
ZVEC_zv_copy (ZVEC *in, ZVEC *out, u_int i0)
 
ZVECzv_move (ZVEC *, int, int, ZVEC *, int)
 
ZVECzmv_move (ZMAT *, int, int, int, int, ZVEC *, int)
 
complex z_finput (FILE *fp)
 
ZMATzm_finput (FILE *fp, ZMAT *a)
 
ZVECzv_finput (FILE *fp, ZVEC *x)
 
ZMATzm_add (ZMAT *mat1, ZMAT *mat2, ZMAT *out)
 
ZMATzm_sub (ZMAT *mat1, ZMAT *mat2, ZMAT *out)
 
ZMATzm_mlt (ZMAT *A, ZMAT *B, ZMAT *OUT)
 
ZMATzmma_mlt (ZMAT *A, ZMAT *B, ZMAT *OUT)
 
ZMATzmam_mlt (ZMAT *A, ZMAT *B, ZMAT *OUT)
 
ZVECzmv_mlt (ZMAT *A, ZVEC *b, ZVEC *out)
 
ZMATzsm_mlt (complex scalar, ZMAT *matrix, ZMAT *out)
 
ZVECzvm_mlt (ZMAT *A, ZVEC *b, ZVEC *out)
 
ZMATzm_adjoint (ZMAT *in, ZMAT *out)
 
ZMATzswap_rows (ZMAT *A, int i, int j, int lo, int hi)
 
ZMATzswap_cols (ZMAT *A, int i, int j, int lo, int hi)
 
ZMATmz_mltadd (ZMAT *A1, ZMAT *A2, complex s, ZMAT *out)
 
ZVECzmv_mltadd (ZVEC *v1, ZVEC *v2, ZMAT *A, complex alpha, ZVEC *out)
 
ZVECzvm_mltadd (ZVEC *v1, ZVEC *v2, ZMAT *A, complex alpha, ZVEC *out)
 
ZVECzv_zero (ZVEC *x)
 
ZMATzm_zero (ZMAT *A)
 
ZMATzm_get (int m, int n)
 
ZVECzv_get (int dim)
 
ZMATzm_resize (ZMAT *A, int new_m, int new_n)
 
complex _zin_prod (ZVEC *x, ZVEC *y, u_int i0, u_int flag)
 
ZVECzv_resize (ZVEC *x, int new_dim)
 
ZVECzv_mlt (complex scalar, ZVEC *vector, ZVEC *out)
 
ZVECzv_add (ZVEC *vec1, ZVEC *vec2, ZVEC *out)
 
ZVECzv_mltadd (ZVEC *v1, ZVEC *v2, complex scale, ZVEC *out)
 
ZVECzv_sub (ZVEC *vec1, ZVEC *vec2, ZVEC *out)
 
ZVECzv_map (complex(*f)(complex), ZVEC *x, ZVEC *out)
 
ZVEC_zv_map (complex(*f)(void *, complex), void *params, ZVEC *x, ZVEC *out)
 
ZVECzv_lincomb (int n, ZVEC *v[], complex a[], ZVEC *out)
 
ZVECzv_linlist (ZVEC *out, ZVEC *v1, complex a1,...)
 
ZVECzv_star (ZVEC *x1, ZVEC *x2, ZVEC *out)
 
ZVECzv_slash (ZVEC *x1, ZVEC *x2, ZVEC *out)
 
int zm_free (ZMAT *mat)
 
int zv_free (ZVEC *vec)
 
ZVECzv_rand (ZVEC *x)
 
ZMATzm_rand (ZMAT *A)
 
ZVECzget_row (ZMAT *A, int i, ZVEC *out)
 
ZVECzget_col (ZMAT *A, int j, ZVEC *out)
 
ZMATzset_row (ZMAT *A, int i, ZVEC *in)
 
ZMATzset_col (ZMAT *A, int j, ZVEC *in)
 
ZVECpx_zvec (PERM *pi, ZVEC *in, ZVEC *out)
 
ZVECpxinv_zvec (PERM *pi, ZVEC *in, ZVEC *out)
 
void __zconj__ (complex zp[], int len)
 
complex __zip__ (complex zp1[], complex zp2[], int len, int flag)
 
void __zmltadd__ (complex zp1[], complex zp2[], complex s, int len, int flag)
 
void __zmlt__ (complex zp[], complex s, complex out[], int len)
 
void __zadd__ (complex zp1[], complex zp2[], complex out[], int len)
 
void __zsub__ (complex zp1[], complex zp2[], complex out[], int len)
 
void __zzero__ (complex zp[], int len)
 
void z_foutput (FILE *fp, complex z)
 
void zm_foutput (FILE *fp, ZMAT *a)
 
void zv_foutput (FILE *fp, ZVEC *x)
 
void zm_dump (FILE *fp, ZMAT *a)
 
void zv_dump (FILE *fp, ZVEC *x)
 
double _zv_norm1 (ZVEC *x, VEC *scale)
 
double _zv_norm2 (ZVEC *x, VEC *scale)
 
double _zv_norm_inf (ZVEC *x, VEC *scale)
 
double zm_norm1 (ZMAT *A)
 
double zm_norm_inf (ZMAT *A)
 
double zm_norm_frob (ZMAT *A)
 
complex zmake (double real, double imag)
 
double zabs (complex z)
 
complex zadd (complex z1, complex z2)
 
complex zsub (complex z1, complex z2)
 
complex zmlt (complex z1, complex z2)
 
complex zinv (complex z)
 
complex zdiv (complex z1, complex z2)
 
complex zsqrt (complex z)
 
complex zexp (complex z)
 
complex zlog (complex z)
 
complex zconj (complex z)
 
complex zneg (complex z)
 

Macro Definition Documentation

◆ Z_CONJ

#define Z_CONJ   1

Definition at line 60 of file zmatrix.h.

◆ z_input

#define z_input ( )    z_finput(stdin)

Definition at line 266 of file zmatrix.h.

◆ Z_NOCONJ

#define Z_NOCONJ   0

Definition at line 61 of file zmatrix.h.

◆ z_output

#define z_output (   z)    z_foutput(stdout,z)

Definition at line 269 of file zmatrix.h.

◆ zin_prod

#define zin_prod (   x,
 
)    _zin_prod(x,y,0,Z_CONJ)

Definition at line 276 of file zmatrix.h.

◆ zm_copy

#define zm_copy (   A,
  B 
)    _zm_copy(A,B,0,0)

Definition at line 264 of file zmatrix.h.

◆ ZM_FREE

#define ZM_FREE (   A)    ( zm_free(A), (A) = ZMNULL )

Definition at line 274 of file zmatrix.h.

◆ zm_input

#define zm_input (   A)    zm_finput(stdin,A)

Definition at line 268 of file zmatrix.h.

◆ zm_output

#define zm_output (   A)    zm_foutput(stdout,A)

Definition at line 271 of file zmatrix.h.

◆ ZMNULL

#define ZMNULL   ((ZMAT *)NULL)

Definition at line 58 of file zmatrix.h.

◆ zv_copy

#define zv_copy (   x,
 
)    _zv_copy(x,y,0)

Definition at line 263 of file zmatrix.h.

◆ ZV_FREE

#define ZV_FREE (   x)    ( zv_free(x), (x) = ZVNULL )

Definition at line 273 of file zmatrix.h.

◆ zv_input

#define zv_input (   x)    zv_finput(stdin,x)

Definition at line 267 of file zmatrix.h.

◆ zv_norm1

#define zv_norm1 (   x)    _zv_norm1(x,VNULL)

Definition at line 278 of file zmatrix.h.

◆ zv_norm2

#define zv_norm2 (   x)    _zv_norm2(x,VNULL)

Definition at line 279 of file zmatrix.h.

◆ zv_norm_inf

#define zv_norm_inf (   x)    _zv_norm_inf(x,VNULL)

Definition at line 280 of file zmatrix.h.

◆ zv_output

#define zv_output (   x)    zv_foutput(stdout,x)

Definition at line 270 of file zmatrix.h.

◆ ZVNULL

#define ZVNULL   ((ZVEC *)NULL)

Definition at line 57 of file zmatrix.h.

Function Documentation

◆ __zadd__()

void __zadd__ ( complex  zp1[],
complex  zp2[],
complex  out[],
int  len 
)

◆ __zconj__()

void __zconj__ ( complex  zp[],
int  len 
)

◆ __zip__()

complex __zip__ ( complex  zp1[],
complex  zp2[],
int  len,
int  flag 
)

◆ __zmlt__()

void __zmlt__ ( complex  zp[],
complex  s,
complex  out[],
int  len 
)

◆ __zmltadd__()

void __zmltadd__ ( complex  zp1[],
complex  zp2[],
complex  s,
int  len,
int  flag 
)

◆ __zsub__()

void __zsub__ ( complex  zp1[],
complex  zp2[],
complex  out[],
int  len 
)

◆ __zzero__()

void __zzero__ ( complex  zp[],
int  len 
)

◆ _zin_prod()

complex _zin_prod ( ZVEC x,
ZVEC y,
u_int  i0,
u_int  flag 
)

Definition at line 38 of file zvecop.c.

◆ _zm_copy()

ZMAT* _zm_copy ( ZMAT in,
ZMAT out,
u_int  i0,
u_int  j0 
)

Definition at line 35 of file zcopy.c.

◆ _zv_copy()

ZVEC* _zv_copy ( ZVEC in,
ZVEC out,
u_int  i0 
)

Definition at line 58 of file zcopy.c.

◆ _zv_map()

ZVEC* _zv_map ( complex(*)(void *, complex f,
void params,
ZVEC x,
ZVEC out 
)

◆ _zv_norm1()

double _zv_norm1 ( ZVEC x,
VEC scale 
)

Definition at line 41 of file znorm.c.

◆ _zv_norm2()

double _zv_norm2 ( ZVEC x,
VEC scale 
)

Definition at line 78 of file znorm.c.

◆ _zv_norm_inf()

double _zv_norm_inf ( ZVEC x,
VEC scale 
)

Definition at line 109 of file znorm.c.

◆ mz_mltadd()

ZMAT* mz_mltadd ( ZMAT A1,
ZMAT A2,
complex  s,
ZMAT out 
)

Definition at line 398 of file zmatop.c.

◆ px_zvec()

ZVEC* px_zvec ( PERM pi,
ZVEC in,
ZVEC out 
)

Definition at line 397 of file zvecop.c.

◆ pxinv_zvec()

ZVEC* pxinv_zvec ( PERM pi,
ZVEC in,
ZVEC out 
)

Definition at line 466 of file zvecop.c.

◆ z_finput()

complex z_finput ( FILE *  fp)

Definition at line 44 of file zmatio.c.

◆ z_foutput()

void z_foutput ( FILE *  fp,
complex  z 
)

Definition at line 302 of file zmatio.c.

◆ zabs()

double zabs ( complex  z)

Definition at line 65 of file zfunc.c.

◆ zadd()

complex zadd ( complex  z1,
complex  z2 
)

Definition at line 93 of file zfunc.c.

◆ zconj()

complex zconj ( complex  z)

Definition at line 233 of file zfunc.c.

◆ zdiv()

complex zdiv ( complex  z1,
complex  z2 
)

Definition at line 166 of file zfunc.c.

◆ zexp()

complex zexp ( complex  z)

Definition at line 204 of file zfunc.c.

◆ zget_col()

ZVEC* zget_col ( ZMAT A,
int  j,
ZVEC out 
)

Definition at line 520 of file zmatop.c.

◆ zget_row()

ZVEC* zget_row ( ZMAT A,
int  i,
ZVEC out 
)

Definition at line 541 of file zmatop.c.

◆ zinv()

complex zinv ( complex  z)

Definition at line 135 of file zfunc.c.

◆ zlog()

complex zlog ( complex  z)

Definition at line 220 of file zfunc.c.

◆ zm_add()

ZMAT* zm_add ( ZMAT mat1,
ZMAT mat2,
ZMAT out 
)

Definition at line 38 of file zmatop.c.

◆ zm_adjoint()

ZMAT* zm_adjoint ( ZMAT in,
ZMAT out 
)

Definition at line 301 of file zmatop.c.

◆ zm_dump()

void zm_dump ( FILE *  fp,
ZMAT a 
)

Definition at line 353 of file zmatio.c.

◆ zm_finput()

ZMAT* zm_finput ( FILE *  fp,
ZMAT a 
)

Definition at line 77 of file zmatio.c.

◆ zm_foutput()

void zm_foutput ( FILE *  fp,
ZMAT a 
)

Definition at line 310 of file zmatio.c.

◆ zm_free()

int zm_free ( ZMAT mat)

Definition at line 149 of file zmemory.c.

◆ zm_free_vars()

int zm_free_vars ( ZMAT **  ,
  ... 
)

Definition at line 536 of file zmemory.c.

◆ zm_get()

ZMAT* zm_get ( int  m,
int  n 
)

Definition at line 65 of file zmemory.c.

◆ zm_get_vars()

int zm_get_vars ( int  m,
int  n,
  ... 
)

Definition at line 436 of file zmemory.c.

◆ zm_mlt()

ZMAT* zm_mlt ( ZMAT A,
ZMAT B,
ZMAT OUT 
)

Definition at line 94 of file zmatop.c.

◆ zm_move()

ZMAT* zm_move ( ZMAT ,
int  ,
int  ,
int  ,
int  ,
ZMAT ,
int  ,
int   
)

Definition at line 90 of file zcopy.c.

◆ zm_norm1()

double zm_norm1 ( ZMAT A)

Definition at line 142 of file znorm.c.

◆ zm_norm_frob()

double zm_norm_frob ( ZMAT A)

Definition at line 191 of file znorm.c.

◆ zm_norm_inf()

double zm_norm_inf ( ZMAT A)

Definition at line 167 of file znorm.c.

◆ zm_rand()

ZMAT* zm_rand ( ZMAT A)

Definition at line 604 of file zmatop.c.

◆ zm_resize()

ZMAT* zm_resize ( ZMAT A,
int  new_m,
int  new_n 
)

Definition at line 227 of file zmemory.c.

◆ zm_resize_vars()

int zm_resize_vars ( int  m,
int  n,
  ... 
)

Definition at line 486 of file zmemory.c.

◆ zm_sub()

ZMAT* zm_sub ( ZMAT mat1,
ZMAT mat2,
ZMAT out 
)

Definition at line 63 of file zmatop.c.

◆ zm_zero()

ZMAT* zm_zero ( ZMAT A)

Definition at line 51 of file zmemory.c.

◆ zmake()

complex zmake ( double  real,
double  imag 
)

Definition at line 41 of file zfunc.c.

◆ zmam_mlt()

ZMAT* zmam_mlt ( ZMAT A,
ZMAT B,
ZMAT OUT 
)

Definition at line 175 of file zmatop.c.

◆ zmlt()

complex zmlt ( complex  z1,
complex  z2 
)

Definition at line 121 of file zfunc.c.

◆ zmma_mlt()

ZMAT* zmma_mlt ( ZMAT A,
ZMAT B,
ZMAT OUT 
)

Definition at line 140 of file zmatop.c.

◆ zmv_mlt()

ZVEC* zmv_mlt ( ZMAT A,
ZVEC b,
ZVEC out 
)

Definition at line 207 of file zmatop.c.

◆ zmv_mltadd()

ZVEC* zmv_mltadd ( ZVEC v1,
ZVEC v2,
ZMAT A,
complex  alpha,
ZVEC out 
)

Definition at line 440 of file zmatop.c.

◆ zmv_move()

ZVEC* zmv_move ( ZMAT ,
int  ,
int  ,
int  ,
int  ,
ZVEC ,
int   
)

Definition at line 142 of file zcopy.c.

◆ zneg()

complex zneg ( complex  z)

Definition at line 53 of file zfunc.c.

◆ zset_col()

ZMAT* zset_col ( ZMAT A,
int  j,
ZVEC in 
)

Definition at line 565 of file zmatop.c.

◆ zset_row()

ZMAT* zset_row ( ZMAT A,
int  i,
ZVEC in 
)

Definition at line 584 of file zmatop.c.

◆ zsm_mlt()

ZMAT* zsm_mlt ( complex  scalar,
ZMAT matrix,
ZMAT out 
)

Definition at line 243 of file zmatop.c.

◆ zsqrt()

complex zsqrt ( complex  z)

Definition at line 175 of file zfunc.c.

◆ zsub()

complex zsub ( complex  z1,
complex  z2 
)

Definition at line 107 of file zfunc.c.

◆ zswap_cols()

ZMAT* zswap_cols ( ZMAT A,
int  i,
int  j,
int  lo,
int  hi 
)

Definition at line 371 of file zmatop.c.

◆ zswap_rows()

ZMAT* zswap_rows ( ZMAT A,
int  i,
int  j,
int  lo,
int  hi 
)

Definition at line 346 of file zmatop.c.

◆ zv_add()

ZVEC* zv_add ( ZVEC vec1,
ZVEC vec2,
ZVEC out 
)

Definition at line 76 of file zvecop.c.

◆ zv_dump()

void zv_dump ( FILE *  fp,
ZVEC x 
)

Definition at line 382 of file zmatio.c.

◆ zv_finput()

ZVEC* zv_finput ( FILE *  fp,
ZVEC x 
)

Definition at line 193 of file zmatio.c.

◆ zv_foutput()

void zv_foutput ( FILE *  fp,
ZVEC x 
)

Definition at line 333 of file zmatio.c.

◆ zv_free()

int zv_free ( ZVEC vec)

Definition at line 195 of file zmemory.c.

◆ zv_free_vars()

int zv_free_vars ( ZVEC **  ,
  ... 
)

Definition at line 515 of file zmemory.c.

◆ zv_get()

ZVEC* zv_get ( int  dim)

Definition at line 122 of file zmemory.c.

◆ zv_get_vars()

int zv_get_vars ( int  dim,
  ... 
)

Definition at line 418 of file zmemory.c.

◆ zv_lincomb()

ZVEC* zv_lincomb ( int  n,
ZVEC v[],
complex  a[],
ZVEC out 
)

◆ zv_linlist()

ZVEC* zv_linlist ( ZVEC out,
ZVEC v1,
complex  a1,
  ... 
)

Definition at line 235 of file zvecop.c.

◆ zv_map()

ZVEC* zv_map ( complex(*)(complex f,
ZVEC x,
ZVEC out 
)

◆ zv_mlt()

ZVEC* zv_mlt ( complex  scalar,
ZVEC vector,
ZVEC out 
)

Definition at line 54 of file zvecop.c.

◆ zv_mltadd()

ZVEC* zv_mltadd ( ZVEC v1,
ZVEC v2,
complex  scale,
ZVEC out 
)

Definition at line 95 of file zvecop.c.

◆ zv_move()

ZVEC* zv_move ( ZVEC ,
int  ,
int  ,
ZVEC ,
int   
)

Definition at line 118 of file zcopy.c.

◆ zv_rand()

ZVEC* zv_rand ( ZVEC x)

Definition at line 502 of file zvecop.c.

◆ zv_resize()

ZVEC* zv_resize ( ZVEC x,
int  new_dim 
)

Definition at line 362 of file zmemory.c.

◆ zv_resize_vars()

int zv_resize_vars ( int  new_dim,
  ... 
)

Definition at line 468 of file zmemory.c.

◆ zv_slash()

ZVEC* zv_slash ( ZVEC x1,
ZVEC x2,
ZVEC out 
)

Definition at line 347 of file zvecop.c.

◆ zv_star()

ZVEC* zv_star ( ZVEC x1,
ZVEC x2,
ZVEC out 
)

Definition at line 319 of file zvecop.c.

◆ zv_sub()

ZVEC* zv_sub ( ZVEC vec1,
ZVEC vec2,
ZVEC out 
)

Definition at line 128 of file zvecop.c.

◆ zv_zero()

ZVEC* zv_zero ( ZVEC x)

Definition at line 39 of file zmemory.c.

◆ zvm_mlt()

ZVEC* zvm_mlt ( ZMAT A,
ZVEC b,
ZVEC out 
)

Definition at line 264 of file zmatop.c.

◆ zvm_mltadd()

ZVEC* zvm_mltadd ( ZVEC v1,
ZVEC v2,
ZMAT A,
complex  alpha,
ZVEC out 
)

Definition at line 484 of file zmatop.c.

◆ zvm_move()

ZMAT* zvm_move ( ZVEC ,
int  ,
ZMAT ,
int  ,
int  ,
int  ,
int   
)

Definition at line 170 of file zcopy.c.