Skip to content

Instantly share code, notes, and snippets.

View gnzlbg's full-sized avatar

gnzlbg gnzlbg

View GitHub Profile
@gnzlbg
gnzlbg / gist:8436401
Created January 15, 2014 13:41
llvm35 fails to install in mavericks
This file has been truncated, but you can view the full file.
To jump for the different files goto the [tags]:
1. [console] Console output.
2. [doctor] brew doctor output.
3. [config.log] config.log
4. [configure] 01.configure
5. [01.configure.cc] 01.configure.cc
6. [02.make] 02.make
7. [02.make.cc] 02.make.cc
@gnzlbg
gnzlbg / gist:db97be19ea35d025db1f
Created July 11, 2014 11:09
ranges::make for range-v3
////////////////////////////////////////////////////////////////////////////////
///
/// \file A make function for the range-v3 library that is able to construct
/// a range from:
/// - a pair of indices
/// - an index and a predicate
/// - a pair of iterators
/// - an iterator and a size
/// - an iterator and a predicate
/// - a container (not implemented yet since we can just use as_range)
@gnzlbg
gnzlbg / gist:435e63a781f387fcb8aa
Created October 10, 2014 13:53
Constexpr storage class
/// Stack storage implementation
/// - preconditions: NoRows != dynamic && NoCols != dynamic
template<class T, template <class> class StorageContainer,
TInt NoRows, TInt NoCols, TInt MaxRows, TInt MaxCols>
struct storage<T, StorageContainer, NoRows, NoCols, MaxRows, MaxCols, stack_storage> {
static_assert(NoRows != dynamic, "stack storage with dynamic #of rows");
static_assert(NoCols != dynamic, "stack storage with dynamic #of columns");
static constexpr auto max_no_rows() RETURNS(MaxRows);
static constexpr auto max_no_cols() RETURNS(MaxCols);
@gnzlbg
gnzlbg / gist:7714403baeef9bcd4be9
Created December 12, 2014 14:04
arithmetic type
#pragma once
/// \file arithmetic.hpp Arithmetic type without implicit conversions
#include <type_traits>
#include <limits>
#include <algorithm>
/// Arithmetic type without implicit conversions
template <class T, class B = void> struct arithmetic {
using value_type = T;
// using difference_type = arithmetic<T, B>;
@gnzlbg
gnzlbg / gist:dcd7f2d7408e763bd416
Created February 18, 2015 15:13
Any-type with over-alignment
#pragma once
/// \file any.hpp Any
///
/// (C) Copyright Christopher Diggins 2005-2011
/// (C) Copyright Pablo Aguilar 2005
/// (C) Copyright Kevlin Henney 2001
///
/// Distributed under the Boost Software License, Version 1.0. (See
/// accompanying file LICENSE_1_0.txt or copy at
/// http://www.boost.org/LICENSE_1_0.txt
@gnzlbg
gnzlbg / randutils.hpp
Last active November 4, 2021 09:08 — forked from imneme/randutils.hpp
/*
* Random-Number Utilities (randutil)
* Addresses common issues with C++11 random number generation.
* Makes good seeding easier, and makes using RNGs easy while retaining
* all the power.
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Melissa E. O'Neill
*
@gnzlbg
gnzlbg / gist:c97742bb08cb6568b8bd
Created May 12, 2015 10:37
clang-format layer
;;; packages.el --- clang-format Layer packages File for Spacemacs
;;
;; Copyright (c) 2012-2014 Sylvain Benner
;; Copyright (c) 2014-2015 Sylvain Benner & Contributors
;;
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
;; URL: https://github.com/syl20bnr/spacemacs
;;
;; This file is not part of GNU Emacs.
;;
/// Primitive number constants
trait PrimNumConstants {
const ZERO: Self;
const ONE: Self;
fn zero() -> Self; // make const?
fn one() -> Self;
}
extern crate time;
use time::{PreciseTime};
fn main() {
let nx: usize = 100;
let ny: usize = 100;
let delta_x: f64 = 1.0;
let dx = delta_x / (nx as f64);
let mut temp_lhs = Vec::<f64>::with_capacity(nx * ny);
let mut temp_rhs = Vec::<f64>::with_capacity(nx * ny);
#pragma once
/// \file
///
/// Access to vertices of an any geometry.
#include <hm3/geometry/access/vertex.hpp>
#include <hm3/geometry/primitive/any/any.hpp>
namespace hm3::geometry::any_primitive {
/// Number of vertices in a any.