NEURON
subrows.cpp
Go to the documentation of this file.
1
#include <../../nrnconf.h>
2
3
#include <stdlib.h>
4
#include "
lineq.h
"
5
6
void
subrow
(
struct
elm
*pivot,
struct
elm
*rowsub) {
7
unsigned
row
;
8
double
r;
9
struct
elm
*el;
10
11
r = rowsub->
value
/ pivot->
value
;
12
rhs
[rowsub->
row
] -=
rhs
[pivot->
row
] * r;
13
row
= rowsub->
row
;
14
rowsub =
ELM0
;
15
for
(el =
rowst
[pivot->
row
] ; el !=
ELM0
; el = el->
c_right
)
16
if
(el != pivot)
17
(rowsub =
getelm
(rowsub,
row
, el->
col
))->
value
18
-= el->
value
* r;
19
}
20
21
void
remelm
(
struct
elm
*el) {
22
if
(el->
c_right
!=
ELM0
)
23
(el->
c_right
)->
c_left
= el->
c_left
;
24
if
(el->
c_left
!=
ELM0
)
25
(el->
c_left
)->
c_right
= el->
c_right
;
26
else
27
rowst
[el->
row
] = el->
c_right
;
28
29
if
(el->
r_down
!=
ELM0
)
30
(el->
r_down
)->
r_up
= el->
r_up
;
31
if
(el->
r_up
!=
ELM0
)
32
(el->
r_up
)->
r_down
= el->
r_down
;
33
else
34
colst
[el->
col
] = el->
r_down
;
35
free((
char
*)el);
36
}
lineq.h
colst
#define colst
Definition:
lineq.h:2
rhs
#define rhs
Definition:
lineq.h:6
getelm
#define getelm
Definition:
lineq.h:8
ELM0
#define ELM0
Definition:
lineq.h:27
rowst
#define rowst
Definition:
lineq.h:1
neuron::if
if(ncell==0)
Definition:
cellorder.cpp:785
row
static unsigned row
Definition:
nonlin.cpp:78
value
static uint32_t value
Definition:
scoprand.cpp:25
elm
Definition:
lineq.h:17
elm::value
double value
Definition:
lineq.h:20
elm::col
unsigned col
Definition:
lineq.h:19
elm::c_right
struct elm * c_right
Definition:
lineq.h:24
elm::r_up
struct elm * r_up
Definition:
lineq.h:21
elm::row
unsigned row
Definition:
lineq.h:18
elm::r_down
struct elm * r_down
Definition:
lineq.h:22
elm::c_left
struct elm * c_left
Definition:
lineq.h:23
subrow
void subrow(struct elm *pivot, struct elm *rowsub)
Definition:
subrows.cpp:6
remelm
void remelm(struct elm *el)
Definition:
subrows.cpp:21
src
sparse
subrows.cpp