本文整理汇总了C++中Parameters::At方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::At方法的具体用法?C++ Parameters::At怎么用?C++ Parameters::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Parameters
的用法示例。
在下文中一共展示了Parameters::At方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Jacobian
int Rossler::Jacobian (long int N, DenseMat J, realtype t, N_Vector x, N_Vector fy,
void *jac_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) {
#endif
#ifdef CVODE26
int Rossler::Jacobian (int N, realtype t, N_Vector x, N_Vector fy, DlsMat J,
void *jac_data, N_Vector tmp1, N_Vector tmp2, N_Vector tmp3) {
#endif
realtype a, b, c;
realtype x1, x2, x3;
Parameters * parameters;
x1 = Ith (x, 0);
x2 = Ith (x, 1);
x3 = Ith (x, 2);
parameters = (Parameters *) jac_data;
a = parameters->At(0);
b = parameters->At(1);
c = parameters->At(2);
IJth (J, 0, 0) = 0.0;
IJth (J, 0, 1) = -1.0;
IJth (J, 0, 2) = -1.0;
IJth (J, 1, 0) = 1.0;
IJth (J, 1, 1) = a;
IJth (J, 1, 2) = 0.0;
IJth (J, 2, 0) = x3;
IJth (J, 2, 1) = 0.0;
IJth (J, 2, 2) = x1-c;
return CV_SUCCESS;
}
示例2: EventsConstraints
void Rossler::EventsConstraints (realtype t, N_Vector x, int * constraints, void * data) {
realtype a, b, c;
realtype x1, x2, x3;
realtype ris[3], xdot[3];
Parameters * parameters;
x1 = Ith (x, 0);
x2 = Ith (x, 1);
x3 = Ith (x, 2);
parameters = (Parameters *) data;
a = parameters->At(0);
b = parameters->At(1);
c = parameters->At(2);
RHS(t,x,xderiv,data);
for(int i=0; i<GetDimension(); i++)
xdot[i] = Ith(xderiv,i);
ris[0] = - xdot[1] - xdot[2];
ris[1] = xdot[0] + a*xdot[1];
ris[2] = xdot[0]*x3 + xdot[2]*(x1-c);
for(int i=0; i<GetNumberOfEvents(); i++)
constraints[i] = (ris[i] < 0 ? 1 : 0);
}
示例3: RHS
int Rossler::RHS (realtype t, N_Vector x, N_Vector xdot, void * data) {
realtype x1, x2, x3;
realtype a, b, c;
Parameters * parameters;
parameters = (Parameters *) data;
a = parameters->At(0);
b = parameters->At(1);
c = parameters->At(2);
x1 = Ith (x, 0);
x2 = Ith (x, 1);
x3 = Ith (x, 2);
Ith (xdot, 0) = - x2 - x3;
Ith (xdot, 1) = x1 + a*x2;
Ith (xdot, 2) = b + x3*(x1 - c);
return CV_SUCCESS;
}
示例4: Events
int PLL::Events (realtype t, N_Vector X, realtype * event, void * data) {
#ifndef WITHPHIERR
realtype x, y, r, w;
Parameters * parameters = (Parameters *) data;
x = Ith (X, 0);
y = Ith (X, 1);
r = Ith (X, 2);
w = Ith (X, 3);
fREF = parameters->At(0);
T = 1.0/fREF;
R1 = parameters->At(1);
omega0 = 2*pi*parameters->At(2);
Vdd = parameters->At(3);
rho0 = parameters->At(4);
rhoap = parameters->At(5);
k0 = parameters->At(6);
Krho = parameters->At(7);
Kap = parameters->At(8);
alpha = parameters->At(9);
KVCOa = parameters->At(10);
KVCOb = parameters->At(11);
KVCOc = parameters->At(12);
tuning_coeff = parameters->At(13);
// rising edge of the clock
event[0] = t - n*T;
// extrema of x
realtype gamma = sqrt(x*x+y*y);
realtype vtune = w/tuning_coeff;
event[1] = ((rho0+Krho*vtune)/gamma - 1)*k0*x - ((1-alpha)*Kap*(gamma-rhoap) + 1 + alpha*vtune*(KVCOa + KVCOb*vtune + KVCOc*vtune*vtune))*omega0*y;
// reset
event[2] = t - (treset+tau_d+dt);
#endif
return CV_SUCCESS;
}