How to do vector element-wise division?

Issue #97 wontfix
liang xiang created an issue

Hi, I want to use blaze vector to do division like this:

using blaze::CustomVector;
using blaze::aligned;
using blaze::unpadded;
using blaze::rowVector;
typedef CustomVector<float,aligned,unpadded,rowVector>  AlignedUnpadded;
int vsize = 10;
std::vector<float> b(vsize, 1), a(vsize, 2), c(vsize, 0);
AlignedUnpadded bb(&b[0], vsize);
AlignedUnpadded ba(&a[0], vsize);
AlignedUnpadded bc(&c[0], vsize);
bc = bb / ba;

But in compilation: error: no match for ‘operator/’ in ‘bb / ba’ /home/lxiang/Downloads/blaze-2.6/blaze/math/intrinsics/Division.h:232:36: note: candidates are: blaze::simd_cdouble_t blaze::operator/(const blaze::simd_cdouble_t&, const blaze::simd_double_t&) /home/lxiang/Downloads/blaze-2.6/blaze/math/intrinsics/Division.h:204:35: note: blaze::simd_cfloat_t blaze::operator/(const blaze::simd_cfloat_t&, const blaze::simd_float_t&) /home/lxiang/Downloads/blaze-2.6/blaze/math/intrinsics/Division.h:140:35: note: blaze::simd_double_t blaze::operator/(const blaze::simd_double_t&, const blaze::simd_double_t&) /home/lxiang/Downloads/blaze-2.6/blaze/math/intrinsics/Division.h:112:34: note: blaze::simd_float_t blaze::operator/(const blaze::simd_float_t&, const blaze::simd_float_t&)

Can you help me?

Thanks, Liang

Comments (2)

  1. Klaus Iglberger

    Hi!

    Vector division has been introduced in Blaze 3.0 (see the notes in the release archive). From the compiler output I can see that you are currently using Blaze 2.6. Please update (if possible) to the current release or alternatively clone the repository to enable vector division. I hope this explanation helps. Thanks for raising this issue,

    Best regards,

    Klaus!

  2. Log in to comment