Skip to content

Commit 464753f

Browse files
committed
sub -> view
1 parent 076951c commit 464753f

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

REQUIRE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
julia 0.4
22
ToeplitzMatrices 0.1
3+
Compat 0.8.4

src/ChebyshevJacobiPlan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function ForwardChebyshevJacobiPlan{T}(c_jac::AbstractVector{T},α::T,β::T,M::I
122122
rp = RecurrencePlan(α,β,N+1)
123123

124124
# Initialize temporary arrays
125-
c₁,c₂,um,vm = zero(c_jac),slice(zero(c_jac),2:N),zero(c_jac),zero(c_jac)
125+
c₁,c₂,um,vm = zero(c_jac),view(zero(c_jac),2:N),zero(c_jac),zero(c_jac)
126126

127127
# Initialize DCT-I and DST-I plans
128128
p₁,p₂ = applyTN_plan(c₁),applyUN_plan(c₂)
@@ -163,7 +163,7 @@ function BackwardChebyshevJacobiPlan{T}(c_cheb::AbstractVector{T},α::T,β::T,M:
163163
rp,pr = RecurrencePlan(α,β,2N+1),zero(c_cheb2)
164164

165165
# Initialize temporary arrays
166-
c₁,c₂,um,vm = zero(c_cheb2),slice(zero(c_cheb2),2:2N),zero(c_cheb2),zero(c_cheb2)
166+
c₁,c₂,um,vm = zero(c_cheb2),view(zero(c_cheb2),2:2N),zero(c_cheb2),zero(c_cheb2)
167167

168168
# Initialize DCT-I and DST-I plans
169169
p₁,p₂ = applyTN_plan(c₁),applyUN_plan(c₂)

src/ChebyshevUltrasphericalPlan.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function ForwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T,
122122
rp = RecurrencePlan-half(λ),λ-half(λ),N+1)
123123

124124
# Initialize temporary arrays
125-
c₁,c₂,um,vm = zero(c_ultra),slice(zero(c_ultra),2:N),zero(c_ultra),zero(c_ultra)
125+
c₁,c₂,um,vm = zero(c_ultra),view(zero(c_ultra),2:N),zero(c_ultra),zero(c_ultra)
126126

127127
# Initialize DCT-I and DST-I plans
128128
p₁,p₂ = applyTN_plan(c₁),applyUN_plan(c₂)
@@ -162,7 +162,7 @@ function BackwardChebyshevUltrasphericalPlan{T}(c_ultra::AbstractVector{T},λ::T
162162
rp,pr = RecurrencePlan-half(λ),λ-half(λ),2N+1),zero(c_cheb2)
163163

164164
# Initialize temporary arrays
165-
c₁,c₂,um,vm = zero(c_cheb2),slice(zero(c_cheb2),2:2N),zero(c_cheb2),zero(c_cheb2)
165+
c₁,c₂,um,vm = zero(c_cheb2),view(zero(c_cheb2),2:2N),zero(c_cheb2),zero(c_cheb2)
166166

167167
# Initialize DCT-I and DST-I plans
168168
p₁,p₂ = applyTN_plan(c₁),applyUN_plan(c₂)

src/FastTransforms.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
__precompile__()
22
module FastTransforms
33

4-
using Base, ToeplitzMatrices
4+
using Base, ToeplitzMatrices, Compat
55

66
import Base: *
7+
import Compat: view
78

89
export cjt, icjt, jjt, plan_cjt, plan_icjt
910
export leg2cheb, cheb2leg, leg2chebu, ultra2ultra, jac2jac

src/cjt.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ for (op,plan_op,D) in ((:cjt,:plan_cjt,:FORWARD),(:icjt,:plan_icjt,:BACKWARD))
9494
*{T<:AbstractFloat}(p::FastTransformPlan{$D,T},c::AbstractVector{T}) = $op(c,p)
9595
$plan_op{T<:AbstractFloat}(c::AbstractVector{Complex{T}},α,β;M::Int=7) = $plan_op(real(c),α,β;M=M)
9696
$plan_op{T<:AbstractFloat}(c::AbstractVector{Complex{T}},λ;M::Int=7) = $plan_op(real(c),λ;M=M)
97-
$plan_op(c::AbstractMatrix,α,β;M::Int=7) = $plan_op(slice(c,1:size(c,1)),α,β;M=M)
98-
$plan_op(c::AbstractMatrix,λ;M::Int=7) = $plan_op(slice(c,1:size(c,1)),λ;M=M)
97+
$plan_op(c::AbstractMatrix,α,β;M::Int=7) = $plan_op(view(c,1:size(c,1)),α,β;M=M)
98+
$plan_op(c::AbstractMatrix,λ;M::Int=7) = $plan_op(view(c,1:size(c,1)),λ;M=M)
9999
end
100100
end
101101

@@ -107,7 +107,7 @@ end
107107
function *(p::FastTransformPlan,c::AbstractMatrix)
108108
m,n = size(c)
109109
ret = zero(c)
110-
for j=1:n ret[:,j] = p*slice(c,1:m,j) end
110+
for j=1:n ret[:,j] = p*view(c,1:m,j) end
111111
ret
112112
end
113113

src/toeplitzhankel.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function th_cheb2leg(v)
137137
w = zero(v)
138138
S,n = eltype(v),length(v)
139139
w[1:2:end] = -one(S)./(one(S):two(S):n)./(-one(S):two(S):n-two(S))
140-
[dot(w,v);th_cheb2legplan(S,n)*slice(v,2:n)]
140+
[dot(w,v);th_cheb2legplan(S,n)*view(v,2:n)]
141141
end
142142
th_leg2chebu(v)=th_leg2chebuplan(eltype(v),length(v))*v
143143
th_ultra2ultra(v,λ₁,λ₂)=th_ultra2ultraplan(eltype(v),length(v),λ₁,λ₂)*v

0 commit comments

Comments
 (0)