本文整理汇总了Java中org.ojalgo.function.aggregator.AggregatorFunction.doubleValue方法的典型用法代码示例。如果您正苦于以下问题:Java AggregatorFunction.doubleValue方法的具体用法?Java AggregatorFunction.doubleValue怎么用?Java AggregatorFunction.doubleValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ojalgo.function.aggregator.AggregatorFunction
的用法示例。
在下文中一共展示了AggregatorFunction.doubleValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRank
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
public int getRank() {
int retVal = 0;
final DecompositionStore<N> tmpInPlace = this.getInPlace();
final AggregatorFunction<N> tmpLargest = this.aggregator().largest();
tmpInPlace.visitDiagonal(0L, 0L, tmpLargest);
final double tmpLargestValue = tmpLargest.doubleValue();
final int tmpMinDim = this.getMinDim();
for (int ij = 0; ij < tmpMinDim; ij++) {
if (!tmpInPlace.isSmall(ij, ij, tmpLargestValue)) {
retVal++;
}
}
return retVal;
}
示例2: getRank
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
public int getRank() {
int retVal = 0;
final MatrixStore<Double> tmpR = this.getR();
final int tmpMinDim = (int) Math.min(tmpR.countRows(), tmpR.countColumns());
final AggregatorFunction<Double> tmpLargest = PrimitiveAggregator.LARGEST.get();
tmpR.visitDiagonal(0L, 0L, tmpLargest);
final double tmpLargestValue = tmpLargest.doubleValue();
for (int ij = 0; ij < tmpMinDim; ij++) {
if (!tmpR.isSmall(ij, ij, tmpLargestValue)) {
retVal++;
}
}
return retVal;
}
示例3: getRank
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
public int getRank() {
int retVal = 0;
final MatrixStore<Double> tmpU = this.getU();
final int tmpMinDim = (int) Math.min(tmpU.countRows(), tmpU.countColumns());
final AggregatorFunction<Double> tmpLargest = PrimitiveAggregator.LARGEST.get();
tmpU.visitDiagonal(0L, 0L, tmpLargest);
final double tmpLargestValue = tmpLargest.doubleValue();
for (int ij = 0; ij < tmpMinDim; ij++) {
if (!tmpU.isSmall(ij, ij, tmpLargestValue)) {
retVal++;
}
}
return retVal;
}
示例4: toVolatilities
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
/**
* Will extract the standard deviations (volatilities) from the input covariance matrix. If "cleaning" is
* enabled small variances will be replaced with a new minimal value.
*/
public static PrimitiveMatrix toVolatilities(final Access2D<?> covariances, final boolean clean) {
final int tmpSize = (int) Math.min(covariances.countRows(), covariances.countColumns());
final Builder<PrimitiveMatrix> retVal = PrimitiveMatrix.FACTORY.getBuilder(tmpSize);
if (clean) {
final AggregatorFunction<Double> tmpLargest = PrimitiveAggregator.LARGEST.get();
MatrixStore.PRIMITIVE.makeWrapper(covariances).get().visitDiagonal(0, 0, tmpLargest);
final double tmpLimit = tmpLargest.doubleValue() * tmpSize * PrimitiveFunction.SQRT.invoke(PrimitiveMath.MACHINE_EPSILON);
for (int ij = 0; ij < tmpSize; ij++) {
final double tmpVariance = covariances.doubleValue(ij, ij);
if (tmpVariance < tmpLimit) {
retVal.set(ij, PrimitiveFunction.SQRT.invoke(tmpLimit));
} else {
retVal.set(ij, PrimitiveFunction.SQRT.invoke(tmpVariance));
}
}
} else {
for (int ij = 0; ij < tmpSize; ij++) {
retVal.set(ij, PrimitiveFunction.SQRT.invoke(covariances.doubleValue(ij, ij)));
}
}
return retVal.get();
}
示例5: performIteration
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
void performIteration(final IterationPoint pivot) {
final double tmpPivotElement = myTableau.doubleValue(pivot.row, pivot.col);
final int tmpColRHS = myTableau.countConstraints() + myTableau.countVariables();
final double tmpPivotRHS = myTableau.doubleValue(pivot.row, tmpColRHS);
myTableau.pivot(pivot);
if (this.isDebug()) {
this.log("Iteration Point <{},{}>\tPivot: {} => {}\tRHS: {} => {}.", pivot.row, pivot.col, tmpPivotElement,
myTableau.doubleValue(pivot.row, pivot.col), tmpPivotRHS, myTableau.doubleValue(pivot.row, tmpColRHS));
}
if (options.validate) {
// Right-most column of the tableau
final Array1D<Double> tmpRHS = myTableau.sliceConstraintsRHS();
final AggregatorFunction<Double> tmpMinAggr = PrimitiveAggregator.getSet().minimum();
tmpRHS.visitAll(tmpMinAggr);
final double tmpMinVal = tmpMinAggr.doubleValue();
if ((tmpMinVal < ZERO) && !options.feasibility.isZero(tmpMinVal)) {
this.log("\nNegative RHS! {}", tmpMinVal);
if (this.isDebug()) {
this.log("Entire RHS columns: {}\n", tmpRHS);
}
}
}
}
示例6: norm
import org.ojalgo.function.aggregator.AggregatorFunction; //导入方法依赖的package包/类
public double norm() {
final AggregatorFunction<N> tmpNorm2 = myArrayFactory.aggregator().norm2();
myArray.visitAll(tmpNorm2);
return tmpNorm2.doubleValue();
}