Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lifetime): extending the lifetime of temporary objects #160

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Commits on Feb 9, 2022

  1. fix(lifetime): extending the lifetime of temporary objects

    Fix for issue #125.
    
    The current implementation does not take into account the prvalue that
    creates an issue while storing it. The prvalue is destroyed after the
    end of its scope, and if you try access it, you are entering into
    undefined land of C++.
    
    To solve this issue, we employ the trait `std::is_lvalue_reference` to
    determine if need to extend the lifetime or not. If extension is needed,
    we store the value with the help of universal forwarding. Otherwise, we
    extend lifetime using `const &`.
    amitsingh19975 committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    15c4476 View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2022

  1. Configuration menu
    Copy the full SHA
    8f5a5d1 View commit details
    Browse the repository at this point in the history
  2. refactor(comparision): decoupled if constexpr and cleaned-up compare.

    Decoupled each `constexpr if` conditions into function using requires
    clause, which cleaned-up the compare function. Also, added the check for
    static extents that removes the runtime check.
    amitsingh19975 committed Feb 10, 2022
    Configuration menu
    Copy the full SHA
    8178c6c View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2022

  1. Configuration menu
    Copy the full SHA
    9b8c4e1 View commit details
    Browse the repository at this point in the history
  2. fix(test): bind the prvalue (=3) to a variable

    Since the patch is fixing the lifetime of the tensor, we cannot combine a prvalue with the old ublas expression. Therefore, we have to bind the prvalue with the name to increase the lifetime.
    amitsingh19975 committed Feb 12, 2022
    Configuration menu
    Copy the full SHA
    d70a701 View commit details
    Browse the repository at this point in the history

Commits on Feb 13, 2022

  1. refactor(expression): add function cast_tensor_expression for casting

    This function casts any `tensor_expression` to its child class, and it
    also handles recursive casting to get the real expression that is stored
    inside the layers of `tensor_expression`.
    amitsingh19975 committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    8ec747c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a936dd View commit details
    Browse the repository at this point in the history
  3. refactor(comparision): remove the construction of a whole new tensor

    Previously, we would create a new tensor from the expression template
    every time there is a comparision. Also, fixed the spelling to
    `cast_tensor_expression` from `cast_tensor_exression`.
    amitsingh19975 committed Feb 13, 2022
    Configuration menu
    Copy the full SHA
    b6a3dd8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3a013d0 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2022

  1. Configuration menu
    Copy the full SHA
    7b23092 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a90573c View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2022

  1. Configuration menu
    Copy the full SHA
    2abe215 View commit details
    Browse the repository at this point in the history
  2. refactor(expression): clean unnecessary code and fix the comparision …

    …between different extents types
    amitsingh19975 committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    51674d5 View commit details
    Browse the repository at this point in the history
  3. refactor(expression): use std::invoke and add types to functional o…

    …bjects to catch type errors
    amitsingh19975 committed Feb 15, 2022
    Configuration menu
    Copy the full SHA
    b7de038 View commit details
    Browse the repository at this point in the history

Commits on Feb 16, 2022

  1. Configuration menu
    Copy the full SHA
    bc0afbd View commit details
    Browse the repository at this point in the history
  2. fix(test): remove the undefined behaviour if the type is not FP

    The standard does not define the complex class other than float, double,
    and long double. It leaves the implementation on the hands of vendors,
    and it could lead to the portability issue or undefined behaviour, which
    is not warranted.
    amitsingh19975 committed Feb 16, 2022
    Configuration menu
    Copy the full SHA
    00357a0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    549f8a0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    23ba8fc View commit details
    Browse the repository at this point in the history