Electrostatic linear plasma dispersion relation
where, in SI units:
using SpecialFunctions, Bessels, LinearAlgebra, Plots | |
const spj = SpecialFunctions.besselj | |
const bej = Bessels.besselj | |
function foo!(A, B, f::T, ns, ms, N) where T | |
for (j, n) in enumerate(ns) | |
for (i, m) in enumerate(ms) | |
A[i, j] = 0 | |
t = @elapsed for _ in 1:N |
using LinearAlgebra, Test, Random | |
Random.seed!(0) | |
@testset "understand raw lapack calls" begin | |
@show Threads.nthreads() | |
@show BLAS.get_num_threads() | |
m = 5 | |
n = 4 | |
A = rand(m, n); |
using LinearAlgebra, Random, Base.Threads | |
Random.seed!(0) | |
alphafactor(x::Real) = -sign(x) | |
alphafactor(x::Complex) = -exp(im * angle(x)) | |
function householder!(A::Matrix{T}) where T | |
m, n = size(A) | |
H = A | |
α = zeros(T, min(m, n)) # Diagonal of R |
using Random, Distributed, Test | |
Random.seed!(0) | |
addprocs(4, exeflags="-t 2") | |
@everywhere begin | |
using LinearAlgebra, Random | |
using Distributed, DistributedArrays, SharedArrays | |
LinearAlgebra.BLAS.set_num_threads(Base.Threads.nthreads()) |