Simplification of the conversion from RealVector to double[].
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1164662 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
de75806149
commit
6a895ec220
|
@ -148,13 +148,7 @@ public class GaussNewtonOptimizer extends AbstractLeastSquaresOptimizer {
|
|||
DecompositionSolver solver = useLU ?
|
||||
new LUDecompositionImpl(mA).getSolver() :
|
||||
new QRDecompositionImpl(mA).getSolver();
|
||||
final RealVector dummy = solver.solve(new ArrayRealVector(b, false));
|
||||
final double[] dX;
|
||||
if (dummy instanceof ArrayRealVector){
|
||||
dX = ((ArrayRealVector) dummy).getDataRef();
|
||||
}else{
|
||||
dX = dummy.getData();
|
||||
}
|
||||
final double[] dX = solver.solve(new ArrayRealVector(b, false)).toArray();
|
||||
// update the estimated parameters
|
||||
for (int i = 0; i < cols; ++i) {
|
||||
point[i] += dX[i];
|
||||
|
|
Loading…
Reference in New Issue