// C++ : Fonctions utilitaires de Hexa
-// Copyright (C) 2009-2013 CEA/DEN, EDF R&D
+// Copyright (C) 2009-2024 CEA, EDF
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
#include <cstdlib>
#include <cmath>
#include <ctime>
+#include <algorithm>
#include <sys/stat.h>
BEGIN_NAMESPACE_HEXA
}
// ======================================================== set_minus
-void set_minus (string& chaine)
+void set_minus (std::string& chaine)
{
int lg = chaine.size();
for (int nc=0 ; nc<lg ; nc++)
Real3 vv = { v2[dir_x]-v1[dir_x], v2[dir_y]-v1[dir_y], v2[dir_z]-v1[dir_z] };
return calc_norme (vv);
}
+// ======================================================== calc_d2
+double calc_d2 (double v1[], double v2[])
+{
+ double dd = carre (v2[dir_x]-v1[dir_x]) + carre (v2[dir_y]-v1[dir_y])
+ + carre (v2[dir_z]-v1[dir_z]);
+ return dd;
+}
// ========================================================= calc_vecteur
void calc_vecteur (double pta[], double ptb[], double vab[])
{
return buffer;
}
// ====================================================== get_time
-cpchar get_time (string& buffer)
+cpchar get_time (std::string& buffer)
{
char quand[24];
time_t tps;
&& requals (lun [1], lautre [1]) && requals (lun [2], lautre [2]) ;
}
// ======================================================== make_basename
-int make_basename (cpchar filename, string& base)
+int make_basename (cpchar filename, std::string& base)
{
const char slash = '/';
const char antis = '\\';