casadi 3.6.4__cp37-none-manylinux2014_i686.whl → 3.6.6__cp37-none-manylinux2014_i686.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (494) hide show
  1. casadi/_casadi.so +0 -0
  2. casadi/casadi.py +984 -500
  3. casadi/cbc +0 -0
  4. casadi/clp +0 -0
  5. casadi/cmake/casadi-config-version.cmake +1 -1
  6. casadi/cmake/highs/highs-config.cmake +6 -13
  7. casadi/cmake/highs/highs-targets-release.cmake +13 -13
  8. casadi/cmake/highs/highs-targets.cmake +13 -10
  9. casadi/highs +0 -0
  10. casadi/include/casadi/casadi.i +33 -15
  11. casadi/include/casadi/casadi_c.h +2 -0
  12. casadi/include/casadi/config.h +8 -8
  13. casadi/include/casadi/core/casadi_common.hpp +1 -0
  14. casadi/include/casadi/core/casadi_misc.hpp +13 -0
  15. casadi/include/casadi/core/casadi_types.hpp +3 -2
  16. casadi/include/casadi/core/code_generator.hpp +59 -2
  17. casadi/include/casadi/core/core.hpp +1 -0
  18. casadi/include/casadi/core/generic_expression.hpp +1 -1
  19. casadi/include/casadi/core/generic_type.hpp +25 -1
  20. casadi/include/casadi/core/global_options.hpp +2 -0
  21. casadi/include/casadi/core/matrix_decl.hpp +15 -0
  22. casadi/include/casadi/core/mx.hpp +13 -3
  23. casadi/include/casadi/core/optistack.hpp +23 -0
  24. casadi/include/casadi/core/runtime/casadi_nlp.hpp +133 -6
  25. casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
  26. casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
  27. casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
  28. casadi/include/casadi/core/runtime/casadi_runtime.hpp +4 -1
  29. casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
  30. casadi/include/casadi/core/runtime/casadi_sqpmethod.hpp +11 -1
  31. casadi/include/casadi/core/serializing_stream.hpp +2 -2
  32. casadi/include/casadi/core/sparsity.hpp +12 -3
  33. casadi/include/casadi/core/tools.hpp +67 -0
  34. casadi/include/casadi/doc.i +2283 -1491
  35. casadi/include/casadi/doc_merged.i +1522 -1065
  36. casadi/include/casadi/mem.h +1 -0
  37. casadi/include/coin-or/IpAlgBuilder.hpp +417 -0
  38. casadi/include/coin-or/IpAlgStrategy.hpp +201 -0
  39. casadi/include/coin-or/IpAlgTypes.hpp +64 -0
  40. casadi/include/coin-or/IpAugSystemSolver.hpp +212 -0
  41. casadi/include/coin-or/IpBlas.hpp +426 -0
  42. casadi/include/coin-or/IpCachedResults.hpp +897 -0
  43. casadi/include/coin-or/IpCompoundMatrix.hpp +423 -0
  44. casadi/include/coin-or/IpCompoundSymMatrix.hpp +348 -0
  45. casadi/include/coin-or/IpCompoundVector.hpp +395 -0
  46. casadi/include/coin-or/IpConvCheck.hpp +97 -0
  47. casadi/include/coin-or/IpDebug.hpp +167 -0
  48. casadi/include/coin-or/IpDenseVector.hpp +626 -0
  49. casadi/include/coin-or/IpDiagMatrix.hpp +158 -0
  50. casadi/include/coin-or/IpEqMultCalculator.hpp +76 -0
  51. casadi/include/coin-or/IpException.hpp +156 -0
  52. casadi/include/coin-or/IpExpansionMatrix.hpp +245 -0
  53. casadi/include/coin-or/IpGenTMatrix.hpp +290 -0
  54. casadi/include/coin-or/IpHessianUpdater.hpp +73 -0
  55. casadi/include/coin-or/IpIdentityMatrix.hpp +167 -0
  56. casadi/include/coin-or/IpIpoptAlg.hpp +257 -0
  57. casadi/include/coin-or/IpIpoptApplication.hpp +367 -0
  58. casadi/include/coin-or/IpIpoptCalculatedQuantities.hpp +1009 -0
  59. casadi/include/coin-or/IpIpoptData.hpp +966 -0
  60. casadi/include/coin-or/IpIpoptNLP.hpp +328 -0
  61. casadi/include/coin-or/IpIterateInitializer.hpp +68 -0
  62. casadi/include/coin-or/IpIteratesVector.hpp +840 -0
  63. casadi/include/coin-or/IpIterationOutput.hpp +78 -0
  64. casadi/include/coin-or/IpJournalist.hpp +573 -0
  65. casadi/include/coin-or/IpLapack.hpp +227 -0
  66. casadi/include/coin-or/IpLibraryLoader.hpp +76 -0
  67. casadi/include/coin-or/IpLineSearch.hpp +106 -0
  68. casadi/include/coin-or/IpLinearSolvers.h +46 -0
  69. casadi/include/coin-or/IpMatrix.hpp +434 -0
  70. casadi/include/coin-or/IpMuUpdate.hpp +77 -0
  71. casadi/include/coin-or/IpNLP.hpp +306 -0
  72. casadi/include/coin-or/IpNLPScaling.hpp +582 -0
  73. casadi/include/coin-or/IpObserver.hpp +422 -0
  74. casadi/include/coin-or/IpOptionsList.hpp +412 -0
  75. casadi/include/coin-or/IpOrigIpoptNLP.hpp +603 -0
  76. casadi/include/coin-or/IpPDSystemSolver.hpp +137 -0
  77. casadi/include/coin-or/IpReferenced.hpp +262 -0
  78. casadi/include/coin-or/IpRegOptions.hpp +1152 -0
  79. casadi/include/coin-or/IpReturnCodes.h +23 -0
  80. casadi/include/coin-or/IpReturnCodes.hpp +18 -0
  81. casadi/include/coin-or/IpReturnCodes.inc +71 -0
  82. casadi/include/coin-or/IpReturnCodes_inc.h +45 -0
  83. casadi/include/coin-or/IpScaledMatrix.hpp +291 -0
  84. casadi/include/coin-or/IpSearchDirCalculator.hpp +72 -0
  85. casadi/include/coin-or/IpSmartPtr.hpp +865 -0
  86. casadi/include/coin-or/IpSolveStatistics.hpp +210 -0
  87. casadi/include/coin-or/IpSparseSymLinearSolverInterface.hpp +260 -0
  88. casadi/include/coin-or/IpStdAugSystemSolver.cpp +555 -0
  89. casadi/include/coin-or/IpStdCInterface.h +428 -0
  90. casadi/include/coin-or/IpSumSymMatrix.hpp +186 -0
  91. casadi/include/coin-or/IpSymLinearSolver.hpp +141 -0
  92. casadi/include/coin-or/IpSymMatrix.hpp +167 -0
  93. casadi/include/coin-or/IpSymScaledMatrix.hpp +255 -0
  94. casadi/include/coin-or/IpSymTMatrix.hpp +275 -0
  95. casadi/include/coin-or/IpTNLP.hpp +820 -0
  96. casadi/include/coin-or/IpTNLPAdapter.hpp +648 -0
  97. casadi/include/coin-or/IpTNLPReducer.hpp +274 -0
  98. casadi/include/coin-or/IpTaggedObject.hpp +128 -0
  99. casadi/include/coin-or/IpTimedTask.hpp +218 -0
  100. casadi/include/coin-or/IpTimingStatistics.hpp +323 -0
  101. casadi/include/coin-or/IpTripletHelper.hpp +308 -0
  102. casadi/include/coin-or/IpTypes.h +81 -0
  103. casadi/include/coin-or/IpTypes.hpp +30 -0
  104. casadi/include/coin-or/IpUtils.hpp +166 -0
  105. casadi/include/coin-or/IpVector.hpp +892 -0
  106. casadi/include/coin-or/IpZeroSymMatrix.hpp +155 -0
  107. casadi/include/coin-or/IpoptConfig.h +45 -0
  108. casadi/include/coin-or/SensAlgorithm.hpp +114 -0
  109. casadi/include/coin-or/SensApplication.hpp +188 -0
  110. casadi/include/coin-or/SensBacksolver.hpp +36 -0
  111. casadi/include/coin-or/SensMeasurement.hpp +56 -0
  112. casadi/include/coin-or/SensPCalculator.hpp +137 -0
  113. casadi/include/coin-or/SensRegOp.hpp +21 -0
  114. casadi/include/coin-or/SensSchurData.hpp +182 -0
  115. casadi/include/coin-or/SensSchurDriver.hpp +118 -0
  116. casadi/include/coin-or/SensSimpleBacksolver.hpp +49 -0
  117. casadi/include/coin-or/SensStepCalc.hpp +85 -0
  118. casadi/include/coin-or/SensUtils.hpp +63 -0
  119. casadi/include/coin-or/metis/defs.h +161 -0
  120. casadi/include/coin-or/metis/macros.h +143 -0
  121. casadi/include/coin-or/metis/metis.h +37 -0
  122. casadi/include/coin-or/metis/proto.h +505 -0
  123. casadi/include/coin-or/metis/rename.h +418 -0
  124. casadi/include/coin-or/metis/struct.h +251 -0
  125. casadi/include/coin-or/mumps/dmumps_c.h +142 -0
  126. casadi/include/coin-or/mumps/mumps_c_types.h +72 -0
  127. casadi/include/coin-or/mumps/mumps_compat.h +27 -0
  128. casadi/include/coin-or/mumps/mumps_int_def.h +11 -0
  129. casadi/include/coin-or/mumps/mumps_mpi.h +67 -0
  130. casadi/include/daqp/api.h +46 -0
  131. casadi/include/daqp/auxiliary.h +29 -0
  132. casadi/include/daqp/bnb.h +32 -0
  133. casadi/include/daqp/codegen.h +18 -0
  134. casadi/include/daqp/constants.h +92 -0
  135. casadi/include/daqp/daqp.h +22 -0
  136. casadi/include/daqp/daqp_prox.h +18 -0
  137. casadi/include/daqp/factorization.h +18 -0
  138. casadi/include/daqp/types.h +161 -0
  139. casadi/include/daqp/utils.h +44 -0
  140. casadi/include/highs/HConfig.h +6 -5
  141. casadi/include/highs/Highs.h +93 -23
  142. casadi/include/highs/filereaderlp/def.hpp +19 -0
  143. casadi/include/highs/interfaces/highs_c_api.h +200 -24
  144. casadi/include/highs/io/Filereader.h +1 -1
  145. casadi/include/highs/io/FilereaderEms.h +1 -1
  146. casadi/include/highs/io/FilereaderLp.h +1 -1
  147. casadi/include/highs/io/FilereaderMps.h +1 -1
  148. casadi/include/highs/io/HMPSIO.h +1 -1
  149. casadi/include/highs/io/HMpsFF.h +5 -3
  150. casadi/include/highs/io/HighsIO.h +18 -8
  151. casadi/include/highs/io/LoadOptions.h +1 -1
  152. casadi/include/highs/ipm/IpxSolution.h +35 -0
  153. casadi/include/highs/ipm/IpxWrapper.h +1 -1
  154. casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
  155. casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
  156. casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
  157. casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
  158. casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
  159. casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
  160. casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
  161. casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
  162. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
  163. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
  164. casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
  165. casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
  166. casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
  167. casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
  168. casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
  169. casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
  170. casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
  171. casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
  172. casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
  173. casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
  174. casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
  175. casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
  176. casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
  177. casadi/include/highs/ipm/ipx/basis.h +351 -0
  178. casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
  179. casadi/include/highs/ipm/ipx/control.h +163 -0
  180. casadi/include/highs/ipm/ipx/crossover.h +157 -0
  181. casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
  182. casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
  183. casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
  184. casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
  185. casadi/include/highs/ipm/ipx/info.h +27 -0
  186. casadi/include/highs/ipm/ipx/ipm.h +94 -0
  187. casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
  188. casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
  189. casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
  190. casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
  191. casadi/include/highs/ipm/ipx/ipx_parameters.h +75 -0
  192. casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
  193. casadi/include/highs/ipm/ipx/iterate.h +328 -0
  194. casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
  195. casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
  196. casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
  197. casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
  198. casadi/include/highs/ipm/ipx/lp_solver.h +201 -0
  199. casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
  200. casadi/include/highs/ipm/ipx/lu_update.h +129 -0
  201. casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
  202. casadi/include/highs/ipm/ipx/model.h +409 -0
  203. casadi/include/highs/ipm/ipx/multistream.h +52 -0
  204. casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
  205. casadi/include/highs/ipm/ipx/power_method.h +44 -0
  206. casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
  207. casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
  208. casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
  209. casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
  210. casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
  211. casadi/include/highs/ipm/ipx/timer.h +24 -0
  212. casadi/include/highs/ipm/ipx/utils.h +39 -0
  213. casadi/include/highs/lp_data/HConst.h +20 -10
  214. casadi/include/highs/lp_data/HStruct.h +23 -1
  215. casadi/include/highs/lp_data/HighsAnalysis.h +1 -1
  216. casadi/include/highs/lp_data/HighsCallback.h +10 -3
  217. casadi/include/highs/lp_data/HighsCallbackStruct.h +31 -5
  218. casadi/include/highs/lp_data/HighsDebug.h +1 -1
  219. casadi/include/highs/lp_data/HighsInfo.h +20 -2
  220. casadi/include/highs/lp_data/HighsInfoDebug.h +1 -1
  221. casadi/include/highs/lp_data/HighsLp.h +17 -1
  222. casadi/include/highs/lp_data/HighsLpSolverObject.h +1 -1
  223. casadi/include/highs/lp_data/HighsLpUtils.h +19 -19
  224. casadi/include/highs/lp_data/HighsModelUtils.h +1 -1
  225. casadi/include/highs/lp_data/HighsOptions.h +237 -10
  226. casadi/include/highs/lp_data/HighsRanging.h +1 -1
  227. casadi/include/highs/lp_data/HighsRuntimeOptions.h +2 -2
  228. casadi/include/highs/lp_data/HighsSolution.h +2 -2
  229. casadi/include/highs/lp_data/HighsSolutionDebug.h +1 -1
  230. casadi/include/highs/lp_data/HighsSolve.h +3 -1
  231. casadi/include/highs/lp_data/HighsStatus.h +1 -1
  232. casadi/include/highs/mip/HighsCliqueTable.h +4 -4
  233. casadi/include/highs/mip/HighsConflictPool.h +1 -1
  234. casadi/include/highs/mip/HighsCutGeneration.h +1 -1
  235. casadi/include/highs/mip/HighsCutPool.h +2 -2
  236. casadi/include/highs/mip/HighsDebugSol.h +22 -29
  237. casadi/include/highs/mip/HighsDomain.h +10 -2
  238. casadi/include/highs/mip/HighsDomainChange.h +1 -1
  239. casadi/include/highs/mip/HighsDynamicRowMatrix.h +5 -3
  240. casadi/include/highs/mip/HighsGFkSolve.h +3 -3
  241. casadi/include/highs/mip/HighsImplications.h +3 -3
  242. casadi/include/highs/mip/HighsLpAggregator.h +1 -1
  243. casadi/include/highs/mip/HighsLpRelaxation.h +6 -1
  244. casadi/include/highs/mip/HighsMipSolver.h +4 -2
  245. casadi/include/highs/mip/HighsMipSolverData.h +47 -4
  246. casadi/include/highs/mip/HighsModkSeparator.h +2 -2
  247. casadi/include/highs/mip/HighsNodeQueue.h +5 -3
  248. casadi/include/highs/mip/HighsObjectiveFunction.h +1 -1
  249. casadi/include/highs/mip/HighsPathSeparator.h +2 -2
  250. casadi/include/highs/mip/HighsPrimalHeuristics.h +1 -1
  251. casadi/include/highs/mip/HighsPseudocost.h +35 -23
  252. casadi/include/highs/mip/HighsRedcostFixing.h +1 -1
  253. casadi/include/highs/mip/HighsSearch.h +2 -1
  254. casadi/include/highs/mip/HighsSeparation.h +1 -1
  255. casadi/include/highs/mip/HighsSeparator.h +1 -1
  256. casadi/include/highs/mip/HighsTableauSeparator.h +1 -1
  257. casadi/include/highs/mip/HighsTransformedLp.h +1 -1
  258. casadi/include/highs/model/HighsHessian.h +5 -0
  259. casadi/include/highs/model/HighsHessianUtils.h +2 -0
  260. casadi/include/highs/model/HighsModel.h +10 -1
  261. casadi/include/highs/parallel/HighsMutex.h +2 -1
  262. casadi/include/highs/parallel/HighsParallel.h +7 -2
  263. casadi/include/highs/parallel/HighsTask.h +1 -2
  264. casadi/include/highs/pdlp/CupdlpWrapper.h +93 -0
  265. casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +41 -0
  266. casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +423 -0
  267. casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +183 -0
  268. casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
  269. casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
  270. casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +28 -0
  271. casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
  272. casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +33 -0
  273. casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1726 -0
  274. casadi/include/highs/pdqsort/pdqsort.h +532 -0
  275. casadi/include/highs/presolve/HPresolve.h +27 -14
  276. casadi/include/highs/presolve/HPresolveAnalysis.h +1 -1
  277. casadi/include/highs/presolve/HighsPostsolveStack.h +92 -68
  278. casadi/include/highs/presolve/HighsSymmetry.h +6 -5
  279. casadi/include/highs/presolve/ICrash.h +8 -2
  280. casadi/include/highs/presolve/ICrashUtil.h +1 -1
  281. casadi/include/highs/presolve/ICrashX.h +1 -1
  282. casadi/include/highs/presolve/PresolveComponent.h +1 -1
  283. casadi/include/highs/qpsolver/a_asm.hpp +23 -12
  284. casadi/include/highs/qpsolver/a_quass.hpp +8 -1
  285. casadi/include/highs/qpsolver/basis.hpp +150 -0
  286. casadi/include/highs/qpsolver/crashsolution.hpp +12 -0
  287. casadi/include/highs/qpsolver/dantzigpricing.hpp +72 -0
  288. casadi/include/highs/qpsolver/devexpricing.hpp +99 -0
  289. casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
  290. casadi/include/highs/qpsolver/factor.hpp +400 -0
  291. casadi/include/highs/qpsolver/feasibility_bounded.hpp +105 -0
  292. casadi/include/highs/qpsolver/feasibility_highs.hpp +270 -0
  293. casadi/include/highs/qpsolver/gradient.hpp +39 -0
  294. casadi/include/highs/qpsolver/instance.hpp +63 -0
  295. casadi/include/highs/qpsolver/matrix.hpp +335 -0
  296. casadi/include/highs/qpsolver/pricing.hpp +15 -0
  297. casadi/include/highs/qpsolver/qpconst.hpp +27 -0
  298. casadi/include/highs/qpsolver/{vector.hpp → qpvector.hpp} +25 -25
  299. casadi/include/highs/qpsolver/quass.hpp +1 -1
  300. casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
  301. casadi/include/highs/qpsolver/runtime.hpp +38 -0
  302. casadi/include/highs/qpsolver/settings.hpp +57 -0
  303. casadi/include/highs/qpsolver/snippets.hpp +29 -0
  304. casadi/include/highs/qpsolver/statistics.hpp +23 -0
  305. casadi/include/highs/qpsolver/steepestedgepricing.hpp +167 -0
  306. casadi/include/highs/simplex/HApp.h +1 -1
  307. casadi/include/highs/simplex/HEkk.h +52 -18
  308. casadi/include/highs/simplex/HEkkDual.h +1 -1
  309. casadi/include/highs/simplex/HEkkDualRHS.h +6 -7
  310. casadi/include/highs/simplex/HEkkDualRow.h +2 -2
  311. casadi/include/highs/simplex/HEkkPrimal.h +6 -1
  312. casadi/include/highs/simplex/HSimplex.h +1 -3
  313. casadi/include/highs/simplex/HSimplexDebug.h +1 -1
  314. casadi/include/highs/simplex/HSimplexNla.h +1 -1
  315. casadi/include/highs/simplex/HSimplexReport.h +1 -1
  316. casadi/include/highs/simplex/HighsSimplexAnalysis.h +228 -100
  317. casadi/include/highs/simplex/SimplexConst.h +1 -1
  318. casadi/include/highs/simplex/SimplexStruct.h +2 -2
  319. casadi/include/highs/simplex/SimplexTimer.h +1 -1
  320. casadi/include/highs/test/DevKkt.h +1 -1
  321. casadi/include/highs/test/KktCh2.h +1 -1
  322. casadi/include/highs/util/FactorTimer.h +1 -1
  323. casadi/include/highs/util/HFactor.h +35 -6
  324. casadi/include/highs/util/HFactorConst.h +1 -1
  325. casadi/include/highs/util/HFactorDebug.h +1 -1
  326. casadi/include/highs/util/HSet.h +1 -1
  327. casadi/include/highs/util/HVector.h +1 -1
  328. casadi/include/highs/util/HVectorBase.h +1 -1
  329. casadi/include/highs/util/HighsCDouble.h +3 -3
  330. casadi/include/highs/util/HighsComponent.h +1 -1
  331. casadi/include/highs/util/HighsDataStack.h +4 -4
  332. casadi/include/highs/util/HighsDisjointSets.h +1 -1
  333. casadi/include/highs/util/HighsHash.h +28 -21
  334. casadi/include/highs/util/HighsHashTree.h +63 -63
  335. casadi/include/highs/util/HighsInt.h +1 -1
  336. casadi/include/highs/util/HighsIntegers.h +8 -9
  337. casadi/include/highs/util/HighsLinearSumBounds.h +1 -1
  338. casadi/include/highs/util/HighsMatrixPic.h +1 -1
  339. casadi/include/highs/util/HighsMatrixSlice.h +9 -6
  340. casadi/include/highs/util/HighsMatrixUtils.h +1 -1
  341. casadi/include/highs/util/HighsMemoryAllocation.h +55 -0
  342. casadi/include/highs/util/HighsRandom.h +27 -15
  343. casadi/include/highs/util/HighsRbTree.h +2 -2
  344. casadi/include/highs/util/HighsSort.h +7 -7
  345. casadi/include/highs/util/HighsSparseMatrix.h +5 -2
  346. casadi/include/highs/util/HighsSparseVectorSum.h +2 -2
  347. casadi/include/highs/util/HighsSplay.h +1 -1
  348. casadi/include/highs/util/HighsTimer.h +18 -9
  349. casadi/include/highs/util/HighsUtils.h +15 -8
  350. casadi/include/highs/util/stringutil.h +9 -4
  351. casadi/include/highs/zstr/strict_fstream.hpp +237 -0
  352. casadi/include/highs/zstr/zstr.hpp +472 -0
  353. casadi/include/licenses/daqp-external/LICENSE +21 -0
  354. casadi/include/licenses/highs-external/{LICENSE → LICENSE.txt} +1 -1
  355. casadi/include/osqp/constants.h +2 -3
  356. casadi/include/osqp/version.h +9 -0
  357. casadi/lib/libtinyxml2.a +0 -0
  358. casadi/libCbc.so +0 -0
  359. casadi/libCbc.so.3 +0 -0
  360. casadi/libCbc.so.3.10.11 +0 -0
  361. casadi/libCbcSolver.so +0 -0
  362. casadi/libCbcSolver.so.3 +0 -0
  363. casadi/libCbcSolver.so.3.10.11 +0 -0
  364. casadi/libCgl.so +0 -0
  365. casadi/libCgl.so.1 +0 -0
  366. casadi/libCgl.so.1.10.8 +0 -0
  367. casadi/libClp.so +0 -0
  368. casadi/libClp.so.1 +0 -0
  369. casadi/libClp.so.1.14.9 +0 -0
  370. casadi/libClpSolver.so +0 -0
  371. casadi/libClpSolver.so.1 +0 -0
  372. casadi/libClpSolver.so.1.14.9 +0 -0
  373. casadi/libCoinUtils.so +0 -0
  374. casadi/libCoinUtils.so.3 +0 -0
  375. casadi/libCoinUtils.so.3.11.10 +0 -0
  376. casadi/libOsi.so +0 -0
  377. casadi/libOsi.so.1 +0 -0
  378. casadi/libOsi.so.1.13.9 +0 -0
  379. casadi/libOsiCbc.so +0 -0
  380. casadi/libOsiCbc.so.3 +0 -0
  381. casadi/libOsiCbc.so.3.10.11 +0 -0
  382. casadi/libOsiClp.so +0 -0
  383. casadi/libOsiClp.so.1 +0 -0
  384. casadi/libOsiClp.so.1.14.9 +0 -0
  385. casadi/libOsiCommonTests.so +0 -0
  386. casadi/libOsiCommonTests.so.1 +0 -0
  387. casadi/libOsiCommonTests.so.1.13.9 +0 -0
  388. casadi/libbonmin.so +0 -0
  389. casadi/libbonmin.so.4 +0 -0
  390. casadi/libbonmin.so.4.8.9 +0 -0
  391. casadi/libcasadi.so +0 -0
  392. casadi/libcasadi.so.3.7 +0 -0
  393. casadi/libcasadi_conic_cbc.so +0 -0
  394. casadi/libcasadi_conic_cbc.so.3.7 +0 -0
  395. casadi/libcasadi_conic_clp.so +0 -0
  396. casadi/libcasadi_conic_clp.so.3.7 +0 -0
  397. casadi/libcasadi_conic_daqp.so +0 -0
  398. casadi/libcasadi_conic_daqp.so.3.7 +0 -0
  399. casadi/libcasadi_conic_gurobi.so +0 -0
  400. casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
  401. casadi/libcasadi_conic_highs.so +0 -0
  402. casadi/libcasadi_conic_highs.so.3.7 +0 -0
  403. casadi/libcasadi_conic_ipqp.so +0 -0
  404. casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
  405. casadi/libcasadi_conic_nlpsol.so +0 -0
  406. casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
  407. casadi/libcasadi_conic_osqp.so +0 -0
  408. casadi/libcasadi_conic_osqp.so.3.7 +0 -0
  409. casadi/libcasadi_conic_proxqp.so +0 -0
  410. casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
  411. casadi/libcasadi_conic_qpoases.so +0 -0
  412. casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
  413. casadi/libcasadi_conic_qrqp.so +0 -0
  414. casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
  415. casadi/libcasadi_conic_superscs.so +0 -0
  416. casadi/libcasadi_conic_superscs.so.3.7 +0 -0
  417. casadi/libcasadi_integrator_collocation.so +0 -0
  418. casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
  419. casadi/libcasadi_integrator_cvodes.so +0 -0
  420. casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
  421. casadi/libcasadi_integrator_idas.so +0 -0
  422. casadi/libcasadi_integrator_idas.so.3.7 +0 -0
  423. casadi/libcasadi_integrator_rk.so +0 -0
  424. casadi/libcasadi_integrator_rk.so.3.7 +0 -0
  425. casadi/libcasadi_nlpsol_alpaqa.so +0 -0
  426. casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
  427. casadi/libcasadi_nlpsol_ampl.so +0 -0
  428. casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
  429. casadi/libcasadi_nlpsol_blocksqp.so +0 -0
  430. casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
  431. casadi/libcasadi_nlpsol_bonmin.so +0 -0
  432. casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
  433. casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
  434. casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
  435. casadi/libcasadi_nlpsol_ipopt.so +0 -0
  436. casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
  437. casadi/libcasadi_nlpsol_knitro.so +0 -0
  438. casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
  439. casadi/libcasadi_nlpsol_madnlp.so +0 -0
  440. casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
  441. casadi/libcasadi_nlpsol_qrsqp.so +0 -0
  442. casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
  443. casadi/libcasadi_nlpsol_scpgen.so +0 -0
  444. casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
  445. casadi/libcasadi_nlpsol_sleqp.so +0 -0
  446. casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
  447. casadi/libcasadi_nlpsol_snopt.so +0 -0
  448. casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
  449. casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
  450. casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
  451. casadi/libcasadi_nlpsol_worhp.so +0 -0
  452. casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
  453. casadi/libcasadi_rootfinder_fast_newton.so +0 -0
  454. casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
  455. casadi/libcasadi_rootfinder_kinsol.so +0 -0
  456. casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
  457. casadi/libcasadi_rootfinder_newton.so +0 -0
  458. casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
  459. casadi/libcasadi_rootfinder_nlpsol.so +0 -0
  460. casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
  461. casadi/libcasadi_sundials_common.so +0 -0
  462. casadi/libcasadi_sundials_common.so.3.7 +0 -0
  463. casadi/libdaqp.so +0 -0
  464. casadi/libdaqpstat.a +0 -0
  465. casadi/libhighs.so +0 -0
  466. casadi/libhighs.so.1 +0 -0
  467. casadi/libhighs.so.1.7.2 +0 -0
  468. casadi/libindirect.a +0 -0
  469. casadi/libipopt.so +0 -0
  470. casadi/libipopt.so.3 +0 -0
  471. casadi/libipopt.so.3.14.11 +0 -0
  472. casadi/liblinsys.a +0 -0
  473. casadi/libmatlab_ipc.so +0 -0
  474. casadi/libosqp.a +0 -0
  475. casadi/libosqp.so +0 -0
  476. casadi/libqdldl.a +0 -0
  477. casadi/libsipopt.so +0 -0
  478. casadi/libsipopt.so.3 +0 -0
  479. casadi/libsipopt.so.3.14.11 +0 -0
  480. casadi/libsleqp.so +0 -0
  481. casadi/libsleqp.so.1.0.1 +0 -0
  482. casadi/libspral.a +0 -0
  483. casadi/libsuperscs.a +0 -0
  484. casadi/pkgconfig/casadi.pc +1 -1
  485. casadi/pkgconfig/highs.pc +1 -1
  486. casadi/tools/__init__.py +4 -0
  487. casadi/tools/bounds.py +3 -3
  488. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/METADATA +12 -4
  489. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/RECORD +490 -281
  490. casadi/include/highs/fortran/highs_fortran_api.mod +0 -0
  491. casadi/libFortranHighs.so +0 -0
  492. casadi/libhighs.so.1.6 +0 -0
  493. casadi/libhighs.so.1.6.0 +0 -0
  494. {casadi-3.6.4.dist-info → casadi-3.6.6.dist-info}/WHEEL +0 -0
@@ -306,15 +306,23 @@ namespace casadi {
306
306
  \identifier{qp} */
307
307
  std::vector<MX> primitives() const;
308
308
 
309
+ /// @{
309
310
  /** \brief Split up an expression along symbolic primitives
310
311
 
311
312
  \identifier{qq} */
312
313
  std::vector<MX> split_primitives(const MX& x) const;
314
+ std::vector<SX> split_primitives(const SX& x) const;
315
+ std::vector<DM> split_primitives(const DM& x) const;
316
+ /// @}
313
317
 
318
+ /// @{
314
319
  /** \brief Join an expression along symbolic primitives
315
320
 
316
321
  \identifier{qr} */
317
322
  MX join_primitives(const std::vector<MX>& v) const;
323
+ SX join_primitives(const std::vector<SX>& v) const;
324
+ DM join_primitives(const std::vector<DM>& v) const;
325
+ /// @}
318
326
 
319
327
  /// \cond INTERNAL
320
328
  /** \brief Detect duplicate symbolic expressions
@@ -655,6 +663,7 @@ namespace casadi {
655
663
  static MX convexify(const MX& H, const Dict& opts = Dict());
656
664
  static MX stop_diff(const MX& expr, casadi_int order);
657
665
  static MX stop_diff(const MX& expr, const MX& var, casadi_int order);
666
+ static std::vector<MX> difference(const std::vector<MX>& a, const std::vector<MX>& b);
658
667
  ///@}
659
668
  /// \endcond
660
669
 
@@ -836,13 +845,14 @@ namespace casadi {
836
845
  return MX::stop_diff(expr, var, order);
837
846
  }
838
847
 
848
+ /** \bried Return all elements of a that do not occur in b, preserving order */
849
+ inline friend std::vector<MX> difference(const std::vector<MX>& a, const std::vector<MX>& b) {
850
+ return MX::difference(a, b);
851
+ }
839
852
 
840
853
  /** @} */
841
854
  #endif // SWIG
842
855
 
843
- /** \bried Return all elements of a that do not occur in b, preserving order */
844
- friend std::vector<MX> difference(const std::vector<MX>& a, const std::vector<MX>& b);
845
-
846
856
  /** \brief returns itself, but with an assertion attached
847
857
  *
848
858
  * If y does not evaluate to 1, a runtime error is raised
@@ -200,6 +200,23 @@ public:
200
200
  void set_value(const std::vector<MX>& assignments);
201
201
  /// @}
202
202
 
203
+ /// @{
204
+ /** \brief Set domain of a decision variable
205
+ *
206
+ * \param[in] x decision variable
207
+ * \param[in] type 'real', 'integer' (default: real)
208
+ *
209
+ * \verbatim
210
+ * opti.set_domain(x, "real")
211
+ * opti.set_domain(x, "integer")
212
+ * \endverbatim
213
+
214
+ \identifier{27t} */
215
+ void set_domain(const MX& x, const std::string& domain);
216
+
217
+ /// @}
218
+
219
+
203
220
  /// Crunch the numbers; solve the problem
204
221
  OptiSol solve();
205
222
 
@@ -451,6 +468,11 @@ public:
451
468
  OPTI_PAR, // parameter
452
469
  OPTI_DUAL_G // dual
453
470
  };
471
+ enum DomainType {
472
+ OPTI_DOMAIN_REAL,
473
+ OPTI_DOMAIN_INTEGER
474
+ };
475
+
454
476
 
455
477
  struct IndexAbstraction {
456
478
  IndexAbstraction() : start(0), stop(0) {}
@@ -475,6 +497,7 @@ public:
475
497
  casadi_int n;
476
498
  casadi_int m;
477
499
  VariableType type;
500
+ DomainType domain;
478
501
  casadi_int count;
479
502
  casadi_int i;
480
503
  casadi_int active_i;
@@ -29,9 +29,12 @@ struct casadi_nlpsol_detect_bounds_prob {
29
29
  casadi_int ng;
30
30
  // Number of bounds
31
31
  casadi_int nb;
32
- casadi_int *target_x;
33
- casadi_int *target_g;
34
- char *is_simple;
32
+ const casadi_int *target_x;
33
+ const casadi_int *target_g;
34
+ const char *is_simple;
35
+
36
+ int (*callback)(const T1** arg, T1** res, casadi_int* iw, T1* w, void* callback_data);
37
+ void* callback_data;
35
38
  };
36
39
  // C-REPLACE "casadi_nlpsol_detect_bounds_prob<T1>" "struct casadi_nlpsol_detect_bounds_prob"
37
40
 
@@ -48,10 +51,10 @@ struct casadi_nlpsol_prob {
48
51
  template<typename T1>
49
52
  struct casadi_nlpsol_detect_bounds_data {
50
53
  // Work vectors
51
- const double** arg;
52
- double** res;
54
+ const T1** arg;
55
+ T1** res;
53
56
  casadi_int* iw;
54
- double* w;
57
+ T1* w;
55
58
 
56
59
  // Simple bounds g(x)=A(b)x+b(p);
57
60
  // a[i]*x[target_x[i]]+b[i]
@@ -63,12 +66,14 @@ struct casadi_nlpsol_detect_bounds_data {
63
66
  T1* lam_xu;
64
67
  };
65
68
  // C-REPLACE "casadi_nlpsol_detect_bounds_data<T1>" "struct casadi_nlpsol_detect_bounds_data"
69
+ // C-REPLACE "casadi_oracle_data<T1>" "struct casadi_oracle_data"
66
70
 
67
71
  // SYMBOL "nlpsol_data"
68
72
  template<typename T1>
69
73
  struct casadi_nlpsol_data {
70
74
  // Problem structure
71
75
  const casadi_nlpsol_prob<T1>* prob;
76
+ casadi_oracle_data<T1>* oracle;
72
77
  // Variable bounds
73
78
  T1 *lbz, *ubz;
74
79
  // Current primal solution
@@ -147,3 +152,125 @@ void casadi_nlpsol_init(casadi_nlpsol_data<T1>* d, const T1*** arg, T1*** res,
147
152
  }
148
153
 
149
154
  }
155
+
156
+ // C-REPLACE "fabs" "casadi_fabs"
157
+
158
+ // SYMBOL "nlpsol_detect_bounds_before"
159
+ template<typename T1>
160
+ int casadi_detect_bounds_before(casadi_nlpsol_data<T1>* d_nlp) {
161
+ const casadi_nlpsol_prob<T1>* p_nlp = d_nlp->prob;
162
+ casadi_nlpsol_detect_bounds_data<T1>* d_bounds = &d_nlp->detect_bounds;
163
+ const casadi_nlpsol_detect_bounds_prob<T1>* p_bounds = &p_nlp->detect_bounds;
164
+
165
+ casadi_int nx = p_nlp->nx;
166
+ d_bounds->arg[0] = d_nlp->p;
167
+ d_bounds->res[0] = d_bounds->a;
168
+ d_bounds->res[1] = d_bounds->b;
169
+ p_bounds->callback(d_bounds->arg, d_bounds->res,
170
+ d_bounds->iw, d_bounds->w, p_bounds->callback_data);
171
+
172
+ for (casadi_int i=0;i<p_bounds->nb;++i) {
173
+ if (d_bounds->a[i]==0) {
174
+ casadi_int k = p_bounds->target_g[i];
175
+ if (d_nlp->lbg[k]>d_bounds->b[i]) return 1;
176
+ if (d_nlp->ubg[k]<d_bounds->b[i]) return 1;
177
+ }
178
+ }
179
+
180
+ T1* lbz = d_nlp->lbz+nx;
181
+ T1* ubz = d_nlp->ubz+nx;
182
+ T1* lam = d_nlp->lam+nx;
183
+
184
+ for (casadi_int i=0;i<nx;++i) {
185
+ d_bounds->lam_xl[i] = d_nlp->lam_x0 ? (d_nlp->lam_x0[i]<0)*d_nlp->lam_x0[i] : 0.;
186
+ d_bounds->lam_xu[i] = d_nlp->lam_x0 ? (d_nlp->lam_x0[i]>0)*d_nlp->lam_x0[i] : 0.;
187
+ }
188
+
189
+ for (casadi_int i=0;i<nx;++i) {
190
+ d_bounds->target_l[i] = i;
191
+ d_bounds->target_u[i] = i;
192
+ }
193
+
194
+ // Update lbz/ubz
195
+ casadi_int k=0;
196
+ for (casadi_int i=0;i<p_bounds->ng;++i) {
197
+ if (p_bounds->is_simple[i]) {
198
+ // Update lbz/ubz
199
+ T1 lb = (d_nlp->lbg[i]-d_bounds->b[k])/fabs(d_bounds->a[k]);
200
+ T1 ub = (d_nlp->ubg[i]-d_bounds->b[k])/fabs(d_bounds->a[k]);
201
+ casadi_int j = p_bounds->target_x[k];
202
+
203
+ if (lb==d_nlp->lbz[j]) {
204
+ if (d_nlp->lam_g0) d_bounds->lam_xl[j] += (d_nlp->lam_g0[i]<0)*d_nlp->lam_g0[i];
205
+ } else if (lb>d_nlp->lbz[j]) {
206
+ d_nlp->lbz[j] = lb;
207
+ d_bounds->target_l[j] = nx+i;
208
+ if (d_nlp->lam_g0) d_bounds->lam_xl[j] = (d_nlp->lam_g0[i]<0)*d_nlp->lam_g0[i];
209
+ }
210
+
211
+ if (ub==d_nlp->ubz[j]) {
212
+ if (d_nlp->lam_g0) d_bounds->lam_xu[j] += (d_nlp->lam_g0[i]>0)*d_nlp->lam_g0[i];
213
+ } else if (ub<d_nlp->ubz[j]) {
214
+ d_nlp->ubz[j] = ub;
215
+ d_bounds->target_u[j] = nx+i;
216
+ if (d_nlp->lam_g0) d_bounds->lam_xu[j] = (d_nlp->lam_g0[i]>0)*d_nlp->lam_g0[i];
217
+ }
218
+
219
+ k++;
220
+ } else {
221
+
222
+ // Update lbz/ubz
223
+ *lbz++ = d_nlp->lbg[i];
224
+ *ubz++ = d_nlp->ubg[i];
225
+
226
+ if (d_nlp->lam_g0) *lam++ = d_nlp->lam_g0[i];
227
+ }
228
+ }
229
+
230
+ for (casadi_int i=0;i<nx;++i) {
231
+ d_nlp->lam[i] = d_bounds->lam_xl[i]+d_bounds->lam_xu[i];
232
+ }
233
+ return 0;
234
+ }
235
+
236
+ // SYMBOL "nlpsol_detect_bounds_after"
237
+ template<typename T1>
238
+ int casadi_detect_bounds_after(casadi_nlpsol_data<T1>* d_nlp) {
239
+ const casadi_nlpsol_prob<T1>* p_nlp = d_nlp->prob;
240
+ casadi_nlpsol_detect_bounds_data<T1>* d_bounds = &d_nlp->detect_bounds;
241
+ const casadi_nlpsol_detect_bounds_prob<T1>* p_bounds = &p_nlp->detect_bounds;
242
+ casadi_int nx = p_nlp->nx;
243
+
244
+ casadi_fill(d_nlp->lam_x, nx, 0.);
245
+ casadi_fill(d_nlp->lam_g, p_bounds->ng, 0.);
246
+
247
+ casadi_int k = 0;
248
+ casadi_int k_normal = 0;
249
+ for (casadi_int i=0;i<p_bounds->ng;++i) {
250
+ if (p_bounds->is_simple[i]) {
251
+ casadi_int j = p_bounds->target_x[k];
252
+ if (d_nlp->g) d_nlp->g[i] = d_bounds->a[k]*d_nlp->z[j]+d_bounds->b[k];
253
+ k++;
254
+ } else {
255
+ if (d_nlp->g) d_nlp->g[i] = d_nlp->z[nx+k_normal];
256
+ if (d_nlp->lam_g) d_nlp->lam_g[i] = d_nlp->lam[nx+k_normal];
257
+ k_normal++;
258
+ }
259
+ }
260
+
261
+ for (casadi_int i=0;i<nx;++i) {
262
+ if (d_bounds->target_l[i]<nx) {
263
+ if (d_nlp->lam_x) d_nlp->lam_x[i] += (d_nlp->lam[i]<0)*d_nlp->lam[i];
264
+ } else {
265
+ if (d_nlp->lam_g)
266
+ d_nlp->lam_g[d_bounds->target_l[i]-nx] += (d_nlp->lam[i]<0)*d_nlp->lam[i];
267
+ }
268
+ if (d_bounds->target_u[i]<nx) {
269
+ if (d_nlp->lam_x) d_nlp->lam_x[i] += (d_nlp->lam[i]>0)*d_nlp->lam[i];
270
+ } else {
271
+ if (d_nlp->lam_g)
272
+ d_nlp->lam_g[d_bounds->target_u[i]-nx] += (d_nlp->lam[i]>0)*d_nlp->lam[i];
273
+ }
274
+ }
275
+ return 0;
276
+ }
@@ -0,0 +1,55 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+
21
+ // SYMBOL "ocp_block"
22
+ struct casadi_ocp_block {
23
+ casadi_int offset_r;
24
+ casadi_int offset_c;
25
+ casadi_int rows;
26
+ casadi_int cols;
27
+ };
28
+ // C-REPLACE "casadi_ocp_block" "struct casadi_ocp_block"
29
+
30
+ // SYMBOL "unpack_ocp_blocks"
31
+ template<typename T1>
32
+ void casadi_unpack_ocp_blocks(casadi_ocp_block* blocks, const casadi_int* packed) {
33
+ casadi_int i;
34
+ casadi_int N = *packed++;
35
+ for (i=0;i<N;++i) {
36
+ blocks[i].offset_r = *packed++;
37
+ blocks[i].offset_c = *packed++;
38
+ blocks[i].rows = *packed++;
39
+ blocks[i].cols = *packed++;
40
+ }
41
+ }
42
+
43
+ // SYMBOL "ptr_ocp_block"
44
+ template<typename T1>
45
+ void casadi_ptr_ocp_block(casadi_int N, T1** vs, T1* v, const casadi_ocp_block* blocks, int eye) {
46
+ casadi_int k, offset = 0;
47
+ for (k=0;k<N;++k) {
48
+ vs[k] = v+offset;
49
+ if (eye) {
50
+ offset += blocks[k].rows;
51
+ } else {
52
+ offset += blocks[k].rows*blocks[k].cols;
53
+ }
54
+ }
55
+ }
@@ -0,0 +1,44 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+ // C-REPLACE "OracleMemory* m;" ""
21
+
22
+
23
+ // SYMBOL "oracle_data"
24
+ template<typename T1>
25
+ struct casadi_oracle_data {
26
+ const T1** arg;
27
+ T1** res;
28
+ casadi_int* iw;
29
+ T1* w;
30
+
31
+ void* m;
32
+ };
33
+
34
+ // C-REPLACE "casadi_oracle_data<T1>" "struct casadi_oracle_data"
35
+
36
+ // SYMBOL "oracle_init"
37
+ template<typename T1>
38
+ void casadi_oracle_init(casadi_oracle_data<T1>* d, const T1*** arg, T1*** res,
39
+ casadi_int** iw, T1** w) {
40
+ d->arg = *arg;
41
+ d->res = *res;
42
+ d->iw = *iw;
43
+ d->w = *w;
44
+ }
@@ -0,0 +1,39 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+ // SYMBOL "oracle_callback"
21
+ template<typename T1>
22
+ struct casadi_oracle_callback {
23
+ int (*eval)(const T1** arg, T1** res, casadi_int* iw, T1* w, int mem);
24
+ int (*checkout)(void);
25
+ void (*release)(int);
26
+ };
27
+ // C-REPLACE "casadi_oracle_callback<T1>" "struct casadi_oracle_callback"
28
+ // C-REPLACE "casadi_oracle_data<T1>" "struct casadi_oracle_data"
29
+
30
+ // SYMBOL "call"
31
+ template<typename T1>
32
+ int casadi_oracle_call(const casadi_oracle_callback<T1>* cb, casadi_oracle_data<T1>* d) {
33
+ int flag;
34
+ int mem = 0;
35
+ if (cb->checkout) mem = cb->checkout();
36
+ flag = cb->eval(d->arg, d->res, d->iw, d->w, mem);
37
+ if (cb->release) cb->release(mem);
38
+ return flag;
39
+ }
@@ -292,6 +292,7 @@ namespace casadi {
292
292
  #include "casadi_qrqp.hpp"
293
293
  #include "casadi_kkt.hpp"
294
294
  #include "casadi_ipqp.hpp"
295
+ #include "casadi_oracle.hpp"
295
296
  #include "casadi_nlp.hpp"
296
297
  #include "casadi_sqpmethod.hpp"
297
298
  #include "casadi_feasiblesqpmethod.hpp"
@@ -307,7 +308,9 @@ namespace casadi {
307
308
  #include "casadi_sum.hpp"
308
309
  #include "casadi_sparsity.hpp"
309
310
  #include "casadi_jac.hpp"
310
-
311
+ #include "casadi_oracle_callback.hpp"
312
+ #include "casadi_ocp_block.hpp"
313
+ #include "casadi_scaled_copy.hpp"
311
314
  } // namespace casadi
312
315
 
313
316
  /// \endcond
@@ -0,0 +1,31 @@
1
+ //
2
+ // MIT No Attribution
3
+ //
4
+ // Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl, KU Leuven.
5
+ //
6
+ // Permission is hereby granted, free of charge, to any person obtaining a copy of this
7
+ // software and associated documentation files (the "Software"), to deal in the Software
8
+ // without restriction, including without limitation the rights to use, copy, modify,
9
+ // merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so.
11
+ //
12
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
13
+ // INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
14
+ // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
15
+ // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
16
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
17
+ // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
+ //
19
+
20
+ // SYMBOL "scaled_copy"
21
+ template<typename T1>
22
+ void casadi_scaled_copy(T1 s, const T1* x, casadi_int n, T1* y) {
23
+ casadi_int i;
24
+ if (y) {
25
+ if (x) {
26
+ for (i=0; i<n; ++i) *y++ = s*(*x++);
27
+ } else {
28
+ for (i=0; i<n; ++i) *y++ = 0.;
29
+ }
30
+ }
31
+ }
@@ -57,6 +57,11 @@ struct casadi_sqpmethod_data {
57
57
  T1* temp_mem;
58
58
  // temp_sol
59
59
  T1* temp_sol;
60
+
61
+ const T1** arg;
62
+ T1** res;
63
+ casadi_int* iw;
64
+ T1* w;
60
65
  };
61
66
  // C-REPLACE "casadi_sqpmethod_data<T1>" "struct casadi_sqpmethod_data"
62
67
 
@@ -113,7 +118,8 @@ void casadi_sqpmethod_work(const casadi_sqpmethod_prob<T1>* p,
113
118
 
114
119
  // SYMBOL "sqpmethod_init"
115
120
  template<typename T1>
116
- void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d, casadi_int** iw, T1** w,
121
+ void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d,
122
+ const T1*** arg, T1*** res, casadi_int** iw, T1** w,
117
123
  int elastic_mode, int so_corr) {
118
124
  // Local variables
119
125
  casadi_int nnz_h, nnz_a, nx, ng;
@@ -165,4 +171,8 @@ void casadi_sqpmethod_init(casadi_sqpmethod_data<T1>* d, casadi_int** iw, T1** w
165
171
  // Jacobian
166
172
  d->Jk = *w; *w += nnz_a;
167
173
  }
174
+ d->arg = *arg;
175
+ d->res = *res;
176
+ d->iw = *iw;
177
+ d->w = *w;
168
178
  }
@@ -99,7 +99,7 @@ namespace casadi {
99
99
  void unpack(Slice& e);
100
100
  void unpack(int& e);
101
101
 
102
- #if SIZE_MAX != UINT_MAX
102
+ #if SIZE_MAX != UINT_MAX || defined(__EMSCRIPTEN__)
103
103
  void unpack(unsigned int& e);
104
104
  #endif
105
105
  void unpack(bool& e);
@@ -236,7 +236,7 @@ namespace casadi {
236
236
  void pack(const GenericType& e);
237
237
  void pack(std::istream& s);
238
238
  void pack(int e);
239
- #if SIZE_MAX != UINT_MAX
239
+ #if SIZE_MAX != UINT_MAX || defined(__EMSCRIPTEN__)
240
240
  void pack(unsigned int e);
241
241
  #endif
242
242
  void pack(bool e);
@@ -1006,7 +1006,7 @@ namespace casadi {
1006
1006
  /** \brief Propagate sparsity through a linear solve
1007
1007
 
1008
1008
  \identifier{d9} */
1009
- void spsolve(bvec_t* X, const bvec_t* B, bool tr) const;
1009
+ void spsolve(bvec_t* X, bvec_t* B, bool tr) const;
1010
1010
  #endif // SWIG
1011
1011
 
1012
1012
  /** \brief Get the location of all non-zero elements as they would appear in a Dense matrix
@@ -1199,17 +1199,26 @@ namespace casadi {
1199
1199
  /** \brief Generate a hash value incrementally, array
1200
1200
 
1201
1201
  \identifier{dq} */
1202
- inline void hash_combine(std::size_t& seed, const casadi_int* v, std::size_t sz) {
1202
+ template<typename T>
1203
+ inline void hash_combine(std::size_t& seed, const T* v, std::size_t sz) {
1203
1204
  for (casadi_int i=0; i<sz; ++i) hash_combine(seed, v[i]);
1204
1205
  }
1205
1206
 
1206
1207
  /** \brief Generate a hash value incrementally (function taken from boost)
1207
1208
 
1208
1209
  \identifier{dr} */
1209
- inline void hash_combine(std::size_t& seed, const std::vector<casadi_int>& v) {
1210
+ template<typename T>
1211
+ inline void hash_combine(std::size_t& seed, const std::vector<T>& v) {
1210
1212
  hash_combine(seed, get_ptr(v), v.size());
1211
1213
  }
1212
1214
 
1215
+ template<>
1216
+ inline size_t hash_value(std::string v) {
1217
+ size_t seed = 0;
1218
+ hash_combine(seed, v.c_str(), v.size());
1219
+ return seed;
1220
+ }
1221
+
1213
1222
  /** \brief Hash a sparsity pattern
1214
1223
 
1215
1224
  \identifier{ds} */
@@ -0,0 +1,67 @@
1
+ /*
2
+ * This file is part of CasADi.
3
+ *
4
+ * CasADi -- A symbolic framework for dynamic optimization.
5
+ * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6
+ * KU Leuven. All rights reserved.
7
+ * Copyright (C) 2011-2014 Greg Horn
8
+ *
9
+ * CasADi is free software; you can redistribute it and/or
10
+ * modify it under the terms of the GNU Lesser General Public
11
+ * License as published by the Free Software Foundation; either
12
+ * version 3 of the License, or (at your option) any later version.
13
+ *
14
+ * CasADi is distributed in the hope that it will be useful,
15
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
+ * Lesser General Public License for more details.
18
+ *
19
+ * You should have received a copy of the GNU Lesser General Public
20
+ * License along with CasADi; if not, write to the Free Software
21
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
+ *
23
+ */
24
+
25
+
26
+ #ifndef CASADI_TOOLS_HPP
27
+ #define CASADI_TOOLS_HPP
28
+
29
+ #include "casadi/core/function.hpp"
30
+
31
+ namespace casadi {
32
+
33
+ /** \brief Apply a transformation defined externally
34
+
35
+ \param name Name of the shared library
36
+ \param op Name of the operation
37
+ \param f Function to transform
38
+ \param opts Options
39
+
40
+ \identifier{27i} */
41
+ CASADI_EXPORT Function external_transform(const std::string& name,
42
+ const std::string& op,
43
+ const Function& f,
44
+ const Dict& opts=Dict());
45
+
46
+
47
+ typedef void (*external_print_callback_t)(const char* s);
48
+ typedef const char* (*external_transform_t)(char api_version, const char* casadi_version,
49
+ const char* in,
50
+ external_print_callback_t cb_stdout, external_print_callback_t cb_stderr);
51
+
52
+ } // namespace casadi
53
+
54
+ #ifndef SWIG
55
+ extern "C" {
56
+ CASADI_EXPORT const char* external_transform_test_success__f(char api_version,
57
+ const char* casadi_version,
58
+ const char* in,
59
+ casadi::external_print_callback_t cb_stdout, casadi::external_print_callback_t cb_stderr);
60
+ CASADI_EXPORT const char* external_transform_test_fail__f(char api_version,
61
+ const char* casadi_version,
62
+ const char* in,
63
+ casadi::external_print_callback_t cb_stdout, casadi::external_print_callback_t cb_stderr);
64
+ }
65
+ #endif // SWIG
66
+
67
+ #endif // CASADI_TOOLS_HPP