These are chat archives for bluescarni/pagmo_reborn

2nd
May 2016
Marcus Märtens
@CoolRunning
May 02 2016 11:12
Oh, cool - feeling part of the secret society now!
Francesco Biscani
@bluescarni
May 02 2016 11:12
do you know the secret handshake?
Marcus Märtens
@CoolRunning
May 02 2016 11:13
We shake hands here?
how gross
Francesco Biscani
@bluescarni
May 02 2016 11:13
metaphorically
Marcus Märtens
@CoolRunning
May 02 2016 11:14
I am just a humble adept willing to learn
Francesco Biscani
@bluescarni
May 02 2016 11:14
dario tells me you are volunteering :)
Marcus Märtens
@CoolRunning
May 02 2016 11:15
Honestly, my C++ sucks but I want to learn it properly
Best opportunity
Francesco Biscani
@bluescarni
May 02 2016 11:15
cool!
Marcus Märtens
@CoolRunning
May 02 2016 11:16
Feel free to dump starting pointers on me... can't be basic enough for my narrow pythonic mind
Dario Izzo
@darioizzo
May 02 2016 11:16
Hey I am just back from lunch ... so we move the developers chat here?
Francesco Biscani
@bluescarni
May 02 2016 11:16
that was the idea yes
Dario Izzo
@darioizzo
May 02 2016 11:16
coolio ....
@CoolRunning can you access the code?
make an account on gitlab
Francesco Biscani
@bluescarni
May 02 2016 11:17
pointers on pointers... we could start by looking at how to convert the raw pointers in the hypervolume code into C++11 smart pointers
Marcus Märtens
@CoolRunning
May 02 2016 11:17
Gitlab? Okay... hang on...
The raw pointers are there because this was original code from some other dudes + Kiryx had some performance considerations.
Francesco Biscani
@bluescarni
May 02 2016 11:19
right... if we wanna port to C++11, we should start using C++11 constructs
Marcus Märtens
@CoolRunning
May 02 2016 11:19
Why C++11? Wasn't this about C++ 14?
Francesco Biscani
@bluescarni
May 02 2016 11:20
the pointer stuff is available from C++11, but yes the new pagmo is in C++14
@darioizzo I checked on the old pagmo and I did not see any dynamic_cast in the HV code, I assume we can use the type erasure technique in the new implementation?
Marcus Märtens
@CoolRunning
May 02 2016 11:21
I will ask Kiryx next time whether there were deeper reasons for the raw pointers, but I guess we should get rid of them.
Dario Izzo
@darioizzo
May 02 2016 11:21
You mean instead of the inheritance?
Francesco Biscani
@bluescarni
May 02 2016 11:21
@darioizzo yes
Marcus Märtens
@CoolRunning
May 02 2016 11:22
I have an account on gitlab now
Dario Izzo
@darioizzo
May 02 2016 11:22
Well, if @CoolRunning wants to hit his head against it .... I guess it would be the proper way to do it.
Francesco Biscani
@bluescarni
May 02 2016 11:23
we can start by fixing the pointer stuff first, then I suppose we can do things in stages
Dario Izzo
@darioizzo
May 02 2016 11:23
yep, good plan
Marcus Märtens
@CoolRunning
May 02 2016 11:23
How to access the code?
Dario Izzo
@darioizzo
May 02 2016 11:23
Give me your gitlab user
Marcus Märtens
@CoolRunning
May 02 2016 11:23
It is like this one "CoolRunning"
Dario Izzo
@darioizzo
May 02 2016 11:23
:) original
Marcus Märtens
@CoolRunning
May 02 2016 11:24
I just used my github-account for login...
Dario Izzo
@darioizzo
May 02 2016 11:25
I added you, do you see yourself?
Marcus Märtens
@CoolRunning
May 02 2016 11:25
yes
need to do some stuff to commit though
Dario Izzo
@darioizzo
May 02 2016 11:26
The ssh stuff is not necessary.
I can commit the moment I was in the project as developer
Marcus Märtens
@CoolRunning
May 02 2016 11:26
okay
Dario Izzo
@darioizzo
May 02 2016 11:27
@bluescarni I see you are listed both in the ESA group as owner and as a project member..... can I remove the latter?
Marcus Märtens
@CoolRunning
May 02 2016 11:28
How do we compile this? I can switch to a Linux environment if necessary, but maybe it is not a bad idea to have one guy compiling it and working with it on Windows?
Dario Izzo
@darioizzo
May 02 2016 11:28
Yessssss!!!
Francesco Biscani
@bluescarni
May 02 2016 11:28
@darioizzo think so yeah
@CoolRunning yeah
Marcus Märtens
@CoolRunning
May 02 2016 11:29
Is Windows-compilation working atm?
Francesco Biscani
@bluescarni
May 02 2016 11:29
looks like you found your first task :)
Marcus Märtens
@CoolRunning
May 02 2016 11:29
Guess that means no
Francesco Biscani
@bluescarni
May 02 2016 11:30
are you going to use mingw or MSVC?
Marcus Märtens
@CoolRunning
May 02 2016 11:31
I don't have any of this shit :smile:
Dario Izzo
@darioizzo
May 02 2016 11:31
How do you compile c++ code on your machine then? You do not?
Marcus Märtens
@CoolRunning
May 02 2016 11:31
Ah, I do have mingw though
For the CGP-stuff
Francesco Biscani
@bluescarni
May 02 2016 11:32
so we already know that pagmo will work in mingw because it's just GCC, it would be interesting to know if Visual C++ can compile it
visual C++ is not fully C++11/14 compliant
Marcus Märtens
@CoolRunning
May 02 2016 11:34
MSVC comes not for free, right? Let me check, whether my university provides
Francesco Biscani
@bluescarni
May 02 2016 11:34
it is free nowadays
trying to dig out the link
https://www.visualstudio.com/ -> download community
Marcus Märtens
@CoolRunning
May 02 2016 11:36
okay
Francesco Biscani
@bluescarni
May 02 2016 11:36
well know I wish we had used Catch to write unit tests... you will have to compile and install the boost libraries as they are a prereq for running the tests
Dario Izzo
@darioizzo
May 02 2016 11:37
We can still change
I would like to get rid of boost entirely as a dependency
But there was a problem with catch right?
Marcus Märtens
@CoolRunning
May 02 2016 11:40
I am installing Visual Studio now
Francesco Biscani
@bluescarni
May 02 2016 11:40
it did not look very modern, but I can't remember exactly what we did not like
I mean
Dario Izzo
@darioizzo
May 02 2016 11:40
To start with the latest build fails on their github :)
Marcus Märtens
@CoolRunning
May 02 2016 11:40
What about Gitlab? Is this the new Github?
Francesco Biscani
@bluescarni
May 02 2016 11:41
installing boost is a one time thing and there's still possibility that we will need something from it eventually
but it's always something that adds friction for some reason, at least in non-linux environments
Marcus Märtens
@CoolRunning
May 02 2016 11:41
Are you trying to get PaGMO boostless?
Dario Izzo
@darioizzo
May 02 2016 11:41
Yes
It is boostless
Francesco Biscani
@bluescarni
May 02 2016 11:41
it is at the moment, apart from the tests
Dario Izzo
@darioizzo
May 02 2016 11:42
The dream is to ship it via pip install PyGMO :)
Marcus Märtens
@CoolRunning
May 02 2016 11:42
On Windows I never managed to do boost-stuff and even on Linux it sometimes created problems.
Sweet dream
Dario Izzo
@darioizzo
May 02 2016 11:43
Yep it does get tricky, but Annalisa managed to get PaGMO legacy working with boost using visual studio
So it must be possible !
Francesco Biscani
@bluescarni
May 02 2016 11:43
actually you can probably start without boost
Marcus Märtens
@CoolRunning
May 02 2016 11:43
Hope she wrote it down somewhere
Francesco Biscani
@bluescarni
May 02 2016 11:43
@darioizzo the tutorial does not need it, does it?
Marcus Märtens
@CoolRunning
May 02 2016 11:43
Installation of this crap will take a while
Francesco Biscani
@bluescarni
May 02 2016 11:44
boost on MSVC if anything should be easier than on MINGW
Dario Izzo
@darioizzo
May 02 2016 12:08
@bluescarni How will we define pi without boost?
Francesco Biscani
@bluescarni
May 02 2016 12:09
#define pi 4? :)
Dario Izzo
@darioizzo
May 02 2016 12:09
k
:)
We need the equivalent to boost::math::constants::pi<double>()
3 is a better approximation
Francesco Biscani
@bluescarni
May 02 2016 12:09
we can put a header somewhere I guess, we don't need anything other than double do we?
Dario Izzo
@darioizzo
May 02 2016 12:10
no, shall I put a define in types.hpp ?
or create a new header math_constants.hpp ?
Francesco Biscani
@bluescarni
May 02 2016 12:10
can't we have a constants.hpp header in detail or something like this?
Dario Izzo
@darioizzo
May 02 2016 12:10
k
#ifndef PAGMO_CONSTANTS_HPP
#define PAGMO_CONSTANTS_HPP

#define pi 3.1415926535897932384626433832795028841971693993

#endif
ok
?
but this pollutes the root namespace should we write pagmo::detail::pi instead ?
Francesco Biscani
@bluescarni
May 02 2016 12:15
you cannot do that with macros, they don't have namespaces... I'd use a constexpr function:
namespace pagmo { namespace detail {

constexpr double pi()
{
    return 3.1415926535897932384626433832795028841971693993;
}

}}
Dario Izzo
@darioizzo
May 02 2016 12:16
constexpr what does it do exactly?
Francesco Biscani
@bluescarni
May 02 2016 12:16
it means that it can be computed at compile time, so you can use the output of constexpr functions into templates and what not
Dario Izzo
@darioizzo
May 02 2016 12:16
cool
Francesco Biscani
@bluescarni
May 02 2016 12:17
you can actually replace some template metaprogramming syntax with constexpr functions nowadays
Marcus Märtens
@CoolRunning
May 02 2016 12:21
This big blob of Visual Studio found its way to my hard disc
Dario Izzo
@darioizzo
May 02 2016 12:21
You have CMake installed?
Marcus Märtens
@CoolRunning
May 02 2016 12:21
nope
Dario Izzo
@darioizzo
May 02 2016 12:21
And git ...
Marcus Märtens
@CoolRunning
May 02 2016 12:21
sort of
Dario Izzo
@darioizzo
May 02 2016 12:21
install CMake then
Then you should be good to follow the boost installation tutorial (http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html)
I like the part where many user suggests ..."go get a cup of coffee :)"
Francesco Biscani
@bluescarni
May 02 2016 12:24
lol
I need to go to a meeting new
Dario Izzo
@darioizzo
May 02 2016 12:24
later
Dario Izzo
@darioizzo
May 02 2016 13:46
    vector_double zdt1_fitness(const vector_double &x) const
    {
        double g = 0.;
        vector_double f(2,0.);
        f[0] = x[0];
        auto N = x.size();

        for(decltype(N) i = 1u; i < N; ++i) {
            g += x[i];
        }
        g = 1. + (9. * g) / (N - 1u);

        f[1] = g * ( 1. - sqrt(x[0]/g));
        return f;
    }
@bluescarni Qui la N e' unsigned ma a me serve per fare calcoli ... il compilatore si lamenta (warning) .. come e' il modo per farla giusta?
Dario Izzo
@darioizzo
May 02 2016 14:14
Just made a commit and, on the right, it appeared several times: the first one with my name darioizzo, the others with undefined ...
Marcus Märtens
@CoolRunning
May 02 2016 14:14
strange
Dario Izzo
@darioizzo
May 02 2016 14:15
did not happen with francesco ..
I wonder if my git credential are wrong somehow
Francesco Biscani
@bluescarni
May 02 2016 14:18
where is the problem above?
Dario Izzo
@darioizzo
May 02 2016 14:18
zdt suite
Francesco Biscani
@bluescarni
May 02 2016 14:18
dunno about the commits on the right
Dario Izzo
@darioizzo
May 02 2016 14:19
Just committed a draft
Francesco Biscani
@bluescarni
May 02 2016 14:19
I mean where is the warning coming from?
Dario Izzo
@darioizzo
May 02 2016 14:19
N on the line g = ...
There its converted into a double
Francesco Biscani
@bluescarni
May 02 2016 14:19
cast it to float? static_cast<double>(N) the denominator gets converted to double anyway at the division
Dario Izzo
@darioizzo
May 02 2016 14:20
I thought that is just "hiding the dust under the carpet" as you once put it
Fine for me though
Francesco Biscani
@bluescarni
May 02 2016 14:20
it will be converted to float, when you do (9. * g) / (N - 1u) you are dividing a double by an unsigned, the unsigned gets converted on the fly to double
you can also write (9. * g) / static_cast<double>(N - 1u) if it makes you feel better :)
it will produce the identical binary code but shut the compiler's mouth
Dario Izzo
@darioizzo
May 02 2016 14:21
I personally do not care ... if it was for me I would just silence the compiler
SILENCE
Francesco Biscani
@bluescarni
May 02 2016 14:22
it is GCC isn't it?
Dario Izzo
@darioizzo
May 02 2016 14:22
yes
Marcus Märtens
@CoolRunning
May 02 2016 14:22
Haha
Francesco Biscani
@bluescarni
May 02 2016 14:23
it's a stupid warning, as if engineer actually cared that converting a big int to double might not preserve the exact value
:)
marcus our dota career is regressing from trash tier into dumpster tier
we play (and lose) only to bots, soon we will just spectate bot games
Dario Izzo
@darioizzo
May 02 2016 14:25
And when we will loose also spectating then we go to only audio dota
Marcus Märtens
@CoolRunning
May 02 2016 14:25
Easy bots? ^^
Francesco Biscani
@bluescarni
May 02 2016 14:25
unfair at the moment, but we will spectate only on easy
passive rather
Marcus Märtens
@CoolRunning
May 02 2016 14:26
No shame in loosing... you can always blame it on your team-mate bots
Francesco Biscani
@bluescarni
May 02 2016 14:26
that's what we do
Marcus Märtens
@CoolRunning
May 02 2016 14:26
and report them for feeding
Dario Izzo
@darioizzo
May 02 2016 14:26
that too