SbpOperator takes &self
This commit is contained in:
		@@ -25,7 +25,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
    let y = ndarray::Array1::linspace(-10.0, 10.0, h);
 | 
			
		||||
    let y = y.broadcast((w, h)).unwrap().reversed_axes();
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(x.into_owned(), y.into_owned());
 | 
			
		||||
    let mut universe = System::new(x.into_owned(), y.into_owned(), Upwind4);
 | 
			
		||||
    group.bench_function("advance", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.init_with_vortex(0.0, 0.0);
 | 
			
		||||
@@ -33,7 +33,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(x.into_owned(), y.into_owned());
 | 
			
		||||
    let mut universe = System::new(x.into_owned(), y.into_owned(), Upwind4);
 | 
			
		||||
    group.bench_function("advance_upwind", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.init_with_vortex(0.0, 0.0);
 | 
			
		||||
@@ -41,7 +41,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<SBP4>::new(x.into_owned(), y.into_owned());
 | 
			
		||||
    let mut universe = System::new(x.into_owned(), y.into_owned(), SBP4);
 | 
			
		||||
    group.bench_function("advance_trad4", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.init_with_vortex(0.0, 0.0);
 | 
			
		||||
 
 | 
			
		||||
@@ -24,7 +24,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
    let x = ndarray::Array2::from_shape_fn((h, w), |(_, i)| i as Float / (w - 1) as Float);
 | 
			
		||||
    let y = ndarray::Array2::from_shape_fn((h, w), |(j, _)| j as Float / (h - 1) as Float);
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(x.clone(), y.clone());
 | 
			
		||||
    let mut universe = System::new(x.clone(), y.clone(), Upwind4);
 | 
			
		||||
    group.bench_function("advance", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
@@ -32,7 +32,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<Upwind4>::new(x.clone(), y.clone());
 | 
			
		||||
    let mut universe = System::new(x.clone(), y.clone(), Upwind4);
 | 
			
		||||
    group.bench_function("advance_upwind", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
@@ -40,7 +40,7 @@ fn performance_benchmark(c: &mut Criterion) {
 | 
			
		||||
        })
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    let mut universe = System::<SBP4>::new(x, y);
 | 
			
		||||
    let mut universe = System::new(x, y, SBP4);
 | 
			
		||||
    group.bench_function("advance_trad4", |b| {
 | 
			
		||||
        b.iter(|| {
 | 
			
		||||
            universe.set_gaussian(0.5, 0.5);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user