本文整理汇总了C#中Vector.empty方法的典型用法代码示例。如果您正苦于以下问题:C# Vector.empty方法的具体用法?C# Vector.empty怎么用?C# Vector.empty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector
的用法示例。
在下文中一共展示了Vector.empty方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: integratedCovariance
public virtual Matrix integratedCovariance(double t, Vector x)
{
// this implementation is not intended for production.
// because it is too slow and too inefficient.
// This method is useful for testing and R&D.
// Please overload the method within derived classes.
//QL_REQUIRE(x.empty(), "can not handle given x here");
try {
if (!(x.empty()))
throw new ApplicationException("can not handle given x here");
}
catch { } //x is empty or null
Matrix tmp= new Matrix(size_, size_,0.0);
for (int i=0; i<size_; ++i) {
for (int j=0; j<=i;++j) {
Var_Helper helper = new Var_Helper(this, i, j);
GaussKronrodAdaptive integrator=new GaussKronrodAdaptive(1e-10, 10000);
for (int k=0; k < 64; ++k) {
tmp[i,j] +=integrator.value(helper.value, k * t / 64.0, (k + 1) * t / 64.0);
}
tmp[j,i]=tmp[i,j];
}
}
return tmp;
}
示例2: Path
public Path(TimeGrid timeGrid, Vector values) {
timeGrid_ = timeGrid;
values_ = (Vector)values.Clone();
if (values_.empty())
values_ = new Vector(timeGrid_.size());
if (values_.size() != timeGrid_.size())
throw new ApplicationException("different number of times and asset values");
}
示例3: integratedCovariance
public double integratedCovariance(int i, int j, double t,Vector x)
{
if (corrModel_.isTimeIndependent()) {
try {
// if all objects support these methods
// thats by far the fastest way to get the
// integrated covariance
return corrModel_.correlation(i, j, 0.0, x)
*volaModel_.integratedVariance(j, i, t, x);
//verifier la methode integratedVariance, qui bdoit etre implémenté
}
catch (System.Exception) {
// okay proceed with the
// slow numerical integration routine
}
}
//QL_REQUIRE(x.empty(), "can not handle given x here");
try {
if (x.empty() == false)
throw new ApplicationException("can not handle given x here");
}
catch { //OK x empty
}
double tmp=0.0;
VarProxy_Helper helper = new VarProxy_Helper(this, i, j);
GaussKronrodAdaptive integrator=new GaussKronrodAdaptive(1e-10, 10000);
for (int k=0; k<64; ++k) {
tmp+=integrator.value(helper.value, k*t/64.0, (k+1)*t/64.0);
}
return tmp;
}