-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013 CEA/DEN, EDF R&D
//
-// 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.
+// 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.
//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#ifndef __VECTORUTILS_HXX__
#define __VECTORUTILS_HXX__
#include <cmath>
#include <map>
-/// Precision used for tests of 3D part of INTERP_KERNEL
-#define VOL_PREC 1.0e-6
-
-/// Default relative tolerance in epsilonEqualRelative
-#define DEFAULT_REL_TOL 1.0e-6
-
-/// Default absolute tolerance in epsilonEqual and epsilonEqualRelative
-#define DEFAULT_ABS_TOL 5.0e-12
-
namespace INTERP_KERNEL
{
+ /// Precision used for tests of 3D part of INTERP_KERNEL
+ const double VOL_PREC = 1.0e-6;
+
+ /// Default relative tolerance in epsilonEqualRelative
+ const double DEFAULT_REL_TOL = 1.0e-6;
+
+ /// Default absolute tolerance in epsilonEqual and epsilonEqualRelative
+ const double DEFAULT_ABS_TOL = 5.0e-12;
+
/**
* @param a first point. Should point on a array of size at least equal to SPACEDIM.
* @param b second point. Should point on a array of size at least equal to SPACEDIM.
return ss.str();
}
+ /**
+ * Adds a double[3] - vector to another one.
+ *
+ * @param v vector v
+ * @param res vector in which to store the result res + v.
+ */
+ inline void add(const double* v, double* res)
+ {
+ res[0] += v[0];
+ res[1] += v[1];
+ res[2] += v[2];
+ }
+
/**
* Calculates the cross product of two double[3] - vectors.
*