Library of Assembled Shared Sources
DataTraits

Detailed Description

A set of trait classes on how to manipulate data.

This is the concept each data traits class has to model:

struct
{
typedef ... TData; // type of data
typedef ... TScalar; // type of a single scalar value in data
static size_t dimension(const TData& iY); // returns number of scalar values in iY
static void zero(TData& iY, size_t iDim); // resets iY to a data object with iDim zeros
static TScalar get(const TData& iY, size_t iIndex); // return iIndex'th scalar in iY
static void set(TData& ioY, size_t iIndex, TScalar iV); // set iIndex'th scalar of iY to iV
static void scale(TDAta& ioAcc, TScalar iS); // scale each scalar of ioAcc by iS
static void multiplyAccumulate(TData& ioAcc, const TData& iY, TScalar iS); // add each
// element of iY multiplied by iS to the element in ioAcc with same index.
};