libRDataFrame  0.815
A library with R style datatypes and associated utilities
 All Classes Files Functions Variables Pages
category.hpp
1 #ifndef CATEGORY_HPP_INCLUDED
2 #define CATEGORY_HPP_INCLUDED
3 
4 #include <cstdio>
5 #include <cstdlib>
6 #include <cctype>
7 #include <iostream>
8 #include <ostream>
9 #include <fstream>
10 #include <sstream>
11 #include <string>
12 #include <vector>
13 #include <map>
14 #include <tuple>
15 #include <algorithm>
16 #include <typeinfo>
17 #include <cxxabi.h>
18 #include <array>
19 #include <initializer_list>
20 #include <utility>
21 #include <boost/any.hpp>
22 
23 #include "dataframe.hpp"
24 #include "node.hpp"
25 #include "category.hpp"
26 
27 
29 protected:
30  int nRows;
31  int nLevels;
32  std::string catVarName = "";
33  std::vector<int> dummySet;
34  std::map<int, std::string> categorySet;
35  std::vector<int> catVarRanks;
36  std::vector<std::vector<int> > dummyVarData;
37 public:
38  categoryType();
39  categoryType(std::string vName);
40  categoryType(std::string vName, std::map<int,std::string> catSet);
41  categoryType(std::string vName, std::map<int,std::string> catSet, void* ptrData);
42  categoryType(std::string vName, void* ptrData);
43  categoryType(std::string vName, std::map<int,std::string> catSet, std::vector<int>* ptrData);
44 
45  std::vector< std::vector<int> >getDummyVarData();
46  void setCategoryLevels(std::vector<std::string> levelStrList, std::vector<int> levelIntList);
47  void setCatVarRanks(std::vector<int> cData);
48  void setDummyVarData(std::vector< std::vector<int> > dummyVData);
49  std::map<int, std::string> getCategoryLevels();
50  std::vector<int> getCatVarRanks();
51  void addLevNameToData(std::vector<int> cData);
52 };
53 
54 
55 #endif // CATEGORY_HPP_INCLUDED
Definition: category.hpp:28
void setCategoryLevels(std::vector< std::string > levelStrList, std::vector< int > levelIntList)
Definition: category.cpp:168
std::vector< int > getCatVarRanks()
Definition: category.cpp:205
void setCatVarRanks(std::vector< int > cData)
Definition: category.cpp:180
categoryType()
Definition: category.cpp:106
std::map< int, std::string > getCategoryLevels()
Definition: category.cpp:197
void addLevNameToData(std::vector< int > cData)
Definition: category.cpp:214
void setDummyVarData(std::vector< std::vector< int > > dummyVData)
Definition: category.cpp:189