Statistics.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: Statistics.h
  24. /*---------------------------------------------------------------------------*/
  25. /* EA Pacific */
  26. /* Confidential Information */
  27. /* Copyright (C) 2001 - All Rights Reserved */
  28. /* DO NOT DISTRIBUTE */
  29. /*---------------------------------------------------------------------------*/
  30. /* Project: RTS3 */
  31. /* File name: Statistics.h */
  32. /* Created: John K. McDonald, Jr., 4/2/2002 */
  33. /* Desc: Common statistical functions */
  34. /* Revision History: */
  35. /* 4/2/2002 : Initial creation */
  36. /*---------------------------------------------------------------------------*/
  37. #pragma once
  38. #ifndef _H_STATISTICS_
  39. #define _H_STATISTICS_
  40. // INCLUDES ///////////////////////////////////////////////////////////////////
  41. #include "Lib/Basetype.h"
  42. // DEFINES ////////////////////////////////////////////////////////////////////
  43. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  44. // FORWARD DECLARATIONS ///////////////////////////////////////////////////////
  45. // valueToRun is the value (between 0 and maxValueForVal) to test.
  46. // mu is designates the steepness of the curve.
  47. // The return value is a value in [-1, 1]
  48. extern Real MuLaw(Real valueToRun, Real maxValueForVal, Real mu);
  49. // valueToNormalize is a value in minRange..maxRange
  50. // minRange is the smallest value the range contains
  51. // maxRange is the largest value the range contains
  52. // the return is a value in [0, 1].
  53. extern Real Normalize(Real valueToNormalize, Real minRange, Real maxRange);
  54. // same as Normalize, except that output will be in the range [outRangeMin, outRangeMax]
  55. extern Real NormalizeToRange(Real valueToNormalize, Real minRange, Real maxRange, Real outRangeMin, Real outRangeMax);
  56. #endif /* _H_STATISTICS_ */