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
# Current maintainer: Janis Beckert <janis.beckert at gmail.com> | |
# Original maintainer: Thomas Dziedzic < gostrc at gmail > | |
# Modified by: Cristóvão D. Sousa <crisjss@gmail.com> | |
# Modified by: Santi Villalba <sdvillal@gmail.com> | |
# Modified by: Janis Beckert <janis.beckert at gmail.com> | |
pkgbase=python-theano | |
pkgname=(python-theano python2-theano) | |
pkgver=0.7.0 | |
pkgrel=3 |
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
use std::ops::{Add,Mul}; | |
pub trait ODE { | |
type State; | |
fn get_state(&self) -> &Self::State; | |
fn differentiate(&self, &Self::State) -> Self::State; | |
fn differentiate_into(&self, &Self::State, &mut Self::State); | |
fn update_state(&mut self, &Self::State); |
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
#[macro_use(s)] extern crate ndarray; | |
#[macro_use] extern crate itertools; | |
use ndarray::{Array,OwnedArray}; | |
fn main() { | |
let r = 0..16; | |
let v = r.map(|x| x as f64).collect::<Vec<_>>(); | |
// Works |
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
extern crate approx; | |
extern crate time; | |
use approx::ApproxEq; | |
use std::f64; | |
fn relative_eq(a: &f64, b: &f64, epsilon: f64, max_relative: f64) -> bool { | |
// Copied straight from approx | |
if a == b { return true; } |
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
fn deserialize_to_last<S: io::Seek + io::Read>(stream: &mut S) -> Result<Self, bincode::serde::DeserializeError> { | |
use bincode::serde::{Deserializer,DeserializeError}; | |
let mut deserializer = Deserializer::new(stream, bincode::SizeLimit::Infinite); | |
let mut input: DeserializationStruct = Deserialize::deserialize(&mut deserializer)?; | |
loop { | |
#[cfg(debug_assertions)] | |
println!("{:?}", input); | |
input = match Deserialize::deserialize(&mut deserializer) { |
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
let time_progression = match sim_config.progression { | |
StepProgression::Linear => vec![sim_config.t; sim_config.nt], | |
StepProgression::Exponential => { | |
(0..sim_config.nt) | |
.map(|x| sim_config.t * 2f64.powi(x as i32)) | |
.collect::<Vec<_>>() | |
}, | |
}; | |
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
pub trait OptionResultExt { | |
type Out; | |
fn invert(self) -> Self::Out; | |
} | |
impl<T, E> OptionResultExt for Option<Result<T, E>> { | |
type Out = Result<Option<T>, E>; | |
fn invert(self) -> Self::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
% cargo run -- -a | |
Compiling clap v2.20.0 | |
Compiling clap-group v0.1.0 (file:///home/janis/code/scrap/rust/clap-group) | |
warning: unused variable: `matches`, #[warn(unused_variables)] on by default | |
--> main.rs:7:9 | |
| | |
7 | let matches = App::new("myapp") | |
| ^^^^^^^ | |
Finished dev [unoptimized + debuginfo] target(s) in 21.31 secs |
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
[package] | |
name = "arrayvec_blowstack" | |
version = "0.1.0" | |
authors = ["Richard Janis Goldschmidt <janis.beckert@gmail.com>"] | |
[dependencies] | |
ndarray = "0.7" | |
[dependencies.arraydeque] | |
git = "https://github.com/SuperFluffy/arraydeque" |
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
name native_blas ns/iter native_noblas ns/iter diff ns/iter diff % | |
add_1d_regular 278 283 5 1.80% | |
add_1d_strided 3,815 3,750 -65 -1.70% | |
add_2d_0_to_2_iadd_scalar 187 181 -6 -3.21% | |
add_2d_assign_ops 300 286 -14 -4.67% | |
add_2d_broadcast_0_to_2 187 181 -6 -3.21% | |
add_2d_broadcast_1_to_2 560 541 -19 -3.39% | |
add_2d_cutout 810 799 -11 -1.36% | |
add_2d_f32_regular 310 312 2 0.65% | |
add_2d_regular 300 287 -13 -4.33% |
OlderNewer