| Safe Haskell | None |
|---|
Ipopt.AnyRF
Description
The AnyRF wrapper holds functions that can be used
for the objective (f) or for constraints (g). Many functions
in the instances provided are partial: this seems to be unavoidable
because the input variables haven't been decided yet, so you should
not be allowed to use compare on these. But for now just use the
standard Prelude classes, and unimplementable functions (which
would not produce an AnyRF) are calls to error.
Values of type AnyRF Identity can be generated using functions
defined in Ipopt.NLP (also exported by Ipopt). Directly using the
constructor is another option: AnyRF $ Identity . V.sum, calculates
the sum of all variables in the problem.
- data AnyRF cb = AnyRF (forall a. AnyRFCxt a => Vector a -> cb a)
- type AnyRFCxt a = (RealFloat a, VectorSpace a, Scalar a ~ a)
- liftOp0 :: (forall a. AnyRFCxt a => a) -> AnyRF Identity
- liftOp1 :: (forall a. AnyRFCxt a => a -> a) -> AnyRF Identity -> AnyRF Identity
- liftOp2 :: (forall a. AnyRFCxt a => a -> a -> a) -> AnyRF Identity -> AnyRF Identity -> AnyRF Identity
Documentation
type AnyRFCxt a = (RealFloat a, VectorSpace a, Scalar a ~ a)Source
RealFloat gives most numerical operations,
VectorSpace is involved to allow using definitions from the
splines package
helpers for defining instances
liftOp2 :: (forall a. AnyRFCxt a => a -> a -> a) -> AnyRF Identity -> AnyRF Identity -> AnyRF IdentitySource
orphan instances
these belong somewhere between the ad package and vector-space