Skip to content

Instantly share code, notes, and snippets.

View bnaul's full-sized avatar

Brett Naul bnaul

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import numpy as np
class Point:
def __init__(self,x,y):
self.x = x
self.y = y
def __repr__(self):
return "Point({}, {})".format(self.x, self.y)
y = [0.1 0.2 0.1 0.2 0.5 0.4 0.6 0.7 0.8]';
p = length(y);
a = 0.2; b = 0.6;
A = tril(toeplitz([-1 1 zeros(1,p-2)]));
cvx_begin
variable x(p, 1)
minimize norm(x - y)
subject to
A * x <= 0
x(1) >= a