void nest::hh_psc_alpha_gap::init_buffers_() { B_.spike_exc_.clear(); // includes resize B_.spike_inh_.clear(); // includes resize B_.currents_.clear(); // includes resize // allocate strucure for gap events here // function is called from Scheduler::prepare_nodes() before the // first call to update // so we already know which interpolation scheme to use according // to the properties of this neurons // determine size of structure depending on interpolation scheme // and unsigned int Scheduler::min_delay() (number of simulation time steps per min_delay step) // resize interpolation_coefficients depending on interpolation order const size_t quantity = kernel().connection_builder_manager.get_min_delay() * ( kernel().simulation_manager.get_prelim_interpolation_order() + 1 ); B_.interpolation_coefficients.resize( quantity, 0.0 ); B_.last_y_values.resize( kernel().connection_builder_manager.get_min_delay(), 0.0 ); B_.sumj_g_ij_ = 0.0; Archiving_Node::clear_history(); B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); B_.IntegrationStep_ = B_.step_; if ( B_.s_ == 0 ) B_.s_ = gsl_odeiv_step_alloc( gsl_odeiv_step_rkf45, State_::STATE_VEC_SIZE ); else gsl_odeiv_step_reset( B_.s_ ); if ( B_.c_ == 0 ) B_.c_ = gsl_odeiv_control_y_new( 1e-6, 0.0 ); else gsl_odeiv_control_init( B_.c_, 1e-6, 0.0, 1.0, 0.0 ); if ( B_.e_ == 0 ) B_.e_ = gsl_odeiv_evolve_alloc( State_::STATE_VEC_SIZE ); else gsl_odeiv_evolve_reset( B_.e_ ); B_.sys_.function = hh_psc_alpha_gap_dynamics; B_.sys_.jacobian = NULL; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast< void* >( this ); B_.I_stim_ = 0.0; }
void nest::aeif_psc_alpha::init_buffers_() { B_.spike_exc_.clear(); // includes resize B_.spike_inh_.clear(); // includes resize B_.currents_.clear(); // includes resize Archiving_Node::clear_history(); B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); // We must integrate this model with high-precision to obtain decent results B_.IntegrationStep_ = std::min( 0.01, B_.step_ ); if ( B_.s_ == 0 ) { B_.s_ = gsl_odeiv_step_alloc( gsl_odeiv_step_rkf45, State_::STATE_VEC_SIZE ); } else { gsl_odeiv_step_reset( B_.s_ ); } if ( B_.c_ == 0 ) { B_.c_ = gsl_odeiv_control_yp_new( P_.gsl_error_tol, P_.gsl_error_tol ); } else { gsl_odeiv_control_init( B_.c_, P_.gsl_error_tol, P_.gsl_error_tol, 0.0, 1.0 ); } if ( B_.e_ == 0 ) { B_.e_ = gsl_odeiv_evolve_alloc( State_::STATE_VEC_SIZE ); } else { gsl_odeiv_evolve_reset( B_.e_ ); } B_.sys_.jacobian = NULL; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast< void* >( this ); B_.sys_.function = aeif_psc_alpha_dynamics; B_.I_stim_ = 0.0; }
void nest::iaf_cond_alpha::init_buffers_() { Archiving_Node::clear_history(); B_.spike_exc_.clear(); // includes resize B_.spike_inh_.clear(); // includes resize B_.currents_.clear(); // includes resize B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); B_.IntegrationStep_ = B_.step_; if ( B_.s_ == 0 ) { B_.s_ = gsl_odeiv_step_alloc( gsl_odeiv_step_rkf45, State_::STATE_VEC_SIZE ); } else { gsl_odeiv_step_reset( B_.s_ ); } if ( B_.c_ == 0 ) { B_.c_ = gsl_odeiv_control_y_new( 1e-3, 0.0 ); } else { gsl_odeiv_control_init( B_.c_, 1e-3, 0.0, 1.0, 0.0 ); } if ( B_.e_ == 0 ) { B_.e_ = gsl_odeiv_evolve_alloc( State_::STATE_VEC_SIZE ); } else { gsl_odeiv_evolve_reset( B_.e_ ); } B_.sys_.function = iaf_cond_alpha_dynamics; B_.sys_.jacobian = NULL; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast< void* >( this ); B_.I_stim_ = 0.0; }
void nest::ht_neuron::init_buffers_() { // Reset spike buffers. for ( std::vector< RingBuffer >::iterator it = B_.spike_inputs_.begin(); it != B_.spike_inputs_.end(); ++it ) { it->clear(); // include resize } B_.currents_.clear(); // include resize B_.logger_.reset(); Archiving_Node::clear_history(); B_.step_ = Time::get_resolution().get_ms(); B_.IntegrationStep_ = B_.step_; if ( B_.s_ == 0 ) B_.s_ = gsl_odeiv_step_alloc( gsl_odeiv_step_rkf45, State_::STATE_VEC_SIZE ); else gsl_odeiv_step_reset( B_.s_ ); if ( B_.c_ == 0 ) B_.c_ = gsl_odeiv_control_y_new( 1e-3, 0.0 ); else gsl_odeiv_control_init( B_.c_, 1e-3, 0.0, 1.0, 0.0 ); if ( B_.e_ == 0 ) B_.e_ = gsl_odeiv_evolve_alloc( State_::STATE_VEC_SIZE ); else gsl_odeiv_evolve_reset( B_.e_ ); B_.sys_.function = ht_neuron_dynamics; B_.sys_.jacobian = 0; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast< void* >( this ); B_.I_stim_ = 0.0; }
void nest::iaf_cond_alpha_mc::init_buffers_() { B_.spikes_.resize( NUM_SPIKE_RECEPTORS ); for ( size_t n = 0; n < NUM_SPIKE_RECEPTORS; ++n ) B_.spikes_[ n ].clear(); // includes resize B_.currents_.resize( NUM_CURR_RECEPTORS ); for ( size_t n = 0; n < NUM_CURR_RECEPTORS; ++n ) B_.currents_[ n ].clear(); // includes resize B_.logger_.reset(); Archiving_Node::clear_history(); B_.step_ = Time::get_resolution().get_ms(); B_.IntegrationStep_ = B_.step_; if ( B_.s_ == 0 ) B_.s_ = gsl_odeiv_step_alloc( gsl_odeiv_step_rkf45, State_::STATE_VEC_SIZE ); else gsl_odeiv_step_reset( B_.s_ ); if ( B_.c_ == 0 ) B_.c_ = gsl_odeiv_control_y_new( 1e-3, 0.0 ); else gsl_odeiv_control_init( B_.c_, 1e-3, 0.0, 1.0, 0.0 ); if ( B_.e_ == 0 ) B_.e_ = gsl_odeiv_evolve_alloc( State_::STATE_VEC_SIZE ); else gsl_odeiv_evolve_reset( B_.e_ ); B_.sys_.function = iaf_cond_alpha_mc_dynamics; B_.sys_.jacobian = NULL; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast< void* >( this ); for ( size_t n = 0; n < NCOMP; ++n ) B_.I_stim_[ n ] = 0.0; }
void nest::hh_cond_exp_traub::init_buffers_() { B_.spike_exc_.clear(); // includes resize B_.spike_inh_.clear(); // includes resize B_.currents_.clear(); // includes resize Archiving_Node::clear_history(); B_.logger_.reset(); B_.step_ = Time::get_resolution().get_ms(); B_.IntegrationStep_ = B_.step_; B_.I_stim_ = 0.0; static const gsl_odeiv_step_type* T1 = gsl_odeiv_step_rkf45; if ( B_.s_ == 0 ) B_.s_ = gsl_odeiv_step_alloc (T1, State_::STATE_VEC_SIZE); else gsl_odeiv_step_reset(B_.s_); if ( B_.c_ == 0 ) B_.c_ = gsl_odeiv_control_y_new (1e-3, 0.0); else gsl_odeiv_control_init(B_.c_, 1e-3, 0.0, 1.0, 0.0); if ( B_.e_ == 0 ) B_.e_ = gsl_odeiv_evolve_alloc(State_::STATE_VEC_SIZE); else gsl_odeiv_evolve_reset(B_.e_); B_.sys_.function = hh_cond_exp_traub_dynamics; B_.sys_.jacobian = 0; B_.sys_.dimension = State_::STATE_VEC_SIZE; B_.sys_.params = reinterpret_cast<void*>(this); }
static VALUE rb_gsl_odeiv_step_reset(VALUE obj) { gsl_odeiv_step *s = NULL; Data_Get_Struct(obj, gsl_odeiv_step, s); return INT2FIX(gsl_odeiv_step_reset(s)); }
void pert_ode_reset (pert_ode * po) { gsl_odeiv_step_reset (po->se); gsl_odeiv_evolve_reset (po->ee); }