diff options
| author | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
|---|---|---|
| committer | Ben Culkin <scorpress@gmail.com> | 2020-04-13 18:40:41 -0400 |
| commit | d4ca769e542b2489b1e23cfcbdc3a0b7275b87cd (patch) | |
| tree | 1653a7399f97fb0c63ce62e3f60fd830d5c37f70 /base/src/main/java/bjc/utils/math/DualExpr.java | |
| parent | 2ac2e31a56ae59ee582e43a90c3495f86dd9ee7a (diff) | |
Cleanup pass
Cleanup pass to uniformize things
Diffstat (limited to 'base/src/main/java/bjc/utils/math/DualExpr.java')
| -rw-r--r-- | base/src/main/java/bjc/utils/math/DualExpr.java | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/base/src/main/java/bjc/utils/math/DualExpr.java b/base/src/main/java/bjc/utils/math/DualExpr.java index 81ee31c..a682814 100644 --- a/base/src/main/java/bjc/utils/math/DualExpr.java +++ b/base/src/main/java/bjc/utils/math/DualExpr.java @@ -83,7 +83,8 @@ public class DualExpr { /** * Create a new constant dual number. * - * @param num The value of the dual number. + * @param num + * The value of the dual number. */ public DualExpr(Dual num) { this.type = ExprType.CONSTANT; @@ -94,8 +95,10 @@ public class DualExpr { /** * Create a new unary dual number. * - * @param type The type of operation to perform. - * @param val The parameter to the value. + * @param type + * The type of operation to perform. + * @param val + * The parameter to the value. */ public DualExpr(DualExpr.ExprType type, DualExpr val) { this.type = type; @@ -106,9 +109,12 @@ public class DualExpr { /** * Create a new binary dual number. * - * @param type The type of operation to perform. - * @param left The left hand side of the expression. - * @param right The right hand side of the expression. + * @param type + * The type of operation to perform. + * @param left + * The left hand side of the expression. + * @param right + * The right hand side of the expression. */ public DualExpr(DualExpr.ExprType type, DualExpr left, DualExpr right) { this.type = type; @@ -189,7 +195,8 @@ 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); @@ -197,7 +204,8 @@ public class DualExpr { // @TODO Ben Culkin 3/27/2020 :RealPower // Make this no longer a special case; since it doesn't have to be one. // - // 3/28/2020 - This is less of a special case, but I've not implemented the bit for variable exponents. + // 3/28/2020 - This is less of a special case, but I've not implemented the + // bit for variable exponents. lval = left.evaluate(); rval = right.evaluate(); |
