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 <Eigen/Dense> | |
| #include <tuple> | |
| #include <utility> | |
| #include <iostream> | |
| template <typename... Args, int... N> | |
| auto _interleave(std::integer_sequence<int,N...>, const Args&... args) { | |
| using namespace Eigen; | |
| constexpr static int S = sizeof...(Args); | |
| using Scalar = typename std::tuple_element<0,std::tuple<Args...>>::type::Scalar; | 
  
    
      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> | |
| int main() { | |
| constexpr static int N = 20; | |
| for(int i = 0; i < N; ++i) { | |
| std::cout << i << ", "; | |
| } | |
| std::cout << std::endl; | 
  
    
      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 <cstddef> | |
| #include <utility> | |
| #include <iostream> | |
| template <typename Obj> | |
| struct bind_enabled { | |
| public: | |
| const Obj& derived() const {return *static_cast<const Obj*>(this);} | 
  
    
      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 <cstddef> | |
| #include <utility> | |
| #include <iostream> | |
| template <typename Obj> | |
| using optional_data_type = decltype(std::declval<Obj>().optional()); | |
| template <typename Obj> | |
| struct Serializer { | |
| public: | 
  
    
      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 TokType> | |
| struct range { | |
| public: | |
| range(const TokType& a, const TokType& b): m_begin(a), m_end(b) {} | |
| TokType begin() const { return m_begin;} | |
| TokType end() const { return m_end;} | |
| private: | |
| const TokType& m_begin,m_end; | |
| }; | 
  
    
      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 CONTIGUOUS_BINARY_TREE_HPP | |
| #define CONTIGUOUS_BINARY_TREE_HPP | |
| #include <cmath> | |
| #include <vector> | |
| template <typename T> | |
| struct CBinaryTree: public std::vector<T> { | |
| public: | |
| using BaseType = std::vector<T>; | |
| using BaseType::operator[]; | 
  
    
      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 EIGEN_HDK_CONVERSION_HPP | |
| #define EIGEN_HDK_CONVERSION_HPP | |
| #include <UT/UT_SparseMatrix.h> | |
| #include <Eigen/Sparse> | |
| template <typename T, int Options = Eigen::ColMajor, typename StorageIndex> | |
| UT_SparseMatrixELLT<T> eigen_to_hdk_ellt(const Eigen::SparseMatrix<T,Options,StorageIndex>& A) { | |
| UT_SparseMatrixELLT<T> B(A.rows(), A.nonZeros()); | |
| int nz; | 
  
    
      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 <array> | |
| #include <iostream> | |
| #include <utility> | |
| #include <iterator> | |
| template <int N, typename T, typename... Types> | |
| struct NthPackTerm { | |
| using type = typename NthPackTerm<N-1,Types...>::type; | |
| }; | 
  
    
      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> | |
| template <typename F, typename... Fs> | |
| auto call_until_not_nullptr(F&& f, Fs&&... fs) -> decltype(f()) { | |
| if(auto v = f()) { | |
| return v; | |
| } else { | |
| if constexpr(sizeof...(fs) != 0) { | |
| return call_until_not_nullptr(std::forward<Fs>(fs)...); | 
  
    
      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 CYCLIC_LIST_HPP | |
| #define CYCLIC_LIST_HPP | |
| #include <list> | |
| namespace detail { | |
| template <typename Iterable> | |
| struct cyclic_iterator { | |
| public: |