table.h

来自「vc的源代码程序的基于最小特征向量的元素的集合方法的程序源代码」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef TABLE_H#define TABLE_H#include "source.h"// Table is a class which is built up upon the Source class. It// constructs an array according to the source. Each line in// the source is a row in the table. Each field separated by// the delimiter is a column class Table {	int row;       // Number of instance	int col;       // Number of fields (attributes and class column)public:	Description **head;	Table();	Table(Source &src);	Table(Source &src, int isExtended);	~Table();	Description **alloc();   // allocate memory to the head	void dealloc(Description **head); // deallocate memory to the head	int numOfRows() { return row; }	int numOfColumns() { return col; }	int setRow(int r) { row = r; }	int setCol(int c) { col = c; }	int Row() { return row; }	int Col() { return col; }	int isInRange(int r, int c); // is the (r,c) out of bound	int isEmpty();  // is the table empty?	Description value(int r, int c); // return the value description	void setValue(int r, int c, Description d); // set the description	Description* getRow(int r); // return the row pointer or instance	void removeSerialColumn();private:	void read(Source &src); // read from the source	// read from the source, but keep the extension column	// skipped	void readForExtension(Source &src);};#endif

⌨️ 快捷键说明

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