UTILITY.H
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 2k
Category:

OpenCV

Development Platform:

Visual C++

  1. /*****************************************************************************
  2.  * VCGLib                                                                    *
  3.  *                                                          *
  4.  * Visual Computing Group                                                o>  *
  5.  * IEI Institute, CNUCE Institute, CNR Pisa                             <|   *
  6.  *                                                                      /   *
  7.  * Copyright(C) 1999 by Paolo Cignoni, Claudio Rocchini                      *
  8.  * All rights reserved.                                                      *
  9.  *                                                          *
  10.  * Permission  to use, copy, modify, distribute  and sell this  software and *
  11.  * its documentation for any purpose is hereby granted without fee, provided *
  12.  * that  the above copyright notice appear  in all copies and that both that *
  13.  * copyright   notice  and  this  permission  notice  appear  in  supporting *
  14.  * documentation. the author makes  no representations about the suitability *
  15.  * of this software for any purpose. It is provided  "as is" without express *
  16.  * or implied warranty.                                                      *
  17.  *                                                          *
  18.  *****************************************************************************/
  19. /****************************************************************************
  20.   History
  21.  1999 Feb 02 First Draft.
  22.  1999 May 15 Corrected Scope of sqrt.. (added ::)
  23. ****************************************************************************/
  24. #ifndef __VCGLIB_UTILITY
  25. #define __VCGLIB_UTILITY
  26. #include <math.h>
  27. namespace vcg {
  28.   inline int sqrt(int v)    {return int(::sqrt(v));};
  29.   inline short  sqrt(short v)  {return short(::sqrtf(v));};
  30.   inline float  sqrt(float v)  {return ::sqrtf(v);};
  31.   inline double sqrt(double v) {return ::sqrt(v);};
  32.   inline int abs(int v)    {return ::abs(v);};
  33.   inline short  abs(short v)   {return short(::abs(v));};
  34.   inline float  abs(float v)   {return ::fabsf(v);};
  35.   inline double abs(double v)  {return ::fabs(v);};
  36. }
  37. #endif