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

update Array hierarchy and allocate nD arrays in a contiguous block by default #1236

Merged
merged 25 commits into from
May 23, 2024

Commits on May 17, 2024

  1. Configuration menu
    Copy the full SHA
    4ca1217 View commit details
    Browse the repository at this point in the history
  2. allow Vector/Array construction from existing memory

    needs more tests
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    1873c9d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3e9527b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    77cbf5a View commit details
    Browse the repository at this point in the history
  5. Array: first version that defaults to continuous allocation

    Currently only applies to the constructor from an IndexRange.
    
    Tests fail due to missing assignment operator. Best to use the
    copy-and-swap idiom.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    ae72749 View commit details
    Browse the repository at this point in the history
  6. Array: add move constructors, swap and missing assignment operators

    Most of the implementation uses the copy-and-swap idiom.
    
    I needed copy-constructors as well, as the default generated ones no longer
    existed or were inappropriate. We should now be following "the rule of five".
    
    This now passes test_Array, including with valgrind.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    616dbb5 View commit details
    Browse the repository at this point in the history
  7. Array: clean-up

    - make sure it works with other STIR classes, not just floats etc
    - re-instate VectorWithOffset constructors that take both start and end pointers for backwards compatibility
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    49146ce View commit details
    Browse the repository at this point in the history
  8. Array: remove wrong/not implemented constructors

    The NumericVectorWithOffset constructor would only work when T=NUMBER.
    
    The 1D Array constructor taking an `elemT*` wasn't implemented yet.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    86a449c View commit details
    Browse the repository at this point in the history
  9. resolve std::swap for VC

    Seems that VC gets confused by the new Array::swap, so add std:: explicitly
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    205197c View commit details
    Browse the repository at this point in the history
  10. add Array constructor from ptr [ci skip]

    make Array:init from ptr private
    
    test_Array is crashing due to  memory bug in grow
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    bc5a282 View commit details
    Browse the repository at this point in the history
  11. Array: first version using shared_ptr<T[]> (WIP)

    nD Array's now store the "full" memory via shared_ptr<T[]>. This automates
    memory management. 1D Array's are still TODO.
    
    test_Array now works ok, except for 1D arrays.
    
    Some testing code remains in test_Array
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    a399a96 View commit details
    Browse the repository at this point in the history
  12. require C++-17

    needed for shared_ptr<T[]>, unless we'd implement deleters ourselves
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    12cec9a View commit details
    Browse the repository at this point in the history
  13. Array: use shared_ptr<T[]> for VectorWithOffset

    all Array tests pass
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    3c29a2a View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    f4b4db8 View commit details
    Browse the repository at this point in the history
  15. Array: remove private member _owns_memory_for_data

    no longer needed as we're using a shared<T[]> and can test that.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    2ba9924 View commit details
    Browse the repository at this point in the history
  16. Array: clean-up constructors that take existing data

    - get rid of copy_data argument for constructors but use sensible defaults
    - add VectorWithOffset::init such that Array doesn't need to know much
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    433bd82 View commit details
    Browse the repository at this point in the history
  17. run clang-format

    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    0ae05b1 View commit details
    Browse the repository at this point in the history
  18. remove experimental/memory work-around for shared_ptr

    This was an attempt to handle pre-C++-17, but it would need
    work for make_shared.  In any case, it isn't available on VS compilers
    apparently.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    345b0d7 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    be32661 View commit details
    Browse the repository at this point in the history
  20. [CMake] fix FindCERN_ROOT to always check version

    This was previously only done when finding the CONFIG file
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    510e429 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    715ede8 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    4bf2d13 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    74579af View commit details
    Browse the repository at this point in the history
  24. Avoid image copies in Parallelproj

    if data is contiguous, we don't need an extra copy.
    KrisThielemans committed May 17, 2024
    Configuration menu
    Copy the full SHA
    8752e45 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2024

  1. Configuration menu
    Copy the full SHA
    ae82826 View commit details
    Browse the repository at this point in the history