Skip to content

Instantly share code, notes, and snippets.

@jtravs
jtravs / Zeros.jl
Created April 6, 2013 18:17
Code to find the zero of a real function
module Zeros
export fzero
# the function fzero finds the root of a continuous function within a provided
# interval [a, b], without requiring derivatives.
# It is based on algorithm 4.2 described in:
# 1. G. E. Alefeld, F. A. Potra, and Y. Shi, "Algorithm 748: enclosing zeros of
# continuous functions," ACM Trans. Math. Softw. 21, 327–344 (1995).
@jtravs
jtravs / quint.jl
Created April 4, 2014 18:52
Quintic spline interpolation
type quint{T}
dx::T
x0::T
Y::Array{T,1}
B::Array{T,1}
C::Array{T,1}
D::Array{T,1}
E::Array{T,1}
F::Array{T,1}
function quint(X::Array{T,1})
module testsums
export sum5, sum5b, dosums
function sum5(scale, sa1, a1, sa2, a2, sa3, a3, sa4, a4, sa5, a5, out)
for i=1:length(out)
@inbounds out[i] = scale*(sa1*a1[i] + sa2*a2[i] + sa3*a3[i]
+ sa4*a4[i] + sa5*a5[i])
end
end
@jtravs
jtravs / Vimba.jl
Last active October 17, 2019 08:41
Very sketchy Vimba interface for Julia
module Vimba
export make_get
const vmblib = ENV["VIMBA_HOME"]*"VimbaC\\Bin\\Win64\\VimbaC"
include("VmbCommonTypes.jl")
function __init__()
err = ccall((:VmbStartup, vmblib), stdcall, VmbError_t, ())