M_maker#1
Open
goldrups wants to merge 725 commits into
Open
Conversation
Functional Changes: ------------------ - Changed the default target_tol parameter to 1.e-15. - Added use of get_abs_approx_tol to also update target_tol as needed. - Updated get_abs_approx_tol method to avoid updating passed in parameters a,b when finding a new interval of length 2*linearization. - Re-organized the if, elif, else statements in subdivsion_solve_nd to avoid running the linear solver without having a sufficiently accurate (according to target_tol) approximation. Cosmetic Changes: ---------------- - Added target_tol description to the docstring of suddivision.solve, - Added spaces to comments without spaces after '#'.
- Updated documentation in several areas, removing typos and adding more accurate descriptors of what the code is doing. - Made more explicit that in 1D the target_deg is the same as deg.
2 Tolerances
* draft of inteval check edits * Fixing up quadratic checks * updated unit tests, fixed small bug
…nto sue_develop2
- Fixed a bug when determining a good_deg. The line np.isclose now uses our default absolute and relative tolerances. - Implemented sign_change in 1D. If there is a sign change, skip the checks. If there isn't a sign change, run the checks.
… arrays have overhead to set up, so regular lists and math library functions are cheaper than very small arrays. Also eval_func was expensive, so speeding it up and reducing the number of calls to it helped a lot.
- Implemented sign change check for 1D case - Implemented sign change check for 2D case
- Implemented the nd sign change check, but it appears that it slows the code down more than it gives any benefit in timing/accuracy. It appears to take (normal time spent in interval_approximage_nd) * dimension for dim >= 2, so as the dimension increases, the slowdown becomes more and more a problem.
speedups to quadratic_check_2D
- Added jit handle to transform to speed it up - Removed the loop from get_abs_approx_tol so that it only samples once. So far, tests have shown that it performs comparably to looping in terms of accuracy, but speeds it up by a factor ~5.
…lerjarvis/RootFinding into erik_subdivisionSolverUpdates
…olverUpdates Erik subdivision solver updates
…, current vision of test code (not yet automated), tested version of Combined Solver
Merges my Combined Solver changes, test code, and approximator to be up to date with Erik's new subdivision solver.
…ently forgot to remove from Erik's code
Add new Combined_Solver to codebase
…lerjarvis/RootFinding into erik_subdivisionSolverUpdates
Erik add base case
Creating Pull Request to pull in Erik's edits to the Numba portion of the code
Merging Exact_option into erik_subdivision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Basic Documentation:
inputs: function, a (ndarray of lower bounds for interval), b (ndarray of upper bounds for interval), guess_deg (what a guess of the best degree is (the code will double it if needed)
List of attributes for any M_maker object you make:
M (the approximation), f, a, b, dim, deg, err (error), rel_approx_tol, abs_approx_tol, inf_norm, M2 (approximation of double degree), M_rescaled (approximation rescaled by inf_norm), values_block(evaluation of approximating polynomial at the Chebyshev critical points), memo_dict (used to calculate values_block via memorization)
Example:
g = lambda x,y: (x-.9999)2 + y2-1
g_deg = 2
a,b = np.array([-1,-1]),np.array([1,1])
g_approx = M_maker(g,a,b,g_deg)