Skip to content

Commit

Permalink
Remove fromcanonical in points for BivariateSpace (#603)
Browse files Browse the repository at this point in the history
* Remove fromcanonical in points for BivariateSpace

* Add trivial tests

* Bump version to v0.9.16
  • Loading branch information
jishnub authored Sep 21, 2023
1 parent 9d017b6 commit 9c921b3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.9.15"
version = "0.9.16"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
16 changes: 13 additions & 3 deletions src/Multivariate/TensorSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,20 @@ end
points(d::Union{EuclideanDomain{2},BivariateSpace},n,m) = points(d,n,m,1),points(d,n,m,2)

function points(d::BivariateSpace,n,m,k)
ptsx=points(columnspace(d,1),n)
ptst=points(factor(d,2),m)
k (1,2) || throw(ArgumentError("k must be 1 or 2"))

promote_type(eltype(ptsx),eltype(ptst))[fromcanonical(d,x,t)[k] for x in ptsx, t in ptst]
ptsx = points(columnspace(d,1), n)
ptst = points(factor(d,2), m)

T = promote_eltypeof(ptsx, ptst)

A = if k == 1
repeat(ptsx, 1, m)
else # k == 2
repeat(reshape(ptst, 1, m), n)
end

convert(AbstractArray{T}, A)
end


Expand Down
7 changes: 7 additions & 0 deletions test/SpacesTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,13 @@ using LinearAlgebra
@test a == a
@test a != b
end

@testset "points" begin
S = PointSpace(1:4) PointSpace(1:4)
P = points(S, 4, 4)
@test P[1] == repeat(1:4, 1, 4)
@test P[2] == repeat((1:4)', 4, 1)
end
end

@testset "ConstantSpace" begin
Expand Down

2 comments on commit 9c921b3

@jishnub
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request updated: JuliaRegistries/General/91302

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.16 -m "<description of version>" 9c921b38c0b7276dae3f18d062f0e705498a9651
git push origin v0.9.16

Please sign in to comment.