casadi 3.7.2__cp314-none-win_amd64.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/__init__.py +92 -0
- casadi/_casadi.pyd +0 -0
- casadi/blasfeo.lib +0 -0
- casadi/casadi-cli.exe +0 -0
- casadi/casadi.lib +0 -0
- casadi/casadi.py +54468 -0
- casadi/cbc.exe +0 -0
- casadi/clp.exe +0 -0
- casadi/cmake/alpaqa/alpaqaConfig.cmake +24 -0
- casadi/cmake/alpaqa/alpaqaConfigVersion.cmake +67 -0
- casadi/cmake/alpaqa/alpaqaTargets-release.cmake +19 -0
- casadi/cmake/alpaqa/alpaqaTargets.cmake +108 -0
- casadi/cmake/casadi-config-version.cmake +11 -0
- casadi/cmake/casadi-config.cmake +8 -0
- casadi/cmake/casadi-targets-release.cmake +19 -0
- casadi/cmake/casadi-targets.cmake +94 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-config-version.cmake +76 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-config.cmake +30 -0
- casadi/cmake/ghc_filesystem/ghc_filesystem-targets.cmake +99 -0
- casadi/cmake/highs/highs-config.cmake +17 -0
- casadi/cmake/highs/highs-targets-release.cmake +28 -0
- casadi/cmake/highs/highs-targets.cmake +105 -0
- 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/cmake/libzip/libzip-targets.cmake +99 -0
- 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/cmake/osqp/osqp-config.cmake +1 -0
- casadi/cmake/osqp/osqp-targets-release.cmake +29 -0
- casadi/cmake/osqp/osqp-targets.cmake +101 -0
- casadi/cmake/proxsuite/find-external/Simde/FindSimde.cmake +39 -0
- casadi/cmake/proxsuite/proxsuiteConfig.cmake +177 -0
- casadi/cmake/proxsuite/proxsuiteConfigVersion.cmake +67 -0
- casadi/cmake/proxsuite/proxsuiteTargets.cmake +107 -0
- casadi/cmake/qdldl/qdldl-config.cmake +1 -0
- casadi/cmake/qdldl/qdldl-targets-release.cmake +29 -0
- casadi/cmake/qdldl/qdldl-targets.cmake +101 -0
- casadi/cmake/sleqp/sleqp-config-version.cmake +67 -0
- casadi/cmake/sleqp/sleqp-config.cmake +1 -0
- casadi/cmake/sleqp/sleqp-targets-release.cmake +20 -0
- casadi/cmake/sleqp/sleqp-targets.cmake +94 -0
- casadi/cmake/trlib/trlib-config-release.cmake +19 -0
- casadi/cmake/trlib/trlib-config-version.cmake +59 -0
- casadi/cmake/trlib/trlib-config.cmake +99 -0
- casadi/daqp.lib +0 -0
- casadi/fatrop.lib +0 -0
- casadi/highs.exe +0 -0
- casadi/highs.lib +0 -0
- casadi/hpipm.lib +0 -0
- casadi/include/alpaqa/accelerators/anderson.hpp +133 -0
- casadi/include/alpaqa/accelerators/internal/anderson-helpers.hpp +92 -0
- casadi/include/alpaqa/accelerators/internal/limited-memory-qr.hpp +295 -0
- casadi/include/alpaqa/accelerators/lbfgs.hpp +244 -0
- casadi/include/alpaqa/accelerators/steihaugcg.hpp +143 -0
- casadi/include/alpaqa/alpaqa.hpp +3 -0
- casadi/include/alpaqa/casadi/CasADiControlProblem.hpp +185 -0
- casadi/include/alpaqa/casadi/CasADiFunctionWrapper.hpp +104 -0
- casadi/include/alpaqa/casadi/CasADiProblem.hpp +102 -0
- casadi/include/alpaqa/casadi-loader-export.hpp +15 -0
- casadi/include/alpaqa/casadi-ocp-loader-export.hpp +15 -0
- casadi/include/alpaqa/config/config.hpp +165 -0
- casadi/include/alpaqa/dl/dl-problem.h +476 -0
- casadi/include/alpaqa/dl/dl-problem.hpp +301 -0
- casadi/include/alpaqa/export.h +42 -0
- casadi/include/alpaqa/export.hpp +30 -0
- casadi/include/alpaqa/implementation/accelerators/lbfgs.tpp +240 -0
- casadi/include/alpaqa/implementation/casadi/CasADiControlProblem.tpp +594 -0
- casadi/include/alpaqa/implementation/casadi/CasADiLoader-util.hpp +50 -0
- casadi/include/alpaqa/implementation/casadi/CasADiProblem.tpp +425 -0
- casadi/include/alpaqa/implementation/inner/directions/panoc/structured-lbfgs.tpp +164 -0
- casadi/include/alpaqa/implementation/inner/panoc-helpers.tpp +389 -0
- casadi/include/alpaqa/implementation/inner/panoc-ocp.tpp +798 -0
- casadi/include/alpaqa/implementation/inner/panoc.tpp +448 -0
- casadi/include/alpaqa/implementation/inner/pantr.tpp +474 -0
- casadi/include/alpaqa/implementation/inner/zerofpr.tpp +482 -0
- casadi/include/alpaqa/implementation/outer/alm.tpp +228 -0
- casadi/include/alpaqa/implementation/outer/internal/alm-helpers.tpp +80 -0
- casadi/include/alpaqa/implementation/params/params.tpp +158 -0
- casadi/include/alpaqa/implementation/problem/ocproblem.tpp +56 -0
- casadi/include/alpaqa/implementation/problem/type-erased-problem.tpp +211 -0
- casadi/include/alpaqa/implementation/util/io/csv.tpp +120 -0
- casadi/include/alpaqa/implementation/util/print.tpp +151 -0
- casadi/include/alpaqa/inner/directions/panoc/anderson.hpp +98 -0
- casadi/include/alpaqa/inner/directions/panoc/lbfgs.hpp +94 -0
- casadi/include/alpaqa/inner/directions/panoc/structured-lbfgs.hpp +146 -0
- casadi/include/alpaqa/inner/directions/panoc/structured-newton.hpp +264 -0
- casadi/include/alpaqa/inner/directions/panoc-direction-update.hpp +96 -0
- casadi/include/alpaqa/inner/directions/panoc-ocp/lqr.hpp +181 -0
- casadi/include/alpaqa/inner/directions/panoc-ocp/ocp-vars.hpp +492 -0
- casadi/include/alpaqa/inner/directions/pantr/newton-tr.hpp +192 -0
- casadi/include/alpaqa/inner/directions/pantr/pantr-direction.hpp +99 -0
- casadi/include/alpaqa/inner/inner-solve-options.hpp +30 -0
- casadi/include/alpaqa/inner/internal/lipschitz.hpp +27 -0
- casadi/include/alpaqa/inner/internal/panoc-helpers.hpp +10 -0
- casadi/include/alpaqa/inner/internal/panoc-stop-crit.hpp +124 -0
- casadi/include/alpaqa/inner/internal/solverstatus.hpp +42 -0
- casadi/include/alpaqa/inner/panoc-ocp.hpp +302 -0
- casadi/include/alpaqa/inner/panoc.hpp +274 -0
- casadi/include/alpaqa/inner/pantr.hpp +284 -0
- casadi/include/alpaqa/inner/zerofpr.hpp +274 -0
- casadi/include/alpaqa/ipopt/ipopt-adapter.hpp +81 -0
- casadi/include/alpaqa/ipopt/ipopt-enums.hpp +35 -0
- casadi/include/alpaqa/lbfgsb/lbfgsb-adapter.hpp +111 -0
- casadi/include/alpaqa/newton-tr-pantr-alm.hpp +27 -0
- casadi/include/alpaqa/outer/alm.hpp +190 -0
- casadi/include/alpaqa/outer/internal/alm-helpers.hpp +10 -0
- casadi/include/alpaqa/panoc-alm.hpp +27 -0
- casadi/include/alpaqa/panoc-anderson-alm.hpp +27 -0
- casadi/include/alpaqa/params/params.hpp +60 -0
- casadi/include/alpaqa/problem/box-constr-problem.hpp +220 -0
- casadi/include/alpaqa/problem/box.hpp +82 -0
- casadi/include/alpaqa/problem/functional-problem.hpp +73 -0
- casadi/include/alpaqa/problem/kkt-error.hpp +43 -0
- casadi/include/alpaqa/problem/ocproblem-counters.hpp +116 -0
- casadi/include/alpaqa/problem/ocproblem.hpp +662 -0
- casadi/include/alpaqa/problem/problem-counters.hpp +116 -0
- casadi/include/alpaqa/problem/problem-with-counters.hpp +141 -0
- casadi/include/alpaqa/problem/type-erased-problem.hpp +874 -0
- casadi/include/alpaqa/problem/unconstr-problem.hpp +37 -0
- casadi/include/alpaqa/structured-panoc-alm.hpp +27 -0
- casadi/include/alpaqa/structured-zerofpr-alm.hpp +27 -0
- casadi/include/alpaqa/util/alloc-check.hpp +23 -0
- casadi/include/alpaqa/util/atomic-stop-signal.hpp +24 -0
- casadi/include/alpaqa/util/check-dim.hpp +64 -0
- casadi/include/alpaqa/util/copyable_unique_ptr.hpp +32 -0
- casadi/include/alpaqa/util/demangled-typename.hpp +9 -0
- casadi/include/alpaqa/util/enumerate.hpp +70 -0
- casadi/include/alpaqa/util/float.hpp +25 -0
- casadi/include/alpaqa/util/index-set.hpp +97 -0
- casadi/include/alpaqa/util/io/csv.hpp +43 -0
- casadi/include/alpaqa/util/iter-adapter.hpp +68 -0
- casadi/include/alpaqa/util/max-history.hpp +47 -0
- casadi/include/alpaqa/util/noop-delete.hpp +15 -0
- casadi/include/alpaqa/util/not-implemented.hpp +12 -0
- casadi/include/alpaqa/util/print.hpp +78 -0
- casadi/include/alpaqa/util/quadmath/quadmath-print.hpp +20 -0
- casadi/include/alpaqa/util/quadmath/quadmath.hpp +137 -0
- casadi/include/alpaqa/util/required-method.hpp +29 -0
- casadi/include/alpaqa/util/ringbuffer.hpp +212 -0
- casadi/include/alpaqa/util/set-intersection.hpp +129 -0
- casadi/include/alpaqa/util/sparse-ops.hpp +164 -0
- casadi/include/alpaqa/util/timed.hpp +22 -0
- casadi/include/alpaqa/util/type-erasure.hpp +568 -0
- casadi/include/alpaqa/util/type-traits.hpp +58 -0
- casadi/include/alpaqa/zerofpr-alm.hpp +27 -0
- casadi/include/alpaqa/zerofpr-anderson-alm.hpp +27 -0
- casadi/include/alpaqa-version.h +8 -0
- casadi/include/blasfeo.h +52 -0
- casadi/include/blasfeo_block_size.h +447 -0
- casadi/include/blasfeo_common.h +274 -0
- casadi/include/blasfeo_d_aux.h +255 -0
- casadi/include/blasfeo_d_aux_ext_dep.h +145 -0
- casadi/include/blasfeo_d_aux_ext_dep_ref.h +84 -0
- casadi/include/blasfeo_d_aux_old.h +75 -0
- casadi/include/blasfeo_d_aux_ref.h +208 -0
- casadi/include/blasfeo_d_aux_test.h +226 -0
- casadi/include/blasfeo_d_blas.h +46 -0
- casadi/include/blasfeo_d_blas_api.h +281 -0
- casadi/include/blasfeo_d_blasfeo_api.h +364 -0
- casadi/include/blasfeo_d_blasfeo_api_ref.h +147 -0
- casadi/include/blasfeo_d_blasfeo_hp_api.h +84 -0
- casadi/include/blasfeo_d_blasfeo_ref_api.h +283 -0
- casadi/include/blasfeo_d_kernel.h +1321 -0
- casadi/include/blasfeo_i_aux_ext_dep.h +69 -0
- casadi/include/blasfeo_m_aux.h +57 -0
- casadi/include/blasfeo_memory.h +62 -0
- casadi/include/blasfeo_naming.h +77 -0
- casadi/include/blasfeo_processor_features.h +88 -0
- casadi/include/blasfeo_s_aux.h +168 -0
- casadi/include/blasfeo_s_aux_ext_dep.h +141 -0
- casadi/include/blasfeo_s_aux_ext_dep_ref.h +82 -0
- casadi/include/blasfeo_s_aux_old.h +64 -0
- casadi/include/blasfeo_s_aux_ref.h +147 -0
- casadi/include/blasfeo_s_aux_test.h +177 -0
- casadi/include/blasfeo_s_blas.h +46 -0
- casadi/include/blasfeo_s_blas_api.h +182 -0
- casadi/include/blasfeo_s_blasfeo_api.h +284 -0
- casadi/include/blasfeo_s_blasfeo_api_ref.h +135 -0
- casadi/include/blasfeo_s_blasfeo_ref_api.h +252 -0
- casadi/include/blasfeo_s_kernel.h +692 -0
- casadi/include/blasfeo_stdlib.h +62 -0
- casadi/include/blasfeo_target.h +73 -0
- casadi/include/blasfeo_timing.h +114 -0
- casadi/include/blasfeo_v_aux_ext_dep.h +83 -0
- casadi/include/casadi/casadi.hpp +31 -0
- casadi/include/casadi/casadi.i +4920 -0
- casadi/include/casadi/casadi_c.h +138 -0
- casadi/include/casadi/casadi_numpy.hpp +97 -0
- casadi/include/casadi/config.h +46 -0
- casadi/include/casadi/core/archiver.hpp +58 -0
- casadi/include/casadi/core/blazing_spline.hpp +47 -0
- casadi/include/casadi/core/calculus.hpp +1805 -0
- casadi/include/casadi/core/callback.hpp +235 -0
- casadi/include/casadi/core/casadi_common.hpp +355 -0
- casadi/include/casadi/core/casadi_enum.hpp +90 -0
- casadi/include/casadi/core/casadi_export.h +42 -0
- casadi/include/casadi/core/casadi_interrupt.hpp +83 -0
- casadi/include/casadi/core/casadi_limits.hpp +104 -0
- casadi/include/casadi/core/casadi_logger.hpp +134 -0
- casadi/include/casadi/core/casadi_meta.hpp +122 -0
- casadi/include/casadi/core/casadi_misc.hpp +1022 -0
- casadi/include/casadi/core/casadi_types.hpp +66 -0
- casadi/include/casadi/core/code_generator.hpp +1071 -0
- casadi/include/casadi/core/conic.hpp +213 -0
- casadi/include/casadi/core/core.hpp +75 -0
- casadi/include/casadi/core/dae_builder.hpp +885 -0
- casadi/include/casadi/core/dm.hpp +90 -0
- casadi/include/casadi/core/dm_fwd.hpp +39 -0
- casadi/include/casadi/core/dple.hpp +138 -0
- casadi/include/casadi/core/exception.hpp +167 -0
- casadi/include/casadi/core/expm.hpp +84 -0
- casadi/include/casadi/core/external.hpp +70 -0
- casadi/include/casadi/core/filesystem.hpp +58 -0
- casadi/include/casadi/core/fmu.hpp +270 -0
- casadi/include/casadi/core/function.hpp +1389 -0
- casadi/include/casadi/core/generic_expression.hpp +760 -0
- casadi/include/casadi/core/generic_matrix.hpp +1805 -0
- 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 +314 -0
- casadi/include/casadi/core/global_options.hpp +107 -0
- casadi/include/casadi/core/im.hpp +52 -0
- casadi/include/casadi/core/im_fwd.hpp +35 -0
- casadi/include/casadi/core/importer.hpp +221 -0
- casadi/include/casadi/core/integration_tools.hpp +292 -0
- casadi/include/casadi/core/integrator.hpp +290 -0
- casadi/include/casadi/core/interpolant.hpp +163 -0
- casadi/include/casadi/core/linsol.hpp +171 -0
- casadi/include/casadi/core/matrix_decl.hpp +1423 -0
- casadi/include/casadi/core/matrix_fwd.hpp +37 -0
- casadi/include/casadi/core/mx.hpp +1014 -0
- casadi/include/casadi/core/nlp_builder.hpp +163 -0
- casadi/include/casadi/core/nlp_tools.hpp +124 -0
- casadi/include/casadi/core/nlpsol.hpp +234 -0
- casadi/include/casadi/core/nonzeros.hpp +111 -0
- casadi/include/casadi/core/options.hpp +122 -0
- casadi/include/casadi/core/optistack.hpp +704 -0
- casadi/include/casadi/core/polynomial.hpp +126 -0
- casadi/include/casadi/core/printable.hpp +81 -0
- casadi/include/casadi/core/resource.hpp +107 -0
- casadi/include/casadi/core/rootfinder.hpp +176 -0
- casadi/include/casadi/core/runtime/casadi_axpy.hpp +8 -0
- casadi/include/casadi/core/runtime/casadi_bfgs.hpp +49 -0
- casadi/include/casadi/core/runtime/casadi_bilin.hpp +42 -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_bound_consistency.hpp +51 -0
- casadi/include/casadi/core/runtime/casadi_cache.hpp +59 -0
- casadi/include/casadi/core/runtime/casadi_clear.hpp +27 -0
- casadi/include/casadi/core/runtime/casadi_clip_max.hpp +33 -0
- casadi/include/casadi/core/runtime/casadi_clip_min.hpp +33 -0
- casadi/include/casadi/core/runtime/casadi_convexify.hpp +182 -0
- casadi/include/casadi/core/runtime/casadi_copy.hpp +31 -0
- casadi/include/casadi/core/runtime/casadi_cvx.hpp +463 -0
- casadi/include/casadi/core/runtime/casadi_de_boor.hpp +36 -0
- casadi/include/casadi/core/runtime/casadi_dense_lsqr.hpp +247 -0
- casadi/include/casadi/core/runtime/casadi_densify.hpp +48 -0
- casadi/include/casadi/core/runtime/casadi_dot.hpp +27 -0
- casadi/include/casadi/core/runtime/casadi_feasiblesqpmethod.hpp +208 -0
- casadi/include/casadi/core/runtime/casadi_file_slurp.hpp +32 -0
- casadi/include/casadi/core/runtime/casadi_fill.hpp +27 -0
- casadi/include/casadi/core/runtime/casadi_finite_diff.hpp +345 -0
- casadi/include/casadi/core/runtime/casadi_flip.hpp +33 -0
- casadi/include/casadi/core/runtime/casadi_getu.hpp +35 -0
- casadi/include/casadi/core/runtime/casadi_iamax.hpp +36 -0
- casadi/include/casadi/core/runtime/casadi_interpn.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_interpn_grad.hpp +72 -0
- casadi/include/casadi/core/runtime/casadi_interpn_interpolate.hpp +43 -0
- casadi/include/casadi/core/runtime/casadi_interpn_weights.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_ipqp.hpp +868 -0
- casadi/include/casadi/core/runtime/casadi_jac.hpp +186 -0
- casadi/include/casadi/core/runtime/casadi_kkt.hpp +67 -0
- casadi/include/casadi/core/runtime/casadi_kron.hpp +50 -0
- casadi/include/casadi/core/runtime/casadi_ldl.hpp +109 -0
- casadi/include/casadi/core/runtime/casadi_logsumexp.hpp +41 -0
- casadi/include/casadi/core/runtime/casadi_low.hpp +65 -0
- casadi/include/casadi/core/runtime/casadi_lsqr.hpp +247 -0
- casadi/include/casadi/core/runtime/casadi_masked_norm_inf.hpp +33 -0
- casadi/include/casadi/core/runtime/casadi_max_viol.hpp +37 -0
- casadi/include/casadi/core/runtime/casadi_mmax.hpp +28 -0
- casadi/include/casadi/core/runtime/casadi_mmin.hpp +29 -0
- casadi/include/casadi/core/runtime/casadi_mtimes.hpp +75 -0
- casadi/include/casadi/core/runtime/casadi_mv.hpp +46 -0
- casadi/include/casadi/core/runtime/casadi_mv_dense.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_nd_boor_dual_eval.hpp +127 -0
- casadi/include/casadi/core/runtime/casadi_nd_boor_eval.hpp +120 -0
- casadi/include/casadi/core/runtime/casadi_newton.hpp +66 -0
- casadi/include/casadi/core/runtime/casadi_nlp.hpp +295 -0
- casadi/include/casadi/core/runtime/casadi_norm_1.hpp +29 -0
- casadi/include/casadi/core/runtime/casadi_norm_2.hpp +24 -0
- casadi/include/casadi/core/runtime/casadi_norm_inf.hpp +28 -0
- casadi/include/casadi/core/runtime/casadi_norm_inf_mul.hpp +105 -0
- casadi/include/casadi/core/runtime/casadi_ocp_block.hpp +55 -0
- casadi/include/casadi/core/runtime/casadi_oracle.hpp +44 -0
- casadi/include/casadi/core/runtime/casadi_oracle_callback.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_polyval.hpp +29 -0
- 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/runtime/casadi_project.hpp +39 -0
- casadi/include/casadi/core/runtime/casadi_qp.hpp +86 -0
- casadi/include/casadi/core/runtime/casadi_qr.hpp +272 -0
- casadi/include/casadi/core/runtime/casadi_qrqp.hpp +1239 -0
- casadi/include/casadi/core/runtime/casadi_rank1.hpp +40 -0
- casadi/include/casadi/core/runtime/casadi_regularize.hpp +73 -0
- casadi/include/casadi/core/runtime/casadi_runtime.hpp +318 -0
- casadi/include/casadi/core/runtime/casadi_scal.hpp +26 -0
- casadi/include/casadi/core/runtime/casadi_scaled_copy.hpp +31 -0
- casadi/include/casadi/core/runtime/casadi_sparsify.hpp +42 -0
- casadi/include/casadi/core/runtime/casadi_sparsity.hpp +24 -0
- casadi/include/casadi/core/runtime/casadi_sqpmethod.hpp +178 -0
- casadi/include/casadi/core/runtime/casadi_sum.hpp +31 -0
- casadi/include/casadi/core/runtime/casadi_sum_viol.hpp +37 -0
- casadi/include/casadi/core/runtime/casadi_swap.hpp +32 -0
- casadi/include/casadi/core/runtime/casadi_trans.hpp +35 -0
- casadi/include/casadi/core/runtime/casadi_tri_project.hpp +37 -0
- casadi/include/casadi/core/runtime/casadi_trilsolve.hpp +81 -0
- casadi/include/casadi/core/runtime/casadi_triusolve.hpp +81 -0
- casadi/include/casadi/core/runtime/casadi_vector_fmax.hpp +28 -0
- casadi/include/casadi/core/runtime/casadi_vector_fmin.hpp +28 -0
- casadi/include/casadi/core/runtime/casadi_vfmax.hpp +28 -0
- casadi/include/casadi/core/runtime/casadi_vfmin.hpp +28 -0
- casadi/include/casadi/core/runtime/shared.hpp +261 -0
- casadi/include/casadi/core/serializer.hpp +264 -0
- casadi/include/casadi/core/serializing_stream.hpp +336 -0
- casadi/include/casadi/core/shared_object.hpp +182 -0
- casadi/include/casadi/core/slice.hpp +149 -0
- casadi/include/casadi/core/sparsity.hpp +1507 -0
- casadi/include/casadi/core/sparsity_interface.hpp +763 -0
- casadi/include/casadi/core/submatrix.hpp +156 -0
- casadi/include/casadi/core/sx.hpp +244 -0
- casadi/include/casadi/core/sx_elem.hpp +376 -0
- casadi/include/casadi/core/sx_fwd.hpp +45 -0
- casadi/include/casadi/core/timing.hpp +98 -0
- casadi/include/casadi/core/tools.hpp +67 -0
- casadi/include/casadi/core/xml_file.hpp +93 -0
- casadi/include/casadi/core/xml_node.hpp +212 -0
- casadi/include/casadi/doc.i +62244 -0
- casadi/include/casadi/doc_merged.i +38499 -0
- casadi/include/casadi/mem.h +311 -0
- casadi/include/casadi/valgrind-casadi.supp +649 -0
- casadi/include/casadi/valgrind-python.supp +3886 -0
- casadi/include/coin/BonArraysHelpers.hpp +52 -0
- casadi/include/coin/BonAuxInfos.hpp +110 -0
- casadi/include/coin/BonBabInfos.hpp +57 -0
- casadi/include/coin/BonBabSetupBase.hpp +386 -0
- casadi/include/coin/BonBonminSetup.hpp +95 -0
- casadi/include/coin/BonBranchingTQP.hpp +197 -0
- casadi/include/coin/BonCbc.hpp +127 -0
- casadi/include/coin/BonCbcLpStrategy.hpp +45 -0
- casadi/include/coin/BonCbcNlpStrategy.hpp +98 -0
- casadi/include/coin/BonCbcNode.hpp +133 -0
- casadi/include/coin/BonChooseVariable.hpp +345 -0
- casadi/include/coin/BonCurvBranchingSolver.hpp +77 -0
- casadi/include/coin/BonCutStrengthener.hpp +244 -0
- casadi/include/coin/BonDiver.hpp +424 -0
- casadi/include/coin/BonDummyHeuristic.hpp +53 -0
- casadi/include/coin/BonDummyPump.hpp +43 -0
- casadi/include/coin/BonEcpCuts.hpp +97 -0
- casadi/include/coin/BonExitCodes.hpp +12 -0
- casadi/include/coin/BonFixAndSolveHeuristic.hpp +43 -0
- casadi/include/coin/BonGuessHeuristic.hpp +46 -0
- casadi/include/coin/BonHeuristicDive.hpp +88 -0
- casadi/include/coin/BonHeuristicDiveFractional.hpp +67 -0
- casadi/include/coin/BonHeuristicDiveMIP.hpp +83 -0
- casadi/include/coin/BonHeuristicDiveMIPFractional.hpp +67 -0
- casadi/include/coin/BonHeuristicDiveMIPVectorLength.hpp +74 -0
- casadi/include/coin/BonHeuristicDiveVectorLength.hpp +74 -0
- casadi/include/coin/BonHeuristicFPump.hpp +111 -0
- casadi/include/coin/BonHeuristicLocalBranching.hpp +59 -0
- casadi/include/coin/BonHeuristicRINS.hpp +55 -0
- casadi/include/coin/BonIpoptInteriorWarmStarter.hpp +103 -0
- casadi/include/coin/BonIpoptSolver.hpp +188 -0
- casadi/include/coin/BonIpoptWarmStart.hpp +148 -0
- casadi/include/coin/BonLinearCutsGenerator.hpp +75 -0
- casadi/include/coin/BonLocalSolverBasedHeuristic.hpp +102 -0
- casadi/include/coin/BonLpBranchingSolver.hpp +80 -0
- casadi/include/coin/BonMilpRounding.hpp +74 -0
- casadi/include/coin/BonOACutGenerator2.hpp +56 -0
- casadi/include/coin/BonOAMessages.hpp +44 -0
- casadi/include/coin/BonOaDecBase.hpp +297 -0
- casadi/include/coin/BonOaFeasChecker.hpp +73 -0
- casadi/include/coin/BonOaNlpOptim.hpp +116 -0
- casadi/include/coin/BonOsiTMINLPInterface.hpp +1342 -0
- casadi/include/coin/BonOuterApprox.hpp +123 -0
- casadi/include/coin/BonPseudoCosts.hpp +91 -0
- casadi/include/coin/BonPumpForMinlp.hpp +45 -0
- casadi/include/coin/BonQuadCut.hpp +217 -0
- casadi/include/coin/BonQuadRow.hpp +122 -0
- casadi/include/coin/BonRegisteredOptions.hpp +225 -0
- casadi/include/coin/BonStrongBranchingSolver.hpp +69 -0
- casadi/include/coin/BonSubMipSolver.hpp +143 -0
- casadi/include/coin/BonTMINLP.hpp +420 -0
- casadi/include/coin/BonTMINLP2OsiLP.hpp +164 -0
- casadi/include/coin/BonTMINLP2Quad.hpp +191 -0
- casadi/include/coin/BonTMINLP2TNLP.hpp +509 -0
- casadi/include/coin/BonTMINLPLinObj.hpp +216 -0
- casadi/include/coin/BonTMatrix.hpp +167 -0
- casadi/include/coin/BonTNLP2FPNLP.hpp +264 -0
- casadi/include/coin/BonTNLPSolver.hpp +241 -0
- casadi/include/coin/BonTypes.hpp +95 -0
- casadi/include/coin/BonminConfig.h +19 -0
- casadi/include/coin/CbcBranchActual.hpp +26 -0
- casadi/include/coin/CbcBranchAllDifferent.hpp +61 -0
- casadi/include/coin/CbcBranchBase.hpp +79 -0
- casadi/include/coin/CbcBranchCut.hpp +182 -0
- casadi/include/coin/CbcBranchDecision.hpp +135 -0
- casadi/include/coin/CbcBranchDefaultDecision.hpp +101 -0
- casadi/include/coin/CbcBranchDynamic.hpp +210 -0
- casadi/include/coin/CbcBranchLotsize.hpp +249 -0
- casadi/include/coin/CbcBranchToFixLots.hpp +94 -0
- casadi/include/coin/CbcBranchingObject.hpp +245 -0
- casadi/include/coin/CbcClique.hpp +309 -0
- casadi/include/coin/CbcCompare.hpp +46 -0
- casadi/include/coin/CbcCompareActual.hpp +16 -0
- casadi/include/coin/CbcCompareBase.hpp +155 -0
- casadi/include/coin/CbcCompareDefault.hpp +129 -0
- casadi/include/coin/CbcCompareDepth.hpp +48 -0
- casadi/include/coin/CbcCompareEstimate.hpp +48 -0
- casadi/include/coin/CbcCompareObjective.hpp +50 -0
- casadi/include/coin/CbcConfig.h +18 -0
- casadi/include/coin/CbcConsequence.hpp +50 -0
- casadi/include/coin/CbcCountRowCut.hpp +176 -0
- casadi/include/coin/CbcCutGenerator.hpp +550 -0
- casadi/include/coin/CbcCutModifier.hpp +59 -0
- casadi/include/coin/CbcCutSubsetModifier.hpp +69 -0
- casadi/include/coin/CbcDummyBranchingObject.hpp +83 -0
- casadi/include/coin/CbcEventHandler.hpp +250 -0
- casadi/include/coin/CbcFathom.hpp +136 -0
- casadi/include/coin/CbcFathomDynamicProgramming.hpp +177 -0
- casadi/include/coin/CbcFeasibilityBase.hpp +60 -0
- casadi/include/coin/CbcFixVariable.hpp +68 -0
- casadi/include/coin/CbcFollowOn.hpp +207 -0
- casadi/include/coin/CbcFullNodeInfo.hpp +171 -0
- casadi/include/coin/CbcGeneral.hpp +60 -0
- casadi/include/coin/CbcGeneralDepth.hpp +289 -0
- casadi/include/coin/CbcHeuristic.hpp +735 -0
- casadi/include/coin/CbcHeuristicDINS.hpp +98 -0
- casadi/include/coin/CbcHeuristicDW.hpp +374 -0
- casadi/include/coin/CbcHeuristicDive.hpp +198 -0
- casadi/include/coin/CbcHeuristicDiveCoefficient.hpp +52 -0
- casadi/include/coin/CbcHeuristicDiveFractional.hpp +52 -0
- casadi/include/coin/CbcHeuristicDiveGuided.hpp +55 -0
- casadi/include/coin/CbcHeuristicDiveLineSearch.hpp +52 -0
- casadi/include/coin/CbcHeuristicDivePseudoCost.hpp +60 -0
- casadi/include/coin/CbcHeuristicDiveVectorLength.hpp +52 -0
- casadi/include/coin/CbcHeuristicFPump.hpp +375 -0
- casadi/include/coin/CbcHeuristicGreedy.hpp +289 -0
- casadi/include/coin/CbcHeuristicLocal.hpp +276 -0
- casadi/include/coin/CbcHeuristicPivotAndFix.hpp +58 -0
- casadi/include/coin/CbcHeuristicRENS.hpp +79 -0
- casadi/include/coin/CbcHeuristicRINS.hpp +106 -0
- casadi/include/coin/CbcHeuristicRandRound.hpp +58 -0
- casadi/include/coin/CbcHeuristicVND.hpp +95 -0
- casadi/include/coin/CbcLinked.hpp +1443 -0
- casadi/include/coin/CbcMessage.hpp +94 -0
- casadi/include/coin/CbcMipStartIO.hpp +29 -0
- casadi/include/coin/CbcModel.hpp +3296 -0
- casadi/include/coin/CbcNWay.hpp +171 -0
- casadi/include/coin/CbcNode.hpp +380 -0
- casadi/include/coin/CbcNodeInfo.hpp +377 -0
- casadi/include/coin/CbcObject.hpp +288 -0
- casadi/include/coin/CbcObjectUpdateData.hpp +63 -0
- casadi/include/coin/CbcOrClpParam.cpp +4321 -0
- casadi/include/coin/CbcOrClpParam.hpp +585 -0
- casadi/include/coin/CbcParam.hpp +338 -0
- casadi/include/coin/CbcPartialNodeInfo.hpp +116 -0
- casadi/include/coin/CbcSOS.hpp +290 -0
- casadi/include/coin/CbcSimpleInteger.hpp +299 -0
- casadi/include/coin/CbcSimpleIntegerDynamicPseudoCost.hpp +619 -0
- casadi/include/coin/CbcSimpleIntegerPseudoCost.hpp +122 -0
- casadi/include/coin/CbcSolver.hpp +460 -0
- casadi/include/coin/CbcStrategy.hpp +269 -0
- casadi/include/coin/CbcSubProblem.hpp +84 -0
- casadi/include/coin/CbcTree.hpp +493 -0
- casadi/include/coin/CbcTreeLocal.hpp +393 -0
- casadi/include/coin/Cbc_C_Interface.h +904 -0
- casadi/include/coin/Cgl012cut.hpp +464 -0
- casadi/include/coin/CglAllDifferent.hpp +115 -0
- casadi/include/coin/CglClique.hpp +312 -0
- casadi/include/coin/CglConfig.h +19 -0
- casadi/include/coin/CglCutGenerator.hpp +133 -0
- casadi/include/coin/CglDuplicateRow.hpp +189 -0
- casadi/include/coin/CglFlowCover.hpp +371 -0
- casadi/include/coin/CglGMI.hpp +364 -0
- casadi/include/coin/CglGMIParam.hpp +313 -0
- casadi/include/coin/CglGomory.hpp +204 -0
- casadi/include/coin/CglKnapsackCover.hpp +310 -0
- casadi/include/coin/CglLandP.hpp +306 -0
- casadi/include/coin/CglLandPValidator.hpp +130 -0
- casadi/include/coin/CglLiftAndProject.hpp +104 -0
- casadi/include/coin/CglMessage.hpp +49 -0
- casadi/include/coin/CglMixedIntegerRounding.hpp +429 -0
- casadi/include/coin/CglMixedIntegerRounding2.hpp +427 -0
- casadi/include/coin/CglOddHole.hpp +160 -0
- casadi/include/coin/CglParam.hpp +93 -0
- casadi/include/coin/CglPreProcess.hpp +600 -0
- casadi/include/coin/CglProbing.hpp +543 -0
- casadi/include/coin/CglRedSplit.hpp +448 -0
- casadi/include/coin/CglRedSplit2.hpp +494 -0
- casadi/include/coin/CglRedSplit2Param.hpp +495 -0
- casadi/include/coin/CglRedSplitParam.hpp +272 -0
- casadi/include/coin/CglResidualCapacity.hpp +240 -0
- casadi/include/coin/CglSimpleRounding.hpp +174 -0
- casadi/include/coin/CglStored.hpp +140 -0
- casadi/include/coin/CglTreeInfo.hpp +216 -0
- casadi/include/coin/CglTwomir.hpp +562 -0
- casadi/include/coin/CglZeroHalf.hpp +133 -0
- casadi/include/coin/ClpAmplObjective.hpp +113 -0
- casadi/include/coin/ClpCholeskyBase.hpp +321 -0
- casadi/include/coin/ClpCholeskyDense.hpp +157 -0
- casadi/include/coin/ClpCholeskyMumps.hpp +65 -0
- casadi/include/coin/ClpCholeskyPardiso.hpp +67 -0
- casadi/include/coin/ClpConfig.h +17 -0
- casadi/include/coin/ClpConstraint.hpp +129 -0
- casadi/include/coin/ClpConstraintAmpl.hpp +109 -0
- casadi/include/coin/ClpConstraintLinear.hpp +113 -0
- casadi/include/coin/ClpConstraintQuadratic.hpp +123 -0
- casadi/include/coin/ClpDualRowDantzig.hpp +72 -0
- casadi/include/coin/ClpDualRowPivot.hpp +136 -0
- casadi/include/coin/ClpDualRowSteepest.hpp +160 -0
- casadi/include/coin/ClpDummyMatrix.hpp +186 -0
- casadi/include/coin/ClpDynamicExampleMatrix.hpp +199 -0
- casadi/include/coin/ClpDynamicMatrix.hpp +420 -0
- casadi/include/coin/ClpEventHandler.hpp +193 -0
- casadi/include/coin/ClpFactorization.hpp +556 -0
- casadi/include/coin/ClpGubDynamicMatrix.hpp +270 -0
- casadi/include/coin/ClpGubMatrix.hpp +373 -0
- casadi/include/coin/ClpInterior.hpp +622 -0
- casadi/include/coin/ClpLinearObjective.hpp +104 -0
- casadi/include/coin/ClpMatrixBase.hpp +561 -0
- casadi/include/coin/ClpMessage.hpp +131 -0
- casadi/include/coin/ClpModel.hpp +1442 -0
- casadi/include/coin/ClpNetworkMatrix.hpp +235 -0
- casadi/include/coin/ClpNode.hpp +364 -0
- casadi/include/coin/ClpNonLinearCost.hpp +432 -0
- casadi/include/coin/ClpObjective.hpp +142 -0
- casadi/include/coin/ClpPEDualRowDantzig.hpp +84 -0
- casadi/include/coin/ClpPEDualRowSteepest.hpp +100 -0
- casadi/include/coin/ClpPEPrimalColumnDantzig.hpp +71 -0
- casadi/include/coin/ClpPEPrimalColumnSteepest.hpp +107 -0
- casadi/include/coin/ClpPESimplex.hpp +231 -0
- casadi/include/coin/ClpPackedMatrix.hpp +778 -0
- casadi/include/coin/ClpParameters.hpp +132 -0
- casadi/include/coin/ClpPdcoBase.hpp +110 -0
- casadi/include/coin/ClpPlusMinusOneMatrix.hpp +565 -0
- casadi/include/coin/ClpPresolve.hpp +379 -0
- casadi/include/coin/ClpPrimalColumnDantzig.hpp +74 -0
- casadi/include/coin/ClpPrimalColumnPivot.hpp +163 -0
- casadi/include/coin/ClpPrimalColumnSteepest.hpp +281 -0
- casadi/include/coin/ClpQuadraticObjective.hpp +161 -0
- casadi/include/coin/ClpSimplex.hpp +2137 -0
- casadi/include/coin/ClpSimplexDual.hpp +304 -0
- casadi/include/coin/ClpSimplexNonlinear.hpp +117 -0
- casadi/include/coin/ClpSimplexOther.hpp +282 -0
- casadi/include/coin/ClpSimplexPrimal.hpp +244 -0
- casadi/include/coin/ClpSolve.hpp +505 -0
- casadi/include/coin/Clp_C_Interface.h +554 -0
- casadi/include/coin/CoinAlloc.hpp +179 -0
- casadi/include/coin/CoinBuild.hpp +159 -0
- casadi/include/coin/CoinDenseFactorization.hpp +452 -0
- casadi/include/coin/CoinDenseVector.hpp +401 -0
- casadi/include/coin/CoinDistance.hpp +51 -0
- casadi/include/coin/CoinError.hpp +274 -0
- casadi/include/coin/CoinFactorization.hpp +2178 -0
- casadi/include/coin/CoinFileIO.hpp +185 -0
- casadi/include/coin/CoinFinite.hpp +37 -0
- casadi/include/coin/CoinFloatEqual.hpp +204 -0
- casadi/include/coin/CoinHelperFunctions.hpp +1270 -0
- casadi/include/coin/CoinIndexedVector.hpp +1437 -0
- casadi/include/coin/CoinLpIO.hpp +836 -0
- casadi/include/coin/CoinMessage.hpp +95 -0
- casadi/include/coin/CoinMessageHandler.hpp +717 -0
- casadi/include/coin/CoinModel.hpp +1214 -0
- casadi/include/coin/CoinModelUseful.hpp +518 -0
- casadi/include/coin/CoinMpsIO.hpp +1142 -0
- casadi/include/coin/CoinOslFactorization.hpp +287 -0
- casadi/include/coin/CoinPackedMatrix.hpp +956 -0
- casadi/include/coin/CoinPackedVector.hpp +670 -0
- casadi/include/coin/CoinPackedVectorBase.hpp +274 -0
- casadi/include/coin/CoinParam.hpp +644 -0
- casadi/include/coin/CoinPragma.hpp +29 -0
- casadi/include/coin/CoinPresolveDoubleton.hpp +76 -0
- casadi/include/coin/CoinPresolveDual.hpp +84 -0
- casadi/include/coin/CoinPresolveDupcol.hpp +259 -0
- casadi/include/coin/CoinPresolveEmpty.hpp +120 -0
- casadi/include/coin/CoinPresolveFixed.hpp +185 -0
- casadi/include/coin/CoinPresolveForcing.hpp +69 -0
- casadi/include/coin/CoinPresolveImpliedFree.hpp +66 -0
- casadi/include/coin/CoinPresolveIsolated.hpp +59 -0
- casadi/include/coin/CoinPresolveMatrix.hpp +1996 -0
- casadi/include/coin/CoinPresolveMonitor.hpp +105 -0
- casadi/include/coin/CoinPresolvePsdebug.hpp +169 -0
- casadi/include/coin/CoinPresolveSingleton.hpp +115 -0
- casadi/include/coin/CoinPresolveSubst.hpp +103 -0
- casadi/include/coin/CoinPresolveTighten.hpp +58 -0
- casadi/include/coin/CoinPresolveTripleton.hpp +69 -0
- casadi/include/coin/CoinPresolveUseless.hpp +63 -0
- casadi/include/coin/CoinPresolveZeros.hpp +65 -0
- casadi/include/coin/CoinRational.hpp +43 -0
- casadi/include/coin/CoinSearchTree.hpp +523 -0
- casadi/include/coin/CoinShallowPackedVector.hpp +149 -0
- casadi/include/coin/CoinSignal.hpp +127 -0
- casadi/include/coin/CoinSimpFactorization.hpp +432 -0
- casadi/include/coin/CoinSmartPtr.hpp +548 -0
- casadi/include/coin/CoinSnapshot.hpp +572 -0
- casadi/include/coin/CoinSort.hpp +753 -0
- casadi/include/coin/CoinStructuredModel.hpp +270 -0
- casadi/include/coin/CoinTime.hpp +350 -0
- casadi/include/coin/CoinTypes.hpp +67 -0
- casadi/include/coin/CoinUtility.hpp +26 -0
- casadi/include/coin/CoinUtilsConfig.h +34 -0
- casadi/include/coin/CoinWarmStart.hpp +56 -0
- casadi/include/coin/CoinWarmStartBasis.hpp +468 -0
- casadi/include/coin/CoinWarmStartDual.hpp +180 -0
- casadi/include/coin/CoinWarmStartPrimalDual.hpp +233 -0
- casadi/include/coin/CoinWarmStartVector.hpp +523 -0
- casadi/include/coin/Coin_C_defines.h +149 -0
- casadi/include/coin/Idiot.hpp +327 -0
- casadi/include/coin/OsiAuxInfo.hpp +261 -0
- casadi/include/coin/OsiBranchingObject.hpp +1097 -0
- casadi/include/coin/OsiCbcSolverInterface.hpp +791 -0
- casadi/include/coin/OsiChooseVariable.hpp +645 -0
- casadi/include/coin/OsiClpSolverInterface.hpp +1604 -0
- casadi/include/coin/OsiColCut.hpp +322 -0
- casadi/include/coin/OsiCollections.hpp +34 -0
- casadi/include/coin/OsiConfig.h +19 -0
- casadi/include/coin/OsiCut.hpp +251 -0
- casadi/include/coin/OsiCuts.hpp +505 -0
- casadi/include/coin/OsiPresolve.hpp +272 -0
- casadi/include/coin/OsiRowCut.hpp +345 -0
- casadi/include/coin/OsiRowCutDebugger.hpp +190 -0
- casadi/include/coin/OsiSolverBranch.hpp +169 -0
- casadi/include/coin/OsiSolverInterface.hpp +2221 -0
- casadi/include/coin/OsiSolverParameters.hpp +144 -0
- casadi/include/coin/OsiUnitTests.hpp +390 -0
- casadi/include/coin-or/IpAlgBuilder.hpp +417 -0
- casadi/include/coin-or/IpAlgStrategy.hpp +201 -0
- casadi/include/coin-or/IpAlgTypes.hpp +64 -0
- casadi/include/coin-or/IpAugSystemSolver.hpp +212 -0
- casadi/include/coin-or/IpBlas.hpp +426 -0
- casadi/include/coin-or/IpCachedResults.hpp +897 -0
- casadi/include/coin-or/IpCompoundMatrix.hpp +423 -0
- casadi/include/coin-or/IpCompoundSymMatrix.hpp +348 -0
- casadi/include/coin-or/IpCompoundVector.hpp +395 -0
- casadi/include/coin-or/IpConvCheck.hpp +97 -0
- casadi/include/coin-or/IpDebug.hpp +167 -0
- casadi/include/coin-or/IpDenseVector.hpp +626 -0
- casadi/include/coin-or/IpDiagMatrix.hpp +158 -0
- casadi/include/coin-or/IpEqMultCalculator.hpp +76 -0
- casadi/include/coin-or/IpException.hpp +156 -0
- casadi/include/coin-or/IpExpansionMatrix.hpp +245 -0
- casadi/include/coin-or/IpGenTMatrix.hpp +290 -0
- casadi/include/coin-or/IpHessianUpdater.hpp +73 -0
- casadi/include/coin-or/IpIdentityMatrix.hpp +167 -0
- casadi/include/coin-or/IpIpoptAlg.hpp +257 -0
- casadi/include/coin-or/IpIpoptApplication.hpp +367 -0
- casadi/include/coin-or/IpIpoptCalculatedQuantities.hpp +1009 -0
- casadi/include/coin-or/IpIpoptData.hpp +966 -0
- casadi/include/coin-or/IpIpoptNLP.hpp +328 -0
- casadi/include/coin-or/IpIterateInitializer.hpp +68 -0
- casadi/include/coin-or/IpIteratesVector.hpp +840 -0
- casadi/include/coin-or/IpIterationOutput.hpp +78 -0
- casadi/include/coin-or/IpJournalist.hpp +573 -0
- casadi/include/coin-or/IpLapack.hpp +227 -0
- casadi/include/coin-or/IpLibraryLoader.hpp +76 -0
- casadi/include/coin-or/IpLineSearch.hpp +106 -0
- casadi/include/coin-or/IpLinearSolvers.h +46 -0
- casadi/include/coin-or/IpMatrix.hpp +434 -0
- casadi/include/coin-or/IpMuUpdate.hpp +77 -0
- casadi/include/coin-or/IpNLP.hpp +306 -0
- casadi/include/coin-or/IpNLPScaling.hpp +582 -0
- casadi/include/coin-or/IpObserver.hpp +422 -0
- casadi/include/coin-or/IpOptionsList.hpp +412 -0
- casadi/include/coin-or/IpOrigIpoptNLP.hpp +603 -0
- casadi/include/coin-or/IpPDSystemSolver.hpp +137 -0
- casadi/include/coin-or/IpReferenced.hpp +262 -0
- casadi/include/coin-or/IpRegOptions.hpp +1152 -0
- casadi/include/coin-or/IpReturnCodes.h +23 -0
- casadi/include/coin-or/IpReturnCodes.hpp +18 -0
- casadi/include/coin-or/IpReturnCodes.inc +71 -0
- casadi/include/coin-or/IpReturnCodes_inc.h +45 -0
- casadi/include/coin-or/IpScaledMatrix.hpp +291 -0
- casadi/include/coin-or/IpSearchDirCalculator.hpp +72 -0
- casadi/include/coin-or/IpSmartPtr.hpp +865 -0
- casadi/include/coin-or/IpSolveStatistics.hpp +210 -0
- casadi/include/coin-or/IpSparseSymLinearSolverInterface.hpp +260 -0
- casadi/include/coin-or/IpStdAugSystemSolver.cpp +555 -0
- casadi/include/coin-or/IpStdCInterface.h +428 -0
- casadi/include/coin-or/IpSumSymMatrix.hpp +186 -0
- casadi/include/coin-or/IpSymLinearSolver.hpp +141 -0
- casadi/include/coin-or/IpSymMatrix.hpp +167 -0
- casadi/include/coin-or/IpSymScaledMatrix.hpp +255 -0
- casadi/include/coin-or/IpSymTMatrix.hpp +275 -0
- casadi/include/coin-or/IpTNLP.hpp +820 -0
- casadi/include/coin-or/IpTNLPAdapter.hpp +648 -0
- casadi/include/coin-or/IpTNLPReducer.hpp +274 -0
- casadi/include/coin-or/IpTaggedObject.hpp +128 -0
- casadi/include/coin-or/IpTimedTask.hpp +218 -0
- casadi/include/coin-or/IpTimingStatistics.hpp +323 -0
- casadi/include/coin-or/IpTripletHelper.hpp +308 -0
- casadi/include/coin-or/IpTypes.h +81 -0
- casadi/include/coin-or/IpTypes.hpp +30 -0
- casadi/include/coin-or/IpUtils.hpp +166 -0
- casadi/include/coin-or/IpVector.hpp +892 -0
- casadi/include/coin-or/IpZeroSymMatrix.hpp +155 -0
- casadi/include/coin-or/IpoptConfig.h +45 -0
- casadi/include/coin-or/SensAlgorithm.hpp +114 -0
- casadi/include/coin-or/SensApplication.hpp +188 -0
- casadi/include/coin-or/SensBacksolver.hpp +36 -0
- casadi/include/coin-or/SensMeasurement.hpp +56 -0
- casadi/include/coin-or/SensPCalculator.hpp +137 -0
- casadi/include/coin-or/SensRegOp.hpp +21 -0
- casadi/include/coin-or/SensSchurData.hpp +182 -0
- casadi/include/coin-or/SensSchurDriver.hpp +118 -0
- casadi/include/coin-or/SensSimpleBacksolver.hpp +49 -0
- casadi/include/coin-or/SensStepCalc.hpp +85 -0
- casadi/include/coin-or/SensUtils.hpp +63 -0
- casadi/include/coin-or/metis/defs.h +161 -0
- casadi/include/coin-or/metis/macros.h +143 -0
- casadi/include/coin-or/metis/metis.h +37 -0
- casadi/include/coin-or/metis/proto.h +505 -0
- casadi/include/coin-or/metis/rename.h +418 -0
- casadi/include/coin-or/metis/struct.h +251 -0
- casadi/include/coin-or/mumps/dmumps_c.h +142 -0
- casadi/include/coin-or/mumps/mumps_c_types.h +72 -0
- casadi/include/coin-or/mumps/mumps_compat.h +27 -0
- casadi/include/coin-or/mumps/mumps_int_def.h +11 -0
- casadi/include/coin-or/mumps/mumps_mpi.h +67 -0
- casadi/include/d_blas.h +78 -0
- casadi/include/d_blas_64.h +73 -0
- casadi/include/daqp/api.h +46 -0
- casadi/include/daqp/auxiliary.h +29 -0
- casadi/include/daqp/bnb.h +32 -0
- casadi/include/daqp/codegen.h +18 -0
- casadi/include/daqp/constants.h +92 -0
- casadi/include/daqp/daqp.h +22 -0
- casadi/include/daqp/daqp_prox.h +18 -0
- casadi/include/daqp/factorization.h +18 -0
- casadi/include/daqp/types.h +161 -0
- casadi/include/daqp/utils.h +44 -0
- casadi/include/dlfcn.h +94 -0
- casadi/include/eigen3/Eigen/Cholesky +45 -0
- casadi/include/eigen3/Eigen/CholmodSupport +48 -0
- casadi/include/eigen3/Eigen/Core +384 -0
- casadi/include/eigen3/Eigen/Dense +7 -0
- casadi/include/eigen3/Eigen/Eigen +2 -0
- casadi/include/eigen3/Eigen/Eigenvalues +60 -0
- casadi/include/eigen3/Eigen/Geometry +59 -0
- casadi/include/eigen3/Eigen/Householder +29 -0
- casadi/include/eigen3/Eigen/IterativeLinearSolvers +48 -0
- casadi/include/eigen3/Eigen/Jacobi +32 -0
- casadi/include/eigen3/Eigen/KLUSupport +41 -0
- casadi/include/eigen3/Eigen/LU +47 -0
- casadi/include/eigen3/Eigen/MetisSupport +35 -0
- casadi/include/eigen3/Eigen/OrderingMethods +70 -0
- casadi/include/eigen3/Eigen/PaStiXSupport +49 -0
- casadi/include/eigen3/Eigen/PardisoSupport +35 -0
- casadi/include/eigen3/Eigen/QR +50 -0
- casadi/include/eigen3/Eigen/QtAlignedMalloc +39 -0
- casadi/include/eigen3/Eigen/SPQRSupport +34 -0
- casadi/include/eigen3/Eigen/SVD +50 -0
- casadi/include/eigen3/Eigen/Sparse +34 -0
- casadi/include/eigen3/Eigen/SparseCholesky +37 -0
- casadi/include/eigen3/Eigen/SparseCore +69 -0
- casadi/include/eigen3/Eigen/SparseLU +50 -0
- casadi/include/eigen3/Eigen/SparseQR +36 -0
- casadi/include/eigen3/Eigen/StdDeque +27 -0
- casadi/include/eigen3/Eigen/StdList +26 -0
- casadi/include/eigen3/Eigen/StdVector +27 -0
- casadi/include/eigen3/Eigen/SuperLUSupport +64 -0
- casadi/include/eigen3/Eigen/UmfPackSupport +40 -0
- casadi/include/eigen3/Eigen/src/Cholesky/LDLT.h +688 -0
- casadi/include/eigen3/Eigen/src/Cholesky/LLT.h +558 -0
- casadi/include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h +99 -0
- casadi/include/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +682 -0
- casadi/include/eigen3/Eigen/src/Core/ArithmeticSequence.h +413 -0
- casadi/include/eigen3/Eigen/src/Core/Array.h +417 -0
- casadi/include/eigen3/Eigen/src/Core/ArrayBase.h +226 -0
- casadi/include/eigen3/Eigen/src/Core/ArrayWrapper.h +209 -0
- casadi/include/eigen3/Eigen/src/Core/Assign.h +90 -0
- casadi/include/eigen3/Eigen/src/Core/AssignEvaluator.h +1010 -0
- casadi/include/eigen3/Eigen/src/Core/Assign_MKL.h +178 -0
- casadi/include/eigen3/Eigen/src/Core/BandMatrix.h +353 -0
- casadi/include/eigen3/Eigen/src/Core/Block.h +448 -0
- casadi/include/eigen3/Eigen/src/Core/BooleanRedux.h +162 -0
- casadi/include/eigen3/Eigen/src/Core/CommaInitializer.h +164 -0
- casadi/include/eigen3/Eigen/src/Core/ConditionEstimator.h +175 -0
- casadi/include/eigen3/Eigen/src/Core/CoreEvaluators.h +1741 -0
- casadi/include/eigen3/Eigen/src/Core/CoreIterators.h +132 -0
- casadi/include/eigen3/Eigen/src/Core/CwiseBinaryOp.h +183 -0
- casadi/include/eigen3/Eigen/src/Core/CwiseNullaryOp.h +1001 -0
- casadi/include/eigen3/Eigen/src/Core/CwiseTernaryOp.h +197 -0
- casadi/include/eigen3/Eigen/src/Core/CwiseUnaryOp.h +103 -0
- casadi/include/eigen3/Eigen/src/Core/CwiseUnaryView.h +132 -0
- casadi/include/eigen3/Eigen/src/Core/DenseBase.h +701 -0
- casadi/include/eigen3/Eigen/src/Core/DenseCoeffsBase.h +685 -0
- casadi/include/eigen3/Eigen/src/Core/DenseStorage.h +652 -0
- casadi/include/eigen3/Eigen/src/Core/Diagonal.h +258 -0
- casadi/include/eigen3/Eigen/src/Core/DiagonalMatrix.h +391 -0
- casadi/include/eigen3/Eigen/src/Core/DiagonalProduct.h +28 -0
- casadi/include/eigen3/Eigen/src/Core/Dot.h +318 -0
- casadi/include/eigen3/Eigen/src/Core/EigenBase.h +160 -0
- casadi/include/eigen3/Eigen/src/Core/ForceAlignedAccess.h +150 -0
- casadi/include/eigen3/Eigen/src/Core/Fuzzy.h +155 -0
- casadi/include/eigen3/Eigen/src/Core/GeneralProduct.h +465 -0
- casadi/include/eigen3/Eigen/src/Core/GenericPacketMath.h +1040 -0
- casadi/include/eigen3/Eigen/src/Core/GlobalFunctions.h +194 -0
- casadi/include/eigen3/Eigen/src/Core/IO.h +258 -0
- casadi/include/eigen3/Eigen/src/Core/IndexedView.h +237 -0
- casadi/include/eigen3/Eigen/src/Core/Inverse.h +117 -0
- casadi/include/eigen3/Eigen/src/Core/Map.h +171 -0
- casadi/include/eigen3/Eigen/src/Core/MapBase.h +310 -0
- casadi/include/eigen3/Eigen/src/Core/MathFunctions.h +2057 -0
- casadi/include/eigen3/Eigen/src/Core/MathFunctionsImpl.h +200 -0
- casadi/include/eigen3/Eigen/src/Core/Matrix.h +565 -0
- casadi/include/eigen3/Eigen/src/Core/MatrixBase.h +547 -0
- casadi/include/eigen3/Eigen/src/Core/NestByValue.h +85 -0
- casadi/include/eigen3/Eigen/src/Core/NoAlias.h +109 -0
- casadi/include/eigen3/Eigen/src/Core/NumTraits.h +335 -0
- casadi/include/eigen3/Eigen/src/Core/PartialReduxEvaluator.h +232 -0
- casadi/include/eigen3/Eigen/src/Core/PermutationMatrix.h +605 -0
- casadi/include/eigen3/Eigen/src/Core/PlainObjectBase.h +1128 -0
- casadi/include/eigen3/Eigen/src/Core/Product.h +191 -0
- casadi/include/eigen3/Eigen/src/Core/ProductEvaluators.h +1179 -0
- casadi/include/eigen3/Eigen/src/Core/Random.h +218 -0
- casadi/include/eigen3/Eigen/src/Core/Redux.h +515 -0
- casadi/include/eigen3/Eigen/src/Core/Ref.h +381 -0
- casadi/include/eigen3/Eigen/src/Core/Replicate.h +142 -0
- casadi/include/eigen3/Eigen/src/Core/Reshaped.h +454 -0
- casadi/include/eigen3/Eigen/src/Core/ReturnByValue.h +119 -0
- casadi/include/eigen3/Eigen/src/Core/Reverse.h +217 -0
- casadi/include/eigen3/Eigen/src/Core/Select.h +164 -0
- casadi/include/eigen3/Eigen/src/Core/SelfAdjointView.h +365 -0
- casadi/include/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h +47 -0
- casadi/include/eigen3/Eigen/src/Core/Solve.h +188 -0
- casadi/include/eigen3/Eigen/src/Core/SolveTriangular.h +235 -0
- casadi/include/eigen3/Eigen/src/Core/SolverBase.h +168 -0
- casadi/include/eigen3/Eigen/src/Core/StableNorm.h +251 -0
- casadi/include/eigen3/Eigen/src/Core/StlIterators.h +463 -0
- casadi/include/eigen3/Eigen/src/Core/Stride.h +116 -0
- casadi/include/eigen3/Eigen/src/Core/Swap.h +68 -0
- casadi/include/eigen3/Eigen/src/Core/Transpose.h +464 -0
- casadi/include/eigen3/Eigen/src/Core/Transpositions.h +386 -0
- casadi/include/eigen3/Eigen/src/Core/TriangularMatrix.h +1001 -0
- casadi/include/eigen3/Eigen/src/Core/VectorBlock.h +96 -0
- casadi/include/eigen3/Eigen/src/Core/VectorwiseOp.h +784 -0
- casadi/include/eigen3/Eigen/src/Core/Visitor.h +381 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX/Complex.h +372 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX/MathFunctions.h +228 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX/PacketMath.h +1574 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX/TypeCasting.h +115 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX512/Complex.h +422 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX512/MathFunctions.h +362 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX512/PacketMath.h +2303 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AVX512/TypeCasting.h +89 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h +417 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MathFunctions.h +90 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +2937 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +221 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +629 -0
- casadi/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h +2711 -0
- casadi/include/eigen3/Eigen/src/Core/arch/CUDA/Complex.h +258 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/BFloat16.h +700 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/ConjHelper.h +117 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +1649 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +110 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/Half.h +942 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/Settings.h +49 -0
- casadi/include/eigen3/Eigen/src/Core/arch/Default/TypeCasting.h +120 -0
- casadi/include/eigen3/Eigen/src/Core/arch/GPU/MathFunctions.h +103 -0
- casadi/include/eigen3/Eigen/src/Core/arch/GPU/PacketMath.h +1685 -0
- casadi/include/eigen3/Eigen/src/Core/arch/GPU/TypeCasting.h +80 -0
- casadi/include/eigen3/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
- casadi/include/eigen3/Eigen/src/Core/arch/MSA/Complex.h +648 -0
- casadi/include/eigen3/Eigen/src/Core/arch/MSA/MathFunctions.h +387 -0
- casadi/include/eigen3/Eigen/src/Core/arch/MSA/PacketMath.h +1233 -0
- casadi/include/eigen3/Eigen/src/Core/arch/NEON/Complex.h +584 -0
- casadi/include/eigen3/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +183 -0
- casadi/include/eigen3/Eigen/src/Core/arch/NEON/MathFunctions.h +75 -0
- casadi/include/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h +4587 -0
- casadi/include/eigen3/Eigen/src/Core/arch/NEON/TypeCasting.h +1419 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SSE/Complex.h +351 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h +199 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h +1505 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SSE/TypeCasting.h +142 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SVE/MathFunctions.h +44 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SVE/PacketMath.h +752 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SVE/TypeCasting.h +49 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SYCL/InteropHeaders.h +232 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SYCL/MathFunctions.h +301 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SYCL/PacketMath.h +670 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SYCL/SyclMemoryModel.h +694 -0
- casadi/include/eigen3/Eigen/src/Core/arch/SYCL/TypeCasting.h +85 -0
- casadi/include/eigen3/Eigen/src/Core/arch/ZVector/Complex.h +426 -0
- casadi/include/eigen3/Eigen/src/Core/arch/ZVector/MathFunctions.h +233 -0
- casadi/include/eigen3/Eigen/src/Core/arch/ZVector/PacketMath.h +1060 -0
- casadi/include/eigen3/Eigen/src/Core/functors/AssignmentFunctors.h +177 -0
- casadi/include/eigen3/Eigen/src/Core/functors/BinaryFunctors.h +541 -0
- casadi/include/eigen3/Eigen/src/Core/functors/NullaryFunctors.h +189 -0
- casadi/include/eigen3/Eigen/src/Core/functors/StlFunctors.h +166 -0
- casadi/include/eigen3/Eigen/src/Core/functors/TernaryFunctors.h +25 -0
- casadi/include/eigen3/Eigen/src/Core/functors/UnaryFunctors.h +1131 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h +2645 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h +517 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +317 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +145 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +124 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h +518 -0
- casadi/include/eigen3/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +136 -0
- casadi/include/eigen3/Eigen/src/Core/products/Parallelizer.h +180 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +544 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +295 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h +262 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +118 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
- casadi/include/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h +94 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h +472 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +317 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h +350 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +255 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h +337 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +167 -0
- casadi/include/eigen3/Eigen/src/Core/products/TriangularSolverVector.h +148 -0
- casadi/include/eigen3/Eigen/src/Core/util/BlasUtil.h +583 -0
- casadi/include/eigen3/Eigen/src/Core/util/ConfigureVectorization.h +512 -0
- casadi/include/eigen3/Eigen/src/Core/util/Constants.h +563 -0
- casadi/include/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h +106 -0
- casadi/include/eigen3/Eigen/src/Core/util/ForwardDeclarations.h +322 -0
- casadi/include/eigen3/Eigen/src/Core/util/IndexedViewHelper.h +186 -0
- casadi/include/eigen3/Eigen/src/Core/util/IntegralConstant.h +272 -0
- casadi/include/eigen3/Eigen/src/Core/util/MKL_support.h +137 -0
- casadi/include/eigen3/Eigen/src/Core/util/Macros.h +1464 -0
- casadi/include/eigen3/Eigen/src/Core/util/Memory.h +1163 -0
- casadi/include/eigen3/Eigen/src/Core/util/Meta.h +812 -0
- casadi/include/eigen3/Eigen/src/Core/util/NonMPL2.h +3 -0
- casadi/include/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h +31 -0
- casadi/include/eigen3/Eigen/src/Core/util/ReshapedHelper.h +51 -0
- casadi/include/eigen3/Eigen/src/Core/util/StaticAssert.h +221 -0
- casadi/include/eigen3/Eigen/src/Core/util/SymbolicIndex.h +293 -0
- casadi/include/eigen3/Eigen/src/Core/util/XprHelper.h +856 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h +346 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h +462 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +91 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/EigenSolver.h +622 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +418 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +226 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h +374 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +158 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/RealQZ.h +657 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/RealSchur.h +558 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +77 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +904 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +87 -0
- casadi/include/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h +561 -0
- casadi/include/eigen3/Eigen/src/Geometry/AlignedBox.h +486 -0
- casadi/include/eigen3/Eigen/src/Geometry/AngleAxis.h +247 -0
- casadi/include/eigen3/Eigen/src/Geometry/EulerAngles.h +114 -0
- casadi/include/eigen3/Eigen/src/Geometry/Homogeneous.h +501 -0
- casadi/include/eigen3/Eigen/src/Geometry/Hyperplane.h +282 -0
- casadi/include/eigen3/Eigen/src/Geometry/OrthoMethods.h +235 -0
- casadi/include/eigen3/Eigen/src/Geometry/ParametrizedLine.h +232 -0
- casadi/include/eigen3/Eigen/src/Geometry/Quaternion.h +870 -0
- casadi/include/eigen3/Eigen/src/Geometry/Rotation2D.h +199 -0
- casadi/include/eigen3/Eigen/src/Geometry/RotationBase.h +206 -0
- casadi/include/eigen3/Eigen/src/Geometry/Scaling.h +188 -0
- casadi/include/eigen3/Eigen/src/Geometry/Transform.h +1563 -0
- casadi/include/eigen3/Eigen/src/Geometry/Translation.h +202 -0
- casadi/include/eigen3/Eigen/src/Geometry/Umeyama.h +166 -0
- casadi/include/eigen3/Eigen/src/Geometry/arch/Geometry_SIMD.h +168 -0
- casadi/include/eigen3/Eigen/src/Householder/BlockHouseholder.h +110 -0
- casadi/include/eigen3/Eigen/src/Householder/Householder.h +176 -0
- casadi/include/eigen3/Eigen/src/Householder/HouseholderSequence.h +545 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +226 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +212 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +229 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +394 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +453 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +444 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +198 -0
- casadi/include/eigen3/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +117 -0
- casadi/include/eigen3/Eigen/src/Jacobi/Jacobi.h +483 -0
- casadi/include/eigen3/Eigen/src/KLUSupport/KLUSupport.h +358 -0
- casadi/include/eigen3/Eigen/src/LU/Determinant.h +117 -0
- casadi/include/eigen3/Eigen/src/LU/FullPivLU.h +877 -0
- casadi/include/eigen3/Eigen/src/LU/InverseImpl.h +432 -0
- casadi/include/eigen3/Eigen/src/LU/PartialPivLU.h +624 -0
- casadi/include/eigen3/Eigen/src/LU/PartialPivLU_LAPACKE.h +83 -0
- casadi/include/eigen3/Eigen/src/LU/arch/InverseSize4.h +351 -0
- casadi/include/eigen3/Eigen/src/MetisSupport/MetisSupport.h +137 -0
- casadi/include/eigen3/Eigen/src/OrderingMethods/Amd.h +435 -0
- casadi/include/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h +1863 -0
- casadi/include/eigen3/Eigen/src/OrderingMethods/Ordering.h +153 -0
- casadi/include/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h +678 -0
- casadi/include/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h +545 -0
- casadi/include/eigen3/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
- casadi/include/eigen3/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +97 -0
- casadi/include/eigen3/Eigen/src/QR/CompleteOrthogonalDecomposition.h +635 -0
- casadi/include/eigen3/Eigen/src/QR/FullPivHouseholderQR.h +713 -0
- casadi/include/eigen3/Eigen/src/QR/HouseholderQR.h +434 -0
- casadi/include/eigen3/Eigen/src/QR/HouseholderQR_LAPACKE.h +68 -0
- casadi/include/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +335 -0
- casadi/include/eigen3/Eigen/src/SVD/BDCSVD.h +1366 -0
- casadi/include/eigen3/Eigen/src/SVD/JacobiSVD.h +812 -0
- casadi/include/eigen3/Eigen/src/SVD/JacobiSVD_LAPACKE.h +91 -0
- casadi/include/eigen3/Eigen/src/SVD/SVDBase.h +376 -0
- casadi/include/eigen3/Eigen/src/SVD/UpperBidiagonalization.h +414 -0
- casadi/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h +697 -0
- casadi/include/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +174 -0
- casadi/include/eigen3/Eigen/src/SparseCore/AmbiVector.h +378 -0
- casadi/include/eigen3/Eigen/src/SparseCore/CompressedStorage.h +274 -0
- casadi/include/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +352 -0
- casadi/include/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h +67 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseAssign.h +270 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseBlock.h +571 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseColEtree.h +206 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseCompressedBase.h +370 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +722 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +150 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h +342 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseDot.h +98 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseFuzzy.h +29 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseMap.h +305 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseMatrix.h +1518 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h +398 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparsePermutation.h +178 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseProduct.h +181 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseRedux.h +49 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseRef.h +397 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h +659 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseSolverBase.h +124 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +198 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseTranspose.h +92 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseTriangularView.h +189 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseUtil.h +186 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseVector.h +478 -0
- casadi/include/eigen3/Eigen/src/SparseCore/SparseView.h +254 -0
- casadi/include/eigen3/Eigen/src/SparseCore/TriangularSolver.h +315 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU.h +923 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLUImpl.h +66 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h +226 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h +110 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +375 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h +80 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h +181 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h +179 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +107 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h +280 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +126 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +130 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h +223 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h +258 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h +137 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h +136 -0
- casadi/include/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h +83 -0
- casadi/include/eigen3/Eigen/src/SparseQR/SparseQR.h +758 -0
- casadi/include/eigen3/Eigen/src/StlSupport/StdDeque.h +116 -0
- casadi/include/eigen3/Eigen/src/StlSupport/StdList.h +106 -0
- casadi/include/eigen3/Eigen/src/StlSupport/StdVector.h +131 -0
- casadi/include/eigen3/Eigen/src/StlSupport/details.h +84 -0
- casadi/include/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h +1025 -0
- casadi/include/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h +642 -0
- casadi/include/eigen3/Eigen/src/misc/Image.h +82 -0
- casadi/include/eigen3/Eigen/src/misc/Kernel.h +79 -0
- casadi/include/eigen3/Eigen/src/misc/RealSvd2x2.h +55 -0
- casadi/include/eigen3/Eigen/src/misc/blas.h +440 -0
- casadi/include/eigen3/Eigen/src/misc/lapack.h +152 -0
- casadi/include/eigen3/Eigen/src/misc/lapacke.h +16292 -0
- casadi/include/eigen3/Eigen/src/misc/lapacke_mangling.h +17 -0
- casadi/include/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h +358 -0
- casadi/include/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h +696 -0
- casadi/include/eigen3/Eigen/src/plugins/BlockMethods.h +1442 -0
- casadi/include/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h +115 -0
- casadi/include/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h +177 -0
- casadi/include/eigen3/Eigen/src/plugins/IndexedViewMethods.h +262 -0
- casadi/include/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h +152 -0
- casadi/include/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h +95 -0
- casadi/include/eigen3/Eigen/src/plugins/ReshapedMethods.h +149 -0
- casadi/include/eigen3/signature_of_eigen3_matrix_library +1 -0
- casadi/include/eigen3/unsupported/Eigen/AdolcForward +159 -0
- casadi/include/eigen3/unsupported/Eigen/AlignedVector3 +234 -0
- casadi/include/eigen3/unsupported/Eigen/ArpackSupport +30 -0
- casadi/include/eigen3/unsupported/Eigen/AutoDiff +46 -0
- casadi/include/eigen3/unsupported/Eigen/BVH +95 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/Tensor +137 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/TensorSymmetry +42 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/ThreadPool +74 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/Tensor.h +554 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorArgMax.h +329 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorAssign.h +247 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBase.h +1176 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h +1559 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorBroadcasting.h +1093 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorChipping.h +518 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConcatenation.h +377 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContraction.h +1023 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionBlocking.h +73 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionCuda.h +6 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionGpu.h +1413 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionMapper.h +575 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionSycl.h +1650 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorContractionThreadPool.h +1679 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConversion.h +456 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolution.h +1132 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorConvolutionSycl.h +544 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCostModel.h +214 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorCustomOp.h +347 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDevice.h +137 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceCuda.h +6 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceDefault.h +104 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceGpu.h +389 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceSycl.h +1048 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDeviceThreadPool.h +409 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensionList.h +236 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorDimensions.h +490 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvalTo.h +236 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorEvaluator.h +983 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExecutor.h +703 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorExpr.h +388 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h +669 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFixedSize.h +379 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForcedEval.h +237 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorForwardDeclarations.h +191 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorFunctors.h +488 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGenerator.h +302 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGlobalFunctions.h +33 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaDefines.h +99 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorGpuHipCudaUndefines.h +44 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIO.h +79 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorImagePatch.h +603 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIndexList.h +738 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInflation.h +247 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorInitializer.h +82 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorIntDiv.h +263 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorLayoutSwap.h +216 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMacros.h +98 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMap.h +327 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h +311 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorMorphing.h +1102 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +708 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorPatch.h +291 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRandom.h +322 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReduction.h +998 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionCuda.h +6 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionGpu.h +966 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReductionSycl.h +582 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorRef.h +454 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorReverse.h +465 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScan.h +528 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorScanSycl.h +513 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorShuffling.h +471 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h +161 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStriding.h +346 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTrace.h +303 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorTraits.h +264 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorUInt128.h +249 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorVolumePatch.h +629 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/DynamicSymmetry.h +293 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/StaticSymmetry.h +236 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/Symmetry.h +338 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/TensorSymmetry/util/TemplateGroupTheory.h +669 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/Barrier.h +67 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/EventCount.h +249 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/NonBlockingThreadPool.h +486 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/RunQueue.h +236 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadCancel.h +23 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadEnvironment.h +40 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h +301 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadPoolInterface.h +48 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/ThreadPool/ThreadYield.h +20 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Meta.h +537 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/CXX11Workarounds.h +88 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/EmulateArray.h +261 -0
- casadi/include/eigen3/unsupported/Eigen/CXX11/src/util/MaxSizeVector.h +158 -0
- casadi/include/eigen3/unsupported/Eigen/EulerAngles +43 -0
- casadi/include/eigen3/unsupported/Eigen/FFT +419 -0
- casadi/include/eigen3/unsupported/Eigen/IterativeSolvers +51 -0
- casadi/include/eigen3/unsupported/Eigen/KroneckerProduct +36 -0
- casadi/include/eigen3/unsupported/Eigen/LevenbergMarquardt +49 -0
- casadi/include/eigen3/unsupported/Eigen/MPRealSupport +213 -0
- casadi/include/eigen3/unsupported/Eigen/MatrixFunctions +504 -0
- casadi/include/eigen3/unsupported/Eigen/MoreVectorization +24 -0
- casadi/include/eigen3/unsupported/Eigen/NonLinearOptimization +140 -0
- casadi/include/eigen3/unsupported/Eigen/NumericalDiff +56 -0
- casadi/include/eigen3/unsupported/Eigen/OpenGLSupport +322 -0
- casadi/include/eigen3/unsupported/Eigen/Polynomials +137 -0
- casadi/include/eigen3/unsupported/Eigen/Skyline +39 -0
- casadi/include/eigen3/unsupported/Eigen/SparseExtra +54 -0
- casadi/include/eigen3/unsupported/Eigen/SpecialFunctions +103 -0
- casadi/include/eigen3/unsupported/Eigen/Splines +35 -0
- casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h +108 -0
- casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h +730 -0
- casadi/include/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h +220 -0
- casadi/include/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h +293 -0
- casadi/include/eigen3/unsupported/Eigen/src/BVH/KdBVH.h +223 -0
- casadi/include/eigen3/unsupported/Eigen/src/Eigenvalues/ArpackSelfAdjointEigenSolver.h +790 -0
- casadi/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerAngles.h +355 -0
- casadi/include/eigen3/unsupported/Eigen/src/EulerAngles/EulerSystem.h +305 -0
- casadi/include/eigen3/unsupported/Eigen/src/FFT/ei_fftw_impl.h +261 -0
- casadi/include/eigen3/unsupported/Eigen/src/FFT/ei_kissfft_impl.h +449 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h +187 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/DGMRES.h +511 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/GMRES.h +335 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IDRS.h +436 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h +90 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/IterationController.h +154 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/MINRES.h +267 -0
- casadi/include/eigen3/unsupported/Eigen/src/IterativeSolvers/Scaling.h +193 -0
- casadi/include/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h +305 -0
- casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMcovar.h +84 -0
- casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMonestep.h +202 -0
- casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMpar.h +160 -0
- casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LMqrsolv.h +188 -0
- casadi/include/eigen3/unsupported/Eigen/src/LevenbergMarquardt/LevenbergMarquardt.h +396 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h +441 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h +569 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h +373 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h +705 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h +368 -0
- casadi/include/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h +117 -0
- casadi/include/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h +95 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h +601 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h +657 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h +66 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h +70 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/dogleg.h +107 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h +79 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/lmpar.h +298 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h +91 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h +30 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1updt.h +99 -0
- casadi/include/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h +49 -0
- casadi/include/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h +130 -0
- casadi/include/eigen3/unsupported/Eigen/src/Polynomials/Companion.h +280 -0
- casadi/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialSolver.h +428 -0
- casadi/include/eigen3/unsupported/Eigen/src/Polynomials/PolynomialUtils.h +143 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h +352 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrix.h +862 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h +212 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineProduct.h +295 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h +259 -0
- casadi/include/eigen3/unsupported/Eigen/src/Skyline/SkylineUtil.h +89 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h +122 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/BlockSparseMatrix.h +1079 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h +404 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h +282 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +247 -0
- casadi/include/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h +349 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsArrayAPI.h +286 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsBFloat16.h +68 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsFunctors.h +357 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsHalf.h +66 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsImpl.h +1959 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/BesselFunctionsPacketMath.h +118 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/HipVectorCompatibility.h +67 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsArrayAPI.h +167 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsBFloat16.h +58 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsFunctors.h +330 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsHalf.h +58 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsImpl.h +2045 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/SpecialFunctionsPacketMath.h +79 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/BesselFunctions.h +46 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX/SpecialFunctions.h +16 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/BesselFunctions.h +46 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/AVX512/SpecialFunctions.h +16 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/GPU/SpecialFunctions.h +369 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/BesselFunctions.h +54 -0
- casadi/include/eigen3/unsupported/Eigen/src/SpecialFunctions/arch/NEON/SpecialFunctions.h +34 -0
- casadi/include/eigen3/unsupported/Eigen/src/Splines/Spline.h +507 -0
- casadi/include/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h +431 -0
- casadi/include/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h +93 -0
- casadi/include/fatrop/auxiliary/Common.hpp +34 -0
- casadi/include/fatrop/auxiliary/DynamicLib.hpp +34 -0
- casadi/include/fatrop/auxiliary/FatropOptions.hpp +68 -0
- casadi/include/fatrop/auxiliary/FatropVector.hpp +143 -0
- casadi/include/fatrop/auxiliary/LinearAlgebra.hpp +88 -0
- casadi/include/fatrop/auxiliary/VectorUtils.hpp +54 -0
- casadi/include/fatrop/blasfeo_wrapper/LinearAlgebraBlasfeo.hpp +496 -0
- casadi/include/fatrop/fatrop.hpp +39 -0
- casadi/include/fatrop/function_evaluation/CasadiCodegen.hpp +104 -0
- casadi/include/fatrop/function_evaluation/FunctionEvaluation.hpp +60 -0
- casadi/include/fatrop/json/json.h +946 -0
- casadi/include/fatrop/ocp/CasadiCApiUserdataWrap.hpp +87 -0
- casadi/include/fatrop/ocp/DuInfEvaluator.hpp +38 -0
- casadi/include/fatrop/ocp/FatropOCP.hpp +161 -0
- casadi/include/fatrop/ocp/FatropOCPBuilder.hpp +52 -0
- casadi/include/fatrop/ocp/FatropOCPResto.hpp +299 -0
- casadi/include/fatrop/ocp/OCP.hpp +82 -0
- casadi/include/fatrop/ocp/OCPAbstract.hpp +254 -0
- casadi/include/fatrop/ocp/OCPAdapter.hpp +197 -0
- casadi/include/fatrop/ocp/OCPCInterface.h +289 -0
- casadi/include/fatrop/ocp/OCPDims.hpp +60 -0
- casadi/include/fatrop/ocp/OCPInitializer.hpp +41 -0
- casadi/include/fatrop/ocp/OCPKKT.hpp +69 -0
- casadi/include/fatrop/ocp/OCPLSRiccati.hpp +198 -0
- casadi/include/fatrop/ocp/OCPLSScaler.hpp +66 -0
- casadi/include/fatrop/ocp/OCPLinearSolver.hpp +75 -0
- casadi/include/fatrop/ocp/OCPNoScaling.hpp +42 -0
- casadi/include/fatrop/ocp/OCPScalingMethod.hpp +42 -0
- casadi/include/fatrop/ocp/StageOCP.hpp +592 -0
- casadi/include/fatrop/ocp/StageOCPApplication.hpp +242 -0
- casadi/include/fatrop/ocp/StageOCPExpressions.hpp +182 -0
- casadi/include/fatrop/ocp/UStageEvalAbstract.hpp +168 -0
- casadi/include/fatrop/ocp/UStageOCPImpl.hpp +152 -0
- casadi/include/fatrop/quasi_newton/bfgs.hpp +159 -0
- casadi/include/fatrop/solver/AlgBuilder.hpp +76 -0
- casadi/include/fatrop/solver/AlgStrategy.hpp +33 -0
- casadi/include/fatrop/solver/FatropAlg.hpp +121 -0
- casadi/include/fatrop/solver/FatropData.hpp +188 -0
- casadi/include/fatrop/solver/FatropOptions.hpp +95 -0
- casadi/include/fatrop/solver/FatropPrinter.hpp +65 -0
- casadi/include/fatrop/solver/FatropStats.hpp +63 -0
- casadi/include/fatrop/solver/Filter.hpp +54 -0
- casadi/include/fatrop/solver/IterationData.hpp +56 -0
- casadi/include/fatrop/solver/LineSearch.hpp +86 -0
- casadi/include/fatrop/solver/NLPL1.hpp +263 -0
- casadi/include/fatrop/templates/NLPAlg.hpp +104 -0
- casadi/include/ghc/filesystem.hpp +6083 -0
- casadi/include/ghc/fs_fwd.hpp +38 -0
- casadi/include/ghc/fs_impl.hpp +35 -0
- casadi/include/ghc/fs_std.hpp +60 -0
- casadi/include/ghc/fs_std_fwd.hpp +63 -0
- casadi/include/ghc/fs_std_impl.hpp +46 -0
- casadi/include/highs/HConfig.h +23 -0
- casadi/include/highs/Highs.h +1703 -0
- casadi/include/highs/filereaderlp/builder.hpp +25 -0
- casadi/include/highs/filereaderlp/def.hpp +19 -0
- casadi/include/highs/filereaderlp/model.hpp +68 -0
- casadi/include/highs/filereaderlp/reader.hpp +10 -0
- casadi/include/highs/interfaces/highs_c_api.h +2456 -0
- casadi/include/highs/io/Filereader.h +45 -0
- casadi/include/highs/io/FilereaderEms.h +30 -0
- casadi/include/highs/io/FilereaderLp.h +51 -0
- casadi/include/highs/io/FilereaderMps.h +27 -0
- casadi/include/highs/io/HMPSIO.h +78 -0
- casadi/include/highs/io/HMpsFF.h +238 -0
- casadi/include/highs/io/HighsIO.h +114 -0
- casadi/include/highs/io/LoadOptions.h +24 -0
- casadi/include/highs/ipm/IpxSolution.h +32 -0
- casadi/include/highs/ipm/IpxWrapper.h +70 -0
- casadi/include/highs/ipm/basiclu/basiclu.h +161 -0
- casadi/include/highs/ipm/basiclu/basiclu_factorize.h +247 -0
- casadi/include/highs/ipm/basiclu/basiclu_get_factors.h +108 -0
- casadi/include/highs/ipm/basiclu/basiclu_initialize.h +119 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_factorize.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_free.h +19 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_get_factors.h +34 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_initialize.h +46 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_dense.h +29 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_for_update.h +42 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_solve_sparse.h +32 -0
- casadi/include/highs/ipm/basiclu/basiclu_obj_update.h +31 -0
- casadi/include/highs/ipm/basiclu/basiclu_object.h +30 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_dense.h +75 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_for_update.h +169 -0
- casadi/include/highs/ipm/basiclu/basiclu_solve_sparse.h +112 -0
- casadi/include/highs/ipm/basiclu/basiclu_update.h +125 -0
- casadi/include/highs/ipm/basiclu/lu_def.h +39 -0
- casadi/include/highs/ipm/basiclu/lu_file.h +21 -0
- casadi/include/highs/ipm/basiclu/lu_internal.h +220 -0
- casadi/include/highs/ipm/basiclu/lu_list.h +168 -0
- casadi/include/highs/ipm/ipx/basiclu_kernel.h +20 -0
- casadi/include/highs/ipm/ipx/basiclu_wrapper.h +47 -0
- casadi/include/highs/ipm/ipx/basis.h +351 -0
- casadi/include/highs/ipm/ipx/conjugate_residuals.h +74 -0
- casadi/include/highs/ipm/ipx/control.h +164 -0
- casadi/include/highs/ipm/ipx/crossover.h +157 -0
- casadi/include/highs/ipm/ipx/diagonal_precond.h +45 -0
- casadi/include/highs/ipm/ipx/forrest_tomlin.h +102 -0
- casadi/include/highs/ipm/ipx/guess_basis.h +21 -0
- casadi/include/highs/ipm/ipx/indexed_vector.h +113 -0
- casadi/include/highs/ipm/ipx/info.h +27 -0
- casadi/include/highs/ipm/ipx/ipm.h +94 -0
- casadi/include/highs/ipm/ipx/ipx_c.h +47 -0
- casadi/include/highs/ipm/ipx/ipx_config.h +9 -0
- casadi/include/highs/ipm/ipx/ipx_info.h +111 -0
- casadi/include/highs/ipm/ipx/ipx_internal.h +88 -0
- casadi/include/highs/ipm/ipx/ipx_parameters.h +76 -0
- casadi/include/highs/ipm/ipx/ipx_status.h +57 -0
- casadi/include/highs/ipm/ipx/iterate.h +328 -0
- casadi/include/highs/ipm/ipx/kkt_solver.h +70 -0
- casadi/include/highs/ipm/ipx/kkt_solver_basis.h +66 -0
- casadi/include/highs/ipm/ipx/kkt_solver_diag.h +48 -0
- casadi/include/highs/ipm/ipx/linear_operator.h +26 -0
- casadi/include/highs/ipm/ipx/lp_solver.h +202 -0
- casadi/include/highs/ipm/ipx/lu_factorization.h +79 -0
- casadi/include/highs/ipm/ipx/lu_update.h +129 -0
- casadi/include/highs/ipm/ipx/maxvolume.h +54 -0
- casadi/include/highs/ipm/ipx/model.h +413 -0
- casadi/include/highs/ipm/ipx/multistream.h +52 -0
- casadi/include/highs/ipm/ipx/normal_matrix.h +44 -0
- casadi/include/highs/ipm/ipx/power_method.h +44 -0
- casadi/include/highs/ipm/ipx/sparse_matrix.h +195 -0
- casadi/include/highs/ipm/ipx/sparse_utils.h +58 -0
- casadi/include/highs/ipm/ipx/splitted_normal_matrix.h +63 -0
- casadi/include/highs/ipm/ipx/starting_basis.h +39 -0
- casadi/include/highs/ipm/ipx/symbolic_invert.h +29 -0
- casadi/include/highs/ipm/ipx/timer.h +24 -0
- casadi/include/highs/ipm/ipx/utils.h +39 -0
- casadi/include/highs/lp_data/HConst.h +320 -0
- casadi/include/highs/lp_data/HStruct.h +182 -0
- casadi/include/highs/lp_data/HighsAnalysis.h +23 -0
- casadi/include/highs/lp_data/HighsCallback.h +47 -0
- casadi/include/highs/lp_data/HighsCallbackStruct.h +62 -0
- casadi/include/highs/lp_data/HighsDebug.h +34 -0
- casadi/include/highs/lp_data/HighsIis.h +62 -0
- casadi/include/highs/lp_data/HighsInfo.h +329 -0
- casadi/include/highs/lp_data/HighsInfoDebug.h +27 -0
- casadi/include/highs/lp_data/HighsLp.h +100 -0
- casadi/include/highs/lp_data/HighsLpSolverObject.h +45 -0
- casadi/include/highs/lp_data/HighsLpUtils.h +298 -0
- casadi/include/highs/lp_data/HighsModelUtils.h +112 -0
- casadi/include/highs/lp_data/HighsOptions.h +1469 -0
- casadi/include/highs/lp_data/HighsRanging.h +43 -0
- casadi/include/highs/lp_data/HighsSolution.h +144 -0
- casadi/include/highs/lp_data/HighsSolutionDebug.h +87 -0
- casadi/include/highs/lp_data/HighsSolve.h +23 -0
- casadi/include/highs/lp_data/HighsStatus.h +29 -0
- casadi/include/highs/mip/HighsCliqueTable.h +318 -0
- casadi/include/highs/mip/HighsConflictPool.h +109 -0
- casadi/include/highs/mip/HighsCutGeneration.h +106 -0
- casadi/include/highs/mip/HighsCutPool.h +168 -0
- casadi/include/highs/mip/HighsDebugSol.h +132 -0
- casadi/include/highs/mip/HighsDomain.h +653 -0
- casadi/include/highs/mip/HighsDomainChange.h +48 -0
- casadi/include/highs/mip/HighsDynamicRowMatrix.h +104 -0
- casadi/include/highs/mip/HighsGFkSolve.h +438 -0
- casadi/include/highs/mip/HighsImplications.h +170 -0
- casadi/include/highs/mip/HighsLpAggregator.h +50 -0
- casadi/include/highs/mip/HighsLpRelaxation.h +357 -0
- casadi/include/highs/mip/HighsMipAnalysis.h +52 -0
- casadi/include/highs/mip/HighsMipSolver.h +112 -0
- casadi/include/highs/mip/HighsMipSolverData.h +297 -0
- casadi/include/highs/mip/HighsModkSeparator.h +60 -0
- casadi/include/highs/mip/HighsNodeQueue.h +311 -0
- casadi/include/highs/mip/HighsObjectiveFunction.h +71 -0
- casadi/include/highs/mip/HighsPathSeparator.h +39 -0
- casadi/include/highs/mip/HighsPrimalHeuristics.h +70 -0
- casadi/include/highs/mip/HighsPseudocost.h +360 -0
- casadi/include/highs/mip/HighsRedcostFixing.h +42 -0
- casadi/include/highs/mip/HighsSearch.h +241 -0
- casadi/include/highs/mip/HighsSeparation.h +41 -0
- casadi/include/highs/mip/HighsSeparator.h +52 -0
- casadi/include/highs/mip/HighsTableauSeparator.h +34 -0
- casadi/include/highs/mip/HighsTransformedLp.h +63 -0
- casadi/include/highs/mip/MipTimer.h +471 -0
- casadi/include/highs/model/HighsHessian.h +54 -0
- casadi/include/highs/model/HighsHessianUtils.h +49 -0
- casadi/include/highs/model/HighsModel.h +52 -0
- casadi/include/highs/parallel/HighsBinarySemaphore.h +113 -0
- casadi/include/highs/parallel/HighsCacheAlign.h +87 -0
- casadi/include/highs/parallel/HighsCombinable.h +121 -0
- casadi/include/highs/parallel/HighsMutex.h +129 -0
- casadi/include/highs/parallel/HighsParallel.h +133 -0
- casadi/include/highs/parallel/HighsRaceTimer.h +43 -0
- casadi/include/highs/parallel/HighsSchedulerConstants.h +24 -0
- casadi/include/highs/parallel/HighsSpinMutex.h +53 -0
- casadi/include/highs/parallel/HighsSplitDeque.h +583 -0
- casadi/include/highs/parallel/HighsTask.h +175 -0
- casadi/include/highs/parallel/HighsTaskExecutor.h +222 -0
- casadi/include/highs/pdlp/CupdlpWrapper.h +104 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_cs.h +40 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_defs.h +433 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_linalg.h +189 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_proj.h +19 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_restart.h +31 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_scaling.h +26 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_solver.h +98 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_step.h +37 -0
- casadi/include/highs/pdlp/cupdlp/cupdlp_utils.c +1807 -0
- casadi/include/highs/pdqsort/pdqsort.h +532 -0
- casadi/include/highs/presolve/HPresolve.h +405 -0
- casadi/include/highs/presolve/HPresolveAnalysis.h +51 -0
- casadi/include/highs/presolve/HighsPostsolveStack.h +940 -0
- casadi/include/highs/presolve/HighsSymmetry.h +281 -0
- casadi/include/highs/presolve/ICrash.h +124 -0
- casadi/include/highs/presolve/ICrashUtil.h +62 -0
- casadi/include/highs/presolve/ICrashX.h +23 -0
- casadi/include/highs/presolve/PresolveComponent.h +90 -0
- casadi/include/highs/qpsolver/a_asm.hpp +70 -0
- casadi/include/highs/qpsolver/a_quass.hpp +15 -0
- casadi/include/highs/qpsolver/basis.hpp +152 -0
- casadi/include/highs/qpsolver/crashsolution.hpp +13 -0
- casadi/include/highs/qpsolver/dantzigpricing.hpp +73 -0
- casadi/include/highs/qpsolver/devexpricing.hpp +101 -0
- casadi/include/highs/qpsolver/eventhandler.hpp +23 -0
- casadi/include/highs/qpsolver/factor.hpp +401 -0
- casadi/include/highs/qpsolver/feasibility_bounded.hpp +107 -0
- casadi/include/highs/qpsolver/feasibility_highs.hpp +294 -0
- casadi/include/highs/qpsolver/gradient.hpp +39 -0
- casadi/include/highs/qpsolver/instance.hpp +63 -0
- casadi/include/highs/qpsolver/matrix.hpp +335 -0
- casadi/include/highs/qpsolver/perturbation.hpp +8 -0
- casadi/include/highs/qpsolver/pricing.hpp +15 -0
- casadi/include/highs/qpsolver/qpconst.hpp +27 -0
- casadi/include/highs/qpsolver/qpvector.hpp +235 -0
- casadi/include/highs/qpsolver/quass.hpp +20 -0
- casadi/include/highs/qpsolver/ratiotest.hpp +19 -0
- casadi/include/highs/qpsolver/runtime.hpp +38 -0
- casadi/include/highs/qpsolver/scaling.hpp +8 -0
- casadi/include/highs/qpsolver/settings.hpp +69 -0
- casadi/include/highs/qpsolver/snippets.hpp +29 -0
- casadi/include/highs/qpsolver/statistics.hpp +23 -0
- casadi/include/highs/qpsolver/steepestedgepricing.hpp +166 -0
- casadi/include/highs/simplex/HApp.h +476 -0
- casadi/include/highs/simplex/HEkk.h +416 -0
- casadi/include/highs/simplex/HEkkDual.h +513 -0
- casadi/include/highs/simplex/HEkkDualRHS.h +134 -0
- casadi/include/highs/simplex/HEkkDualRow.h +201 -0
- casadi/include/highs/simplex/HEkkPrimal.h +191 -0
- casadi/include/highs/simplex/HSimplex.h +42 -0
- casadi/include/highs/simplex/HSimplexDebug.h +48 -0
- casadi/include/highs/simplex/HSimplexNla.h +158 -0
- casadi/include/highs/simplex/HSimplexReport.h +21 -0
- casadi/include/highs/simplex/HighsSimplexAnalysis.h +500 -0
- casadi/include/highs/simplex/SimplexConst.h +273 -0
- casadi/include/highs/simplex/SimplexStruct.h +261 -0
- casadi/include/highs/simplex/SimplexTimer.h +409 -0
- casadi/include/highs/test/DevKkt.h +143 -0
- casadi/include/highs/test/KktCh2.h +79 -0
- casadi/include/highs/util/FactorTimer.h +199 -0
- casadi/include/highs/util/HFactor.h +587 -0
- casadi/include/highs/util/HFactorConst.h +81 -0
- casadi/include/highs/util/HFactorDebug.h +55 -0
- casadi/include/highs/util/HSet.h +89 -0
- casadi/include/highs/util/HVector.h +22 -0
- casadi/include/highs/util/HVectorBase.h +102 -0
- casadi/include/highs/util/HighsCDouble.h +319 -0
- casadi/include/highs/util/HighsComponent.h +53 -0
- casadi/include/highs/util/HighsDataStack.h +83 -0
- casadi/include/highs/util/HighsDisjointSets.h +107 -0
- casadi/include/highs/util/HighsHash.h +1274 -0
- casadi/include/highs/util/HighsHashTree.h +1447 -0
- casadi/include/highs/util/HighsInt.h +36 -0
- casadi/include/highs/util/HighsIntegers.h +212 -0
- casadi/include/highs/util/HighsLinearSumBounds.h +157 -0
- casadi/include/highs/util/HighsMatrixPic.h +37 -0
- casadi/include/highs/util/HighsMatrixSlice.h +561 -0
- casadi/include/highs/util/HighsMatrixUtils.h +54 -0
- casadi/include/highs/util/HighsMemoryAllocation.h +63 -0
- casadi/include/highs/util/HighsRandom.h +242 -0
- casadi/include/highs/util/HighsRbTree.h +452 -0
- casadi/include/highs/util/HighsSort.h +131 -0
- casadi/include/highs/util/HighsSparseMatrix.h +150 -0
- casadi/include/highs/util/HighsSparseVectorSum.h +95 -0
- casadi/include/highs/util/HighsSplay.h +135 -0
- casadi/include/highs/util/HighsTimer.h +381 -0
- casadi/include/highs/util/HighsUtils.h +217 -0
- casadi/include/highs/util/stringutil.h +46 -0
- casadi/include/highs/zstr/strict_fstream.hpp +237 -0
- casadi/include/highs/zstr/zstr.hpp +472 -0
- casadi/include/highs_export.h +42 -0
- casadi/include/hpipm_aux_mem.h +52 -0
- casadi/include/hpipm_aux_string.h +50 -0
- casadi/include/hpipm_common.h +76 -0
- casadi/include/hpipm_d_cast_qcqp.h +71 -0
- casadi/include/hpipm_d_cond.h +135 -0
- casadi/include/hpipm_d_cond_aux.h +92 -0
- casadi/include/hpipm_d_cond_qcqp.h +129 -0
- casadi/include/hpipm_d_core_qp_ipm.h +101 -0
- casadi/include/hpipm_d_core_qp_ipm_aux.h +68 -0
- casadi/include/hpipm_d_dense_qcqp.h +199 -0
- casadi/include/hpipm_d_dense_qcqp_dim.h +98 -0
- casadi/include/hpipm_d_dense_qcqp_ipm.h +193 -0
- casadi/include/hpipm_d_dense_qcqp_res.h +108 -0
- casadi/include/hpipm_d_dense_qcqp_sol.h +85 -0
- casadi/include/hpipm_d_dense_qcqp_utils.h +82 -0
- casadi/include/hpipm_d_dense_qp.h +207 -0
- casadi/include/hpipm_d_dense_qp_dim.h +92 -0
- casadi/include/hpipm_d_dense_qp_ipm.h +260 -0
- casadi/include/hpipm_d_dense_qp_kkt.h +72 -0
- casadi/include/hpipm_d_dense_qp_res.h +106 -0
- casadi/include/hpipm_d_dense_qp_sol.h +94 -0
- casadi/include/hpipm_d_dense_qp_utils.h +83 -0
- casadi/include/hpipm_d_ocp_qcqp.h +322 -0
- casadi/include/hpipm_d_ocp_qcqp_dim.h +130 -0
- casadi/include/hpipm_d_ocp_qcqp_ipm.h +192 -0
- casadi/include/hpipm_d_ocp_qcqp_red.h +118 -0
- casadi/include/hpipm_d_ocp_qcqp_res.h +115 -0
- casadi/include/hpipm_d_ocp_qcqp_sol.h +114 -0
- casadi/include/hpipm_d_ocp_qcqp_utils.h +81 -0
- casadi/include/hpipm_d_ocp_qp.h +306 -0
- casadi/include/hpipm_d_ocp_qp_dim.h +142 -0
- casadi/include/hpipm_d_ocp_qp_ipm.h +252 -0
- casadi/include/hpipm_d_ocp_qp_kkt.h +66 -0
- casadi/include/hpipm_d_ocp_qp_red.h +117 -0
- casadi/include/hpipm_d_ocp_qp_res.h +113 -0
- casadi/include/hpipm_d_ocp_qp_sol.h +128 -0
- casadi/include/hpipm_d_ocp_qp_utils.h +82 -0
- casadi/include/hpipm_d_part_cond.h +115 -0
- casadi/include/hpipm_d_part_cond_qcqp.h +106 -0
- casadi/include/hpipm_d_sim_erk.h +122 -0
- casadi/include/hpipm_d_sim_rk.h +71 -0
- casadi/include/hpipm_d_tree_ocp_qcqp.h +213 -0
- casadi/include/hpipm_d_tree_ocp_qcqp_dim.h +117 -0
- casadi/include/hpipm_d_tree_ocp_qcqp_ipm.h +191 -0
- casadi/include/hpipm_d_tree_ocp_qcqp_res.h +109 -0
- casadi/include/hpipm_d_tree_ocp_qcqp_sol.h +99 -0
- casadi/include/hpipm_d_tree_ocp_qcqp_utils.h +84 -0
- casadi/include/hpipm_d_tree_ocp_qp.h +195 -0
- casadi/include/hpipm_d_tree_ocp_qp_dim.h +111 -0
- casadi/include/hpipm_d_tree_ocp_qp_ipm.h +209 -0
- casadi/include/hpipm_d_tree_ocp_qp_kkt.h +52 -0
- casadi/include/hpipm_d_tree_ocp_qp_res.h +107 -0
- casadi/include/hpipm_d_tree_ocp_qp_sol.h +100 -0
- casadi/include/hpipm_d_tree_ocp_qp_utils.h +83 -0
- casadi/include/hpipm_m_dense_qp.h +68 -0
- casadi/include/hpipm_m_dense_qp_dim.h +68 -0
- casadi/include/hpipm_m_ocp_qp.h +49 -0
- casadi/include/hpipm_m_ocp_qp_ipm_hard.h +115 -0
- casadi/include/hpipm_m_ocp_qp_kkt.h +45 -0
- casadi/include/hpipm_s_cast_qcqp.h +72 -0
- casadi/include/hpipm_s_cond.h +137 -0
- casadi/include/hpipm_s_cond_aux.h +92 -0
- casadi/include/hpipm_s_cond_qcqp.h +130 -0
- casadi/include/hpipm_s_core_qp_ipm.h +101 -0
- casadi/include/hpipm_s_core_qp_ipm_aux.h +68 -0
- casadi/include/hpipm_s_dense_qcqp.h +200 -0
- casadi/include/hpipm_s_dense_qcqp_dim.h +99 -0
- casadi/include/hpipm_s_dense_qcqp_ipm.h +204 -0
- casadi/include/hpipm_s_dense_qcqp_res.h +109 -0
- casadi/include/hpipm_s_dense_qcqp_sol.h +86 -0
- casadi/include/hpipm_s_dense_qcqp_utils.h +83 -0
- casadi/include/hpipm_s_dense_qp.h +207 -0
- casadi/include/hpipm_s_dense_qp_dim.h +94 -0
- casadi/include/hpipm_s_dense_qp_ipm.h +260 -0
- casadi/include/hpipm_s_dense_qp_kkt.h +72 -0
- casadi/include/hpipm_s_dense_qp_res.h +107 -0
- casadi/include/hpipm_s_dense_qp_sol.h +94 -0
- casadi/include/hpipm_s_dense_qp_utils.h +84 -0
- casadi/include/hpipm_s_ocp_qcqp.h +322 -0
- casadi/include/hpipm_s_ocp_qcqp_dim.h +131 -0
- casadi/include/hpipm_s_ocp_qcqp_ipm.h +193 -0
- casadi/include/hpipm_s_ocp_qcqp_red.h +119 -0
- casadi/include/hpipm_s_ocp_qcqp_res.h +116 -0
- casadi/include/hpipm_s_ocp_qcqp_sol.h +115 -0
- casadi/include/hpipm_s_ocp_qcqp_utils.h +82 -0
- casadi/include/hpipm_s_ocp_qp.h +306 -0
- casadi/include/hpipm_s_ocp_qp_dim.h +141 -0
- casadi/include/hpipm_s_ocp_qp_ipm.h +252 -0
- casadi/include/hpipm_s_ocp_qp_kkt.h +66 -0
- casadi/include/hpipm_s_ocp_qp_red.h +118 -0
- casadi/include/hpipm_s_ocp_qp_res.h +115 -0
- casadi/include/hpipm_s_ocp_qp_sol.h +128 -0
- casadi/include/hpipm_s_ocp_qp_utils.h +83 -0
- casadi/include/hpipm_s_part_cond.h +115 -0
- casadi/include/hpipm_s_part_cond_qcqp.h +107 -0
- casadi/include/hpipm_s_sim_erk.h +121 -0
- casadi/include/hpipm_s_sim_rk.h +72 -0
- casadi/include/hpipm_s_tree_ocp_qcqp.h +213 -0
- casadi/include/hpipm_s_tree_ocp_qcqp_dim.h +118 -0
- casadi/include/hpipm_s_tree_ocp_qcqp_ipm.h +192 -0
- casadi/include/hpipm_s_tree_ocp_qcqp_res.h +110 -0
- casadi/include/hpipm_s_tree_ocp_qcqp_sol.h +97 -0
- casadi/include/hpipm_s_tree_ocp_qcqp_utils.h +85 -0
- casadi/include/hpipm_s_tree_ocp_qp.h +196 -0
- casadi/include/hpipm_s_tree_ocp_qp_dim.h +111 -0
- casadi/include/hpipm_s_tree_ocp_qp_ipm.h +208 -0
- casadi/include/hpipm_s_tree_ocp_qp_kkt.h +54 -0
- casadi/include/hpipm_s_tree_ocp_qp_res.h +108 -0
- casadi/include/hpipm_s_tree_ocp_qp_sol.h +98 -0
- casadi/include/hpipm_s_tree_ocp_qp_utils.h +84 -0
- casadi/include/hpipm_scenario_tree.h +70 -0
- casadi/include/hpipm_timing.h +67 -0
- casadi/include/hpipm_tree.h +76 -0
- casadi/include/licenses/FMI-Standard-2.0.2/LICENSE.txt +473 -0
- casadi/include/licenses/FMI-Standard-3.0/LICENSE.txt +464 -0
- casadi/include/licenses/alpaqa-external/LICENSE +165 -0
- casadi/include/licenses/blasfeo-external/LICENSE.txt +26 -0
- casadi/include/licenses/bonmin-external/Bonmin/LICENSE +87 -0
- casadi/include/licenses/bonmin-external/LICENSE +3 -0
- casadi/include/licenses/casadi/LICENSE/LICENSE.txt +165 -0
- casadi/include/licenses/casadi-sundials/LICENSE +64 -0
- casadi/include/licenses/casadi-sundials/cvodes/LICENSE +60 -0
- casadi/include/licenses/casadi-sundials/idas/LICENSE +59 -0
- casadi/include/licenses/casadi-sundials/kinsol/LICENSE +59 -0
- casadi/include/licenses/casadi-sundials/sundials/LICENSE +67 -0
- casadi/include/licenses/cbc-external/Cbc/LICENSE +239 -0
- casadi/include/licenses/cbc-external/LICENSE +245 -0
- casadi/include/licenses/cgl-external/Cgl/LICENSE +239 -0
- casadi/include/licenses/cgl-external/LICENSE +245 -0
- casadi/include/licenses/clp-external/Clp/LICENSE +239 -0
- casadi/include/licenses/clp-external/LICENSE +245 -0
- casadi/include/licenses/coinutils-external/CoinUtils/LICENSE +239 -0
- casadi/include/licenses/coinutils-external/LICENSE +245 -0
- casadi/include/licenses/daqp-external/LICENSE +21 -0
- casadi/include/licenses/fatrop-external/LICENSE.txt +165 -0
- casadi/include/licenses/fatrop-external/external/blasfeo/LICENSE.txt +26 -0
- casadi/include/licenses/fatrop-external/external/pybind11/LICENSE +29 -0
- casadi/include/licenses/ghc-external/LICENSE +19 -0
- casadi/include/licenses/highs-external/LICENSE.txt +21 -0
- casadi/include/licenses/highs-external/extern/filereaderlp/LICENSE +19 -0
- casadi/include/licenses/hpipm-external/LICENSE.txt +26 -0
- casadi/include/licenses/ipopt-external/LICENSE +260 -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/include/licenses/metis-external/LICENSE +87 -0
- casadi/include/licenses/metis-external/metis-4.0/LICENSE +18 -0
- casadi/include/licenses/mockups-external/LICENSE +21 -0
- casadi/include/licenses/mumps-external/LICENSE +87 -0
- casadi/include/licenses/mumps-external/MUMPS/LICENSE +50 -0
- casadi/include/licenses/openblas-external/LICENSE +29 -0
- casadi/include/licenses/openblas-external/ctest/LICENSE +23 -0
- casadi/include/licenses/openblas-external/lapack-netlib/LAPACKE/LICENSE +26 -0
- casadi/include/licenses/openblas-external/lapack-netlib/LICENSE +48 -0
- casadi/include/licenses/openblas-external/reference/LICENSE +23 -0
- casadi/include/licenses/openblas-external/relapack/LICENSE +22 -0
- casadi/include/licenses/openblas-external/test/LICENSE +23 -0
- casadi/include/licenses/osi-external/LICENSE +245 -0
- casadi/include/licenses/osi-external/Osi/LICENSE +239 -0
- casadi/include/licenses/osqp-external/LICENSE +201 -0
- casadi/include/licenses/osqp-external/lin_sys/direct/qdldl/amd/LICENSE +36 -0
- casadi/include/licenses/osqp-external/lin_sys/direct/qdldl/qdldl_sources/LICENSE +201 -0
- casadi/include/licenses/proxqp-external/LICENSE +25 -0
- casadi/include/licenses/proxqp-external/bindings/python/external/pybind11/LICENSE +29 -0
- casadi/include/licenses/proxqp-external/cmake-module/LICENSE +4 -0
- casadi/include/licenses/proxqp-external/cmake-module/doxygen/MathJax/LICENSE +202 -0
- casadi/include/licenses/proxqp-external/external/cereal/LICENSE +24 -0
- casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/LICENSE +21 -0
- casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/rapidjson/LICENSE +13 -0
- casadi/include/licenses/proxqp-external/external/cereal/include/cereal/external/rapidjson/msinttypes/LICENSE +29 -0
- casadi/include/licenses/qpOASES/LICENSE.txt +503 -0
- casadi/include/licenses/sleqp-external/LICENSE +165 -0
- casadi/include/licenses/superscs-external/LICENSE.txt +24 -0
- casadi/include/licenses/tinyxml2-9.0.0/LICENSE.txt +18 -0
- casadi/include/licenses/trlib-external/LICENSE +21 -0
- casadi/include/openblas/cblas.h +411 -0
- casadi/include/openblas/f77blas.h +796 -0
- casadi/include/openblas/lapack.h +22997 -0
- casadi/include/openblas/lapacke.h +12665 -0
- casadi/include/openblas/lapacke_config.h +119 -0
- casadi/include/openblas/lapacke_example_aux.h +9 -0
- casadi/include/openblas/lapacke_mangling.h +17 -0
- casadi/include/openblas/lapacke_utils.h +582 -0
- casadi/include/openblas/openblas/lapacke_mangling.h +17 -0
- casadi/include/openblas/openblas_config.h +140 -0
- casadi/include/osqp/auxil.h +181 -0
- casadi/include/osqp/constants.h +128 -0
- casadi/include/osqp/cs.h +180 -0
- casadi/include/osqp/ctrlc.h +56 -0
- casadi/include/osqp/error.h +38 -0
- casadi/include/osqp/glob_opts.h +167 -0
- casadi/include/osqp/lin_alg.h +216 -0
- casadi/include/osqp/lin_sys.h +54 -0
- casadi/include/osqp/osqp.h +430 -0
- casadi/include/osqp/osqp_configure.h +49 -0
- casadi/include/osqp/polish.h +25 -0
- casadi/include/osqp/proj.h +37 -0
- casadi/include/osqp/scaling.h +44 -0
- casadi/include/osqp/types.h +326 -0
- casadi/include/osqp/util.h +222 -0
- casadi/include/osqp/version.h +9 -0
- casadi/include/proxsuite/config.hpp +68 -0
- casadi/include/proxsuite/deprecated.hpp +56 -0
- casadi/include/proxsuite/fwd.hpp +52 -0
- casadi/include/proxsuite/helpers/common.hpp +70 -0
- casadi/include/proxsuite/helpers/instruction-set.hpp +275 -0
- casadi/include/proxsuite/helpers/optional.hpp +46 -0
- casadi/include/proxsuite/helpers/tl-optional.hpp +2472 -0
- casadi/include/proxsuite/helpers/version.hpp +39 -0
- casadi/include/proxsuite/linalg/dense/core.hpp +863 -0
- casadi/include/proxsuite/linalg/dense/factorize.hpp +375 -0
- casadi/include/proxsuite/linalg/dense/ldlt.hpp +817 -0
- casadi/include/proxsuite/linalg/dense/modify.hpp +333 -0
- casadi/include/proxsuite/linalg/dense/solve.hpp +38 -0
- casadi/include/proxsuite/linalg/dense/update.hpp +330 -0
- casadi/include/proxsuite/linalg/sparse/core.hpp +531 -0
- casadi/include/proxsuite/linalg/sparse/factorize.hpp +1303 -0
- casadi/include/proxsuite/linalg/sparse/rowmod.hpp +443 -0
- casadi/include/proxsuite/linalg/sparse/update.hpp +348 -0
- casadi/include/proxsuite/linalg/veg/internal/assert_impl.hpp +20 -0
- casadi/include/proxsuite/linalg/veg/internal/collection_algo.hpp +93 -0
- casadi/include/proxsuite/linalg/veg/internal/dbg.hpp +15 -0
- casadi/include/proxsuite/linalg/veg/internal/delete_special_members.hpp +77 -0
- casadi/include/proxsuite/linalg/veg/internal/dyn_index.hpp +292 -0
- casadi/include/proxsuite/linalg/veg/internal/epilogue.hpp +31 -0
- casadi/include/proxsuite/linalg/veg/internal/external/hedley.ext.hpp +2074 -0
- casadi/include/proxsuite/linalg/veg/internal/external/unhedley.ext.hpp +148 -0
- casadi/include/proxsuite/linalg/veg/internal/fix_index.hpp +339 -0
- casadi/include/proxsuite/linalg/veg/internal/has_asan.hpp +17 -0
- casadi/include/proxsuite/linalg/veg/internal/integer_seq.hpp +248 -0
- casadi/include/proxsuite/linalg/veg/internal/macros.hpp +1312 -0
- casadi/include/proxsuite/linalg/veg/internal/narrow.hpp +46 -0
- casadi/include/proxsuite/linalg/veg/internal/preprocessor.hpp +434 -0
- casadi/include/proxsuite/linalg/veg/internal/prologue.hpp +157 -0
- casadi/include/proxsuite/linalg/veg/internal/std.hpp +13 -0
- casadi/include/proxsuite/linalg/veg/internal/terminate.hpp +22 -0
- casadi/include/proxsuite/linalg/veg/internal/typedefs.hpp +58 -0
- casadi/include/proxsuite/linalg/veg/memory/address.hpp +97 -0
- casadi/include/proxsuite/linalg/veg/memory/alloc.hpp +352 -0
- casadi/include/proxsuite/linalg/veg/memory/dynamic_stack.hpp +504 -0
- casadi/include/proxsuite/linalg/veg/memory/placement.hpp +202 -0
- casadi/include/proxsuite/linalg/veg/memory/stack_alloc.hpp +239 -0
- casadi/include/proxsuite/linalg/veg/ref.hpp +148 -0
- casadi/include/proxsuite/linalg/veg/slice.hpp +240 -0
- casadi/include/proxsuite/linalg/veg/tuple.hpp +876 -0
- casadi/include/proxsuite/linalg/veg/type_traits/alloc.hpp +169 -0
- casadi/include/proxsuite/linalg/veg/type_traits/assignable.hpp +53 -0
- casadi/include/proxsuite/linalg/veg/type_traits/constructible.hpp +217 -0
- casadi/include/proxsuite/linalg/veg/type_traits/core.hpp +298 -0
- casadi/include/proxsuite/linalg/veg/type_traits/invocable.hpp +47 -0
- casadi/include/proxsuite/linalg/veg/type_traits/primitives.hpp +43 -0
- casadi/include/proxsuite/linalg/veg/type_traits/tags.hpp +47 -0
- casadi/include/proxsuite/linalg/veg/util/assert.hpp +48 -0
- casadi/include/proxsuite/linalg/veg/util/dbg.hpp +6 -0
- casadi/include/proxsuite/linalg/veg/util/defer.hpp +57 -0
- casadi/include/proxsuite/linalg/veg/util/dynstack_alloc.hpp +19 -0
- casadi/include/proxsuite/linalg/veg/util/get.hpp +153 -0
- casadi/include/proxsuite/linalg/veg/util/index.hpp +6 -0
- casadi/include/proxsuite/linalg/veg/util/unreachable.hpp +41 -0
- casadi/include/proxsuite/linalg/veg/vec.hpp +1034 -0
- casadi/include/proxsuite/proxqp/dense/dense.hpp +10 -0
- casadi/include/proxsuite/proxqp/dense/fwd.hpp +55 -0
- casadi/include/proxsuite/proxqp/dense/helpers.hpp +520 -0
- casadi/include/proxsuite/proxqp/dense/linesearch.hpp +517 -0
- casadi/include/proxsuite/proxqp/dense/model.hpp +147 -0
- casadi/include/proxsuite/proxqp/dense/preconditioner/identity.hpp +113 -0
- casadi/include/proxsuite/proxqp/dense/preconditioner/ruiz.hpp +571 -0
- casadi/include/proxsuite/proxqp/dense/solver.hpp +1330 -0
- casadi/include/proxsuite/proxqp/dense/utils.hpp +415 -0
- casadi/include/proxsuite/proxqp/dense/views.hpp +1466 -0
- casadi/include/proxsuite/proxqp/dense/workspace.hpp +264 -0
- casadi/include/proxsuite/proxqp/dense/wrapper.hpp +491 -0
- casadi/include/proxsuite/proxqp/results.hpp +212 -0
- casadi/include/proxsuite/proxqp/settings.hpp +302 -0
- casadi/include/proxsuite/proxqp/sparse/fwd.hpp +58 -0
- casadi/include/proxsuite/proxqp/sparse/helpers.hpp +309 -0
- casadi/include/proxsuite/proxqp/sparse/model.hpp +228 -0
- casadi/include/proxsuite/proxqp/sparse/preconditioner/identity.hpp +64 -0
- casadi/include/proxsuite/proxqp/sparse/preconditioner/ruiz.hpp +569 -0
- casadi/include/proxsuite/proxqp/sparse/solver.hpp +1441 -0
- casadi/include/proxsuite/proxqp/sparse/sparse.hpp +10 -0
- casadi/include/proxsuite/proxqp/sparse/utils.hpp +815 -0
- casadi/include/proxsuite/proxqp/sparse/views.hpp +63 -0
- casadi/include/proxsuite/proxqp/sparse/workspace.hpp +790 -0
- casadi/include/proxsuite/proxqp/sparse/wrapper.hpp +772 -0
- casadi/include/proxsuite/proxqp/status.hpp +46 -0
- casadi/include/proxsuite/proxqp/timings.hpp +101 -0
- casadi/include/proxsuite/proxqp/utils/prints.hpp +47 -0
- casadi/include/proxsuite/proxqp/utils/random_qp_problems.hpp +669 -0
- casadi/include/proxsuite/serialization/archive.hpp +231 -0
- casadi/include/proxsuite/serialization/eigen.hpp +107 -0
- casadi/include/proxsuite/serialization/model.hpp +34 -0
- casadi/include/proxsuite/serialization/results.hpp +74 -0
- casadi/include/proxsuite/serialization/settings.hpp +60 -0
- casadi/include/proxsuite/serialization/wrapper.hpp +24 -0
- casadi/include/proxsuite/warning.hpp +35 -0
- casadi/include/qdldl/qdldl.h +169 -0
- casadi/include/qdldl/qdldl_types.h +23 -0
- casadi/include/s_blas.h +78 -0
- casadi/include/s_blas_64.h +73 -0
- casadi/include/simde/arm/neon/aba.h +208 -0
- casadi/include/simde/arm/neon/abd.h +384 -0
- casadi/include/simde/arm/neon/abdl.h +147 -0
- casadi/include/simde/arm/neon/abs.h +408 -0
- casadi/include/simde/arm/neon/add.h +681 -0
- casadi/include/simde/arm/neon/addl.h +127 -0
- casadi/include/simde/arm/neon/addl_high.h +127 -0
- casadi/include/simde/arm/neon/addlv.h +317 -0
- casadi/include/simde/arm/neon/addv.h +447 -0
- casadi/include/simde/arm/neon/addw.h +222 -0
- casadi/include/simde/arm/neon/addw_high.h +193 -0
- casadi/include/simde/arm/neon/and.h +552 -0
- casadi/include/simde/arm/neon/bic.h +472 -0
- casadi/include/simde/arm/neon/bsl.h +448 -0
- casadi/include/simde/arm/neon/cagt.h +168 -0
- casadi/include/simde/arm/neon/ceq.h +711 -0
- casadi/include/simde/arm/neon/ceqz.h +335 -0
- casadi/include/simde/arm/neon/cge.h +677 -0
- casadi/include/simde/arm/neon/cgez.h +378 -0
- casadi/include/simde/arm/neon/cgt.h +686 -0
- casadi/include/simde/arm/neon/cgtz.h +380 -0
- casadi/include/simde/arm/neon/cle.h +677 -0
- casadi/include/simde/arm/neon/clez.h +378 -0
- casadi/include/simde/arm/neon/cls.h +148 -0
- casadi/include/simde/arm/neon/clt.h +679 -0
- casadi/include/simde/arm/neon/cltz.h +263 -0
- casadi/include/simde/arm/neon/clz.h +423 -0
- casadi/include/simde/arm/neon/cnt.h +145 -0
- casadi/include/simde/arm/neon/combine.h +343 -0
- casadi/include/simde/arm/neon/create.h +186 -0
- casadi/include/simde/arm/neon/cvt.h +492 -0
- casadi/include/simde/arm/neon/dot.h +171 -0
- casadi/include/simde/arm/neon/dot_lane.h +196 -0
- casadi/include/simde/arm/neon/dup_lane.h +702 -0
- casadi/include/simde/arm/neon/dup_n.h +534 -0
- casadi/include/simde/arm/neon/eor.h +552 -0
- casadi/include/simde/arm/neon/ext.h +887 -0
- casadi/include/simde/arm/neon/get_high.h +260 -0
- casadi/include/simde/arm/neon/get_lane.h +499 -0
- casadi/include/simde/arm/neon/get_low.h +276 -0
- casadi/include/simde/arm/neon/hadd.h +287 -0
- casadi/include/simde/arm/neon/hsub.h +287 -0
- casadi/include/simde/arm/neon/ld1.h +399 -0
- casadi/include/simde/arm/neon/ld3.h +609 -0
- casadi/include/simde/arm/neon/ld4.h +448 -0
- casadi/include/simde/arm/neon/max.h +614 -0
- casadi/include/simde/arm/neon/maxnm.h +215 -0
- casadi/include/simde/arm/neon/maxv.h +400 -0
- casadi/include/simde/arm/neon/min.h +660 -0
- casadi/include/simde/arm/neon/minnm.h +215 -0
- casadi/include/simde/arm/neon/minv.h +424 -0
- casadi/include/simde/arm/neon/mla.h +530 -0
- casadi/include/simde/arm/neon/mla_n.h +333 -0
- casadi/include/simde/arm/neon/mlal.h +156 -0
- casadi/include/simde/arm/neon/mlal_high.h +156 -0
- casadi/include/simde/arm/neon/mlal_n.h +128 -0
- casadi/include/simde/arm/neon/mls.h +264 -0
- casadi/include/simde/arm/neon/mlsl.h +124 -0
- casadi/include/simde/arm/neon/mlsl_high.h +124 -0
- casadi/include/simde/arm/neon/mlsl_n.h +96 -0
- casadi/include/simde/arm/neon/movl.h +208 -0
- casadi/include/simde/arm/neon/movl_high.h +126 -0
- casadi/include/simde/arm/neon/movn.h +195 -0
- casadi/include/simde/arm/neon/movn_high.h +125 -0
- casadi/include/simde/arm/neon/mul.h +594 -0
- casadi/include/simde/arm/neon/mul_lane.h +472 -0
- casadi/include/simde/arm/neon/mul_n.h +383 -0
- casadi/include/simde/arm/neon/mull.h +236 -0
- casadi/include/simde/arm/neon/mull_high.h +125 -0
- casadi/include/simde/arm/neon/mull_n.h +158 -0
- casadi/include/simde/arm/neon/mvn.h +426 -0
- casadi/include/simde/arm/neon/neg.h +393 -0
- casadi/include/simde/arm/neon/orn.h +505 -0
- casadi/include/simde/arm/neon/orr.h +552 -0
- casadi/include/simde/arm/neon/padal.h +211 -0
- casadi/include/simde/arm/neon/padd.h +293 -0
- casadi/include/simde/arm/neon/paddl.h +239 -0
- casadi/include/simde/arm/neon/pmax.h +253 -0
- casadi/include/simde/arm/neon/pmin.h +260 -0
- casadi/include/simde/arm/neon/qabs.h +281 -0
- casadi/include/simde/arm/neon/qadd.h +553 -0
- casadi/include/simde/arm/neon/qdmulh.h +125 -0
- casadi/include/simde/arm/neon/qdmull.h +125 -0
- casadi/include/simde/arm/neon/qmovn.h +273 -0
- casadi/include/simde/arm/neon/qmovn_high.h +127 -0
- casadi/include/simde/arm/neon/qmovun.h +159 -0
- casadi/include/simde/arm/neon/qneg.h +301 -0
- casadi/include/simde/arm/neon/qrdmulh.h +165 -0
- casadi/include/simde/arm/neon/qrdmulh_n.h +136 -0
- casadi/include/simde/arm/neon/qshl.h +732 -0
- casadi/include/simde/arm/neon/qsub.h +549 -0
- casadi/include/simde/arm/neon/qtbl.h +455 -0
- casadi/include/simde/arm/neon/qtbx.h +470 -0
- casadi/include/simde/arm/neon/rbit.h +165 -0
- casadi/include/simde/arm/neon/reinterpret.h +3101 -0
- casadi/include/simde/arm/neon/rev16.h +137 -0
- casadi/include/simde/arm/neon/rev32.h +235 -0
- casadi/include/simde/arm/neon/rev64.h +358 -0
- casadi/include/simde/arm/neon/rhadd.h +406 -0
- casadi/include/simde/arm/neon/rnd.h +143 -0
- casadi/include/simde/arm/neon/rndi.h +135 -0
- casadi/include/simde/arm/neon/rndm.h +143 -0
- casadi/include/simde/arm/neon/rndn.h +135 -0
- casadi/include/simde/arm/neon/rndp.h +143 -0
- casadi/include/simde/arm/neon/rshl.h +903 -0
- casadi/include/simde/arm/neon/rshr_n.h +471 -0
- casadi/include/simde/arm/neon/rsra_n.h +209 -0
- casadi/include/simde/arm/neon/set_lane.h +422 -0
- casadi/include/simde/arm/neon/shl.h +805 -0
- casadi/include/simde/arm/neon/shl_n.h +560 -0
- casadi/include/simde/arm/neon/shr_n.h +612 -0
- casadi/include/simde/arm/neon/sra_n.h +202 -0
- casadi/include/simde/arm/neon/st1.h +353 -0
- casadi/include/simde/arm/neon/st1_lane.h +363 -0
- casadi/include/simde/arm/neon/st3.h +426 -0
- casadi/include/simde/arm/neon/st4.h +445 -0
- casadi/include/simde/arm/neon/sub.h +659 -0
- casadi/include/simde/arm/neon/subl.h +127 -0
- casadi/include/simde/arm/neon/subw.h +221 -0
- casadi/include/simde/arm/neon/subw_high.h +222 -0
- casadi/include/simde/arm/neon/tbl.h +224 -0
- casadi/include/simde/arm/neon/tbx.h +247 -0
- casadi/include/simde/arm/neon/trn.h +252 -0
- casadi/include/simde/arm/neon/trn1.h +500 -0
- casadi/include/simde/arm/neon/trn2.h +499 -0
- casadi/include/simde/arm/neon/tst.h +540 -0
- casadi/include/simde/arm/neon/types.h +683 -0
- casadi/include/simde/arm/neon/uqadd.h +325 -0
- casadi/include/simde/arm/neon/uzp.h +252 -0
- casadi/include/simde/arm/neon/uzp1.h +643 -0
- casadi/include/simde/arm/neon/uzp2.h +647 -0
- casadi/include/simde/arm/neon/zip.h +252 -0
- casadi/include/simde/arm/neon/zip1.h +625 -0
- casadi/include/simde/arm/neon/zip2.h +625 -0
- casadi/include/simde/arm/neon.h +166 -0
- casadi/include/simde/check.h +276 -0
- casadi/include/simde/debug-trap.h +85 -0
- casadi/include/simde/hedley.h +1971 -0
- casadi/include/simde/simde-align.h +449 -0
- casadi/include/simde/simde-arch.h +532 -0
- casadi/include/simde/simde-common.h +890 -0
- casadi/include/simde/simde-complex.h +148 -0
- casadi/include/simde/simde-constify.h +397 -0
- casadi/include/simde/simde-detect-clang.h +109 -0
- casadi/include/simde/simde-diagnostic.h +428 -0
- casadi/include/simde/simde-features.h +522 -0
- casadi/include/simde/simde-math.h +1805 -0
- casadi/include/simde/x86/avx.h +6193 -0
- casadi/include/simde/x86/avx2.h +5660 -0
- casadi/include/simde/x86/avx512/2intersect.h +250 -0
- casadi/include/simde/x86/avx512/abs.h +562 -0
- casadi/include/simde/x86/avx512/add.h +641 -0
- casadi/include/simde/x86/avx512/adds.h +390 -0
- casadi/include/simde/x86/avx512/and.h +305 -0
- casadi/include/simde/x86/avx512/andnot.h +193 -0
- casadi/include/simde/x86/avx512/avg.h +258 -0
- casadi/include/simde/x86/avx512/blend.h +293 -0
- casadi/include/simde/x86/avx512/broadcast.h +897 -0
- casadi/include/simde/x86/avx512/cast.h +324 -0
- casadi/include/simde/x86/avx512/cmp.h +587 -0
- casadi/include/simde/x86/avx512/cmpeq.h +179 -0
- casadi/include/simde/x86/avx512/cmpge.h +104 -0
- casadi/include/simde/x86/avx512/cmpgt.h +189 -0
- casadi/include/simde/x86/avx512/cmple.h +103 -0
- casadi/include/simde/x86/avx512/cmplt.h +123 -0
- casadi/include/simde/x86/avx512/copysign.h +86 -0
- casadi/include/simde/x86/avx512/cvt.h +122 -0
- casadi/include/simde/x86/avx512/cvts.h +723 -0
- casadi/include/simde/x86/avx512/div.h +162 -0
- casadi/include/simde/x86/avx512/extract.h +198 -0
- casadi/include/simde/x86/avx512/fmadd.h +136 -0
- casadi/include/simde/x86/avx512/fmsub.h +108 -0
- casadi/include/simde/x86/avx512/fnmadd.h +108 -0
- casadi/include/simde/x86/avx512/fnmsub.h +108 -0
- casadi/include/simde/x86/avx512/insert.h +193 -0
- casadi/include/simde/x86/avx512/kshift.h +152 -0
- casadi/include/simde/x86/avx512/load.h +67 -0
- casadi/include/simde/x86/avx512/loadu.h +113 -0
- casadi/include/simde/x86/avx512/lzcnt.h +209 -0
- casadi/include/simde/x86/avx512/madd.h +155 -0
- casadi/include/simde/x86/avx512/maddubs.h +159 -0
- casadi/include/simde/x86/avx512/max.h +587 -0
- casadi/include/simde/x86/avx512/min.h +587 -0
- casadi/include/simde/x86/avx512/mov.h +859 -0
- casadi/include/simde/x86/avx512/mov_mask.h +372 -0
- casadi/include/simde/x86/avx512/movm.h +460 -0
- casadi/include/simde/x86/avx512/mul.h +279 -0
- casadi/include/simde/x86/avx512/mulhi.h +65 -0
- casadi/include/simde/x86/avx512/mulhrs.h +65 -0
- casadi/include/simde/x86/avx512/mullo.h +117 -0
- casadi/include/simde/x86/avx512/negate.h +88 -0
- casadi/include/simde/x86/avx512/or.h +252 -0
- casadi/include/simde/x86/avx512/packs.h +122 -0
- casadi/include/simde/x86/avx512/packus.h +122 -0
- casadi/include/simde/x86/avx512/permutex2var.h +1645 -0
- casadi/include/simde/x86/avx512/permutexvar.h +1180 -0
- casadi/include/simde/x86/avx512/sad.h +77 -0
- casadi/include/simde/x86/avx512/set.h +477 -0
- casadi/include/simde/x86/avx512/set1.h +331 -0
- casadi/include/simde/x86/avx512/set4.h +140 -0
- casadi/include/simde/x86/avx512/setone.h +66 -0
- casadi/include/simde/x86/avx512/setr.h +144 -0
- casadi/include/simde/x86/avx512/setr4.h +140 -0
- casadi/include/simde/x86/avx512/setzero.h +90 -0
- casadi/include/simde/x86/avx512/shuffle.h +176 -0
- casadi/include/simde/x86/avx512/sll.h +247 -0
- casadi/include/simde/x86/avx512/slli.h +179 -0
- casadi/include/simde/x86/avx512/sllv.h +68 -0
- casadi/include/simde/x86/avx512/sqrt.h +127 -0
- casadi/include/simde/x86/avx512/sra.h +81 -0
- casadi/include/simde/x86/avx512/srai.h +70 -0
- casadi/include/simde/x86/avx512/srav.h +67 -0
- casadi/include/simde/x86/avx512/srl.h +216 -0
- casadi/include/simde/x86/avx512/srli.h +180 -0
- casadi/include/simde/x86/avx512/srlv.h +282 -0
- casadi/include/simde/x86/avx512/store.h +93 -0
- casadi/include/simde/x86/avx512/storeu.h +93 -0
- casadi/include/simde/x86/avx512/sub.h +351 -0
- casadi/include/simde/x86/avx512/subs.h +222 -0
- casadi/include/simde/x86/avx512/test.h +193 -0
- casadi/include/simde/x86/avx512/types.h +380 -0
- casadi/include/simde/x86/avx512/unpackhi.h +380 -0
- casadi/include/simde/x86/avx512/unpacklo.h +104 -0
- casadi/include/simde/x86/avx512/xor.h +263 -0
- casadi/include/simde/x86/avx512/xorsign.h +72 -0
- casadi/include/simde/x86/avx512.h +108 -0
- casadi/include/simde/x86/clmul.h +414 -0
- casadi/include/simde/x86/fma.h +724 -0
- casadi/include/simde/x86/gfni.h +802 -0
- casadi/include/simde/x86/mmx.h +2399 -0
- casadi/include/simde/x86/sse.h +4471 -0
- casadi/include/simde/x86/sse2.h +7389 -0
- casadi/include/simde/x86/sse3.h +499 -0
- casadi/include/simde/x86/sse4.1.h +2216 -0
- casadi/include/simde/x86/sse4.2.h +347 -0
- casadi/include/simde/x86/ssse3.h +1032 -0
- casadi/include/simde/x86/svml.h +12139 -0
- casadi/include/simde/x86/xop.h +3644 -0
- casadi/include/sleqp/defs.h +58 -0
- casadi/include/sleqp/export.h +42 -0
- casadi/include/sleqp/pub_cmp.h +18 -0
- casadi/include/sleqp/pub_dyn.h +140 -0
- casadi/include/sleqp/pub_error.h +50 -0
- casadi/include/sleqp/pub_func.h +257 -0
- casadi/include/sleqp/pub_hess_struct.h +105 -0
- casadi/include/sleqp/pub_iterate.h +88 -0
- casadi/include/sleqp/pub_log.h +88 -0
- casadi/include/sleqp/pub_lsq.h +158 -0
- casadi/include/sleqp/pub_mem.h +52 -0
- casadi/include/sleqp/pub_problem.h +213 -0
- casadi/include/sleqp/pub_scale.h +150 -0
- casadi/include/sleqp/pub_settings.h +162 -0
- casadi/include/sleqp/pub_solver.h +155 -0
- casadi/include/sleqp/pub_types.h +230 -0
- casadi/include/sleqp/pub_working_set.h +135 -0
- casadi/include/sleqp/sparse/pub_mat.h +153 -0
- casadi/include/sleqp/sparse/pub_vec.h +336 -0
- casadi/include/sleqp.h +38 -0
- casadi/include/spral.h +13 -0
- casadi/include/spral_lsmr.h +57 -0
- casadi/include/spral_matrix_util.h +40 -0
- casadi/include/spral_random.h +26 -0
- casadi/include/spral_random_matrix.h +27 -0
- casadi/include/spral_rutherford_boeing.h +51 -0
- casadi/include/spral_scaling.h +139 -0
- casadi/include/spral_ssids.h +121 -0
- casadi/include/spral_ssmfe.h +268 -0
- casadi/include/superscs/cones.h +185 -0
- casadi/include/superscs/constants.h +144 -0
- casadi/include/superscs/cs.h +109 -0
- casadi/include/superscs/ctrlc.h +77 -0
- casadi/include/superscs/directions.h +125 -0
- casadi/include/superscs/glbopts.h +240 -0
- casadi/include/superscs/linAlg.h +437 -0
- casadi/include/superscs/linSys.h +205 -0
- casadi/include/superscs/linsys/amatrix.h +77 -0
- casadi/include/superscs/linsys/common.h +49 -0
- casadi/include/superscs/normalize.h +138 -0
- casadi/include/superscs/scs.h +656 -0
- casadi/include/superscs/scs_blas.h +79 -0
- casadi/include/superscs/scs_parser.h +187 -0
- casadi/include/superscs/unit_test_util.h +210 -0
- casadi/include/superscs/util.h +354 -0
- casadi/include/trlib/trlib_eigen_inverse.h +118 -0
- casadi/include/trlib/trlib_krylov.h +493 -0
- casadi/include/trlib/trlib_leftmost.h +181 -0
- casadi/include/trlib/trlib_private.h +109 -0
- casadi/include/trlib/trlib_quadratic_zero.h +57 -0
- casadi/include/trlib/trlib_tri_factor.h +409 -0
- casadi/include/trlib/trlib_types.h +36 -0
- casadi/include/trlib.h +44 -0
- casadi/include/zconf.h +545 -0
- casadi/include/zip.h +528 -0
- casadi/include/zipconf.h +48 -0
- casadi/include/zlib.h +1938 -0
- casadi/ipopt.lib +0 -0
- casadi/lapack.lib +0 -0
- casadi/libCbc-3.dll +0 -0
- casadi/libCbc.dll.a +0 -0
- casadi/libCbc.la +35 -0
- casadi/libCbcSolver-3.dll +0 -0
- casadi/libCbcSolver.dll.a +0 -0
- casadi/libCbcSolver.la +35 -0
- casadi/libCgl-1.dll +0 -0
- casadi/libCgl.dll.a +0 -0
- casadi/libCgl.la +35 -0
- casadi/libClp-1.dll +0 -0
- casadi/libClp.dll.a +0 -0
- casadi/libClp.la +35 -0
- casadi/libClpSolver-1.dll +0 -0
- casadi/libClpSolver.dll.a +0 -0
- casadi/libClpSolver.la +35 -0
- casadi/libCoinUtils-3.dll +0 -0
- casadi/libCoinUtils.dll.a +0 -0
- casadi/libCoinUtils.la +35 -0
- casadi/libOsi-1.dll +0 -0
- casadi/libOsi.dll.a +0 -0
- casadi/libOsi.la +35 -0
- casadi/libOsiCbc-3.dll +0 -0
- casadi/libOsiCbc.dll.a +0 -0
- casadi/libOsiCbc.la +35 -0
- casadi/libOsiClp-1.dll +0 -0
- casadi/libOsiClp.dll.a +0 -0
- casadi/libOsiClp.la +35 -0
- casadi/libOsiCommonTests-1.dll +0 -0
- casadi/libOsiCommonTests.dll.a +0 -0
- casadi/libOsiCommonTests.la +35 -0
- casadi/libalpaqa.dll +0 -0
- casadi/libalpaqa.dll.a +0 -0
- casadi/libatomic-1.dll +0 -0
- casadi/libblasfeo.dll +0 -0
- casadi/libblasfeo.dll.a +0 -0
- casadi/libbonmin-4.dll +0 -0
- casadi/libbonmin.dll.a +0 -0
- casadi/libbonmin.la +35 -0
- casadi/libcasadi-tp-openblas.dll +0 -0
- casadi/libcasadi-tp-openblas.dll.a +0 -0
- casadi/libcasadi.dll +0 -0
- casadi/libcasadi.dll.a +0 -0
- casadi/libcasadi.lib +0 -0
- casadi/libcasadi_archiver_libzip.dll +0 -0
- casadi/libcasadi_archiver_libzip.dll.a +0 -0
- casadi/libcasadi_conic_cbc.dll +0 -0
- casadi/libcasadi_conic_cbc.dll.a +0 -0
- casadi/libcasadi_conic_clp.dll +0 -0
- casadi/libcasadi_conic_clp.dll.a +0 -0
- casadi/libcasadi_conic_cplex.dll +0 -0
- casadi/libcasadi_conic_cplex.dll.a +0 -0
- casadi/libcasadi_conic_daqp.dll +0 -0
- casadi/libcasadi_conic_daqp.dll.a +0 -0
- casadi/libcasadi_conic_fatrop.dll +0 -0
- casadi/libcasadi_conic_fatrop.dll.a +0 -0
- casadi/libcasadi_conic_gurobi.dll +0 -0
- casadi/libcasadi_conic_gurobi.dll.a +0 -0
- casadi/libcasadi_conic_highs.dll +0 -0
- casadi/libcasadi_conic_highs.dll.a +0 -0
- casadi/libcasadi_conic_hpipm.dll +0 -0
- casadi/libcasadi_conic_hpipm.dll.a +0 -0
- casadi/libcasadi_conic_ipqp.dll +0 -0
- casadi/libcasadi_conic_ipqp.dll.a +0 -0
- casadi/libcasadi_conic_nlpsol.dll +0 -0
- casadi/libcasadi_conic_nlpsol.dll.a +0 -0
- casadi/libcasadi_conic_osqp.dll +0 -0
- casadi/libcasadi_conic_osqp.dll.a +0 -0
- casadi/libcasadi_conic_proxqp.dll +0 -0
- casadi/libcasadi_conic_proxqp.dll.a +0 -0
- casadi/libcasadi_conic_qpoases.dll +0 -0
- casadi/libcasadi_conic_qpoases.dll.a +0 -0
- casadi/libcasadi_conic_qrqp.dll +0 -0
- casadi/libcasadi_conic_qrqp.dll.a +0 -0
- casadi/libcasadi_conic_superscs.dll +0 -0
- casadi/libcasadi_conic_superscs.dll.a +0 -0
- casadi/libcasadi_filesystem_ghc.dll +0 -0
- casadi/libcasadi_filesystem_ghc.dll.a +0 -0
- casadi/libcasadi_importer_shell.dll +0 -0
- casadi/libcasadi_importer_shell.dll.a +0 -0
- casadi/libcasadi_integrator_collocation.dll +0 -0
- casadi/libcasadi_integrator_collocation.dll.a +0 -0
- casadi/libcasadi_integrator_cvodes.dll +0 -0
- casadi/libcasadi_integrator_cvodes.dll.a +0 -0
- casadi/libcasadi_integrator_idas.dll +0 -0
- casadi/libcasadi_integrator_idas.dll.a +0 -0
- casadi/libcasadi_integrator_rk.dll +0 -0
- casadi/libcasadi_integrator_rk.dll.a +0 -0
- casadi/libcasadi_interpolant_bspline.dll +0 -0
- casadi/libcasadi_interpolant_bspline.dll.a +0 -0
- casadi/libcasadi_interpolant_linear.dll +0 -0
- casadi/libcasadi_interpolant_linear.dll.a +0 -0
- casadi/libcasadi_linsol_csparse.dll +0 -0
- casadi/libcasadi_linsol_csparse.dll.a +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll +0 -0
- casadi/libcasadi_linsol_csparsecholesky.dll.a +0 -0
- casadi/libcasadi_linsol_lapacklu.dll +0 -0
- casadi/libcasadi_linsol_lapacklu.dll.a +0 -0
- casadi/libcasadi_linsol_lapackqr.dll +0 -0
- casadi/libcasadi_linsol_lapackqr.dll.a +0 -0
- casadi/libcasadi_linsol_ldl.dll +0 -0
- casadi/libcasadi_linsol_ldl.dll.a +0 -0
- casadi/libcasadi_linsol_lsqr.dll +0 -0
- casadi/libcasadi_linsol_lsqr.dll.a +0 -0
- casadi/libcasadi_linsol_ma27.dll +0 -0
- casadi/libcasadi_linsol_ma27.dll.a +0 -0
- casadi/libcasadi_linsol_mumps.dll +0 -0
- casadi/libcasadi_linsol_mumps.dll.a +0 -0
- casadi/libcasadi_linsol_qr.dll +0 -0
- casadi/libcasadi_linsol_qr.dll.a +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll +0 -0
- casadi/libcasadi_linsol_symbolicqr.dll.a +0 -0
- casadi/libcasadi_linsol_tridiag.dll +0 -0
- casadi/libcasadi_linsol_tridiag.dll.a +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll +0 -0
- casadi/libcasadi_nlpsol_alpaqa.dll.a +0 -0
- casadi/libcasadi_nlpsol_ampl.dll +0 -0
- casadi/libcasadi_nlpsol_ampl.dll.a +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll +0 -0
- casadi/libcasadi_nlpsol_blocksqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll +0 -0
- casadi/libcasadi_nlpsol_bonmin.dll.a +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll +0 -0
- casadi/libcasadi_nlpsol_fatrop.dll.a +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_feasiblesqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll +0 -0
- casadi/libcasadi_nlpsol_ipopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_knitro.dll +0 -0
- casadi/libcasadi_nlpsol_knitro.dll.a +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll +0 -0
- casadi/libcasadi_nlpsol_madnlp.dll.a +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll +0 -0
- casadi/libcasadi_nlpsol_qrsqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll +0 -0
- casadi/libcasadi_nlpsol_scpgen.dll.a +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll +0 -0
- casadi/libcasadi_nlpsol_sleqp.dll.a +0 -0
- casadi/libcasadi_nlpsol_snopt.dll +0 -0
- casadi/libcasadi_nlpsol_snopt.dll.a +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll +0 -0
- casadi/libcasadi_nlpsol_sqpmethod.dll.a +0 -0
- casadi/libcasadi_nlpsol_worhp.dll +0 -0
- casadi/libcasadi_nlpsol_worhp.dll.a +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll +0 -0
- casadi/libcasadi_rootfinder_fast_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll +0 -0
- casadi/libcasadi_rootfinder_kinsol.dll.a +0 -0
- casadi/libcasadi_rootfinder_newton.dll +0 -0
- casadi/libcasadi_rootfinder_newton.dll.a +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll +0 -0
- casadi/libcasadi_rootfinder_nlpsol.dll.a +0 -0
- casadi/libcasadi_sundials_common.dll +0 -0
- casadi/libcasadi_sundials_common.dll.a +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll +0 -0
- casadi/libcasadi_xmlfile_tinyxml.dll.a +0 -0
- casadi/libcoinmetis-2.dll +0 -0
- casadi/libcoinmetis.dll.a +0 -0
- casadi/libcoinmetis.la +41 -0
- casadi/libcoinmumps-3.dll +0 -0
- casadi/libcoinmumps.dll.a +0 -0
- casadi/libcoinmumps.la +41 -0
- casadi/libcplex_adaptor.dll +0 -0
- casadi/libdaqp.dll +0 -0
- casadi/libdaqp.dll.a +0 -0
- casadi/libdaqpstat.a +0 -0
- casadi/libdl.dll +0 -0
- casadi/libdl.dll.a +0 -0
- casadi/libfatrop.dll +0 -0
- casadi/libfatrop.dll.a +0 -0
- casadi/libgcc_s_seh-1.dll +0 -0
- casadi/libgfortran-5.dll +0 -0
- casadi/libgomp-1.dll +0 -0
- casadi/libgurobi_adaptor.dll +0 -0
- casadi/libhighs.dll +0 -0
- casadi/libhighs.dll.a +0 -0
- casadi/libhpipm.dll +0 -0
- casadi/libhpipm.dll.a +0 -0
- casadi/libindirect.a +0 -0
- casadi/libipopt-3.dll +0 -0
- casadi/libipopt.dll.a +0 -0
- casadi/libipopt.la +41 -0
- casadi/liblinsys.a +0 -0
- casadi/libmatlab_ipc.dll +0 -0
- casadi/libmatlab_ipc.dll.a +0 -0
- casadi/libosqp.a +0 -0
- casadi/libosqp.dll +0 -0
- casadi/libosqp.dll.a +0 -0
- casadi/libqdldl.a +0 -0
- casadi/libqdldl.dll +0 -0
- casadi/libqdldl.dll.a +0 -0
- casadi/libquadmath-0.dll +0 -0
- casadi/libsipopt-3.dll +0 -0
- casadi/libsipopt.dll.a +0 -0
- casadi/libsipopt.la +41 -0
- casadi/libsleqp.dll +0 -0
- casadi/libsleqp.dll.a +0 -0
- casadi/libspral.a +0 -0
- casadi/libssp-0.dll +0 -0
- casadi/libstdc++-6.dll +0 -0
- casadi/libsuperscs.a +0 -0
- casadi/libtrlib.dll +0 -0
- casadi/libtrlib.dll.a +0 -0
- casadi/libwinpthread-1.dll +0 -0
- casadi/libzip.a +0 -0
- casadi/libzlib.dll +0 -0
- casadi/libzlib.dll.a +0 -0
- casadi/libzlibstatic.a +0 -0
- casadi/matlab_ipc.lib +0 -0
- casadi/osqp.lib +0 -0
- casadi/pkgconfig/blas.pc +11 -0
- casadi/pkgconfig/bonmin.pc +12 -0
- casadi/pkgconfig/casadi.pc +12 -0
- casadi/pkgconfig/cbc.pc +12 -0
- casadi/pkgconfig/cgl.pc +12 -0
- casadi/pkgconfig/clp.pc +12 -0
- casadi/pkgconfig/coinmetis.pc +13 -0
- casadi/pkgconfig/coinmumps.pc +15 -0
- casadi/pkgconfig/coinutils.pc +12 -0
- casadi/pkgconfig/highs.pc +12 -0
- casadi/pkgconfig/ipopt.pc +15 -0
- casadi/pkgconfig/lapack.pc +11 -0
- casadi/pkgconfig/libzip.pc +14 -0
- casadi/pkgconfig/openblas.pc +11 -0
- casadi/pkgconfig/osi-cbc.pc +12 -0
- casadi/pkgconfig/osi-clp.pc +12 -0
- casadi/pkgconfig/osi-unittests.pc +12 -0
- casadi/pkgconfig/osi.pc +12 -0
- casadi/pkgconfig/proxsuite.pc +22 -0
- casadi/pkgconfig/sleqp.pc +10 -0
- casadi/sleqp.lib +0 -0
- casadi/spral_ssids.exe +0 -0
- casadi/std-e414687e404555e5.dll +0 -0
- casadi/tools/__init__.py +54 -0
- casadi/tools/bounds.py +107 -0
- casadi/tools/graph/__init__.py +35 -0
- casadi/tools/graph/graph.py +747 -0
- casadi/tools/in_out.py +89 -0
- casadi/tools/structure3.py +1441 -0
- casadi-3.7.2.dist-info/METADATA +45 -0
- casadi-3.7.2.dist-info/RECORD +2398 -0
- casadi-3.7.2.dist-info/WHEEL +4 -0
- dummy.txt +1 -0
@@ -0,0 +1,4920 @@
|
|
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
|
+
|
27
|
+
%module(package="casadi",directors=1) casadi
|
28
|
+
|
29
|
+
#ifdef CASADI_WITH_COPYSIGN_UNDEF
|
30
|
+
%{
|
31
|
+
#ifdef copysign
|
32
|
+
#undef copysign
|
33
|
+
#endif
|
34
|
+
%}
|
35
|
+
#endif // CASADI_WITH_COPYSIGN_UNDEF
|
36
|
+
|
37
|
+
// Include all public CasADi C++
|
38
|
+
%{
|
39
|
+
#include <casadi/casadi.hpp>
|
40
|
+
#include <casadi/core/casadi_interrupt.hpp>
|
41
|
+
%}
|
42
|
+
|
43
|
+
// casadi_int type
|
44
|
+
%include <casadi/core/casadi_types.hpp>
|
45
|
+
|
46
|
+
/// Data structure in the target language holding data
|
47
|
+
#ifdef SWIGPYTHON
|
48
|
+
#define GUESTOBJECT PyObject
|
49
|
+
#elif defined(SWIGMATLAB)
|
50
|
+
#define GUESTOBJECT mxArray
|
51
|
+
#else
|
52
|
+
#define GUESTOBJECT void
|
53
|
+
#endif
|
54
|
+
|
55
|
+
// Define printing routine
|
56
|
+
|
57
|
+
#ifdef SWIGPYTHON
|
58
|
+
|
59
|
+
#ifdef CASADI_WITH_PYTHON_GIL_RELEASE
|
60
|
+
%{
|
61
|
+
// This .cxx was swig-compiled with WITH_PYTHON_GIL_RELEASE option
|
62
|
+
#define CASADI_WITH_PYTHON_GIL_RELEASE
|
63
|
+
%}
|
64
|
+
#else //CASADI_WITH_PYTHON_GIL_RELEASE
|
65
|
+
%{
|
66
|
+
// This .cxx was swig-compiled without WITH_PYTHON_GIL_RELEASE option
|
67
|
+
#undef CASADI_WITH_PYTHON_GIL_RELEASE
|
68
|
+
%}
|
69
|
+
#endif //CASADI_WITH_PYTHON_GIL_RELEASE
|
70
|
+
|
71
|
+
%ignore CASADI_SWIG_FLAGS;
|
72
|
+
%include "swig_config.h"
|
73
|
+
|
74
|
+
%{
|
75
|
+
namespace casadi {
|
76
|
+
|
77
|
+
// Redirect printout
|
78
|
+
static void pythonlogger(const char* s, std::streamsize num, bool error) {
|
79
|
+
#ifndef CASADI_WITH_PYTHON_GIL_RELEASE
|
80
|
+
if (!casadi::InterruptHandler::is_main_thread()) {
|
81
|
+
casadi::Logger::writeDefault(s, num, error);
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
85
|
+
int n = num;
|
86
|
+
#ifdef CASADI_WITH_PYTHON_GIL_RELEASE
|
87
|
+
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
88
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
89
|
+
while (n>0) {
|
90
|
+
if (error) {
|
91
|
+
PySys_WriteStderr("%.*s", std::min(n, 1000), s);
|
92
|
+
} else {
|
93
|
+
PySys_WriteStdout("%.*s", std::min(n, 1000), s);
|
94
|
+
}
|
95
|
+
n -= 1000;
|
96
|
+
s += 1000;
|
97
|
+
}
|
98
|
+
#ifdef CASADI_WITH_PYTHON_GIL_RELEASE
|
99
|
+
SWIG_PYTHON_THREAD_END_BLOCK;
|
100
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
101
|
+
}
|
102
|
+
|
103
|
+
static bool pythoncheckinterrupted() {
|
104
|
+
if (!casadi::InterruptHandler::is_main_thread()) return false;
|
105
|
+
#ifdef CASADI_WITH_PYTHON_GIL_RELEASE
|
106
|
+
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
107
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
108
|
+
return PyErr_CheckSignals();
|
109
|
+
// SWIG_PYTHON_THREAD_END_BLOCK is not needed, destructor will release GIL
|
110
|
+
}
|
111
|
+
|
112
|
+
std::string python_string_to_std_string(PyObject *str_py) {
|
113
|
+
#if SWIG_VERSION < 0x040200
|
114
|
+
const char *str_char = SWIG_Python_str_AsChar(str_py);
|
115
|
+
std::string str(str_char);
|
116
|
+
SWIG_Python_str_DelForPy3(str_char);
|
117
|
+
#else
|
118
|
+
PyObject *bytes = NULL;
|
119
|
+
std::string str(SWIG_PyUnicode_AsUTF8AndSize(str_py, NULL, &bytes));
|
120
|
+
Py_XDECREF(bytes);
|
121
|
+
#endif
|
122
|
+
return str;
|
123
|
+
}
|
124
|
+
|
125
|
+
void handle_director_exception() {
|
126
|
+
std::string msg = "Exception in SWIG director ";
|
127
|
+
// Note: CASADI_WITH_PYTHON_GIL_RELEASE case has SWIG_PYTHON_THREAD_BEGIN_BLOCK in the caller
|
128
|
+
#ifndef CASADI_WITH_PYTHON_GIL_RELEASE
|
129
|
+
SWIG_PYTHON_THREAD_BEGIN_BLOCK;
|
130
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
131
|
+
if (PyErr_ExceptionMatches(PyExc_KeyboardInterrupt)) {
|
132
|
+
PyErr_Clear();
|
133
|
+
#ifndef CASADI_WITH_PYTHON_GIL_RELEASE
|
134
|
+
SWIG_PYTHON_THREAD_END_BLOCK;
|
135
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
136
|
+
throw casadi::KeyboardInterruptException();
|
137
|
+
}
|
138
|
+
PyObject *ptype, *pvalue, *ptraceback;
|
139
|
+
PyErr_Fetch(&ptype, &pvalue, &ptraceback);
|
140
|
+
PyObject* msg_py = PyObject_Str(pvalue);
|
141
|
+
msg = python_string_to_std_string(msg_py);
|
142
|
+
Py_DECREF(msg_py);
|
143
|
+
PyErr_Restore(ptype, pvalue, ptraceback);
|
144
|
+
PyErr_Print();
|
145
|
+
#ifndef CASADI_WITH_PYTHON_GIL_RELEASE
|
146
|
+
SWIG_PYTHON_THREAD_END_BLOCK;
|
147
|
+
#endif // CASADI_WITH_PYTHON_GIL_RELEASE
|
148
|
+
casadi_error(msg.c_str());
|
149
|
+
}
|
150
|
+
}
|
151
|
+
|
152
|
+
%}
|
153
|
+
%init %{
|
154
|
+
// Set logger functions
|
155
|
+
casadi::Logger::writeFun = casadi::pythonlogger;
|
156
|
+
|
157
|
+
// @jgillis: please document
|
158
|
+
casadi::InterruptHandler::checkInterrupted = casadi::pythoncheckinterrupted;
|
159
|
+
|
160
|
+
casadi::InterruptHandler::is_main_thread();
|
161
|
+
|
162
|
+
%}
|
163
|
+
#elif defined(SWIGMATLAB)
|
164
|
+
%{
|
165
|
+
namespace casadi {
|
166
|
+
// Redirect printout to mexPrintf
|
167
|
+
static void mexlogger(const char* s, std::streamsize num, bool error) {
|
168
|
+
if (!casadi::InterruptHandler::is_main_thread()) {
|
169
|
+
casadi::Logger::writeDefault(s, num, error);
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
mexPrintf("%.*s", static_cast<int>(num), s);
|
173
|
+
}
|
174
|
+
|
175
|
+
#ifdef HAVE_OCTAVE
|
176
|
+
// Flush the command window buffer (needed in gui mode)
|
177
|
+
static void mexflush(bool error) {
|
178
|
+
}
|
179
|
+
// Never for Octave
|
180
|
+
static bool mexcheckinterrupted() {
|
181
|
+
return false;
|
182
|
+
}
|
183
|
+
void mexclearinterrupted() {
|
184
|
+
|
185
|
+
}
|
186
|
+
#else
|
187
|
+
// Undocumented matlab feature
|
188
|
+
extern "C" bool utIsInterruptPending(void);
|
189
|
+
extern "C" void utSetInterruptPending(bool);
|
190
|
+
|
191
|
+
static bool mexcheckinterrupted() {
|
192
|
+
if (!casadi::InterruptHandler::is_main_thread()) return false;
|
193
|
+
return utIsInterruptPending();
|
194
|
+
}
|
195
|
+
|
196
|
+
void mexclearinterrupted() {
|
197
|
+
utSetInterruptPending(false);
|
198
|
+
}
|
199
|
+
|
200
|
+
// Flush the command window buffer (needed in gui mode)
|
201
|
+
static void mexflush(bool error) {
|
202
|
+
if (!casadi::InterruptHandler::is_main_thread()) {
|
203
|
+
casadi::Logger::flushDefault(error);
|
204
|
+
return;
|
205
|
+
}
|
206
|
+
if (!mexcheckinterrupted()) {
|
207
|
+
if (mexEvalString("drawnow('update');pause(0.0001);")) {
|
208
|
+
utSetInterruptPending(true);
|
209
|
+
}
|
210
|
+
}
|
211
|
+
}
|
212
|
+
#endif
|
213
|
+
|
214
|
+
}
|
215
|
+
%}
|
216
|
+
%init %{
|
217
|
+
// Get full path
|
218
|
+
mxArray *fullpath, *fullpath_cmd = mxCreateString("fullpath");
|
219
|
+
mexCallMATLAB(1, &fullpath, 1, &fullpath_cmd, "mfilename");
|
220
|
+
mxDestroyArray(fullpath_cmd);
|
221
|
+
std::string path = mxArrayToString(fullpath);
|
222
|
+
mxDestroyArray(fullpath);
|
223
|
+
|
224
|
+
// Get file separator
|
225
|
+
mxArray *filesep;
|
226
|
+
mexCallMATLAB(1, &filesep, 0, 0, "filesep");
|
227
|
+
std::string sep = mxArrayToString(filesep);
|
228
|
+
mxDestroyArray(filesep);
|
229
|
+
|
230
|
+
// Truncate at separator
|
231
|
+
path = path.substr(0, path.rfind(sep));
|
232
|
+
|
233
|
+
// Octave-on-Windows seems to pick up superfluous +casadi
|
234
|
+
// Make sure we exclude it
|
235
|
+
if (path.rfind(sep)!=std::string::npos && path.substr(path.rfind(sep)+1)=="+casadi")
|
236
|
+
path = path.substr(0, path.rfind(sep));
|
237
|
+
|
238
|
+
// Set library path
|
239
|
+
casadi::GlobalOptions::setCasadiPath(path);
|
240
|
+
casadi::GlobalOptions::setCasadiIncludePath(path+sep+"include");
|
241
|
+
|
242
|
+
// Matlab is index-one based
|
243
|
+
casadi::GlobalOptions::start_index = 1;
|
244
|
+
|
245
|
+
// @jgillis: please document
|
246
|
+
mxArray *warning_rhs[] = {mxCreateString("error"),
|
247
|
+
|
248
|
+
mxCreateString("SWIG:OverloadError")};
|
249
|
+
mexCallMATLAB(0, 0, 2, warning_rhs, "warning");
|
250
|
+
mxDestroyArray(warning_rhs[0]);
|
251
|
+
mxDestroyArray(warning_rhs[1]);
|
252
|
+
|
253
|
+
|
254
|
+
// Set logger functions
|
255
|
+
casadi::Logger::writeFun = casadi::mexlogger;
|
256
|
+
casadi::Logger::flush = casadi::mexflush;
|
257
|
+
|
258
|
+
// @jgillis: please document
|
259
|
+
casadi::InterruptHandler::checkInterrupted = casadi::mexcheckinterrupted;
|
260
|
+
casadi::InterruptHandler::clearInterrupted = casadi::mexclearinterrupted;
|
261
|
+
|
262
|
+
casadi::InterruptHandler::is_main_thread();
|
263
|
+
|
264
|
+
%}
|
265
|
+
#endif
|
266
|
+
|
267
|
+
// Turn off the warnings that certain methods are effectively ignored, this seams to be a false warning,
|
268
|
+
// for example vertcat(SXVector), vertcat(DMVector) and vertcat(MXVector) appears to work fine
|
269
|
+
#pragma SWIG nowarn=509,303,302
|
270
|
+
|
271
|
+
#define CASADI_EXPORT
|
272
|
+
|
273
|
+
// Incude cmath early on, see #622
|
274
|
+
%begin %{
|
275
|
+
#include <cmath>
|
276
|
+
#ifdef _XOPEN_SOURCE
|
277
|
+
#undef _XOPEN_SOURCE
|
278
|
+
#endif
|
279
|
+
#ifdef _POSIX_C_SOURCE
|
280
|
+
#undef _POSIX_C_SOURCE
|
281
|
+
#endif
|
282
|
+
%}
|
283
|
+
|
284
|
+
%ignore *::operator->;
|
285
|
+
|
286
|
+
%rename(str) get_str;
|
287
|
+
|
288
|
+
%begin %{
|
289
|
+
#define SWIG_PYTHON_OUTPUT_TUPLE
|
290
|
+
%}
|
291
|
+
|
292
|
+
#ifdef SWIGPYTHON
|
293
|
+
%pythoncode %{
|
294
|
+
|
295
|
+
import contextlib
|
296
|
+
|
297
|
+
class _copyableObject(object):
|
298
|
+
def __copy__(self):
|
299
|
+
return self.__class__(self)
|
300
|
+
|
301
|
+
def __deepcopy__(self,dummy=None):
|
302
|
+
return self.__class__(self)
|
303
|
+
|
304
|
+
_object = object = _copyableObject
|
305
|
+
|
306
|
+
_swig_repr_default = _swig_repr
|
307
|
+
def _swig_repr(self):
|
308
|
+
if hasattr(self,'repr'):
|
309
|
+
return self.repr()
|
310
|
+
else:
|
311
|
+
return _swig_repr_default(self)
|
312
|
+
|
313
|
+
def DM_from_array(m, check_only=True):
|
314
|
+
import numpy as np
|
315
|
+
if isinstance(m, np.ndarray):
|
316
|
+
if len(m.shape)>2:
|
317
|
+
return False
|
318
|
+
try:
|
319
|
+
m = m.astype(float,casting="same_kind",copy=False)
|
320
|
+
except:
|
321
|
+
return False
|
322
|
+
if check_only:
|
323
|
+
return True
|
324
|
+
else:
|
325
|
+
shape = m.shape + (1, 1)
|
326
|
+
nrow, ncol = shape[0], shape[1]
|
327
|
+
return (nrow,ncol,m.flat)
|
328
|
+
return False
|
329
|
+
|
330
|
+
def IM_from_array(m, check_only=True):
|
331
|
+
import numpy as np
|
332
|
+
if isinstance(m, np.ndarray):
|
333
|
+
if len(m.shape)>2:
|
334
|
+
return False
|
335
|
+
try:
|
336
|
+
m = m.astype(int,casting="same_kind",copy=False)
|
337
|
+
except:
|
338
|
+
return False
|
339
|
+
if check_only:
|
340
|
+
return True
|
341
|
+
else:
|
342
|
+
shape = m.shape + (1, 1)
|
343
|
+
nrow, ncol = shape[0], shape[1]
|
344
|
+
return (nrow,ncol,m.flat)
|
345
|
+
return False
|
346
|
+
|
347
|
+
def SX_from_array(m, check_only=True):
|
348
|
+
import numpy as np
|
349
|
+
if isinstance(m, np.ndarray):
|
350
|
+
if len(m.shape)>2:
|
351
|
+
return False
|
352
|
+
if m.dtype!=object: return None
|
353
|
+
shape = m.shape + (1, 1)
|
354
|
+
nrow, ncol = shape[0], shape[1]
|
355
|
+
return (nrow,ncol,m.flat)
|
356
|
+
return False
|
357
|
+
|
358
|
+
def DM_from_csc(m, check_only=True):
|
359
|
+
if hasattr(m,"tocsc"):
|
360
|
+
m = m.tocsc()
|
361
|
+
if m.__class__.__name__ == "csc_matrix":
|
362
|
+
if len(m.shape)!=2: return False
|
363
|
+
if check_only: return True
|
364
|
+
return m.shape + (m.indptr.flat,m.indices.flat,m.data.flat)
|
365
|
+
return False
|
366
|
+
|
367
|
+
%}
|
368
|
+
#endif // WITH_SWIGPYTHON
|
369
|
+
|
370
|
+
|
371
|
+
// These are the following styles
|
372
|
+
// error
|
373
|
+
// overview
|
374
|
+
// group
|
375
|
+
|
376
|
+
%feature("autodoc", "1");
|
377
|
+
|
378
|
+
%feature("customdoc", "1");
|
379
|
+
|
380
|
+
%feature("customdoc:arg:self", "self");
|
381
|
+
|
382
|
+
#if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
|
383
|
+
#define MNAME "$NAME"
|
384
|
+
%feature("customdoc:proto:constructor", "new_obj = $NAME($in)");
|
385
|
+
%feature("customdoc:proto:single_out", "$out = $NAME($in)");
|
386
|
+
%feature("customdoc:proto:normal", "[$out] = $NAME($in)");
|
387
|
+
%feature("customdoc:main", " $NAME $brief\n\n$overview\n$main");
|
388
|
+
#else
|
389
|
+
#define MNAME "$name"
|
390
|
+
%feature("customdoc:proto:constructor", "$name($in)");
|
391
|
+
%feature("customdoc:proto:single_out", "$name($in) -> $out");
|
392
|
+
%feature("customdoc:proto:normal", "$name($in) -> ($out)");
|
393
|
+
%feature("customdoc:main", " $brief\n\n::\n\n$overview\n$main");
|
394
|
+
#endif
|
395
|
+
|
396
|
+
%feature("customdoc:arg:normal:style_error", "$type");
|
397
|
+
%feature("customdoc:arg:only:style_error", "$type");
|
398
|
+
%feature("customdoc:arg:separator:style_error", ",");
|
399
|
+
%feature("customdoc:proto:void:style_error", MNAME "($in)");
|
400
|
+
%feature("customdoc:proto:single_out:style_error", MNAME "($in)");
|
401
|
+
%feature("customdoc:proto:normal:style_error", MNAME "($in)");
|
402
|
+
%feature("customdoc:proto:constructor:style_error", MNAME "($in)");
|
403
|
+
|
404
|
+
%feature("customdoc:arg:normal", "$type $name");
|
405
|
+
%feature("customdoc:arg:only", "$type $name");
|
406
|
+
%feature("customdoc:arg:only:out", "$type");
|
407
|
+
%feature("customdoc:arg:no_name", "out$ip");
|
408
|
+
%feature("customdoc:arg:separator", ", ");
|
409
|
+
|
410
|
+
|
411
|
+
%feature("customdoc:proto:void", MNAME "($in)");
|
412
|
+
%feature("customdoc:proto:single_out:style_group", MNAME "($in)");
|
413
|
+
%feature("customdoc:proto:normal:style_group", MNAME "($in)");
|
414
|
+
%feature("customdoc:proto:constructor:style_group", MNAME "($in)");
|
415
|
+
|
416
|
+
%feature("customdoc:protoline", " $proto");
|
417
|
+
%feature("customdoc:protoline:style_overview", " $proto");
|
418
|
+
%feature("customdoc:protoline:nobrief:style_overview", " $proto");
|
419
|
+
|
420
|
+
%feature("customdoc:protoline:style_group", " $proto");
|
421
|
+
|
422
|
+
%feature("customdoc:group", "\n.......\n\n::\n\n$group\n$main\n\n.............\n\n");
|
423
|
+
|
424
|
+
// append works for strings
|
425
|
+
|
426
|
+
%naturalvar;
|
427
|
+
|
428
|
+
// Make data members read-only
|
429
|
+
%immutable;
|
430
|
+
|
431
|
+
// Make sure that a copy constructor is created
|
432
|
+
%copyctor;
|
433
|
+
|
434
|
+
#ifndef SWIGXML
|
435
|
+
%feature("compactdefaultargs","1");
|
436
|
+
//%feature("compactdefaultargs","0") casadi::taylor; // taylor function has a default argument for which the namespace is not recognised by SWIG
|
437
|
+
%feature("compactdefaultargs","0") casadi::Function::generateCode; // buggy
|
438
|
+
#endif //SWIGXML
|
439
|
+
|
440
|
+
// STL
|
441
|
+
#ifdef SWIGXML
|
442
|
+
namespace std {
|
443
|
+
template<class T> class vector {};
|
444
|
+
template<class A, class B> class pair {};
|
445
|
+
template<class A, class B> class map {};
|
446
|
+
}
|
447
|
+
#else // SWIGXML
|
448
|
+
%include "stl.i"
|
449
|
+
#endif // SWIGXML
|
450
|
+
|
451
|
+
%include "doc.i"
|
452
|
+
|
453
|
+
|
454
|
+
// Note: Only from 3.0.0 onwards,
|
455
|
+
// DirectorException inherits from std::exception
|
456
|
+
#if SWIG_VERSION >= 0x030000
|
457
|
+
// Exceptions handling
|
458
|
+
%include "exception.i"
|
459
|
+
%exception {
|
460
|
+
try {
|
461
|
+
$action
|
462
|
+
} catch(const std::exception& e) {
|
463
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
464
|
+
}
|
465
|
+
}
|
466
|
+
|
467
|
+
// Python sometimes takes an approach to not check, but just try.
|
468
|
+
// It expects a python error to be thrown.
|
469
|
+
%exception __int__ {
|
470
|
+
try {
|
471
|
+
$action
|
472
|
+
} catch (const std::exception& e) {
|
473
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
474
|
+
}
|
475
|
+
}
|
476
|
+
|
477
|
+
#ifdef WITH_PYTHON3
|
478
|
+
// See https://github.com/casadi/casadi/issues/701
|
479
|
+
// Recent numpys will only catch TypeError or ValueError in printing logic
|
480
|
+
%exception __bool__ {
|
481
|
+
try {
|
482
|
+
$action
|
483
|
+
} catch (const std::exception& e) {
|
484
|
+
SWIG_exception(SWIG_TypeError, e.what());
|
485
|
+
}
|
486
|
+
}
|
487
|
+
#else
|
488
|
+
%exception __nonzero__ {
|
489
|
+
try {
|
490
|
+
$action
|
491
|
+
} catch (const std::exception& e) {
|
492
|
+
SWIG_exception(SWIG_TypeError, e.what());
|
493
|
+
}
|
494
|
+
}
|
495
|
+
#endif
|
496
|
+
#else
|
497
|
+
// Exceptions handling
|
498
|
+
%include "exception.i"
|
499
|
+
%exception {
|
500
|
+
try {
|
501
|
+
$action
|
502
|
+
} catch(const std::exception& e) {
|
503
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
504
|
+
} catch (const Swig::DirectorException& e) {
|
505
|
+
SWIG_exception(SWIG_TypeError, e.getMessage());
|
506
|
+
}
|
507
|
+
}
|
508
|
+
|
509
|
+
// Python sometimes takes an approach to not check, but just try.
|
510
|
+
// It expects a python error to be thrown.
|
511
|
+
%exception __int__ {
|
512
|
+
try {
|
513
|
+
$action
|
514
|
+
} catch (const std::exception& e) {
|
515
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
516
|
+
} catch (const Swig::DirectorException& e) {
|
517
|
+
SWIG_exception(SWIG_TypeError, e.getMessage());
|
518
|
+
}
|
519
|
+
}
|
520
|
+
|
521
|
+
#ifdef WITH_PYTHON3
|
522
|
+
// See https://github.com/casadi/casadi/issues/701
|
523
|
+
// Recent numpys will only catch TypeError or ValueError in printing logic
|
524
|
+
%exception __bool__ {
|
525
|
+
try {
|
526
|
+
$action
|
527
|
+
} catch (const std::exception& e) {
|
528
|
+
SWIG_exception(SWIG_TypeError, e.what());
|
529
|
+
} catch (const Swig::DirectorException& e) {
|
530
|
+
SWIG_exception(SWIG_TypeError, e.getMessage());
|
531
|
+
}
|
532
|
+
}
|
533
|
+
#else
|
534
|
+
%exception __nonzero__ {
|
535
|
+
try {
|
536
|
+
$action
|
537
|
+
} catch (const std::exception& e) {
|
538
|
+
SWIG_exception(SWIG_TypeError, e.what());
|
539
|
+
}
|
540
|
+
catch (const Swig::DirectorException& e) {
|
541
|
+
SWIG_exception(SWIG_TypeError, e.getMessage());
|
542
|
+
}
|
543
|
+
}
|
544
|
+
#endif
|
545
|
+
#endif
|
546
|
+
|
547
|
+
#ifdef SWIGPYTHON
|
548
|
+
%feature("director:except") {
|
549
|
+
if ($error != NULL) casadi::handle_director_exception();
|
550
|
+
}
|
551
|
+
#endif //SWIGPYTHON
|
552
|
+
|
553
|
+
|
554
|
+
#ifdef SWIGPYTHON
|
555
|
+
|
556
|
+
%{
|
557
|
+
#define SWIG_FILE_WITH_INIT
|
558
|
+
%}
|
559
|
+
|
560
|
+
#endif // SWIGPYTHON
|
561
|
+
|
562
|
+
%{
|
563
|
+
#define SWIG_Error_return(code, msg) { std::cerr << "Error occured in CasADi SWIG interface code:" << std::endl << " "<< msg << std::endl;SWIG_Error(code, msg); return 0; }
|
564
|
+
%}
|
565
|
+
|
566
|
+
#ifndef SWIGXML
|
567
|
+
|
568
|
+
// Can be overloaded by specifying before importing casadi.i
|
569
|
+
%fragment("casadi_extra_decl", "header") {}
|
570
|
+
|
571
|
+
%fragment("casadi_decl", "header",fragment="casadi_extra_decl") {
|
572
|
+
namespace casadi {
|
573
|
+
/* Check if Null or None */
|
574
|
+
bool is_null(GUESTOBJECT *p);
|
575
|
+
|
576
|
+
/* Typemaps from CasADi types to types in the interfaced language:
|
577
|
+
*
|
578
|
+
* to_ptr: Converts a pointer in interfaced language to C++:
|
579
|
+
* Input: GUESTOBJECT pointer p
|
580
|
+
* Output: Pointer to pointer: At input, pointer to pointer to temporary
|
581
|
+
* The routine will either:
|
582
|
+
* - Do nothing, if 0
|
583
|
+
* - Change the pointer
|
584
|
+
* - Change the temporary object
|
585
|
+
* Returns true upon success, else false
|
586
|
+
*
|
587
|
+
* from_ptr: Converts result from CasADi to interfaced language
|
588
|
+
*/
|
589
|
+
|
590
|
+
// Basic types
|
591
|
+
bool to_ptr(GUESTOBJECT *p, bool** m);
|
592
|
+
GUESTOBJECT* from_ptr(const bool *a);
|
593
|
+
bool to_ptr(GUESTOBJECT *p, casadi_int** m);
|
594
|
+
GUESTOBJECT* from_ptr(const casadi_int *a);
|
595
|
+
bool to_ptr(GUESTOBJECT *p, double** m);
|
596
|
+
GUESTOBJECT* from_ptr(const double *a);
|
597
|
+
bool to_ptr(GUESTOBJECT *p, std::string** m);
|
598
|
+
GUESTOBJECT* from_ptr(const std::string *a);
|
599
|
+
|
600
|
+
// std::vector
|
601
|
+
#ifdef SWIGMATLAB
|
602
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<double> **m);
|
603
|
+
GUESTOBJECT* from_ptr(const std::vector<double> *a);
|
604
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<casadi_int>** m);
|
605
|
+
GUESTOBJECT* from_ptr(const std::vector<casadi_int> *a);
|
606
|
+
bool to_ptr(GUESTOBJECT *p, const std::vector<bool> **m);
|
607
|
+
GUESTOBJECT* from_ptr(const std::vector<bool> *a);
|
608
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<std::string>** m);
|
609
|
+
GUESTOBJECT* from_ptr(const std::vector<std::string> *a);
|
610
|
+
#endif // SWIGMATLAB
|
611
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector<M>** m);
|
612
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector< std::vector<M> >** m);
|
613
|
+
template<typename M> GUESTOBJECT* from_ptr(const std::vector<M> *a);
|
614
|
+
|
615
|
+
// std::pair
|
616
|
+
#ifdef SWIGMATLAB
|
617
|
+
bool to_ptr(GUESTOBJECT *p, std::pair<casadi_int, casadi_int>** m);
|
618
|
+
GUESTOBJECT* from_ptr(const std::pair<casadi_int, casadi_int>* a);
|
619
|
+
#endif // SWIGMATLAB
|
620
|
+
template<typename M1, typename M2> bool to_ptr(GUESTOBJECT *p, std::pair<M1, M2>** m);
|
621
|
+
template<typename M1, typename M2> GUESTOBJECT* from_ptr(const std::pair<M1, M2>* a);
|
622
|
+
|
623
|
+
// std::map
|
624
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::map<std::string, M>** m);
|
625
|
+
template<typename M> GUESTOBJECT* from_ptr(const std::map<std::string, M> *a);
|
626
|
+
|
627
|
+
// Slice
|
628
|
+
bool to_ptr(GUESTOBJECT *p, casadi::Slice** m);
|
629
|
+
GUESTOBJECT* from_ptr(const casadi::Slice *a);
|
630
|
+
|
631
|
+
// Sparsity
|
632
|
+
bool to_ptr(GUESTOBJECT *p, casadi::Sparsity** m);
|
633
|
+
GUESTOBJECT* from_ptr(const casadi::Sparsity *a);
|
634
|
+
|
635
|
+
// Matrix<>
|
636
|
+
bool to_ptr(GUESTOBJECT *p, casadi::DM** m);
|
637
|
+
GUESTOBJECT* from_ptr(const casadi::DM *a);
|
638
|
+
bool to_ptr(GUESTOBJECT *p, casadi::IM** m);
|
639
|
+
GUESTOBJECT* from_ptr(const casadi::IM *a);
|
640
|
+
bool to_ptr(GUESTOBJECT *p, casadi::SX** m);
|
641
|
+
GUESTOBJECT* from_ptr(const casadi::SX *a);
|
642
|
+
|
643
|
+
// MX
|
644
|
+
bool to_ptr(GUESTOBJECT *p, casadi::MX** m);
|
645
|
+
GUESTOBJECT* from_ptr(const casadi::MX *a);
|
646
|
+
|
647
|
+
// Function
|
648
|
+
bool to_ptr(GUESTOBJECT *p, casadi::Function** m);
|
649
|
+
GUESTOBJECT* from_ptr(const casadi::Function *a);
|
650
|
+
|
651
|
+
// SXElem
|
652
|
+
bool to_ptr(GUESTOBJECT *p, casadi::SXElem** m);
|
653
|
+
GUESTOBJECT* from_ptr(const casadi::SXElem *a);
|
654
|
+
|
655
|
+
// GenericType
|
656
|
+
bool to_ptr(GUESTOBJECT *p, casadi::GenericType** m);
|
657
|
+
GUESTOBJECT* from_ptr(const casadi::GenericType *a);
|
658
|
+
|
659
|
+
// Same as to_ptr, but with pointer instead of pointer to pointer
|
660
|
+
template<typename M> bool to_val(GUESTOBJECT *p, M* m);
|
661
|
+
|
662
|
+
// Check if conversion is possible
|
663
|
+
template<typename M> bool can_convert(GUESTOBJECT *p) { return to_ptr(p, static_cast<M**>(0));}
|
664
|
+
|
665
|
+
// Same as the above, but with reference instead of pointer
|
666
|
+
template<typename M> GUESTOBJECT* from_ref(const M& m) { return from_ptr(&m);}
|
667
|
+
|
668
|
+
// Specialization for std::vectors of booleans
|
669
|
+
GUESTOBJECT* from_ref(std::vector<bool>::const_reference m) {
|
670
|
+
bool tmp = m;
|
671
|
+
return from_ptr(&tmp);
|
672
|
+
}
|
673
|
+
|
674
|
+
// Same as the above, but with a temporary object
|
675
|
+
template<typename M> GUESTOBJECT* from_tmp(M m) { return from_ptr(&m);}
|
676
|
+
#ifdef SWIGMATLAB
|
677
|
+
// Get sparsity pattern
|
678
|
+
Sparsity get_sparsity(const mxArray* p);
|
679
|
+
|
680
|
+
// Number of nonzeros
|
681
|
+
size_t getNNZ(const mxArray* p);
|
682
|
+
#endif // SWIGMATLAB
|
683
|
+
|
684
|
+
GUESTOBJECT* full(const DM& m, bool simplify=false) {
|
685
|
+
#ifdef SWIGPYTHON
|
686
|
+
PyObject *p = from_ptr(&m);
|
687
|
+
PyObject *method_name = PyString_FromString("toarray");
|
688
|
+
PyObject *cr = PyObject_CallMethodObjArgs(p, method_name, (simplify? Py_True: Py_False), 0);
|
689
|
+
Py_DECREF(method_name);
|
690
|
+
Py_DECREF(p);
|
691
|
+
if (cr) return cr;
|
692
|
+
return Py_None;
|
693
|
+
#elif defined(SWIGMATLAB)
|
694
|
+
mxArray *p = mxCreateDoubleMatrix(m.size1(), m.size2(), mxREAL);
|
695
|
+
double* d = static_cast<double*>(mxGetData(p));
|
696
|
+
casadi_densify(m.ptr(), m.sparsity(), d, false); // Column-major
|
697
|
+
return p;
|
698
|
+
#else
|
699
|
+
return 0;
|
700
|
+
#endif
|
701
|
+
}
|
702
|
+
|
703
|
+
|
704
|
+
// Convert to a sparse matrix
|
705
|
+
GUESTOBJECT* sparse(const DM& m) {
|
706
|
+
#ifdef SWIGPYTHON
|
707
|
+
PyObject *p = from_ptr(&m);
|
708
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "tocsc", 0);
|
709
|
+
Py_DECREF(p);
|
710
|
+
if (cr) return cr;
|
711
|
+
return Py_None;
|
712
|
+
#elif defined(SWIGMATLAB)
|
713
|
+
mxArray *p = mxCreateSparse(m.size1(), m.size2(), m.nnz(), mxREAL);
|
714
|
+
casadi::casadi_copy(m.ptr(), m.nnz(), static_cast<double*>(mxGetData(p)));
|
715
|
+
std::copy(m.colind(), m.colind()+m.size2()+1, mxGetJc(p));
|
716
|
+
std::copy(m.row(), m.row()+m.nnz(), mxGetIr(p));
|
717
|
+
return p;
|
718
|
+
#else
|
719
|
+
return 0;
|
720
|
+
#endif
|
721
|
+
|
722
|
+
}
|
723
|
+
|
724
|
+
GUESTOBJECT* full_or_sparse(const DM& m, bool simplify=false) {
|
725
|
+
if (m.is_dense()) {
|
726
|
+
return full(m, simplify);
|
727
|
+
} else {
|
728
|
+
GUESTOBJECT* p = sparse(m);
|
729
|
+
if (is_null(p)) return from_ptr(&m);
|
730
|
+
return p;
|
731
|
+
}
|
732
|
+
}
|
733
|
+
#ifdef SWIGPYTHON
|
734
|
+
|
735
|
+
|
736
|
+
PyObject* get_Python_helper(const std::string& name) {
|
737
|
+
%#if PY_VERSION_HEX < 0x03070000
|
738
|
+
PyObject* module = PyImport_AddModule("casadi");
|
739
|
+
%#else
|
740
|
+
PyObject* c_name = PyString_FromString("casadi");
|
741
|
+
PyObject* module = PyImport_GetModule(c_name);
|
742
|
+
Py_DECREF(c_name);
|
743
|
+
%#endif
|
744
|
+
if (!module) {
|
745
|
+
if (PyErr_Occurred()) {
|
746
|
+
PyErr_Clear();
|
747
|
+
}
|
748
|
+
}
|
749
|
+
PyObject* dict = PyModule_GetDict(module);
|
750
|
+
return PyDict_GetItemString(dict, (char*) name.c_str());
|
751
|
+
}
|
752
|
+
|
753
|
+
template<class T>
|
754
|
+
bool casadi_object_from_fun(GUESTOBJECT *p, T** m, const std::string& fun, const std::function<bool(PyObject*, T**)> & conv) {
|
755
|
+
PyObject* dm = get_Python_helper(fun);
|
756
|
+
if (!dm) return false;
|
757
|
+
PyObject *check_only = m? Py_False : Py_True;
|
758
|
+
PyObject *cr = PyObject_CallFunctionObjArgs(dm, p, check_only, NULL);
|
759
|
+
if (!cr) return false;
|
760
|
+
bool ret;
|
761
|
+
if (PyBool_Check(cr)) {
|
762
|
+
ret = PyObject_IsTrue(cr);
|
763
|
+
} else {
|
764
|
+
ret = conv(cr, m);
|
765
|
+
}
|
766
|
+
Py_DECREF(cr);
|
767
|
+
return ret;
|
768
|
+
}
|
769
|
+
|
770
|
+
bool SX_from_array_conv(GUESTOBJECT *p, casadi::SX** m) {
|
771
|
+
std::vector<SXElem> data;
|
772
|
+
if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
|
773
|
+
casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
|
774
|
+
casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
|
775
|
+
if (m) {
|
776
|
+
**m = casadi::SX::zeros(nrow, ncol);
|
777
|
+
casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
|
778
|
+
}
|
779
|
+
return true;
|
780
|
+
}
|
781
|
+
|
782
|
+
bool IM_from_array_conv(GUESTOBJECT *p, casadi::IM** m) {
|
783
|
+
if (!m) return true;
|
784
|
+
std::vector<casadi_int> data;
|
785
|
+
if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
|
786
|
+
casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
|
787
|
+
casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
|
788
|
+
**m = IM::zeros(nrow, ncol);
|
789
|
+
casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
|
790
|
+
return true;
|
791
|
+
}
|
792
|
+
|
793
|
+
bool DM_from_array_conv(GUESTOBJECT *p, casadi::DM** m) {
|
794
|
+
if (!m) return true;
|
795
|
+
std::vector<double> data;
|
796
|
+
if (!to_val(PyTuple_GetItem(p, 2), &data)) return false;
|
797
|
+
casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
|
798
|
+
casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
|
799
|
+
**m = DM::zeros(nrow, ncol);
|
800
|
+
casadi_densify(get_ptr(data), (**m).sparsity().T(), (**m).ptr(), true);
|
801
|
+
return true;
|
802
|
+
}
|
803
|
+
|
804
|
+
bool DM_from_csc_conv(GUESTOBJECT *p, casadi::DM** m) {
|
805
|
+
std::vector<double> data;
|
806
|
+
std::vector<casadi_int> colind, row;
|
807
|
+
if (!to_val(PyTuple_GetItem(p, 4), &data)) return false;
|
808
|
+
if (!to_val(PyTuple_GetItem(p, 3), &row)) return false;
|
809
|
+
if (!to_val(PyTuple_GetItem(p, 2), &colind)) return false;
|
810
|
+
casadi_int nrow; to_val(PyTuple_GetItem(p, 0), &nrow);
|
811
|
+
casadi_int ncol; to_val(PyTuple_GetItem(p, 1), &ncol);
|
812
|
+
**m = casadi::Matrix<double>(casadi::Sparsity(nrow,ncol,colind,row), data, false);
|
813
|
+
return true;
|
814
|
+
}
|
815
|
+
|
816
|
+
bool SX_from_array(GUESTOBJECT *p, casadi::SX** m) {
|
817
|
+
return casadi_object_from_fun<casadi::SX>(p, m, "SX_from_array", SX_from_array_conv);
|
818
|
+
}
|
819
|
+
|
820
|
+
bool IM_from_array(GUESTOBJECT *p, casadi::IM** m) {
|
821
|
+
return casadi_object_from_fun<casadi::IM>(p, m, "IM_from_array", IM_from_array_conv);
|
822
|
+
}
|
823
|
+
|
824
|
+
bool DM_from_array(GUESTOBJECT *p, casadi::DM** m) {
|
825
|
+
return casadi_object_from_fun<casadi::DM>(p, m, "DM_from_array", DM_from_array_conv);
|
826
|
+
}
|
827
|
+
|
828
|
+
bool DM_from_csc(GUESTOBJECT *p, casadi::DM** m) {
|
829
|
+
return casadi_object_from_fun<casadi::DM>(p, m, "DM_from_csc", DM_from_csc_conv);
|
830
|
+
}
|
831
|
+
|
832
|
+
bool is_scalar_np_array(GUESTOBJECT *p) {
|
833
|
+
if (PyObject_HasAttrString(p, "__array__")) {
|
834
|
+
PyObject *cr = PyObject_GetAttrString(p, (char*) "size");
|
835
|
+
if (cr) {
|
836
|
+
casadi_int size;
|
837
|
+
casadi_int res = to_val(cr, &size);
|
838
|
+
Py_DECREF(cr);
|
839
|
+
if (!res) return false;
|
840
|
+
return size==1;
|
841
|
+
} else {
|
842
|
+
PyErr_Clear();
|
843
|
+
return false;
|
844
|
+
}
|
845
|
+
}
|
846
|
+
return false;
|
847
|
+
}
|
848
|
+
|
849
|
+
#endif
|
850
|
+
|
851
|
+
|
852
|
+
} // namespace CasADi
|
853
|
+
}
|
854
|
+
|
855
|
+
%fragment("casadi_aux", "header", fragment="casadi_decl") {
|
856
|
+
namespace casadi {
|
857
|
+
template<typename M> bool to_val(GUESTOBJECT *p, M* m) {
|
858
|
+
// Copy the pointer
|
859
|
+
M *m2 = m;
|
860
|
+
bool ret = to_ptr(p, m ? &m2 : 0);
|
861
|
+
// If pointer changed, copy the object
|
862
|
+
if (m!=m2) *m=*m2;
|
863
|
+
return ret;
|
864
|
+
}
|
865
|
+
|
866
|
+
// Same as to_ptr, but with GenericType
|
867
|
+
template<typename M> bool to_generic(GUESTOBJECT *p, GenericType** m) {
|
868
|
+
if (m) {
|
869
|
+
// Temporary
|
870
|
+
M tmp, *tmp_ptr=&tmp;
|
871
|
+
bool ret = to_ptr(p, &tmp_ptr);
|
872
|
+
if (!ret) return ret;
|
873
|
+
**m = GenericType(*tmp_ptr);
|
874
|
+
return ret;
|
875
|
+
} else {
|
876
|
+
return to_ptr(p, static_cast<M**>(0));
|
877
|
+
}
|
878
|
+
}
|
879
|
+
|
880
|
+
// Check if casadi_int
|
881
|
+
template<typename T> struct is_int {
|
882
|
+
static inline bool check() {return false;}
|
883
|
+
};
|
884
|
+
|
885
|
+
template<> struct is_int<casadi_int> {
|
886
|
+
static inline bool check() {return true;}
|
887
|
+
};
|
888
|
+
|
889
|
+
bool is_null(GUESTOBJECT *p) {
|
890
|
+
#ifdef SWIGPYTHON
|
891
|
+
if (p == Py_None) return true;
|
892
|
+
#endif
|
893
|
+
#ifdef SWIGMATLAB
|
894
|
+
if (p == 0) return true;
|
895
|
+
#endif
|
896
|
+
return false;
|
897
|
+
}
|
898
|
+
|
899
|
+
#ifdef SWIGMATLAB
|
900
|
+
Sparsity get_sparsity(const mxArray* p) {
|
901
|
+
// Get sparsity pattern
|
902
|
+
size_t nrow = mxGetM(p);
|
903
|
+
size_t ncol = mxGetN(p);
|
904
|
+
|
905
|
+
if (mxIsSparse(p)) {
|
906
|
+
// Sparse storage in MATLAB
|
907
|
+
mwIndex *Jc = mxGetJc(p);
|
908
|
+
mwIndex *Ir = mxGetIr(p);
|
909
|
+
|
910
|
+
// Store in vectors
|
911
|
+
std::vector<casadi_int> colind(ncol+1);
|
912
|
+
std::copy(Jc, Jc+colind.size(), colind.begin());
|
913
|
+
std::vector<casadi_int> row(colind.back());
|
914
|
+
std::copy(Ir, Ir+row.size(), row.begin());
|
915
|
+
|
916
|
+
// Create pattern and return
|
917
|
+
return Sparsity(nrow, ncol, colind, row);
|
918
|
+
} else {
|
919
|
+
return Sparsity::dense(nrow, ncol);
|
920
|
+
}
|
921
|
+
}
|
922
|
+
|
923
|
+
size_t getNNZ(const mxArray* p) {
|
924
|
+
// Dimensions
|
925
|
+
size_t nrow = mxGetM(p);
|
926
|
+
size_t ncol = mxGetN(p);
|
927
|
+
if (mxIsSparse(p)) {
|
928
|
+
// Sparse storage in MATLAB
|
929
|
+
mwIndex *Jc = mxGetJc(p);
|
930
|
+
return Jc[ncol];
|
931
|
+
} else {
|
932
|
+
return nrow*ncol;
|
933
|
+
}
|
934
|
+
}
|
935
|
+
#endif // SWIGMATLAB
|
936
|
+
} // namespace casadi
|
937
|
+
}
|
938
|
+
|
939
|
+
|
940
|
+
%fragment("casadi_bool", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(bool)) {
|
941
|
+
namespace casadi {
|
942
|
+
bool to_ptr(GUESTOBJECT *p, bool** m) {
|
943
|
+
// Treat Null
|
944
|
+
if (is_null(p)) return false;
|
945
|
+
|
946
|
+
// Standard typemaps
|
947
|
+
if (SWIG_IsOK(SWIG_AsVal(bool)(p, m ? *m : 0))) return true;
|
948
|
+
|
949
|
+
#ifdef SWIGMATLAB
|
950
|
+
if (mxIsLogicalScalar(p)) {
|
951
|
+
if (m) **m = mxIsLogicalScalarTrue(p);
|
952
|
+
return true;
|
953
|
+
}
|
954
|
+
#endif
|
955
|
+
|
956
|
+
// No match
|
957
|
+
return false;
|
958
|
+
}
|
959
|
+
|
960
|
+
GUESTOBJECT * from_ptr(const bool *a) {
|
961
|
+
#ifdef SWIGPYTHON
|
962
|
+
return PyBool_FromLong(*a);
|
963
|
+
#elif defined(SWIGMATLAB)
|
964
|
+
return mxCreateLogicalScalar(*a);
|
965
|
+
#else
|
966
|
+
return 0;
|
967
|
+
#endif
|
968
|
+
}
|
969
|
+
} // namespace casadi
|
970
|
+
}
|
971
|
+
|
972
|
+
%fragment("casadi_int", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(int), fragment=SWIG_AsVal_frag(long), fragment=SWIG_AsVal_frag(long long)) {
|
973
|
+
namespace casadi {
|
974
|
+
bool to_ptr(GUESTOBJECT *p, casadi_int** m) {
|
975
|
+
// Treat Null
|
976
|
+
if (is_null(p)) return false;
|
977
|
+
|
978
|
+
// long long
|
979
|
+
{
|
980
|
+
long long tmp;
|
981
|
+
if (SWIG_IsOK(SWIG_AsVal(long long)(p, &tmp))) {
|
982
|
+
if (m) **m = static_cast<casadi_int>(tmp);
|
983
|
+
return true;
|
984
|
+
}
|
985
|
+
}
|
986
|
+
|
987
|
+
#ifdef SWIGPYTHON
|
988
|
+
if (is_scalar_np_array(p)) {
|
989
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "item", 0);
|
990
|
+
if (cr) {
|
991
|
+
casadi_int res = to_ptr(cr, m);
|
992
|
+
Py_DECREF(cr);
|
993
|
+
if (!res) return false;
|
994
|
+
return true;
|
995
|
+
} else {
|
996
|
+
PyErr_Clear();
|
997
|
+
return false;
|
998
|
+
}
|
999
|
+
}
|
1000
|
+
#endif // SWIGPYTHON
|
1001
|
+
|
1002
|
+
bool tmp;
|
1003
|
+
if (to_val(p, m? &tmp : 0)) {
|
1004
|
+
if (m) **m = tmp;
|
1005
|
+
return true;
|
1006
|
+
}
|
1007
|
+
|
1008
|
+
// No match
|
1009
|
+
return false;
|
1010
|
+
}
|
1011
|
+
|
1012
|
+
GUESTOBJECT * from_ptr(const casadi_int *a) {
|
1013
|
+
#ifdef SWIGPYTHON
|
1014
|
+
#ifdef WITH_PYTHON3
|
1015
|
+
return PyLong_FromLongLong(*a);
|
1016
|
+
#else
|
1017
|
+
// For python on Windows
|
1018
|
+
if (*a > PyInt_GetMax() || *a < -(PyInt_GetMax()-1)) return PyLong_FromLongLong(*a);
|
1019
|
+
return PyInt_FromLong(*a);
|
1020
|
+
#endif
|
1021
|
+
|
1022
|
+
#elif defined(SWIGMATLAB)
|
1023
|
+
return mxCreateDoubleScalar(static_cast<double>(*a));
|
1024
|
+
#else
|
1025
|
+
return 0;
|
1026
|
+
#endif
|
1027
|
+
}
|
1028
|
+
} // namespace casadi
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
%fragment("casadi_double", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(double)) {
|
1032
|
+
namespace casadi {
|
1033
|
+
bool to_ptr(GUESTOBJECT *p, double** m) {
|
1034
|
+
// Treat Null
|
1035
|
+
if (is_null(p)) return false;
|
1036
|
+
|
1037
|
+
// Standard typemaps
|
1038
|
+
if (SWIG_IsOK(SWIG_AsVal(double)(p, m ? *m : 0))) return true;
|
1039
|
+
|
1040
|
+
#ifdef SWIGPYTHON
|
1041
|
+
if (is_scalar_np_array(p)) {
|
1042
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "item", 0);
|
1043
|
+
if (cr) {
|
1044
|
+
casadi_int res = to_ptr(cr, m);
|
1045
|
+
Py_DECREF(cr);
|
1046
|
+
if (!res) return false;
|
1047
|
+
return true;
|
1048
|
+
} else {
|
1049
|
+
PyErr_Clear();
|
1050
|
+
return false;
|
1051
|
+
}
|
1052
|
+
}
|
1053
|
+
#endif // SWIGPYTHON
|
1054
|
+
|
1055
|
+
casadi_int tmp;
|
1056
|
+
if (to_val(p, m? &tmp: 0)) {
|
1057
|
+
if (m) **m = tmp;
|
1058
|
+
return true;
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
// No match
|
1062
|
+
return false;
|
1063
|
+
}
|
1064
|
+
|
1065
|
+
GUESTOBJECT * from_ptr(const double *a) {
|
1066
|
+
#ifdef SWIGPYTHON
|
1067
|
+
return PyFloat_FromDouble(*a);
|
1068
|
+
#elif defined(SWIGMATLAB)
|
1069
|
+
return mxCreateDoubleScalar(*a);
|
1070
|
+
#else
|
1071
|
+
return 0;
|
1072
|
+
#endif
|
1073
|
+
}
|
1074
|
+
} // namespace casadi
|
1075
|
+
}
|
1076
|
+
|
1077
|
+
|
1078
|
+
%fragment("casadi_vector", "header", fragment="casadi_aux") {
|
1079
|
+
namespace casadi {
|
1080
|
+
|
1081
|
+
#ifdef SWIGMATLAB
|
1082
|
+
|
1083
|
+
// Cell array
|
1084
|
+
template<typename M> bool to_ptr_cell(GUESTOBJECT *p, std::vector<M>** m) {
|
1085
|
+
// Cell arrays (only row vectors)
|
1086
|
+
if (mxGetClassID(p)==mxCELL_CLASS) {
|
1087
|
+
casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
|
1088
|
+
if (nrow==1 || (nrow==0 && ncol==0) || ncol==1) {
|
1089
|
+
casadi_int n = (nrow==0 || ncol==0) ? 0 : std::max(nrow, ncol);
|
1090
|
+
// Allocate elements
|
1091
|
+
if (m) {
|
1092
|
+
(**m).clear();
|
1093
|
+
(**m).reserve(n);
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
// Temporary
|
1097
|
+
M tmp;
|
1098
|
+
|
1099
|
+
// Loop over elements
|
1100
|
+
for (casadi_int i=0; i<n; ++i) {
|
1101
|
+
// Get element
|
1102
|
+
mxArray* pe = mxGetCell(p, i);
|
1103
|
+
if (pe==0) return false;
|
1104
|
+
|
1105
|
+
// Convert element
|
1106
|
+
M *m_i = m ? &tmp : 0;
|
1107
|
+
if (!to_ptr(pe, m_i ? &m_i : 0)) {
|
1108
|
+
return false;
|
1109
|
+
}
|
1110
|
+
if (m) (**m).push_back(*m_i);
|
1111
|
+
}
|
1112
|
+
return true;
|
1113
|
+
}
|
1114
|
+
}
|
1115
|
+
return false;
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
// MATLAB row/column vector maps to std::vector<double>
|
1119
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<double> **m) {
|
1120
|
+
// Treat Null
|
1121
|
+
if (is_null(p)) return false;
|
1122
|
+
|
1123
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
|
1124
|
+
&& (mxGetM(p)<=1 || mxGetN(p)<=1)) {
|
1125
|
+
if (m) {
|
1126
|
+
double* data = static_cast<double*>(mxGetData(p));
|
1127
|
+
casadi_int n = mxGetM(p)*mxGetN(p);
|
1128
|
+
(**m).resize(n);
|
1129
|
+
std::copy(data, data+n, (**m).begin());
|
1130
|
+
}
|
1131
|
+
return true;
|
1132
|
+
}
|
1133
|
+
|
1134
|
+
// Cell array
|
1135
|
+
if (to_ptr_cell(p, m)) return true;
|
1136
|
+
|
1137
|
+
// No match
|
1138
|
+
return false;
|
1139
|
+
}
|
1140
|
+
|
1141
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<casadi_int>** m) {
|
1142
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
|
1143
|
+
&& (mxGetM(p)<=1 || mxGetN(p)<=1)) {
|
1144
|
+
double* data = static_cast<double*>(mxGetData(p));
|
1145
|
+
casadi_int n = mxGetM(p)*mxGetN(p);
|
1146
|
+
|
1147
|
+
// Check if all integers
|
1148
|
+
bool all_integers=true;
|
1149
|
+
for (casadi_int i=0; all_integers && i<n; ++i) {
|
1150
|
+
if (data[i]!=static_cast<casadi_int>(data[i])) {
|
1151
|
+
all_integers = false;
|
1152
|
+
break;
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
|
1156
|
+
// Successful conversion
|
1157
|
+
if (all_integers) {
|
1158
|
+
if (m) {
|
1159
|
+
(**m).resize(n);
|
1160
|
+
std::copy(data, data+n, (**m).begin());
|
1161
|
+
}
|
1162
|
+
return true;
|
1163
|
+
}
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
|
1167
|
+
&& (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
|
1168
|
+
casadi_int n = mxGetM(p)*mxGetN(p);
|
1169
|
+
mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
|
1170
|
+
if (m) {
|
1171
|
+
(**m).resize(n);
|
1172
|
+
std::copy(data, data+n, (**m).begin());
|
1173
|
+
}
|
1174
|
+
return true;
|
1175
|
+
}
|
1176
|
+
|
1177
|
+
// Cell array
|
1178
|
+
if (to_ptr_cell(p, m)) return true;
|
1179
|
+
|
1180
|
+
return false;
|
1181
|
+
}
|
1182
|
+
|
1183
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<bool>** m) {
|
1184
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2
|
1185
|
+
&& (mxGetM(p)<=1 || mxGetN(p)<=1)) {
|
1186
|
+
double* data = static_cast<double*>(mxGetData(p));
|
1187
|
+
casadi_int n = mxGetM(p)*mxGetN(p);
|
1188
|
+
|
1189
|
+
// Check if all integers
|
1190
|
+
bool all_0_or_1 = true;
|
1191
|
+
for (casadi_int i=0; all_0_or_1 && i<n; ++i) {
|
1192
|
+
double d = data[i];
|
1193
|
+
all_0_or_1 = all_0_or_1 && (d==1 || d==0);
|
1194
|
+
}
|
1195
|
+
|
1196
|
+
// Successful conversion
|
1197
|
+
if (all_0_or_1) {
|
1198
|
+
if (m) {
|
1199
|
+
(**m).resize(n);
|
1200
|
+
std::copy(data, data+n, (**m).begin());
|
1201
|
+
}
|
1202
|
+
return true;
|
1203
|
+
}
|
1204
|
+
}
|
1205
|
+
|
1206
|
+
if (mxIsLogical(p) && !mxIsLogicalScalar(p) &&mxGetNumberOfDimensions(p)==2
|
1207
|
+
&& (mxGetM(p)<=1 || mxGetN(p)<=1) ) {
|
1208
|
+
casadi_int n = mxGetM(p)*mxGetN(p);
|
1209
|
+
mxLogical* data = static_cast<mxLogical*>(mxGetData(p));
|
1210
|
+
if (m) {
|
1211
|
+
(**m).resize(n);
|
1212
|
+
std::copy(data, data+n, (**m).begin());
|
1213
|
+
}
|
1214
|
+
return true;
|
1215
|
+
}
|
1216
|
+
|
1217
|
+
// Cell array
|
1218
|
+
if (to_ptr_cell(p, m)) return true;
|
1219
|
+
|
1220
|
+
return false;
|
1221
|
+
}
|
1222
|
+
|
1223
|
+
// MATLAB n-by-m char array mapped to vector of length m
|
1224
|
+
bool to_ptr(GUESTOBJECT *p, std::vector<std::string>** m) {
|
1225
|
+
if (mxIsChar(p)) {
|
1226
|
+
if (m) {
|
1227
|
+
// Get data
|
1228
|
+
size_t nrow = mxGetM(p);
|
1229
|
+
size_t ncol = mxGetN(p);
|
1230
|
+
mxChar *data = mxGetChars(p);
|
1231
|
+
|
1232
|
+
// Allocate space for output
|
1233
|
+
(**m).resize(nrow);
|
1234
|
+
std::vector<std::string> &m_ref = **m;
|
1235
|
+
|
1236
|
+
// For all strings
|
1237
|
+
for (size_t j=0; j!=nrow; ++j) {
|
1238
|
+
// Get length without trailing spaces
|
1239
|
+
size_t len = ncol;
|
1240
|
+
while (len!=0 && data[j + nrow*(len-1)]==' ') --len;
|
1241
|
+
|
1242
|
+
// Check if null-terminated
|
1243
|
+
for (size_t i=0; i!=len; ++i) {
|
1244
|
+
if (data[j + nrow*i]=='\0') {
|
1245
|
+
len = i;
|
1246
|
+
break;
|
1247
|
+
}
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
// Create a string of the desired length
|
1251
|
+
m_ref[j] = std::string(len, ' ');
|
1252
|
+
|
1253
|
+
// Get string content
|
1254
|
+
for (size_t i=0; i!=len; ++i) {
|
1255
|
+
m_ref[j][i] = data[j + nrow*i];
|
1256
|
+
}
|
1257
|
+
}
|
1258
|
+
}
|
1259
|
+
return true;
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
// Cell array
|
1263
|
+
if (to_ptr_cell(p, m)) return true;
|
1264
|
+
|
1265
|
+
// No match
|
1266
|
+
return false;
|
1267
|
+
}
|
1268
|
+
#endif // SWIGMATLAB
|
1269
|
+
|
1270
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector<M>** m) {
|
1271
|
+
// Treat Null
|
1272
|
+
if (is_null(p)) return false;
|
1273
|
+
#ifdef SWIGPYTHON
|
1274
|
+
|
1275
|
+
// Some built-in types are iterable
|
1276
|
+
if (PyDict_Check(p) || PyString_Check(p) || PySet_Check(p) || PyUnicode_Check(p)) return false;
|
1277
|
+
|
1278
|
+
// Make sure shape is 1D, if defined.
|
1279
|
+
if (PyObject_HasAttrString(p, "shape")) {
|
1280
|
+
PyObject * shape = PyObject_GetAttrString(p, "shape");
|
1281
|
+
if(!PyTuple_Check(shape) || PyTuple_Size(shape)!=1) {
|
1282
|
+
Py_DECREF(shape);
|
1283
|
+
return false;
|
1284
|
+
}
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
// Iterator to the sequence
|
1288
|
+
PyObject *it = PyObject_GetIter(p);
|
1289
|
+
if (!it) {
|
1290
|
+
PyErr_Clear();
|
1291
|
+
return false;
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
// Allocate elements
|
1295
|
+
if (m) (**m).clear();
|
1296
|
+
|
1297
|
+
// Temporary
|
1298
|
+
M tmp;
|
1299
|
+
|
1300
|
+
PyObject *pe;
|
1301
|
+
// Iterate over sequence
|
1302
|
+
while ((pe=PyIter_Next(it))) {
|
1303
|
+
// Convert element
|
1304
|
+
M *m_i = m ? &tmp : 0;
|
1305
|
+
if (!to_ptr(pe, m_i ? &m_i : 0)) {
|
1306
|
+
// Failure
|
1307
|
+
Py_DECREF(pe);
|
1308
|
+
Py_DECREF(it);
|
1309
|
+
return false;
|
1310
|
+
}
|
1311
|
+
if (m) (**m).push_back(*m_i);
|
1312
|
+
Py_DECREF(pe);
|
1313
|
+
}
|
1314
|
+
Py_DECREF(it);
|
1315
|
+
return true;
|
1316
|
+
#endif // SWIGPYTHON
|
1317
|
+
#ifdef SWIGMATLAB
|
1318
|
+
// Cell array
|
1319
|
+
if (to_ptr_cell(p, m)) return true;
|
1320
|
+
#endif // SWIGMATLAB
|
1321
|
+
// No match
|
1322
|
+
return false;
|
1323
|
+
}
|
1324
|
+
|
1325
|
+
#ifdef SWIGMATLAB
|
1326
|
+
GUESTOBJECT* from_ptr(const std::vector<double> *a) {
|
1327
|
+
mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
|
1328
|
+
std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
|
1329
|
+
return ret;
|
1330
|
+
}
|
1331
|
+
GUESTOBJECT* from_ptr(const std::vector<casadi_int> *a) {
|
1332
|
+
mxArray* ret = mxCreateDoubleMatrix(1, a->size(), mxREAL);
|
1333
|
+
std::copy(a->begin(), a->end(), static_cast<double*>(mxGetData(ret)));
|
1334
|
+
return ret;
|
1335
|
+
}
|
1336
|
+
GUESTOBJECT* from_ptr(const std::vector<bool> *a) {
|
1337
|
+
mxArray* ret = mxCreateLogicalMatrix(1, a->size());
|
1338
|
+
std::copy(a->begin(), a->end(), static_cast<bool*>(mxGetData(ret)));
|
1339
|
+
return ret;
|
1340
|
+
}
|
1341
|
+
GUESTOBJECT* from_ptr(const std::vector<std::string> *a) {
|
1342
|
+
// Collect arguments as char arrays
|
1343
|
+
std::vector<const char*> str(a->size());
|
1344
|
+
for (size_t i=0; i<str.size(); ++i) str[i] = (*a)[i].c_str();
|
1345
|
+
|
1346
|
+
// std::vector<string> maps to MATLAB char array with multiple columns
|
1347
|
+
return mxCreateCharMatrixFromStrings(str.size(), str.empty() ? 0 : &str[0]);
|
1348
|
+
}
|
1349
|
+
#endif // SWIGMATLAB
|
1350
|
+
|
1351
|
+
template<typename M> GUESTOBJECT* from_ptr(const std::vector<M> *a) {
|
1352
|
+
#ifdef SWIGPYTHON
|
1353
|
+
// std::vector maps to Python list
|
1354
|
+
PyObject* ret = PyList_New(a->size());
|
1355
|
+
if (!ret) return 0;
|
1356
|
+
for (casadi_int k=0; k<a->size(); ++k) {
|
1357
|
+
PyObject* el = from_ref(a->at(k));
|
1358
|
+
if (!el) {
|
1359
|
+
Py_DECREF(ret);
|
1360
|
+
return 0;
|
1361
|
+
}
|
1362
|
+
PyList_SetItem(ret, k, el);
|
1363
|
+
}
|
1364
|
+
return ret;
|
1365
|
+
#elif defined(SWIGMATLAB)
|
1366
|
+
// std::vector maps to MATLAB cell array
|
1367
|
+
mxArray* ret = mxCreateCellMatrix(1, a->size());
|
1368
|
+
if (!ret) return 0;
|
1369
|
+
for (casadi_int k=0; k<a->size(); ++k) {
|
1370
|
+
mxArray* el = from_ref(a->at(k));
|
1371
|
+
if (!el) return 0;
|
1372
|
+
mxSetCell(ret, k, el);
|
1373
|
+
}
|
1374
|
+
return ret;
|
1375
|
+
#else
|
1376
|
+
return 0;
|
1377
|
+
#endif
|
1378
|
+
}
|
1379
|
+
} // namespace casadi
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
|
1383
|
+
%fragment("casadi_vectorvector", "header", fragment="casadi_aux") {
|
1384
|
+
namespace casadi {
|
1385
|
+
|
1386
|
+
#ifdef SWIGMATLAB
|
1387
|
+
|
1388
|
+
// Cell array
|
1389
|
+
template<typename M> bool to_ptr_cell2(GUESTOBJECT *p, std::vector< std::vector<M> >** m) {
|
1390
|
+
// Cell arrays (only row vectors)
|
1391
|
+
if (mxGetClassID(p)==mxCELL_CLASS) {
|
1392
|
+
casadi_int nrow = mxGetM(p), ncol = mxGetN(p);
|
1393
|
+
if (true) {
|
1394
|
+
// Allocate elements
|
1395
|
+
if (m) {
|
1396
|
+
(**m).clear();
|
1397
|
+
(**m).resize(nrow, std::vector<M>(ncol));
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
// Temporary
|
1401
|
+
M tmp;
|
1402
|
+
|
1403
|
+
// Loop over elements
|
1404
|
+
for (casadi_int i=0; i<nrow*ncol; ++i) {
|
1405
|
+
// Get element
|
1406
|
+
mxArray* pe = mxGetCell(p, i);
|
1407
|
+
if (pe==0) return false;
|
1408
|
+
|
1409
|
+
// Convert element
|
1410
|
+
M *m_i = m ? &tmp : 0;
|
1411
|
+
if (!to_ptr(pe, m_i ? &m_i : 0)) {
|
1412
|
+
return false;
|
1413
|
+
}
|
1414
|
+
|
1415
|
+
if (m) (**m)[i % nrow][i / nrow] = tmp;
|
1416
|
+
}
|
1417
|
+
return true;
|
1418
|
+
}
|
1419
|
+
}
|
1420
|
+
return false;
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
#endif // SWIGMATLAB
|
1424
|
+
|
1425
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::vector< std::vector<M> >** m) {
|
1426
|
+
// Treat Null
|
1427
|
+
if (is_null(p)) return false;
|
1428
|
+
|
1429
|
+
// Pass on to to_ptr(GUESTOBJECT *p, std::vector<M>** m)
|
1430
|
+
if (to_ptr< std::vector<M> >(p, m)) return true;
|
1431
|
+
|
1432
|
+
#ifdef SWIGMATLAB
|
1433
|
+
// Cell array
|
1434
|
+
if (to_ptr_cell2(p, m)) return true;
|
1435
|
+
#endif // SWIGMATLAB
|
1436
|
+
return false;
|
1437
|
+
}
|
1438
|
+
|
1439
|
+
} // namespace casadi
|
1440
|
+
}
|
1441
|
+
|
1442
|
+
%fragment("casadi_function", "header", fragment="casadi_aux") {
|
1443
|
+
namespace casadi {
|
1444
|
+
bool to_ptr(GUESTOBJECT *p, Function** m) {
|
1445
|
+
// Treat Null
|
1446
|
+
if (is_null(p)) return false;
|
1447
|
+
|
1448
|
+
// Function already?
|
1449
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1450
|
+
$descriptor(casadi::Function*), 0))) {
|
1451
|
+
return true;
|
1452
|
+
}
|
1453
|
+
|
1454
|
+
// No match
|
1455
|
+
return false;
|
1456
|
+
}
|
1457
|
+
|
1458
|
+
GUESTOBJECT* from_ptr(const Function *a) {
|
1459
|
+
return SWIG_NewPointerObj(new Function(*a), $descriptor(casadi::Function *), SWIG_POINTER_OWN);
|
1460
|
+
}
|
1461
|
+
} // namespace casadi
|
1462
|
+
}
|
1463
|
+
|
1464
|
+
%fragment("casadi_generictype", "header", fragment="casadi_aux") {
|
1465
|
+
namespace casadi {
|
1466
|
+
bool to_ptr(GUESTOBJECT *p, GenericType** m) {
|
1467
|
+
#ifdef SWIGPYTHON
|
1468
|
+
if (p==Py_None) {
|
1469
|
+
if (m) **m=GenericType();
|
1470
|
+
return true;
|
1471
|
+
}
|
1472
|
+
#endif // SWIGPYTHON
|
1473
|
+
|
1474
|
+
// Treat Null
|
1475
|
+
if (is_null(p)) return false;
|
1476
|
+
|
1477
|
+
// GenericType already?
|
1478
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1479
|
+
$descriptor(casadi::GenericType*), 0))) {
|
1480
|
+
return true;
|
1481
|
+
}
|
1482
|
+
|
1483
|
+
// Try to convert to different types
|
1484
|
+
if (to_generic<casadi_int>(p, m)
|
1485
|
+
|| to_generic<double>(p, m)
|
1486
|
+
|| to_generic<std::string>(p, m)
|
1487
|
+
|| to_generic<std::vector<casadi_int> >(p, m)
|
1488
|
+
|| to_generic<std::vector<double> >(p, m)
|
1489
|
+
|| to_generic<std::vector<bool> >(p, m)
|
1490
|
+
|| to_generic<std::vector<std::string> >(p, m)
|
1491
|
+
|| to_generic<std::vector<std::vector<std::string> > >(p, m)
|
1492
|
+
|| to_generic<std::vector<std::vector<casadi_int> > >(p, m)
|
1493
|
+
|| to_generic<std::vector<std::vector<double> > >(p, m)
|
1494
|
+
|| to_generic<casadi::Function>(p, m)
|
1495
|
+
|| to_generic<std::vector<casadi::Function> >(p, m)
|
1496
|
+
|| to_generic<casadi::GenericType::Dict>(p, m)
|
1497
|
+
|| to_generic<std::vector<casadi::GenericType::Dict> >(p, m)
|
1498
|
+
|| to_generic<std::vector<std::vector<casadi::GenericType> > >(p, m)
|
1499
|
+
|| to_generic<std::vector<casadi::GenericType> >(p, m)) {
|
1500
|
+
return true;
|
1501
|
+
}
|
1502
|
+
|
1503
|
+
// Check if it can be converted to boolean (last as e.g. can be converted to boolean)
|
1504
|
+
if (to_generic<bool>(p, m)) return true;
|
1505
|
+
|
1506
|
+
// No match
|
1507
|
+
return false;
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
GUESTOBJECT * from_ptr(const GenericType *a) {
|
1511
|
+
switch (a->getType()) {
|
1512
|
+
case OT_BOOL: return from_tmp(a->as_bool());
|
1513
|
+
case OT_INT: return from_tmp(a->as_int());
|
1514
|
+
case OT_DOUBLE: return from_tmp(a->as_double());
|
1515
|
+
case OT_STRING: return from_tmp(a->as_string());
|
1516
|
+
case OT_INTVECTOR: return from_tmp(a->as_int_vector());
|
1517
|
+
case OT_INTVECTORVECTOR: return from_tmp(a->as_int_vector_vector());
|
1518
|
+
case OT_BOOLVECTOR: return from_tmp(a->as_bool_vector());
|
1519
|
+
case OT_DOUBLEVECTOR: return from_tmp(a->as_double_vector());
|
1520
|
+
case OT_DOUBLEVECTORVECTOR: return from_tmp(a->as_double_vector_vector());
|
1521
|
+
case OT_STRINGVECTOR: return from_tmp(a->as_string_vector());
|
1522
|
+
case OT_STRINGVECTORVECTOR: return from_tmp(a->as_string_vector_vector());
|
1523
|
+
case OT_DICT: return from_tmp(a->as_dict());
|
1524
|
+
case OT_DICTVECTOR: return from_tmp(a->as_dict_vector());
|
1525
|
+
case OT_VECTORVECTOR: return from_tmp(a->as_vector_vector());
|
1526
|
+
case OT_VECTOR: return from_tmp(a->as_vector());
|
1527
|
+
case OT_FUNCTION: return from_tmp(a->as_function());
|
1528
|
+
case OT_FUNCTIONVECTOR: return from_tmp(a->as_function_vector());
|
1529
|
+
#ifdef SWIGPYTHON
|
1530
|
+
case OT_NULL:
|
1531
|
+
case OT_VOIDPTR:
|
1532
|
+
return Py_None;
|
1533
|
+
#endif // SWIGPYTHON
|
1534
|
+
#ifdef SWIGMATLAB
|
1535
|
+
case OT_VOIDPTR:
|
1536
|
+
return mxCreateDoubleScalar(0);
|
1537
|
+
#endif
|
1538
|
+
default: return 0;
|
1539
|
+
}
|
1540
|
+
}
|
1541
|
+
} // namespace casadi
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
%fragment("casadi_string", "header", fragment="casadi_aux") {
|
1545
|
+
namespace casadi {
|
1546
|
+
bool to_ptr(GUESTOBJECT *p, std::string** m) {
|
1547
|
+
// Treat Null
|
1548
|
+
if (is_null(p)) return false;
|
1549
|
+
|
1550
|
+
// String already?
|
1551
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1552
|
+
$descriptor(std::string*), 0))) {
|
1553
|
+
return true;
|
1554
|
+
}
|
1555
|
+
|
1556
|
+
#ifdef SWIGPYTHON
|
1557
|
+
if (PyString_Check(p) || PyUnicode_Check(p)) {
|
1558
|
+
if (m) {
|
1559
|
+
(*m)->clear();
|
1560
|
+
(*m)->append(python_string_to_std_string(p));
|
1561
|
+
}
|
1562
|
+
return true;
|
1563
|
+
}
|
1564
|
+
#endif // SWIGPYTHON
|
1565
|
+
#ifdef SWIGMATLAB
|
1566
|
+
if (mxIsChar(p) && mxGetM(p)<=1) {
|
1567
|
+
if (m) {
|
1568
|
+
if (mxGetM(p)==0) return true;
|
1569
|
+
size_t len=mxGetN(p);
|
1570
|
+
std::vector<char> s(len+1);
|
1571
|
+
if (mxGetString(p, &s[0], (len+1)*sizeof(char))) {
|
1572
|
+
casadi_warning("mxGetString returned NULL");
|
1573
|
+
return false;
|
1574
|
+
}
|
1575
|
+
// Matlab silent failure; see #4034
|
1576
|
+
if (s[0]=='\0' && len>0) {
|
1577
|
+
casadi_warning("mxGetString failure, see https://github.com/casadi/casadi/issues/4034");
|
1578
|
+
return false;
|
1579
|
+
}
|
1580
|
+
**m = std::string(&s[0], len);
|
1581
|
+
}
|
1582
|
+
return true;
|
1583
|
+
}
|
1584
|
+
#endif // SWIGMATLAB
|
1585
|
+
|
1586
|
+
// No match
|
1587
|
+
return false;
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
GUESTOBJECT* from_ptr(const std::string *a) {
|
1591
|
+
#ifdef SWIGPYTHON
|
1592
|
+
return PyString_FromString(a->c_str());
|
1593
|
+
#elif defined(SWIGMATLAB)
|
1594
|
+
return mxCreateString(a->c_str());
|
1595
|
+
#else
|
1596
|
+
return 0;
|
1597
|
+
#endif
|
1598
|
+
}
|
1599
|
+
} // namespace casadi
|
1600
|
+
}
|
1601
|
+
|
1602
|
+
%fragment("casadi_slice", "header", fragment="casadi_aux") {
|
1603
|
+
namespace casadi {
|
1604
|
+
bool to_ptr(GUESTOBJECT *p, Slice** m) {
|
1605
|
+
// Treat Null
|
1606
|
+
if (is_null(p)) return false;
|
1607
|
+
|
1608
|
+
// Slice already?
|
1609
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1610
|
+
$descriptor(casadi::Slice*), 0))) {
|
1611
|
+
return true;
|
1612
|
+
}
|
1613
|
+
|
1614
|
+
#ifdef SWIGPYTHON
|
1615
|
+
|
1616
|
+
// Python casadi_int
|
1617
|
+
if (PyInt_Check(p)) {
|
1618
|
+
if (m) {
|
1619
|
+
(**m).start = PyInt_AsLong(p);
|
1620
|
+
(**m).stop = (**m).start+1;
|
1621
|
+
if ((**m).stop==0) (**m).stop = std::numeric_limits<casadi_int>::max();
|
1622
|
+
}
|
1623
|
+
return true;
|
1624
|
+
}
|
1625
|
+
// Python slice
|
1626
|
+
if (PySlice_Check(p)) {
|
1627
|
+
PySliceObject *r = (PySliceObject*)(p);
|
1628
|
+
if (m) {
|
1629
|
+
(**m).start = (r->start == Py_None || PyNumber_AsSsize_t(r->start, NULL) <= std::numeric_limits<int>::min())
|
1630
|
+
? std::numeric_limits<casadi_int>::min() : PyInt_AsLong(r->start);
|
1631
|
+
(**m).stop = (r->stop ==Py_None || PyNumber_AsSsize_t(r->stop, NULL)>= std::numeric_limits<int>::max())
|
1632
|
+
? std::numeric_limits<casadi_int>::max() : PyInt_AsLong(r->stop);
|
1633
|
+
if(r->step !=Py_None) (**m).step = PyInt_AsLong(r->step);
|
1634
|
+
}
|
1635
|
+
return true;
|
1636
|
+
}
|
1637
|
+
#endif // SWIGPYTHON
|
1638
|
+
|
1639
|
+
// No match
|
1640
|
+
return false;
|
1641
|
+
}
|
1642
|
+
|
1643
|
+
GUESTOBJECT* from_ptr(const Slice *a) {
|
1644
|
+
return SWIG_NewPointerObj(new Slice(*a), $descriptor(casadi::Slice *), SWIG_POINTER_OWN);
|
1645
|
+
}
|
1646
|
+
|
1647
|
+
} // namespace casadi
|
1648
|
+
}
|
1649
|
+
|
1650
|
+
%fragment("casadi_map", "header", fragment="casadi_aux") {
|
1651
|
+
namespace casadi {
|
1652
|
+
template<typename M> bool to_ptr(GUESTOBJECT *p, std::map<std::string, M>** m) {
|
1653
|
+
#ifdef SWIGPYTHON
|
1654
|
+
if (PyDict_Check(p)) {
|
1655
|
+
PyObject *key, *value;
|
1656
|
+
Py_ssize_t pos = 0;
|
1657
|
+
while (PyDict_Next(p, &pos, &key, &value)) {
|
1658
|
+
if (!(PyString_Check(key) || PyUnicode_Check(key))) return false;
|
1659
|
+
if (m) {
|
1660
|
+
M *v=&(**m)[python_string_to_std_string(key)], *v2=v;
|
1661
|
+
if (!casadi::to_ptr(value, &v)) return false;
|
1662
|
+
if (v!=v2) *v2=*v; // if only pointer changed
|
1663
|
+
} else {
|
1664
|
+
if (!casadi::to_ptr(value, static_cast<M**>(0))) return false;
|
1665
|
+
}
|
1666
|
+
}
|
1667
|
+
return true;
|
1668
|
+
}
|
1669
|
+
#elif defined(SWIGMATLAB)
|
1670
|
+
if (mxIsStruct(p) && mxGetM(p)==1 && mxGetN(p)==1) {
|
1671
|
+
casadi_int len = mxGetNumberOfFields(p);
|
1672
|
+
for (casadi_int k=0; k<len; ++k) {
|
1673
|
+
mxArray *value = mxGetFieldByNumber(p, 0, k);
|
1674
|
+
if (m) {
|
1675
|
+
M *v=&(**m)[std::string(mxGetFieldNameByNumber(p, k))], *v2=v;
|
1676
|
+
if (!casadi::to_ptr(value, &v)) return false;
|
1677
|
+
if (v!=v2) *v2=*v; // if only pointer changed
|
1678
|
+
} else {
|
1679
|
+
if (!casadi::to_ptr(value, static_cast<M**>(0))) return false;
|
1680
|
+
}
|
1681
|
+
}
|
1682
|
+
return true;
|
1683
|
+
}
|
1684
|
+
#endif
|
1685
|
+
return false;
|
1686
|
+
}
|
1687
|
+
|
1688
|
+
template<typename M> GUESTOBJECT* from_ptr(const std::map<std::string, M> *a) {
|
1689
|
+
#ifdef SWIGPYTHON
|
1690
|
+
PyObject *p = PyDict_New();
|
1691
|
+
for (typename std::map<std::string, M>::const_iterator it=a->begin(); it!=a->end(); ++it) {
|
1692
|
+
PyObject * e = from_ptr(&it->second);
|
1693
|
+
if (!e) {
|
1694
|
+
Py_DECREF(p);
|
1695
|
+
return 0;
|
1696
|
+
}
|
1697
|
+
PyDict_SetItemString(p, it->first.c_str(), e);
|
1698
|
+
Py_DECREF(e);
|
1699
|
+
}
|
1700
|
+
return p;
|
1701
|
+
#elif defined(SWIGMATLAB)
|
1702
|
+
// Get vectors of the field names and mxArrays
|
1703
|
+
std::vector<const char*> fieldnames;
|
1704
|
+
std::vector<mxArray*> fields;
|
1705
|
+
for (typename std::map<std::string, M>::const_iterator it=a->begin(); it!=a->end(); ++it) {
|
1706
|
+
fieldnames.push_back(it->first.c_str());
|
1707
|
+
mxArray* f = from_ptr(&it->second);
|
1708
|
+
if (!f) {
|
1709
|
+
// Deallocate elements created up to now
|
1710
|
+
for (casadi_int k=0; k<fields.size(); ++k) mxDestroyArray(fields[k]);
|
1711
|
+
return 0;
|
1712
|
+
}
|
1713
|
+
fields.push_back(f);
|
1714
|
+
}
|
1715
|
+
|
1716
|
+
// Create return object
|
1717
|
+
mxArray *p = mxCreateStructMatrix(1, 1, fields.size(),
|
1718
|
+
fieldnames.empty() ? 0 : &fieldnames[0]);
|
1719
|
+
for (casadi_int k=0; k<fields.size(); ++k) mxSetFieldByNumber(p, 0, k, fields[k]);
|
1720
|
+
return p;
|
1721
|
+
#else
|
1722
|
+
return 0;
|
1723
|
+
#endif
|
1724
|
+
}
|
1725
|
+
} // namespace casadi
|
1726
|
+
}
|
1727
|
+
|
1728
|
+
%fragment("casadi_pair", "header", fragment="casadi_aux") {
|
1729
|
+
namespace casadi {
|
1730
|
+
#ifdef SWIGMATLAB
|
1731
|
+
bool to_ptr(GUESTOBJECT *p, std::pair<casadi_int, casadi_int>** m) {
|
1732
|
+
// (casadi_int,casadi_int) mapped to 2-by-1 double matrix
|
1733
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2 && !mxIsSparse(p)
|
1734
|
+
&& mxGetM(p)==1 && mxGetN(p)==2) {
|
1735
|
+
double* data = static_cast<double*>(mxGetData(p));
|
1736
|
+
casadi_int first = static_cast<casadi_int>(data[0]);
|
1737
|
+
casadi_int second = static_cast<casadi_int>(data[1]);
|
1738
|
+
if (data[0]==first && data[1]==second) {
|
1739
|
+
if (m) **m = std::make_pair(first, second);
|
1740
|
+
return true;
|
1741
|
+
} else {
|
1742
|
+
return false;
|
1743
|
+
}
|
1744
|
+
}
|
1745
|
+
|
1746
|
+
// No match
|
1747
|
+
return false;
|
1748
|
+
}
|
1749
|
+
#endif // SWIGMATLAB
|
1750
|
+
|
1751
|
+
template<typename M1, typename M2> bool to_ptr(GUESTOBJECT *p, std::pair<M1, M2>** m) {
|
1752
|
+
#ifdef SWIGPYTHON
|
1753
|
+
if (PyTuple_Check(p) && PyTuple_Size(p)==2) {
|
1754
|
+
PyObject *p_first = PyTuple_GetItem(p, 0);
|
1755
|
+
PyObject *p_second = PyTuple_GetItem(p, 1);
|
1756
|
+
return to_val(p_first, m ? &(**m).first : 0)
|
1757
|
+
&& to_val(p_second, m ? &(**m).second : 0);
|
1758
|
+
}
|
1759
|
+
#elif defined(SWIGMATLAB)
|
1760
|
+
// Other overloads mapped to 2-by-1 cell array
|
1761
|
+
if (mxGetClassID(p)==mxCELL_CLASS && mxGetM(p)==1 && mxGetN(p)==2) {
|
1762
|
+
mxArray *p_first = mxGetCell(p, 0);
|
1763
|
+
mxArray *p_second = mxGetCell(p, 1);
|
1764
|
+
return to_val(p_first, m ? &(**m).first : 0)
|
1765
|
+
&& to_val(p_second, m ? &(**m).second : 0);
|
1766
|
+
}
|
1767
|
+
#endif
|
1768
|
+
// No match
|
1769
|
+
return false;
|
1770
|
+
}
|
1771
|
+
|
1772
|
+
#ifdef SWIGMATLAB
|
1773
|
+
GUESTOBJECT* from_ptr(const std::pair<casadi_int, casadi_int>* a) {
|
1774
|
+
// (casadi_int,casadi_int) mapped to 2-by-1 double matrix
|
1775
|
+
mxArray* ret = mxCreateDoubleMatrix(1, 2, mxREAL);
|
1776
|
+
double* data = static_cast<double*>(mxGetData(ret));
|
1777
|
+
data[0] = a->first;
|
1778
|
+
data[1] = a->second;
|
1779
|
+
return ret;
|
1780
|
+
}
|
1781
|
+
#endif // SWIGMATLAB
|
1782
|
+
|
1783
|
+
template<typename M1, typename M2> GUESTOBJECT* from_ptr(const std::pair<M1, M2>* a) {
|
1784
|
+
#ifdef SWIGPYTHON
|
1785
|
+
PyObject* ret = PyTuple_New(2);
|
1786
|
+
PyTuple_SetItem(ret, 0, from_ref(a->first));
|
1787
|
+
PyTuple_SetItem(ret, 1, from_ref(a->second));
|
1788
|
+
return ret;
|
1789
|
+
#elif defined(SWIGMATLAB)
|
1790
|
+
// Other overloads mapped to 2-by-1 cell array
|
1791
|
+
mxArray* ret = mxCreateCellMatrix(1, 2);
|
1792
|
+
mxSetCell(ret, 0, from_ref(a->first));
|
1793
|
+
mxSetCell(ret, 1, from_ref(a->second));
|
1794
|
+
return ret;
|
1795
|
+
#else
|
1796
|
+
return 0;
|
1797
|
+
#endif // SWIGPYTHON
|
1798
|
+
}
|
1799
|
+
} // namespace casadi
|
1800
|
+
}
|
1801
|
+
|
1802
|
+
%fragment("casadi_sx", "header", fragment="casadi_aux") {
|
1803
|
+
namespace casadi {
|
1804
|
+
bool to_ptr(GUESTOBJECT *p, SX** m) {
|
1805
|
+
// Treat Null
|
1806
|
+
if (is_null(p)) return false;
|
1807
|
+
|
1808
|
+
// SX already?
|
1809
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1810
|
+
$descriptor(casadi::Matrix<casadi::SXElem>*), 0))) {
|
1811
|
+
return true;
|
1812
|
+
}
|
1813
|
+
|
1814
|
+
// Try first converting to a temporary DM
|
1815
|
+
{
|
1816
|
+
DM tmp;
|
1817
|
+
if(to_val(p, m? &tmp: 0)) {
|
1818
|
+
if (m) **m = tmp;
|
1819
|
+
return true;
|
1820
|
+
}
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
#ifdef SWIGPYTHON
|
1824
|
+
// Numpy arrays will be cast to dense SX
|
1825
|
+
if (SX_from_array(p, m)) return true;
|
1826
|
+
// Object has __SX__ method
|
1827
|
+
if (PyObject_HasAttrString(p,"__SX__")) {
|
1828
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "__SX__", 0);
|
1829
|
+
if (!cr) return false;
|
1830
|
+
casadi_int flag = to_ptr(cr, m);
|
1831
|
+
Py_DECREF(cr);
|
1832
|
+
return flag;
|
1833
|
+
}
|
1834
|
+
#endif // SWIGPYTHON
|
1835
|
+
|
1836
|
+
// No match
|
1837
|
+
return false;
|
1838
|
+
}
|
1839
|
+
|
1840
|
+
GUESTOBJECT* from_ptr(const SX *a) {
|
1841
|
+
return SWIG_NewPointerObj(new SX(*a), $descriptor(casadi::Matrix<casadi::SXElem> *), SWIG_POINTER_OWN);
|
1842
|
+
}
|
1843
|
+
} // namespace casadi
|
1844
|
+
}
|
1845
|
+
|
1846
|
+
%fragment("casadi_sxelem", "header", fragment="casadi_aux") {
|
1847
|
+
namespace casadi {
|
1848
|
+
bool to_ptr(GUESTOBJECT *p, SXElem** m) {
|
1849
|
+
// Treat Null
|
1850
|
+
if (is_null(p)) return false;
|
1851
|
+
|
1852
|
+
// Try first converting to a temporary SX
|
1853
|
+
{
|
1854
|
+
SX tmp, *mt=&tmp;
|
1855
|
+
if(casadi::to_ptr(p, m ? &mt : 0)) {
|
1856
|
+
if (m && !mt->is_scalar()) return false;
|
1857
|
+
if (m) **m = mt->scalar();
|
1858
|
+
return true;
|
1859
|
+
}
|
1860
|
+
}
|
1861
|
+
|
1862
|
+
// No match
|
1863
|
+
return false;
|
1864
|
+
}
|
1865
|
+
|
1866
|
+
GUESTOBJECT* from_ptr(const SXElem *a) {
|
1867
|
+
return from_ref(SX(*a));
|
1868
|
+
}
|
1869
|
+
} // namespace casadi
|
1870
|
+
}
|
1871
|
+
|
1872
|
+
%fragment("casadi_mx", "header", fragment="casadi_decl") {
|
1873
|
+
namespace casadi {
|
1874
|
+
bool to_ptr(GUESTOBJECT *p, MX** m) {
|
1875
|
+
// Treat Null
|
1876
|
+
if (is_null(p)) return false;
|
1877
|
+
|
1878
|
+
// MX already?
|
1879
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1880
|
+
$descriptor(casadi::MX*), 0))) {
|
1881
|
+
return true;
|
1882
|
+
}
|
1883
|
+
|
1884
|
+
// Try first converting to a temporary DM
|
1885
|
+
{
|
1886
|
+
DM tmp;
|
1887
|
+
if(to_val(p, m ? &tmp : 0)) {
|
1888
|
+
if (m) **m = tmp;
|
1889
|
+
return true;
|
1890
|
+
}
|
1891
|
+
}
|
1892
|
+
|
1893
|
+
#ifdef SWIGPYTHON
|
1894
|
+
if (PyObject_HasAttrString(p,"__MX__")) {
|
1895
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "__MX__", 0);
|
1896
|
+
if (!cr) return false;
|
1897
|
+
casadi_int flag = to_ptr(cr, m);
|
1898
|
+
Py_DECREF(cr);
|
1899
|
+
return flag;
|
1900
|
+
}
|
1901
|
+
#endif // SWIGPYTHON
|
1902
|
+
|
1903
|
+
// No match
|
1904
|
+
return false;
|
1905
|
+
}
|
1906
|
+
|
1907
|
+
GUESTOBJECT* from_ptr(const MX *a) {
|
1908
|
+
return SWIG_NewPointerObj(new MX(*a), $descriptor(casadi::MX*), SWIG_POINTER_OWN);
|
1909
|
+
}
|
1910
|
+
} // namespace casadi
|
1911
|
+
}
|
1912
|
+
|
1913
|
+
%fragment("casadi_dmatrix", "header", fragment="casadi_aux") {
|
1914
|
+
namespace casadi {
|
1915
|
+
#ifdef SWIGPYTHON
|
1916
|
+
/** Check PyObjects by class name */
|
1917
|
+
bool PyObjectHasClassName(PyObject* p, const char * name) {
|
1918
|
+
PyObject * classo = PyObject_GetAttrString( p, "__class__");
|
1919
|
+
PyObject * classname = PyObject_GetAttrString( classo, "__name__");
|
1920
|
+
|
1921
|
+
bool ret = python_string_to_std_string(classname) == name;
|
1922
|
+
Py_DECREF(classo);Py_DECREF(classname);
|
1923
|
+
return ret;
|
1924
|
+
}
|
1925
|
+
#endif // SWIGPYTHON
|
1926
|
+
|
1927
|
+
bool to_ptr(GUESTOBJECT *p, DM** m) {
|
1928
|
+
// Treat Null
|
1929
|
+
if (is_null(p)) return false;
|
1930
|
+
|
1931
|
+
// DM already?
|
1932
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
1933
|
+
$descriptor(casadi::Matrix<double>*), 0))) {
|
1934
|
+
return true;
|
1935
|
+
}
|
1936
|
+
|
1937
|
+
// Object is a sparsity pattern
|
1938
|
+
{
|
1939
|
+
Sparsity *m2;
|
1940
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
|
1941
|
+
$descriptor(casadi::Sparsity*), 0))) {
|
1942
|
+
if (m) **m=DM::ones(*m2);
|
1943
|
+
return true;
|
1944
|
+
}
|
1945
|
+
}
|
1946
|
+
|
1947
|
+
// Double scalar
|
1948
|
+
{
|
1949
|
+
double tmp;
|
1950
|
+
if (to_val(p, m? &tmp: 0)) {
|
1951
|
+
if (m) **m=tmp;
|
1952
|
+
return true;
|
1953
|
+
}
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
#ifdef SWIGPYTHON
|
1957
|
+
// Object has __DM__ method
|
1958
|
+
if (PyObject_HasAttrString(p,"__DM__")) {
|
1959
|
+
char name[] = "__DM__";
|
1960
|
+
PyObject *cr = PyObject_CallMethod(p, name, 0);
|
1961
|
+
if (!cr) return false;
|
1962
|
+
casadi_int result = to_val(cr, m ? *m : 0);
|
1963
|
+
Py_DECREF(cr);
|
1964
|
+
return result;
|
1965
|
+
}
|
1966
|
+
|
1967
|
+
if (DM_from_array(p, m)) return true;
|
1968
|
+
|
1969
|
+
if (DM_from_csc(p,m)) return true;
|
1970
|
+
|
1971
|
+
{
|
1972
|
+
std::vector <double> t;
|
1973
|
+
casadi_int res = to_val(p, &t);
|
1974
|
+
if (t.size()>0) {
|
1975
|
+
if (m) **m = casadi::Matrix<double>(t);
|
1976
|
+
} else {
|
1977
|
+
if (m) **m = casadi::Matrix<double>(0,0);
|
1978
|
+
}
|
1979
|
+
return res;
|
1980
|
+
}
|
1981
|
+
#endif // SWIGPYTHON
|
1982
|
+
#ifdef SWIGMATLAB
|
1983
|
+
// MATLAB double matrix (sparse or dense)
|
1984
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
|
1985
|
+
if (m) {
|
1986
|
+
**m = casadi::DM(get_sparsity(p));
|
1987
|
+
double* data = static_cast<double*>(mxGetData(p));
|
1988
|
+
casadi_copy(data, (*m)->nnz(), (*m)->ptr());
|
1989
|
+
}
|
1990
|
+
return true;
|
1991
|
+
}
|
1992
|
+
#endif // SWIGMATLAB
|
1993
|
+
|
1994
|
+
// No match
|
1995
|
+
return false;
|
1996
|
+
}
|
1997
|
+
|
1998
|
+
GUESTOBJECT* from_ptr(const DM *a) {
|
1999
|
+
return SWIG_NewPointerObj(new DM(*a), $descriptor(casadi::Matrix<double>*), SWIG_POINTER_OWN);
|
2000
|
+
}
|
2001
|
+
} // namespace casadi
|
2002
|
+
}
|
2003
|
+
|
2004
|
+
%fragment("casadi_sparsity", "header", fragment="casadi_aux") {
|
2005
|
+
namespace casadi {
|
2006
|
+
bool to_ptr(GUESTOBJECT *p, Sparsity** m) {
|
2007
|
+
// Treat Null
|
2008
|
+
if (is_null(p)) return false;
|
2009
|
+
|
2010
|
+
// Sparsity already?
|
2011
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(m),
|
2012
|
+
$descriptor(casadi::Sparsity*), 0))) {
|
2013
|
+
return true;
|
2014
|
+
}
|
2015
|
+
|
2016
|
+
// No match
|
2017
|
+
return false;
|
2018
|
+
}
|
2019
|
+
|
2020
|
+
GUESTOBJECT* from_ptr(const Sparsity *a) {
|
2021
|
+
return SWIG_NewPointerObj(new Sparsity(*a), $descriptor(casadi::Sparsity*), SWIG_POINTER_OWN);
|
2022
|
+
}
|
2023
|
+
} // namespace casadi
|
2024
|
+
}
|
2025
|
+
|
2026
|
+
%fragment("casadi_imatrix", "header", fragment="casadi_aux", fragment=SWIG_AsVal_frag(int)) {
|
2027
|
+
namespace casadi {
|
2028
|
+
bool to_ptr(GUESTOBJECT *p, IM** m) {
|
2029
|
+
// Treat Null
|
2030
|
+
if (is_null(p)) return false;
|
2031
|
+
|
2032
|
+
// Object is a sparsity pattern
|
2033
|
+
{
|
2034
|
+
Sparsity *m2;
|
2035
|
+
if (SWIG_IsOK(SWIG_ConvertPtr(p, reinterpret_cast<void**>(&m2),
|
2036
|
+
$descriptor(casadi::Sparsity*), 0))) {
|
2037
|
+
if (m) **m=IM::ones(*m2);
|
2038
|
+
return true;
|
2039
|
+
}
|
2040
|
+
}
|
2041
|
+
|
2042
|
+
// First convert to integer
|
2043
|
+
{
|
2044
|
+
casadi_int tmp;
|
2045
|
+
if (to_val(p, m? &tmp: 0)) {
|
2046
|
+
if (m) **m=tmp;
|
2047
|
+
return true;
|
2048
|
+
}
|
2049
|
+
}
|
2050
|
+
|
2051
|
+
#ifdef SWIGPYTHON
|
2052
|
+
// Numpy arrays will be cast to dense Matrix<casadi_int>
|
2053
|
+
if (IM_from_array(p, m)) return true;
|
2054
|
+
|
2055
|
+
if (PyObject_HasAttrString(p,"__IM__")) {
|
2056
|
+
PyObject *cr = PyObject_CallMethod(p, (char*) "__IM__", 0);
|
2057
|
+
if (!cr) return false;
|
2058
|
+
casadi_int result = to_val(cr, m ? *m : 0);
|
2059
|
+
Py_DECREF(cr);
|
2060
|
+
return result;
|
2061
|
+
}
|
2062
|
+
|
2063
|
+
{
|
2064
|
+
std::vector <casadi_int> t;
|
2065
|
+
if (to_val(p, &t)) {
|
2066
|
+
if (m) **m = casadi::Matrix<casadi_int>(t);
|
2067
|
+
return true;
|
2068
|
+
}
|
2069
|
+
}
|
2070
|
+
#endif // SWIGPYTHON
|
2071
|
+
|
2072
|
+
#ifdef SWIGMATLAB
|
2073
|
+
// In MATLAB, it is common to use floating point values to represent integers
|
2074
|
+
if (mxIsDouble(p) && mxGetNumberOfDimensions(p)==2) {
|
2075
|
+
double* data = static_cast<double*>(mxGetData(p));
|
2076
|
+
|
2077
|
+
// Check if all integers
|
2078
|
+
bool all_integers=true;
|
2079
|
+
size_t sz = getNNZ(p);
|
2080
|
+
for (size_t i=0; i<sz; ++i) {
|
2081
|
+
if (data[i] != casadi_int(data[i])) {
|
2082
|
+
all_integers = false;
|
2083
|
+
break;
|
2084
|
+
}
|
2085
|
+
}
|
2086
|
+
|
2087
|
+
// If successful
|
2088
|
+
if (all_integers) {
|
2089
|
+
if (m) {
|
2090
|
+
**m = casadi::IM(get_sparsity(p));
|
2091
|
+
for (size_t i=0; i<sz; ++i) {
|
2092
|
+
(**m)->at(i) = casadi_int(data[i]);
|
2093
|
+
}
|
2094
|
+
}
|
2095
|
+
return true;
|
2096
|
+
}
|
2097
|
+
}
|
2098
|
+
#endif // SWIGMATLAB
|
2099
|
+
|
2100
|
+
// Convert from DM
|
2101
|
+
{
|
2102
|
+
DM tmp;
|
2103
|
+
if (to_val(p, m? &tmp: 0)) {
|
2104
|
+
// Check integrality
|
2105
|
+
for (double d : tmp.nonzeros()) {
|
2106
|
+
if (d!=casadi_int(d)) return false;
|
2107
|
+
}
|
2108
|
+
// Convert
|
2109
|
+
if (m) {
|
2110
|
+
**m = casadi::Matrix<double>(tmp);
|
2111
|
+
}
|
2112
|
+
return true;
|
2113
|
+
}
|
2114
|
+
}
|
2115
|
+
|
2116
|
+
// No match
|
2117
|
+
return false;
|
2118
|
+
}
|
2119
|
+
GUESTOBJECT* from_ptr(const IM *a) {
|
2120
|
+
DM tmp(*a);
|
2121
|
+
return from_ref(tmp);
|
2122
|
+
}
|
2123
|
+
|
2124
|
+
} // namespace casadi
|
2125
|
+
}
|
2126
|
+
|
2127
|
+
// Can be overloaded by specifying before importing casadi.i
|
2128
|
+
%fragment("casadi_extra", "header") {}
|
2129
|
+
|
2130
|
+
// Collect all fragments
|
2131
|
+
%fragment("casadi_all", "header", fragment="casadi_aux,casadi_extra,casadi_bool,casadi_int,casadi_double,casadi_vector,casadi_vectorvector,casadi_function,casadi_generictype,casadi_string,casadi_slice,casadi_map,casadi_pair,casadi_sx,casadi_sxelem,casadi_mx,casadi_dmatrix,casadi_sparsity,casadi_imatrix") { }
|
2132
|
+
|
2133
|
+
#endif // SWIGXML
|
2134
|
+
|
2135
|
+
// Define all input typemaps
|
2136
|
+
%define %casadi_input_typemaps(xName, xPrec, xType...)
|
2137
|
+
// Pass input by value, check if matches
|
2138
|
+
%typemap(typecheck, noblock=1, precedence=xPrec, fragment="casadi_all") xType {
|
2139
|
+
$1 = casadi::to_ptr($input, static_cast< xType **>(0));
|
2140
|
+
}
|
2141
|
+
|
2142
|
+
// Directorout typemap; as input by value
|
2143
|
+
%typemap(directorout, noblock=1, fragment="casadi_all") xType {
|
2144
|
+
if (!casadi::to_val($input, &$result)) {
|
2145
|
+
%dirout_fail(SWIG_TypeError,"$type");
|
2146
|
+
}
|
2147
|
+
}
|
2148
|
+
|
2149
|
+
// Pass input by value, convert argument
|
2150
|
+
%typemap(in, doc=xName, noblock=1, fragment="casadi_all") xType {
|
2151
|
+
if (!casadi::to_val($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type '" xName "'.");
|
2152
|
+
}
|
2153
|
+
|
2154
|
+
// Pass input by value, cleanup
|
2155
|
+
%typemap(freearg, noblock=1) xType {}
|
2156
|
+
|
2157
|
+
// Pass input by reference, check if matches
|
2158
|
+
%typemap(typecheck, noblock=1, precedence=xPrec, fragment="casadi_all") const xType& {
|
2159
|
+
$1 = casadi::to_ptr($input, static_cast< xType **>(0));
|
2160
|
+
}
|
2161
|
+
|
2162
|
+
// Pass input by reference, convert argument
|
2163
|
+
%typemap(in, doc=xName, noblock=1, fragment="casadi_all") const xType & (xType m) {
|
2164
|
+
$1 = &m;
|
2165
|
+
if (!casadi::to_ptr($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type '" xName "'.");
|
2166
|
+
}
|
2167
|
+
|
2168
|
+
// Pass input by reference, cleanup
|
2169
|
+
%typemap(freearg, noblock=1) const xType & {}
|
2170
|
+
|
2171
|
+
%enddef
|
2172
|
+
|
2173
|
+
// Define all output typemaps
|
2174
|
+
%define %casadi_output_typemaps(xName, xType...)
|
2175
|
+
|
2176
|
+
// Return-by-value
|
2177
|
+
%typemap(out, doc=xName, noblock=1, fragment="casadi_all") xType, const xType {
|
2178
|
+
if(!($result = casadi::from_ref($1))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" xName "'.");
|
2179
|
+
}
|
2180
|
+
|
2181
|
+
// Return a const-ref behaves like return-by-value
|
2182
|
+
%typemap(out, doc=xName, noblock=1, fragment="casadi_all") const xType& {
|
2183
|
+
if(!($result = casadi::from_ptr($1))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type '" xName "'.");
|
2184
|
+
}
|
2185
|
+
|
2186
|
+
// Inputs marked OUTPUT are also returned by the function, ...
|
2187
|
+
%typemap(argout, noblock=1,fragment="casadi_all") xType &OUTPUT {
|
2188
|
+
%append_output(casadi::from_ptr($1));
|
2189
|
+
}
|
2190
|
+
|
2191
|
+
// ... and the corresponding inputs are ignored
|
2192
|
+
%typemap(in, doc=xName, noblock=1, numinputs=0) xType &OUTPUT (xType m) {
|
2193
|
+
$1 = &m;
|
2194
|
+
}
|
2195
|
+
|
2196
|
+
// Directorin typemap; as output
|
2197
|
+
%typemap(directorin, noblock=1, fragment="casadi_all") xType, const xType {
|
2198
|
+
if(!($input = casadi::from_ref($1))) %dirout_fail(SWIG_TypeError,"For director inputs, failed to convert input to " xName ".");
|
2199
|
+
}
|
2200
|
+
|
2201
|
+
// Directorin typemap; as output
|
2202
|
+
%typemap(directorin, noblock=1, fragment="casadi_all") const xType& {
|
2203
|
+
if(!($input = casadi::from_ptr(&$1))) %dirout_fail(SWIG_TypeError,"For director inputs, failed to convert input to " xName ".");
|
2204
|
+
}
|
2205
|
+
|
2206
|
+
// Enable dynamic dispatch
|
2207
|
+
%typemap(typecheck, noblock=1, fragment="casadi_all") xType &OUTPUT {
|
2208
|
+
$1 = casadi::to_ptr($input, static_cast< xType **>(0));
|
2209
|
+
}
|
2210
|
+
|
2211
|
+
// Alternative names
|
2212
|
+
%apply xType &OUTPUT {xType &OUTPUT1};
|
2213
|
+
%apply xType &OUTPUT {xType &OUTPUT2};
|
2214
|
+
%apply xType &OUTPUT {xType &OUTPUT3};
|
2215
|
+
%apply xType &OUTPUT {xType &OUTPUT4};
|
2216
|
+
%apply xType &OUTPUT {xType &OUTPUT5};
|
2217
|
+
%apply xType &OUTPUT {xType &OUTPUT6};
|
2218
|
+
|
2219
|
+
// Inputs marked INOUT are also returned by the function, ...
|
2220
|
+
%typemap(argout,noblock=1,fragment="casadi_all") xType &INOUT {
|
2221
|
+
%append_output(casadi::from_ptr($1));
|
2222
|
+
}
|
2223
|
+
|
2224
|
+
// ... but kept as inputs
|
2225
|
+
%typemap(in, doc=xName, noblock=1, fragment="casadi_all") xType &INOUT (xType m) {
|
2226
|
+
$1 = &m;
|
2227
|
+
if (!casadi::to_ptr($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input to type '" xName "'.");
|
2228
|
+
}
|
2229
|
+
|
2230
|
+
// ... also for dynamic dispatch
|
2231
|
+
%typemap(typecheck, noblock=1, fragment="casadi_all") xType& INOUT {
|
2232
|
+
$1 = casadi::to_ptr($input, static_cast< xType **>(0));
|
2233
|
+
}
|
2234
|
+
|
2235
|
+
// No arguments need to be freed
|
2236
|
+
%typemap(freearg, noblock=1) xType& INOUT {}
|
2237
|
+
|
2238
|
+
// Alternative names
|
2239
|
+
%apply xType &INOUT {xType &INOUT1};
|
2240
|
+
%apply xType &INOUT {xType &INOUT2};
|
2241
|
+
%apply xType &INOUT {xType &INOUT3};
|
2242
|
+
%apply xType &INOUT {xType &INOUT4};
|
2243
|
+
%apply xType &INOUT {xType &INOUT5};
|
2244
|
+
%apply xType &INOUT {xType &INOUT6};
|
2245
|
+
|
2246
|
+
%enddef
|
2247
|
+
|
2248
|
+
// Define all typemaps for a template instantiation without proxy classes
|
2249
|
+
%define %casadi_template(xName, xPrec, xType...)
|
2250
|
+
%template() xType;
|
2251
|
+
%casadi_input_typemaps(xName, xPrec, xType)
|
2252
|
+
%casadi_output_typemaps(xName, %arg(xType))
|
2253
|
+
%enddef
|
2254
|
+
|
2255
|
+
// Define all input and ouput typemaps
|
2256
|
+
%define %casadi_typemaps(xName, xPrec, xType...)
|
2257
|
+
%casadi_input_typemaps(xName, xPrec, xType)
|
2258
|
+
%casadi_output_typemaps(xName, xType)
|
2259
|
+
%enddef
|
2260
|
+
|
2261
|
+
// Order in typemap matching: Lower value means will be checked first
|
2262
|
+
|
2263
|
+
%define PREC_DICT 21 %enddef
|
2264
|
+
%define PREC_SPARSITY 90 %enddef
|
2265
|
+
%define PREC_IVector 92 %enddef
|
2266
|
+
%define PREC_IVectorVector 92 %enddef
|
2267
|
+
%define PREC_VECTOR 92 %enddef
|
2268
|
+
%define PREC_PAIR_SLICE_SLICE 93 %enddef
|
2269
|
+
%define PREC_SLICE 94 %enddef
|
2270
|
+
%define PREC_PAIR_IVector_IVector 96 %enddef
|
2271
|
+
%define PREC_IM 97 %enddef
|
2272
|
+
%define PREC_DVector 99 %enddef
|
2273
|
+
%define PREC_DM 100 %enddef
|
2274
|
+
%define PREC_DMVector 101 %enddef
|
2275
|
+
%define PREC_DMVectorVector 101 %enddef
|
2276
|
+
%define PREC_SX 103 %enddef
|
2277
|
+
%define PREC_SXVector 103 %enddef
|
2278
|
+
%define PREC_SXVectorVector 103 %enddef
|
2279
|
+
%define PREC_MX 104 %enddef
|
2280
|
+
%define PREC_MXVector 105 %enddef
|
2281
|
+
%define PREC_MXVectorVector 106 %enddef
|
2282
|
+
%define PREC_CREATOR 150 %enddef
|
2283
|
+
%define PREC_STRING 180 %enddef
|
2284
|
+
%define PREC_FUNCTION 200 %enddef
|
2285
|
+
%define PREC_GENERICTYPE 201 %enddef
|
2286
|
+
|
2287
|
+
#ifndef SWIGXML
|
2288
|
+
|
2289
|
+
// std::ostream & is redirected to casadi::uout()
|
2290
|
+
%typemap(in, noblock=1, numinputs=0) std::ostream &stream {
|
2291
|
+
$1 = &casadi::uout();
|
2292
|
+
}
|
2293
|
+
|
2294
|
+
// Add trailing newline in MATLAB and Octave
|
2295
|
+
#if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
|
2296
|
+
%typemap(argout, noblock=1) std::ostream &stream {
|
2297
|
+
*$1 << "\n" << std::flush;
|
2298
|
+
}
|
2299
|
+
#endif
|
2300
|
+
|
2301
|
+
#define L_INT "int"
|
2302
|
+
#define L_BOOL "bool"
|
2303
|
+
#define LPAIR(A,B) "(" A "," B ")"
|
2304
|
+
|
2305
|
+
#if defined(SWIGMATLAB) || defined(SWIGOCTAVE)
|
2306
|
+
#define L_DOUBLE "double"
|
2307
|
+
#define L_DICT "struct"
|
2308
|
+
#define LDICT(ARG) L_DICT ":" ARG
|
2309
|
+
#define LL "{"
|
2310
|
+
#define LR "}"
|
2311
|
+
#define L_STR "char"
|
2312
|
+
#define MATLABSTYLE
|
2313
|
+
#else
|
2314
|
+
#define LL "["
|
2315
|
+
#define LR "]"
|
2316
|
+
#define L_DICT "dict"
|
2317
|
+
#define L_DOUBLE "float"
|
2318
|
+
#define LDICT(ARG) L_DICT ":" ARG
|
2319
|
+
#define L_STR "str"
|
2320
|
+
#endif
|
2321
|
+
|
2322
|
+
#ifdef SWIGPYTHON
|
2323
|
+
%typemap(in, doc="memoryview(ro)", noblock=1, fragment="casadi_all") (const double * a, casadi_int size) (Py_buffer* buffer) {
|
2324
|
+
if (!PyMemoryView_Check($input)) SWIG_exception_fail(SWIG_TypeError, "Must supply a MemoryView.");
|
2325
|
+
buffer = PyMemoryView_GET_BUFFER($input);
|
2326
|
+
$1 = static_cast<double*>(buffer->buf); // const double cast comes later
|
2327
|
+
$2 = buffer->len;
|
2328
|
+
}
|
2329
|
+
|
2330
|
+
%typemap(in, doc="memoryview(rw)", noblock=1, fragment="casadi_all") (double * a, casadi_int size) (Py_buffer* buffer) {
|
2331
|
+
if (!PyMemoryView_Check($input)) SWIG_exception_fail(SWIG_TypeError, "Must supply a writable MemoryView.");
|
2332
|
+
buffer = PyMemoryView_GET_BUFFER($input);
|
2333
|
+
if (buffer->readonly) SWIG_exception_fail(SWIG_TypeError, "Must supply a writable MemoryView.");
|
2334
|
+
$1 = static_cast<double*>(buffer->buf);
|
2335
|
+
$2 = buffer->len;
|
2336
|
+
}
|
2337
|
+
|
2338
|
+
// Directorin typemap; as output
|
2339
|
+
%typemap(directorin, noblock=1, fragment="casadi_all") (const double** arg, const std::vector<casadi_int>& sizes_arg) (PyObject* my_tuple) {
|
2340
|
+
PyObject * arg_tuple = PyTuple_New($2.size());
|
2341
|
+
for (casadi_int i=0;i<$2.size();++i) {
|
2342
|
+
|
2343
|
+
#ifdef WITH_PYTHON3
|
2344
|
+
PyObject* buf = $1[i] ? PyMemoryView_FromMemory(reinterpret_cast<char*>(const_cast<double*>($1[i])), $2[i]*sizeof(double), PyBUF_READ) : SWIG_Py_Void();
|
2345
|
+
#else
|
2346
|
+
PyObject* buf = $1[i] ? PyBuffer_FromMemory(const_cast<double*>($1[i]), $2[i]*sizeof(double)) : SWIG_Py_Void();
|
2347
|
+
#endif
|
2348
|
+
PyTuple_SET_ITEM(arg_tuple, i, buf);
|
2349
|
+
}
|
2350
|
+
$input = arg_tuple;
|
2351
|
+
}
|
2352
|
+
|
2353
|
+
%typemap(directorin, noblock=1, fragment="casadi_all") (double** res, const std::vector<casadi_int>& sizes_res) {
|
2354
|
+
PyObject* res_tuple = PyTuple_New($2.size());
|
2355
|
+
for (casadi_int i=0;i<$2.size();++i) {
|
2356
|
+
#ifdef WITH_PYTHON3
|
2357
|
+
PyObject* buf = $1[i] ? PyMemoryView_FromMemory(reinterpret_cast<char*>(const_cast<double*>($1[i])), $2[i]*sizeof(double), PyBUF_WRITE) : SWIG_Py_Void();
|
2358
|
+
#else
|
2359
|
+
PyObject* buf = $1[i] ? PyBuffer_FromReadWriteMemory($1[i], $2[i]*sizeof(double)) : SWIG_Py_Void();
|
2360
|
+
#endif
|
2361
|
+
PyTuple_SET_ITEM(res_tuple, i, buf);
|
2362
|
+
}
|
2363
|
+
$input = res_tuple;
|
2364
|
+
}
|
2365
|
+
|
2366
|
+
%typemap(in, doc="void*", noblock=1, fragment="casadi_all") void* raw {
|
2367
|
+
$1 = PyCapsule_GetPointer($input, NULL);
|
2368
|
+
}
|
2369
|
+
|
2370
|
+
%typemap(out, doc="void*", noblock=1, fragment="casadi_all") void* {
|
2371
|
+
$result = PyCapsule_New($1, NULL,NULL);
|
2372
|
+
}
|
2373
|
+
#endif
|
2374
|
+
|
2375
|
+
%casadi_typemaps(L_STR, PREC_STRING, std::string)
|
2376
|
+
%casadi_template(LL L_STR LR, PREC_VECTOR, std::vector<std::string>)
|
2377
|
+
%casadi_template(LL LL L_STR LR LR, PREC_VECTOR, std::vector<std::vector<std::string> >)
|
2378
|
+
%casadi_typemaps("Sparsity", PREC_SPARSITY, casadi::Sparsity)
|
2379
|
+
%casadi_template(LL "Sparsity" LR, PREC_SPARSITY, std::vector< casadi::Sparsity>)
|
2380
|
+
%casadi_template(LL LL "Sparsity" LR LR, PREC_SPARSITY, std::vector<std::vector< casadi::Sparsity> >)
|
2381
|
+
%casadi_template(LDICT("Sparsity"), PREC_SPARSITY, std::map<std::string, casadi::Sparsity >)
|
2382
|
+
%casadi_template(LDICT(LL "Sparsity" LR), PREC_SPARSITY, std::map<std::string, std::vector<casadi::Sparsity > >)
|
2383
|
+
%casadi_template(LPAIR(LDICT("Sparsity"),"[" L_STR "]"), PREC_SPARSITY, std::pair<std::map<std::string, casadi::Sparsity >, std::vector<std::string> >)
|
2384
|
+
%casadi_typemaps(L_BOOL, SWIG_TYPECHECK_BOOL, bool)
|
2385
|
+
%casadi_template("[" L_BOOL "]", SWIG_TYPECHECK_BOOL, std::vector<bool>)
|
2386
|
+
%casadi_template("[[" L_BOOL "]]", SWIG_TYPECHECK_BOOL, std::vector<std::vector<bool> >)
|
2387
|
+
%casadi_typemaps( L_INT , SWIG_TYPECHECK_INTEGER, casadi_int)
|
2388
|
+
|
2389
|
+
#ifdef MATLABSTYLE
|
2390
|
+
#define LABEL "[int,int]"
|
2391
|
+
#else
|
2392
|
+
#define LABEL LPAIR("int","int")
|
2393
|
+
#endif
|
2394
|
+
%casadi_template(LABEL, SWIG_TYPECHECK_INTEGER, std::pair<casadi_int,casadi_int>)
|
2395
|
+
#undef LABEL
|
2396
|
+
%casadi_template("[" L_INT "]", PREC_IVector, std::vector<casadi_int>)
|
2397
|
+
%casadi_template(LL "[" L_INT "]" LR, PREC_IVectorVector, std::vector<std::vector<casadi_int> >)
|
2398
|
+
%casadi_typemaps(L_DOUBLE, SWIG_TYPECHECK_DOUBLE, double)
|
2399
|
+
%casadi_template("[" L_DOUBLE "]", SWIG_TYPECHECK_DOUBLE, std::vector<double>)
|
2400
|
+
%casadi_template(LL "[" L_DOUBLE "]" LR, SWIG_TYPECHECK_DOUBLE, std::vector<std::vector<double> >)
|
2401
|
+
%casadi_typemaps("SXElem", PREC_SX, casadi::SXElem)
|
2402
|
+
%casadi_template(LL "SXElem" LR, PREC_SXVector, std::vector<casadi::SXElem>)
|
2403
|
+
%casadi_typemaps("SX", PREC_SX, casadi::Matrix<casadi::SXElem>)
|
2404
|
+
%casadi_template(LL "SX" LR, PREC_SXVector, std::vector< casadi::Matrix<casadi::SXElem> >)
|
2405
|
+
%casadi_template(LL LL "SX" LR LR, PREC_SXVectorVector, std::vector<std::vector< casadi::Matrix<casadi::SXElem> > >)
|
2406
|
+
%casadi_template(LDICT("SX"), PREC_SX, std::map<std::string, casadi::Matrix<casadi::SXElem> >)
|
2407
|
+
%casadi_typemaps("MX", PREC_MX, casadi::MX)
|
2408
|
+
%casadi_template(LL "MX" LR, PREC_MXVector, std::vector<casadi::MX>)
|
2409
|
+
%casadi_template(LL LL "MX" LR LR, PREC_MXVectorVector, std::vector<std::vector<casadi::MX> >)
|
2410
|
+
%casadi_template(LDICT("MX"), PREC_MX, std::map<std::string, casadi::MX>)
|
2411
|
+
%casadi_template(LPAIR("MX","MX"), PREC_MXVector, std::pair<casadi::MX, casadi::MX>)
|
2412
|
+
%casadi_typemaps("DM", PREC_DM, casadi::Matrix<double>)
|
2413
|
+
%casadi_template(LL "DM" LR, PREC_DMVector, std::vector< casadi::Matrix<double> >)
|
2414
|
+
%casadi_template(LL LL "DM" LR LR, PREC_DMVectorVector, std::vector<std::vector< casadi::Matrix<double> > >)
|
2415
|
+
%casadi_template(LDICT("DM"), PREC_DM, std::map<std::string, casadi::Matrix<double> >)
|
2416
|
+
%casadi_typemaps("IM", PREC_IM, casadi::Matrix<casadi_int>)
|
2417
|
+
// Without CASADI_INT_TYPE, you get SwigValueWrapper
|
2418
|
+
// With it, docstrings are screwed
|
2419
|
+
%casadi_typemaps("GenericType", PREC_GENERICTYPE, casadi::GenericType)
|
2420
|
+
%casadi_template(LL "GenericType" LR, PREC_GENERICTYPE, std::vector<casadi::GenericType>)
|
2421
|
+
%casadi_typemaps("Slice", PREC_SLICE, casadi::Slice)
|
2422
|
+
%casadi_typemaps("Function", PREC_FUNCTION, casadi::Function)
|
2423
|
+
%casadi_template(LL "Function" LR, PREC_FUNCTION, std::vector<casadi::Function>)
|
2424
|
+
%casadi_template(LPAIR("Function","Function"), PREC_FUNCTION, std::pair<casadi::Function, casadi::Function>)
|
2425
|
+
%casadi_template(L_DICT, PREC_DICT, std::map<std::string, casadi::GenericType>)
|
2426
|
+
%casadi_template(LDICT(LL L_STR LR), PREC_DICT, std::map<std::string, std::vector<std::string> >)
|
2427
|
+
|
2428
|
+
#undef L_INT
|
2429
|
+
#undef L_BOOL
|
2430
|
+
#undef LPAIR
|
2431
|
+
#undef L_DOUBLE
|
2432
|
+
#undef L_DICT
|
2433
|
+
#undef LL
|
2434
|
+
#undef LR
|
2435
|
+
#undef L_STR
|
2436
|
+
#undef MATLABSTYLE
|
2437
|
+
|
2438
|
+
// Matlab is index-1 based
|
2439
|
+
#ifdef SWIGMATLAB
|
2440
|
+
%typemap(in, doc="index", noblock=1) casadi_index {
|
2441
|
+
if (!casadi::to_val($input, &$1)) SWIG_exception_fail(SWIG_TypeError,"Failed to convert input $argnum to type ' index '.");
|
2442
|
+
if ($1==0) SWIG_exception_fail(SWIG_TypeError,"Index starts at 1, got index '0'.");
|
2443
|
+
if ($1>=1) $1--;
|
2444
|
+
}
|
2445
|
+
#endif
|
2446
|
+
|
2447
|
+
#endif // SWIGXML
|
2448
|
+
|
2449
|
+
#ifdef SWIGPYTHON
|
2450
|
+
%pythoncode %{
|
2451
|
+
if __name__ != "casadi.casadi":
|
2452
|
+
raise Exception("""
|
2453
|
+
CasADi is not running from its package context.
|
2454
|
+
|
2455
|
+
You probably specified the wrong casadi directory.
|
2456
|
+
|
2457
|
+
When setting PYTHONPATH or sys.path.append,
|
2458
|
+
take care not to add a trailing '/casadi'.
|
2459
|
+
|
2460
|
+
""")
|
2461
|
+
|
2462
|
+
def swigtypeconvertor(*args):
|
2463
|
+
return swig_typename_convertor_python2cpp(args)
|
2464
|
+
|
2465
|
+
def swig_typename_convertor_python2cpp(a):
|
2466
|
+
try:
|
2467
|
+
import numpy as np
|
2468
|
+
except:
|
2469
|
+
class NoExist:
|
2470
|
+
pass
|
2471
|
+
class Temp(object):
|
2472
|
+
ndarray = NoExist
|
2473
|
+
np = Temp()
|
2474
|
+
if isinstance(a,list):
|
2475
|
+
if len(a)>0:
|
2476
|
+
return "[%s]" % "|".join(set([swig_typename_convertor_python2cpp(i) for i in a]))
|
2477
|
+
else:
|
2478
|
+
return "[]"
|
2479
|
+
elif isinstance(a,tuple):
|
2480
|
+
return "(%s)" % ",".join([swig_typename_convertor_python2cpp(i) for i in a])
|
2481
|
+
elif isinstance(a,np.ndarray):
|
2482
|
+
return "np.array(%s)" % ",".join(set([swig_typename_convertor_python2cpp(i) for i in np.array(a).flatten().tolist()]))
|
2483
|
+
elif isinstance(a,dict):
|
2484
|
+
if len(a)>0:
|
2485
|
+
return "|".join(set([swig_typename_convertor_python2cpp(i) for i in a.keys()])) +":"+ "|".join(set([swig_typename_convertor_python2cpp(i) for i in a.values()]))
|
2486
|
+
else:
|
2487
|
+
return "dict"
|
2488
|
+
return type(a).__name__
|
2489
|
+
%}
|
2490
|
+
#endif // SWIGPYTHON
|
2491
|
+
|
2492
|
+
// Init hooks
|
2493
|
+
#ifdef SWIGPYTHON
|
2494
|
+
#ifdef WITH_PYTHON_INTERRUPTS
|
2495
|
+
%{
|
2496
|
+
#include <pythonrun.h>
|
2497
|
+
void SigIntHandler(casadi_int) {
|
2498
|
+
std::cerr << "Keyboard Interrupt" << std::endl;
|
2499
|
+
signal(SIGINT, SIG_DFL);
|
2500
|
+
kill(getpid(), SIGINT);
|
2501
|
+
}
|
2502
|
+
%}
|
2503
|
+
|
2504
|
+
%init %{
|
2505
|
+
PyOS_setsig(SIGINT, SigIntHandler);
|
2506
|
+
%}
|
2507
|
+
#endif // WITH_PYTHON_INTERRUPTS
|
2508
|
+
|
2509
|
+
%pythoncode%{
|
2510
|
+
try:
|
2511
|
+
from numpy import pi, inf, sum
|
2512
|
+
except:
|
2513
|
+
pass
|
2514
|
+
|
2515
|
+
arcsin = lambda x: _casadi.asin(x)
|
2516
|
+
arccos = lambda x: _casadi.acos(x)
|
2517
|
+
arctan = lambda x: _casadi.atan(x)
|
2518
|
+
arctan2 = lambda x,y: _casadi.atan2(x, y)
|
2519
|
+
arctanh = lambda x: _casadi.atanh(x)
|
2520
|
+
arcsinh = lambda x: _casadi.asinh(x)
|
2521
|
+
arccosh = lambda x: _casadi.acosh(x)
|
2522
|
+
%}
|
2523
|
+
#endif // SWIGPYTHON
|
2524
|
+
|
2525
|
+
// Strip leading casadi_ unless followed by ML/int
|
2526
|
+
%rename("%(regex:/casadi_(?!ML|int\\b)(.*)/\\1/)s") "";
|
2527
|
+
%rename(casadi_int) "casadi_int";
|
2528
|
+
|
2529
|
+
%rename(row) get_row;
|
2530
|
+
%rename(colind) get_colind;
|
2531
|
+
%rename(sparsity) get_sparsity;
|
2532
|
+
%rename(nonzeros) get_nonzeros;
|
2533
|
+
%rename(elements) get_elements;
|
2534
|
+
|
2535
|
+
// Explicit conversion to double and casadi_int
|
2536
|
+
#ifdef SWIGPYTHON
|
2537
|
+
%rename(__float__) operator double;
|
2538
|
+
%rename(__int__) operator casadi_int;
|
2539
|
+
#else
|
2540
|
+
%rename(to_double) operator double;
|
2541
|
+
%rename(to_int) operator casadi_int;
|
2542
|
+
#endif
|
2543
|
+
%rename(to_DM) operator Matrix<double>;
|
2544
|
+
|
2545
|
+
#ifdef SWIGPYTHON
|
2546
|
+
%ignore T;
|
2547
|
+
|
2548
|
+
%rename(logic_and) casadi_and;
|
2549
|
+
%rename(logic_or) casadi_or;
|
2550
|
+
%rename(logic_not) casadi_not;
|
2551
|
+
%rename(logic_all) casadi_all;
|
2552
|
+
%rename(logic_any) casadi_any;
|
2553
|
+
%rename(fabs) casadi_abs;
|
2554
|
+
|
2555
|
+
// Concatenations
|
2556
|
+
%rename(_veccat) casadi_veccat;
|
2557
|
+
%rename(_vertcat) casadi_vertcat;
|
2558
|
+
%rename(_horzcat) casadi_horzcat;
|
2559
|
+
%rename(_diagcat) casadi_diagcat;
|
2560
|
+
%pythoncode %{
|
2561
|
+
def veccat(*args):
|
2562
|
+
try:
|
2563
|
+
if len(args)==0:
|
2564
|
+
return DM(0,1)
|
2565
|
+
except:
|
2566
|
+
pass
|
2567
|
+
return _veccat(args)
|
2568
|
+
def vertcat(*args):
|
2569
|
+
try:
|
2570
|
+
if len(args)==0:
|
2571
|
+
return DM(0,1)
|
2572
|
+
except:
|
2573
|
+
pass
|
2574
|
+
return _vertcat(args)
|
2575
|
+
def horzcat(*args):
|
2576
|
+
try:
|
2577
|
+
if len(args)==0:
|
2578
|
+
return DM(1,0)
|
2579
|
+
except:
|
2580
|
+
pass
|
2581
|
+
return _horzcat(args)
|
2582
|
+
def diagcat(*args):
|
2583
|
+
try:
|
2584
|
+
if len(args)==0:
|
2585
|
+
return DM(0,0)
|
2586
|
+
except:
|
2587
|
+
pass
|
2588
|
+
return _diagcat(args)
|
2589
|
+
def vvcat(args):
|
2590
|
+
try:
|
2591
|
+
if len(args)==0:
|
2592
|
+
return DM(0,1)
|
2593
|
+
except:
|
2594
|
+
pass
|
2595
|
+
return _veccat(args)
|
2596
|
+
def vcat(args):
|
2597
|
+
try:
|
2598
|
+
if len(args)==0:
|
2599
|
+
return DM(0,1)
|
2600
|
+
except:
|
2601
|
+
pass
|
2602
|
+
return _vertcat(args)
|
2603
|
+
def hcat(args):
|
2604
|
+
try:
|
2605
|
+
if len(args)==0:
|
2606
|
+
return DM(1,0)
|
2607
|
+
except:
|
2608
|
+
pass
|
2609
|
+
return _horzcat(args)
|
2610
|
+
def dcat(args):
|
2611
|
+
try:
|
2612
|
+
if len(args)==0:
|
2613
|
+
return DM(0,0)
|
2614
|
+
except:
|
2615
|
+
pass
|
2616
|
+
return _diagcat(args)
|
2617
|
+
%}
|
2618
|
+
|
2619
|
+
// Non-fatal errors (returning NotImplemented singleton)
|
2620
|
+
%feature("python:maybecall") casadi_plus;
|
2621
|
+
%feature("python:maybecall") casadi_minus;
|
2622
|
+
%feature("python:maybecall") casadi_times;
|
2623
|
+
%feature("python:maybecall") casadi_rdivide;
|
2624
|
+
%feature("python:maybecall") casadi_lt;
|
2625
|
+
%feature("python:maybecall") casadi_le;
|
2626
|
+
%feature("python:maybecall") casadi_eq;
|
2627
|
+
%feature("python:maybecall") casadi_ne;
|
2628
|
+
%feature("python:maybecall") casadi_power;
|
2629
|
+
%feature("python:maybecall") casadi_atan2;
|
2630
|
+
%feature("python:maybecall") casadi_min;
|
2631
|
+
%feature("python:maybecall") casadi_max;
|
2632
|
+
%feature("python:maybecall") casadi_and;
|
2633
|
+
%feature("python:maybecall") casadi_or;
|
2634
|
+
%feature("python:maybecall") casadi_mod;
|
2635
|
+
%feature("python:maybecall") casadi_copysign;
|
2636
|
+
%feature("python:maybecall") casadi_constpow;
|
2637
|
+
#endif // SWIGPYTHON
|
2638
|
+
|
2639
|
+
#ifdef SWIGMATLAB
|
2640
|
+
%rename(uminus) operator-;
|
2641
|
+
%rename(uplus) operator+;
|
2642
|
+
%feature("varargin","1") casadi_vertcat;
|
2643
|
+
%feature("varargin","1") casadi_horzcat;
|
2644
|
+
%feature("varargin","1") casadi_diagcat;
|
2645
|
+
%feature("varargin","1") casadi_veccat;
|
2646
|
+
%feature("optionalunpack","1") size;
|
2647
|
+
|
2648
|
+
// Raise an error if "this" not correct
|
2649
|
+
%typemap(check, noblock=1) SWIGTYPE *self %{
|
2650
|
+
if (!$1) {
|
2651
|
+
SWIG_Error(SWIG_RuntimeError, "Invalid 'self' object");
|
2652
|
+
SWIG_fail;
|
2653
|
+
}
|
2654
|
+
%}
|
2655
|
+
|
2656
|
+
// Workarounds, pending proper fix
|
2657
|
+
%rename(nonzero) __nonzero__;
|
2658
|
+
%rename(hash) __hash__;
|
2659
|
+
|
2660
|
+
%rename(rem) casadi_mod;
|
2661
|
+
#endif // SWIGMATLAB
|
2662
|
+
|
2663
|
+
#ifdef SWIGPYTHON
|
2664
|
+
%ignore casadi_mod;
|
2665
|
+
#endif // SWIGPYTHON
|
2666
|
+
|
2667
|
+
#ifdef WITH_PYTHON3
|
2668
|
+
%rename(__bool__) __nonzero__;
|
2669
|
+
#endif
|
2670
|
+
|
2671
|
+
#ifdef SWIGPYTHON
|
2672
|
+
|
2673
|
+
%pythoncode %{
|
2674
|
+
class NZproxy:
|
2675
|
+
def __init__(self,matrix):
|
2676
|
+
self.matrix = matrix
|
2677
|
+
|
2678
|
+
def __getitem__(self,s):
|
2679
|
+
return self.matrix.get_nz(False, s)
|
2680
|
+
|
2681
|
+
def __setitem__(self,s,val):
|
2682
|
+
return self.matrix.set_nz(val, False, s)
|
2683
|
+
|
2684
|
+
def __len__(self):
|
2685
|
+
return self.matrix.nnz()
|
2686
|
+
|
2687
|
+
def __iter__(self):
|
2688
|
+
for i in range(len(self)):
|
2689
|
+
yield self[i]
|
2690
|
+
|
2691
|
+
%}
|
2692
|
+
|
2693
|
+
%define %matrix_helpers(Type)
|
2694
|
+
%pythoncode %{
|
2695
|
+
@property
|
2696
|
+
def shape(self):
|
2697
|
+
return (self.size1(),self.size2())
|
2698
|
+
|
2699
|
+
def reshape(self,arg):
|
2700
|
+
return _casadi.reshape(self,arg)
|
2701
|
+
|
2702
|
+
@property
|
2703
|
+
def T(self):
|
2704
|
+
return _casadi.transpose(self)
|
2705
|
+
|
2706
|
+
def __getitem__(self, s):
|
2707
|
+
if isinstance(s, tuple) and len(s)==2:
|
2708
|
+
if s[1] is None: raise TypeError("Cannot slice with None")
|
2709
|
+
return self.get(False, s[0], s[1])
|
2710
|
+
return self.get(False, s)
|
2711
|
+
|
2712
|
+
def __iter__(self):
|
2713
|
+
raise Exception("""CasADi matrices are not iterable by design.
|
2714
|
+
Did you mean to iterate over m.nz, with m IM/DM/SX?
|
2715
|
+
Did you mean to iterate over horzsplit(m,1)/vertsplit(m,1) with m IM/DM/SX/MX?
|
2716
|
+
""")
|
2717
|
+
|
2718
|
+
def __setitem__(self,s,val):
|
2719
|
+
if isinstance(s,tuple) and len(s)==2:
|
2720
|
+
return self.set(val, False, s[0], s[1])
|
2721
|
+
return self.set(val, False, s)
|
2722
|
+
|
2723
|
+
@property
|
2724
|
+
def nz(self):
|
2725
|
+
return NZproxy(self)
|
2726
|
+
|
2727
|
+
%}
|
2728
|
+
%enddef
|
2729
|
+
|
2730
|
+
%define %python_array_wrappers(arraypriority)
|
2731
|
+
%pythoncode %{
|
2732
|
+
|
2733
|
+
__array_priority__ = arraypriority
|
2734
|
+
|
2735
|
+
def __array_wrap__(self,out_arr,context=None):
|
2736
|
+
if context is None:
|
2737
|
+
return out_arr
|
2738
|
+
name = context[0].__name__
|
2739
|
+
args = list(context[1])
|
2740
|
+
|
2741
|
+
if len(context[1])==3:
|
2742
|
+
raise Exception("Error with %s. Looks like you are using an assignment operator, such as 'a+=b' where 'a' is a numpy type. This is not supported, and cannot be supported without changing numpy." % name)
|
2743
|
+
|
2744
|
+
if "vectorized" in name:
|
2745
|
+
name = name[:-len(" (vectorized)")]
|
2746
|
+
|
2747
|
+
conversion = {"multiply": "mul", "divide": "div", "true_divide": "div", "subtract":"sub","power":"pow","greater_equal":"ge","less_equal": "le", "less": "lt", "greater": "gt", "equal": "eq", "not_equal": "ne"}
|
2748
|
+
if name in conversion:
|
2749
|
+
name = conversion[name]
|
2750
|
+
if len(context[1])==2 and context[1][1] is self and not(context[1][0] is self):
|
2751
|
+
name = 'r' + name
|
2752
|
+
args.reverse()
|
2753
|
+
if not(hasattr(self,name)) or ('mul' in name):
|
2754
|
+
name = '__' + name + '__'
|
2755
|
+
fun=getattr(self, name)
|
2756
|
+
return fun(*args[1:])
|
2757
|
+
|
2758
|
+
def __array_ufunc__(self, ufunc, method, *inputs, **kwargs):
|
2759
|
+
conversion = {"multiply": "mul", "divide": "div", "true_divide": "div", "subtract":"sub","power":"pow","greater_equal":"ge","less_equal": "le", "less": "lt", "greater": "gt", "equal": "eq", "not_equal": "ne"}
|
2760
|
+
name = ufunc.__name__
|
2761
|
+
inputs = list(inputs)
|
2762
|
+
if len(inputs)==3:
|
2763
|
+
import warnings
|
2764
|
+
warnings.warn("Error with %s. Looks like you are using an assignment operator, such as 'a+=b' where 'a' is a numpy type. This is not supported, and cannot be supported without changing numpy." % name, RuntimeWarning)
|
2765
|
+
return NotImplemented
|
2766
|
+
if "vectorized" in name:
|
2767
|
+
name = name[:-len(" (vectorized)")]
|
2768
|
+
if name in conversion:
|
2769
|
+
name = conversion[name]
|
2770
|
+
if len(inputs)==2 and inputs[1] is self and not(inputs[0] is self):
|
2771
|
+
name = 'r' + name
|
2772
|
+
inputs.reverse()
|
2773
|
+
if not(hasattr(self,name)) or ('mul' in name):
|
2774
|
+
name = '__' + name + '__'
|
2775
|
+
if method=="reduce" and name=="add":
|
2776
|
+
assert len(inputs)==1
|
2777
|
+
axis = kwargs["axis"]
|
2778
|
+
if axis is None:
|
2779
|
+
return inputs[0].sum()
|
2780
|
+
else:
|
2781
|
+
return inputs[0].sum(axis)
|
2782
|
+
try:
|
2783
|
+
assert method=="__call__"
|
2784
|
+
fun=getattr(self, name)
|
2785
|
+
return fun(*inputs[1:])
|
2786
|
+
except Exception as e:
|
2787
|
+
if "Dimension mismatch" in str(e):
|
2788
|
+
import sys
|
2789
|
+
if sys.version_info[0] < 3:
|
2790
|
+
raise RuntimeError(str(e))
|
2791
|
+
else:
|
2792
|
+
raise e
|
2793
|
+
# Fall back to numpy conversion
|
2794
|
+
new_inputs = list(inputs)
|
2795
|
+
try:
|
2796
|
+
new_inputs[0] = new_inputs[0].full()
|
2797
|
+
except:
|
2798
|
+
import warnings
|
2799
|
+
warnings.warn("Implicit conversion of symbolic CasADi type to numeric matrix not supported.\n"
|
2800
|
+
+ "This may occur when you pass a CasADi object to a numpy function.\n"
|
2801
|
+
+ "Use an equivalent CasADi function instead of that numpy function.", RuntimeWarning)
|
2802
|
+
return NotImplemented
|
2803
|
+
return new_inputs[0].__array_ufunc__(ufunc, method, *new_inputs, **kwargs)
|
2804
|
+
|
2805
|
+
|
2806
|
+
def __array__(self,*args,**kwargs):
|
2807
|
+
import numpy as n
|
2808
|
+
if len(args) > 1 and isinstance(args[1],tuple) and isinstance(args[1][0],n.ufunc) and isinstance(args[1][0],n.ufunc) and len(args[1])>1 and args[1][0].nin==len(args[1][1]):
|
2809
|
+
if len(args[1][1])==3:
|
2810
|
+
raise Exception("Error with %s. Looks like you are using an assignment operator, such as 'a+=b'. This is not supported when 'a' is a numpy type, and cannot be supported without changing numpy itself. Either upgrade a to a CasADi type first, or use 'a = a + b'. " % args[1][0].__name__)
|
2811
|
+
return n.array([n.nan])
|
2812
|
+
else:
|
2813
|
+
if hasattr(self,'__array_custom__'):
|
2814
|
+
return self.__array_custom__(*args,**kwargs)
|
2815
|
+
else:
|
2816
|
+
try:
|
2817
|
+
return self.full()
|
2818
|
+
except:
|
2819
|
+
if self.is_scalar(True):
|
2820
|
+
# Needed for #2743
|
2821
|
+
E=n.empty((),dtype=object)
|
2822
|
+
E[()] = self
|
2823
|
+
return E
|
2824
|
+
else:
|
2825
|
+
raise Exception("Implicit conversion of symbolic CasADi type to numeric matrix not supported.\n"
|
2826
|
+
+ "This may occur when you pass a CasADi object to a numpy function.\n"
|
2827
|
+
+ "Use an equivalent CasADi function instead of that numpy function.")
|
2828
|
+
|
2829
|
+
%}
|
2830
|
+
%enddef
|
2831
|
+
#endif // SWIGPYTHON
|
2832
|
+
|
2833
|
+
#ifdef SWIGXML
|
2834
|
+
%define %matrix_helpers(Type)
|
2835
|
+
%enddef
|
2836
|
+
#endif
|
2837
|
+
|
2838
|
+
#ifdef SWIGMATLAB
|
2839
|
+
%{
|
2840
|
+
namespace casadi {
|
2841
|
+
/// Helper function: Convert ':' to Slice
|
2842
|
+
inline Slice char2Slice(char ch) {
|
2843
|
+
casadi_assert_dev(ch==':');
|
2844
|
+
return Slice();
|
2845
|
+
}
|
2846
|
+
} // namespace casadi
|
2847
|
+
%}
|
2848
|
+
|
2849
|
+
%define %matrix_helpers(Type)
|
2850
|
+
// Get a submatrix (index-1)
|
2851
|
+
const Type paren(char rr) const {
|
2852
|
+
casadi_assert_dev(rr==':');
|
2853
|
+
return vec(*$self);
|
2854
|
+
}
|
2855
|
+
const Type paren(const Matrix<casadi_int>& rr) const {
|
2856
|
+
Type m;
|
2857
|
+
$self->get(m, true, rr);
|
2858
|
+
return m;
|
2859
|
+
}
|
2860
|
+
const Type paren(const Sparsity& sp) const {
|
2861
|
+
Type m;
|
2862
|
+
$self->get(m, true, sp);
|
2863
|
+
return m;
|
2864
|
+
}
|
2865
|
+
const Type paren(char rr, char cc) const {
|
2866
|
+
Type m;
|
2867
|
+
$self->get(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));
|
2868
|
+
return m;
|
2869
|
+
}
|
2870
|
+
const Type paren(char rr, const Matrix<casadi_int>& cc) const {
|
2871
|
+
Type m;
|
2872
|
+
$self->get(m, true, casadi::char2Slice(rr), cc);
|
2873
|
+
return m;
|
2874
|
+
}
|
2875
|
+
const Type paren(const Matrix<casadi_int>& rr, char cc) const {
|
2876
|
+
Type m;
|
2877
|
+
$self->get(m, true, rr, casadi::char2Slice(cc));
|
2878
|
+
return m;
|
2879
|
+
}
|
2880
|
+
const Type paren(const Matrix<casadi_int>& rr, const Matrix<casadi_int>& cc) const {
|
2881
|
+
Type m;
|
2882
|
+
$self->get(m, true, rr, cc);
|
2883
|
+
return m;
|
2884
|
+
}
|
2885
|
+
|
2886
|
+
// Set a submatrix (index-1)
|
2887
|
+
void paren_asgn(const Type& m, char rr) {
|
2888
|
+
casadi_assert_dev(rr==':');
|
2889
|
+
$self->set(m, false, casadi::IM(casadi::range($self->numel())));
|
2890
|
+
}
|
2891
|
+
void paren_asgn(const Type& m, const Matrix<casadi_int>& rr) { $self->set(m, true, rr);}
|
2892
|
+
void paren_asgn(const Type& m, const Sparsity& sp) { $self->set(m, true, sp);}
|
2893
|
+
void paren_asgn(const Type& m, char rr, char cc) { $self->set(m, true, casadi::char2Slice(rr), casadi::char2Slice(cc));}
|
2894
|
+
void paren_asgn(const Type& m, char rr, const Matrix<casadi_int>& cc) { $self->set(m, true, casadi::char2Slice(rr), cc);}
|
2895
|
+
void paren_asgn(const Type& m, const Matrix<casadi_int>& rr, char cc) { $self->set(m, true, rr, casadi::char2Slice(cc));}
|
2896
|
+
void paren_asgn(const Type& m, const Matrix<casadi_int>& rr, const Matrix<casadi_int>& cc) { $self->set(m, true, rr, cc);}
|
2897
|
+
|
2898
|
+
// Get nonzeros (index-1)
|
2899
|
+
const Type brace(char rr) const { Type m; $self->get_nz(m, true, casadi::char2Slice(rr)); return m;}
|
2900
|
+
const Type brace(const Matrix<casadi_int>& rr) const { Type m; $self->get_nz(m, true, rr); return m;}
|
2901
|
+
|
2902
|
+
// Set nonzeros (index-1)
|
2903
|
+
void setbrace(const Type& m, char rr) { $self->set_nz(m, true, casadi::char2Slice(rr));}
|
2904
|
+
void setbrace(const Type& m, const Matrix<casadi_int>& rr) { $self->set_nz(m, true, rr);}
|
2905
|
+
|
2906
|
+
// 'end' function (needed for end syntax in MATLAB)
|
2907
|
+
inline casadi_int end(casadi_int i, casadi_int n) const {
|
2908
|
+
return n==1 ? $self->numel() : i==1 ? $self->size1() : $self->size2();
|
2909
|
+
}
|
2910
|
+
|
2911
|
+
|
2912
|
+
// Needed for brace syntax to access nonzeros
|
2913
|
+
casadi_int numel(casadi_int k) const {
|
2914
|
+
return 1;
|
2915
|
+
}
|
2916
|
+
|
2917
|
+
// Needed for brace syntax to access nonzeros
|
2918
|
+
casadi_int numel(char rr) const {
|
2919
|
+
casadi_assert_dev(rr==':');
|
2920
|
+
return 1;
|
2921
|
+
}
|
2922
|
+
|
2923
|
+
// Needed for brace syntax to access nonzeros
|
2924
|
+
casadi_int numel(const std::vector<casadi_int> &k) const {
|
2925
|
+
return 1;
|
2926
|
+
}
|
2927
|
+
|
2928
|
+
// Needed because original numel call gets hidden by the above extend overloads
|
2929
|
+
casadi_int numel() const {
|
2930
|
+
return $self->numel();
|
2931
|
+
}
|
2932
|
+
|
2933
|
+
|
2934
|
+
// Transpose using the A' syntax in addition to A.'
|
2935
|
+
Type ctranspose() const { return $self->T();}
|
2936
|
+
|
2937
|
+
%enddef
|
2938
|
+
#endif
|
2939
|
+
|
2940
|
+
%include <casadi/core/printable.hpp>
|
2941
|
+
|
2942
|
+
namespace casadi{
|
2943
|
+
%extend PrintableCommon {
|
2944
|
+
#ifdef SWIGPYTHON
|
2945
|
+
%pythoncode %{
|
2946
|
+
def __str__(self): return self.str()
|
2947
|
+
def repr(self): return self.type_name() + '(' + self.str() + ')'
|
2948
|
+
%}
|
2949
|
+
#endif // SWIGPYTHON
|
2950
|
+
#ifdef SWIGMATLAB
|
2951
|
+
%matlabcode %{
|
2952
|
+
function s = repr(self)
|
2953
|
+
s = [self.type_name() '(' self.str() ')'];
|
2954
|
+
end
|
2955
|
+
%}
|
2956
|
+
#endif // SWIGMATLAB
|
2957
|
+
}
|
2958
|
+
} // namespace casadi
|
2959
|
+
|
2960
|
+
%include <casadi/core/generic_shared.hpp>
|
2961
|
+
|
2962
|
+
%template(GenSharedObject) casadi::GenericShared<casadi::SharedObject, casadi::SharedObjectInternal>;
|
2963
|
+
%template(GenWeakRef) casadi::GenericWeakRef<casadi::SharedObject, casadi::SharedObjectInternal>;
|
2964
|
+
|
2965
|
+
%include <casadi/core/shared_object.hpp>
|
2966
|
+
%include <casadi/core/casadi_misc.hpp>
|
2967
|
+
%include <casadi/core/casadi_common.hpp>
|
2968
|
+
%include <casadi/core/generic_type.hpp>
|
2969
|
+
%include <casadi/core/calculus.hpp>
|
2970
|
+
%include <casadi/core/sparsity_interface.hpp>
|
2971
|
+
%include <casadi/core/sparsity.hpp>
|
2972
|
+
|
2973
|
+
// Logic for pickling
|
2974
|
+
#ifdef SWIGPYTHON
|
2975
|
+
namespace casadi{
|
2976
|
+
%extend Sparsity {
|
2977
|
+
%pythoncode %{
|
2978
|
+
def __setstate__(self, state):
|
2979
|
+
self.__init__(Sparsity.deserialize(state["serialization"]))
|
2980
|
+
|
2981
|
+
def __getstate__(self):
|
2982
|
+
return {"serialization": self.serialize()}
|
2983
|
+
%}
|
2984
|
+
}
|
2985
|
+
%extend Matrix<SXElem> {
|
2986
|
+
%pythoncode %{
|
2987
|
+
def __setstate__(self, state):
|
2988
|
+
ctx = _current_unpickle_context()
|
2989
|
+
if not ctx:
|
2990
|
+
raise Exception("Cannot unpickle SX objects without a casadi context. " +
|
2991
|
+
"Use something like:\n"+
|
2992
|
+
"with ca.global_unpickle_context(): \n"+
|
2993
|
+
" f_ref = pickle.load(open(filename,'rb'))")
|
2994
|
+
ctx.decode(state)
|
2995
|
+
self.__init__(ctx.unpack())
|
2996
|
+
|
2997
|
+
def __getstate__(self):
|
2998
|
+
ctx = _current_pickle_context()
|
2999
|
+
if not ctx:
|
3000
|
+
raise Exception("Cannot pickle SX objects without a casadi context. " +
|
3001
|
+
"Use something like:\n"+
|
3002
|
+
"with ca.global_pickle_context(): \n"+
|
3003
|
+
" pickle.dump(f,open(filename,'wb'))")
|
3004
|
+
ctx.pack(self)
|
3005
|
+
return ctx.encode()
|
3006
|
+
%}
|
3007
|
+
}
|
3008
|
+
%extend MX {
|
3009
|
+
%pythoncode %{
|
3010
|
+
def __setstate__(self, state):
|
3011
|
+
ctx = _current_unpickle_context()
|
3012
|
+
if not ctx:
|
3013
|
+
raise Exception("Cannot unpickle MX objects without a casadi context. " +
|
3014
|
+
"Use something like:\n"+
|
3015
|
+
"with ca.global_unpickle_context(): \n"+
|
3016
|
+
" f_ref = pickle.load(open(filename,'rb'))")
|
3017
|
+
ctx.decode(state)
|
3018
|
+
self.__init__(ctx.unpack())
|
3019
|
+
|
3020
|
+
def __getstate__(self):
|
3021
|
+
ctx = _current_pickle_context()
|
3022
|
+
if not ctx:
|
3023
|
+
raise Exception("Cannot pickle MX objects without a casadi context. " +
|
3024
|
+
"Use something like:\n"+
|
3025
|
+
"with ca.global_pickle_context(): \n"+
|
3026
|
+
" pickle.dump(f,open(filename,'wb'))")
|
3027
|
+
ctx.pack(self)
|
3028
|
+
return ctx.encode()
|
3029
|
+
%}
|
3030
|
+
}
|
3031
|
+
|
3032
|
+
} // namespace casadi
|
3033
|
+
#endif // SWIGPYTHON
|
3034
|
+
|
3035
|
+
/* There is no reason to expose the Slice class to e.g. Python or MATLAB. Only if an interfaced language
|
3036
|
+
lacks a slice type, the type should be exposed here */
|
3037
|
+
// #if !(defined(SWIGPYTHON) || defined(SWIGMATLAB))
|
3038
|
+
%include <casadi/core/slice.hpp>
|
3039
|
+
//#endif
|
3040
|
+
|
3041
|
+
|
3042
|
+
%include <casadi/core/generic_matrix.hpp>
|
3043
|
+
|
3044
|
+
%template(GenDM) casadi::GenericMatrix<casadi::Matrix<double> >;
|
3045
|
+
%template(GenSX) casadi::GenericMatrix<casadi::Matrix<casadi::SXElem> >;
|
3046
|
+
%template(GenMX) casadi::GenericMatrix<casadi::MX>;
|
3047
|
+
|
3048
|
+
%include <casadi/core/generic_expression.hpp>
|
3049
|
+
|
3050
|
+
// Flags to allow differentiating the wrapping by type
|
3051
|
+
#define IS_GLOBAL 0x1
|
3052
|
+
#define IS_MEMBER 0x10
|
3053
|
+
#define IS_SPARSITY 0x100
|
3054
|
+
#define IS_DMATRIX 0x1000
|
3055
|
+
#define IS_IMATRIX 0x10000
|
3056
|
+
#define IS_SX 0x100000
|
3057
|
+
#define IS_MX 0x1000000
|
3058
|
+
#define IS_DOUBLE 0x10000000
|
3059
|
+
|
3060
|
+
%define SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
|
3061
|
+
#if FLAG & IS_MEMBER
|
3062
|
+
|
3063
|
+
DECL M casadi_horzcat(const std::vector< M > &v) {
|
3064
|
+
return horzcat(v);
|
3065
|
+
}
|
3066
|
+
DECL M casadi_vertcat(const std::vector< M > &v) {
|
3067
|
+
return vertcat(v);
|
3068
|
+
}
|
3069
|
+
DECL std::vector< M >
|
3070
|
+
casadi_horzsplit(const M& v, const std::vector<casadi_int>& offset) {
|
3071
|
+
return horzsplit(v, offset);
|
3072
|
+
}
|
3073
|
+
DECL std::vector< M > casadi_horzsplit(const M& v, casadi_int incr=1) {
|
3074
|
+
return horzsplit(v, incr);
|
3075
|
+
}
|
3076
|
+
DECL std::vector< M > casadi_horzsplit_n(const M& v, casadi_int n) {
|
3077
|
+
return horzsplit_n(v, n);
|
3078
|
+
}
|
3079
|
+
DECL std::vector< M >
|
3080
|
+
casadi_vertsplit(const M& v, const std::vector<casadi_int>& offset) {
|
3081
|
+
return vertsplit(v, offset);
|
3082
|
+
}
|
3083
|
+
DECL std::vector<casadi_int >
|
3084
|
+
casadi_offset(const std::vector< M > &v, bool vert=true) {
|
3085
|
+
return offset(v, vert);
|
3086
|
+
}
|
3087
|
+
DECL std::vector< M >
|
3088
|
+
casadi_vertsplit(const M& v, casadi_int incr=1) {
|
3089
|
+
return vertsplit(v, incr);
|
3090
|
+
}
|
3091
|
+
DECL std::vector< M >
|
3092
|
+
casadi_vertsplit_n(const M& v, casadi_int n) {
|
3093
|
+
return vertsplit_n(v, n);
|
3094
|
+
}
|
3095
|
+
DECL M casadi_blockcat(const M& A, const M& B, const M& C, const M& D) {
|
3096
|
+
return vertcat(horzcat(A, B), horzcat(C, D));
|
3097
|
+
}
|
3098
|
+
DECL std::vector< std::vector< M > >
|
3099
|
+
casadi_blocksplit(const M& x, const std::vector<casadi_int>& vert_offset,
|
3100
|
+
const std::vector<casadi_int>& horz_offset) {
|
3101
|
+
return blocksplit(x, vert_offset, horz_offset);
|
3102
|
+
}
|
3103
|
+
DECL std::vector< std::vector< M > >
|
3104
|
+
casadi_blocksplit(const M& x, casadi_int vert_incr=1, casadi_int horz_incr=1) {
|
3105
|
+
return blocksplit(x, vert_incr, horz_incr);
|
3106
|
+
}
|
3107
|
+
DECL M casadi_diagcat(const std::vector< M > &A) {
|
3108
|
+
return diagcat(A);
|
3109
|
+
}
|
3110
|
+
DECL std::vector< M >
|
3111
|
+
casadi_diagsplit(const M& x, const std::vector<casadi_int>& output_offset1,
|
3112
|
+
const std::vector<casadi_int>& output_offset2) {
|
3113
|
+
return diagsplit(x, output_offset1, output_offset2);
|
3114
|
+
}
|
3115
|
+
DECL std::vector< M >
|
3116
|
+
casadi_diagsplit(const M& x, const std::vector<casadi_int>& output_offset) {
|
3117
|
+
return diagsplit(x, output_offset);
|
3118
|
+
}
|
3119
|
+
DECL std::vector< M > casadi_diagsplit(const M& x, casadi_int incr=1) {
|
3120
|
+
return diagsplit(x, incr);
|
3121
|
+
}
|
3122
|
+
DECL std::vector< M >
|
3123
|
+
casadi_diagsplit(const M& x, casadi_int incr1, casadi_int incr2) {
|
3124
|
+
return diagsplit(x, incr1, incr2);
|
3125
|
+
}
|
3126
|
+
DECL M casadi_veccat(const std::vector< M >& x) {
|
3127
|
+
return veccat(x);
|
3128
|
+
}
|
3129
|
+
DECL M casadi_mtimes(const M& x, const M& y) {
|
3130
|
+
return mtimes(x, y);
|
3131
|
+
}
|
3132
|
+
DECL M casadi_mtimes(const std::vector< M > &args) {
|
3133
|
+
return mtimes(args);
|
3134
|
+
}
|
3135
|
+
DECL M casadi_mac(const M& X, const M& Y, const M& Z) {
|
3136
|
+
return mac(X, Y, Z);
|
3137
|
+
}
|
3138
|
+
DECL M casadi_transpose(const M& X) {
|
3139
|
+
return X.T();
|
3140
|
+
}
|
3141
|
+
DECL M casadi_vec(const M& a) {
|
3142
|
+
return vec(a);
|
3143
|
+
}
|
3144
|
+
DECL M casadi_reshape(const M& a, casadi_int nrow, casadi_int ncol) {
|
3145
|
+
return reshape(a, nrow, ncol);
|
3146
|
+
}
|
3147
|
+
DECL M casadi_reshape(const M& a, std::pair<casadi_int, casadi_int> rc) {
|
3148
|
+
return reshape(a, rc.first, rc.second);
|
3149
|
+
}
|
3150
|
+
DECL M casadi_reshape(const M& a, const Sparsity& sp) {
|
3151
|
+
return reshape(a, sp);
|
3152
|
+
}
|
3153
|
+
DECL M casadi_sparsity_cast(const M& a, const Sparsity& sp) {
|
3154
|
+
return sparsity_cast(a, sp);
|
3155
|
+
}
|
3156
|
+
DECL casadi_int casadi_sprank(const M& A) {
|
3157
|
+
return sprank(A);
|
3158
|
+
}
|
3159
|
+
DECL casadi_int casadi_norm_0_mul(const M& x, const M& y) {
|
3160
|
+
return norm_0_mul(x, y);
|
3161
|
+
}
|
3162
|
+
DECL M casadi_triu(const M& a, bool includeDiagonal=true) {
|
3163
|
+
return triu(a, includeDiagonal);
|
3164
|
+
}
|
3165
|
+
DECL M casadi_tril(const M& a, bool includeDiagonal=true) {
|
3166
|
+
return tril(a, includeDiagonal);
|
3167
|
+
}
|
3168
|
+
DECL M casadi_kron(const M& a, const M& b) {
|
3169
|
+
return kron(a, b);
|
3170
|
+
}
|
3171
|
+
DECL M casadi_repmat(const M& A, casadi_int n, casadi_int m=1) {
|
3172
|
+
return repmat(A, n, m);
|
3173
|
+
}
|
3174
|
+
DECL M casadi_repmat(const M& A, const std::pair<casadi_int, casadi_int>& rc) {
|
3175
|
+
return repmat(A, rc.first, rc.second);
|
3176
|
+
}
|
3177
|
+
DECL M casadi_sum2(const M& x) {
|
3178
|
+
return sum2(x);
|
3179
|
+
}
|
3180
|
+
DECL M casadi_sum1(const M& x) {
|
3181
|
+
return sum1(x);
|
3182
|
+
}
|
3183
|
+
#endif
|
3184
|
+
%enddef
|
3185
|
+
|
3186
|
+
%define SPARSITY_INTERFACE_ALL(DECL, FLAG)
|
3187
|
+
SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_SPARSITY), Sparsity)
|
3188
|
+
SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_MX), MX)
|
3189
|
+
SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
|
3190
|
+
SPARSITY_INTERFACE_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
|
3191
|
+
%enddef
|
3192
|
+
|
3193
|
+
#ifdef SWIGMATLAB
|
3194
|
+
%define SPARSITY_INTERFACE_FUN(DECL, FLAG, M)
|
3195
|
+
SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
|
3196
|
+
#if FLAG & IS_MEMBER
|
3197
|
+
DECL casadi_int casadi_length(const M &v) {
|
3198
|
+
return std::max(v.size1(), v.size2());
|
3199
|
+
}
|
3200
|
+
DECL M casadi_sum(const M& x, casadi_int dim) {
|
3201
|
+
if (dim==1) return sum1(x);
|
3202
|
+
if (dim==2) return sum2(x);
|
3203
|
+
casadi_error(
|
3204
|
+
"Expected sum(A,1), sum(A,2), sum(A,\"all\") got " + casadi::str(dim) + " instead.");
|
3205
|
+
}
|
3206
|
+
DECL M casadi_sum(const M& x, const std::string& dim) {
|
3207
|
+
casadi_assert(dim=="all",
|
3208
|
+
"Expected sum(...,'all'), got '" + dim + "' instead.");
|
3209
|
+
return sum(x);
|
3210
|
+
}
|
3211
|
+
DECL M casadi_sum(const M& x) {
|
3212
|
+
if (x.is_vector()) return sum(x);
|
3213
|
+
return sum1(x);
|
3214
|
+
}
|
3215
|
+
#endif
|
3216
|
+
%enddef
|
3217
|
+
#else
|
3218
|
+
%define SPARSITY_INTERFACE_FUN(DECL, FLAG, M)
|
3219
|
+
SPARSITY_INTERFACE_FUN_BASE(DECL, FLAG, M)
|
3220
|
+
#if FLAG & IS_MEMBER
|
3221
|
+
DECL M casadi_sum(const M& x, casadi_int dim) {
|
3222
|
+
if (dim==0) return sum1(x);
|
3223
|
+
if (dim==1) return sum2(x);
|
3224
|
+
casadi_error(
|
3225
|
+
"Expected sum(A,0), sum(A,1), sum(A,\"all\") got " + casadi::str(dim) + " instead.");
|
3226
|
+
}
|
3227
|
+
DECL M casadi_sum(const M& x) {
|
3228
|
+
return sum(x);
|
3229
|
+
}
|
3230
|
+
#endif
|
3231
|
+
%enddef
|
3232
|
+
#endif
|
3233
|
+
|
3234
|
+
%define GENERIC_MATRIX_FUN(DECL, FLAG, M)
|
3235
|
+
#if FLAG & IS_MEMBER
|
3236
|
+
DECL M casadi_mpower(const M& x, const M& n) {
|
3237
|
+
return mpower(x, n);
|
3238
|
+
}
|
3239
|
+
|
3240
|
+
DECL M casadi_mrdivide(const M& x, const M& y) {
|
3241
|
+
return mrdivide(x, y);
|
3242
|
+
}
|
3243
|
+
|
3244
|
+
DECL M casadi_mldivide(const M& x, const M& y) {
|
3245
|
+
return mldivide(x, y);
|
3246
|
+
}
|
3247
|
+
|
3248
|
+
DECL std::vector< M > casadi_symvar(const M& x) {
|
3249
|
+
return symvar(x);
|
3250
|
+
}
|
3251
|
+
|
3252
|
+
DECL M casadi_bilin(const M& A, const M& x, const M& y) {
|
3253
|
+
return bilin(A, x, y);
|
3254
|
+
}
|
3255
|
+
|
3256
|
+
DECL M casadi_bilin(const M& A, const M& x) {
|
3257
|
+
return bilin(A, x);
|
3258
|
+
}
|
3259
|
+
|
3260
|
+
DECL M casadi_rank1(const M& A, const M& alpha, const M& x, const M& y) {
|
3261
|
+
return rank1(A, alpha, x, y);
|
3262
|
+
}
|
3263
|
+
|
3264
|
+
DECL M casadi_sumsqr(const M& X) {
|
3265
|
+
return sumsqr(X);
|
3266
|
+
}
|
3267
|
+
|
3268
|
+
DECL M casadi_linspace(const M& a, const M& b, casadi_int nsteps) {
|
3269
|
+
return linspace(a, b, nsteps);
|
3270
|
+
}
|
3271
|
+
|
3272
|
+
DECL M casadi_logsumexp(const M& a) {
|
3273
|
+
return logsumexp(a);
|
3274
|
+
}
|
3275
|
+
|
3276
|
+
DECL M casadi_logsumexp(const M& a, const M& margin) {
|
3277
|
+
return logsumexp(a, margin);
|
3278
|
+
}
|
3279
|
+
|
3280
|
+
DECL M casadi_interp1d(const std::vector<double>& x, const M&v,
|
3281
|
+
const std::vector<double>& xq, const std::string& mode="linear", bool equidistant=false) {
|
3282
|
+
return interp1d(x, v, xq, mode, equidistant);
|
3283
|
+
}
|
3284
|
+
|
3285
|
+
DECL M casadi_soc(const M& x, const M& y) {
|
3286
|
+
return soc(x, y);
|
3287
|
+
}
|
3288
|
+
|
3289
|
+
DECL M casadi_cross(const M& a, const M& b, casadi_int dim = -1) {
|
3290
|
+
return cross(a, b, dim);
|
3291
|
+
}
|
3292
|
+
|
3293
|
+
DECL M casadi_skew(const M& a) {
|
3294
|
+
return skew(a);
|
3295
|
+
}
|
3296
|
+
|
3297
|
+
DECL M casadi_inv_skew(const M& a) {
|
3298
|
+
return inv_skew(a);
|
3299
|
+
}
|
3300
|
+
|
3301
|
+
DECL M casadi_det(const M& A) {
|
3302
|
+
return det(A);
|
3303
|
+
}
|
3304
|
+
|
3305
|
+
DECL M casadi_inv_minor(const M& A) {
|
3306
|
+
return inv_minor(A);
|
3307
|
+
}
|
3308
|
+
|
3309
|
+
DECL M casadi_inv(const M& A) {
|
3310
|
+
return inv(A);
|
3311
|
+
}
|
3312
|
+
|
3313
|
+
DECL M casadi_inv(const M& A, const std::string& lsolver,
|
3314
|
+
const casadi::Dict& opts = casadi::Dict()) {
|
3315
|
+
return inv(A, lsolver, opts);
|
3316
|
+
}
|
3317
|
+
|
3318
|
+
DECL M casadi_trace(const M& a) {
|
3319
|
+
return trace(a);
|
3320
|
+
}
|
3321
|
+
|
3322
|
+
DECL M casadi_tril2symm(const M& a) {
|
3323
|
+
return tril2symm(a);
|
3324
|
+
}
|
3325
|
+
|
3326
|
+
DECL M casadi_triu2symm(const M& a) {
|
3327
|
+
return triu2symm(a);
|
3328
|
+
}
|
3329
|
+
|
3330
|
+
DECL M casadi_norm_fro(const M& x) {
|
3331
|
+
return norm_fro(x);
|
3332
|
+
}
|
3333
|
+
|
3334
|
+
DECL M casadi_norm_2(const M& x) {
|
3335
|
+
return norm_2(x);
|
3336
|
+
}
|
3337
|
+
|
3338
|
+
DECL M casadi_norm_1(const M& x) {
|
3339
|
+
return norm_1(x);
|
3340
|
+
}
|
3341
|
+
|
3342
|
+
DECL M casadi_norm_inf(const M& x) {
|
3343
|
+
return norm_inf(x);
|
3344
|
+
}
|
3345
|
+
|
3346
|
+
DECL M casadi_dot(const M& x, const M& y) {
|
3347
|
+
return dot(x, y);
|
3348
|
+
}
|
3349
|
+
|
3350
|
+
DECL M casadi_nullspace(const M& A) {
|
3351
|
+
return nullspace(A);
|
3352
|
+
}
|
3353
|
+
|
3354
|
+
DECL M casadi_polyval(const M& p, const M& x) {
|
3355
|
+
return polyval(p, x);
|
3356
|
+
}
|
3357
|
+
|
3358
|
+
DECL M casadi_diag(const M& A) {
|
3359
|
+
return diag(A);
|
3360
|
+
}
|
3361
|
+
|
3362
|
+
DECL M casadi_unite(const M& A, const M& B) {
|
3363
|
+
return unite(A, B);
|
3364
|
+
}
|
3365
|
+
|
3366
|
+
DECL M casadi_densify(const M& x) {
|
3367
|
+
return densify(x);
|
3368
|
+
}
|
3369
|
+
|
3370
|
+
DECL M casadi_project(const M& A, const Sparsity& sp, bool intersect=false) {
|
3371
|
+
return project(A, sp, intersect);
|
3372
|
+
}
|
3373
|
+
|
3374
|
+
DECL M casadi_if_else(const M& cond, const M& if_true,
|
3375
|
+
const M& if_false, bool short_circuit=false) {
|
3376
|
+
return if_else(cond, if_true, if_false, short_circuit);
|
3377
|
+
}
|
3378
|
+
|
3379
|
+
DECL M casadi_conditional(const M& ind, const std::vector< M > &x,
|
3380
|
+
const M& x_default, bool short_circuit=false) {
|
3381
|
+
return conditional(ind, x, x_default, short_circuit);
|
3382
|
+
}
|
3383
|
+
|
3384
|
+
DECL bool casadi_depends_on(const M& f, const M& arg) {
|
3385
|
+
return depends_on(f, arg);
|
3386
|
+
}
|
3387
|
+
|
3388
|
+
DECL bool casadi_contains(const std::vector<M>& v, const M& n) {
|
3389
|
+
return contains(v, n);
|
3390
|
+
}
|
3391
|
+
|
3392
|
+
DECL bool casadi_contains_all(const std::vector<M>& v, const std::vector<M>& n) {
|
3393
|
+
return contains_all(v, n);
|
3394
|
+
}
|
3395
|
+
|
3396
|
+
DECL bool casadi_contains_any(const std::vector<M>& v, const std::vector<M>& n) {
|
3397
|
+
return contains_any(v, n);
|
3398
|
+
}
|
3399
|
+
|
3400
|
+
DECL M casadi_solve(const M& A, const M& b) {
|
3401
|
+
return solve(A, b);
|
3402
|
+
}
|
3403
|
+
|
3404
|
+
DECL M casadi_solve(const M& A, const M& b,
|
3405
|
+
const std::string& lsolver,
|
3406
|
+
const casadi::Dict& opts = casadi::Dict()) {
|
3407
|
+
return solve(A, b, lsolver, opts);
|
3408
|
+
}
|
3409
|
+
|
3410
|
+
DECL M casadi_pinv(const M& A) {
|
3411
|
+
return pinv(A);
|
3412
|
+
}
|
3413
|
+
|
3414
|
+
DECL M casadi_pinv(const M& A, const std::string& lsolver,
|
3415
|
+
const casadi::Dict& opts = casadi::Dict()) {
|
3416
|
+
return pinv(A, lsolver, opts);
|
3417
|
+
}
|
3418
|
+
|
3419
|
+
DECL M casadi_expm_const(const M& A, const M& t) {
|
3420
|
+
return expm_const(A, t);
|
3421
|
+
}
|
3422
|
+
|
3423
|
+
DECL M casadi_expm(const M& A) {
|
3424
|
+
return expm(A);
|
3425
|
+
}
|
3426
|
+
|
3427
|
+
DECL M casadi_jacobian(const M &ex, const M &arg, const Dict& opts=Dict()) {
|
3428
|
+
return jacobian(ex, arg, opts);
|
3429
|
+
}
|
3430
|
+
|
3431
|
+
DECL M casadi_jtimes(const M& ex, const M& arg, const M& v, bool tr=false, const Dict& opts=Dict()) {
|
3432
|
+
return jtimes(ex, arg, v, tr);
|
3433
|
+
}
|
3434
|
+
|
3435
|
+
DECL M casadi_linearize(const M& f, const M& x, const M& x0) {
|
3436
|
+
return linearize(f, x, x0);
|
3437
|
+
}
|
3438
|
+
|
3439
|
+
DECL std::vector<bool> casadi_which_depends(const M& expr, const M& var,
|
3440
|
+
casadi_int order=1, bool tr=false) {
|
3441
|
+
return which_depends(expr, var, order, tr);
|
3442
|
+
}
|
3443
|
+
|
3444
|
+
DECL Sparsity casadi_jacobian_sparsity(const M& f, const M& x) {
|
3445
|
+
return jacobian_sparsity(f, x);
|
3446
|
+
}
|
3447
|
+
|
3448
|
+
DECL bool casadi_is_linear(const M& expr, const M& var) {
|
3449
|
+
return is_linear(expr, var);
|
3450
|
+
}
|
3451
|
+
|
3452
|
+
DECL bool casadi_is_quadratic(const M& expr, const M& var) {
|
3453
|
+
return is_quadratic(expr, var);
|
3454
|
+
}
|
3455
|
+
|
3456
|
+
DECL M casadi_gradient(const M &ex, const M &arg, const Dict& opts=Dict()) {
|
3457
|
+
return gradient(ex, arg, opts);
|
3458
|
+
}
|
3459
|
+
|
3460
|
+
DECL M casadi_tangent(const M &ex, const M &arg, const Dict& opts=Dict()) {
|
3461
|
+
return tangent(ex, arg, opts);
|
3462
|
+
}
|
3463
|
+
|
3464
|
+
DECL M casadi_hessian(const M& ex, const M& arg, M& OUTPUT1, const casadi::Dict& opts = casadi::Dict()) {
|
3465
|
+
return hessian(ex, arg, OUTPUT1, opts);
|
3466
|
+
}
|
3467
|
+
|
3468
|
+
DECL void casadi_quadratic_coeff(const M& ex, const M& arg, M& OUTPUT1, M& OUTPUT2, M& OUTPUT3, bool check=true) {
|
3469
|
+
quadratic_coeff(ex, arg, OUTPUT1, OUTPUT2, OUTPUT3, check);
|
3470
|
+
}
|
3471
|
+
|
3472
|
+
DECL void casadi_linear_coeff(const M& ex, const M& arg, M& OUTPUT1, M& OUTPUT2, bool check=true) {
|
3473
|
+
linear_coeff(ex, arg, OUTPUT1, OUTPUT2, check);
|
3474
|
+
}
|
3475
|
+
|
3476
|
+
DECL casadi_int casadi_n_nodes(const M& A) {
|
3477
|
+
return n_nodes(A);
|
3478
|
+
}
|
3479
|
+
|
3480
|
+
DECL std::string casadi_print_operator(const M& xb,
|
3481
|
+
const std::vector<std::string>& args) {
|
3482
|
+
return print_operator(xb, args);
|
3483
|
+
}
|
3484
|
+
DECL M casadi_repsum(const M& A, casadi_int n, casadi_int m=1) {
|
3485
|
+
return repsum(A, n, m);
|
3486
|
+
}
|
3487
|
+
DECL M casadi_diff(const M& A, casadi_int n=1, casadi_index axis=-1) {
|
3488
|
+
return diff(A, n, axis);
|
3489
|
+
}
|
3490
|
+
DECL M casadi_cumsum(const M& A, casadi_index axis=-1) {
|
3491
|
+
return cumsum(A, axis);
|
3492
|
+
}
|
3493
|
+
DECL M casadi_einstein(const M& A, const M& B, const M& C,
|
3494
|
+
const std::vector<casadi_int>& dim_a, const std::vector<casadi_int>& dim_b, const std::vector<casadi_int>& dim_c,
|
3495
|
+
const std::vector<casadi_int>& a, const std::vector<casadi_int>& b, const std::vector<casadi_int>& c) {
|
3496
|
+
return einstein(A, B, C, dim_a, dim_b, dim_c, a, b, c);
|
3497
|
+
}
|
3498
|
+
DECL M casadi_einstein(const M& A, const M& B,
|
3499
|
+
const std::vector<casadi_int>& dim_a, const std::vector<casadi_int>& dim_b, const std::vector<casadi_int>& dim_c,
|
3500
|
+
const std::vector<casadi_int>& a, const std::vector<casadi_int>& b, const std::vector<casadi_int>& c) {
|
3501
|
+
return einstein(A, B, dim_a, dim_b, dim_c, a, b, c);
|
3502
|
+
}
|
3503
|
+
DECL M casadi_mmin(const M& x) { return mmin(x); }
|
3504
|
+
DECL M casadi_mmax(const M& x) { return mmax(x); }
|
3505
|
+
DECL casadi::DM casadi_evalf(const M& x) {
|
3506
|
+
return evalf(x);
|
3507
|
+
}
|
3508
|
+
DECL void casadi_separate_linear(const M &expr,
|
3509
|
+
const M &sym_lin, const M &sym_const,
|
3510
|
+
M& OUTPUT1, M& OUTPUT2, M& OUTPUT3) {
|
3511
|
+
separate_linear(expr, sym_lin, sym_const, OUTPUT1, OUTPUT2, OUTPUT3);
|
3512
|
+
}
|
3513
|
+
DECL void casadi_separate_linear(const M &expr,
|
3514
|
+
const std::vector<M> &sym_lin, const std::vector<M> &sym_const,
|
3515
|
+
M& OUTPUT1, M& OUTPUT2, M& OUTPUT3) {
|
3516
|
+
separate_linear(expr, sym_lin, sym_const, OUTPUT1, OUTPUT2, OUTPUT3);
|
3517
|
+
}
|
3518
|
+
#endif // FLAG & IS_MEMBER
|
3519
|
+
|
3520
|
+
#if FLAG & IS_GLOBAL
|
3521
|
+
DECL std::vector<M> casadi_cse(const std::vector<M>& e) {
|
3522
|
+
return cse(e);
|
3523
|
+
}
|
3524
|
+
DECL M casadi_cse(const M& e) {
|
3525
|
+
return cse(e);
|
3526
|
+
}
|
3527
|
+
|
3528
|
+
DECL void casadi_extract_parametric(const M &expr, const M& par,
|
3529
|
+
M& OUTPUT1, std::vector<M>& OUTPUT2, std::vector<M>& OUTPUT3, const Dict& opts=Dict()) {
|
3530
|
+
extract_parametric(expr, par, OUTPUT1, OUTPUT2, OUTPUT3, opts);
|
3531
|
+
}
|
3532
|
+
DECL void casadi_extract_parametric(const M &expr, const std::vector<M>& par,
|
3533
|
+
M& OUTPUT1, std::vector<M>& OUTPUT2, std::vector<M>& OUTPUT3, const Dict& opts=Dict()) {
|
3534
|
+
extract_parametric(expr, par, OUTPUT1, OUTPUT2, OUTPUT3, opts);
|
3535
|
+
}
|
3536
|
+
DECL void casadi_extract_parametric(const std::vector<M> &expr, const M& par,
|
3537
|
+
std::vector<M>& OUTPUT1, std::vector<M>& OUTPUT2, std::vector<M>& OUTPUT3, const Dict& opts=Dict()) {
|
3538
|
+
extract_parametric(expr, par, OUTPUT1, OUTPUT2, OUTPUT3, opts);
|
3539
|
+
}
|
3540
|
+
DECL void casadi_extract_parametric(const std::vector<M> &expr, const std::vector<M>& par,
|
3541
|
+
std::vector<M>& OUTPUT1, std::vector<M>& OUTPUT2, std::vector<M>& OUTPUT3, const Dict& opts=Dict()) {
|
3542
|
+
extract_parametric(expr, par, OUTPUT1, OUTPUT2, OUTPUT3, opts);
|
3543
|
+
}
|
3544
|
+
|
3545
|
+
DECL std::vector<std::vector< M > >
|
3546
|
+
casadi_forward(const std::vector< M > &ex, const std::vector< M > &arg,
|
3547
|
+
const std::vector<std::vector< M > > &v,
|
3548
|
+
const Dict& opts = Dict()) {
|
3549
|
+
return forward(ex, arg, v, opts);
|
3550
|
+
}
|
3551
|
+
|
3552
|
+
DECL std::vector<std::vector< M > >
|
3553
|
+
casadi_reverse(const std::vector< M > &ex, const std::vector< M > &arg,
|
3554
|
+
const std::vector<std::vector< M > > &v,
|
3555
|
+
const Dict& opts = Dict()) {
|
3556
|
+
return reverse(ex, arg, v, opts);
|
3557
|
+
}
|
3558
|
+
|
3559
|
+
DECL M casadi_substitute(const M& ex, const M& v, const M& vdef) {
|
3560
|
+
return substitute(ex, v, vdef);
|
3561
|
+
}
|
3562
|
+
|
3563
|
+
DECL std::vector< M > casadi_substitute(const std::vector< M >& ex,
|
3564
|
+
const std::vector< M >& v,
|
3565
|
+
const std::vector< M >& vdef) {
|
3566
|
+
return substitute(ex, v, vdef);
|
3567
|
+
}
|
3568
|
+
|
3569
|
+
DECL void casadi_substitute_inplace(const std::vector< M >& v,
|
3570
|
+
std::vector< M >& INOUT1,
|
3571
|
+
std::vector< M >& INOUT2,
|
3572
|
+
bool reverse=false) {
|
3573
|
+
return substitute_inplace(v, INOUT1, INOUT2, reverse);
|
3574
|
+
}
|
3575
|
+
|
3576
|
+
DECL void casadi_extract(const std::vector< M >& ex,
|
3577
|
+
std::vector< M >& OUTPUT1,
|
3578
|
+
std::vector< M >& OUTPUT2,
|
3579
|
+
std::vector< M >& OUTPUT3,
|
3580
|
+
const Dict& opts = Dict()) {
|
3581
|
+
OUTPUT1 = ex;
|
3582
|
+
extract(OUTPUT1, OUTPUT2, OUTPUT3, opts);
|
3583
|
+
}
|
3584
|
+
|
3585
|
+
DECL void casadi_shared(const std::vector< M >& ex,
|
3586
|
+
std::vector< M >& OUTPUT1,
|
3587
|
+
std::vector< M >& OUTPUT2,
|
3588
|
+
std::vector< M >& OUTPUT3,
|
3589
|
+
const std::string& v_prefix="v_",
|
3590
|
+
const std::string& v_suffix="") {
|
3591
|
+
OUTPUT1 = ex;
|
3592
|
+
shared(OUTPUT1, OUTPUT2, OUTPUT3, v_prefix, v_suffix);
|
3593
|
+
}
|
3594
|
+
|
3595
|
+
DECL M casadi_blockcat(const std::vector< std::vector< M > > &v) {
|
3596
|
+
return blockcat(v);
|
3597
|
+
}
|
3598
|
+
#endif // FLAG & IS_GLOBAL
|
3599
|
+
%enddef
|
3600
|
+
|
3601
|
+
%define GENERIC_MATRIX_ALL(DECL, FLAG)
|
3602
|
+
GENERIC_MATRIX_FUN(DECL, (FLAG | IS_MX), MX)
|
3603
|
+
GENERIC_MATRIX_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
|
3604
|
+
GENERIC_MATRIX_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
|
3605
|
+
%enddef
|
3606
|
+
|
3607
|
+
%define GENERIC_EXPRESSION_FUN(DECL, FLAG, M)
|
3608
|
+
#if FLAG & IS_MEMBER
|
3609
|
+
DECL M casadi_plus(const M& x, const M& y) { return x+y; }
|
3610
|
+
DECL M casadi_minus(const M& x, const M& y) { return x-y; }
|
3611
|
+
DECL M casadi_times(const M& x, const M& y) { return x*y; }
|
3612
|
+
DECL M casadi_rdivide(const M& x, const M& y) { return x/y; }
|
3613
|
+
DECL M casadi_ldivide(const M& x, const M& y) { return y/x; }
|
3614
|
+
DECL M casadi_lt(const M& x, const M& y) { return x<y; }
|
3615
|
+
DECL M casadi_le(const M& x, const M& y) { return x<=y; }
|
3616
|
+
DECL M casadi_gt(const M& x, const M& y) { return x>y; }
|
3617
|
+
DECL M casadi_ge(const M& x, const M& y) { return x>=y; }
|
3618
|
+
DECL M casadi_eq(const M& x, const M& y) { return x==y; }
|
3619
|
+
DECL M casadi_ne(const M& x, const M& y) { return x!=y; }
|
3620
|
+
DECL M casadi_and(const M& x, const M& y) { return x&&y; }
|
3621
|
+
DECL M casadi_or(const M& x, const M& y) { return x||y; }
|
3622
|
+
DECL M casadi_not(const M& x) { return !x; }
|
3623
|
+
DECL M casadi_abs(const M& x) { return fabs(x); }
|
3624
|
+
DECL M casadi_sqrt(const M& x) { return sqrt(x); }
|
3625
|
+
DECL M casadi_sin(const M& x) { return sin(x); }
|
3626
|
+
DECL M casadi_cos(const M& x) { return cos(x); }
|
3627
|
+
DECL M casadi_tan(const M& x) { return tan(x); }
|
3628
|
+
DECL M casadi_atan(const M& x) { return atan(x); }
|
3629
|
+
DECL M casadi_asin(const M& x) { return asin(x); }
|
3630
|
+
DECL M casadi_acos(const M& x) { return acos(x); }
|
3631
|
+
DECL M casadi_tanh(const M& x) { return tanh(x); }
|
3632
|
+
DECL M casadi_sinh(const M& x) { return sinh(x); }
|
3633
|
+
DECL M casadi_cosh(const M& x) { return cosh(x); }
|
3634
|
+
DECL M casadi_atanh(const M& x) { return atanh(x); }
|
3635
|
+
DECL M casadi_asinh(const M& x) { return asinh(x); }
|
3636
|
+
DECL M casadi_acosh(const M& x) { return acosh(x); }
|
3637
|
+
DECL M casadi_exp(const M& x) { return exp(x); }
|
3638
|
+
DECL M casadi_log(const M& x) { return log(x); }
|
3639
|
+
DECL M casadi_log10(const M& x) { return log10(x); }
|
3640
|
+
DECL M casadi_log1p(const M& x) { return log1p(x); }
|
3641
|
+
DECL M casadi_expm1(const M& x) { return expm1(x); }
|
3642
|
+
DECL M casadi_floor(const M& x) { return floor(x); }
|
3643
|
+
DECL M casadi_ceil(const M& x) { return ceil(x); }
|
3644
|
+
DECL M casadi_erf(const M& x) { return erf(x); }
|
3645
|
+
DECL M casadi_erfinv(const M& x) { using casadi::erfinv; return erfinv(x); }
|
3646
|
+
DECL M casadi_sign(const M& x) { using casadi::sign; return sign(x); }
|
3647
|
+
DECL M casadi_power(const M& x, const M& n) { return pow(x, n); }
|
3648
|
+
DECL M casadi_mod(const M& x, const M& y) { return fmod(x, y); }
|
3649
|
+
DECL M casadi_fmod(const M& x, const M& y) { return fmod(x, y); }
|
3650
|
+
DECL M casadi_remainder(const M& x, const M& y) { return remainder(x, y); }
|
3651
|
+
DECL M casadi_atan2(const M& x, const M& y) { return atan2(x, y); }
|
3652
|
+
DECL M casadi_fmin(const M& x, const M& y) { return fmin(x, y); }
|
3653
|
+
DECL M casadi_fmax(const M& x, const M& y) { return fmax(x, y); }
|
3654
|
+
DECL M casadi_hypot(const M& x, const M& y) { return hypot(x, y); }
|
3655
|
+
DECL M casadi_simplify(const M& x) { using casadi::simplify; return simplify(x); }
|
3656
|
+
DECL bool casadi_is_equal(const M& x, const M& y, casadi_int depth=0) { using casadi::is_equal; return is_equal(x, y, depth); }
|
3657
|
+
DECL M casadi_copysign(const M& x, const M& y) { return copysign(x, y); }
|
3658
|
+
DECL M casadi_constpow(const M& x, const M& y) { using casadi::constpow; return constpow(x, y); }
|
3659
|
+
#endif // FLAG & IS_MEMBER
|
3660
|
+
%enddef
|
3661
|
+
|
3662
|
+
%define GENERIC_EXPRESSION_ALL(DECL, FLAG)
|
3663
|
+
GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_MX), MX)
|
3664
|
+
GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
|
3665
|
+
GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
|
3666
|
+
GENERIC_EXPRESSION_FUN(DECL, (FLAG | IS_DOUBLE), double)
|
3667
|
+
%enddef
|
3668
|
+
|
3669
|
+
%define MATRIX_FUN(DECL, FLAG, M)
|
3670
|
+
#if FLAG & IS_MEMBER
|
3671
|
+
DECL M casadi_all(const M& x) {
|
3672
|
+
return all(x);
|
3673
|
+
}
|
3674
|
+
|
3675
|
+
DECL M casadi_any(const M& x) {
|
3676
|
+
return any(x);
|
3677
|
+
}
|
3678
|
+
|
3679
|
+
DECL M casadi_adj(const M& A) {
|
3680
|
+
return adj(A);
|
3681
|
+
}
|
3682
|
+
|
3683
|
+
DECL M casadi_minor(const M& x, casadi_int i, casadi_int j) {
|
3684
|
+
return minor(x, i, j);
|
3685
|
+
}
|
3686
|
+
|
3687
|
+
DECL M casadi_cofactor(const M& x, casadi_int i, casadi_int j) {
|
3688
|
+
return cofactor(x, i, j);
|
3689
|
+
}
|
3690
|
+
|
3691
|
+
DECL void casadi_qr(const M& A, M& OUTPUT1, M& OUTPUT2) {
|
3692
|
+
return qr(A, OUTPUT1, OUTPUT2);
|
3693
|
+
}
|
3694
|
+
|
3695
|
+
DECL void casadi_qr_sparse(const M& A, M& OUTPUT1, M& OUTPUT2, M& OUTPUT3,
|
3696
|
+
std::vector<casadi_int>& OUTPUT4, std::vector<casadi_int>& OUTPUT5, bool amd=true) {
|
3697
|
+
return qr_sparse(A, OUTPUT1, OUTPUT2, OUTPUT3, OUTPUT4, OUTPUT5, amd);
|
3698
|
+
}
|
3699
|
+
|
3700
|
+
DECL M casadi_qr_solve(const M& b, const M& v, const M& r, const M& beta,
|
3701
|
+
const std::vector<casadi_int>& prinv,
|
3702
|
+
const std::vector<casadi_int>& pc, bool tr=false) {
|
3703
|
+
return qr_solve(b, v, r, beta, prinv, pc, tr);
|
3704
|
+
}
|
3705
|
+
|
3706
|
+
DECL void casadi_ldl(const M& A, M& OUTPUT1, M& OUTPUT2, std::vector<casadi_int>& OUTPUT3, bool amd=true) {
|
3707
|
+
return ldl(A, OUTPUT1, OUTPUT2, OUTPUT3, amd);
|
3708
|
+
}
|
3709
|
+
|
3710
|
+
DECL M casadi_ldl_solve(const M& b, const M& D, const M& LT, const std::vector<casadi_int>& p) {
|
3711
|
+
return ldl_solve(b, D, LT, p);
|
3712
|
+
}
|
3713
|
+
|
3714
|
+
DECL M casadi_chol(const M& A) {
|
3715
|
+
return chol(A);
|
3716
|
+
}
|
3717
|
+
|
3718
|
+
DECL M casadi_norm_inf_mul(const M& x, const M& y) {
|
3719
|
+
return norm_inf_mul(x, y);
|
3720
|
+
}
|
3721
|
+
|
3722
|
+
DECL M casadi_sparsify(const M& A, double tol=0) {
|
3723
|
+
return sparsify(A, tol);
|
3724
|
+
}
|
3725
|
+
|
3726
|
+
DECL void casadi_expand(const M& ex, M& OUTPUT1, M& OUTPUT2) {
|
3727
|
+
expand(ex, OUTPUT1, OUTPUT2);
|
3728
|
+
}
|
3729
|
+
|
3730
|
+
DECL M casadi_pw_const(const M &t, const M& tval, const M& val) {
|
3731
|
+
return pw_const(t, tval, val);
|
3732
|
+
}
|
3733
|
+
|
3734
|
+
DECL M casadi_pw_lin(const M& t, const M& tval, const M& val) {
|
3735
|
+
return pw_lin(t, tval, val);
|
3736
|
+
}
|
3737
|
+
|
3738
|
+
DECL M casadi_heaviside(const M& x) {
|
3739
|
+
return heaviside(x);
|
3740
|
+
}
|
3741
|
+
|
3742
|
+
DECL M casadi_rectangle(const M& x) {
|
3743
|
+
return rectangle(x);
|
3744
|
+
}
|
3745
|
+
|
3746
|
+
DECL M casadi_triangle(const M& x) {
|
3747
|
+
return triangle(x);
|
3748
|
+
}
|
3749
|
+
|
3750
|
+
DECL M casadi_ramp(const M& x) {
|
3751
|
+
return ramp(x);
|
3752
|
+
}
|
3753
|
+
|
3754
|
+
DECL M casadi_gauss_quadrature(const M& f, const M& x,
|
3755
|
+
const M& a, const M& b,
|
3756
|
+
casadi_int order=5) {
|
3757
|
+
return gauss_quadrature(f, x, a, b, order);
|
3758
|
+
}
|
3759
|
+
|
3760
|
+
DECL M casadi_gauss_quadrature(const M& f, const M& x,
|
3761
|
+
const M& a, const M& b,
|
3762
|
+
casadi_int order, const M& w) {
|
3763
|
+
return gauss_quadrature(f, x, a, b, order, w);
|
3764
|
+
}
|
3765
|
+
|
3766
|
+
DECL M casadi_taylor(const M& ex, const M& x, const M& a=0, casadi_int order=1) {
|
3767
|
+
return taylor(ex, x, a, order);
|
3768
|
+
}
|
3769
|
+
|
3770
|
+
DECL M casadi_mtaylor(const M& ex, const M& x, const M& a, casadi_int order=1) {
|
3771
|
+
return mtaylor(ex, x, a, order);
|
3772
|
+
}
|
3773
|
+
|
3774
|
+
DECL M casadi_mtaylor(const M& ex, const M& x, const M& a, casadi_int order,
|
3775
|
+
const std::vector<casadi_int>& order_contributions) {
|
3776
|
+
return mtaylor(ex, x, a, order, order_contributions);
|
3777
|
+
}
|
3778
|
+
|
3779
|
+
DECL M casadi_poly_coeff(const M& ex,
|
3780
|
+
const M&x) {
|
3781
|
+
return poly_coeff(ex, x);
|
3782
|
+
}
|
3783
|
+
|
3784
|
+
DECL M casadi_poly_roots(const M& p) {
|
3785
|
+
return poly_roots(p);
|
3786
|
+
}
|
3787
|
+
|
3788
|
+
DECL M casadi_eig_symbolic(const M& m) {
|
3789
|
+
return eig_symbolic(m);
|
3790
|
+
}
|
3791
|
+
|
3792
|
+
#endif
|
3793
|
+
%enddef
|
3794
|
+
|
3795
|
+
%define MATRIX_ALL(DECL, FLAG)
|
3796
|
+
MATRIX_FUN(DECL, (FLAG | IS_DMATRIX), Matrix<double>)
|
3797
|
+
MATRIX_FUN(DECL, (FLAG | IS_SX), Matrix<SXElem>)
|
3798
|
+
%enddef
|
3799
|
+
|
3800
|
+
%define MX_FUN(DECL, FLAG, M)
|
3801
|
+
#if FLAG & IS_MEMBER
|
3802
|
+
DECL M casadi_find(const M& x) {
|
3803
|
+
return find(x);
|
3804
|
+
}
|
3805
|
+
DECL M casadi_low(const M& v, const M& p, const Dict& options = Dict()) {
|
3806
|
+
return low(v, p, options);
|
3807
|
+
}
|
3808
|
+
DECL M casadi_inv_node(const M& x) {
|
3809
|
+
return inv_node(x);
|
3810
|
+
}
|
3811
|
+
#endif // FLAG & IS_MEMBER
|
3812
|
+
|
3813
|
+
#if FLAG & IS_GLOBAL
|
3814
|
+
DECL std::vector< M >
|
3815
|
+
casadi_matrix_expand(const std::vector< M >& e,
|
3816
|
+
const std::vector< M > &boundary = std::vector< M >(),
|
3817
|
+
const Dict& options = Dict()) {
|
3818
|
+
return matrix_expand(e, boundary, options);
|
3819
|
+
}
|
3820
|
+
|
3821
|
+
DECL M casadi_matrix_expand(const M& e,
|
3822
|
+
const std::vector< M > &boundary = std::vector< M >(),
|
3823
|
+
const Dict& options = Dict()) {
|
3824
|
+
return matrix_expand(e, boundary, options);
|
3825
|
+
}
|
3826
|
+
|
3827
|
+
DECL M casadi_graph_substitute(const M& ex, const std::vector< M >& v,
|
3828
|
+
const std::vector< M > &vdef) {
|
3829
|
+
return graph_substitute(ex, v, vdef);
|
3830
|
+
}
|
3831
|
+
|
3832
|
+
DECL std::vector< M >
|
3833
|
+
casadi_graph_substitute(const std::vector< M > &ex,
|
3834
|
+
const std::vector< M > &v,
|
3835
|
+
const std::vector< M > &vdef) {
|
3836
|
+
return graph_substitute(ex, v, vdef);
|
3837
|
+
}
|
3838
|
+
DECL M casadi_bspline(const M& x,
|
3839
|
+
const DM& coeffs,
|
3840
|
+
const std::vector< std::vector<double> >& knots,
|
3841
|
+
const std::vector<casadi_int>& degree,
|
3842
|
+
casadi_int m,
|
3843
|
+
const Dict& opts = Dict()) {
|
3844
|
+
return bspline(x, coeffs, knots, degree, m, opts);
|
3845
|
+
}
|
3846
|
+
DECL M casadi_bspline(const M& x,
|
3847
|
+
const M& coeffs,
|
3848
|
+
const std::vector< std::vector<double> >& knots,
|
3849
|
+
const std::vector<casadi_int>& degree,
|
3850
|
+
casadi_int m,
|
3851
|
+
const Dict& opts = Dict()) {
|
3852
|
+
return bspline(x, coeffs, knots, degree, m, opts);
|
3853
|
+
}
|
3854
|
+
DECL M casadi_convexify(const M& H,
|
3855
|
+
const Dict& opts = Dict()) {
|
3856
|
+
return convexify(H, opts);
|
3857
|
+
}
|
3858
|
+
DECL M casadi_stop_diff(const M& expr, casadi_int order) {
|
3859
|
+
return stop_diff(expr, order);
|
3860
|
+
}
|
3861
|
+
DECL M casadi_stop_diff(const M& expr, const M& var, casadi_int order) {
|
3862
|
+
return stop_diff(expr, var, order);
|
3863
|
+
}
|
3864
|
+
DECL std::vector< M > casadi_difference(const std::vector< M >& a, const std::vector< M >& b) {
|
3865
|
+
return difference(a, b);
|
3866
|
+
}
|
3867
|
+
DECL M casadi_no_hess(const M& expr) {
|
3868
|
+
return no_hess(expr);
|
3869
|
+
}
|
3870
|
+
DECL M casadi_no_grad(const M& expr) {
|
3871
|
+
return no_grad(expr);
|
3872
|
+
}
|
3873
|
+
|
3874
|
+
#endif
|
3875
|
+
%enddef
|
3876
|
+
|
3877
|
+
%define MX_ALL(DECL, FLAG)
|
3878
|
+
MX_FUN(DECL, (FLAG | IS_MX), MX)
|
3879
|
+
%enddef
|
3880
|
+
%include <casadi/core/matrix_fwd.hpp>
|
3881
|
+
%include <casadi/core/matrix_decl.hpp>
|
3882
|
+
%include <casadi/core/dm_fwd.hpp>
|
3883
|
+
%include <casadi/core/sx_fwd.hpp>
|
3884
|
+
|
3885
|
+
// Remove from API
|
3886
|
+
%warnfilter(401) casadi::Matrix<casadi_int>;
|
3887
|
+
%template() casadi::Matrix<casadi_int>;
|
3888
|
+
|
3889
|
+
%template(DM) casadi::Matrix<double>;
|
3890
|
+
%extend casadi::Matrix<double> {
|
3891
|
+
%template(DM) Matrix<SXElem>;
|
3892
|
+
};
|
3893
|
+
|
3894
|
+
|
3895
|
+
namespace casadi{
|
3896
|
+
%extend Matrix<double> {
|
3897
|
+
void assign(const casadi::Matrix<double>&rhs) { (*$self)=rhs; }
|
3898
|
+
%matrix_helpers(casadi::Matrix<double>)
|
3899
|
+
|
3900
|
+
}
|
3901
|
+
|
3902
|
+
}
|
3903
|
+
|
3904
|
+
#ifdef SWIGPYTHON
|
3905
|
+
%feature("nothread") casadi::Matrix<double>::full;
|
3906
|
+
%feature("nothread") casadi::Matrix<double>::sparse;
|
3907
|
+
#endif
|
3908
|
+
|
3909
|
+
// Extend DM with SWIG unique features
|
3910
|
+
namespace casadi{
|
3911
|
+
%extend Matrix<double> {
|
3912
|
+
// Convert to a dense matrix
|
3913
|
+
GUESTOBJECT* full() const {
|
3914
|
+
return full(*$self);
|
3915
|
+
}
|
3916
|
+
|
3917
|
+
// Convert to a sparse matrix
|
3918
|
+
GUESTOBJECT* sparse() const {
|
3919
|
+
return sparse(*$self);
|
3920
|
+
}
|
3921
|
+
}
|
3922
|
+
|
3923
|
+
} // namespace casadi
|
3924
|
+
|
3925
|
+
|
3926
|
+
#ifdef SWIGPYTHON
|
3927
|
+
namespace casadi{
|
3928
|
+
%extend Matrix<double> {
|
3929
|
+
|
3930
|
+
%python_array_wrappers(999.0)
|
3931
|
+
|
3932
|
+
// The following code has some trickery to fool numpy ufunc.
|
3933
|
+
// Normally, because of the presence of __array__, an ufunctor like nump.sqrt
|
3934
|
+
// will unleash its activity on the output of __array__
|
3935
|
+
// However, we wish DM to remain a DM
|
3936
|
+
// So when we receive a call from a functor, we return a dummy empty array
|
3937
|
+
// and return the real result during the postprocessing (__array_wrap__) of the functor.
|
3938
|
+
%pythoncode %{
|
3939
|
+
def __array_custom__(self,*args,**kwargs):
|
3940
|
+
if "dtype" in kwargs and not(isinstance(kwargs["dtype"],n.double)):
|
3941
|
+
return n.array(self.full(),dtype=kwargs["dtype"])
|
3942
|
+
else:
|
3943
|
+
return self.full()
|
3944
|
+
%}
|
3945
|
+
|
3946
|
+
%pythoncode %{
|
3947
|
+
def tocsc(self):
|
3948
|
+
import numpy as np
|
3949
|
+
import warnings
|
3950
|
+
with warnings.catch_warnings():
|
3951
|
+
warnings.simplefilter("ignore")
|
3952
|
+
from scipy.sparse import csc_matrix
|
3953
|
+
return csc_matrix( (self.nonzeros(),self.row(),self.colind()), shape = self.shape, dtype=np.double )
|
3954
|
+
def toarray(self,simplify=False):
|
3955
|
+
import numpy as np
|
3956
|
+
if simplify:
|
3957
|
+
if self.is_scalar():
|
3958
|
+
return float(self)
|
3959
|
+
elif self.is_vector():
|
3960
|
+
return np.array(self.T.elements())
|
3961
|
+
return np.array(self.T.elements()).reshape(self.shape)
|
3962
|
+
%}
|
3963
|
+
|
3964
|
+
|
3965
|
+
#ifdef WITH_PYTHON3
|
3966
|
+
%pythoncode %{
|
3967
|
+
def __bool__(self):
|
3968
|
+
if self.numel()!=1:
|
3969
|
+
raise Exception("Only a scalar can be cast to a float")
|
3970
|
+
if self.nnz()==0:
|
3971
|
+
return False
|
3972
|
+
return float(self)!=0
|
3973
|
+
%}
|
3974
|
+
#else
|
3975
|
+
%pythoncode %{
|
3976
|
+
def __nonzero__(self):
|
3977
|
+
if self.numel()!=1:
|
3978
|
+
raise Exception("Only a scalar can be cast to a float")
|
3979
|
+
if self.nnz()==0:
|
3980
|
+
return False
|
3981
|
+
return float(self)!=0
|
3982
|
+
%}
|
3983
|
+
#endif
|
3984
|
+
|
3985
|
+
%pythoncode %{
|
3986
|
+
def __abs__(self):
|
3987
|
+
return abs(float(self))
|
3988
|
+
%}
|
3989
|
+
|
3990
|
+
}; // extend Matrix<double>
|
3991
|
+
|
3992
|
+
|
3993
|
+
// Logic for pickling
|
3994
|
+
|
3995
|
+
%extend Matrix<double> {
|
3996
|
+
|
3997
|
+
%pythoncode %{
|
3998
|
+
def __setstate__(self, state):
|
3999
|
+
self.__init__(DM.deserialize(state["serialization"]))
|
4000
|
+
|
4001
|
+
def __getstate__(self):
|
4002
|
+
return {"serialization": self.serialize()}
|
4003
|
+
%}
|
4004
|
+
|
4005
|
+
}
|
4006
|
+
|
4007
|
+
|
4008
|
+
%extend Function {
|
4009
|
+
|
4010
|
+
%pythoncode %{
|
4011
|
+
def __setstate__(self, state):
|
4012
|
+
self.__init__(Function.deserialize(state["serialization"]))
|
4013
|
+
|
4014
|
+
def __getstate__(self):
|
4015
|
+
return {"serialization": self.serialize()}
|
4016
|
+
%}
|
4017
|
+
|
4018
|
+
}
|
4019
|
+
|
4020
|
+
|
4021
|
+
} // namespace casadi
|
4022
|
+
#endif // SWIGPYTHON
|
4023
|
+
|
4024
|
+
|
4025
|
+
#ifdef SWIGMATLAB
|
4026
|
+
namespace casadi{
|
4027
|
+
|
4028
|
+
|
4029
|
+
%extend Matrix<double> {
|
4030
|
+
|
4031
|
+
%matlabcode %{
|
4032
|
+
function s = saveobj(obj)
|
4033
|
+
try
|
4034
|
+
s.serialization = obj.serialize();
|
4035
|
+
catch exception
|
4036
|
+
warning(['Serializing of CasADi DM failed:' getReport(exception) ]);
|
4037
|
+
s = struct;
|
4038
|
+
end
|
4039
|
+
end
|
4040
|
+
%}
|
4041
|
+
%matlabcode_static %{
|
4042
|
+
function obj = loadobj(s)
|
4043
|
+
try
|
4044
|
+
if isstruct(s)
|
4045
|
+
obj = casadi.DM.deserialize(s.serialization);
|
4046
|
+
else
|
4047
|
+
obj = s;
|
4048
|
+
end
|
4049
|
+
catch exception
|
4050
|
+
warning(['Serializing of CasADi DM failed:' getReport(exception) ]);
|
4051
|
+
s = struct;
|
4052
|
+
end
|
4053
|
+
end
|
4054
|
+
%}
|
4055
|
+
}
|
4056
|
+
|
4057
|
+
%extend Sparsity {
|
4058
|
+
%matlabcode %{
|
4059
|
+
function s = saveobj(obj)
|
4060
|
+
try
|
4061
|
+
s.serialization = obj.serialize();
|
4062
|
+
catch exception
|
4063
|
+
warning(['Serializing of CasADi Sparsity failed:' getReport(exception) ]);
|
4064
|
+
s = struct;
|
4065
|
+
end
|
4066
|
+
end
|
4067
|
+
%}
|
4068
|
+
%matlabcode_static %{
|
4069
|
+
function obj = loadobj(s)
|
4070
|
+
try
|
4071
|
+
if isstruct(s)
|
4072
|
+
obj = casadi.Sparsity.deserialize(s.serialization);
|
4073
|
+
else
|
4074
|
+
obj = s;
|
4075
|
+
end
|
4076
|
+
catch exception
|
4077
|
+
warning(['Serializing of CasADi Sparsity failed:' getReport(exception) ]);
|
4078
|
+
s = struct;
|
4079
|
+
end
|
4080
|
+
end
|
4081
|
+
%}
|
4082
|
+
}
|
4083
|
+
|
4084
|
+
|
4085
|
+
%extend Function {
|
4086
|
+
|
4087
|
+
%matlabcode %{
|
4088
|
+
function s = saveobj(obj)
|
4089
|
+
try
|
4090
|
+
s.serialization = obj.serialize();
|
4091
|
+
catch exception
|
4092
|
+
warning(['Serializing of CasADi Function failed:' getReport(exception) ]);
|
4093
|
+
s = struct;
|
4094
|
+
end
|
4095
|
+
end
|
4096
|
+
%}
|
4097
|
+
%matlabcode_static %{
|
4098
|
+
function obj = loadobj(s)
|
4099
|
+
try
|
4100
|
+
if isstruct(s)
|
4101
|
+
obj = casadi.Function.deserialize(s.serialization);
|
4102
|
+
else
|
4103
|
+
obj = s;
|
4104
|
+
end
|
4105
|
+
catch exception
|
4106
|
+
warning(['Serializing of CasADi Function failed:' getReport(exception) ]);
|
4107
|
+
s = struct;
|
4108
|
+
end
|
4109
|
+
end
|
4110
|
+
%}
|
4111
|
+
|
4112
|
+
}
|
4113
|
+
|
4114
|
+
} // namespace casadi
|
4115
|
+
#endif // SWIGMATLAB
|
4116
|
+
|
4117
|
+
%include <casadi/core/sx_elem.hpp>
|
4118
|
+
|
4119
|
+
#ifdef SWIGPYTHON
|
4120
|
+
%extend casadi::Sparsity{
|
4121
|
+
%pythoncode %{
|
4122
|
+
@property
|
4123
|
+
def shape(self):
|
4124
|
+
return (self.size1(),self.size2())
|
4125
|
+
|
4126
|
+
@property
|
4127
|
+
def T(self):
|
4128
|
+
return _casadi.transpose(self)
|
4129
|
+
|
4130
|
+
def __array__(self,*args,**kwargs):
|
4131
|
+
return DM.ones(self).full()
|
4132
|
+
%}
|
4133
|
+
};
|
4134
|
+
|
4135
|
+
#endif // SWIGPYTHON
|
4136
|
+
|
4137
|
+
#ifdef SWIGPYTHON
|
4138
|
+
%pythoncode %{
|
4139
|
+
|
4140
|
+
try:
|
4141
|
+
import numpy
|
4142
|
+
|
4143
|
+
def constpow(x,y):
|
4144
|
+
pass
|
4145
|
+
|
4146
|
+
constpow=numpy.frompyfunc(constpow,2,1)
|
4147
|
+
except:
|
4148
|
+
pass
|
4149
|
+
%}
|
4150
|
+
#endif // SWIGPYTHON
|
4151
|
+
|
4152
|
+
namespace casadi {
|
4153
|
+
%extend Matrix<SXElem>{
|
4154
|
+
%matrix_helpers(casadi::Matrix<casadi::SXElem>)
|
4155
|
+
|
4156
|
+
#ifdef SWIGPYTHON
|
4157
|
+
%python_array_wrappers(1001.0)
|
4158
|
+
#endif // SWIGPYTHON
|
4159
|
+
|
4160
|
+
};
|
4161
|
+
|
4162
|
+
} // namespace casadi
|
4163
|
+
|
4164
|
+
#ifdef SWIGPYTHON
|
4165
|
+
#include <arrayobject.h>
|
4166
|
+
%template() std::vector<PyObject*>;
|
4167
|
+
#endif // SWIGPYTHON
|
4168
|
+
|
4169
|
+
%template(SX) casadi::Matrix<casadi::SXElem>;
|
4170
|
+
%extend casadi::Matrix<casadi::SXElem> {
|
4171
|
+
%template(SX) Matrix<double>;
|
4172
|
+
};
|
4173
|
+
|
4174
|
+
%include <casadi/core/mx.hpp>
|
4175
|
+
|
4176
|
+
%extend casadi::MX{
|
4177
|
+
%matrix_helpers(casadi::MX)
|
4178
|
+
#ifdef SWIGPYTHON
|
4179
|
+
%python_array_wrappers(1002.0)
|
4180
|
+
#endif //SWIGPYTHON
|
4181
|
+
};
|
4182
|
+
|
4183
|
+
#ifdef SWIGPYTHON
|
4184
|
+
%pythoncode %{
|
4185
|
+
def attach_return_type(f,t):
|
4186
|
+
if not(hasattr(f,'func_annotations')):
|
4187
|
+
f.func_annotations = {}
|
4188
|
+
if not(isinstance(getattr(f,'func_annotations'),dict)):
|
4189
|
+
raise Exception("Cannot annotate this python Method to be a sparsitygenerator. Method has func_annotations attribute with unknown type.")
|
4190
|
+
f.func_annotations["return"] = t
|
4191
|
+
return f
|
4192
|
+
|
4193
|
+
def pyevaluate(f):
|
4194
|
+
return attach_return_type(f,None)
|
4195
|
+
|
4196
|
+
def pycallback(f):
|
4197
|
+
return attach_return_type(f,int)
|
4198
|
+
|
4199
|
+
|
4200
|
+
def pyfunction(inputs,outputs):
|
4201
|
+
def wrap(f):
|
4202
|
+
|
4203
|
+
@pyevaluate
|
4204
|
+
def fcustom(f2):
|
4205
|
+
res = f([f2.getInput(i) for i in range(f2.n_in())])
|
4206
|
+
if not isinstance(res,list):
|
4207
|
+
res = [res]
|
4208
|
+
for i in range(f2.n_out()):
|
4209
|
+
f2.setOutput(res[i],i)
|
4210
|
+
import warnings
|
4211
|
+
|
4212
|
+
with warnings.catch_warnings():
|
4213
|
+
warnings.filterwarnings("ignore",category=DeprecationWarning)
|
4214
|
+
Fun = CustomFunction("CustomFunction",fcustom,inputs,outputs)
|
4215
|
+
return Fun
|
4216
|
+
|
4217
|
+
return wrap
|
4218
|
+
|
4219
|
+
def PyFunction(name, obj, inputs, outputs, opts={}):
|
4220
|
+
@pyevaluate
|
4221
|
+
def fcustom(f):
|
4222
|
+
res = [f.getOutput(i) for i in range(f.n_out())]
|
4223
|
+
obj.evaluate([f.getInput(i) for i in range(f.n_in())],res)
|
4224
|
+
for i in range(f.n_out()): f.setOutput(res[i], i)
|
4225
|
+
|
4226
|
+
import warnings
|
4227
|
+
|
4228
|
+
with warnings.catch_warnings():
|
4229
|
+
warnings.filterwarnings("ignore",category=DeprecationWarning)
|
4230
|
+
return CustomFunction("CustomFunction", fcustom,
|
4231
|
+
inputs, outputs, opts)
|
4232
|
+
|
4233
|
+
%}
|
4234
|
+
#endif
|
4235
|
+
|
4236
|
+
#ifndef SWIGPYTHON
|
4237
|
+
%ignore FunctionBuffer;
|
4238
|
+
%ignore _function_buffer_eval;
|
4239
|
+
#endif
|
4240
|
+
|
4241
|
+
%include <casadi/core/function.hpp>
|
4242
|
+
#ifdef SWIGPYTHON
|
4243
|
+
namespace casadi{
|
4244
|
+
%extend Function {
|
4245
|
+
%pythoncode %{
|
4246
|
+
def __call__(self, *args, **kwargs):
|
4247
|
+
# Either named inputs or ordered inputs
|
4248
|
+
if len(args)>0 and len(kwargs)>0:
|
4249
|
+
raise SyntaxError('Function evaluation requires all arguments to be named or none')
|
4250
|
+
if len(args)>0:
|
4251
|
+
# Ordered inputs -> return tuple
|
4252
|
+
ret = self.call(args)
|
4253
|
+
if len(ret)==0:
|
4254
|
+
return None
|
4255
|
+
elif len(ret)==1:
|
4256
|
+
return ret[0]
|
4257
|
+
else:
|
4258
|
+
return tuple(ret)
|
4259
|
+
else:
|
4260
|
+
# Named inputs -> return dictionary
|
4261
|
+
return self.call(kwargs)
|
4262
|
+
|
4263
|
+
def buffer(self):
|
4264
|
+
"""
|
4265
|
+
Create a FunctionBuffer object for evaluating with minimal overhead
|
4266
|
+
|
4267
|
+
"""
|
4268
|
+
import functools
|
4269
|
+
fb = FunctionBuffer(self)
|
4270
|
+
caller = functools.partial(_casadi._function_buffer_eval, fb._self())
|
4271
|
+
return (fb, caller)
|
4272
|
+
%}
|
4273
|
+
|
4274
|
+
|
4275
|
+
}
|
4276
|
+
|
4277
|
+
}
|
4278
|
+
#endif // SWIGPYTHON
|
4279
|
+
|
4280
|
+
#ifdef SWIGMATLAB
|
4281
|
+
namespace casadi{
|
4282
|
+
%extend GenericMatrixCommon {
|
4283
|
+
%matlabcode %{
|
4284
|
+
function varargout = spy(self,varargin)
|
4285
|
+
[varargout{1:nargout}] = spy(sparse(casadi.DM(self.sparsity(),1)),varargin{:});
|
4286
|
+
end
|
4287
|
+
function varargout = subsref(self,s)
|
4288
|
+
if numel(s)==1 && strcmp(s.type,'()')
|
4289
|
+
[varargout{1}] = paren(self, s.subs{:});
|
4290
|
+
elseif numel(s)==1 && strcmp(s.type,'{}')
|
4291
|
+
[varargout{1}] = brace(self, s.subs{:});
|
4292
|
+
else
|
4293
|
+
[varargout{1:nargout}] = builtin('subsref',self,s);
|
4294
|
+
end
|
4295
|
+
end
|
4296
|
+
function self = subsasgn(self,s,v)
|
4297
|
+
if numel(s)==1 && strcmp(s.type,'()')
|
4298
|
+
paren_asgn(self, v, s.subs{:});
|
4299
|
+
elseif numel(s)==1 && strcmp(s.type,'{}')
|
4300
|
+
brace_asgn(self, v, s.subs{:});
|
4301
|
+
else
|
4302
|
+
self = builtin('subsasgn',self,s,v);
|
4303
|
+
end
|
4304
|
+
end
|
4305
|
+
function out = norm(self,varargin)
|
4306
|
+
narginchk(1,2);
|
4307
|
+
% 2-norm by default
|
4308
|
+
if nargin==1
|
4309
|
+
ind = 2;
|
4310
|
+
else
|
4311
|
+
ind = varargin{1};
|
4312
|
+
end
|
4313
|
+
% Typecheck
|
4314
|
+
assert((isnumeric(ind) && isscalar(ind)) || ischar(ind))
|
4315
|
+
% Pick the right norm
|
4316
|
+
if isnumeric(ind)
|
4317
|
+
switch ind
|
4318
|
+
case 1
|
4319
|
+
out = norm_1(self);
|
4320
|
+
case 2
|
4321
|
+
out = norm_2(self);
|
4322
|
+
case inf
|
4323
|
+
out = norm_inf(self);
|
4324
|
+
otherwise
|
4325
|
+
error(sprintf('Unknown norm argument: %g', ind))
|
4326
|
+
end
|
4327
|
+
else
|
4328
|
+
switch ind
|
4329
|
+
case 'fro'
|
4330
|
+
out = norm_fro(self);
|
4331
|
+
case 'inf'
|
4332
|
+
out = norm_inf(self);
|
4333
|
+
otherwise
|
4334
|
+
error(sprintf('Unknown norm argument: ''%s''', ind))
|
4335
|
+
end
|
4336
|
+
end
|
4337
|
+
end
|
4338
|
+
function out = min(varargin)
|
4339
|
+
narginchk(1,2);
|
4340
|
+
if nargin==1
|
4341
|
+
out = mmin(varargin{1});
|
4342
|
+
else
|
4343
|
+
out = fmin(varargin{1}, varargin{2});
|
4344
|
+
end
|
4345
|
+
end
|
4346
|
+
function out = max(varargin)
|
4347
|
+
narginchk(1,2);
|
4348
|
+
if nargin==1
|
4349
|
+
out = mmax(varargin{1});
|
4350
|
+
else
|
4351
|
+
out = fmax(varargin{1}, varargin{2});
|
4352
|
+
end
|
4353
|
+
end
|
4354
|
+
function b = isrow(self)
|
4355
|
+
b = is_row(self);
|
4356
|
+
end
|
4357
|
+
function b = iscolumn(self)
|
4358
|
+
b = is_column(self);
|
4359
|
+
end
|
4360
|
+
function b = isvector(self)
|
4361
|
+
b = is_vector(self);
|
4362
|
+
end
|
4363
|
+
function b = isscalar(self)
|
4364
|
+
b = is_scalar(self);
|
4365
|
+
end
|
4366
|
+
%}
|
4367
|
+
}
|
4368
|
+
%extend Function {
|
4369
|
+
%matlabcode %{
|
4370
|
+
function varargout = subsref(self,s)
|
4371
|
+
if numel(s)==1 && strcmp(s.type,'()')
|
4372
|
+
[varargout{1:nargout}]= paren(self, s.subs{:});
|
4373
|
+
else
|
4374
|
+
[varargout{1:nargout}] = builtin('subsref',self,s);
|
4375
|
+
end
|
4376
|
+
end
|
4377
|
+
function varargout = paren(self, varargin)
|
4378
|
+
if nargin==1 || (nargin>=2 && ischar(varargin{1}))
|
4379
|
+
% Named inputs: return struct
|
4380
|
+
assert(nargout<2, 'Syntax error');
|
4381
|
+
assert(mod(nargin,2)==1, 'Syntax error');
|
4382
|
+
arg = struct;
|
4383
|
+
for i=1:2:nargin-1
|
4384
|
+
assert(ischar(varargin{i}), 'Syntax error');
|
4385
|
+
arg.(varargin{i}) = varargin{i+1};
|
4386
|
+
end
|
4387
|
+
res = self.call(arg);
|
4388
|
+
varargout{1} = res;
|
4389
|
+
else
|
4390
|
+
% Ordered inputs: return variable number of outputs
|
4391
|
+
res = self.call(varargin);
|
4392
|
+
assert(nargout<=numel(res), 'Too many outputs');
|
4393
|
+
for i=1:max(min(1,numel(res)),nargout)
|
4394
|
+
varargout{i} = res{i};
|
4395
|
+
end
|
4396
|
+
end
|
4397
|
+
end
|
4398
|
+
%}
|
4399
|
+
}
|
4400
|
+
}
|
4401
|
+
#endif // SWIGMATLAB
|
4402
|
+
%include <casadi/core/external.hpp>
|
4403
|
+
%include <casadi/core/integrator.hpp>
|
4404
|
+
%include <casadi/core/conic.hpp>
|
4405
|
+
%include <casadi/core/nlpsol.hpp>
|
4406
|
+
%include <casadi/core/rootfinder.hpp>
|
4407
|
+
%include <casadi/core/linsol.hpp>
|
4408
|
+
%include <casadi/core/dple.hpp>
|
4409
|
+
%include <casadi/core/expm.hpp>
|
4410
|
+
%include <casadi/core/interpolant.hpp>
|
4411
|
+
%include <casadi/core/blazing_spline.hpp>
|
4412
|
+
|
4413
|
+
%feature("copyctor", "0") casadi::CodeGenerator;
|
4414
|
+
%include <casadi/core/code_generator.hpp>
|
4415
|
+
|
4416
|
+
#ifdef SWIGMATLAB
|
4417
|
+
// Wrap (static) member functions
|
4418
|
+
%feature("nonstatic");
|
4419
|
+
namespace casadi {
|
4420
|
+
%extend SparsityInterfaceCommon {
|
4421
|
+
SPARSITY_INTERFACE_ALL(static inline, IS_MEMBER)
|
4422
|
+
}
|
4423
|
+
%extend GenericExpressionCommon {
|
4424
|
+
GENERIC_EXPRESSION_ALL(static inline, IS_MEMBER)
|
4425
|
+
}
|
4426
|
+
%extend GenericMatrixCommon {
|
4427
|
+
GENERIC_MATRIX_ALL(static inline, IS_MEMBER)
|
4428
|
+
}
|
4429
|
+
%extend MatrixCommon {
|
4430
|
+
MATRIX_ALL(static inline, IS_MEMBER)
|
4431
|
+
}
|
4432
|
+
%extend MX {
|
4433
|
+
MX_ALL(static inline, IS_MEMBER)
|
4434
|
+
const MX brace(const casadi::MX& rr) const { casadi::MX m; $self->get_nz(m, true, rr); return m;}
|
4435
|
+
void brace_asgn(const MX& m, const casadi::MX& rr) { $self->set_nz(m, true, rr); }
|
4436
|
+
const MX paren(const casadi::MX& rr) const {
|
4437
|
+
casadi::MX m;
|
4438
|
+
$self->get(m, true, rr);
|
4439
|
+
return m;
|
4440
|
+
}
|
4441
|
+
const MX paren(char rr, const casadi::MX& cc) const {
|
4442
|
+
casadi::MX m;
|
4443
|
+
$self->get(m, true, casadi::char2Slice(rr), cc);
|
4444
|
+
return m;
|
4445
|
+
}
|
4446
|
+
const MX paren(const casadi::MX& rr, char cc) const {
|
4447
|
+
casadi::MX m;
|
4448
|
+
$self->get(m, true, rr, casadi::char2Slice(cc));
|
4449
|
+
return m;
|
4450
|
+
}
|
4451
|
+
const MX paren(const casadi::MX& rr, const casadi::MX& cc) const {
|
4452
|
+
casadi::MX m;
|
4453
|
+
$self->get(m, true, rr, cc);
|
4454
|
+
return m;
|
4455
|
+
}
|
4456
|
+
/*
|
4457
|
+
Not yet implemeted in core
|
4458
|
+
set(const MX& m, bool ind1, const MX&, const MX&); does not seem to exist
|
4459
|
+
void paren_asgn(const MX& m, char rr, const casadi::MX& cc) {
|
4460
|
+
$self->set(m, true, casadi::char2Slice(rr), cc);
|
4461
|
+
}
|
4462
|
+
void paren_asgn(const MX& m, const casadi::MX& rr, char cc) {
|
4463
|
+
$self->set(m, true, rr, casadi::char2Slice(cc));
|
4464
|
+
}
|
4465
|
+
void paren_asgn(const MX& m, const casadi::MX& rr, const casadi::MX& cc) {
|
4466
|
+
$self->set(m, true, rr, cc);
|
4467
|
+
}*/
|
4468
|
+
// Needed for brace syntax to access nonzeros
|
4469
|
+
casadi_int numel(const MX &k) const {
|
4470
|
+
return 1;
|
4471
|
+
}
|
4472
|
+
}
|
4473
|
+
} // namespace casadi
|
4474
|
+
%feature("nonstatic", "");
|
4475
|
+
// Member functions already wrapped
|
4476
|
+
#define FLAG IS_GLOBAL
|
4477
|
+
#else // SWIGMATLAB
|
4478
|
+
// Need to wrap member functions below
|
4479
|
+
#define FLAG (IS_GLOBAL | IS_MEMBER)
|
4480
|
+
#endif // SWIGMATLAB
|
4481
|
+
|
4482
|
+
// Wrap non-member functions, possibly with casadi_ prefix
|
4483
|
+
|
4484
|
+
%inline {
|
4485
|
+
namespace casadi {
|
4486
|
+
SPARSITY_INTERFACE_ALL(inline, FLAG)
|
4487
|
+
GENERIC_EXPRESSION_ALL(inline, FLAG)
|
4488
|
+
GENERIC_MATRIX_ALL(inline, FLAG)
|
4489
|
+
MATRIX_ALL(inline, FLAG)
|
4490
|
+
MX_ALL(inline, FLAG)
|
4491
|
+
}
|
4492
|
+
}
|
4493
|
+
|
4494
|
+
// Wrap the casadi_ prefixed functions in member functions
|
4495
|
+
#ifdef SWIGPYTHON
|
4496
|
+
#ifdef WITH_PYTHON3
|
4497
|
+
namespace casadi {
|
4498
|
+
%extend GenericExpressionCommon {
|
4499
|
+
%pythoncode %{
|
4500
|
+
def __hash__(self):
|
4501
|
+
try:
|
4502
|
+
return self.element_hash()
|
4503
|
+
except:
|
4504
|
+
return SharedObject.__hash__(self)
|
4505
|
+
def __matmul__(x, y): return _casadi.mtimes(x, y)
|
4506
|
+
def __rmatmul__(x, y): return _casadi.mtimes(y, x)
|
4507
|
+
%}
|
4508
|
+
}
|
4509
|
+
}
|
4510
|
+
#endif
|
4511
|
+
namespace casadi {
|
4512
|
+
%extend GenericExpressionCommon {
|
4513
|
+
%pythoncode %{
|
4514
|
+
def __add__(x, y): return _casadi.plus(x, y)
|
4515
|
+
def __radd__(x, y): return _casadi.plus(y, x)
|
4516
|
+
def __sub__(x, y): return _casadi.minus(x, y)
|
4517
|
+
def __rsub__(x, y): return _casadi.minus(y, x)
|
4518
|
+
def __mul__(x, y): return _casadi.times(x, y)
|
4519
|
+
def __rmul__(x, y): return _casadi.times(y, x)
|
4520
|
+
def __div__(x, y): return _casadi.rdivide(x, y)
|
4521
|
+
def __rdiv__(x, y): return _casadi.rdivide(y, x)
|
4522
|
+
def __truediv__(x, y): return _casadi.rdivide(x, y)
|
4523
|
+
def __rtruediv__(x, y): return _casadi.rdivide(y, x)
|
4524
|
+
def __lt__(x, y): return _casadi.lt(x, y)
|
4525
|
+
def __rlt__(x, y): return _casadi.lt(y, x)
|
4526
|
+
def __le__(x, y): return _casadi.le(x, y)
|
4527
|
+
def __rle__(x, y): return _casadi.le(y, x)
|
4528
|
+
def __gt__(x, y): return _casadi.lt(y, x)
|
4529
|
+
def __rgt__(x, y): return _casadi.lt(x, y)
|
4530
|
+
def __ge__(x, y): return _casadi.le(y, x)
|
4531
|
+
def __rge__(x, y): return _casadi.le(x, y)
|
4532
|
+
def __eq__(x, y): return _casadi.eq(x, y)
|
4533
|
+
def __req__(x, y): return _casadi.eq(y, x)
|
4534
|
+
def __ne__(x, y): return _casadi.ne(x, y)
|
4535
|
+
def __rne__(x, y): return _casadi.ne(y, x)
|
4536
|
+
def __pow__(x, n): return _casadi.power(x, n)
|
4537
|
+
def __rpow__(n, x): return _casadi.power(x, n)
|
4538
|
+
def __arctan2__(x, y): return _casadi.atan2(x, y)
|
4539
|
+
def __rarctan2__(y, x): return _casadi.atan2(x, y)
|
4540
|
+
def fmin(x, y): return _casadi.fmin(x, y)
|
4541
|
+
def fmax(x, y): return _casadi.fmax(x, y)
|
4542
|
+
def __fmin__(x, y): return _casadi.fmin(x, y)
|
4543
|
+
def __rfmin__(y, x): return _casadi.fmin(x, y)
|
4544
|
+
def __fmax__(x, y): return _casadi.fmax(x, y)
|
4545
|
+
def __rfmax__(y, x): return _casadi.fmax(x, y)
|
4546
|
+
def logic_and(x, y): return _casadi.logic_and(x, y)
|
4547
|
+
def logic_or(x, y): return _casadi.logic_or(x, y)
|
4548
|
+
def fabs(x): return _casadi.fabs(x)
|
4549
|
+
def sqrt(x): return _casadi.sqrt(x)
|
4550
|
+
def sin(x): return _casadi.sin(x)
|
4551
|
+
def cos(x): return _casadi.cos(x)
|
4552
|
+
def tan(x): return _casadi.tan(x)
|
4553
|
+
def arcsin(x): return _casadi.asin(x)
|
4554
|
+
def arccos(x): return _casadi.acos(x)
|
4555
|
+
def arctan(x): return _casadi.atan(x)
|
4556
|
+
def sinh(x): return _casadi.sinh(x)
|
4557
|
+
def cosh(x): return _casadi.cosh(x)
|
4558
|
+
def tanh(x): return _casadi.tanh(x)
|
4559
|
+
def arcsinh(x): return _casadi.asinh(x)
|
4560
|
+
def arccosh(x): return _casadi.acosh(x)
|
4561
|
+
def arctanh(x): return _casadi.atanh(x)
|
4562
|
+
def exp(x): return _casadi.exp(x)
|
4563
|
+
def log(x): return _casadi.log(x)
|
4564
|
+
def log10(x): return _casadi.log10(x)
|
4565
|
+
def log1p(x): return _casadi.log1p(x)
|
4566
|
+
def expm1(x): return _casadi.expm1(x)
|
4567
|
+
def floor(x): return _casadi.floor(x)
|
4568
|
+
def ceil(x): return _casadi.ceil(x)
|
4569
|
+
def erf(x): return _casadi.erf(x)
|
4570
|
+
def sign(x): return _casadi.sign(x)
|
4571
|
+
def fmod(x, y): return _casadi.mod(x, y)
|
4572
|
+
def hypot(x, y): return _casadi.hypot(x, y)
|
4573
|
+
def remainder(x, y): return _casadi.remainder(x, y)
|
4574
|
+
def __copysign__(x, y): return _casadi.copysign(x, y)
|
4575
|
+
def __rcopysign__(y, x): return _casadi.copysign(x, y)
|
4576
|
+
def copysign(x, y): return _casadi.copysign(x, y)
|
4577
|
+
def rcopysign(y, x): return _casadi.copysign(x, y)
|
4578
|
+
def __constpow__(x, y): return _casadi.constpow(x, y)
|
4579
|
+
def __rconstpow__(y, x): return _casadi.constpow(x, y)
|
4580
|
+
def constpow(x, y): return _casadi.constpow(x, y)
|
4581
|
+
def rconstpow(y, x): return _casadi.constpow(x, y)
|
4582
|
+
%}
|
4583
|
+
}
|
4584
|
+
|
4585
|
+
%extend GenericMatrixCommon {
|
4586
|
+
%pythoncode %{
|
4587
|
+
def __mldivide__(x, y): return _casadi.mldivide(x, y)
|
4588
|
+
def __rmldivide__(y, x): return _casadi.mldivide(x, y)
|
4589
|
+
def __mrdivide__(x, y): return _casadi.mrdivide(x, y)
|
4590
|
+
def __rmrdivide__(y, x): return _casadi.mrdivide(x, y)
|
4591
|
+
def __mpower__(x, y): return _casadi.mpower(x, y)
|
4592
|
+
def __rmpower__(y, x): return _casadi.mpower(x, y)
|
4593
|
+
%}
|
4594
|
+
}
|
4595
|
+
|
4596
|
+
} // namespace casadi
|
4597
|
+
#endif // SWIGPYTHON
|
4598
|
+
|
4599
|
+
%feature("director") casadi::Callback;
|
4600
|
+
|
4601
|
+
%include <casadi/core/importer.hpp>
|
4602
|
+
%include <casadi/core/callback.hpp>
|
4603
|
+
%include <casadi/core/global_options.hpp>
|
4604
|
+
|
4605
|
+
%include <casadi/core/casadi_meta.hpp>
|
4606
|
+
#ifdef SWIGPYTHON
|
4607
|
+
%extend casadi::CasadiMeta {
|
4608
|
+
static const char* swig_flags() { return CASADI_SWIG_FLAGS; }
|
4609
|
+
};
|
4610
|
+
#endif // SWIGPYTHON
|
4611
|
+
|
4612
|
+
%include <casadi/core/integration_tools.hpp>
|
4613
|
+
%include <casadi/core/nlp_tools.hpp>
|
4614
|
+
%include <casadi/core/tools.hpp>
|
4615
|
+
%include <casadi/core/nlp_builder.hpp>
|
4616
|
+
%include <casadi/core/dae_builder.hpp>
|
4617
|
+
%include <casadi/core/xml_file.hpp>
|
4618
|
+
%include <casadi/core/archiver.hpp>
|
4619
|
+
%include <casadi/core/filesystem.hpp>
|
4620
|
+
%include <casadi/core/options.hpp>
|
4621
|
+
|
4622
|
+
%feature("copyctor", "0") casadi::SerializerBase;
|
4623
|
+
%feature("copyctor", "0") casadi::DeserializerBase;
|
4624
|
+
%feature("copyctor", "0") casadi::StringSerializer;
|
4625
|
+
%feature("copyctor", "0") casadi::StringDeserializer;
|
4626
|
+
%feature("copyctor", "0") casadi::FileSerializer;
|
4627
|
+
%feature("copyctor", "0") casadi::FileDeserializer;
|
4628
|
+
%nodefaultctor casadi::SerializerBase;
|
4629
|
+
%nodefaultctor casadi::DeserializerBase;
|
4630
|
+
|
4631
|
+
#ifdef SWIGPYTHON
|
4632
|
+
%rename("_pop_type") casadi::DeserializerBase::pop_type;
|
4633
|
+
%rename("%(regex:/(SERIALIZED_\w+)/_\\1/)s", regextarget=1, fullname=1) "casadi::SerializerBase::SERIALIZED_\w+";
|
4634
|
+
#endif // SWIG_PYTHON
|
4635
|
+
|
4636
|
+
|
4637
|
+
#ifdef SWIGMATLAB
|
4638
|
+
%rename("internal_pop_type") casadi::DeserializerBase::pop_type;
|
4639
|
+
%rename("%(regex:/(SERIALIZED_\w+)/internal_\\1/)s", regextarget=1, fullname=1) "casadi::SerializerBase::SERIALIZED_\w+";
|
4640
|
+
#endif // SWIG_PYTHON
|
4641
|
+
|
4642
|
+
%include <casadi/core/serializer.hpp>
|
4643
|
+
|
4644
|
+
#ifdef SWIGPYTHON
|
4645
|
+
%extend casadi::DeserializerBase {
|
4646
|
+
%pythoncode %{
|
4647
|
+
def unpack(self):
|
4648
|
+
type = SerializerBase.type_to_string(self._pop_type())
|
4649
|
+
f = getattr(self, "blind_unpack_"+type)
|
4650
|
+
return f()
|
4651
|
+
%}
|
4652
|
+
}
|
4653
|
+
%pythoncode %{
|
4654
|
+
|
4655
|
+
try:
|
4656
|
+
import threading
|
4657
|
+
_thread_local = threading.local()
|
4658
|
+
except:
|
4659
|
+
threading_available = True
|
4660
|
+
_thread_local = globals()
|
4661
|
+
|
4662
|
+
def _current_pickle_context():
|
4663
|
+
return getattr(_thread_local, "casadi_pickle_ctx", None)
|
4664
|
+
|
4665
|
+
def _current_unpickle_context():
|
4666
|
+
return getattr(_thread_local, "casadi_unpickle_ctx", None)
|
4667
|
+
|
4668
|
+
class global_pickle_context:
|
4669
|
+
def __enter__(self):
|
4670
|
+
self.ctx = StringSerializer()
|
4671
|
+
_thread_local.casadi_pickle_ctx = self.ctx
|
4672
|
+
return self.ctx
|
4673
|
+
|
4674
|
+
def __exit__(self, *args):
|
4675
|
+
_thread_local.casadi_pickle_ctx = None
|
4676
|
+
|
4677
|
+
class global_unpickle_context:
|
4678
|
+
def __enter__(self):
|
4679
|
+
self.ctx = StringDeserializer("")
|
4680
|
+
_thread_local.casadi_unpickle_ctx = self.ctx
|
4681
|
+
return self.ctx
|
4682
|
+
|
4683
|
+
def __exit__(self, *args):
|
4684
|
+
_thread_local.casadi_unpickle_ctx = None
|
4685
|
+
%}
|
4686
|
+
#endif // SWIGPYTHON
|
4687
|
+
#ifdef SWIGMATLAB
|
4688
|
+
%extend casadi::DeserializerBase {
|
4689
|
+
%matlabcode %{
|
4690
|
+
function out = unpack(self)
|
4691
|
+
type = casadi.SerializerBase.type_to_string(self.internal_pop_type);
|
4692
|
+
out = self.(['blind_unpack_' type]);
|
4693
|
+
end
|
4694
|
+
%}
|
4695
|
+
}
|
4696
|
+
#endif // SWIGMATLAB
|
4697
|
+
|
4698
|
+
%feature("director") casadi::OptiCallback;
|
4699
|
+
|
4700
|
+
// Return-by-value
|
4701
|
+
%typemap(out, doc="double", noblock=1, fragment="casadi_all") casadi::native_DM {
|
4702
|
+
if(!($result = full_or_sparse($1, true))) SWIG_exception_fail(SWIG_TypeError,"Failed to convert output to type 'double'.");
|
4703
|
+
}
|
4704
|
+
|
4705
|
+
|
4706
|
+
%apply casadi_int &OUTPUT { Opti::ConstraintType &OUTPUT };
|
4707
|
+
|
4708
|
+
%typemap(argout, noblock=1,fragment="casadi_all") casadi::Opti::ConstraintType &OUTPUT {
|
4709
|
+
%append_output(casadi::from_ptr((casadi_int *) $1));
|
4710
|
+
}
|
4711
|
+
|
4712
|
+
%typemap(in, doc="Opti.ConstraintType", noblock=1, numinputs=0) casadi::Opti::ConstraintType &OUTPUT (casadi::Opti::ConstraintType m) {
|
4713
|
+
$1 = &m;
|
4714
|
+
}
|
4715
|
+
|
4716
|
+
|
4717
|
+
#ifdef SWIGPYTHON
|
4718
|
+
|
4719
|
+
%define make_property(class, name)
|
4720
|
+
%rename(_ ## name) class ## :: ## name;
|
4721
|
+
%extend class {
|
4722
|
+
%pythoncode %{
|
4723
|
+
@property
|
4724
|
+
def name(self):
|
4725
|
+
return self._ ## name()
|
4726
|
+
%}
|
4727
|
+
}
|
4728
|
+
%enddef
|
4729
|
+
|
4730
|
+
|
4731
|
+
make_property(casadi::Opti, debug);
|
4732
|
+
make_property(casadi::Opti, advanced);
|
4733
|
+
make_property(casadi::OptiSol, opti);
|
4734
|
+
|
4735
|
+
%define make_property_opti(name)
|
4736
|
+
make_property(casadi::Opti, name);
|
4737
|
+
%enddef
|
4738
|
+
|
4739
|
+
make_property(casadi::OptiSol, debug);
|
4740
|
+
make_property_opti(f)
|
4741
|
+
make_property_opti(g)
|
4742
|
+
make_property_opti(x)
|
4743
|
+
make_property_opti(p)
|
4744
|
+
make_property_opti(lam_g)
|
4745
|
+
make_property_opti(lbg)
|
4746
|
+
make_property_opti(ubg)
|
4747
|
+
make_property_opti(nx)
|
4748
|
+
make_property_opti(np)
|
4749
|
+
make_property_opti(ng)
|
4750
|
+
make_property_opti(x_linear_scale)
|
4751
|
+
make_property_opti(x_linear_scale_offset)
|
4752
|
+
make_property_opti(g_linear_scale)
|
4753
|
+
make_property_opti(f_linear_scale)
|
4754
|
+
|
4755
|
+
make_property(casadi::Opti, casadi_solver);
|
4756
|
+
%define opti_metadata_modifiers(class)
|
4757
|
+
%rename(_variable) class ## :: variable;
|
4758
|
+
%rename(_parameter) class ## :: parameter;
|
4759
|
+
%rename(_subject_to) class ## :: subject_to;
|
4760
|
+
%extend class {
|
4761
|
+
%pythoncode %{
|
4762
|
+
def parameter(self,*args):
|
4763
|
+
import sys
|
4764
|
+
import os
|
4765
|
+
try:
|
4766
|
+
frame = sys._getframe(1)
|
4767
|
+
except:
|
4768
|
+
frame = {}
|
4769
|
+
meta = {} if frame is None else {"stacktrace": [{"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name}]}
|
4770
|
+
ret = self._parameter(*args)
|
4771
|
+
if len(meta)>0:
|
4772
|
+
self.update_user_dict(ret, meta)
|
4773
|
+
return ret
|
4774
|
+
|
4775
|
+
def variable(self,*args):
|
4776
|
+
import sys
|
4777
|
+
import os
|
4778
|
+
try:
|
4779
|
+
frame = sys._getframe(1)
|
4780
|
+
except:
|
4781
|
+
frame = {}
|
4782
|
+
meta = {} if frame is None else {"stacktrace": [{"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name}]}
|
4783
|
+
ret = self._variable(*args)
|
4784
|
+
if len(meta)>0:
|
4785
|
+
self.update_user_dict(ret, meta)
|
4786
|
+
return ret
|
4787
|
+
|
4788
|
+
def subject_to(self,*args):
|
4789
|
+
if len(args)==0:
|
4790
|
+
return self._subject_to()
|
4791
|
+
import sys
|
4792
|
+
import os
|
4793
|
+
stacktrace = []
|
4794
|
+
for i in range(1,10000):
|
4795
|
+
try:
|
4796
|
+
frame = sys._getframe(i)
|
4797
|
+
stacktrace.append({"file":os.path.abspath(frame.f_code.co_filename),"line":frame.f_lineno,"name":frame.f_code.co_name})
|
4798
|
+
except Exception as e:
|
4799
|
+
break
|
4800
|
+
args = list(args)
|
4801
|
+
if len(args)==3 and isinstance(args[2],dict):
|
4802
|
+
args[2] = dict(args[2])
|
4803
|
+
if "stacktrace" not in args[2]:
|
4804
|
+
args[2]["stacktrace"] = stacktrace
|
4805
|
+
elif len(args)==2 and isinstance(args[1],dict):
|
4806
|
+
args[1] = dict(args[1])
|
4807
|
+
if "stacktrace" not in args[1]:
|
4808
|
+
args[1]["stacktrace"] = stacktrace
|
4809
|
+
elif len(args)==1:
|
4810
|
+
args = [args[0], {"stacktrace": stacktrace}]
|
4811
|
+
elif len(args)==2:
|
4812
|
+
args = [args[0], args[1], {"stacktrace": stacktrace}]
|
4813
|
+
ret = self._subject_to(*args)
|
4814
|
+
return ret
|
4815
|
+
%}
|
4816
|
+
}
|
4817
|
+
%enddef
|
4818
|
+
|
4819
|
+
opti_metadata_modifiers(casadi::Opti);
|
4820
|
+
|
4821
|
+
#endif
|
4822
|
+
|
4823
|
+
|
4824
|
+
#ifdef SWIGMATLAB
|
4825
|
+
%define opti_metadata_modifiers(class)
|
4826
|
+
%rename(internal_variable) class ## ::variable;
|
4827
|
+
%rename(internal_parameter) class ## ::parameter;
|
4828
|
+
%rename(internal_subject_to) class ## ::subject_to;
|
4829
|
+
%extend class {
|
4830
|
+
%matlabcode %{
|
4831
|
+
function out = variable(self, varargin)
|
4832
|
+
st = dbstack('-completenames',1);
|
4833
|
+
if length(st)>0
|
4834
|
+
meta = struct('stacktrace', {num2cell(st)});
|
4835
|
+
else
|
4836
|
+
meta = struct;
|
4837
|
+
end
|
4838
|
+
out = self.internal_variable(varargin{:});
|
4839
|
+
self.update_user_dict(out, meta);
|
4840
|
+
end
|
4841
|
+
function out = parameter(self, varargin)
|
4842
|
+
st = dbstack('-completenames',1);
|
4843
|
+
if length(st)>0
|
4844
|
+
meta = struct('stacktrace', {num2cell(st)});
|
4845
|
+
else
|
4846
|
+
meta = struct;
|
4847
|
+
end
|
4848
|
+
out = self.internal_parameter(varargin{:});
|
4849
|
+
self.update_user_dict(out, meta);
|
4850
|
+
end
|
4851
|
+
function [] = subject_to(self, varargin)
|
4852
|
+
if length(varargin)==0
|
4853
|
+
self.internal_subject_to();
|
4854
|
+
return;
|
4855
|
+
end
|
4856
|
+
st = dbstack('-completenames',1);
|
4857
|
+
if length(st)>0
|
4858
|
+
meta = struct('stacktrace', {num2cell(st)});
|
4859
|
+
else
|
4860
|
+
meta = struct;
|
4861
|
+
end
|
4862
|
+
self.internal_subject_to(varargin{:});
|
4863
|
+
self.update_user_dict(varargin{1}, meta);
|
4864
|
+
end
|
4865
|
+
%}
|
4866
|
+
}
|
4867
|
+
%enddef
|
4868
|
+
|
4869
|
+
opti_metadata_modifiers(casadi::Opti)
|
4870
|
+
#endif
|
4871
|
+
%include <casadi/core/optistack.hpp>
|
4872
|
+
|
4873
|
+
|
4874
|
+
#ifdef SWIGPYTHON
|
4875
|
+
%extend casadi::Opti {
|
4876
|
+
%pythoncode %{
|
4877
|
+
|
4878
|
+
@staticmethod
|
4879
|
+
def _callback(self,fh=None):
|
4880
|
+
if fh is None:
|
4881
|
+
self.callback_class();
|
4882
|
+
return
|
4883
|
+
class OptiCallbackHelper(OptiCallback):
|
4884
|
+
def __init__(self, callback):
|
4885
|
+
OptiCallback.__init__(self)
|
4886
|
+
self.callback = callback
|
4887
|
+
|
4888
|
+
def call(self, i):
|
4889
|
+
self.callback(i)
|
4890
|
+
|
4891
|
+
self._fh = fh
|
4892
|
+
self._cb = OptiCallbackHelper(fh);
|
4893
|
+
self.callback_class(self._cb);
|
4894
|
+
|
4895
|
+
|
4896
|
+
def callback(self,fh=None):
|
4897
|
+
self._callback(self,fh)
|
4898
|
+
|
4899
|
+
|
4900
|
+
%}
|
4901
|
+
|
4902
|
+
}
|
4903
|
+
#endif
|
4904
|
+
|
4905
|
+
#ifdef SWIGMATLAB
|
4906
|
+
%extend casadi::Opti {
|
4907
|
+
%matlabcode %{
|
4908
|
+
function [] = callback(self, varargin)
|
4909
|
+
casadi.OptiCallbackHelper.callback_setup(self, varargin{:})
|
4910
|
+
end
|
4911
|
+
%}
|
4912
|
+
}
|
4913
|
+
#endif
|
4914
|
+
|
4915
|
+
%include <casadi/core/resource.hpp>
|
4916
|
+
|
4917
|
+
// Cleanup for dependent modules
|
4918
|
+
%exception {
|
4919
|
+
$action
|
4920
|
+
}
|