=======================================================================
Util.h
-----------------------------------------------------------------------
Numerical utility functions
-----------------------------------------------------------------------
Copyright 1999, 2000, 2001 James R. Bruce
School of Computer Science, Carnegie Mellon University
-----------------------------------------------------------------------
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to: Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
=======================================================================
*
|
Functions |
template<class num1, class num2> num1 | bound (num1 x, num2 low, num2 high) |
template<class num> num | max3 (num a, num b, num c) |
template<class num> num | min3 (num a, num b, num c) |
template<class num> void | sort (num &a, num &b, num &c) |
template<class real> real | fmodt (real x, real m) |
template<class num1, class num2> num1 | setbits (num1 val, num2 bits) |
template<class num1, class num2> num1 | clearbits (num1 val, num2 bits) |
template<class real> real | saw (real t) |
template<class data> int | mcopy (data *dest, data *src, int num) |
template<class data> data | mset (data *dest, data val, int num) |
template<class data> void | mzero (data &d) |
template<class node> int | list_length (node *list) |
double | norm_angle (double angle) |
void | angle_wrap (double &angle) |
double | avg_angle (double left, double right) |
double | atan2a (double y, double x) |
double | atan2b (double y, double x) |
template<class num> int | sign (num n) |
double | gaussian_with_min (double x, double min_value) |
double | gaussian_prob (double x, double mean, double sigma) |
Variables |
const double | TODEG = (180.0 / M_PI) |
const double | gaussian_constant = sqrt(2*M_PI) |