Пример #1
0
double* NrnProperty::prop_pval(const Symbol* s, int index)const {
	if (npi_->p_->ob) {
		return npi_->p_->ob->u.dataspace[prop_index(s)].pval + index;
	}else{
		if (s->subtype == NRNPOINTER) {
			return npi_->p_->dparam[prop_index(s) + index].pval;
		}else{
			return npi_->p_->param + prop_index(s) + index;
		}
	}
}
Пример #2
0
static void v2_pidx_crit(CSTR_rast c) {
	int16_t pidx;
	// version *v, *wv;
	UniVersions vers, wvers = { 0 };
	uint16_t let;
	int i, j;
	CSTR_rast_attr attr;

	CSTR_GetAttr(c, &attr);
	CSTR_GetCollectionUni(c, &vers);
	// Paul 07-12-99
	if (vers.lnAltCnt <= 0)
		return;
	//

	attr.reasno = 0;
	pidx = prop_index(attr.h, attr.w);
	// wv = v = c->vers;
	wvers.lnAltMax = REC_MAX_VERS;

	// while (v->let)
	for (i = j = 0; i < vers.lnAltCnt; i++) {
		if (is_cen_language(language) && !attr.accent_leader)
			//let = (wv->let=v->let) * 2;
			let = ((uint16_t) vers.Alt[i].Liga) * 2;
		else
			//let = (let_sans_acc[wv->let=v->let]) * 2;
			let = (let_sans_acc[vers.Alt[i].Liga]) * 2;

		//   wv->prob = v->prob;
		if (pidx + prop_l_delta < letters_pidx_table[let]) {
			attr.reasno |= CSTR_rn_left;
			continue;
		}

		if (pidx - prop_r_delta > letters_pidx_table[let + 1]) {
			attr.reasno |= CSTR_rn_right;
			continue;
		}

		//   v++;
		//   wv++;
		wvers.Alt[j] = vers.Alt[i];
		j++;
	}

	// wv->let = 0;
	CSTR_SetAttr(c, &attr);

	wvers.lnAltCnt = j;

	// if ((c->nvers -= v-wv) == 0)
	if (wvers.lnAltCnt <= 0)
		set_bad_cell(c);
	else
		CSTR_StoreCollectionUni(c, &wvers);
}