Skip to content

Instantly share code, notes, and snippets.

View axsk's full-sized avatar

Alexander axsk

  • Zuse Institute Berlin
  • Berlin
View GitHub Profile
@axsk
axsk / make
Created April 17, 2016 12:29
julia make error
fatal: No names found, cannot describe anything.
fatal: bad revision '^'
JULIA usr/lib/julia/inference.ji
essentials.jl
generator.jl
reflection.jl
options.jl
promotion.jl
tuple.jl
range.jl
@axsk
axsk / Make.user
Last active April 17, 2016 12:37
make error
JULIA_CPU_TARGET:=core2
prefix=/datanumerik/bzfsikor/julia/julia-head
typealias ColVec Vector{Union{Colon,Int}}
immutable SliceIterator{A<:AbstractArray}
a::A
dim::Int
cols::ColVec
end
function SliceIterator(a, dim::Int)
cols = ColVec(length(size(a)))
cols = fill!(cols, :)
@userplot PlotSolutions
@recipe function f(o::PlotSolutions)
samples = o.args[1]
species --> measuredinds
t --> 0:1/3:30
color_palette --> [colorant"steelblue"]
linewidth --> 0.1
label --> ""
seriesalpha --> 0.1
using Plots
rect(x,y,w,h) = Shape(x+[0,w,w,0], y+[0,0,h,h])
@recipe function f(ds::Array{Measurement}; alpha = 1)
isempty(ds) && return []
binedges = [0,10,12,14,16,18,20,25]
nmax = nfollicles(ds)
a = alpha
using Sundials
using Sundials: N_Vector, N_Vector_S
using ForwardDiff
#using ReverseDiff
"""
sens(f!, t0, y0, p, tout; reltol, abstol)
Compute the solution and sensivities to the parametrized ODE problem defined by `f!(ẏ, t, y, p)`, starting at t0, y0, p.
using Sundials
function test1()
yS0 = [1. 2. 3.; 4. 5 6]
N, Ns = size(yS0)
GC.@preserve yS0n = [Sundials.NVector(yS0[:,j]) for j=1:Ns] # array of julia wrappers
GC.@preserve yS0nv = [Sundials.N_Vector(n) for n in yS0n] # array of pointers to sund. structs
pyS0 = pointer(yS0nv)
# HEAD FROM lapack.jl
const liblapack = Base.liblapack_name
import Base.LinAlg: BlasFloat, BlasChar, BlasInt, blas_int, chkstride1, chksquare, Schur
# extract to appear in lapack.jl
# Reorder Schur forms
for (trsen, elty) in
((:dtrsen_,:Float64),
(:strsen_,:Float32))
import numpy as np
t_adopt = .5
p_adopt = .9
p_expl = .1
def timestep(state, influence):
influenced = (np.abs(np.dot(influence,state)) > t_adopt)
r = np.random.rand(np.size(state))
# vectorized: 415us