Skip to content

Commit

Permalink
workaround issue #72
Browse files Browse the repository at this point in the history
  • Loading branch information
ghorn committed Apr 29, 2015
1 parent 05abad4 commit 97d2c76
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Dyno/DirectCollocation/Dynamic.hs
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ dynPlotPoints ::
-> CollTraj x z u p n deg (Vector a)
-> Vec n (Vec deg (J (JV o) (Vector a), J (JV x) (Vector a)), J (JV x) (Vector a))
-> DynPlotPoints a
dynPlotPoints quadratureRoots (CollTraj tf' _ stages' xf) outputs =
DynPlotPoints xss' zss uss oss xdss
dynPlotPoints quadratureRoots (CollTraj tf' _ stages' xf) outputs
-- if degree is one, each arc will be 1 point and won't get drawn
-- see https://github.com/ghorn/dynobud/issues/72
-- https://github.com/ghorn/Plot-ho-matic/issues/10
-- https://github.com/timbod7/haskell-chart/issues/81
| reflectDim (Proxy :: Proxy deg) == 1 =
DynPlotPoints xss' (singleArc zss) (singleArc uss) (singleArc oss) (singleArc xdss)
| otherwise = DynPlotPoints xss' zss uss oss xdss
where
singleArc :: Vector (Vector b) -> Vector (Vector b)
singleArc = V.singleton . V.concat . V.toList
nStages = size (Proxy :: Proxy (JVec n (JV Id)))
tf,h :: a
Id tf = splitJV tf'
Expand Down

0 comments on commit 97d2c76

Please sign in to comment.