Skip to content

Instantly share code, notes, and snippets.

@ghorn
Last active August 29, 2015 13:57
Show Gist options
  • Save ghorn/9730902 to your computer and use it in GitHub Desktop.
Save ghorn/9730902 to your computer and use it in GitHub Desktop.
{-# OPTIONS_GHC -Wall #-}
{-# Language RankNTypes #-}
{-# Language DeriveFunctor #-}
{-# Language DeriveGeneric #-}
module Dyno.Nlp ( Nlp(..) ) where
import Dyno.Vectorize
import Dyno.TypeVecs
import Dyno.TypeNats
import GHC.Generics
import Linear.V ( Dim )
data Nlp x g =
Nlp { nlpFG :: forall a . Floating a => x a -> (a, g a)
, nlpBX :: x (Maybe Double, Maybe Double)
, nlpBG :: g (Maybe Double, Maybe Double)
, nlpX0 :: x Double
}
solveNlp :: (Vectorize x, Vectorize g) => Nlp x g -> x Double
solveNlp = undefined
data MyDvs a = MyDvs a a a a deriving (Functor, Generic1)
instance Vectorize MyDvs
data OtherDvs a = OtherDvs a (Vec D10 a) a a a deriving (Functor, Generic1)
instance Vectorize OtherDvs
data OtherDvs2 n a = OtherDvs2 a (Vec n a) a a a deriving (Functor, Generic1)
instance Dim n => Vectorize (OtherDvs2 n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment