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
use vulkano::instance::Instance; | |
use vulkano::instance::InstanceExtensions; | |
use vulkano::instance::PhysicalDevice; | |
use vulkano::device::Device; | |
use vulkano::device::DeviceExtensions; | |
use vulkano::device::Features; | |
use vulkano::buffer::BufferUsage; | |
use vulkano::buffer::CpuAccessibleBuffer; | |
use vulkano::command_buffer::AutoCommandBufferBuilder; | |
use vulkano::command_buffer::CommandBuffer; |
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
fn get_last_block(bc_file: &Arc<Mutex<File>>) -> io::Result<String> { | |
let mut f = bc_file.lock().unwrap(); | |
let a = BufReader::new(f.deref_mut()).lines(); | |
a.last().unwrap() | |
} |
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
extern crate argparse; | |
extern crate meval; | |
extern crate crossbeam; | |
extern crate num_cpus; | |
#[macro_use] | |
extern crate generator; | |
use argparse::{ArgumentParser, Store}; | |
use meval::Expr; |
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
use std::hash::Hasher; | |
use std::hash::BuildHasher; | |
struct SquareSumHasher { | |
state: u64, | |
} | |
impl SquareSumHasher { | |
fn new(state: u64) -> Self { | |
SquareSumHasher { state } |
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
[package] | |
name = "mandelbrot" | |
version = "0.1.0" | |
authors = ["Federico Pasqua <[email protected]>"] | |
[dependencies] | |
num = "0.1.41" | |
image = "0.18.0" | |
crossbeam = "0.3.0" | |
num_cpus = "1.8.0" |
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
extern crate num; | |
use num::Float; | |
use std::ops::{Add,Sub,Mul}; | |
#[derive(Debug, Eq, PartialEq)] | |
struct Vector2<T> { | |
x: T, | |
y: T, | |
} |
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
==> Making package: x86_64-unknown-redox-newlib-git r17774.d5ac42a49-1 (Thu Feb 22 17:22:12 CET 2018) | |
==> Checking runtime dependencies... | |
==> Checking buildtime dependencies... | |
==> Retrieving sources... | |
-> Updating newlib git repo... | |
-> Updating rust git repo... | |
==> Validating source files with md5sums... | |
newlib ... Skipped | |
rust ... Skipped | |
==> Extracting sources... |
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
use std::io; | |
use std::fmt::Write; | |
/* | |
STDIN: | |
4 | |
7 1 199999 4 | |
STDOUT: | |
17 2 2750131 7 |
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
extern crate crossbeam; | |
extern crate num; | |
use num::Complex; | |
/// Try to determine if `c` is in the Mandelbrot set, using at most `limit` | |
/// iterations to decide. | |
/// | |
/// If `c` is not a member, return `Some(i)` where `i` is the number of | |
/// iterations it took for `c` to leave the circle of radius two centered on the | |
/// origin. If `c` seems to be a member (more precisely, if we reached the |
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
extern crate num; | |
use num::Complex; | |
/// Try to determine if `c` is in the Mandelbrot set, using at most `limit` | |
/// iterations to decide. | |
/// | |
/// If `c` is not a member, return `Some(i)` where `i` is the number of | |
/// iterations it took for `c` to leave the circle of radius two centered on the | |
/// origin. If `c` seems to be a member (more precisely, if we reached the | |
/// iteration limit without being able to prove that `c` is not a member), |