00001 /* 00002 00003 Copyright (c) 2004, Cornell University 00004 All rights reserved. 00005 00006 Redistribution and use in source and binary forms, with or without 00007 modification, are permitted provided that the following conditions are met: 00008 00009 - Redistributions of source code must retain the above copyright notice, 00010 this list of conditions and the following disclaimer. 00011 - Redistributions in binary form must reproduce the above copyright 00012 notice, this list of conditions and the following disclaimer in the 00013 documentation and/or other materials provided with the distribution. 00014 - Neither the name of Cornell University nor the names of its 00015 contributors may be used to endorse or promote products derived from 00016 this software without specific prior written permission. 00017 00018 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00019 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00020 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00021 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00022 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00023 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00024 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00025 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00026 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00027 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 00028 THE POSSIBILITY OF SUCH DAMAGE. 00029 00030 */ 00031 00032 00033 ///////////////////////////////////////////////////////////////////// 00034 /// 00035 /// DatasetInfo.h 00036 /// 00037 ///////////////////////////////////////////////////////////////////// 00038 00039 #ifndef __DATASETINFO_H 00040 #define __DATASETINFO_H 00041 00042 ///////////////////////////////////////////////////////////////////// 00043 /// @addtogroup FileInputGroup 00044 /** @{ */ 00045 00046 #include "SeqBitmap.h" 00047 00048 typedef struct 00049 { 00050 int count; 00051 int index; 00052 } 00053 CountInfo; 00054 00055 ///////////////////////////////////////////////////////////////////// 00056 /// A class for representing the info gathered from the dataset 00057 ///////////////////////////////////////////////////////////////////// 00058 class DatasetInfo 00059 { 00060 public: 00061 00062 // -- constructor 00063 DatasetInfo() 00064 { 00065 custCount = 0; 00066 minSup = 0; 00067 f1Size = 0; 00068 f1BufSize = 0; 00069 maxCustTrans = 0; 00070 f1Buff = 0; 00071 f1NameBuff = 0; 00072 sListBuff = 0; 00073 iListBuff = 0; 00074 countBuff = 0; 00075 00076 } 00077 00078 // -- destructor 00079 ~DatasetInfo() 00080 { 00081 if (f1Buff != 0) 00082 { 00083 for (int i = 0; i < f1Size; i++) 00084 delete f1Buff[i]; 00085 delete [] f1Buff; 00086 } 00087 00088 if (f1NameBuff != 0) 00089 delete [] f1NameBuff; 00090 00091 if (iListBuff != 0) 00092 delete [] iListBuff; 00093 00094 if (sListBuff != 0) 00095 delete [] sListBuff; 00096 00097 if (countBuff != 0) 00098 delete [] countBuff; 00099 00100 if (bitmapSizes != 0) 00101 delete [] bitmapSizes; 00102 } 00103 00104 00105 // -- variables 00106 00107 /// number of customers who have transactions in the data set 00108 int custCount; 00109 00110 00111 /// the minimum support (the minimum number of customers) 00112 int minSup; 00113 00114 /// the number of frequent 1 itemsets 00115 int f1Size; 00116 00117 /// the size of the f1Buff and f1NameBuff 00118 int f1BufSize; 00119 00120 /// the maximum number of transactions of a customer 00121 int maxCustTrans; 00122 00123 /// the buffer for frequent 1 itemsets (data are stored in the bitmaps) 00124 SeqBitmap** f1Buff; 00125 00126 /// the buffer for bitmap4s 00127 SeqBitmap** bitmap4Buff; 00128 00129 /// the buffer for the info of item names 00130 int* f1NameBuff; 00131 00132 /// the buffer for the lists of s-steps 00133 int* sListBuff; 00134 00135 /// the buffer for the lists of i-steps 00136 int* iListBuff; 00137 00138 /// the buffer for the counts 00139 CountInfo *countBuff; 00140 00141 /// size of each bitmap 00142 int* bitmapSizes; 00143 00144 }; 00145 00146 /** @} */ 00147 00148 #endif