]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/LinestFormulaFunction.java
Adopt spreadsheet changes made in Balas development
[simantics/platform.git] / bundles / org.simantics.spreadsheet / src / org / simantics / spreadsheet / solver / formula / LinestFormulaFunction.java
similarity index 82%
rename from bundles/org.simantics.spreadsheet.graph/src/org/simantics/spreadsheet/graph/formula/LinestFormulaFunction.java
rename to bundles/org.simantics.spreadsheet/src/org/simantics/spreadsheet/solver/formula/LinestFormulaFunction.java
index dd037e9eaae010927dee651aadca7a5474d19014..8d952c1ac8f4e9f61cc8a60c9e4f0303ea22093d 100644 (file)
@@ -1,11 +1,9 @@
-package org.simantics.spreadsheet.graph.formula;
+package org.simantics.spreadsheet.solver.formula;
 
 import org.apache.commons.math3.stat.regression.OLSMultipleLinearRegression;
-import org.simantics.spreadsheet.graph.CellFormulaFunction;
-import org.simantics.spreadsheet.graph.CellValueVisitor;
-import org.simantics.spreadsheet.graph.SpreadsheetGraphUtils;
-import org.simantics.spreadsheet.graph.SpreadsheetMatrix;
-import org.simantics.spreadsheet.graph.parser.ast.AstArgList;
+import org.simantics.spreadsheet.SpreadsheetMatrix;
+import org.simantics.spreadsheet.Spreadsheets;
+import org.simantics.spreadsheet.solver.formula.parser.ast.AstArgList;
 
 public class LinestFormulaFunction implements CellFormulaFunction<SpreadsheetMatrix> {
 
@@ -30,9 +28,9 @@ public class LinestFormulaFunction implements CellFormulaFunction<SpreadsheetMat
                 double x[][] = new double[ysm.values.length][xsm.getWidth()];
 
                 for (int i = 0; i < ysm.values.length; i++) {
-                    y[i] = SpreadsheetGraphUtils.asNumber(ysm.values[i]);
+                    y[i] = Spreadsheets.asNumber(ysm.values[i]);
                     for (int j = 0; j < xsm.getWidth(); j++) {
-                        x[i][j] = SpreadsheetGraphUtils.asNumber(xsm.get(i, j));
+                        x[i][j] = Spreadsheets.asNumber(xsm.get(i, j));
                     }
                 }
 
@@ -64,7 +62,7 @@ public class LinestFormulaFunction implements CellFormulaFunction<SpreadsheetMat
                 result.set(2,2, FormulaError2.NA.getString());
                 result.set(3,2, FormulaError2.NA.getString());
                 result.set(4,2, FormulaError2.NA.getString());
-                
+
                 return result;
 
             }