Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
rotagaporp-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ivan Kondov
rotagaporp-c
Commits
5cd3ebe8
Commit
5cd3ebe8
authored
5 years ago
by
Ivan Kondov
Browse files
Options
Downloads
Patches
Plain Diff
some refactoring of __init__()
parent
4debee1c
No related branches found
No related tags found
1 merge request
!2
WIP: Polynomial propagators with variable time step
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
rotagaporp/propagators.py
+5
-8
5 additions, 8 deletions
rotagaporp/propagators.py
with
5 additions
and
8 deletions
rotagaporp/propagators.py
+
5
−
8
View file @
5cd3ebe8
...
...
@@ -269,6 +269,8 @@ class SymmetricPolynomialPropagator(PolynomialPropagator):
self
.
numeric
=
self
.
syst
.
numeric
validate_numeric
(
self
.
fpprec
,
self
.
numeric
)
if
self
.
fpprec
==
'
fixed
'
:
self
.
prec
=
np
.
finfo
(
float
).
precision
tool
=
self
.
numeric
[
'
tool
'
]
assert
tool
in
[
'
subs
'
,
'
lambdify
'
,
'
theano
'
]
...
...
@@ -282,9 +284,10 @@ class SymmetricPolynomialPropagator(PolynomialPropagator):
if
tool
==
'
theano
'
:
self
.
linalg
=
'
numpy
'
if
self
.
fpprec
==
'
fixed
'
:
self
.
prec
=
np
.
finfo
(
float
).
precision
self
.
set_util_funcs
()
def
set_util_funcs
(
self
):
"""
utility functions depending on numeric backend and type of q
"""
if
self
.
linalg
==
'
sympy
'
:
self
.
matrix
=
sp
.
Matrix
self
.
matmul
=
lambda
x
,
y
:
x
*
y
...
...
@@ -302,12 +305,6 @@ class SymmetricPolynomialPropagator(PolynomialPropagator):
self
.
normf
=
np
.
linalg
.
norm
if
isinstance
(
self
.
q
,
Iterable
):
assert
isinstance
(
self
.
p
,
Iterable
)
assert
isinstance
(
self
.
syst
.
q
,
Iterable
)
assert
isinstance
(
self
.
syst
.
p
,
Iterable
)
assert
len
(
self
.
q
)
==
len
(
self
.
p
)
assert
len
(
self
.
q
)
==
len
(
self
.
syst
.
q
)
assert
len
(
self
.
syst
.
q
)
==
len
(
self
.
syst
.
p
)
self
.
concat
=
lambda
a
,
b
:
(
*
a
,
*
b
)
self
.
split
=
lambda
x
:
(
x
[:
len
(
x
)
//
2
],
x
[
len
(
x
)
//
2
:])
else
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment