Skip to content

Instantly share code, notes, and snippets.

View saschatimme's full-sized avatar
💭

Sascha Timme saschatimme

💭
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saschatimme
saschatimme / Solving a chemical reaction network with HomotopyContinuation.jl.ipynb
Created January 25, 2019 13:37
Solving a chemical reaction network with HomotopyContinuation.jl.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
EditURL = "https://github.com/TRAVIS_REPO_SLUG/blob/master/"

+++

title = "Get started"

description = "Up and running in under five minutes"

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@saschatimme
saschatimme / Manifest.toml
Last active August 12, 2018 12:51
Package load regression
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "277d3807440d9793421354b6680911fc95d91a84"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "1.0.1"
[[Dates]]
@saschatimme
saschatimme / circles_conic.jl
Last active July 4, 2018 09:20
Polynomial system to compute all circles that are tangent to 3 given conics. See https://www.JuliaHomotopyContinuation.org/blog/circles_conics/
x, y, a_1, a_2, r, b_1, b_2, b_3, b_4, b_5, b_6 = [PolyVar{true}(i) for i in ["x", "y", "a_1", "a_2", "r", "b_1", "b_2", "b_3", "b_4", "b_5", "b_6"]];
f = [a_1^8*b_1^2*b_2^4+2*a_1^6*a_2^2*b_1^2*b_2^4+a_1^4*a_2^4*b_1^2*b_2^4-4*a_1^6*r^2*b_1^2*b_2^4-6*a_1^4*a_2^2*r^2*b_1^2*b_2^4-2*a_1^2*a_2^4*r^2*b_1^2*b_2^4+6*a_1^4*r^4*b_1^2*b_2^4+6*a_1^2*a_2^2*r^4*b_1^2*b_2^4+a_2^4*r^4*b_1^2*b_2^4-4*a_1^2*r^6*b_1^2*b_2^4-2*a_2^2*r^6*b_1^2*b_2^4+r^8*b_1^2*b_2^4+2*a_1^7*a_2*b_1*b_2^5+4*a_1^5*a_2^3*b_1*b_2^5+2*a_1^3*a_2^5*b_1*b_2^5-6*a_1^5*a_2*r^2*b_1*b_2^5-8*a_1^3*a_2^3*r^2*b_1*b_2^5-2*a_1*a_2^5*r^2*b_1*b_2^5+6*a_1^3*a_2*r^4*b_1*b_2^5+4*a_1*a_2^3*r^4*b_1*b_2^5-2*a_1*a_2*r^6*b_1*b_2^5+a_1^6*a_2^2*b_2^6+2*a_1^4*a_2^4*b_2^6+a_1^2*a_2^6*b_2^6-a_1^6*r^2*b_2^6-5*a_1^4*a_2^2*r^2*b_2^6-5*a_1^2*a_2^4*r^2*b_2^6-a_2^6*r^2*b_2^6+3*a_1^4*r^4*b_2^6+7*a_1^2*a_2^2*r^4*b_2^6+3*a_2^4*r^4*b_2^6-3*a_1^2*r^6*b_2^6-3*a_2^2*r^6*b_2^6+r^8*b_2^6-8*a_1^8*b_1^3*b_2^2*b_3-16*a_1^6*a_2^2*b_1^3*b_2^2*b_3-8*a_1^4*a_2^4*b_1^3*b_2^2*b_3+32*a_1^6*r^2*b_1^3*b_2^
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Benchmark Report for StaticPolynomials

Job Properties

  • Time of benchmarks:
    • Target: 28 Apr 2018 - 20:27
    • Baseline: 28 Apr 2018 - 20:31
  • Package commits:
    • Target: 35310a
    • Baseline: fe936e
  • Julia commits:

Hey guys,

I worked on a new package for the fast evaluation of sparse (multivariate) polynomials, StaticPolynomials.jl. The key idea is to encode the support of a polynomial in it's type. With a known support we then can use @generated to create high performance functions for the evaluation of the polynomial, the gradient etc. This put's some stress on the compiler but depending on the application the upside can be really nice.

Here is a benchmark report for the current version and to compare the numbers here is a report with the current FixedPolynomials master. The systems references are from a collection of TestSystems I started here. For large systems (like rps10) the complex Jacobian is up to 14 times faster.

The package still needs more document

function ∇tSTE_threaded(X::Array{Float64,2},
no_objects::Int64,
no_dims::Int64,
no_triplets::Int64,
triplets::Array{Int64,2},
λ::Float64,
α::Float64)
use_log = true
P = 0.0::Float64