ESBMC
Efficient SMT-based Context-Bounded Model Checker
Loading...
Searching...
No Matches
numpy_reducer_shared.h File Reference
#include <python-frontend/type/type_handler.h>
#include <nlohmann/json.hpp>
#include <python-frontend/math/convert_float_literal.h>
#include <python-frontend/python_converter.h>
#include <util/irep/expr.h>
#include <util/irep/std_expr.h>
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <set>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for numpy_reducer_shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  numeric_value

Functions

numeric_value make_int_value (int64_t value)
numeric_value make_float_value (double value)
double to_double (const numeric_value &value)
numeric_value extract_value (const nlohmann::json &arg)
bool try_extract_numeric_constant (const nlohmann::json &node, numeric_value &out)
bool is_json_none_literal (const nlohmann::json &node)
bool numpy_reducer_has_unsupported_keywords_besides_axis (const nlohmann::json &call)
bool numpy_reducer_has_unsupported_keywords_besides (const nlohmann::json &call, const std::set< std::string > &allowed)
void validate_numpy_sort_kind_keyword_value (const nlohmann::json &value, const std::string &function_name)
void validate_numpy_stable_bool_keyword_value (const nlohmann::json &value, const std::string &function_name)
exprt build_1d_numpy_array_value (const std::vector< exprt > &elems, const type_handler &th)
long long normalize_reducer_axis (long long axis, std::size_t rank)
void bubble_sort_numpy_paired (std::vector< exprt > &keys, std::vector< exprt > *payload)
exprt build_numpy_shape_array_value (const std::vector< std::size_t > &shape, const std::vector< exprt > &elems, const typet &elem_type, const type_handler &th)
exprt build_numpy_sort_or_argsort_result (python_converter &converter, const type_handler &th, const std::vector< std::size_t > &shape, std::vector< exprt > elems, bool flatten, long long axis, bool want_indices, const typet &elem_type)

Variables

constexpr std::size_t max_numpy_sort_elements = 64

Function Documentation

◆ bubble_sort_numpy_paired()

void bubble_sort_numpy_paired ( std::vector< exprt > & keys,
std::vector< exprt > * payload )
inline

◆ build_1d_numpy_array_value()

exprt build_1d_numpy_array_value ( const std::vector< exprt > & elems,
const type_handler & th )
inline

◆ build_numpy_shape_array_value()

exprt build_numpy_shape_array_value ( const std::vector< std::size_t > & shape,
const std::vector< exprt > & elems,
const typet & elem_type,
const type_handler & th )
inline

◆ build_numpy_sort_or_argsort_result()

exprt build_numpy_sort_or_argsort_result ( python_converter & converter,
const type_handler & th,
const std::vector< std::size_t > & shape,
std::vector< exprt > elems,
bool flatten,
long long axis,
bool want_indices,
const typet & elem_type )
inline

◆ extract_value()

numeric_value extract_value ( const nlohmann::json & arg)
inline

◆ is_json_none_literal()

bool is_json_none_literal ( const nlohmann::json & node)
inline

◆ make_float_value()

numeric_value make_float_value ( double value)
inline

◆ make_int_value()

numeric_value make_int_value ( int64_t value)
inline

◆ normalize_reducer_axis()

long long normalize_reducer_axis ( long long axis,
std::size_t rank )
inline

◆ numpy_reducer_has_unsupported_keywords_besides()

bool numpy_reducer_has_unsupported_keywords_besides ( const nlohmann::json & call,
const std::set< std::string > & allowed )
inline

◆ numpy_reducer_has_unsupported_keywords_besides_axis()

bool numpy_reducer_has_unsupported_keywords_besides_axis ( const nlohmann::json & call)
inline

◆ to_double()

double to_double ( const numeric_value & value)
inline

◆ try_extract_numeric_constant()

bool try_extract_numeric_constant ( const nlohmann::json & node,
numeric_value & out )
inline

◆ validate_numpy_sort_kind_keyword_value()

void validate_numpy_sort_kind_keyword_value ( const nlohmann::json & value,
const std::string & function_name )
inline

◆ validate_numpy_stable_bool_keyword_value()

void validate_numpy_stable_bool_keyword_value ( const nlohmann::json & value,
const std::string & function_name )
inline

Variable Documentation

◆ max_numpy_sort_elements

std::size_t max_numpy_sort_elements = 64
constexpr