#include <statfunc.h>
Public Member Functions | |
Standardize (T s=1) | |
Constructor. | |
template<class I> | |
void | operator() (Subscript nelem, I begin) |
Compute standardized values for data pointed to by begin. |
T | A floating point type. |
Definition at line 39 of file statfunc.h.
SCPPNT::Standardize< T >::Standardize | ( | T | s = 1 |
) | [inline] |
Constructor.
s | The value the sequence should sum to. |
Definition at line 47 of file statfunc.h.
void SCPPNT::Standardize< T >::operator() | ( | Subscript | nelem, | |
I | begin | |||
) | [inline] |
Compute standardized values for data pointed to by begin.
I | An iterator type pointing to values which are standardized. | |
nelem | Number of values to be standardized. | |
begin | Iterator to values to be standardized. |
Definition at line 60 of file statfunc.h.
00061 { 00062 int i; 00063 T oldsum = 0; 00064 00065 I ib = begin; 00066 for (i = nelem; i--; ++ib) 00067 { 00068 oldsum += *ib; 00069 } 00070 00071 oldsum *= sum; 00072 for (i = nelem; i--; ++begin) 00073 { 00074 *begin /= oldsum; 00075 } 00076 }