removed the dhypot functions

This commit is contained in:
Zeno Rogue 2019-08-10 00:05:42 +02:00
parent e77a6f3440
commit 986bf0ee9a
2 changed files with 3 additions and 13 deletions

View File

@ -194,16 +194,6 @@ EX ld hypot_d(int d, const hyperpoint& h) {
return sqrt(sqhypot_d(d, h));
}
EX ld sqdhypot_d(int d, const hyperpoint& a, const hyperpoint& b) {
ld sum = 0;
for(int i=0; i<d; i++) sum += (a[i]-b[i])*(a[i]-b[i]);
return sum;
}
EX ld dhypot_d(int d, const hyperpoint& a, const hyperpoint& b) {
return sqrt(sqdhypot_d(d, a, b));
}
EX ld zlevel(const hyperpoint &h) {
if(translatable) return h[GDIM];
else if(sphere) return sqrt(intval(h, Hypc));

View File

@ -589,7 +589,7 @@ void verify() {
ld l = e.len;
ld l0;
if(fast_euclidean) l0 = sqdhypot_d(rugdim, m->flat, m2->flat);
if(fast_euclidean) l0 = sqhypot_d(rugdim, m->flat - m2->flat);
else {
normalizer n(m->flat, m2->flat);
hyperpoint h1 = n(m->flat);
@ -694,7 +694,7 @@ void enqueue(rugpoint *m) {
bool force_euclidean(rugpoint& m1, rugpoint& m2, double rd, bool is_anticusp = false, double d1=1, double d2=1) {
if(!m1.valid || !m2.valid) return false;
// double rd = hdist(m1.h, m2.h) * xd;
double t = sqdhypot_d(rugdim, m1.flat, m2.flat);
double t = sqhypot_d(rugdim, m1.flat - m2.flat);
if(is_anticusp && t > rd*rd) return false;
t = sqrt(t);
current_total_error += (t-rd) * (t-rd);
@ -806,7 +806,7 @@ ld sse(const hyperpoint& h) {
ld l = p.first;
ld l0;
if(fast_euclidean)
l0 = dhypot_d(rugdim, h, p.second->flat);
l0 = hypot_d(rugdim, h - p.second->flat);
else {
normalizer n(h, p.second->flat);
hyperpoint h1 = n(h);