casadi 3.6.7__cp313-none-manylinux2014_i686.whl → 3.7.1__cp313-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.
- casadi/_casadi.so +0 -0
- casadi/casadi-cli +0 -0
- casadi/casadi.py +6531 -3039
- casadi/cbc +0 -0
- casadi/clp +0 -0
- casadi/cmake/casadi-config-version.cmake +1 -1
- casadi/cmake/casadi-config.cmake +1 -1
- casadi/cmake/casadi-targets-release.cmake +5 -5
- casadi/cmake/casadi-targets.cmake +5 -5
- casadi/{lib/cmake/tinyxml2/tinyxml2-config-version.cmake → cmake/ghc_filesystem/ghc_filesystem-config-version.cmake} +30 -10
- casadi/cmake/ghc_filesystem/ghc_filesystem-config.cmake +30 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-targets.cmake +107 -0
- casadi/cmake/highs/highs-targets-release.cmake +2 -2
- casadi/cmake/highs/highs-targets.cmake +1 -1
- casadi/cmake/libzip/libzip-config-version.cmake +48 -0
- casadi/cmake/libzip/libzip-config.cmake +69 -0
- casadi/cmake/libzip/libzip-targets-release.cmake +19 -0
- casadi/{lib/cmake/tinyxml2/tinyxml2-static-targets.cmake → cmake/libzip/libzip-targets.cmake} +11 -7
- casadi/cmake/libzip/modules/FindMbedTLS.cmake +141 -0
- casadi/cmake/libzip/modules/FindNettle.cmake +141 -0
- casadi/cmake/libzip/modules/Findzstd.cmake +186 -0
- casadi/highs +0 -0
- casadi/include/casadi/casadi.i +276 -47
- casadi/include/casadi/config.h +11 -11
- casadi/include/casadi/core/archiver.hpp +58 -0
- casadi/include/casadi/core/blazing_spline.hpp +47 -0
- casadi/include/casadi/core/calculus.hpp +57 -2
- casadi/include/casadi/core/callback.hpp +9 -0
- casadi/include/casadi/core/casadi_common.hpp +37 -0
- casadi/include/casadi/core/casadi_meta.hpp +15 -0
- casadi/include/casadi/core/casadi_misc.hpp +21 -0
- casadi/include/casadi/core/code_generator.hpp +115 -19
- casadi/include/casadi/core/core.hpp +5 -0
- casadi/include/casadi/core/dae_builder.hpp +303 -141
- casadi/include/casadi/core/dm.hpp +3 -0
- casadi/include/casadi/core/filesystem.hpp +58 -0
- casadi/include/casadi/core/fmu.hpp +62 -16
- casadi/include/casadi/core/function.hpp +24 -0
- casadi/include/casadi/core/generic_matrix.hpp +214 -7
- casadi/include/casadi/core/generic_shared.hpp +395 -0
- casadi/include/casadi/core/generic_shared_impl.hpp +218 -0
- casadi/include/casadi/core/generic_shared_internal.hpp +215 -0
- casadi/include/casadi/core/generic_type.hpp +3 -0
- casadi/include/casadi/core/global_options.hpp +10 -0
- casadi/include/casadi/core/integrator.hpp +41 -7
- casadi/include/casadi/core/matrix_decl.hpp +71 -0
- casadi/include/casadi/core/mx.hpp +63 -2
- casadi/include/casadi/core/nlp_builder.hpp +2 -1
- casadi/include/casadi/core/options.hpp +6 -3
- casadi/include/casadi/core/optistack.hpp +43 -9
- casadi/include/casadi/core/printable.hpp +8 -0
- casadi/include/casadi/core/resource.hpp +107 -0
- casadi/include/casadi/core/runtime/casadi_blazing_1d_boor_eval.hpp +112 -0
- casadi/include/casadi/core/runtime/casadi_blazing_2d_boor_eval.hpp +311 -0
- casadi/include/casadi/core/runtime/casadi_blazing_3d_boor_eval.hpp +645 -0
- casadi/include/casadi/core/runtime/casadi_blazing_de_boor.hpp +101 -0
- casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +1 -1
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +8 -2
- casadi/include/casadi/core/runtime/casadi_print_canonical.hpp +55 -0
- casadi/include/casadi/core/runtime/casadi_print_scalar.hpp +25 -0
- casadi/include/casadi/core/runtime/casadi_print_vector.hpp +32 -0
- casadi/include/casadi/core/runtime/casadi_printme.hpp +26 -0
- casadi/include/casadi/core/serializer.hpp +13 -5
- casadi/include/casadi/core/serializing_stream.hpp +9 -2
- casadi/include/casadi/core/shared_object.hpp +73 -161
- casadi/include/casadi/core/sparsity.hpp +13 -1
- casadi/include/casadi/core/sparsity_interface.hpp +19 -1
- casadi/include/casadi/core/sx.hpp +41 -0
- casadi/include/casadi/core/sx_elem.hpp +25 -0
- casadi/include/casadi/core/xml_node.hpp +5 -0
- casadi/include/casadi/doc.i +10026 -6513
- casadi/include/casadi/doc_merged.i +6744 -4449
- casadi/include/casadi/valgrind-casadi.supp +138 -0
- casadi/include/casadi/valgrind-python.supp +2470 -0
- casadi/include/highs/HConfig.h +6 -4
- casadi/include/highs/Highs.h +260 -86
- casadi/include/highs/filereaderlp/reader.hpp +10 -10
- casadi/include/highs/interfaces/highs_c_api.h +195 -22
- casadi/include/highs/io/Filereader.h +4 -6
- casadi/include/highs/io/FilereaderEms.h +0 -3
- casadi/include/highs/io/FilereaderLp.h +0 -3
- casadi/include/highs/io/FilereaderMps.h +0 -3
- casadi/include/highs/io/HMPSIO.h +1 -4
- casadi/include/highs/io/HMpsFF.h +8 -5
- casadi/include/highs/io/HighsIO.h +10 -5
- casadi/include/highs/io/LoadOptions.h +0 -3
- casadi/include/highs/ipm/IpxSolution.h +0 -3
- casadi/include/highs/ipm/IpxWrapper.h +4 -7
- casadi/include/highs/ipm/ipx/control.h +1 -0
- casadi/include/highs/ipm/ipx/ipx_parameters.h +1 -0
- casadi/include/highs/ipm/ipx/lp_solver.h +3 -2
- casadi/include/highs/ipm/ipx/model.h +7 -3
- casadi/include/highs/lp_data/HConst.h +21 -6
- casadi/include/highs/lp_data/HStruct.h +40 -4
- casadi/include/highs/lp_data/HighsAnalysis.h +0 -3
- casadi/include/highs/lp_data/HighsCallback.h +10 -3
- casadi/include/highs/lp_data/HighsCallbackStruct.h +3 -3
- casadi/include/highs/lp_data/HighsDebug.h +0 -3
- casadi/include/highs/lp_data/HighsIis.h +62 -0
- casadi/include/highs/lp_data/HighsInfo.h +50 -43
- casadi/include/highs/lp_data/HighsInfoDebug.h +0 -3
- casadi/include/highs/lp_data/HighsLp.h +2 -3
- casadi/include/highs/lp_data/HighsLpSolverObject.h +0 -3
- casadi/include/highs/lp_data/HighsLpUtils.h +38 -6
- casadi/include/highs/lp_data/HighsModelUtils.h +21 -18
- casadi/include/highs/lp_data/HighsOptions.h +134 -22
- casadi/include/highs/lp_data/HighsRanging.h +0 -3
- casadi/include/highs/lp_data/HighsSolution.h +10 -3
- casadi/include/highs/lp_data/HighsSolutionDebug.h +0 -3
- casadi/include/highs/lp_data/HighsSolve.h +0 -3
- casadi/include/highs/lp_data/HighsStatus.h +0 -3
- casadi/include/highs/mip/HighsCliqueTable.h +3 -3
- casadi/include/highs/mip/HighsConflictPool.h +0 -3
- casadi/include/highs/mip/HighsCutGeneration.h +13 -3
- casadi/include/highs/mip/HighsCutPool.h +0 -3
- casadi/include/highs/mip/HighsDebugSol.h +0 -3
- casadi/include/highs/mip/HighsDomain.h +16 -4
- casadi/include/highs/mip/HighsDomainChange.h +0 -3
- casadi/include/highs/mip/HighsDynamicRowMatrix.h +0 -3
- casadi/include/highs/mip/HighsGFkSolve.h +3 -6
- casadi/include/highs/mip/HighsImplications.h +29 -5
- casadi/include/highs/mip/HighsLpAggregator.h +0 -3
- casadi/include/highs/mip/HighsLpRelaxation.h +0 -3
- casadi/include/highs/mip/HighsMipAnalysis.h +52 -0
- casadi/include/highs/mip/HighsMipSolver.h +11 -4
- casadi/include/highs/mip/HighsMipSolverData.h +67 -6
- casadi/include/highs/mip/HighsModkSeparator.h +1 -4
- casadi/include/highs/mip/HighsNodeQueue.h +0 -3
- casadi/include/highs/mip/HighsObjectiveFunction.h +0 -3
- casadi/include/highs/mip/HighsPathSeparator.h +1 -4
- casadi/include/highs/mip/HighsPrimalHeuristics.h +7 -5
- casadi/include/highs/mip/HighsPseudocost.h +0 -3
- casadi/include/highs/mip/HighsRedcostFixing.h +0 -3
- casadi/include/highs/mip/HighsSearch.h +0 -3
- casadi/include/highs/mip/HighsSeparation.h +0 -3
- casadi/include/highs/mip/HighsSeparator.h +1 -5
- casadi/include/highs/mip/HighsTableauSeparator.h +1 -4
- casadi/include/highs/mip/HighsTransformedLp.h +0 -3
- casadi/include/highs/mip/MipTimer.h +471 -0
- casadi/include/highs/parallel/HighsBinarySemaphore.h +1 -1
- casadi/include/highs/parallel/HighsCacheAlign.h +1 -1
- casadi/include/highs/parallel/HighsCombinable.h +1 -1
- casadi/include/highs/parallel/HighsMutex.h +1 -1
- casadi/include/highs/parallel/HighsRaceTimer.h +1 -1
- casadi/include/highs/parallel/HighsSchedulerConstants.h +1 -1
- casadi/include/highs/parallel/HighsSplitDeque.h +1 -1
- casadi/include/highs/parallel/HighsTaskExecutor.h +68 -55
- casadi/include/highs/pdlp/CupdlpWrapper.h +18 -7
- casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +2 -3
- casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +16 -6
- casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +10 -4
- casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +3 -3
- casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +6 -6
- casadi/include/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +11 -11
- casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +8 -4
- casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +253 -172
- casadi/include/highs/presolve/HPresolve.h +50 -10
- casadi/include/highs/presolve/HPresolveAnalysis.h +0 -3
- casadi/include/highs/presolve/HighsPostsolveStack.h +39 -6
- casadi/include/highs/presolve/HighsSymmetry.h +0 -3
- casadi/include/highs/presolve/ICrash.h +0 -3
- casadi/include/highs/presolve/ICrashUtil.h +1 -4
- casadi/include/highs/presolve/ICrashX.h +0 -3
- casadi/include/highs/presolve/PresolveComponent.h +0 -3
- casadi/include/highs/qpsolver/a_asm.hpp +20 -17
- casadi/include/highs/qpsolver/a_quass.hpp +5 -9
- casadi/include/highs/qpsolver/basis.hpp +12 -10
- casadi/include/highs/qpsolver/crashsolution.hpp +4 -3
- casadi/include/highs/qpsolver/dantzigpricing.hpp +3 -2
- casadi/include/highs/qpsolver/devexpricing.hpp +3 -1
- casadi/include/highs/qpsolver/factor.hpp +6 -5
- casadi/include/highs/qpsolver/feasibility_bounded.hpp +31 -29
- casadi/include/highs/qpsolver/feasibility_highs.hpp +94 -70
- casadi/include/highs/qpsolver/gradient.hpp +1 -1
- casadi/include/highs/qpsolver/instance.hpp +1 -1
- casadi/include/highs/qpsolver/pricing.hpp +2 -2
- casadi/include/highs/qpsolver/qpconst.hpp +2 -2
- casadi/include/highs/qpsolver/quass.hpp +2 -2
- casadi/include/highs/qpsolver/runtime.hpp +2 -2
- casadi/include/highs/qpsolver/settings.hpp +20 -8
- casadi/include/highs/qpsolver/steepestedgepricing.hpp +38 -39
- casadi/include/highs/simplex/HApp.h +88 -34
- casadi/include/highs/simplex/HEkk.h +24 -11
- casadi/include/highs/simplex/HEkkDual.h +2 -4
- casadi/include/highs/simplex/HEkkDualRHS.h +0 -3
- casadi/include/highs/simplex/HEkkDualRow.h +0 -3
- casadi/include/highs/simplex/HEkkPrimal.h +1 -5
- casadi/include/highs/simplex/HSimplex.h +0 -3
- casadi/include/highs/simplex/HSimplexDebug.h +0 -3
- casadi/include/highs/simplex/HSimplexNla.h +0 -26
- casadi/include/highs/simplex/HSimplexReport.h +0 -3
- casadi/include/highs/simplex/HighsSimplexAnalysis.h +5 -8
- casadi/include/highs/simplex/SimplexConst.h +10 -11
- casadi/include/highs/simplex/SimplexStruct.h +9 -12
- casadi/include/highs/simplex/SimplexTimer.h +83 -101
- casadi/include/highs/test/DevKkt.h +0 -3
- casadi/include/highs/test/KktCh2.h +0 -3
- casadi/include/highs/util/FactorTimer.h +39 -64
- casadi/include/highs/util/HFactor.h +4 -4
- casadi/include/highs/util/HFactorConst.h +0 -3
- casadi/include/highs/util/HFactorDebug.h +0 -3
- casadi/include/highs/util/HSet.h +0 -3
- casadi/include/highs/util/HVector.h +0 -3
- casadi/include/highs/util/HVectorBase.h +1 -4
- casadi/include/highs/util/HighsCDouble.h +12 -3
- casadi/include/highs/util/HighsComponent.h +0 -3
- casadi/include/highs/util/HighsDataStack.h +0 -3
- casadi/include/highs/util/HighsDisjointSets.h +0 -3
- casadi/include/highs/util/HighsHash.h +9 -12
- casadi/include/highs/util/HighsHashTree.h +15 -11
- casadi/include/highs/util/HighsInt.h +0 -3
- casadi/include/highs/util/HighsIntegers.h +0 -3
- casadi/include/highs/util/HighsLinearSumBounds.h +0 -3
- casadi/include/highs/util/HighsMatrixPic.h +0 -3
- casadi/include/highs/util/HighsMatrixSlice.h +3 -6
- casadi/include/highs/util/HighsMatrixUtils.h +0 -3
- casadi/include/highs/util/HighsMemoryAllocation.h +11 -3
- casadi/include/highs/util/HighsRandom.h +3 -6
- casadi/include/highs/util/HighsRbTree.h +0 -3
- casadi/include/highs/util/HighsSort.h +0 -3
- casadi/include/highs/util/HighsSparseMatrix.h +6 -3
- casadi/include/highs/util/HighsSparseVectorSum.h +0 -3
- casadi/include/highs/util/HighsSplay.h +0 -3
- casadi/include/highs/util/HighsTimer.h +94 -56
- casadi/include/highs/util/HighsUtils.h +10 -3
- casadi/include/highs/util/stringutil.h +14 -12
- casadi/include/licenses/ghc-external/LICENSE +19 -0
- casadi/include/licenses/libz-external/LICENSE +22 -0
- casadi/include/licenses/libz-external/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- casadi/include/licenses/libzip-external/LICENSE +31 -0
- casadi/libCbcSolver.so +0 -0
- casadi/libCbcSolver.so.3 +0 -0
- casadi/libCbcSolver.so.3.10.11 +0 -0
- casadi/libClpSolver.so +0 -0
- casadi/libClpSolver.so.1 +0 -0
- casadi/libClpSolver.so.1.14.9 +0 -0
- casadi/libbonmin.so +0 -0
- casadi/libbonmin.so.4 +0 -0
- casadi/libbonmin.so.4.8.9 +0 -0
- casadi/libcasadi.so +0 -0
- casadi/libcasadi.so.3.7 +0 -0
- casadi/libcasadi_archiver_libzip.so +0 -0
- casadi/libcasadi_archiver_libzip.so.3.7 +0 -0
- casadi/libcasadi_conic_cbc.so +0 -0
- casadi/libcasadi_conic_cbc.so.3.7 +0 -0
- casadi/libcasadi_conic_clp.so +0 -0
- casadi/libcasadi_conic_clp.so.3.7 +0 -0
- casadi/libcasadi_conic_daqp.so +0 -0
- casadi/libcasadi_conic_daqp.so.3.7 +0 -0
- casadi/libcasadi_conic_gurobi.so +0 -0
- casadi/libcasadi_conic_gurobi.so.3.7 +0 -0
- casadi/libcasadi_conic_highs.so +0 -0
- casadi/libcasadi_conic_highs.so.3.7 +0 -0
- casadi/libcasadi_conic_ipqp.so +0 -0
- casadi/libcasadi_conic_ipqp.so.3.7 +0 -0
- casadi/libcasadi_conic_nlpsol.so +0 -0
- casadi/libcasadi_conic_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_conic_osqp.so +0 -0
- casadi/libcasadi_conic_osqp.so.3.7 +0 -0
- casadi/libcasadi_conic_proxqp.so +0 -0
- casadi/libcasadi_conic_proxqp.so.3.7 +0 -0
- casadi/libcasadi_conic_qpoases.so +0 -0
- casadi/libcasadi_conic_qpoases.so.3.7 +0 -0
- casadi/libcasadi_conic_qrqp.so +0 -0
- casadi/libcasadi_conic_qrqp.so.3.7 +0 -0
- casadi/libcasadi_conic_superscs.so +0 -0
- casadi/libcasadi_conic_superscs.so.3.7 +0 -0
- casadi/libcasadi_filesystem_ghc.so +0 -0
- casadi/libcasadi_filesystem_ghc.so.3.7 +0 -0
- casadi/libcasadi_importer_shell.so +0 -0
- casadi/libcasadi_importer_shell.so.3.7 +0 -0
- casadi/libcasadi_integrator_collocation.so +0 -0
- casadi/libcasadi_integrator_collocation.so.3.7 +0 -0
- casadi/libcasadi_integrator_cvodes.so +0 -0
- casadi/libcasadi_integrator_cvodes.so.3.7 +0 -0
- casadi/libcasadi_integrator_idas.so +0 -0
- casadi/libcasadi_integrator_idas.so.3.7 +0 -0
- casadi/libcasadi_integrator_rk.so +0 -0
- casadi/libcasadi_integrator_rk.so.3.7 +0 -0
- casadi/libcasadi_interpolant_bspline.so +0 -0
- casadi/libcasadi_interpolant_bspline.so.3.7 +0 -0
- casadi/libcasadi_interpolant_linear.so +0 -0
- casadi/libcasadi_interpolant_linear.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparse.so +0 -0
- casadi/libcasadi_linsol_csparse.so.3.7 +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so +0 -0
- casadi/libcasadi_linsol_csparsecholesky.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapacklu.so +0 -0
- casadi/libcasadi_linsol_lapacklu.so.3.7 +0 -0
- casadi/libcasadi_linsol_lapackqr.so +0 -0
- casadi/libcasadi_linsol_lapackqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ldl.so +0 -0
- casadi/libcasadi_linsol_ldl.so.3.7 +0 -0
- casadi/libcasadi_linsol_lsqr.so +0 -0
- casadi/libcasadi_linsol_lsqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_ma27.so +0 -0
- casadi/libcasadi_linsol_ma27.so.3.7 +0 -0
- casadi/libcasadi_linsol_mumps.so +0 -0
- casadi/libcasadi_linsol_mumps.so.3.7 +0 -0
- casadi/libcasadi_linsol_qr.so +0 -0
- casadi/libcasadi_linsol_qr.so.3.7 +0 -0
- casadi/libcasadi_linsol_symbolicqr.so +0 -0
- casadi/libcasadi_linsol_symbolicqr.so.3.7 +0 -0
- casadi/libcasadi_linsol_tridiag.so +0 -0
- casadi/libcasadi_linsol_tridiag.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so +0 -0
- casadi/libcasadi_nlpsol_alpaqa.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ampl.so +0 -0
- casadi/libcasadi_nlpsol_ampl.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so +0 -0
- casadi/libcasadi_nlpsol_blocksqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_bonmin.so +0 -0
- casadi/libcasadi_nlpsol_bonmin.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_ipopt.so +0 -0
- casadi/libcasadi_nlpsol_ipopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_knitro.so +0 -0
- casadi/libcasadi_nlpsol_knitro.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_madnlp.so +0 -0
- casadi/libcasadi_nlpsol_madnlp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so +0 -0
- casadi/libcasadi_nlpsol_qrsqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_scpgen.so +0 -0
- casadi/libcasadi_nlpsol_scpgen.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sleqp.so +0 -0
- casadi/libcasadi_nlpsol_sleqp.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_snopt.so +0 -0
- casadi/libcasadi_nlpsol_snopt.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.so.3.7 +0 -0
- casadi/libcasadi_nlpsol_worhp.so +0 -0
- casadi/libcasadi_nlpsol_worhp.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so +0 -0
- casadi/libcasadi_rootfinder_fast_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_kinsol.so +0 -0
- casadi/libcasadi_rootfinder_kinsol.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_newton.so +0 -0
- casadi/libcasadi_rootfinder_newton.so.3.7 +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so +0 -0
- casadi/libcasadi_rootfinder_nlpsol.so.3.7 +0 -0
- casadi/libcasadi_sundials_common.so +0 -0
- casadi/libcasadi_sundials_common.so.3.7 +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so +0 -0
- casadi/libcasadi_xmlfile_tinyxml.so.3.7 +0 -0
- casadi/libcoinmumps.so +0 -0
- casadi/libcoinmumps.so.3 +0 -0
- casadi/libcoinmumps.so.3.0.1 +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libhighs.so +0 -0
- casadi/libhighs.so.1 +0 -0
- casadi/libhighs.so.1.10.0 +0 -0
- casadi/libindirect.a +0 -0
- casadi/libipopt.so +0 -0
- casadi/libipopt.so.3 +0 -0
- casadi/libipopt.so.3.14.11 +0 -0
- casadi/liblinsys.a +0 -0
- casadi/libosqp.a +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libsipopt.so +0 -0
- casadi/libsipopt.so.3 +0 -0
- casadi/libsipopt.so.3.14.11 +0 -0
- casadi/libsleqp.so +0 -0
- casadi/libsleqp.so.1.0.1 +0 -0
- casadi/libspral.a +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/libz.a +0 -0
- casadi/libz.so +0 -0
- casadi/libz.so.1 +0 -0
- casadi/libz.so.1.3.1 +0 -0
- casadi/libzip.a +0 -0
- casadi/pkgconfig/casadi.pc +1 -1
- casadi/pkgconfig/highs.pc +1 -1
- casadi/pkgconfig/libzip.pc +14 -0
- casadi/tools/__init__.py +3 -1
- casadi/tools/graph/graph.py +1 -1
- casadi/tools/structure3.py +7 -7
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/METADATA +1 -1
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/RECORD +380 -347
- casadi/include/highs/lp_data/HighsRuntimeOptions.h +0 -276
- casadi/include/highs/pdlp/cupdlp/cupdlp_scaling_cuda.h +0 -28
- casadi/include/tinyxml2.h +0 -2380
- casadi/lib/cmake/tinyxml2/tinyxml2-config.cmake +0 -57
- casadi/lib/cmake/tinyxml2/tinyxml2-static-targets-release.cmake +0 -19
- casadi/lib/libtinyxml2.a +0 -0
- casadi/lib/pkgconfig/tinyxml2.pc +0 -10
- casadi/libhighs.so.1.7.2 +0 -0
- casadi/tools/structure.py +0 -1446
- {casadi-3.6.7.dist-info → casadi-3.7.1.dist-info}/WHEEL +0 -0
@@ -65,6 +65,9 @@ namespace casadi {
|
|
65
65
|
std::vector<DM> DM::
|
66
66
|
cse(const std::vector<DM>& e);
|
67
67
|
|
68
|
+
template<>
|
69
|
+
std::vector<double> DM::call(const Function& f, const std::vector<double>& dep);
|
70
|
+
|
68
71
|
template<> void DM::export_code(const std::string& lang,
|
69
72
|
std::ostream &stream, const Dict& options) const;
|
70
73
|
|
@@ -0,0 +1,58 @@
|
|
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_FILESYSTEM_HPP
|
27
|
+
#define CASADI_FILESYSTEM_HPP
|
28
|
+
|
29
|
+
#include <casadi/core/casadi_export.h>
|
30
|
+
#include <string>
|
31
|
+
|
32
|
+
namespace casadi {
|
33
|
+
|
34
|
+
/** \defgroup main_filesystem Title
|
35
|
+
\par
|
36
|
+
|
37
|
+
|
38
|
+
\generalsection{Filesystem}
|
39
|
+
\pluginssection{Filesystem}
|
40
|
+
|
41
|
+
\author Joris Gillis
|
42
|
+
\date 2025
|
43
|
+
|
44
|
+
\identifier{2d8} */
|
45
|
+
|
46
|
+
/// Check if a particular plugin is available
|
47
|
+
CASADI_EXPORT bool has_filesystem(const std::string& name);
|
48
|
+
|
49
|
+
/// Explicitly load a plugin dynamically
|
50
|
+
CASADI_EXPORT void load_filesystem(const std::string& name);
|
51
|
+
|
52
|
+
/// Get the documentation string for a plugin
|
53
|
+
CASADI_EXPORT std::string doc_filesystem(const std::string& name);
|
54
|
+
|
55
|
+
} // namespace casadi
|
56
|
+
|
57
|
+
|
58
|
+
#endif // CASADI_FILESYSTEM_HPP
|
@@ -36,6 +36,7 @@ namespace casadi {
|
|
36
36
|
|
37
37
|
// Forward declarations
|
38
38
|
class DaeBuilderInternal;
|
39
|
+
class FmuFunction;
|
39
40
|
struct FmuMemory;
|
40
41
|
struct InputStruct;
|
41
42
|
|
@@ -43,7 +44,7 @@ struct InputStruct;
|
|
43
44
|
class FmuInternal;
|
44
45
|
|
45
46
|
/// Which C API
|
46
|
-
enum class FmuApi {FMI2, NUMEL};
|
47
|
+
enum class FmuApi {FMI2, FMI3, NUMEL};
|
47
48
|
|
48
49
|
/// Convert to string
|
49
50
|
CASADI_EXPORT std::string to_string(FmuApi v);
|
@@ -80,6 +81,11 @@ class CASADI_EXPORT Fmu
|
|
80
81
|
\identifier{26u} */
|
81
82
|
const std::string& name() const;
|
82
83
|
|
84
|
+
/** \brief Name of the FMU
|
85
|
+
|
86
|
+
\identifier{2ab} */
|
87
|
+
const std::string& instance_name() const;
|
88
|
+
|
83
89
|
///@{
|
84
90
|
/// Access functions of the node
|
85
91
|
FmuInternal* operator->();
|
@@ -130,8 +136,14 @@ class CASADI_EXPORT Fmu
|
|
130
136
|
// Description of an input
|
131
137
|
std::string desc_in(FmuMemory* m, size_t id, bool more = true) const;
|
132
138
|
|
133
|
-
/// Does the
|
134
|
-
bool
|
139
|
+
/// Does the FMU provide support for forward directional derivatives
|
140
|
+
bool provides_directional_derivatives() const;
|
141
|
+
|
142
|
+
/// Does the FMU provide support for adjoint directional derivatives
|
143
|
+
bool provides_adjoint_derivatives() const;
|
144
|
+
|
145
|
+
/// Does the FMU declare restrictions on instantiation?
|
146
|
+
bool can_be_instantiated_only_once_per_process() const;
|
135
147
|
|
136
148
|
// Get Jacobian sparsity for a subset of inputs and outputs
|
137
149
|
Sparsity jac_sparsity(const std::vector<size_t>& osub, const std::vector<size_t>& isub) const;
|
@@ -149,13 +161,23 @@ class CASADI_EXPORT Fmu
|
|
149
161
|
return hess_sparsity(ired(r), ired(c));
|
150
162
|
}
|
151
163
|
|
164
|
+
/** \brief Create memory block
|
165
|
+
|
166
|
+
\identifier{2dn} */
|
167
|
+
FmuMemory* alloc_mem(const FmuFunction& f) const;
|
168
|
+
|
152
169
|
/** \brief Initalize memory block
|
153
170
|
|
154
171
|
\identifier{26x} */
|
155
172
|
int init_mem(FmuMemory* m) const;
|
156
173
|
|
174
|
+
/** \brief Free memory block
|
175
|
+
|
176
|
+
\identifier{2dt} */
|
177
|
+
void free_mem(void *mem) const;
|
178
|
+
|
157
179
|
// Free FMU instance
|
158
|
-
void free_instance(void*
|
180
|
+
void free_instance(void* instance) const;
|
159
181
|
|
160
182
|
// Set value
|
161
183
|
void set(FmuMemory* m, size_t ind, const double* value) const;
|
@@ -169,28 +191,52 @@ class CASADI_EXPORT Fmu
|
|
169
191
|
// Get a calculated variable
|
170
192
|
void get(FmuMemory* m, size_t ind, double* value) const;
|
171
193
|
|
172
|
-
// Set seed
|
173
|
-
void
|
174
|
-
|
175
|
-
// Request the calculation of a sensitivity
|
176
|
-
void request_sens(FmuMemory* m, casadi_int nsens, const casadi_int* id,
|
177
|
-
const casadi_int* wrt_id) const;
|
178
|
-
|
179
|
-
// Calculate directional derivatives
|
180
|
-
int eval_derivative(FmuMemory* m, bool independent_seeds) const;
|
181
|
-
|
182
|
-
// Get calculated derivatives
|
183
|
-
void get_sens(FmuMemory* m, casadi_int nsens, const casadi_int* id, double* v) const;
|
194
|
+
// Set forward seed by variable index
|
195
|
+
void set_fwd(FmuMemory* m, casadi_int nseed, const casadi_int* id, const double* v) const;
|
184
196
|
|
185
197
|
// Set all forward seeds for a single input
|
186
198
|
void set_fwd(FmuMemory* m, size_t ind, const double* v) const;
|
187
199
|
|
200
|
+
// Request the calculation of forward sensitivities
|
201
|
+
void request_fwd(FmuMemory* m, casadi_int nsens, const casadi_int* id,
|
202
|
+
const casadi_int* wrt_id) const;
|
203
|
+
|
188
204
|
// Request the calculation of all forward sensitivities for an output
|
189
205
|
void request_fwd(FmuMemory* m, casadi_int ind) const;
|
190
206
|
|
207
|
+
// Calculate forward directional derivatives
|
208
|
+
int eval_fwd(FmuMemory* m, bool independent_seeds) const;
|
209
|
+
|
210
|
+
// Get forward sensitivities
|
211
|
+
void get_fwd(FmuMemory* m, casadi_int nsens, const casadi_int* id, double* v) const;
|
212
|
+
|
191
213
|
// Get the forward sensitivities for a single output
|
192
214
|
void get_fwd(FmuMemory* m, size_t ind, double* v) const;
|
193
215
|
|
216
|
+
// Set adjoint seeds
|
217
|
+
void set_adj(FmuMemory* m, casadi_int nseed,
|
218
|
+
const casadi_int* id, const double* v) const;
|
219
|
+
|
220
|
+
// Set all adjoint seeds for a single output
|
221
|
+
void set_adj(FmuMemory* m, size_t ind, const double* v) const;
|
222
|
+
|
223
|
+
// Request the calculation of adjoint sensitivities
|
224
|
+
void request_adj(FmuMemory* m, casadi_int nsens, const casadi_int* id,
|
225
|
+
const casadi_int* wrt_id) const;
|
226
|
+
|
227
|
+
// Request the calculation of all adjoint sensitivities for an input
|
228
|
+
void request_adj(FmuMemory* m, casadi_int ind) const;
|
229
|
+
|
230
|
+
// Calculate adjoint directional derivatives
|
231
|
+
int eval_adj(FmuMemory* m) const;
|
232
|
+
|
233
|
+
// Get adjoint sensitivities
|
234
|
+
void get_adj(FmuMemory* m, casadi_int nsens,
|
235
|
+
const casadi_int* id, double* v) const;
|
236
|
+
|
237
|
+
// Get the adjoint sensitivities for a single input
|
238
|
+
void get_adj(FmuMemory* m, size_t ind, double* v) const;
|
239
|
+
|
194
240
|
/** \brief Get stats
|
195
241
|
|
196
242
|
\identifier{26y} */
|
@@ -340,6 +340,15 @@ namespace casadi {
|
|
340
340
|
\identifier{1vl} */
|
341
341
|
casadi_int index_out(const std::string &name) const;
|
342
342
|
|
343
|
+
/** \brief Does the function have a particularly named input?
|
344
|
+
|
345
|
+
\identifier{2c9} */
|
346
|
+
bool has_in(const std::string &name) const;
|
347
|
+
/** \brief Does the function have a particularly named output?
|
348
|
+
|
349
|
+
\identifier{2ca} */
|
350
|
+
bool has_out(const std::string &name) const;
|
351
|
+
|
343
352
|
/** \brief Get default input value
|
344
353
|
|
345
354
|
\identifier{1vm} */
|
@@ -454,6 +463,11 @@ namespace casadi {
|
|
454
463
|
\identifier{1w2} */
|
455
464
|
void change_option(const std::string& option_name, const GenericType& option_value);
|
456
465
|
|
466
|
+
/** \brief Reset the counter used to name dump files
|
467
|
+
|
468
|
+
\identifier{2dy} */
|
469
|
+
void reset_dump_count();
|
470
|
+
|
457
471
|
/** \brief Do the derivative functions need nondifferentiated outputs?
|
458
472
|
|
459
473
|
\identifier{1w3} */
|
@@ -1128,6 +1142,12 @@ namespace casadi {
|
|
1128
1142
|
template<typename M>
|
1129
1143
|
void call_gen(const std::map<std::string, M>& arg, std::map<std::string, M>& res,
|
1130
1144
|
bool always_inline, bool never_inline) const;
|
1145
|
+
|
1146
|
+
/** \brief List merge opportunitities
|
1147
|
+
|
1148
|
+
\identifier{2b6} */
|
1149
|
+
void merge(const std::vector<MX>& arg,
|
1150
|
+
std::vector<MX>& subs_from, std::vector<MX>& subs_to) const;
|
1131
1151
|
#endif // SWIG
|
1132
1152
|
/// \endcond
|
1133
1153
|
|
@@ -1204,6 +1224,9 @@ namespace casadi {
|
|
1204
1224
|
#ifndef SWIG
|
1205
1225
|
/// Get memory object
|
1206
1226
|
void* memory(int ind) const;
|
1227
|
+
|
1228
|
+
static std::vector<SX> order(const std::vector<SX>& expr);
|
1229
|
+
static std::vector<MX> order(const std::vector<MX>& expr);
|
1207
1230
|
#endif // SWIG
|
1208
1231
|
|
1209
1232
|
/** \brief Get all functions in the cache
|
@@ -1334,6 +1357,7 @@ public:
|
|
1334
1357
|
int ret();
|
1335
1358
|
void _eval();
|
1336
1359
|
void* _self() { return this; }
|
1360
|
+
Dict stats() const;
|
1337
1361
|
};
|
1338
1362
|
|
1339
1363
|
void CASADI_EXPORT _function_buffer_eval(void* raw);
|
@@ -305,7 +305,7 @@ namespace casadi {
|
|
305
305
|
/** \brief Performs 1d linear interpolation
|
306
306
|
*
|
307
307
|
* The data-points to be interpolated are given as (x[i], v[i]).
|
308
|
-
* xq[j] is used as
|
308
|
+
* xq[j] is used as interpolating value
|
309
309
|
|
310
310
|
\identifier{1bh} */
|
311
311
|
inline friend MatType interp1d(const std::vector<double>& x, const MatType&v,
|
@@ -653,11 +653,48 @@ namespace casadi {
|
|
653
653
|
|
654
654
|
The argument must be symbolic
|
655
655
|
|
656
|
+
The dependency is in a mathematical way:
|
657
|
+
Does the value of the argument affect the value of the expression?
|
658
|
+
Equivalently, will the corresponding entry of the Jacobian by a non-zero?
|
659
|
+
|
660
|
+
The symbol could still be present in the expression graph.
|
661
|
+
|
662
|
+
To check that kind of dependency, use contains(symvar(f),arg)
|
663
|
+
|
656
664
|
\identifier{1ck} */
|
657
665
|
inline friend bool depends_on(const MatType& f, const MatType &arg) {
|
658
666
|
return MatType::depends_on(f, arg);
|
659
667
|
}
|
660
668
|
|
669
|
+
/** \brief Check if expression n is listed in v
|
670
|
+
*
|
671
|
+
* This function checks for correspondence between nodes.
|
672
|
+
* The detection does not descend into the expression graph.
|
673
|
+
*
|
674
|
+
* contains({a,b},b) -> true
|
675
|
+
* contains({a+b},b) -> false
|
676
|
+
*
|
677
|
+
* e = a+b
|
678
|
+
* contains({e},e) -> true
|
679
|
+
*
|
680
|
+
* For mathematical dependency, see depends_on
|
681
|
+
* \sa depends_on
|
682
|
+
|
683
|
+
\identifier{2c8} */
|
684
|
+
/// @{
|
685
|
+
inline friend bool contains(const std::vector<MatType>& v, const MatType &n) {
|
686
|
+
return contains_all(v, std::vector<MatType>{n});
|
687
|
+
}
|
688
|
+
|
689
|
+
inline friend bool contains_all(const std::vector<MatType>& v, const std::vector<MatType> &n) {
|
690
|
+
return MatType::contains_all(v, n);
|
691
|
+
}
|
692
|
+
|
693
|
+
inline friend bool contains_any(const std::vector<MatType>& v, const std::vector<MatType> &n) {
|
694
|
+
return MatType::contains_any(v, n);
|
695
|
+
}
|
696
|
+
/// @}
|
697
|
+
|
661
698
|
/** \brief Substitute variable v with expression vdef in an expression ex
|
662
699
|
|
663
700
|
\identifier{1cl} */
|
@@ -722,6 +759,8 @@ namespace casadi {
|
|
722
759
|
|
723
760
|
\identifier{1cq} */
|
724
761
|
friend inline MatType solve(const MatType& A, const MatType& b) {
|
762
|
+
// If A is scalar, just divide
|
763
|
+
if (A.is_scalar()) return b/A;
|
725
764
|
return MatType::solve(A, b);
|
726
765
|
}
|
727
766
|
|
@@ -731,16 +770,33 @@ namespace casadi {
|
|
731
770
|
friend inline MatType solve(const MatType& A, const MatType& b,
|
732
771
|
const std::string& lsolver,
|
733
772
|
const Dict& dict = Dict()) {
|
773
|
+
// If A is scalar, just divide
|
774
|
+
if (A.is_scalar()) return b/A;
|
734
775
|
return MatType::solve(A, b, lsolver, dict);
|
735
776
|
}
|
736
777
|
|
778
|
+
#ifdef WITH_DEPRECATED_FEATURES
|
737
779
|
/** \brief Linearize an expression
|
780
|
+
*
|
781
|
+
* [DEPRECATED] confusing behaviour
|
782
|
+
*
|
783
|
+
* This function linearizes an expression around a point x0,
|
784
|
+
* using x as delta around that point.
|
785
|
+
*
|
786
|
+
* \code
|
787
|
+
* linearize(sin(x),x,x0) -> sin(x0)+cos(x0)*x
|
788
|
+
* \endcode
|
789
|
+
*
|
790
|
+
* For a variant that returns sin(x0)+cos(x0)*(x-x0), see taylor.
|
791
|
+
*
|
792
|
+
* \sa taylor, linear_coeff
|
738
793
|
|
739
794
|
\identifier{1cs} */
|
740
795
|
friend inline MatType linearize(const MatType& f, const MatType& x, const MatType& x0,
|
741
796
|
const Dict& opts=Dict()) {
|
742
797
|
return MatType::linearize(f, x, x0, opts);
|
743
798
|
}
|
799
|
+
#endif // WITH_DEPRECATED_FEATURES
|
744
800
|
|
745
801
|
/** \brief Computes the Moore-Penrose pseudo-inverse
|
746
802
|
*
|
@@ -935,6 +991,129 @@ namespace casadi {
|
|
935
991
|
MatType::linear_coeff(expr, var, A, b, check);
|
936
992
|
}
|
937
993
|
|
994
|
+
/** \brief Extract purely parametric parts from an expression graph
|
995
|
+
*
|
996
|
+
* The purpose of extract_parametric is ultimately to save on evaluation time of an expression,
|
997
|
+
* by extracting out the parts that are only solely dependent on parameters.
|
998
|
+
*
|
999
|
+
* For any:
|
1000
|
+
* [expr_ret, symbols, parametric] = extract_parametric(expr, par)
|
1001
|
+
* It holds that:
|
1002
|
+
* substitute(expr_ret,symbols,parametric) == expr
|
1003
|
+
*
|
1004
|
+
* parametric is only dependant on par
|
1005
|
+
* expr_ret is not dependant on par, but is dependant on symbols
|
1006
|
+
*
|
1007
|
+
* Example:
|
1008
|
+
* [expr_ret, symbols, parametric] = extract_parametric((x-sqrt(p))*y+cos(p)**2, p)
|
1009
|
+
*
|
1010
|
+
* expr_ret: (((x-extracted1)*y)+extracted2)
|
1011
|
+
* symbols: [extracted1, extracted2]
|
1012
|
+
* parametric: [sqrt(p),cos(p)**2]
|
1013
|
+
*
|
1014
|
+
* Options to control the name of new symbols:
|
1015
|
+
* - offset (int), default 0: Offset for new symbol counter
|
1016
|
+
* - prefix (str), default 'e_': Prefix for new symbols
|
1017
|
+
* - suffix (str), default '': Suffix for new symbols
|
1018
|
+
*
|
1019
|
+
* Option 'extract_trivial' controls the behaviour for extracted parts
|
1020
|
+
* that consist of pure symbols. If false (default),
|
1021
|
+
* these parts are not extracted.
|
1022
|
+
*
|
1023
|
+
|
1024
|
+
\identifier{288} */
|
1025
|
+
inline friend void extract_parametric(const MatType &expr, const MatType& par,
|
1026
|
+
MatType& SWIG_OUTPUT(expr_ret),
|
1027
|
+
std::vector<MatType>& SWIG_OUTPUT(symbols),
|
1028
|
+
std::vector<MatType>& SWIG_OUTPUT(parametric),
|
1029
|
+
const Dict& opts=Dict()) {
|
1030
|
+
MatType::extract_parametric(expr, par, expr_ret, symbols, parametric, opts);
|
1031
|
+
}
|
1032
|
+
|
1033
|
+
inline friend void extract_parametric(const std::vector<MatType> &expr, const MatType& par,
|
1034
|
+
std::vector<MatType>& SWIG_OUTPUT(expr_ret),
|
1035
|
+
std::vector<MatType>& SWIG_OUTPUT(symbols),
|
1036
|
+
std::vector<MatType>& SWIG_OUTPUT(parametric),
|
1037
|
+
const Dict& opts=Dict()) {
|
1038
|
+
// Concatenate all vector elements
|
1039
|
+
MatType expr_cat = veccat(expr);
|
1040
|
+
MatType expr_ret_cat;
|
1041
|
+
|
1042
|
+
// Concatenated extract_parametric
|
1043
|
+
MatType::extract_parametric(expr_cat, par, expr_ret_cat, symbols, parametric, opts);
|
1044
|
+
|
1045
|
+
// Compute edges of vertsplit needed to undo concatenate
|
1046
|
+
std::vector<casadi_int> edges = {0};
|
1047
|
+
for (const MatType& e : expr) {
|
1048
|
+
edges.push_back(edges.back() + e.numel());
|
1049
|
+
}
|
1050
|
+
// Perform vertsplit
|
1051
|
+
std::vector<MatType> expr_ret_catv = MatType::vertsplit(expr_ret_cat, edges);
|
1052
|
+
|
1053
|
+
// Reshape all elements back into original size
|
1054
|
+
expr_ret.resize(expr_ret_catv.size());
|
1055
|
+
for (casadi_int i=0; i<expr_ret_catv.size(); ++i) {
|
1056
|
+
expr_ret[i] = reshape(expr_ret_catv[i], expr[i].size1(), expr[i].size2());
|
1057
|
+
}
|
1058
|
+
}
|
1059
|
+
|
1060
|
+
inline friend void extract_parametric(const std::vector<MatType> &expr,
|
1061
|
+
const std::vector<MatType>& par,
|
1062
|
+
std::vector<MatType>& SWIG_OUTPUT(expr_ret),
|
1063
|
+
std::vector<MatType>& SWIG_OUTPUT(symbols),
|
1064
|
+
std::vector<MatType>& SWIG_OUTPUT(parametric),
|
1065
|
+
const Dict& opts=Dict()) {
|
1066
|
+
extract_parametric(expr, veccat(par), expr_ret, symbols, parametric, opts);
|
1067
|
+
}
|
1068
|
+
|
1069
|
+
inline friend void extract_parametric(const MatType &expr, const std::vector<MatType>& par,
|
1070
|
+
MatType& SWIG_OUTPUT(expr_ret),
|
1071
|
+
std::vector<MatType>& SWIG_OUTPUT(symbols),
|
1072
|
+
std::vector<MatType>& SWIG_OUTPUT(parametric),
|
1073
|
+
const Dict& opts=Dict()) {
|
1074
|
+
extract_parametric(expr, veccat(par), expr_ret, symbols, parametric, opts);
|
1075
|
+
}
|
1076
|
+
|
1077
|
+
/* \brief separate an expression into subuexpression that are linear, constant, and nonlinear
|
1078
|
+
*
|
1079
|
+
* \param expr[in] The expression to be separated
|
1080
|
+
* \param sym_lin[in] The symbolic variables w.r.t. which linearity should be checked
|
1081
|
+
* \param sym_const[in] The symbolic variables that are deemed constant
|
1082
|
+
* \param expr_const[out] The constant part of the expression
|
1083
|
+
* \param expr_lin[out] The linear part of the expression
|
1084
|
+
* \param expr_nonlin[out] The nonlinear part of the expression
|
1085
|
+
*
|
1086
|
+
* Expression dependencies that are not in sym_lin or sym_const are considered nonlinear
|
1087
|
+
*
|
1088
|
+
* A post condition is that the following holds:
|
1089
|
+
* expr = expr_const + expr_lin + expr_nonlin
|
1090
|
+
*
|
1091
|
+
* Here, expr_const is not dependant on sym_const,
|
1092
|
+
* expr_lin is linear in sym_lin
|
1093
|
+
*
|
1094
|
+
* Example:
|
1095
|
+
*
|
1096
|
+
* [expr_const,expr_lin,expr_nonlin] =
|
1097
|
+
* separate_linear(cos(p)+7*x+x*y, vertcat(x,y), p)
|
1098
|
+
*
|
1099
|
+
* expr_const: cos(p)
|
1100
|
+
* expr_lin: 7*x
|
1101
|
+
* expr_nonlin: x*y
|
1102
|
+
*
|
1103
|
+
*/
|
1104
|
+
inline friend void separate_linear(const MatType &expr,
|
1105
|
+
const MatType &sym_lin, const MatType &sym_const,
|
1106
|
+
MatType& expr_const, MatType& expr_lin, MatType& expr_nonlin) {
|
1107
|
+
MatType::separate_linear(expr, sym_lin, sym_const, expr_const, expr_lin, expr_nonlin);
|
1108
|
+
}
|
1109
|
+
|
1110
|
+
inline friend void separate_linear(const MatType &expr,
|
1111
|
+
const std::vector<MatType> &sym_lin, const std::vector<MatType> &sym_const,
|
1112
|
+
MatType& expr_const, MatType& expr_lin, MatType& expr_nonlin) {
|
1113
|
+
separate_linear(expr, veccat(sym_lin), veccat(sym_const),
|
1114
|
+
expr_const, expr_lin, expr_nonlin);
|
1115
|
+
}
|
1116
|
+
|
938
1117
|
/** Count number of nodes */
|
939
1118
|
inline friend casadi_int n_nodes(const MatType& A) {
|
940
1119
|
return MatType::n_nodes(A);
|
@@ -1252,10 +1431,20 @@ namespace casadi {
|
|
1252
1431
|
MatType GenericMatrix<MatType>::interp1d(const std::vector<double>& x, const MatType& v,
|
1253
1432
|
const std::vector<double>& xq, const std::string& mode, bool equidistant) {
|
1254
1433
|
|
1255
|
-
bool mode_floor =
|
1256
|
-
bool mode_ceil =
|
1434
|
+
bool mode_floor = false;
|
1435
|
+
bool mode_ceil = false;
|
1436
|
+
if (mode=="floor") {
|
1437
|
+
mode_floor = true;
|
1438
|
+
} else if (mode=="ceil") {
|
1439
|
+
mode_ceil = true;
|
1440
|
+
} else if (mode=="linear") {
|
1441
|
+
//
|
1442
|
+
} else {
|
1443
|
+
casadi_error("interp1d(x, v, xq, mode): "
|
1444
|
+
"Mode must be 'floor', 'ceil' or 'linear'. Got '" + mode + "' instead.");
|
1445
|
+
}
|
1257
1446
|
|
1258
|
-
|
1447
|
+
casadi_assert(is_increasing(x), "interp1d(x, v, xq): x must be increasing.");
|
1259
1448
|
|
1260
1449
|
casadi_assert(x.size()==v.size1(),
|
1261
1450
|
"interp1d(x, v, xq): dimensions mismatch. v expected to have " + str(x.size()) + " rows,"
|
@@ -1423,17 +1612,35 @@ namespace casadi {
|
|
1423
1612
|
try {
|
1424
1613
|
// Assert consistent input dimensions
|
1425
1614
|
if (tr) {
|
1426
|
-
|
1615
|
+
if (ex.size2()==0 && v.size2()>0) {
|
1616
|
+
casadi_error("Ambiguous dimensions.");
|
1617
|
+
}
|
1618
|
+
casadi_assert(v.size1() == ex.size1() &&
|
1619
|
+
(v.size2()==0 || ex.size2()==0 || v.size2() % ex.size2() == 0),
|
1427
1620
|
"'v' has inconsistent dimensions: "
|
1428
1621
|
" v " + v.dim(false) + ", ex " + ex.dim(false) + ".");
|
1429
1622
|
} else {
|
1430
|
-
|
1623
|
+
if (arg.size2()==0 && v.size2()>0) {
|
1624
|
+
casadi_error("Ambiguous dimensions.");
|
1625
|
+
}
|
1626
|
+
casadi_assert(v.size1() == arg.size1() &&
|
1627
|
+
(v.size2()==0 || arg.size2()==0 || v.size2() % arg.size2() == 0),
|
1431
1628
|
"'v' has inconsistent dimensions: "
|
1432
1629
|
" v " + v.dim(false) + ", arg " + arg.dim(false) + ".");
|
1433
1630
|
}
|
1434
1631
|
|
1632
|
+
casadi_int n_seeds = 1;
|
1633
|
+
if (tr) {
|
1634
|
+
if (ex.size2()>0) n_seeds = v.size2() / ex.size2();
|
1635
|
+
} else {
|
1636
|
+
if (arg.size2()>0) n_seeds = v.size2() / arg.size2();
|
1637
|
+
}
|
1638
|
+
|
1435
1639
|
// Quick return if no seeds
|
1436
|
-
if (v.is_empty()
|
1640
|
+
if (v.is_empty() || ex.is_empty()) {
|
1641
|
+
return MatType(tr ? arg.size1() : ex.size1(),
|
1642
|
+
tr ? arg.size2()*n_seeds : ex.size2()*n_seeds);
|
1643
|
+
}
|
1437
1644
|
|
1438
1645
|
// Split up the seed into its components
|
1439
1646
|
std::vector<MatType> w = horzsplit(v, tr ? ex.size2() : arg.size2());
|