Skip to content

Commit

Permalink
Removed Verstei and Legendre nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
RJDennis committed Mar 18, 2024
1 parent 51e7d26 commit 01d0d03
Show file tree
Hide file tree
Showing 6 changed files with 159 additions and 445 deletions.
68 changes: 48 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,76 @@
name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
tags: ['*']
pull_request:
workflow_dispatch:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created
actions: write
contents: read
strategy:
fail-fast: false
matrix:
version:
- '1.6' # Replace this with the minimum Julia version that your package supports. E.g. if your package requires Julia 1.5 or higher, change this to '1.5'.
- '1' # Leave this line unchanged. '1' will automatically expand to the latest stable 1.x release of Julia.
- '1.10'
- '1.6'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info

files: lcov.info
docs:
name: Documentation
runs-on: ubuntu-latest
permissions:
actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created
contents: write
statuses: write
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- uses: julia-actions/cache@v1
- name: Configure doc environment
shell: julia --project=docs --color=yes {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run doctests
shell: julia --project=docs --color=yes {0}
run: |
using Documenter: DocMeta, doctest
using ChebyshevApprox
DocMeta.setdocmeta!(ChebyshevApprox, :DocTestSetup, :(using ChebyshevApprox); recursive=true)
doctest(ChebyshevApprox)
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name = "ChebyshevApprox"
uuid = "17a596ad-87cd-578c-9b6d-01108c31dc04"
authors = ["Richard Dennis <richard.dennis@glasgow.ac.uk>"]
version = "0.3.2"
version = "0.4.0"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
ThreadPools = "b189fb0b-2eb5-4ed4-bc0c-d34c51242431"

[compat]
julia = "^1.6"
ThreadPools = "^2.0"

13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ChebyshevApprox
===============

ChebyshevApprox.jl is a Julia package for approximating continuous functions using Chebyshev polynomials. The package's focus is on multivariate functions that depend on an arbitrary number of variables. Both tensor-product polynomials and complete polynomials are implemented. Working with complete polynomials often leads to a considerable decrease in computation time with little loss of accuracy. The package allows the nodes to be either the roots of the Chebyshev polynomial (points of the first kind), the extrema of the Chebyshev polynomial (points of the second kind), Chebyshev extended points (Chebyshev roots normalized so that the boundry nodes equal -1.0 and 1.0), the Vertesi nodes, or the Legendre nodes. In addition to approximating functions, the package also uses the approximating polynomial to compute derivatives, gradients, and hessians.
ChebyshevApprox.jl is a Julia package for approximating continuous functions using Chebyshev polynomials. The package's focus is on multivariate functions that depend on an arbitrary number of variables. Both tensor-product polynomials and complete polynomials are implemented. Working with complete polynomials often leads to a considerable decrease in computation time with little loss of accuracy. The package allows the nodes to be either the roots of the Chebyshev polynomial (points of the first kind), the extrema of the Chebyshev polynomial (points of the second kind), or the Chebyshev extended points (Chebyshev roots normalized so that the boundry nodes equal -1.0 and 1.0). In addition to approximating functions, the package also uses the approximating polynomial to compute derivatives, gradients, and hessians.

Installation
------------
Expand All @@ -25,7 +25,7 @@ n = 11
points = nodes(n,:chebyshev_nodes)
```

where `n`, an integer, is the number of nodes and `:chebyshev_nodes` is a symbol indicating the type of nodes to be produced. Alternatives to `:chebyshev_nodes` are: `chebyshev_extrema`, `:chebyshev_extended`, `:vertesi_nodes`, and `:legendre_nodes`.
where `n`, an integer, is the number of nodes and `:chebyshev_nodes` is a symbol indicating the type of nodes to be produced. Alternatives to `:chebyshev_nodes` are: `chebyshev_extrema`, and `:chebyshev_extended`.

To compute nodes over bounded domains other than the [1.0,-1.0] interval, the `nodes` function accepts an optional third argument containing the domain in the form of a 1D array (a vector) containing two elements, where the first element is the upper bound on the interval and the second is the lower bound. For example,

Expand Down Expand Up @@ -99,11 +99,6 @@ hess_hat = f_hess(x)

There are multi-threaded versions of these functions: `chebyshev_interp_threaded()`, `chebyshev_gradient_threaded()`, and `chebyshev_hessian_threaded()`.

Under the hood
--------------

The functions documented above should cover a lot of use cases. However, the machinery used to produce the chebyshev polynomials, find the polynomial weights, and evaluate polynomials at given points---which took center stage in releases before version 0.3.0---is still there and can be used as before. As such this 0.3.x release is (mostly) not expected to be code-breaking (some stuctures have gone, but I don't think they were used much anyway).

Polynomials
-----------

Expand Down Expand Up @@ -182,7 +177,7 @@ domain = [domain_x1 domain_x2]
w = chebyshev_weights_extrema(y,nodes,order,domain)
```

Other possibilities are to use `chebyshev_weights_extended()`, `chebyshev_weights_vertesi()`, or `chebyshev_weights_legendre()`.
The third possibility is to use `chebyshev_weights_extended()`.

Function evaluation
-------------------
Expand Down Expand Up @@ -233,8 +228,6 @@ For completeness, there are also:
```julia
w = chebyshev_weights_extrema_threaded(y,nodes,order,domain)
w = chebyshev_weights_extended_threaded(y,nodes,order,domain)
w = chebyshev_weights_vertesi_threaded(y,nodes,order,domain)
w = chebyshev_weights_legendre_threaded(y,nodes,order,domain)
```

Related packages
Expand Down
8 changes: 0 additions & 8 deletions src/ChebyshevApprox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ include("chebyshev_approx_functions.jl")
export ChebRoots,
ChebExtrema,
ChebExtended,
VertesiNodes,
LegendreNodes,
Grid,
ChebPoly,
CApproxPlan,
Expand All @@ -19,22 +17,16 @@ export ChebRoots,
export chebyshev_nodes,
chebyshev_extrema,
chebyshev_extended,
vertesi_nodes,
legendre_nodes,
nodes,
chebyshev_polynomial,
chebyshev_polynomial_deriv,
chebyshev_polynomial_sec_deriv,
chebyshev_weights,
chebyshev_weights_extrema,
chebyshev_weights_extended,
chebyshev_weights_vertesi,
chebyshev_weights_legendre,
chebyshev_weights_threaded,
chebyshev_weights_extrema_threaded,
chebyshev_weights_extended_threaded,
chebyshev_weights_vertesi_threaded,
chebyshev_weights_legendre_threaded,
chebyshev_evaluate,
chebyshev_interp,
chebyshev_interp_threaded,
Expand Down
Loading

0 comments on commit 01d0d03

Please sign in to comment.