text:
# Julia wrapper for header: /usr/include/scip/pub_misc_select.h
# Automatically generated using Clang.jl wrap_c

function SCIPselectInd(indarray, indcomp, dataptr, k, len)
    ccall((:SCIPselectInd, libscip), Cvoid, (Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), indarray, indcomp, dataptr, k, len)
end

function SCIPselectWeightedInd(indarray, indcomp, dataptr, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedInd, libscip), Cvoid, (Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), indarray, indcomp, dataptr, weights, capacity, len, medianpos)
end

function SCIPselectPtr(ptrarray, ptrcomp, k, len)
    ccall((:SCIPselectPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint, Cint), ptrarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtr(ptrarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtr(ptrarray1, ptrarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtr(ptrarray1, ptrarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrReal(ptrarray, realarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrReal(ptrarray, realarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrInt(ptrarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrInt(ptrarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrBool(ptrarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrBool(ptrarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrIntInt(ptrarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrIntInt(ptrarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrRealInt(ptrarray, realarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrRealInt(ptrarray, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrRealRealInt(ptrarray, realarray1, realarray2, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrRealRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray1, realarray2, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrRealRealInt(ptrarray, realarray1, realarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrRealRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray1, realarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrRealBool(ptrarray, realarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrRealBool(ptrarray, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrRealReal(ptrarray, realarray1, realarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrRealReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray1, realarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrRealReal(ptrarray, realarray1, realarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrRealReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray1, realarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrInt(ptrarray1, ptrarray2, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrInt(ptrarray1, ptrarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrReal(ptrarray1, ptrarray2, realarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrReal(ptrarray1, ptrarray2, realarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrIntInt(ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrIntInt(ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrRealIntInt(ptrarray, realarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrRealIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrRealIntInt(ptrarray, realarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrRealIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrRealInt(ptrarray1, ptrarray2, realarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrRealInt(ptrarray1, ptrarray2, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrRealBool(ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrRealBool(ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrLongInt(ptrarray1, ptrarray2, longarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrLongInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, longarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrLongInt(ptrarray1, ptrarray2, longarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrLongInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, longarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectPtrPtrLongIntInt(ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrPtrLongIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrPtrLongIntInt(ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrPtrLongIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectReal(realarray, k, len)
    ccall((:SCIPselectReal, libscip), Cvoid, (Ptr{Cdouble}, Cint, Cint), realarray, k, len)
end

function SCIPselectWeightedReal(realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedReal, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, weights, capacity, len, medianpos)
end

function SCIPselectRealPtr(realarray, ptrarray, k, len)
    ccall((:SCIPselectRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, ptrarray, k, len)
end

function SCIPselectWeightedRealPtr(realarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealInt(realarray, intarray, k, len)
    ccall((:SCIPselectRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray, intarray, k, len)
end

function SCIPselectWeightedRealInt(realarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectRealIntInt(realarray, intarray1, intarray2, k, len)
    ccall((:SCIPselectRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray, intarray1, intarray2, k, len)
end

function SCIPselectWeightedRealIntInt(realarray, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectRealBoolPtr(realarray, boolarray, ptrarray, k, len)
    ccall((:SCIPselectRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, boolarray, ptrarray, k, len)
end

function SCIPselectWeightedRealBoolPtr(realarray, boolarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, boolarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealIntLong(realarray, intarray, longarray, k, len)
    ccall((:SCIPselectRealIntLong, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Clonglong}, Cint, Cint), realarray, intarray, longarray, k, len)
end

function SCIPselectWeightedRealIntLong(realarray, intarray, longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealIntLong, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, longarray, weights, capacity, len, medianpos)
end

function SCIPselectRealIntPtr(realarray, intarray, ptrarray, k, len)
    ccall((:SCIPselectRealIntPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, intarray, ptrarray, k, len)
end

function SCIPselectWeightedRealIntPtr(realarray, intarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealIntPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealRealPtr(realarray1, realarray2, ptrarray, k, len)
    ccall((:SCIPselectRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, ptrarray, k, len)
end

function SCIPselectWeightedRealRealPtr(realarray1, realarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealPtrPtrInt(realarray, ptrarray1, ptrarray2, intarray, k, len)
    ccall((:SCIPselectRealPtrPtrInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), realarray, ptrarray1, ptrarray2, intarray, k, len)
end

function SCIPselectWeightedRealPtrPtrInt(realarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealPtrPtrInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
end

function SCIPselectRealPtrPtrIntInt(realarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectRealPtrPtrIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedRealPtrPtrIntInt(realarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealPtrPtrIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectRealLongRealInt(realarray1, longarray, realarray3, intarray, k, len)
    ccall((:SCIPselectRealLongRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Clonglong}, Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray1, longarray, realarray3, intarray, k, len)
end

function SCIPselectWeightedRealLongRealInt(realarray1, longarray, realarray3, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealLongRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Clonglong}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, longarray, realarray3, intarray, weights, capacity, len, medianpos)
end

function SCIPselectRealRealIntInt(realarray1, realarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectRealRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray1, realarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedRealRealIntInt(realarray1, realarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectRealRealRealInt(realarray1, realarray2, realarray3, intarray, k, len)
    ccall((:SCIPselectRealRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray1, realarray2, realarray3, intarray, k, len)
end

function SCIPselectWeightedRealRealRealInt(realarray1, realarray2, realarray3, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, intarray, weights, capacity, len, medianpos)
end

function SCIPselectRealRealRealPtr(realarray1, realarray2, realarray3, ptrarray, k, len)
    ccall((:SCIPselectRealRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, ptrarray, k, len)
end

function SCIPselectWeightedRealRealRealPtr(realarray1, realarray2, realarray3, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealRealRealBoolPtr(realarray1, realarray2, realarray3, boolarray, ptrarray, k, len)
    ccall((:SCIPselectRealRealRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, boolarray, ptrarray, k, len)
end

function SCIPselectWeightedRealRealRealBoolPtr(realarray1, realarray2, realarray3, boolarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, boolarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectRealRealRealBoolBoolPtr(realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, k, len)
    ccall((:SCIPselectRealRealRealBoolBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, k, len)
end

function SCIPselectWeightedRealRealRealBoolBoolPtr(realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedRealRealRealBoolBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectInt(intarray, k, len)
    ccall((:SCIPselectInt, libscip), Cvoid, (Ptr{Cint}, Cint, Cint), intarray, k, len)
end

function SCIPselectWeightedInt(intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, weights, capacity, len, medianpos)
end

function SCIPselectIntInt(intarray1, intarray2, k, len)
    ccall((:SCIPselectIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Cint, Cint), intarray1, intarray2, k, len)
end

function SCIPselectWeightedIntInt(intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectIntPtr(intarray, ptrarray, k, len)
    ccall((:SCIPselectIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray, ptrarray, k, len)
end

function SCIPselectWeightedIntPtr(intarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectIntReal(intarray, realarray, k, len)
    ccall((:SCIPselectIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray, realarray, k, len)
end

function SCIPselectWeightedIntReal(intarray, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, realarray, weights, capacity, len, medianpos)
end

function SCIPselectIntIntInt(intarray1, intarray2, intarray3, k, len)
    ccall((:SCIPselectIntIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), intarray1, intarray2, intarray3, k, len)
end

function SCIPselectWeightedIntIntInt(intarray1, intarray2, intarray3, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, weights, capacity, len, medianpos)
end

function SCIPselectIntIntLong(intarray1, intarray2, longarray, k, len)
    ccall((:SCIPselectIntIntLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Clonglong}, Cint, Cint), intarray1, intarray2, longarray, k, len)
end

function SCIPselectWeightedIntIntLong(intarray1, intarray2, longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, longarray, weights, capacity, len, medianpos)
end

function SCIPselectIntRealLong(intarray, realarray, longarray, k, len)
    ccall((:SCIPselectIntRealLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Clonglong}, Cint, Cint), intarray, realarray, longarray, k, len)
end

function SCIPselectWeightedIntRealLong(intarray, realarray, longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntRealLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, realarray, longarray, weights, capacity, len, medianpos)
end

function SCIPselectIntIntPtr(intarray1, intarray2, ptrarray, k, len)
    ccall((:SCIPselectIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray1, intarray2, ptrarray, k, len)
end

function SCIPselectWeightedIntIntPtr(intarray1, intarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectIntIntReal(intarray1, intarray2, realarray, k, len)
    ccall((:SCIPselectIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, intarray2, realarray, k, len)
end

function SCIPselectWeightedIntIntReal(intarray1, intarray2, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, realarray, weights, capacity, len, medianpos)
end

function SCIPselectIntPtrReal(intarray, ptrarray, realarray, k, len)
    ccall((:SCIPselectIntPtrReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cint, Cint), intarray, ptrarray, realarray, k, len)
end

function SCIPselectWeightedIntPtrReal(intarray, ptrarray, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntPtrReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, ptrarray, realarray, weights, capacity, len, medianpos)
end

function SCIPselectIntIntIntPtr(intarray1, intarray2, intarray3, ptrarray, k, len)
    ccall((:SCIPselectIntIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray1, intarray2, intarray3, ptrarray, k, len)
end

function SCIPselectWeightedIntIntIntPtr(intarray1, intarray2, intarray3, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectIntIntIntReal(intarray1, intarray2, intarray3, realarray, k, len)
    ccall((:SCIPselectIntIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, intarray2, intarray3, realarray, k, len)
end

function SCIPselectWeightedIntIntIntReal(intarray1, intarray2, intarray3, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, realarray, weights, capacity, len, medianpos)
end

function SCIPselectIntPtrIntReal(intarray1, ptrarray, intarray2, realarray, k, len)
    ccall((:SCIPselectIntPtrIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, ptrarray, intarray2, realarray, k, len)
end

function SCIPselectWeightedIntPtrIntReal(intarray1, ptrarray, intarray2, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntPtrIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, ptrarray, intarray2, realarray, weights, capacity, len, medianpos)
end

function SCIPselectLong(longarray, k, len)
    ccall((:SCIPselectLong, libscip), Cvoid, (Ptr{Clonglong}, Cint, Cint), longarray, k, len)
end

function SCIPselectWeightedLong(longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLong, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtr(longarray, ptrarray, k, len)
    ccall((:SCIPselectLongPtr, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Cint, Cint), longarray, ptrarray, k, len)
end

function SCIPselectWeightedLongPtr(longarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtr, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrInt(longarray, ptrarray, intarray, k, len)
    ccall((:SCIPselectLongPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), longarray, ptrarray, intarray, k, len)
end

function SCIPselectWeightedLongPtrInt(longarray, ptrarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrRealBool(longarray, ptrarray, realarray, boolarray, k, len)
    ccall((:SCIPselectLongPtrRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, boolarray, k, len)
end

function SCIPselectWeightedLongPtrRealBool(longarray, ptrarray, realarray, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrRealRealBool(longarray, ptrarray, realarray, realarray2, boolarray, k, len)
    ccall((:SCIPselectLongPtrRealRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, realarray2, boolarray, k, len)
end

function SCIPselectWeightedLongPtrRealRealBool(longarray, ptrarray, realarray, realarray2, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrRealRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, realarray2, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrRealRealIntBool(longarray, ptrarray, realarray, realarray2, intarray, boolarray, k, len)
    ccall((:SCIPselectLongPtrRealRealIntBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, realarray2, intarray, boolarray, k, len)
end

function SCIPselectWeightedLongPtrRealRealIntBool(longarray, ptrarray, realarray, realarray2, intarray, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrRealRealIntBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, realarray2, intarray, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrPtrInt(longarray, ptrarray1, ptrarray2, intarray, k, len)
    ccall((:SCIPselectLongPtrPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, intarray, k, len)
end

function SCIPselectWeightedLongPtrPtrInt(longarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrPtrIntInt(longarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectLongPtrPtrIntInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedLongPtrPtrIntInt(longarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrPtrIntInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectLongPtrPtrBoolInt(longarray, ptrarray1, ptrarray2, boolarray, intarray, k, len)
    ccall((:SCIPselectLongPtrPtrBoolInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, boolarray, intarray, k, len)
end

function SCIPselectWeightedLongPtrPtrBoolInt(longarray, ptrarray1, ptrarray2, boolarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedLongPtrPtrBoolInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, boolarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectPtrIntIntBoolBool(ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, k, len)
    ccall((:SCIPselectPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, k, len)
end

function SCIPselectWeightedPtrIntIntBoolBool(ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectIntPtrIntIntBoolBool(intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, k, len)
    ccall((:SCIPselectIntPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Cint, Cint), intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, k, len)
end

function SCIPselectWeightedIntPtrIntIntBoolBool(intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedIntPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownInd(indarray, indcomp, dataptr, k, len)
    ccall((:SCIPselectDownInd, libscip), Cvoid, (Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Cint, Cint), indarray, indcomp, dataptr, k, len)
end

function SCIPselectWeightedDownInd(indarray, indcomp, dataptr, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownInd, libscip), Cvoid, (Ptr{Cint}, Ptr{Cvoid}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), indarray, indcomp, dataptr, weights, capacity, len, medianpos)
end

function SCIPselectDownPtr(ptrarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint, Cint), ptrarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtr(ptrarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtr(ptrarray1, ptrarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtr(ptrarray1, ptrarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtr, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrReal(ptrarray, realarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrReal(ptrarray, realarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrInt(ptrarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrInt(ptrarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrBool(ptrarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrBool(ptrarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrIntInt(ptrarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrIntInt(ptrarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrRealInt(ptrarray, realarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrRealInt(ptrarray, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrRealBool(ptrarray, realarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrRealBool(ptrarray, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrInt(ptrarray1, ptrarray2, intarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrInt(ptrarray1, ptrarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrReal(ptrarray1, ptrarray2, realarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrReal(ptrarray1, ptrarray2, realarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrReal, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrIntInt(ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrIntInt(ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrRealIntInt(ptrarray, realarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrRealIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray, realarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrRealIntInt(ptrarray, realarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrRealIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, realarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrRealInt(ptrarray1, ptrarray2, realarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrRealInt(ptrarray1, ptrarray2, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrRealInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrRealBool(ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrRealBool(ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrRealBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, realarray, boolarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrLongInt(ptrarray1, ptrarray2, longarray, intarray, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrLongInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, longarray, intarray, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrLongInt(ptrarray1, ptrarray2, longarray, intarray, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrLongInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, longarray, intarray, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrPtrLongIntInt(ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrPtrLongIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Cint, Cint), ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrPtrLongIntInt(ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrPtrLongIntInt, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Clonglong}, Ptr{Cint}, Ptr{Cint}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray1, ptrarray2, longarray, intarray1, intarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownReal(realarray, k, len)
    ccall((:SCIPselectDownReal, libscip), Cvoid, (Ptr{Cdouble}, Cint, Cint), realarray, k, len)
end

function SCIPselectWeightedDownReal(realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownReal, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealPtr(realarray, ptrarray, k, len)
    ccall((:SCIPselectDownRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, ptrarray, k, len)
end

function SCIPselectWeightedDownRealPtr(realarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealInt(realarray, intarray, k, len)
    ccall((:SCIPselectDownRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray, intarray, k, len)
end

function SCIPselectDownRealIntInt(realarray, intarray1, intarray2, k, len)
    ccall((:SCIPselectDownRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray, intarray1, intarray2, k, len)
end

function SCIPselectWeightedDownRealInt(realarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectWeightedDownRealIntInt(realarray, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownRealBoolPtr(realarray, boolarray, ptrarray, k, len)
    ccall((:SCIPselectDownRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, boolarray, ptrarray, k, len)
end

function SCIPselectWeightedDownRealBoolPtr(realarray, boolarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, boolarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealIntLong(realarray, intarray, longarray, k, len)
    ccall((:SCIPselectDownRealIntLong, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Clonglong}, Cint, Cint), realarray, intarray, longarray, k, len)
end

function SCIPselectWeightedDownRealIntLong(realarray, intarray, longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealIntLong, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, longarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealIntPtr(realarray, intarray, ptrarray, k, len)
    ccall((:SCIPselectDownRealIntPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, intarray, ptrarray, k, len)
end

function SCIPselectWeightedDownRealIntPtr(realarray, intarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealIntPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, intarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealInt(realarray1, realarray2, intarray, k, len)
    ccall((:SCIPselectDownRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray1, realarray2, intarray, k, len)
end

function SCIPselectWeightedDownRealRealInt(realarray1, realarray2, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealPtr(realarray1, realarray2, ptrarray, k, len)
    ccall((:SCIPselectDownRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, ptrarray, k, len)
end

function SCIPselectWeightedDownRealRealPtr(realarray1, realarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealPtrPtr(realarray1, realarray2, ptrarray1, ptrarray2, k, len)
    ccall((:SCIPselectDownRealRealPtrPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, ptrarray1, ptrarray2, k, len)
end

function SCIPselectWeightedDownRealRealPtrPtr(realarray1, realarray2, ptrarray1, ptrarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealPtrPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, ptrarray1, ptrarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownRealPtrPtrInt(realarray, ptrarray1, ptrarray2, intarray, k, len)
    ccall((:SCIPselectDownRealPtrPtrInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), realarray, ptrarray1, ptrarray2, intarray, k, len)
end

function SCIPselectWeightedDownRealPtrPtrInt(realarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealPtrPtrInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealPtrPtrIntInt(realarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectDownRealPtrPtrIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedDownRealPtrPtrIntInt(realarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealPtrPtrIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownRealLongRealInt(realarray1, longarray, realarray3, intarray, k, len)
    ccall((:SCIPselectDownRealLongRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Clonglong}, Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray1, longarray, realarray3, intarray, k, len)
end

function SCIPselectWeightedDownRealLongRealInt(realarray1, longarray, realarray3, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealLongRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Clonglong}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, longarray, realarray3, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealIntInt(realarray1, realarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectDownRealRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), realarray1, realarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedDownRealRealIntInt(realarray1, realarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealIntInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealRealInt(realarray1, realarray2, realarray3, intarray, k, len)
    ccall((:SCIPselectDownRealRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Cint, Cint), realarray1, realarray2, realarray3, intarray, k, len)
end

function SCIPselectWeightedDownRealRealRealInt(realarray1, realarray2, realarray3, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealRealInt, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealRealPtr(realarray1, realarray2, realarray3, ptrarray, k, len)
    ccall((:SCIPselectDownRealRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, ptrarray, k, len)
end

function SCIPselectWeightedDownRealRealRealPtr(realarray1, realarray2, realarray3, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealRealPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealPtrPtr(realarray, ptrarray1, ptrarray2, k, len)
    ccall((:SCIPselectDownRealPtrPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray, ptrarray1, ptrarray2, k, len)
end

function SCIPselectWeightedDownRealPtrPtr(realarray, ptrarray1, ptrarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealPtrPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray, ptrarray1, ptrarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealRealBoolPtr(realarray1, realarray2, realarray3, boolarray, ptrarray, k, len)
    ccall((:SCIPselectDownRealRealRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, boolarray, ptrarray, k, len)
end

function SCIPselectWeightedDownRealRealRealBoolPtr(realarray1, realarray2, realarray3, boolarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealRealBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, boolarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownRealRealRealBoolBoolPtr(realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, k, len)
    ccall((:SCIPselectDownRealRealRealBoolBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Cint, Cint), realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, k, len)
end

function SCIPselectWeightedDownRealRealRealBoolBoolPtr(realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownRealRealRealBoolBoolPtr, libscip), Cvoid, (Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), realarray1, realarray2, realarray3, boolarray1, boolarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownInt(intarray, k, len)
    ccall((:SCIPselectDownInt, libscip), Cvoid, (Ptr{Cint}, Cint, Cint), intarray, k, len)
end

function SCIPselectWeightedDownInt(intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntInt(intarray1, intarray2, k, len)
    ccall((:SCIPselectDownIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Cint, Cint), intarray1, intarray2, k, len)
end

function SCIPselectWeightedDownIntInt(intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownIntPtr(intarray, ptrarray, k, len)
    ccall((:SCIPselectDownIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray, ptrarray, k, len)
end

function SCIPselectWeightedDownIntPtr(intarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntReal(intarray, realarray, k, len)
    ccall((:SCIPselectDownIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray, realarray, k, len)
end

function SCIPselectWeightedDownIntReal(intarray, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray, realarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntInt(intarray1, intarray2, intarray3, k, len)
    ccall((:SCIPselectDownIntIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), intarray1, intarray2, intarray3, k, len)
end

function SCIPselectWeightedDownIntIntInt(intarray1, intarray2, intarray3, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntInt, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntLong(intarray1, intarray2, longarray, k, len)
    ccall((:SCIPselectDownIntIntLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Clonglong}, Cint, Cint), intarray1, intarray2, longarray, k, len)
end

function SCIPselectWeightedDownIntIntLong(intarray1, intarray2, longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntLong, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, longarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntPtr(intarray1, intarray2, ptrarray, k, len)
    ccall((:SCIPselectDownIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray1, intarray2, ptrarray, k, len)
end

function SCIPselectWeightedDownIntIntPtr(intarray1, intarray2, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntReal(intarray1, intarray2, realarray, k, len)
    ccall((:SCIPselectDownIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, intarray2, realarray, k, len)
end

function SCIPselectWeightedDownIntIntReal(intarray1, intarray2, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, realarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntIntPtr(intarray1, intarray2, intarray3, ptrarray, k, len)
    ccall((:SCIPselectDownIntIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Cint, Cint), intarray1, intarray2, intarray3, ptrarray, k, len)
end

function SCIPselectWeightedDownIntIntIntPtr(intarray1, intarray2, intarray3, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntIntPtr, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntIntIntReal(intarray1, intarray2, intarray3, realarray, k, len)
    ccall((:SCIPselectDownIntIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, intarray2, intarray3, realarray, k, len)
end

function SCIPselectWeightedDownIntIntIntReal(intarray1, intarray2, intarray3, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntIntIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, intarray2, intarray3, realarray, weights, capacity, len, medianpos)
end

function SCIPselectDownIntPtrIntReal(intarray1, ptrarray, intarray2, realarray, k, len)
    ccall((:SCIPselectDownIntPtrIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cint, Cint), intarray1, ptrarray, intarray2, realarray, k, len)
end

function SCIPselectWeightedDownIntPtrIntReal(intarray1, ptrarray, intarray2, realarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntPtrIntReal, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, ptrarray, intarray2, realarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLong(longarray, k, len)
    ccall((:SCIPselectDownLong, libscip), Cvoid, (Ptr{Clonglong}, Cint, Cint), longarray, k, len)
end

function SCIPselectWeightedDownLong(longarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLong, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtr(longarray, ptrarray, k, len)
    ccall((:SCIPselectDownLongPtr, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Cint, Cint), longarray, ptrarray, k, len)
end

function SCIPselectWeightedDownLongPtr(longarray, ptrarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtr, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrInt(longarray, ptrarray, intarray, k, len)
    ccall((:SCIPselectDownLongPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), longarray, ptrarray, intarray, k, len)
end

function SCIPselectWeightedDownLongPtrInt(longarray, ptrarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrRealBool(longarray, ptrarray, realarray, boolarray, k, len)
    ccall((:SCIPselectDownLongPtrRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, boolarray, k, len)
end

function SCIPselectWeightedDownLongPtrRealBool(longarray, ptrarray, realarray, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrRealRealBool(longarray, ptrarray, realarray, realarray2, boolarray, k, len)
    ccall((:SCIPselectDownLongPtrRealRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, realarray2, boolarray, k, len)
end

function SCIPselectWeightedDownLongPtrRealRealBool(longarray, ptrarray, realarray, realarray2, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrRealRealBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, realarray2, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrRealRealIntBool(longarray, ptrarray, realarray, realarray2, intarray, boolarray, k, len)
    ccall((:SCIPselectDownLongPtrRealRealIntBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{UInt32}, Cint, Cint), longarray, ptrarray, realarray, realarray2, intarray, boolarray, k, len)
end

function SCIPselectWeightedDownLongPtrRealRealIntBool(longarray, ptrarray, realarray, realarray2, intarray, boolarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrRealRealIntBool, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cint}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray, realarray, realarray2, intarray, boolarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrPtrInt(longarray, ptrarray1, ptrarray2, intarray, k, len)
    ccall((:SCIPselectDownLongPtrPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, intarray, k, len)
end

function SCIPselectWeightedDownLongPtrPtrInt(longarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrPtrInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrPtrIntInt(longarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
    ccall((:SCIPselectDownLongPtrPtrIntInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, intarray1, intarray2, k, len)
end

function SCIPselectWeightedDownLongPtrPtrIntInt(longarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrPtrIntInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, intarray1, intarray2, weights, capacity, len, medianpos)
end

function SCIPselectDownLongPtrPtrBoolInt(longarray, ptrarray1, ptrarray2, boolarray, intarray, k, len)
    ccall((:SCIPselectDownLongPtrPtrBoolInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cint}, Cint, Cint), longarray, ptrarray1, ptrarray2, boolarray, intarray, k, len)
end

function SCIPselectWeightedDownLongPtrPtrBoolInt(longarray, ptrarray1, ptrarray2, boolarray, intarray, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownLongPtrPtrBoolInt, libscip), Cvoid, (Ptr{Clonglong}, Ptr{Ptr{Cvoid}}, Ptr{Ptr{Cvoid}}, Ptr{UInt32}, Ptr{Cint}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), longarray, ptrarray1, ptrarray2, boolarray, intarray, weights, capacity, len, medianpos)
end

function SCIPselectDownPtrIntIntBoolBool(ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, k, len)
    ccall((:SCIPselectDownPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cvoid}, Cint, Cint), ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, k, len)
end

function SCIPselectWeightedDownPtrIntIntBoolBool(ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cvoid}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), ptrarray, intarray1, intarray2, boolarray1, boolarray2, ptrcomp, weights, capacity, len, medianpos)
end

function SCIPselectDownIntPtrIntIntBoolBool(intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, k, len)
    ccall((:SCIPselectDownIntPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Cint, Cint), intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, k, len)
end

function SCIPselectWeightedDownIntPtrIntIntBoolBool(intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, weights, capacity, len, medianpos)
    ccall((:SCIPselectWeightedDownIntPtrIntIntBoolBool, libscip), Cvoid, (Ptr{Cint}, Ptr{Ptr{Cvoid}}, Ptr{Cint}, Ptr{Cint}, Ptr{UInt32}, Ptr{UInt32}, Ptr{Cdouble}, Cdouble, Cint, Ptr{Cint}), intarray1, ptrarray, intarray2, intarray3, boolarray1, boolarray2, weights, capacity, len, medianpos)
end


text:
@testset "Small model join" begin
    m1 = load_model(model_paths["e_coli_core.json"])
    m2 = load_model(CoreModel, model_paths["e_coli_core.json"])

    exchange_rxn_ids = filter(looks_like_exchange_reaction, reactions(m2))
    exchange_met_ids =
        [first(keys(reaction_stoichiometry(m2, ex_rxn))) for ex_rxn in exchange_rxn_ids]

    biomass_ids = ["BIOMASS_Ecoli_core_w_GAM", "BIOMASS_Ecoli_core_w_GAM"]

    community = join_with_exchanges(
        [m1, m2],
        exchange_rxn_ids,
        exchange_met_ids;
        add_biomass_objective = true,
        biomass_ids = biomass_ids,
    )

    env_ex_inds = indexin(exchange_rxn_ids, reactions(community))
    m2_ex_inds = indexin(exchange_rxn_ids, reactions(m2))
    community.xl[env_ex_inds] .= m2.xl[m2_ex_inds]
    community.xu[env_ex_inds] .= m2.xu[m2_ex_inds]

    biomass_ids =
        ["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ecoli_core_w_GAM"]
    add_objective!(
        community,
        biomass_ids;
        objective_column_index = first(
            indexin(["community_biomass"], reactions(community)),
        ),
    )

    d = flux_balance_analysis_dict(community, Tulip.Optimizer)
    @test size(stoichiometry(community)) == (166, 211)
    @test isapprox(d["community_biomass"], 0.41559777495618294, atol = TEST_TOLERANCE)
end

@testset "Heterogenous model join" begin
    m1 = load_model(CoreModel, model_paths["e_coli_core.json"])
    m2 = load_model(CoreModel, model_paths["iJO1366.mat"])

    exchange_rxn_ids = filter(looks_like_exchange_reaction, reactions(m2))
    exchange_met_ids =
        [first(keys(reaction_stoichiometry(m2, ex_rxn))) for ex_rxn in exchange_rxn_ids]

    biomass_ids = ["BIOMASS_Ecoli_core_w_GAM", "BIOMASS_Ec_iJO1366_core_53p95M"]

    community = join_with_exchanges(
        [m1, m2],
        exchange_rxn_ids,
        exchange_met_ids;
        add_biomass_objective = true,
        biomass_ids = biomass_ids,
    )

    env_ex_inds = indexin(exchange_rxn_ids, reactions(community))
    m2_ex_inds = indexin(exchange_rxn_ids, reactions(m2))
    m1_ex_inds = indexin(exchange_rxn_ids, reactions(m1))

    for (env_ex, m2_ex, m1_ex) in zip(env_ex_inds, m2_ex_inds, m1_ex_inds)
        m2lb = isnothing(m2_ex) ? 0.0 : m2.xl[m2_ex]
        m2ub = isnothing(m2_ex) ? 0.0 : m2.xu[m2_ex]

        m1lb = isnothing(m1_ex) ? 0.0 : m1.xl[m1_ex]
        m1ub = isnothing(m1_ex) ? 0.0 : m1.xu[m1_ex]

        community.xl[env_ex] = m1lb + m2lb
        community.xu[env_ex] = m1ub + m2ub
    end

    biomass_metabolite_inds = indexin(
        ["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ec_iJO1366_core_53p95M"],
        metabolites(community),
    )

    community.S[biomass_metabolite_inds, end] .= -1.0
    community.c[end] = 1.0
    community.xl[end] = 0.0
    community.xu[end] = 1000.0

    d = flux_balance_analysis_dict(
        community,
        Tulip.Optimizer;
        modifications = [change_optimizer_attribute("IPM_IterationsLimit", 1000)],
    )

    @test size(stoichiometry(community)) == (2203, 3003)
    @test isapprox(d["community_biomass"], 0.8739215069675402, atol = TEST_TOLERANCE)
end

@testset "Community model modifications" begin
    m1 = load_model(CoreModel, model_paths["e_coli_core.json"])

    exchange_rxn_ids = filter(looks_like_exchange_reaction, reactions(m1))
    exchange_met_ids =
        [first(keys(reaction_stoichiometry(m1, ex_rxn))) for ex_rxn in exchange_rxn_ids]

    biomass_ids = ["BIOMASS_Ecoli_core_w_GAM"]

    community = join_with_exchanges(
        [m1],
        exchange_rxn_ids,
        exchange_met_ids;
        add_biomass_objective = true,
        biomass_ids = biomass_ids,
    )

    env_ex_inds = indexin(exchange_rxn_ids, reactions(community))
    m1_ex_inds = indexin(exchange_rxn_ids, reactions(m1))
    community.xl[env_ex_inds] .= m1.xl[m1_ex_inds]
    community.xu[env_ex_inds] .= m1.xu[m1_ex_inds]

    m2 = load_model(CoreModel, model_paths["e_coli_core.json"])

    community = add_model_with_exchanges(
        community,
        m2,
        exchange_rxn_ids,
        exchange_met_ids;
        model_name = "species_2",
        biomass_id = "BIOMASS_Ecoli_core_w_GAM",
    )

    biomass_ids =
        ["species_1_BIOMASS_Ecoli_core_w_GAM", "species_2_BIOMASS_Ecoli_core_w_GAM"]
    add_objective!(
        community,
        biomass_ids;
        objective_column_index = first(
            indexin(["community_biomass"], reactions(community)),
        ),
    )

    d = flux_balance_analysis_dict(community, Tulip.Optimizer)

    @test size(stoichiometry(community)) == (166, 211)
    @test isapprox(d["community_biomass"], 0.41559777495618294, atol = TEST_TOLERANCE)
end

ext: jl


text:
using JuMP
using DReal

m = Model(solver=DReal.DRealSolver(precision = 0.001))
@defVar(m, -10 <= x <= 10)
@setNLObjective(m, :Min, x^2*(x-1)*(x-2))
  status = solve(m)
println("Objective value: ", getObjectiveValue(m))
println("x = ", getValue(x))

f(x) = x^2*(x-1)*(x-2)
y = ForallVar(Float64, -10.0, 10.0)
x = Var(Float64)

add!(f(x) <= f(y))

using DReal
f(x) = x^2*(x-1)*(x-2)
x = Var(Float64, -100., 100.)
obj = Var(Float64, -100., 100.)
add!(obj == f(x))
result = minimize(obj, x, lb= -100., ub=100.)


text:
using DelaunayTriangulations:
    KDTree,
    Node,
    spatial_order,
    biased_random_order

function test_binary_search_property(tree, node_id, dim)
    root = tree.nodes[node_id]
    if root.left != 0
        left = tree.nodes[root.left]
        @test root.value[dim] >= left.value[dim]
        test_binary_search_property(tree, root.left, dim % 2 + 1)
    end
    if root.right != 0
        right = tree.nodes[root.right]
        @test root.value[dim] < right.value[dim]
        test_binary_search_property(tree, root.right, dim % 2 + 1)
    end
end

@testset "KDTree" begin
    # Check edge case of one vertex in the tree
    vertices = [(rand(), rand())]
    tree = KDTree(vertices)
    @test tree.nodes == [Node(vertices[1], 1, 0, 0)]
    # Check binary search property
    tree = KDTree([(rand(), rand()) for _ in 1:10])
    test_binary_search_property(tree, 1, 1)
    # Check sorting
    vertices = [(0.5185, 0.0347), (0.5216, 0.4219),
                (0.6828, 0.9237), (0.4302, 0.4148),
                (0.1816, 0.2890), (0.9312, 0.6561),
                (0.5897, 0.3000), (0.8778, 0.0046),
                (0.5463, 0.4520), (0.2716, 0.1995)]
    nodes = [Node(vertices[1], 1, 8, 2), Node(vertices[2], 2, 3, 4),
             Node(vertices[8], 8, 7, 0), Node(vertices[6], 6, 5, 0),
             Node(vertices[9], 9, 0, 6), Node(vertices[3], 3, 0, 0),
             Node(vertices[7], 7, 0, 0), Node(vertices[4], 4, 9, 0),
             Node(vertices[5], 5, 0, 10), Node(vertices[10], 10, 0, 0)]
    vertex_order = spatial_order(KDTree(nodes))
    @test vertex_order == [4, 7, 9, 3, 1, 10, 5, 6, 8, 2]
end

max_stars_repo_name: PaulMatlashewski/DelaunayTriangulations

max_issues_repo_name: PaulMatlashewski/DelaunayTriangulations

max_forks_repo_name: PaulMatlashewski/DelaunayTriangulations


text:
@testset "experiments" begin
	indices = collect(1:1000)
	ratios = (0.8,0.1,0.1)
	randsplit = HierarchicalAD.train_val_test_inds(indices, ratios)

	# basic index splitting
	seed = 1
	splits = [HierarchicalAD.train_val_test_inds(indices, ratios, seed=seed) for _ in 1:2]
	@test all(map(spl->all(spl[1] .== spl[2]), zip(splits[1], splits[2])))

	# data splitting
	seed = 1
	dataset = "morpho_mnist"
	filter_dict = Dict()
	ratios = (0.8,0.1,0.1)
	splits = [HierarchicalAD.load_train_val_test_data(dataset, filter_dict; ratios=ratios,
		seed=seed) for _ in 1:2];
	# test the labels
	@test all(splits[1][1][2][!,:length] .== splits[2][1][2][!,:length])
	# and the data
	@test all(splits[1][1][1][:,:,:,1:100] .== splits[2][1][1][:,:,:,1:100])
end

max_stars_repo_name: vitskvara/HierarchicalAD

max_issues_repo_name: vitskvara/HierarchicalAD

max_forks_repo_name: vitskvara/HierarchicalAD


text:
using Lale
using InteractiveUtils

using Random
using Statistics
using Test
using DataFrames: DataFrame
using AutoMLPipeline: Utils

function pauseme(msg)
  println(msg)
  println(">>> enter key to continue <<<")
  read(stdin,Char);
  nothing
end

function generateX()
   Random.seed!(123)
   iris = getiris()
   Xreg = iris[:,1:3] |> DataFrame
   Yreg = iris[:,4]   |> Vector
   Xcl  = iris[:,1:4] |> DataFrame
   Ycl  = iris[:,5]   |> Vector
   return (Xcl,Ycl)
end

function lale_demo()
  Xcl,Ycl=generateX()
  println("\n")
  println(">>>>>>>>>><<<<<<<<<<")
  println("Welcome to Lale demo")
  println(">>>>>>>>>><<<<<<<<<<")
  println("\n")
  pauseme("Let's start by loading the Iris plant dataset and show the first 5 rows.")
  println("X features:")  ;println(first(Xcl,5))
  println("\nY features:"); println(first(Ycl,5))
  pauseme("\nLet's define some Lale Operators")
  println("""
    julia code:
          pca     = laleoperator("PCA")
          rb      = laleoperator("RobustScaler","autogen")
          noop    = laleoperator("NoOp","lale")
          rfc     = laleoperator("RandomForestClassifier")
          treec   = laleoperator("DecisionTreeClassifier")
  """)
  pca     = laleoperator("PCA")
  rb      = laleoperator("RobustScaler","autogen")
  noop    = laleoperator("NoOp","lale")
  rfc     = laleoperator("RandomForestClassifier")
  treec   = laleoperator("DecisionTreeClassifier")
  pauseme("Let's build a simple Lale pipeline for classification and optimize it.")
  println("""
    julia code:
        lalepipe    = (rb + pca + noop) >>  (rfc | treec)
        lale_hopt   = LalePipeOptimizer(lalepipe,max_evals = 50,cv = 3)
        laletrained = fit(lale_hopt,Xcl,Ycl)
        lalepred    = transform(laletrained,Xcl)
        laleacc     = score(:accuracy,lalepred,Ycl)
        println("accuracy:",laleacc)
  """)
  lalepipe    = (rb + pca + noop) >>  (rfc | treec)
  lale_hopt   = LalePipeOptimizer(lalepipe,max_evals = 10,cv = 3)
  laletrained = fit(lale_hopt,Xcl,Ycl)
  lalepred    = transform(laletrained,Xcl)
  laleacc     = score(:accuracy,lalepred,Ycl)
  println("accuracy:",laleacc)
  nothing
end
lale_demo()


text:
using Forge.DSL
using ColorTypes

window = create_window(1000, 800, "Plotting Demo")
show_window(window)

function get_plot_data(range_start, range_end, dx, f)
    data = []
    for i in range_start:dx:range_end+dx
        push!(data, i, f(i))
    end
    data
end

const FRANGE_START = 0.
const FRANGE_END = 2pi

chart = create_chart_2d()

for (f, color, legend, args) in [
        (sin, RGB(1,0,0), "Sine", ())
        (cos, RGB(0,0,1), "Cosine", (Forge.FG_PLOT_LINE, Forge.FG_MARKER_NONE))
        (tan, RGB(1,1,0), "Tangent", (Forge.FG_PLOT_LINE, Forge.FG_MARKER_TRIANGLE))
        (log, RGB(.\(0xff, (0x25, 0x79, 0x73))...), "Log base 10", (Forge.FG_PLOT_LINE, Forge.FG_MARKER_TRIANGLE))
    ]
    set_axes_limits(chart, FRANGE_START, FRANGE_END, -1, 1)
    data = get_plot_data(FRANGE_START, FRANGE_END, 0.1, f)
    plot = create_plot(chart, length(data)/2, args...)
    set_color(plot, color)
    set_legend(plot, legend)
    update_vertex_buffer(plot, data)
end

draw_chart(!isclosed, window, chart)
save_framebuffer(window, "plotting.png")


text:
struct anova_bnp_fitted
    group_codes::DataFrame
    group_probs::DataFrame
    effects1::DataFrame
    effects2::DataFrame
    fpost::DataFrame
end

# Fit the model in a more pleasant way
function anova_bnp_normal(
    y::Vector{Float64},
    X::Matrix{Int};
    iter::Int = 4000, # taken from rstan::stan()
    warmup::Int = 2000, # taken from rstan::stan()
    seed::Int = 1, # taken from rstan::stan()
    n::Int = 50, # taken from ggplot2::geom_density(),
    zeta0::Float64 = 1.0,
    a0::Float64 = 1.0,
    b0::Float64 = 1.0,
    v0::Float64 = 2.0,
    r0::Float64 = 1.0,
    u0::Float64 = 0.0,
    s0::Float64 = 1.0,
)
    # Set data for training
    data0 = NormalData(X, y)

    # Set data for prediction
    G = length(data0.Xunique)
    lb = minimum(y) - 0.5 * std(y)
    ub = maximum(y) + 0.5 * std(y)
    y1 = range(lb, ub, length = n) |> x -> repeat(x, inner = G)
    X1 = repeat(vcat(data0.Xunique'...), n)
    data1 = NormalData(X1, y1)

    # Initialize the model
    N = length(y)
    rng = MersenneTwister(seed)
    m = NormalDDP(rng, N, G; a0, b0, v0, r0, u0, s0, ζ0 = zeta0)

    # Train the model
    ch = train(rng, m, data0, data1; iter, warmup);

    # Compute p(γ | y)
    group_probs = gamma_posterior(ch);

    # Compute the codebook
    group_codes = gamma_codebook(data0);

    # Compute the effects
    effects1 = simple_effect_probabilities(ch, data0)
    effects2 = interaction_effect_probabilities(ch, data0)

    # Compute p(y0 | y)
    fpost = DataFrame(group = data1.x, y = data1.y, f = mean(ch.f))

    return anova_bnp_fitted(
        group_codes,
        group_probs,
        effects1,
        effects2,
        fpost
    )
end

group_codes(x::anova_bnp_fitted) = x.group_codes
group_probs(x::anova_bnp_fitted) = x.group_probs
effects1(x::anova_bnp_fitted) = x.effects1
effects2(x::anova_bnp_fitted) = x.effects2
fpost(x::anova_bnp_fitted) = x.fpost


text:
## We follow Escher layout here
immutable Length{unit}
    value::Float64
end

abstract Layout
abstract LayoutAttribute <: Layout

immutable Size <: LayoutAttribute
    tile
    w_prefix
    h_prefix
    w_px::Length
    h_px::Length
end

Base.size(w::Int, h::Int, lyt::Layout) = Size(lyt, "", "", Length{:px}(w), Length{:px}(h))
Base.size(w::Int, h::Int) = lyt -> size(w, h, lyt)

"Width of widget"
function width(prefix::AbstractString, px::Int, lyt::Layout)
    Size(lyt, prefix, "", Length{:px}(px), Length{:px}(-1))
end
width(prefix::AbstractString, px::Int) = lyt -> width(prefix, px, lyt)
width(px::Int, w) = width("", px, w)
width(px::Int) = w -> width(px, w)
#minwidth(w, x...) = width("min", w, x...)
#maxwidth(w, x...) = width("max", w, x...)

"Height of widget"
function height(prefix::AbstractString, px::Int, lyt::Layout)
    Size(lyt, "", prefix, Length{:px}(-1), Length{:px}(px))
end
height(prefix::AbstractString, px::Int) = lyt -> height(prefix, px, lyt)
height(px::Int, w) = height("", px, w)
height(px::Int) = w -> height(px, w)
#minheight(w, x...) = height("min", w, x...)
#maxheight(w, x...) = height("max", w, x...)

vksip(y, lyt::Layout) = size(0, y, lyt)
vskip(y) = lyt -> vskip(y, lyt)
hskip(y, lyt::Layout) = size(y, 0, lyt)
hskip(y) = lyt -> hskip(y, lyt)

## flex
immutable Grow <: LayoutAttribute
    tile
    factor
end
## factor in [0,1]
grow(factor::Real, tile) = Grow(tile, factor)
grow(factor::Real) = tile -> grow(factor, tile)
grow(tile) = grow(1.0, tile)

immutable Shrink <: LayoutAttribute
    tile
    factor
end
## factor in [0,1]
shrink(factor::Real, tile) = Shrink(tile, factor)
shrink(factor::Real) = tile -> shrink(factor, tile)
shrink(tile) = shrink(1.0, tile)

immutable Flex <: LayoutAttribute
    tile
    factor
end
## factor in [0,1]
flex(factor::Real, tile) = Flex(tile, factor)
flex(factor::Real) = tile -> flex(factor, tile)
flex(tile) = flex(1.0, tile)

## alignment
Alignments =Dict(:fill      => Gtk.GConstants.GtkAlign.FILL,
                 :axisstart => Gtk.GConstants.GtkAlign.START,
                 :start     => Gtk.GConstants.GtkAlign.START,
                 :axisend   => Gtk.GConstants.GtkAlign.END,
                 :end       => Gtk.GConstants.GtkAlign.END,
                 :center    => Gtk.GConstants.GtkAlign.CENTER,
                 :baseline  => Gtk.GConstants.GtkAlign.BASELINE)

immutable Align <: LayoutAttribute
    tile
    halign
    valign
end

align(h::Symbol, v::Symbol, lyt) = Align(lyt, Alignments[h], Alignments[v])
align(h::Symbol, v::Symbol) = lyt -> align(h, v, lyt)
halign(a::Symbol, lyt) = align(a, :fill, lyt)
halign(a::Symbol) = lyt -> halign(a, lyt)
valign(a::Symbol, lyt) = align(:fill, a, lyt)
valign(a::Symbol) = lyt -> valign(a, lyt)

## padding
immutable Pad <: LayoutAttribute
    tile
    sides
    len::Length
end
## what to put for sides?
padcontent(len, tile, sides=[:left, :right, :top, :bottom]) = Pad(tile, sides, Length{:px}(len))

paad(len::Int, widget) = padcontent(len, widget)
paad(len::Int) = widget -> pad(len, widget)
paad(sides::AbstractVector, len, tile) =
    padcontent(sides, len, Container(tile))

## Boxes
type FlowContainer <: Layout
    obj
    direction
    children
end

" vertical box"
vbox(children...) = FlowContainer(nothing, "vertical", [children...])
hbox(children...) = FlowContainer(nothing, "horizontal", [children...])

## Separator
immutable Separator <: Layout
    orient
end
separator(orient::Symbol=:horizontal) = Separator(orient)

## Tabs...
immutable Tabs <: Layout
    children
    labels
    initial::Int
end

## Tabs are a bit different than Escher
## We use pairs to label children
##
## tabs("label"=>tile, "label1"=>tile, ...; selected=1)
##
function tabs(tiles...; selected::Int=1)
    labels = [label for (label, child) in tiles]
    children = [child for (label, child) in tiles]
    Tabs(children, labels, selected)
end

type Window <: Layout
    title
    children
end

## """
## A parentless container, like MainWindow, but less fuss.
##
## Children are packed into a `vbox`.
##
## """
window(children...; title::AbstractString="") = Window(title, [children...])
window(;kwargs...) = tile -> window(tile; kwargs...)


text:
"""
    Erjulix

Julia module for communicating with Erlang and Elixir.
"""
module Erjulix

using ErlangTerm, Sockets

export eServer, pServer, EvalServer, recv_erl, send_erl

# Vector of created eServer modules
const _ESM = Module[]

include("utils.jl")
include("translate.jl")

"""
```
eServer(host::IPAddr, port::Integer, key::AbstractString)
eServer(port::Integer)
```
Create a module and spawn an `EvalServer` listening to an UDP `port`
in its namespace and return the module.
"""
function eServer(host::IPAddr, port::Integer, key::AbstractString)
    sock = UDPSocket()
    if bind(sock, host, port)
        mdl = Module(gensym(:esm))
        hp = getHostPort(sock)
        println("start EvalServer $host:$(hp.port), $mdl")
        t = Threads.@spawn EvalServer(sock, mdl, key)
        Core.eval(mdl, :(_socket = $sock))
        Core.eval(mdl, :(_eServer = $t))
        push!(_ESM, mdl)
        mdl
    else
        println(stderr, "port $port not available")
        close(sock)
    end
end
eServer(port::Integer) = eServer(Sockets.localhost, port, "")

"""
    EvalServer(port::Integer, mod::Module, key::AbstractString)

An `EvalServer` runs as a task with its own module namespace.
It receives UDP message tuples from Erlang:

- `(:eval, term)`: where `term` is a `Symbol` or a `String`,
- `(:call, term, args)`: with `term` as above and `args` a `Vector{Any}`,
- `(:set, atoms, vals)`: where `atoms` is a `Symbol` or a vector
    of them and `vals` is a value `Any` or a vector of them.

It then evaluates the messages in its namespace as

1. strings to parse or symbols to evaluate,
2. functions to execute with arguments or
3. variables to create or to assign values to.

It sends a result tuple back to the Erlang client.

The server finishes if it gets an `"exit"` or `:exit` message.

If `!isempty(key)`, the UDP packages get sha-256 encoded/decoded
with that key as JSON Web tokens.
"""
function EvalServer(sock::UDPSocket, mod::Module, key::AbstractString)
    while true
        hp, msg = recvfrom(sock)
        isexit(msg) && break
        val = deserializek(msg, key)
    # println(@show val)
        if val == :exit
            send(sock, hp.host, hp.port, serializek((:ok, :done), key))
            break
        else
            msg = try
                res = _exec(mod, val)
                serializek((:ok, res), key)
            catch exc
            # rethrow()
                serializek((:error, repr(exc)), key)
            end
            send(sock, hp.host, hp.port, msg)
        end
    end
    close(sock)
    println("EvalServer $mod done")
end

function _exec(m, val)
    # println("received: $val")
    exec(m, Val(first(val)), val[2:end]...)
end
function exec(m, ::Val{:eval}, str::String)
    Core.eval(m, Meta.parse(str))
end
function exec(m, ::Val{:eval}, sym::Symbol)
    Core.eval(m, sym)
end
function exec(m, ::Val{:call}, sym::Symbol, args)
    Base.invokelatest(Core.eval(m, sym), args...)
end
function exec(m, ::Val{:call}, str::String, args)
    Core.eval(m, Meta.parse(str))(args...)
end
function exec(m, ::Val{:set}, x::Symbol, arg)
    (Core.eval(m, :($x = $arg)); nothing)
end
function exec(m, ::Val{:set}, xs::Vector{Any}, args::Vector{Any})
    for (i, x) in enumerate(xs)
        Core.eval(m, :($x = $(args[i])))
    end
    nothing
end
function exec(_, cmd, args...)
    throw(ArgumentError("cannot $cmd $args"))
end

isexit(msg::Vector{UInt8}) = String(copy(msg)) == "exit"
isexit(msg) = msg == :exit

"""
```
pServer(port::Integer)
pServer(host::IPAddr, port::Integer, key::AbstractString)
```

Start a server listening to an UDP `port` and starting
parallel `EvalServer`s if requested.
"""
function pServer(host::IPAddr, port::Integer, key::AbstractString)
    sock = UDPSocket()
    if bind(sock, host, port)
        Threads.@spawn _listen(sock, port, key)
    else
        println("host $host, port $port not available")
        close(sock)
    end
end
pServer(port::Integer) = pServer(Sockets.localhost, port, "")

# listen to a UDP socket and start a parallel
# EvalServer if requested.
function _listen(sock, port, key)
    while true
        hp, msg = recvfrom(sock)
        isexit(msg) && break
        val = deserializek(msg, key)
        if val == :exit
            send(sock, hp.host, hp.port, serializek((:ok, :done), key))
            break
        elseif val == :srv
            md = parServer(hp, key)
            # println("parServer $md")
        else
            println("parServer cannot $val")
        end
    end
    println("pServer at port $port done")
    close(sock)
end

# Start a parallel EvalServer at a random port and
# respond over its socket to the requesting client
function parServer(client::Sockets.InetAddr, key::AbstractString)
    newKey = isempty(key) ? "" : genpasswd(24)
    md = client.host == Sockets.localhost ? eServer(0) : eServer(getipaddr(), 0, newKey)
    isempty(key) ?
        send(md._socket, client.host, client.port, serializek((:ok, md), key)) :
        send(md._socket, client.host, client.port, serializek((:ok, newKey, md), key))
    md
end

function recv_erl(socket::UDPSocket, timeout::Real=5)
    cond = Condition()
    Timer(_ -> notify(cond), timeout)
    t = @async begin
        msg = recv(socket)
        notify(cond)
msg
    end
    wait(cond)
    t.state == :done ?
        deserialize(fetch(t)) :
        :timeout
end

function recv_erl(port::Integer, timeout::Real=5)
    s = UDPSocket()
    rec = if bind(s, ip"127.0.0.1", port)
        recv_erl(s, timeout)
    else
        println(stderr, "port $port is not available")
        nothing
    end
    close(s)
    rec
end

function send_erl(host::IPAddr, port::Integer, msg)
    s = UDPSocket()
    send_erl(s, host, port, msg)
    close(s)
end

function send_erl(s::UDPSocket, host::IPAddr, port::Integer, msg)
    send(s, host, port, serialize(msg))
end

end

max_stars_repo_name: pbayer/erjulix

max_issues_repo_name: pbayer/erjulix

max_forks_repo_name: pbayer/erjulix


text:
module Checkpointing

using ChainRulesCore
using LinearAlgebra
using Enzyme

"""
    Scheme

Abstract type from which all checkpointing schemes are derived.

"""
abstract type Scheme end

"""
    ActionFlag

Each checkpointing algorithm currently uses the same ActionFlag type for setting the next action in the checkpointing scheme
none: no action
store: store a checkpoint now equivalent to TAKESHOT in Alg. 79
restore: restore a checkpoint now equivalent to RESTORE in Alg. 79
forward: execute iteration(s) forward equivalent to ADVANCE in Alg. 79
firstuturn: tape iteration(s); optionally leave to return later;  and (upon return) do the adjoint(s) equivalent to FIRSTTURN in Alg. 799
uturn: tape iteration(s) and do the adjoint(s) equivalent to YOUTURN in Alg. 79
done: we are done with adjoining the loop equivalent to the `terminate` enum value in Alg. 79

"""
@enum ActionFlag begin
    none
	store
	restore
	forward
	firstuturn
	uturn
	done
end

"""
    Action

Stores the state of the checkpointing scheme after an action is taken.
    * `actionflag` is the next action
    * `iteration` is number of iterations for move forward
    * `startiteration` is the loop step to start from
    * `cpnum` is the checkpoint index number

"""
struct Action
	actionflag::ActionFlag
	iteration::Int
	startiteration::Int
	cpnum::Int
end

abstract type AbstractADTool end

function jacobian(tobedifferentiated, F_H, ::AbstractADTool)
    error("No AD tool interface implemented")
end

export Scheme, AbstractADTool, jacobian, @checkpoint, @checkpoint_struct, checkpoint_struct

include("deprecated.jl")
include("Schemes/Revolve.jl")
include("Schemes/Periodic.jl")
include("Schemes/Online_r2.jl")

export Revolve, guess, factor, next_action!, ActionFlag, Periodic
export ReverseDiffADTool, ZygoteADTool, EnzymeADTool, ForwardDiffADTool, DiffractorADTool, jacobian

@generated function copyto!(dest::MT, src::MT) where {MT}
    assignments = [
        :( dest.$name = src.$name ) for name in fieldnames(MT)
    ]
    quote $(assignments...) end
end

function copyto!(dest::MT, src::TT) where {MT,TT}
    for name in (fieldnames(MT))
        if !isa(src[name], ChainRulesCore.ZeroTangent)
            setfield!(dest, name, convert(typeof(getfield(dest, name)), src[name]))
        end
    end
end

to_named_tuple(p) = (; (v=>getfield(p, v) for v in fieldnames(typeof(p)))...)

function create_tangent(shadowmodel::MT) where {MT}
    shadowtuple = to_named_tuple(shadowmodel)
    return Tangent{MT,typeof(shadowtuple)}(shadowtuple)
end

function ChainRulesCore.rrule(
    ::typeof(Checkpointing.checkpoint_struct),
    body::Function,
    alg::Scheme,
    model::MT,
    shadowmodel::MT,
) where {MT}
    model_input = deepcopy(model)
    for i in 1:alg.steps
        body(model)
    end
    function checkpoint_struct_pullback(dmodel)
        copyto!(shadowmodel, dmodel)
        model = checkpoint_struct(body, alg, model_input, shadowmodel)
        dshadowmodel = create_tangent(shadowmodel)
        return NoTangent(), NoTangent(), NoTangent(), dshadowmodel, NoTangent()
    end
    return model, checkpoint_struct_pullback
end

"""
    @checkpoint_struct(
        alg,
        model,
        shadowmodel,
        loop,
    )

Apply the checkpointing scheme `alg` on the loop `loop` expression. `model` is
the primal struct and `shadowmodel` the adjoint struct where the adjoints
are seeded and retrieved.

"""
macro checkpoint_struct(alg, model, shadowmodel, loop)
    ex = quote
        $model = checkpoint_struct($alg, $model, $shadowmodel) do $model
            $(loop.args[2])
        end
    end
    esc(ex)
end

"""
    checkpoint_struct(
        body::Function
        alg::Scheme,
        model::MT,
        shadowmodel::MT,
    ) where {MT}

Default method for the function `checkpoint_struct` if the function is not specialized for an unknown scheme `Scheme`.
`body` is the loop body as generated by the macro `@checkpoint_struct` and `MT` is the checkpointed struct.

"""
function checkpoint_struct(
        body::Function,
        alg::Scheme,
        model_input::MT,
        shadowmodel::MT
    ) where {MT}
    error("No checkpointing scheme implemented for algorithm $Scheme.")
end

end


text:
using SymbolicUtils: similarterm, operation, arguments
using DataStructures: OrderedDict
export cse

# Adaptation of this code:
# https://github.com/JuliaSymbolics/SymbolicUtils.jl/issues/121
function cse(s::Symbolic)
    vars = atoms(s)
    dict = OrderedDict()
    csestep(s, vars, dict)
    # r = @rule ~x => csestep(~x, vars, dict)
    # final = RW.Postwalk(RW.PassThrough(r))(s)
    [[var.name => ex for (ex, var) in pairs(dict)]...]
end

csestep(s::Sym, vars, dict) = s

csestep(s, vars, dict) = s

function csestep(s::Symbolic, vars, dict)
    # Avoid breaking local variables out of their scope
    isempty(setdiff(atoms(s), vars)) || return s

    f = operation(s)
    args = [csestep(arg, vars, dict) for arg in arguments(s)]

    t = similarterm(s, f, args)

    if !haskey(dict, t)
        dict[t] = Sym{symtype(t)}(gensym())
    end

    return dict[t]
end