Skip to content
Snippets Groups Projects

implemented derivation of gradient weights via rotation

Merged Markus Holzer requested to merge (removed):derivation_gradient into master

derive gradient weights of other direction with already calculated weights of one direction via rotation and apply them to a field.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • For the 2D case in the as_matrix function the result is converted from a MutableDenseNDimArray to a MutableDenseMatrix to keep the compatibility in the test cases since MutableDenseMatrix can not be used for 3D cases. I am not sure whether it is better to change the datatype to MutableDenseNDimArray in general. Working with both types might lead to inconsistency problems somewhere sometime.

    code snippet where the datatype is changed in derivation.py:

    result = sp.MutableDenseNDimArray([0] * number_of_elements, shape)
    
    if dim == 2:
        for direction, weight in zip(self.stencil, self.weights):
            result[max_offset - direction[1], max_offset + direction[0]] = weight
        result = result.tomatrix()
  • We could rename the function you implemented to as_array. This function could consistently return a DenseNDimArray. The old as_matrix function can be deprecated then by using a deprecation warning.

    All tests should then also use the new as_array function.

  • Markus Holzer added 1 commit

    added 1 commit

    • 248a5e0d - implemented derivation of gradient weights via rotation

    Compare with previous version

  • Everything done

  • merged

  • Martin Bauer mentioned in commit dc8453b3

    mentioned in commit dc8453b3

  • mentioned in issue #8 (closed)

Please register or sign in to reply