Skip to content

Commit

Permalink
Added check that we are inside the domain during hit and run
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffrey-hokanson committed Jan 30, 2019
1 parent f9b29b7 commit e250aa7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion psdr/domains.py
Expand Up @@ -377,7 +377,12 @@ def _hit_and_run(self, _recurse = 2):
x0 = sum([self.corner(np.random.randn(len(self))) for i in range(N)])/N
x0 = self.closest_point(x0)
self._hit_and_run_state = x0



# Sometimes we may have a point that is slightly outside due to numerical issues
# so we push it back in
if not self.isinside(x0):
x0 = self.closest_point(x0)

# See if there is an orthongonal basis for the equality constraints
# This is necessary so we can generate random directions that satisfy the equality constraint.
Expand Down

0 comments on commit e250aa7

Please sign in to comment.