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
# Enabling -ffast-math makes the two versions competetive, without it explicit is much faster... | |
# (~20x for exponent of 5) | |
CFLAGS ?= -std=c99 -O3 #-ffast-math | |
LIBS ?= -lrt -lm | |
.PHONY: all | |
output.txt: main | |
$(CC) --version > $@ | |
./$< 42 >> $@ |
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
# -*- coding: utf-8 -*- | |
# distutils: language = c++ | |
from func cimport func as _func | |
def func(double inp): | |
cdef double out | |
_func[double, 3](&inp, &out); | |
return out; |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import (absolute_import, division, | |
print_function, unicode_literals) | |
from sparse import SMat | |
def _print(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
{ | |
"metadata": { | |
"name": "", | |
"signature": "sha256:ff2051673721abee70ec74bc10add60780735c583e66f767e30c0906bd95ba38" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ |
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
# -*- coding: utf-8 -*- | |
# distutils: language = c++ | |
from func cimport func as _func | |
def func(double inp): | |
cdef double out | |
_func[double, double](&inp, &out); | |
return out; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# -*- coding: utf-8 -*- | |
# distutils: language = c++ | |
from libcpp cimport bool | |
cdef extern from "myheader.hpp": | |
cdef cppclass MyInt: | |
void add_two() | |
bool is_poitive() |
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 infer import MetaInfer | |
from infer import types as t | |
class Vec2(metaclass=MetaInfer): | |
# Typed slots: | |
_typed_init_slots = ( | |
('x', t.double, 0.0), | |
('y', t.double, 0.0) | |
) |
OlderNewer