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

Go to the source code of this file.

Classes

struct  row_elt
 
struct  SPROW
 
struct  SPMAT
 
struct  mesch_pair
 
struct  SPVEC
 

Macros

#define SMNULL   ((SPMAT*)NULL)
 
#define SVNULL   ((SPVEC*)NULL)
 
#define sprow_idx2(r, c, hint)
 
#define sp_input()   sp_finput(stdin)
 
#define sp_output(A)   sp_foutput(stdout,(A))
 
#define sp_output2(A)   sp_foutput2(stdout,(A))
 
#define row_mltadd(r1, r2, alpha, out)   sprow_mltadd(r1,r2,alpha,0,out)
 
#define out_row(r)   sprow_foutput(stdout,(r))
 
#define SP_FREE(A)   ( sp_free((A)), (A)=(SPMAT *)NULL)
 
#define fixindex(idx)
 

Typedefs

typedef struct row_elt row_elt
 
typedef struct SPROW SPROW
 
typedef struct SPMAT SPMAT
 
typedef struct mesch_pair mesch_pair
 
typedef struct SPVEC SPVEC
 

Functions

int sp_get_vars (int m, int n, int deg,...)
 
int sp_resize_vars (int m, int n,...)
 
int sp_free_vars (SPMAT **,...)
 
SPMATsp_get (int, int, int)
 
SPMATsp_copy (SPMAT *)
 
SPMATsp_copy2 (SPMAT *, SPMAT *)
 
SPMATsp_zero (SPMAT *)
 
SPMATsp_resize (SPMAT *, int, int)
 
SPMATsp_compact (SPMAT *, double)
 
double sp_get_val (SPMAT *, int, int)
 
double sp_set_val (SPMAT *, int, int, double)
 
VECsp_mv_mlt (SPMAT *, VEC *, VEC *)
 
VECsp_vm_mlt (SPMAT *, VEC *, VEC *)
 
int sp_free (SPMAT *)
 
SPMATsp_col_access (SPMAT *)
 
SPMATsp_diag_access (SPMAT *)
 
int chk_col_access (SPMAT *)
 
SPMATsp_finput (FILE *)
 
void sp_foutput (FILE *, SPMAT *)
 
void sp_foutput2 (FILE *, SPMAT *)
 
SPMATsp_smlt (SPMAT *A, double alpha, SPMAT *B)
 
SPMATsp_add (SPMAT *A, SPMAT *B, SPMAT *C)
 
SPMATsp_sub (SPMAT *A, SPMAT *B, SPMAT *C)
 
SPMATsp_mltadd (SPMAT *A, SPMAT *B, double alpha, SPMAT *C)
 
SPROWsprow_get (int)
 
SPROWsprow_xpd (SPROW *r, int n, int type)
 
SPROWsprow_resize (SPROW *r, int n, int type)
 
SPROWsprow_merge (SPROW *, SPROW *, SPROW *, int type)
 
SPROWsprow_copy (SPROW *, SPROW *, SPROW *, int type)
 
SPROWsprow_mltadd (SPROW *, SPROW *, double, int, SPROW *, int type)
 
SPROWsprow_add (SPROW *r1, SPROW *r2, int j0, SPROW *r_out, int type)
 
SPROWsprow_sub (SPROW *r1, SPROW *r2, int j0, SPROW *r_out, int type)
 
SPROWsprow_smlt (SPROW *r1, double alpha, int j0, SPROW *r_out, int type)
 
double sprow_set_val (SPROW *, int, double)
 
int sprow_free (SPROW *)
 
int sprow_idx (SPROW *, int)
 
void sprow_foutput (FILE *, SPROW *)
 
void sp_dump (FILE *fp, SPMAT *A)
 
void sprow_dump (FILE *fp, SPROW *r)
 
MATsp_m2dense (SPMAT *A, MAT *out)
 

Macro Definition Documentation

◆ fixindex

#define fixindex (   idx)
Value:
((idx) == -1 ? (error(E_BOUNDS,"fixindex"),0) : \
(idx) < 0 ? -((idx)+2) : (idx))
#define error(err_num, fn_name)
Definition: err.h:73
#define E_BOUNDS
Definition: err.h:96

Definition at line 186 of file sparse.h.

◆ out_row

#define out_row (   r)    sprow_foutput(stdout,(r))

Definition at line 181 of file sparse.h.

◆ row_mltadd

#define row_mltadd (   r1,
  r2,
  alpha,
  out 
)    sprow_mltadd(r1,r2,alpha,0,out)

Definition at line 180 of file sparse.h.

◆ SMNULL

#define SMNULL   ((SPMAT*)NULL)

Definition at line 74 of file sparse.h.

◆ SP_FREE

#define SP_FREE (   A)    ( sp_free((A)), (A)=(SPMAT *)NULL)

Definition at line 183 of file sparse.h.

◆ sp_input

#define sp_input ( )    sp_finput(stdin)

Definition at line 177 of file sparse.h.

◆ sp_output

#define sp_output (   A)    sp_foutput(stdout,(A))

Definition at line 178 of file sparse.h.

◆ sp_output2

#define sp_output2 (   A)    sp_foutput2(stdout,(A))

Definition at line 179 of file sparse.h.

◆ sprow_idx2

#define sprow_idx2 (   r,
  c,
  hint 
)
Value:
( ( (hint) >= 0 && (hint) < (r)->len && \
(r)->elt[hint].col == (c)) ? (hint) : sprow_idx((r),(c)) )
#define c
int sprow_idx(SPROW *, int)
Definition: sprow.c:75

Definition at line 78 of file sparse.h.

◆ SVNULL

#define SVNULL   ((SPVEC*)NULL)

Definition at line 75 of file sparse.h.

Typedef Documentation

◆ mesch_pair

typedef struct mesch_pair mesch_pair

◆ row_elt

typedef struct row_elt row_elt

◆ SPMAT

typedef struct SPMAT SPMAT

◆ SPROW

typedef struct SPROW SPROW

◆ SPVEC

typedef struct SPVEC SPVEC

Function Documentation

◆ chk_col_access()

int chk_col_access ( SPMAT A)

Definition at line 512 of file spbkp.c.

◆ sp_add()

SPMAT * sp_add ( SPMAT A,
SPMAT B,
SPMAT C 
)

◆ sp_col_access()

SPMAT* sp_col_access ( SPMAT A)

Definition at line 376 of file sparse.c.

◆ sp_compact()

SPMAT * sp_compact ( SPMAT A,
double  tol 
)

Definition at line 810 of file sparse.c.

◆ sp_copy()

SPMAT * sp_copy ( SPMAT )

◆ sp_copy2()

SPMAT * sp_copy2 ( SPMAT ,
SPMAT  
)

◆ sp_diag_access()

SPMAT* sp_diag_access ( SPMAT A)

Definition at line 417 of file sparse.c.

◆ sp_dump()

void sp_dump ( FILE *  fp,
SPMAT A 
)

Definition at line 127 of file sparseio.c.

◆ sp_finput()

SPMAT* sp_finput ( FILE *  fp)

Definition at line 185 of file sparseio.c.

◆ sp_foutput()

void sp_foutput ( FILE *  ,
SPMAT  
)

◆ sp_foutput2()

void sp_foutput2 ( FILE *  ,
SPMAT  
)

◆ sp_free()

int sp_free ( SPMAT A)

Definition at line 260 of file sparse.c.

◆ sp_free_vars()

int sp_free_vars ( SPMAT **  va,
  ... 
)

Definition at line 918 of file sparse.c.

◆ sp_get()

SPMAT* sp_get ( int  ,
int  ,
int   
)

◆ sp_get_val()

double sp_get_val ( SPMAT ,
int  ,
int   
)

◆ sp_get_vars()

int sp_get_vars ( int  m,
int  n,
int  deg,
  ... 
)

Definition at line 861 of file sparse.c.

◆ sp_m2dense()

MAT* sp_m2dense ( SPMAT A,
MAT out 
)

Definition at line 438 of file sparse.c.

◆ sp_mltadd()

SPMAT * sp_mltadd ( SPMAT A,
SPMAT B,
double  alpha,
SPMAT C 
)

Definition at line 559 of file sparse.c.

◆ sp_mv_mlt()

VEC* sp_mv_mlt ( SPMAT ,
VEC ,
VEC  
)

◆ sp_resize()

SPMAT * sp_resize ( SPMAT ,
int  ,
int   
)

◆ sp_resize_vars()

int sp_resize_vars ( int  m,
int  n,
  ... 
)

Definition at line 891 of file sparse.c.

◆ sp_set_val()

double sp_set_val ( SPMAT A,
int  i,
int  j,
double  val 
)

Definition at line 66 of file sparse.c.

◆ sp_smlt()

SPMAT* sp_smlt ( SPMAT A,
double  alpha,
SPMAT B 
)

◆ sp_sub()

SPMAT * sp_sub ( SPMAT A,
SPMAT B,
SPMAT C 
)

◆ sp_vm_mlt()

VEC * sp_vm_mlt ( SPMAT A,
VEC x,
VEC out 
)

Definition at line 159 of file sparse.c.

◆ sp_zero()

SPMAT * sp_zero ( SPMAT )

◆ sprow_add()

SPROW* sprow_add ( SPROW r1,
SPROW r2,
int  j0,
SPROW r_out,
int  type 
)

◆ sprow_copy()

SPROW * sprow_copy ( SPROW ,
SPROW ,
SPROW ,
int  type 
)

◆ sprow_dump()

void sprow_dump ( FILE *  fp,
SPROW r 
)

Definition at line 45 of file sprow.c.

◆ sprow_foutput()

void sprow_foutput ( FILE *  fp,
SPROW r 
)

Definition at line 644 of file sprow.c.

◆ sprow_free()

int sprow_free ( SPROW r)

Definition at line 259 of file sprow.c.

◆ sprow_get()

SPROW* sprow_get ( int  )

◆ sprow_idx()

int sprow_idx ( SPROW r,
int  col 
)

Definition at line 75 of file sprow.c.

◆ sprow_merge()

SPROW * sprow_merge ( SPROW ,
SPROW ,
SPROW ,
int  type 
)

◆ sprow_mltadd()

SPROW * sprow_mltadd ( SPROW r1,
SPROW r2,
double  alpha,
int  j0,
SPROW r_out,
int  type 
)

Definition at line 399 of file sprow.c.

◆ sprow_resize()

SPROW * sprow_resize ( SPROW r,
int  n,
int  type 
)

◆ sprow_set_val()

double sprow_set_val ( SPROW r,
int  j,
double  val 
)

Definition at line 666 of file sprow.c.

◆ sprow_smlt()

SPROW * sprow_smlt ( SPROW r1,
double  alpha,
int  j0,
SPROW r_out,
int  type 
)

Definition at line 605 of file sprow.c.

◆ sprow_sub()

SPROW * sprow_sub ( SPROW r1,
SPROW r2,
int  j0,
SPROW r_out,
int  type 
)

◆ sprow_xpd()

SPROW * sprow_xpd ( SPROW r,
int  n,
int  type 
)