the.bay.news

Preparing an antisymmetric matrix of normal numbers as efficiently as possible

Julia Programming Language
Preparing an antisymmetric matrix of normal numbers as efficiently as possible
My goal is to prepare a fully antisymmetric matrix of normal numbers, on a single thread, as efficiently as possible. After numerous manual attempts, here is the best version I could come up with: using BenchmarkTools const N = 1024 const TAB = zeros(Float64, N, N) function prepare!() @inbounds for i=1:N for j=1:(i-1) val = randn() TAB[i,j] = val TAB[j,i] = -val # Antisymmetry end TAB[i,i] = 0.0 # Diagonal end end ##### @btim...

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.