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

Add accumulate_axis_inplace method and implement NdProducer for RawArrayView/Mut #611

Merged
merged 4 commits into from Sep 18, 2019

Commits on Sep 11, 2019

  1. Configuration menu
    Copy the full SHA
    71c8c8f View commit details
    Browse the repository at this point in the history
  2. Add accumulate_axis_inplace method

    jturner314 authored and bluss committed Sep 11, 2019
    Configuration menu
    Copy the full SHA
    bcd7078 View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2019

  1. Tweak how we create raw views in accumulate_axis_inplace

    We had:
    
    1. let ptr1 = self.raw_view(); // Borrow &self
    2. let ptr2 = self.raw_view_mut(); // Borrow &mut self
    3. Use ptr1 and ptr2
    
    While I'm not an expert at the unsafe coding guidelines for Rust, and
    there are more places in ndarray to revisit, I think it's best to change
    change 1 and 2 - they don't pass my internalized borrow checker.
    
    It seems as though the steps 1, 2, 3 could be against the rules as ptr1
    is borrowed from the array data, and its scope straddles the mut borrow
    of the array data in 2.
    
    For this reason, I think this would be better:
    
    1. let ptr2 = self.raw_view_mut() // Borrow &mut self
    2. let ptr1 = derive from ptr2
    3. use ptr1 and ptr2
    
    RawView should hopefully be our ally in making a better ndarray from the
    foundation.
    bluss committed Sep 12, 2019
    Configuration menu
    Copy the full SHA
    9d197a3 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    886b6a1 View commit details
    Browse the repository at this point in the history