#include <cctype>
#include <functional>
#include <algorithm>
#include "dNDArray.h"
#include "CNDArray.h"
#include "Cell.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "ovl.h"
#include "ov.h"
Go to the source code of this file.
Macros | |
#define | INT_ARRAY_LOOKUP(TYPE) |
Functions | |
static bool | contains_char (const std::string &str, char c) |
template<typename ArrayT > | |
static octave_value | do_numeric_lookup (const ArrayT &array, const ArrayT &values, bool left_inf, bool right_inf, bool match_idx, bool match_bool) |
OCTAVE_EXPORT octave_value_list | Flookup (const octave_value_list &args, int) of length N and ode |
template<typename T > | |
sortmode | get_sort_mode (const Array< T > &array, typename octave_sort< T >::compare_fcn_type desc_comp=octave_sort< T >::descending_compare) |
Variables | |
then | ode {table(idx(i)) <= y(i) < table(idx(i+1))} for all ode{y(i)} within the table. If ode{y(i) < table(1)} then ode{idx(i)} is 0. If ode{y(i) >= table(end)} or ode{isnan (y(i))} then ode{idx(i)} is N. If the table is decreasing, then the tests are reversed. For non-strictly monotonic tables, empty intervals are always skipped. The result is undefined if ar{table} is not monotonic, or if ar{table} contains a NaN. The complexity of the lookup is O(M*log(N)) where M is the size of ar{y}. In the special case when ar{y} is also sorted, the complexity is O(min (M*log(N), M+N)). ar{table} and ar{y} can also be cell arrays of strings (or ar{y} can be a single string). In this case, string lookup is performed using lexicographical comparison. If ar{opts} is specified, it must be a string with letters indicating additional options. able ode tem m Match. ode{table(idx(i)) == y(i)} if ode{y(i)} occurs in table |
otherwise | |
#define INT_ARRAY_LOOKUP | ( | TYPE | ) |
|
static |
|
static |
OCTAVE_EXPORT octave_value_list Flookup | ( | const octave_value_list & | args, |
int | |||
) |
|
inline |
Definition at line 53 of file lookup.cc.
References array(), ASCENDING, and DESCENDING.
ode {table(idx(i)) <= y(i) < table(idx(i+1))} for all ode{y(i)} within the table. If ode{y(i) < table(1)} then ode{idx(i)} is 0. If ode{y(i) >= table(end)} or ode{isnan (y(i))} then ode{idx(i)} is N. If the table is decreasing, then the tests are reversed. For non-strictly monotonic tables, empty intervals are always skipped. The result is undefined if ar{table} is not monotonic, or if ar{table} contains a NaN. The complexity of the lookup is O(M*log(N)) where M is the size of ar{y}. In the special case when ar{y} is also sorted, the complexity is O(min (M*log(N), M+N)). ar{table} and ar{y} can also be cell arrays of strings (or ar{y} can be a single string). In this case, string lookup is performed using lexicographical comparison. If ar{opts} is specified, it must be a string with letters indicating additional options. able ode tem m Match. ode{table(idx(i)) == y(i)} if ode{y(i)} occurs in table |