Skip to content

Instantly share code, notes, and snippets.

View Thuener's full-sized avatar

Thuener Silva Thuener

View GitHub Profile
using JuMP,CPLEX
const C = 300000
const N = 100
function memuse()
pid = getpid()
return round(Int,parse(Int,read(`ps -p $pid -o rss=`,String))/1024)
end
@Thuener
Thuener / MP.jl
Last active June 9, 2017 14:40
Polynomial multiplication Karatsuba
function MP3(p1::Vector{Int64},p2::Vector{Int64})
if length(p1) == 1 || length(p2) == 1
return([p1[1]*p2[1]])
end
n = length(p1)
n_div2 = floor(Int64,n/2)
A = p1[1:n_div2]
B = p1[(n_div2+1):(n)]
C = p2[1:n_div2]