pow Matches too aggressively
Hi Klaus!
A small bug report/feature request. I'm trying to overload the pow function to allow element-wise pow between two Blaze expressions. However, my overloaded one matches on blaze::Vector<VT, TF>
which is a worse match than the Blaze-provided one, which then encounters the IsNumeric static_assert. Would it be possible to instead express the IsNumeric condition on ET
as an enable_if
so that I am able to overload pow
? Thanks!
Cheers,
Nils
Comments (5)
-
reporter -
-
assigned issue to
-
assigned issue to
-
- changed status to open
-
- changed status to resolved
Summary
Commit 9264760 resolves the problem with the unary
pow()
functions. Commits 97568b0 and 92ac0f4 add binarypow()
functions for dense vectors and matrices. The fix and the newpow()
functions are immediately available via cloning the Blaze repository and will be officially released in Blaze 3.3.The pow() Function
The
pow()
function can be used to compute the exponential value of each element of a vector or matrix. If passed a vector or matrix and a numeric exponent, the function computes the exponential value of each element using the same exponent. If passed a second vector or matrix, the function computes the componentwise exponential value:blaze::StaticVector<double,3UL> a, b, c; c = pow( a, 1.2 ); // Computes the exponential value of each element c = pow( a, b ); // Computes the componentwise exponential value
blaze::StaticMatrix<double,3UL,3UL> A, B, C; C = pow( A, 1.2 ); // Computes the exponential value of each element C = pow( A, B ); // Computes the componentwise exponential value
-
reporter Hi Klaus!
Once again thank you for the amazingly fast turn around time on this! It is greatly appreciated!
Cheers,
Nils
- Log in to comment
Here is the required change to the pow function definition:
I would expect similar changes to be useful for SparseVectors and Matrices