本文整理汇总了Java中cern.colt.list.DoubleArrayList.set方法的典型用法代码示例。如果您正苦于以下问题:Java DoubleArrayList.set方法的具体用法?Java DoubleArrayList.set怎么用?Java DoubleArrayList.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cern.colt.list.DoubleArrayList
的用法示例。
在下文中一共展示了DoubleArrayList.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: quantileElements
import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
* Computes the specified quantile elements over the values previously added.
* @param phis the quantiles for which elements are to be computed. Each phi must be in the interval (0.0,1.0]. <tt>phis</tt> must be sorted ascending.
* @return the approximate quantile elements.
*/
public DoubleArrayList quantileElements(DoubleArrayList phis) {
if (precomputeEpsilon<=0.0) return super.quantileElements(phis);
int quantilesToPrecompute = (int) Utils.epsilonCeiling(1.0 / precomputeEpsilon);
/*
if (phis.size() > quantilesToPrecompute) {
// illegal use case!
// we compute results, but loose explicit approximation guarantees.
return super.quantileElements(phis);
}
*/
//select that quantile from the precomputed set that corresponds to a position closest to phi.
phis = phis.copy();
double e = precomputeEpsilon;
for (int index=phis.size(); --index >= 0;) {
double phi = phis.get(index);
int i = (int) Math.round( ((2.0*phi/e) - 1.0 ) / 2.0); // finds closest
i = Math.min(quantilesToPrecompute-1, Math.max(0,i));
double augmentedPhi = (e/2.0)*(1+2*i);
phis.set(index,augmentedPhi);
}
return super.quantileElements(phis);
}
示例2: Divides
import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
Divides (rebins) a copy of the receiver at the given <i>interval boundaries</i> into bins and returns these bins, such that each bin <i>approximately</i> reflects the data elements of its range.
For each interval boundary of the axis (including -infinity and +infinity), computes the percentage (quantile inverse) of elements less than the boundary.
Then lets {@link #splitApproximately(DoubleArrayList,int)} do the real work.
@param axis an axis defining interval boundaries.
@param resolution a measure of accuracy; the desired number of subintervals per interval.
*/
public synchronized MightyStaticBin1D[] splitApproximately(hep.aida.IAxis axis, int k) {
DoubleArrayList percentages = new DoubleArrayList(new hep.aida.ref.Converter().edges(axis));
percentages.beforeInsert(0,Double.NEGATIVE_INFINITY);
percentages.add(Double.POSITIVE_INFINITY);
for (int i=percentages.size(); --i >= 0; ) {
percentages.set(i, quantileInverse(percentages.get(i)));
}
return splitApproximately(percentages,k);
}
示例3: preProcessPhis
import cern.colt.list.DoubleArrayList; //导入方法依赖的package包/类
/**
*/
protected DoubleArrayList preProcessPhis(DoubleArrayList phis) {
if (beta>1.0) {
phis = phis.copy();
for (int i=phis.size(); --i >=0;) {
phis.set(i, (2*phis.get(i) + beta - 1) / (2*beta));
}
}
return phis;
}