Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
NIFTy
Commits
d1901ab5
Commit
d1901ab5
authored
Sep 27, 2018
by
Martin Reinecke
Browse files
add Linearization.__pow__
parent
dbe056fc
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty5/linearization.py
View file @
d1901ab5
...
...
@@ -101,6 +101,11 @@ class Linearization(object):
def
__rtruediv__
(
self
,
other
):
return
self
.
inverse
().
__mul__
(
other
)
def
__pow__
(
self
,
power
):
if
not
np
.
isscalar
(
power
):
return
NotImplemented
return
self
.
new
(
self
.
_val
**
power
,
(
self
.
_jac
**
(
power
-
1
)).
scale
(
power
))
def
inverse
(
self
):
return
self
.
new
(
1.
/
self
.
_val
,
makeOp
(
-
1.
/
(
self
.
_val
**
2
))(
self
.
_jac
))
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment