darioizzo on master
Fixed abs ambiguity compilation… Merge pull request #197 from ci… (compare)
So it is not possible for me to upgrade numpy cause Fedora 26 provides 1.12 as the most updated one, and I risk to get conflicts with all the other packages if I force an upgrade. So I am building from source.
cmake CMakeList.txt works fine for
pagmo but when I want to build
pygmo and I
cd /pagmo/pygmo and do
cmake CMakeList.txt, the process cannot be completed issuing the following error:
`CMake Error at CMakeLists.txt:10 (if):
if given arguments:
Unknown arguments specified`
Hello Dear Pygmo Colleagues,
I recently installed pygmo and attempted the exercise cases. The cases not involving SLSQP, IPopt, and SNopt ran successfully. I'm now trying to make the remaining cases run. I have conda 4.3.34 installed, and I think I used 'conda install pygmo'. I have SNopt, which I think is already compiled to run with another tool. I've installed the 'pygmo_plugins_nonfree'package, but am not sure how to set it up with SNopt.
Thanks for your help in advance)
When I run the exercises I get the following error:
ValueError: function: evolve where: C:\bld\pygmo_plugins_nonfree_1518171231957\work\pagmo_plugins_nonfree-0.3\include\pagmo_plugins_nonfree/snopt7.hpp, 463 what: An error occurred while loading the snopt7_c library at run-time. This is typically caused by one of the following reasons: - The file declared to be the snopt7_c library, i.e. /usr/local/lib/libsnopt7_c.so, is not a shared library containing the necessary C interface symbols (is the file path really pointing to a valid shared library?) - The library is found and it does contain the C interface symbols, but it needs linking to some additional libraries that are not found at run-time. We report the exact text of the original exception thrown: function: evolve where: C:\bld\pygmo_plugins_nonfree_1518171231957\work\pagmo_plugins_nonfree-0.3\include\pagmo_plugins_nonfree/snopt7.hpp, 415 what: The snopt7_c library path was constructed to be: /usr/local/lib/libsnopt7_c.so and it does not appear to be a file
$ python3 /local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py CMAES 4 PaGMO: mu: 10 - lambda: 20 - mueff: 5.9388 - N: 11 cc: 0.282335 - cs: 0.361861 - c1: 0.0127203 - cmu: 0.0469557 - sigma: 0.5 - damps: 1.36186 - chiN: 3.24255 Gen: Fevals: Best: dx: df: sigma: 1 0 15468.6 2625.02 1.68662e+06 0.5 Traceback (most recent call last): File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py", line 39, in <module> run_example1() File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex1.py", line 29, in run_example1 pop = algo.evolve(pop) File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/examples/_ex_utilities.py", line 17, in fitness return self.prob.fitness(x) File "/local/scratch/bgodard/sw/anaconda3/lib/python3.6/site-packages/pykep/trajopt/_pl2pl_N_impulses.py", line 98, in fitness T[i] = log(x[2 + 4 * i]) ValueError: math domain error
$ conda search -f pykep Loading channels: done # Name Version Build Channel pykep 2.0 py27_0 conda-forge pykep 2.0 py35_0 conda-forge pykep 2.0 py36_0 conda-forge pykep 2.1 py27_0 conda-forge pykep 2.1 py27_1 conda-forge pykep 2.1 py35_0 conda-forge pykep 2.1 py35_1 conda-forge pykep 2.1 py36_0 conda-forge pykep 2.1 py36_1 conda-forge $ conda list |grep pykep pykep 2.1 py36_1 conda-forge $ conda search -f pagmo Loading channels: done # Name Version Build Channel pagmo 2.0 0 conda-forge pagmo 2.1 0 conda-forge pagmo 2.2 0 conda-forge pagmo 2.2 1 conda-forge pagmo 2.3 0 conda-forge pagmo 2.4 0 conda-forge pagmo 2.4 1 conda-forge pagmo 2.5 0 conda-forge pagmo 2.6 0 conda-forge pagmo 2.6 1 conda-forge pagmo 2.7 0 conda-forge $ conda list |grep pagmo pagmo 2.7 0 conda-forge $ conda search -f pygmo [truncated output] pygmo 2.6 np114py35_1 conda-forge pygmo 2.6 np114py36_1 conda-forge pygmo 2.7 py27_0 conda-forge pygmo 2.7 py35_0 conda-forge pygmo 2.7 py36_0 conda-forge $ conda list |grep pygmo pygmo 2.7 py36_0 conda-forge
Hello, there. I am new to pygmo and I just tried to use it today.
Here is my definition of the function
class problem_udp: def fitness(self,x): out =  out.append(rbf[m](x.reshape(1,n))) # rbf is outside defined class that return values of objective or constraint for i in range (m): out.append(rbf[i](x.reshape(1,n))-1) return out def get_bounds(self): return(ak,bk) def get_nic(self): return m def get_nec(self): return 0 def gradient(self,x): return pg.estimate_gradient_h(lambda x: self.fitness(x), x)
When I solve it, there is a error
File "", line 625, in <module> pop = pg.population(prob = problem_udp(), size = 1) File "", line 450, in _population_init __original_population_init(self, prob, size, seed) TypeError: No registered converter was able to produce a C++ rvalue of type double from this Python object of type numpy.ndarray
I do not know how to fix it cause I am also new to C++.
Could someone give me some advice about it?
my_udp = problem_udp() my_prob = pg.problem(my_udp) pop = pg.population(prob = my_prob, size = 1)