Skip to content

Instantly share code, notes, and snippets.

Mikael Slevinsky MikaelSlevinsky

View GitHub Profile
@MikaelSlevinsky
MikaelSlevinsky / test_slowplan_openmp.jl
Last active Feb 26, 2018
Test the experimental use of multithreading for spherical harmonic transforms in FastTransforms.jl
View test_slowplan_openmp.jl
Pkg.build("FastTransforms")
using FastTransforms
N = 2.^(7:12)
tSP = zeros(length(N), 3)
Nr = 3
j = 1
for n in N
A = sphrandn(Float64, n+1, n+1)
SlowSphericalHarmonicPlan(A)
@MikaelSlevinsky
MikaelSlevinsky / ThreeMethodsComparison.jl
Created Mar 19, 2017
Timings and errors between hierarchical, Toeplitz-dot-Hankel, and asymptotic methods for converting Legendre expansions to Chebyshev expansions
View ThreeMethodsComparison.jl
using FastTransforms, PyPlot
N = 40
t = Matrix{Float64}(N,6)
err = Matrix{Float64}(N,3)
for i in 1:N
n = round(Int64, 10.0^(1 + 5*((i-1)/(N-1))))
v = rand(n)
View asycxn.jl
using FastTransforms, PyPlot
errASY1,errASY2,errCXN1,errCXN2 = Float64[],Float64[],Float64[],Float64[]
n = round(Int,logspace(1,5,30))
for k in n
println("This is k: ",k)
srand(0)
c = randn(k)
push!(errASY1,norm(icjt(cjt(c,0.,0.),0.,0.)-c,Inf))
push!(errASY2,norm(cjt(icjt(c,0.,0.),0.,0.)-c,Inf))
@MikaelSlevinsky
MikaelSlevinsky / myFun.jl
Last active Mar 24, 2016
An axiomatically-designed constructor
View myFun.jl
using ApproxFun
import ApproxFun: Fun, domain, Space, checkpoints, ArraySpace, zerocfsFun, defaultFun, real
function myFun(f, d::Space)
#TODO: reuse function values?
T = eltype(domain(d))
if T <: Complex
T = T.parameters[1] #get underlying real representation
end
r=checkpoints(d)
View gist:725d8c17ee73bf565c48
#
# woodburysolve
#
using ApproxFun, SingularIntegralEquations, PyPlot
d = 8
t1,t2 = Array(Float64,min(d,6)),Array(Float64,d)
for i = 1:d
@MikaelSlevinsky
MikaelSlevinsky / multtest.jl
Last active Aug 29, 2015
Test coefficient- and value-based multiplication
View multtest.jl
using PyCall
pygui(:tk)
using PyPlot
using ApproxFun
gc()
gc_disable()
N = 36
You can’t perform that action at this time.