From d4ca769e542b2489b1e23cfcbdc3a0b7275b87cd Mon Sep 17 00:00:00 2001 From: Ben Culkin Date: Mon, 13 Apr 2020 18:40:41 -0400 Subject: Cleanup pass Cleanup pass to uniformize things --- base/src/main/java/bjc/utils/math/DualExpr.java | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'base/src/main/java/bjc/utils/math/DualExpr.java') 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(); -- cgit v1.2.3