subroutine ToyDat( Prob, maxm, maxn, maxne, inform, $ m, n, ne, nnCon, nnObj, nnJac, iObj, $ ObjAdd, BigBnd, $ a, ha, ka, bl, bu, hs, x, pi ) character*8 Prob integer maxm, maxn, maxne, inform integer m, n, ne, nnCon, nnObj, nnJac, iObj integer ha(maxne) , hs(maxn+maxm) integer ka(maxn+1) double precision ObjAdd, BigBnd double precision a(maxne) , bl(maxn+maxm), bu(maxn+maxm), $ x(maxn+maxm), pi(maxm) * ------------------------------------------------------------------ * ToyDat generates data for the Toyagon problem. * The constraints take the form * c(x) + A*x - s = 0, * where the Jacobian for c(x) + Ax is stored in a(*), and any * terms coming from c(x) are in the TOP LEFT-HAND CORNER of a(*), * with dimensions nnCon x nnJac. * Note that the right-hand side is zero. * s is a set of slack variables whose bounds contain any constants * that might have formed a right-hand side. * * The objective function is * f(x) + d'x * where d would be row iobj of A (but there is no such row in * this example). f(x) involves only the FIRST nnObj variables. * * On entry, * maxm, maxn, maxne are upper limits on m, n, ne. * * On exit, * inform is 0 if there is enough storage, 1 otherwise. * m is the number of nonlinear and linear constraints. * n is the number of variables. * ne is the number of nonzeros in a(*). * nnCon is the number of nonlinear constraints (they come first). * nnObj is the number of nonlinear objective variables. * nnJac is the number of nonlinear Jacobian variables. * a is the constraint matrix (Jacobian), stored column-wise. * ha is the list of row indices for each nonzero in a(*). * ka is a set of pointers to the beginning of each column of a. * bl is the lower bounds on x and s. * bu is the upper bounds on x and s. * hs(1:n) is a set of initial states for each x (0,1,2,3,4,5). * x (1:n) is a set of initial values for x. * pi(1:m) is a set of initial values for the dual variables pi. * * 24 Dec 1997: First version of ToyDat. * ------------------------------------------------------------------ * Give a name to the Problem. Prob = ' Toy NLP' ne = 10 n = 4 m = 4 nnCon = 2 nnJac = 2 nnObj = 3 * Check if there is enough storage. inform = 0 if (m .gt. maxm ) inform = 1 if (n .gt. maxn ) inform = 1 if (ne .gt. maxne) inform = 1 if (inform .gt. 0 ) return * ------------------------------------- * Set up the list of row indices in ha. * ------------------------------------- * Column 1 * Nonlinear elements in rows (1, 2) first. ka( 1) = 1 ha( 1) = 1 a ( 1) = 0.0d+0 ha( 2) = 2 a ( 2) = 0.0d+0 * Linear element in row 3 next. ha( 3) = 3 a ( 3) = 2.0d+0 * Column 2. * Nonlinear elements in rows (1, 2). ka( 2) = 4 ha( 4) = 1 a ( 4) = 0.0d+0 ha( 5) = 2 a ( 5) = 0.0d+0 * Linear element in row 3. ha( 6) = 3 a ( 6) = 4.0d+0 * Column 3. * Linear element in row 1. ka( 3) = 7 ha( 7) = 1 a ( 7) = 1.0d+0 * Objective row element in row 4. ha( 8) = 4 a ( 8) = 3.0d+0 * Column 4. * Linear element in row 2 ka( 4) = 9 ha( 9) = 2 a ( 9) = 1.0d+0 * Objective row element in row 4 ha(10) = 4 a (10) = 5.0d+0 * Don't forget to finish off ka. * This is crucial. ka(5) = ne + 1 * ------------------------------------------------------------------ * Constraint ranges * ------------------------------------------------------------------ * Nonlinear constraints first. bl(n+1) = 2.0d+0 bu(n+1) = 2.0d+0 bl(n+2) = 4.0d+0 bu(n+2) = 4.0d+0 * Followed by the linear constraints. bl(n+3) = 0.0d+0 bu(n+3) = BigBnd * The linear objective term is row 4. iObj = 4 * The objective row is a free row. bl(n+4) = -BigBnd bu(n+4) = BigBnd ObjAdd = 0.0d+0 * ------------------------------------------------------------------ * Variable ranges * ------------------------------------------------------------------ do 100, j = 1, n bl(j) = -BigBnd bu(j) = BigBnd 100 continue bl(3) = 0.0d+0 bl(4) = 0.0d+0 * ------------------------------------------------------------------ * Initialize x, hs and pi. * Set the initial value and status of each variable. * For want of something better to do, make the variables x(1:n) * temporarily fixed at their current values. * The crash can set the rest. * ------------------------------------------------------------------ do 200, j = 1, n x(j) = 1.0d+0 200 continue do 300, j = 1, n hs(j) = 0 300 continue do 400, i = 1, m pi(i) = 0.0d+0 400 continue * end of ToyDat end