Code indexing in gitaly is broken and leads to code not being visible to the user. We work on the issue with highest priority.

Skip to content
Snippets Groups Projects
Commit a8ba6d67 authored by adelmann's avatar adelmann :reminder_ribbon:
Browse files

fix dot

parent 31f9aab6
No related branches found
No related tags found
No related merge requests found
......@@ -65,13 +65,21 @@ inline double euclidean_norm(const Vector_t<T, D>& v) {
return std::sqrt(dot(v, v).apply());
}
// dot product
// dot products
template <class T, unsigned D>
inline double dot(const Vector_t<T, D>& v, const Vector_t<T, D>& w) {
T res = 0.0;
double res = 0.0;
for (unsigned i = 0; i < D; i++)
res += v(i) * w(i);
return std::sqrt(res);
return res;
}
template <class T, unsigned D>
inline double dot(const Vector_t<T, D>& v) {
double res = 0.0;
for (unsigned i = 0; i < D; i++)
res += v(i) * v(i);
return res;
}
#endif
\ No newline at end of file
......@@ -131,8 +131,7 @@ inline void BorisPusher::push(
* R[i] += 0.5 * P[i] * recpgamma;
* \endcode
*/
const double dp = P(0) * P(0) + P(1) * P(1) + P(2) * P(2); // \todo dot(P,P) does not work
R += 0.5 * P / std::sqrt(1.0 + dp);
R += 0.5 * P / std::sqrt(1.0 + dot(P));
}
#endif
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