[gnome-calculator] GCalc: renamed Polynomial to MathPolynomial
- From: Daniel Espinosa Ortiz <despinosa src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calculator] GCalc: renamed Polynomial to MathPolynomial
- Date: Thu, 17 Oct 2019 19:07:16 +0000 (UTC)
commit 153ab2c63f892a239773216221a8cc21a92a16a0
Author: Daniel Espinosa <esodan gmail com>
Date: Thu Oct 17 10:35:01 2019 -0500
GCalc: renamed Polynomial to MathPolynomial
gcalc/gcalc-assign.vala | 2 +-
gcalc/gcalc-gparser.vala | 28 ++++----
gcalc/gcalc-gpolynomial.vala | 2 +-
gcalc/gcalc-group.vala | 2 +-
...-polynomial.vala => gcalc-math-polynomial.vala} | 5 +-
gcalc/gcalc-variable.vala | 2 +-
gcalc/meson.build | 2 +-
tests/gcalc-parsing.vala | 80 +++++++++++-----------
tests/gcalc-solving-basic.vala | 72 +++++++++----------
9 files changed, 99 insertions(+), 96 deletions(-)
---
diff --git a/gcalc/gcalc-assign.vala b/gcalc/gcalc-assign.vala
index 5ee49556..eb1e8ce8 100644
--- a/gcalc/gcalc-assign.vala
+++ b/gcalc/gcalc-assign.vala
@@ -27,7 +27,7 @@ public interface GCalc.Assign : Object, MathExpression, MathOperator, MathBinary
if (v == null) {
throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid variable object in assign");
}
- var p = expressions.get_item (1) as Polynomial;
+ var p = expressions.get_item (1) as MathPolynomial;
if (p == null) {
throw new AssigError.INVALID_STRUCTURE_ERROR ("Invalid polynomial object in assign");
}
diff --git a/gcalc/gcalc-gparser.vala b/gcalc/gcalc-gparser.vala
index d54e80b7..971a6c6b 100644
--- a/gcalc/gcalc-gparser.vala
+++ b/gcalc/gcalc-gparser.vala
@@ -82,11 +82,11 @@ public class GCalc.GParser : Object {
top_parent = exp;
expected.clear ();
expected.add(TokenType.OPEN_PARENS);
- } else if (current is MathOperator && current_parent is Term && top_parent is Polynomial) {
+ } else if (current is MathOperator && current_parent is Term && top_parent is MathPolynomial) {
current_parent.expressions.add (sfunc);
current = sfunc;
expected.clear ();
- } else if (current is Term && current_parent is Polynomial) {
+ } else if (current is Term && current_parent is MathPolynomial) {
current.expressions.add (sfunc);
current_parent = current;
current = sfunc;
@@ -124,7 +124,7 @@ public class GCalc.GParser : Object {
current_parent = v.parent;
top_parent = current_parent.parent;
expected.clear ();
- } else if (current is MathOperator && current_parent is Term && top_parent is Polynomial) {
+ } else if (current is MathOperator && current_parent is Term && top_parent is MathPolynomial) {
current_parent.expressions.add (v);
current = v;
expected.clear ();
@@ -153,11 +153,11 @@ public class GCalc.GParser : Object {
current = cexp;
current_parent = t;
top_parent = exp;
- } else if ((current is MathOperator || current is Term) && current_parent is Term && top_parent is
Polynomial) {
+ } else if ((current is MathOperator || current is Term) && current_parent is Term && top_parent is
MathPolynomial) {
current_parent.expressions.add (cexp);
expected.clear ();
current = cexp;
- } else if (current is Term && current_parent is Polynomial && (top_parent is Group || top_parent
is Function)) {
+ } else if (current is Term && current_parent is MathPolynomial && (top_parent is Group ||
top_parent is Function)) {
current.expressions.add (cexp);
top_parent = current_parent;
current_parent = current;
@@ -184,7 +184,7 @@ public class GCalc.GParser : Object {
case TokenType.ASSIGN:
if (current == null) {
throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for an assignment");
- } else if (current is Polynomial) {
+ } else if (current is MathPolynomial) {
throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression: can't set a value to
a polynomial");
} else if (current is Variable) {
bool removed = false;
@@ -192,7 +192,7 @@ public class GCalc.GParser : Object {
if (current.parent is Term) {
var t = current.parent;
if (t.parent != null) {
- if (t.parent is Polynomial) {
+ if (t.parent is MathPolynomial) {
var p = t.parent;
if (p.parent != null) {
if (p.parent is MathEquation) {
@@ -245,7 +245,7 @@ public class GCalc.GParser : Object {
current = t;
current_parent = fexp;
expected.clear ();
- } else if (current is MathOperator && current_parent is Term && top_parent is Polynomial) {
+ } else if (current is MathOperator && current_parent is Term && top_parent is MathPolynomial) {
var g = new GGroup ();
current_parent.expressions.add (g);
var exp = new GPolynomial ();
@@ -348,14 +348,14 @@ public class GCalc.GParser : Object {
top_parent = exp;
eq.expressions.add (exp);
expected.clear ();
- } else if (current_parent is Polynomial && current is Term) {
+ } else if (current_parent is MathPolynomial && current is Term) {
current.expressions.add (opp);
top_parent = current_parent;
current_parent = current;
current = opp;
expected.clear ();
} else if ((current is Constant || current is Variable)
- && current_parent is Term && top_parent is Polynomial) {
+ && current_parent is Term && top_parent is MathPolynomial) {
// New term
var t = new GTerm ();
t.expressions.add (opp);
@@ -363,7 +363,7 @@ public class GCalc.GParser : Object {
current = opp;
current_parent = t;
expected.clear ();
- } else if ((current is Group || current is Function) && current_parent is Term && top_parent is
Polynomial) {
+ } else if ((current is Group || current is Function) && current_parent is Term && top_parent is
MathPolynomial) {
// New term
var t = new GTerm ();
t.expressions.add (opp);
@@ -373,7 +373,7 @@ public class GCalc.GParser : Object {
top_parent = current_parent.parent;
expected.clear ();
} else if (current is Variable && current_parent == null) {
- // New Polynomial
+ // New MathPolynomial
var exp = new GPolynomial ();
eq.expressions.add (exp);
var t = new GTerm ();
@@ -393,12 +393,12 @@ public class GCalc.GParser : Object {
throw new ParserError.INVALID_TOKEN_ERROR ("Found an unexpected expression for a multiply operator");
}
if ((current is Constant || current is Variable || current is Group || current is Function)
- && current_parent is Term && top_parent is Polynomial) {
+ && current_parent is Term && top_parent is MathPolynomial) {
current_parent.expressions.add (op);
current = op;
expected.clear ();
} else if (current is Variable && current_parent == null) {
- // New Polynomial
+ // New MathPolynomial
var exp = new GPolynomial ();
eq.expressions.add (exp);
var t = new GTerm ();
diff --git a/gcalc/gcalc-gpolynomial.vala b/gcalc/gcalc-gpolynomial.vala
index 86f72800..0a8b20bb 100644
--- a/gcalc/gcalc-gpolynomial.vala
+++ b/gcalc/gcalc-gpolynomial.vala
@@ -18,7 +18,7 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public class GCalc.GPolynomial : Expression, Polynomial {
+public class GCalc.GPolynomial : Expression, MathPolynomial {
internal override Result solve () {
Result res = null;
try {
diff --git a/gcalc/gcalc-group.vala b/gcalc/gcalc-group.vala
index 3205d933..ec7b8119 100644
--- a/gcalc/gcalc-group.vala
+++ b/gcalc/gcalc-group.vala
@@ -30,7 +30,7 @@ public interface GCalc.Group : Object, MathExpression {
if (expressions.get_n_items () == 0) {
throw new GroupError.INVALID_POLYNOMIAL ("No internal polynomial in group");
}
- var e = expressions.get_item (0) as Polynomial;
+ var e = expressions.get_item (0) as MathPolynomial;
if (e == null) {
throw new GroupError.INVALID_POLYNOMIAL ("Invalid internal polynomial in group");
}
diff --git a/gcalc/gcalc-polynomial.vala b/gcalc/gcalc-math-polynomial.vala
similarity index 93%
rename from gcalc/gcalc-polynomial.vala
rename to gcalc/gcalc-math-polynomial.vala
index 621175f9..3515bdb7 100644
--- a/gcalc/gcalc-polynomial.vala
+++ b/gcalc/gcalc-math-polynomial.vala
@@ -18,7 +18,10 @@
* Authors:
* Daniel Espinosa <esodan gmail com>
*/
-public interface GCalc.Polynomial : Object, MathExpression {
+/**
+ * A multiple expressions in a math expression
+ */
+public interface GCalc.MathPolynomial : Object, MathExpression {
public virtual MathExpression evaluate () throws GLib.Error {
Term current = null;
MathExpression res = null;
diff --git a/gcalc/gcalc-variable.vala b/gcalc/gcalc-variable.vala
index a3bd7daf..9a69b4bd 100644
--- a/gcalc/gcalc-variable.vala
+++ b/gcalc/gcalc-variable.vala
@@ -40,7 +40,7 @@ public interface GCalc.Variable : Object, MathExpression {
if (parent.expressions.get_n_items () != 2) {
throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to Variable's expression
definition. Expression not found");
}
- var e = parent.expressions.get_item (1) as Polynomial;
+ var e = parent.expressions.get_item (1) as MathPolynomial;
if (e == null) {
throw new VariableError.INVALID_EXPRESSION_DEFINITION ("Can't access to Variable's expression
definition. Unexpected object type");
}
diff --git a/gcalc/meson.build b/gcalc/meson.build
index 96585637..d6917d1e 100644
--- a/gcalc/meson.build
+++ b/gcalc/meson.build
@@ -105,11 +105,11 @@ gcalc_sources = files([
'gcalc-math-equation-manager.vala',
'gcalc-math-expression.vala',
'gcalc-math-operator.vala',
+ 'gcalc-math-polynomial.vala',
'gcalc-minus.vala',
'gcalc-multiply.vala',
'gcalc-parameter.vala',
'gcalc-plus.vala',
- 'gcalc-polynomial.vala',
'gcalc-pow.vala',
'gcalc-result.vala',
'gcalc-solver.vala',
diff --git a/tests/gcalc-parsing.vala b/tests/gcalc-parsing.vala
index 843a0017..23042455 100644
--- a/tests/gcalc-parsing.vala
+++ b/tests/gcalc-parsing.vala
@@ -33,7 +33,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -55,7 +55,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -94,7 +94,7 @@ class Tests {
var v = assign.expressions.get_item (0) as Variable;
assert (v != null);
assert (v.name == "var");
- var p = assign.expressions.get_item (1) as Polynomial;
+ var p = assign.expressions.get_item (1) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -116,7 +116,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 2);
var t1 = p.expressions.get_item (0) as Term;
@@ -145,7 +145,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 2);
var t1 = p.expressions.get_item (0) as Term;
@@ -174,7 +174,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 2);
var t1 = p.expressions.get_item (0) as Term;
@@ -203,7 +203,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 2);
var t1 = p.expressions.get_item (0) as Term;
@@ -232,7 +232,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 4);
@@ -278,7 +278,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 4);
@@ -324,7 +324,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t1 = p.expressions.get_item (0) as Term;
@@ -350,7 +350,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 1);
@@ -377,7 +377,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 2);
@@ -417,7 +417,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t1 = p.expressions.get_item (0) as Term;
@@ -443,7 +443,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 1);
@@ -470,7 +470,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
message ("Terms: %u", p.expressions.get_n_items ());
assert (p.expressions.get_n_items () == 2);
@@ -519,7 +519,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -529,7 +529,7 @@ class Tests {
assert (g != null);
assert (g.closed);
assert (g.expressions.get_n_items () == 1);
- var p1 = g.expressions.get_item (0) as Polynomial;
+ var p1 = g.expressions.get_item (0) as MathPolynomial;
assert (p1 != null);
assert (p1.expressions.get_n_items () == 1);
var t1 = p1.expressions.get_item (0) as Term;
@@ -579,7 +579,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 2);
var t1 = p.expressions.get_item (0) as Term;
@@ -589,7 +589,7 @@ class Tests {
assert (g1 != null);
assert (g1.closed);
assert (g1.expressions.get_n_items () == 1);
- var p1 = g1.expressions.get_item (0) as Polynomial;
+ var p1 = g1.expressions.get_item (0) as MathPolynomial;
assert (p1 != null);
assert (p1.expressions.get_n_items () == 1);
var t11 = p1.expressions.get_item (0) as Term;
@@ -606,7 +606,7 @@ class Tests {
assert (g2 != null);
assert (g2.closed);
assert (g2.expressions.get_n_items () == 1);
- var p2 = g2.expressions.get_item (0) as Polynomial;
+ var p2 = g2.expressions.get_item (0) as MathPolynomial;
assert (p2 != null);
assert (p2.expressions.get_n_items () == 1);
var t21 = p1.expressions.get_item (0) as Term;
@@ -628,7 +628,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t1 = p.expressions.get_item (0) as Term;
@@ -642,7 +642,7 @@ class Tests {
assert (g != null);
assert (g.closed);
assert (g.expressions.get_n_items () == 1);
- var pg = g.expressions.get_item (0) as Polynomial;
+ var pg = g.expressions.get_item (0) as MathPolynomial;
assert (pg != null);
assert (pg.expressions.get_n_items () == 2);
var tg1 = pg.expressions.get_item (0) as Term;
@@ -672,7 +672,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t1 = p.expressions.get_item (0) as Term;
@@ -682,7 +682,7 @@ class Tests {
assert (g != null);
assert (g.closed);
assert (g.expressions.get_n_items () == 1);
- var pg = g.expressions.get_item (0) as Polynomial;
+ var pg = g.expressions.get_item (0) as MathPolynomial;
assert (pg != null);
assert (pg.expressions.get_n_items () == 2);
var tg1 = pg.expressions.get_item (0) as Term;
@@ -736,7 +736,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -745,7 +745,7 @@ class Tests {
var f = t.expressions.get_item (0) as Function;
assert (f != null);
assert (f.expressions.get_n_items () == 1);
- var p1 = f.expressions.get_item (0) as Polynomial;
+ var p1 = f.expressions.get_item (0) as MathPolynomial;
assert (p1 != null);
var t1 =p1.expressions.get_item (0) as Term;
assert (t1 != null);
@@ -767,7 +767,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -793,7 +793,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
assert (eq.expressions.get_n_items () == 1);
- var p = eq.expressions.get_item (0) as Polynomial;
+ var p = eq.expressions.get_item (0) as MathPolynomial;
assert (p != null);
assert (p.expressions.get_n_items () == 1);
var t = p.expressions.get_item (0) as Term;
@@ -806,7 +806,7 @@ class Tests {
var g = t.expressions.get_item (2) as Group;
assert (g != null);
assert (g.expressions.get_n_items () == 1);
- var p1 = g.expressions.get_item (0) as Polynomial;
+ var p1 = g.expressions.get_item (0) as MathPolynomial;
assert (p1 != null);
} catch (GLib.Error error) {
warning ("Error: %s", error.message);
@@ -827,7 +827,7 @@ class Tests {
assert (a.expressions.get_n_items () == 2);
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 1);
var t = e.expressions.get_item (0) as Term;
@@ -854,7 +854,7 @@ class Tests {
assert (a.expressions.get_n_items () == 2);
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 2);
var t1 = e.expressions.get_item (0) as Term;
@@ -936,7 +936,7 @@ class Tests {
assert (a.expressions.get_n_items () == 2);
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 1);
var t = e.expressions.get_item (0) as Term;
@@ -947,7 +947,7 @@ class Tests {
assert (eq2 != null);
message (eq2.to_string ());
assert (eq2.expressions.get_n_items () == 1);
- var e2 = eq2.expressions.get_item (0) as Polynomial;
+ var e2 = eq2.expressions.get_item (0) as MathPolynomial;
assert (e2 != null);
assert (e2.expressions.get_n_items () == 1);
var t2 = e2.expressions.get_item (0) as Term;
@@ -974,7 +974,7 @@ class Tests {
assert (a.expressions.get_n_items () == 2);
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 1);
var t = e.expressions.get_item (0) as Term;
@@ -990,7 +990,7 @@ class Tests {
assert (a2.expressions.get_n_items () == 2);
var v2 = a2.expressions.get_item (0) as Variable;
assert (v2 != null);
- var e2 = a2.expressions.get_item (1) as Polynomial;
+ var e2 = a2.expressions.get_item (1) as MathPolynomial;
assert (e2 != null);
assert (e2.expressions.get_n_items () == 1);
var t2 = e2.expressions.get_item (0) as Term;
@@ -1019,7 +1019,7 @@ class Tests {
assert (a.expressions.get_n_items () == 2);
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 1);
var t = e.expressions.get_item (0) as Term;
@@ -1035,7 +1035,7 @@ class Tests {
assert (a2.expressions.get_n_items () == 2);
var v2 = a2.expressions.get_item (0) as Variable;
assert (v2 != null);
- var e2 = a2.expressions.get_item (1) as Polynomial;
+ var e2 = a2.expressions.get_item (1) as MathPolynomial;
assert (e2 != null);
assert (e2.expressions.get_n_items () == 1);
var t2 = e2.expressions.get_item (0) as Term;
@@ -1051,7 +1051,7 @@ class Tests {
assert (a3.expressions.get_n_items () == 2);
var v4 = a3.expressions.get_item (0) as Variable;
assert (v4 != null);
- var e3 = a3.expressions.get_item (1) as Polynomial;
+ var e3 = a3.expressions.get_item (1) as MathPolynomial;
assert (e3 != null);
message ("Termns in Polynomial3: %u", e3.expressions.get_n_items ());
assert (e3.expressions.get_n_items () == 2);
@@ -1088,7 +1088,7 @@ class Tests {
var v = a.expressions.get_item (0) as Variable;
assert (v != null);
assert (v.name == "x");
- var e = a.expressions.get_item (1) as Polynomial;
+ var e = a.expressions.get_item (1) as MathPolynomial;
assert (e != null);
assert (e.expressions.get_n_items () == 1);
var t = e.expressions.get_item (0) as Term;
@@ -1102,7 +1102,7 @@ class Tests {
assert (eq2 != null);
message (eq2.to_string ());
assert (eq2.expressions.get_n_items () == 1);
- var e2 = eq2.expressions.get_item (0) as Polynomial;
+ var e2 = eq2.expressions.get_item (0) as MathPolynomial;
assert (e2 != null);
assert (e2.expressions.get_n_items () == 1);
var t2 = e2.expressions.get_item (0) as Term;
diff --git a/tests/gcalc-solving-basic.vala b/tests/gcalc-solving-basic.vala
index bb64f9ee..cd97609f 100644
--- a/tests/gcalc-solving-basic.vala
+++ b/tests/gcalc-solving-basic.vala
@@ -85,7 +85,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
assert (t != null);
@@ -111,7 +111,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
var res = t.solve ();
@@ -136,7 +136,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
var res = t.solve ();
@@ -161,7 +161,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
var res = t.solve ();
@@ -186,7 +186,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t1 = e.expressions.get_item (0) as Term;
var t2 = e.expressions.get_item (1) as Term;
@@ -210,7 +210,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate ();
assert (res != null);
@@ -232,7 +232,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate ();
assert (res != null);
@@ -254,7 +254,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
assert (t != null);
@@ -277,7 +277,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -296,7 +296,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -315,7 +315,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -334,7 +334,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
assert (t != null);
@@ -357,7 +357,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
assert (t != null);
@@ -380,7 +380,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -399,7 +399,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -418,7 +418,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -437,7 +437,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -456,7 +456,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -685,7 +685,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var t = e.expressions.get_item (0) as Term;
assert (t != null);
@@ -709,7 +709,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -728,7 +728,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -747,7 +747,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -766,7 +766,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -785,7 +785,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -804,7 +804,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -823,7 +823,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -842,7 +842,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -861,7 +861,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -880,7 +880,7 @@ class Tests {
assert (eqman.equations.get_n_items () == 1);
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -900,7 +900,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -920,7 +920,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -940,7 +940,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -960,7 +960,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -980,7 +980,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -1000,7 +1000,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
@@ -1020,7 +1020,7 @@ class Tests {
var eq = eqman.equations.get_item (0) as MathEquation;
assert (eq != null);
message ("Equation: %s", eq.to_string ());
- var e = eq.expressions.get_item (0) as Polynomial;
+ var e = eq.expressions.get_item (0) as MathPolynomial;
assert (e != null);
var res = e.evaluate () as Constant;
assert (res != null);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]