Introduce the componentwise division of dense vectors

Issue #33 resolved
Klaus Iglberger created an issue

Description

The Blaze library provides the componentwise multiplication of dense vectors. However, although offen required, it doesn't provide the componentwise division of dense vectors. Blaze should also provide the componentwise division of vectors.

Conceptual Example

blaze::DynamicVector<double> a, b, c;
// Resizing and initialization
c = a / b;  // Componentwise dense vector division

Tasks

  • implement the componentwise division of dense vectors
  • provide a full documentation of the feature
  • ensure compatibility with all existing vector classes
  • ensure compatibility with all existing vector expressions
  • guarantee maximum performance for the operation
  • add the necessary number of test cases for the functionality

Comments (3)

  1. Klaus Iglberger reporter

    Summary

    The feature has been implemented, tested, optimized (including vectorization and parallelization) and documented as required. It is immediately available via cloning the Blaze repository and will be officially released in Blaze 3.0.

    Vector/Vector Division

    A componentwise vector/vector division between two vectors with the same transpose flag (i.e. either blaze::columnVector or blaze::rowVector) is expressed via the division operator:

    using blaze::DynamicVector;
    using blaze::CompressedVector;
    
    CompressedVector<int,columnVector> v1( 17UL );
    DynamicVector<int,columnVector>    v2( 17UL );
    
    StaticVector<double,10UL,rowVector> v3;
    DynamicVector<double,rowVector>     v4( 10UL );
    
    // ... Initialization of the vectors
    
    CompressedVector<int,columnVector> v5( v1 / v2 );  // Componentwise division of a sparse and a
                                                       // dense column vector. The result is a sparse
                                                       // column vector.
    DynamicVector<double,rowVector>    v6( v3 / v4 );  // Componentwise division of two dense row
                                                       // vectors. The result is a dense row vector.
    

    Please note that only dense vectors can be used as divisors! Also note that all values of the divisor must be non-zero and that no checks are performed to assert this precondition!

  2. Log in to comment