Skip to content

Commit

Permalink
Use QR for Rational as well and tighten LINPACK pivot tolerance a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
aadler committed Aug 20, 2023
1 parent ab942a0 commit 4fcefe3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion R/RemezPolynomial.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ polyMat <- function(x, y, relErr) {
# Function to calculate coefficients given matrix and known values
polyCoeffs <- function(x, fn, relErr) {
y <- callFun(fn, x)
PP <- qr.solve(polyMat(x, y, relErr), y)
PP <- qr.solve(polyMat(x, y, relErr), y, tol = 1e-12)
list(a = PP[-length(PP)], E = PP[length(PP)])
}

Expand Down
2 changes: 1 addition & 1 deletion R/RemezRational.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ratMat <- function(x, E, y, nD, dD, relErr) {
# Function to calculate coefficients given matrix and known values
ratCoeffs <- function(x, E, fn, nD, dD, relErr) {
y <- callFun(fn, x)
P <- solve(ratMat(x, E, y, nD, dD, relErr), y)
P <- qr.solve(ratMat(x, E, y, nD, dD, relErr), y, tol = 1e-12)
list(a = P[seq_len(nD + 1L)], # Works even if nD = 0
b = c(1, P[seq_len(dD) + nD + 1L]), # Works even if dD = 0
E = P[length(P)])
Expand Down

0 comments on commit 4fcefe3

Please sign in to comment.