| |
- builtins.object
-
- Polynomial
class Polynomial(builtins.object) |
|
Class for multivariate polynomials in sparse notation, focus on optimisation. |
|
Methods defined here:
- __add__(self, other)
- Return the sum of this polynomial with another one.
- __call__(self, x, dtype='float')
- Evaluate the polynomial at point x.
__dict__ = mappingproxy({'__module__': 'polynomial_base', '...f__' of 'Polynomial' objects>, '__hash__': None})
- __eq__(self, other)
- Check equality of polynomials.
- __init__(self, *args, **kwargs)
- Create a new multivariate polynomial object for optimisation.
Call:
p = Polynomial(A, b)
p = Polynomial(s)
p = Polynomial(shape, variables, degree, terms[, inner])
p = Polynomial(nr)
Input:
There are different possible inputs:
---
A - (n x t)-matrix or list of lists, representiong the exponents
b - array-like of length t
---
s - string, which represents the polynomial, variables as 'x0' or 'x(0)'
---
shape - string, describes Newton polytope, can be 'simplex'/'standard_simplex'/'general'
variables - int, maximal number of variables
degree - int, maximal degree
terms - int, number of terms
inner [optional, default 0] - minimal number of interior points
---
nr - number, which tells the rowid of the database
---
Additional keywords
seed [default None] - seed for the random number generator
dirty [default True] - flag, whether the input is in an unclean state
USE ONLY IF YOU KNOW WHAT YOU ARE DOING.
matlab_instance [default newly created] - bridge to matlab, to avoid starting multiple instances
orthant [default (0,...,0)] - restriction to some orthants, one entry for each variable
0 - unknown sign
1/-1 - positive/negative half space
- __neg__(self)
- Return the negation of this polynomial.
- __sizeof__(self)
- Return bit-size of the instance.
- __str__(self)
- Return the polynomial as string.
- __sub__(self, other)
- Return the difference between this polynomial and another one.
- clean(self)
- Bring polynomial into clean state.
- copy(self)
- Return a copy of itself.
- derive(self, index)
- Compute the derivative with respect to the given index.
Call:
res = p.derive(index)
Input:
index [integer] - index of variable, by which we derive p, starting with zero
Output:
res - Polynomial, derivative of p by x_index
- pip(self)
- Return the polynomial in PIP-format.
- prime(self, variables=None)
- Compute full derivative of the polynomial.
Call:
pprime = p.prime([variables])
Input:
variables [optional, default: all occurring] - number of variables, by which we derive
Output:
pprime - Polynomial, derivative of p
- scaleround(self, factor)
- Scale polynomial and round coefficients to integer.
Call:
p.scaleround(factor)
Input:
factor [number] - scale all coefficients by 'factor', then round to integer
Note: This function changes the coefficients in place and sets the 'dirty' flag to 'True'.
- tex(self)
- Return the polynomial as string for LaTeX.
- to_symbolic(self)
- Return the polynomial as symbolic expression in sympy.
Data descriptors defined here:
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __hash__ = None
| |