diff --git a/doc/pdf/cutest.pdf b/doc/pdf/cutest.pdf index 909ebac..d1e3c09 100644 Binary files a/doc/pdf/cutest.pdf and b/doc/pdf/cutest.pdf differ diff --git a/doc/pdf/cutest_cchprodsp.pdf b/doc/pdf/cutest_cchprodsp.pdf new file mode 100644 index 0000000..66e134f Binary files /dev/null and b/doc/pdf/cutest_cchprodsp.pdf differ diff --git a/doc/pdf/cutest_csgrp.pdf b/doc/pdf/cutest_csgrp.pdf new file mode 100644 index 0000000..9886fb4 Binary files /dev/null and b/doc/pdf/cutest_csgrp.pdf differ diff --git a/doc/pdf/cutest_csgrshp.pdf b/doc/pdf/cutest_csgrshp.pdf new file mode 100644 index 0000000..965d712 Binary files /dev/null and b/doc/pdf/cutest_csgrshp.pdf differ diff --git a/doc/pdf/cutest_cshp.pdf b/doc/pdf/cutest_cshp.pdf index 4bb7725..0ad3771 100644 Binary files a/doc/pdf/cutest_cshp.pdf and b/doc/pdf/cutest_cshp.pdf differ diff --git a/man/man3/cutest.3 b/man/man3/cutest.3 index 8808906..8f8c6ec 100644 --- a/man/man3/cutest.3 +++ b/man/man3/cutest.3 @@ -186,6 +186,10 @@ evaluate both the value and gradient of the objective function. .B cutest_cofsg \fP(unthreaded) and \fBcutest_cofsg_threaded \fP(threaded) evaluate both the value and sparse gradient of the objective function. .TP +.B cutest_csgrp \fP(both unthreaded and threaded) +evaluate the sparsity pattern of the gradients of the objective function +and constraints +.TP .B cutest_csgr \fP(unthreaded) and \fBcutest_csgr_threaded \fP(threaded) evaluate the sparse gradients of the objective function and constraints. .TP @@ -233,6 +237,10 @@ including the objective as a sparse matrix. evaluate the Hessian of the objective function or an individual constraint as a sparse matrix. .TP +.B cutest_csgrshp \fP(both unthreaded and threaded) +evaluate the sparsity pattern of the gradients of the objective function +and constraints and the Hessian of the Lagrangian function +.TP .B cutest_csgrsh \fP(unthreaded) and \fBcutest_csgrsh_threaded \fP(threaded) evaluate the constraint Jacobian and Hessian of the Lagrangian function as sparse matrices. @@ -266,6 +274,10 @@ evaluate the product of the constraint Jacobian or its transpose with a vector. evaluate the product of the constraint Jacobian or its transpose with a sparse vector. .TP +.B cutest_cchprodsp \fP(both unthreaded and threaded) +evaluate the sparsity pattern needed when computing the products of the +constraint Hessians with a vector. +.TP .B cutest_cchprods \fP(unthreaded) and \fBcutest_cchprods_threaded \fP(threaded) evaluate the products of the constraint Hessians with a vector. .TP diff --git a/man/man3/cutest_cchprods.3 b/man/man3/cutest_cchprods.3 index 454fd3d..db6f33a 100644 --- a/man/man3/cutest_cchprods.3 +++ b/man/man3/cutest_cchprods.3 @@ -9,7 +9,7 @@ CALL CUTEST_cchprods( status, n, m, goth, X, Y, VECTOR, lchp, CHP_val, CHP_ind, CHP_ptr ) .SH DESCRIPTION The CUTEST_cchprods subroutine forms the product of a vector with each of -the Hessian matrix of the constraint functions +the Hessian matrices of the constraint functions .EQ c(x) .EN diff --git a/man/man3/cutest_cchprodsp.3 b/man/man3/cutest_cchprodsp.3 new file mode 100644 index 0000000..9a43f1e --- /dev/null +++ b/man/man3/cutest_cchprodsp.3 @@ -0,0 +1,114 @@ +'\" e @(#)cutest_cchprodsp v1.5 03/2017; +.TH cutest_cchprodsp 3M "30 Mar 2017" "CUTEst user documentation" "CUTEst user documentation" +.SH NAME +CUTEST_cchprodsp \- CUTEst tool to detetrmine the sparsity structure used when +forming the matrix-vector products of a vector +with each of the Hessian matrices of the constraint functions. +.SH SYNOPSIS +.HP 1i +CALL CUTEST_cchprodsp( status, n, m, lchp, CHP_ind, CHP_ptr ) +.SH DESCRIPTION +The CUTEST_cchprodsp subroutine obtins the sparsity structure used when +forming the product of a vector with each of +the Hessian matrices of the constraint functions +.EQ +c(x) +.EN +corresponding to the problem decoded from a SIF file by the script +\fIsifdecoder\fP at the point +.EQ +x = +.EN +X. + +The problem under consideration +is to minimize or maximize an objective function +.EQ +f(x) +.EN +over all +.EQ +x +.EN +\(mo +.EQ +R sup n +.EN +subject to +general equations +.EQ +c sub i (x) ~=~ 0, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ 1 ,..., m sub E } ), +.EN +general inequalities +.EQ +c sub i sup l ~<=~ c sub i (x) ~<=~ c sub i sup u, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ m sub E + 1 ,..., m }), +.EN +and simple bounds +.EQ +x sup l ~<=~ x ~<=~ x sup u. +.EN +The objective function is group-partially separable +and all constraint functions are partially separable. +.LP +.SH ARGUMENTS +The arguments of CUTEST_cchprodsp are as follows: +.TP 5 +.B status \fP[out] - integer +the outputr status: 0 for a succesful call, 1 for an array +allocation/deallocation error, 2 for an array bound error, +3 for an evaluation error, +.TP +.B n \fP[in] - integer +the number of variables for the problem, +.TP +.B m \fP[in] - integer +the total number of general constraints, +.TP +.B lchp \fP[in] - integer +a variable that specifies the declared lengths of CHP_val and CHP_ind. +The precise length required may be found by calling \fICUTEST_cdimchp\fP prior +to \fICUTEST_cchprodsp\fP, +.TP +.B CHP_ind \fP[inout] - integer +an array that gives the indices of the nonzeros in the result obtained by +multiplying the constraint Hessians by VECTOR. The indices for the i-th +constraint are stored in CHP_ind(CHP_ptr(i):CHP_ptr(i+1)-1), and will +match the values stored in CHP_val from a cutest_cchprods(3M) call. +.TP +.B CHP_ptr \fP[inout] - integer +an array of length m+1 that gives pointers to the starting positions in +CHP_ind for the indices of the nonzeros for the product with each Hessian. +CHP_ptr(m+1)-1 gives the total space required by CHP_ind. +.LP +.SH AUTHORS +I. Bongartz, A.R. Conn, N.I.M. Gould, D. Orban and Ph.L. Toint +.SH "SEE ALSO" +\fICUTEst: a Constrained and Unconstrained Testing +Environment with safe threads for mathematical optimization\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + Computational Optimization and Applications \fB60\fP:3, pp.545-557, 2014. + +\fICUTEr (and SifDec): A Constrained and Unconstrained Testing +Environment, revisited\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + ACM TOMS, \fB29\fP:4, pp.373-394, 2003. + +\fICUTE: Constrained and Unconstrained Testing Environment\fP, + I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, + ACM TOMS, \fB21\fP:1, pp.123-160, 1995. + +cutest_cdimchp(3M), cutest_cchprods(3M), sifdecoder(1). diff --git a/man/man3/cutest_csgr.3 b/man/man3/cutest_csgr.3 index 2fdb314..453c505 100644 --- a/man/man3/cutest_csgr.3 +++ b/man/man3/cutest_csgr.3 @@ -5,7 +5,7 @@ CUTEST_csgr \- CUTEst tool to evaluate constraints gradients and gradient of objective/Lagrangian function. .SH SYNOPSIS .HP 1i -CALL CUTEST_csgr( status, n, m, X, Y, grlagf, +CALL CUTEST_csgr( status, n, m, X, Y, grlagf, nnzj, lj, J_val, J_var, J_fun ) .SH DESCRIPTION The CUTEST_csgr subroutine evaluates the gradients of the general @@ -16,14 +16,9 @@ l(x,y) = f(x) + y sup T c(x) corresponding to the problem decoded from a SIF file by the script \fIsifdecoder\fP at the point .EQ -(x,y) = +(x,y) = .EN (X,Y). -It also evaluates the Hessian matrix -of the Lagrangian function at -.EQ -(x,y). -.EN The gradients are stored in a sparse format. The problem under consideration @@ -66,14 +61,14 @@ and simple bounds .EQ x sup l ~<=~ x ~<=~ x sup u. .EN -The objective function is group-partially separable and +The objective function is group-partially separable and all constraint functions are partially separable. -.LP +.LP .SH ARGUMENTS The arguments of CUTEST_csgr are as follows .TP 5 .B status \fP[out] - integer -the outputr status: 0 for a succesful call, 1 for an array +the outputr status: 0 for a succesful call, 1 for an array allocation/deallocation error, 2 for an array bound error, 3 for an evaluation error, .TP @@ -122,7 +117,7 @@ j-th general constraint function. .SH AUTHORS I. Bongartz, A.R. Conn, N.I.M. Gould, D. Orban and Ph.L. Toint .SH "SEE ALSO" -\fICUTEst: a Constrained and Unconstrained Testing +\fICUTEst: a Constrained and Unconstrained Testing Environment with safe threads\fP, N.I.M. Gould, D. Orban and Ph.L. Toint, Computational Optimization and Applications \fB60\fP:3, pp.545-557, 2014. @@ -133,7 +128,7 @@ Environment, revisited\fP, ACM TOMS, \fB29\fP:4, pp.373-394, 2003. \fICUTE: Constrained and Unconstrained Testing Environment\fP, - I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, + I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, ACM TOMS, \fB21\fP:1, pp.123-160, 1995. cutest_ugr(3M), cutest_cgr(3M), sifdecoder(1). diff --git a/man/man3/cutest_csgrp.3 b/man/man3/cutest_csgrp.3 new file mode 100644 index 0000000..c510fd2 --- /dev/null +++ b/man/man3/cutest_csgrp.3 @@ -0,0 +1,106 @@ +'\" e @(#)cutest_csgrp v1.5 03/2017; +.TH cutest_csgrp 3M "30 Mar 2017" "CUTEst user documentation" "CUTEst user documentation" +.SH NAME +CUTEST_csgrp \- CUTEst tool to evaluate the sparsity pattern of the +constraints gradients and gradient of objective/Lagrangian function. +.SH SYNOPSIS +.HP 1i +CALL CUTEST_csgrp( status, n, nnzj, lj, J_var, J_fun ) +.SH DESCRIPTION +The CUTEST_csgrp subroutine evaluates sparsity pattern used when storing the +gradients of the general constraints and of either the objective function +or the Lagrangian function +.EQ +l(x,y) = f(x) + y sup T c(x) +.EN +corresponding to the problem decoded from a SIF file by the script +\fIsifdecoder\fP. + +The problem under consideration +is to minimize or maximize an objective function +.EQ +f(x) +.EN +over all +.EQ +x +.EN +\(mo +.EQ +R sup n +.EN +subject to +general equations +.EQ +c sub i (x) ~=~ 0, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ 1 ,..., m sub E } ), +.EN +general inequalities +.EQ +c sub i sup l ~<=~ c sub i (x) ~<=~ c sub i sup u, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ m sub E + 1 ,..., m }), +.EN +and simple bounds +.EQ +x sup l ~<=~ x ~<=~ x sup u. +.EN +The objective function is group-partially separable and +all constraint functions are partially separable. +.LP +.SH ARGUMENTS +The arguments of CUTEST_csgrp are as follows +.TP 5 +.B status \fP[out] - integer +the outputr status: 0 for a succesful call, 1 for an array +allocation/deallocation error, 2 for an array bound error, +3 for an evaluation error, +.TP +.B n \fP[in] - integer +the number of variables for the problem, +.TP +.B nnzj \fP[out] - integer +the number of nonzeros in J_var and J_fun, +.TP +.B lj \fP[in] - integer +the actual declared dimensions of J_var and J_fun, +.TP +.B J_var \fP[out] - integer +an array whose i-th component is the index of the variable with +respect to which the derivative is taken, +.TP +.B J_fun \fP[out] - integer +an array whose i-th component is the index of the problem function +whose derivative is taken. J_fun(i) = 0 indicates the +objective or Lagrangian function, while J_fun(i) = j > 0 indicates the +j-th general constraint function. +.LP +.SH AUTHORS +I. Bongartz, A.R. Conn, N.I.M. Gould, D. Orban and Ph.L. Toint +.SH "SEE ALSO" +\fICUTEst: a Constrained and Unconstrained Testing +Environment with safe threads\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + Computational Optimization and Applications \fB60\fP:3, pp.545-557, 2014. + +\fICUTEr (and SifDec): A Constrained and Unconstrained Testing +Environment, revisited\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + ACM TOMS, \fB29\fP:4, pp.373-394, 2003. + +\fICUTE: Constrained and Unconstrained Testing Environment\fP, + I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, + ACM TOMS, \fB21\fP:1, pp.123-160, 1995. + +cutest_csgr(3M), sifdecoder(1). diff --git a/man/man3/cutest_csgrshp.3 b/man/man3/cutest_csgrshp.3 new file mode 100644 index 0000000..9e953b2 --- /dev/null +++ b/man/man3/cutest_csgrshp.3 @@ -0,0 +1,123 @@ +'\" e @(#)cutest_csgrshp v1.5 03/2017; +.TH cutest_csgrshp 3M "30 Mar 2017" "CUTEst user documentation" "CUTEst user documentation" +.SH NAME +CUTEST_csgrshp \- CUTEst tool to evaluate the sparsity patterns of the +constraints gradients and gradient of objective/Lagrangian function, +and the Hessian of the Lagrangian. +.SH SYNOPSIS +.HP 1i +CALL CUTEST_csgrshp( status, n, nnzj, lj, J_var, J_fun, nnzh, lh, H_row, H_col ) +.SH DESCRIPTION +The CUTEST_csgrshp subroutine evaluates sparsity pattern used when storing the +gradients of the general constraints and of either the objective function +or the Lagrangian function +.EQ +l(x,y) = f(x) + y sup T c(x), +.EN +as well as the Hessian of the Lagrangian function, +corresponding to the problem decoded from a SIF file by the script +\fIsifdecoder\fP. + +The problem under consideration +is to minimize or maximize an objective function +.EQ +f(x) +.EN +over all +.EQ +x +.EN +\(mo +.EQ +R sup n +.EN +subject to +general equations +.EQ +c sub i (x) ~=~ 0, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ 1 ,..., m sub E } ), +.EN +general inequalities +.EQ +c sub i sup l ~<=~ c sub i (x) ~<=~ c sub i sup u, +.EN +.EQ +~(i +.EN +\(mo +.EQ +{ m sub E + 1 ,..., m }), +.EN +and simple bounds +.EQ +x sup l ~<=~ x ~<=~ x sup u. +.EN +The objective function is group-partially separable and +all constraint functions are partially separable. +.LP +.SH ARGUMENTS +The arguments of CUTEST_csgrshp are as follows +.TP 5 +.B status \fP[out] - integer +the outputr status: 0 for a succesful call, 1 for an array +allocation/deallocation error, 2 for an array bound error, +3 for an evaluation error, +.TP +.B n \fP[in] - integer +the number of variables for the problem, +.TP +.B nnzj \fP[out] - integer +the number of nonzeros in J_var and J_fun, +.TP +.B lj \fP[in] - integer +the actual declared dimensions of J_var and J_fun, +.TP +.B J_var \fP[out] - integer +an array whose i-th component is the index of the variable with +respect to which the derivative is taken, +.TP +.B J_fun \fP[out] - integer +an array whose i-th component is the index of the problem function +whose derivative is taken. J_fun(i) = 0 indicates the +objective or Lagrangian function, while J_fun(i) = j > 0 indicates the +j-th general constraint function. +.TP +.B nnzh \fP[out] - integer +the number of nonzeros in the Hessian matrix, +.TP +.B lh \fP[in] - integer +the actual declared dimensions of H_row and H_col, +.TP +.B H_row \fP[out] - integer +an array which gives the row indices of the nonzeros of the Hessian +matrix of the Lagrangian function; only the upper triangular part of the +Hessian is stored, and +.TP +.B H_col \fP[out] - integer +an array which gives the column indices of the nonzeros of the Hessian +matrix of the Lagrangian function corresponding to the row indices in H_row. +.LP +.SH AUTHORS +I. Bongartz, A.R. Conn, N.I.M. Gould, D. Orban and Ph.L. Toint +.SH "SEE ALSO" +\fICUTEst: a Constrained and Unconstrained Testing +Environment with safe threads\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + Computational Optimization and Applications \fB60\fP:3, pp.545-557, 2014. + +\fICUTEr (and SifDec): A Constrained and Unconstrained Testing +Environment, revisited\fP, + N.I.M. Gould, D. Orban and Ph.L. Toint, + ACM TOMS, \fB29\fP:4, pp.373-394, 2003. + +\fICUTE: Constrained and Unconstrained Testing Environment\fP, + I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, + ACM TOMS, \fB21\fP:1, pp.123-160, 1995. + +cutest_csgrsh(3M), sifdecoder(1). diff --git a/man/man3/cutest_cshp.3 b/man/man3/cutest_cshp.3 index 8a0df6e..887d1f2 100644 --- a/man/man3/cutest_cshp.3 +++ b/man/man3/cutest_cshp.3 @@ -1,18 +1,18 @@ '\" e @(#)cutest_cshp v1.0 04/2013; .TH cutest_cshp 3M "8 Apr 2013" "CUTEst user documentation" "CUTEst user documentation" .SH NAME -CUTEST_cshp \- CUTEst tool to evaluate the sparsity pattern of the Hessian +CUTEST_cshp \- CUTEst tool to evaluate the sparsity pattern of the Hessian of the Lagrangian function. .SH SYNOPSIS .HP 1i -CALL CUTEST_cshp( status, n, m, nnzh, lh, H_row, H_col ) +CALL CUTEST_cshp( status, n, nnzh, lh, H_row, H_col ) .SH DESCRIPTION -The CUTEST_cshp subroutine evaluates the sparsity pattern of the +The CUTEST_cshp subroutine evaluates the sparsity pattern of the Hessian of the Lagrangian function .EQ l(x,y) = f(x) + y sup T c(x) .EN -for the problem, decoded from a SIF file by the script \fIsifdecoder\fP, +for the problem, decoded from a SIF file by the script \fIsifdecoder\fP, in coordinate format. The problem under consideration @@ -55,23 +55,20 @@ and simple bounds .EQ x sup l ~<=~ x ~<=~ x sup u. .EN -The objective function is group-partially separable and +The objective function is group-partially separable and all constraint functions are partially separable. -.LP +.LP .SH ARGUMENTS The arguments of CUTEST_cshp are as follows .TP 5 .B status \fP[out] - integer -the outputr status: 0 for a succesful call, 1 for an array +the outputr status: 0 for a succesful call, 1 for an array allocation/deallocation error, 2 for an array bound error, 3 for an evaluation error, .TP .B n \fP[in] - integer the number of variables for the problem, .TP -.B m \fP[in] - integer -the total number of general constraints, -.TP .B nnzh \fP[out] - integer the number of nonzeros in the Hessian matrix, .TP @@ -80,7 +77,7 @@ the actual declared dimensions of H_row and H_col, .TP .B H_row \fP[out] - integer an array which gives the row indices of the nonzeros of the Hessian -matrix of the Lagrangian function; only the upper triangular part of the +matrix of the Lagrangian function; only the upper triangular part of the Hessian is stored, and .TP .B H_col \fP[out] - integer @@ -90,7 +87,7 @@ matrix of the Lagrangian function corresponding to the row indices in H_row. .SH AUTHORS I. Bongartz, A.R. Conn, N.I.M. Gould, D. Orban and Ph.L. Toint .SH "SEE ALSO" -\fICUTEst: a Constrained and Unconstrained Testing +\fICUTEst: a Constrained and Unconstrained Testing Environment with safe threads\fP, N.I.M. Gould, D. Orban and Ph.L. Toint, Computational Optimization and Applications \fB60\fP:3, pp.545-557, 2014. @@ -101,7 +98,7 @@ Environment, revisited\fP, ACM TOMS, \fB29\fP:4, pp.373-394, 2003. \fICUTE: Constrained and Unconstrained Testing Environment\fP, - I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, + I. Bongartz, A.R. Conn, N.I.M. Gould and Ph.L. Toint, ACM TOMS, \fB21\fP:1, pp.123-160, 1995. cutest_ush(3M), sifdecoder(1). diff --git a/man/man3/makedocs b/man/man3/makedocs index 5b3a657..5c5acc6 100755 --- a/man/man3/makedocs +++ b/man/man3/makedocs @@ -1,49 +1,52 @@ #!/bin/csh -foreach pack ( cutest_ccfg cutest_ccfsg cutest_ccifg cutest_ccifsg cutest_cdh \ - cutest_cdhc \ - cutest_cdimen cutest_cdimse cutest_cdimsh cutest_cdimsj \ - cutest_ceh cutest_cfn cutest_cgr cutest_cgrdh cutest_chcprod \ - cutest_chprod cutest_cidh cutest_cish cutest_cjprod \ - cutest_cnames cutest_cofg cutest_cofsg cutest_clfg \ - cutest_cifn cutest_cigr cutest_cisgr \ - cutest_connames cutest_creport cutest_cshp \ - cutest_csetup cutest_cstats cutest_csetup cutest_csgr \ - cutest_csgreh cutest_csgrsh cutest_csh cutest_cshc \ - cutest_cvartype cutest_probname cutest_ubandh cutest_udh \ - cutest_udimen cutest_udimse cutest_udimsh \ - cutest_ueh cutest_ushp cutest_pname \ - cutest_ufn cutest_ugr cutest_ugrdh cutest_ugreh cutest_ugrsh \ - cutest_uhprod cutest_unames cutest_uofg cutest_ureport \ - cutest_ushprod cutest_cshprod cutest_cshcprod cutest_csjprod \ - cutest_usetup cutest_ush cutest_uvartype cutest_varnames \ - cutest_ccfg_threaded cutest_ccfsg_threaded \ - cutest_ccifg_threaded cutest_ccifsg_threaded \ - cutest_cdh_threaded \ - cutest_cdhc_threaded cutest_ceh_threaded \ - cutest_cfn_threaded cutest_cgr_threaded \ - cutest_cgrdh_threaded cutest_chcprod_threaded \ - cutest_chprod_threaded cutest_cidh_threaded \ - cutest_cish_threaded cutest_cjprod_threaded \ - cutest_cofg_threaded cutest_clfg_threaded \ - cutest_cifn_threaded cutest_cigr_threaded \ - cutest_cisgr_threaded \ - cutest_cofsg_threaded cutest_creport_threaded \ - cutest_csetup_threaded cutest_csgr_threaded \ - cutest_csgreh_threaded cutest_csgrsh_threaded \ - cutest_csh_threaded cutest_cshc_threaded \ - cutest_ubandh_threaded cutest_udh_threaded \ - cutest_ueh_threaded cutest_ufn_threaded \ - cutest_ugr_threaded cutest_ugrdh_threaded \ - cutest_ugreh_threaded cutest_ugrsh_threaded \ - cutest_uhprod_threaded cutest_uofg_threaded \ - cutest_ureport_threaded cutest_usetup_threaded \ - cutest_ush_threaded \ - cutest_ushprod_threaded cutest_cshprod_threaded \ - cutest_cshcprod_threaded cutest_csjprod_threaded \ - cutest_cdimchp cutest_cchprods cutest_cchprods_threaded \ - cutest_timings \ - cutest ) +#foreach pack ( cutest_ccfg cutest_ccfsg cutest_ccifg cutest_ccifsg cutest_cdh \ +# cutest_cdhc \ +# cutest_cdimen cutest_cdimse cutest_cdimsh cutest_cdimsj \ +# cutest_ceh cutest_cfn cutest_cgr cutest_cgrdh cutest_chcprod \ +# cutest_chprod cutest_cidh cutest_cish cutest_cjprod \ +# cutest_cnames cutest_cofg cutest_cofsg cutest_clfg \ +# cutest_cifn cutest_cigr cutest_cisgr \ +# cutest_connames cutest_creport cutest_cshp \ +# cutest_csgrp cutest_csgrshp cutest_cchprodsp \ +# cutest_csetup cutest_cstats cutest_csetup cutest_csgr \ +# cutest_csgreh cutest_csgrsh cutest_csh cutest_cshc \ +# cutest_cvartype cutest_probname cutest_ubandh cutest_udh \ +# cutest_udimen cutest_udimse cutest_udimsh \ +# cutest_ueh cutest_ushp cutest_pname \ +# cutest_ufn cutest_ugr cutest_ugrdh cutest_ugreh cutest_ugrsh \ +# cutest_uhprod cutest_unames cutest_uofg cutest_ureport \ +# cutest_ushprod cutest_cshprod cutest_cshcprod cutest_csjprod \ +# cutest_usetup cutest_ush cutest_uvartype cutest_varnames \ +# cutest_ccfg_threaded cutest_ccfsg_threaded \ +# cutest_ccifg_threaded cutest_ccifsg_threaded \ +# cutest_cdh_threaded \ +# cutest_cdhc_threaded cutest_ceh_threaded \ +# cutest_cfn_threaded cutest_cgr_threaded \ +# cutest_cgrdh_threaded cutest_chcprod_threaded \ +# cutest_chprod_threaded cutest_cidh_threaded \ +# cutest_cish_threaded cutest_cjprod_threaded \ +# cutest_cofg_threaded cutest_clfg_threaded \ +# cutest_cifn_threaded cutest_cigr_threaded \ +# cutest_cisgr_threaded \ +# cutest_cofsg_threaded cutest_creport_threaded \ +# cutest_csetup_threaded cutest_csgr_threaded \ +# cutest_csgreh_threaded cutest_csgrsh_threaded \ +# cutest_csh_threaded cutest_cshc_threaded \ +# cutest_ubandh_threaded cutest_udh_threaded \ +# cutest_ueh_threaded cutest_ufn_threaded \ +# cutest_ugr_threaded cutest_ugrdh_threaded \ +# cutest_ugreh_threaded cutest_ugrsh_threaded \ +# cutest_uhprod_threaded cutest_uofg_threaded \ +# cutest_ureport_threaded cutest_usetup_threaded \ +# cutest_ush_threaded \ +# cutest_ushprod_threaded cutest_cshprod_threaded \ +# cutest_cshcprod_threaded cutest_csjprod_threaded \ +# cutest_cdimchp cutest_cchprods cutest_cchprods_threaded \ +# cutest_timings \ +# cutest ) + +foreach pack ( cutest_cshp cutest_csgrp cutest_csgrshp cutest_cchprodsp cutest ) #foreach pack ( cutest_cdimchp cutest_cchprods cutest_cchprods_threaded ) #foreach pack ( cutest_timings cutest_timings_threaded ) diff --git a/src/test/ctest.f90 b/src/test/ctest.f90 index 648f044..f1114e3 100644 --- a/src/test/ctest.f90 +++ b/src/test/ctest.f90 @@ -251,6 +251,13 @@ PROGRAM CUTEST_test_constrained_tools ALLOCATE( J_val( l_j ), J_fun( l_j ), J_var( l_j ), stat = alloc_stat ) IF ( alloc_stat /= 0 ) GO TO 990 +! compute the sparsity pattern of the Jacobian + + WRITE( out, "( ' Call CUTEST_csgrp' )" ) + CALL CUTEST_csgrp( status, n, J_ne, l_j, J_var, J_fun ) + IF ( status /= 0 ) GO TO 900 + CALL WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + ! compute the gradient and sparse Jacobian values grlagf = .TRUE. @@ -486,6 +493,15 @@ PROGRAM CUTEST_test_constrained_tools IF ( status /= 0 ) GO TO 900 CALL WRITE_H_sparse( out, H_ne, l_h, H_val, H_row, H_col ) +! compute the sparsity pattern of the gradients and Hessian + + WRITE( out, "( ' Call CUTEST_csgrshp' )" ) + CALL CUTEST_csgrshp( status, n, J_ne, l_j, J_var, J_fun, & + H_ne, l_h, H_row, H_col ) + IF ( status /= 0 ) GO TO 900 + CALL WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + CALL WRITE_H_sparsity_pattern( out, H_ne, l_h, H_row, H_col ) + ! compute the gradient and sparse Hessian values grlagf = .TRUE. @@ -710,6 +726,13 @@ PROGRAM CUTEST_test_constrained_tools stat = alloc_stat ) IF ( alloc_stat /= 0 ) GO TO 990 +! compute the sparsity pattern needed for the matrix-vector products between +! each constraint Hessian and a vector + + WRITE( out, "( ' Call CUTEST_cchprodsp' )" ) + CALL CUTEST_cchprodsp( status, m, l_chp, CHP_ind, CHP_ptr ) + CALL WRITE_CHP_sparsity( out, m, l_chp, CHP_ind, CHP_ptr ) + ! compute the matrix-vector products between each constraint Hessian and a ! vector @@ -1041,6 +1064,22 @@ SUBROUTINE WRITE_H_sparse( out, H_ne, l_h, H_val, H_row, H_col ) END DO END SUBROUTINE WRITE_H_sparse + SUBROUTINE WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + INTEGER :: l_j, J_ne, out + INTEGER, DIMENSION( l_j ) :: J_fun, J_var + INTEGER :: i + WRITE( out, "( ' * J(sparse)' )" ) + WRITE( out, "( ' * ', 2( ' fun var' ) )" ) + DO i = 1, J_ne, 2 + IF ( i + 1 <= J_ne ) THEN + WRITE( out, "( ' * ', 2( 2I7 ) )" ) & + J_fun( i ), J_var( i ), J_fun( i + 1 ), J_var( i + 1 ) + ELSE + WRITE( out, "( ' * ', 2( 2I7 ) )" ) J_fun( i ), J_var( i ) + END IF + END DO + END SUBROUTINE WRITE_J_sparsity_pattern + SUBROUTINE WRITE_J_sparse( out, J_ne, l_j, J_val, J_fun, J_var ) INTEGER :: l_j, J_ne, out INTEGER, DIMENSION( l_j ) :: J_fun, J_var @@ -1151,6 +1190,24 @@ SUBROUTINE WRITE_SRESULT2( out, nnz_vector, INDEX_nz_vector, VECTOR, & END DO END SUBROUTINE WRITE_SRESULT2 + SUBROUTINE WRITE_CHP_sparsity( out, m, l_chp, CHP_ind, CHP_ptr ) + INTEGER :: m, l_chp, out + INTEGER, DIMENSION( m + 1 ) :: CHP_ptr + INTEGER, DIMENSION( l_chp ) :: CHP_ind + INTEGER :: i + WRITE( out, "( ' * CH(product_sparsity)' )" ) + DO i = 1, m + IF ( CHP_ptr( i + 1 ) > CHP_ptr( i ) ) THEN + WRITE( out, "( ' * constraint Hessian ', I0 )" ) i + WRITE( out, "( ' * product indices ', 5I12, /, & + & ( ' *', 17X, 5I12 ) )" ) & + CHP_ind( CHP_ptr( i ) : CHP_ptr( i + 1 ) - 1 ) + ELSE + WRITE( out, "( ' * no Hessian indices for constraint ', I0 )" ) i + END IF + END DO + END SUBROUTINE WRITE_CHP_sparsity + SUBROUTINE WRITE_CHP( out, m, l_chp, CHP_val, CHP_ind, CHP_ptr ) INTEGER :: m, l_chp, out INTEGER, DIMENSION( m + 1 ) :: CHP_ptr diff --git a/src/test/ctest_threaded.f90 b/src/test/ctest_threaded.f90 index 0b95699..8e4a556 100644 --- a/src/test/ctest_threaded.f90 +++ b/src/test/ctest_threaded.f90 @@ -254,6 +254,13 @@ PROGRAM CUTEST_test_constrained_tools ALLOCATE( J_val( l_j ), J_fun( l_j ), J_var( l_j ), stat = alloc_stat ) IF ( alloc_stat /= 0 ) GO TO 990 +! compute the sparsity pattern of the Jacobian + + WRITE( out, "( ' Call CUTEST_csgrp' )" ) + CALL CUTEST_csgrp( status, n, J_ne, l_j, J_var, J_fun ) + IF ( status /= 0 ) GO TO 900 + CALL WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + ! compute the gradient and sparse Jacobian values grlagf = .TRUE. @@ -490,6 +497,15 @@ PROGRAM CUTEST_test_constrained_tools IF ( status /= 0 ) GO to 900 CALL WRITE_H_sparse( out, H_ne, l_h, H_val, H_row, H_col ) +! compute the sparsity pattern of the gradients and Hessian + + WRITE( out, "( ' Call CUTEST_csgrshp' )" ) + CALL CUTEST_csgrshp( status, n, J_ne, l_j, J_var, J_fun, & + H_ne, l_h, H_row, H_col ) + IF ( status /= 0 ) GO TO 900 + CALL WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + CALL WRITE_H_sparsity_pattern( out, H_ne, l_h, H_row, H_col ) + ! compute the gradient and sparse Hessian values grlagf = .TRUE. @@ -729,6 +745,13 @@ PROGRAM CUTEST_test_constrained_tools stat = alloc_stat ) IF ( alloc_stat /= 0 ) GO TO 990 +! compute the sparsity pattern needed for the matrix-vector products between +! each constraint Hessian and a vector + + WRITE( out, "( ' Call CUTEST_cchprodsp' )" ) + CALL CUTEST_cchprodsp( status, m, l_chp, CHP_ind, CHP_ptr ) + CALL WRITE_CHP_sparsity( out, m, l_chp, CHP_ind, CHP_ptr ) + ! compute the matrix-vector products between each constraint Hessian and a ! vector @@ -1052,6 +1075,22 @@ SUBROUTINE WRITE_H_sparse( out, H_ne, l_h, H_val, H_row, H_col ) END DO END SUBROUTINE WRITE_H_sparse + SUBROUTINE WRITE_J_sparsity_pattern( out, J_ne, l_j, J_fun, J_var ) + INTEGER :: l_j, J_ne, out + INTEGER, DIMENSION( l_j ) :: J_fun, J_var + INTEGER :: i + WRITE( out, "( ' * J(sparse)' )" ) + WRITE( out, "( ' * ', 2( ' fun var' ) )" ) + DO i = 1, J_ne, 2 + IF ( i + 1 <= J_ne ) THEN + WRITE( out, "( ' * ', 2( 2I7 ) )" ) & + J_fun( i ), J_var( i ), J_fun( i + 1 ), J_var( i + 1 ) + ELSE + WRITE( out, "( ' * ', 2( 2I7 ) )" ) J_fun( i ), J_var( i ) + END IF + END DO + END SUBROUTINE WRITE_J_sparsity_pattern + SUBROUTINE WRITE_J_sparse( out, J_ne, l_j, J_val, J_fun, J_var ) INTEGER :: l_j, J_ne, out INTEGER, DIMENSION( l_j ) :: J_fun, J_var @@ -1162,6 +1201,24 @@ SUBROUTINE WRITE_SRESULT2( out, nnz_vector, INDEX_nz_vector, VECTOR, & END DO END SUBROUTINE WRITE_SRESULT2 + SUBROUTINE WRITE_CHP_sparsity( out, m, l_chp, CHP_ind, CHP_ptr ) + INTEGER :: m, l_chp, out + INTEGER, DIMENSION( m + 1 ) :: CHP_ptr + INTEGER, DIMENSION( l_chp ) :: CHP_ind + INTEGER :: i + WRITE( out, "( ' * CH(product_sparsity)' )" ) + DO i = 1, m + IF ( CHP_ptr( i + 1 ) > CHP_ptr( i ) ) THEN + WRITE( out, "( ' * constraint Hessian ', I0 )" ) i + WRITE( out, "( ' * product indices ', 5I12, /, & + & ( ' *', 17X, 5I12 ) )" ) & + CHP_ind( CHP_ptr( i ) : CHP_ptr( i + 1 ) - 1 ) + ELSE + WRITE( out, "( ' * no Hessian indices for constraint ', I0 )" ) i + END IF + END DO + END SUBROUTINE WRITE_CHP_sparsity + SUBROUTINE WRITE_CHP( out, m, l_chp, CHP_val, CHP_ind, CHP_ptr ) INTEGER :: m, l_chp, out INTEGER, DIMENSION( m + 1 ) :: CHP_ptr diff --git a/src/tools/cchprodsp.f90 b/src/tools/cchprodsp.f90 new file mode 100644 index 0000000..de119c5 --- /dev/null +++ b/src/tools/cchprodsp.f90 @@ -0,0 +1,103 @@ +! THIS VERSION: CUTEST 1.5 - 29/03/2017 AT 14:15 GMT. + +!-*-*-*-*-*- C U T E S T C C H P R O D S P S U B R O U T I N E -*-*-*-*- + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal author: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29 March 2017 + + SUBROUTINE CUTEST_cchprodsp( status, m, lchp, CHP_ind, CHP_ptr ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + INTEGER, INTENT( IN ) :: m, lchp + INTEGER, INTENT( OUT ) :: status + INTEGER, INTENT( INOUT ), DIMENSION( m + 1 ) :: CHP_ptr + INTEGER, INTENT( INOUT ), DIMENSION( lchp ) :: CHP_ind + +! ---------------------------------------------------------------------------- +! determine the integer storage arrays needed when computing the matrix-vector +! products H_i(x) v, i = 1, ..., m, between each of the Hessian matrices +! H_i(x) of the constraint functions for the problem and a given vector v. +! The indices of the nonzero entries of the resulting products H_i(x) v +! occur in CHP_ind), k = CHP_ptr(i),..., CHP_ptr(i+1)-1, i = 1, ..., m. +! ---------------------------------------------------------------------------- + + CALL CUTEST_cchprodsp_threadsafe( CUTEST_data_global, & + CUTEST_work_global( 1 ), & + status, m, lchp, CHP_ind, CHP_ptr ) + RETURN + +! end of subroutine CUTEST_cchprodsp + + END SUBROUTINE CUTEST_cchprodsp + +!- C U T E S T C C H P R O D S P _ t h r e a d s a f e S U B R O U T I N E - + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal authors: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29 March 2017 + + SUBROUTINE CUTEST_cchprodsp_threadsafe( data, work, status, m, & + lchp, CHP_ind, CHP_ptr ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + TYPE ( CUTEST_data_type ), INTENT( IN ) :: data + TYPE ( CUTEST_work_type ), INTENT( INOUT ) :: work + INTEGER, INTENT( IN ) :: m, lchp + INTEGER, INTENT( OUT ) :: status + INTEGER, INTENT( INOUT ), DIMENSION( m + 1 ) :: CHP_ptr + INTEGER, INTENT( INOUT ), DIMENSION( lchp ) :: CHP_ind + +! ---------------------------------------------------------------------------- +! determine the integer storage arrays needed when computing the matrix-vector +! products H_i(x) v, i = 1, ..., m, between each of the Hessian matrices +! H_i(x) of the constraint functions for the problem and a given vector v. +! The indices of the nonzero entries of the resulting products H_i(x) v +! occur in CHP_ind), k = CHP_ptr(i),..., CHP_ptr(i+1)-1, i = 1, ..., m. +! ---------------------------------------------------------------------------- + +! local variables + + INTEGER :: i, ic, ig, ls + REAL ( KIND = wp ) :: time_in, time_out + + IF ( work%record_times ) CALL CPU_TIME( time_in ) + +! set the indices for the nonzeros for each constraint Hessian product in turn + + ls = 1 + DO ic = 1, m + ig = data%CGROUP( ic ) + CHP_ptr( ic ) = ls + DO k = data%ISTAGV( ig ), data%ISTAGV( ig + 1 ) - 1 + CHP_ind( ls ) = data%ISVGRP( k ) + ls = ls + 1 + END DO + END DO + CHP_ptr( m + 1 ) = ls + +! update elapsed CPU time if required + + IF ( work%record_times ) THEN + CALL CPU_TIME( time_out ) + work%time_cchprodsp = work%time_cchprodsp + time_out - time_in + END IF + status = 0 + + RETURN + +! end of subroutine CUTEST_cchprodsp_threadsafe + + END SUBROUTINE CUTEST_cchprodsp_threadsafe + + diff --git a/src/tools/csgrp.f90 b/src/tools/csgrp.f90 new file mode 100644 index 0000000..492a540 --- /dev/null +++ b/src/tools/csgrp.f90 @@ -0,0 +1,145 @@ +! THIS VERSION: CUTEST 1.5 - 29/03/2017 AT 14:15 GMT. + +!-*-*-*-*-*-*-*- C U T E S T C S G R P S U B R O U T I N E -*-*-*-*-*-*- + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal author: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29th March 2017 + + SUBROUTINE CUTEST_csgrp( status, n, nnzj, lj, J_var, J_fun ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + INTEGER, INTENT( IN ) :: n, lj + INTEGER, INTENT( OUT ) :: nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + +! ---------------------------------------------------------------------- +! compute the spasity pattern of the gradients of the objective function +! and general constraints of a group partially separable function. + +! The gradients are stored as a sparse matrix in coordinate form. +! The i-th entry of this matrix represents the derivative of +! function J_fun(i) with respect to variable J_var(i) for +! i = 1,...,nnzj, where function 0 is the objective function, +! and function j>0 is the jth constraint +! ---------------------------------------------------------------------- + + CALL CUTEST_csgrp_threadsafe( CUTEST_data_global, & + CUTEST_work_global( 1 ), & + status, n, nnzj, lj, J_var, J_fun ) + RETURN + +! end of subroutine CUTEST_csgrp + + END SUBROUTINE CUTEST_csgrp + + +!-*-*- C U T E S T C S G R P _ t h r e a d s a f e S U B R O U T I N E -*- + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal author: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29th March 2017 + + SUBROUTINE CUTEST_csgrp_threadsafe( data, work, status, n, & + nnzj, lj, J_var, J_fun ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + TYPE ( CUTEST_data_type ), INTENT( IN ) :: data + TYPE ( CUTEST_work_type ), INTENT( INOUT ) :: work + INTEGER, INTENT( IN ) :: n, lj + INTEGER, INTENT( OUT ) :: nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + +! ---------------------------------------------------------------------- +! compute the spasity pattern of the gradients of the objective function +! and general constraints of a group partially separable function. + +! The gradients are stored as a sparse matrix in coordinate form. +! The i-th entry of this matrix represents the derivative of +! function J_fun(i) with respect to variable J_var(i) for +! i = 1,...,nnzj, where function 0 is the objective function, +! and function j>0 is the jth constraint +! ---------------------------------------------------------------------- + +! local variables + + INTEGER :: i, j, ig, ig1, icon, alloc_status + INTEGER :: nin, nvarel, istrgv + CHARACTER ( LEN = 80 ) :: bad_alloc = REPEAT( ' ', 80 ) + REAL ( KIND = wp ) :: time_in, time_out + + IF ( work%record_times ) CALL CPU_TIME( time_in ) + +! determine the Jacobian pattern + + nnzj = 0 + +! consider the ig-th group + + IF ( data%numcon > 0 ) THEN + DO ig = 1, data%ng + icon = data%KNDOFC( ig ) + +! the group defines a constraint + + IF ( icon /= 0 ) THEN + DO i = data%ISTAGV( ig ), data%ISTAGV( ig + 1 ) - 1 + nnzj = nnzj + 1 + IF ( nnzj <= lj ) THEN + J_fun( nnzj ) = icon + J_var( nnzj ) = data%ISVGRP( i ) + END IF + END DO + END IF + END DO + END IF + +! transfer the gradient of the objective function to the sparse storage scheme + + DO i = 1, n + nnzj = nnzj + 1 + IF ( nnzj <= lj ) THEN + J_fun( nnzj ) = 0 + J_var( nnzj ) = i + END IF + END DO + +! exit if the space provided was insufficient + + IF ( nnzj > lj ) THEN + IF ( data%out > 0 ) WRITE( data%out, & + "( /, ' ** SUBROUTINE CSGRP: array length lj too small.', & + & /, ' -- Increase the parameter lj to at least ', I0 )" ) nnzj + status = 2 ; GO TO 990 + END IF + + work%firstg = .FALSE. + +! update the counters for the report tool + + work%nc2og = work%nc2og + 1 + work%nc2cg = work%nc2cg + work%pnc + status = 0 + +! update elapsed CPU time if required + + 990 CONTINUE + IF ( work%record_times ) THEN + CALL CPU_TIME( time_out ) + work%time_csgrp = work%time_csgrp + time_out - time_in + END IF + RETURN + +! end of subroutine CUTEST_csgrp_threadsafe + + END SUBROUTINE CUTEST_csgrp_threadsafe diff --git a/src/tools/csgrsh.f90 b/src/tools/csgrsh.f90 index d31e2f6..9ef5f6e 100644 --- a/src/tools/csgrsh.f90 +++ b/src/tools/csgrsh.f90 @@ -28,8 +28,9 @@ SUBROUTINE CUTEST_Cint_csgrsh( status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lj ) :: J_val ! ---------------------------------------------------------------- -! compute the Hessian matrix of the Lagrangian function of -! a problem initially written in Standard Input Format (SIF). +! compute the gradients of the objective function and general +! constraints of a function initially written in Standard +! Input Format (SIF). The gradients are given in a sparse format. ! Also compute the Hessian matrix of the Lagrangian function of ! the problem @@ -43,10 +44,10 @@ SUBROUTINE CUTEST_Cint_csgrsh( status, n, m, X, Y, grlagf, & ! J_fun(i) = j > 0 indicates the j-th general constraint ! function -! H is an array which gives the values of entries of the +! H_val is an array which gives the values of entries of the ! upper triangular part of the Hessian matrix of the ! Lagrangian function, stored in coordinate form, i.e., -! the entry H(i) is the derivative with respect to variables +! the entry H_val(i) is the derivative with respect to variables ! with indices H_row(i) and H_col(i) for i = 1, ...., nnzh ! ---------------------------------------------------------------- @@ -90,8 +91,9 @@ SUBROUTINE CUTEST_csgrsh( status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lj ) :: J_val ! ---------------------------------------------------------------- -! compute the Hessian matrix of the Lagrangian function of -! a problem initially written in Standard Input Format (SIF). +! compute the gradients of the objective function and general +! constraints of a function initially written in Standard +! Input Format (SIF). The gradients are given in a sparse format. ! Also compute the Hessian matrix of the Lagrangian function of ! the problem @@ -105,10 +107,10 @@ SUBROUTINE CUTEST_csgrsh( status, n, m, X, Y, grlagf, & ! J_fun(i) = j > 0 indicates the j-th general constraint ! function -! H is an array which gives the values of entries of the +! H_val is an array which gives the values of entries of the ! upper triangular part of the Hessian matrix of the ! Lagrangian function, stored in coordinate form, i.e., -! the entry H(i) is the derivative with respect to variables +! the entry H_val(i) is the derivative with respect to variables ! with indices H_row(i) and H_col(i) for i = 1, ...., nnzh ! ---------------------------------------------------------------- @@ -150,8 +152,9 @@ SUBROUTINE CUTEST_csgrsh_threaded( status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lj ) :: J_val ! ---------------------------------------------------------------- -! compute the Hessian matrix of the Lagrangian function of -! a problem initially written in Standard Input Format (SIF). +! compute the gradients of the objective function and general +! constraints of a function initially written in Standard +! Input Format (SIF). The gradients are given in a sparse format. ! Also compute the Hessian matrix of the Lagrangian function of ! the problem @@ -165,10 +168,10 @@ SUBROUTINE CUTEST_csgrsh_threaded( status, n, m, X, Y, grlagf, & ! J_fun(i) = j > 0 indicates the j-th general constraint ! function -! H is an array which gives the values of entries of the +! H_val is an array which gives the values of entries of the ! upper triangular part of the Hessian matrix of the ! Lagrangian function, stored in coordinate form, i.e., -! the entry H(i) is the derivative with respect to variables +! the entry H_val(i) is the derivative with respect to variables ! with indices H_row(i) and H_col(i) for i = 1, ...., nnzh ! ---------------------------------------------------------------- @@ -225,8 +228,9 @@ SUBROUTINE CUTEST_csgrsh_threadsafe( data, work, status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lj ) :: J_val ! ---------------------------------------------------------------- -! compute the Hessian matrix of the Lagrangian function of -! a problem initially written in Standard Input Format (SIF). +! compute the gradients of the objective function and general +! constraints of a function initially written in Standard +! Input Format (SIF). The gradients are given in a sparse format. ! Also compute the Hessian matrix of the Lagrangian function of ! the problem @@ -240,10 +244,10 @@ SUBROUTINE CUTEST_csgrsh_threadsafe( data, work, status, n, m, X, Y, & ! J_fun(i) = j > 0 indicates the j-th general constraint ! function -! H is an array which gives the values of entries of the +! H_val is an array which gives the values of entries of the ! upper triangular part of the Hessian matrix of the ! Lagrangian function, stored in coordinate form, i.e., -! the entry H(i) is the derivative with respect to variables +! the entry H_val(i) is the derivative with respect to variables ! with indices H_row(i) and H_col(i) for i = 1, ...., nnzh ! ---------------------------------------------------------------- @@ -268,6 +272,7 @@ SUBROUTINE CUTEST_csgrsh_threadsafe( data, work, status, n, m, X, Y, & ! evaluate the element function values +write(6,*) 'in a' CALL ELFUN( work%FUVALS, X, data%EPVALU, data%nel, data%ITYPEE, & data%ISTAEV, data%IELVAR, data%INTVAR, data%ISTADH, & data%ISTEP, work%ICALCF, data%ltypee, data%lstaev, & @@ -275,6 +280,7 @@ SUBROUTINE CUTEST_csgrsh_threadsafe( data, work, status, n, m, X, Y, & data%lcalcf, data%lfuval, data%lvscal, data%lepvlu, & 1, ifstat ) IF ( ifstat /= 0 ) GO TO 930 +write(6,*) 'out a' ! evaluate the element function gradient and Hessian values diff --git a/src/tools/csgrshp.f90 b/src/tools/csgrshp.f90 new file mode 100644 index 0000000..1b59a5c --- /dev/null +++ b/src/tools/csgrshp.f90 @@ -0,0 +1,175 @@ +! THIS VERSION: CUTEST 1.5 - 29/03/2017 AT 14:15 GMT. + +!-*-*-*-*-*-*- C U T E S T C S G R S H P S U B R O U T I N E -*-*-*-*-*- + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal author: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29th March 2017 + + SUBROUTINE CUTEST_csgrshp( status, n, nnzj, lj, J_var, J_fun, & + nnzh, lh, H_row, H_col ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + INTEGER, INTENT( IN ) :: n, lj, lh + INTEGER, INTENT( OUT ) :: nnzh, nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + INTEGER, INTENT( OUT ), DIMENSION( lh ) :: H_row, H_col + +! ------------------------------------------------------------------------ +! compute the spasity pattern of the gradients of the objective function +! and general constraints and the Hessian matrix of the associated +! Lagrangian function of a group partially separable function. + +! The gradients are stored as a sparse matrix in coordinate form. +! The i-th entry of this matrix represents the derivative of +! function J_fun(i) with respect to variable J_var(i) for +! i = 1, ..., nnzj, where function 0 is the objective function, and +! function j>0 is the jth constraint. The upper triangle of the Hessian +! is stored in coordinate form, i.e., the entry has row index +! H_row(i) and column index H_col(i) for i = 1, ...., nnzh +! ----------------------------------------------------------------------- + + CALL CUTEST_csgrshp_threadsafe( CUTEST_data_global, & + CUTEST_work_global( 1 ), & + status, n, nnzj, lj, J_var, J_fun, & + nnzh, lh, H_row, H_col ) + RETURN + +! end of subroutine CUTEST_csgrshp + + END SUBROUTINE CUTEST_csgrshp + +!-*- C U T E S T C S G R S H P _ t h r e a d s a f e S U B R O U T I N E - + +! Copyright reserved, Gould/Orban/Toint, for GALAHAD productions +! Principal author: Nick Gould + +! History - +! fortran 2003 version released in CUTEst, 29th March 2017 + + SUBROUTINE CUTEST_csgrshp_threadsafe( data, work, status, n, & + nnzj, lj, J_var, J_fun, & + nnzh, lh, H_row, H_col ) + USE CUTEST + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + +! dummy arguments + + TYPE ( CUTEST_data_type ), INTENT( IN ) :: data + TYPE ( CUTEST_work_type ), INTENT( INOUT ) :: work + INTEGER, INTENT( IN ) :: n, lj, lh + INTEGER, INTENT( OUT ) :: nnzh, nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + INTEGER, INTENT( OUT ), DIMENSION( lh ) :: H_row, H_col + +! ------------------------------------------------------------------------ +! compute the spasity pattern of the gradients of the objective function +! and general constraints and the Hessian matrix of the associated +! Lagrangian function of a group partially separable function. + +! The gradients are stored as a sparse matrix in coordinate form. +! The i-th entry of this matrix represents the derivative of +! function J_fun(i) with respect to variable J_var(i) for +! i = 1, ..., nnzj, where function 0 is the objective function, and +! function j>0 is the jth constraint. The upper triangle of the Hessian +! is stored in coordinate form, i.e., the entry has row index +! H_row(i) and column index H_col(i) for i = 1, ...., nnzh +! ----------------------------------------------------------------------- + +! local variables + + INTEGER :: i, j, ig, ig1, icon, alloc_status + INTEGER :: nin, nvarel, istrgv + CHARACTER ( LEN = 80 ) :: bad_alloc = REPEAT( ' ', 80 ) + REAL ( KIND = wp ) :: time_in, time_out + + IF ( work%record_times ) CALL CPU_TIME( time_in ) + +! determine the Jacobian pattern + + nnzj = 0 + +! consider the ig-th group + + IF ( data%numcon > 0 ) THEN + DO ig = 1, data%ng + icon = data%KNDOFC( ig ) + +! the group defines a constraint + + IF ( icon /= 0 ) THEN + DO i = data%ISTAGV( ig ), data%ISTAGV( ig + 1 ) - 1 + nnzj = nnzj + 1 + IF ( nnzj <= lj ) THEN + J_fun( nnzj ) = icon + J_var( nnzj ) = data%ISVGRP( i ) + END IF + END DO + END IF + END DO + END IF + +! transfer the gradient of the objective function to the sparse storage scheme + + DO i = 1, n + nnzj = nnzj + 1 + IF ( nnzj <= lj ) THEN + J_fun( nnzj ) = 0 + J_var( nnzj ) = i + END IF + END DO + +! exit if the space provided was insufficient + + IF ( nnzj > lj ) THEN + IF ( data%out > 0 ) WRITE( data%out, & + "( /, ' ** SUBROUTINE CSGRSHP: array length lj too small.', & + & /, ' -- Increase the parameter lj to at least ', I0 )" ) nnzj + status = 2 ; GO TO 990 + END IF + + work%firstg = .FALSE. + +! determine the Hessian pattern + + CALL CUTEST_assemble_hessian_pattern( & + n, data%ng, data%nel, data%ntotel, data%nvrels, data%nvargp, & + data%IELVAR, data%IELING, data%ISTADG, & + data%ISTAEV, data%ISTAGV, data%ISVGRP, data%GXEQX, & + 0, data%out, data%out, status, alloc_status, bad_alloc, & + work%hessian_setup_complete, work%lh_row, work%lh_col, & + work%H_row, work%H_col, work%ROW_start, work%POS_in_H, work%USED, & + work%FILLED, work%lrowst, work%lpos, work%lused, work%lfilled, & + nnzh ) + +! record the pattern if it is available + + IF ( status == 0 ) THEN + H_row( : nnzh ) = work%H_row( : nnzh ) + H_col( : nnzh ) = work%H_col( : nnzh ) + +! update the counters for the report tool + + work%nc2cg = work%nc2cg + work%pnc + work%nc2og = work%nc2og + 1 + work%nc2oh = work%nc2oh + 1 + work%nc2ch = work%nc2ch + work%pnc + END IF + +! update elapsed CPU time if required + + 990 CONTINUE + IF ( work%record_times ) THEN + CALL CPU_TIME( time_out ) + work%time_csgrshp = work%time_csgrshp + time_out - time_in + END IF + RETURN + +! end of subroutine CUTEST_csgrshp_threadsafe + + END SUBROUTINE CUTEST_csgrshp_threadsafe diff --git a/src/tools/cshp.f90 b/src/tools/cshp.f90 index 4d6e660..84fc0e9 100644 --- a/src/tools/cshp.f90 +++ b/src/tools/cshp.f90 @@ -81,19 +81,17 @@ SUBROUTINE CUTEST_cshp_threadsafe( data, work, status, n, & work%FILLED, work%lrowst, work%lpos, work%lused, work%lfilled, & nnzh ) -! check for errors +! record the pattern if it is available - IF ( status > 0 ) GO TO 990 - -! record the sparse Hessian - - H_row( : nnzh ) = work%H_row( : nnzh ) - H_col( : nnzh ) = work%H_col( : nnzh ) + IF ( status == 0 ) THEN + H_row( : nnzh ) = work%H_row( : nnzh ) + H_col( : nnzh ) = work%H_col( : nnzh ) ! update the counters for the report tool - work%nc2oh = work%nc2oh + 1 - status = 0 + work%nc2oh = work%nc2oh + 1 + work%nc2ch = work%nc2ch + work%pnc + END IF ! update elapsed CPU time if required diff --git a/src/tools/cutest.f90 b/src/tools/cutest.f90 index 2f6bf37..50416cd 100644 --- a/src/tools/cutest.f90 +++ b/src/tools/cutest.f90 @@ -147,6 +147,7 @@ MODULE CUTEST REAL ( KIND = wp ) :: time_ccfsg = 0.0_wp REAL ( KIND = wp ) :: time_cch = 0.0_wp REAL ( KIND = wp ) :: time_cchprods = 0.0_wp + REAL ( KIND = wp ) :: time_cchprodsp = 0.0_wp REAL ( KIND = wp ) :: time_ccifg = 0.0_wp REAL ( KIND = wp ) :: time_ccifsg = 0.0_wp REAL ( KIND = wp ) :: time_cdh = 0.0_wp @@ -168,8 +169,10 @@ MODULE CUTEST REAL ( KIND = wp ) :: time_cofg = 0.0_wp REAL ( KIND = wp ) :: time_cofsg = 0.0_wp REAL ( KIND = wp ) :: time_csgr = 0.0_wp + REAL ( KIND = wp ) :: time_csgrp = 0.0_wp REAL ( KIND = wp ) :: time_csgreh = 0.0_wp REAL ( KIND = wp ) :: time_csgrsh = 0.0_wp + REAL ( KIND = wp ) :: time_csgrshp = 0.0_wp REAL ( KIND = wp ) :: time_csh = 0.0_wp REAL ( KIND = wp ) :: time_cshc = 0.0_wp REAL ( KIND = wp ) :: time_cshcprod = 0.0_wp diff --git a/src/tools/interface.f90 b/src/tools/interface.f90 index d0c1ee5..9851ac6 100644 --- a/src/tools/interface.f90 +++ b/src/tools/interface.f90 @@ -6,7 +6,7 @@ ! Principal author: Nick Gould ! History - -! November 10th 2000 (as a GALAHAD module) for CUTEr +! November 10th 2000 (as a GALAHAD module) for CUTEr ! February 6th 2013 for CUTEst MODULE CUTEst_interface_double @@ -36,7 +36,7 @@ SUBROUTINE CUTEST_udimen( cutest_status, input, n ) INTEGER, INTENT( IN ) :: input INTEGER, INTENT( OUT ) :: cutest_status, n END SUBROUTINE CUTEST_udimen - + SUBROUTINE CUTEST_usetup( cutest_status, input, out, io_buffer, & n, X, X_l, X_u ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -45,20 +45,20 @@ SUBROUTINE CUTEST_usetup( cutest_status, input, out, io_buffer, & INTEGER, INTENT( OUT ) :: cutest_status REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: X, X_l, X_u END SUBROUTINE CUTEST_usetup - + SUBROUTINE CUTEST_unames( cutest_status, n, p_name, X_names ) INTEGER, INTENT( IN ) :: n INTEGER, INTENT( OUT ) :: cutest_status CHARACTER ( LEN = 10 ), INTENT( OUT ) :: p_name CHARACTER ( LEN = 10 ), INTENT( OUT ), DIMENSION( n ) :: X_names END SUBROUTINE CUTEST_unames - + SUBROUTINE CUTEST_uvartype( cutest_status, n, X_type ) INTEGER, INTENT( IN ) :: n INTEGER, INTENT( OUT ) :: cutest_status INTEGER, INTENT( OUT ) :: X_type( n ) END SUBROUTINE CUTEST_uvartype - + SUBROUTINE CUTEST_ufn( cutest_status, n, X, f ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n @@ -66,7 +66,7 @@ SUBROUTINE CUTEST_ufn( cutest_status, n, X, f ) REAL ( KIND = wp ), INTENT( OUT ) :: f REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X END SUBROUTINE CUTEST_ufn - + SUBROUTINE CUTEST_ugr( cutest_status, n, X, G ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n @@ -74,7 +74,7 @@ SUBROUTINE CUTEST_ugr( cutest_status, n, X, G ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G END SUBROUTINE CUTEST_ugr - + SUBROUTINE CUTEST_uofg( cutest_status, n, X, f, G, grad ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n @@ -84,7 +84,7 @@ SUBROUTINE CUTEST_uofg( cutest_status, n, X, f, G, grad ) REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G LOGICAL, INTENT( IN ) :: grad END SUBROUTINE CUTEST_uofg - + SUBROUTINE CUTEST_udh( cutest_status, n, X, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, lh1 @@ -92,7 +92,7 @@ SUBROUTINE CUTEST_udh( cutest_status, n, X, lh1, H ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_udh - + SUBROUTINE CUTEST_ugrdh( cutest_status, n, X, G, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, lh1 @@ -101,17 +101,17 @@ SUBROUTINE CUTEST_ugrdh( cutest_status, n, X, G, lh1, H ) REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_ugrdh - + SUBROUTINE CUTEST_udimsh( cutest_status, nnzh ) INTEGER, INTENT( OUT ) :: cutest_status, nnzh END SUBROUTINE CUTEST_udimsh - + SUBROUTINE CUTEST_ushp( cutest_status, n, nnzh, lh, IRNH, ICNH ) INTEGER, INTENT( IN ) :: n, lh INTEGER, INTENT( OUT ) :: cutest_status, nnzh INTEGER, INTENT( OUT ), DIMENSION( lh ) :: IRNH, ICNH END SUBROUTINE CUTEST_ushp - + SUBROUTINE CUTEST_ush( cutest_status, n, X, nnzh, lh, H, IRNH, ICNH ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, lh @@ -120,7 +120,7 @@ SUBROUTINE CUTEST_ush( cutest_status, n, X, nnzh, lh, H, IRNH, ICNH ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_ush - + SUBROUTINE CUTEST_ugrsh( cutest_status, n, X, G, & nnzh, lh, H, IRNH, ICNH ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -131,15 +131,15 @@ SUBROUTINE CUTEST_ugrsh( cutest_status, n, X, G, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_ugrsh - + SUBROUTINE CUTEST_udimse( cutest_status, ne, nnzh, nzirnh ) INTEGER, INTENT( OUT ) :: cutest_status, ne, nnzh, nzirnh END SUBROUTINE CUTEST_udimse - + SUBROUTINE CUTEST_ueh( cutest_status, n, X, ne, le, IPRNHI, IPRHI, & lirnhi, IRNHI, lhi, Hi, byrows ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) - INTEGER, INTENT( IN ) :: n, le, lirnhi, lhi + INTEGER, INTENT( IN ) :: n, le, lirnhi, lhi INTEGER, INTENT( OUT ) :: cutest_status, ne LOGICAL, INTENT( IN ) :: byrows INTEGER, INTENT( OUT ), DIMENSION( lirnhi ) :: IRNHI @@ -147,11 +147,11 @@ SUBROUTINE CUTEST_ueh( cutest_status, n, X, ne, le, IPRNHI, IPRHI, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ueh - + SUBROUTINE CUTEST_ugreh( cutest_status, n, X, G, ne, le, IPRNHI, IPRHI, & lirnhi, IRNHI, lhi, Hi, byrows ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) - INTEGER, INTENT( IN ) :: n, le, lirnhi, lhi + INTEGER, INTENT( IN ) :: n, le, lirnhi, lhi INTEGER, INTENT( OUT ) :: cutest_status, ne LOGICAL, INTENT( IN ) :: byrows INTEGER, INTENT( OUT ), DIMENSION( lirnhi ) :: IRNHI @@ -160,7 +160,7 @@ SUBROUTINE CUTEST_ugreh( cutest_status, n, X, G, ne, le, IPRNHI, IPRHI, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ugreh - + SUBROUTINE CUTEST_uhprod( cutest_status, n, goth, X, P, RESULT ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n @@ -169,7 +169,7 @@ SUBROUTINE CUTEST_uhprod( cutest_status, n, goth, X, P, RESULT ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X, P REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_uhprod - + SUBROUTINE CUTEST_ushprod( status, n, goth, X, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT ) @@ -193,7 +193,7 @@ SUBROUTINE CUTEST_ubandh( cutest_status, n, X, nsemib, BANDH, lbandh, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( 0 : lbandh, n ) :: BANDH END SUBROUTINE CUTEST_ubandh - + SUBROUTINE CUTEST_ureport( cutest_status, CALLS, CPU ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( OUT ) :: cutest_status @@ -211,7 +211,7 @@ SUBROUTINE CUTEST_cdimen( cutest_status, input, n, m ) INTEGER, INTENT( IN ) :: input INTEGER, INTENT( OUT ) :: cutest_status, n, m END SUBROUTINE CUTEST_cdimen - + SUBROUTINE CUTEST_csetup( cutest_status, input, out, io_buffer, & n, m, X, X_l, X_u, & Y, C_l, C_u, EQUATN, LINEAR, & @@ -225,7 +225,7 @@ SUBROUTINE CUTEST_csetup( cutest_status, input, out, io_buffer, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: Y, C_l, C_u LOGICAL, INTENT( OUT ), DIMENSION( m ) :: EQUATN, LINEAR END SUBROUTINE CUTEST_csetup - + SUBROUTINE CUTEST_cnames( cutest_status, n, m, p_name, X_names, C_names ) INTEGER, INTENT( IN ) :: n, m INTEGER, INTENT( OUT ) :: cutest_status @@ -233,19 +233,19 @@ SUBROUTINE CUTEST_cnames( cutest_status, n, m, p_name, X_names, C_names ) CHARACTER ( LEN = 10 ), INTENT( OUT ), DIMENSION( n ) :: X_names CHARACTER ( LEN = 10 ), INTENT( OUT ), DIMENSION( m ) :: C_names END SUBROUTINE CUTEST_cnames - + SUBROUTINE CUTEST_connames( cutest_status, m, C_names ) INTEGER, INTENT( IN ) :: m INTEGER, INTENT( OUT ) :: cutest_status CHARACTER ( LEN = 10 ), INTENT( OUT ), DIMENSION( m ) :: C_names END SUBROUTINE CUTEST_connames - + SUBROUTINE CUTEST_cvartype( cutest_status, n, X_type ) INTEGER, INTENT( IN ) :: n INTEGER, INTENT( OUT ) :: cutest_status INTEGER, INTENT( OUT ) :: X_type( n ) END SUBROUTINE CUTEST_cvartype - + SUBROUTINE CUTEST_cfn( cutest_status, n, m, X, f, C ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, m @@ -254,7 +254,7 @@ SUBROUTINE CUTEST_cfn( cutest_status, n, m, X, f, C ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: C END SUBROUTINE CUTEST_cfn - + SUBROUTINE CUTEST_cgr( cutest_status, n, m, X, Y, grlagf, G, jtrans, & lcjac1, lcjac2, CJAC ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -267,7 +267,7 @@ SUBROUTINE CUTEST_cgr( cutest_status, n, m, X, Y, grlagf, G, jtrans, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( lcjac1, lcjac2 ) :: CJAC END SUBROUTINE CUTEST_cgr - + SUBROUTINE CUTEST_cofg( cutest_status, n, X, f, G, grad ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n @@ -288,12 +288,19 @@ SUBROUTINE CUTEST_cofsg( status, n, X, f, nnzg, lg, G_val, G_var, grad ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lg ) :: G_val END SUBROUTINE CUTEST_cofsg - + SUBROUTINE CUTEST_cdimsj( cutest_status, nnzj ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( OUT ) :: cutest_status, nnzj END SUBROUTINE CUTEST_cdimsj - + + SUBROUTINE CUTEST_csgrp( status, n, nnzj, lj, J_var, J_fun ) + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + INTEGER, INTENT( IN ) :: n, lj + INTEGER, INTENT( OUT ) :: nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + END SUBROUTINE CUTEST_csgrp + SUBROUTINE CUTEST_csgr( cutest_status, n, m, X, Y, grlagf, nnzj, & lcjac, CJAC, INDVAR, INDFUN ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -305,7 +312,7 @@ SUBROUTINE CUTEST_csgr( cutest_status, n, m, X, Y, grlagf, nnzj, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgr - + SUBROUTINE CUTEST_ccfg( cutest_status, n, m, X, C, jtrans, & lcjac1, lcjac2, CJAC, grad ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -317,7 +324,7 @@ SUBROUTINE CUTEST_ccfg( cutest_status, n, m, X, C, jtrans, & DIMENSION( lcjac1, lcjac2 ) :: CJAC LOGICAL, INTENT( IN ) :: jtrans, grad END SUBROUTINE CUTEST_ccfg - + SUBROUTINE CUTEST_ccfsg( cutest_status, n, m, X, C, nnzj, lcjac, CJAC, & INDVAR, INDFUN, grad ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -329,7 +336,7 @@ SUBROUTINE CUTEST_ccfsg( cutest_status, n, m, X, C, nnzj, lcjac, CJAC, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: C REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_ccfsg - + SUBROUTINE CUTEST_clfg( status, n, m, X, Y, f, G, grad ) USE CUTEST INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -351,7 +358,7 @@ SUBROUTINE CUTEST_ccifg( cutest_status, n, icon, X, ci, GCI, grad ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: GCI END SUBROUTINE CUTEST_ccifg - + SUBROUTINE CUTEST_ccifsg( cutest_status, n, icon, X, ci, & nnzgci, lgci, GCI, INDVAR, grad ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -363,7 +370,7 @@ SUBROUTINE CUTEST_ccifsg( cutest_status, n, icon, X, ci, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lgci ) :: GCI END SUBROUTINE CUTEST_ccifsg - + SUBROUTINE CUTEST_cdh( cutest_status, n, m, X, Y, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, m, lh1 @@ -372,7 +379,7 @@ SUBROUTINE CUTEST_cdh( cutest_status, n, m, X, Y, lh1, H ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_cdh - + SUBROUTINE CUTEST_cdhc( cutest_status, n, m, X, Y, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, m, lh1 @@ -381,7 +388,7 @@ SUBROUTINE CUTEST_cdhc( cutest_status, n, m, X, Y, lh1, H ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_cdhc - + SUBROUTINE CUTEST_cidh( cutest_status, n, X, iprob, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, iprob, lh1 @@ -389,7 +396,7 @@ SUBROUTINE CUTEST_cidh( cutest_status, n, X, iprob, lh1, H ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_cidh - + SUBROUTINE CUTEST_cgrdh( cutest_status, n, m, X, Y, grlagf, G, & jtrans, lcjac1, lcjac2, CJAC, lh1, H ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -403,17 +410,17 @@ SUBROUTINE CUTEST_cgrdh( cutest_status, n, m, X, Y, grlagf, G, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( lcjac1, lcjac2 ) :: CJAC END SUBROUTINE CUTEST_cgrdh - + SUBROUTINE CUTEST_cdimsh( cutest_status, nnzh ) INTEGER, INTENT( OUT ) :: cutest_status, nnzh END SUBROUTINE CUTEST_cdimsh - + SUBROUTINE CUTEST_cshp( cutest_status, n, nnzh, lh, IRNH, ICNH ) INTEGER, INTENT( IN ) :: n, lh INTEGER, INTENT( OUT ) :: cutest_status, nnzh INTEGER, INTENT( OUT ), DIMENSION( lh ) :: IRNH, ICNH END SUBROUTINE CUTEST_cshp - + SUBROUTINE CUTEST_csh( cutest_status, n, m, X, Y, & nnzh, lh, H, IRNH, ICNH ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -424,7 +431,7 @@ SUBROUTINE CUTEST_csh( cutest_status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_csh - + SUBROUTINE CUTEST_cshc( cutest_status, n, m, X, Y, & nnzh, lh, H, IRNH, ICNH ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -435,7 +442,7 @@ SUBROUTINE CUTEST_cshc( cutest_status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_cshc - + SUBROUTINE CUTEST_cish( cutest_status, n, X, iprob, & nnzh, lh, H, IRNH, ICNH ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -445,7 +452,16 @@ SUBROUTINE CUTEST_cish( cutest_status, n, X, iprob, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_cish - + + SUBROUTINE CUTEST_csgrshp( status, n, nnzj, lj, J_var, J_fun, & + nnzh, lh, H_row, H_col ) + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + INTEGER, INTENT( IN ) :: n, lj, lh + INTEGER, INTENT( OUT ) :: nnzh, nnzj, status + INTEGER, INTENT( OUT ), DIMENSION( lj ) :: J_var, J_fun + INTEGER, INTENT( OUT ), DIMENSION( lh ) :: H_row, H_col + END SUBROUTINE CUTEST_csgrshp + SUBROUTINE CUTEST_csgrsh( cutest_status, n, m, X, Y, grlagf, nnzj, & lcjac, CJAC, INDVAR, INDFUN, nnzh, & lh, H, IRNH, ICNH ) @@ -460,15 +476,15 @@ SUBROUTINE CUTEST_csgrsh( cutest_status, n, m, X, Y, grlagf, nnzj, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgrsh - + SUBROUTINE CUTEST_cdimse( cutest_status, ne, nnzh, nzirnh ) INTEGER, INTENT( OUT ) :: cutest_status, ne, nnzh, nzirnh END SUBROUTINE CUTEST_cdimse - + SUBROUTINE CUTEST_ceh( cutest_status, n, m, X, Y, ne, le, IPRNHI, & IPRHI, lirnhi, IRNHI, lhi, Hi, byrows ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) - INTEGER, INTENT( IN ) :: n, m, le, lirnhi, lhi + INTEGER, INTENT( IN ) :: n, m, le, lirnhi, lhi INTEGER, INTENT( OUT ) :: cutest_status, ne LOGICAL, INTENT( IN ) :: byrows INTEGER, INTENT( OUT ), DIMENSION( lirnhi ) :: IRNHI @@ -477,13 +493,13 @@ SUBROUTINE CUTEST_ceh( cutest_status, n, m, X, Y, ne, le, IPRNHI, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ceh - + SUBROUTINE CUTEST_csgreh( cutest_status, n, m, X, Y, grlagf, & nnzj, lcjac, CJAC, INDVAR, INDFUN, & ne, le, IPRNHI, IPRHI, lirnhi, IRNHI, lhi, & Hi, byrows ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) - INTEGER, INTENT( IN ) :: n, m, lcjac, le, lirnhi, lhi + INTEGER, INTENT( IN ) :: n, m, lcjac, le, lirnhi, lhi INTEGER, INTENT( OUT ) :: cutest_status, ne, nnzj LOGICAL, INTENT( IN ) :: grlagf, byrows INTEGER, INTENT( OUT ), DIMENSION( lcjac ) :: INDVAR, INDFUN @@ -494,7 +510,7 @@ SUBROUTINE CUTEST_csgreh( cutest_status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgreh - + SUBROUTINE CUTEST_chprod( cutest_status, n, m, goth, X, Y, P, RESULT ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, m @@ -504,7 +520,7 @@ SUBROUTINE CUTEST_chprod( cutest_status, n, m, goth, X, Y, P, RESULT ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_chprod - + SUBROUTINE CUTEST_cshprod( status, n, m, goth, X, Y, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT ) @@ -528,7 +544,7 @@ SUBROUTINE CUTEST_chcprod( cutest_status, n, m, goth, X, Y, P, RESULT ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_chcprod - + SUBROUTINE CUTEST_cshcprod( status, n, m, goth, X, Y, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT ) @@ -553,7 +569,7 @@ SUBROUTINE CUTEST_cjprod( cutest_status, n, m, gotj, jtrans, X, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( lvector ) :: VECTOR REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lresult ) :: RESULT END SUBROUTINE CUTEST_cjprod - + SUBROUTINE CUTEST_csjprod( cutest_status, n, m, gotj, jtrans, X, & nnz_vector, INDEX_nz_vector, VECTOR, lvector,& nnz_result, INDEX_nz_result, RESULT, lresult ) @@ -572,6 +588,14 @@ SUBROUTINE CUTEST_cdimchp( cutest_status, nnzchp ) INTEGER, INTENT( OUT ) :: cutest_status, nnzchp END SUBROUTINE CUTEST_cdimchp + SUBROUTINE CUTEST_cchprodsp( status, m, lchp, CHP_ind, CHP_ptr ) + INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) + INTEGER, INTENT( IN ) :: m, lchp + INTEGER, INTENT( OUT ) :: status + INTEGER, INTENT( INOUT ), DIMENSION( m + 1 ) :: CHP_ptr + INTEGER, INTENT( INOUT ), DIMENSION( lchp ) :: CHP_ind + END SUBROUTINE CUTEST_cchprodsp + SUBROUTINE CUTEST_cchprods( cutest_status, n, m, goth, X, VECTOR, & lchp, CHP_val, CHP_ind, CHP_ptr ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -598,7 +622,7 @@ SUBROUTINE CUTEST_cstats( cutest_status, nonlinear_variables_objective, & INTEGER, INTENT( OUT ) :: nonlinear_variables_constraints INTEGER, INTENT( OUT ) :: equality_constraints, linear_constraint END SUBROUTINE CUTEST_cstats - + SUBROUTINE CUTEST_cterminate( cutest_status ) INTEGER, INTENT( OUT ) :: cutest_status END SUBROUTINE CUTEST_cterminate @@ -614,7 +638,7 @@ SUBROUTINE CUTEST_usetup_threaded( cutest_status, input, out, threads, & INTEGER, INTENT( IN ), DIMENSION( threads ) :: IO_BUFFERS REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: X, X_l, X_u END SUBROUTINE CUTEST_usetup_threaded - + SUBROUTINE CUTEST_ufn_threaded( cutest_status, n, X, f, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, thread @@ -622,7 +646,7 @@ SUBROUTINE CUTEST_ufn_threaded( cutest_status, n, X, f, thread ) REAL ( KIND = wp ), INTENT( OUT ) :: f REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X END SUBROUTINE CUTEST_ufn_threaded - + SUBROUTINE CUTEST_ugr_threaded( cutest_status, n, X, G, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, thread @@ -630,7 +654,7 @@ SUBROUTINE CUTEST_ugr_threaded( cutest_status, n, X, G, thread ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G END SUBROUTINE CUTEST_ugr_threaded - + SUBROUTINE CUTEST_uofg_threaded( cutest_status, n, X, f, G, grad, & thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -641,7 +665,7 @@ SUBROUTINE CUTEST_uofg_threaded( cutest_status, n, X, f, G, grad, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G LOGICAL, INTENT( IN ) :: grad END SUBROUTINE CUTEST_uofg_threaded - + SUBROUTINE CUTEST_udh_threaded( cutest_status, n, X, lh1, H, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, lh1, thread @@ -649,7 +673,7 @@ SUBROUTINE CUTEST_udh_threaded( cutest_status, n, X, lh1, H, thread ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_udh_threaded - + SUBROUTINE CUTEST_ugrdh_threaded( cutest_status, n, X, G, & lh1, H, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -659,7 +683,7 @@ SUBROUTINE CUTEST_ugrdh_threaded( cutest_status, n, X, G, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_ugrdh_threaded - + SUBROUTINE CUTEST_ush_threaded( cutest_status, n, X, & nnzh, lh, H, IRNH, ICNH, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -669,7 +693,7 @@ SUBROUTINE CUTEST_ush_threaded( cutest_status, n, X, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_ush_threaded - + SUBROUTINE CUTEST_ugrsh_threaded( cutest_status, n, X, G, & nnzh, lh, H, IRNH, ICNH, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -680,12 +704,12 @@ SUBROUTINE CUTEST_ugrsh_threaded( cutest_status, n, X, G, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_ugrsh_threaded - + SUBROUTINE CUTEST_ueh_threaded( cutest_status, n, X, ne, le, IPRNHI, & IPRHI, lirnhi, IRNHI, lhi, Hi, byrows, & thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) - INTEGER, INTENT( IN ) :: n, ne, le, lirnhi, lhi, thread + INTEGER, INTENT( IN ) :: n, ne, le, lirnhi, lhi, thread INTEGER, INTENT( OUT ) :: cutest_status LOGICAL, INTENT( IN ) :: byrows INTEGER, INTENT( OUT ), DIMENSION( lirnhi ) :: IRNHI @@ -693,7 +717,7 @@ SUBROUTINE CUTEST_ueh_threaded( cutest_status, n, X, ne, le, IPRNHI, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ueh_threaded - + SUBROUTINE CUTEST_ugreh_threaded( cutest_status, n, X, G, ne, le, & IPRNHI, IPRHI, lirnhi, IRNHI, lhi, & Hi, byrows, thread ) @@ -707,7 +731,7 @@ SUBROUTINE CUTEST_ugreh_threaded( cutest_status, n, X, G, ne, le, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ugreh_threaded - + SUBROUTINE CUTEST_uhprod_threaded( cutest_status, n, goth, X, P, & RESULT, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -717,7 +741,7 @@ SUBROUTINE CUTEST_uhprod_threaded( cutest_status, n, goth, X, P, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X, P REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_uhprod_threaded - + SUBROUTINE CUTEST_ushprod_threaded( status, n, goth, X, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT, & @@ -741,7 +765,7 @@ SUBROUTINE CUTEST_ubandh_threaded( cutest_status, n, X, nsemib, BANDH, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( 0 : lbandh, n ) :: BANDH END SUBROUTINE CUTEST_ubandh_threaded - + SUBROUTINE CUTEST_ureport_threaded( cutest_status, CALLS, CPU, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: thread @@ -766,7 +790,7 @@ SUBROUTINE CUTEST_csetup_threaded( cutest_status, input, out, threads, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: Y, C_l, C_u LOGICAL, INTENT( OUT ), DIMENSION( m ) :: EQUATN, LINEAR END SUBROUTINE CUTEST_csetup_threaded - + SUBROUTINE CUTEST_cfn_threaded( cutest_status, n, m, X, f, C, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) INTEGER, INTENT( IN ) :: n, m, thread @@ -775,7 +799,7 @@ SUBROUTINE CUTEST_cfn_threaded( cutest_status, n, m, X, f, C, thread ) REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: C END SUBROUTINE CUTEST_cfn_threaded - + SUBROUTINE CUTEST_cgr_threaded( cutest_status, n, m, X, Y, grlagf, G, & jtrans, lcjac1, lcjac2, CJAC , thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -788,7 +812,7 @@ SUBROUTINE CUTEST_cgr_threaded( cutest_status, n, m, X, Y, grlagf, G, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( lcjac1, lcjac2 ) :: CJAC END SUBROUTINE CUTEST_cgr_threaded - + SUBROUTINE CUTEST_cofg_threaded( cutest_status, n, X, f, G, grad, & thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -799,7 +823,7 @@ SUBROUTINE CUTEST_cofg_threaded( cutest_status, n, X, f, G, grad, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: G LOGICAL, INTENT( IN ) :: grad END SUBROUTINE CUTEST_cofg_threaded - + SUBROUTINE CUTEST_csgr_threaded( cutest_status, n, m, X, Y, grlagf, & nnzj, lcjac, CJAC, INDVAR, INDFUN, & thread ) @@ -812,7 +836,7 @@ SUBROUTINE CUTEST_csgr_threaded( cutest_status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgr_threaded - + SUBROUTINE CUTEST_ccfg_threaded( cutest_status, n, m, X, C, jtrans, & lcjac1, lcjac2, CJAC, grad, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -824,7 +848,7 @@ SUBROUTINE CUTEST_ccfg_threaded( cutest_status, n, m, X, C, jtrans, & DIMENSION( lcjac1, lcjac2 ) :: CJAC LOGICAL, INTENT( IN ) :: jtrans, grad END SUBROUTINE CUTEST_ccfg_threaded - + SUBROUTINE CUTEST_ccfsg_threaded( cutest_status, n, m, X, C, nnzj, & lcjac, CJAC, INDVAR, INDFUN, grad, & thread ) @@ -837,7 +861,7 @@ SUBROUTINE CUTEST_ccfsg_threaded( cutest_status, n, m, X, C, nnzj, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( m ) :: C REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_ccfsg_threaded - + SUBROUTINE CUTEST_ccifg_threaded( cutest_status, n, icon, X, ci, GCI, & grad, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -848,7 +872,7 @@ SUBROUTINE CUTEST_ccifg_threaded( cutest_status, n, icon, X, ci, GCI, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: GCI END SUBROUTINE CUTEST_ccifg_threaded - + SUBROUTINE CUTEST_ccifsg_threaded( cutest_status, n, icon, X, ci, & nnzgci, lgci, GCI, INDVAR, grad, & thread ) @@ -861,7 +885,7 @@ SUBROUTINE CUTEST_ccifsg_threaded( cutest_status, n, icon, X, ci, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lgci ) :: GCI END SUBROUTINE CUTEST_ccifsg_threaded - + SUBROUTINE CUTEST_cdh_threaded( cutest_status, n, m, X, Y, & lh1, H, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -871,7 +895,7 @@ SUBROUTINE CUTEST_cdh_threaded( cutest_status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_cdh_threaded - + SUBROUTINE CUTEST_cidh_threaded( cutest_status, n, X, iprob, & lh1, H, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -880,7 +904,7 @@ SUBROUTINE CUTEST_cidh_threaded( cutest_status, n, X, iprob, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh1, n ) :: H END SUBROUTINE CUTEST_cidh_threaded - + SUBROUTINE CUTEST_cgrdh_threaded( cutest_status, n, m, X, Y, grlagf, & G, jtrans, lcjac1, lcjac2, CJAC, & lh1, H, thread ) @@ -895,7 +919,7 @@ SUBROUTINE CUTEST_cgrdh_threaded( cutest_status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), & DIMENSION( lcjac1, lcjac2 ) :: CJAC END SUBROUTINE CUTEST_cgrdh_threaded - + SUBROUTINE CUTEST_csh_threaded( cutest_status, n, m, X, Y, & nnzh, lh, H, IRNH, ICNH , thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -906,7 +930,7 @@ SUBROUTINE CUTEST_csh_threaded( cutest_status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_csh_threaded - + SUBROUTINE CUTEST_cshc_threaded( cutest_status, n, m, X, Y, & nnzh, lh, H, IRNH, ICNH , thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -917,7 +941,7 @@ SUBROUTINE CUTEST_cshc_threaded( cutest_status, n, m, X, Y, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_cshc_threaded - + SUBROUTINE CUTEST_cish_threaded( cutest_status, n, X, iprob, & nnzh, lh, H, IRNH, ICNH , thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -927,7 +951,7 @@ SUBROUTINE CUTEST_cish_threaded( cutest_status, n, X, iprob, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( n ) :: X REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H END SUBROUTINE CUTEST_cish_threaded - + SUBROUTINE CUTEST_csgrsh_threaded( cutest_status, n, m, X, Y, grlagf, & nnzj, lcjac, CJAC, INDVAR, INDFUN, & nnzh, lh, H, IRNH, ICNH , thread ) @@ -942,7 +966,7 @@ SUBROUTINE CUTEST_csgrsh_threaded( cutest_status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lh ) :: H REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgrsh_threaded - + SUBROUTINE CUTEST_ceh_threaded( cutest_status, n, m, X, Y, ne, le, & IPRNHI, IPRHI, lirnhi, IRNHI, lhi, & HI, byrows, thread ) @@ -956,7 +980,7 @@ SUBROUTINE CUTEST_ceh_threaded( cutest_status, n, m, X, Y, ne, le, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI END SUBROUTINE CUTEST_ceh_threaded - + SUBROUTINE CUTEST_csgreh_threaded( cutest_status, n, m, X, Y, grlagf, & nnzj, lcjac, CJAC, INDVAR, INDFUN, & ne, le, IPRNHI, IPRHI, lirnhi, & @@ -973,7 +997,7 @@ SUBROUTINE CUTEST_csgreh_threaded( cutest_status, n, m, X, Y, grlagf, & REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lhi ) :: HI REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lcjac ) :: CJAC END SUBROUTINE CUTEST_csgreh_threaded - + SUBROUTINE CUTEST_chprod_threaded( cutest_status, n, m, goth, & X, Y, P, RESULT, thread ) INTEGER, PARAMETER :: wp = KIND( 1.0D+0 ) @@ -984,7 +1008,7 @@ SUBROUTINE CUTEST_chprod_threaded( cutest_status, n, m, goth, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_chprod_threaded - + SUBROUTINE CUTEST_cshprod_threaded( status, n, m, goth, X, Y, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT, & @@ -1010,7 +1034,7 @@ SUBROUTINE CUTEST_chcprod_threaded( cutest_status, n, m, goth, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( m ) :: Y REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( n ) :: RESULT END SUBROUTINE CUTEST_chcprod_threaded - + SUBROUTINE CUTEST_cshcprod_threaded( status, n, m, goth, X, Y, & nnz_vector, INDEX_nz_vector, VECTOR, & nnz_result, INDEX_nz_result, RESULT, & @@ -1037,7 +1061,7 @@ SUBROUTINE CUTEST_cjprod_threaded( cutest_status, n, m, gotj, X, & REAL ( KIND = wp ), INTENT( IN ), DIMENSION( lvector ) :: VECTOR REAL ( KIND = wp ), INTENT( OUT ), DIMENSION( lresult ) :: RESULT END SUBROUTINE CUTEST_cjprod_threaded - + SUBROUTINE CUTEST_cchprods_threaded( cutest_status, n, m, goth, X, & VECTOR, lchp, CHP_val, CHP_ind, & CHP_ptr ) @@ -1060,9 +1084,9 @@ SUBROUTINE CUTEST_creport_threaded( cutest_status, CALLS, CPU, thread ) END SUBROUTINE CUTEST_creport_threaded END INTERFACE - + ! End of module CUTEst_interface_double END MODULE CUTEst_interface_double - + diff --git a/src/tools/makemaster b/src/tools/makemaster index c72464d..d94071e 100644 --- a/src/tools/makemaster +++ b/src/tools/makemaster @@ -81,6 +81,7 @@ CCUTESTS = $(LCS)(csetup.o) $(LCS)(cdimen.o) $(LCS)(cdimse.o) $(LCS)(cdimsh.o) \ $(LCS)(cshc.o) $(LCS)(cshp.o) $(LCS)(cish.o) $(LCS)(cjprod.o) \ $(LCS)(cstats.o) $(LCS)(csgr.o) $(LCS)(csgreh.o) $(LCS)(csgrsh.o) \ $(LCS)(csjprod.o) $(LCS)(chprod.o) $(LCS)(chcprod.o) \ + $(LCS)(csgrp.o) $(LCS)(csgrshp.o) $(LCS)(cchprodsp.o) \ $(LCS)(cshprod.o) $(LCS)(cshcprod.o) $(LCS)(cchprods.o) \ $(LCS)(creport.o) $(LCS)(connames.o) $(LCS)(cterminate.o) \ $(LCS)(lqp.o) $(LCS)(cconst.o) @@ -108,6 +109,7 @@ CCUTESTD = $(LCD)(csetup.o) $(LCD)(cdimen.o) $(LCD)(cdimse.o) $(LCD)(cdimsh.o) \ $(LCD)(cstats.o) $(LCD)(csgr.o) $(LCD)(csgreh.o) $(LCD)(csgrsh.o) \ $(LCD)(csjprod.o) $(LCD)(chprod.o) $(LCD)(chcprod.o) \ $(LCD)(cshprod.o) $(LCD)(cshcprod.o) $(LCD)(cchprods.o) \ + $(LCD)(csgrp.o) $(LCD)(csgrshp.o) $(LCD)(cchprodsp.o) \ $(LCD)(creport.o) $(LCD)(connames.o) $(LCD)(cterminate.o) \ $(LCD)(lqp.o) $(LCD)(cconst.o) @@ -224,13 +226,16 @@ $(LC)(cutest.o): ../tools/cutest.f90 $(RMARFILE) cjprod.o $(RMARFILE) csjprod.o $(RMARFILE) csgr.o + $(RMARFILE) csgrp.o $(RMARFILE) csgreh.o $(RMARFILE) csgrsh.o + $(RMARFILE) csgrshp.o $(RMARFILE) chprod.o $(RMARFILE) chcprod.o $(RMARFILE) cshprod.o $(RMARFILE) cshcprod.o $(RMARFILE) cchprods.o + $(RMARFILE) cchprodsp.o $(RMARFILE) cconst.o $(RMARFILE) creport.o $(RMARFILE) cterminate.o @@ -673,6 +678,18 @@ $(LC)(csgr.o): ../tools/csgr.f90 # $(MVMODS) @printf '[ OK ]\n' +csgrp.o: $(LC)(csgrp.o) + +$(LC)(csgrp.o): ../tools/csgrp.f90 + @printf ' %-9s %-15s\t\t' "Compiling" "csgrp" + $(SED) -f $(SEDS) ../tools/csgrp.f90 > $(OBJ)/csgrp.f90 + cd $(OBJ); $(FORTRAN) -o csgrp.o $(FFLAGS) csgrp.f90 \ + || ( printf ' %-26s' "=> Disabling optimization " ; \ + $(FORTRAN) -o csgrp.o $(FFLAGSN) csgrp.f90 ) + cd $(OBJ); $(ARR) csgrp.o; $(RM) csgrp.f90 csgrp.o +# $(MVMODS) + @printf '[ OK ]\n' + csgreh.o: $(LC)(csgreh.o) $(LC)(csgreh.o): ../tools/csgreh.f90 @@ -697,6 +714,22 @@ $(LC)(csgrsh.o): ../tools/csgrsh.f90 # $(MVMODS) @printf '[ OK ]\n' +csgrshp.o: $(LC)(csgrshp.o) + +$(LC)(csgrshp.o): ../tools/csgrshp.f90 + @printf ' %-9s %-15s\t\t' "Compiling" "csgrshp" + $(SED) -f $(SEDS) ../tools/csgrshp.f90 > \ + $(OBJ)/csgrshp.f90 + cd $(OBJ); $(FORTRAN) -o csgrshp.o $(FFLAGS) \ + csgrshp.f90 \ + || ( printf ' %-26s' "=> Disabling optimization " ; \ + $(FORTRAN) -o csgrshp.o $(FFLAGSN) \ + csgrshp.f90 ) + cd $(OBJ); $(ARR) csgrshp.o; \ + $(RM) csgrshp.f90 csgrshp.o +# $(MVMODS) + @printf '[ OK ]\n' + chprod.o: $(LC)(chprod.o) $(LC)(chprod.o): ../tools/chprod.f90 @@ -757,6 +790,22 @@ $(LC)(cchprods.o): ../tools/cchprods.f90 # $(MVMODS) @printf '[ OK ]\n' +cchprodsp.o: $(LC)(cchprodsp.o) + +$(LC)(cchprodsp.o): ../tools/cchprodsp.f90 + @printf ' %-9s %-15s\t\t' "Compiling" "cchprodsp" + $(SED) -f $(SEDS) ../tools/cchprodsp.f90 > \ + $(OBJ)/cchprodsp.f90 + cd $(OBJ); $(FORTRAN) -o cchprodsp.o $(FFLAGS) \ + cchprodsp.f90 \ + || ( printf ' %-26s' "=> Disabling optimization " ; \ + $(FORTRAN) -o cchprodsp.o $(FFLAGSN) \ + cchprodsp.f90 ) + cd $(OBJ); $(ARR) cchprodsp.o; \ + $(RM) cchprodsp.f90 cchprodsp.o +# $(MVMODS) + @printf '[ OK ]\n' + cconst.o: $(LC)(cconst.o) $(LC)(cconst.o): ../tools/cconst.f90