本文整理汇总了Java中org.apache.commons.math3.linear.RealVector.add方法的典型用法代码示例。如果您正苦于以下问题:Java RealVector.add方法的具体用法?Java RealVector.add怎么用?Java RealVector.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.math3.linear.RealVector
的用法示例。
在下文中一共展示了RealVector.add方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compose
import org.apache.commons.math3.linear.RealVector; //导入方法依赖的package包/类
@Override
public RealVector compose(List<RealVector> vectors) {
logger.trace("Composing {} vectors", vectors.size());
if (vectors.isEmpty()) {
return null;
} else if (vectors.size() == 1) {
return vectors.get(0);
} else {
RealVector sum = vectors.get(0).add(vectors.get(1));
for (int i = 2; i < vectors.size(); i++) {
sum = sum.add(vectors.get(i));
}
return sum;
}
}
示例2: simpleNewtonIteration
import org.apache.commons.math3.linear.RealVector; //导入方法依赖的package包/类
public static RealVector simpleNewtonIteration(RealVector currentApprox) {
NewtonMethod method = new NewtonMethod();
double[] temp = currentApprox.toArray();
method.setJacobiMatrix(temp);
method.setEquationSystem(temp);
RealVector vector = method.solveOfEquation();
return vector.add(currentApprox);
}
示例3: nextMVNormalMeanCovariance
import org.apache.commons.math3.linear.RealVector; //导入方法依赖的package包/类
public RealVector nextMVNormalMeanCovariance(RealVector mu, Cholesky covariance) {
RealVector x = nextMVNormal(mu.getDimension());
return mu.add(covariance.getL().operate(x));
}
示例4: nextMVNormalMeanPrecision
import org.apache.commons.math3.linear.RealVector; //导入方法依赖的package包/类
public RealVector nextMVNormalMeanPrecision(RealVector mu, Cholesky precision) {
RealVector x = nextMVNormal(mu.getDimension());
return mu.add(precision.solveLT(x));
}