本文整理匯總了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));
}