Skip to content

Add advanced tree utilities#1

Open
ericpts wants to merge 3 commits intoadrian-budau:masterfrom
ericpts:master
Open

Add advanced tree utilities#1
ericpts wants to merge 3 commits intoadrian-budau:masterfrom
ericpts:master

Conversation

@ericpts
Copy link
Copy Markdown

@ericpts ericpts commented Apr 6, 2018

No description provided.

ericpts added 3 commits April 7, 2018 00:26
* Add advanced_tree generator
* Add countfefete example
* Move common benchmarking functionality to benchmark.hpp
* Create binaries under bin/
@ericpts
Copy link
Copy Markdown
Author

ericpts commented Apr 6, 2018

Building a tree of size N should now only take O(NlogN) time.

@ericpts
Copy link
Copy Markdown
Author

ericpts commented Apr 24, 2018

Please take a look @adrian-budau

Comment thread Makefile
benchmark:
$(CXX) $(CFLAGS) examples/benchmark.cpp -o examples/benchmark $(LDFLAGS)
./examples/benchmark
$(CXX) $(CFLAGS) -DINPUT_GENERATOR_DEBUG examples/benchmark.cpp -o bin/benchmark $(LDFLAGS)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably run the benchmark without the debug checks?

Comment thread Makefile
$(CXX) $(CFLAGS) examples/benchmark.cpp -o examples/benchmark $(LDFLAGS)
./examples/benchmark
$(CXX) $(CFLAGS) -DINPUT_GENERATOR_DEBUG examples/benchmark.cpp -o bin/benchmark $(LDFLAGS)
./bin/benchmark
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Countfefete shouldnt be here i guess?

Comment thread src/advanced_tree.hpp
namespace inputGenerator {

template<typename int_t>
static int random_int(int_t left, int_t right)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is randomInt<int_t> exactly like this

Comment thread src/advanced_tree.hpp

template<typename T>
typename std::vector<T>::const_iterator
random_choice(const std::vector<T>& v)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is randomElement (gives item not iterator though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants