update README + force user to use unsafe_mode on unsafe usage
All checks were successful
CI / Rust project (push) Successful in 1m51s
All checks were successful
CI / Rust project (push) Successful in 1m51s
This commit is contained in:
parent
83b80c847b
commit
c69eac05c4
13
README.md
13
README.md
@ -1,3 +1,14 @@
|
|||||||
# incfunc
|
# incfunc
|
||||||
|
|
||||||
Incrementally Draw derivation function of deriviation function of function
|
Incrementally Draw derivation function of deriviation function of function
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
Usage: incfunc [OPTIONS]
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-o <OPT_LEVEL> Optimization level [default: 3]
|
||||||
|
-c <CORES> Number of cores [default: max]
|
||||||
|
--unsafe-mode Unsave mode (Advanced)
|
||||||
|
-h, --help Print help
|
||||||
|
|
||||||
|
|||||||
BIN
grid_image.png
BIN
grid_image.png
Binary file not shown.
|
Before Width: | Height: | Size: 774 KiB After Width: | Height: | Size: 765 KiB |
13
src/main.rs
13
src/main.rs
@ -15,7 +15,11 @@ struct Args {
|
|||||||
|
|
||||||
/// Number of cores [default: max]
|
/// Number of cores [default: max]
|
||||||
#[arg(short, value_name = "CORES")]
|
#[arg(short, value_name = "CORES")]
|
||||||
core: Option<u8>
|
core: Option<u8>,
|
||||||
|
|
||||||
|
/// Unsave mode (Advanced)
|
||||||
|
#[arg(long, default_value_t = false)]
|
||||||
|
unsafe_mode: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -34,6 +38,13 @@ fn main() {
|
|||||||
// // points.push(-(i as f64 / 10000.0));
|
// // points.push(-(i as f64 / 10000.0));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
if args.opt_level > 8 {
|
||||||
|
if ! args.unsafe_mode {
|
||||||
|
panic!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this, then enable save mode");
|
||||||
|
} else {
|
||||||
|
println!("WARNING: This will use at least 30GB RAM\nMake sure you want to use this");
|
||||||
|
}
|
||||||
|
}
|
||||||
let mut step = "0.".to_string();
|
let mut step = "0.".to_string();
|
||||||
for _ in 0..args.opt_level {
|
for _ in 0..args.opt_level {
|
||||||
step.push('0')
|
step.push('0')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user