Preparing to sort by interestingness

This commit is contained in:
Erica Fischer
2023-02-08 15:49:36 -08:00
parent c6379d74d2
commit de607d1440
5 changed files with 70 additions and 16 deletions
+30
View File
@@ -250,6 +250,10 @@ static int metacmp(const std::vector<long long> &keys1, const std::vector<long l
}
}
double get_interestingness(const struct coalesce *c1) {
return 0; // XXX
}
static mvt_value find_attribute_value(const struct coalesce *c1, std::string key) {
if (key == ORDER_BY_SIZE) {
mvt_value v;
@@ -257,6 +261,12 @@ static mvt_value find_attribute_value(const struct coalesce *c1, std::string key
v.numeric_value.double_value = c1->extent;
return v;
}
if (key == ORDER_BY_INTERESTINGNESS) {
mvt_value v;
v.type = mvt_double;
v.numeric_value.double_value = get_interestingness(c1);
return v;
}
const std::vector<long long> &keys1 = c1->keys;
const std::vector<long long> &values1 = c1->values;
@@ -519,6 +529,14 @@ struct partial_arg {
drawvec *shared_nodes;
};
double get_interestingness(const serial_feature *c1, const char *stringpool, long long pool_off[]) {
return 0; // XXX
}
double get_interestingness(const partial *c1, const char *stringpool, long long pool_off[]) {
return 0; // XXX
}
// THIS IS RIDICULOUS to have three almost-identical representations for features. FIX FIX FIX
static mvt_value find_attribute_value(const serial_feature *c1, std::string key, const char *stringpool, long long pool_off[]) {
@@ -528,6 +546,12 @@ static mvt_value find_attribute_value(const serial_feature *c1, std::string key,
v.numeric_value.double_value = c1->extent;
return v;
}
if (key == ORDER_BY_INTERESTINGNESS) {
mvt_value v;
v.type = mvt_double;
v.numeric_value.double_value = get_interestingness(c1, stringpool, pool_off);
return v;
}
const std::vector<long long> &keys1 = c1->keys;
const std::vector<long long> &values1 = c1->values;
@@ -559,6 +583,12 @@ static mvt_value find_attribute_value(const partial *c1, std::string key, const
v.numeric_value.double_value = c1->extent;
return v;
}
if (key == ORDER_BY_INTERESTINGNESS) {
mvt_value v;
v.type = mvt_double;
v.numeric_value.double_value = get_interestingness(c1, stringpool, pool_off);
return v;
}
const std::vector<long long> &keys1 = c1->keys;
const std::vector<long long> &values1 = c1->values;