Closed Lumphie closed 7 years ago
Desired result:
3 4 <--- generation 2
| |
1 2 <---- generation 1
\ /
|
0 <--- generation 0
Yay I broke the boost graph
runtime error: member access within misaligned address [some memory location] for type 'const struct pair', which requires 8 byte alignment
`/usr/include/c++/5/ext/new_allocator.h:120:4: runtime error: constructor call on misaligned address 0xb780f000b7817 for type 'struct pair', which requires 8 byte alignment 0xb780f000b7817: note: pointer points here
I think I found the error.
I was trying to change something outside the borders of a vector, as I like to do often because I forget to assert the ranges I'm looking for. Now trying to find how the value got outside the borders of the vector.
I'm making a vector of size n. Where n is the generation number of the last species in the vector I get from the input. Maybe the last species is not necessarily the one with the highest generation number.
Will make a for loop that looks for the highest generation number in all the species.
That did not work.
Aaaaaah
Why didn't I find that sooner.
My vector has the correct size (3) but I forgot that I number my generations as generation 1, generation 2, generation 3.
So if I look in the vector[3] it will not work because I should look for vector[2].
That's a mistake I haven't made in a long time.
thank you assert() and std::cout for finding this error.
The code looks horrible and is terribly slow, but it should work now.
sado_test: malloc.c:3695: _int_malloc: Assertion (unsigned long) (size) >= (unsigned long) (nb) failed.
God damnit
same mistake as above. Num_gen is the number of generations (which is 3) and another vector I'm looking in is size 3.
too many empty species and looking outside of vectors.
Can you have a look @richelbilderbeek ?
I think I fixed it.
Problem was that in a directed graph you have to make sure you check the right way.
edge between vd1 and vd2 does not mean edge between vd2 and vd1.
I'm not sure if this is in your tutorial @richelbilderbeek
Yes it passed!
Since I edited it in the online github editor I can't check if it procudes the right graphs, but I'll look at that tomorrow.
Or if you actually looked at the clock you knew I meant today.
So close. It doesn't do the last generation. That should be doable.
Correction: It does not do the last generation and does the 0th generation wrong.
I'm not sure if this is in your tutorial @richelbilderbeek
AFAIKS, it is absent in the tutorial. Thanks for posting this at https://github.com/richelbilderbeek/BoostGraphTutorial/issues/44 and I will implement it one day.
Somehow there are 2 species to start with in a temporary vector. That vector should be empty.
Getting there.
This is happening:
[0] [1]
|\ /|
| \/ |
| /\ |
[a] [b]
a <- 0 true so: Fixed[a] += a a <= 1 true so: Fixed[b] += a b <- 0 true so: Fixed[a] += b b <= 1 true so: Fixed[b] += b
Instead of just creating 1 single species (Fixed[a])
I just don't know. Do you know how to do fix this. The code is a mess. sado_species_graph.cpp
@richelbilderbeek
Just follow the advice of OCLint: cut it to pieces, into multiple smaller (thus better testable) functions.
I hope you have not been doing this: do not optimize for high runtime speed before measuring: slow code that runs is preferred over fast code that does not run.
It does run, but I don't know how to merge species correctly. I might go back a few steps next monday.
I guess it has been done, use sado::to_newick
right now my function correctly graphs all the species, but still has to group different species together if the end up (some generations later) in 1 species.