Skip to content

Commit

Permalink
fix documentation test
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydriscoll committed Sep 14, 2023
1 parent f34bc64 commit 7f3c393
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/Manifest.toml
/docs/Manifest.toml
/docs/build/
.DS_Store
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[deps]
ComplexRegions = "c64915e2-6c82-11e9-38e9-1f159a780463"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
RationalFunctionApproximation = "c92886a3-cb30-4e18-b84f-372dde475ecc"
11 changes: 6 additions & 5 deletions src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,23 @@ Construct a `Barycentric` rational function.
# Examples
```jldoctest
julia> r = Barycentric([1,2,3], [1,2,3], [1,1,1])
Barycentric rational function of type (2,2)
julia> r = Barycentric([1, 2, 3], [1, 2, 3], [1/2, -1, 1/2])
Barycentric function with 3 nodes and values:
1.0=>1.0, 2.0=>2.0, 3.0=>3.0
julia> r(1.5)
1.5
```
"""
function Barycentric(node, value, weight, wf=value.*weight; stats=missing)
Barycentric( promote(node, value, weight)..., wf; stats )
Barycentric( promote(float(node), float(value), float(weight))..., float(wf); stats )
end

function Barycentric(
node::Vector{S}, value::Vector{S}, weight::Vector{S}, wf=value.*weight;
stats=missing
) where {T<:Number, S<:RealComplex{T}}
return Barycentric{float(T)}(node, value, weight, wf; stats)
) where {T<:AbstractFloat, S<:RealComplex{T}}
return Barycentric{T}(node, value, weight, wf; stats)
end

# convenience accessors and overloads
Expand Down

0 comments on commit 7f3c393

Please sign in to comment.