1#ifndef TATAMI_ISOMETRIC_UNARY_ARITHMETIC_HELPERS_H
2#define TATAMI_ISOMETRIC_UNARY_ARITHMETIC_HELPERS_H
4#include "../arithmetic_utils.hpp"
20template<ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Index_,
typename Scalar_,
typename OutputValue_>
23 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
34template<
bool check_only_, ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Scalar_>
51 throw std::runtime_error(
"division by zero is not supported");
65template<ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Scalar_>
70template<ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Scalar_>
91template<ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Scalar_>
109 static constexpr bool is_basic =
false;
111 bool is_sparse()
const {
122 template<
typename Index_,
typename OutputValue_>
127 template<
typename Index_,
typename OutputValue_>
132 template<
typename Index_,
typename OutputValue_>
137 template<
typename OutputValue_,
typename,
typename Index_>
163template<ArithmeticOperation op_,
bool right_,
typename InputValue_,
typename Vector_>
174 for (
auto x : my_vector) {
185 bool my_sparse =
true;
191 static constexpr bool is_basic =
false;
193 bool zero_depends_on_row()
const {
197 bool zero_depends_on_column()
const {
201 bool non_zero_depends_on_row()
const {
205 bool non_zero_depends_on_column()
const {
209 bool is_sparse()
const {
220 template<
typename Index_,
typename OutputValue_>
222 if (
row == my_by_row) {
226 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
236 template<
typename Index_,
typename OutputValue_>
238 if (
row == my_by_row) {
243 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
253 template<
typename Index_,
typename OutputValue_>
255 if (
row == my_by_row) {
259 if constexpr(std::is_same<InputValue_, OutputValue_>::value) {
269 template<
typename OutputValue_,
typename,
typename Index_>
271 if (
row == my_by_row) {
291template<
typename InputValue_ =
double,
typename Scalar_>
304template<
bool right_,
typename InputValue_ =
double,
typename Scalar_>
316template<
typename InputValue_ =
double,
typename Scalar_>
329template<
bool right_,
typename InputValue_ =
double,
typename Scalar_>
342template<
bool right_,
typename InputValue_ =
double,
typename Scalar_>
355template<
bool right_,
typename InputValue_ =
double,
typename Scalar_>
368template<
bool right_,
typename InputValue_ =
double,
typename Scalar_>
381template<
typename InputValue_ =
double,
typename Vector_>
395template<
bool right_,
typename InputValue_ =
double,
typename Vector_>
408template<
typename InputValue_ =
double,
typename Vector_>
422template<
bool right_,
typename InputValue_ =
double,
typename Vector_>
436template<
bool right_,
typename InputValue_ =
double,
typename Vector_>
450template<
bool right_,
typename InputValue_ =
double,
typename Vector_>
464template<
bool right_,
typename InputValue_ =
double,
typename Vector_>
Delayed unary isometric scalar arithmetic.
Definition arithmetic_helpers.hpp:92
DelayedUnaryIsometricArithmeticScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:97
Delayed unary isometric vector arithmetic.
Definition arithmetic_helpers.hpp:164
DelayedUnaryIsometricArithmeticVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:173
Flexible representations for matrix data.
Definition Extractor.hpp:15
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::DIVIDE, right_, InputValue_, Vector_ > make_DelayedUnaryIsometricDivideVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:423
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::POWER, right_, InputValue_, Vector_ > make_DelayedUnaryIsometricPowerVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:437
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::DIVIDE, right_, InputValue_, Scalar_ > make_DelayedUnaryIsometricDivideScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:330
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::ADD, true, InputValue_, Vector_ > make_DelayedUnaryIsometricAddVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:382
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MODULO, right_, InputValue_, Scalar_ > make_DelayedUnaryIsometricModuloScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:356
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Scalar_ > make_DelayedUnaryIsometricIntegerDivideScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:369
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MODULO, right_, InputValue_, Vector_ > make_DelayedUnaryIsometricModuloVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:451
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::MULTIPLY, true, InputValue_, Scalar_ > make_DelayedUnaryIsometricMultiplyScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:317
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::INTEGER_DIVIDE, right_, InputValue_, Vector_ > make_DelayedUnaryIsometricIntegerDivideVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:465
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::POWER, right_, InputValue_, Scalar_ > make_DelayedUnaryIsometricPowerScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:343
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::ADD, true, InputValue_, Scalar_ > make_DelayedUnaryIsometricAddScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:292
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::MULTIPLY, true, InputValue_, Vector_ > make_DelayedUnaryIsometricMultiplyVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:409
DelayedUnaryIsometricArithmeticVector< ArithmeticOperation::SUBTRACT, right_, InputValue_, Vector_ > make_DelayedUnaryIsometricSubtractVector(Vector_ vector, bool by_row)
Definition arithmetic_helpers.hpp:396
auto consecutive_extractor(const Matrix< Value_, Index_ > *mat, bool row, Index_ iter_start, Index_ iter_length, Args_ &&... args)
Definition consecutive_extractor.hpp:35
DelayedUnaryIsometricArithmeticScalar< ArithmeticOperation::SUBTRACT, right_, InputValue_, Scalar_ > make_DelayedUnaryIsometricSubtractScalar(Scalar_ scalar)
Definition arithmetic_helpers.hpp:305