This commit is contained in:
ssharfraz3
2010-10-20 12:37:01 +00:00
parent 848718dc30
commit f4d43965c8
3 changed files with 49 additions and 7 deletions
@@ -78,7 +78,8 @@ class MinHeap {
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & entries_;
//ArrayList to be replaced by std::vector
//ar & entries_;
}
/**
@@ -47,6 +47,11 @@
#include "../la/matrix.h"
#include "../math/discrete.h"
#include "../file/textfile.h"
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/utility.hpp>
#include <boost/serialization/serialization.hpp>
class TextLineReader;
class TextWriter;
@@ -87,6 +92,7 @@ class DatasetFeature {
OT_ENUM_VAL(NOMINAL));
OT_OBJ(value_names_);
}
/**
* Initialization common to all features.
@@ -104,9 +110,11 @@ class DatasetFeature {
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & name_;
// String will be replaced by std::string
//ar & name_;
ar & type_;
ar & value_names_;
// ArrayList will be replaced by std::vector
//ar & value_names_;
}
/**
@@ -237,6 +245,18 @@ class DatasetInfo {
}
public:
friend class boost::serialization::access; // Should be removed later
template<class Archive>
void serialize(Archive & ar, QueryStat & query)
{
// String will be replaced by std::string
//ar & name_;
// ArrayList will be replaced by std::vector
//ar & features_;
}
/** Gets a mutable list of all features. */
ArrayList<DatasetFeature>& features() {
return features_;
@@ -143,18 +143,30 @@ class GaussianStarKernel {
double critical_point_sq_;
double critical_point_value_;
OBJECT_TRAVERSAL(GaussianStarKernel) {
/*OBJECT_TRAVERSAL(GaussianStarKernel) {
OT_OBJ(neg_inv_bandwidth_2sq_);
OT_OBJ(factor_);
OT_OBJ(bandwidth_sq_);
OT_OBJ(critical_point_sq_);
OT_OBJ(critical_point_value_);
}
}*/
public:
static const bool HAS_CUTOFF = false;
public:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & neg_inv_bandwidth_2sq_;
ar & factor_;
ar & bandwidth_sq_;
ar & critical_point_sq_;
ar & critical_point_value_;
}
double bandwidth_sq() const {
return bandwidth_sq_;
}
@@ -236,15 +248,24 @@ class EpanKernel {
double inv_bandwidth_sq_;
double bandwidth_sq_;
OBJECT_TRAVERSAL(EpanKernel) {
/*OBJECT_TRAVERSAL(EpanKernel) {
OT_OBJ(inv_bandwidth_sq_);
OT_OBJ(bandwidth_sq_);
}
}*/
public:
static const bool HAS_CUTOFF = true;
public:
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
{
ar & inv_bandwidth_sq_;
ar & bandwidth_sq_;
}
void Init(double bandwidth_in, index_t dims) {
Init(bandwidth_in);
}