forked from jfischoff/lagrangian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lagrangian.cabal
64 lines (62 loc) · 2.22 KB
/
lagrangian.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: lagrangian
version: 0.6.0.1
synopsis: Solve Lagrange multiplier problems
description:
Numerically solve convex Lagrange multiplier problems with conjugate gradient descent.
.
For some background on the method of Lagrange multipliers checkout the wikipedia page
<http://en.wikipedia.org/wiki/Lagrange_multiplier>
.
Here is an example from the Wikipedia page on Lagrange multipliers
Maximize f(x, y) = x + y, subject to the constraint x^2 + y^2 = 1
.
@
\> maximize 0.00001 (\\[x, y] -> x + y) [(\\[x, y] -> x^2 + y^2) \<=\> 1] 2
Right ([0.707,0.707], [-0.707])
@
.
For more information look here: <http://en.wikipedia.org/wiki/Lagrange_multiplier#Example_1>
.
For example, to find the maximum entropy with the constraint that the probabilities sum
to one.
.
@
\> maximize 0.00001 (negate . sum . map (\\x -> x * log x)) [sum \<=\> 1] 3
Right ([0.33, 0.33, 0.33], [-0.09])
@
.
The first elements of the result pair are the arguments for the
objective function at the maximum. The second elements are the Lagrange multipliers.
.
homepage: http://github.com/jfischoff/lagrangian
license: BSD3
license-file: LICENSE
author: (c) Jonathan Fischoff 2012-2014, (c) Eric Pashman 2014
maintainer: [email protected]
-- copyright:
category: Math
build-type: Simple
cabal-version: >=1.8
library
exposed-modules: Numeric.AD.Lagrangian
other-modules: Numeric.AD.Lagrangian.Internal
ghc-options: -Wall
build-depends: base >=4.5 && < 5,
nonlinear-optimization ==0.3.*,
vector ==0.10.*,
ad >= 4 && < 5,
hmatrix >= 0.14 && < 0.17
hs-source-dirs: src
Test-Suite tests
Hs-Source-Dirs: src, tests
type: exitcode-stdio-1.0
main-is: Main.hs
build-depends: base >=4.5 && < 5,
nonlinear-optimization ==0.3.*,
vector ==0.10.*,
ad >= 4 && <5,
hmatrix >= 0.14 && < 0.17,
test-framework ==0.8.*,
test-framework-hunit ==0.3.*,
test-framework-quickcheck2 ==0.3.*,
HUnit == 1.2.*