summaryrefslogtreecommitdiff
path: root/stereographic.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'stereographic.hpp')
-rw-r--r--stereographic.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/stereographic.hpp b/stereographic.hpp
index 7a6b411..7dd871c 100644
--- a/stereographic.hpp
+++ b/stereographic.hpp
@@ -17,7 +17,7 @@ Vector stereographicToEuclidean(const Vector& ζ) {
Vector euclideanToStereographic(const Vector& z) {
unsigned N = z.size();
Vector ζ(N - 1);
-
+
for (unsigned i = 0; i < N - 1; i++) {
ζ(i) = z(i) / (sqrt(N) - z(N - 1));
}
@@ -33,7 +33,7 @@ Matrix stereographicJacobian(const Vector& ζ) {
for (unsigned i = 0; i < N - 1; i++) {
for (unsigned j = 0; j < N - 1; j++) {
- J(i, j) = - 4.0 * ζ(i) * ζ(j);
+ J(i, j) = -4.0 * ζ(i) * ζ(j);
if (i == j) {
J(i, j) += 2.0 * (1.0 + b);
}
@@ -55,7 +55,8 @@ Matrix stereographicMetric(const Vector& ζ) {
for (unsigned i = 0; i < N; i++) {
for (unsigned j = 0; j < N; j++) {
- g(i, j) = 16.0 * (std::conj(ζ(i)) * ζ(j) * (1.0 + a) - std::real(std::conj(ζ(i) * ζ(j)) * (1.0 + b)));
+ g(i, j) = 16.0 * (std::conj(ζ(i)) * ζ(j) * (1.0 + a) -
+ std::real(std::conj(ζ(i) * ζ(j)) * (1.0 + b)));
if (i == j) {
g(i, j) += 4.0 * std::abs(1.0 + b);
}
@@ -66,7 +67,8 @@ Matrix stereographicMetric(const Vector& ζ) {
return g;
}
-std::tuple<std::complex<double>, Vector, Matrix> stereographicHamGradHess(const Tensor3& J, const Vector& ζ) {
+std::tuple<std::complex<double>, Vector, Matrix> stereographicHamGradHess(const Tensor3& J,
+ const Vector& ζ) {
Vector grad;
Matrix hess;