From ffff6a11e1d5be7c16a26e064a24f30fee3b5dc9 Mon Sep 17 00:00:00 2001 From: Wai-Shing Luk Date: Mon, 12 Feb 2024 14:23:59 +0800 Subject: [PATCH] apply black --- docs/conf.py | 4 +- experiments/corr_fn.py | 23 +- experiments/corr_fn_cvx.py | 21 +- experiments/exp2d.py | 21 +- src/ellpy/cutting_plane.py | 15 +- src/ellpy/oracles/chol_ext.py | 23 +- src/ellpy/oracles/corr_bspline_oracle.py | 7 +- src/ellpy/oracles/corr_oracle.py | 4 +- src/ellpy/oracles/csdlowpass_oracle.py | 1 + src/ellpy/oracles/cycle_ratio_oracle.py | 21 +- src/ellpy/oracles/gmi_oracle.py | 2 + src/ellpy/oracles/lmi0_oracle.py | 6 +- src/ellpy/oracles/lmi_old_oracle.py | 7 +- src/ellpy/oracles/lmi_oracle.py | 10 +- src/ellpy/oracles/lowpass_oracle.py | 5 +- src/ellpy/oracles/lsq_corr_oracle.py | 5 +- src/ellpy/oracles/mle_corr_oracle.py | 4 +- src/ellpy/oracles/network_oracle.py | 8 +- src/ellpy/oracles/optscaling_oracle.py | 19 +- src/ellpy/oracles/profit_oracle.py | 22 +- src/ellpy/oracles/qmi_oracle.py | 9 +- src/ellpy/oracles/setup.py | 6 +- src/ellpy/oracles/spectral_fact.py | 22 +- src/ellpy/problem.py | 24 +- src/pycsd/__init__.py | 1 + src/pycsd/csd/csd.py | 4 +- src/pycsd/dev/csd_numbers.py | 25 +- src/pycsd/run_tests.py | 2 +- src/pycsd/test/test_csd_decimals.py | 42 +- src/pycsd/test/test_csd_integers.py | 14 +- src/pycsd/test/test_to_and_fro_10bits.py | 2738 +++++++++++----------- tests/test_chol.py | 59 +- tests/test_corr_fn.py | 23 +- tests/test_csd.py | 12 +- tests/test_cycle_ratio.py | 48 +- tests/test_example1.py | 33 +- tests/test_example2.py | 18 +- tests/test_firfilter.py | 18 +- tests/test_lmi.py | 33 +- tests/test_lowpass.py | 16 +- tests/test_optscaling.py | 14 +- tests/test_profit.py | 20 +- tests/test_quasicvx.py | 35 +- tests/test_quasicvx2.py | 41 +- 44 files changed, 1752 insertions(+), 1733 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index dabfe16..099de32 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -169,7 +169,7 @@ def setup(app): # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'alabaster' -html_theme = 'sphinx_rtd_theme' +html_theme = "sphinx_rtd_theme" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -301,4 +301,4 @@ def setup(app): "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None), "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), "pyscaffold": ("https://pyscaffold.org/en/stable", None), -} \ No newline at end of file +} diff --git a/experiments/corr_fn.py b/experiments/corr_fn.py index 9baa7f5..ffc3e8d 100755 --- a/experiments/corr_fn.py +++ b/experiments/corr_fn.py @@ -10,7 +10,7 @@ corr_bspline, corr_poly, create_2d_isotropic, - create_2d_sites + create_2d_sites, ) from ellpy.oracles.lsq_corr_oracle import lsq_oracle from ellpy.oracles.mle_corr_oracle import mle_oracle @@ -29,15 +29,15 @@ def lsq_corr_core2(Y: Arr, n: int, P: Callable): Returns: [type]: [description] """ - normY = np.linalg.norm(Y, 'fro') + normY = np.linalg.norm(Y, "fro") normY2 = 32 * normY * normY val = 256 * np.ones(n + 1) val[-1] = normY2 * normY2 x = np.zeros(n + 1) # cannot all zeros - x[0] = 1. + x[0] = 1.0 x[-1] = normY2 / 2 E = ell(val, x) - xb, _, ell_info = cutting_plane_dc(P, E, float('inf')) + xb, _, ell_info = cutting_plane_dc(P, E, float("inf")) return xb[:-1], ell_info.num_iters, ell_info.feasible @@ -67,13 +67,13 @@ def mle_corr_core(Y: Arr, n: int, P: Callable): [type]: [description] """ x = np.zeros(n) - x[0] = 1. - E = ell(50., x) + x[0] = 1.0 + E = ell(50.0, x) # E.use_parallel_cut = False # options = Options() # options.max_it = 2000 # options.tol = 1e-8 - xb, _, ell_info = cutting_plane_dc(P, E, float('inf')) + xb, _, ell_info = cutting_plane_dc(P, E, float("inf")) # print(num_iters, feasible, status) return xb, ell_info.num_iters, ell_info.feasible @@ -124,10 +124,11 @@ def lsq_corr_bspline2(Y, s, m): if __name__ == "__main__": import matplotlib.pyplot as plt + # import matplotlib.pylab as lab s = create_2d_sites(10, 8) Y = create_2d_isotropic(s, 1000) - print('start ell...') + print("start ell...") spl, num_iters, _ = lsq_corr_bspline2(Y, s, 5) pol, num_iters, _ = lsq_corr_poly2(Y, s, 5) # pol, num_iters, _ = mle_corr_poly(Y, s, 4) @@ -141,9 +142,9 @@ def lsq_corr_bspline2(Y, s, m): # h = s[-1] - s[0] d = np.sqrt(10**2 + 8**2) xs = np.linspace(0, d, 100) - plt.plot(xs, spl(xs), 'g', label='BSpline') + plt.plot(xs, spl(xs), "g", label="BSpline") # plt.plot(xs, splcvx(xs), 'b', label='BSpline CVX') - plt.plot(xs, np.polyval(pol, xs), 'r', label='Polynomial') + plt.plot(xs, np.polyval(pol, xs), "r", label="Polynomial") # plt.plot(xs, np.polyval(polcvx, xs), 'r', label='Polynomial CVX') - plt.legend(loc='best') + plt.legend(loc="best") plt.show() diff --git a/experiments/corr_fn_cvx.py b/experiments/corr_fn_cvx.py index b5bccd9..48be356 100644 --- a/experiments/corr_fn_cvx.py +++ b/experiments/corr_fn_cvx.py @@ -8,7 +8,7 @@ from ellpy.oracles.corr_oracle import ( construct_distance_matrix, create_2d_isotropic, - create_2d_sites + create_2d_sites, ) Arr = Union[np.ndarray] @@ -41,11 +41,11 @@ def lsq_corr_poly(Y: Arr, s: Arr, n: int): D = np.multiply(D, D1) Sig += D * a[n - 2 - i] constraints = [Sig >> 0] - prob = cvx.Problem(cvx.Minimize(cvx.norm(Sig - Y, 'fro')), constraints) + prob = cvx.Problem(cvx.Minimize(cvx.norm(Sig - Y, "fro")), constraints) prob.solve(solver=cvx.CVXOPT) # prob.solve() if prob.status != cvx.OPTIMAL: - raise Exception('CVXPY Error') + raise Exception("CVXPY Error") return np.poly1d(np.array(a.value).flatten()) @@ -90,18 +90,19 @@ def lsq_corr_bspline(Y: Arr, s: Arr, n: int): constraints = [Sig >> 0] for i in range(n - 1): constraints += [c[i] >= c[i + 1]] - constraints += [c[-1] >= 0.] + constraints += [c[-1] >= 0.0] - prob = cvx.Problem(cvx.Minimize(cvx.norm(Sig - Y, 'fro')), constraints) + prob = cvx.Problem(cvx.Minimize(cvx.norm(Sig - Y, "fro")), constraints) prob.solve(solver=cvx.CVXOPT) # prob.solve() if prob.status != cvx.OPTIMAL: - raise Exception('CVXPY Error') + raise Exception("CVXPY Error") return BSpline(t, np.array(c.value).flatten(), k) if __name__ == "__main__": import matplotlib.pyplot as plt + # import matplotlib.pylab as lab s = create_2d_sites(10, 8) Y = create_2d_isotropic(s, 1000) @@ -111,7 +112,7 @@ def lsq_corr_bspline(Y: Arr, s: Arr, n: int): # # pol, num_iters, _ = mle_corr_poly(Y, s, 4) # print(pol) # print(num_iters) - print('start cvx...') + print("start cvx...") splcvx = lsq_corr_bspline(Y, s, 5) polcvx = lsq_corr_poly(Y, s, 5) @@ -119,8 +120,8 @@ def lsq_corr_bspline(Y: Arr, s: Arr, n: int): d = np.sqrt(10**2 + 8**2) xs = np.linspace(0, d, 100) # plt.plot(xs, spl(xs), 'g', label='BSpline') - plt.plot(xs, splcvx(xs), 'b', label='BSpline CVX') + plt.plot(xs, splcvx(xs), "b", label="BSpline CVX") # plt.plot(xs, np.polyval(pol, xs), 'r', label='Polynomial') - plt.plot(xs, np.polyval(polcvx, xs), 'r', label='Polynomial CVX') - plt.legend(loc='best') + plt.plot(xs, np.polyval(polcvx, xs), "r", label="Polynomial CVX") + plt.legend(loc="best") plt.show() diff --git a/experiments/exp2d.py b/experiments/exp2d.py index ece3d53..e1422ab 100644 --- a/experiments/exp2d.py +++ b/experiments/exp2d.py @@ -2,6 +2,7 @@ from __future__ import print_function import matplotlib.pylab as lab + # from pprint import pprint import matplotlib.pyplot as plt import numpy as np @@ -11,13 +12,13 @@ # from corr_fn import lsq_corr_poly, lsq_corr_bspline # a fake dataset to make the bumps with -nx = 80 # number of points +nx = 80 # number of points ny = 64 -n = nx*ny -s_end = [10., 8.] +n = nx * ny +s_end = [10.0, 8.0] sdkern = 0.25 # width of kernel -var = 2. # standard derivation -tau = 0.00001 # standard derivation of white noise +var = 2.0 # standard derivation +tau = 0.00001 # standard derivation of white noise N = 4 # number of samples # create sites s @@ -39,19 +40,19 @@ # ym = np.random.randn(n) for k in range(N): x = var * np.random.randn(n) - y = A @ x + tau*np.random.randn(n) + y = A @ x + tau * np.random.randn(n) Ys[:, k] = y Y = np.cov(Ys, bias=True) plt.subplot(2, 2, 1) -lab.contourf(xx, yy, np.reshape(Ys[:, 0], (ny, nx)), cmap='Greens') +lab.contourf(xx, yy, np.reshape(Ys[:, 0], (ny, nx)), cmap="Greens") plt.subplot(2, 2, 2) -lab.contourf(xx, yy, np.reshape(Ys[:, 1], (ny, nx)), cmap='Greens') +lab.contourf(xx, yy, np.reshape(Ys[:, 1], (ny, nx)), cmap="Greens") plt.subplot(2, 2, 3) -lab.contourf(xx, yy, np.reshape(Ys[:, 2], (ny, nx)), cmap='Greens') +lab.contourf(xx, yy, np.reshape(Ys[:, 2], (ny, nx)), cmap="Greens") plt.subplot(2, 2, 4) -lab.contourf(xx, yy, np.reshape(Ys[:, 3], (ny, nx)), cmap='Greens') +lab.contourf(xx, yy, np.reshape(Ys[:, 3], (ny, nx)), cmap="Greens") plt.show() diff --git a/src/ellpy/cutting_plane.py b/src/ellpy/cutting_plane.py index 442c5cc..4661ba4 100644 --- a/src/ellpy/cutting_plane.py +++ b/src/ellpy/cutting_plane.py @@ -29,8 +29,7 @@ def __init__(self, feasible: bool, num_iters: int, status: CUTStatus): self.status: CUTStatus = status -def cutting_plane_feas(Omega: Callable[[Any], Any], S, - options=Options()) -> CInfo: +def cutting_plane_feas(Omega: Callable[[Any], Any], S, options=Options()) -> CInfo: """Find a point in a convex set (defined through a cutting-plane oracle). Description: @@ -75,8 +74,9 @@ def cutting_plane_feas(Omega: Callable[[Any], Any], S, return CInfo(feasible, niter + 1, status) -def cutting_plane_dc(Omega: Callable[[Any, Any], Any], S, t, - options=Options()) -> Tuple[Any, Any, CInfo]: +def cutting_plane_dc( + Omega: Callable[[Any, Any], Any], S, t, options=Options() +) -> Tuple[Any, Any, CInfo]: """Cutting-plane method for solving convex optimization problem Arguments: @@ -134,7 +134,7 @@ def cutting_plane_q(Omega, S, t, options=Options()): status = CUTStatus.nosoln for niter in range(options.max_it): - retry = (status == CUTStatus.noeffect) + retry = status == CUTStatus.noeffect cut, x0, t1, more_alt = Omega(S.xc, t, retry) if t1 is not None: # better t obtained t = t1 @@ -153,8 +153,9 @@ def cutting_plane_q(Omega, S, t, options=Options()): return x_best, t, ret -def bsearch(Omega: Callable[[Any], bool], Interval: Tuple, - options=Options()) -> Tuple[Any, CInfo]: +def bsearch( + Omega: Callable[[Any], bool], Interval: Tuple, options=Options() +) -> Tuple[Any, CInfo]: """[summary] Arguments: diff --git a/src/ellpy/oracles/chol_ext.py b/src/ellpy/oracles/chol_ext.py index 30f4002..476b112 100644 --- a/src/ellpy/oracles/chol_ext.py +++ b/src/ellpy/oracles/chol_ext.py @@ -10,15 +10,16 @@ class chol_ext: """LDLT factorization (mainly for LMI oracles) - - LDL^T square-root-free version - - Option allow semidefinite - - Cholesky–Banachiewicz style, row-based - - Lazy evaluation - - A matrix A in R^{m x m} is positive definite - iff v' A v > 0 for all v in R^n. - - O(p^3) per iteration, independent of N + - LDL^T square-root-free version + - Option allow semidefinite + - Cholesky–Banachiewicz style, row-based + - Lazy evaluation + - A matrix A in R^{m x m} is positive definite + iff v' A v > 0 for all v in R^n. + - O(p^3) per iteration, independent of N """ - __slots__ = ('p', 'v', '_n', '_T', 'allow_semidefinite') + + __slots__ = ("p", "v", "_n", "_T", "allow_semidefinite") def __init__(self, N: int): """Construct a new chol ext object @@ -65,9 +66,9 @@ def factor(self, getA: Callable[[int, int], float]) -> bool: s = j + 1 d = getA(i, s) - (self._T[i, start:s] @ self._T[start:s, s]) self._T[i, i] = d - if d > 0.: + if d > 0.0: continue - if d < 0. or not self.allow_semidefinite: + if d < 0.0 or not self.allow_semidefinite: self.p = start, i + 1 break start = i + 1 # T[i, i] == 0 (very unlikely), restart at i+1 @@ -98,7 +99,7 @@ def witness(self): raise AssertionError() start, n = self.p m = n - 1 - self.v[m] = 1. + self.v[m] = 1.0 for i in range(m, start, -1): self.v[i - 1] = -(self._T[i:n, i - 1] @ self.v[i:n]) return -self._T[m, m] diff --git a/src/ellpy/oracles/corr_bspline_oracle.py b/src/ellpy/oracles/corr_bspline_oracle.py index b1f6688..7572c6e 100644 --- a/src/ellpy/oracles/corr_bspline_oracle.py +++ b/src/ellpy/oracles/corr_bspline_oracle.py @@ -25,8 +25,8 @@ def mono_oracle(x): for i in range(n - 1): fj = x[i + 1] - x[i] if fj > 0: - g[i] = -1. - g[i + 1] = 1. + g[i] = -1.0 + g[i + 1] = 1.0 return g, fj @@ -36,6 +36,7 @@ class mono_decreasing_oracle2: Returns: [type]: [description] """ + def __init__(self, basis): """[summary] @@ -61,7 +62,7 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: if cut: g1, fj = cut g[:-1] = g1 - g[-1] = 0. + g[-1] = 0.0 return (g, fj), None return self.basis(x, t) diff --git a/src/ellpy/oracles/corr_oracle.py b/src/ellpy/oracles/corr_oracle.py index 1a7e04b..d257240 100644 --- a/src/ellpy/oracles/corr_oracle.py +++ b/src/ellpy/oracles/corr_oracle.py @@ -19,7 +19,7 @@ def create_2d_sites(nx=10, ny=8) -> Arr: Arr: location of sites """ n = nx * ny - s_end = np.array([10., 8.]) + s_end = np.array([10.0, 8.0]) hgen = halton([2, 3]) s = s_end * np.array([hgen() for _ in range(n)]) return s @@ -39,7 +39,7 @@ def create_2d_isotropic(s: Arr, N=3000) -> Arr: """ n = s.shape[0] sdkern = 0.12 # width of kernel - var = 2. # standard derivation + var = 2.0 # standard derivation tau = 0.00001 # standard derivation of white noise np.random.seed(5) diff --git a/src/ellpy/oracles/csdlowpass_oracle.py b/src/ellpy/oracles/csdlowpass_oracle.py index d5fa9aa..a8e3b23 100644 --- a/src/ellpy/oracles/csdlowpass_oracle.py +++ b/src/ellpy/oracles/csdlowpass_oracle.py @@ -18,6 +18,7 @@ class csdlowpass_oracle: Returns: [type]: [description] """ + rcsd = None def __init__(self, nnz, lowpass): diff --git a/src/ellpy/oracles/cycle_ratio_oracle.py b/src/ellpy/oracles/cycle_ratio_oracle.py index 4c0dea3..7f89fac 100644 --- a/src/ellpy/oracles/cycle_ratio_oracle.py +++ b/src/ellpy/oracles/cycle_ratio_oracle.py @@ -12,16 +12,17 @@ class cycle_ratio_oracle: """Oracle for minimum ratio cycle problem. - This example solves the following convex problem: + This example solves the following convex problem: - max t - s.t. u[j] - u[i] ≤ mij - sij * x, - t ≤ x + max t + s.t. u[j] - u[i] ≤ mij - sij * x, + t ≤ x - where sij is not necessarily positive. - The problem could be unbounded??? + where sij is not necessarily positive. + The problem could be unbounded??? """ + class ratio: def __init__(self, G): """[summary] @@ -42,8 +43,8 @@ def eval(self, e, x): Any: function evaluation """ u, v = e - cost = self.G[u][v]['cost'] - time = self.G[u][v]['time'] + cost = self.G[u][v]["cost"] + time = self.G[u][v]["time"] return cost - time * x def grad(self, e, x): @@ -57,7 +58,7 @@ def grad(self, e, x): [type]: [description] """ u, v = e - time = self.G[u][v]['time'] + time = self.G[u][v]["time"] return -time def __init__(self, G, u): @@ -89,4 +90,4 @@ def __call__(self, x, t) -> Tuple[Cut, Any]: if cut: return cut, None - return (-1, 0.), x + return (-1, 0.0), x diff --git a/src/ellpy/oracles/gmi_oracle.py b/src/ellpy/oracles/gmi_oracle.py index d11bac2..267b92f 100644 --- a/src/ellpy/oracles/gmi_oracle.py +++ b/src/ellpy/oracles/gmi_oracle.py @@ -17,6 +17,7 @@ class gmi_oracle: H.neggrad[k](p, x): negative gradient in range p, the k-term """ + def __init__(self, H, m): """[summary] @@ -40,6 +41,7 @@ def __call__(self, x: np.ndarray) -> Optional[Cut]: Returns: Optional[Cut]: [description] """ + def getA(i, j): return self.H.eval(i, j, x) diff --git a/src/ellpy/oracles/lmi0_oracle.py b/src/ellpy/oracles/lmi0_oracle.py index 979a7f4..f281ddf 100644 --- a/src/ellpy/oracles/lmi0_oracle.py +++ b/src/ellpy/oracles/lmi0_oracle.py @@ -12,10 +12,11 @@ class lmi0_oracle: """Oracle for Linear Matrix Inequality constraint - find x - s.t.​ F * x ⪰ 0 + find x + s.t.​ F * x ⪰ 0 """ + def __init__(self, F): """[summary] @@ -34,6 +35,7 @@ def __call__(self, x: Arr) -> Optional[Cut]: Returns: Optional[Cut]: [description] """ + def getA(i, j): n = len(x) return sum(self.F[k][i, j] * x[k] for k in range(n)) diff --git a/src/ellpy/oracles/lmi_old_oracle.py b/src/ellpy/oracles/lmi_old_oracle.py index fcb6d58..4ab2da1 100644 --- a/src/ellpy/oracles/lmi_old_oracle.py +++ b/src/ellpy/oracles/lmi_old_oracle.py @@ -12,12 +12,13 @@ class lmi_old_oracle: """Oracle for Linear Matrix Inequality constraint. - This oracle solves the following feasibility problem: + This oracle solves the following feasibility problem: - find x - s.t. (B − F * x) ⪰ 0 + find x + s.t. (B − F * x) ⪰ 0 """ + def __init__(self, F, B): """[summary] diff --git a/src/ellpy/oracles/lmi_oracle.py b/src/ellpy/oracles/lmi_oracle.py index d1342af..ffe04c8 100644 --- a/src/ellpy/oracles/lmi_oracle.py +++ b/src/ellpy/oracles/lmi_oracle.py @@ -12,10 +12,10 @@ class lmi_oracle: """Oracle for Linear Matrix Inequality constraint. - This oracle solves the following feasibility problem: + This oracle solves the following feasibility problem: - find x - s.t. (B − F * x) ⪰ 0 + find x + s.t. (B − F * x) ⪰ 0 """ @@ -39,10 +39,10 @@ def __call__(self, x: Arr) -> Optional[Cut]: Returns: Optional[Cut]: [description] """ + def getA(i, j): n = len(x) - return self.F0[i, j] - sum(self.F[k][i, j] * x[k] - for k in range(n)) + return self.F0[i, j] - sum(self.F[k][i, j] * x[k] for k in range(n)) if self.Q.factor(getA): return None diff --git a/src/ellpy/oracles/lowpass_oracle.py b/src/ellpy/oracles/lowpass_oracle.py index 46d8bd4..3f54605 100644 --- a/src/ellpy/oracles/lowpass_oracle.py +++ b/src/ellpy/oracles/lowpass_oracle.py @@ -16,6 +16,7 @@ class lowpass_oracle: Returns: [type]: [description] """ + more_alt = True # for round robin counters @@ -113,13 +114,13 @@ def __call__(self, x: Arr, Spsq: float): # case 1 (unlikely) if x[0] < 0: g = np.zeros(n) - g[0] = -1. + g[0] = -1.0 f = -x[0] return (g, f), None # Begin objective function Spsq = fmax - f = (0., fmax) + f = (0.0, fmax) # f = 0. g = self.As[imax, :] return (g, f), Spsq diff --git a/src/ellpy/oracles/lsq_corr_oracle.py b/src/ellpy/oracles/lsq_corr_oracle.py index d69561f..c98edde 100644 --- a/src/ellpy/oracles/lsq_corr_oracle.py +++ b/src/ellpy/oracles/lsq_corr_oracle.py @@ -30,6 +30,7 @@ class lsq_oracle: Returns: [type]: [description] """ + def __init__(self, F: List[Arr], F0: Arr): """[summary] @@ -57,7 +58,7 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: if cut: g1, fj = cut g[:-1] = g1 - g[-1] = 0. + g[-1] = 0.0 return (g, fj), None self.qmi.update(x[-1]) @@ -77,4 +78,4 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: fj = tc - t if fj > 0: return (g, fj), None - return (g, 0.), tc + return (g, 0.0), tc diff --git a/src/ellpy/oracles/mle_corr_oracle.py b/src/ellpy/oracles/mle_corr_oracle.py index 6f024dd..9b9d569 100644 --- a/src/ellpy/oracles/mle_corr_oracle.py +++ b/src/ellpy/oracles/mle_corr_oracle.py @@ -63,7 +63,7 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: g[i] -= sum(SFsi[k, :] @ SY[:, k] for k in range(m)) f = f1 - t - if f < 0.: - return (g, 0.), f1 + if f < 0.0: + return (g, 0.0), f1 return (g, f), None diff --git a/src/ellpy/oracles/network_oracle.py b/src/ellpy/oracles/network_oracle.py index a55217e..642bb28 100644 --- a/src/ellpy/oracles/network_oracle.py +++ b/src/ellpy/oracles/network_oracle.py @@ -9,11 +9,12 @@ class network_oracle: """Oracle for Parametric Network Problem: - find x, u - s.t. u[j] − u[i] ≤ h(e, x) - ∀ e(i, j) ∈ E + find x, u + s.t. u[j] − u[i] ≤ h(e, x) + ∀ e(i, j) ∈ E """ + def __init__(self, G, u, h): """[summary] @@ -44,6 +45,7 @@ def __call__(self, x) -> Optional[Cut]: Returns: Optional[Cut]: [description] """ + def get_weight(e): """[summary] diff --git a/src/ellpy/oracles/optscaling_oracle.py b/src/ellpy/oracles/optscaling_oracle.py index 3e9f0d0..555f1a9 100644 --- a/src/ellpy/oracles/optscaling_oracle.py +++ b/src/ellpy/oracles/optscaling_oracle.py @@ -13,13 +13,14 @@ class optscaling_oracle: """Oracle for Optimal Matrix Scaling - This example is taken from[Orlin and Rothblum, 1985] + This example is taken from[Orlin and Rothblum, 1985] - min π/ψ - s.t. ψ ≤ u[i] * |aij| * u[j]^{−1} ≤ π, - ∀ aij != 0, - π, ψ, u, positive + min π/ψ + s.t. ψ ≤ u[i] * |aij| * u[j]^{−1} ≤ π, + ∀ aij != 0, + π, ψ, u, positive """ + class Ratio: def __init__(self, G, get_cost): """[summary] @@ -57,7 +58,7 @@ def grad(self, e, x: Arr) -> Arr: """ u, v = e assert u != v - return np.array([1., 0.] if u < v else [0., -1.]) + return np.array([1.0, 0.0] if u < v else [0.0, -1.0]) def __init__(self, G, u, get_cost): """Construct a new optscaling oracle object @@ -82,12 +83,12 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: """ s = x[0] - x[1] fj = s - t - g = np.array([1., -1.]) - if fj >= 0.: + g = np.array([1.0, -1.0]) + if fj >= 0.0: return (g, fj), None cut = self._network(x) if cut: return cut, None - return (g, 0.), s + return (g, 0.0), s diff --git a/src/ellpy/oracles/profit_oracle.py b/src/ellpy/oracles/profit_oracle.py index ee72d3d..053f036 100644 --- a/src/ellpy/oracles/profit_oracle.py +++ b/src/ellpy/oracles/profit_oracle.py @@ -25,6 +25,7 @@ class profit_oracle: v: output price k: a given constant that restricts the quantity of x1 """ + def __init__(self, params: Tuple[float, float, float], a: Arr, v: Arr): """[summary] @@ -53,8 +54,8 @@ def __call__(self, y: Arr, t: float) -> Tuple[Cut, Optional[float]]: cutting_plane_dc """ fj = y[0] - self.log_k # constraint - if fj > 0.: - g = np.array([1., 0.]) + if fj > 0.0: + g = np.array([1.0, 0.0]) return (g, fj), None log_Cobb = self.log_pA + self.a @ y @@ -63,10 +64,10 @@ def __call__(self, y: Arr, t: float) -> Tuple[Cut, Optional[float]]: te = t + vx fj = np.log(te) - log_Cobb - if fj < 0.: # feasible + if fj < 0.0: # feasible te = np.exp(log_Cobb) g = q / te - self.a - return (g, 0.), te - vx + return (g, 0.0), te - vx g = q / te - self.a return (g, fj), None @@ -91,8 +92,14 @@ class profit_rb_oracle: See also: profit_oracle """ - def __init__(self, params: Tuple[float, float, float], a: Arr, - v: Arr, vparams: Tuple[float, float, float, float, float]): + + def __init__( + self, + params: Tuple[float, float, float], + a: Arr, + v: Arr, + vparams: Tuple[float, float, float, float, float], + ): """[summary] Arguments: @@ -123,7 +130,7 @@ def __call__(self, y: Arr, t: float) -> Tuple[Cut, Optional[float]]: """ a_rb = self.a.copy() for i in [0, 1]: - a_rb[i] += -self.e[i] if y[i] > 0. else self.e[i] + a_rb[i] += -self.e[i] if y[i] > 0.0 else self.e[i] self.P.a = a_rb return self.P(y, t) @@ -150,6 +157,7 @@ class profit_q_oracle: See also: profit_oracle """ + yd = None def __init__(self, params, a, v): diff --git a/src/ellpy/oracles/qmi_oracle.py b/src/ellpy/oracles/qmi_oracle.py index 2a1d7a7..d1ee539 100644 --- a/src/ellpy/oracles/qmi_oracle.py +++ b/src/ellpy/oracles/qmi_oracle.py @@ -15,13 +15,14 @@ class qmi_oracle: class QMI: """Oracle for Quadratic Matrix Inequality - find x - s.t.​ t*I − F(x)' F(x) ⪰ 0 + find x + s.t.​ t*I − F(x)' F(x) ⪰ 0 - where + where - F(x) = F0 − (F1 * x1 + F2 * x2 + ...) + F(x) = F0 − (F1 * x1 + F2 * x2 + ...) """ + t = None count = 0 diff --git a/src/ellpy/oracles/setup.py b/src/ellpy/oracles/setup.py index 92fa2ef..936bfd7 100644 --- a/src/ellpy/oracles/setup.py +++ b/src/ellpy/oracles/setup.py @@ -3,5 +3,7 @@ import numpy from Cython.Build import cythonize -setup(ext_modules=cythonize("cholutil.pyx", annotate=True), - include_dirs=[numpy.get_include()]) +setup( + ext_modules=cythonize("cholutil.pyx", annotate=True), + include_dirs=[numpy.get_include()], +) diff --git a/src/ellpy/oracles/spectral_fact.py b/src/ellpy/oracles/spectral_fact.py index 5e97683..ade3d23 100644 --- a/src/ellpy/oracles/spectral_fact.py +++ b/src/ellpy/oracles/spectral_fact.py @@ -4,17 +4,17 @@ def spectral_fact(r): """Spectral factorization using Kolmogorov 1939 approach. - (code follows pp. 232-233, Signal Analysis, by A. Papoulis) + (code follows pp. 232-233, Signal Analysis, by A. Papoulis) - Computes the minimum-phase impulse response which satisfies - given auto-correlation. + Computes the minimum-phase impulse response which satisfies + given auto-correlation. - Input: - r: top-half of the auto-correlation coefficients - starts from 0th element to end of the auto-corelation - should be passed in as a column vector - Output - h: impulse response that gives the desired auto-correlation + Input: + r: top-half of the auto-correlation coefficients + starts from 0th element to end of the auto-corelation + should be passed in as a column vector + Output + h: impulse response that gives the desired auto-correlation """ # length of the impulse response sequence @@ -36,7 +36,7 @@ def spectral_fact(r): An = 2 * np.cos(Bn) R = np.hstack((np.ones((m, 1)), An)) @ r # NOQA - alpha = ne.evaluate('0.5 * log(abs(R))') + alpha = ne.evaluate("0.5 * log(abs(R))") # find the Hilbert transform alphatmp = np.fft.fft(alpha) @@ -71,7 +71,7 @@ def inverse_spectral_fact(h): n = len(h) r = np.zeros(n) for t in range(n): - r[t] = h[t:] @ h[:n - t] + r[t] = h[t:] @ h[: n - t] return r diff --git a/src/ellpy/problem.py b/src/ellpy/problem.py index 37b4d50..a390eeb 100644 --- a/src/ellpy/problem.py +++ b/src/ellpy/problem.py @@ -54,8 +54,7 @@ def status(self): @property def solver_stats(self): - """Returns an object containing additional information returned by the solver. - """ + """Returns an object containing additional information returned by the solver.""" return self._solver_stats def solve(self, *args, **kwargs): @@ -99,11 +98,13 @@ def solve(self, *args, **kwargs): # """ # cls.REGISTERED_SOLVE_METHODS[name] = func - def _solve(self, t - # solver=None, - # warm_start=False, - # verbose=False, **kwargs - ): + def _solve( + self, + t + # solver=None, + # warm_start=False, + # verbose=False, **kwargs + ): """Solves a DCP compliant optimization problem. Saves the values of primal and dual variables in the variable @@ -135,15 +136,15 @@ def _solve(self, t if ell_info.feasible: if status == CUTStatus.smallenough: - self._status = 'optimal' + self._status = "optimal" else: - self._status = 'feasible' + self._status = "feasible" self._optim_value = fb self._optim_var = xb else: - self._status = 'infeasible' + self._status = "infeasible" - solver_stats = SolverStats('deep-cut') + solver_stats = SolverStats("deep-cut") solver_stats.num_iters = num_iters self._solver_stats = solver_stats @@ -180,6 +181,7 @@ class SolverStats: The number of iterations the solver had to go through to find a solution. """ + def __init__(self, solver_name): """[summary] diff --git a/src/pycsd/__init__.py b/src/pycsd/__init__.py index 03c16d3..13ac065 100644 --- a/src/pycsd/__init__.py +++ b/src/pycsd/__init__.py @@ -6,6 +6,7 @@ from __future__ import absolute_import import sys + if sys.version_info[:2] < (2, 7): m = "Python 2.7 or later is required for PyCSD (%d.%d detected)." raise ImportError(m % sys.version_info[:2]) diff --git a/src/pycsd/csd/csd.py b/src/pycsd/csd/csd.py index f97aaf1..d3d4913 100755 --- a/src/pycsd/csd/csd.py +++ b/src/pycsd/csd/csd.py @@ -83,7 +83,7 @@ def to_csd(dec_val, places=0, debug=False): def to_decimal(csd_str, debug=False): - """ Convert the CSD string to a decimal """ + """Convert the CSD string to a decimal""" if debug: print("Converting: ", csd_str) @@ -143,7 +143,7 @@ def to_decimal(csd_str, debug=False): def to_csdfixed(dec_val, nnz=4, debug=False): - """ Convert the argument to CSD Format. """ + """Convert the argument to CSD Format.""" if debug: print( diff --git a/src/pycsd/dev/csd_numbers.py b/src/pycsd/dev/csd_numbers.py index 403b1b4..937f553 100755 --- a/src/pycsd/dev/csd_numbers.py +++ b/src/pycsd/dev/csd_numbers.py @@ -5,12 +5,12 @@ import pycsd.csd as csd -sys.path.append('/home/mmcgrana/lib/python/csd') +sys.path.append("/home/mmcgrana/lib/python/csd") num_digits = 4 # recursion -csd_num = ['0'] * num_digits +csd_num = ["0"] * num_digits indent_ = 2 @@ -18,31 +18,30 @@ def is_proper_csd(csd_num): - """ Check we've a valid CSD number + """Check we've a valid CSD number Returns false if the array contains consequitive non-zero terms. """ for i in range(1, len(csd_num)): - if csd_num[i] != '0' and csd_num[i - 1] != '0': + if csd_num[i] != "0" and csd_num[i - 1] != "0": return False return True def cycle_bits(i): - global indent_ indent_ += 2 - for ch in ('0', '-', '+'): + for ch in ("0", "-", "+"): csd_num[i] = ch - if (i > 0): + if i > 0: cycle_bits(i - 1) else: if is_proper_csd(csd_num): - csd_str = ''.join(csd_num) + csd_str = "".join(csd_num) num = csd.to_decimal(csd_str) csd_dict[num] = csd_str @@ -50,7 +49,7 @@ def cycle_bits(i): def wiki_table(): - """ A table of CSD numbers for the wiki. """ + """A table of CSD numbers for the wiki.""" ordered_keys = csd_dict.keys() ordered_keys.sort() @@ -66,7 +65,10 @@ def wiki_table(): wiki_str += """ | %s | %d -|- """ % (csd_dict[key], key) +|- """ % ( + csd_dict[key], + key, + ) wiki_str += "|}" return wiki_str @@ -82,8 +84,7 @@ def show_csd(): print(csd_dict[key], key) -if __name__ == '__main__': - +if __name__ == "__main__": cycle_bits(num_digits - 1) print(wiki_table()) diff --git a/src/pycsd/run_tests.py b/src/pycsd/run_tests.py index 756dc4e..bd9c4e7 100755 --- a/src/pycsd/run_tests.py +++ b/src/pycsd/run_tests.py @@ -8,6 +8,6 @@ # from test import * -sys.path.append('./csd') +sys.path.append("./csd") unittest.main() diff --git a/src/pycsd/test/test_csd_decimals.py b/src/pycsd/test/test_csd_decimals.py index 2ac2c7c..be72d87 100755 --- a/src/pycsd/test/test_csd_decimals.py +++ b/src/pycsd/test/test_csd_decimals.py @@ -8,11 +8,11 @@ import pycsd.csd as csd good_values_dict = { - 16.5: '+0000.+', - -16.5: '-0000.-', - -2.5: '-0.-', - 0.5: '0.+', - -0.5: '0.-' + 16.5: "+0000.+", + -16.5: "-0000.-", + -2.5: "-0.-", + 0.5: "0.+", + -0.5: "0.-", } @@ -21,7 +21,7 @@ def tmp(self): pass def test__01_to_decimal(self): - """ Check the conversion from CSD with a binary point to decimal. """ + """Check the conversion from CSD with a binary point to decimal.""" for key in good_values_dict.keys(): csd_str = good_values_dict[key] @@ -29,30 +29,30 @@ def test__01_to_decimal(self): self.assertEqual(value, key) def test__01a_to_decimal(self): - self.assertEqual(csd.to_decimal('0.+00-'), 0.5 - (2.0**-4)) - self.assertEqual(csd.to_decimal('0.0+0-'), 0.25 - (2.0**-4)) - self.assertEqual(csd.to_decimal('0.+0-0'), 0.5 - (2.0**-3)) + self.assertEqual(csd.to_decimal("0.+00-"), 0.5 - (2.0**-4)) + self.assertEqual(csd.to_decimal("0.0+0-"), 0.25 - (2.0**-4)) + self.assertEqual(csd.to_decimal("0.+0-0"), 0.5 - (2.0**-3)) def test__02_to_csd_1_place(self): - """ Check that decimals are converted to CSD properly. """ + """Check that decimals are converted to CSD properly.""" for key in good_values_dict.keys(): csd_str = csd.to_csd(key, places=1) self.assertEqual(csd_str, good_values_dict[key]) def test__03_to_csd_4_places(self): - """ To four places """ - self.assertEqual(csd.to_csd(0.0625, 4), '0.000+') - self.assertEqual(csd.to_csd(-0.0625, 4), '0.000-') - self.assertEqual(csd.to_csd(0.25, 4), '0.0+00') - self.assertEqual(csd.to_csd(-0.25, 4), '0.0-00') + """To four places""" + self.assertEqual(csd.to_csd(0.0625, 4), "0.000+") + self.assertEqual(csd.to_csd(-0.0625, 4), "0.000-") + self.assertEqual(csd.to_csd(0.25, 4), "0.0+00") + self.assertEqual(csd.to_csd(-0.25, 4), "0.0-00") def test__04_to_csd_x_places(self): - """ To four places """ - self.assertEqual(csd.to_csd(0.0625, 4), '0.000+') - self.assertEqual(csd.to_csd(-0.0625, 4), '0.000-') - self.assertEqual(csd.to_csd(0.25, 4), '0.0+00') - self.assertEqual(csd.to_csd(-0.25, 4), '0.0-00') + """To four places""" + self.assertEqual(csd.to_csd(0.0625, 4), "0.000+") + self.assertEqual(csd.to_csd(-0.0625, 4), "0.000-") + self.assertEqual(csd.to_csd(0.25, 4), "0.0+00") + self.assertEqual(csd.to_csd(-0.25, 4), "0.0-00") def suite(): @@ -61,5 +61,5 @@ def suite(): return suite -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/src/pycsd/test/test_csd_integers.py b/src/pycsd/test/test_csd_integers.py index 3b8c8a6..ca02f89 100755 --- a/src/pycsd/test/test_csd_integers.py +++ b/src/pycsd/test/test_csd_integers.py @@ -7,18 +7,12 @@ import pycsd.csd as csd -good_values_dict = { - 32: '+00000', - -32: '-00000', - 0: '0', - 7: '+00-', - 15: '+000-' -} +good_values_dict = {32: "+00000", -32: "-00000", 0: "0", 7: "+00-", 15: "+000-"} class tests__integers(unittest.TestCase): def test__01_to_integer(self): - """ Check conversion from CSD to integer """ + """Check conversion from CSD to integer""" for key in good_values_dict.keys(): csd_str = good_values_dict[key] @@ -26,7 +20,7 @@ def test__01_to_integer(self): self.assertEqual(value, key) def test__02_to_csd(self): - """ Check that integers are converted to CSD properly. """ + """Check that integers are converted to CSD properly.""" for key in good_values_dict.keys(): csd_str = csd.to_csd(key) @@ -39,5 +33,5 @@ def suite(): return suite -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/src/pycsd/test/test_to_and_fro_10bits.py b/src/pycsd/test/test_to_and_fro_10bits.py index ee52770..2c00586 100644 --- a/src/pycsd/test/test_to_and_fro_10bits.py +++ b/src/pycsd/test/test_to_and_fro_10bits.py @@ -9,1377 +9,1377 @@ # generated by recursive alg in ../dev/csd_numbers.py good_values_dict = { - 0.0: '0000000000', - 1.0: '000000000+', - 2.0: '00000000+0', - 3.0: '0000000+0-', - 4.0: '0000000+00', - 5.0: '0000000+0+', - 6.0: '000000+0-0', - 7.0: '000000+00-', - 8.0: '000000+000', - 9.0: '000000+00+', - 10.0: '000000+0+0', - 11.0: '00000+0-0-', - 12.0: '00000+0-00', - 13.0: '00000+0-0+', - 14.0: '00000+00-0', - 15.0: '00000+000-', - 16.0: '00000+0000', - 17.0: '00000+000+', - 18.0: '00000+00+0', - 19.0: '00000+0+0-', - 20.0: '00000+0+00', - 21.0: '00000+0+0+', - 22.0: '0000+0-0-0', - 23.0: '0000+0-00-', - 24.0: '0000+0-000', - 25.0: '0000+0-00+', - 26.0: '0000+0-0+0', - 27.0: '0000+00-0-', - 28.0: '0000+00-00', - 29.0: '0000+00-0+', - 30.0: '0000+000-0', - 31.0: '0000+0000-', - 32.0: '0000+00000', - 33.0: '0000+0000+', - 34.0: '0000+000+0', - 35.0: '0000+00+0-', - 36.0: '0000+00+00', - 37.0: '0000+00+0+', - 38.0: '0000+0+0-0', - 39.0: '0000+0+00-', - 40.0: '0000+0+000', - 41.0: '0000+0+00+', - 42.0: '0000+0+0+0', - 43.0: '000+0-0-0-', - 44.0: '000+0-0-00', - 45.0: '000+0-0-0+', - 46.0: '000+0-00-0', - 47.0: '000+0-000-', - 48.0: '000+0-0000', - 49.0: '000+0-000+', - 50.0: '000+0-00+0', - 51.0: '000+0-0+0-', - 52.0: '000+0-0+00', - 53.0: '000+0-0+0+', - 54.0: '000+00-0-0', - 55.0: '000+00-00-', - 56.0: '000+00-000', - 57.0: '000+00-00+', - 58.0: '000+00-0+0', - 59.0: '000+000-0-', - 60.0: '000+000-00', - 61.0: '000+000-0+', - 62.0: '000+0000-0', - 63.0: '000+00000-', - 64.0: '000+000000', - 65.0: '000+00000+', - 66.0: '000+0000+0', - 67.0: '000+000+0-', - 68.0: '000+000+00', - 69.0: '000+000+0+', - 70.0: '000+00+0-0', - 71.0: '000+00+00-', - 72.0: '000+00+000', - 73.0: '000+00+00+', - 74.0: '000+00+0+0', - 75.0: '000+0+0-0-', - 76.0: '000+0+0-00', - 77.0: '000+0+0-0+', - 78.0: '000+0+00-0', - 79.0: '000+0+000-', - 80.0: '000+0+0000', - 81.0: '000+0+000+', - 82.0: '000+0+00+0', - 83.0: '000+0+0+0-', - 84.0: '000+0+0+00', - 85.0: '000+0+0+0+', - 86.0: '00+0-0-0-0', - 87.0: '00+0-0-00-', - 88.0: '00+0-0-000', - 89.0: '00+0-0-00+', - 90.0: '00+0-0-0+0', - 91.0: '00+0-00-0-', - 92.0: '00+0-00-00', - 93.0: '00+0-00-0+', - 94.0: '00+0-000-0', - 95.0: '00+0-0000-', - 96.0: '00+0-00000', - 97.0: '00+0-0000+', - 98.0: '00+0-000+0', - 99.0: '00+0-00+0-', - 100.0: '00+0-00+00', - 101.0: '00+0-00+0+', - 102.0: '00+0-0+0-0', - 103.0: '00+0-0+00-', - 104.0: '00+0-0+000', - 105.0: '00+0-0+00+', - 106.0: '00+0-0+0+0', - 107.0: '00+00-0-0-', - 108.0: '00+00-0-00', - 109.0: '00+00-0-0+', - 110.0: '00+00-00-0', - 111.0: '00+00-000-', - 112.0: '00+00-0000', - 113.0: '00+00-000+', - 114.0: '00+00-00+0', - 115.0: '00+00-0+0-', - 116.0: '00+00-0+00', - 117.0: '00+00-0+0+', - 118.0: '00+000-0-0', - 119.0: '00+000-00-', - 120.0: '00+000-000', - 121.0: '00+000-00+', - 122.0: '00+000-0+0', - 123.0: '00+0000-0-', - 124.0: '00+0000-00', - 125.0: '00+0000-0+', - 126.0: '00+00000-0', - 127.0: '00+000000-', - 128.0: '00+0000000', - 129.0: '00+000000+', - 130.0: '00+00000+0', - 131.0: '00+0000+0-', - 132.0: '00+0000+00', - 133.0: '00+0000+0+', - 134.0: '00+000+0-0', - 135.0: '00+000+00-', - 136.0: '00+000+000', - 137.0: '00+000+00+', - 138.0: '00+000+0+0', - 139.0: '00+00+0-0-', - 140.0: '00+00+0-00', - 141.0: '00+00+0-0+', - 142.0: '00+00+00-0', - 143.0: '00+00+000-', - 144.0: '00+00+0000', - 145.0: '00+00+000+', - 146.0: '00+00+00+0', - 147.0: '00+00+0+0-', - 148.0: '00+00+0+00', - 149.0: '00+00+0+0+', - 150.0: '00+0+0-0-0', - 151.0: '00+0+0-00-', - 152.0: '00+0+0-000', - 153.0: '00+0+0-00+', - 154.0: '00+0+0-0+0', - 155.0: '00+0+00-0-', - 156.0: '00+0+00-00', - 157.0: '00+0+00-0+', - 158.0: '00+0+000-0', - 159.0: '00+0+0000-', - 160.0: '00+0+00000', - 161.0: '00+0+0000+', - 162.0: '00+0+000+0', - 163.0: '00+0+00+0-', - 164.0: '00+0+00+00', - 165.0: '00+0+00+0+', - 166.0: '00+0+0+0-0', - 167.0: '00+0+0+00-', - 168.0: '00+0+0+000', - 169.0: '00+0+0+00+', - 170.0: '00+0+0+0+0', - 171.0: '0+0-0-0-0-', - 172.0: '0+0-0-0-00', - 173.0: '0+0-0-0-0+', - 174.0: '0+0-0-00-0', - 175.0: '0+0-0-000-', - 176.0: '0+0-0-0000', - 177.0: '0+0-0-000+', - 178.0: '0+0-0-00+0', - 179.0: '0+0-0-0+0-', - 180.0: '0+0-0-0+00', - 181.0: '0+0-0-0+0+', - 182.0: '0+0-00-0-0', - 183.0: '0+0-00-00-', - 184.0: '0+0-00-000', - 185.0: '0+0-00-00+', - 186.0: '0+0-00-0+0', - 187.0: '0+0-000-0-', - 188.0: '0+0-000-00', - 189.0: '0+0-000-0+', - 190.0: '0+0-0000-0', - 191.0: '0+0-00000-', - 192.0: '0+0-000000', - 193.0: '0+0-00000+', - 194.0: '0+0-0000+0', - 195.0: '0+0-000+0-', - 196.0: '0+0-000+00', - 197.0: '0+0-000+0+', - 198.0: '0+0-00+0-0', - 199.0: '0+0-00+00-', - 200.0: '0+0-00+000', - 201.0: '0+0-00+00+', - 202.0: '0+0-00+0+0', - 203.0: '0+0-0+0-0-', - 204.0: '0+0-0+0-00', - 205.0: '0+0-0+0-0+', - 206.0: '0+0-0+00-0', - 207.0: '0+0-0+000-', - 208.0: '0+0-0+0000', - 209.0: '0+0-0+000+', - 210.0: '0+0-0+00+0', - 211.0: '0+0-0+0+0-', - 212.0: '0+0-0+0+00', - 213.0: '0+0-0+0+0+', - 214.0: '0+00-0-0-0', - 215.0: '0+00-0-00-', - 216.0: '0+00-0-000', - 217.0: '0+00-0-00+', - 218.0: '0+00-0-0+0', - 219.0: '0+00-00-0-', - 220.0: '0+00-00-00', - 221.0: '0+00-00-0+', - 222.0: '0+00-000-0', - 223.0: '0+00-0000-', - 224.0: '0+00-00000', - 225.0: '0+00-0000+', - 226.0: '0+00-000+0', - 227.0: '0+00-00+0-', - 228.0: '0+00-00+00', - 229.0: '0+00-00+0+', - 230.0: '0+00-0+0-0', - 231.0: '0+00-0+00-', - 232.0: '0+00-0+000', - 233.0: '0+00-0+00+', - 234.0: '0+00-0+0+0', - 235.0: '0+000-0-0-', - 236.0: '0+000-0-00', - 237.0: '0+000-0-0+', - 238.0: '0+000-00-0', - 239.0: '0+000-000-', - 240.0: '0+000-0000', - 241.0: '0+000-000+', - 242.0: '0+000-00+0', - 243.0: '0+000-0+0-', - 244.0: '0+000-0+00', - 245.0: '0+000-0+0+', - 246.0: '0+0000-0-0', - 247.0: '0+0000-00-', - 248.0: '0+0000-000', - 249.0: '0+0000-00+', - 250.0: '0+0000-0+0', - 251.0: '0+00000-0-', - 252.0: '0+00000-00', - 253.0: '0+00000-0+', - 254.0: '0+000000-0', - 255.0: '0+0000000-', - 256.0: '0+00000000', - 257.0: '0+0000000+', - 258.0: '0+000000+0', - 259.0: '0+00000+0-', - 260.0: '0+00000+00', - 261.0: '0+00000+0+', - 262.0: '0+0000+0-0', - 263.0: '0+0000+00-', - 264.0: '0+0000+000', - 265.0: '0+0000+00+', - 266.0: '0+0000+0+0', - 267.0: '0+000+0-0-', - 268.0: '0+000+0-00', - 269.0: '0+000+0-0+', - 270.0: '0+000+00-0', - 271.0: '0+000+000-', - 272.0: '0+000+0000', - 273.0: '0+000+000+', - 274.0: '0+000+00+0', - 275.0: '0+000+0+0-', - 276.0: '0+000+0+00', - 277.0: '0+000+0+0+', - 278.0: '0+00+0-0-0', - 279.0: '0+00+0-00-', - 280.0: '0+00+0-000', - 281.0: '0+00+0-00+', - 282.0: '0+00+0-0+0', - 283.0: '0+00+00-0-', - 284.0: '0+00+00-00', - 285.0: '0+00+00-0+', - 286.0: '0+00+000-0', - 287.0: '0+00+0000-', - 288.0: '0+00+00000', - 289.0: '0+00+0000+', - 290.0: '0+00+000+0', - 291.0: '0+00+00+0-', - 292.0: '0+00+00+00', - 293.0: '0+00+00+0+', - 294.0: '0+00+0+0-0', - 295.0: '0+00+0+00-', - 296.0: '0+00+0+000', - 297.0: '0+00+0+00+', - 298.0: '0+00+0+0+0', - 299.0: '0+0+0-0-0-', - 300.0: '0+0+0-0-00', - 301.0: '0+0+0-0-0+', - 302.0: '0+0+0-00-0', - 303.0: '0+0+0-000-', - 304.0: '0+0+0-0000', - 305.0: '0+0+0-000+', - 306.0: '0+0+0-00+0', - 307.0: '0+0+0-0+0-', - 308.0: '0+0+0-0+00', - 309.0: '0+0+0-0+0+', - 310.0: '0+0+00-0-0', - 311.0: '0+0+00-00-', - 312.0: '0+0+00-000', - 313.0: '0+0+00-00+', - 314.0: '0+0+00-0+0', - 315.0: '0+0+000-0-', - 316.0: '0+0+000-00', - 317.0: '0+0+000-0+', - 318.0: '0+0+0000-0', - 319.0: '0+0+00000-', - 320.0: '0+0+000000', - 321.0: '0+0+00000+', - 322.0: '0+0+0000+0', - 323.0: '0+0+000+0-', - 324.0: '0+0+000+00', - 325.0: '0+0+000+0+', - 326.0: '0+0+00+0-0', - 327.0: '0+0+00+00-', - 328.0: '0+0+00+000', - 329.0: '0+0+00+00+', - 330.0: '0+0+00+0+0', - 331.0: '0+0+0+0-0-', - 332.0: '0+0+0+0-00', - 333.0: '0+0+0+0-0+', - 334.0: '0+0+0+00-0', - 335.0: '0+0+0+000-', - 336.0: '0+0+0+0000', - 337.0: '0+0+0+000+', - 338.0: '0+0+0+00+0', - 339.0: '0+0+0+0+0-', - 340.0: '0+0+0+0+00', - 341.0: '0+0+0+0+0+', - 342.0: '+0-0-0-0-0', - 343.0: '+0-0-0-00-', - 344.0: '+0-0-0-000', - 345.0: '+0-0-0-00+', - 346.0: '+0-0-0-0+0', - 347.0: '+0-0-00-0-', - 348.0: '+0-0-00-00', - 349.0: '+0-0-00-0+', - 350.0: '+0-0-000-0', - 351.0: '+0-0-0000-', - 352.0: '+0-0-00000', - 353.0: '+0-0-0000+', - 354.0: '+0-0-000+0', - 355.0: '+0-0-00+0-', - 356.0: '+0-0-00+00', - 357.0: '+0-0-00+0+', - 358.0: '+0-0-0+0-0', - 359.0: '+0-0-0+00-', - 360.0: '+0-0-0+000', - 361.0: '+0-0-0+00+', - 362.0: '+0-0-0+0+0', - 363.0: '+0-00-0-0-', - 364.0: '+0-00-0-00', - 365.0: '+0-00-0-0+', - 366.0: '+0-00-00-0', - 367.0: '+0-00-000-', - 368.0: '+0-00-0000', - 369.0: '+0-00-000+', - 370.0: '+0-00-00+0', - 371.0: '+0-00-0+0-', - 372.0: '+0-00-0+00', - 373.0: '+0-00-0+0+', - 374.0: '+0-000-0-0', - 375.0: '+0-000-00-', - 376.0: '+0-000-000', - 377.0: '+0-000-00+', - 378.0: '+0-000-0+0', - 379.0: '+0-0000-0-', - 380.0: '+0-0000-00', - 381.0: '+0-0000-0+', - 382.0: '+0-00000-0', - 383.0: '+0-000000-', - 384.0: '+0-0000000', - 385.0: '+0-000000+', - 386.0: '+0-00000+0', - 387.0: '+0-0000+0-', - 388.0: '+0-0000+00', - 389.0: '+0-0000+0+', - 390.0: '+0-000+0-0', - 391.0: '+0-000+00-', - 392.0: '+0-000+000', - 393.0: '+0-000+00+', - 394.0: '+0-000+0+0', - 395.0: '+0-00+0-0-', - 396.0: '+0-00+0-00', - 397.0: '+0-00+0-0+', - 398.0: '+0-00+00-0', - 399.0: '+0-00+000-', - 400.0: '+0-00+0000', - 401.0: '+0-00+000+', - 402.0: '+0-00+00+0', - 403.0: '+0-00+0+0-', - 404.0: '+0-00+0+00', - 405.0: '+0-00+0+0+', - 406.0: '+0-0+0-0-0', - 407.0: '+0-0+0-00-', - 408.0: '+0-0+0-000', - 409.0: '+0-0+0-00+', - 410.0: '+0-0+0-0+0', - 411.0: '+0-0+00-0-', - 412.0: '+0-0+00-00', - 413.0: '+0-0+00-0+', - 414.0: '+0-0+000-0', - 415.0: '+0-0+0000-', - 416.0: '+0-0+00000', - 417.0: '+0-0+0000+', - 418.0: '+0-0+000+0', - 419.0: '+0-0+00+0-', - 420.0: '+0-0+00+00', - 421.0: '+0-0+00+0+', - 422.0: '+0-0+0+0-0', - 423.0: '+0-0+0+00-', - 424.0: '+0-0+0+000', - 425.0: '+0-0+0+00+', - 426.0: '+0-0+0+0+0', - 427.0: '+00-0-0-0-', - 428.0: '+00-0-0-00', - 429.0: '+00-0-0-0+', - 430.0: '+00-0-00-0', - 431.0: '+00-0-000-', - 432.0: '+00-0-0000', - 433.0: '+00-0-000+', - 434.0: '+00-0-00+0', - 435.0: '+00-0-0+0-', - 436.0: '+00-0-0+00', - 437.0: '+00-0-0+0+', - 438.0: '+00-00-0-0', - 439.0: '+00-00-00-', - 440.0: '+00-00-000', - 441.0: '+00-00-00+', - 442.0: '+00-00-0+0', - 443.0: '+00-000-0-', - 444.0: '+00-000-00', - 445.0: '+00-000-0+', - 446.0: '+00-0000-0', - 447.0: '+00-00000-', - 448.0: '+00-000000', - 449.0: '+00-00000+', - 450.0: '+00-0000+0', - 451.0: '+00-000+0-', - 452.0: '+00-000+00', - 453.0: '+00-000+0+', - 454.0: '+00-00+0-0', - 455.0: '+00-00+00-', - 456.0: '+00-00+000', - 457.0: '+00-00+00+', - 458.0: '+00-00+0+0', - 459.0: '+00-0+0-0-', - 460.0: '+00-0+0-00', - 461.0: '+00-0+0-0+', - 462.0: '+00-0+00-0', - 463.0: '+00-0+000-', - 464.0: '+00-0+0000', - 465.0: '+00-0+000+', - 466.0: '+00-0+00+0', - 467.0: '+00-0+0+0-', - 468.0: '+00-0+0+00', - 469.0: '+00-0+0+0+', - 470.0: '+000-0-0-0', - 471.0: '+000-0-00-', - 472.0: '+000-0-000', - 473.0: '+000-0-00+', - 474.0: '+000-0-0+0', - 475.0: '+000-00-0-', - 476.0: '+000-00-00', - 477.0: '+000-00-0+', - 478.0: '+000-000-0', - 479.0: '+000-0000-', - 480.0: '+000-00000', - 481.0: '+000-0000+', - 482.0: '+000-000+0', - 483.0: '+000-00+0-', - 484.0: '+000-00+00', - 485.0: '+000-00+0+', - 486.0: '+000-0+0-0', - 487.0: '+000-0+00-', - 488.0: '+000-0+000', - 489.0: '+000-0+00+', - 490.0: '+000-0+0+0', - 491.0: '+0000-0-0-', - 492.0: '+0000-0-00', - 493.0: '+0000-0-0+', - 494.0: '+0000-00-0', - 495.0: '+0000-000-', - 496.0: '+0000-0000', - 497.0: '+0000-000+', - 498.0: '+0000-00+0', - 499.0: '+0000-0+0-', - 500.0: '+0000-0+00', - 501.0: '+0000-0+0+', - 502.0: '+00000-0-0', - 503.0: '+00000-00-', - 504.0: '+00000-000', - 505.0: '+00000-00+', - 506.0: '+00000-0+0', - 507.0: '+000000-0-', - 508.0: '+000000-00', - 509.0: '+000000-0+', - 510.0: '+0000000-0', - 511.0: '+00000000-', - 512.0: '+000000000', - 513.0: '+00000000+', - 514.0: '+0000000+0', - 515.0: '+000000+0-', - 516.0: '+000000+00', - 517.0: '+000000+0+', - 518.0: '+00000+0-0', - 519.0: '+00000+00-', - 520.0: '+00000+000', - 521.0: '+00000+00+', - 522.0: '+00000+0+0', - 523.0: '+0000+0-0-', - 524.0: '+0000+0-00', - 525.0: '+0000+0-0+', - 526.0: '+0000+00-0', - 527.0: '+0000+000-', - 528.0: '+0000+0000', - 529.0: '+0000+000+', - 530.0: '+0000+00+0', - 531.0: '+0000+0+0-', - 532.0: '+0000+0+00', - 533.0: '+0000+0+0+', - 534.0: '+000+0-0-0', - 535.0: '+000+0-00-', - 536.0: '+000+0-000', - 537.0: '+000+0-00+', - 538.0: '+000+0-0+0', - 539.0: '+000+00-0-', - 540.0: '+000+00-00', - 541.0: '+000+00-0+', - 542.0: '+000+000-0', - 543.0: '+000+0000-', - 544.0: '+000+00000', - 545.0: '+000+0000+', - 546.0: '+000+000+0', - 547.0: '+000+00+0-', - 548.0: '+000+00+00', - 549.0: '+000+00+0+', - 550.0: '+000+0+0-0', - 551.0: '+000+0+00-', - 552.0: '+000+0+000', - 553.0: '+000+0+00+', - 554.0: '+000+0+0+0', - 555.0: '+00+0-0-0-', - 556.0: '+00+0-0-00', - 557.0: '+00+0-0-0+', - 558.0: '+00+0-00-0', - 559.0: '+00+0-000-', - 560.0: '+00+0-0000', - 561.0: '+00+0-000+', - 562.0: '+00+0-00+0', - 563.0: '+00+0-0+0-', - 564.0: '+00+0-0+00', - 565.0: '+00+0-0+0+', - 566.0: '+00+00-0-0', - 567.0: '+00+00-00-', - 568.0: '+00+00-000', - 569.0: '+00+00-00+', - 570.0: '+00+00-0+0', - 571.0: '+00+000-0-', - 572.0: '+00+000-00', - 573.0: '+00+000-0+', - 574.0: '+00+0000-0', - 575.0: '+00+00000-', - 576.0: '+00+000000', - 577.0: '+00+00000+', - 578.0: '+00+0000+0', - 579.0: '+00+000+0-', - 580.0: '+00+000+00', - 581.0: '+00+000+0+', - 582.0: '+00+00+0-0', - 583.0: '+00+00+00-', - 584.0: '+00+00+000', - 585.0: '+00+00+00+', - 586.0: '+00+00+0+0', - 587.0: '+00+0+0-0-', - 588.0: '+00+0+0-00', - 589.0: '+00+0+0-0+', - 590.0: '+00+0+00-0', - 591.0: '+00+0+000-', - 592.0: '+00+0+0000', - 593.0: '+00+0+000+', - 594.0: '+00+0+00+0', - 595.0: '+00+0+0+0-', - 596.0: '+00+0+0+00', - 597.0: '+00+0+0+0+', - 598.0: '+0+0-0-0-0', - 599.0: '+0+0-0-00-', - 600.0: '+0+0-0-000', - 601.0: '+0+0-0-00+', - 602.0: '+0+0-0-0+0', - 603.0: '+0+0-00-0-', - 604.0: '+0+0-00-00', - 605.0: '+0+0-00-0+', - 606.0: '+0+0-000-0', - 607.0: '+0+0-0000-', - 608.0: '+0+0-00000', - 609.0: '+0+0-0000+', - 610.0: '+0+0-000+0', - 611.0: '+0+0-00+0-', - 612.0: '+0+0-00+00', - 613.0: '+0+0-00+0+', - 614.0: '+0+0-0+0-0', - 615.0: '+0+0-0+00-', - 616.0: '+0+0-0+000', - 617.0: '+0+0-0+00+', - 618.0: '+0+0-0+0+0', - 619.0: '+0+00-0-0-', - 620.0: '+0+00-0-00', - 621.0: '+0+00-0-0+', - 622.0: '+0+00-00-0', - 623.0: '+0+00-000-', - 624.0: '+0+00-0000', - 625.0: '+0+00-000+', - 626.0: '+0+00-00+0', - 627.0: '+0+00-0+0-', - 628.0: '+0+00-0+00', - 629.0: '+0+00-0+0+', - 630.0: '+0+000-0-0', - 631.0: '+0+000-00-', - 632.0: '+0+000-000', - 633.0: '+0+000-00+', - 634.0: '+0+000-0+0', - 635.0: '+0+0000-0-', - 636.0: '+0+0000-00', - 637.0: '+0+0000-0+', - 638.0: '+0+00000-0', - 639.0: '+0+000000-', - 640.0: '+0+0000000', - 641.0: '+0+000000+', - 642.0: '+0+00000+0', - 643.0: '+0+0000+0-', - 644.0: '+0+0000+00', - 645.0: '+0+0000+0+', - 646.0: '+0+000+0-0', - 647.0: '+0+000+00-', - 648.0: '+0+000+000', - 649.0: '+0+000+00+', - 650.0: '+0+000+0+0', - 651.0: '+0+00+0-0-', - 652.0: '+0+00+0-00', - 653.0: '+0+00+0-0+', - 654.0: '+0+00+00-0', - 655.0: '+0+00+000-', - 656.0: '+0+00+0000', - 657.0: '+0+00+000+', - 658.0: '+0+00+00+0', - 659.0: '+0+00+0+0-', - 660.0: '+0+00+0+00', - 661.0: '+0+00+0+0+', - 662.0: '+0+0+0-0-0', - 663.0: '+0+0+0-00-', - 664.0: '+0+0+0-000', - 665.0: '+0+0+0-00+', - 666.0: '+0+0+0-0+0', - 667.0: '+0+0+00-0-', - 668.0: '+0+0+00-00', - 669.0: '+0+0+00-0+', - 670.0: '+0+0+000-0', - 671.0: '+0+0+0000-', - 672.0: '+0+0+00000', - 673.0: '+0+0+0000+', - 674.0: '+0+0+000+0', - 675.0: '+0+0+00+0-', - 676.0: '+0+0+00+00', - 677.0: '+0+0+00+0+', - 678.0: '+0+0+0+0-0', - 679.0: '+0+0+0+00-', - 680.0: '+0+0+0+000', - 681.0: '+0+0+0+00+', - 682.0: '+0+0+0+0+0', - -11.0: '00000-0+0+', - -682.0: '-0-0-0-0-0', - -681.0: '-0-0-0-00-', - -680.0: '-0-0-0-000', - -679.0: '-0-0-0-00+', - -678.0: '-0-0-0-0+0', - -677.0: '-0-0-00-0-', - -676.0: '-0-0-00-00', - -675.0: '-0-0-00-0+', - -674.0: '-0-0-000-0', - -673.0: '-0-0-0000-', - -672.0: '-0-0-00000', - -671.0: '-0-0-0000+', - -670.0: '-0-0-000+0', - -669.0: '-0-0-00+0-', - -668.0: '-0-0-00+00', - -667.0: '-0-0-00+0+', - -666.0: '-0-0-0+0-0', - -665.0: '-0-0-0+00-', - -664.0: '-0-0-0+000', - -663.0: '-0-0-0+00+', - -662.0: '-0-0-0+0+0', - -661.0: '-0-00-0-0-', - -660.0: '-0-00-0-00', - -659.0: '-0-00-0-0+', - -658.0: '-0-00-00-0', - -657.0: '-0-00-000-', - -656.0: '-0-00-0000', - -655.0: '-0-00-000+', - -654.0: '-0-00-00+0', - -653.0: '-0-00-0+0-', - -652.0: '-0-00-0+00', - -651.0: '-0-00-0+0+', - -650.0: '-0-000-0-0', - -649.0: '-0-000-00-', - -648.0: '-0-000-000', - -647.0: '-0-000-00+', - -646.0: '-0-000-0+0', - -645.0: '-0-0000-0-', - -644.0: '-0-0000-00', - -643.0: '-0-0000-0+', - -642.0: '-0-00000-0', - -641.0: '-0-000000-', - -640.0: '-0-0000000', - -639.0: '-0-000000+', - -638.0: '-0-00000+0', - -637.0: '-0-0000+0-', - -636.0: '-0-0000+00', - -635.0: '-0-0000+0+', - -634.0: '-0-000+0-0', - -633.0: '-0-000+00-', - -632.0: '-0-000+000', - -631.0: '-0-000+00+', - -630.0: '-0-000+0+0', - -629.0: '-0-00+0-0-', - -628.0: '-0-00+0-00', - -627.0: '-0-00+0-0+', - -626.0: '-0-00+00-0', - -625.0: '-0-00+000-', - -624.0: '-0-00+0000', - -623.0: '-0-00+000+', - -622.0: '-0-00+00+0', - -621.0: '-0-00+0+0-', - -620.0: '-0-00+0+00', - -619.0: '-0-00+0+0+', - -618.0: '-0-0+0-0-0', - -617.0: '-0-0+0-00-', - -616.0: '-0-0+0-000', - -615.0: '-0-0+0-00+', - -614.0: '-0-0+0-0+0', - -613.0: '-0-0+00-0-', - -612.0: '-0-0+00-00', - -611.0: '-0-0+00-0+', - -610.0: '-0-0+000-0', - -609.0: '-0-0+0000-', - -608.0: '-0-0+00000', - -607.0: '-0-0+0000+', - -606.0: '-0-0+000+0', - -605.0: '-0-0+00+0-', - -604.0: '-0-0+00+00', - -603.0: '-0-0+00+0+', - -602.0: '-0-0+0+0-0', - -601.0: '-0-0+0+00-', - -600.0: '-0-0+0+000', - -599.0: '-0-0+0+00+', - -598.0: '-0-0+0+0+0', - -597.0: '-00-0-0-0-', - -596.0: '-00-0-0-00', - -595.0: '-00-0-0-0+', - -594.0: '-00-0-00-0', - -593.0: '-00-0-000-', - -592.0: '-00-0-0000', - -591.0: '-00-0-000+', - -590.0: '-00-0-00+0', - -589.0: '-00-0-0+0-', - -588.0: '-00-0-0+00', - -587.0: '-00-0-0+0+', - -586.0: '-00-00-0-0', - -585.0: '-00-00-00-', - -584.0: '-00-00-000', - -583.0: '-00-00-00+', - -582.0: '-00-00-0+0', - -581.0: '-00-000-0-', - -580.0: '-00-000-00', - -579.0: '-00-000-0+', - -578.0: '-00-0000-0', - -577.0: '-00-00000-', - -576.0: '-00-000000', - -575.0: '-00-00000+', - -574.0: '-00-0000+0', - -573.0: '-00-000+0-', - -572.0: '-00-000+00', - -571.0: '-00-000+0+', - -570.0: '-00-00+0-0', - -569.0: '-00-00+00-', - -568.0: '-00-00+000', - -567.0: '-00-00+00+', - -566.0: '-00-00+0+0', - -565.0: '-00-0+0-0-', - -564.0: '-00-0+0-00', - -563.0: '-00-0+0-0+', - -562.0: '-00-0+00-0', - -561.0: '-00-0+000-', - -560.0: '-00-0+0000', - -559.0: '-00-0+000+', - -558.0: '-00-0+00+0', - -557.0: '-00-0+0+0-', - -556.0: '-00-0+0+00', - -555.0: '-00-0+0+0+', - -554.0: '-000-0-0-0', - -553.0: '-000-0-00-', - -552.0: '-000-0-000', - -551.0: '-000-0-00+', - -550.0: '-000-0-0+0', - -549.0: '-000-00-0-', - -548.0: '-000-00-00', - -547.0: '-000-00-0+', - -546.0: '-000-000-0', - -545.0: '-000-0000-', - -544.0: '-000-00000', - -543.0: '-000-0000+', - -542.0: '-000-000+0', - -541.0: '-000-00+0-', - -540.0: '-000-00+00', - -539.0: '-000-00+0+', - -538.0: '-000-0+0-0', - -537.0: '-000-0+00-', - -536.0: '-000-0+000', - -535.0: '-000-0+00+', - -534.0: '-000-0+0+0', - -533.0: '-0000-0-0-', - -532.0: '-0000-0-00', - -531.0: '-0000-0-0+', - -530.0: '-0000-00-0', - -529.0: '-0000-000-', - -528.0: '-0000-0000', - -527.0: '-0000-000+', - -526.0: '-0000-00+0', - -525.0: '-0000-0+0-', - -524.0: '-0000-0+00', - -523.0: '-0000-0+0+', - -522.0: '-00000-0-0', - -521.0: '-00000-00-', - -520.0: '-00000-000', - -519.0: '-00000-00+', - -518.0: '-00000-0+0', - -517.0: '-000000-0-', - -516.0: '-000000-00', - -515.0: '-000000-0+', - -514.0: '-0000000-0', - -513.0: '-00000000-', - -512.0: '-000000000', - -511.0: '-00000000+', - -510.0: '-0000000+0', - -509.0: '-000000+0-', - -508.0: '-000000+00', - -507.0: '-000000+0+', - -506.0: '-00000+0-0', - -505.0: '-00000+00-', - -504.0: '-00000+000', - -503.0: '-00000+00+', - -502.0: '-00000+0+0', - -501.0: '-0000+0-0-', - -500.0: '-0000+0-00', - -499.0: '-0000+0-0+', - -498.0: '-0000+00-0', - -497.0: '-0000+000-', - -496.0: '-0000+0000', - -495.0: '-0000+000+', - -494.0: '-0000+00+0', - -493.0: '-0000+0+0-', - -492.0: '-0000+0+00', - -491.0: '-0000+0+0+', - -490.0: '-000+0-0-0', - -489.0: '-000+0-00-', - -488.0: '-000+0-000', - -487.0: '-000+0-00+', - -486.0: '-000+0-0+0', - -485.0: '-000+00-0-', - -484.0: '-000+00-00', - -483.0: '-000+00-0+', - -482.0: '-000+000-0', - -481.0: '-000+0000-', - -480.0: '-000+00000', - -479.0: '-000+0000+', - -478.0: '-000+000+0', - -477.0: '-000+00+0-', - -476.0: '-000+00+00', - -475.0: '-000+00+0+', - -474.0: '-000+0+0-0', - -473.0: '-000+0+00-', - -472.0: '-000+0+000', - -471.0: '-000+0+00+', - -470.0: '-000+0+0+0', - -469.0: '-00+0-0-0-', - -468.0: '-00+0-0-00', - -467.0: '-00+0-0-0+', - -466.0: '-00+0-00-0', - -465.0: '-00+0-000-', - -464.0: '-00+0-0000', - -463.0: '-00+0-000+', - -462.0: '-00+0-00+0', - -461.0: '-00+0-0+0-', - -460.0: '-00+0-0+00', - -459.0: '-00+0-0+0+', - -458.0: '-00+00-0-0', - -457.0: '-00+00-00-', - -456.0: '-00+00-000', - -455.0: '-00+00-00+', - -454.0: '-00+00-0+0', - -453.0: '-00+000-0-', - -452.0: '-00+000-00', - -451.0: '-00+000-0+', - -450.0: '-00+0000-0', - -449.0: '-00+00000-', - -448.0: '-00+000000', - -447.0: '-00+00000+', - -446.0: '-00+0000+0', - -445.0: '-00+000+0-', - -444.0: '-00+000+00', - -443.0: '-00+000+0+', - -442.0: '-00+00+0-0', - -441.0: '-00+00+00-', - -440.0: '-00+00+000', - -439.0: '-00+00+00+', - -438.0: '-00+00+0+0', - -437.0: '-00+0+0-0-', - -436.0: '-00+0+0-00', - -435.0: '-00+0+0-0+', - -434.0: '-00+0+00-0', - -433.0: '-00+0+000-', - -432.0: '-00+0+0000', - -431.0: '-00+0+000+', - -430.0: '-00+0+00+0', - -429.0: '-00+0+0+0-', - -428.0: '-00+0+0+00', - -427.0: '-00+0+0+0+', - -426.0: '-0+0-0-0-0', - -425.0: '-0+0-0-00-', - -424.0: '-0+0-0-000', - -423.0: '-0+0-0-00+', - -422.0: '-0+0-0-0+0', - -421.0: '-0+0-00-0-', - -420.0: '-0+0-00-00', - -419.0: '-0+0-00-0+', - -418.0: '-0+0-000-0', - -417.0: '-0+0-0000-', - -416.0: '-0+0-00000', - -415.0: '-0+0-0000+', - -414.0: '-0+0-000+0', - -413.0: '-0+0-00+0-', - -412.0: '-0+0-00+00', - -411.0: '-0+0-00+0+', - -410.0: '-0+0-0+0-0', - -409.0: '-0+0-0+00-', - -408.0: '-0+0-0+000', - -407.0: '-0+0-0+00+', - -406.0: '-0+0-0+0+0', - -405.0: '-0+00-0-0-', - -404.0: '-0+00-0-00', - -403.0: '-0+00-0-0+', - -402.0: '-0+00-00-0', - -401.0: '-0+00-000-', - -400.0: '-0+00-0000', - -399.0: '-0+00-000+', - -398.0: '-0+00-00+0', - -397.0: '-0+00-0+0-', - -396.0: '-0+00-0+00', - -395.0: '-0+00-0+0+', - -394.0: '-0+000-0-0', - -393.0: '-0+000-00-', - -392.0: '-0+000-000', - -391.0: '-0+000-00+', - -390.0: '-0+000-0+0', - -389.0: '-0+0000-0-', - -388.0: '-0+0000-00', - -387.0: '-0+0000-0+', - -386.0: '-0+00000-0', - -385.0: '-0+000000-', - -384.0: '-0+0000000', - -383.0: '-0+000000+', - -382.0: '-0+00000+0', - -381.0: '-0+0000+0-', - -380.0: '-0+0000+00', - -379.0: '-0+0000+0+', - -378.0: '-0+000+0-0', - -377.0: '-0+000+00-', - -376.0: '-0+000+000', - -375.0: '-0+000+00+', - -374.0: '-0+000+0+0', - -373.0: '-0+00+0-0-', - -372.0: '-0+00+0-00', - -371.0: '-0+00+0-0+', - -370.0: '-0+00+00-0', - -369.0: '-0+00+000-', - -368.0: '-0+00+0000', - -367.0: '-0+00+000+', - -366.0: '-0+00+00+0', - -365.0: '-0+00+0+0-', - -364.0: '-0+00+0+00', - -363.0: '-0+00+0+0+', - -362.0: '-0+0+0-0-0', - -361.0: '-0+0+0-00-', - -360.0: '-0+0+0-000', - -359.0: '-0+0+0-00+', - -358.0: '-0+0+0-0+0', - -357.0: '-0+0+00-0-', - -356.0: '-0+0+00-00', - -355.0: '-0+0+00-0+', - -354.0: '-0+0+000-0', - -353.0: '-0+0+0000-', - -352.0: '-0+0+00000', - -351.0: '-0+0+0000+', - -350.0: '-0+0+000+0', - -349.0: '-0+0+00+0-', - -348.0: '-0+0+00+00', - -347.0: '-0+0+00+0+', - -346.0: '-0+0+0+0-0', - -345.0: '-0+0+0+00-', - -344.0: '-0+0+0+000', - -343.0: '-0+0+0+00+', - -342.0: '-0+0+0+0+0', - -341.0: '0-0-0-0-0-', - -340.0: '0-0-0-0-00', - -339.0: '0-0-0-0-0+', - -338.0: '0-0-0-00-0', - -337.0: '0-0-0-000-', - -336.0: '0-0-0-0000', - -335.0: '0-0-0-000+', - -334.0: '0-0-0-00+0', - -333.0: '0-0-0-0+0-', - -332.0: '0-0-0-0+00', - -331.0: '0-0-0-0+0+', - -330.0: '0-0-00-0-0', - -329.0: '0-0-00-00-', - -328.0: '0-0-00-000', - -327.0: '0-0-00-00+', - -326.0: '0-0-00-0+0', - -325.0: '0-0-000-0-', - -324.0: '0-0-000-00', - -323.0: '0-0-000-0+', - -322.0: '0-0-0000-0', - -321.0: '0-0-00000-', - -320.0: '0-0-000000', - -319.0: '0-0-00000+', - -318.0: '0-0-0000+0', - -317.0: '0-0-000+0-', - -316.0: '0-0-000+00', - -315.0: '0-0-000+0+', - -314.0: '0-0-00+0-0', - -313.0: '0-0-00+00-', - -312.0: '0-0-00+000', - -311.0: '0-0-00+00+', - -310.0: '0-0-00+0+0', - -309.0: '0-0-0+0-0-', - -308.0: '0-0-0+0-00', - -307.0: '0-0-0+0-0+', - -306.0: '0-0-0+00-0', - -305.0: '0-0-0+000-', - -304.0: '0-0-0+0000', - -303.0: '0-0-0+000+', - -302.0: '0-0-0+00+0', - -301.0: '0-0-0+0+0-', - -300.0: '0-0-0+0+00', - -299.0: '0-0-0+0+0+', - -298.0: '0-00-0-0-0', - -297.0: '0-00-0-00-', - -296.0: '0-00-0-000', - -295.0: '0-00-0-00+', - -294.0: '0-00-0-0+0', - -293.0: '0-00-00-0-', - -292.0: '0-00-00-00', - -291.0: '0-00-00-0+', - -290.0: '0-00-000-0', - -289.0: '0-00-0000-', - -288.0: '0-00-00000', - -287.0: '0-00-0000+', - -286.0: '0-00-000+0', - -285.0: '0-00-00+0-', - -284.0: '0-00-00+00', - -283.0: '0-00-00+0+', - -282.0: '0-00-0+0-0', - -281.0: '0-00-0+00-', - -280.0: '0-00-0+000', - -279.0: '0-00-0+00+', - -278.0: '0-00-0+0+0', - -277.0: '0-000-0-0-', - -276.0: '0-000-0-00', - -275.0: '0-000-0-0+', - -274.0: '0-000-00-0', - -273.0: '0-000-000-', - -272.0: '0-000-0000', - -271.0: '0-000-000+', - -270.0: '0-000-00+0', - -269.0: '0-000-0+0-', - -268.0: '0-000-0+00', - -267.0: '0-000-0+0+', - -266.0: '0-0000-0-0', - -265.0: '0-0000-00-', - -264.0: '0-0000-000', - -263.0: '0-0000-00+', - -262.0: '0-0000-0+0', - -261.0: '0-00000-0-', - -260.0: '0-00000-00', - -259.0: '0-00000-0+', - -258.0: '0-000000-0', - -257.0: '0-0000000-', - -256.0: '0-00000000', - -255.0: '0-0000000+', - -254.0: '0-000000+0', - -253.0: '0-00000+0-', - -252.0: '0-00000+00', - -251.0: '0-00000+0+', - -250.0: '0-0000+0-0', - -249.0: '0-0000+00-', - -248.0: '0-0000+000', - -247.0: '0-0000+00+', - -246.0: '0-0000+0+0', - -245.0: '0-000+0-0-', - -244.0: '0-000+0-00', - -243.0: '0-000+0-0+', - -242.0: '0-000+00-0', - -241.0: '0-000+000-', - -240.0: '0-000+0000', - -239.0: '0-000+000+', - -238.0: '0-000+00+0', - -237.0: '0-000+0+0-', - -236.0: '0-000+0+00', - -235.0: '0-000+0+0+', - -234.0: '0-00+0-0-0', - -233.0: '0-00+0-00-', - -232.0: '0-00+0-000', - -231.0: '0-00+0-00+', - -230.0: '0-00+0-0+0', - -229.0: '0-00+00-0-', - -228.0: '0-00+00-00', - -227.0: '0-00+00-0+', - -226.0: '0-00+000-0', - -225.0: '0-00+0000-', - -224.0: '0-00+00000', - -223.0: '0-00+0000+', - -222.0: '0-00+000+0', - -221.0: '0-00+00+0-', - -220.0: '0-00+00+00', - -219.0: '0-00+00+0+', - -218.0: '0-00+0+0-0', - -217.0: '0-00+0+00-', - -216.0: '0-00+0+000', - -215.0: '0-00+0+00+', - -214.0: '0-00+0+0+0', - -213.0: '0-0+0-0-0-', - -212.0: '0-0+0-0-00', - -211.0: '0-0+0-0-0+', - -210.0: '0-0+0-00-0', - -209.0: '0-0+0-000-', - -208.0: '0-0+0-0000', - -207.0: '0-0+0-000+', - -206.0: '0-0+0-00+0', - -205.0: '0-0+0-0+0-', - -204.0: '0-0+0-0+00', - -203.0: '0-0+0-0+0+', - -202.0: '0-0+00-0-0', - -201.0: '0-0+00-00-', - -200.0: '0-0+00-000', - -199.0: '0-0+00-00+', - -198.0: '0-0+00-0+0', - -197.0: '0-0+000-0-', - -196.0: '0-0+000-00', - -195.0: '0-0+000-0+', - -194.0: '0-0+0000-0', - -193.0: '0-0+00000-', - -192.0: '0-0+000000', - -191.0: '0-0+00000+', - -190.0: '0-0+0000+0', - -189.0: '0-0+000+0-', - -188.0: '0-0+000+00', - -187.0: '0-0+000+0+', - -186.0: '0-0+00+0-0', - -185.0: '0-0+00+00-', - -184.0: '0-0+00+000', - -183.0: '0-0+00+00+', - -182.0: '0-0+00+0+0', - -181.0: '0-0+0+0-0-', - -180.0: '0-0+0+0-00', - -179.0: '0-0+0+0-0+', - -178.0: '0-0+0+00-0', - -177.0: '0-0+0+000-', - -176.0: '0-0+0+0000', - -175.0: '0-0+0+000+', - -174.0: '0-0+0+00+0', - -173.0: '0-0+0+0+0-', - -172.0: '0-0+0+0+00', - -171.0: '0-0+0+0+0+', - -170.0: '00-0-0-0-0', - -169.0: '00-0-0-00-', - -168.0: '00-0-0-000', - -167.0: '00-0-0-00+', - -166.0: '00-0-0-0+0', - -165.0: '00-0-00-0-', - -164.0: '00-0-00-00', - -163.0: '00-0-00-0+', - -162.0: '00-0-000-0', - -161.0: '00-0-0000-', - -160.0: '00-0-00000', - -159.0: '00-0-0000+', - -158.0: '00-0-000+0', - -157.0: '00-0-00+0-', - -156.0: '00-0-00+00', - -155.0: '00-0-00+0+', - -154.0: '00-0-0+0-0', - -153.0: '00-0-0+00-', - -152.0: '00-0-0+000', - -151.0: '00-0-0+00+', - -150.0: '00-0-0+0+0', - -149.0: '00-00-0-0-', - -148.0: '00-00-0-00', - -147.0: '00-00-0-0+', - -146.0: '00-00-00-0', - -145.0: '00-00-000-', - -144.0: '00-00-0000', - -143.0: '00-00-000+', - -142.0: '00-00-00+0', - -141.0: '00-00-0+0-', - -140.0: '00-00-0+00', - -139.0: '00-00-0+0+', - -138.0: '00-000-0-0', - -137.0: '00-000-00-', - -136.0: '00-000-000', - -135.0: '00-000-00+', - -134.0: '00-000-0+0', - -133.0: '00-0000-0-', - -132.0: '00-0000-00', - -131.0: '00-0000-0+', - -130.0: '00-00000-0', - -129.0: '00-000000-', - -128.0: '00-0000000', - -127.0: '00-000000+', - -126.0: '00-00000+0', - -125.0: '00-0000+0-', - -124.0: '00-0000+00', - -123.0: '00-0000+0+', - -122.0: '00-000+0-0', - -121.0: '00-000+00-', - -120.0: '00-000+000', - -119.0: '00-000+00+', - -118.0: '00-000+0+0', - -117.0: '00-00+0-0-', - -116.0: '00-00+0-00', - -115.0: '00-00+0-0+', - -114.0: '00-00+00-0', - -113.0: '00-00+000-', - -112.0: '00-00+0000', - -111.0: '00-00+000+', - -110.0: '00-00+00+0', - -109.0: '00-00+0+0-', - -108.0: '00-00+0+00', - -107.0: '00-00+0+0+', - -106.0: '00-0+0-0-0', - -105.0: '00-0+0-00-', - -104.0: '00-0+0-000', - -103.0: '00-0+0-00+', - -102.0: '00-0+0-0+0', - -101.0: '00-0+00-0-', - -100.0: '00-0+00-00', - -99.0: '00-0+00-0+', - -98.0: '00-0+000-0', - -97.0: '00-0+0000-', - -96.0: '00-0+00000', - -95.0: '00-0+0000+', - -94.0: '00-0+000+0', - -93.0: '00-0+00+0-', - -92.0: '00-0+00+00', - -91.0: '00-0+00+0+', - -90.0: '00-0+0+0-0', - -89.0: '00-0+0+00-', - -88.0: '00-0+0+000', - -87.0: '00-0+0+00+', - -86.0: '00-0+0+0+0', - -85.0: '000-0-0-0-', - -84.0: '000-0-0-00', - -83.0: '000-0-0-0+', - -82.0: '000-0-00-0', - -81.0: '000-0-000-', - -80.0: '000-0-0000', - -79.0: '000-0-000+', - -78.0: '000-0-00+0', - -77.0: '000-0-0+0-', - -76.0: '000-0-0+00', - -75.0: '000-0-0+0+', - -74.0: '000-00-0-0', - -73.0: '000-00-00-', - -72.0: '000-00-000', - -71.0: '000-00-00+', - -70.0: '000-00-0+0', - -69.0: '000-000-0-', - -68.0: '000-000-00', - -67.0: '000-000-0+', - -66.0: '000-0000-0', - -65.0: '000-00000-', - -64.0: '000-000000', - -63.0: '000-00000+', - -62.0: '000-0000+0', - -61.0: '000-000+0-', - -60.0: '000-000+00', - -59.0: '000-000+0+', - -58.0: '000-00+0-0', - -57.0: '000-00+00-', - -56.0: '000-00+000', - -55.0: '000-00+00+', - -54.0: '000-00+0+0', - -53.0: '000-0+0-0-', - -52.0: '000-0+0-00', - -51.0: '000-0+0-0+', - -50.0: '000-0+00-0', - -49.0: '000-0+000-', - -48.0: '000-0+0000', - -47.0: '000-0+000+', - -46.0: '000-0+00+0', - -45.0: '000-0+0+0-', - -44.0: '000-0+0+00', - -43.0: '000-0+0+0+', - -42.0: '0000-0-0-0', - -41.0: '0000-0-00-', - -40.0: '0000-0-000', - -39.0: '0000-0-00+', - -38.0: '0000-0-0+0', - -37.0: '0000-00-0-', - -36.0: '0000-00-00', - -35.0: '0000-00-0+', - -34.0: '0000-000-0', - -33.0: '0000-0000-', - -32.0: '0000-00000', - -31.0: '0000-0000+', - -30.0: '0000-000+0', - -29.0: '0000-00+0-', - -28.0: '0000-00+00', - -27.0: '0000-00+0+', - -26.0: '0000-0+0-0', - -25.0: '0000-0+00-', - -24.0: '0000-0+000', - -23.0: '0000-0+00+', - -22.0: '0000-0+0+0', - -21.0: '00000-0-0-', - -20.0: '00000-0-00', - -19.0: '00000-0-0+', - -18.0: '00000-00-0', - -17.0: '00000-000-', - -16.0: '00000-0000', - -15.0: '00000-000+', - -14.0: '00000-00+0', - -13.0: '00000-0+0-', - -12.0: '00000-0+00', - -1.0: '000000000-', - -10.0: '000000-0-0', - -9.0: '000000-00-', - -8.0: '000000-000', - -7.0: '000000-00+', - -6.0: '000000-0+0', - -5.0: '0000000-0-', - -4.0: '0000000-00', - -3.0: '0000000-0+', - -2.0: '00000000-0' + 0.0: "0000000000", + 1.0: "000000000+", + 2.0: "00000000+0", + 3.0: "0000000+0-", + 4.0: "0000000+00", + 5.0: "0000000+0+", + 6.0: "000000+0-0", + 7.0: "000000+00-", + 8.0: "000000+000", + 9.0: "000000+00+", + 10.0: "000000+0+0", + 11.0: "00000+0-0-", + 12.0: "00000+0-00", + 13.0: "00000+0-0+", + 14.0: "00000+00-0", + 15.0: "00000+000-", + 16.0: "00000+0000", + 17.0: "00000+000+", + 18.0: "00000+00+0", + 19.0: "00000+0+0-", + 20.0: "00000+0+00", + 21.0: "00000+0+0+", + 22.0: "0000+0-0-0", + 23.0: "0000+0-00-", + 24.0: "0000+0-000", + 25.0: "0000+0-00+", + 26.0: "0000+0-0+0", + 27.0: "0000+00-0-", + 28.0: "0000+00-00", + 29.0: "0000+00-0+", + 30.0: "0000+000-0", + 31.0: "0000+0000-", + 32.0: "0000+00000", + 33.0: "0000+0000+", + 34.0: "0000+000+0", + 35.0: "0000+00+0-", + 36.0: "0000+00+00", + 37.0: "0000+00+0+", + 38.0: "0000+0+0-0", + 39.0: "0000+0+00-", + 40.0: "0000+0+000", + 41.0: "0000+0+00+", + 42.0: "0000+0+0+0", + 43.0: "000+0-0-0-", + 44.0: "000+0-0-00", + 45.0: "000+0-0-0+", + 46.0: "000+0-00-0", + 47.0: "000+0-000-", + 48.0: "000+0-0000", + 49.0: "000+0-000+", + 50.0: "000+0-00+0", + 51.0: "000+0-0+0-", + 52.0: "000+0-0+00", + 53.0: "000+0-0+0+", + 54.0: "000+00-0-0", + 55.0: "000+00-00-", + 56.0: "000+00-000", + 57.0: "000+00-00+", + 58.0: "000+00-0+0", + 59.0: "000+000-0-", + 60.0: "000+000-00", + 61.0: "000+000-0+", + 62.0: "000+0000-0", + 63.0: "000+00000-", + 64.0: "000+000000", + 65.0: "000+00000+", + 66.0: "000+0000+0", + 67.0: "000+000+0-", + 68.0: "000+000+00", + 69.0: "000+000+0+", + 70.0: "000+00+0-0", + 71.0: "000+00+00-", + 72.0: "000+00+000", + 73.0: "000+00+00+", + 74.0: "000+00+0+0", + 75.0: "000+0+0-0-", + 76.0: "000+0+0-00", + 77.0: "000+0+0-0+", + 78.0: "000+0+00-0", + 79.0: "000+0+000-", + 80.0: "000+0+0000", + 81.0: "000+0+000+", + 82.0: "000+0+00+0", + 83.0: "000+0+0+0-", + 84.0: "000+0+0+00", + 85.0: "000+0+0+0+", + 86.0: "00+0-0-0-0", + 87.0: "00+0-0-00-", + 88.0: "00+0-0-000", + 89.0: "00+0-0-00+", + 90.0: "00+0-0-0+0", + 91.0: "00+0-00-0-", + 92.0: "00+0-00-00", + 93.0: "00+0-00-0+", + 94.0: "00+0-000-0", + 95.0: "00+0-0000-", + 96.0: "00+0-00000", + 97.0: "00+0-0000+", + 98.0: "00+0-000+0", + 99.0: "00+0-00+0-", + 100.0: "00+0-00+00", + 101.0: "00+0-00+0+", + 102.0: "00+0-0+0-0", + 103.0: "00+0-0+00-", + 104.0: "00+0-0+000", + 105.0: "00+0-0+00+", + 106.0: "00+0-0+0+0", + 107.0: "00+00-0-0-", + 108.0: "00+00-0-00", + 109.0: "00+00-0-0+", + 110.0: "00+00-00-0", + 111.0: "00+00-000-", + 112.0: "00+00-0000", + 113.0: "00+00-000+", + 114.0: "00+00-00+0", + 115.0: "00+00-0+0-", + 116.0: "00+00-0+00", + 117.0: "00+00-0+0+", + 118.0: "00+000-0-0", + 119.0: "00+000-00-", + 120.0: "00+000-000", + 121.0: "00+000-00+", + 122.0: "00+000-0+0", + 123.0: "00+0000-0-", + 124.0: "00+0000-00", + 125.0: "00+0000-0+", + 126.0: "00+00000-0", + 127.0: "00+000000-", + 128.0: "00+0000000", + 129.0: "00+000000+", + 130.0: "00+00000+0", + 131.0: "00+0000+0-", + 132.0: "00+0000+00", + 133.0: "00+0000+0+", + 134.0: "00+000+0-0", + 135.0: "00+000+00-", + 136.0: "00+000+000", + 137.0: "00+000+00+", + 138.0: "00+000+0+0", + 139.0: "00+00+0-0-", + 140.0: "00+00+0-00", + 141.0: "00+00+0-0+", + 142.0: "00+00+00-0", + 143.0: "00+00+000-", + 144.0: "00+00+0000", + 145.0: "00+00+000+", + 146.0: "00+00+00+0", + 147.0: "00+00+0+0-", + 148.0: "00+00+0+00", + 149.0: "00+00+0+0+", + 150.0: "00+0+0-0-0", + 151.0: "00+0+0-00-", + 152.0: "00+0+0-000", + 153.0: "00+0+0-00+", + 154.0: "00+0+0-0+0", + 155.0: "00+0+00-0-", + 156.0: "00+0+00-00", + 157.0: "00+0+00-0+", + 158.0: "00+0+000-0", + 159.0: "00+0+0000-", + 160.0: "00+0+00000", + 161.0: "00+0+0000+", + 162.0: "00+0+000+0", + 163.0: "00+0+00+0-", + 164.0: "00+0+00+00", + 165.0: "00+0+00+0+", + 166.0: "00+0+0+0-0", + 167.0: "00+0+0+00-", + 168.0: "00+0+0+000", + 169.0: "00+0+0+00+", + 170.0: "00+0+0+0+0", + 171.0: "0+0-0-0-0-", + 172.0: "0+0-0-0-00", + 173.0: "0+0-0-0-0+", + 174.0: "0+0-0-00-0", + 175.0: "0+0-0-000-", + 176.0: "0+0-0-0000", + 177.0: "0+0-0-000+", + 178.0: "0+0-0-00+0", + 179.0: "0+0-0-0+0-", + 180.0: "0+0-0-0+00", + 181.0: "0+0-0-0+0+", + 182.0: "0+0-00-0-0", + 183.0: "0+0-00-00-", + 184.0: "0+0-00-000", + 185.0: "0+0-00-00+", + 186.0: "0+0-00-0+0", + 187.0: "0+0-000-0-", + 188.0: "0+0-000-00", + 189.0: "0+0-000-0+", + 190.0: "0+0-0000-0", + 191.0: "0+0-00000-", + 192.0: "0+0-000000", + 193.0: "0+0-00000+", + 194.0: "0+0-0000+0", + 195.0: "0+0-000+0-", + 196.0: "0+0-000+00", + 197.0: "0+0-000+0+", + 198.0: "0+0-00+0-0", + 199.0: "0+0-00+00-", + 200.0: "0+0-00+000", + 201.0: "0+0-00+00+", + 202.0: "0+0-00+0+0", + 203.0: "0+0-0+0-0-", + 204.0: "0+0-0+0-00", + 205.0: "0+0-0+0-0+", + 206.0: "0+0-0+00-0", + 207.0: "0+0-0+000-", + 208.0: "0+0-0+0000", + 209.0: "0+0-0+000+", + 210.0: "0+0-0+00+0", + 211.0: "0+0-0+0+0-", + 212.0: "0+0-0+0+00", + 213.0: "0+0-0+0+0+", + 214.0: "0+00-0-0-0", + 215.0: "0+00-0-00-", + 216.0: "0+00-0-000", + 217.0: "0+00-0-00+", + 218.0: "0+00-0-0+0", + 219.0: "0+00-00-0-", + 220.0: "0+00-00-00", + 221.0: "0+00-00-0+", + 222.0: "0+00-000-0", + 223.0: "0+00-0000-", + 224.0: "0+00-00000", + 225.0: "0+00-0000+", + 226.0: "0+00-000+0", + 227.0: "0+00-00+0-", + 228.0: "0+00-00+00", + 229.0: "0+00-00+0+", + 230.0: "0+00-0+0-0", + 231.0: "0+00-0+00-", + 232.0: "0+00-0+000", + 233.0: "0+00-0+00+", + 234.0: "0+00-0+0+0", + 235.0: "0+000-0-0-", + 236.0: "0+000-0-00", + 237.0: "0+000-0-0+", + 238.0: "0+000-00-0", + 239.0: "0+000-000-", + 240.0: "0+000-0000", + 241.0: "0+000-000+", + 242.0: "0+000-00+0", + 243.0: "0+000-0+0-", + 244.0: "0+000-0+00", + 245.0: "0+000-0+0+", + 246.0: "0+0000-0-0", + 247.0: "0+0000-00-", + 248.0: "0+0000-000", + 249.0: "0+0000-00+", + 250.0: "0+0000-0+0", + 251.0: "0+00000-0-", + 252.0: "0+00000-00", + 253.0: "0+00000-0+", + 254.0: "0+000000-0", + 255.0: "0+0000000-", + 256.0: "0+00000000", + 257.0: "0+0000000+", + 258.0: "0+000000+0", + 259.0: "0+00000+0-", + 260.0: "0+00000+00", + 261.0: "0+00000+0+", + 262.0: "0+0000+0-0", + 263.0: "0+0000+00-", + 264.0: "0+0000+000", + 265.0: "0+0000+00+", + 266.0: "0+0000+0+0", + 267.0: "0+000+0-0-", + 268.0: "0+000+0-00", + 269.0: "0+000+0-0+", + 270.0: "0+000+00-0", + 271.0: "0+000+000-", + 272.0: "0+000+0000", + 273.0: "0+000+000+", + 274.0: "0+000+00+0", + 275.0: "0+000+0+0-", + 276.0: "0+000+0+00", + 277.0: "0+000+0+0+", + 278.0: "0+00+0-0-0", + 279.0: "0+00+0-00-", + 280.0: "0+00+0-000", + 281.0: "0+00+0-00+", + 282.0: "0+00+0-0+0", + 283.0: "0+00+00-0-", + 284.0: "0+00+00-00", + 285.0: "0+00+00-0+", + 286.0: "0+00+000-0", + 287.0: "0+00+0000-", + 288.0: "0+00+00000", + 289.0: "0+00+0000+", + 290.0: "0+00+000+0", + 291.0: "0+00+00+0-", + 292.0: "0+00+00+00", + 293.0: "0+00+00+0+", + 294.0: "0+00+0+0-0", + 295.0: "0+00+0+00-", + 296.0: "0+00+0+000", + 297.0: "0+00+0+00+", + 298.0: "0+00+0+0+0", + 299.0: "0+0+0-0-0-", + 300.0: "0+0+0-0-00", + 301.0: "0+0+0-0-0+", + 302.0: "0+0+0-00-0", + 303.0: "0+0+0-000-", + 304.0: "0+0+0-0000", + 305.0: "0+0+0-000+", + 306.0: "0+0+0-00+0", + 307.0: "0+0+0-0+0-", + 308.0: "0+0+0-0+00", + 309.0: "0+0+0-0+0+", + 310.0: "0+0+00-0-0", + 311.0: "0+0+00-00-", + 312.0: "0+0+00-000", + 313.0: "0+0+00-00+", + 314.0: "0+0+00-0+0", + 315.0: "0+0+000-0-", + 316.0: "0+0+000-00", + 317.0: "0+0+000-0+", + 318.0: "0+0+0000-0", + 319.0: "0+0+00000-", + 320.0: "0+0+000000", + 321.0: "0+0+00000+", + 322.0: "0+0+0000+0", + 323.0: "0+0+000+0-", + 324.0: "0+0+000+00", + 325.0: "0+0+000+0+", + 326.0: "0+0+00+0-0", + 327.0: "0+0+00+00-", + 328.0: "0+0+00+000", + 329.0: "0+0+00+00+", + 330.0: "0+0+00+0+0", + 331.0: "0+0+0+0-0-", + 332.0: "0+0+0+0-00", + 333.0: "0+0+0+0-0+", + 334.0: "0+0+0+00-0", + 335.0: "0+0+0+000-", + 336.0: "0+0+0+0000", + 337.0: "0+0+0+000+", + 338.0: "0+0+0+00+0", + 339.0: "0+0+0+0+0-", + 340.0: "0+0+0+0+00", + 341.0: "0+0+0+0+0+", + 342.0: "+0-0-0-0-0", + 343.0: "+0-0-0-00-", + 344.0: "+0-0-0-000", + 345.0: "+0-0-0-00+", + 346.0: "+0-0-0-0+0", + 347.0: "+0-0-00-0-", + 348.0: "+0-0-00-00", + 349.0: "+0-0-00-0+", + 350.0: "+0-0-000-0", + 351.0: "+0-0-0000-", + 352.0: "+0-0-00000", + 353.0: "+0-0-0000+", + 354.0: "+0-0-000+0", + 355.0: "+0-0-00+0-", + 356.0: "+0-0-00+00", + 357.0: "+0-0-00+0+", + 358.0: "+0-0-0+0-0", + 359.0: "+0-0-0+00-", + 360.0: "+0-0-0+000", + 361.0: "+0-0-0+00+", + 362.0: "+0-0-0+0+0", + 363.0: "+0-00-0-0-", + 364.0: "+0-00-0-00", + 365.0: "+0-00-0-0+", + 366.0: "+0-00-00-0", + 367.0: "+0-00-000-", + 368.0: "+0-00-0000", + 369.0: "+0-00-000+", + 370.0: "+0-00-00+0", + 371.0: "+0-00-0+0-", + 372.0: "+0-00-0+00", + 373.0: "+0-00-0+0+", + 374.0: "+0-000-0-0", + 375.0: "+0-000-00-", + 376.0: "+0-000-000", + 377.0: "+0-000-00+", + 378.0: "+0-000-0+0", + 379.0: "+0-0000-0-", + 380.0: "+0-0000-00", + 381.0: "+0-0000-0+", + 382.0: "+0-00000-0", + 383.0: "+0-000000-", + 384.0: "+0-0000000", + 385.0: "+0-000000+", + 386.0: "+0-00000+0", + 387.0: "+0-0000+0-", + 388.0: "+0-0000+00", + 389.0: "+0-0000+0+", + 390.0: "+0-000+0-0", + 391.0: "+0-000+00-", + 392.0: "+0-000+000", + 393.0: "+0-000+00+", + 394.0: "+0-000+0+0", + 395.0: "+0-00+0-0-", + 396.0: "+0-00+0-00", + 397.0: "+0-00+0-0+", + 398.0: "+0-00+00-0", + 399.0: "+0-00+000-", + 400.0: "+0-00+0000", + 401.0: "+0-00+000+", + 402.0: "+0-00+00+0", + 403.0: "+0-00+0+0-", + 404.0: "+0-00+0+00", + 405.0: "+0-00+0+0+", + 406.0: "+0-0+0-0-0", + 407.0: "+0-0+0-00-", + 408.0: "+0-0+0-000", + 409.0: "+0-0+0-00+", + 410.0: "+0-0+0-0+0", + 411.0: "+0-0+00-0-", + 412.0: "+0-0+00-00", + 413.0: "+0-0+00-0+", + 414.0: "+0-0+000-0", + 415.0: "+0-0+0000-", + 416.0: "+0-0+00000", + 417.0: "+0-0+0000+", + 418.0: "+0-0+000+0", + 419.0: "+0-0+00+0-", + 420.0: "+0-0+00+00", + 421.0: "+0-0+00+0+", + 422.0: "+0-0+0+0-0", + 423.0: "+0-0+0+00-", + 424.0: "+0-0+0+000", + 425.0: "+0-0+0+00+", + 426.0: "+0-0+0+0+0", + 427.0: "+00-0-0-0-", + 428.0: "+00-0-0-00", + 429.0: "+00-0-0-0+", + 430.0: "+00-0-00-0", + 431.0: "+00-0-000-", + 432.0: "+00-0-0000", + 433.0: "+00-0-000+", + 434.0: "+00-0-00+0", + 435.0: "+00-0-0+0-", + 436.0: "+00-0-0+00", + 437.0: "+00-0-0+0+", + 438.0: "+00-00-0-0", + 439.0: "+00-00-00-", + 440.0: "+00-00-000", + 441.0: "+00-00-00+", + 442.0: "+00-00-0+0", + 443.0: "+00-000-0-", + 444.0: "+00-000-00", + 445.0: "+00-000-0+", + 446.0: "+00-0000-0", + 447.0: "+00-00000-", + 448.0: "+00-000000", + 449.0: "+00-00000+", + 450.0: "+00-0000+0", + 451.0: "+00-000+0-", + 452.0: "+00-000+00", + 453.0: "+00-000+0+", + 454.0: "+00-00+0-0", + 455.0: "+00-00+00-", + 456.0: "+00-00+000", + 457.0: "+00-00+00+", + 458.0: "+00-00+0+0", + 459.0: "+00-0+0-0-", + 460.0: "+00-0+0-00", + 461.0: "+00-0+0-0+", + 462.0: "+00-0+00-0", + 463.0: "+00-0+000-", + 464.0: "+00-0+0000", + 465.0: "+00-0+000+", + 466.0: "+00-0+00+0", + 467.0: "+00-0+0+0-", + 468.0: "+00-0+0+00", + 469.0: "+00-0+0+0+", + 470.0: "+000-0-0-0", + 471.0: "+000-0-00-", + 472.0: "+000-0-000", + 473.0: "+000-0-00+", + 474.0: "+000-0-0+0", + 475.0: "+000-00-0-", + 476.0: "+000-00-00", + 477.0: "+000-00-0+", + 478.0: "+000-000-0", + 479.0: "+000-0000-", + 480.0: "+000-00000", + 481.0: "+000-0000+", + 482.0: "+000-000+0", + 483.0: "+000-00+0-", + 484.0: "+000-00+00", + 485.0: "+000-00+0+", + 486.0: "+000-0+0-0", + 487.0: "+000-0+00-", + 488.0: "+000-0+000", + 489.0: "+000-0+00+", + 490.0: "+000-0+0+0", + 491.0: "+0000-0-0-", + 492.0: "+0000-0-00", + 493.0: "+0000-0-0+", + 494.0: "+0000-00-0", + 495.0: "+0000-000-", + 496.0: "+0000-0000", + 497.0: "+0000-000+", + 498.0: "+0000-00+0", + 499.0: "+0000-0+0-", + 500.0: "+0000-0+00", + 501.0: "+0000-0+0+", + 502.0: "+00000-0-0", + 503.0: "+00000-00-", + 504.0: "+00000-000", + 505.0: "+00000-00+", + 506.0: "+00000-0+0", + 507.0: "+000000-0-", + 508.0: "+000000-00", + 509.0: "+000000-0+", + 510.0: "+0000000-0", + 511.0: "+00000000-", + 512.0: "+000000000", + 513.0: "+00000000+", + 514.0: "+0000000+0", + 515.0: "+000000+0-", + 516.0: "+000000+00", + 517.0: "+000000+0+", + 518.0: "+00000+0-0", + 519.0: "+00000+00-", + 520.0: "+00000+000", + 521.0: "+00000+00+", + 522.0: "+00000+0+0", + 523.0: "+0000+0-0-", + 524.0: "+0000+0-00", + 525.0: "+0000+0-0+", + 526.0: "+0000+00-0", + 527.0: "+0000+000-", + 528.0: "+0000+0000", + 529.0: "+0000+000+", + 530.0: "+0000+00+0", + 531.0: "+0000+0+0-", + 532.0: "+0000+0+00", + 533.0: "+0000+0+0+", + 534.0: "+000+0-0-0", + 535.0: "+000+0-00-", + 536.0: "+000+0-000", + 537.0: "+000+0-00+", + 538.0: "+000+0-0+0", + 539.0: "+000+00-0-", + 540.0: "+000+00-00", + 541.0: "+000+00-0+", + 542.0: "+000+000-0", + 543.0: "+000+0000-", + 544.0: "+000+00000", + 545.0: "+000+0000+", + 546.0: "+000+000+0", + 547.0: "+000+00+0-", + 548.0: "+000+00+00", + 549.0: "+000+00+0+", + 550.0: "+000+0+0-0", + 551.0: "+000+0+00-", + 552.0: "+000+0+000", + 553.0: "+000+0+00+", + 554.0: "+000+0+0+0", + 555.0: "+00+0-0-0-", + 556.0: "+00+0-0-00", + 557.0: "+00+0-0-0+", + 558.0: "+00+0-00-0", + 559.0: "+00+0-000-", + 560.0: "+00+0-0000", + 561.0: "+00+0-000+", + 562.0: "+00+0-00+0", + 563.0: "+00+0-0+0-", + 564.0: "+00+0-0+00", + 565.0: "+00+0-0+0+", + 566.0: "+00+00-0-0", + 567.0: "+00+00-00-", + 568.0: "+00+00-000", + 569.0: "+00+00-00+", + 570.0: "+00+00-0+0", + 571.0: "+00+000-0-", + 572.0: "+00+000-00", + 573.0: "+00+000-0+", + 574.0: "+00+0000-0", + 575.0: "+00+00000-", + 576.0: "+00+000000", + 577.0: "+00+00000+", + 578.0: "+00+0000+0", + 579.0: "+00+000+0-", + 580.0: "+00+000+00", + 581.0: "+00+000+0+", + 582.0: "+00+00+0-0", + 583.0: "+00+00+00-", + 584.0: "+00+00+000", + 585.0: "+00+00+00+", + 586.0: "+00+00+0+0", + 587.0: "+00+0+0-0-", + 588.0: "+00+0+0-00", + 589.0: "+00+0+0-0+", + 590.0: "+00+0+00-0", + 591.0: "+00+0+000-", + 592.0: "+00+0+0000", + 593.0: "+00+0+000+", + 594.0: "+00+0+00+0", + 595.0: "+00+0+0+0-", + 596.0: "+00+0+0+00", + 597.0: "+00+0+0+0+", + 598.0: "+0+0-0-0-0", + 599.0: "+0+0-0-00-", + 600.0: "+0+0-0-000", + 601.0: "+0+0-0-00+", + 602.0: "+0+0-0-0+0", + 603.0: "+0+0-00-0-", + 604.0: "+0+0-00-00", + 605.0: "+0+0-00-0+", + 606.0: "+0+0-000-0", + 607.0: "+0+0-0000-", + 608.0: "+0+0-00000", + 609.0: "+0+0-0000+", + 610.0: "+0+0-000+0", + 611.0: "+0+0-00+0-", + 612.0: "+0+0-00+00", + 613.0: "+0+0-00+0+", + 614.0: "+0+0-0+0-0", + 615.0: "+0+0-0+00-", + 616.0: "+0+0-0+000", + 617.0: "+0+0-0+00+", + 618.0: "+0+0-0+0+0", + 619.0: "+0+00-0-0-", + 620.0: "+0+00-0-00", + 621.0: "+0+00-0-0+", + 622.0: "+0+00-00-0", + 623.0: "+0+00-000-", + 624.0: "+0+00-0000", + 625.0: "+0+00-000+", + 626.0: "+0+00-00+0", + 627.0: "+0+00-0+0-", + 628.0: "+0+00-0+00", + 629.0: "+0+00-0+0+", + 630.0: "+0+000-0-0", + 631.0: "+0+000-00-", + 632.0: "+0+000-000", + 633.0: "+0+000-00+", + 634.0: "+0+000-0+0", + 635.0: "+0+0000-0-", + 636.0: "+0+0000-00", + 637.0: "+0+0000-0+", + 638.0: "+0+00000-0", + 639.0: "+0+000000-", + 640.0: "+0+0000000", + 641.0: "+0+000000+", + 642.0: "+0+00000+0", + 643.0: "+0+0000+0-", + 644.0: "+0+0000+00", + 645.0: "+0+0000+0+", + 646.0: "+0+000+0-0", + 647.0: "+0+000+00-", + 648.0: "+0+000+000", + 649.0: "+0+000+00+", + 650.0: "+0+000+0+0", + 651.0: "+0+00+0-0-", + 652.0: "+0+00+0-00", + 653.0: "+0+00+0-0+", + 654.0: "+0+00+00-0", + 655.0: "+0+00+000-", + 656.0: "+0+00+0000", + 657.0: "+0+00+000+", + 658.0: "+0+00+00+0", + 659.0: "+0+00+0+0-", + 660.0: "+0+00+0+00", + 661.0: "+0+00+0+0+", + 662.0: "+0+0+0-0-0", + 663.0: "+0+0+0-00-", + 664.0: "+0+0+0-000", + 665.0: "+0+0+0-00+", + 666.0: "+0+0+0-0+0", + 667.0: "+0+0+00-0-", + 668.0: "+0+0+00-00", + 669.0: "+0+0+00-0+", + 670.0: "+0+0+000-0", + 671.0: "+0+0+0000-", + 672.0: "+0+0+00000", + 673.0: "+0+0+0000+", + 674.0: "+0+0+000+0", + 675.0: "+0+0+00+0-", + 676.0: "+0+0+00+00", + 677.0: "+0+0+00+0+", + 678.0: "+0+0+0+0-0", + 679.0: "+0+0+0+00-", + 680.0: "+0+0+0+000", + 681.0: "+0+0+0+00+", + 682.0: "+0+0+0+0+0", + -11.0: "00000-0+0+", + -682.0: "-0-0-0-0-0", + -681.0: "-0-0-0-00-", + -680.0: "-0-0-0-000", + -679.0: "-0-0-0-00+", + -678.0: "-0-0-0-0+0", + -677.0: "-0-0-00-0-", + -676.0: "-0-0-00-00", + -675.0: "-0-0-00-0+", + -674.0: "-0-0-000-0", + -673.0: "-0-0-0000-", + -672.0: "-0-0-00000", + -671.0: "-0-0-0000+", + -670.0: "-0-0-000+0", + -669.0: "-0-0-00+0-", + -668.0: "-0-0-00+00", + -667.0: "-0-0-00+0+", + -666.0: "-0-0-0+0-0", + -665.0: "-0-0-0+00-", + -664.0: "-0-0-0+000", + -663.0: "-0-0-0+00+", + -662.0: "-0-0-0+0+0", + -661.0: "-0-00-0-0-", + -660.0: "-0-00-0-00", + -659.0: "-0-00-0-0+", + -658.0: "-0-00-00-0", + -657.0: "-0-00-000-", + -656.0: "-0-00-0000", + -655.0: "-0-00-000+", + -654.0: "-0-00-00+0", + -653.0: "-0-00-0+0-", + -652.0: "-0-00-0+00", + -651.0: "-0-00-0+0+", + -650.0: "-0-000-0-0", + -649.0: "-0-000-00-", + -648.0: "-0-000-000", + -647.0: "-0-000-00+", + -646.0: "-0-000-0+0", + -645.0: "-0-0000-0-", + -644.0: "-0-0000-00", + -643.0: "-0-0000-0+", + -642.0: "-0-00000-0", + -641.0: "-0-000000-", + -640.0: "-0-0000000", + -639.0: "-0-000000+", + -638.0: "-0-00000+0", + -637.0: "-0-0000+0-", + -636.0: "-0-0000+00", + -635.0: "-0-0000+0+", + -634.0: "-0-000+0-0", + -633.0: "-0-000+00-", + -632.0: "-0-000+000", + -631.0: "-0-000+00+", + -630.0: "-0-000+0+0", + -629.0: "-0-00+0-0-", + -628.0: "-0-00+0-00", + -627.0: "-0-00+0-0+", + -626.0: "-0-00+00-0", + -625.0: "-0-00+000-", + -624.0: "-0-00+0000", + -623.0: "-0-00+000+", + -622.0: "-0-00+00+0", + -621.0: "-0-00+0+0-", + -620.0: "-0-00+0+00", + -619.0: "-0-00+0+0+", + -618.0: "-0-0+0-0-0", + -617.0: "-0-0+0-00-", + -616.0: "-0-0+0-000", + -615.0: "-0-0+0-00+", + -614.0: "-0-0+0-0+0", + -613.0: "-0-0+00-0-", + -612.0: "-0-0+00-00", + -611.0: "-0-0+00-0+", + -610.0: "-0-0+000-0", + -609.0: "-0-0+0000-", + -608.0: "-0-0+00000", + -607.0: "-0-0+0000+", + -606.0: "-0-0+000+0", + -605.0: "-0-0+00+0-", + -604.0: "-0-0+00+00", + -603.0: "-0-0+00+0+", + -602.0: "-0-0+0+0-0", + -601.0: "-0-0+0+00-", + -600.0: "-0-0+0+000", + -599.0: "-0-0+0+00+", + -598.0: "-0-0+0+0+0", + -597.0: "-00-0-0-0-", + -596.0: "-00-0-0-00", + -595.0: "-00-0-0-0+", + -594.0: "-00-0-00-0", + -593.0: "-00-0-000-", + -592.0: "-00-0-0000", + -591.0: "-00-0-000+", + -590.0: "-00-0-00+0", + -589.0: "-00-0-0+0-", + -588.0: "-00-0-0+00", + -587.0: "-00-0-0+0+", + -586.0: "-00-00-0-0", + -585.0: "-00-00-00-", + -584.0: "-00-00-000", + -583.0: "-00-00-00+", + -582.0: "-00-00-0+0", + -581.0: "-00-000-0-", + -580.0: "-00-000-00", + -579.0: "-00-000-0+", + -578.0: "-00-0000-0", + -577.0: "-00-00000-", + -576.0: "-00-000000", + -575.0: "-00-00000+", + -574.0: "-00-0000+0", + -573.0: "-00-000+0-", + -572.0: "-00-000+00", + -571.0: "-00-000+0+", + -570.0: "-00-00+0-0", + -569.0: "-00-00+00-", + -568.0: "-00-00+000", + -567.0: "-00-00+00+", + -566.0: "-00-00+0+0", + -565.0: "-00-0+0-0-", + -564.0: "-00-0+0-00", + -563.0: "-00-0+0-0+", + -562.0: "-00-0+00-0", + -561.0: "-00-0+000-", + -560.0: "-00-0+0000", + -559.0: "-00-0+000+", + -558.0: "-00-0+00+0", + -557.0: "-00-0+0+0-", + -556.0: "-00-0+0+00", + -555.0: "-00-0+0+0+", + -554.0: "-000-0-0-0", + -553.0: "-000-0-00-", + -552.0: "-000-0-000", + -551.0: "-000-0-00+", + -550.0: "-000-0-0+0", + -549.0: "-000-00-0-", + -548.0: "-000-00-00", + -547.0: "-000-00-0+", + -546.0: "-000-000-0", + -545.0: "-000-0000-", + -544.0: "-000-00000", + -543.0: "-000-0000+", + -542.0: "-000-000+0", + -541.0: "-000-00+0-", + -540.0: "-000-00+00", + -539.0: "-000-00+0+", + -538.0: "-000-0+0-0", + -537.0: "-000-0+00-", + -536.0: "-000-0+000", + -535.0: "-000-0+00+", + -534.0: "-000-0+0+0", + -533.0: "-0000-0-0-", + -532.0: "-0000-0-00", + -531.0: "-0000-0-0+", + -530.0: "-0000-00-0", + -529.0: "-0000-000-", + -528.0: "-0000-0000", + -527.0: "-0000-000+", + -526.0: "-0000-00+0", + -525.0: "-0000-0+0-", + -524.0: "-0000-0+00", + -523.0: "-0000-0+0+", + -522.0: "-00000-0-0", + -521.0: "-00000-00-", + -520.0: "-00000-000", + -519.0: "-00000-00+", + -518.0: "-00000-0+0", + -517.0: "-000000-0-", + -516.0: "-000000-00", + -515.0: "-000000-0+", + -514.0: "-0000000-0", + -513.0: "-00000000-", + -512.0: "-000000000", + -511.0: "-00000000+", + -510.0: "-0000000+0", + -509.0: "-000000+0-", + -508.0: "-000000+00", + -507.0: "-000000+0+", + -506.0: "-00000+0-0", + -505.0: "-00000+00-", + -504.0: "-00000+000", + -503.0: "-00000+00+", + -502.0: "-00000+0+0", + -501.0: "-0000+0-0-", + -500.0: "-0000+0-00", + -499.0: "-0000+0-0+", + -498.0: "-0000+00-0", + -497.0: "-0000+000-", + -496.0: "-0000+0000", + -495.0: "-0000+000+", + -494.0: "-0000+00+0", + -493.0: "-0000+0+0-", + -492.0: "-0000+0+00", + -491.0: "-0000+0+0+", + -490.0: "-000+0-0-0", + -489.0: "-000+0-00-", + -488.0: "-000+0-000", + -487.0: "-000+0-00+", + -486.0: "-000+0-0+0", + -485.0: "-000+00-0-", + -484.0: "-000+00-00", + -483.0: "-000+00-0+", + -482.0: "-000+000-0", + -481.0: "-000+0000-", + -480.0: "-000+00000", + -479.0: "-000+0000+", + -478.0: "-000+000+0", + -477.0: "-000+00+0-", + -476.0: "-000+00+00", + -475.0: "-000+00+0+", + -474.0: "-000+0+0-0", + -473.0: "-000+0+00-", + -472.0: "-000+0+000", + -471.0: "-000+0+00+", + -470.0: "-000+0+0+0", + -469.0: "-00+0-0-0-", + -468.0: "-00+0-0-00", + -467.0: "-00+0-0-0+", + -466.0: "-00+0-00-0", + -465.0: "-00+0-000-", + -464.0: "-00+0-0000", + -463.0: "-00+0-000+", + -462.0: "-00+0-00+0", + -461.0: "-00+0-0+0-", + -460.0: "-00+0-0+00", + -459.0: "-00+0-0+0+", + -458.0: "-00+00-0-0", + -457.0: "-00+00-00-", + -456.0: "-00+00-000", + -455.0: "-00+00-00+", + -454.0: "-00+00-0+0", + -453.0: "-00+000-0-", + -452.0: "-00+000-00", + -451.0: "-00+000-0+", + -450.0: "-00+0000-0", + -449.0: "-00+00000-", + -448.0: "-00+000000", + -447.0: "-00+00000+", + -446.0: "-00+0000+0", + -445.0: "-00+000+0-", + -444.0: "-00+000+00", + -443.0: "-00+000+0+", + -442.0: "-00+00+0-0", + -441.0: "-00+00+00-", + -440.0: "-00+00+000", + -439.0: "-00+00+00+", + -438.0: "-00+00+0+0", + -437.0: "-00+0+0-0-", + -436.0: "-00+0+0-00", + -435.0: "-00+0+0-0+", + -434.0: "-00+0+00-0", + -433.0: "-00+0+000-", + -432.0: "-00+0+0000", + -431.0: "-00+0+000+", + -430.0: "-00+0+00+0", + -429.0: "-00+0+0+0-", + -428.0: "-00+0+0+00", + -427.0: "-00+0+0+0+", + -426.0: "-0+0-0-0-0", + -425.0: "-0+0-0-00-", + -424.0: "-0+0-0-000", + -423.0: "-0+0-0-00+", + -422.0: "-0+0-0-0+0", + -421.0: "-0+0-00-0-", + -420.0: "-0+0-00-00", + -419.0: "-0+0-00-0+", + -418.0: "-0+0-000-0", + -417.0: "-0+0-0000-", + -416.0: "-0+0-00000", + -415.0: "-0+0-0000+", + -414.0: "-0+0-000+0", + -413.0: "-0+0-00+0-", + -412.0: "-0+0-00+00", + -411.0: "-0+0-00+0+", + -410.0: "-0+0-0+0-0", + -409.0: "-0+0-0+00-", + -408.0: "-0+0-0+000", + -407.0: "-0+0-0+00+", + -406.0: "-0+0-0+0+0", + -405.0: "-0+00-0-0-", + -404.0: "-0+00-0-00", + -403.0: "-0+00-0-0+", + -402.0: "-0+00-00-0", + -401.0: "-0+00-000-", + -400.0: "-0+00-0000", + -399.0: "-0+00-000+", + -398.0: "-0+00-00+0", + -397.0: "-0+00-0+0-", + -396.0: "-0+00-0+00", + -395.0: "-0+00-0+0+", + -394.0: "-0+000-0-0", + -393.0: "-0+000-00-", + -392.0: "-0+000-000", + -391.0: "-0+000-00+", + -390.0: "-0+000-0+0", + -389.0: "-0+0000-0-", + -388.0: "-0+0000-00", + -387.0: "-0+0000-0+", + -386.0: "-0+00000-0", + -385.0: "-0+000000-", + -384.0: "-0+0000000", + -383.0: "-0+000000+", + -382.0: "-0+00000+0", + -381.0: "-0+0000+0-", + -380.0: "-0+0000+00", + -379.0: "-0+0000+0+", + -378.0: "-0+000+0-0", + -377.0: "-0+000+00-", + -376.0: "-0+000+000", + -375.0: "-0+000+00+", + -374.0: "-0+000+0+0", + -373.0: "-0+00+0-0-", + -372.0: "-0+00+0-00", + -371.0: "-0+00+0-0+", + -370.0: "-0+00+00-0", + -369.0: "-0+00+000-", + -368.0: "-0+00+0000", + -367.0: "-0+00+000+", + -366.0: "-0+00+00+0", + -365.0: "-0+00+0+0-", + -364.0: "-0+00+0+00", + -363.0: "-0+00+0+0+", + -362.0: "-0+0+0-0-0", + -361.0: "-0+0+0-00-", + -360.0: "-0+0+0-000", + -359.0: "-0+0+0-00+", + -358.0: "-0+0+0-0+0", + -357.0: "-0+0+00-0-", + -356.0: "-0+0+00-00", + -355.0: "-0+0+00-0+", + -354.0: "-0+0+000-0", + -353.0: "-0+0+0000-", + -352.0: "-0+0+00000", + -351.0: "-0+0+0000+", + -350.0: "-0+0+000+0", + -349.0: "-0+0+00+0-", + -348.0: "-0+0+00+00", + -347.0: "-0+0+00+0+", + -346.0: "-0+0+0+0-0", + -345.0: "-0+0+0+00-", + -344.0: "-0+0+0+000", + -343.0: "-0+0+0+00+", + -342.0: "-0+0+0+0+0", + -341.0: "0-0-0-0-0-", + -340.0: "0-0-0-0-00", + -339.0: "0-0-0-0-0+", + -338.0: "0-0-0-00-0", + -337.0: "0-0-0-000-", + -336.0: "0-0-0-0000", + -335.0: "0-0-0-000+", + -334.0: "0-0-0-00+0", + -333.0: "0-0-0-0+0-", + -332.0: "0-0-0-0+00", + -331.0: "0-0-0-0+0+", + -330.0: "0-0-00-0-0", + -329.0: "0-0-00-00-", + -328.0: "0-0-00-000", + -327.0: "0-0-00-00+", + -326.0: "0-0-00-0+0", + -325.0: "0-0-000-0-", + -324.0: "0-0-000-00", + -323.0: "0-0-000-0+", + -322.0: "0-0-0000-0", + -321.0: "0-0-00000-", + -320.0: "0-0-000000", + -319.0: "0-0-00000+", + -318.0: "0-0-0000+0", + -317.0: "0-0-000+0-", + -316.0: "0-0-000+00", + -315.0: "0-0-000+0+", + -314.0: "0-0-00+0-0", + -313.0: "0-0-00+00-", + -312.0: "0-0-00+000", + -311.0: "0-0-00+00+", + -310.0: "0-0-00+0+0", + -309.0: "0-0-0+0-0-", + -308.0: "0-0-0+0-00", + -307.0: "0-0-0+0-0+", + -306.0: "0-0-0+00-0", + -305.0: "0-0-0+000-", + -304.0: "0-0-0+0000", + -303.0: "0-0-0+000+", + -302.0: "0-0-0+00+0", + -301.0: "0-0-0+0+0-", + -300.0: "0-0-0+0+00", + -299.0: "0-0-0+0+0+", + -298.0: "0-00-0-0-0", + -297.0: "0-00-0-00-", + -296.0: "0-00-0-000", + -295.0: "0-00-0-00+", + -294.0: "0-00-0-0+0", + -293.0: "0-00-00-0-", + -292.0: "0-00-00-00", + -291.0: "0-00-00-0+", + -290.0: "0-00-000-0", + -289.0: "0-00-0000-", + -288.0: "0-00-00000", + -287.0: "0-00-0000+", + -286.0: "0-00-000+0", + -285.0: "0-00-00+0-", + -284.0: "0-00-00+00", + -283.0: "0-00-00+0+", + -282.0: "0-00-0+0-0", + -281.0: "0-00-0+00-", + -280.0: "0-00-0+000", + -279.0: "0-00-0+00+", + -278.0: "0-00-0+0+0", + -277.0: "0-000-0-0-", + -276.0: "0-000-0-00", + -275.0: "0-000-0-0+", + -274.0: "0-000-00-0", + -273.0: "0-000-000-", + -272.0: "0-000-0000", + -271.0: "0-000-000+", + -270.0: "0-000-00+0", + -269.0: "0-000-0+0-", + -268.0: "0-000-0+00", + -267.0: "0-000-0+0+", + -266.0: "0-0000-0-0", + -265.0: "0-0000-00-", + -264.0: "0-0000-000", + -263.0: "0-0000-00+", + -262.0: "0-0000-0+0", + -261.0: "0-00000-0-", + -260.0: "0-00000-00", + -259.0: "0-00000-0+", + -258.0: "0-000000-0", + -257.0: "0-0000000-", + -256.0: "0-00000000", + -255.0: "0-0000000+", + -254.0: "0-000000+0", + -253.0: "0-00000+0-", + -252.0: "0-00000+00", + -251.0: "0-00000+0+", + -250.0: "0-0000+0-0", + -249.0: "0-0000+00-", + -248.0: "0-0000+000", + -247.0: "0-0000+00+", + -246.0: "0-0000+0+0", + -245.0: "0-000+0-0-", + -244.0: "0-000+0-00", + -243.0: "0-000+0-0+", + -242.0: "0-000+00-0", + -241.0: "0-000+000-", + -240.0: "0-000+0000", + -239.0: "0-000+000+", + -238.0: "0-000+00+0", + -237.0: "0-000+0+0-", + -236.0: "0-000+0+00", + -235.0: "0-000+0+0+", + -234.0: "0-00+0-0-0", + -233.0: "0-00+0-00-", + -232.0: "0-00+0-000", + -231.0: "0-00+0-00+", + -230.0: "0-00+0-0+0", + -229.0: "0-00+00-0-", + -228.0: "0-00+00-00", + -227.0: "0-00+00-0+", + -226.0: "0-00+000-0", + -225.0: "0-00+0000-", + -224.0: "0-00+00000", + -223.0: "0-00+0000+", + -222.0: "0-00+000+0", + -221.0: "0-00+00+0-", + -220.0: "0-00+00+00", + -219.0: "0-00+00+0+", + -218.0: "0-00+0+0-0", + -217.0: "0-00+0+00-", + -216.0: "0-00+0+000", + -215.0: "0-00+0+00+", + -214.0: "0-00+0+0+0", + -213.0: "0-0+0-0-0-", + -212.0: "0-0+0-0-00", + -211.0: "0-0+0-0-0+", + -210.0: "0-0+0-00-0", + -209.0: "0-0+0-000-", + -208.0: "0-0+0-0000", + -207.0: "0-0+0-000+", + -206.0: "0-0+0-00+0", + -205.0: "0-0+0-0+0-", + -204.0: "0-0+0-0+00", + -203.0: "0-0+0-0+0+", + -202.0: "0-0+00-0-0", + -201.0: "0-0+00-00-", + -200.0: "0-0+00-000", + -199.0: "0-0+00-00+", + -198.0: "0-0+00-0+0", + -197.0: "0-0+000-0-", + -196.0: "0-0+000-00", + -195.0: "0-0+000-0+", + -194.0: "0-0+0000-0", + -193.0: "0-0+00000-", + -192.0: "0-0+000000", + -191.0: "0-0+00000+", + -190.0: "0-0+0000+0", + -189.0: "0-0+000+0-", + -188.0: "0-0+000+00", + -187.0: "0-0+000+0+", + -186.0: "0-0+00+0-0", + -185.0: "0-0+00+00-", + -184.0: "0-0+00+000", + -183.0: "0-0+00+00+", + -182.0: "0-0+00+0+0", + -181.0: "0-0+0+0-0-", + -180.0: "0-0+0+0-00", + -179.0: "0-0+0+0-0+", + -178.0: "0-0+0+00-0", + -177.0: "0-0+0+000-", + -176.0: "0-0+0+0000", + -175.0: "0-0+0+000+", + -174.0: "0-0+0+00+0", + -173.0: "0-0+0+0+0-", + -172.0: "0-0+0+0+00", + -171.0: "0-0+0+0+0+", + -170.0: "00-0-0-0-0", + -169.0: "00-0-0-00-", + -168.0: "00-0-0-000", + -167.0: "00-0-0-00+", + -166.0: "00-0-0-0+0", + -165.0: "00-0-00-0-", + -164.0: "00-0-00-00", + -163.0: "00-0-00-0+", + -162.0: "00-0-000-0", + -161.0: "00-0-0000-", + -160.0: "00-0-00000", + -159.0: "00-0-0000+", + -158.0: "00-0-000+0", + -157.0: "00-0-00+0-", + -156.0: "00-0-00+00", + -155.0: "00-0-00+0+", + -154.0: "00-0-0+0-0", + -153.0: "00-0-0+00-", + -152.0: "00-0-0+000", + -151.0: "00-0-0+00+", + -150.0: "00-0-0+0+0", + -149.0: "00-00-0-0-", + -148.0: "00-00-0-00", + -147.0: "00-00-0-0+", + -146.0: "00-00-00-0", + -145.0: "00-00-000-", + -144.0: "00-00-0000", + -143.0: "00-00-000+", + -142.0: "00-00-00+0", + -141.0: "00-00-0+0-", + -140.0: "00-00-0+00", + -139.0: "00-00-0+0+", + -138.0: "00-000-0-0", + -137.0: "00-000-00-", + -136.0: "00-000-000", + -135.0: "00-000-00+", + -134.0: "00-000-0+0", + -133.0: "00-0000-0-", + -132.0: "00-0000-00", + -131.0: "00-0000-0+", + -130.0: "00-00000-0", + -129.0: "00-000000-", + -128.0: "00-0000000", + -127.0: "00-000000+", + -126.0: "00-00000+0", + -125.0: "00-0000+0-", + -124.0: "00-0000+00", + -123.0: "00-0000+0+", + -122.0: "00-000+0-0", + -121.0: "00-000+00-", + -120.0: "00-000+000", + -119.0: "00-000+00+", + -118.0: "00-000+0+0", + -117.0: "00-00+0-0-", + -116.0: "00-00+0-00", + -115.0: "00-00+0-0+", + -114.0: "00-00+00-0", + -113.0: "00-00+000-", + -112.0: "00-00+0000", + -111.0: "00-00+000+", + -110.0: "00-00+00+0", + -109.0: "00-00+0+0-", + -108.0: "00-00+0+00", + -107.0: "00-00+0+0+", + -106.0: "00-0+0-0-0", + -105.0: "00-0+0-00-", + -104.0: "00-0+0-000", + -103.0: "00-0+0-00+", + -102.0: "00-0+0-0+0", + -101.0: "00-0+00-0-", + -100.0: "00-0+00-00", + -99.0: "00-0+00-0+", + -98.0: "00-0+000-0", + -97.0: "00-0+0000-", + -96.0: "00-0+00000", + -95.0: "00-0+0000+", + -94.0: "00-0+000+0", + -93.0: "00-0+00+0-", + -92.0: "00-0+00+00", + -91.0: "00-0+00+0+", + -90.0: "00-0+0+0-0", + -89.0: "00-0+0+00-", + -88.0: "00-0+0+000", + -87.0: "00-0+0+00+", + -86.0: "00-0+0+0+0", + -85.0: "000-0-0-0-", + -84.0: "000-0-0-00", + -83.0: "000-0-0-0+", + -82.0: "000-0-00-0", + -81.0: "000-0-000-", + -80.0: "000-0-0000", + -79.0: "000-0-000+", + -78.0: "000-0-00+0", + -77.0: "000-0-0+0-", + -76.0: "000-0-0+00", + -75.0: "000-0-0+0+", + -74.0: "000-00-0-0", + -73.0: "000-00-00-", + -72.0: "000-00-000", + -71.0: "000-00-00+", + -70.0: "000-00-0+0", + -69.0: "000-000-0-", + -68.0: "000-000-00", + -67.0: "000-000-0+", + -66.0: "000-0000-0", + -65.0: "000-00000-", + -64.0: "000-000000", + -63.0: "000-00000+", + -62.0: "000-0000+0", + -61.0: "000-000+0-", + -60.0: "000-000+00", + -59.0: "000-000+0+", + -58.0: "000-00+0-0", + -57.0: "000-00+00-", + -56.0: "000-00+000", + -55.0: "000-00+00+", + -54.0: "000-00+0+0", + -53.0: "000-0+0-0-", + -52.0: "000-0+0-00", + -51.0: "000-0+0-0+", + -50.0: "000-0+00-0", + -49.0: "000-0+000-", + -48.0: "000-0+0000", + -47.0: "000-0+000+", + -46.0: "000-0+00+0", + -45.0: "000-0+0+0-", + -44.0: "000-0+0+00", + -43.0: "000-0+0+0+", + -42.0: "0000-0-0-0", + -41.0: "0000-0-00-", + -40.0: "0000-0-000", + -39.0: "0000-0-00+", + -38.0: "0000-0-0+0", + -37.0: "0000-00-0-", + -36.0: "0000-00-00", + -35.0: "0000-00-0+", + -34.0: "0000-000-0", + -33.0: "0000-0000-", + -32.0: "0000-00000", + -31.0: "0000-0000+", + -30.0: "0000-000+0", + -29.0: "0000-00+0-", + -28.0: "0000-00+00", + -27.0: "0000-00+0+", + -26.0: "0000-0+0-0", + -25.0: "0000-0+00-", + -24.0: "0000-0+000", + -23.0: "0000-0+00+", + -22.0: "0000-0+0+0", + -21.0: "00000-0-0-", + -20.0: "00000-0-00", + -19.0: "00000-0-0+", + -18.0: "00000-00-0", + -17.0: "00000-000-", + -16.0: "00000-0000", + -15.0: "00000-000+", + -14.0: "00000-00+0", + -13.0: "00000-0+0-", + -12.0: "00000-0+00", + -1.0: "000000000-", + -10.0: "000000-0-0", + -9.0: "000000-00-", + -8.0: "000000-000", + -7.0: "000000-00+", + -6.0: "000000-0+0", + -5.0: "0000000-0-", + -4.0: "0000000-00", + -3.0: "0000000-0+", + -2.0: "00000000-0", } class tests__to_and_fro_10bits(unittest.TestCase): def test__01_to_integer(self): - """ Check conversion from CSD to integer """ + """Check conversion from CSD to integer""" for key in good_values_dict.keys(): csd_str = good_values_dict[key] @@ -1387,12 +1387,12 @@ def test__01_to_integer(self): self.assertEqual(value, key) def test__02_to_csd(self): - """ Check that integers are converted to CSD properly. """ + """Check that integers are converted to CSD properly.""" for key in good_values_dict.keys(): csd_str = csd.to_csd(key) - while (len(csd_str) < 10): + while len(csd_str) < 10: csd_str = "0" + csd_str self.assertEqual(csd_str, good_values_dict[key]) @@ -1404,5 +1404,5 @@ def suite(): return suite -if __name__ == '__main__': +if __name__ == "__main__": unittest.main() diff --git a/tests/test_chol.py b/tests/test_chol.py index 60a6383..cbd4b5c 100644 --- a/tests/test_chol.py +++ b/tests/test_chol.py @@ -7,19 +7,21 @@ def test_chol1(): - """[summary] - """ - l1 = [[25., 15., -5.], [15., 18., 0.], [-5., 0., 11.]] + """[summary]""" + l1 = [[25.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 11.0]] m1 = np.array(l1) Q1 = chol_ext(len(m1)) assert Q1.factorize(m1) def test_chol2(): - """[summary] - """ - l2 = [[18., 22., 54., 42.], [22., -70., 86., 62.], [54., 86., -174., 134.], - [42., 62., 134., -106.]] + """[summary]""" + l2 = [ + [18.0, 22.0, 54.0, 42.0], + [22.0, -70.0, 86.0, 62.0], + [54.0, 86.0, -174.0, 134.0], + [42.0, 62.0, 134.0, -106.0], + ] m2 = np.array(l2) Q = chol_ext(len(m2)) assert not Q.factorize(m2) @@ -29,9 +31,8 @@ def test_chol2(): def test_chol3(): - """[summary] - """ - l3 = [[0., 15., -5.], [15., 18., 0.], [-5., 0., 11.]] + """[summary]""" + l3 = [[0.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 11.0]] m3 = np.array(l3) Q = chol_ext(len(m3)) assert not Q.factorize(m3) @@ -42,9 +43,8 @@ def test_chol3(): def test_chol4(): - """[summary] - """ - l1 = [[25., 15., -5.], [15., 18., 0.], [-5., 0., 11.]] + """[summary]""" + l1 = [[25.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 11.0]] m1 = np.array(l1) Q1 = chol_ext(len(m1)) Q1.allow_semidefinite = True @@ -52,10 +52,13 @@ def test_chol4(): def test_chol5(): - """[summary] - """ - l2 = [[18., 22., 54., 42.], [22., -70., 86., 62.], [54., 86., -174., 134.], - [42., 62., 134., -106.]] + """[summary]""" + l2 = [ + [18.0, 22.0, 54.0, 42.0], + [22.0, -70.0, 86.0, 62.0], + [54.0, 86.0, -174.0, 134.0], + [42.0, 62.0, 134.0, -106.0], + ] m2 = np.array(l2) Q = chol_ext(len(m2)) Q.allow_semidefinite = True @@ -66,9 +69,8 @@ def test_chol5(): def test_chol6(): - """[summary] - """ - l3 = [[0., 15., -5.], [15., 18., 0.], [-5., 0., 11.]] + """[summary]""" + l3 = [[0.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 11.0]] m3 = np.array(l3) Q = chol_ext(len(m3)) Q.allow_semidefinite = True @@ -82,23 +84,21 @@ def test_chol6(): def test_chol7(): - """[summary] - """ - l3 = [[0., 15., -5.], [15., 18., 0.], [-5., 0., -20.]] + """[summary]""" + l3 = [[0.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, -20.0]] m3 = np.array(l3) Q = chol_ext(len(m3)) Q.allow_semidefinite = True assert not Q.factorize(m3) ep = Q.witness() - assert ep == 20. + assert ep == 20.0 def test_chol8(): + """[summary]""" """[summary] """ - """[summary] - """ - l3 = [[0., 15., -5.], [15., 18., 0.], [-5., 0., 20.]] + l3 = [[0.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 20.0]] m3 = np.array(l3) Q = chol_ext(len(m3)) Q.allow_semidefinite = False @@ -106,11 +106,10 @@ def test_chol8(): def test_chol9(): + """[summary]""" """[summary] """ - """[summary] - """ - l3 = [[0., 15., -5.], [15., 18., 0.], [-5., 0., 20.]] + l3 = [[0.0, 15.0, -5.0], [15.0, 18.0, 0.0], [-5.0, 0.0, 20.0]] m3 = np.array(l3) Q = chol_ext(len(m3)) Q.allow_semidefinite = True diff --git a/tests/test_corr_fn.py b/tests/test_corr_fn.py index 6015b0f..ef86af9 100644 --- a/tests/test_corr_fn.py +++ b/tests/test_corr_fn.py @@ -25,15 +25,15 @@ def lsq_corr_core2(Y, n, P): Returns: [type]: [description] """ - normY = np.linalg.norm(Y, 'fro') + normY = np.linalg.norm(Y, "fro") normY2 = 32 * normY * normY val = 256 * np.ones(n + 1) val[-1] = normY2 * normY2 x = np.zeros(n + 1) # cannot all zeros - x[0] = 1. + x[0] = 1.0 x[-1] = normY2 / 2 E = ell(val, x) - xb, _, ell_info = cutting_plane_dc(P, E, float('inf')) + xb, _, ell_info = cutting_plane_dc(P, E, float("inf")) return xb[:-1], ell_info.num_iters, ell_info.feasible @@ -53,11 +53,11 @@ def lsq_corr_poly2(Y, s, n): def lsq_corr_core(Y, n, Q): x = np.zeros(n) # cannot all zeros - x[0] = 1. - E = ell(256., x) + x[0] = 1.0 + E = ell(256.0, x) P = bsearch_adaptor(Q, E) - normY = np.linalg.norm(Y, 'fro') - _, bs_info = bsearch(P, [0., normY * normY]) + normY = np.linalg.norm(Y, "fro") + _, bs_info = bsearch(P, [0.0, normY * normY]) return P.x_best, bs_info.num_iters, bs_info.feasible @@ -87,13 +87,13 @@ def mle_corr_core(Y, n, P): [type]: [description] """ x = np.zeros(n) - x[0] = 1. - E = ell(50., x) + x[0] = 1.0 + E = ell(50.0, x) # E.use_parallel_cut = False # options = Options() # options.max_it = 2000 # options.tol = 1e-8 - xb, _, ell_info = cutting_plane_dc(P, E, float('inf')) + xb, _, ell_info = cutting_plane_dc(P, E, float("inf")) # print(num_iters, feasible, status) return xb, ell_info.num_iters, ell_info.feasible @@ -114,8 +114,7 @@ def mle_corr_poly(Y, s, n): def test_data(): - """[summary] - """ + """[summary]""" # assert Y[2,3] == approx(1.9365965488224368) assert s[6, 0] == approx(8.75) # D1 = construct_distance_matrix(s) diff --git a/tests/test_csd.py b/tests/test_csd.py index 05a1b52..3a689e4 100644 --- a/tests/test_csd.py +++ b/tests/test_csd.py @@ -3,8 +3,7 @@ def test_csd1(): - """[summary] - """ + """[summary]""" csdstr = "+00-00+" csdnumber = to_decimal(csdstr) csdnew = to_csd(csdnumber) @@ -12,8 +11,7 @@ def test_csd1(): def test_csd2(): - """[summary] - """ + """[summary]""" csdstr = "+00-.000+" csdnumber = to_decimal(csdstr) csdnew = to_csd(csdnumber, places=4) @@ -21,8 +19,7 @@ def test_csd2(): def test_csd3(): - """[summary] - """ + """[summary]""" csdstr = "+00-.000+" csdnumber = to_decimal(csdstr) csdnew = to_csdfixed(csdnumber, nnz=3) @@ -30,8 +27,7 @@ def test_csd3(): def test_csd4(): - """[summary] - """ + """[summary]""" n = 545 csdstr = to_csd(n) n2 = to_decimal(csdstr) diff --git a/tests/test_cycle_ratio.py b/tests/test_cycle_ratio.py index 0da4b06..644da76 100644 --- a/tests/test_cycle_ratio.py +++ b/tests/test_cycle_ratio.py @@ -32,7 +32,7 @@ def create_test_case1(): [type]: [description] """ G = nx.cycle_graph(5, create_using=nx.DiGraph()) - G[1][2]['weight'] = -5 + G[1][2]["weight"] = -5 G.add_edges_from([(5, n) for n in G]) return G @@ -44,24 +44,26 @@ def create_test_case_timing(): [type]: [description] """ G = nx.DiGraph() - nodelist = ['a1', 'a2', 'a3'] + nodelist = ["a1", "a2", "a3"] G.add_nodes_from(nodelist) - G.add_edges_from([ - ('a1', 'a2', {'weight': 7}), - ('a2', 'a1', {'weight': 0}), - ('a2', 'a3', {'weight': 3}), - ('a3', 'a2', {'weight': 1}), - ('a3', 'a1', {'weight': 2}), - ('a1', 'a3', {'weight': 5}) - ]) + G.add_edges_from( + [ + ("a1", "a2", {"weight": 7}), + ("a2", "a1", {"weight": 0}), + ("a2", "a3", {"weight": 3}), + ("a3", "a2", {"weight": 1}), + ("a3", "a1", {"weight": 2}), + ("a1", "a3", {"weight": 5}), + ] + ) return G def test_cycle_ratio(): G = create_test_case1() - set_default(G, 'time', 1) - set_default(G, 'cost', 1) - G[1][2]['cost'] = 5 + set_default(G, "time", 1) + set_default(G, "cost", 1) + G[1][2]["cost"] = 5 dist = list(Fraction(0, 1) for _ in G) E = ell1d([-100, 100]) @@ -70,21 +72,21 @@ def test_cycle_ratio(): opts = Options() opts.tol = 1e-12 P = cycle_ratio_oracle(G, dist) - _, r, ell_info = cutting_plane_dc(P, E, float('-inf'), opts) + _, r, ell_info = cutting_plane_dc(P, E, float("-inf"), opts) print(ell_info.num_iters) assert ell_info.feasible - assert r == approx(9/5) + assert r == approx(9 / 5) def test_cycle_ratio_timing(): G = create_test_case_timing() - set_default(G, 'time', 1) - G['a1']['a2']['cost'] = 7 - G['a2']['a1']['cost'] = -1 - G['a2']['a3']['cost'] = 3 - G['a3']['a2']['cost'] = 0 - G['a3']['a1']['cost'] = 2 - G['a1']['a3']['cost'] = 4 + set_default(G, "time", 1) + G["a1"]["a2"]["cost"] = 7 + G["a2"]["a1"]["cost"] = -1 + G["a2"]["a3"]["cost"] = 3 + G["a3"]["a2"]["cost"] = 0 + G["a3"]["a1"]["cost"] = 2 + G["a1"]["a3"]["cost"] = 4 # make sure no parallel edges in above!!! dist = {v: Fraction(0, 1) for v in G} @@ -94,7 +96,7 @@ def test_cycle_ratio_timing(): opts = Options() opts.tol = 1e-12 P = cycle_ratio_oracle(G, dist) - _, r, ell_info = cutting_plane_dc(P, E, float('-inf'), opts) + _, r, ell_info = cutting_plane_dc(P, E, float("-inf"), opts) print(ell_info.num_iters) assert ell_info.feasible assert r == approx(1) diff --git a/tests/test_example1.py b/tests/test_example1.py index 5c6b1d0..f49c3a9 100644 --- a/tests/test_example1.py +++ b/tests/test_example1.py @@ -21,12 +21,12 @@ def my_oracle2(z): # constraint 1: x + y <= 3 fj = x + y - 3 if fj > 0: - return np.array([1., 1.]), fj + return np.array([1.0, 1.0]), fj # constraint 2: x - y >= 1 fj = -x + y + 1 if fj > 0: - return np.array([-1., 1.]), fj + return np.array([-1.0, 1.0]), fj def my_oracle(z, t: float): @@ -47,18 +47,17 @@ def my_oracle(z, t: float): f0 = x + y fj = t - f0 if fj < 0: - fj = 0. + fj = 0.0 t = f0 - return (-1. * np.array([1., 1.]), fj), t + return (-1.0 * np.array([1.0, 1.0]), fj), t def test_case_feasible(): - """[summary] - """ - x0 = np.array([0., 0.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([0.0, 0.0]) # initial x0 + E = ell(10.0, x0) P = my_oracle - _, _, ell_info = cutting_plane_dc(P, E, float('-inf')) + _, _, ell_info = cutting_plane_dc(P, E, float("-inf")) assert ell_info.feasible # fmt = '{:f} {} {} {}' @@ -67,21 +66,19 @@ def test_case_feasible(): def test_case_infeasible1(): - """[summary] - """ - x0 = np.array([100., 100.]) # wrong initial guess, - E = ell(10., x0) # or ellipsoid is too small + """[summary]""" + x0 = np.array([100.0, 100.0]) # wrong initial guess, + E = ell(10.0, x0) # or ellipsoid is too small P = my_oracle - _, _, ell_info = cutting_plane_dc(P, E, float('-inf')) + _, _, ell_info = cutting_plane_dc(P, E, float("-inf")) assert not ell_info.feasible assert ell_info.status == CUTStatus.nosoln # no sol'n def test_case_infeasible2(): - """[summary] - """ - x0 = np.array([0., 0.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([0.0, 0.0]) # initial x0 + E = ell(10.0, x0) P = my_oracle _, _, ell_info = cutting_plane_dc(P, E, 100) # wrong initial best-so-far assert not ell_info.feasible diff --git a/tests/test_example2.py b/tests/test_example2.py index 073f712..6508628 100644 --- a/tests/test_example2.py +++ b/tests/test_example2.py @@ -21,19 +21,18 @@ def my_oracle2(z): # constraint 1: x + y <= 3 fj = x + y - 3 if fj > 0: - return np.array([1., 1.]), fj + return np.array([1.0, 1.0]), fj # constraint 2: x - y >= 1 fj = -x + y + 1 if fj > 0: - return np.array([-1., 1.]), fj + return np.array([-1.0, 1.0]), fj def test_case_feasible(): - """[summary] - """ - x0 = np.array([0., 0.]) # initial guess - E = ell(10., x0) + """[summary]""" + x0 = np.array([0.0, 0.0]) # initial guess + E = ell(10.0, x0) P = my_oracle2 ell_info = cutting_plane_feas(P, E) assert ell_info.feasible @@ -42,10 +41,9 @@ def test_case_feasible(): def test_case_infeasible(): - """[summary] - """ - x0 = np.array([100., 100.]) # wrong initial guess - E = ell(10., x0) + """[summary]""" + x0 = np.array([100.0, 100.0]) # wrong initial guess + E = ell(10.0, x0) P = my_oracle2 ell_info = cutting_plane_feas(P, E) assert ell_info.status == CUTStatus.nosoln # no sol'n diff --git a/tests/test_firfilter.py b/tests/test_firfilter.py index 9ad9f1b..643b0eb 100644 --- a/tests/test_firfilter.py +++ b/tests/test_firfilter.py @@ -25,7 +25,7 @@ # ******************************************************************** # Fractional delay. D = 8.25 # Delay value. -Hdes = ne.evaluate('exp(-1j * D * w)') # Desired frequency response. +Hdes = ne.evaluate("exp(-1j * D * w)") # Desired frequency response. # Gaussian filter with linear phase. (Uncomment lines below for this design.) # var = 0.05 @@ -61,7 +61,7 @@ def __call__(self, h, t: float): Returns: [type]: [description] """ - fmax = float('-Inf') + fmax = float("-Inf") for i in range(m): a_R = A_R[i, :] a_I = A_I[i, :] @@ -76,7 +76,7 @@ def __call__(self, h, t: float): if fmax < fj: fmax = fj gmax = 2 * (t_r * a_R + t_i * a_I) - return (gmax, 0.), fmax + return (gmax, 0.0), fmax def run_firfilter(no_trick, duration=0.000001): @@ -92,18 +92,18 @@ def run_firfilter(no_trick, duration=0.000001): Exception: [description] """ h0 = np.zeros(n) # initial x0 - E = ell(10., h0) + E = ell(10.0, h0) E.no_defer_trick = no_trick P = my_oracle() prob1 = Problem(E, P) - prob1.solve(100.) + prob1.solve(100.0) time.sleep(duration) - print('Problem status:', prob1.status) - if prob1.status != 'optimal': - raise Exception('ELL Error') + print("Problem status:", prob1.status) + if prob1.status != "optimal": + raise Exception("ELL Error") print("optimal value", prob1.optim_value) - assert prob1.status == 'optimal' + assert prob1.status == "optimal" return prob1._solver_stats.num_iters diff --git a/tests/test_lmi.py b/tests/test_lmi.py index 9435751..a8f2baa 100644 --- a/tests/test_lmi.py +++ b/tests/test_lmi.py @@ -22,14 +22,23 @@ def __init__(self, oracle): Arguments: oracle ([type]): [description] """ - self.c = np.array([1., -1., 1.]) - F1 = np.array([[[-7., -11.], [-11., 3.]], [[7., -18.], [-18., 8.]], - [[-2., -8.], [-8., 1.]]]) - B1 = np.array([[33., -9.], [-9., 26.]]) - F2 = np.array([[[-21., -11., 0.], [-11., 10., 8.], [0., 8., 5.]], - [[0., 10., 16.], [10., -10., -10.], [16., -10., 3.]], - [[-5., 2., -17.], [2., -6., 8.], [-17., 8., 6.]]]) - B2 = np.array([[14., 9., 40.], [9., 91., 10.], [40., 10., 15.]]) + self.c = np.array([1.0, -1.0, 1.0]) + F1 = np.array( + [ + [[-7.0, -11.0], [-11.0, 3.0]], + [[7.0, -18.0], [-18.0, 8.0]], + [[-2.0, -8.0], [-8.0, 1.0]], + ] + ) + B1 = np.array([[33.0, -9.0], [-9.0, 26.0]]) + F2 = np.array( + [ + [[-21.0, -11.0, 0.0], [-11.0, 10.0, 8.0], [0.0, 8.0, 5.0]], + [[0.0, 10.0, 16.0], [10.0, -10.0, -10.0], [16.0, -10.0, 3.0]], + [[-5.0, 2.0, -17.0], [2.0, -6.0, 8.0], [-17.0, 8.0, 6.0]], + ] + ) + B2 = np.array([[14.0, 9.0, 40.0], [9.0, 91.0, 10.0], [40.0, 10.0, 15.0]]) self.lmi1 = oracle(F1, B1) self.lmi2 = oracle(F2, B2) @@ -55,7 +64,7 @@ def __call__(self, x: Arr, t: float) -> Tuple[Cut, Optional[float]]: fj = f0 - t if fj > 0: return (self.c, fj), None - return (self.c, 0.), f0 + return (self.c, 0.0), f0 def run_lmi(oracle, duration=0.000001): @@ -70,10 +79,10 @@ def run_lmi(oracle, duration=0.000001): Returns: [type]: [description] """ - x0 = np.array([0., 0., 0.]) # initial x0 - E = ell(10., x0) + x0 = np.array([0.0, 0.0, 0.0]) # initial x0 + E = ell(10.0, x0) P = my_oracle(oracle) - _, _, ell_info = cutting_plane_dc(P, E, float('inf')) + _, _, ell_info = cutting_plane_dc(P, E, float("inf")) time.sleep(duration) # fmt = '{:f} {} {} {}' diff --git a/tests/test_lowpass.py b/tests/test_lowpass.py index 70ccf4e..f795602 100644 --- a/tests/test_lowpass.py +++ b/tests/test_lowpass.py @@ -80,13 +80,13 @@ def create_lowpass_case(N=48): # passband 0 <= w <= w_pass ind_p = np.where(w <= wpass)[0] # passband - Lp = 10**(-delta / 20) - Up = 10**(+delta / 20) + Lp = 10 ** (-delta / 20) + Up = 10 ** (+delta / 20) Ap = A[ind_p, :] # stopband (w_stop <= w) ind_s = np.where(wstop <= w)[0] # stopband - Sp = 10**(delta2 / 20) + Sp = 10 ** (delta2 / 20) As = A[ind_s, :] # remove redundant contraints @@ -138,7 +138,7 @@ def run_lowpass(use_parallel_cut, duration=0.000001): r0 = np.zeros(N) # initial x0 r0[0] = 0 - E = ell(4., r0) + E = ell(4.0, r0) E.use_parallel_cut = use_parallel_cut P, Spsq = create_lowpass_case(N) options = Options() @@ -162,8 +162,7 @@ def run_lowpass(use_parallel_cut, duration=0.000001): def test_lowpass(): - """[summary] - """ + """[summary]""" result, feasible = run_lowpass(True) assert feasible assert result >= 1089 @@ -187,7 +186,7 @@ def run_csdlowpass(use_parallel_cut, duration=0.000001): r0 = np.zeros(N) # initial x0 r0[0] = 0 - E = ell(4., r0) + E = ell(4.0, r0) E.use_parallel_cut = use_parallel_cut Pcsd, Spsq = create_csdlowpass_case(N, nnz) options = Options() @@ -201,8 +200,7 @@ def run_csdlowpass(use_parallel_cut, duration=0.000001): def test_csdlowpass(): - """[summary] - """ + """[summary]""" result, feasible = run_csdlowpass(True) assert feasible assert result >= 1000 diff --git a/tests/test_optscaling.py b/tests/test_optscaling.py index 5c31e0e..699e72a 100644 --- a/tests/test_optscaling.py +++ b/tests/test_optscaling.py @@ -21,7 +21,7 @@ def vdc(n, base=2): Returns: [type]: [description] """ - vdc, denom = 0., 1. + vdc, denom = 0.0, 1.0 while n: denom *= base n, remainder = divmod(n, base) @@ -92,16 +92,16 @@ def formGraph(T, pos, eta, seed=None): # G[u][v]['cost'] = np.sqrt(h @ h) for u, v in G.edges(): - h = np.array(G.nodes()[u]['pos']) - np.array(G.nodes()[v]['pos']) - G[u][v]['cost'] = np.log(np.sqrt(h @ h)) + h = np.array(G.nodes()[u]["pos"]) - np.array(G.nodes()[v]["pos"]) + G[u][v]["cost"] = np.log(np.sqrt(h @ h)) -cmax = max(c for _, _, c in G.edges.data('cost')) -cmin = min(c for _, _, c in G.edges.data('cost')) +cmax = max(c for _, _, c in G.edges.data("cost")) +cmin = min(c for _, _, c in G.edges.data("cost")) def get_cost(e): u, v = e - return G[u][v]['cost'] + return G[u][v]["cost"] def test_optscaling(): @@ -118,7 +118,7 @@ def test_optscaling(): E = ell(1.5 * t, x0) dist = list(0 for _ in G) P = optscaling_oracle(G, dist, get_cost) - _, _, ell_info = cutting_plane_dc(P, E, float('inf')) + _, _, ell_info = cutting_plane_dc(P, E, float("inf")) # fmt = '{:f} {} {} {}' # print(np.exp(xb)) # print(fmt.format(np.exp(fb), niter, feasible, status)) diff --git a/tests/test_profit.py b/tests/test_profit.py index 9ad14a3..a551a42 100644 --- a/tests/test_profit.py +++ b/tests/test_profit.py @@ -7,19 +7,19 @@ from ellpy.ell import ell from ellpy.oracles.profit_oracle import profit_oracle, profit_q_oracle, profit_rb_oracle -p, A, k = 20., 40., 30.5 +p, A, k = 20.0, 40.0, 30.5 params = p, A, k alpha, beta = 0.1, 0.4 -v1, v2 = 10., 35. +v1, v2 = 10.0, 35.0 a = np.array([alpha, beta]) v = np.array([v1, v2]) -r = np.array([100., 100.]) # initial ellipsoid (sphere) +r = np.array([100.0, 100.0]) # initial ellipsoid (sphere) def test_profit(): - E = ell(r, np.array([0., 0.])) + E = ell(r, np.array([0.0, 0.0])) P = profit_oracle(params, a, v) - _, _, ell_info = cutting_plane_dc(P, E, 0.) + _, _, ell_info = cutting_plane_dc(P, E, 0.0) assert ell_info.feasible assert ell_info.num_iters == 37 @@ -27,18 +27,18 @@ def test_profit(): def test_profit_rb(): e1 = 0.003 e2 = 0.007 - e3 = e4 = e5 = 1. - E = ell(r, np.array([0., 0.])) + e3 = e4 = e5 = 1.0 + E = ell(r, np.array([0.0, 0.0])) P = profit_rb_oracle(params, a, v, (e1, e2, e3, e4, e5)) - _, _, ell_info = cutting_plane_dc(P, E, 0.) + _, _, ell_info = cutting_plane_dc(P, E, 0.0) assert ell_info.feasible assert ell_info.num_iters == 42 def test_profit_q(): - E = ell(r, np.array([0., 0.])) + E = ell(r, np.array([0.0, 0.0])) P = profit_q_oracle(params, a, v) - _, _, ell_info = cutting_plane_q(P, E, 0.) + _, _, ell_info = cutting_plane_q(P, E, 0.0) assert ell_info.feasible assert ell_info.num_iters == 28 return ell_info.num_iters diff --git a/tests/test_quasicvx.py b/tests/test_quasicvx.py index fb6589b..abd6854 100644 --- a/tests/test_quasicvx.py +++ b/tests/test_quasicvx.py @@ -26,7 +26,7 @@ def my_quasicvx_oracle(z, t: float): # constraint 1: exp(x) <= y, or sqrtx**2 <= ly fj = sqrtx * sqrtx - ly if fj > 0: - return (np.array([2*sqrtx, -1.]), fj), None + return (np.array([2 * sqrtx, -1.0]), fj), None # constraint 3: x > 0 # if x <= 0.: @@ -36,42 +36,39 @@ def my_quasicvx_oracle(z, t: float): tmp2 = math.exp(ly) tmp3 = t * tmp2 fj = -sqrtx + tmp3 - if fj < 0.: # feasible + if fj < 0.0: # feasible t = sqrtx / tmp2 - return (np.array([-1., sqrtx]), 0), t + return (np.array([-1.0, sqrtx]), 0), t - return (np.array([-1., tmp3]), fj), None + return (np.array([-1.0, tmp3]), fj), None def test_case_feasible(): - """[summary] - """ - x0 = np.array([0., 0.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([0.0, 0.0]) # initial x0 + E = ell(10.0, x0) P = my_quasicvx_oracle - xb, fb, ell_info = cutting_plane_dc(P, E, 0.) + xb, fb, ell_info = cutting_plane_dc(P, E, 0.0) assert ell_info.feasible assert fb == approx(0.4288673396685956) - assert xb[0]*xb[0] == approx(0.5046900657538383) + assert xb[0] * xb[0] == approx(0.5046900657538383) assert math.exp(xb[1]) == approx(1.6564805414665902) def test_case_infeasible1(): - """[summary] - """ - x0 = np.array([100., 100.]) # wrong initial guess, - E = ell(10., x0) # or ellipsoid is too small + """[summary]""" + x0 = np.array([100.0, 100.0]) # wrong initial guess, + E = ell(10.0, x0) # or ellipsoid is too small P = my_quasicvx_oracle - _, _, ell_info = cutting_plane_dc(P, E, 0.) + _, _, ell_info = cutting_plane_dc(P, E, 0.0) assert not ell_info.feasible assert ell_info.status == CUTStatus.nosoln # no sol'n def test_case_infeasible2(): - """[summary] - """ - x0 = np.array([0., 0.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([0.0, 0.0]) # initial x0 + E = ell(10.0, x0) P = my_quasicvx_oracle _, _, ell_info = cutting_plane_dc(P, E, 100) # wrong initial best-so-far assert not ell_info.feasible diff --git a/tests/test_quasicvx2.py b/tests/test_quasicvx2.py index 6f735cc..42dc056 100644 --- a/tests/test_quasicvx2.py +++ b/tests/test_quasicvx2.py @@ -27,33 +27,32 @@ def my_quasicvx_oracle(z, t: float): tmp = math.exp(x) fj = tmp - y if fj > 0: - return (np.array([tmp, -1.]), fj), None + return (np.array([tmp, -1.0]), fj), None # constraint 2: y > 0 - if y <= 0.: - return (np.array([0., -1.]), -y), None + if y <= 0.0: + return (np.array([0.0, -1.0]), -y), None # constraint 3: x > 0 - if x <= 0.: - return (np.array([-1., 0.]), -x), None + if x <= 0.0: + return (np.array([-1.0, 0.0]), -x), None # objective: minimize -sqrt(x) / y tmp2 = math.sqrt(x) fj = -tmp2 - t * y - if fj < 0.: # feasible + if fj < 0.0: # feasible t = -tmp2 / y - return (np.array([-0.5/tmp2, -t]), 0), t + return (np.array([-0.5 / tmp2, -t]), 0), t - return (np.array([-0.5/tmp2, -t]), fj), None + return (np.array([-0.5 / tmp2, -t]), fj), None def test_case_feasible(): - """[summary] - """ - x0 = np.array([1., 1.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([1.0, 1.0]) # initial x0 + E = ell(10.0, x0) P = my_quasicvx_oracle - xb, fb, ell_info = cutting_plane_dc(P, E, 0.) + xb, fb, ell_info = cutting_plane_dc(P, E, 0.0) assert ell_info.feasible assert fb == approx(-0.4288673396685956) assert xb[0] == approx(0.501315956) @@ -61,21 +60,19 @@ def test_case_feasible(): def test_case_infeasible1(): - """[summary] - """ - x0 = np.array([100., 100.]) # wrong initial guess, - E = ell(10., x0) # or ellipsoid is too small + """[summary]""" + x0 = np.array([100.0, 100.0]) # wrong initial guess, + E = ell(10.0, x0) # or ellipsoid is too small P = my_quasicvx_oracle - _, _, ell_info = cutting_plane_dc(P, E, 0.) + _, _, ell_info = cutting_plane_dc(P, E, 0.0) assert not ell_info.feasible assert ell_info.status == CUTStatus.nosoln # no sol'n def test_case_infeasible2(): - """[summary] - """ - x0 = np.array([1., 1.]) # initial x0 - E = ell(10., x0) + """[summary]""" + x0 = np.array([1.0, 1.0]) # initial x0 + E = ell(10.0, x0) P = my_quasicvx_oracle _, _, ell_info = cutting_plane_dc(P, E, -100) # wrong initial best-so-far assert not ell_info.feasible