26 #ifndef FUNCTIONS_FUNCTIONS_UTIL_H_
27 #define FUNCTIONS_FUNCTIONS_UTIL_H_
47 std::vector<int> parse_dims(
const std::string &shape);
49 void check_number_type_array(libdap::BaseType *btp,
unsigned int rank = 0);
51 unsigned int extract_uint_value(libdap::BaseType *arg);
58 static double string_to_double(
const char *val);
59 static double get_attribute_double_value(BaseType *var,
const string &attribute);
60 static double get_attribute_double_value(BaseType *var, vector<string> &attributes);
61 static double get_missing_value(BaseType *var);
62 static double get_slope(BaseType *var);
63 static double get_y_intercept(BaseType *var);
66 typedef std::vector<unsigned long> Shape;
67 static Shape array_shape(Array *a);
68 static bool shape_matches(Array *a,
const Shape &shape);
69 static bool dep_indep_match(
const Shape &dep_shape,
const Shape &indep_shape);
71 static unsigned long number_of_values(
const Shape &shape);
73 static void build_columns(
unsigned long n, BaseType *btp, std::vector<Array*> &arrays, Shape &shape);
75 static void read_values(
const std::vector<Array*> &arrays);
77 static void build_sequence_values(
const std::vector<Array*> &arrays, SequenceValues &sv);
78 static void combine_sequence_values(SequenceValues &dep,
const SequenceValues &indep);
79 static void add_index_column(
const Shape &indep_shape,
const Shape &dep_shape, std::vector<Array*> &dep_vars);