Skip to content

Commit df20867

Browse files
try supporting 32-bit
1 parent 54f9be8 commit df20867

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

src/SphericalHarmonics/Butterfly.jl

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ immutable Butterfly{T} <: Factorization{T}
22
columns::Vector{Matrix{T}}
33
factors::Vector{Vector{IDPackedV{T}}}
44
permutations::Vector{Vector{ColumnPermutation}}
5-
indices::Vector{Vector{Int64}}
5+
indices::Vector{Vector{Int}}
66
temp1::Vector{T}
77
temp2::Vector{T}
88
temp3::Vector{T}
@@ -28,7 +28,7 @@ end
2828

2929
size(B::Butterfly) = size(B, 1), size(B, 2)
3030

31-
function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false, opts...)
31+
function Butterfly{T}(A::AbstractMatrix{T}, L::Int; isorthogonal::Bool = false, opts...)
3232
m, n = size(A)
3333
tL = 2^L
3434

@@ -38,13 +38,13 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false
3838
columns = Vector{Matrix{T}}(tL)
3939
factors = Vector{Vector{IDPackedV{T}}}(L+1)
4040
permutations = Vector{Vector{ColumnPermutation}}(L+1)
41-
indices = Vector{Vector{Int64}}(L+1)
42-
cs = Vector{Vector{Vector{Int64}}}(L+1)
41+
indices = Vector{Vector{Int}}(L+1)
42+
cs = Vector{Vector{Vector{Int}}}(L+1)
4343

4444
factors[1] = Vector{IDPackedV{T}}(tL)
4545
permutations[1] = Vector{ColumnPermutation}(tL)
46-
indices[1] = Vector{Int64}(tL+1)
47-
cs[1] = Vector{Vector{Int64}}(tL)
46+
indices[1] = Vector{Int}(tL+1)
47+
cs[1] = Vector{Vector{Int}}(tL)
4848

4949
ninds = linspace(1, n+1, tL+1)
5050
indices[1][1] = 1
@@ -53,7 +53,7 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false
5353
nu = round(Int, ninds[j+1]) - 1
5454
nd = nu-nl+1
5555
if isorthogonal
56-
factors[1][j] = IDPackedV{T}(collect(1:nd),Int64[],Array{T}(nd,0))
56+
factors[1][j] = IDPackedV{T}(collect(1:nd),Int[],Array{T}(nd,0))
5757
else
5858
factors[1][j] = idfact!(A[:,nl:nu], LRAOpts)
5959
end
@@ -66,8 +66,8 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false
6666
for l = 2:L+1
6767
factors[l] = Vector{IDPackedV{T}}(tL)
6868
permutations[l] = Vector{ColumnPermutation}(tL)
69-
indices[l] = Vector{Int64}(tL+1)
70-
cs[l] = Vector{Vector{Int64}}(tL)
69+
indices[l] = Vector{Int}(tL+1)
70+
cs[l] = Vector{Vector{Int}}(tL)
7171

7272
ctr = 0
7373
minds = linspace(1, m+1, ii+1)
@@ -81,7 +81,7 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false
8181
lc = length(cols)
8282
Av = A[ml:mu,cols]
8383
if maximum(abs, Av) < realmin(real(T))/eps(real(T))
84-
factors[l][j+ctr] = IDPackedV{T}(Int64[], collect(1:lc), Array{T}(0,lc))
84+
factors[l][j+ctr] = IDPackedV{T}(Int[], collect(1:lc), Array{T}(0,lc))
8585
else
8686
LRAOpts.rtol = eps(real(T))*max(mu-ml+1, lc)
8787
factors[l][j+ctr] = idfact!(Av, LRAOpts)
@@ -108,7 +108,7 @@ function Butterfly{T}(A::AbstractMatrix{T}, L::Int64; isorthogonal::Bool = false
108108
Butterfly(columns, factors, permutations, indices, zeros(T, kk), zeros(T, kk), zeros(T, kk))
109109
end
110110

111-
function sumkmax(indices::Vector{Vector{Int64}})
111+
function sumkmax(indices::Vector{Vector{Int}})
112112
ret = 0
113113
@inbounds for j = 1:length(indices)
114114
ret = max(ret, indices[j][end])
@@ -313,7 +313,7 @@ end
313313
function allranks(B::Butterfly)
314314
L = length(B.factors)-1
315315
tL = 2^L
316-
ret = zeros(Int64, tL, L+1)
316+
ret = zeros(Int, tL, L+1)
317317
@inbounds for l = 1:L+1
318318
for j = 1:tL
319319
ret[j,l] = size(B.factors[l][j], 1)

src/hierarchical.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ size(P::HierarchicalPlanWithParity) = (size(P.even, 1)+size(P.odd, 1), size(P.ev
4343
evensize(v::AbstractVecOrMat, d) = (L = size(v, d); iseven(L) ? L÷2 : (L+1)÷2)
4444
oddsize(v::AbstractVecOrMat, d) = (L = size(v, d); iseven(L) ? L÷2 : (L-1)÷2)
4545

46-
UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, bd::Int64) = UpperTriangularHierarchicalMatrix(T, f, bd, bd)
47-
UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, b::Int64, d::Int64) = UpperTriangularHierarchicalMatrix(T, f, 1, b, 1, d)
46+
UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, bd::Int) = UpperTriangularHierarchicalMatrix(T, f, bd, bd)
47+
UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, b::Int, d::Int) = UpperTriangularHierarchicalMatrix(T, f, 1, b, 1, d)
4848

49-
function UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, a::Int64, b::Int64, c::Int64, d::Int64)
49+
function UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, a::Int, b::Int, c::Int, d::Int)
5050
if (b-a+1) < BLOCKSIZE(T) && (d-c+1) < BLOCKSIZE(T)
5151
i = (b-a)÷2
5252
j = (d-c)÷2
@@ -68,7 +68,7 @@ function UpperTriangularHierarchicalMatrix{T}(::Type{T}, f::Function, a::Int64,
6868
end
6969
end
7070

71-
function HierarchicalMatrix{T}(::Type{T}, f::Function, a::Int64, b::Int64, c::Int64, d::Int64)
71+
function HierarchicalMatrix{T}(::Type{T}, f::Function, a::Int, b::Int, c::Int, d::Int)
7272
if (b-a+1) < BLOCKSIZE(T) && (d-c+1) < BLOCKSIZE(T)
7373
i = (b-a)÷2
7474
j = (d-c)÷2

src/precompile.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
function _precompile_()
22
ccall(:jl_generating_output, Cint, ()) == 1 || return nothing
3-
precompile(FastTransforms.pochhammer, (Float64, Int64,))
3+
precompile(FastTransforms.pochhammer, (Float64, Int,))
44
end

src/specialfunctions.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ function compute_absf!{T<:AbstractFloat}(ret::Vector{T},tempsin::Vector{T},temps
282282
ret
283283
end
284284

285-
function compute_umvm!{T<:AbstractFloat}(um::Vector{T},vm::Vector{T},cfs::Matrix{T}::T::T,tempcos::Vector{T},tempsin::Vector{T},tempcosβsinα::Vector{T},m::Int::Vector{T},ir::UnitRange{Int64})
285+
function compute_umvm!{T<:AbstractFloat}(um::Vector{T},vm::Vector{T},cfs::Matrix{T}::T::T,tempcos::Vector{T},tempsin::Vector{T},tempcosβsinα::Vector{T},m::Int::Vector{T},ir::UnitRange{Int})
286286
@inbounds for i in ir
287287
temp = inv(tempcos[i]^m*tempcosβsinα[i])
288288
ϑ =+half(α))/2-+β+m+1)*θ[i]/2
@@ -297,7 +297,7 @@ function compute_umvm!{T<:AbstractFloat}(um::Vector{T},vm::Vector{T},cfs::Matrix
297297
end
298298
end
299299

300-
function compute_umvm!{T<:AbstractFloat}(um::Vector{T},vm::Vector{T}::T,tempsinλm::Vector{T},m::Int::Vector{T},ir::UnitRange{Int64})
300+
function compute_umvm!{T<:AbstractFloat}(um::Vector{T},vm::Vector{T}::T,tempsinλm::Vector{T},m::Int::Vector{T},ir::UnitRange{Int})
301301
@inbounds @simd for i in ir
302302
temp = inv(tempsinλm[i])
303303
ϑ = (m+λ)*(half(T)-θ[i])

0 commit comments

Comments
 (0)