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
// copyright Toru Niina 2018. distributed under the Boost Software License v1.0. | |
// it provides an implementation of ReLU without branching. | |
// the core idea of branchless-ReLU is the following. | |
// 1. first, bitwise-and with 0 bits everytime returns 0 bits. but bitwise-and | |
// with 1 bits returns the original argument kept intact. | |
// 0000 & 1010 == 0000, 1111 & 1010 == 1010 | |
// 2. second, we can make 0 bits or 1 bits depending on the sign bit by applying | |
// right arithmetic shift 31 times. | |
// 1000 >> 31 == 1111, 0110 >> 31 == 0000 |
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
// Copyright 2018 Toru Niina | |
// Distributed under the MIT license. | |
#include<type_traits> | |
#include<utility> | |
#include<iterator> | |
#include<tuple> | |
namespace detail | |
{ |
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 <sprout/config.hpp> | |
#include <sprout/container/traits.hpp> | |
#include <sprout/container/functions.hpp> | |
#include <sprout/container/indexes.hpp> | |
#include <sprout/algorithm/fixed/unfold.hpp> | |
#include <sprout/utility/pair.hpp> | |
#include <sprout/array.hpp> | |
constexpr static double dt = 0.1; |
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
template<typename ... T_args> | |
struct pack{}; | |
template<template<typename ...T>class target, typename ... T_args> | |
struct transfer; | |
template<template<typename ...T>class target, typename ... T_args> | |
struct transfer<target, pack<T_args...>> | |
{ | |
typedef target<T_args...> type; |
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
/* Description: this program generates vmd script file (.tcl file) that draws * | |
* polygon structure on vmd from STL binary-format file. * | |
* * | |
* Licensing Terms : This code is licensed under the MIT License. * | |
* copyright (c) 2016 Toru Niina (niina.toru.68u@gmail.com) * | |
* all rights reserved. * | |
* * | |
* Permission is hereby granted, free of charge, to any person obtaining a copy * | |
* of this software and associated documentation files (the "Software"), to deal * | |
* in the Software without restriction, including without limitation the rights * |