MCPcopy Create free account
hub / github.com/autodiff/autodiff / main

Function main

examples/reverse/example-reverse-multi-variable-function.cpp:15–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15int main()
16{
17 var x = 1.0; // the input variable x
18 var y = 2.0; // the input variable y
19 var z = 3.0; // the input variable z
20 var u = f(x, y, z); // the output variable u
21
22 auto [ux, uy, uz] = derivatives(u, wrt(x, y, z)); // evaluate the derivatives of u with respect to x, y, z
23
24 cout << "u = " << u << endl; // print the evaluated output u
25 cout << "ux = " << ux << endl; // print the evaluated derivative ux
26 cout << "uy = " << uy << endl; // print the evaluated derivative uy
27 cout << "uz = " << uz << endl; // print the evaluated derivative uz
28}

Callers

nothing calls this directly

Calls 3

fFunction · 0.70
derivativesFunction · 0.50
wrtFunction · 0.50

Tested by

no test coverage detected