File: newton_struct.h

package info (click to toggle)
neuron 8.2.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,760 kB
  • sloc: cpp: 149,571; python: 58,465; ansic: 50,329; sh: 3,510; xml: 213; pascal: 51; makefile: 35; sed: 5
file content (39 lines) | stat: -rw-r--r-- 1,125 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
// This header has to be both valid C and C++ because the scoplib sources are
// compiled as C.
#ifdef __cplusplus
extern "C" {
#endif

/* avoid incessant alloc/free memory */
typedef struct NewtonSpace {
	int n;
	double* delta_x;
	double** jacobian;
	int* perm;
	double* high_value;
	double* low_value;
	double* rowmax;
} NewtonSpace;

// Forward-declare for use in function pointer type declaration.
typedef union Datum Datum;
typedef struct NrnThread NrnThread;

/* Memory allocation routines */
double* makevector(int length);
int freevector(double* vector);
double** makematrix(int nrows, int ncols);
int freematrix(double** matrix);

int nrn_crout_thread(NewtonSpace* ns, int n, double** a, int* perm);
void nrn_scopmath_solve_thread(int n, double** a,
 double* b, int* perm, double* p, int* y);
int nrn_newton_thread(NewtonSpace* ns, int n, int* index, double* x,
 int (*pfunc)(double *, Datum *, Datum *, NrnThread *), double* value, void* ppvar, void* thread, void* nt);
NewtonSpace* nrn_cons_newtonspace(int n);
void nrn_destroy_newtonspace(NewtonSpace* ns);

#ifdef __cplusplus
} // extern "C"
#endif