41 Value<T>* lookup(
const std::string& name){
42 GenValue* gv = GenValue::get_value(name);
45 CRITICAL(
"Value: \""+gv->get_name() +
"\" has improper type.",-1);
50 ObsFilter* lookup_obs_filter(
const std::string& name){
51 ObsFilter* f =
dynamic_cast<ObsFilter*
>(GenValue::get_value(name));
53 CRITICAL(
"ObsFilter: "+f->get_name() +
"has improper type.",-1);
58 template <
typename... ArgTypes>
59 Value<std::vector<std::tuple<ArgTypes...>>>*
60 zip(
Value<std::vector<ArgTypes>>*... args,
const std::string& alias=
""){
61 return new Zip<ArgTypes...>(args..., alias);
64 template <
typename Ret,
typename... ArgTypes>
66 map(Function<Ret(ArgTypes...)>& fn,
67 Value<std::vector<std::tuple<ArgTypes...>>>* arg,
const std::string& alias=
""){
68 return new Map<Ret(ArgTypes...)>(fn, arg, alias);
71 template <
typename... ArgTypes>
72 Value<std::tuple<ArgTypes...>>*
74 return new Tuple<ArgTypes...>(args...,
"");
77 template <
size_t N,
typename... ArgTypes>
78 Value<
typename std::tuple_element<N, std::tuple<ArgTypes...>>::type>*
79 detup(
Value<std::tuple<ArgTypes...>>* tup,
const std::string& alias=
""){
80 return new DeTup<N, ArgTypes...>(tup, alias);
83 template <
size_t N,
typename... ArgTypes>
84 Value<std::vector<
typename std::tuple_element<N, std::tuple<ArgTypes...>>::type>>*
85 detup_vec(
Value<std::vector<std::tuple<ArgTypes...>>>* tup,
const std::string& alias=
""){
89 template <
typename Ret,
typename... ArgTypes>
91 apply(Function<Ret(ArgTypes...)>& fn,
92 Value<std::tuple<ArgTypes...>>* arg,
const std::string& alias=
""){
93 return new Apply<Ret(ArgTypes...)>(fn, arg, alias);
96 template <
typename T1,
typename T2>
102 template <
typename T1,
typename T2>
104 pair(
const std::string& name1,
const std::string& name2,
const std::string& alias=
""){
105 return pair<T1,T2>(lookup<T1>(name1), lookup<T2>(name2), alias);
109 template <
typename T>
111 max(
Value<std::vector<T>>* v,
const std::string& alias=
""){
112 return new Max<T>(v, alias);
115 template <
typename T>
117 max(
const std::string& v_name,
const std::string& alias=
""){
118 return max(lookup<std::vector<T>>(v_name), alias);
121 template <
typename T>
123 min(
Value<std::vector<T>>* v,
const std::string& alias=
""){
124 return new Min<T>(v, alias);
127 template <
typename T>
129 min(
const std::string& v_name,
const std::string& alias=
""){
130 return min(lookup<std::vector<T>>(v_name), alias);
133 template <
typename T>
135 range(
Value<std::vector<T>>* v,
const std::string& alias=
""){
139 template <
typename T>
141 range(
const std::string& v_name,
const std::string& alias=
""){
142 return range(lookup<std::vector<T>>(v_name), alias);
145 template <
typename T>
147 mean(
Value<std::vector<T>>* v,
const std::string& alias=
""){
151 template <
typename T>
153 mean(
const std::string& v_name,
const std::string& alias=
""){
154 return mean(lookup<std::vector<T>>(v_name), alias);
157 template <
typename T>
159 count(Function<
bool(T)>& selector,
Value<std::vector<T>>* v,
const std::string& alias=
""){
160 return new Count<T>(selector, v, alias);
163 template <
typename T>
165 count(Function<
bool(T)>& selector,
const std::string& v_name,
const std::string& alias=
""){
166 return count<T>(selector, lookup<std::vector<T>>(v_name), alias);
169 template <
typename FST,
typename SND>
171 cart_product(
Value<std::vector<FST>>* val1,
Value<std::vector<SND>>* val2,
const std::string& alias=
""){
175 template <
typename FST,
typename SND>
177 cart_product(
const std::string& val1_name,
const std::string& val2_name,
const std::string& alias=
""){
178 return cart_product<FST,SND>(lookup<std::vector<FST>>(val1_name), lookup<std::vector<SND>>(val2_name), alias);
181 template <
typename T,
int Size>
183 combinations(
Value<std::vector<T>>* val,
const std::string& alias=
""){
187 template <
typename T,
int Size>
189 combinations(
const std::string& val_name,
const std::string alias =
""){
190 return combinations<T, Size>(lookup<std::vector<T>>(val_name), alias);
193 template <
typename T>
195 filter(Function<
bool(T)>& filter,
Value<std::vector<T>>* val,
const std::string alias=
""){
196 return new Filter<T>(filter, val, alias);
199 template <
typename T>
201 filter(Function<
bool(T)>& filter_func,
const std::string& val_name,
const std::string alias=
""){
202 return filter<T>(filter_func, lookup<std::vector<T>>(val_name), alias);
205 template <
typename... ArgTypes>
206 Value<std::vector<std::tuple<ArgTypes...>>>*
207 tup_filter(Function<
bool(ArgTypes...)>& filter,
Value<std::vector<std::tuple<ArgTypes...>>>* val,
const std::string alias=
""){
208 return new TupFilter<ArgTypes...>(filter, val, alias);
211 template <
typename... ArgTypes>
212 Value<std::vector<std::tuple<ArgTypes...>>>*
213 tup_filter(Function<
bool(ArgTypes...)>& filter,
const std::string& val_name,
const std::string alias=
""){
214 return tup_filter<ArgTypes...>(filter, lookup<std::vector<std::tuple<ArgTypes...>>>(val_name), alias);
217 ObsFilter* obs_filter(
const std::string& name, std::function<
bool()> filter_function,
const std::string& impl=
""){
218 return new ObsFilter(name, filter_function, impl);
Find and return the maximum value of a vector.
Definition: value.hpp:918
Zips a series of vectors together.
Definition: value.hpp:639
Find combinations of items from an input vector.
Definition: value.hpp:1034
Calculate the range of the values in a vector.
Definition: value.hpp:959
Takes a series of Value objects and bundles them together into a std::tuple object.
Definition: value.hpp:738
Returns the count of elements in the input vector passing a test function.
Definition: value.hpp:822
Returns the elements in a vector that pass a test function.
Definition: value.hpp:845
Gets the Nth element from a tuple value.
Definition: value.hpp:761
Find and return the minimum value of a vector.
Definition: value.hpp:931
Creates a vector of extracting the Nth value from each entry in a vector of tuples.
Definition: value.hpp:779
Creates a std::pair type from a two other Value objects.
Definition: value.hpp:560
The namespace containing all filval classes and functions.
Definition: api.hpp:38
Returns the elements in a vector that pass a test function.
Definition: value.hpp:870
Calculate the mean value of a vector.
Definition: value.hpp:944
A generic value.
Definition: value.hpp:415
Calculate the cartesian product of two input vectors.
Definition: value.hpp:1077