Permalink
Browse files

[rustc] Update to a newer version of the compiler and fix a bug.

  • Loading branch information...
ptal committed Oct 13, 2017
1 parent cd05438 commit 00c1bc2fc5c4babce6abf65256ab0aa2e2863a59
View
@@ -12,8 +12,8 @@ crate_type = ["rlib", "dylib"]
[dependencies]
intervallum = "^0.6.4"
gcollections = "^0.3.3"
intervallum = "^0.6.5"
gcollections = "^0.3.5"
num = "^0.1.29"
bit-set = "^0.4.0"
View
@@ -6,7 +6,7 @@ Constraint Programming Library
[travis-image]: https://travis-ci.org/ptal/pcp.png
[travis]: https://travis-ci.org/ptal/pcp
Compiled on the nightly channel of Rust. Use [rustup](http://www.rustup.rs) for managing compiler channels. Download the exact same version of the compiler used for PCP with `rustup override add nightly-2017-04-27`.
Compiled on the nightly channel of Rust. Use [rustup](http://www.rustup.rs) for managing compiler channels. Download the exact same version of the compiler used for PCP with `rustup override add nightly-2017-08-30`.
PCP Constraint Programming library will make you feel NP like P.
View
@@ -8,6 +8,6 @@ repository = "https://github.com/ptal/pcp"
license = "Apache-2.0"
[dependencies]
intervallum = "^0.6.0"
gcollections = "^0.3.2"
intervallum = "^0.6.5"
gcollections = "^0.3.5"
pcp = { path = "../" }
View
@@ -58,7 +58,7 @@ fn main() {
println!("{}", test2);
println!("Solve robot1 domaine 38");
let test1 = robot2::RobotScheduling::new_test1(2, 38, 1, 3, 24, 3).solve(); //ne rend pas la main trop long alors que le problème
let test1 = robot2::RobotScheduling::new_test1(2, 38, 1, 3, 24, 3).solve(); //ne rend pas la main trop long alors que le problème
//est plus simple que test précédent. Dans cette version la durée des taches est fixée
println!("{}", test1);
View
@@ -78,7 +78,7 @@ pub enum RobotType {
}
impl Clone for RobotType {
fn clone(&self) -> Self {
fn clone(&self) -> Self {
match self {
&RobotType::Simple => RobotType::Simple, //task has a fixed duration
&RobotType::Duration{ref vdurations, variation} => RobotType::Duration{vdurations: vdurations.iter().map(|v| v.bclone()).collect(), variation: variation}, //task duration is a variable
@@ -365,8 +365,8 @@ mod tests {
use super::*;
use test::Bencher;
#[bench]
fn bench_schedule_2(b: &mut Bencher) {
b.iter(|| RobotScheduling::new(2, 500).solve());
}
// #[bench]
// fn bench_schedule_2(b: &mut Bencher) {
// b.iter(|| RobotScheduling::new(2, 500).solve());
// }
}
View
@@ -16,7 +16,7 @@
#![crate_name = "pcp"]
#![feature(alloc, unboxed_closures, box_syntax, fn_traits, fnbox, never_type)]
#![feature(alloc, unboxed_closures, box_syntax, fnbox, never_type)]
#![feature(test)]
extern crate test;
@@ -63,14 +63,14 @@ impl Reactor for IndexedDeps {
"propagator already subscribed to this variable");
self.assert_var_idx(var, "subscription");
self.num_subscriptions += 1;
let mut props = self.deps_of_mut(var, ev);
let props = self.deps_of_mut(var, ev);
props.push(prop);
}
fn unsubscribe<E>(&mut self, var: usize, ev: E, prop: usize) where E: EventIndex {
self.assert_var_idx(var, "unsubscription");
self.num_subscriptions -= 1;
let mut props = self.deps_of_mut(var, ev);
let props = self.deps_of_mut(var, ev);
let idx = props.iter().position(|&v| v == prop);
assert!(idx.is_some(), "cannot unsubscribe propagator not registered.");
props.swap_remove(idx.unwrap());
@@ -23,6 +23,8 @@ use gcollections::*;
use std::ops::*;
use concept::*;
/// TODO see K. Apt Section 6.5.4 for a better implementation.
// x = y * z
#[derive(Debug)]
pub struct XEqYMulZ<VStore>
@@ -45,7 +45,7 @@ impl<Space> Branch<Space> where
pub fn commit(self, space_from: Space::FrozenState) -> Space {
let mut new = space_from.restore(self.label);
self.alternative.call_once((&mut new,));
self.alternative.call_box((&mut new,));
new
}
}

0 comments on commit 00c1bc2

Please sign in to comment.