rsspice/generated/spicelib/
zzinvelt.rs1use super::*;
6use f2rust_std::*;
7
8const XFRACT: f64 = 0.0000000001;
9const KEYXFR: i32 = 1;
10const SGREED: f64 = 0.00000001;
11const KEYSGR: i32 = (KEYXFR + 1);
12const SGPADM: f64 = 0.0000000001;
13const KEYSPM: i32 = (KEYSGR + 1);
14const PTMEMM: f64 = 0.0000001;
15const KEYPTM: i32 = (KEYSPM + 1);
16const ANGMRG: f64 = 0.000000000001;
17const KEYAMG: i32 = (KEYPTM + 1);
18const LONALI: f64 = 0.000000000001;
19const KEYLAL: i32 = (KEYAMG + 1);
20const SRFIDX: i32 = 1;
21const CTRIDX: i32 = (SRFIDX + 1);
22const CLSIDX: i32 = (CTRIDX + 1);
23const TYPIDX: i32 = (CLSIDX + 1);
24const FRMIDX: i32 = (TYPIDX + 1);
25const SYSIDX: i32 = (FRMIDX + 1);
26const PARIDX: i32 = (SYSIDX + 1);
27const NSYPAR: i32 = 10;
28const MN1IDX: i32 = (PARIDX + NSYPAR);
29const MX1IDX: i32 = (MN1IDX + 1);
30const MN2IDX: i32 = (MX1IDX + 1);
31const MX2IDX: i32 = (MN2IDX + 1);
32const MN3IDX: i32 = (MX2IDX + 1);
33const MX3IDX: i32 = (MN3IDX + 1);
34const BTMIDX: i32 = (MX3IDX + 1);
35const ETMIDX: i32 = (BTMIDX + 1);
36const DSKDSZ: i32 = ETMIDX;
37const SVFCLS: i32 = 1;
38const GENCLS: i32 = 2;
39const LATSYS: i32 = 1;
40const CYLSYS: i32 = 2;
41const RECSYS: i32 = 3;
42const PDTSYS: i32 = 4;
43
44pub fn ZZINVELT(
46 P: &[f64],
47 CORSYS: i32,
48 CORPAR: &[f64],
49 BOUNDS: &[f64],
50 MARGIN: f64,
51 EXCLUD: i32,
52 INSIDE: &mut bool,
53 ctx: &mut Context,
54) -> f2rust_std::Result<()> {
55 let P = DummyArray::new(P, 1..=3);
56 let CORPAR = DummyArray::new(CORPAR, 1..);
57 let BOUNDS = DummyArray2D::new(BOUNDS, 1..=2, 1..=3);
58
59 if RETURN(ctx) {
67 return Ok(());
68 }
69
70 CHKIN(b"ZZINVELT", ctx)?;
71
72 if (MARGIN < 0.0) {
73 SETMSG(b"Margin must be non-negative but was #.", ctx);
74 ERRDP(b"#", MARGIN, ctx);
75 SIGERR(b"SPICE(VALUEOUTOFRANGE)", ctx)?;
76 CHKOUT(b"ZZINVELT", ctx)?;
77 return Ok(());
78 }
79
80 if (CORSYS == LATSYS) {
85 ZZINLAT(P.as_slice(), BOUNDS.as_slice(), MARGIN, EXCLUD, INSIDE, ctx)?;
86 } else if (CORSYS == PDTSYS) {
87 ZZINPDT(
88 P.as_slice(),
89 BOUNDS.as_slice(),
90 CORPAR.as_slice(),
91 MARGIN,
92 EXCLUD,
93 INSIDE,
94 ctx,
95 )?;
96 } else if (CORSYS == RECSYS) {
97 ZZINREC(P.as_slice(), BOUNDS.as_slice(), MARGIN, EXCLUD, INSIDE, ctx)?;
98 } else {
99 SETMSG(b"Coordinate system code # was not recognized.", ctx);
100 ERRINT(b"#", CORSYS, ctx);
101 SIGERR(b"SPICE(NOTSUPPORTED)", ctx)?;
102 CHKOUT(b"ZZINVELT", ctx)?;
103 return Ok(());
104 }
105
106 CHKOUT(b"ZZINVELT", ctx)?;
107 Ok(())
108}