diff options
author | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-18 16:26:37 +0000 |
---|---|---|
committer | skachano <skachano@636b058d-ea47-450e-bf9e-a15bfbe3eedb> | 2016-11-18 16:26:37 +0000 |
commit | 786f13354f48a652232ca51112386ed0173f23d1 (patch) | |
tree | ae320abe21a40f7459c1ac9bac6da0f36525eb9c /src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h | |
parent | f891467fe38d7757aa3d92705ca99e847cdd68d9 (diff) | |
parent | 49ba4f283d9a742b4dbc7ef966f2cb769a87c4d1 (diff) |
Merged trunc in witness
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/relaxed-witness@1761 636b058d-ea47-450e-bf9e-a15bfbe3eedb
Former-commit-id: 67fd48a872fb297cd04ba127bb0778c5216f0a41
Diffstat (limited to 'src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h')
-rw-r--r-- | src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h b/src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h new file mode 100644 index 00000000..e1bad64e --- /dev/null +++ b/src/common/include/gudhi_patches/CGAL/determinant_of_vectors.h @@ -0,0 +1,117 @@ +// Copyright (c) 2014 +// INRIA Saclay-Ile de France (France) +// +// This file is part of CGAL (www.cgal.org); 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 3 of the License, +// or (at your option) any later version. +// +// Licensees holding a valid commercial license may use this file in +// accordance with the commercial license agreement provided with the software. +// +// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE +// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. +// +// $URL$ +// $Id$ +// +// Author(s) : Marc Glisse + +#ifndef CGAL_DETVEC_H +#define CGAL_DETVEC_H +#include <CGAL/determinant.h> +#include <CGAL/predicates/sign_of_determinant.h> + +namespace CGAL { + // TODO: determine whether it is better to pass them by lines or columns. + + template <class NT, class Vector> inline + NT determinant_of_vectors(Vector const&a, Vector const&b){ + return determinant<NT>(a[0],a[1],b[0],b[1]); + } + template <class NT, class Vector> inline + typename Sgn<NT>::result_type + sign_of_determinant_of_vectors(Vector const&a, Vector const&b){ + return sign_of_determinant<NT>(a[0],a[1],b[0],b[1]); + } + + template <class NT, class Vector> + NT determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c){ + return determinant<NT>(a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); + } + template <class NT, class Vector> + typename Sgn<NT>::result_type + sign_of_determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c){ + return sign_of_determinant<NT>(a[0],a[1],a[2],b[0],b[1],b[2],c[0],c[1],c[2]); + } + + template <class NT, class Vector> + NT determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d){ + return determinant<NT>( + a[0],a[1],a[2],a[3], + b[0],b[1],b[2],b[3], + c[0],c[1],c[2],c[3], + d[0],d[1],d[2],d[3]); + } + template <class NT, class Vector> + typename Sgn<NT>::result_type + sign_of_determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d){ + return sign_of_determinant<NT>( + a[0],a[1],a[2],a[3], + b[0],b[1],b[2],b[3], + c[0],c[1],c[2],c[3], + d[0],d[1],d[2],d[3]); + } + + template <class NT, class Vector> + NT determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d, Vector const&e){ + return determinant<NT>( + a[0],a[1],a[2],a[3],a[4], + b[0],b[1],b[2],b[3],b[4], + c[0],c[1],c[2],c[3],c[4], + d[0],d[1],d[2],d[3],d[4], + e[0],e[1],e[2],e[3],e[4]); + } + template <class NT, class Vector> + typename Sgn<NT>::result_type + sign_of_determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d, Vector const&e){ + return sign_of_determinant<NT>( + a[0],a[1],a[2],a[3],a[4], + b[0],b[1],b[2],b[3],b[4], + c[0],c[1],c[2],c[3],c[4], + d[0],d[1],d[2],d[3],d[4], + e[0],e[1],e[2],e[3],e[4]); + } + + template <class NT, class Vector> + NT determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d, Vector const&e, Vector const&f){ + return determinant<NT>( + a[0],a[1],a[2],a[3],a[4],a[5], + b[0],b[1],b[2],b[3],b[4],b[5], + c[0],c[1],c[2],c[3],c[4],c[5], + d[0],d[1],d[2],d[3],d[4],d[5], + e[0],e[1],e[2],e[3],e[4],e[5], + f[0],f[1],f[2],f[3],f[4],f[5]); + } + template <class NT, class Vector> + typename Sgn<NT>::result_type + sign_of_determinant_of_vectors(Vector const&a, Vector const&b, + Vector const&c, Vector const&d, Vector const&e, Vector const&f){ + return sign_of_determinant<NT>( + a[0],a[1],a[2],a[3],a[4],a[5], + b[0],b[1],b[2],b[3],b[4],b[5], + c[0],c[1],c[2],c[3],c[4],c[5], + d[0],d[1],d[2],d[3],d[4],d[5], + e[0],e[1],e[2],e[3],e[4],e[5], + f[0],f[1],f[2],f[3],f[4],f[5]); + } + +} +#endif |