Skip to content
Snippets Groups Projects
Commit fc743250 authored by Oliver Sander's avatar Oliver Sander Committed by sander@FU-BERLIN.DE
Browse files

rename method arguments a and b to p and q, to conform with the paper

[[Imported from SVN: r7049]]
parent 94265a24
No related branches found
No related tags found
No related merge requests found
...@@ -158,20 +158,20 @@ public: ...@@ -158,20 +158,20 @@ public:
Unlike the distance itself the squared distance is differentiable at zero Unlike the distance itself the squared distance is differentiable at zero
*/ */
static Dune::FieldMatrix<double,N,N> secondDerivativeOfDistanceSquaredWRTSecondArgument(const UnitVector& a, const UnitVector& b) { static Dune::FieldMatrix<double,N,N> secondDerivativeOfDistanceSquaredWRTSecondArgument(const UnitVector& p, const UnitVector& q) {
Dune::FieldMatrix<double,N,N> result; Dune::FieldMatrix<double,N,N> result;
double sp = a.data_ * b.data_; double sp = p.data_ * q.data_;
// Compute vector A (see notes) // Compute vector A (see notes)
Dune::FieldMatrix<double,1,N> row; Dune::FieldMatrix<double,1,N> row;
row[0] = b.projectOntoTangentSpace(a.globalCoordinates()); row[0] = q.projectOntoTangentSpace(p.globalCoordinates());
row *= secondDerivativeOfArcCosSquared(sp); row *= secondDerivativeOfArcCosSquared(sp);
Dune::FieldMatrix<double,N,1> column; Dune::FieldMatrix<double,N,1> column;
for (int i=0; i<N; i++) for (int i=0; i<N; i++)
column[i] = a.globalCoordinates()[i] - b.globalCoordinates()[i]*sp; column[i] = p.globalCoordinates()[i] - q.globalCoordinates()[i]*sp;
Dune::FieldMatrix<double,N,N> A; Dune::FieldMatrix<double,N,N> A;
// A = row * column // A = row * column
...@@ -181,14 +181,14 @@ public: ...@@ -181,14 +181,14 @@ public:
Dune::FieldMatrix<double,N,N> B; Dune::FieldMatrix<double,N,N> B;
for (int i=0; i<N; i++) for (int i=0; i<N; i++)
for (int j=0; j<N; j++) for (int j=0; j<N; j++)
B[i][j] = (i==j)*sp + a.data_[i]*b.data_[j]; B[i][j] = (i==j)*sp + p.data_[i]*q.data_[j];
// Bring it all together // Bring it all together
result = A; result = A;
result.axpy(-1*derivativeOfArcCosSquared(sp), B); result.axpy(-1*derivativeOfArcCosSquared(sp), B);
for (int i=0; i<N; i++) for (int i=0; i<N; i++)
result[i] = b.projectOntoTangentSpace(result[i]); result[i] = q.projectOntoTangentSpace(result[i]);
return result; return result;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment