在处理过程中,我将Apache和作为外部jar库导入。我遵循了这样的指示:
处理草图似乎工作良好,但每次运行草图时,我都会得到下面的错误,以便输出控制台。
No library found for org.apache.commons.math3.fitting.leastsquares.LeastSquaresOptimizer这是处理PDE草图:
import org.apache.commons.math3.fitting.leastsquares.*;
import org.apache.commons.math3.fitting.leastsquares.LeastSquaresOptimizer.Optimum;
import org.apache.commons.math3.linear.RealMatrix;
import org.apache.commons.math3.linear.RealVector;
import com.lemmingapex.trilateration.*;
void setup() {
size(1024, 768);
double[][] positions = new double[][] { { 8.0, 12.0 }, { 15.0, 40.0 }, { 40.0, 20.0 }, { 22, 40 } };
double[] distances = new double[] { 10.06, 13.97, 23.32, 10.31 };
NonLinearLeastSquaresSolver solver = new NonLinearLeastSquaresSolver(new TrilaterationFunction(positions, distances), new LevenbergMarquardtOptimizer());
Optimum optimum = solver.solve();
// the answer
double[] centroid = optimum.getPoint().toArray();
printArray(centroid);
// error and geometry information; may throw SingularMatrixException depending the threshold argument provided
RealVector standardDeviation = optimum.getSigma(0);
RealMatrix covarianceMatrix = optimum.getCovariances(0);
printArray(standardDeviation);
printArray(covarianceMatrix);
background(37);
ellipse((float) centroid[0], (float) centroid[1], 20, 20);
}
void draw() {
}我哪里出问题了?有什么指示吗?
发布于 2018-01-08 19:21:42
我能够使用以下的导入来使它工作。
import org.apache.commons.math3.fitting.leastsquares.LeastSquaresOptimizer.Optimum;
import org.apache.commons.math3.fitting.leastsquares.LevenbergMarquardtOptimizer;
import com.lemmingapex.trilateration.NonLinearLeastSquaresSolver;
import com.lemmingapex.trilateration.TrilaterationFunction;
import com.lemmingapex.trilateration.*;谢谢凯文。希望这能帮到其他人。
发布于 2017-11-21 04:46:55
你在你链接到的答案上看到我的意见了吗?
在处理过程中使用库的最简单方法是将库的.jar文件拖到处理编辑器中。只需对您需要的所有.jar文件执行此操作即可。(您可能必须删除已经创建的库目录。)
无耻的自我推销:我写了一篇关于在处理可用这里时使用库的教程。
https://stackoverflow.com/questions/47372241
复制相似问题