diff --git a/src/core_interface.jl b/src/core_interface.jl index 990fa1d1..234bd09d 100644 --- a/src/core_interface.jl +++ b/src/core_interface.jl @@ -104,19 +104,7 @@ function usetup( x_l::StrideOneVector{Cdouble}, x_u::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_usetup_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - ), + cutest_usetup_( io_err, input, out, @@ -184,28 +172,7 @@ function csetup( l_order::StrideOneVector{Cint}, v_order::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csetup_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_csetup_( io_err, input, out, @@ -250,10 +217,7 @@ function udimen( input::StrideOneVector{Cint}, n::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_udimen_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_udimen_( io_err, input, n, @@ -281,7 +245,10 @@ Usage: - nnzh: [OUT] Vector{Cint} """ function udimsh(io_err::StrideOneVector{Cint}, nnzh::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_udimsh_"), Nothing, (Ptr{Cint}, Ptr{Cint}), io_err, nnzh) + cutest_udimsh_( + io_err, + nnzh, + ) end """# udimse @@ -314,10 +281,7 @@ function udimse( he_val_ne::StrideOneVector{Cint}, he_row_ne::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_udimse_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_udimse_( io_err, ne, he_val_ne, @@ -350,10 +314,7 @@ function uvartype( n::StrideOneVector{Cint}, x_type::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_uvartype_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_uvartype_( io_err, n, x_type, @@ -385,12 +346,9 @@ function unames( io_err::StrideOneVector{Cint}, n::StrideOneVector{Cint}, pname::StrideOneVector{UInt8}, - vname::Array{UInt8, 2}, + vname::Matrix{UInt8}, ) - ccall( - dlsym(cutest_lib, "cutest_unames_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{UInt8}, Ptr{UInt8}), + cutest_unames_( io_err, n, pname, @@ -423,10 +381,7 @@ function ureport( calls::StrideOneVector{Cdouble}, time::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_ureport_"), - Nothing, - (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_ureport_( io_err, calls, time, @@ -462,10 +417,7 @@ function cdimen( n::StrideOneVector{Cint}, m::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cdimen_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cdimen_( io_err, input, n, @@ -497,7 +449,10 @@ Usage: - nnzj: [OUT] Vector{Cint} """ function cdimsj(io_err::StrideOneVector{Cint}, nnzj::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_cdimsj_"), Nothing, (Ptr{Cint}, Ptr{Cint}), io_err, nnzj) + cutest_cdimsj_( + io_err, + nnzj, + ) end """# cdimsh @@ -523,7 +478,10 @@ Usage: - nnzh: [OUT] Vector{Cint} """ function cdimsh(io_err::StrideOneVector{Cint}, nnzh::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_cdimsh_"), Nothing, (Ptr{Cint}, Ptr{Cint}), io_err, nnzh) + cutest_cdimsh_( + io_err, + nnzh, + ) end """# cdimchp @@ -549,7 +507,10 @@ Usage: - nnzchp: [OUT] Vector{Cint} """ function cdimchp(io_err::StrideOneVector{Cint}, nnzchp::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_cdimchp_"), Nothing, (Ptr{Cint}, Ptr{Cint}), io_err, nnzchp) + cutest_cdimchp_( + io_err, + nnzchp, + ) end """# cdimse @@ -584,10 +545,7 @@ function cdimse( he_val_ne::StrideOneVector{Cint}, he_row_ne::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cdimse_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cdimse_( io_err, ne, he_val_ne, @@ -613,10 +571,7 @@ function cstats( equality_constraints::StrideOneVector{Cint}, linear_constraints::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cstats_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cstats_( io_err, nonlinear_variables_objective, nonlinear_variables_constraints, @@ -652,10 +607,7 @@ function cvartype( n::StrideOneVector{Cint}, x_type::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cvartype_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cvartype_( io_err, n, x_type, @@ -694,13 +646,10 @@ function cnames( n::StrideOneVector{Cint}, m::StrideOneVector{Cint}, pname::StrideOneVector{UInt8}, - vname::Array{UInt8, 2}, - cname::Array{UInt8, 2}, + vname::Matrix{UInt8}, + cname::Matrix{UInt8}, ) - ccall( - dlsym(cutest_lib, "cutest_cnames_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt8}, Ptr{UInt8}, Ptr{UInt8}), + cutest_cnames_( io_err, n, m, @@ -737,10 +686,7 @@ function creport( calls::StrideOneVector{Cdouble}, time::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_creport_"), - Nothing, - (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_creport_( io_err, calls, time, @@ -770,11 +716,8 @@ Usage: To get useful names, use `String(cname[:,i])`. """ -function connames(io_err::StrideOneVector{Cint}, m::StrideOneVector{Cint}, cname::Array{UInt8, 2}) - ccall( - dlsym(cutest_lib, "cutest_connames_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{UInt8}), +function connames(io_err::StrideOneVector{Cint}, m::StrideOneVector{Cint}, cname::Matrix{UInt8}) + cutest_connames_( io_err, m, cname, @@ -808,10 +751,7 @@ function pname( input::StrideOneVector{Cint}, pname::StrideOneVector{UInt8}, ) - ccall( - dlsym(cutest_lib, "cutest_pname_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{UInt8}), + cutest_pname_( io_err, input, pname, @@ -840,7 +780,10 @@ Usage: To get a useful name, use `String(pname)`. """ function probname(io_err::StrideOneVector{Cint}, pname::StrideOneVector{UInt8}) - ccall(dlsym(cutest_lib, "cutest_probname_"), Nothing, (Ptr{Cint}, Ptr{UInt8}), io_err, pname) + cutest_probname_( + io_err, + pname, + ) end """# varnames @@ -866,11 +809,8 @@ Usage: To get useful names, use `String(vname[:, i])`. """ -function varnames(io_err::StrideOneVector{Cint}, n::StrideOneVector{Cint}, vname::Array{UInt8, 2}) - ccall( - dlsym(cutest_lib, "cutest_varnames_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{UInt8}), +function varnames(io_err::StrideOneVector{Cint}, n::StrideOneVector{Cint}, vname::Matrix{UInt8}) + cutest_varnames_( io_err, n, vname, @@ -903,10 +843,7 @@ function ufn( x::StrideOneVector{Cdouble}, f::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_ufn_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_ufn_( io_err, n, x, @@ -940,10 +877,7 @@ function ugr( x::StrideOneVector{Cdouble}, g::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_ugr_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_ugr_( io_err, n, x, @@ -982,10 +916,7 @@ function uofg( g::StrideOneVector{Cdouble}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_uofg_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}), + cutest_uofg_( io_err, n, x, @@ -1015,19 +946,16 @@ Usage: - n: [IN] Vector{Cint} - x: [IN] Vector{Cdouble} - lh1: [IN] Vector{Cint} - - h: [OUT] Array{Cdouble, 2} + - h: [OUT] Matrix{Cdouble} """ function udh( io_err::StrideOneVector{Cint}, n::StrideOneVector{Cint}, x::StrideOneVector{Cdouble}, lh1::StrideOneVector{Cint}, - h::Array{Cdouble, 2}, + h::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_udh_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), + cutest_udh_( io_err, n, x, @@ -1067,10 +995,7 @@ function ushp( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ushp_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_ushp_( io_err, n, nnzh, @@ -1116,10 +1041,7 @@ function ush( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ush_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}), + cutest_ush_( io_err, n, x, @@ -1177,23 +1099,7 @@ function ueh( he_val::StrideOneVector{Cdouble}, byrows::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ueh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_ueh_( io_err, n, x, @@ -1231,7 +1137,7 @@ Usage: - x: [IN] Vector{Cdouble} - g: [OUT] Vector{Cdouble} - lh1: [IN] Vector{Cint} - - h: [OUT] Array{Cdouble, 2} + - h: [OUT] Matrix{Cdouble} """ function ugrdh( io_err::StrideOneVector{Cint}, @@ -1239,12 +1145,9 @@ function ugrdh( x::StrideOneVector{Cdouble}, g::StrideOneVector{Cdouble}, lh1::StrideOneVector{Cint}, - h::Array{Cdouble, 2}, + h::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_ugrdh_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), + cutest_ugrdh_( io_err, n, x, @@ -1292,20 +1195,7 @@ function ugrsh( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ugrsh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_ugrsh_( io_err, n, x, @@ -1367,24 +1257,7 @@ function ugreh( he_val::StrideOneVector{Cdouble}, byrows::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ugreh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_ugreh_( io_err, n, x, @@ -1432,10 +1305,7 @@ function uhprod( vector::StrideOneVector{Cdouble}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_uhprod_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_uhprod_( io_err, n, goth, @@ -1487,21 +1357,7 @@ function ushprod( index_nz_result::StrideOneVector{Cint}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_ushprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - ), + cutest_ushprod_( io_err, n, goth, @@ -1536,7 +1392,7 @@ Usage: - n: [IN] Vector{Cint} - x: [IN] Vector{Cdouble} - semibandwidth: [IN] Vector{Cint} - - h_band: [OUT] Array{Cdouble, 2} + - h_band: [OUT] Matrix{Cdouble} - lbandh: [IN] Vector{Cint} - max_semibandwidth: [OUT] Vector{Cint} """ @@ -1545,14 +1401,11 @@ function ubandh( n::StrideOneVector{Cint}, x::StrideOneVector{Cdouble}, semibandwidth::StrideOneVector{Cint}, - h_band::Array{Cdouble, 2}, + h_band::Matrix{Cdouble}, lbandh::StrideOneVector{Cint}, max_semibandwidth::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ubandh_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}), + cutest_ubandh_( io_err, n, x, @@ -1596,10 +1449,7 @@ function cfn( f::StrideOneVector{Cdouble}, c::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cfn_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_cfn_( io_err, n, m, @@ -1642,10 +1492,7 @@ function cofg( g::StrideOneVector{Cdouble}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cofg_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}), + cutest_cofg_( io_err, n, x, @@ -1694,20 +1541,7 @@ function cofsg( g_var::StrideOneVector{Cint}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cofsg_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_cofsg_( io_err, n, x, @@ -1746,7 +1580,7 @@ Usage: - jtrans: [IN] Vector{Cint} - lcjac1: [IN] Vector{Cint} - lcjac2: [IN] Vector{Cint} - - cjac: [OUT] Array{Cdouble, 2} + - cjac: [OUT] Matrix{Cdouble} - grad: [IN] Vector{Cint} """ function ccfg( @@ -1758,24 +1592,10 @@ function ccfg( jtrans::StrideOneVector{Cint}, lcjac1::StrideOneVector{Cint}, lcjac2::StrideOneVector{Cint}, - cjac::Array{Cdouble, 2}, + cjac::Matrix{Cdouble}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ccfg_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_ccfg_( io_err, n, m, @@ -1826,19 +1646,7 @@ function clfg( g::StrideOneVector{Cdouble}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_clfg_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_clfg_( io_err, n, m, @@ -1879,7 +1687,7 @@ Usage: - jtrans: [IN] Vector{Cint} - lj1: [IN] Vector{Cint} - lj2: [IN] Vector{Cint} - - j_val: [OUT] Array{Cdouble, 2} + - j_val: [OUT] Matrix{Cdouble} """ function cgr( io_err::StrideOneVector{Cint}, @@ -1892,24 +1700,9 @@ function cgr( jtrans::StrideOneVector{Cint}, lj1::StrideOneVector{Cint}, lj2::StrideOneVector{Cint}, - j_val::Array{Cdouble, 2}, + j_val::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cgr_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - ), + cutest_cgr_( io_err, n, m, @@ -1970,22 +1763,7 @@ function csgr( j_var::StrideOneVector{Cint}, j_fun::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csgr_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_csgr_( io_err, n, m, @@ -2044,22 +1822,7 @@ function ccfsg( j_fun::StrideOneVector{Cint}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ccfsg_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_ccfsg_( io_err, n, m, @@ -2110,10 +1873,7 @@ function ccifg( gci::StrideOneVector{Cdouble}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ccifg_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}), + cutest_ccifg_( io_err, n, icon, @@ -2167,21 +1927,7 @@ function ccifsg( gci_var::StrideOneVector{Cint}, grad::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ccifsg_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_ccifsg_( io_err, n, icon, @@ -2226,9 +1972,9 @@ Usage: - jtrans: [IN] Vector{Cint} - lj1: [IN] Vector{Cint} - lj2: [IN] Vector{Cint} - - j_val: [OUT] Array{Cdouble, 2} + - j_val: [OUT] Matrix{Cdouble} - lh1: [IN] Vector{Cint} - - h_val: [OUT] Array{Cdouble, 2} + - h_val: [OUT] Matrix{Cdouble} """ function cgrdh( io_err::StrideOneVector{Cint}, @@ -2241,28 +1987,11 @@ function cgrdh( jtrans::StrideOneVector{Cint}, lj1::StrideOneVector{Cint}, lj2::StrideOneVector{Cint}, - j_val::Array{Cdouble, 2}, + j_val::Matrix{Cdouble}, lh1::StrideOneVector{Cint}, - h_val::Array{Cdouble, 2}, + h_val::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cgrdh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cdouble}, - ), + cutest_cgrdh_( io_err, n, m, @@ -2304,7 +2033,7 @@ Usage: - x: [IN] Vector{Cdouble} - y: [IN] Vector{Cdouble} - lh1: [IN] Vector{Cint} - - h_val: [OUT] Array{Cdouble, 2} + - h_val: [OUT] Matrix{Cdouble} """ function cdh( io_err::StrideOneVector{Cint}, @@ -2313,12 +2042,9 @@ function cdh( x::StrideOneVector{Cdouble}, y::StrideOneVector{Cdouble}, lh1::StrideOneVector{Cint}, - h_val::Array{Cdouble, 2}, + h_val::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cdh_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), + cutest_cdh_( io_err, n, m, @@ -2354,7 +2080,7 @@ Usage: - x: [IN] Vector{Cdouble} - y: [IN] Vector{Cdouble} - lh1: [IN] Vector{Cint} - - h_val: [OUT] Array{Cdouble, 2} + - h_val: [OUT] Matrix{Cdouble} """ function cdhc( io_err::StrideOneVector{Cint}, @@ -2363,12 +2089,9 @@ function cdhc( x::StrideOneVector{Cdouble}, y::StrideOneVector{Cdouble}, lh1::StrideOneVector{Cint}, - h_val::Array{Cdouble, 2}, + h_val::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cdhc_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}), + cutest_cdhc_( io_err, n, m, @@ -2412,10 +2135,7 @@ function cshp( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cshp_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cshp_( io_err, n, nnzh, @@ -2467,21 +2187,7 @@ function csh( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_csh_( io_err, n, m, @@ -2537,21 +2243,7 @@ function cshc( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cshc_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_cshc_( io_err, n, m, @@ -2618,25 +2310,7 @@ function ceh( he_val::StrideOneVector{Cdouble}, byrows::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_ceh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_ceh_( io_err, n, m, @@ -2678,7 +2352,7 @@ Usage: - x: [IN] Vector{Cdouble} - iprob: [IN] Vector{Cint} - lh1: [IN] Vector{Cint} - - h: [OUT] Array{Cdouble, 2} + - h: [OUT] Matrix{Cdouble} """ function cidh( io_err::StrideOneVector{Cint}, @@ -2686,12 +2360,9 @@ function cidh( x::StrideOneVector{Cdouble}, iprob::StrideOneVector{Cint}, lh1::StrideOneVector{Cint}, - h::Array{Cdouble, 2}, + h::Matrix{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cidh_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}), + cutest_cidh_( io_err, n, x, @@ -2741,20 +2412,7 @@ function cish( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cish_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_cish_( io_err, n, x, @@ -2824,27 +2482,7 @@ function csgrsh( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csgrsh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_csgrsh_( io_err, n, m, @@ -2933,31 +2571,7 @@ function csgreh( he_val::StrideOneVector{Cdouble}, byrows::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csgreh_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_csgreh_( io_err, n, m, @@ -3019,19 +2633,7 @@ function chprod( vector::StrideOneVector{Cdouble}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_chprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - ), + cutest_chprod_( io_err, n, m, @@ -3092,23 +2694,7 @@ function cshprod( index_nz_result::StrideOneVector{Cint}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cshprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - ), + cutest_cshprod_( io_err, n, m, @@ -3162,19 +2748,7 @@ function chcprod( vector::StrideOneVector{Cdouble}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_chcprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cdouble}, - ), + cutest_chcprod_( io_err, n, m, @@ -3233,23 +2807,7 @@ function cshcprod( index_nz_result::StrideOneVector{Cint}, result::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cshcprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - ), + cutest_cshcprod_( io_err, n, m, @@ -3307,21 +2865,7 @@ function cjprod( result::StrideOneVector{Cdouble}, lresult::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cjprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_cjprod_( io_err, n, m, @@ -3386,25 +2930,7 @@ function csjprod( result::StrideOneVector{Cdouble}, lresult::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csjprod_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - ), + cutest_csjprod_( io_err, n, m, @@ -3464,21 +2990,7 @@ function cchprods( chp_ind::StrideOneVector{Cint}, chp_ptr::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cchprods_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cdouble}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_cchprods_( io_err, n, m, @@ -3515,10 +3027,7 @@ function cchprodsp( chp_ind::StrideOneVector{Cint}, chp_ptr::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cchprodsp_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_cchprodsp_( io_err, m, lchp, @@ -3542,7 +3051,7 @@ Usage: - io_err: [OUT] Vector{Cint} """ function uterminate(io_err::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_uterminate_"), Nothing, (Ptr{Cint},), io_err) + cutest_uterminate_(io_err) end """# cterminate @@ -3560,7 +3069,7 @@ Usage: - io_err: [OUT] Vector{Cint} """ function cterminate(io_err::StrideOneVector{Cint}) - ccall(dlsym(cutest_lib, "cutest_cterminate_"), Nothing, (Ptr{Cint},), io_err) + cutest_cterminate_(io_err) end """# cifn @@ -3589,10 +3098,7 @@ function cifn( x::StrideOneVector{Cdouble}, f::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cifn_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_cifn_( io_err, n, iprob, @@ -3632,10 +3138,7 @@ function cisgr( g_val::StrideOneVector{Cdouble}, g_var::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_cisgr_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cint}), + cutest_cisgr_( io_err, n, iprod, @@ -3676,10 +3179,7 @@ function csgrp( j_var::StrideOneVector{Cint}, j_fun::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csgrp_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cint}), + cutest_csgrp_( io_err, n, nnzj, @@ -3711,10 +3211,7 @@ function cigr( x::StrideOneVector{Cdouble}, g_val::StrideOneVector{Cdouble}, ) - ccall( - dlsym(cutest_lib, "cutest_cigr_"), - Nothing, - (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}), + cutest_cigr_( io_err, n, iprob, @@ -3757,21 +3254,7 @@ function csgrshp( h_row::StrideOneVector{Cint}, h_col::StrideOneVector{Cint}, ) - ccall( - dlsym(cutest_lib, "cutest_csgrshp_"), - Nothing, - ( - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - Ptr{Cint}, - ), + cutest_csgrshp_( io_err, n, nnzj, diff --git a/src/julia_interface.jl b/src/julia_interface.jl index ba3b1c70..6e679945 100644 --- a/src/julia_interface.jl +++ b/src/julia_interface.jl @@ -20,10 +20,7 @@ function NLPModels.objcons!( io_err = Cint[0] f = Cdouble[0] if ncon > 0 - ccall( - dlsym(cutest_lib, :cutest_cfn_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ref{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}), + cutest_cfn_( io_err, nvar, ncon, @@ -33,10 +30,7 @@ function NLPModels.objcons!( ) increment!(nlp, :neval_cons) else - ccall( - dlsym(cutest_lib, :cutest_ufn_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Float64}, Ptr{Float64}), + cutest_ufn_( io_err, nvar, x, @@ -86,10 +80,7 @@ function NLPModels.objgrad!( io_err = Cint[0] get_grad = 1 if nlp.meta.ncon > 0 - ccall( - dlsym(cutest_lib, "cutest_cofg_"), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ref{Int32}), + cutest_cofg_( io_err, nvar, x, @@ -98,10 +89,7 @@ function NLPModels.objgrad!( get_grad, ) else - ccall( - dlsym(cutest_lib, "cutest_uofg_"), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}, Ref{Int32}), + cutest_uofg_( io_err, nvar, x, @@ -180,22 +168,7 @@ function cons_coord!( jsize = nlp.meta.nnzj get_j = 1 - ccall( - dlsym(cutest_lib, :cutest_ccfsg_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Int32}, - Ptr{Int32}, - Ref{Int32}, - ), + cutest_ccfsg_( io_err, nvar, ncon, @@ -336,10 +309,7 @@ function NLPModels.jac_structure!( io_err = Cint[0] this_nnzj = Cint[0] - ccall( - dlsym(cutest_lib, :cutest_csjp_), - Nothing, - (Ptr{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_csjp_( io_err, this_nnzj, nnzj, @@ -360,10 +330,7 @@ function NLPModels.jac_structure!(nlp::CUTEstModel) io_err = Cint[0] this_nnzj = Cint[0] - ccall( - dlsym(cutest_lib, :cutest_csjp_), - Nothing, - (Ptr{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_csjp_( io_err, this_nnzj, nnzj, @@ -505,21 +472,7 @@ function NLPModels.jprod!( got_j = 0 jtrans = 0 io_err = Cint[0] - ccall( - dlsym(cutest_lib, :cutest_cjprod_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ref{Int32}, - Ptr{Float64}, - Ref{Int32}, - ), + cutest_cjprod_( io_err, nvar, ncon, @@ -602,21 +555,7 @@ function NLPModels.jtprod!( got_j = 0 jtrans = 1 io_err = Cint[0] - ccall( - dlsym(cutest_lib, :cutest_cjprod_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ref{Int32}, - Ptr{Float64}, - Ref{Int32}, - ), + cutest_cjprod_( io_err, nvar, ncon, @@ -701,10 +640,7 @@ function NLPModels.hess_structure!( this_nnzh = Cint[0] if ncon > 0 - ccall( - dlsym(cutest_lib, :cutest_cshp_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_cshp_( io_err, nvar, this_nnzh, @@ -714,10 +650,7 @@ function NLPModels.hess_structure!( ) @cutest_error else - ccall( - dlsym(cutest_lib, :cutest_ushp_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_ushp_( io_err, nvar, this_nnzh, @@ -742,10 +675,7 @@ function NLPModels.hess_structure!(nlp::CUTEstModel) this_nnzh = Cint[0] if ncon > 0 - ccall( - dlsym(cutest_lib, :cutest_cshp_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_cshp_( io_err, nvar, this_nnzh, @@ -755,10 +685,7 @@ function NLPModels.hess_structure!(nlp::CUTEstModel) ) @cutest_error else - ccall( - dlsym(cutest_lib, :cutest_ushp_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Int32}), + cutest_ushp_( io_err, nvar, this_nnzh, @@ -803,21 +730,7 @@ function NLPModels.hess_coord!( this_nnzh = Cint[0] if obj_weight == 0.0 && ncon > 0 - ccall( - dlsym(cutest_lib, :cutest_cshc_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Int32}, - Ptr{Int32}, - ), + cutest_cshc_( io_err, nvar, ncon, @@ -838,21 +751,7 @@ function NLPModels.hess_coord!( # σ H₀ + ∑ᵢ yᵢ Hᵢ = σ (H₀ + ∑ᵢ (yᵢ/σ) Hᵢ) z = obj_weight == 1.0 ? y : y / obj_weight - ccall( - dlsym(cutest_lib, :cutest_csh_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Int32}, - Ptr{Int32}, - ), + cutest_csh_( io_err, nvar, ncon, @@ -865,19 +764,7 @@ function NLPModels.hess_coord!( nlp.hrows, ) else - ccall( - dlsym(cutest_lib, :cutest_ush_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Int32}, - Ref{Int32}, - Ptr{Float64}, - Ptr{Int32}, - Ptr{Int32}, - ), + cutest_ush_( io_err, nvar, x, @@ -943,19 +830,7 @@ function NLPModels.hprod!( io_err = Cint[0] goth = Cint[0] if obj_weight == 0.0 && ncon > 0 - ccall( - dlsym(cutest_lib, :cutest_chcprod_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Float64}, - ), + cutest_chcprod_( io_err, nvar, ncon, @@ -974,19 +849,7 @@ function NLPModels.hprod!( # σ H₀ + ∑ᵢ yᵢ Hᵢ = σ (H₀ + ∑ᵢ (yᵢ/σ) Hᵢ) z = obj_weight == 1 ? y : y / obj_weight - ccall( - dlsym(cutest_lib, :cutest_chprod_), - Nothing, - ( - Ptr{Int32}, - Ref{Int32}, - Ref{Int32}, - Ptr{Int32}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Float64}, - Ptr{Float64}, - ), + cutest_chprod_( io_err, nvar, ncon, @@ -997,10 +860,7 @@ function NLPModels.hprod!( hv, ) else - ccall( - dlsym(cutest_lib, :cutest_uhprod_), - Nothing, - (Ptr{Int32}, Ref{Int32}, Ptr{Int32}, Ptr{Float64}, Ptr{Float64}, Ptr{Float64}), + cutest_uhprod_( io_err, nvar, goth,