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::collections::{HashMap, VecDeque}; | |
use std::hash::Hash; | |
pub type Count = usize; | |
/// Ring-buffer based counter for O(1) checking of counts | |
/// of a value within the last `n` entries. | |
/// | |
/// Probably overkill. | |
pub struct RecentCounts<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
potential: | |
supercell: {target: [1, 1, 1]} | |
kind: | |
kc-z: {} | |
#airebo: | |
# lj-sigma: 3.0 | |
# lj-scale: 1.0 | |
scale-ranges: | |
repeat-count: 2 | |
parameter: |
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::cmp::Ordering; | |
use std::collections::BTreeSet; | |
macro_rules! set { | |
($($t:tt)*) => { vec![$($t)*].into_iter().collect::<BTreeSet<_>>() }; | |
} | |
/// Implements "is subset of" as a comparator. | |
struct Subset<S>(BTreeSet<S>); |
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
lattice: | |
- [2.6457513110645907, 0.0] | |
- [-1.3228756555322954, 2.29128784747792] | |
layer: | |
- frac-lattice: | |
- [-0.14285714285714285, 0.2857142857142857] | |
- [-0.2857142857142857, -0.42857142857142855] | |
frac-sites: | |
- [0.0, 0.0] | |
- [0.6666666666666666, 0.3333333333333333] |
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
potential: | |
supercell: {target: [1, 1, 1]} | |
kind: | |
kc-z: {} | |
#airebo: | |
# lj-sigma: 3.0 | |
# lj-scale: 1.0 | |
scale-ranges: | |
repeat-count: 2 | |
parameter: |
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
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT | |
// file at the top-level directory of this distribution and at | |
// http://rust-lang.org/COPYRIGHT. | |
// | |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or | |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license | |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | |
// option. This file may not be copied, modified, or distributed | |
// except according to those terms. |
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::ops::{Add, Sub, Neg}; | |
pub trait AddSub2<OtherP> | |
: Sized | |
+ Add<<Self as AddSub2<OtherP>>::Zero, Output=Self> | |
+ Sub<<Self as AddSub2<OtherP>>::Zero, Output=Self> | |
+ Add<<Self as AddSub2<OtherP>>::Other, Output=<Self as AddSub2<OtherP>>::Add> | |
+ Sub<<Self as AddSub2<OtherP>>::Other, Output=<Self as AddSub2<OtherP>>::Sub> | |
+ Add<<Self as AddSub2<OtherP>>::NOther, Output=<Self as AddSub2<OtherP>>::Sub> | |
+ Sub<<Self as AddSub2<OtherP>>::NOther, Output=<Self as AddSub2<OtherP>>::Add> |
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
pub use ::std::io::prelude::*; | |
pub use ::std::io::Result; | |
pub trait Node | |
: Copy + Ord + Eq | |
{ | |
fn add(self, b: Self) -> Self; | |
fn sub(self, b: Self) -> Self; | |
fn neg(self) -> Self; |
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::ops::{Add, Sub, Neg}; | |
pub trait AddSub2<OtherP> | |
: Sized | |
+ Add<<Self as AddSub2<OtherP>>::Zero, Output=Self> | |
+ Sub<<Self as AddSub2<OtherP>>::Zero, Output=Self> | |
+ Add<<Self as AddSub2<OtherP>>::Other, Output=<Self as AddSub2<OtherP>>::Add> | |
+ Sub<<Self as AddSub2<OtherP>>::Other, Output=<Self as AddSub2<OtherP>>::Sub> | |
+ Add<<Self as AddSub2<OtherP>>::NOther, Output=<Self as AddSub2<OtherP>>::Sub> | |
+ Sub<<Self as AddSub2<OtherP>>::NOther, Output=<Self as AddSub2<OtherP>>::Add> |
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::ops::{Add, Sub, Neg}; | |
pub trait AddSub1 | |
: Sized | |
+ Add<<Self as AddSub1>::NThrice, Output=<Self as AddSub1>::NTwice> | |
+ Sub<<Self as AddSub1>::NThrice> | |
+ Add<<Self as AddSub1>::NTwice, Output=<Self as AddSub1>::Neg> | |
+ Sub<<Self as AddSub1>::NTwice, Output=<Self as AddSub1>::Thrice> | |
+ Add<<Self as AddSub1>::Neg, Output=<Self as AddSub1>::Zero> | |
+ Sub<<Self as AddSub1>::Neg, Output=<Self as AddSub1>::Twice> |