Skip to content

Commit

Permalink
workaround for ndim being mangled into a pointer on intel compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesBuchner committed May 16, 2017
1 parent b76c786 commit a6430f2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pymultinest/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ def myprior(cube):
dimensionality of the problem
"""
def solve(LogLikelihood, Prior, **kwargs):
n_dims = kwargs['n_dims']
def solve(LogLikelihood, Prior, n_dims, **kwargs):
kwargs['n_dims'] = n_dims
files_temporary = False
if 'outputfiles_basename' not in kwargs:
files_temporary = True
Expand All @@ -40,9 +40,9 @@ def solve(LogLikelihood, Prior, **kwargs):
outputfiles_basename = kwargs['outputfiles_basename']
def SafePrior(cube, ndim, nparams):
try:
a = numpy.array([cube[i] for i in range(ndim)])
a = numpy.array([cube[i] for i in range(n_dims)])
b = Prior(a)
for i in range(ndim):
for i in range(n_dims):
cube[i] = b[i]
except Exception as e:
import sys
Expand All @@ -51,7 +51,7 @@ def SafePrior(cube, ndim, nparams):

def SafeLoglikelihood(cube, ndim, nparams, lnew):
try:
a = numpy.array([cube[i] for i in range(ndim)])
a = numpy.array([cube[i] for i in range(n_dims)])
l = float(LogLikelihood(a))
if not numpy.isfinite(l):
import sys
Expand Down

0 comments on commit a6430f2

Please sign in to comment.