• R/O
  • SSH
  • HTTPS

ongeo: Commit


Commit MetaInfo

Revisão63 (tree)
Hora2020-10-28 18:25:13
Autormocchi_2012

Mensagem de Log

・Akima補間 m1=m2 かつ m3=m4 の時の処理を入れていなかったため、ゼロ除算が発生していた不具合の修正

Mudança Sumário

Diff

--- trunk/Interpolation_Akima_Univariate.cpp (revision 62)
+++ trunk/Interpolation_Akima_Univariate.cpp (revision 63)
@@ -81,7 +81,11 @@
8181 else if (m2[i] == m3[i]) ta[ji+i] = m2[i];
8282 else{
8383 double m4_3 = std::abs(m4[i]-m3[i]), m2_1 = std::abs(m2[i]-m1[i]);
84- ta[ji+i] = (m4_3 * m2[i] + m2_1 * m3[i]) / (m4_3 + m2_1);
84+ if (m2_1 == 0 && m4_3 == 0){
85+ ta[ji+i] = (m2[i] + m3[i]) * 0.5;
86+ }else{
87+ ta[ji+i] = (m4_3 * m2[i] + m2_1 * m3[i]) / (m4_3 + m2_1);
88+ }
8589 }
8690 }
8791 }
Show on old repository browser