These are chat archives for bluescarni/pagmo_reborn

20th
May 2016
Dario Izzo
@darioizzo
May 20 2016 09:59
This message was deleted
Non per lamentarmi di boost pero:
`error: in "sea_serialization_test": difference{1.24513e-16} between std::get<3>(before_log[i]){467482.371472392} and std::get<3>(after_log[i]){467482.37147239206} exceeds 1e-14%`
Mi sta dicendo cosa? che 1e-16 > 1e-14 ??
Francesco Biscani
@bluescarni
May 20 2016 10:00
isn't it complaining about a relative difference?
thatr percent symbol
Dario Izzo
@darioizzo
May 20 2016 10:00
Even so .... the relative difference is what?
1e-16 is the relative difference
(a-b)/a
I struggle to understand what he means and why he fails ....
Francesco Biscani
@bluescarni
May 20 2016 10:02
it also seems suspicious that in a number of the order 1E5 the absolute difference is 1E-16
should be 1E-11 or so
Dario Izzo
@darioizzo
May 20 2016 10:02
Indeed that is the relative difference
Francesco Biscani
@bluescarni
May 20 2016 10:02
ah wait
but 1E-14% isn't it like 1E-14 / 100?
Dario Izzo
@darioizzo
May 20 2016 10:03
in what world?
that would be the % of unity
Francesco Biscani
@bluescarni
May 20 2016 10:03
if I say something differs relatively by 1% I expect the relative difference would be 0.01
I gues it's saying that 1.2E-16 > 1E-16
that would be my interpretation
Dario Izzo
@darioizzo
May 20 2016 10:04
so he asks me to define a tolerance on the relative error percentage ?
ok lets go with your interpretation. SO i ask for 1e-14 which would be 1e-16 relative differene
still .... mah
Francesco Biscani
@bluescarni
May 20 2016 10:05
I think it's asking for a relative difference yes
Dario Izzo
@darioizzo
May 20 2016 10:06
a relative difference percentage
not (a-b)/b
but (a-b) / b / 100
for some reason
Francesco Biscani
@bluescarni
May 20 2016 10:06
I have never used that function... I guess the percentage is only for reporting purposes... what does the documentation say?
Dario Izzo
@darioizzo
May 20 2016 10:06
no that is a parameter of boost_CHECK_CLOSE(a,b,err)
Francesco Biscani
@bluescarni
May 20 2016 10:07
lol docs are for losers right!
Dario Izzo
@darioizzo
May 20 2016 10:08
```// Absolute value of difference between these two values is 1e-15. They seems // to be very close. But we want to checks that these values differ no more then 0.0001% // of their value. And this test will fail at tolerance supplied.```
Francesco Biscani
@bluescarni
May 20 2016 10:08
Last third parameter defines the tolerance for the comparison in percentage units.
Dario Izzo
@darioizzo
May 20 2016 10:08
so? what should I put in order to account for machine precision?
Francesco Biscani
@bluescarni
May 20 2016 10:09
just put 1E-8 who cares, it's floating point :)
Dario Izzo
@darioizzo
May 20 2016 10:09
k
passes indeed :) !
Francesco Biscani
@bluescarni
May 20 2016 10:09
we don't even know what is the behaviour we expect, as for that we would need to dive into the rapidjson bullshit
:+1:
machine epsilon pfft who cares
:p
¯_(ツ)_/¯ -> my face whenever floating point comes up
whateverface.jpg
Francesco Biscani
@bluescarni
May 20 2016 10:15
sorry for the snark, I just have bad reactions whenever floating point stuff comes up
Dario Izzo
@darioizzo
May 20 2016 11:03
:)
Dario Izzo
@darioizzo
May 20 2016 11:41
@CoolRunning u here?
Marcus Märtens
@CoolRunning
May 20 2016 11:41
yes
I also give no fuck about floating points
Dario Izzo
@darioizzo
May 20 2016 11:41
I am looking at the hypervolume stuff and, if I understand correctly, the logic that we are trying to follow is:
1 - The user invokes the hypervolume as hv = hypervolume(points)
2 - According to the points when the hypervolume.compute is called the appropriate algorithm is called returning the hypervolume
3 - Other methods provide stuff such as least contributor and more that follow the same logic of calling a different algorithm according to points
in a nutshell, is this correct?
Marcus Märtens
@CoolRunning
May 20 2016 11:44
yes... the hypervolume-object has two functions: 1. it encapsulates the points and 2. it selects (based on the points) the best-performing algorithms for computation.
It is a smart interface for someone who needs this quantity to be computed.
Dario Izzo
@darioizzo
May 20 2016 11:45
May I then ask why do we not put everything in one class and select the algorithm called with a switch or if then ?
Marcus Märtens
@CoolRunning
May 20 2016 11:45
There is a method for it in hypervolume
get_best_compute or so
which is switch
Dario Izzo
@darioizzo
May 20 2016 11:46
I know, my question is why is there the need to have base derived class, different classes etc.
Would one class called hypervolume not be enough? Without any subclass .... ?
Marcus Märtens
@CoolRunning
May 20 2016 11:46
There might be better algorithms for several aspects of hv computation at some point. The class-structure allows to implement them quite easily.
Let's say, someone invents a very specific algorithm, that can only compute exclusive contributions for 5 dimensions.
All we need to do is to write a subclass from hv_algorithm that implement the exclusive method and adapt the selection-switch in hypervolume for 5 dimensions.
If this algorithm changes at some point, it is well separated from all the rest.
We used this structure also to embed 3rd party code more easily, by just writing wrappers for the compute, exclusive, etc. methods
Dario Izzo
@darioizzo
May 20 2016 11:49
mmm...
Marcus Märtens
@CoolRunning
May 20 2016 11:49
If put everything in one class, this would be cluttered and much harder to figure out, what is called when exactly.
Dario Izzo
@darioizzo
May 20 2016 11:49
I understand that compute is part of a hypervolume algorithm, but exclusive? what does it do?
Marcus Märtens
@CoolRunning
May 20 2016 11:50
In MOEA, you often want to select the point x that contributes the least to the hypervolume... i.e. you compute HV(points) - HV(points without x).
This is called the contribution of x
So exclusive gives you that.
Dario Izzo
@darioizzo
May 20 2016 11:51
I see, but its a different algorithm, completely orthogonal to the hypervolume one right?
I mean to the one to compute the hypervolume
Marcus Märtens
@CoolRunning
May 20 2016 11:51
There is a naive algorithm, that invokes two hypervolume computations HV(points) and HV(points without x)
But there are more clever methods
The naive implementation is part of the base-class in case there is no more specific method available.
But yeah, computing contributions is something different than computing hypervolumes
Dario Izzo
@darioizzo
May 20 2016 11:53
My point is: we have the following algorithms that work on points:
``````double hypervolume_algo1(const std::vector<vector_double>& points, SOMETHING ELSE);
double hypervolume_algo2(const std::vector<vector_double>& points, SOMETHING ELSE);
double hypervolume_algoN(const std::vector<vector_double>& points, SOMETHING ELSE);
double exclusive_hypervolume_algo1(const std::vector<vector_double>& points, SOMETHING ELSE);
double exclusive_hypervolume_algo2(const std::vector<vector_double>& points, SOMETHING ELSE);
double exclusive_hypervolume_algoN(const std::vector<vector_double>& points, SOMETHING ELSE);``````
And these are all orthogonal to each other right?
Marcus Märtens
@CoolRunning
May 20 2016 11:55
They sort of depend on each other... i.e. WFG is a recursive algorithm, that reduces the dimensionality. However, it needs an efficient algorithm for the stopping dimension. So once it reaches 3 or 2 dimensions, it passes the rest of the computation to hv3d or hv2d, which are the best for these dimensions.
Dario Izzo
@darioizzo
May 20 2016 11:55
ok they can call each other, but thats it
Marcus Märtens
@CoolRunning
May 20 2016 11:55
I am not sure, what you mean with orthogonal :D
They compute the same thing though
They might not work for certain dimensions
but the output should be the same in cases where they do
Dario Izzo
@darioizzo
May 20 2016 11:56
I mean why do we not put these algorithms as functions in a file? They can later be called by a class if we want to provide some logic to choose the good algo for a set of points
If you need to add one algo, just add one function ... right?
there is no OO need here I do not see it at least
Marcus Märtens
@CoolRunning
May 20 2016 11:57
The OO is mainly for extensibility.
And to define an interface that needs to be implemented.
Dario Izzo
@darioizzo
May 20 2016 11:58
But if I want to implement one more algo, I just code one more function ..... as a user I only care to be able to do:
1 - Naive user -> hv = hypervolume(points) -> hv.compute -> hv.exclusive(points, i)
2 - SUper user -> hypervolume_algo1(points) -> exclusive_hypervolume_algoN(points, i)
or I am missing something?
The naive user is using the class hypervolume to make clever choices for him based on dimensions, perf etc.. The super user knows what he want and calls directly the algo he needs
Marcus Märtens
@CoolRunning
May 20 2016 12:01
Yes, I think you are right. It is just a matter of style I guess. We went with OO back then to have it more organized.
A bunch of functions can achieve the same thing.
Dario Izzo
@darioizzo
May 20 2016 12:01
In any case, I am unable to solve the circular dep problem .... did you manage?
Marcus Märtens
@CoolRunning
May 20 2016 12:01
Francesco mentioned outsourcing the files to ./details etc
That might work
I have not tried it.
Dario Izzo
@darioizzo
May 20 2016 12:02
I tried to move them there, but then they still need to refer to each other and you must put the class A before its used. So I did not manage
I think there was some trick to move the methods within the thing ... mah
Francesco Biscani
@bluescarni
May 20 2016 12:03
yes there's a trick
Marcus Märtens
@CoolRunning
May 20 2016 12:03
:smile:
Dario Izzo
@darioizzo
May 20 2016 12:03
:) there he is! so you are following !
Francesco Biscani
@bluescarni
May 20 2016 12:03
not much, just fighting with python atm :)
but anyway
you can declare methods inside the class and the define them afterwards
``````class foo
{
void bar()
{
}
};``````
you do this:
``````class foo
{
void bar();
};

inline void foo::bar()
{

}``````
the `inline` is the important bit
Dario Izzo
@darioizzo
May 20 2016 12:06
So i put the three files in one mega file in detail and move the methods like this?
Francesco Biscani
@bluescarni
May 20 2016 12:06
so if you have a circular dependnecy inside the body of a method, you can defer the implementation of the method after the full declaration of `hv_02` or whatever it is is avaiable
not all methods
Dario Izzo
@darioizzo
May 20 2016 12:06
no I know ...
Francesco Biscani
@bluescarni
May 20 2016 12:06
only the ones that are hit by the circular dep
Dario Izzo
@darioizzo
May 20 2016 12:06
the ones needed by the dep
yep ...
Francesco Biscani
@bluescarni
May 20 2016 12:06
yep
Dario Izzo
@darioizzo
May 20 2016 12:06
ok will try
Francesco Biscani
@bluescarni
May 20 2016 12:06
good luck :)
Dario Izzo
@darioizzo
May 20 2016 12:06
to you!!!
you need it more :)
Francesco Biscani
@bluescarni
May 20 2016 12:06
cheerio
``````// Convert a vector of doubles into a numpy array.
inline bp::object vd_to_a(const pagmo::vector_double &v)
{
// The dimensions of the array to be created.
npy_intp dims[] = {boost::numeric_cast<npy_intp>(v.size())};
// Attempt creating the array.
PyObject *ret = PyArray_SimpleNew(1,dims,NPY_DOUBLE);
if (!ret) {
pagmo_throw(std::runtime_error,"couldn't create a NumPy array: the 'PyArray_SimpleNew()' function failed");
}
// Copy over the data.
std::copy(v.begin(),v.end(),static_cast<double *>(PyArray_DATA((PyArrayObject *)(ret))));
// Hand over to boost python.
return bp::object(bp::handle<>(ret));
}``````
doesn't even look bad and now works properly
Dario Izzo
@darioizzo
May 20 2016 12:18
yeahh!
Marcus Märtens
@CoolRunning
May 20 2016 12:18
:+1:
Francesco Biscani
@bluescarni
May 20 2016 12:29
I mean the conversion works properly, before you get too excited :) it's gonna take some more before I get to the serialization stuff
Dario Izzo
@darioizzo
May 20 2016 12:58
@darioizzo
So I solved the circular dependency stuff between the three classes. Now we have a hypervolume_blob.hpp that has the three together.
BUT
hypervolume_blob.hpp includes hypervolume.hpp that includes hypervolume_blob.hpp
Dario Izzo
@darioizzo
May 20 2016 13:21
@bluescarni @CoolRunning Compiles now. BUT -> Everything is in one huge file. Can we live with this? Can We CAN WE????!!!?!?!?
do you want me to commit this ugly solution?
or we can come up with better?
Marcus Märtens
@CoolRunning
May 20 2016 13:21
:worried:
Francesco Biscani
@bluescarni
May 20 2016 13:22
it does not really matter, in the end if we want to be header only and everything is interdependent we HAVE to include the whole thing
Dario Izzo
@darioizzo
May 20 2016 13:22
You should see it ...
Marcus Märtens
@CoolRunning
May 20 2016 13:22
but working on this blob will be a pain
Dario Izzo
@darioizzo
May 20 2016 13:22
its revolting
Francesco Biscani
@bluescarni
May 20 2016 13:22
you can split it internally in multiple files
you don't have to browse a huge file for editing
Marcus Märtens
@CoolRunning
May 20 2016 13:23
I already had problems combining things into header-only... now with 3 different algos in one file that marginally do the same... its asking for a major screw up :confounded:
Francesco Biscani
@bluescarni
May 20 2016 13:24
in what sense screw up?
Dario Izzo
@darioizzo
May 20 2016 13:24
maybe I can commit and Fra can split it into workable files?
Marcus Märtens
@CoolRunning
May 20 2016 13:24
That I will be constantly asking myself: am I currently in the compute method of the 2-dimensional, 3-dimensional or n-dimensional case?
Dario Izzo
@darioizzo
May 20 2016 13:25
if we split the files could be better
Francesco Biscani
@bluescarni
May 20 2016 13:25
@darioizzo it's just a matter of splitting in 3 files and have the user-visible include do:
``````#include "file1.hpp"
#include "file2.hpp"
#include "file3.hpp"``````
I mean, I can do it but there's no "magic" in it
Dario Izzo
@darioizzo
May 20 2016 13:25
i actually tried
should I commit the shit?
I can then suggest splitting points ... :)
Francesco Biscani
@bluescarni
May 20 2016 13:26
commit it, I can take a look. I need to re-checkout though as I am in the middle of the python stuff and cannot commit yet (I am on a separate branch)
Dario Izzo
@darioizzo
May 20 2016 13:27
done
I weep for c++ :)
Francesco Biscani
@bluescarni
May 20 2016 13:28
`#include` directives are nothing more than copy+paste from the compiler, in theory it should work even if you cut off a function in two pieces in separate files
Dario Izzo
@darioizzo
May 20 2016 13:32
sorry @CoolRunning the test does not pass ... :( but I guess you knew
Marcus Märtens
@CoolRunning
May 20 2016 13:32
Which test?
Dario Izzo
@darioizzo
May 20 2016 13:32
hypervolume
Francesco Biscani
@bluescarni
May 20 2016 13:32
@darioizzo is the hv test suppose to compile in debug mode?
Marcus Märtens
@CoolRunning
May 20 2016 13:32
Ahh... that is... disappointing
Francesco Biscani
@bluescarni
May 20 2016 13:32
I am still getting the warning errors here
Dario Izzo
@darioizzo
May 20 2016 13:32
the one we tried to compile since yesterday
warnings -> yes
but they are suppressed right?
let me see if I have release
Francesco Biscani
@bluescarni
May 20 2016 13:33
``````home/yardbird/temp/PaGMOreborn/tests/../include/detail/hypervolume_blob.hpp:592:23: error: implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
cmp_results.resize(no_points);``````
I have this stuff
Marcus Märtens
@CoolRunning
May 20 2016 13:33
You guys are so hardcore turning warnings into errors
Francesco Biscani
@bluescarni
May 20 2016 13:33
maybe it's GCC vs clang?
Dario Izzo
@darioizzo
May 20 2016 13:33
I don't
Francesco Biscani
@bluescarni
May 20 2016 13:34
you using gcc?
Dario Izzo
@darioizzo
May 20 2016 13:34
I see now the lines you put yesterday are not in the blob
may have removed them ...
you have them still?
Francesco Biscani
@bluescarni
May 20 2016 13:34
GCC still gives warnings here as well, but `-Werror` is disabled for GCC so at least it compiles
Dario Izzo
@darioizzo
May 20 2016 13:35
I can put the lines back so that it compiles also in clang
Francesco Biscani
@bluescarni
May 20 2016 13:35
it's ok, but you don't have these warnings in gcc?
Dario Izzo
@darioizzo
May 20 2016 13:35
nope ...
not when compiling only hypervolume.cpp
maybe if I do make clean? let me try
Francesco Biscani
@bluescarni
May 20 2016 13:36
the builds are failing on gitlab
so the warnings are there as well
Dario Izzo
@darioizzo
May 20 2016 13:36
i have the warnings here too confirmed
``````#if defined(__clang__) || defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wshorten-64-to-32"
#pragma GCC diagnostic ignored "-Wsign-conversion"
#endif``````
its still in utils/hv_algorithms/hv_algorithm.hpp
Francesco Biscani
@bluescarni
May 20 2016 13:38
so everything is in the blob file right? everything to be split off I mean
Dario Izzo
@darioizzo
May 20 2016 13:38
yes
mainly there are four classes and at the end the inline methods
Francesco Biscani
@bluescarni
May 20 2016 13:48
so I have committed something that compiles
it needs to be clear how this stuff is to be included though
because otherwise it's gonna be a mess
is the functionality in these classes supposed to be user-visible or just implementation details?
Dario Izzo
@darioizzo
May 20 2016 13:49
what do you mean?
@CoolRunning ?
Francesco Biscani
@bluescarni
May 20 2016 13:50
the user cannot include detail/hypervolume_hv2d.hpp directly for instance
it has no include guards, it does not include anything, it won't work, it's undefined behaviour
in the documentation needs to be written: "the hv functionality is provided by the header include/hv_all.hpp" for instance
or something like that
and we need to add doxygen directives to override the automatic header identification in the generated documentation
because otherwise in the documentation of the class hv2d the header detail/hvd2d.hpp will be mentioned
Dario Izzo
@darioizzo
May 20 2016 13:52
I was kind of hoping that this initial import would later be changed into a better design .... but ok
Francesco Biscani
@bluescarni
May 20 2016 13:52
there's no better design if the classes depend on each other
Dario Izzo
@darioizzo
May 20 2016 13:52
I would not use classes at all
only one class hypervolume and then functions
Francesco Biscani
@bluescarni
May 20 2016 13:53
and I guess if you spend time to redesign the classe/ functions the time spent fixing the documentation will be a minimal fraction :)
Dario Izzo
@darioizzo
May 20 2016 13:54
well ok lets wait for @CoolRunning to generate a working set up
Francesco Biscani
@bluescarni
May 20 2016 13:57
ok I go back to python then
Dario Izzo
@darioizzo
May 20 2016 13:58
thanks ! I basically had tried the same as you did but got confused by the include guards and all
Francesco Biscani
@bluescarni
May 20 2016 13:58
yeah np, now there's no guards at all in the details :)
kinda bummed that apprently sphinx does not generate the header information: https://europeanspaceagency.gitlab.io/PaGMOreborn/docs/problem.html
are we generating it in doxy?
what do I need to include in order to use the class problem?
Dario Izzo
@darioizzo
May 20 2016 13:59
I did not explicitly activate it
Francesco Biscani
@bluescarni
May 20 2016 13:59
right ok
Dario Izzo
@darioizzo
May 20 2016 13:59
problem.hpp ?
Francesco Biscani
@bluescarni
May 20 2016 14:00
yes but if I am starting to use this the first time it's kinda hard
to guess
Marcus Märtens
@CoolRunning
May 20 2016 14:00
sorry - was in a different office - reading up
Dario Izzo
@darioizzo
May 20 2016 14:00
problem -> problem.hpp not that hard :) but I agree
Francesco Biscani
@bluescarni
May 20 2016 14:00
things are simple until they get complicated
Dario Izzo
@darioizzo
May 20 2016 14:00
like now
Francesco Biscani
@bluescarni
May 20 2016 14:01
yeah but also other things, like the utils header
it's kinda debatable how things are categorized
not necessarily obvious
Dario Izzo
@darioizzo
May 20 2016 14:02
yep, there we have made some arbitrary choices ... subject to changes too ...
@CoolRunning I am merging with master and committing a new version you can work on soon ...
Francesco Biscani
@bluescarni
May 20 2016 14:02
it's fine I don't have concrete grievances :) just saying there's no right or wrong choice
Marcus Märtens
@CoolRunning
May 20 2016 14:03

is the functionality in these classes supposed to be user-visible or just implementation details?

It was supposed to be user-visible... i.e. for advanced users who wants to use the algorithms directly rather than relying on the hypervolume-class as interface.

There is no right nor wrong... just ugly :D
I still expect compilation errors on my side though
with the new checkout, CMake got all messed up again with me :(
Francesco Biscani
@bluescarni
May 20 2016 14:04
there's gonna be warnings turned to errors in MSVC as well
you can disable them for the moment
Marcus Märtens
@CoolRunning
May 20 2016 14:04
Oh joy
Francesco Biscani
@bluescarni
May 20 2016 14:04
comment out this stuff (from `if` to `endif`)
Marcus Märtens
@CoolRunning
May 20 2016 14:06
I wonder if breaking up the circular thing simply by reimplementation would have not been the lesser evil
But I am curious to see the blob-solution
Dario Izzo
@darioizzo
May 20 2016 14:06
thats up to you to judge I guess
Francesco Biscani
@bluescarni
May 20 2016 14:06
I think at this stage it's more important to have something that works
dario told me it's pretty important stuff so I believe him :)
Marcus Märtens
@CoolRunning
May 20 2016 14:07
In theory
This is the minimal hv-system.
That it does not pass the test troubles me
but in theory it should be able to "kinda" efficiently compute everything like in the legacy PyGMO by now
Dario Izzo
@darioizzo
May 20 2016 14:13
``````function: get_best_compute
where: /home/dario/Documents/PaGMOreborn/tests/../include/detail/hypervolume_hv3d.hpp, 359
what: Current implementation allows only to compute 2d hypervolumes!``````
you commented out the 3d cases ...
Marcus Märtens
@CoolRunning
May 20 2016 14:15
yes, I thought so
Anyway, I am still at the office - will check at home.
Dario Izzo
@darioizzo
May 20 2016 14:26
@CoolRunning np. I committed. All warnings are taken care of. One important thing to check: the loop:
``````    /// Comparator function for sorting
/**
* Comparison function for WFG. Can't be static in order to have access to member variable m_current_slice.
*/
bool cmp_points(double* a, double* b) const
{
for (auto i = m_current_slice; i > 0u; --i) {
if (a[i+1] > b[i+1]) {
return true;
}
else if (a[i+1] < b[i+1]) {
return false;
}
}
return false;
}``````
was before:
``````    /// Comparator function for sorting
/**
* Comparison function for WFG. Can't be static in order to have access to member variable m_current_slice.
*/
bool cmp_points(double* a, double* b) const
{
for (int i = m_current_slice + 1; i > =0; --i) {
if (a[i] > b[i]) {
return true;
}
else if (a[i] < b[i]) {
return false;
}
}
return false;
}``````
This is the only dangerous change I made .... check if they are indeed equivalent
Marcus Märtens
@CoolRunning
May 20 2016 14:28
It should be fine, but I will check
The next step would be to port the test-cases from PyGMO to C++
So we know whether we break the algorithms at some point
Dario Izzo
@darioizzo
May 20 2016 14:29
first make the current test pass right?
Marcus Märtens
@CoolRunning
May 20 2016 14:29
sure
Francesco Biscani
@bluescarni
May 20 2016 14:29
ouch that loop hurts
Marcus Märtens
@CoolRunning
May 20 2016 14:29
I guess it is only a matter of activating the 3d and n-dimensional compute functions
Dario Izzo
@darioizzo
May 20 2016 14:29
but I did not want to chenge too much stuff
Francesco Biscani
@bluescarni
May 20 2016 14:30
I think that gives a negative integer overflow
Dario Izzo
@darioizzo
May 20 2016 14:30
how can i be reduced to less than 0?
m_current_slice is vector_double::size_type
Francesco Biscani
@bluescarni
May 20 2016 14:31
`i` will go to zero, and then gets reduced by 1 at the next loop?
Dario Izzo
@darioizzo
May 20 2016 14:31
the first loop?
i thought that when i goes to zero the loop ends
Francesco Biscani
@bluescarni
May 20 2016 14:32
when `i` is zero the loop is run for the last time, then at the end of the loop `i` is still reduced by 1
Dario Izzo
@darioizzo
May 20 2016 14:32
if so needs to be written again ... in equivalent form ... but I am not touching it without tests
Francesco Biscani
@bluescarni
May 20 2016 14:33
the statements in the for loop declaration are always executed
Dario Izzo
@darioizzo
May 20 2016 14:33
so when i=0u he executes --i ?
boom
Francesco Biscani
@bluescarni
May 20 2016 14:34
when you write loops in the form `(i = ...; i < n; ++i)`, `i` will do get to the value of `n` eventually
Dario Izzo
@darioizzo
May 20 2016 14:34
but not n+1
Francesco Biscani
@bluescarni
May 20 2016 14:34
but that's a straight less than
the one above is a leq
or a geq rather
Marcus Märtens
@CoolRunning
May 20 2016 14:34
but darios loop is i > 0
Dario Izzo
@darioizzo
May 20 2016 14:34
the first code snippet
Marcus Märtens
@CoolRunning
May 20 2016 14:35
so i should hold at 0
Dario Izzo
@darioizzo
May 20 2016 14:35
not the second, the second is the old kiryx version
Francesco Biscani
@bluescarni
May 20 2016 14:35
the first snippet is good
Marcus Märtens
@CoolRunning
May 20 2016 14:35
condition will be checked and --i will not be used
Dario Izzo
@darioizzo
May 20 2016 14:35
thats the "new"
Marcus Märtens
@CoolRunning
May 20 2016 14:35
:)
Dario Izzo
@darioizzo
May 20 2016 14:35
as far as its equivalent to the second we are gpood then
Francesco Biscani
@bluescarni
May 20 2016 14:35
I was always talking about the second snippet all this time
:)
Dario Izzo
@darioizzo
May 20 2016 14:36
lol
Marcus Märtens
@CoolRunning
May 20 2016 14:36
I will be seeing Kiryx again beginning of July
The next month will show how much pain will be inflicted upon him :P
Dario Izzo
@darioizzo
May 20 2016 14:36
nice! say hello fro my side .... is this for the PaGMO presentation?
Marcus Märtens
@CoolRunning
May 20 2016 14:37
Yes
Dario Izzo
@darioizzo
May 20 2016 14:37
bring a knife
Marcus Märtens
@CoolRunning
May 20 2016 14:37
Shall we hint some PaGMO 2.0 stuff in the presentation as well?
We are lazy as fuck - still haven't worked on it.
Dario Izzo
@darioizzo
May 20 2016 14:37
funny the second loop is in pagmo and still all tests pass
I mean the second code snippet
Francesco Biscani
@bluescarni
May 20 2016 14:37
it's undefined behaviour, no guarantee of fail either :)
Marcus Märtens
@CoolRunning
May 20 2016 14:37
I only have cabin luggage. Better take something blunt
Francesco Biscani
@bluescarni
May 20 2016 14:37
as wolfgang pauli would say, "not even wrong"
Francesco Biscani
@bluescarni
May 20 2016 14:46
lol can you make out what this means
Dario Izzo
@darioizzo
May 20 2016 14:48
whats that?
I see some reference to the ancient to Davos ... but wtf?
Francesco Biscani
@bluescarni
May 20 2016 14:48
it's an antimage that finished farming ("my agriculture is fninshed") proceeds to buy all items in the shop (including manta style in the 4th panel) and proceeds to win the game
Marcus Märtens
@CoolRunning
May 20 2016 14:49
Moooonsterkill
:D
Francesco Biscani
@bluescarni
May 20 2016 14:49
momomomomomonster kill
Marcus Märtens
@CoolRunning
May 20 2016 14:50
This surely is some historical document
Francesco Biscani
@bluescarni
May 20 2016 14:50
it's a lost chapter from the canterbury tales