Version 4.2.0

This commit is contained in:
Gary Scavone
2009-03-24 23:02:14 -04:00
committed by Stephen Sinclair
parent cf06b7598b
commit a6381b9d38
281 changed files with 17152 additions and 12000 deletions

View File

@@ -10,20 +10,24 @@
An StkError will be thrown if the table file
is not found.
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
by Perry R. Cook and Gary P. Scavone, 1995 - 2004.
*/
/***************************************************/
#if !defined(__TABLE_H)
#define __TABLE_H
#ifndef STK_TABLE_H
#define STK_TABLE_H
#include "Stk.h"
#include "Function.h"
class Table : public Stk
class Table : public Function
{
public:
//! Constructor loads the data from \e fileName.
Table(char *fileName);
//! The constructor loads the data from \e fileName.
/*!
An StkError will be thrown in the file cannot be found or
opened.
*/
Table( std::string fileName );
//! Class destructor.
~Table();
@@ -31,23 +35,28 @@ public:
//! Return the number of elements in the table.
long getLength() const;
//! Return the last output value.
MY_FLOAT lastOut() const;
//! Return the table value at position \e index.
/*!
Linear interpolation is performed if \e index is
fractional.
*/
MY_FLOAT tick(MY_FLOAT index);
StkFloat tick(StkFloat index);
//! Take \e vectorSize index positions and return the corresponding table values in \e vector.
MY_FLOAT *tick(MY_FLOAT *vector, unsigned int vectorSize);
//! Take \e vectorSize inputs from \e vector and replace them with corresponding outputs.
StkFloat *tick( StkFloat *vector, unsigned int vectorSize );
//! Take a channel of the StkFrames object as inputs to the function and replace with corresponding outputs.
/*!
The \c channel argument should be one or greater (the first
channel is specified by 1). An StkError will be thrown if the \c
channel argument is zero or it is greater than the number of
channels in the StkFrames object.
*/
StkFrames& tick( StkFrames& frames, unsigned int channel = 1 );
protected:
long length;
MY_FLOAT *data;
MY_FLOAT lastOutput;
long length_;
std::valarray<StkFloat> data_;
};