|
|||||||||
| Home >> All >> com >> hartmath >> [ expression overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.hartmath.expression
Class HMultinomial

java.lang.Objectcom.hartmath.expression.HArrayList
com.hartmath.expression.HFunction
com.hartmath.expression.HMultinomial
- All Implemented Interfaces:
- java.lang.Cloneable, HObject
- public class HMultinomial
- extends HFunction
- implements java.lang.Cloneable
- extends HFunction
A class for Multinomials in recursive representation.
3*x^5 + 4*x^2 will be represented as
Poly({3,{5},4,{2}},{x}).
4*x^2+y^3+10 will be represented as
Poly({4,{2,3},10,{0,0}},{x,y})
| Nested Class Summary |
| Nested classes inherited from class com.hartmath.expression.HArrayList |
HArrayList.HArrayListIterator |
| Field Summary | |
private com.hartmath.domain.ObjectD |
dom
|
(package private) com.hartmath.lib.Session |
session
|
| Fields inherited from class com.hartmath.expression.HFunction |
FLAT_EVALED, header, MATCHEQUAL, MATCHSEQUENCE, MATRIXFORM, NOPROPERTY, ORDERLESS_EVALED, prop, SET, SETDELAYED |
| Fields inherited from class com.hartmath.expression.HArrayList |
|
| Fields inherited from interface com.hartmath.expression.HObject |
COMPLEXFILEID, COMPLEXID, DOUBLECOMPLEXFILEID, DOUBLECOMPLEXID, DOUBLEFILEID, DOUBLEID, FRACTIONFILEID, FRACTIONID, FUNCTIONFILEID, FUNCTIONID, INTEGERFILEID, INTEGERID, OBJECTID, PATTERNFILEID, PATTERNID, STRINGFILEID, STRINGID, SYMBOLFILEID, SYMBOLID |
| Constructor Summary | |
private |
HMultinomial(HFunction var_list,
com.hartmath.domain.ObjectD domi,
HFunction domain,
com.hartmath.lib.Session sess)
Constructor for the HMultinomial object |
|
HMultinomial(HObject obj,
HFunction var_list,
HFunction domain,
com.hartmath.lib.Session sess)
Constructs a new HMultinomial from the specified object and variable-list;domain |
private |
HMultinomial(HObject obj,
HFunction var_list,
com.hartmath.domain.ObjectD domi,
HFunction domain,
com.hartmath.lib.Session sess)
Constructs a new HMultinomial from the specified object and variable-list;domain |
|
HMultinomial(HObject obj,
HFunction var_list,
com.hartmath.lib.Session sess)
Constructs a new HMultinomial from the specified object and variable-list |
| Method Summary | |
HMultinomial |
add(HMultinomial parm1)
Returns a HMultinomial whose value is (this + parm1). |
java.lang.Object |
clone()
Description of the Method |
HObject |
contentp()
Description of the Method |
private static boolean |
convertFunction(HFunction poly_rep,
HFunction f,
HFunction var_list,
com.hartmath.domain.ObjectD dom)
Convert a function f into polynomial representation |
private static boolean |
convertMonomial(HFunction poly_rep,
HFunction f,
HFunction var_list,
com.hartmath.domain.ObjectD dom)
Convert a monomial f into polynomial representation |
private int |
degree()
Description of the Method |
HInteger |
degree(HSymbol sym)
Description of the Method |
HMultinomial |
divide(HMultinomial parm1)
Description of the Method |
HObject |
dp()
derivative of the polynomial (must be univariate) |
HObject |
evalp(HFunction var_list0,
HFunction val_list0)
Description of the Method |
HObject |
evalp(HObject x)
Description of the Method |
HMultinomial |
gcd(HMultinomial parm1)
Description of the Method |
HObject |
getCoeff(HInteger exponent)
the coefficient for the exponent of the first variable in the variable-list of the polynomial |
HObject |
getCoeff(int exp)
the coefficient for the exponent of the first variable in the variable-list of the polynomial |
com.hartmath.domain.ObjectD |
getDomain()
Gets the domain attribute of the HMultinomial object |
private void |
init(HObject obj,
HFunction var_list,
com.hartmath.domain.ObjectD domain)
Description of the Method |
boolean |
isZero()
Gets the zero attribute of the HMultinomial object |
HMultinomial |
lcm(HMultinomial parm1)
Description of the Method |
HObject |
lcoefficientp()
Description of the Method |
HMultinomial |
mod(HMultinomial parm1)
Description of the Method |
HMultinomial |
multiply(HMultinomial parm1)
Returns a HMultinomial whose value is (this * parm1). |
HMultinomial |
multiply(HObject scalar)
Returns a HMultinomial whose value is (skalar * this). |
void |
normalize()
Description of the Method |
int |
nTerms()
the number of terms of the polynomial |
HObject |
nthCoeff(int n)
the n-th coefficient of the polynomial |
HMultinomial |
nthMonomial(int n)
the n-th monomial of the polynomial |
HMultinomial |
nthTerm(int n)
the n-th term of the polynomial |
private boolean |
polyList(HFunction poly_rep,
HObject expr,
HFunction var_list,
com.hartmath.domain.ObjectD dom)
Description of the Method |
HMultinomial |
pow(HInteger parm1)
Returns a HMultinomial whose value is (this ^ parm1); parm1 must be a nonnegative integer |
HObject |
primpartp()
Description of the Method |
private void |
reduce()
Description of the Method |
private void |
reduceZero()
Description of the Method |
void |
setCoeff(HInteger exponent,
HObject obj)
set the Coefficient for the term: <variable>^exponent (only for the first variable in the variable-list) |
void |
setCoeff(int exponent,
HObject obj)
set the Coefficient for the term: <variable>^exponent (only for the first variable in the variable-list) |
private static void |
sort(com.hartmath.lib.Session session,
HFunction poly_rep)
helper function to sort the polynomial representation into lexical order |
private HObject |
toMonomial(HObject coeff,
HFunction exp_list,
HFunction var_list)
Description of the Method |
HObject |
toObject()
convert this polynomial representation back to a HObject representation |
java.lang.String |
toString()
Description of the Method |
void |
toStringBuffer(java.lang.StringBuffer buf,
com.hartmath.lib.Session session)
Description of the Method |
| Methods inherited from class com.hartmath.expression.HFunction |
apply, argumentsToString, checkAttributes, clearPattern, clearProperties, deepCopy, depth, equals, equalsFromPosition, evalArguments, evaluate, evaluateArgAttr, evaluateAttributes, evaluateAttributes1, evaluateAttributes2, evaluateLHSAttr, findMember, flatten, getAttributes, getHead, getInstanceList, getPattern, getProperties, getVariables, greater, hashCode, head, hierarchy, initPattern, isEqualRule, isHeadMember, isList, isMatrix, isMember, isNumber, isNumericNumber, isPureFunction, isRational, isVector, less, map, matches, patternHashCode, precedence, replaceAll, resetPattern, setHead, setProperties, substitute, substituteArg, substitutePattern, toFullForm, toInt, unequals |
| Methods inherited from class com.hartmath.expression.HArrayList |
add, add, addAll, addAll, addDouble, addDouble, addDoubleComplex, addDoubleComplex, addFraction, addFraction, addInteger, addInteger, clear, contains, ensureCapacity, get, get, get, indexOf, isEmpty, iterator, lastIndexOf, remove, removeRange, set, set, set, size, sort, toArray, toArray, toArrayList, trimToSize |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
session
com.hartmath.lib.Session session
dom
private com.hartmath.domain.ObjectD dom
| Constructor Detail |
HMultinomial
public HMultinomial(HObject obj, HFunction var_list, com.hartmath.lib.Session sess)
- Constructs a new HMultinomial from the specified object and variable-list
HMultinomial
public HMultinomial(HObject obj, HFunction var_list, HFunction domain, com.hartmath.lib.Session sess)
- Constructs a new HMultinomial from the specified object and
variable-list;domain
HMultinomial
private HMultinomial(HFunction var_list, com.hartmath.domain.ObjectD domi, HFunction domain, com.hartmath.lib.Session sess)
- Constructor for the HMultinomial object
HMultinomial
private HMultinomial(HObject obj, HFunction var_list, com.hartmath.domain.ObjectD domi, HFunction domain, com.hartmath.lib.Session sess)
- Constructs a new HMultinomial from the specified object and
variable-list;domain
| Method Detail |
setCoeff
public void setCoeff(HInteger exponent, HObject obj)
- set the Coefficient for the term: <variable>^exponent (only for the
first variable in the variable-list)
setCoeff
public final void setCoeff(int exponent,
HObject obj)
- set the Coefficient for the term: <variable>^exponent (only for the
first variable in the variable-list)
getDomain
public com.hartmath.domain.ObjectD getDomain()
- Gets the domain attribute of the HMultinomial object
isZero
public boolean isZero()
- Gets the zero attribute of the HMultinomial object
getCoeff
public HObject getCoeff(HInteger exponent)
- the coefficient for the exponent of the first variable in the variable-list
of the polynomial
getCoeff
public final HObject getCoeff(int exp)
- the coefficient for the exponent of the first variable in the variable-list
of the polynomial
clone
public final java.lang.Object clone()
normalize
public void normalize()
- Description of the Method
toObject
public HObject toObject()
- convert this polynomial representation back to a HObject representation
toString
public java.lang.String toString()
toStringBuffer
public void toStringBuffer(java.lang.StringBuffer buf, com.hartmath.lib.Session session)
- Description of the Method
- Specified by:
toStringBufferin interfaceHObject- Overrides:
toStringBufferin classHFunction
degree
public HInteger degree(HSymbol sym)
- Description of the Method
nTerms
public int nTerms()
- the number of terms of the polynomial
nthMonomial
public HMultinomial nthMonomial(int n)
- the n-th monomial of the polynomial
nthCoeff
public HObject nthCoeff(int n)
- the n-th coefficient of the polynomial
nthTerm
public HMultinomial nthTerm(int n)
- the n-th term of the polynomial
add
public HMultinomial add(HMultinomial parm1)
- Returns a HMultinomial whose value is (this + parm1).
multiply
public HMultinomial multiply(HObject scalar)
- Returns a HMultinomial whose value is (skalar * this). (i.e. all
coefficients are multiplied with the skalar)
multiply
public HMultinomial multiply(HMultinomial parm1)
- Returns a HMultinomial whose value is (this * parm1).
pow
public HMultinomial pow(HInteger parm1)
- Returns a HMultinomial whose value is (this ^ parm1); parm1 must be a
nonnegative integer
divide
public HMultinomial divide(HMultinomial parm1)
- Description of the Method
mod
public HMultinomial mod(HMultinomial parm1)
- Description of the Method
gcd
public HMultinomial gcd(HMultinomial parm1)
- Description of the Method
lcm
public HMultinomial lcm(HMultinomial parm1)
- Description of the Method
evalp
public HObject evalp(HObject x)
- Description of the Method
evalp
public HObject evalp(HFunction var_list0, HFunction val_list0)
- Description of the Method
dp
public HObject dp()
- derivative of the polynomial (must be univariate)
contentp
public HObject contentp()
- Description of the Method
primpartp
public HObject primpartp()
- Description of the Method
lcoefficientp
public HObject lcoefficientp()
- Description of the Method
init
private void init(HObject obj, HFunction var_list, com.hartmath.domain.ObjectD domain)
- Description of the Method
polyList
private boolean polyList(HFunction poly_rep, HObject expr, HFunction var_list, com.hartmath.domain.ObjectD dom)
- Description of the Method
toMonomial
private HObject toMonomial(HObject coeff, HFunction exp_list, HFunction var_list)
- Description of the Method
degree
private int degree()
- Description of the Method
reduce
private void reduce()
- Description of the Method
reduceZero
private void reduceZero()
- Description of the Method
convertFunction
private static boolean convertFunction(HFunction poly_rep, HFunction f, HFunction var_list, com.hartmath.domain.ObjectD dom)
- Convert a function f into polynomial representation
convertMonomial
private static boolean convertMonomial(HFunction poly_rep, HFunction f, HFunction var_list, com.hartmath.domain.ObjectD dom)
- Convert a monomial f into polynomial representation
sort
private static void sort(com.hartmath.lib.Session session, HFunction poly_rep)
- helper function to sort the polynomial representation into lexical order
|
|||||||||
| Home >> All >> com >> hartmath >> [ expression overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC