16 #ifndef OPENKALMAN_SCALAR_QUOTIENT_HPP 17 #define OPENKALMAN_SCALAR_QUOTIENT_HPP 24 template<
typename Arg,
typename S>
26 scalar_quotient_impl(Arg&& arg, S&& s)
28 if constexpr (interface::scalar_quotient_defined_for<Arg, Arg&&, S&&>)
30 return interface::library_interface<stdex::remove_cvref_t<Arg>>::scalar_quotient(std::forward<Arg>(arg), std::forward<S>(s));
44 template<indexible Arg, values::scalar S> requires
46 static constexpr vector_space_descriptors_may_match_with<Arg>
auto 48 template<
typename Arg,
typename S>
51 scalar_quotient(Arg&& arg, S&& s)
53 if constexpr (zero<Arg>)
55 return std::forward<Arg>(arg);
57 else if constexpr (constant_matrix<Arg>)
61 std::divides<scalar_type_of_t<Arg>>{},
65 else if constexpr (constant_diagonal_matrix<Arg>)
69 std::divides<scalar_type_of_t<Arg>>{},
70 constant_diagonal_value{arg},
71 std::forward<S>(s))));
73 else if constexpr (values::fixed_value_compares_with<S, 1>)
75 return std::forward<Arg>(arg);
79 return detail::scalar_quotient_impl(std::forward<Arg>(arg), std::forward<S>(s));
constexpr auto n_ary_operation(const std::tuple< Ds... > &d_tup, Operation &&operation, Args &&...args)
Perform a component-wise n-ary operation, using broadcasting to match the size of a pattern matrix...
Definition: n_ary_operation.hpp:325
decltype(auto) constexpr to_value_type(Arg &&arg)
Convert, if necessary, a fixed or dynamic value to its underlying base type.
Definition: to_value_type.hpp:28
decltype(auto) constexpr to_diagonal(Arg &&arg)
Convert an indexible object into a diagonal matrix.
Definition: to_diagonal.hpp:33
The root namespace for OpenKalman.
Definition: basics.hpp:34
decltype(auto) constexpr diagonal_of(Arg &&arg)
Extract a column vector (or column slice for rank>2 tensors) comprising the diagonal elements...
Definition: diagonal_of.hpp:36
constexpr auto constant_value(T &&t)
The constant value associated with a constant_object or constant_diagonal_object. ...
Definition: constant_value.hpp:37
constexpr auto make_constant(C c, stdex::extents< IndexType, Extents... > extents)
Make an indexible object in which every element is a constant value.
Definition: make_constant.hpp:39
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98