diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-02-17 12:08:10 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-02-17 12:08:10 +0100 |
commit | 81cc0094a2c7478144702e1532bcb067faaebf26 (patch) | |
tree | 15625475af54dde33ded4a5035d8c1914df9bff2 /stokes_test.cpp | |
parent | 9c3ac9c97abeca3ebcb11a1a2c8a6e3cb3791735 (diff) | |
download | code-81cc0094a2c7478144702e1532bcb067faaebf26.tar.gz code-81cc0094a2c7478144702e1532bcb067faaebf26.tar.bz2 code-81cc0094a2c7478144702e1532bcb067faaebf26.zip |
Got the variation calculation fixed and working.
Diffstat (limited to 'stokes_test.cpp')
-rw-r--r-- | stokes_test.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/stokes_test.cpp b/stokes_test.cpp new file mode 100644 index 0000000..7d96c8c --- /dev/null +++ b/stokes_test.cpp @@ -0,0 +1,25 @@ +#include "stokes.hpp" + +using namespace std::complex_literals; + +int main() { + + Vector<std::complex<double>> z(2), dz(2), ddz(2), dH(2); + Matrix<std::complex<double>> ddH(2, 2); + + z << -0.75067 - 0.190132 * 1i, -0.625994 + 0.665987 * 1i; + dz << -0.0636149 - 0.469166 * 1i, 0.820037 - 0.449064 * 1i; + ddz << 0.55777 + 0.730164 * 1i, 0.361959 - 0.463245 * 1i; + dH << 0.967613 - 0.907519 * 1i, 0.712336 - 0.649056 * 1i; + + ddH << -0.371925 - 0.280788 * 1i, -0.163888 - 0.141297 * 1i, + -0.163888 - 0.141297 * 1i, 0.230969 + 0.942449 * 1i; + + std::cout << zDot(z, dH) << std::endl << std::endl; + + std::cout << segmentCost(z, dz, dH) << std::endl << std::endl; + + std::cout << variation(z, dz, ddz, dH, ddH) << std::endl; + + return 0; +} |