00001 #define __cplusplus__
00002 #ifndef __SPATIALDATA__
00003 #define __SPATIALDATA__
00004
00005 #include<iostream>
00006 #include<istream>
00007 #include<fstream>
00008 #include<string>
00009 #include<vector>
00010 #include<sstream>
00011 #include <cmath>
00012
00013 #include <Data.hpp>
00014 #include <Neighborhood_System.hpp>
00015
00016 using namespace std;
00017
00018
00020 typedef enum {
00021 TYPE_SPATIAL,
00022 TYPE_IMAGE,
00023 TYPE_NONSPATIAL,
00024 TYPE_NB } NeighborhoodType;
00025
00026
00027
00028
00050 class Spatial_Data{
00052 Data *data;
00054 Neighborhood_System *nhsys;
00055
00056 public :
00057
00059 Spatial_Data();
00061 Spatial_Data(Data *d, Neighborhood_System *nhs);
00062
00064 ~Spatial_Data();
00066 void DeleteAll();
00067
00068
00069
00071 void Get(uint i, vector<double> & obs );
00073 double Get(uint i, uint d);
00074
00076 uint GetLabel(uint i);
00078 void GetLabels(vector<uint> & labs);
00079
00081 uint Get_N();
00083 uint Get_D();
00084
00085
00086
00087 Neighborhood_System * Get_NS();
00089 void GetNeighbors(uint site, vector< Weighted_Neighbor * > & neighs);
00090
00092 void ReadStructureFromFile(string filename);
00094 void ReadDataFromFile(string filename);
00096 void ReadNeighborhoodFromFile(string filename);
00098 void ReadFromFile(string filename);
00100 void WriteToFile(string filename);
00101
00102
00104 void Stats(vector<double> & mean, vector<double> & cov);
00106 void K_means(uint K, vector<double> & centers, vector<uint> & labels);
00107
00109 void Info();
00110
00111 };
00112
00113 #endif