Skip to content

Commit 0bc5e1c

Browse files
authored
Backport: Remove fromcanonical in points for BivariateSpace (JuliaApproximation#604)
1 parent 16cc267 commit 0bc5e1c

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.8.59"
3+
version = "0.8.60"
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
@@ -570,10 +570,20 @@ end
570570
points(d::Union{EuclideanDomain{2},BivariateSpace},n,m) = points(d,n,m,1),points(d,n,m,2)
571571

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

576-
promote_type(eltype(ptsx),eltype(ptst))[fromcanonical(d,x,t)[k] for x in ptsx, t in ptst]
575+
ptsx = points(columnspace(d,1), n)
576+
ptst = points(factor(d,2), m)
577+
578+
T = promote_eltypeof(ptsx, ptst)
579+
580+
A = if k == 1
581+
repeat(ptsx, 1, m)
582+
else # k == 2
583+
repeat(reshape(ptst, 1, m), n)
584+
end
585+
586+
convert(AbstractArray{T}, A)
577587
end
578588

579589

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)