Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Avraham Adler committed Feb 22, 2024
1 parent d987784 commit 8d6f65c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion R/RemezPolynomial.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Function to create augmented Vandermonde matrix for polynomial approximation.
polyMat <- function(x, y, relErr, basis) {
n <- length(x)
matFunc <- switch(EXPR = basis, "m" = vanderMat, chebMat)
matFunc <- switch(EXPR = basis, m = vanderMat, chebMat)
A <- matFunc(x, n - 2L)
altSgn <- (-1) ^ (seq_len(n) - 1L)
# For relative error, need to weight the E by f(x).
Expand Down
2 changes: 1 addition & 1 deletion R/RemezRational.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ ratMat <- function(x, E, y, nD, dD, relErr, basis) {
if (relErr) altSgn <- altSgn * y
altE <- altSgn * E
yvctr <- -(y + altE)
matFunc <- switch(EXPR = basis, "m" = vanderMat, chebMat)
matFunc <- switch(EXPR = basis, m = vanderMat, chebMat)
aMat <- matFunc(x, nD)
bMat <- matFunc(x, dD)[, -1L] * yvctr
cbind(aMat, bMat, -altSgn, deparse.level = 0L)
Expand Down
2 changes: 1 addition & 1 deletion R/shared.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ callFun <- function(fn, x) {
isOscil <- function(x) all(abs(diff(sign(x))) == 2)

evalFunc <- function(x, R, basis) {
calcFunc <- switch(EXPR = basis, "m" = polyCalc, chebCalc)
calcFunc <- switch(EXPR = basis, m = polyCalc, chebCalc)
ret <- calcFunc(x, R$a)
if ("b" %in% names(R)) {
ret <- ret / calcFunc(x, R$b)
Expand Down
2 changes: 1 addition & 1 deletion inst/tinytest/test_shared.R
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ expect_equal(r, control, tolerance = 1e-7)

## Rational
QQ <- minimaxApprox:::ratCoeffs(x, 0, function(x) expm1(x), 1L, 0L, TRUE, "m",
0, 1,opts$ztol)
0, 1, opts$ztol)
control <- minimaxApprox:::findRoots(x, QQ, function(x) expm1(x), TRUE, "m")
RR <- minimaxApprox:::ratCoeffs(x, 0, fn, 1L, 0L, TRUE, "m", 0, 1, opts$ztol)
r <- minimaxApprox:::findRoots(x, RR, fn, TRUE, "m")
Expand Down

0 comments on commit 8d6f65c

Please sign in to comment.