BWAPI
SPAR/AIModule/BWTA/vendors/CGAL/CGAL/predicates/sign_of_determinant.h
Go to the documentation of this file.
00001 // Copyright (c) 1999  Utrecht University (The Netherlands),
00002 // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
00003 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
00004 // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria),
00005 // and Tel-Aviv University (Israel).  All rights reserved.
00006 //
00007 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or
00008 // modify it under the terms of the GNU Lesser General Public License as
00009 // published by the Free Software Foundation; version 2.1 of the License.
00010 // See the file LICENSE.LGPL distributed with CGAL.
00011 //
00012 // Licensees holding a valid commercial license may use this file in
00013 // accordance with the commercial license agreement provided with the software.
00014 //
00015 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00016 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00017 //
00018 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Kernel_23/include/CGAL/predicates/sign_of_determinant.h $
00019 // $Id: sign_of_determinant.h 42811 2008-04-09 13:35:34Z spion $
00020 // 
00021 //
00022 // Author(s)     : Sylvain Pion
00023 //                 Stefan Schirra
00024 
00025 #ifndef CGAL_PREDICATES_SIGN_OF_DETERMINANT_H
00026 #define CGAL_PREDICATES_SIGN_OF_DETERMINANT_H
00027 
00028 #include <CGAL/determinant.h>
00029 
00030 CGAL_BEGIN_NAMESPACE
00031 
00032 template <class RT>
00033 inline
00034 typename Sgn<RT>::result_type
00035 sign_of_determinant( const RT& a00,  const RT& a01,
00036                         const RT& a10,  const RT& a11)
00037 {
00038   return enum_cast<Sign>(CGAL_NTS compare( a00*a11, a10*a01));
00039 }
00040 
00041 template <class RT>
00042 inline
00043 typename Sgn<RT>::result_type
00044 sign_of_determinant( const RT& a00,  const RT& a01,  const RT& a02,
00045                         const RT& a10,  const RT& a11,  const RT& a12,
00046                         const RT& a20,  const RT& a21,  const RT& a22)
00047 {
00048   return CGAL_NTS sign(determinant(a00, a01, a02,
00049                                          a10, a11, a12,
00050                                          a20, a21, a22));
00051 }
00052 
00053 template <class RT>
00054 inline
00055 typename Sgn<RT>::result_type
00056 sign_of_determinant(
00057  const RT& a00,  const RT& a01,  const RT& a02,  const RT& a03,
00058  const RT& a10,  const RT& a11,  const RT& a12,  const RT& a13,
00059  const RT& a20,  const RT& a21,  const RT& a22,  const RT& a23,
00060  const RT& a30,  const RT& a31,  const RT& a32,  const RT& a33)
00061 {
00062   return CGAL_NTS sign(determinant(a00, a01, a02, a03,
00063                                          a10, a11, a12, a13,
00064                                          a20, a21, a22, a23,
00065                                          a30, a31, a32, a33));
00066 }
00067 
00068 template <class RT>
00069 CGAL_KERNEL_LARGE_INLINE
00070 typename Sgn<RT>::result_type
00071 sign_of_determinant(
00072  const RT& a00,  const RT& a01,  const RT& a02,  const RT& a03,  const RT& a04,
00073  const RT& a10,  const RT& a11,  const RT& a12,  const RT& a13,  const RT& a14,
00074  const RT& a20,  const RT& a21,  const RT& a22,  const RT& a23,  const RT& a24,
00075  const RT& a30,  const RT& a31,  const RT& a32,  const RT& a33,  const RT& a34,
00076  const RT& a40,  const RT& a41,  const RT& a42,  const RT& a43,  const RT& a44)
00077 {
00078   return CGAL_NTS sign(determinant(a00, a01, a02, a03, a04,
00079                                          a10, a11, a12, a13, a14,
00080                                          a20, a21, a22, a23, a24,
00081                                          a30, a31, a32, a33, a34,
00082                                          a40, a41, a42, a43, a44));
00083 }
00084 
00085 template <class RT>
00086 CGAL_KERNEL_LARGE_INLINE
00087 typename Sgn<RT>::result_type
00088 sign_of_determinant(
00089  const RT& a00, const RT& a01, const RT& a02, const RT& a03, const RT& a04,
00090  const RT& a05,
00091  const RT& a10, const RT& a11, const RT& a12, const RT& a13, const RT& a14,
00092  const RT& a15,
00093  const RT& a20, const RT& a21, const RT& a22, const RT& a23, const RT& a24,
00094  const RT& a25,
00095  const RT& a30, const RT& a31, const RT& a32, const RT& a33, const RT& a34,
00096  const RT& a35,
00097  const RT& a40, const RT& a41, const RT& a42, const RT& a43, const RT& a44,
00098  const RT& a45,
00099  const RT& a50, const RT& a51, const RT& a52, const RT& a53, const RT& a54,
00100  const RT& a55)
00101 {
00102   return CGAL_NTS sign(determinant(a00, a01, a02, a03, a04, a05,
00103                                          a10, a11, a12, a13, a14, a15,
00104                                          a20, a21, a22, a23, a24, a25,
00105                                          a30, a31, a32, a33, a34, a35,
00106                                          a40, a41, a42, a43, a44, a45,
00107                                          a50, a51, a52, a53, a54, a55));
00108 }
00109 
00110 CGAL_END_NAMESPACE
00111 
00112 #endif // CGAL_PREDICATES_SIGN_OF_DETERMINANT_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines