1#ifndef CHIHAYA_BINARY_ARITHMETIC_HPP
2#define CHIHAYA_BINARY_ARITHMETIC_HPP
5#include "ritsuko/hdf5/hdf5.hpp"
6#include "ritsuko/ritsuko.hpp"
13#include "utils_arithmetic.hpp"
14#include "utils_misc.hpp"
15#include "utils_unary.hpp"
28namespace binary_arithmetic {
39 auto left_details = internal_arithmetic::fetch_seed(handle,
"left", version, options);
40 auto right_details = internal_arithmetic::fetch_seed(handle,
"right", version, options);
43 if (!internal_misc::are_dimensions_equal(left_details.dimensions, right_details.dimensions)) {
44 throw std::runtime_error(
"'left' and 'right' should have the same dimensions");
48 auto method = internal_unary::load_method(handle);
50 if (!internal_arithmetic::is_valid_operation(method)) {
51 throw std::runtime_error(
"unrecognized 'method' (" + method +
")");
55 left_details.type = internal_arithmetic::determine_output_type(left_details.type, right_details.type, method);
ArrayDetails validate(const H5::Group &handle, const ritsuko::Version &version, Options &options)
Definition: binary_arithmetic.hpp:38
Namespace for all chihaya functions.
Definition: binary_arithmetic.hpp:22
Details about an array.
Definition: utils_public.hpp:36
Validation options.
Definition: utils_public.hpp:66
bool details_only
Definition: utils_public.hpp:71
Various public utilities.