This file contains 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 <SFML/Graphics.hpp> | |
#include <Thor/Animations.hpp> | |
#include <Thor/Input.hpp> | |
#include <SFGUI/SFGUI.hpp> | |
#include <SFGUI/Widgets.hpp> | |
template <class Item> | |
void SetPosition(Item&, const sf::Vector2f&); | |
template <> |
This file contains 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
from os import listdir | |
f = open("CMakeLists.txt", "w") | |
f.write( | |
"""project(Foo) | |
cmake_minimum_required(VERSION 2.8) | |
list(APPEND CMAKE_MODULE_PATH \"${CMAKE_CURRENT_LIST_DIR}/cmake\") | |
find_package(SFML 2 REQUIRED graphics window system) | |
include_directories(${SFML_INCLUDE_DIR})\n\n""") |
This file contains 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 Build { | |
local buildType="$1" | |
mkdir -p $buildType/install | |
cd $buildType | |
cmake -DCMAKE_BUILD_TYPE=$buildType -DCMAKE_MODULE_PATH=$(pwd)../../../SFML/cmake/Modules/ -DSFML_ROOT=$(pwd)/../../../SFML/Builds/$buildType/install -DCMAKE_INSTALL_PREFIX=$(pwd)/install -DCMAKE_CXX_FLAGS=-std=c++14 ../.. | |
make -j6 install | |
cd .. | |
} | |
function CloneAndBuild { |
This file contains 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
xi_star = 0.4 | |
max_diameter = 4 | |
def u(xi): | |
return xi_star - xi | |
def f1(xi): | |
return (1 / (xi + 0.1)) ** 2 |
This file contains 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
import subprocess | |
import pickle | |
SetupTime = [] | |
FactorisationTime = [] | |
TotalTime = [] | |
ApproximateSolution = [] | |
TrueSolution = 0.199268 # hardcoded | |
AbsoluteError = [] |
This file contains 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
/* | |
Output: | |
0.000019s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%) | |
0.000029s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%) | |
0.000019s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%) | |
0.000019s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%) | |
0.000019s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%) | |
*/ |
This file contains 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 <boost/range/algorithm.hpp> | |
#include <boost/range/adaptors.hpp> | |
#include <boost/range/join.hpp> | |
#include <boost/range/algorithm_ext/push_back.hpp> | |
#include <boost/graph/adjacency_list.hpp> | |
#include <boost/graph/breadth_first_search.hpp> | |
#include <boost/phoenix.hpp> | |
#include <cstdint> |
This file contains 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 <SFML/Graphics.hpp> | |
#include <cmath> | |
#include <vector> | |
#include <memory> | |
//Vector math functions | |
float dotProduct(const sf::Vector2f& lhs, const sf::Vector2f& rhs) | |
{ | |
return lhs.x * rhs.x + lhs.y * rhs.y; |
This file contains 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
typedef unsigned int Uint; | |
class Permutation { | |
public: | |
//construct identity of given order | |
explicit Permutation(Uint order); | |
//construct from init list | |
Permutation(std::initializer_list<Uint> list); |
This file contains 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 <boost/timer/timer.hpp> | |
#include <boost/range/irange.hpp> | |
#include <boost/range/algorithm/count_if.hpp> | |
#include <algorithm> | |
#include <gmpxx.h> | |
using boost::irange; | |
typedef mpz_class Int; |
NewerOlder