Skip to content

Instantly share code, notes, and snippets.

View angeris's full-sized avatar
😄

guille angeris

😄
View GitHub Profile
@angeris
angeris / complete_m1_output.txt
Created November 18, 2020 03:21
Complete output for Julia tests
julia> Base.runtests()
Test (Worker) | Time (s) | GC (s) | GC % | Alloc (MB) | RSS (MB)
LinearAlgebra/dense (4) | started at 2020-11-17T18:30:04.806
LinearAlgebra/qr (3) | started at 2020-11-17T18:30:04.86
LinearAlgebra/triangular (2) | started at 2020-11-17T18:30:04.861
LinearAlgebra/matmul (5) | started at 2020-11-17T18:30:04.861
LinearAlgebra/qr (3) | 62.22 | 2.61 | 4.2 | 14365.25 | 2541.80
LinearAlgebra/schur (3) | started at 2020-11-17T18:31:07.722
LinearAlgebra/schur (3) | 13.64 | 0.44 | 3.2 | 1945.10 | 2735.72
LinearAlgebra/special (3) | started at 2020-11-17T18:31:21.399
@angeris
angeris / gist:f1263dde142f85b0270de71428cfbef8
Created November 18, 2020 03:16
Results for Julia tests on Apple M1 with Rosetta 2
Test Summary: | Pass Fail Broken Total
Overall | 38547375 1 352559 38899935
LinearAlgebra/qr | 4526 4526
LinearAlgebra/schur | 430 430
LinearAlgebra/dense | 7876 7876
LinearAlgebra/eigen | 410 410
LinearAlgebra/matmul | 969 969
LinearAlgebra/special | 3159 3159
LinearAlgebra/bunchkaufman | 5285 5285
LinearAlgebra/lapack | 800 800
import numpy as np
import cvxpy as cp
import matplotlib.pyplot as plt
# The idea is that we have two circles, in opposite corners
# that need to move past each other during optimization (in order to minimize
# some simple objective function). The important thing to guarantee
# is that they do not intersect at any point during any iteration.
# Initial/desired positions of circles, radius = 1/4.

Keybase proof

I hereby claim:

  • I am angeris on github.
  • I am angeris (https://keybase.io/angeris) on keybase.
  • I have a public key ASDT_GHDJohjVhunI0yCpEHqZH_yvzT0KEkNhjkOXA1-LQo

To claim this, I am signing this object:

@angeris
angeris / test_diffcpsdp_example.jl
Created April 21, 2019 00:35
Naïve translation of `cvxpy/tests/test_benchmarks.py` to JuMP.
using JuMP
using LinearAlgebra
using BenchmarkTools
using ProgressMeter
import Random
import SCS
Random.seed!(1234)
function randn_symm(n)
@angeris
angeris / jump-v.19-sample.jl
Last active April 18, 2019 20:06
MWE for reproducing large performance decrease for JuMP v0.19
using JuMP
using LinearAlgebra
using SparseArrays
# Formulates ‖x‖² ≤ y as an SOC
function quad_cons(m, x, y)
@constraint(m, sum(x.^2) ≤ y )
end
const t_min = 1
@angeris
angeris / jump-v.18-sample.jl
Last active April 18, 2019 18:50
MWE for reproducing large performance decrease for JuMP v0.18.5
using JuMP
using ProgressMeter
using LinearAlgebra
using SparseArrays
import Gurobi
# Formulates ‖x‖² ≤ y as an SOC
function quad_cons(m, x, y)
@constraint(m, sum(x.^2) ≤ y )
end
@angeris
angeris / learn_sum.py
Created May 28, 2018 05:35
Learns the sum of two numbers. In response to an hn comment.
import numpy as np
X = np.array([
[1, 4],
[20, 35],
[8, 15]
])
y = np.array([3, 15, 7])
opt_theta = np.linalg.lstsq(X, y)
@angeris
angeris / domino_counter_example.txt
Last active July 13, 2018 13:32
Greedy Counterexample for Dominos
Initial positions
Player A:
[0-5] [1-3] [1-4] [2-2] [3-4] [4-4] [5-6]
Player B:
[0-0] [0-1] [0-6] [1-1] [1-6] [2-3] [2-6]
Player C:
[0-2] [2-4] [2-5] [3-3] [3-6] [4-5] [4-6]
Player D:
[0-3] [0-4] [1-2] [1-5] [3-5] [5-5] [6-6]
@angeris
angeris / union_find.py
Last active August 31, 2016 16:54
A simple (but complete) union-find structure in Python.
# Author: Guillermo Angeris (@guillean)
# Simple UnionFind based on https://www.cs.princeton.edu/~rs/AlgsDS07/01UnionFind.pdf
class UnionFind:
def __init__(self):
self.rank = {}
self.parent = {}
def add(self, elem):
self.rank[elem] = 1