本文整理汇总了C++中Filter::getAmplitude方法的典型用法代码示例。如果您正苦于以下问题:C++ Filter::getAmplitude方法的具体用法?C++ Filter::getAmplitude怎么用?C++ Filter::getAmplitude使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Filter
的用法示例。
在下文中一共展示了Filter::getAmplitude方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
double
NewDiscretizedRandomProcessSeries::getFactorSensitivity(double time)
{
// The parameterID has been set to the number of
// the random variable in question
// So, do the same thing as above, just set x(i-1) equal to 1.0
// for i==parameterID
if (time == 0.0 || parameterID<0) {
return 0.0;
}
else if (randomVariables == 0 || kickInTimes == 0) {
opserr << "ERROR in DiscretizedRandomProcessSeries::getFactorSensitivity(): " << endln
<< " random variables or kick-in times vector(s) do not exist. " << endln;
return 0.0;
}
else if (kickInTimes->Size() != randomVariables->Size() ) {
opserr << "ERROR in DiscretizedRandomProcessSeries::getFactorSensitivity(): " << endln
<< " number of random variables is not the same as kick-in times. " << endln;
return 0.0;
}
else {
double sum1;
double sum2;
// int nrv = 0;
double modFuncAmplitude;
Filter *theFilter;
// Loop over all modulating functions
double dtime;
sum1 = 0.0;
for (int k=0; k<numModFuncs; k++) {
// Get value of modulating function number k at time t
modFuncAmplitude = theModulatingFunctions[k]->getAmplitude(time);
theFilter = theModulatingFunctions[k]->getFilter();
// Number of discretizing random variables
//nrv = randomVariables->Size();
// Loop over all rv's (even though some may be zero at this time)
dtime=time-(*kickInTimes)(parameterID);
// if(fabs(dtime)<=1.0e-7) dtime=0.0;
sum2 = theFilter->getAmplitude(dtime, 0.0);
sum1 += sum2*modFuncAmplitude;
}
// double result=0.0;
// if(fabs(time-(*kickInTimes)(parameterID-1))<= 1.0e-8) result=1.0;
double result = mean + c*sum1;
return result;
}
}