Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add advanced tree utilities #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

ericpts
Copy link

@ericpts ericpts commented Apr 6, 2018

No description provided.

* Add advanced_tree generator
* Add countfefete example
* Move common benchmarking functionality to benchmark.hpp
* Create binaries under bin/
@ericpts
Copy link
Author

ericpts commented Apr 6, 2018

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

@ericpts
Copy link
Author

ericpts commented Apr 24, 2018

Please take a look @adrian-budau

@@ -37,10 +33,17 @@ lint:
find . -name "*.hpp" | xargs python2 cpplint.py --filter=-legal --counting=detailed

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
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?

$(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
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?

namespace inputGenerator {

template<typename int_t>
static int random_int(int_t left, int_t right)
Copy link
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


template<typename T>
typename std::vector<T>::const_iterator
random_choice(const std::vector<T>& v)
Copy link
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.

None yet

2 participants