Modules¶
Subdivision¶
Subdivision provides a solve function that finds roots of a set of functions by approximating the functions with Chebyshev polynomials. When the approximation is performed on a sufficiently small interval, the approximation degree is small enough to be solved efficiently.
-
class
yroots.subdivision.
Memoize
(f)¶ A Memoization class taken from Stack Overflow https://stackoverflow.com/questions/1988804/what-is-memoization-and-how-can-i-use-it-in-python
-
yroots.subdivision.
chebyshev_block_copy
(values_block)¶ This function helps avoid double evaluation of functions at interpolation points. It takes in a tensor of function evaluation values and copies these values to a new tensor appropriately to prepare for chebyshev interpolation.
- Parameters
values_block (numpy array) – A block of values from function evaluation.
- Returns
values_cheb – Chebyshev interpolation values
- Return type
numpy array
-
yroots.subdivision.
full_cheb_approximate
(f, a, b, deg, tol, good_deg=None)¶ Gives the full chebyshev approximation and checks if it’s good enough.
Called recursively.
- Parameters
f (function) – The function we approximate.
a (numpy array) – The lower bound(s) on the interval.
b (numpy array) – The upper bound(s) on the interval.
deg (int) – The degree to approximate with.
tol (float) – How small the high degree terms must be to consider the approximation accurate.
good_deg (numpy array) – Interpoation degree that is guaranteed to give an approximation valid to within approx_tol.
- Returns
coeff (numpy array) – The coefficient array of the interpolation. If it can’t get a good approximation and needs to subdivide, returns None.
bools (numpy array) – (2^n, 1) array of bools corresponding to which subintervals the function changes sign in.
-
yroots.subdivision.
get_subintervals
(a, b, dimensions, interval_data, polys, change_sign, approx_tol, check_subintervals=False)¶ Gets the subintervals to divide a search interval into.
- Parameters
a (numpy array) – The lower bound on the interval.
b (numpy array) – The upper bound on the interval.
dimensions (numpy array) – The dimensions we want to cut in half.
interval_data (IntervalData) – A class to run the subinterval checks and keep track of the solve progress
polys (list MultiCheb polynomials) – A list of MultiCheb polynomials representing the function approximations on the interval to subdivide. Used in the subinterval checks.
change_sign (list of bools) – A list of bools of whether we know the functions can change sign on the subintervals. Used in the subinterval checks.
approx_tol (float) –
The bound of the sup norm error of the chebyshev approximation. Because trim_coeff introduces this much error again, 2*approx_tol
is passed into the subintervals checks.
check_subintervals (bool) – If True runs the subinterval checks to throw out intervals where the functions are never 0.
- Returns
subintervals – Each element of the list is a tuple containing an a and b, the lower and upper bounds of the interval.
- Return type
list of tuples
-
yroots.subdivision.
good_direc
(coeffs, dim, solve_tol)¶ Determines if this is a good direction to try solving with division.
- Parameters
coeffs (list) – The coefficient matrices of the polynomials to solve.
dim (int) – The direction to divide by in division.
solve_tol (float) – How small spots in the Macaulay diagonal are allowed to get before we determine it is unstable.
- Returns
good_direc – If True running division should be stable. If False, probably not.
- Return type
bool
-
yroots.subdivision.
good_zeros_1d
(zeros, imag_tol=1e-10)¶ Get the real zeros in the interval [-1,1] in the one dimensional case.
- Parameters
zeros (numpy array) – The zeros to be checked.
imag_tol (float) – How large the imaginary part can be to still have it be considered real.
- Returns
good_zeros – The real zero in [-1,1] of the input zeros.
- Return type
numpy array
-
yroots.subdivision.
good_zeros_nd
(zeros, imag_tol=1e-05, real_tol=1e-05)¶ Get the real zeros in the -1 to 1 interval in each dimension.
- Parameters
zeros (numpy array) – The zeros to be checked.
imag_tol (float) – How large the imaginary part can be to have it be considered real.
real_tol (float) – How far the real part can be outside the interval [-1,1] and still be considered valid.
- Returns
good_zeros – The real zeros in [-1,1] of the input zeros.
- Return type
numpy array
-
yroots.subdivision.
interval_approximate_1d
(f, a, b, deg)¶ Finds the chebyshev approximation of a one-dimensional function on an interval.
- Parameters
f (function from R -> R) – The function to interpolate.
a (float) – The lower bound on the interval.
b (float) – The upper bound on the interval.
deg (int) – The degree of the interpolation.
- Returns
coeffs – The coefficient of the chebyshev interpolating polynomial.
- Return type
numpy array
-
yroots.subdivision.
interval_approximate_nd
(f, a, b, deg, return_bools=False, multiplier=None)¶ Finds the chebyshev approximation of an n-dimensional function on an interval.
- Parameters
f (function from R^n -> R) – The function to interpolate.
a (numpy array) – The lower bound on the interval.
b (numpy array) – The upper bound on the interval.
deg (numpy array) – The degree of the interpolation in each dimension.
return_bools (bool) – Whether to return bools that indicate if the funtion changes sign.
multiplier (float) – The multiplier used to scale an interval during approximation.
- Returns
coeffs (numpy array) – The coefficient of the chebyshev interpolating polynomial.
multiplier (float) – Scaling factor to help scale up small values for precision.
change_sign (numpy array (Optional)) – list of which subintervals change sign
-
yroots.subdivision.
mon_combos_limited
(mon, remaining_degrees, shape, cur_dim=0)¶ Finds all the monomials of a given degree that fits in a given shape and returns them. Works recursively.
Very similar to mon_combos, but only returns the monomials of the desired degree.
- Parameters
mon (list) – A list of zeros, the length of which is the dimension of the desired monomials. Will change as the function searches recursively.
remaining_degrees (int) – Initially the degree of the monomials desired. Will decrease as the function searches recursively.
shape (tuple) – The limiting shape. The i’th index of the mon can’t be bigger than the i’th index of the shape.
cur_dim (int) – The current position in the list the function is iterating through. Defaults to 0, but increases in each step of the recursion.
- Returns
answers – A list of all the monomials.
- Return type
list
-
yroots.subdivision.
polish_zeros
(zeros, funcs, tol=0.1)¶ Polishes the given zeros of the functions to a better accuracy.
Resolves with finer tolerances in a box around the zeros.
- Parameters
zeros (numpy array) – The given zeros.
funcs (list) – The functions to find the zeros of.
tol (float) – How big of a box around the found zeros to solve on.
- Returns
polish_zeros – The polished zeros.
- Return type
numpy
-
yroots.subdivision.
solve
(funcs, a, b, plot=False, plot_intervals=False, polish=False)¶ Finds the real roots of the given list of functions on a given interval.
- Parameters
funcs (list of vectorized, callable functions) – Functions to find the common roots of. More efficient if functions have an ‘evaluate_grid’ method handle function evaluation on a grid of points.
a (numpy array) – The lower bound(s) on the interval.
b (numpy array) – The upper bound(s) on the interval.
plot (bool) – If True plots the zeros-loci of the functions along with the computed roots.
plot_intervals (bool) – If True, plot is True, and the functions are 2 dimensional, plots what check/method solved each part of the interval.
polish (bool) – If True, resolves for each root on a smaller interval with a finer approximation to give a more accurate answer.
finding roots of a univariate function, funcs does not need to be (If) –
list, and a and b can be floats instead of arrays. (a) –
- Returns
zeros – The common zeros of the polynomials. Each row is a root.
- Return type
numpy array
Examples
This can be used to solve a system of two dimensional equations.
>>> import numpy as np >>> import yroots as yr >>> f = lambda x,y: np.sin(x) - np.cos(y) >>> g = lambda x,y: np.cos(x) + np.sin(y) >>> a = [-1,-1] >>> b = [1,1] >>> roots = yr.solve([f,g],a,b) >>> roots array([[ 0.59192208, -0.97888622], ... [ 0.79322528, -0.7775749 ], ... [ 0.98545828, -0.58535726]])
This can also be used to solve higher dimensional systems. For example, we have a 3 dimensional system.
>>> import numpy as np >>> import yroots as yr >>> f = lambda x,y,z : np.sin(5*x+y+z) >>> g = lambda x,y,z : np.sin(x*y*z) >>> h = lambda x,y,z : x**2+y**2-z**2-1 >>> a = -np.ones(3) >>> b = np.ones(3 >>> roots = yr.solve([f,g,h], a, b, polish=True >>> # Show the number of roots and maximal residuals >>> roots.shape[0],np.max(np.abs(f(*[roots[:,i] for i in range(3)]))), ... np.max(np.abs(g(*[roots[:,i] for i in range(3)]))),np.max(np.abs( ... h(*[roots[:,i] for i in range(3)]))) (6, 3.216245299353273e-16, 4.948322275872661e-15, 1.8096635301390052e-14)
-
yroots.subdivision.
subdivision_solve_1d
(f, a, b, interval_data, cheb_approx_tol=1e-05, max_degree=128)¶ Finds the roots of a one-dimensional function using subdivision and chebyshev approximation.
- Parameters
f (function from R^n -> R) – The function to interpolate.
a (numpy array) – The lower bound on the interval.
b (numpy array) – The upper bound on the interval.
cheb_approx_tol (float) – The bound of the sup norm error of the chebyshev approximation.
max_degree (int) – The degree of the interpolation before subdividing.
- Returns
coeffs – The coefficient of the chebyshev interpolating polynomial.
- Return type
numpy array
-
yroots.subdivision.
subdivision_solve_nd
(funcs, a, b, deg, interval_data, approx_tol=0.0001, solve_tol=1e-08, polish=False, good_degs=None, level=0, max_level=20)¶ Finds the common zeros of the given functions for multidimensional systems. # TODO Long Function
- Parameters
funcs (list) – Each element of the list is a callable function.
a (numpy array) – The lower bound on the interval.
b (numpy array) – The upper bound on the interval.
deg (int) – The degree to approximate with in the chebyshev approximation.
interval_data (IntervalData) – A class to run the subinterval checks and keep track of the solve progress
approx_tol (float) – The bound of the sup norm error of the chebyshev approximation.
solve_tol (float) – The tolerance to pass into division solve.
polish (bool) – If True resolves for each root on a smaller interval with a finer approximation to give a more accurate answer.
good_degs (numpy array) – Interpoation degrees that are guaranteed to give an approximation valid to within approx_tol.
level (int) – Current level of recursion.
max_level (int) – Maximum level of recursion before exiting.
- Returns
zeros – The real zeros of the functions in the interval [a,b].
- Return type
numpy array
-
yroots.subdivision.
transform
(x, a, b)¶ Transforms points from the interval [-1,1] to the interval [a,b].
- Parameters
x (numpy array) – The points to be tranformed.
a (float or numpy array) – The lower bound on the interval. Float if one-dimensional, numpy array if multi-dimensional.
b (float or numpy array) – The upper bound on the interval. Float if one-dimensional, numpy array if multi-dimensional.
- Returns
transform – The transformed points.
- Return type
numpy array
Examples
Example 1 - Scaling the points to a larger interval in one dimension.
>>> x = np.array([-1, 0, 1]) >>> a = 3 >>> b = 5 >>> transform(x,a,b) array([3., 4., 5.])
Example 2 - Multidimensional points
>>> x = np.array([[0.5,1],[.25,.33],[-1,-.4]]) >>> a = np.array([1,2]) >>> b = np.array([2,3]) >>> transform(x,a,b) array([[1.75 , 3. ], [1.625, 2.665], [1. , 2.3 ]]
-
yroots.subdivision.
trim_coeffs
(coeffs, approx_tol, solve_tol)¶ Trim the coefficient matrices so they are stable and choose a direction to divide in.
- Parameters
coeffs (list) – The coefficient matrices of the Chebyshev polynomials we are solving.
approx_tol (float) – The bound of the sup norm error of the chebyshev approximation.
solve_tol (float) – The tolerance to pass into division solve.
- Returns
polys (list) – The reduced degree Chebyshev polynomials.
divisor_var (int # TODO Remove because of the division matrix?) – What direction to do the division in to be stable. -1 means we should subdivide.
One Dimension¶
Contains all the funcitons necessary for solving one-dimensional systems.
-
yroots.OneDimension.
divCheb
(coeff, eigvals=True, verbose=False)¶ Finds the zeros of a 1-D chebyshev polynomial using a division matrix.
- Parameters
coeff (numpy array) – The coefficients of the polynomial.
eigvals (bool) – If True, calculates the zeros using the eigenvalues. If False, calculates the zeros using the left eigenvectors.
verbose (bool) – If True, prints the intermediate steps.
- Returns
zero – An array of the zeros.
- Return type
numpy array
-
yroots.OneDimension.
divPower
(coeff, eigvals=True, verbose=False)¶ Finds the zeros of a 1-D power polynomial using a division matrix.
- Parameters
coeff (numpy array) – The coefficients of the polynomial.
eigvals (bool) – If True, calculates the zeros using the eigenvalues. If False, calculates the zeros using the left eigenvectors.
verbose (bool) – If True, prints the intermediate steps.
- Returns
zero – An array of the zeros.
- Return type
numpy array
-
yroots.OneDimension.
getXinv
(coeff)¶ Helper function for division matrix
-
yroots.OneDimension.
multCheb
(coeff, eigvals=True, verbose=False)¶ Finds the zeros of a 1-D chebyshev polynomial using a multiplication matrix.
- Parameters
coeff (numpy array) – The coefficients of the polynomial.
eigvals (bool) – If True, calculates the zeros using the eigenvalues. If False, calculates the zeros using the left eigenvectors.
verbose (bool) – If True, prints the intermediate steps.
- Returns
zero – An array of the zeros.
- Return type
numpy array
-
yroots.OneDimension.
multPower
(coeff, eigvals=True, verbose=False)¶ Finds the zeros of a 1-D power polynomial using a rotated multiplication matrix.
- Parameters
coeff (numpy array) – The coefficients of the polynomial.
eigvals (bool) – If True, calculates the zeros using the eigenvalues. If False, calculates the zeros using the left eigenvectors.
verbose (bool) – If True, prints the intermediate steps.
- Returns
zero – An array of the zeros.
- Return type
numpy array
-
yroots.OneDimension.
solve
(poly, MSmatrix=0, eigvals=True, verbose=False)¶ Finds the zeros of a 1-D polynomial.
- Parameters
poly (Polynomial) – The polynomial to find the roots of.
MSmatrix (int) –
Controls which Moller-Stetter matrix is constructed For a univariate polynomial, the options are:
0 (default) – The companion or colleague matrix -1 – The inverse of the companion or colleague matrix
- Returns
one_dimensional_solve – An array of the zeros.
- Return type
numpy array
Multiplication¶
Multiplication contains the functions necessary to solve for the roots of a system using a Macaulay matrix that represents a multiplcation by x operator. This includes reducing the Macaulay matrix, finding a good choice of basis, and solving the system for the roots.
-
yroots.Multiplication.
MSMultMatrix
(polys, poly_type, verbose=False, MSmatrix=0, tol=1e-10)¶ Finds the multiplication matrix using the reduced Macaulay matrix.
- Parameters
polys (array-like) – The polynomials to find the common zeros of.
poly_type (string) – The type of the polynomials in polys.
MSmatrix (int) –
- Controls which Moller-Stetter matrix is constructed. The options are:
0 (default) – The Moller-Stetter matrix of a random polynomial Some positive integer i < dimension – The Moller-Stetter matrix of x_i
verbose (bool) – If True, prints information about how the roots are computed.
tol (float) – Tolerance, how small a number has to be before it’s considered to be 0.
- Returns
multiplicationMatrix (2D numpy array) – The multiplication matrix for a random polynomial f
var_dict (dictionary) – Maps each variable to its position in the vector space basis
-
yroots.Multiplication.
MacaulayReduction
(initial_poly_list, tol=0, verbose=False)¶ Reduces the Macaulay matrix to find a vector basis for the system of polynomials.
- Parameters
initial_poly_list (list) – The polynomials in the system we are solving.
tol (float) – How small we want a number to be before assuming it is zero.
verbose (bool) – If True, prints out the process of reducing the Macaulay Matrix.
- Returns
basisDict (dict) – A dictionary of terms not in the vector basis to things in the vector basis that the term can be reduced to.
VB (numpy array) – The terms in the vector basis, each row being a term.
-
yroots.Multiplication.
create_matrix
(poly_coeffs, degree, dim)¶ Builds a Macaulay matrix.
- Parameters
poly_coeffs (list of numpy arrays) – Contains numpy arrays that hold the coefficients of the polynomials to be put in the matrix.
degree (int) – The degree of the Macaulay Matrix
dim (int) – The dimension of the polynomials going into the matrix.
- Returns
matrix (2D numpy array) – The Macaulay matrix.
matrix_terms (numpy array) – The ith row is the term represented by the ith column of the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
-
yroots.Multiplication.
makeBasisDict
(matrix, matrix_terms, VB, power)¶ Calculates and returns the basisDict.
This is a dictionary of the terms on the diagonal of the reduced Macaulay matrix to the terms in the Vector Basis. It is used to create the multiplication matrix in root_finder.
- Parameters
matrix (numpy array) – The reduced Macaulay matrix.
matrix_terms (numpy array) – The terms in the matrix. The i’th row is the term represented by the i’th column of the matrix.
VB (numpy array) – Each row is a term in the vector basis.
power (bool) – If True, the initial polynomials were MultiPower. If False, they were MultiCheb.
- Returns
basisDict – Maps terms on the diagonal of the reduced Macaulay matrix (tuples) to numpy arrays that represent the terms reduction into the Vector Basis.
- Return type
dict
-
yroots.Multiplication.
multiplication
(polys, verbose=False, MSmatrix=0, return_all_roots=True, tol=1e-10)¶ Finds the roots of the given list of multidimensional polynomials using a multiplication matrix.
- Parameters
polys (list of polynomial objects) – Polynomials to find the common roots of.
MSmatrix (int) –
- Controls which Moller-Stetter matrix is constructed. The options are:
0 (default):The Moller-Stetter matrix of a random polynomial Some positive integer i < dimension: The Moller-Stetter matrix of x_i
verbose (bool) – If True, prints information about how the roots are computed.
tol (float) – Tolerance of the function - how small a number has to be before it’s considered to be 0.
- Returns
roots – The common roots of the polynomials. Each row is a root.
- Return type
numpy array
-
yroots.Multiplication.
sorted_matrix_terms
(degree, dim)¶ Finds the matrix_terms sorted in the term order needed for Macaulay reduction. The highest terms come first and the x,y,z etc. monomials last.
- Parameters
degree (int) – The degree of the Macaulay Matrix
dim (int) – The dimension of the polynomials going into the matrix.
- Returns
sorted_matrix_terms (numpy array) – The sorted matrix_terms. The ith row is the term represented by the ith column of the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
Interval Checks¶
The check functions are all functions that take in a coefficent matrix and run a quick check to determine if there can ever be zeros on the unit box there. They are then put into the list all_bound_check_functions in the order we want to run them (probably fastest first). These are then all run to throw out intervals as possible.
-
class
yroots.IntervalChecks.
IntervalData
(a, b)¶ Class to handle all the things related to intervals. It holds and runs the interval checks and also tracks what happened to each interval, and how much progress has been made.
-
interval_checks
¶ A list of functions. Each function accepts a coefficient matrix and a tolerance, and returns whether the Chebyshev Polynomial represented by that matrix, and accurate to within that tolerance, can ever be zero on the n dimensional interval [-1,1].
- Type
list
-
subinterval_checks
¶ A list of functions. Each function accepts a coefficient matrix, a list of intervals, a list of sign changes,and a tolerance. It then returns a list of booleans whether the Chebyshev Polynomial represented by that matrix, and accurate to within that tolerance, can ever be zero on the given intervals. The list of sign changes represents if we already know the function changes sign on a given interval.
- Type
list
-
a
¶ The lower bounds of the overall interval to solve on.
- Type
numpy array
-
b
¶ The upper bounds of the overall interval to solve on.
- Type
numpy array
-
interval_results
¶ A dictionary of funciton names to lists of intervals that were solved by that function.
- Type
dictionary
-
total_area
¶ The total n dimensional volume of the overall interval being solved on.
- Type
float
-
current_area
¶ How much of the n dimensional volume has been checked.
- Type
float
-
polishing
¶ If true this class is just being used as a shell to pass into the polish code.
- Type
bool
-
tick
¶ Keeps track of how many intervals have been solved. Every 100 it resets and prints the progress.
- Type
int
-
__init__
()¶ Initializes everything.
-
check_intervals
()¶ Checks if a polynomial can be zero on an interval.
-
check_subintervals
()¶ Checks if a polynomial can be zero on an list of intervals.
-
track_interval
()¶ Tracks what happened to a given interval.
-
print_progress
()¶ Prints what percentage of the domain has been searched.
-
print_results
()¶ Prints the results of how much each method contributed to the overall search.
-
plot_results
()¶ Plots the results of subdivision solve.
-
check_interval
(coeff, approx_tol, a, b)¶ Runs the interval checks on the interval [a,b].
- Parameters
coeff (numpy array.) – The coefficient matrix of the Chebyshev approximation to check.
approx_tol (float) – The sup norm bound on the approximation error.
a (numpy array) – The lower bounds of the interval to check.
b (numpy array) – The upper bounds of the interval to check.
- Returns
check_interval – True if we can throw out the interval. Otherwise False.
- Return type
bool
-
check_subintervals
(subintervals, scaled_subintervals, polys, change_sign, approx_tol) Runs the subinterval checks on the given intervals
- Parameters
subintervals (list) – A list of the intervals to check.
scaled_subintervals (list) – A list of the intervals to check, scaled to the unit box that the approxiations are valid on.
polys (list) – The MultiCheb polynomials that approximate the functions on these intervals.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
approx_tol (float) – The sup norm bound on the approximation error.
- Returns
check_interval – True if we can throw out the interval. Otherwise False.
- Return type
bool
-
plot_results
(funcs, zeros, plot_intervals) Prints the results of subdivision solve. Only works if the funcitons are two dimensional.
- Parameters
funcs (list) – A list of the functions the were solved
zeros (numpy array) – Each row is a zero of the funcitons
plot_intervals (bool) – If true, shows on the plot which areas were solved by which check/method.
-
print_progress
() Prints the progress of subdivision solve. Only prints every 100th time this function is called to save time.
-
print_results
() Prints the results of subdivision solve, how many intervals there were and what percent were solved by each check/method.
-
track_interval
(name, interval) Stores what happened to a given interval
- Parameters
name (string) – The name of the check or process (Division, Base Case) that solved this interval.
interval (list) – [a,b] where a and b are the lower and upper bound of the interval to track.
-
-
yroots.IntervalChecks.
constant_term_check
(test_coeff, tol)¶ Checks if the constant term is bigger than all the other terms combined using the fact that each Chebyshev monomial is bounded by 1.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
constant_term_check – False if the function is guarenteed to never be zero in the unit box, True otherwise.
- Return type
bool
-
yroots.IntervalChecks.
cubic_check
(test_coeff, tol)¶ Like the constant_term, but splits the coefficient matrix into one-dimensional cubics and uses the extreme values of those to get a better bound.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
cubic_check – False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
bool
-
yroots.IntervalChecks.
extreme_val3
(test_coeff, maxx=True)¶ Finds the extreme value of test_coeff on -1 to 1, used by quad_check.
test_coeff is [a,b,c] and represents the funciton a + bx + c(2x^2 - 1). Basic calculus can be used to find the extreme values.
- Parameters
test_coeff (numpy array) – Array representing [a,b,c].
maxx (bool) – If true returns the absolute value of the max of the funciton, otherwise returns the absolute value of the min of the function.
- Returns
extreme_val3 – The extreme value (max or min) of the absolute value of a + bx + c(2x^2 - 1).
- Return type
float
-
yroots.IntervalChecks.
extreme_val4
(test_coeff, maxx=True)¶ Finds the extreme value of test_coeff on -1 to 1, used by cubic_check
test_coeff is [a,b,c,d] and represents the funciton a + bx + c(2x^2 - 1) + d*(4x^3 - 3x). Basic calculus can be used to find the extreme values.
- Parameters
test_coeff (numpy array) – Array representing [a,b,c,d]
maxx (bool) – If true returns the absolute value of the max of the funciton, otherwise returns the absolute value of the min of the function.
- Returns
extreme_val4 – The extreme value (max or min) of the absolute value of a + bx + c(2x^2 - 1) + d*(4x^3 - 3x).
- Return type
float
-
yroots.IntervalChecks.
full_cubic_check
(test_coeff, tol)¶ Runs the cubic_check in each possible direction to get as much out of it as possible.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
full_cubic_check – False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
bool
-
yroots.IntervalChecks.
full_quad_check
(test_coeff, tol)¶ Runs the quad_check in each possible direction to get as much out of it as possible.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
full_quad_check – False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
bool
-
yroots.IntervalChecks.
linear_check
(test_coeff, intervals, change_sign, tol)¶ Checks the max of the linear part of the approximation and compares to the sum of the other terms.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check.
intervals (list) – A list of the intervals to check.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
mask – A list of the results of each interval. False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
list
-
yroots.IntervalChecks.
quad_check
(test_coeff, tol)¶ Like the constant term check, but splits the coefficient matrix into a one dimensional quadratics and uses the extreme values of those to get a better bound.
- Parameters
test_coeff (numpy array) – The coefficient matrix of the polynomial to check
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
quad_check – False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
bool
-
yroots.IntervalChecks.
quadratic_check
(test_coeff, intervals, change_sign, tol)¶ Finds the min of the absolute value of the quadratic part, and compares to the sum of the rest of the terms. quadratic_check_2D and quadratic_check_3D are faster so runs those if it can, otherwise it runs the genereic n-dimensional version.
- Parameters
test_coeff_in (numpy array) – The coefficient matrix of the polynomial to check.
intervals (list) – A list of the intervals to check.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
mask – A list of the results of each interval. False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
list
-
yroots.IntervalChecks.
quadratic_check_2D
(test_coeff, intervals, change_sign, tol)¶ Finds the min of the absolute value of the quadratic part, and compares to the sum of the rest of the terms in 2 dimensions.
- Parameters
test_coeff_in (numpy array) – The coefficient matrix of the polynomial to check
intervals (list) – A list of the intervals to check.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
mask – A list of the results of each interval. False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
list
-
yroots.IntervalChecks.
quadratic_check_3D
(test_coeff, intervals, change_sign, tol)¶ - Finds the min of the absolute value of the quadratic part, and compares
to the sum of the rest of the terms in 3 dimensions.
- Parameters
test_coeff_in (numpy array) – The coefficient matrix of the polynomial to check
intervals (list) – A list of the intervals to check.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
mask – A list of the results of each interval. False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
list
-
yroots.IntervalChecks.
quadratic_check_nd
(test_coeff, intervals, change_sign, tol)¶ Finds the min of the absolute value of the quadratic part, and compares to the sum of the rest of the terms in n-dimensions.
- Parameters
test_coeff_in (numpy array) – The coefficient matrix of the polynomial to check
intervals (list) – A list of the intervals to check.
change_sign (list) – A list of bools of whether we know the functions can change sign on the subintervals.
tol (float) – The bound of the sup norm error of the chebyshev approximation.
- Returns
mask – A list of the results of each interval. False if the function is guarenteed to never be zero in the unit box, True otherwise
- Return type
list
Macaulay Reduce¶
Macaulay Reduce contains functions that are helpful when reducing the Macaulay matrix when solving a system of polynomials.
-
yroots.MacaulayReduce.
add_polys
(degree, poly, poly_coeff_list)¶ Adds polynomials to a Macaulay Matrix.
- This function is called on one polynomial and adds all monomial multiples of
it to the matrix.
- Parameters
degree (int) – The degree of the Macaulay Matrix
poly (Polynomial) – One of the polynomials used to make the matrix.
poly_coeff_list (list) – A list of all the current polynomials in the matrix.
- Returns
poly_coeff_list – The original list of polynomials in the matrix with the new monomial multiplications of poly added.
- Return type
list
-
yroots.MacaulayReduce.
find_degree
(poly_list, verbose=False)¶ Finds the appropriate degree for the Macaulay Matrix.
- Parameters
poly_list (list) – The polynomials used to construct the matrix.
verbose (bool) – If True prints the degree
- Returns
find_degree – The degree of the Macaulay Matrix.
- Return type
int
-
yroots.MacaulayReduce.
rrqr_reduceMacaulay
(matrix, matrix_terms, cuts, accuracy=1e-10, return_perm=False)¶ Reduces a Macaulay matrix, BYU style.
The matrix is split into the shape A B C D E F Where A is square and contains all the highest terms, and C contains all the x,y,z etc. terms. The lengths are determined by the matrix_shape_stuff tuple. First A and D are reduced using rrqr without pivoting, and then the rest of the matrix is multiplied by Q.T to change it accordingly. Then E is reduced by rrqr with pivoting, the rows of B are shifted accordingly, and F is multipled by Q.T to change it accordingly. This is all done in place to save memory.
- Parameters
matrix (numpy array.) – The Macaulay matrix, sorted in BYU style.
matrix_terms (numpy array) – Each row of the array contains a term in the matrix. The i’th row corresponds to the i’th column in the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
accuracy (float) – Throws an error if the condition number of the backsolve is more than 1/accuracy.
- Returns
matrix (numpy array) – The reduced matrix.
matrix_terms (numpy array) – The resorted matrix_terms. If something goes wrong, returns -1, -1
-
yroots.MacaulayReduce.
rrqr_reduceMacaulay2
(matrix, matrix_terms, cuts, accuracy=1e-10)¶ Reduces a Macaulay matrix, BYU style
This function does the same thing as rrqr_reduceMacaulay but uses qr_multiply instead of qr and a multiplication to make the function faster and more memory efficient.
This function only works properly if the bottom left (D) part of the matrix is zero
- Parameters
matrix (numpy array.) – The Macaulay matrix, sorted in BYU style.
matrix_terms (numpy array) – Each row of the array contains a term in the matrix. The i’th row corresponds to the i’th column in the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
accuracy (float) – What is determined to be 0.
- Returns
matrix (numpy array) – The reduced matrix.
matrix_terms (numpy array) – The resorted matrix_terms. If something goes wrong, returns -1, -1
Polynomial¶
-
class
yroots.polynomial.
MultiCheb
(coeff, order='degrevlex', lead_term=None, clean_zeros=True)¶ Used to represent a Chebyshev polynomial.
-
coeff
¶ The coefficient matrix represented in the object.
-
dim
¶ The number of dimensions of the coefficient matrix
-
order
¶ Ordering type given as a string.
-
shape
¶ The shape of the coefficient matrix.
-
lead_term
¶ The polynomial term with the largest total degree.
-
degree
¶ The total degree of the lead_term.
-
lead_coeff
¶ The coeff of the lead_term.
- Parameters
dim (int) – number of variables, dimension of polynomial system.
terms (int) – highest term of single variable power polynomials.
coeff (list(terms**dim) or np.array ([terms,] * dim)) – coefficents in given ordering.
order (string) – monomial ordering desired for Grobner calculations.
lead_term (list) – the index of the current leading coefficent.
-
__add__
()¶ Add two MultiCheb polynomials.
-
__sub__
()¶ Subtract two MultiCheb polynomials.
-
mon_mult
()¶ Multiply a MultiCheb monomial by a MultiCheb polynomial.
-
__call__
()¶ Evaluate a MultiCheb polynomial at a point.
-
evaluate_grid
(xyz)¶ Evaluates the Chebyshev polynomial on a grid of points, very efficiently.
- Parameters
xyz (array-like) – Each column contains the values for an axis. The direct product of these columns produces the points of the desired grid.
- Returns
values – The polynomial evaluated at all of the points in the grid determined by the axis values
- Return type
complex
-
grad
(point)¶ Evaluates the gradient of the polynomial at the given point.
- Parameters
point (array-like) – the point at which to evaluate the polynomial
- Returns
out – Gradient of the polynomial at the given point.
- Return type
ndarray
-
mon_mult
(idx, returnType='Poly') Multiplies a Chebyshev polynomial by a monomial
- Parameters
idx (tuple of ints) – The index of the monomial to multiply self by.
returnType (str) – If ‘Poly’ then returns a polynomial object.
- Returns
MultiCheb object if returnType is ‘Poly’.
ndarray if returnType is “Matrix”.
-
-
class
yroots.polynomial.
MultiPower
(coeff, order='degrevlex', lead_term=None, clean_zeros=True)¶ Used to represent a power basis polynomial.
-
coeff
¶ The coefficient matrix represented in the object.
-
dim
¶ The number of dimensions of the coefficient matrix.
-
order
¶ Ordering type given as a string.
-
shape
¶ The shape of the coefficient matrix.
-
lead_term
¶ The polynomial term with the largest total degree.
-
degree
¶ The total degree of the lead_term.
-
lead_coeff
¶ The coeff of the lead_term.
- Parameters
dim (int) – number of variables, dimension of polynomial system.
terms (int) – highest term of single variable power polynomials
coeff (list(terms**dim) or np.array ([terms,] * dim)) – coefficents in given ordering.
order (string) – monomial ordering desired for Grobner calculations.
lead_term (list) – the index of the current leading coefficent.
-
__add__
()¶ Add two power polynomials.
-
__sub__
()¶ Subtract two power polynomials.
-
__mul__
()¶ Multiply two power polynomials.
-
__eq__
()¶ Check if two power polynomials are equal.
-
__ne__
()¶ Check if two power polynomials are not equal.
-
mon_mult
()¶ Multiplies a power monomial by a power polynomial.
-
__call__
()¶ Evaluate a power polynomial at a point.
-
evaluate_grid
(xyz)¶ Evaluates the Power polynomial on a grid of points, very efficiently.
- Parameters
xyz (array-like) – Each column contains the values for an axis. The direct product of these columns produces the points of the desired grid.
- Returns
values – The polynomial evaluated at all of the points in the grid determined by the axis values
- Return type
complex
-
grad
(point)¶ Evaluates the gradient of the polynomial at the given point.
- Parameters
point (array-like) – the point at which to evaluate the polynomial
- Returns
out – Gradient of the polynomial at the given point.
- Return type
ndarray
-
mon_mult
(mon, returnType='Poly') Multiplies a polynomial by a monomial.
- Parameters
mon (tuple) – The powers in the monomial. Ex: x^3*y^4*z^2 would be input as (3,4,2)
returnType (str) – Which type of object to return.
- Returns
MultiPower object if returnType is ‘Poly’
ndarray if returnType is ‘Matrix’
-
-
class
yroots.polynomial.
Polynomial
(coeff, order='degrevlex', lead_term=None, clean_zeros=True)¶ Superclass for MultiPower and MultiCheb. Contains methods and attributes that are applicable to both subclasses.
-
coeff
¶ The coefficient matrix represented in the object.
-
dim
¶ The number of dimensions of the coefficient matrix
-
order
¶ Ordering type given as a string
-
shape
¶ The shape of the coefficient matrix
-
lead_term
¶ The polynomial term with the largest total degree
-
degree
¶ The total degree of the lead_term
-
lead_coeff
¶ The coeff of the lead_term
- Parameters
coeff (ndarray) – Coefficients of the polynomial
order (string) –
lead_term (Tuple) – Default is None. Accepts tuple or tuple-like inputs
clean_zeros (bool) – Default is True. If True, all extra rows, columns, etc of all zeroes are removed from matrix of coefficients.
-
clean_coeff
()¶ Removes extra rows, columns, etc of zeroes from end of matrix of coefficients
-
match_size
()¶ Matches the shape of two matrices.
-
monomialList
()¶ Creates a list of monomials that make up the polynomial in degrevlex order.
-
monSort
()¶ Calls monomial list.
-
update_lead_term
()¶ Finds the lead_term of a polynomial
-
__call__
()¶ Evaluates a polynomial at a certain point.
-
__eq__
()¶ Checks if two polynomials are equal.
-
__ne__
()¶ Checks if two polynomials are not equal.
-
clean_coeff
() Gets rid of any 0’s on the outside of the coeff matrix, not giving any info.
-
grad
(point)¶ Evaluates the gradient of the polynomial at the given point. This method is overridden by the MultiPower and MultiCheb classes, so this definition only checks if the polynomial can be evaluated at the given point.
- Parameters
point (array-like) – the point at which to evaluate the polynomial
- Returns
grad – Gradient of the polynomial at the given point.
- Return type
ndarray
-
-
yroots.polynomial.
cheb2poly
(T)¶ Convert a Chebyshev polynomial to a standard polynomial in multiple dimensions.
- Parameters
T (MultiCheb) –
- Returns
- Return type
-
yroots.polynomial.
chebvalnd
(x, c)¶ Evaluate a MultiCheb object at a point x
- Parameters
x (ndarray) – Point to evaluate at
c (ndarray) – Tensor of Chebyshev coefficients
- Returns
c – Value of the MultiCheb polynomial at x
- Return type
float
-
yroots.polynomial.
conv_cheb
(T)¶ Convert a Chebyshev polynomial to the power basis representation in one dimension.
- Parameters
T (array_like) – A one dimensional array_like object that represents the coeff of a Chebyshev polynomial.
- Returns
A one dimensional array that represents the coeff of a power basis polynomial.
- Return type
ndarray
-
yroots.polynomial.
conv_poly
(P)¶ Convert a standard polynomial to a Chebyshev polynomial in one dimension.
- Parameters
P (array_like) – A one dimensional array_like object that represents the coeff of a power basis polynomial.
- Returns
A one dimensional array that represents the coeff of a Chebyshev polynomial.
- Return type
ndarray
-
yroots.polynomial.
getPoly
(deg, dim, power)¶ A helper function for testing. Returns a random upper triangular polynomial of the given dimension and degree. power is a boolean indicating whether or not the polynomial should be MultiPower.
-
yroots.polynomial.
is_power
(poly_list, return_string=False)¶ Determines the type of a list of polynomials.
- Parameters
poly_list (list of polynomial objects) –
- Returns
is_power – If the list is all power objects then returns True, if all obects are chebyshev then returns False, and if there is a mix then an error is raised
- Return type
bool
-
yroots.polynomial.
poly2cheb
(P)¶ Convert a standard polynomial to a Chebyshev polynomial in multiple dimensions.
- Parameters
P (MultiPower) –
- Returns
The multi-dimensional Chebyshev polynomial.
- Return type
-
yroots.polynomial.
polyvalnd
(x, c)¶ Evaluate a MultiPower object at a point x
- Parameters
x (ndarray) – Point to evaluate at
c (ndarray) – Tensor of Polynomial coefficients
- Returns
c – Value of the MultiPower polynomial at x
- Return type
float
-
yroots.polynomial.
solve
(poly1, poly2)¶ Multiplies two polynomials given only their coefficients
- Parameters
(tuple) (poly1,poly2) – tuples of coefficients of polynomials, in descending order of degree
- Returns
- Return type
a tuple of coefficents for the resultant polynomial
Polyroots¶
-
yroots.polyroots.
solve
(polys, MSmatrix=0, eigvals=True, verbose=False, return_all_roots=True)¶ Finds the roots of the given list of polynomials.
- Parameters
polys (list of polynomial objects) – Polynomials to find the common roots of.
MSmatrix (int) –
Controls which Moller-Stetter matrix is constructed For a univariate polynomial, the options are:
0 (default) – The companion or colleague matrix, rotated 180 degrees 1 – The unrotated companion or colleague matrix -1 – The inverse of the companion or colleague matrix
- For a multivariate polynomial, the options are:
0 (default) – The Moller-Stetter matrix of a random polynomial Some positive integer i <= dimension – The Moller-Stetter matrix of x_i, where variables are index from x1, …, xn Some negative integer i >= -dimension – The Moller-Stetter matrix of x_i-inverse
eigvals (bool) – Whether to compute roots of univariate polynomials from eigenvalues (True) or eigenvectors (False). Roots of multivariate polynomials are always comptued from eigenvectors
verbose (bool) – Prints information about how the roots are computed.
- Returns
roots – The common roots of the polynomials. Each row is a root.
- Return type
numpy array
Linear Projection¶
-
yroots.LinearProjection.
bounding_parallelepiped
(linear)¶ A helper function for projecting polynomials. It accepts a linear polynomial and return vectors describing an (n-1)-dimensional parallelepiped that covers the intersection between the linear polynomial (it’s variety) and the n-dimensional hypercube.
Note: The parallelepiped can be described using just one vertex, and (n-1) vectors, each of dimension n.
Second Note: This first attempt is very simple, and can be greatly improved by creating a parallelepiped that much more closely surrounds the points. Currently, it just makes an nd-rectangle.
- Parameters
linear (numpy array) – The coefficients of the linear function.
- Returns
p0 (numpy array) – One vertex of the parallelepiped.
edges (numpy array) – Array of vectors describing the edges of the parallelepiped, from p0.
-
yroots.LinearProjection.
proj_approximate_nd
(f, transform)¶ Finds the chebyshev approximation of an n-dimensional function on the affine transformation of hypercube.
- Parameters
f (function from R^n -> R) – The function to project by interpolating.
transform (function from R^(n-1) -> R^n) – The affine function mapping the hypercube to the desired space.
- Returns
coeffs – The coefficient of the chebyshev interpolating polynomial.
- Return type
numpy array
-
yroots.LinearProjection.
project_down
(polys, linear, approx_tol, solve_tol)¶ This function reduces the dimension of a polynomial system when one of functions is linear. For polynomials in n variables, it uses an affine transformation that maps the (n-1) dimensional hyper-square to cover the intersection between the variety of the linear polynomial and the n dimensional hyper-square. Then it performs chebyshev interpolation of the functions onto this intersection.
- Parameters
polys (list of polynomials) – The polynomials to be projected in a lower dimension by interpolated.
linear (numpy array) – The coefficents of the linear function.
- Returns
proj_polys (list) – The projected polynomials.
T (function from R^(n-1) -> R^n) – This function maps the roots of the projected system to the roots of the original system.
-
yroots.LinearProjection.
remove_linear
(polys, approx_tol, solve_tol, transform_in=None)¶ This function recursively removes linear polynomials from a list by applying the project_down function once for each linear polynomial. This function assumes these polynomials had the zeros removed already, so that it can rely on dimensions to detect linear polynomials.
- Parameters
polys (list of polynomial objects) – Polynomials to find the common roots of.
approx_tol (float) – A tolerance to pass into the trim_coeff.
solve_tol (float) – A tolerance to pass into the trim_coeff.
transform_in (function) – only intended for use in recursion
- Returns
polys (list of polynomial objects) – Polynomials to find the common roots of.
transform (function) – A function mapping the roots of the output system to the roots of the original system.
projected (bool) – True is projection was performed, False if no projection
Projective Space¶
Code for determining if a system of polynomials has a root at infinity August 17, 2018
-
yroots.ProjectiveSpace.
common_root_at_inf
(polys, return_root=False)¶ Tests if a system of upper-triagular bivariate power-basis polynomials has a common root at infinity.
- Parameters
(list, 2) (polys) –
(bool) (return_root) –
- Returns
bool (whether or not there is at least one root at infinity)
root ((tuple) the first root at infinity it found, if any exist)
-
yroots.ProjectiveSpace.
pad_with_zeros
(matrix)¶ Extends a nonsquare matrix into a square matrix with zeros in it. e.g. if A is a tall matrix, returns [A|0]
- Parameters
(np.array) (matrix) –
- Returns
square matrix – square matrix with zeros in it (np.array)
- Return type
np array
-
yroots.ProjectiveSpace.
roots_at_inf
(f)¶ Finds the roots at infinity of a homogenous, bivarite power-basis polynomial.
- Parameters
poly (a bivariate power-basis polynomial) –
- Returns
inf_roots_f_d – The roots at infinity of the polynomial (list of tuples). In the form (x,y). Since at infinity, z = 0
- Return type
list of tuples
Division¶
Division contains the functions necessary to solve for the roots of a system using a Macaulay matrix that represents a division by x_i operator. This includes reducing the Macaulay matrix, finding a good choice of basis, and solving the system for the roots. This method is similar to multiplication, but is an experimental method for solving a specific class of problems quickly and efficiently. Currently, it’s very comprable to Mutliplication, so more research needs to be done.
-
yroots.Division.
build_division_matrix
(VB, VB_spot_dict, diag_reduction_dict, inv_reduction_dict, divisor_terms_dict)¶ Builds the division matrix.
- Parameters
VB (numpy array) – The vector basis.
VB_spot_dict (dictionary) – A dictionary of term in the vector basis to their spot in the vector basis.
diag_reduction_dict (dictionary) – A dictionary of terms on the diagonal to their reduction in the vector basis.
inv_reduction_dict (dictionary) – A dictionary of terms of type y^k/x to their reduction in the vector basis.
divisor_terms_dict (dictionary) – A dictionary of terms to the terms in their dividend when divided by x.
- Returns
div_matrix – The division matrix.
- Return type
numpy array
-
yroots.Division.
condeig
(A)¶ Calculates the condition numbers of the eigenvalues of A
-
yroots.Division.
condeigv
(A)¶ Calculates the condition numbers of the eigenvectors of A
-
yroots.Division.
create_matrix
(poly_coeffs, degree, dim, divisor_var)¶ Builds a Macaulay matrix for reduction.
- Parameters
poly_coeffs (list.) –
- Contains numpy arrays that hold the coefficients of the polynomials
to be put in the matrix.
degree (int) – The degree of the Macaulay Matrix
dim (int) – The dimension of the polynomials going into the matrix.
divisor_var (int) – What variable is being divided by. 0 is x, 1 is y, etc. Defaults to x.
- Returns
matrix (2D numpy array) – The Macaulay matrix.
matrix_terms (numpy array) – The ith row is the term represented by the ith column of the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
-
yroots.Division.
divide_row
(coeffs, terms, term_divide_dict, length)¶ Divides a row of the matrix by the divisor variable..
- Parameters
coeffs (numpy array.) – The numerical values of the terms we want to divide by x.
terms (numpy array) – The terms corresponding to the numerical values.
term_divide_dict (dictionary) – Maps each term as a tuple to a numpy array representing that term divided by x.
length (int) – The length of the rows in the inv_matrix.
- Returns
new_row – The row we get in the inverse_matrix by dividing the first row by x.
- Return type
numpy array
-
yroots.Division.
divide_term
(term, inv_matrix_terms, inv_spot_dict, diag_reduction_dict, VB_size, divisor_terms_dict)¶ Divides a term of the matrix by the divisor variable.
- Parameters
term (numpy array) – The term to divide.
inv_matrix_terms (numpy array) – The terms in the inverse matrix.
inv_spot_dict (dictionary) – A dictionary of term in inv_matrix_terms to their spot in inv_matrix_terms.
diag_reduction_dict (dictionary) – A dictionary of terms on the diagonal to their reduction in the vector basis.
VB_size (int) – The number of elements in the vector basis.
divisor_terms_dict (dictionary) – A dictionary of terms to the terms in their dividend when divided by x.
- Returns
row – The row we get in the inverse_matrix by dividing the term by x.
- Return type
numpy array
-
yroots.Division.
division
(polys, divisor_var=0, tol=1e-10, verbose=False, polish=False, return_all_roots=True)¶ Calculates the common zeros of polynomials using a division matrix.
- Parameters
polys (list of MultiCheb Polynomials) – The polynomials for which the common roots are found.
divisor_var (int) – What variable is being divided by. 0 is x, 1 is y, etc. Defaults to x.
tol (float) – The tolerance parameter for the Macaulay Reduce.
verbose (bool) – If True, prints information about the solve.
polish (bool) – If True, runs a newton polish on the zeros before returning.
- Returns
zeros – The common roots of the polynomials. Each row is a root. Returns -1 if something goes wrong (see instances for details)
- Return type
numpy array
-
yroots.Division.
get_divisor_terms
(term, divisor_var)¶ Finds the terms that will be present when dividing a given term by x.
- Parameters
term (numpy array) – The term to divide.
divisor_var (int) – What variable is being divided by. 0 is x, 1 is y, etc.
- Returns
terms – Each row is a term that will be in the quotient.
- Return type
numpy array
-
yroots.Division.
get_matrix_terms
(poly_coeffs, dim, divisor_var)¶ Finds the terms in the Macaulay matrix.
- Parameters
poly_coeffs (list) – A list of numpy arrays that contain the coefficients of the polynomials to go into the Macaualy Matrix.
dim (int) – The dimension of the polynomials in the matrix.
divisor_var (int) – What variable is being divided by. 0 is x, 1 is y, etc.
- Returns
matrix_terms (numpy array) – The matrix_terms. The ith row is the term represented by the ith column of the matrix.
cuts (tuple) – When the matrix is reduced it is split into 3 parts with restricted pivoting. These numbers indicate where those cuts happen.
-
yroots.Division.
makeBasisDict
(matrix, matrix_terms, VB)¶ Calculates and returns the basisDict.
This is a dictionary of the terms on the diagonal of the reduced Macaulay matrix to the terms in the Vector Basis. It is used to create the multiplication matrix in root_finder.
- Parameters
matrix (numpy array) – The reduced Macaulay matrix.
matrix_terms (numpy array) – The terms in the matrix. The i’th row is the term represented by the i’th column of the matrix.
VB (numpy array) – Each row is a term in the vector basis.
- Returns
basisDict – Maps terms on the diagonal of the reduced Macaulay matrix (tuples) to numpy arrays of the shape remainder_shape that represent the terms reduction into the Vector Basis.
- Return type
dict
Utils¶
A collection of functions used in the F4 Macaulay and TVB solvers
-
exception
yroots.utils.
InstabilityWarning
¶
-
exception
yroots.utils.
MacaulayError
¶
-
class
yroots.utils.
Term
(val)¶ Terms are just tuples of exponents with the grevlex ordering
-
yroots.utils.
all_permutations
(deg, dim, matrixDegree, permutations=None, current_degree=2)¶ Finds all the permutation arrays needed to create a Macaulay Matrix.
- Parameters
deg (int) – Permutation arrays will be computed for all monomials up to this degree.
dim (int) – The dimension the monomials for which permutation degrees.
matrixDegree (int) – The degree of the Macaulay Matrix that will be created. This is needed to get the length of the rows.
permutations (dict) – Defaults to none. The permutations that have already been computed.
current_degree (int) – Defaults to 2. The degree of permutations that have already been computed.
- Returns
permutations – The keys of the dictionary are tuple representation of the monomials, and each value is the permutation array corresponding to multiplying by that monomial.
- Return type
dict
-
yroots.utils.
all_permutations_cheb
(deg, dim, matrixDegree, current_degree=2)¶ Finds all the permutation arrays needed to create a Macaulay Matrix for Chebyshev Basis.
- Parameters
deg (int) – Permutation arrays will be computed for all monomials up to this degree.
dim (int) – The dimension the monomials for which permutation degrees.
matrixDegree (int) – The degree of the Macaulay Matrix that will be created. This is needed to get the length of the rows.
current_degree (int) – Defaults to 2. The degree of permutations that have already been computed.
- Returns
permutations – The keys of the dictionary are tuple representation of the monomials, and each value is the permutation array corresponding to multiplying by that monomial.
- Return type
dict
-
yroots.utils.
arrays
(deg, dim, mon)¶ Finds a part of the permutation array.
- Parameters
deg (int.) – The degree of the Macaulay matrix that the row is in.
dim (int) – The dimension of the polynomials in the Macaualy matrix that the row is in.
mon (int) – The monomial we are multiplying by. 0 -> multiplying by x0 1 -> multiplying by x1 … n -> multiplying by xn
- Returns
arrays – The array is full of True/False values, using np.where the array is True will generate the permutation array.
- Return type
numpy array
-
yroots.utils.
cheb_perturbation2
(mult_mon, mons, mon_dict, var)¶ Calculates the Cheb perturbation for the case where mon is greater than poly_mon
- Parameters
mult_mon (tuple) – the monomial that multiplies the polynomial
mons (array) – Array of monomials in the polynomial
mon_dict (dict) – Dictionary of the index of each monomial.
var (int) – index of the variable that is being calculated
- Returns
cheb_pertubation3 – list of indexes for the 3rd case of cheb mon mult
- Return type
list
-
yroots.utils.
cheb_perturbation3
(mult_mon, mons, mon_dict, var)¶ Calculates the Cheb perturbation for the case where mon is greater than poly_mon
- Parameters
mult_mon (tuple) – the monomial that multiplies the polynomial
mons (array) – Array of monomials in the polynomial
mon_dict (dict) – Dictionary of the index of each monomial.
var (int) – index of the variable that is being calculated
- Returns
cheb_pertubation3 – list of indexes for the 3rd case of cheb mon mult
- Return type
list
-
yroots.utils.
clean_zeros_from_matrix
(array, accuracy=1e-10)¶ Sets all values in the array less than the given accuracy to 0.
- Parameters
array (numpy array) –
accuracy (float, optional) – Values in the matrix less than this will be set to 0.
- Returns
array – Same array, but with values less than the given accuracy set to 0.
- Return type
numpy array
-
yroots.utils.
deg_d_polys
(polys, deg, dim)¶ Finds the rows of the Macaulay Matrix of degree deg.
Iterating through this for each needed degree creates a full rank matrix in all dimensions, getting rid of the extra rows that are there when we do all the monomial multiplications.
The idea behind this algorithm comes from that cool triangle thing I drew on a board once, I have no proof of it, but it seems to work real good.
It is also less stable than the other version.
- Parameters
polys (list.) – A list of polynomials.
deg (int) – The desired degree.
dim (int) – The dimension of the polynomials.
- Returns
poly_coeff_list – A list of the polynomials of degree deg to be added to the Macaulay Matrix.
- Return type
list
-
yroots.utils.
divides
(mon1, mon2)¶ - Parameters
mon1 (tuple) – contains the exponents of the monomial divisor
mon2 (tuple) – contains the exponents of the monomial dividend
- Returns
true if mon1 divides mon2, false otherwise
- Return type
boolean
-
yroots.utils.
first_x
(string)¶ Finds the first position of an ‘x’ in a string. If there is not x it returns the length of the string.
- Parameters
string (str) – The string of interest.
- Returns
i – The position in the string of the first ‘x’ character. If ‘x’ does not appear in the string the return value is the length of the string.
- Return type
int
-
yroots.utils.
get_var_list
(dim)¶ Returns a list of the variables [x_1, x_2, …, x_n] as tuples.
-
yroots.utils.
inverse_P
(P)¶ The inverse of P, the array with column switching indexes.
- Parameters
P (array-like) – 1D array P returned by scipy’s QRP decomposition.
- Returns
The indexes needed to switch the columns back to their original positions.
- Return type
1D numpy array
See also
scipy.linalg.qr()
QR decomposition (with pivoting=True).
-
yroots.utils.
is_number
(string)¶ Checks is a string can be converted to a number.
- Parameters
string (str) – The string of interest.
- Returns
value – Whether or not the string is a valid number.
- Return type
bool
-
yroots.utils.
lcm
(a, b)¶ Finds the LCM of the two leading terms of polynomials a and b
- Parameters
b (a,) –
- Returns
The lcm of the leading terms of a and b. The usual representation is used, i.e., \(x^2y^3\) is represented as \(\mathtt{(2,3)}\)
- Return type
numpy array
-
yroots.utils.
makePolyCoeffMatrix
(inputString)¶ Takes a string input of a polynomaial and returns the coefficient matrix for it. Usefull for making things of high degree of dimension so you don’t have to make it by hand.
All strings must be of the following syntax. Ex. ‘3x0^2+2.1x1^2*x2+-14.73x0*x2^3’
There can be no spaces.
All monomials must be seperated by a ‘+’. If the coefficient of the monomial is negative then the ‘-‘ sign should come after the ‘+’. This is not needed for the first monomial.
All variables inside a monomial are seperated by a ‘*’.
The power of a variable in a monomial is given folowing a ‘^’ sign.
-
yroots.utils.
match_poly_dimensions
(polys)¶ Matches the dimensions of a list of polynomials.
- Parameters
polys (list) – Polynomials of possibly different dimensions.
- Returns
new_polys – The same polynomials but of the same dimensions.
- Return type
list
-
yroots.utils.
match_size
(a, b)¶ Matches the shape of two matrixes.
- Parameters
b (a,) – Matrixes whose size is to be matched.
- Returns
a, b – Matrixes of equal size.
- Return type
ndarray
-
yroots.utils.
memoize_permutaions
(function)¶ Specially designed for memoizing all_permutations.
-
yroots.utils.
mon_combos
(mon, numLeft, spot=0)¶ Finds all the monomials up to a given degree and returns them. Works recursively.
- Parameters
mon (list) – A list of zeros, the length of which is the dimension of the desired monomials. Will change as the function searches recursively.
numLeft (int) – The degree of the monomials desired. Will decrease as the function searches recursively.
spot (int) – The current position in the list the function is iterating through. Defaults to 0, but increases in each step of the recursion.
- Returns
answers – A list of all the monomials.
- Return type
list
-
yroots.utils.
mon_combosHighest
(mon, numLeft, spot=0)¶ Finds all the monomials of a given degree and returns them. Works recursively.
Very similar to mon_combos, but only returns the monomials of the desired degree.
- Parameters
mon (list) – A list of zeros, the length of which is the dimension of the desired monomials. Will change as the function searches recursively.
numLeft (int) – The degree of the monomials desired. Will decrease as the function searches recursively.
spot (int) – The current position in the list the function is iterating through. Defaults to 0, but increases in each step of the recursion.
- Returns
answers – A list of all the monomials.
- Return type
list
-
yroots.utils.
mons_1D
(dim, deg, var)¶ Finds the monomials of one variable up to a given degree.
- Parameters
dim (int) – Dimension of the monomial
deg (int) – Desired degree of highest monomial returned
var (int) – index of the variable of desired monomials
- Returns
mons_1D – Array of monomials where each row is a monomial.
- Return type
ndarray
-
yroots.utils.
newton_polish
(polys, root, niter=100, tol=1e-05)¶ Perform Newton’s method on a system of N polynomials in M variables.
- Parameters
polys (list) – A list of polynomial objects of the same type (MultiPower or MultiCheb).
root (ndarray) – An initial guess for Newton’s method, intended to be a candidate root from root_finder.
niter (int) – A maximum number of iterations of Newton’s method.
tol (float) – Tolerance for convergence of Newton’s method.
- Returns
x1 – The terminal point of Newton’s method, an estimation for a root of the system
- Return type
ndarray
-
yroots.utils.
num_mons
(deg, dim)¶ Returns the number of monomials of a certain degree and dimension.
- Parameters
deg (int.) – The degree desired.
dim (int) – The dimension desired.
- Returns
num_mons – The number of monomials of the given degree and dimension.
- Return type
int
-
yroots.utils.
num_mons_full
(deg, dim)¶ Returns the number of monomials of a certain dimension and less than or equal to a certian degree.
- Parameters
deg (int.) – The degree desired.
dim (int) – The dimension desired.
- Returns
num_mons – The number of monomials of the given degree and dimension.
- Return type
int
-
yroots.utils.
permutation_array
(deg, dim, mon)¶ Finds the permutation array to multiply a row of a matrix by a certain monomial.
- Parameters
deg (int.) – The degree of the Macaulay matrix that the row is in.
dim (int) – The dimension of the polynomials in the Macaualy matrix that the row is in.
mon (int) – The monomial we are multiplying by. 0 -> multiplying by x0 1 -> multiplying by x1 … n -> multiplying by xn
- Returns
permutation_array – Permutting a row in the Macaulay matrix by this array will be equivalent to multiplying by mon.
- Return type
numpy array
-
yroots.utils.
quotient
(a, b)¶ Finds the quotient of monomials a and b, that is, a / b.
- Parameters
b (a,) –
- Returns
The quotient a / b
- Return type
list
-
yroots.utils.
row_linear_dependencies
(matrix, accuracy=1e-10)¶ Uses rank revealing QR to determine which rows of the given matrix are linearly independent and which ones are linearly dependent. (This function needs a name change).
- Parameters
matrix ((2D numpy array)) – The matrix of interest.
- Returns
independentRows ((list)) – The indexes of the rows that are linearly independent
dependentRows ((list)) – The indexes of the rows that can be removed without affecting the rank (which are the linearly dependent rows).
Q ((2D numpy array)) – The Q matrix used in RRQR reduction in finding the rank.
-
yroots.utils.
row_swap_matrix
(matrix)¶ Rearrange the rows of matrix so it is close to upper traingular.
- Parameters
matrix (2D numpy array) – The matrix whose rows need to be switched
- Returns
The same matrix but with the rows changed so it is close to upper triangular
- Return type
2D numpy array
Examples
>>> utils.row_swap_matrix(np.array([[0,2,0,2],[0,1,3,0],[1,2,3,4]])) array([[1, 2, 3, 4], [0, 2, 0, 2], [0, 1, 3, 0]])
-
yroots.utils.
slice_bottom
(matrix)¶ Gets the n-d slices needed to slice a matrix into the bottom corner of another.
- Parameters
coeff (numpy matrix.) – The matrix of interest.
- Returns
slices – Each value of the list is a slice of the matrix in some dimension. It is exactly the size of the matrix.
- Return type
list
-
yroots.utils.
slice_top
(matrix)¶ Gets the n-d slices needed to slice a matrix into the top corner of another.
- Parameters
coeff (numpy matrix.) – The matrix of interest.
- Returns
slices – Each value of the list is a slice of the matrix in some dimension. It is exactly the size of the matrix.
- Return type
list
-
yroots.utils.
sort_polys_by_degree
(polys, ascending=True)¶ Sorts the polynomials by their degree.
- Parameters
polys (list.) – A list of polynomials.
ascending (bool) – Defaults to True. If True the polynomials are sorted in order of ascending degree. If False they are sorted in order of descending degree.
- Returns
sorted_polys – A list of the same polynomials, now sorted.
- Return type
list
-
yroots.utils.
sorted_polys_coeff
(polys)¶ Sorts the polynomials by how much bigger the leading coefficient is than the rest of the coeff matrix.
- Parameters
polys (array-like) – Contains polynomial objects to sort.
- Returns
sorted_polys – The polynomial objects in order of lead coefficient to everything else ratio.
- Return type
list
-
yroots.utils.
sorted_polys_monomial
(polys)¶ Sorts the polynomials by the number of monomials they have, the ones with the least amount first.
- Parameters
polys (array-like, contains polynomial objects !!! Is it a list or could it be any iterable?) – Polynomials to be sorted
- Returns
sorted_polys – Polynomials in order.
- Return type
list
-
yroots.utils.
triangular_solve
(matrix)¶ Takes a matrix that is in row echelon form and reduces it into row reduced echelon form.
- Parameters
matrix (2D numpy array) – The matrix of interest.
- Returns
matrix – The matrix is row reduced echelon form.
- Return type
2D numpy array


--- layout: public-atf footer-space: true current: faq page-title: FAQ permalink: '/faq.html' ---
Yes, instances in a stopped state continue to reserve dedicated system resources (RAM, SSD storage, IP aliases, CPU) and therefore incur charges until you destroy the instance. If you wish to no longer accumulate charges for a virtual machine, please use the DESTROY button in the customer portal.
We have not charged your card. What you have observed is a temporary authorization in order to validate the card provided. The hold will automatically expire based on your bank's policy, generally within a few days.
saferwall.com is required to collect VAT (Value Added Tax) for customers that reside in the EU. VAT is not charged to Business or Charity customers that provide a valid VAT registration. You may enter your VAT registration in your customer portal's settings section. Our prices do not include VAT - VAT will be added to your invoice as a separate line item.
Yes, instances in a stopped state continue to reserve dedicated system resources (RAM, SSD storage, IP aliases, CPU) and therefore incur charges until you destroy the instance. If you wish to no longer accumulate charges for a virtual machine, please use the DESTROY button in the customer portal.
We have not charged your card. What you have observed is a temporary authorization in order to validate the card provided. The hold will automatically expire based on your bank's policy, generally within a few days.
Yes, instances in a stopped state continue to reserve dedicated system resources (RAM, SSD storage, IP aliases, CPU) and therefore incur charges until you destroy the instance. If you wish to no longer accumulate charges for a virtual machine, please use the DESTROY button in the customer portal.
We have not charged your card. What you have observed is a temporary authorization in order to validate the card provided. The hold will automatically expire based on your bank's policy, generally within a few days.


This is polyfill/shim for the (w3c, draft) Notifications API.
Simply put, this shim uses various techniques to bring a user back to a page, this could be especially useful if they were waiting for something to occur. e.g. when a video has finished uploading to Youtube or perhaps you've received a new message in your inbox.
WARNING: browsers are yet to implement http://www.w3.org/TR/notifications/, when they do, this shall move the goal, can't do it now because of permissions - i should probably change the namespace to, nrrrgh
This shim is all about capturing your attention and bringing you back to the page. It employs various "eye catching" techniques, leveraging the best the browser can offer. Checkout the techniques below.
| IE6 | IE7 | IE8 | IE9 | IE10 | Mobile | SA5.1 | OP11 | |||
|---|---|---|---|---|---|---|---|---|---|---|
Alternating document.title
Alternate the text in the window/tab is a good eye catcher. |
||||||||||
| Desktop Notification Create a popup on your desktop which can be viewed outside the browser |
||||||||||
| Flashing TaskBar Icon
Used only with IE pinned sites we may flash the taskbar icon |
||||||||||
| Mobile Notifications
Adding messages to the devices default notification bar |
<script src="notification.js"></script>
createNotification( url Image, string Title, string Description);
if(Notification.checkPermission() === 1){ Notification.requestPermission(); } Notification.createNotification("star.ico","Hello","This is a test");
To use the desktop notifications we need to request permission. So first lets check whether your browser supports it?
var chck = Notification.checkPermission(); if( chck === 0 ){ alert("Yes enabled") } else if( chck === 1 ){ alert("Browser supports it, but not enabled") } else if( chck === -1 ){ alert("Browser does not support it") }
If checkPermission === 1
, then perhaps prompt the user to
enable it?
if(Notification.checkPermission() === 1){ // show a button to enable permissions }
// attach this to a button click event or automatically load it. Notification.requestPermission();
Now go to first demo above and run it!


{% extends "base.html" %} {% load url from future %} {% block extratitle%} — Post a new design / Add description & instructions{% endblock %} {% block main %}
You're almost done ! You can now either add a description and some instructions, or directly publish your design !


1. Installing the App
2. Create A Roster
3. Using a Reader
4. Create Workouts
5. Import Athletes
6. Controlling Workouts
7. Viewing Results
8. Comparing Athletes
To create a roster, you first need to create a team. Your team will have been automatically created for you unless you signed in via Google. Otherwise create your team now, by clicking the 'Add Team' tab.
You will only need to ever do this once, unless new athletes join your team. If you are using RFID tags, associate the tags with the athletes, otherwise leave the 'Tag' field blank.
To use a reader, you will first need to register it before creating a workout. By using a reader, the split taking process becomes 100% automated.
To get to this page, click on the down carrot, and select 'Readers'. Then give your reader a nickname, and under reader number, type in the reader number that was provided to you with your system. Click create and the reader should appear in the list. Do this for as many readers as you are using.
Once you do this, you will never have to do it again.
Creating workouts can be done on the website or on the app. You have more control when doing it on the website. This is because you can set specific start and end dates for each workout as well as specify distance. More data now helps us produce meaningful analytics in the future.
You can also filter workouts, meaning any times less than 30 seconds will be removed. Additionally, if you select a workout to be not private, it will be visible to the public via the public score page. This is handy when hosting races to allow spectators to get live results.
Finally, you can add old workout data to the system for analytics purposes by uploading them by the 'CSV Upload' tab.
Arguably the most important part of the process, you should do this everytime before a practice. Click on the workout you will be running in the near future on the left hand bar, then select roster you created earlier. Check the runners that will be in the workout and click 'Register Runners.'
If you own a reader, and don't register runners, they will dynamically appear on the screen when a workout starts, however it is a best practice to preregister runners.
If you are hosting a race, you can upload the entire roster of runners directly into the workout by clicking the 'CSV Upload' button on the main page. This will add them to the workout, but not your roster.
This is done in the app. Notice how there is no 'Stop' button. This is because at TRAC we believe every time is important including that rest split. This allows us to do powerful data analysis.
Anytime that the reset button is hit, its only a reset on the running clock within the phone. You can view this time by long-pressing on a specific athlete. Anytime the split button is hit, the time is then recorded.
On the controls page, most of the buttons are self explanatory aside from calibrate and stop. These buttons help the readers determine where to put new split information. If a workout is not calibrated, new times may not appear. Its not necessary to use these buttons if you recorded the correct start and stop times of the workout when you created it. Stop a workout when it is finished to prevent new times being added.
Go! is a mass start button when splitting every athlete to start is difficult. Its best used in races when you have a big mass start.
You can view results in the app or on the website. You can more easily view results on the site and drill down into splits by graphing them.
You can also edit and delete splits as necessary as well as insert splits. In race situations, if a runner was missed, by clicking the 'Missed Runner' button, you can know who your system missed out of those athletes that were registered.
When using a reader, sometimes runners will run outside of the range of the antenna, missing splits. Sometimes you miss a split when handtiming. Toggle auto-correction to find those places where a split may have been missed.
Compare two the results of two athletes head to head, or the same runner over two different workouts. Drill down and see each individual split, or graph the two side by side.
In the future new analytics features can be expected on this page. If you're a developer or just a data junkie, contact us for more details about using our API.


--- title: Sharding & IDs at Instagram layout: post ---
We’ve delegated ID creation to each table inside each shard, by using PL/PGSQL, Postgres’ internal programming language, and Postgres’ existing auto-increment functionality.
Each of our IDs consists of:
- 41 bits for time in milliseconds (gives us 41 years of IDs with a custom epoch)
- 13 bits that represent the logical shard ID
- 10 bits that represent an auto-incrementing sequence, modulus 1024. This means we can generate 1024 IDs, per shard, per millisecond


- My name is Rujeena alzyoud Im computer engineer from BAU
- I have experience in machine learning and deep learning model and image processing
- I want to be a good programmer and I have goal in it
- Top 10 moive
- Miracle in Cell No. 7
- Siccin
- Anablla
- Irishman
- parasit
- okja
- tolkien
- alaaden
- The lord of rhe rings
- 1917


Thing
The most generic type of item.
| Property | Expected Type | Description |
|---|---|---|
| Properties from Thing | ||
additionalType
|
URL | An additional type for the item, typically used for adding more specific types from external vocabularies in microdata syntax. This is a relationship between something and a class that the thing is in. In RDFa syntax, it is better to use the native RDFa syntax - the 'typeof' attribute - for multiple types. Schema.org tools may have only weaker understanding of extra types, in particular those defined externally. |
alternateName
|
Text | An alias for the item. |
description
|
Text | A short description of the item. |
image
|
URL or ImageObject | An image of the item. This can be a URL or a fully described ImageObject. |
name
|
Text | The name of the item. |
potentialAction
|
Action | Indicates a potential Action, which describes an idealized action in which this thing would play an 'object' role. |
sameAs
|
URL | URL of a reference Web page that unambiguously indicates the item's identity. E.g. the URL of the item's Wikipedia page, Freebase page, or official website. |
url
|
URL | URL of the item. |
Instances of Thing may appear as values for the following properties
| Property | On Types | Description |
|---|---|---|
about
|
CommunicateAction or CreativeWork | The subject matter of the content. |
category
|
Offer or PhysicalActivity | A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy. |
characterAttribute
|
VideoGameSeries or Game | A piece of data that represents a particular aspect of a fictional character (skill, power, character points, advantage, disadvantage). |
collection
|
UpdateAction | A sub property of object. The collection target of the action. |
defaultValue
|
PropertyValueSpecification | The default value of the input. For properties that expect a literal, the default is a literal value, for properties that expect an object, it's an ID reference to one of the current values. |
error
|
Action | For failed actions, more information on the cause of the failure. |
gameItem
|
VideoGameSeries or Game | An item is an object within the game world that can be collected by a player or, occasionally, a non-player character. |
gamePlatform
|
VideoGameSeries or VideoGame | The electronic systems used to play video games. |
instrument
|
Action | The object that helped the agent perform the action. e.g. John wrote a book with *a pen*. |
item
|
ListItem | An entity represented by an entry in a list (e.g. an 'artist' in a list of 'artists')’. |
itemListElement
|
ItemList | For itemListElement values, you can use simple strings (e.g. "Peter", "Paul, "Mary"), existing entities, or use ListItem.
Text values are best if the elements in the list are plain strings. Existing entities are best for a simple, unordered list of existing things in your data. ListItem is used with ordered lists when you want to provide additional context about the element in that list or when the same item might be in different places in different lists. Note: The order of elements in your mark-up is not sufficient for indicating the order or elements. Use ListItem with a 'position' property in such cases. |
itemReviewed
|
AggregateRating or Review | The item that is being reviewed/rated. |
mentions
|
CreativeWork | Indicates that the CreativeWork contains a reference to, but is not necessarily about a concept. |
object
|
Action | The object upon the action is carried out, whose state is kept intact or changed. Also known as the semantic roles patient, affected or undergoer (which change their state) or theme (which doesn't). e.g. John read *a book*. |
option
|
ChooseAction | A sub property of object. The options subject to this action. |
produces
|
Service | The tangible thing generated by the service, e.g. a passport, permit, etc. |
programmingLanguage
|
Code | The computer programming language. |
purpose
|
PayAction or MedicalDevice or AllocateAction | A goal towards an action is taken. Can be concrete or abstract. |
quest
|
VideoGameSeries or Game | The task that a player-controlled character, or group of characters may complete in order to gain a reward. |
replacee
|
ReplaceAction | A sub property of object. The object that is being replaced. |
replacer
|
ReplaceAction | A sub property of object. The object that replaces. |
reservationFor
|
Reservation | The thing -- flight, event, restaurant,etc. being reserved. |
result
|
Action | The result produced in the action. e.g. John wrote *a book*. |
More specific Types
Schema Version 1.92


US Emissions by Economic Sector
CO2 affects the atmosphere, ocean, temperature, climate, and personal health.
- 2019: (+0.98°C)
- 2018: (+0.95°C)
- 2017: (+0.91°C)
- 2016: (+0.87°C)
- 2015: (+0.83°C)
Global Average Temperature
- 2015
- 2016
- 2017
- 2018
- 2019
- 0.98
- 0.95
- 0.91
- 0.87
- 0.83
- 0.79
-
Polluters
🚗Personal Vehicles
✈Aircraft
🚆🚌Public Transportation
🚢Ships
🚚Deliveries
-
Large-Scale Solutions
🚇Improved public transportation infrastructure
🔋Incentivize energy efficient vehicles
-
Local Solutions
ⓂUtilize public transport more often ⚡Consider Hybrid/Electric vehicles
🚲🚶Biking and Walking
-
Polluters
🔥Burning fossil fuels (mostly coal and natural gas)
-
Large Scale Solutions
🌩Produce energy from more renewable resources
🔋Research ways to efficiently store energy
-
Local Solutions
🎛Reduce unused electricity usage (lights, appliances)
💡Purchase energy efficient homeware
-
Polluters
🔥Burning fossil fuels (mostly coal and natural gas)
🥫Producing goods from raw materials
-
Large Scale Solutions
💰Impose Carbon Taxes
🖊Find ways to reduce emissions while operating
🕰Find ways to shorten the time of operation
🔨Create composite materials
-
Local Solutions
💓Eat less processed foods
♻Recycle
-
Polluters
🐮Livestock
🌱Agricultural soils
🍚Rice Production
-
Large Scale Solutions
🐄Reduce cattle production
Stop planting in 💩
-
Local Solutions
🍙Reduce rice consumption
🥩Substitute beef with other meats
-
Polluters
🏘Use of products which contain greenhouse gases
💩Handling of waste
-
Large Scale Solutions
🚽More effectively deal with waste disposal
🍏Look for ways to develop the same product with reduced greenhouse gases
-
Local Solutions
🚮Find ways to reduce trash each week ♻Dispose of food in yard waste


Navigation
index
modules
|
next
|
deepconcolic documentation
»
Welcome to DeepConcolic’s Documentation!
Welcome to DeepConcolic’s Documentation!
¶
Purposes of DeepConcolic
¶
TODO: Insert parts of
README.md
.
Source Code Documentation
¶
DeepConcolic API
Core
Engine
Norms
Utilities
Available Coverage Metrics & Analyzers
Neuron Coverage
Modified Condition/Decision Coverage
Discrete Bayesian-Network-based Coverage
Internals
Linear Program Solving
Specialized L0 Search
Howto
Adding New Criteria
Indices & Tables
¶
Index
Module Index
Search Page
Table of Contents
Welcome to DeepConcolic’s Documentation!
Purposes of DeepConcolic
Source Code Documentation
Indices & Tables
Next topic
DeepConcolic API
This Page
Show Source
Quick search
Navigation
index
modules
|
next
|
deepconcolic documentation
»
Welcome to DeepConcolic’s Documentation!


- To provide a conducive environment for offering well balanced Information Technology education and research.
- To provide training and practical experience in fundamentals and emerging technologies.
- To create opportunities and nurture creativity for overall personality development.


{% extends "global/Page.html" %} {% load staticfiles otree_tags %} {% block title %} Thank You For Completing The Survey {% endblock %} {% block content %}
Thank you for your participation. Despite the fact that you decided to leave the study early, you are still elibigle for payment for your waiting and for the participation fee.
{% include 'my_simple_survey/results_table.html' %} {% next_button %} {% endblock %}


Prometheus stores all data as time series: streams of timestamped values belonging to the same metric and the same set of labeled dimensions. It also generates derived time series from these data.
An endpoint that you can scrape is an instance. A collection of instances with the same purpose, a process replicated for scalability or reliability, is called a job.
When prometheus scrapes a target, it attaches some labels automatically to scraped time series which serve to identify the scraped target.
Prometheus stores a sample in the time series.
Metrics collection, storage, calculation
Efficient storage for prometheus data. Stores time series database. Distribute time series database.
Visualization tool and alterting tool
Components:
ZK stores IP address of each node
Script stores IP addresses into prometheus,
Fanout Storage -Reads/writes series data
Local storage
Remote storage
TSZ: 1.45 bytes/datapoint
All writes persist to a commit log
Sharding and replication makes horizontal scaling easier.
Provide more fine grained lock granularity.
Data consistency level when writing and reading.
Cache to speed up read operation


## Acknowledgements
This Global Galaxy course is only possible thanks to a Global network of instructors and institutes.
### Instructors & Helpers & Community Caption Contributors
{% include hof.html %}
### Institutions
{% for image in site.static_files %}
{% if image.path contains 'images/logos' %}
{% endif %}
{% endfor %}


The Level 1 cache is used within the PersistenceManager/EntityManager, storing objects that are currently managed etc. There are several implementations of Level 1 Cache here :- SoftRefCache, WeakRefCache and HardRefCache. They provide varying degrees of object retention during the garbage collection process.
The Level 2 cache is used across multiple PersistenceManagers/EntityManagers within the same PersistenceManagerFactory/EntityManagerFactory. There are several implementations of a Level 2 Cache here :- JavaxCacheLevel2Cache (using the javax.cache API), SoftLevel2Cache, and WeakLevel2Cache. Alternatively look in the datanucleus-cache plugin for various L2 caches using third party software.
As far as Level 2 caching is concerned each class is configurable via metadata @Cacheable (and equivalent XML) as to whether it is cached. In addition we can define which fields are cacheable using this mechanism, but maybe using @Extension metadata if the persistence API doesn't support field-level restrictions.
At commit of a transaction we check all enlisted objects and have a recursive process that navigates down through all objects to cache (limited by the FetchPlan) and at the end all of these objects will be put in the L2 cache (and logged). Also at this point if any enlisted objects have been deleted during the transaction we remove them from the L2 cache. When an object is to be put in the L2 cache we check if it already has an entry in the L2 cache and, if so, we update that object with the current field values, version, etc. When an object is to be put in the L2 cache and it has relation fields, we don't store the actual objects of those relations instead storing the identities of the related objects in the CachedPC object. When an object is to be taken from the L2 cache we create a copy of that object and copy the field values across for all fields that were loaded when it was originally put in the cache. When a relation field is required to be loaded we use the identities that are stored in the CachedPC, and find the equivalent object for that identity from the L1/L2 caches, reinstating it into the managed object.


The Date object allows you to create dates and access values such as year, month, day, and second.
If no argument is specified, it is initialized to the current date and time of the system.
var now = new Date(); alert("Now : " + now.toUTCString()); var milliSecs = new Date(7789110879); alert("MilliSecs: " + milliSecs.toUTCString()); var soccerDay = new Date("June 14, 2018 16:00:00"); alert("Kick Off: " + soccerDay.toUTCString()); var birthday = new Date(1981,1,25); alert("Birthday: " + birthday.toLocaleString()); var newYearsEve = new Date(2018,11,31,23,59,59,59); alert("New Year's Eve: " + newYearsEve.toUTCString());References


If you need to manage data in a private database, use the {@link android.database.sqlite} classes. These classes are used to manage the {@link android.database.Cursor} object returned from a content provider query. Databases are usually created and opened with {@link android.content.Context#openOrCreateDatabase} To make requests through content providers, you can use the {@link android.content.ContentResolver content.ContentResolver} class.
All databases are stored on the device in /data/data/<package_name>/databases


What you post on your feed is very important on how certain things can affect others. posting appropriate content can help portray social media on a more positive side. Another thing you can do about being more positive on social media is to post a positive message.  Doing this can allow you to feel more secure about what people see. Being comfortable is very essential when it comes to social media because it can become very dangerous.
 You can grow a more vulnerable bond with your followers.
Female Influencers: Dont's
{DON'T OVER SHARE}
Social media is where people share there lives and promote products but everything needs a balence. Having balence on social media is not over posting your life. Giving infomation out only yourselfs needs to know can bring danger to not only you but people around you. Its a danger over sharing because, "Instagram's 1 billion monthly active users, more than 500 million of them use the platform every day - Todd Clarke." If your not privete this allows ANYONE to access your account.
{BULLYING}
Bullying is a big thing that happens over social media that is NOT ok. Cyber bullying can lead to people being suicidal. for example, "Over 14 percent of teenage students have considered suicide -Digital Humans."
{ASK FOR PERMISSION}
Always ask your friends permiddion to be in any photo. Tagging them in photos they are not ok with is a negitive way to be on social media. You should treat other people on social media how you want to be treated.


You are currently logged in as @StarButterfly on mewni.gov. (Visibility: public)
Not sure what to do now? Test a Twitter intent dialogue or use the new buttons in TweetDeck (which now support quoted tweets) .
You are not logged in.
Launching Mastodon authorisation window...


Sign Up
First Name
*
Last Name
*
Username
*
Email
*
Password
*
School
*
Department
*
Sign Up
Already have an account
Login Here


Ragas with 2 TDs as Louisiana rolls past Troy 53-3
by The Associated PressLAFAYETTE, La. (AP) — Trey Ragas ran for two touchdowns as Louisiana rolled to a 53-3 win over Troy on Saturday night.
Ragas had 79 yards rushing and was one of four running backs to score touchdowns for the Ragin’ Cajuns (9-2, 6-1 Sun Belt Conference). Chris Smith led with 87 yards and Raymond Calais and Elijah Mitchell each contributed to a total of 254 rushing yards. Levi Lewis threw for 273 yards and a score.
Louisiana outgained Troy 598-359 and forced three turnovers.
Lewis capped the first drive of the game with a 12-yard touchdown throw to Ja’Marcus Bradley. Troy got on the board with a field goal late in the first quarter but would not score again.
The Ragin’ Cajuns scored three consecutive touchdowns after that, on Calais’ 27-yard run, on a 1-yard run by Ragas and on an 11-yard run by Michell for a 28-3 lead with 8:18 to go in the first half. Stevie Artigue’s 49-yard field goal made it 31-3 at halftime.
Kaleb Barker threw for 178 yards for the Trojans (5-6, 3-4) and was intercepted twice.
The Associated Press


maskoverlay documentation
maskoverlay overlays a gridded mask.
Contents
Syntax
maskoverlay(x,y,tf) maskoverlay(...,'color',rgb) maskoverlay(...,'alpha',alpha) h = maskoverlay(...)
Description
maskoverlay(x,y,tf) overlays a mask that is black wherever tf is true and transparent wherever tf is false.
maskoverlay(...,'color',rgb) colors the mask by an RGB triplet (values in the range of 0 to 1.)
maskoverlay(...,'alpha',alpha) sets the mask transparency to a value between 0 (invisible) to 1 (opaque).
h = maskoverlay(...) returns a handle h of the image object.
Example:
Plot some data as pseudocolor:
pcolor(-3:3,-3:3,magic(7))
Load some example data we'll use to create masks:
[X,Y,Z] = peaks(500);
x = X(1,:);
y = Y(:,1);
% Overlay an opaque black mask wherever Z is greater than 3:
maskoverlay(x,y,Z>3)
Overlay a semitransparent red mask wherever Z is less than -1:
maskoverlay(x,y,Z<-1,'color',[1 0 0],'alpha',0.5);
Author Info
Written by Chad A. Greene of NASA Jet Propulsion Laboratory, August 2021.


class BuildConfig class BuildConfig |
|
class FamilyTreeApplication : Application
Application class for maintaining global application state. |
|
class R class R |
class DataNotFoundException : Exception
A DataNotFoundException is thrown when an item cannot be found in the database. |
|
class MultipleIdResultsException : Exception
A MultipleIdResultsException is thrown when an unexpected number of rows are returned by a database query for a unique id, and so the data is unable to be processed. |


Articles
ECONOMY
Thousands under observation for coronavirus in India
by WHO
ECONOMY
Coronavirus cases in India reaches 60
by WHO
ECONOMY
Misinformation, fake news spark India coronavirus fears
by WHO
ECONOMY
Coronavirus cases in India reaches 60
by WHO
ECONOMY
Misinformation, fake news spark India coronavirus fears
by WHO
ECONOMY
Coronavirus cases in India reaches 60
by WHO
ECONOMY
Misinformation, fake news spark India coronavirus fears
by WHO


Cloudy Sys Admin. I keep web apps running. BSD user.
I work remotely for Matillion, I previously looked after Sage Business Cloud.
Email: me@rosstimson.com


Play
Options
Credits
Volume:
-
+
Difficulty:
-
+
Close
Space Vikings was made by the
/r/MakeAVideoGame
team as its revival debut. All code is licensed under the BSD 3-Clause License and is
available on GitHub
.
Programming:
Hydrothermal
•
Belbertn
•
robert-porter
Design:
Hydrothermal
•
Belbertn
•
dan_the_ceiling_fan
Dannox
• Momma-Says
Art:
Hydrothermal
•
dan_the_ceiling_fan
Background: Supernova Remnant Cassiopeia A, from
hubblesite.org
.
Close