1 #include <../../nrnconf.h>
64 "current injection site change not allowed with both gap junctions and nhost > 1", 0);
71 return sqrt(x * x + y * y);
75 hoc_execerror(
"not allowed with both gap junctions and nhost>1", 0);
85 return sqrt(x * x + y * y);
90 "current injection site change not allowed with both gap junctions and nhost > 1", 0);
101 hoc_execerror(
"not allowed with both gap junctions and nhost>1", 0);
115 hoc_execerror(
"not allowed with both gap junctions and nhost>1", 0);
123 double ax, bx, cx, ay, by, cy, bb;
128 bb = bx * bx + by * by;
129 cx = (ax * bx + ay * by) / bb;
130 cy = (ay * bx - ax * by) / bb;
131 return sqrt(cx * cx + cy * cy);
148 hoc_execerror(
"Impedance calculation with LinearMechanism not implemented", 0);
151 hoc_execerror(
"Impedance calculation with extracellular not implemented", 0);
169 int e = cmplx_spFactor(
rep_->
m_);
250 m_ = cmplx_spCreate(
neq_, 1, &err);
273 diag_[
i] = cmplx_spGetElement(
m_,
i + 1,
i + 1);
293 int i,
j, nc,
cnt, ieq;
304 if (s && (
cnt = (*s)(
i)) > 0) {
306 for (
j = 0;
j < nc; ++
j) {
334 for (
i = 0;
i <
n; ++
i) {
335 double* cd = mlc->
data[
i];
388 int ieq,
i, in, is, iis;
410 for (iis = 0; iis <
cnt; ++iis) {
411 is = ieq + in *
cnt + iis;
437 int ieq,
i, in, is, iis;
453 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
462 if (x1[in] ==
NODEV(nd)) {
471 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
482 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
498 int ieq,
i, in, is, iis, ks, kks;
516 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
525 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
530 for (kks = 0; kks <
cnt; ++kks) {
533 ks = ieq + in *
cnt + kks;
534 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
544 ks = ieq + in *
cnt + kks;
545 for (is = ieq + in *
cnt, iis = 0; iis <
cnt; ++iis, ++is) {
548 double*
elm = cmplx_spGetElement(
m_, is + 1, ks + 1);
569 mfake.nodeindices = ml->nodeindices + in;
599 hoc_execerror(
"there can be one and only one impedance stimulus", 0);
606 double *rx, *jx, *rx1, *jx1, *rb, *jb;
608 rx =
new double[
neq_];
609 jx =
new double[
neq_];
610 rx1 =
new double[
neq_];
611 jx1 =
new double[
neq_];
612 rb =
new double[
neq_];
613 jb =
new double[
neq_];
617 for (
int i = 0;
i <
neq_; ++
i) {
630 for (iter = 1; iter <=
maxiter_; ++iter) {
632 cmplx_spSolve(
m_, rb - 1, rx1 - 1, jb - 1, jx1 - 1);
638 for (
int i = 0;
i <
neq_; ++
i) {
639 double err =
fabs(rx1[
i] - rx[
i]) +
fabs(jx1[
i] - jx[
i]);
653 for (
int i = 0;
i <
neq_; ++
i) {
661 for (
int i = 0;
i <
neq_; ++
i) {
685 "Impedance calculation did not converge in %d iterations. Max state change on last "
686 "iteration was %g (Iterations stop at %g)\n",
double transfer_amp(int curloc, int vloc)
void compute(double omega, double deltafac, int maxiter)
double ratio_amp(int clmploc, int vloc)
double input_phase(int curloc)
double input_amp(int curloc)
double transfer_phase(int curloc, int vloc)
void ode(int, Memb_list *)
void current(int, Memb_list *, int)
Symbol * hoc_table_lookup(const char *, Symlist *)
sprintf(buf, " if (secondorder) {\n" " int _i;\n" " for (_i = 0; _i < %d; ++_i) {\n" " _p[_slist%d[_i]] += dt*_p[_dlist%d[_i]];\n" " }}\n", numeqn, listnum, listnum)
void hoc_execerror(const char *, const char *)
static double deltafac(void *v)
static int ode_count(int type)
void(* nrn_ode_map_t)(int, double **, double **, double *, Datum *, double *, int)
int(* nrn_ode_count_t)(int)
void(* Pvmi)(struct NrnThread *, Memb_list *, int)
void(* nrnthread_v_transfer_)(NrnThread *)
void pargap_jacobi_setup(int mode)
int nrndae_extra_eqn_count()
void nrn_rhs(NrnThread *)
void pargap_jacobi_rhs(double *, double *)
spREAL * spGetElement(char *, int, int)
Symlist * hoc_built_in_symlist
int const size_t const size_t n
Represent main neuron object computed by single thread.
Memb_list * _ecell_memb_list
struct NrnThreadMembList * next