Skip to content

Instantly share code, notes, and snippets.

Eric Hanson ericphanson

Block or report user

Report or block ericphanson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ericphanson
ericphanson / convert_tests.jl
Created Sep 9, 2019
Convex.jl ProblemDepot test conversion
View convert_tests.jl
function convert_test(file, prefix)
# handle start and end:
# delete @testset for... and final "end"
file_contents = read(file, String)
file_contents = replace(file_contents, r"\h*@testset.*for\ssolver.*\n" => "")
file_contents = lstrip(file_contents)
file_contents = file_contents[1:prevind(file_contents, first(findlast("end", file_contents)))]
file_contents = replace(file_contents, r"\n\h\h\h\h(.*)" => SubstitutionString("\n\\1"))
# handle special cases
@ericphanson
ericphanson / diff_eigmin.md
Created Aug 3, 2019
Various attempts to differentiate through `eigmin` in Julia
View diff_eigmin.md

Attempts to differentiate eigmin

Julia 1.1, with Zygote master

Version information:

julia> Pkg.status()
    Status `~/Dropbox (Personal)/Research/Code/julia-projects/DiffEvals/ZygoteMaster/Project.toml`
  [ec485272] ArnoldiMethod v0.0.4
  [14197337] GenericLinearAlgebra v0.1.0
@ericphanson
ericphanson / simdiag.jl
Last active Jan 19, 2019
Simultaneous diagonalization for complex commuting normal matrices
View simdiag.jl
# Adapted from
# https://uk.mathworks.com/matlabcentral/fileexchange/46794-simdiag-m
# which has the following license:
# Copyright (c) 2009, Christian B. Mendl
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
You can’t perform that action at this time.