duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
from __future__ import division | |
import numpy as np | |
from numpy.random import randn | |
from scipy.linalg.blas import drot, drotg | |
# references for updates: | |
# - Golub and van Loan (4th ed.) Section 6.5.4 | |
# - http://mathoverflow.net/questions/30162/is-there-a-way-to-simplify-block-cholesky-decomposition-if-you-already-have-deco | |
# | |
# references for downdates: |
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start daemon at boot time | |
# Description: Enable service provided by daemon. | |
### END INIT INFO |
# Code based on: https://discourse.julialang.org/t/gpu-sort-wip-gpu-1000x-faster-than-cpu-i-must-be-doing-something-wrong/20310/4 | |
# bitonic sorts a vector of any length. | |
using CUDA | |
function bisort!(shared, j, k) | |
tid = UInt(((blockIdx().x - 1) * blockDim().x + threadIdx().x)-1) | |
ixj = tid⊻UInt(j) | |
if ixj > tid | |
if (tid & k) == 0 | |
if shared[tid+1] > shared[ixj+1] | |
tmp = shared[ixj+1] |
using CUDA | |
function gpu_bottomUpMerge!(source, dest, first, middle, last) | |
i = first | |
j = middle | |
for k = first:last | |
if i < middle && (j > last || source[i] < source[j]) | |
dest[k] = source[i] | |
i += 1 | |
else | |
dest[k] = source[j] |