diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-11-05 09:03:36 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-11-05 09:03:36 +0100 |
commit | 8209ca60b99594f26f3e9b21ccdbc8695526eb93 (patch) | |
tree | 73c64505e1f7b976c7e09958f6b0621245b0c589 /p-spin.hpp | |
parent | 433bc18e3b9ad16a85777f91c1cc6aa8cc6c7849 (diff) | |
download | code-8209ca60b99594f26f3e9b21ccdbc8695526eb93.tar.gz code-8209ca60b99594f26f3e9b21ccdbc8695526eb93.tar.bz2 code-8209ca60b99594f26f3e9b21ccdbc8695526eb93.zip |
Work on Stokes lines, and new method involving parametric fits.
Diffstat (limited to 'p-spin.hpp')
-rw-r--r-- | p-spin.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -89,3 +89,18 @@ std::tuple<Real, Vector<Scalar>> WdW(const Tensor<Scalar, p>& J, const Vector<Sc return {W, dW}; } + +template <class Scalar> +Matrix<Scalar> dzDot(const Vector<Scalar>& z, const Vector<Scalar>& dH) { + Real z² = z.squaredNorm(); + return (dH.conjugate() - (dH.dot(z) / z²) * z.conjugate()) * z.adjoint() / z²; +} + +template <class Scalar> +Matrix<Scalar> dzDotConjugate(const Vector<Scalar>& z, const Vector<Scalar>& dH, const Matrix<Scalar>& ddH) { + Real z² = z.squaredNorm(); + return -ddH + (ddH * z.conjugate()) * z.transpose() / z² + + (z.dot(dH) / z²) * ( + Matrix<Scalar>::Identity(ddH.rows(), ddH.cols()) - z.conjugate() * z.transpose() / z² + ); +} |