]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.equation/src/org/simantics/equation/ext/SecondOrderScalarPolynomialSolver.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.equation / src / org / simantics / equation / ext / SecondOrderScalarPolynomialSolver.java
index cff38df9615a1b1a169a95e1fc923987e20a9878..17307dc254543624fe6c02b33f4edc258e24e44d 100644 (file)
@@ -1,38 +1,38 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.equation.ext;\r
-\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.equation.EquationResources;\r
-import org.simantics.equation.solver.ExpressionSolver;\r
-import org.simantics.equation.solver.Solver;\r
-import org.simantics.equation.stubs.EquationResource;\r
-\r
-public class SecondOrderScalarPolynomialSolver implements ExpressionSolver {\r
-\r
-    public void evaluate(Solver solver, ReadGraph g, Resource t) throws DatabaseException {\r
-        EquationResource eq = EquationResources.equationResource;\r
-\r
-        double a = g.getRelatedValue(t, eq.HasA);\r
-        double b = g.getRelatedValue(t, eq.HasB);\r
-        double c = g.getRelatedValue(t, eq.HasC);\r
-\r
-        double x = solver.getDoubleValue(g, g.getSingleObject(t, eq.HasSource));\r
-\r
-        double r = a * x * x + b * x + c;\r
-\r
-        solver.setValue(g.getSingleObject(t, eq.HasTarget), new double[] { r });\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.equation.ext;
+
+import org.simantics.db.Resource;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.equation.EquationResources;
+import org.simantics.equation.solver.ExpressionSolver;
+import org.simantics.equation.solver.Solver;
+import org.simantics.equation.stubs.EquationResource;
+
+public class SecondOrderScalarPolynomialSolver implements ExpressionSolver {
+
+    public void evaluate(Solver solver, ReadGraph g, Resource t) throws DatabaseException {
+        EquationResource eq = EquationResources.equationResource;
+
+        double a = g.getRelatedValue(t, eq.HasA);
+        double b = g.getRelatedValue(t, eq.HasB);
+        double c = g.getRelatedValue(t, eq.HasC);
+
+        double x = solver.getDoubleValue(g, g.getSingleObject(t, eq.HasSource));
+
+        double r = a * x * x + b * x + c;
+
+        solver.setValue(g.getSingleObject(t, eq.HasTarget), new double[] { r });
+    }
+
+}