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>
65 Map<Ret(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);
72 template <
typename... ArgTypes>
75 return new Tuple<ArgTypes...>(args..., alias);
78 template <
typename Ret,
typename... ArgTypes>
79 Apply<Ret(ArgTypes...)>*
80 apply(Function<Ret(ArgTypes...)>& fn,
82 return new Apply<Ret(ArgTypes...)>(fn, arg, alias);
85 template <
typename T1,
typename T2>
91 template <
typename T1,
typename T2>
93 pair(
const std::string& name1,
const std::string& name2,
const std::string& alias=
""){
94 return pair<T1,T2>(lookup<T1>(name1), lookup<T2>(name2), alias);
100 max(
Value<std::vector<T>>* v,
const std::string alias){
101 return new Max<T>(v, alias);
104 template <
typename T>
106 max(
const std::string& v_name,
const std::string alias){
107 return max(lookup<std::vector<T>>(v_name), alias);
110 template <
typename T>
112 min(
Value<std::vector<T>>* v,
const std::string alias){
113 return new Min<T>(v, alias);
116 template <
typename T>
118 min(
const std::string& v_name,
const std::string alias){
119 return min(lookup<std::vector<T>>(v_name), alias);
122 template <
typename T>
124 range(
Value<std::vector<T>>* v,
const std::string alias){
128 template <
typename T>
130 range(
const std::string& v_name,
const std::string alias){
131 return range(lookup<std::vector<T>>(v_name), alias);
134 template <
typename T>
136 mean(
Value<std::vector<T>>* v,
const std::string alias){
140 template <
typename T>
142 mean(
const std::string& v_name,
const std::string alias){
143 return mean(lookup<std::vector<T>>(v_name), alias);
146 template <
typename T>
148 count(Function<
bool(T)>& selector,
Value<std::vector<T>>* v,
const std::string alias){
149 return new Count<T>(selector, v, alias);
152 template <
typename T>
154 count(Function<
bool(T)>& selector,
const std::string& v_name,
const std::string alias){
155 return count<T>(selector, lookup<std::vector<T>>(v_name), alias);
158 template <
typename FST,
typename SND>
160 cart_product(
Value<std::vector<FST>>* val1,
Value<std::vector<SND>>* val2,
const std::string alias){
164 template <
typename FST,
typename SND>
166 cart_product(
const std::string& val1_name,
const std::string& val2_name,
const std::string alias =
""){
167 return cart_product<FST,SND>(lookup<std::vector<FST>>(val1_name), lookup<std::vector<SND>>(val2_name), alias);
170 ObsFilter* obs_filter(
const std::string& name, std::function<
bool()> filter_function,
const std::string& impl=
""){
171 return new ObsFilter(name, filter_function, impl);
Find and return the maximum value of a vector.
Definition: value.hpp:788
Zips a series of vectors together.
Definition: value.hpp:546
Calculate the range of the values in a vector.
Definition: value.hpp:829
Takes a series of Value objects and bundles them together into a std::tuple object.
Definition: value.hpp:670
Returns the count of elements in the input vector passing a test function.
Definition: value.hpp:717
Find and return the minimum value of a vector.
Definition: value.hpp:801
Creates a std::pair type from a two other Value objects.
Definition: value.hpp:467
The namespace containing all filval classes and functions.
Definition: api.hpp:38
Calculate the mean value of a vector.
Definition: value.hpp:814
A generic value.
Definition: value.hpp:352
Find and return the minimum value of a vector and its index.
Definition: value.hpp:904