estimator 1.0.0 → 1.0.0.1
raw patch · 3 files changed
+16/−6 lines, 3 files
Files
- estimator.cabal +2/−2
- src/Numeric/Estimator/Class.hs +4/−2
- src/Numeric/Estimator/Model/Coordinate.hs +10/−2
estimator.cabal view
@@ -1,5 +1,5 @@ name: estimator-version: 1.0.0+version: 1.0.0.1 synopsis: State-space estimation algorithms such as Kalman Filters description: The goal of this library is to simplify implementation and use of@@ -31,7 +31,7 @@ source-repository this type: git location: https://github.com/GaloisInc/estimator- tag: 1.0.0+ tag: 1.0.0.1 Flag werror description: Make warnings errors
src/Numeric/Estimator/Class.hs view
@@ -18,6 +18,8 @@ module Numeric.Estimator.Class where +import GHC.Exts (Constraint)+ -- | An estimator is a model of a system, describing how to update a -- prior estimated state with new information. Two kinds of estimators -- are the 'Process' model, and the 'Measure' (or observation) model.@@ -72,12 +74,12 @@ -- observation is, such as, for example, the innovation. This is the -- type of that quality indication, which may be @()@ if the chosen -- algorithm can't report measurement quality.- type MeasureQuality t obs+ type MeasureQuality (t :: *) (obs :: * -> *) :: * -- | An algorithm may have specific constraints on what types of -- observation it can process. This type has a 'Constraint' kind and -- captures any required type-class constraints.- type MeasureObservable t obs+ type MeasureObservable (t :: *) (obs :: * -> *) :: Constraint measure :: MeasureObservable t obs => obs (Var t, t)
src/Numeric/Estimator/Model/Coordinate.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE GeneralizedNewtypeDeriving #-}+{-# LANGUAGE DeriveTraversable #-}+{-# LANGUAGE DeriveFoldable #-} {- | Description: Types for different coordinate systems@@ -34,8 +36,11 @@ distances. -} newtype NED a = NED { nedToVec3 :: V3 a }- deriving (Show, Additive, Applicative, Distributive, Foldable, Functor, Metric, Num, Traversable)+ deriving (Show, Additive, Applicative, Foldable, Functor, Metric, Num, Traversable) +instance Distributive NED where+ distribute = NED . distribute . fmap nedToVec3+ -- | Construct a navigation frame coordinate from (north, east, down). ned :: a -> a -> a -> NED a ned n e d = NED $ V3 n e d@@ -53,7 +58,10 @@ instant that the measurement was taken. -} newtype XYZ a = XYZ { xyzToVec3 :: V3 a }- deriving (Show, Additive, Applicative, Distributive, Foldable, Functor, Metric, Num, Traversable)+ deriving (Show, Additive, Applicative, Foldable, Functor, Metric, Num, Traversable)++instance (Distributive XYZ) where+ distribute = XYZ . distribute . fmap xyzToVec3 -- | Construct a body frame coordinate from (x, y, z). xyz :: a -> a -> a -> XYZ a