Skip to content

Instantly share code, notes, and snippets.

View bstellato's full-sized avatar

Bartolomeo Stellato bstellato

View GitHub Profile
@bstellato
bstellato / installIPOPTjl.log
Created February 28, 2016 11:31
Segmentation Fault Backtrace from BinDeps.debug("Ipopt") in Julia
(lldb) bt
* thread #1: tid = 0x2993f, 0x00000003114b7e25, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3114b7e25)
* frame #0: 0x00000003114b7e25
frame #1: 0x00007fff9734762f libsystem_pthread.dylib`_pthread_fork_prepare + 85
frame #2: 0x00007fff9db2ca74 libSystem.B.dylib`libSystem_atfork_prepare + 24
frame #3: 0x00007fff927f7f9c libsystem_c.dylib`fork + 12
frame #4: 0x000000010016e9c7 libjulia-debug.dylib`uv_spawn + 455
frame #5: 0x000000010013b3e3 libjulia-debug.dylib`jl_spawn(name="/Users/sidereus/.julia/v0.4/Homebrew/deps/usr/bin/brew", argv=0x0000000109a9de00, loop=0x0000000100c3eca0, proc=0x0000000101734840, julia_struct=0x000000010a3bd810, stdin_type=UV_STREAM, stdin_pipe=0x0000000000000000, stdout_type=UV_STREAM, stdout_pipe=0x0000000101736620, stderr_type=UV_STREAM, stderr_pipe=0x0000000101108f40, detach=0, env=0x0000000000000000, cwd=0x0000000000000000, cb=(sys-debug.dylib`jlcapi_uv_return_spawn_19196)) + 403 at jl_uv.c:240
frame #6: 0x000
#!/bin/bash
# arXiv uses an outdated TexLive distribution. This script is used to package
# all neccesary files so my paper can be compiled on arXiv...
# path to the texlive distribution
TEXLIVE=/usr/local/texlive/2015
# prepare the diretory for my submission
rm arxiv_package.zip
@bstellato
bstellato / paper.mplstyle
Created May 15, 2017 10:01
Matplotlib paper stylesheet
# Matplotlib paper stylesheet to be integrated with LaTeX
# To put in .matplotlib/stylelib/paper.mplstyle
pgf.texsystem: pdflatex
text.usetex: True
font.family: "serif"
font.serif: []
font.sans-serif: []
font.monospace: []
@bstellato
bstellato / mpl_latex.py
Created May 15, 2017 10:10
Matplotlib python helper function to generate latex plots
import matplotlib as mpl
mpl.use('pgf') # Export pgf figures
import matplotlib.pylab as plt
# Text width in pt
# -> Get this from LaTeX using \the\textwidth
text_width = 469.75
@bstellato
bstellato / parallel_map.py
Last active August 30, 2017 10:39
Simple parallel map in python
'''
Script to run function f in parallel taking multiple arguments
'''
from multiprocessing import Pool, cpu_count
import numpy as np
from itertools import repeat
import time
@bstellato
bstellato / osqp_cla.md
Last active January 23, 2018 18:13
OSQP Contributor License Agreement

OSQP Contributor License Agreement

Adapted from https://www.apache.org/licenses/icla.pdf

Thank you for your interest in the OSQP project ("OSQP").

In order to clarify the intellectual property license granted with Contributions from any person or entity, OSQP must have a Contributor License Agreement ("CLA") on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for

@bstellato
bstellato / test_cvxpy_params.py
Created February 6, 2019 19:43
Test CVXPY speed with and without parameters
from __future__ import print_function
import time
import random
import cvxpy as cvx
import numpy as np
solver = "ECOS"
for N in [8, 800, 8000]:
N = 8
FUNCTION: with_compile Used 100 times with solver ECOS
Solver time
MEDIAN 0.000491588
MEAN 0.000584584825
STDEV 0.00025277084914314066
CVXPY time
MEDIAN 0.03191720293206787
MEAN 0.03357378209356384
STDEV 0.005317177566723467
N = 8
FUNCTION: with_compile Used 100 times with solver ECOS
Solver time
MEDIAN 0.000482311
MEAN 0.000531244488888889
STDEV 0.0001849527009135786
CVXPY time
MEDIAN 0.03360658268151855
MEAN 0.041804371728830295
STDEV 0.02494174225767466
@bstellato
bstellato / mosek_error_pr664.txt
Created February 7, 2019 21:06
Mosek error in CVXPY PR 664
ERROR: Test grad for partial minimization/maximization problems.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/sidereus/Dropbox/research/code/projects/cvxpy/cvxpy/tests/test_grad.py", line 692, in test_partial_problem
fix_prob.solve()
File "/Users/sidereus/Dropbox/research/code/projects/cvxpy/cvxpy/problems/problem.py", line 271, in solve
return solve_func(self, *args, **kwargs)
File "/Users/sidereus/Dropbox/research/code/projects/cvxpy/cvxpy/problems/problem.py", line 511, in _solve
self.unpack_results(solution, full_chain, inverse_data)
File "/Users/sidereus/Dropbox/research/code/projects/cvxpy/cvxpy/problems/problem.py", line 650, in unpack_results