# mvgrimes/pdl-opt-qp

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Perl PDL module to solve Quadratic Programming problems
FORTRAN Pure Data Perl

Fetching latest commit…

Cannot retrieve the latest commit at this time

 Failed to load latest commit information. lib/PDL/Opt src t .gitignore Build.PL Changes MANIFEST.SKIP META.json README.md

# NAME

PDL::Opt::QP - Quadratic programming solver for PDL

# SYNOPSIS

``````use PDL;
use PDL::NiceSlice;
use PDL::Opt::QP;

my \$mu   = pdl(q[ 0.0427 0.0015 0.0285 ])->transpose; # [ n x 1 ]
my \$mu_0 = 0.0427;
my \$dmat = pdl q[ 0.0100 0.0018 0.0011 ;
0.0018 0.0109 0.0026 ;
0.0011 0.0026 0.0199 ];
my \$dvec = zeros(3);
my \$amat = \$mu->glue( 0, ones( 1, 3 ) )->copy;
my \$bvec = pdl(\$mu_0)->glue( 1, ones(1) )->flat;
my \$meq  = pdl(2);

my \$sol = qp( \$dmat, \$dvec, \$amat, \$bvec, \$meq );
say "Solution: ", \$sol->{x};
``````

# DESCRIPTION

This routine uses Goldfarb/Idnani algorithm to solve the following minimization problem:

``````       minimize  f(x) = 0.5 * x' D x  -  d' x
x

optionally constrained by:

Aeq'  x  = a_eq
Aneq  x >= b_neq
``````

# FUNCTIONS

## qpgen2

``````Signature: (dmat(m,m); dvec(m);
[o]sol(m); [o]lagr(q); [o]crval();
amat(m,q); bvec(q); int meq();
int [o]iact(q); int [o]nact();
int [o]iter(s=2); [t]work(z); int [o]ierr();
)
``````

This routine solves the quadratic programming optimization problem

``````       minimize  f(x) = 0.5 x' D x  -  d' x
x

optionally constrained by:

Aeq'  x  = a_eq
Aneq  x >= b_neq
``````

.... more docs to come ....

qpgen2 ignores the bad-value flag of the input piddles. It will set the bad-value flag of all output piddles if the flag is set for any of the input piddles.

# BUGS

Please report any bugs or suggestions at http://rt.cpan.org/

# AUTHOR

Mark Grimes, mgrimes@cpan.org