Skip to content

Instantly share code, notes, and snippets.

@kalmarek
kalmarek / backtrack.jl
Last active Oct 14, 2022
Simple backtracking search over iterators in julia
View backtrack.jl
struct BacktrackSearch{V<:AbstractVector, VI<:AbstractVector, VS<:AbstractVector, O, A}
nodes::V
iterators::VI
states::VS
oracle_descend::O
node_accept::A
end
"""
BacktrackSearch(iterators; oracle_descend, node_accept)
View calc_roots.jl
import Arblib: arb_struct, arf_struct, @libarb, ArbLike
struct arf_interval
lo::arf_struct
hi::arf_struct
# function arf_interval()
# v = new()
# init!(v)
# finalizer(clear!, v)
View Monoids.jl
module Monoids
using KnuthBendix
import KnuthBendix: Alphabet, AbstractWord, LenLex, alphabet
export Alphabet, FreeMonoid, gens
# this should go to KnuthBendix.jl
Base.convert(::Type{Word{I}}, v::AbstractVector{<:Integer}) where I = Word{I}(v)
@kalmarek
kalmarek / order.jl
Last active Mar 21, 2021
Order implementation
View order.jl
struct Order{I} <: Integer
val::I
Order{I}(n::Integer) where I<:Integer = (n > 0 ? new{I}(n) : throw(DomainError(0, "invalid order")))
Order{I}(::Val{Inf}) where I<:Integer = new{I}(0)
end
Order(n::I) where I<:Integer = Order{I}(n)
Order(v::Val{Inf}) = Order{Int}(v)
@kalmarek
kalmarek / W_statistic.jl
Last active Jan 22, 2021
Shapiro-Wilk coefficients, computed exactly (up to `eps(Float64)`) using Arb with 512 bits of precision and itegration radius 32.0
View W_statistic.jl
using Statistics
using Random
using LinearAlgebra
function Wstatistic(X, sw_coeffs)
@boundscheck @assert length(X) == length(sw_coeffs)
@assert issorted(X)
@assert last(X) - first(X) > length(X) * eps(eltype(X)) "Data seems to be constant!"
µ = mean(X)
View gersten_presentation.jl
using Groups
using KnuthBendix
import Groups: ϱ, λ
KnuthBendix.Word(A::Alphabet{T}, v::AbstractVector{T}) where {T} = Word([A[s] for s in v])
invof(A::Alphabet{T}, a::T) where {T} = A[-A[a]]
comm(A::Alphabet, x::S, y::S) where {S<:Groups.GSymbol} =
Word([A[x], A[y], A[invof(A, x)], A[invof(A, y)]])
View kacmoody.jl
# using Pkg
# Pkg.activate(joinpath(@__DIR__, ".."))
using PropertyT
using PropertyT.GroupRings
using PropertyT.Groups
using PropertyT.AbstractAlgebra
using PropertyT.JuMP
using PropertyT.IntervalArithmetic
@kalmarek
kalmarek / build.log
Created Jan 16, 2020
GAP.jl build.log
View build.log
Already on 'stable-4.11'
Your branch is up to date with 'origin/stable-4.11'.
From https://github.com/gap-system/gap
* branch stable-4.11 -> FETCH_HEAD
Already up to date.
+ autoconf -Wall -f
+ autoheader -Wall -f
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for gcc... gcc
@kalmarek
kalmarek / build_scs_for_julia.sh
Last active Oct 15, 2021
custom build of scs (SCS.jl)
View build_scs_for_julia.sh
#!/bin/bash
JULIA_HOME="/opt/julias/julia-1.6"
JULIA_LD_PATH="$JULIA_HOME/lib/julia"
BLASLDFLAGS="-L$JULIA_LD_PATH -lopenblas64_"
SCSFLAGS="USE_OPENMP=1 BLAS64=1 BLASSUFFIX=_64_"
make purge
make -j4 CFLAGS="-march=native" DLONG=1 ${SCSFLAGS} BLASLDFLAGS="${BLASLDFLAGS}" direct
make -j4 CFLAGS="-march=native" DLONG=1 ${SCSFLAGS} BLASLDFLAGS="${BLASLDFLAGS}" indirect
@kalmarek
kalmarek / Positivity of Adj_n + kOp_n in ISL(n,Z).ipynb
Created Jul 4, 2019
Positivity of Adj_n + kOp_n in ISL(n,Z)
View Positivity of Adj_n + kOp_n in ISL(n,Z).ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.