casadi 3.6.4__cp38-none-manylinux2014_i686.whl → 3.6.6__cp38-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
@@ -0,0 +1,892 @@
1
+ // Copyright (C) 2004, 2008 International Business Machines and others.
2
+ // All Rights Reserved.
3
+ // This code is published under the Eclipse Public License.
4
+ //
5
+ // Authors: Carl Laird, Andreas Waechter IBM 2004-08-13
6
+
7
+ #ifndef __IPVECTOR_HPP__
8
+ #define __IPVECTOR_HPP__
9
+
10
+ #include "IpTypes.hpp"
11
+ #include "IpTaggedObject.hpp"
12
+ #include "IpCachedResults.hpp"
13
+ #include "IpSmartPtr.hpp"
14
+ #include "IpJournalist.hpp"
15
+ #include "IpException.hpp"
16
+
17
+ #include <vector>
18
+
19
+ namespace Ipopt
20
+ {
21
+
22
+ /** Exception that can be used to flag unimplemented linear algebra
23
+ * methods */
24
+ DECLARE_STD_EXCEPTION(UNIMPLEMENTED_LINALG_METHOD_CALLED);
25
+
26
+ /* forward declarations */
27
+ class VectorSpace;
28
+
29
+ /** Vector Base Class.
30
+ *
31
+ * This is the base class for all derived vector types. Those vectors
32
+ * are meant to store entities like iterates, Lagrangian multipliers,
33
+ * constraint values etc. The implementation of a vector type depends
34
+ * on the computational environment (e.g. just a double array on a shared
35
+ * memory machine, or distributed double arrays for a distributed
36
+ * memory machine.)
37
+ *
38
+ * Deriving from Vector: This class inherits from tagged object to
39
+ * implement an advanced caching scheme. Because of this, the
40
+ * TaggedObject method ObjectChanged() must be called each time the
41
+ * Vector changes. If you overload the XXXX_Impl protected methods,
42
+ * this taken care of (along with caching if possible) for you. If
43
+ * you have additional methods in your derived class that change the
44
+ * underlying data (vector values), you MUST remember to call
45
+ * ObjectChanged() AFTER making the change!
46
+ */
47
+ class IPOPTLIB_EXPORT Vector: public TaggedObject
48
+ {
49
+ public:
50
+ /** @name Constructor/Destructor */
51
+ ///@{
52
+ /** Constructor.
53
+ *
54
+ * It has to be given a pointer to the corresponding VectorSpace.
55
+ */
56
+ inline Vector(
57
+ const VectorSpace* owner_space
58
+ );
59
+
60
+ /** Destructor */
61
+ inline virtual ~Vector();
62
+ ///@}
63
+
64
+ /** Create new Vector of the same type with uninitialized data */
65
+ inline Vector* MakeNew() const;
66
+
67
+ /** Create new Vector of the same type and copy the data over */
68
+ inline Vector* MakeNewCopy() const;
69
+
70
+ /**@name Standard BLAS-1 Operations
71
+ * (derived classes do NOT overload these
72
+ * methods, instead, overload the
73
+ * protected versions of these methods).
74
+ */
75
+ ///@{
76
+ /** Copy the data of the vector x into this vector (DCOPY). */
77
+ inline void Copy(
78
+ const Vector& x
79
+ );
80
+
81
+ /** Scales the vector by scalar alpha (DSCAL) */
82
+ void Scal(
83
+ Number alpha
84
+ );
85
+
86
+ /** Add the multiple alpha of vector x to this vector (DAXPY) */
87
+ inline void Axpy(
88
+ Number alpha,
89
+ const Vector& x
90
+ );
91
+
92
+ /** Computes inner product of vector x with this (DDOT) */
93
+ inline Number Dot(
94
+ const Vector& x
95
+ ) const;
96
+
97
+ /** Computes the 2-norm of this vector (DNRM2) */
98
+ inline Number Nrm2() const;
99
+
100
+ /** Computes the 1-norm of this vector (DASUM) */
101
+ inline Number Asum() const;
102
+
103
+ /** Computes the max-norm of this vector (based on IDAMAX) */
104
+ inline Number Amax() const;
105
+ ///@}
106
+
107
+ /** @name Additional (Non-BLAS) Vector Methods
108
+ * (derived classes do NOT overload these
109
+ * methods, instead, overload the
110
+ * protected versions of these methods).
111
+ */
112
+ ///@{
113
+ /** Set each element in the vector to the scalar alpha. */
114
+ inline void Set(
115
+ Number alpha
116
+ );
117
+
118
+ /** Element-wise division \f$y_i \gets y_i/x_i\f$ */
119
+ inline void ElementWiseDivide(
120
+ const Vector& x
121
+ );
122
+
123
+ /** Element-wise multiplication \f$y_i \gets y_i*x_i\f$ */
124
+ inline void ElementWiseMultiply(
125
+ const Vector& x
126
+ );
127
+
128
+ /** Element-wise selection \f$y_i \gets sgn(y_i)x_i, if y_i != 0, else 0\f$
129
+ *
130
+ * So like ElementWiseSgn().ElementWiseMultiply(x), but with 0*inf = 0.
131
+ * @since 3.14.0
132
+ */
133
+ inline void ElementWiseSelect(
134
+ const Vector& x
135
+ );
136
+
137
+ /** Element-wise max against entries in x */
138
+ inline void ElementWiseMax(
139
+ const Vector& x
140
+ );
141
+
142
+ /** Element-wise min against entries in x */
143
+ inline void ElementWiseMin(
144
+ const Vector& x
145
+ );
146
+
147
+ /** Reciprocates the entries in the vector */
148
+ inline void ElementWiseReciprocal();
149
+
150
+ /** Absolute values of the entries in the vector */
151
+ inline void ElementWiseAbs();
152
+
153
+ /** Element-wise square root of the entries in the vector */
154
+ inline void ElementWiseSqrt();
155
+
156
+ /** Replaces the vector values with their sgn values
157
+ * ( -1 if x_i < 0, 0 if x_i == 0, and 1 if x_i > 0)
158
+ */
159
+ inline void ElementWiseSgn();
160
+
161
+ /** Add scalar to every vector component */
162
+ inline void AddScalar(
163
+ Number scalar
164
+ );
165
+
166
+ /** Returns the maximum value in the vector */
167
+ inline Number Max() const;
168
+
169
+ /** Returns the minimum value in the vector */
170
+ inline Number Min() const;
171
+
172
+ /** Returns the sum of the vector entries */
173
+ inline Number Sum() const;
174
+
175
+ /** Returns the sum of the logs of each vector entry */
176
+ inline Number SumLogs() const;
177
+ ///@}
178
+
179
+ /** @name Methods for specialized operations.
180
+ *
181
+ * A prototype implementation is provided, but for efficient
182
+ * implementation those should be specially implemented.
183
+ */
184
+ ///@{
185
+ /** Add one vector, y = a * v1 + c * y.
186
+ *
187
+ * This is automatically reduced to call AddTwoVectors.
188
+ */
189
+ inline void AddOneVector(
190
+ Number a,
191
+ const Vector& v1,
192
+ Number c
193
+ );
194
+
195
+ /** Add two vectors, y = a * v1 + b * v2 + c * y.
196
+ *
197
+ * Here, this vector is y.
198
+ */
199
+ inline void AddTwoVectors(
200
+ Number a,
201
+ const Vector& v1,
202
+ Number b,
203
+ const Vector& v2,
204
+ Number c
205
+ );
206
+
207
+ /** Fraction to the boundary parameter.
208
+ *
209
+ * Computes \f$\alpha = \max\{\bar\alpha\in(0,1] : x + \bar\alpha \Delta \geq (1-\tau)x\}\f$
210
+ */
211
+ inline Number FracToBound(
212
+ const Vector& delta,
213
+ Number tau
214
+ ) const;
215
+
216
+ /** Add the quotient of two vectors, y = a * z/s + c * y. */
217
+ inline void AddVectorQuotient(
218
+ Number a,
219
+ const Vector& z,
220
+ const Vector& s,
221
+ Number c
222
+ );
223
+ ///@}
224
+
225
+ /** Method for determining if all stored numbers are valid (i.e., no Inf or Nan). */
226
+ inline bool HasValidNumbers() const;
227
+
228
+ /** @name Accessor methods */
229
+ ///@{
230
+ /** Dimension of the Vector */
231
+ inline Index Dim() const;
232
+
233
+ /** Return the owner VectorSpace*/
234
+ inline SmartPtr<const VectorSpace> OwnerSpace() const;
235
+ ///@}
236
+
237
+ /** @name Output methods
238
+ * (derived classes do NOT overload these
239
+ * methods, instead, overload the
240
+ * protected versions of these methods).
241
+ */
242
+ ///@{
243
+ /** Print the entire vector */
244
+ void Print(
245
+ SmartPtr<const Journalist> jnlst,
246
+ EJournalLevel level,
247
+ EJournalCategory category,
248
+ const std::string& name,
249
+ Index indent = 0,
250
+ const std::string& prefix = ""
251
+ ) const;
252
+
253
+ void Print(
254
+ const Journalist& jnlst,
255
+ EJournalLevel level,
256
+ EJournalCategory category,
257
+ const std::string& name,
258
+ Index indent = 0,
259
+ const std::string& prefix = ""
260
+ ) const;
261
+ ///@}
262
+
263
+ protected:
264
+ /** @name implementation methods (derived classes MUST
265
+ * overload these pure virtual protected methods.)
266
+ */
267
+ ///@{
268
+ /** Copy the data of the vector x into this vector (DCOPY). */
269
+ virtual void CopyImpl(
270
+ const Vector& x
271
+ ) = 0;
272
+
273
+ /** Scales the vector by scalar alpha (DSCAL) */
274
+ virtual void ScalImpl(
275
+ Number alpha
276
+ ) = 0;
277
+
278
+ /** Add the multiple alpha of vector x to this vector (DAXPY) */
279
+ virtual void AxpyImpl(
280
+ Number alpha,
281
+ const Vector& x
282
+ ) = 0;
283
+
284
+ /** Computes inner product of vector x with this (DDOT) */
285
+ virtual Number DotImpl(
286
+ const Vector& x
287
+ ) const = 0;
288
+
289
+ /** Computes the 2-norm of this vector (DNRM2) */
290
+ virtual Number Nrm2Impl() const = 0;
291
+
292
+ /** Computes the 1-norm of this vector (DASUM) */
293
+ virtual Number AsumImpl() const = 0;
294
+
295
+ /** Computes the max-norm of this vector (based on IDAMAX) */
296
+ virtual Number AmaxImpl() const = 0;
297
+
298
+ /** Set each element in the vector to the scalar alpha. */
299
+ virtual void SetImpl(
300
+ Number alpha
301
+ ) = 0;
302
+
303
+ /** Element-wise division \f$y_i \gets y_i/x_i\f$ */
304
+ virtual void ElementWiseDivideImpl(
305
+ const Vector& x
306
+ ) = 0;
307
+
308
+ /** Element-wise multiplication \f$y_i \gets y_i*x_i\f$ */
309
+ virtual void ElementWiseMultiplyImpl(
310
+ const Vector& x
311
+ ) = 0;
312
+
313
+ /** Element-wise selection \f$y_i \gets sgn(y_i)x_i, if y_i != 0, else 0\f$ */
314
+ virtual void ElementWiseSelectImpl(
315
+ const Vector& x
316
+ ) = 0;
317
+
318
+ /** Element-wise max against entries in x */
319
+ virtual void ElementWiseMaxImpl(
320
+ const Vector& x
321
+ ) = 0;
322
+
323
+ /** Element-wise min against entries in x */
324
+ virtual void ElementWiseMinImpl(
325
+ const Vector& x
326
+ ) = 0;
327
+
328
+ /** Reciprocates the elements of the vector */
329
+ virtual void ElementWiseReciprocalImpl() = 0;
330
+
331
+ /** Take elementwise absolute values of the elements of the vector */
332
+ virtual void ElementWiseAbsImpl() = 0;
333
+
334
+ /** Take elementwise square-root of the elements of the vector */
335
+ virtual void ElementWiseSqrtImpl() = 0;
336
+
337
+ /** Replaces entries with sgn of the entry */
338
+ virtual void ElementWiseSgnImpl() = 0;
339
+
340
+ /** Add scalar to every component of vector */
341
+ virtual void AddScalarImpl(
342
+ Number scalar
343
+ ) = 0;
344
+
345
+ /** Max value in the vector */
346
+ virtual Number MaxImpl() const = 0;
347
+
348
+ /** Min number in the vector */
349
+ virtual Number MinImpl() const = 0;
350
+
351
+ /** Sum of entries in the vector */
352
+ virtual Number SumImpl() const = 0;
353
+
354
+ /** Sum of logs of entries in the vector */
355
+ virtual Number SumLogsImpl() const = 0;
356
+
357
+ /** Add two vectors (a * v1 + b * v2).
358
+ *
359
+ * Result is stored in this vector.
360
+ */
361
+ virtual void AddTwoVectorsImpl(
362
+ Number a,
363
+ const Vector& v1,
364
+ Number b,
365
+ const Vector& v2,
366
+ Number c
367
+ );
368
+
369
+ /** Fraction to boundary parameter. */
370
+ virtual Number FracToBoundImpl(
371
+ const Vector& delta,
372
+ Number tau
373
+ ) const;
374
+
375
+ /** Add the quotient of two vectors */
376
+ virtual void AddVectorQuotientImpl(
377
+ Number a,
378
+ const Vector& z,
379
+ const Vector& s,
380
+ Number c
381
+ );
382
+
383
+ /** Method for determining if all stored numbers are valid (i.e., no Inf or Nan).
384
+ *
385
+ * A default implementation using Asum is provided. */
386
+ virtual bool HasValidNumbersImpl() const;
387
+
388
+ /** Print the entire vector */
389
+ virtual void PrintImpl(
390
+ const Journalist& jnlst,
391
+ EJournalLevel level,
392
+ EJournalCategory category,
393
+ const std::string& name,
394
+ Index indent,
395
+ const std::string& prefix
396
+ ) const = 0;
397
+ ///@}
398
+
399
+ private:
400
+ /**@name Default Compiler Generated Methods
401
+ * (Hidden to avoid implicit creation/calling).
402
+ * These methods are not implemented and
403
+ * we do not want the compiler to implement
404
+ * them for us, so we declare them private
405
+ * and do not define them. This ensures that
406
+ * they will not be implicitly created/called.
407
+ */
408
+ ///@{
409
+ /** Default constructor */
410
+ Vector();
411
+
412
+ /** Copy constructor */
413
+ Vector(
414
+ const Vector&
415
+ );
416
+
417
+ /** Default Assignment Operator */
418
+ Vector& operator=(
419
+ const Vector&
420
+ );
421
+ ///@}
422
+
423
+ /** Vector Space */
424
+ const SmartPtr<const VectorSpace> owner_space_;
425
+
426
+ /**@name CachedResults data members */
427
+ ///@{
428
+ /** Cache for dot products */
429
+ mutable CachedResults<Number> dot_cache_;
430
+
431
+ mutable TaggedObject::Tag nrm2_cache_tag_;
432
+ mutable Number cached_nrm2_;
433
+
434
+ mutable TaggedObject::Tag asum_cache_tag_;
435
+ mutable Number cached_asum_;
436
+
437
+ mutable TaggedObject::Tag amax_cache_tag_;
438
+ mutable Number cached_amax_;
439
+
440
+ mutable TaggedObject::Tag max_cache_tag_;
441
+ mutable Number cached_max_;
442
+
443
+ mutable TaggedObject::Tag min_cache_tag_;
444
+ mutable Number cached_min_;
445
+
446
+ mutable TaggedObject::Tag sum_cache_tag_;
447
+ mutable Number cached_sum_;
448
+
449
+ mutable TaggedObject::Tag sumlogs_cache_tag_;
450
+ mutable Number cached_sumlogs_;
451
+
452
+ mutable TaggedObject::Tag valid_cache_tag_;
453
+ mutable bool cached_valid_;
454
+
455
+ // AW: I removed this cache since it gets in the way for the
456
+ // quality function search
457
+ // /** Cache for FracToBound */
458
+ // mutable CachedResults<Number> frac_to_bound_cache_;
459
+ ///@}
460
+
461
+ };
462
+
463
+ /** VectorSpace base class, corresponding to the Vector base class.
464
+ *
465
+ * For each Vector implementation, a corresponding VectorSpace has
466
+ * to be implemented. A VectorSpace is able to create new Vectors
467
+ * of a specific type. The VectorSpace should also store
468
+ * information that is common to all Vectors of that type. For
469
+ * example, the dimension of a Vector is stored in the VectorSpace
470
+ * base class.
471
+ */
472
+ class IPOPTLIB_EXPORT VectorSpace: public ReferencedObject
473
+ {
474
+ public:
475
+ /** @name Constructors/Destructors */
476
+ ///@{
477
+ /** Constructor, given the dimension of all vectors generated by
478
+ * this VectorSpace.
479
+ */
480
+ VectorSpace(
481
+ Index dim
482
+ );
483
+
484
+ /** Destructor */
485
+ virtual ~VectorSpace()
486
+ { }
487
+ ///@}
488
+
489
+ /** Pure virtual method for creating a new Vector of the
490
+ * corresponding type.
491
+ */
492
+ virtual Vector* MakeNew() const = 0;
493
+
494
+ /** Accessor function for the dimension of the vectors of this type.*/
495
+ Index Dim() const
496
+ {
497
+ return dim_;
498
+ }
499
+
500
+ private:
501
+ /**@name Default Compiler Generated Methods
502
+ * (Hidden to avoid implicit creation/calling).
503
+ * These methods are not implemented and
504
+ * we do not want the compiler to implement
505
+ * them for us, so we declare them private
506
+ * and do not define them. This ensures that
507
+ * they will not be implicitly created/called.
508
+ */
509
+ ///@{
510
+ /** Default constructor */
511
+ VectorSpace();
512
+
513
+ /** Copy constructor */
514
+ VectorSpace(
515
+ const VectorSpace&
516
+ );
517
+
518
+ /** Default Assignment Operator */
519
+ VectorSpace& operator=(
520
+ const VectorSpace&
521
+ );
522
+ ///@}
523
+
524
+ /** Dimension of the vectors in this vector space. */
525
+ const Index dim_;
526
+ };
527
+
528
+ /* inline methods */
529
+ inline Vector::~Vector()
530
+ { }
531
+
532
+ inline Vector::Vector(
533
+ const VectorSpace* owner_space
534
+ )
535
+ : TaggedObject(),
536
+ owner_space_(owner_space),
537
+ dot_cache_(10),
538
+ nrm2_cache_tag_(0),
539
+ asum_cache_tag_(0),
540
+ amax_cache_tag_(0),
541
+ max_cache_tag_(0),
542
+ min_cache_tag_(0),
543
+ sum_cache_tag_(0),
544
+ sumlogs_cache_tag_(0),
545
+ cached_valid_(0)
546
+ {
547
+ DBG_ASSERT(IsValid(owner_space_));
548
+ }
549
+
550
+ inline Vector* Vector::MakeNew() const
551
+ {
552
+ return owner_space_->MakeNew();
553
+ }
554
+
555
+ inline Vector* Vector::MakeNewCopy() const
556
+ {
557
+ // ToDo: We can probably copy also the cached values for Norms etc here
558
+ Vector* copy = MakeNew();
559
+ copy->Copy(*this);
560
+ return copy;
561
+ }
562
+
563
+ inline void Vector::Copy(
564
+ const Vector& x
565
+ )
566
+ {
567
+ CopyImpl(x);
568
+ ObjectChanged();
569
+ // Also copy any cached scalar values from the original vector
570
+ // ToDo: Check if that is too much overhead
571
+ TaggedObject::Tag x_tag = x.GetTag();
572
+ if( x_tag == x.nrm2_cache_tag_ )
573
+ {
574
+ nrm2_cache_tag_ = GetTag();
575
+ cached_nrm2_ = x.cached_nrm2_;
576
+ }
577
+ if( x_tag == x.asum_cache_tag_ )
578
+ {
579
+ asum_cache_tag_ = GetTag();
580
+ cached_asum_ = x.cached_asum_;
581
+ }
582
+ if( x_tag == x.amax_cache_tag_ )
583
+ {
584
+ amax_cache_tag_ = GetTag();
585
+ cached_amax_ = x.cached_amax_;
586
+ }
587
+ if( x_tag == x.max_cache_tag_ )
588
+ {
589
+ max_cache_tag_ = GetTag();
590
+ cached_max_ = x.cached_max_;
591
+ }
592
+ if( x_tag == x.min_cache_tag_ )
593
+ {
594
+ min_cache_tag_ = GetTag();
595
+ cached_min_ = x.cached_min_;
596
+ }
597
+ if( x_tag == x.sum_cache_tag_ )
598
+ {
599
+ sum_cache_tag_ = GetTag();
600
+ cached_sum_ = x.cached_sum_;
601
+ }
602
+ if( x_tag == x.sumlogs_cache_tag_ )
603
+ {
604
+ sumlogs_cache_tag_ = GetTag();
605
+ cached_sumlogs_ = x.cached_sumlogs_;
606
+ }
607
+ }
608
+
609
+ inline void Vector::Axpy(
610
+ Number alpha,
611
+ const Vector& x
612
+ )
613
+ {
614
+ AxpyImpl(alpha, x);
615
+ ObjectChanged();
616
+ }
617
+
618
+ inline Number Vector::Dot(
619
+ const Vector& x
620
+ ) const
621
+ {
622
+ // The current implementation of the caching doesn't allow to have
623
+ // a dependency of something with itself. Therefore, we use the
624
+ // Nrm2 method if the dot product is to be taken with the vector
625
+ // itself. Might be more efficient anyway.
626
+ if( this == &x )
627
+ {
628
+ Number nrm2 = Nrm2();
629
+ return nrm2 * nrm2;
630
+ }
631
+ Number retValue;
632
+ if( !dot_cache_.GetCachedResult2Dep(retValue, this, &x) )
633
+ {
634
+ retValue = DotImpl(x);
635
+ dot_cache_.AddCachedResult2Dep(retValue, this, &x);
636
+ }
637
+ return retValue;
638
+ }
639
+
640
+ inline Number Vector::Nrm2() const
641
+ {
642
+ if( nrm2_cache_tag_ != GetTag() )
643
+ {
644
+ cached_nrm2_ = Nrm2Impl();
645
+ nrm2_cache_tag_ = GetTag();
646
+ }
647
+ return cached_nrm2_;
648
+ }
649
+
650
+ inline Number Vector::Asum() const
651
+ {
652
+ if( asum_cache_tag_ != GetTag() )
653
+ {
654
+ cached_asum_ = AsumImpl();
655
+ asum_cache_tag_ = GetTag();
656
+ }
657
+ return cached_asum_;
658
+ }
659
+
660
+ inline Number Vector::Amax() const
661
+ {
662
+ if( amax_cache_tag_ != GetTag() )
663
+ {
664
+ cached_amax_ = AmaxImpl();
665
+ amax_cache_tag_ = GetTag();
666
+ }
667
+ return cached_amax_;
668
+ }
669
+
670
+ inline Number Vector::Sum() const
671
+ {
672
+ if( sum_cache_tag_ != GetTag() )
673
+ {
674
+ cached_sum_ = SumImpl();
675
+ sum_cache_tag_ = GetTag();
676
+ }
677
+ return cached_sum_;
678
+ }
679
+
680
+ inline Number Vector::SumLogs() const
681
+ {
682
+ if( sumlogs_cache_tag_ != GetTag() )
683
+ {
684
+ cached_sumlogs_ = SumLogsImpl();
685
+ sumlogs_cache_tag_ = GetTag();
686
+ }
687
+ return cached_sumlogs_;
688
+ }
689
+
690
+ inline void Vector::ElementWiseSgn()
691
+ {
692
+ ElementWiseSgnImpl();
693
+ ObjectChanged();
694
+ }
695
+
696
+ inline void Vector::Set(
697
+ Number alpha
698
+ )
699
+ {
700
+ // Could initialize caches here
701
+ SetImpl(alpha);
702
+ ObjectChanged();
703
+ }
704
+
705
+ inline void Vector::ElementWiseDivide(
706
+ const Vector& x
707
+ )
708
+ {
709
+ ElementWiseDivideImpl(x);
710
+ ObjectChanged();
711
+ }
712
+
713
+ inline void Vector::ElementWiseMultiply(
714
+ const Vector& x
715
+ )
716
+ {
717
+ ElementWiseMultiplyImpl(x);
718
+ ObjectChanged();
719
+ }
720
+
721
+ inline void Vector::ElementWiseSelect(
722
+ const Vector& x
723
+ )
724
+ {
725
+ ElementWiseSelectImpl(x);
726
+ ObjectChanged();
727
+ }
728
+
729
+ inline void Vector::ElementWiseReciprocal()
730
+ {
731
+ ElementWiseReciprocalImpl();
732
+ ObjectChanged();
733
+ }
734
+
735
+ inline void Vector::ElementWiseMax(
736
+ const Vector& x
737
+ )
738
+ {
739
+ // Could initialize some caches here
740
+ ElementWiseMaxImpl(x);
741
+ ObjectChanged();
742
+ }
743
+
744
+ inline void Vector::ElementWiseMin(
745
+ const Vector& x
746
+ )
747
+ {
748
+ // Could initialize some caches here
749
+ ElementWiseMinImpl(x);
750
+ ObjectChanged();
751
+ }
752
+
753
+ inline void Vector::ElementWiseAbs()
754
+ {
755
+ // Could initialize some caches here
756
+ ElementWiseAbsImpl();
757
+ ObjectChanged();
758
+ }
759
+
760
+ inline void Vector::ElementWiseSqrt()
761
+ {
762
+ ElementWiseSqrtImpl();
763
+ ObjectChanged();
764
+ }
765
+
766
+ inline void Vector::AddScalar(
767
+ Number scalar)
768
+ {
769
+ // Could initialize some caches here
770
+ AddScalarImpl(scalar);
771
+ ObjectChanged();
772
+ }
773
+
774
+ inline Number Vector::Max() const
775
+ {
776
+ if( max_cache_tag_ != GetTag() )
777
+ {
778
+ cached_max_ = MaxImpl();
779
+ max_cache_tag_ = GetTag();
780
+ }
781
+ return cached_max_;
782
+ }
783
+
784
+ inline Number Vector::Min() const
785
+ {
786
+ if( min_cache_tag_ != GetTag() )
787
+ {
788
+ cached_min_ = MinImpl();
789
+ min_cache_tag_ = GetTag();
790
+ }
791
+ return cached_min_;
792
+ }
793
+
794
+ inline void Vector::AddOneVector(
795
+ Number a,
796
+ const Vector& v1,
797
+ Number c
798
+ )
799
+ {
800
+ AddTwoVectors(a, v1, 0., v1, c);
801
+ }
802
+
803
+ inline void Vector::AddTwoVectors(
804
+ Number a,
805
+ const Vector& v1,
806
+ Number b,
807
+ const Vector& v2,
808
+ Number c
809
+ )
810
+ {
811
+ AddTwoVectorsImpl(a, v1, b, v2, c);
812
+ ObjectChanged();
813
+ }
814
+
815
+ inline Number Vector::FracToBound(
816
+ const Vector& delta,
817
+ Number tau
818
+ ) const
819
+ {
820
+ /* AW: I avoid the caching here, since it leads to overhead in the
821
+ quality function search. Caches for this are in
822
+ CalculatedQuantities.
823
+ Number retValue;
824
+ std::vector<const TaggedObject*> tdeps(1);
825
+ tdeps[0] = &delta;
826
+ std::vector<Number> sdeps(1);
827
+ sdeps[0] = tau;
828
+ if (!frac_to_bound_cache_.GetCachedResult(retValue, tdeps, sdeps)) {
829
+ retValue = FracToBoundImpl(delta, tau);
830
+ frac_to_bound_cache_.AddCachedResult(retValue, tdeps, sdeps);
831
+ }
832
+ return retValue;
833
+ */
834
+ return FracToBoundImpl(delta, tau);
835
+ }
836
+
837
+ inline void Vector::AddVectorQuotient(
838
+ Number a,
839
+ const Vector& z,
840
+ const Vector& s,
841
+ Number c
842
+ )
843
+ {
844
+ AddVectorQuotientImpl(a, z, s, c);
845
+ ObjectChanged();
846
+ }
847
+
848
+ inline bool Vector::HasValidNumbers() const
849
+ {
850
+ if( valid_cache_tag_ != GetTag() )
851
+ {
852
+ cached_valid_ = HasValidNumbersImpl();
853
+ valid_cache_tag_ = GetTag();
854
+ }
855
+ return cached_valid_;
856
+ }
857
+
858
+ inline Index Vector::Dim() const
859
+ {
860
+ return owner_space_->Dim();
861
+ }
862
+
863
+ inline SmartPtr<const VectorSpace> Vector::OwnerSpace() const
864
+ {
865
+ return owner_space_;
866
+ }
867
+
868
+ inline VectorSpace::VectorSpace(
869
+ Index dim
870
+ )
871
+ : dim_(dim)
872
+ { }
873
+
874
+ } // namespace Ipopt
875
+
876
+ // Macro definitions for debugging vectors
877
+ #if IPOPT_VERBOSITY == 0
878
+ # define DBG_PRINT_VECTOR(__verbose_level, __vec_name, __vec)
879
+ #else
880
+ # define DBG_PRINT_VECTOR(__verbose_level, __vec_name, __vec) \
881
+ if (dbg_jrnl.Verbosity() >= (__verbose_level)) { \
882
+ if (dbg_jrnl.Jnlst()!=NULL) { \
883
+ (__vec).Print(dbg_jrnl.Jnlst(), \
884
+ J_ERROR, J_DBG, \
885
+ __vec_name, \
886
+ dbg_jrnl.IndentationLevel()*2, \
887
+ "# "); \
888
+ } \
889
+ }
890
+ #endif //if IPOPT_VERBOSITY == 0
891
+
892
+ #endif