Skip to content

Instantly share code, notes, and snippets.

@stiv-yakovenko
Created October 28, 2017 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stiv-yakovenko/d982f2757a4b9da684102bc8b9cebbae to your computer and use it in GitHub Desktop.
Save stiv-yakovenko/d982f2757a4b9da684102bc8b9cebbae to your computer and use it in GitHub Desktop.
extern crate rand;
use std::collections::HashMap;
use std::cell::RefCell;
use std::collections::*;
pub struct Aliases {
pub idx_to_name:HashMap< i16,String>,
pub name_to_idx:HashMap< String,i16>
}
pub struct Polynome {
pub poly: BTreeMap<i16, f64>,
pub aliases: RefCell<Aliases>,
}
impl Aliases {
pub fn new()->Aliases{
Aliases{idx_to_name:HashMap::new(),name_to_idx:HashMap::new()}
}
}
impl Polynome {
pub fn new() -> Polynome {
Polynome {
poly: BTreeMap::new(),
aliases: RefCell::new(Aliases::new()),
}
}
pub fn clone(&self) -> Polynome {
Polynome {
poly: self.poly.clone(),
aliases: self.aliases,
}
}
}
fn main() {
println!("hi");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment