Skip to content

Commit 85abc4b

Browse files
committedMar 26, 2021
move neg_cycle and low_discr_seq out of box
1 parent 77f98ee commit 85abc4b

7 files changed

+11
-93
lines changed
 

‎.gitpod.Dockerfile

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ RUN apt-get update \
2222
pkg-config \
2323
ranger \
2424
w3m \
25+
dialog \
26+
whiptail \
2527
# just for fun (not cmatrix) \
2628
cowsay \
2729
figlet \

‎.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ matrix:
1515
install:
1616
- source tests/travis_install.sh
1717
- pip install -r requirements.txt
18+
- git clone https://github.com/luk036/pylds
19+
- cd pylds; pip install .; cd ..
20+
- git clone https://github.com/luk036/netoptim
21+
- cd netoptim; pip install .; cd ..
1822
# ^ DEPRECATION WARNING:
1923
# The automatic creation of a `requirements.txt` file is deprecated.
2024
# See `Dependency Management` in the docs for other options.

‎src/ellpy/oracles/corr_oracle.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
from typing import List, Tuple, Union
33

44
import numpy as np
5-
6-
from .low_discr_seq import halton
5+
from pylds.low_discr_seq import halton
76

87
Arr = Union[np.ndarray]
98
Cut = Tuple[Arr, float]
File renamed without changes.
File renamed without changes.

‎src/ellpy/oracles/network_oracle.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: utf-8 -*-
22
from typing import Any, Optional, Tuple
33

4-
from .neg_cycle import negCycleFinder
4+
from netoptim.neg_cycle import negCycleFinder
55

66
Cut = Tuple[Any, float]
77

@@ -55,9 +55,8 @@ def get_weight(e):
5555
"""
5656
return self._h.eval(e, x)
5757

58-
C = self._S.find_neg_cycle(self._u, get_weight)
59-
if C != []:
60-
f = -sum(self._h.eval(e, x) for e in C)
61-
g = -sum(self._h.grad(e, x) for e in C)
58+
for Ci in self._S.find_neg_cycle(self._u, get_weight):
59+
f = -sum(self._h.eval(e, x) for e in Ci)
60+
g = -sum(self._h.grad(e, x) for e in Ci)
6261
return g, f
6362
return None

‎tests/test_neg_cycle.py

-86
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.