Start Basic Doubts

Issue #316 resolved
Nycholas Maia created an issue

I started to read the Blaze documentation and I have some basic questions:

1- I don’t understood the “UL” notation.

Example:

blaze::StaticVector<int, 3UL> a;

Why not just “3”, like:

blaze::StaticVector<int, 3> a;

2- What is the difference between:

blaze::UniformVector<int> a( 3UL ) and blaze::StaticVector<int, 3UL> a;

I read the UniformVector documentation but I didn’t get the difference.

3- Future Doubts:

If I have another Blaze doubts in the future, which option should I select in the “Kind” combo box the this “Create Issue” form?

  1. bug
  2. enhancement
  3. proposal
  4. task

Thank you,

Comments (1)

  1. Klaus Iglberger

    Hi Nycholas!

    1.) UL denotes unsigned long integrals (see CppReference). Blaze excepts size_t arguments, which on a 64-bit system correspond to 64-bit unsigned integers. UL therefore gives the literals the right type.

    Using 3 instead of 3UL does not matter in many cases (for instance in your example), but there are cases where the type of literal matters. Therefore we try to use the right kind of literal in the documentation and wiki.

    2.) A UniformVector represents a vector with any number of elements, which have the same value. For instance:

    blaze::UniformVector<int> u( 5UL, 2.1 );  // Represents ( 2.1, 2.1, 2.1, 2.1, 2.1 )
    u = 3.5;  // Changes u to ( 3.5, 3.5, 3.5, 3.5, 3.5 )
    

    A StaticVector has a fixed number of elements of arbitrary value. For instance:

    blaze::StaticVector<int,5UL> s{ 1, 2, 3, 4, 5 };  // Represents ( 1, 2, 3, 4, 5 ); the number of elements cannot change
    s = { 5, 4, 3, 2, 1 };  // Changes s to ( 5, 4, 3, 2, 1 )
    

    3.) There is an overview of the different kinds of issues in the wiki. This should answer all your questions about issue creation.

    I hope this helps you to get started with Blaze.

    Best regards,

    Klaus!

  2. Log in to comment