Menu

Average Class

Vanyamba Software

Average Class allows you to calculate average value for given number of samples.

template <typename _Ch, typename _SizeT = unsigned int>
class AverageT
{
public:
    AverageT(_SizeT size);
    virtual ~AverageT();
    AverageT& operator +=(const _Ch& sample);
    float value() const;
    operator _Ch() const;
};

typedef AverageT<char>          AverageChar;
typedef AverageT<unsigned char> AverageUChar;
typedef AverageT<int>           AverageInt;
typedef AverageT<unsigned int>  AverageChar;
typedef AverageT<float>         AverageChar;

See Average Example on how to use this classes in your sketches.


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.