
optimalMatrixOfOneState::
  (Vec.Walker varVec, Vec.Storage varVec a, Arith.Constant a,
   Ord a, Vec.Storage varVec (Maybe (Result a)), Vec.FromList varVec) =>
  Type.OptimalSolutionOfOneState node a ->
  Sig.PSignal2 Vector varVec a
-}



optimalMatrixOfOneState ::
  (Ord b, Arith.Constant d2, Vec.Walker v1, Vec.Walker v2,
   Vec.Storage v1 d2, Vec.Storage v2 (v1 d2),
   Vec.Storage v1 (Maybe (Result d2)),
   Vec.Storage v2 (v1 (Maybe (Result d2))), Vec.FromList v1,
   Vec.FromList v2) =>
  (a -> d2) ->
  Map [b] (Maybe a) ->
  Sig.TC s (Typ x y z) (Data (v2 :> (v1 :> Nil)) d2)
optimalMatrixOfOneState f =
  Sig.map ModUt.nothing2Nan
  . ModUt.to2DMatrix
  . Map.map (fmap (Determined . f))


optimalMatrixOfOneState ::
  (Ord b, Arith.Constant d2, Vec.Walker v1, Vec.Walker v2,
   Vec.Storage v1 d2, Vec.Storage v2 (v1 d2),
   Vec.Storage v1 (Maybe (Result d2)),
   Vec.Storage v2 (v1 (Maybe (Result d2))), Vec.FromList v1,
   Vec.FromList v2) =>
  (a -> d2) ->
  Map [b] (Maybe a) ->
  Sig.TC s (Typ x y z) (Data (v2 :> (v1 :> Nil)) d2)
optimalMatrixOfOneState f =
  Sig.map ModUt.nothing2Nan
  . ModUt.to2DMatrix
  . Map.map (fmap (Determined . f))
optimalMatrixOfOneState f =
  Sig.map ModUt.nothing2Nan
  . ModUt.to2DMatrix
  . Map.map (fmap (Determined . f))