Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <memory> | |
#include <cereal/archives/binary.hpp> | |
#include <cereal/types/vector.hpp> | |
#include <cereal/types/string.hpp> | |
#include <cereal/types/base_class.hpp> | |
#include <cereal/types/memory.hpp> | |
#include <cereal/access.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
class Base { | |
public: | |
Base() { ; } | |
~Base() { ; } | |
}; | |
template <typename Derived> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename KeyType, typename ValueType> | |
class range_map { | |
public: | |
range_map() { ; } | |
range_map(std::initializer_list<std::pair<KeyType,ValueType>> list) { | |
for (auto& pair : list) { | |
keys.push_back(pair.first); | |
values.push_back(pair.second); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <set> | |
class Base { | |
}; | |
template <typename T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename ...Args> | |
void hist(bool conditional, TRuntimeObjects& obj, Args&&... args) { | |
if (conditional) { obj.FillHistogram(std::forward<Args>(args)...); } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
S - Set of all nodes with no inbound connections (NodeType::Input) | |
-- Enumerating all paths | |
paths = {} | |
for each node n in S do | |
visit(n,{}) | |
function visit(node n, list l) | |
if n is not in l then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Function template constraint (implicit or "ad-hoc") | |
template<typename T> requires | |
requires (T a) { a + a; } && | |
requires (T b) { b * b; } && | |
requires (T c) { sqrt(c); } | |
T Magnitude(vector<T>&& vec) { | |
T sum; | |
for (auto& const i : vec) { sum += i*i; } | |
return sqrt(sum); |