Skip to content

Commit 6383202

Browse files
committed
Add set_output and fix #38
1 parent 921857e commit 6383202

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

src/dop853.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ where
191191
}
192192
}
193193

194+
/// Sets the output type
195+
///
196+
/// See [`OutputType`] for more details.
197+
pub fn set_output(&mut self, out_type: OutputType) {
198+
self.out_type = out_type;
199+
}
200+
194201
/// Computes the initial step size.
195202
fn hinit(&self) -> T {
196203
let (rows, cols) = self.y.shape_generic();
@@ -538,7 +545,7 @@ where
538545
}
539546
}
540547
} else {
541-
self.results.push(self.x0, y_next.clone());
548+
self.results.push(self.x, y_next.clone());
542549
}
543550
}
544551

src/dopri5.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,13 @@ where
183183
}
184184
}
185185

186+
/// Sets the output type
187+
///
188+
/// See [`OutputType`] for more details.
189+
pub fn set_output(&mut self, out_type: OutputType) {
190+
self.out_type = out_type;
191+
}
192+
186193
/// Computes the initial step size
187194
fn hinit(&self) -> T {
188195
let (rows, cols) = self.y.shape_generic();

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ pub use dopri5::Dopri5;
2222
pub use rk4::Rk4;
2323

2424
pub use dop_shared::System;
25+
pub use dop_shared::OutputType;

0 commit comments

Comments
 (0)