Skip to content

Commit

Permalink
implement LoopConcatenate._sum
Browse files Browse the repository at this point in the history
  • Loading branch information
joostvanzwieten committed Mar 11, 2024
1 parent d7e8833 commit c96c6fa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nutils/evaluable.py
Original file line number Diff line number Diff line change
Expand Up @@ -4529,6 +4529,12 @@ def _simplified(self):
return
return align(f, where, self.shape)

def _sum(self, axis):
if axis == self.ndim-1:
return loop_sum(Sum(self.func), self.index)
else:
return loop_concatenate(sum(self.func, axis), self.index)

def _takediag(self, axis1, axis2):
if axis1 < self.ndim-1 and axis2 < self.ndim-1:
return Transpose.from_end(loop_concatenate(Transpose.to_end(_takediag(self.func, axis1, axis2), -2), self.index), -2)
Expand Down

0 comments on commit c96c6fa

Please sign in to comment.