1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
//$Procedure T_TAYHRM ( Taylor expansions of Hermite polynomials )
pub fn T_TAYHRM(
N: i32,
NEQ: i32,
MBUFF: &mut [f64],
RSYS: &mut [f64],
DERIVS: &mut [f64],
FOUND: &mut bool,
ctx: &mut Context,
) -> f2rust_std::Result<()> {
let mut MBUFF = DummyArrayMut::new(MBUFF, 1..=((4 * N) * N));
let mut RSYS = DummyArrayMut2D::new(RSYS, 1..=(2 * N), 1..=NEQ);
let mut DERIVS = DummyArrayMut2D::new(DERIVS, 1..=(2 * N), 1..=NEQ);
let mut FACT: f64 = 0.0;
//
// SPICELIB functions
//
//
// Local variables
//
if spicelib::RETURN(ctx) {
return Ok(());
}
spicelib::CHKIN(b"T_TAYHRM", ctx)?;
//
// Solve the systems of equations
//
//
// M * COEFFS = RSYS(1,*)
//
// where M is the coefficient matrix packed into MBUFF.
//
T_SOLVEG_2(
RSYS.as_slice_mut(),
(2 * N),
NEQ,
MBUFF.as_slice_mut(),
DERIVS.as_slice_mut(),
FOUND,
ctx,
);
if !*FOUND {
spicelib::CHKOUT(b"T_TAYHRM", ctx)?;
return Ok(());
}
//
// Compute the derivatives of the Taylor expansion at X.
//
FACT = 1.0;
for I in 1..=(2 * N) {
if (I > 2) {
FACT = (FACT * (I - 1) as f64);
}
for J in 1..=NEQ {
DERIVS[[I, J]] = (DERIVS[[I, J]] * FACT);
}
}
spicelib::CHKOUT(b"T_TAYHRM", ctx)?;
Ok(())
}