diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-23 16:42:38 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-23 16:42:38 -0400 |
| commit | 48f781fb6e61539ba9d17efcfd9f9e38245cf6c0 (patch) | |
| tree | 97e5743678a00d09024ec040490b8fcf8ccb1c74 /CSMath/src/bisection | |
| parent | 81d8191c01629d881486f1f1fe5ae16c42b46287 (diff) | |
Refactor package structure
Diffstat (limited to 'CSMath/src/bisection')
| -rw-r--r-- | CSMath/src/bisection/DualExpr.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/CSMath/src/bisection/DualExpr.java b/CSMath/src/bisection/DualExpr.java index 0e16b3a..22cc368 100644 --- a/CSMath/src/bisection/DualExpr.java +++ b/CSMath/src/bisection/DualExpr.java @@ -1,4 +1,5 @@ package bisection;
+
/**
* Represents an expression using dual numbers.
*
@@ -68,11 +69,11 @@ public class DualExpr { /**
* The left (or first) part of the expression.
*/
- public DualExpr left;
+ public DualExpr left;
/**
* The right (or second) part of the expression.
*/
- public DualExpr right;
+ public DualExpr right;
/**
* The power to use, for power operations.
@@ -106,12 +107,14 @@ public class DualExpr { }
/**
- * Create a new binary dual number.
- *
+ * Create a new math expression.
+ *
* @param type
- * The type of operation to perform.
- * @param val
- * The parameter to the value.
+ * The math operation to perform
+ * @param left
+ * The left operand
+ * @param right
+ * The right operand.
*/
public DualExpr(DualExpr.ExprType type, DualExpr left, DualExpr right) {
this.type = type;
@@ -207,8 +210,7 @@ public class DualExpr { lval = left.evaluate();
if (lval.real <= 0) {
- throw new IllegalArgumentException(
- "ERROR: Attempted to take non-positive log.");
+ throw new IllegalArgumentException("ERROR: Attempted to take non-positive log.");
}
return new Dual(Math.log(lval.real), lval.dual / lval.real);
|
