Skip to content

Commit 9c921b3

Browse files
authored
Remove fromcanonical in points for BivariateSpace (#603)
* Remove fromcanonical in points for BivariateSpace * Add trivial tests * Bump version to v0.9.16
1 parent 9d017b6 commit 9c921b3

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.9.15"
3+
version = "0.9.16"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Multivariate/TensorSpace.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,20 @@ end
565565
points(d::Union{EuclideanDomain{2},BivariateSpace},n,m) = points(d,n,m,1),points(d,n,m,2)
566566

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

571-
promote_type(eltype(ptsx),eltype(ptst))[fromcanonical(d,x,t)[k] for x in ptsx, t in ptst]
570+
ptsx = points(columnspace(d,1), n)
571+
ptst = points(factor(d,2), m)
572+
573+
T = promote_eltypeof(ptsx, ptst)
574+
575+
A = if k == 1
576+
repeat(ptsx, 1, m)
577+
else # k == 2
578+
repeat(reshape(ptst, 1, m), n)
579+
end
580+
581+
convert(AbstractArray{T}, A)
572582
end
573583

574584

test/SpacesTest.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,13 @@ using LinearAlgebra
295295
@test a == a
296296
@test a != b
297297
end
298+
299+
@testset "points" begin
300+
S = PointSpace(1:4) PointSpace(1:4)
301+
P = points(S, 4, 4)
302+
@test P[1] == repeat(1:4, 1, 4)
303+
@test P[2] == repeat((1:4)', 4, 1)
304+
end
298305
end
299306

300307
@testset "ConstantSpace" begin

0 commit comments

Comments
 (0)