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

📄 tvelement.h

📁 TV-tree的c实现源码
💻 H
字号:
/*                    COPYRIGHT NOTICE This material was developed by Christos Faloutsos and King-Ip Linat the University of Maryland, College Park, Department of Computer Science.Permission is granted to copy this software, to redistribute iton a nonprofit basis, and to use it for any purpose, subject tothe following restrictions and understandings. 1. Any copy made of this software must include this copyright noticein full. 2. All materials developed as a consequence of the use of thissoftware shall duly acknowledge such use, in accordance with the usualstandards of acknowledging credit in academic research. 3. The authors have made no warranty or representation that theoperation of this software will be error-free or suitable for anyapplication, and they are under under no obligation to provide anyservices, by way of maintenance, update, or otherwise.  The softwareis an experimental prototype offered on an as-is basis. 4. Redistribution for profit requires the express, written permissionof the authors. */// Author : $Author$// Date : $Date$// Id : $Id$// $Id: element.h,v 1.2 1996/04/18 21:50:24 kilin Exp kilin $ // Elements to be indexing by the TV-tree// bytearray : an array storing the byte pattern of the object to be stored// noofbytes : number of bytes of the byte pattern// vec : Currently expanded vector for the element// The elmenet require three functions declare on the type to be indexed://// gfeat(featno, bytearray) : Generate the featno-th feature (counting from 1)//			    : if featno is 0 or less, will return the maximum//			      number of features//// equal() : return TRUE if the two bytearray represent the same object //// dist() : return the distance between two objects #define NO_OF_FEATURES 27class Leaf_Element {public:  Leaf_Element();  Leaf_Element(char *barray, int bytes);  Leaf_Element(const Leaf_Element& ele);  ~Leaf_Element();    Leaf_Element& operator=(const Leaf_Element&);  // Get the vector, expend if necessary  // dim = number of dimensions wanted  // store = TRUE : store the newly expanded vector to vec;  TVector GetTVector(int dim, VCOM_TYPE (*gfeat)(int, char*), int store = TRUE);  // Get the currently expanded vector  TVector GetTVector();  // Drop the last dimensions of the vector  Leaf_Element& DropDim(int dimtodrop);  // Get component no. (compno), start counting at 1  // Call gfeat if necessary  // store = TRUE : store the newly expanded vector to vec;  VCOM_TYPE GetFeature(int feature, VCOM_TYPE (*gfeat)(int, char*), int store = TRUE);  int Size() const;  int ExpectedSize(int dim) const; // expected size of the element if it carries			          // a dim dimensional vector  int BytearraySize() const;  int equal(const Leaf_Element& le, int (*eq)(char *, int, char *, int));    // Return the byte array   char* operator()();   float Distance(const Leaf_Element& le, float (*dist)(char *, int, char *, int));//   Leaf_Element& PreComputeFeature(int count, VCOM_TYPE (*gfeat)(int, char*));private:  TVector GenNewTVector(int noofnewfeature, VCOM_TYPE (*gfeat)(int, char*));   char *bytearray;   int noofbytes;  // size of the bytearray   TVector vec;};

⌨️ 快捷键说明

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