This class represents a product of Expression objects. More...

Public Member Functions | |
| Product (Expression expression, final boolean inverse) | |
| Construct a Product. | |
| Product () | |
| Construct a Product. | |
| Product | clone () |
| Create a copy of this Product. | |
| OObject | multiply (Complex z) |
| Multiply a Complex by this. | |
| OObject | divide (Complex z) |
| Divide this by a Complex. | |
| Product | negate () |
| Get the negative of this. | |
| OObject | multiply (Product x) |
| multiply this by a product | |
| OObject | divide (Product x) |
| Divide this by a product. | |
| boolean | isNegative () |
| Indicate whether or not expression is negative. | |
| OObject | unBox () |
| Return either this or the first expression in this if this is just a container for a single object. | |
| int | compareTo (Product product) |
| The comparison operator. | |
| jscicalc.StringArray | toHTMLSubString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the Product. | |
| jscicalc.StringArray | toHTMLParenString (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| jscicalc.StringArray | toHTMLParenStringL (int maxChars, int precision, final Base base, final Notation notation, double polarFactor) |
| Function to create an HTML string representation of the expression. | |
| void | sort () |
| Sort the class. | |
| OObject | auto_simplify () |
| Simplify a Product expression. | |
| OObject | substitute (jscicalc.Substitution substitution) |
Static Public Member Functions | |
| static void | main (String[] args) |
Protected Attributes | |
| java.util.LinkedList< Expression > | divisorList |
| The divisor Expression objects. | |
Package Functions | |
| void | setComplex (Complex z) |
| Set the Complex value. | |
| OObject | integer_power (long n) |
| Compute an integer power. | |
This class represents a product of Expression objects.
expression.
| jscicalc.expression.Product.Product | ( | Expression | expression, | |
| final boolean | inverse | |||
| ) |
Construct a Product.
| expression | The expression from which to construct the Product. | |
| inverse | Set to true or false according as you want expression or 1/expression |
References jscicalc.OObject.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.complex.Complex.divide(), jscicalc.expression.Product.divisorList, and jscicalc.expression.SumOrProduct.expressionList.
| jscicalc.expression.Product.Product | ( | ) |
Construct a Product.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, and jscicalc.expression.SumOrProduct.expressionList.
Referenced by jscicalc.expression.Product.clone(), and jscicalc.expression.Product.integer_power().
| OObject jscicalc.expression.Product.auto_simplify | ( | ) |
Simplify a Product expression.
Returns Error or Complex or jscicalc.Product.
Reimplemented from jscicalc.expression.SumOrProduct.
References jscicalc.OObject.add(), jscicalc.OObject.auto_simplify(), jscicalc.OObject.compareTo(), jscicalc.expression.SumOrProduct.complex, jscicalc.complex.Complex.divide(), jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.multiply(), jscicalc.expression.Product.sort(), and jscicalc.expression.Product.unBox().
Referenced by jscicalc.expression.Product.substitute().
| Product jscicalc.expression.Product.clone | ( | ) |
Create a copy of this Product.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.expression.SumOrProduct.getExpressionList(), jscicalc.complex.Complex.imaginary(), jscicalc.expression.Product.Product(), and jscicalc.complex.Complex.real().
Referenced by jscicalc.expression.Product.divide(), jscicalc.expression.Product.multiply(), jscicalc.expression.Product.negate(), and jscicalc.expression.Product.substitute().
| int jscicalc.expression.Product.compareTo | ( | Product | product | ) |
The comparison operator.
| product | The Product to be compared. |
References jscicalc.expression.SumOrProduct.compare(), jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.expression.Product.sort().
Referenced by jscicalc.expression.Sum.auto_simplify().
Divide this by a Complex.
| z | The complex to divide by |
References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.complex.Complex.divide().
Referenced by jscicalc.OObject.divide().
Divide this by a product.
| x | The product to divide by. |
References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, jscicalc.complex.Complex.divide(), jscicalc.expression.Product.divisorList, and jscicalc.expression.SumOrProduct.expressionList.
| OObject jscicalc.expression.Product.integer_power | ( | long | n | ) | [package] |
Compute an integer power.
This just means taking the integer power of each expression and creating a new Product. Note that this will not work for non-integer powers.
| n | The integer (actually a long) |
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.pow(), and jscicalc.expression.Product.Product().
Referenced by jscicalc.expression.Power.auto_simplify().
| boolean jscicalc.expression.Product.isNegative | ( | ) |
Indicate whether or not expression is negative.
The default is not negative.
Reimplemented from jscicalc.OObject.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.SumOrProduct.expressionList, jscicalc.OObject.isNegative(), jscicalc.complex.Complex.isNegative(), jscicalc.OObject.isZero(), and jscicalc.complex.Complex.isZero().
| static void jscicalc.expression.Product.main | ( | String[] | args | ) | [static] |
multiply this by a product
| x | The product to multiply by. |
References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, and jscicalc.complex.Complex.multiply().
Multiply a Complex by this.
| z | The complex to multiply by |
References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.complex.Complex.multiply().
Referenced by jscicalc.expression.Power.auto_simplify(), jscicalc.OObject.divide(), and jscicalc.OObject.multiply().
| Product jscicalc.expression.Product.negate | ( | ) | [virtual] |
Get the negative of this.
Implements jscicalc.expression.Expression.
References jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, and jscicalc.complex.Complex.negate().
Referenced by jscicalc.expression.Xor.negate(), jscicalc.expression.Variable.negate(), jscicalc.expression.Power.negate(), jscicalc.expression.Permutation.negate(), jscicalc.expression.Or.negate(), jscicalc.expression.Monadic.negate(), jscicalc.expression.Combination.negate(), and jscicalc.expression.And.negate().
| void jscicalc.expression.Product.setComplex | ( | Complex | z | ) | [package] |
Set the Complex value.
| z | The new value of the complex in the Product. |
References jscicalc.expression.SumOrProduct.complex.
Referenced by jscicalc.expression.Sum.auto_simplify().
| void jscicalc.expression.Product.sort | ( | ) |
Sort the class.
Reimplemented from jscicalc.expression.SumOrProduct.
References jscicalc.expression.Product.divisorList.
Referenced by jscicalc.expression.Product.auto_simplify(), and jscicalc.expression.Product.compareTo().
| OObject jscicalc.expression.Product.substitute | ( | jscicalc.Substitution | substitution | ) |
References jscicalc.expression.Product.auto_simplify(), jscicalc.expression.Product.clone(), jscicalc.expression.SumOrProduct.complex, jscicalc.complex.Complex.divide(), jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.multiply(), and jscicalc.OObject.substitute().
| jscicalc.StringArray jscicalc.expression.Product.toHTMLParenString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
| jscicalc.StringArray jscicalc.expression.Product.toHTMLParenStringL | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the expression.
This has six arguments. See Complex for a definition of the arguments.
This version may put parentheses round the expression.
This version of the function is designed to be used with LFunctions like square and cube, where, for example the square of minus x has to use parentheses (as opposed to cos, where it might not need them.
This function does not include the html tags.
| maxChars | The maximum number of (visible) characters we can use | |
| precision | The desired number of significant figures | |
| base | The required base | |
| notation | The notation to use to display this value | |
| polarFactor | Not used |
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.StringArray.StringArray(), jscicalc.complex.Complex.toHTMLParenString(), and jscicalc.expression.Product.toHTMLSubString().
| jscicalc.StringArray jscicalc.expression.Product.toHTMLSubString | ( | int | maxChars, | |
| int | precision, | |||
| final Base | base, | |||
| final Notation | notation, | |||
| double | polarFactor | |||
| ) |
Function to create an HTML string representation of the Product.
The arguments are ignored except for the Complex.
| maxChars | ignored | |
| precision | ignored | |
| base | ignored | |
| notation | ignored | |
| polarFactor | ignored |
References jscicalc.StringArray.add(), jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.StringArray.StringArray(), jscicalc.OObject.toHTMLParenString(), jscicalc.complex.Complex.toHTMLParenString(), and jscicalc.OObject.toHTMLSubString().
Referenced by jscicalc.expression.Product.toHTMLParenString(), and jscicalc.expression.Product.toHTMLParenStringL().
| OObject jscicalc.expression.Product.unBox | ( | ) |
Return either this or the first expression in this if this is just a container for a single object.
References jscicalc.expression.SumOrProduct.complex, jscicalc.expression.Product.divisorList, jscicalc.expression.SumOrProduct.expressionList, jscicalc.complex.Complex.isZero(), and jscicalc.complex.Complex.subtract().
Referenced by jscicalc.expression.Sum.add(), jscicalc.expression.Sum.auto_simplify(), and jscicalc.expression.Product.auto_simplify().
java.util.LinkedList<Expression> jscicalc.expression.Product.divisorList [protected] |
The divisor Expression objects.
Referenced by jscicalc.expression.Product.auto_simplify(), jscicalc.expression.Product.clone(), jscicalc.expression.Product.compareTo(), jscicalc.expression.Product.divide(), jscicalc.expression.Product.integer_power(), jscicalc.expression.Product.multiply(), jscicalc.expression.Product.Product(), jscicalc.expression.Product.sort(), jscicalc.expression.Product.substitute(), jscicalc.expression.Product.toHTMLParenString(), jscicalc.expression.Product.toHTMLParenStringL(), jscicalc.expression.Product.toHTMLSubString(), and jscicalc.expression.Product.unBox().
1.7.1