Skip to content

Instantly share code, notes, and snippets.

View kalmarek's full-sized avatar

Marek Kaluba kalmarek

View GitHub Profile
@kalmarek
kalmarek / direct.log
Created March 4, 2017 19:06
SCS logs
----------------------------------------------------------------------------
SCS v1.2.6 - Splitting Conic Solver
(c) Brendan O'Donoghue, Stanford University, 2012-2016
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 375437
eps = 1.00e-06, alpha = 1.80, max_iters = 20000, normalize = 1, scale = 5.00
Variables n = 93962, constraints m = 263096
Cones: primal zero / dual free vars: 75173
linear vars: 1
sd vars: 187922, sd blks: 2
@kalmarek
kalmarek / bench.jl
Created May 14, 2017 18:19
Benchmarking code for ^(p::perm, n::Int)
using Nemo
function power_by_cycles(a::perm, n::Int)
if n <0
return inv(a)^-n
elseif n == 0
return parent(a)()
elseif n == 1
return deepcopy(a)
elseif n == 2
@kalmarek
kalmarek / DirectProductGroups.jl
Last active May 14, 2017 20:34
Direct Product of Groups
module DirectProduct
using Nemo
import Base: show, ==, hash
import Base: ×, *, inv
import Nemo: parent, parent_type, elem_type
import Nemo: elements, order, Group, GroupElem, Ring
@kalmarek
kalmarek / perm_powers.jl
Last active May 22, 2017 06:03
Powering Perms
using Nemo
function power_by_cycles(a::Nemo.perm, n::Int)
if n <0
return inv(a)^-n
elseif n == 0
return parent(a)()
elseif n == 1
return deepcopy(a)
elseif n == 2
using Nemo
using BenchmarkTools
function perm_sample(N=1000, samplesize=10000, seed=1234)
sample = Nemo.Generic.perm[]
srand(seed)
for i in 1:samplesize
push!(sample, rand(PermutationGroup(N)))
end
return sample
----------------------------------------------------------------------------
SCS v2.0.2 - Splitting Conic Solver
(c) Brendan O'Donoghue, Stanford University, 2012-2017
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 7232838
eps = 1.00e-14, alpha = 1.50, max_iters = 20000, normalize = 1, scale = 1.00
acceleration_lookback = 20, rho_x = 1.00e-03
Variables n = 13233, constraints m = 20463
Cones: primal zero / dual free vars: 13621
linear vars: 2
@kalmarek
kalmarek / SCS.log
Created December 19, 2017 14:30
acceleration_lookback in 1:20
----------------------------------------------------------------------------
SCS v2.0.2 - Splitting Conic Solver
(c) Brendan O'Donoghue, Stanford University, 2012-2017
----------------------------------------------------------------------------
Lin-sys: sparse-direct, nnz in A = 7232838
eps = 1.00e-05, alpha = 1.50, max_iters = 5000, normalize = 1, scale = 1.00
acceleration_lookback = 1, rho_x = 1.00e-03
Variables n = 13233, constraints m = 20463
Cones: primal zero / dual free vars: 13621
linear vars: 2
@kalmarek
kalmarek / normordstats.jl
Last active January 25, 2018 17:27
Order Statistics of Normal distribution
module OrderStatistics
using StatsFuns
using Memoize
using IntervalArithmetic.Interval
import IntervalArithmetic.interval_from_midpoint_radius
import QuadGK.quadgk
export NormOrderStatistic, moment, expectation, expectationproduct
@kalmarek
kalmarek / acb_integrate.jl
Created February 8, 2018 17:59
tests for acb_calc_integrate
using Nemo
using Base.Test
const PREC = 200
const FF = AcbField(PREC)
const acb_struct = Nemo.acb_struct
import Base.*
function *(x::acb_struct, d::S, prec::Int=PREC) where S<:Int
doc"""
elements!(G::PermGroup)
> Return an unsafe iterator over all permutations in `G`. Only one permutation
> is allocated and then modified in-place using the non-recursive
> [Heaps algorithm](https://en.wikipedia.org/wiki/Heap's_algorithm).
>
> Note: you need to explicitely copy permutations intended to be stored or
> modified.
# Examples: