NAME
Meta::Math::MinMax - save minimum and maximum values for sets of numbers.
COPYRIGHT
Copyright (C) 2001, 2002 Mark Veltzer; All rights reserved.
LICENSE
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 the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
DETAILS
MANIFEST: MinMax.pm
PROJECT: meta
VERSION: 0.07
SYNOPSIS
package foo;
use Meta::Math::MinMax qw();
my($object)=Meta::Math::MinMax->new();
$object->add(5);
$object->add(4);
$object->add(11.5);
my($min)=$object->get_min();#should be 4
my($max)=$object->get_max();#should be 11.5
DESCRIPTION
This is a simple Min/Max collector. Meaning - while you are in some kind of process, and would like to get some infomation on sets of numbers you are working with, create an instance of this object, throw numbers it's way and at the end of your process it will tell you what the minimum and maximum values were. This saves you the code to do it in your object.
The memory consumption of this object is quite low since it only remembers the min and max values.
Another advantage of using this kind of object is that you can supply yet other objects with the same interface which do other things like keep the mean value, the variation and other statistics.
If no values are thrown then the get_min and get_max methods will return "undef".
FUNCTIONS
BEGIN()
add($$)
reset($)
TEST($)
FUNCTION DOCUMENTATION
- BEGIN()
-
This block sets up the constructor and attribute methods for this object which are "min" and "max".
- add($$)
-
Throws another value into the pot. The minimum and maximum values get updated accordingly.
- reset($)
-
This method will reset the MinMax object so that it could be used for a new set of numbers.
- TEST($)
-
Test suite for this module.
SUPER CLASSES
None.
BUGS
None.
AUTHOR
Name: Mark Veltzer
Email: mailto:veltzer@cpan.org
WWW: http://www.veltzer.org
CPAN id: VELTZER
HISTORY
0.00 MV md5 progress
0.01 MV thumbnail project basics
0.02 MV thumbnail user interface
0.03 MV more thumbnail issues
0.04 MV website construction
0.05 MV web site development
0.06 MV web site automation
0.07 MV SEE ALSO section fix
SEE ALSO
Meta::Class::MethodMaker(3), strict(3)
TODO
-add more things to be save: mean value, variance, sum etc...