Skip to content

Instantly share code, notes, and snippets.

View ZacCranko's full-sized avatar

Zac Cranko ZacCranko

  • Sydney, Australia
View GitHub Profile
@ZacCranko
ZacCranko / preamble.tex
Last active February 27, 2016 00:32
LaTeX Preamble
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{notes}
\RequirePackage{xparse, etoolbox}
\DeclareOption{maketitle}{\AtBeginDocument{\maketitle}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
\author{Zac Cranko} % default author
@ZacCranko
ZacCranko / .juliarc.jl
Last active August 9, 2016 23:59
Current juliarc.jl
push!(LOAD_PATH, pwd())
# Run _init.jl at runtime if it exists
if VERSION < v"0.4-"
if isinteractive() && isfile("_init.jl")
info("Found ", joinpath(pwd(),"_init.jl"))
include(joinpath(pwd(),"_init.jl"))
end
else
atreplinit() do repl
diff --git a/Makefile b/Makefile
index c995628..8c4cd92 100644
--- a/Makefile
+++ b/Makefile
@@ -240,9 +240,10 @@ endif
ifeq ($(USE_SYSTEM_ARPACK),0)
JL_PRIVATE_LIBS += arpack
endif
-ifeq ($(USE_SYSTEM_SUITESPARSE),0)
+# Always install these, since Homebrew's suite-sparse is all static libraries
diff --git a/deps/Makefile b/deps/Makefile
index 16d503b..4a8a807 100644
--- a/deps/Makefile
+++ b/deps/Makefile
@@ -654,7 +654,7 @@ distclean-suitesparse: clean-suitesparse
# SUITESPARSE WRAPPER
ifeq ($(USE_SYSTEM_SUITESPARSE), 1)
-SUITESPARSE_INC = -I /usr/include/suitesparse
+SUITESPARSE_INC = -I $(brew --prefix)/include
SUITESPARSE_LIB = -lumfpack -lcholmod -lamd -lcamd -lcolamd -lspqr
function DiGraph{T<:Real}(adjmx::AbstractMatrix{T})
isequal(size(adjmx)...) || error("Adjacency / distance matrices must be square")
g = DiGraph(size(adjmx,1))
for (s,d) in zip(findn(adjmx)...)
add_edge!(g,s,d)
end
return g
end
julia> Pkg.status()
9 required packages:
- Cairo 0.2.27
- Debug 0.1.3
- Devectorize 0.4.1
- Distributions 0.7.3
- Gadfly 0.3.12
- IJulia 0.2.5
- LightGraphs 0.1.14
- Reel 0.1.0
using ForwardDiff
norm2(x::Vector) = dot(x,x) # define square norm function
function linesearch(z,
p,
grad,
B,
Δ,
c1::Real=1e-4,