⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vectorshort.h

📁 这是一个从音频信号里提取特征参量的程序
💻 H
字号:
// file: $isip/class/math/vector/VectorShort/VectorShort.h// version: $Id: VectorShort.h,v 1.31 2001/10/31 19:43:42 gao Exp $//// make sure definitions are only made once//#ifndef ISIP_VECTOR_SHORT#define ISIP_VECTOR_SHORT// isip include files//#ifndef ISIP_MVECTOR#include <MVector.h>#endif// VectorShort: this is a vector of Short objects, which inherits// the MVector template class.//class VectorShort : public MVector<Short, short> {  //---------------------------------------------------------------------------  //  // public constants  //  //---------------------------------------------------------------------------public:  // define the class name  //  static const String CLASS_NAME;  //----------------------------------------  //  // default values and arguments  //  //----------------------------------------      //----------------------------------------  //  // error codes  //  //----------------------------------------      static const long ERR = 22500;  //---------------------------------------------------------------------------  //  // protected data  //  //---------------------------------------------------------------------------protected:  // static memory manager  //  static MemoryManager mgr_d;  //---------------------------------------------------------------------------  //  // required public methods  //  //---------------------------------------------------------------------------public:   // method: name  //  static const String& name() {    return CLASS_NAME;  }  // other static methods  //  static boolean diagnose(Integral::DEBUG debug_level);  // method: setDebug  //  these methods are inherited from the MVector template class  //    // method: debug  //  boolean debug(const unichar* message) const {    return MVector<Short, short>::debug(name(), &message[0]);  }    // method: destructor  //  ~VectorShort() {}      // method: default constructor  //  VectorShort(long length = DEF_LENGTH, short value = DEF_VALUE) {    assign(length, value);  }  // method: copy constructor  //  VectorShort(const VectorShort& vector) {    assign(vector);  }    // assign methods:  //  these methods are inherited from the MVector template class  //  // method: operator=  //  //  note that we need to have the overloaded operator '=' defined in the  //  derived classes instead of the base template class. this is required  //  since c++ predefines the operator '=' for any class by default  //  and this hides any other definition of this operator in the base class  //  VectorShort& operator= (const VectorShort& vector) {    assign(vector);    return *this;  }    // i/o methods:  //  the sofSize, readData and writeData are inherited from the MVector  //  template class  //  // method: read  //  boolean read(Sof& sof, long tag, const String& name = CLASS_NAME) {    return MVector<Short, short>::read(sof, tag, name);  }    // method: write  //  boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) {    return MVector<Short, short>::write(sof, tag, name);  }      // equality methods:  //  these methods are inherited from the MVector template class  //  // method: new  //  static void* operator new(size_t size) {    return mgr_d.get();  }  // method: new[]  //  static void* operator new[](size_t size) {    return mgr_d.getBlock(size);  }  // method: delete  //  static void operator delete(void* ptr) {    mgr_d.release(ptr);  }  // method: delete[]  //  static void operator delete[](void* ptr) {    mgr_d.releaseBlock(ptr);  }  // method: setGrowSize  //  static boolean setGrowSize(long grow_size) {    return mgr_d.setGrow(grow_size);  }  // other memory management methods:  //  the clear method is inherited from the MVector template class  //   //---------------------------------------------------------------------------  //  // class-specific public methods  //  //---------------------------------------------------------------------------public:    // method: constructor  //  this method constructs a vector with a String* object  //  VectorShort(const String& arg, unichar delim = DEF_DELIM) {    assign(arg, delim);  }    // method: constructor  //  this method constructs a vector with a unichar* object  //  VectorShort(const unichar* arg, unichar delim = DEF_DELIM) {    assign(arg, delim);  }    // method: operator=  //  this method assigns a short value to the vector  //  VectorShort& operator= (short value) {    assign(value);    return *this;  }  //---------------------------------------------------------------------------  //  // private methods  //  //---------------------------------------------------------------------------private:  //declare trigonometric methods as private because they cannot be  //defined for Short operations  //  short acos(short);  short acosh(short);  short asin(short);  short asinh(short);  short atan(short);  short atanh(short);  short cos(short);  short cosh(short);  short sin(short);  short sinh(short);  short tan(short);  short tanh(short);    //declare those methods as private which cannot be defined for  //integer numbers  //    short ceil(short);  short rceil(short);  short rfloor(short);  short round(short);  short floor(short);  };// end of include file//#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -