Use homebrew to install postgres:
$ brew install postgresql
If this is your first time installing Postgres with Homebrew, you'll need to create a database with:
Acquire the tarball which contains the PKGBUILD and possibly other required files, like systemd units and patches (but often not the actual code).
Extract the tarball (preferably in a directory set aside just for builds from the AUR) with
$ tar -xvf pkgname.tar.gz
import numpy as np | |
from numpy.linalg import norm | |
from ipsolver import equality_constrained_sqp | |
def fun(x): | |
return 2*(x[0]**2 + x[1]**2 - 1) - x[0] | |
def grad(x): | |
return np.array([4*x[0]-1, 4*x[1]]) |
# Example | |
from __future__ import division, print_function, absolute_import | |
import numpy as np | |
from scipy.optimize import minimize_constrained, NonlinearConstraint, BoxConstraint | |
# Define objective function and derivatives | |
fun = lambda x: 1/2*(x[0] - 2)**2 + 1/2*(x[1] - 1/2)**2 | |
grad = lambda x: np.array([x[0] - 2, x[1] - 1/2]) | |
hess = lambda x: np.eye(2) | |
# Define nonlinear constraint |