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 <iterator> | |
| #include <algorithm> | |
| #include "houdini_iterator_wrapper.hpp" | |
| int main() { | |
| hdk_test_iter vit(10); | |
| for ( vit.rewind(); !vit.atEnd(); vit.advance() ) { |
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 <array> | |
| #include <utility> | |
| #include <iostream> | |
| #include <boost/hana/for_each.hpp> | |
| #include <boost/hana/integral_constant.hpp> | |
| #include <boost/hana/range.hpp> | |
| constexpr size_t factorial(size_t v) { | |
| return v==0?1:factorial(v-1) * v; |
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 <typeinfo> | |
| #include <memory> | |
| #include <cxxabi.h> | |
| #include <vector> | |
| class ObjectBase { | |
| public: | |
| virtual std::string held_type() const = 0; |
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 <algorithm> | |
| #include <vector> | |
| #include <numeric> | |
| #include <iterator> | |
| int main( int argc, char * argv[]) { |
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 <tuple> | |
| //sample vector class | |
| struct Vec3 { | |
| public: | |
| Vec3(const std::initializer_list<double>& a) { std::copy(a.begin(),a.end(),data); } | |
| double& operator()(size_t i) { return data[i]; } | |
| private: |
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 <Eigen/Core> | |
| //Mimics http://stackoverflow.com/a/40958644 | |
| template <typename Scalar, int D, int E, int... Is> | |
| auto eigen_unpack_impl(const Eigen::Matrix<Scalar, D, E>& a, std::integer_sequence<int,Is...>) { | |
| return std::tie( a(Is)... ); | |
| } |
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 "active_set.h" | |
| #include <set> | |
| template <> | |
| const ActiveSet::IndexPair& ActiveSet::getIndexPair<ActiveSet::VariableType::Free>() const { | |
| return m_active_pair; | |
| } | |
| template <> | |
| const ActiveSet::IndexPair& ActiveSet::getIndexPair<ActiveSet::VariableType::Dirichlet>() const { | |
| return m_dirichlet_pair; |
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
| // ImGui GLUT binding with OpenGL | |
| // In this binding, ImTextureID is used to store an OpenGL 'GLuint' texture identifier. Read the FAQ about ImTextureID in imgui.cpp. | |
| // If your context is GL3/GL3 then prefer using the code in opengl3_example. | |
| // You *might* use this code with a GL3/GL4 context but make sure you disable the programmable pipeline by calling "glUseProgram(0)" before ImGui::Render(). | |
| // We cannot do that from GL2 code because the function doesn't exist. | |
| // You can copy and use unmodified imgui_impl_* files in your project. See main.cpp for an example of using this. | |
| // If you use this binding you'll need to call 4 functions: ImGui_ImplXXXX_Init(), ImGui_ImplXXXX_NewFrame(), ImGui::Render() and ImGui_ImplXXXX_Shutdown(). | |
| // If you are new to ImGui, see examples/README.txt and documentation at the top of imgui.cpp. |
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
| #ifndef PIFDSL_HPP | |
| #define PIFDSL_HPP | |
| #include <map> | |
| namespace pif { | |
| using hash = std::map<string,string>; | |
| } | |
| //example: |
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 <algorithm> | |
| #include <iterator> | |
| #include <vector> | |
| #include <sstream> | |
| template <typename T> | |
| std::string to_csv(const std::vector<T>& vec) { | |
| std::stringstream ss; | |
| std::copy(vec.begin(),vec.end()-1,std::ostream_iterator<T>(ss,",")); |