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 }
#define colst
Definition: lineq.h:2
#define rhs
Definition: lineq.h:6
#define getelm
Definition: lineq.h:8
#define ELM0
Definition: lineq.h:27
#define rowst
Definition: lineq.h:1
if(ncell==0)
Definition: cellorder.cpp:785
static unsigned row
Definition: nonlin.cpp:78
static uint32_t value
Definition: scoprand.cpp:25
Definition: lineq.h:17
double value
Definition: lineq.h:20
unsigned col
Definition: lineq.h:19
struct elm * c_right
Definition: lineq.h:24
struct elm * r_up
Definition: lineq.h:21
unsigned row
Definition: lineq.h:18
struct elm * r_down
Definition: lineq.h:22
struct elm * c_left
Definition: lineq.h:23
void subrow(struct elm *pivot, struct elm *rowsub)
Definition: subrows.cpp:6
void remelm(struct elm *el)
Definition: subrows.cpp:21