edu.jas.poly
Class GenPolynomialTokenizer
- java.lang.Object
-
- edu.jas.poly.GenPolynomialTokenizer
-
public class GenPolynomialTokenizer extends java.lang.ObjectGenPolynomial Tokenizer. Used to read rational polynomials and lists of polynomials from input streams. Arbitrary polynomial rings and coefficient rings can be read with RingFactoryTokenizer. Note: Can no more read QuotientRing since end of 2010, revision 3441. Quotient coefficients and others can still be read if the respective factory is provided via the constructor.- See Also:
RingFactoryTokenizer
-
-
Constructor Summary
Constructors Constructor and Description GenPolynomialTokenizer()noargs constructor reads from System.in.GenPolynomialTokenizer(GenPolynomialRing rf, java.io.Reader r)constructor with Ring and Reader.GenPolynomialTokenizer(java.io.Reader r)constructor with Reader.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static java.lang.String[]expressionVariables(java.lang.String s)Extract variable list from expression.voidinitFactory(RingFactory rf, edu.jas.poly.GenPolynomialTokenizer.coeffType ct)Initialize coefficient and polynomial factories.voidinitSolvableFactory(RingFactory rf, edu.jas.poly.GenPolynomialTokenizer.coeffType ct)Initialize polynomial and solvable polynomial factories.RingFactorynextCoefficientRing()Parsing method for coefficient ring.voidnextComma()java.lang.StringnextComment()Parsing method for comments.longnextExponent()Parsing method for exponent (of variable).GenPolynomialnextPolynomial()Parsing method for GenPolynomial.java.util.List<GenPolynomial>nextPolynomialList()Parsing method for polynomial list.PolynomialListnextPolynomialSet()Parsing method for polynomial set.voidnextRelationTable()Parsing method for solvable polynomial relation table.GenSolvablePolynomialnextSolvablePolynomial()Parsing method for solvable polynomial.java.util.List<GenSolvablePolynomial>nextSolvablePolynomialList()Parsing method for solvable polynomial list.PolynomialListnextSolvablePolynomialSet()Parsing method for solvable polynomial set.java.util.List<java.util.List<GenSolvablePolynomial>>nextSolvableSubModuleList()Parsing method for solvable submodule list.ModuleListnextSolvableSubModuleSet()Parsing method for solvable module set.intnextSplitIndex()Parsing method for split index.java.util.List<java.util.List<GenPolynomial>>nextSubModuleList()Parsing method for submodule list.ModuleListnextSubModuleSet()Parsing method for module set.TermOrdernextTermOrder()Parsing method for term order name.java.lang.String[]nextVariableList()Parsing method for variable list.long[][]nextWeightArray()Parsing method for weight array.long[]nextWeightList()Parsing method for weight list.static java.lang.String[]variableList(java.lang.String s)Parse variable list from String.
-
-
-
Constructor Detail
-
GenPolynomialTokenizer
public GenPolynomialTokenizer()
noargs constructor reads from System.in.
-
GenPolynomialTokenizer
public GenPolynomialTokenizer(GenPolynomialRing rf, java.io.Reader r)
constructor with Ring and Reader.- Parameters:
rf- ring factory.r- reader stream.
-
GenPolynomialTokenizer
public GenPolynomialTokenizer(java.io.Reader r)
constructor with Reader.- Parameters:
r- reader stream.
-
-
Method Detail
-
initFactory
public void initFactory(RingFactory rf, edu.jas.poly.GenPolynomialTokenizer.coeffType ct)
Initialize coefficient and polynomial factories.- Parameters:
rf- ring factory.ct- coefficient type.
-
initSolvableFactory
public void initSolvableFactory(RingFactory rf, edu.jas.poly.GenPolynomialTokenizer.coeffType ct)
Initialize polynomial and solvable polynomial factories.- Parameters:
rf- ring factory.ct- coefficient type.
-
nextPolynomial
public GenPolynomial nextPolynomial() throws java.io.IOException
Parsing method for GenPolynomial. syntax ? (simple)- Returns:
- the next polynomial.
- Throws:
java.io.IOException
-
nextExponent
public long nextExponent() throws java.io.IOExceptionParsing method for exponent (of variable). syntax: ^long | **long.- Returns:
- the next exponent or 1.
- Throws:
java.io.IOException
-
nextComment
public java.lang.String nextComment() throws java.io.IOExceptionParsing method for comments. syntax: (* comment *) | /_* comment *_/ without _ Does not work with this pushBack(), unused.- Throws:
java.io.IOException
-
nextVariableList
public java.lang.String[] nextVariableList() throws java.io.IOExceptionParsing method for variable list. syntax: (a, b c, de) gives [ "a", "b", "c", "de" ]- Returns:
- the next variable list.
- Throws:
java.io.IOException
-
nextCoefficientRing
public RingFactory nextCoefficientRing() throws java.io.IOException
Parsing method for coefficient ring. syntax: Rat | Q | Int | Z | Mod modul | Complex | C | D | Quat | AN[ (var) ( poly ) ] | AN[ modul (var) ( poly ) ] | IntFunc (var_list)- Returns:
- the next coefficient factory.
- Throws:
java.io.IOException
-
nextWeightList
public long[] nextWeightList() throws java.io.IOExceptionParsing method for weight list. syntax: (w1, w2, w3, ..., wn)- Returns:
- the next weight list.
- Throws:
java.io.IOException
-
nextWeightArray
public long[][] nextWeightArray() throws java.io.IOExceptionParsing method for weight array. syntax: ( (w11, ...,w1n), ..., (wm1, ..., wmn) )- Returns:
- the next weight array.
- Throws:
java.io.IOException
-
nextSplitIndex
public int nextSplitIndex() throws java.io.IOExceptionParsing method for split index. syntax: |i|- Returns:
- the next split index.
- Throws:
java.io.IOException
-
nextTermOrder
public TermOrder nextTermOrder() throws java.io.IOException
Parsing method for term order name. syntax: termOrderName = L, IL, LEX, G, IG, GRLEX, W(weights) |split index|- Returns:
- the next term order.
- Throws:
java.io.IOException
-
nextPolynomialList
public java.util.List<GenPolynomial> nextPolynomialList() throws java.io.IOException
Parsing method for polynomial list. syntax: ( p1, p2, p3, ..., pn )- Returns:
- the next polynomial list.
- Throws:
java.io.IOException
-
nextSubModuleList
public java.util.List<java.util.List<GenPolynomial>> nextSubModuleList() throws java.io.IOException
Parsing method for submodule list. syntax: ( ( p11, p12, p13, ..., p1n ), ..., ( pm1, pm2, pm3, ..., pmn ) )- Returns:
- the next list of polynomial lists.
- Throws:
java.io.IOException
-
nextRelationTable
public void nextRelationTable() throws java.io.IOExceptionParsing method for solvable polynomial relation table. syntax: ( p_1, p_2, p_3, ..., p_{n+3} ) semantics: p_{n+1} * p_{n+2} = p_{n+3} The next relation table is stored into the solvable polynomial factory.- Throws:
java.io.IOException
-
nextPolynomialSet
public PolynomialList nextPolynomialSet() throws java.io.IOException
Parsing method for polynomial set. syntax: coeffRing varList termOrderName polyList.- Returns:
- the next polynomial set.
- Throws:
java.io.IOException
-
nextSubModuleSet
public ModuleList nextSubModuleSet() throws java.io.IOException
Parsing method for module set. syntax: coeffRing varList termOrderName moduleList.- Returns:
- the next module set.
- Throws:
java.io.IOException
-
nextSolvablePolynomialList
public java.util.List<GenSolvablePolynomial> nextSolvablePolynomialList() throws java.io.IOException
Parsing method for solvable polynomial list. syntax: ( p1, p2, p3, ..., pn )- Returns:
- the next solvable polynomial list.
- Throws:
java.io.IOException
-
nextSolvablePolynomial
public GenSolvablePolynomial nextSolvablePolynomial() throws java.io.IOException
Parsing method for solvable polynomial. syntax: p.- Returns:
- the next polynomial.
- Throws:
java.io.IOException
-
nextSolvablePolynomialSet
public PolynomialList nextSolvablePolynomialSet() throws java.io.IOException
Parsing method for solvable polynomial set. syntax: varList termOrderName relationTable polyList.- Returns:
- the next solvable polynomial set.
- Throws:
java.io.IOException
-
nextSolvableSubModuleList
public java.util.List<java.util.List<GenSolvablePolynomial>> nextSolvableSubModuleList() throws java.io.IOException
Parsing method for solvable submodule list. syntax: ( ( p11, p12, p13, ..., p1n ), ..., ( pm1, pm2, pm3, ..., pmn ) )- Returns:
- the next list of solvable polynomial lists.
- Throws:
java.io.IOException
-
nextSolvableSubModuleSet
public ModuleList nextSolvableSubModuleSet() throws java.io.IOException
Parsing method for solvable module set. syntax: varList termOrderName relationTable moduleList.- Returns:
- the next solvable module set.
- Throws:
java.io.IOException
-
nextComma
public void nextComma() throws java.io.IOException- Throws:
java.io.IOException
-
variableList
public static java.lang.String[] variableList(java.lang.String s)
Parse variable list from String.- Parameters:
s- String. Syntax: (n1,...,nk) or (n1 ... nk), parenthesis are also optional.- Returns:
- array of variable names found in s.
-
expressionVariables
public static java.lang.String[] expressionVariables(java.lang.String s)
Extract variable list from expression.- Parameters:
s- String. Syntax: any polynomial expression.- Returns:
- array of variable names found in s.
-
-
DMelt 3.0 © DataMelt by jWork.ORG