Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #563 from OP2/pefarrell/global-inner
Browse files Browse the repository at this point in the history
* pefarrell/global-inner:
  Implement Global.inner.
  • Loading branch information
wence- committed May 28, 2019
2 parents f6748ff + 628e576 commit 5dec18a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pyop2/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,10 @@ def __itruediv__(self, other):
"""Pointwise division or scaling of fields."""
return self._iop(other, operator.itruediv)

def inner(self, other):
assert isinstance(other, Global)
return np.dot(self.data_ro, other.data_ro)


class Map(object):

Expand Down

0 comments on commit 5dec18a

Please sign in to comment.