From 42d93e94df410dc38b7f96e8061cff462a97d646 Mon Sep 17 00:00:00 2001 From: HaraldSchafer Date: Wed, 15 Sep 2021 21:14:11 -0700 Subject: [PATCH] remove ACADO (#22247) * remove acado * not relevant anymore --- SConstruct | 4 - phonelibs/acado/01.patch | 28 - phonelibs/acado/build.sh | 29 - .../include/acado/acado_code_generation.hpp | 33 - .../acado/include/acado/acado_controller.hpp | 62 - .../acado/include/acado/acado_gnuplot.hpp | 33 - .../acado/include/acado/acado_integrators.hpp | 44 - .../include/acado/acado_optimal_control.hpp | 47 - .../acado/include/acado/acado_toolkit.hpp | 51 - .../bindings/acado_csparse/acado_csparse.hpp | 210 - .../bindings/acado_gnuplot/gnuplot_window.hpp | 226 - .../bindings/acado_gnuplot/gnuplot_window.ipp | 57 - .../acado_qpoases/qp_solver_qpoases.hpp | 218 - .../acado_qpoases/qp_solver_qpoases.ipp | 48 - phonelibs/acado/include/acado/clock/clock.hpp | 184 - phonelibs/acado/include/acado/clock/clock.ipp | 54 - .../acado/include/acado/clock/real_clock.hpp | 138 - .../acado/include/acado/clock/real_clock.ipp | 49 - .../include/acado/clock/simulation_clock.hpp | 132 - .../include/acado/clock/simulation_clock.ipp | 48 - .../acado/code_generation/code_generation.hpp | 42 - .../code_generation/export_acado_function.hpp | 205 - .../code_generation/export_algorithm.hpp | 226 - .../export_algorithm_factory.hpp | 127 - .../acado/code_generation/export_argument.hpp | 211 - .../export_argument_internal.hpp | 220 - .../code_generation/export_argument_list.hpp | 220 - .../export_arithmetic_statement.hpp | 218 - .../export_auxiliary_functions.hpp | 96 - .../export_cholesky_decomposition.hpp | 122 - .../code_generation/export_common_header.hpp | 90 - .../acado/code_generation/export_data.hpp | 194 - .../export_data_declaration.hpp | 146 - .../code_generation/export_data_internal.hpp | 201 - .../export_exact_hessian_cn2.hpp | 102 - .../export_exact_hessian_qpdunes.hpp | 115 - .../acado/code_generation/export_file.hpp | 126 - .../acado/code_generation/export_for_loop.hpp | 205 - .../export_forces_generator.hpp | 100 - .../export_forces_interface.hpp | 91 - .../acado/code_generation/export_function.hpp | 303 -- .../code_generation/export_function_call.hpp | 249 - .../export_function_declaration.hpp | 109 - .../export_gauss_newton_block_cn2.hpp | 176 - .../export_gauss_newton_block_forces.hpp | 142 - .../export_gauss_newton_block_qpdunes.hpp | 105 - .../export_gauss_newton_cn2.hpp | 259 - .../export_gauss_newton_cn2_factorization.hpp | 278 - .../export_gauss_newton_condensed.hpp | 280 - .../export_gauss_newton_forces.hpp | 227 - .../export_gauss_newton_generic.hpp | 212 - .../export_gauss_newton_hpmpc.hpp | 217 - .../export_gauss_newton_qpdunes.hpp | 222 - .../export_hessian_regularization.hpp | 91 - .../export_hpmpc_interface.hpp | 96 - .../acado/code_generation/export_index.hpp | 144 - .../code_generation/export_index_node.hpp | 163 - .../acado/code_generation/export_module.hpp | 140 - .../code_generation/export_nlp_solver.hpp | 378 -- .../export_qpdunes_interface.hpp | 106 - .../export_qpoases3_interface.hpp | 116 - .../export_qpoases_interface.hpp | 116 - .../export_simulink_interface.hpp | 113 - .../export_split_qpdunes_interface.hpp | 106 - .../code_generation/export_statement.hpp | 164 - .../export_statement_block.hpp | 312 -- .../export_statement_string.hpp | 106 - .../code_generation/export_templated_file.hpp | 139 - .../acado/code_generation/export_variable.hpp | 536 -- .../export_variable_internal.hpp | 349 -- .../integrators/dirk3_export.hpp | 95 - .../integrators/dirk4_export.hpp | 95 - .../integrators/dirk5_export.hpp | 95 - .../integrators/dirk_export.hpp | 308 -- .../integrators/discrete_export.hpp | 229 - .../integrators/erk2_export.hpp | 92 - .../integrators/erk3_export.hpp | 95 - .../integrators/erk4_export.hpp | 94 - .../integrators/erk_3sweep_export.hpp | 146 - .../integrators/erk_adjoint_export.hpp | 137 - .../integrators/erk_export.hpp | 229 - .../integrators/erk_export.ipp | 73 - .../integrators/erk_fob_export.hpp | 115 - .../integrators/explicit_euler_export.hpp | 95 - .../export_auxiliary_sim_functions.hpp | 96 - .../integrators/export_matlab_integrator.hpp | 112 - .../integrators/gauss_legendre2_export.hpp | 94 - .../integrators/gauss_legendre4_export.hpp | 95 - .../integrators/gauss_legendre6_export.hpp | 96 - .../integrators/gauss_legendre8_export.hpp | 94 - .../integrators/integrator_export.hpp | 508 -- .../integrators/integrator_export_types.hpp | 77 - .../integrators/integrator_generation.hpp | 59 - .../integrators/irk_export.hpp | 606 --- .../integrators/irk_export.ipp | 83 - .../integrators/irk_forward_export.hpp | 287 - .../integrators/irk_lifted_adjoint_export.hpp | 184 - .../irk_lifted_feedback_export.hpp | 229 - .../integrators/irk_lifted_fob_export.hpp | 240 - .../integrators/irk_lifted_forward_export.hpp | 426 -- .../irk_lifted_symmetric_export.hpp | 183 - .../integrators/irk_symmetric_export.hpp | 255 - .../integrators/lifted_erk_export.hpp | 157 - .../integrators/narx_export.hpp | 258 - .../integrators/radau_IIA1_export.hpp | 94 - .../integrators/radau_IIA3_export.hpp | 94 - .../integrators/radau_IIA5_export.hpp | 94 - .../register_exported_integrators.hpp | 48 - .../code_generation/integrators/rk_export.hpp | 205 - .../integrators/rk_sensitivities_export.hpp | 163 - .../linear_solvers/export_cholesky_solver.hpp | 147 - .../gaussian_elimination_export.hpp | 164 - .../linear_solvers/householder_qr_export.hpp | 147 - .../irk_3stage_simplified_newton_export.hpp | 219 - .../irk_3stage_single_newton_export.hpp | 176 - .../irk_4stage_simplified_newton_export.hpp | 216 - .../irk_4stage_single_newton_export.hpp | 176 - .../linear_solvers/linear_solver_export.hpp | 307 -- .../linear_solver_generation.hpp | 51 - .../code_generation/memory_allocator.hpp | 65 - .../acado/code_generation/object_pool.hpp | 148 - .../acado/code_generation/ocp_export.hpp | 173 - .../code_generation/register_nlp_solvers.hpp | 48 - .../acado/code_generation/sim_export.hpp | 348 -- .../templates/acado_EH_solver_mex.c.in | 479 -- .../templates/acado_auxiliary_functions.c.in | 193 - .../templates/acado_auxiliary_functions.h.in | 119 - .../acado_auxiliary_sim_functions.c.in | 91 - .../acado_auxiliary_sim_functions.h.in | 77 - .../templates/acado_common_header.h.in | 70 - .../templates/acado_forces_generator.m.in | 221 - .../templates/acado_forces_generator.py.in | 313 -- .../acado_hessian_regularization.c.in | 290 - .../templates/acado_solver_mex.c.in | 535 -- .../templates/acado_solver_sfunction.c.in | 141 - .../templates/acado_solver_sfunction.h.in | 96 - .../templates/dummy_test_file.in | 100 - .../templates/forces_interface.in | 25 - .../templates/hpmpc_interface.c.in | 301 -- .../templates/integrator_mex.c.in | 658 --- .../make_acado_EH_solver_qpdunes.m.in | 94 - .../make_acado_EH_solver_qpoases.m.in | 68 - .../make_acado_EH_solver_qpoases3.m.in | 68 - .../make_acado_block_solver_qpdunes.m.in | 93 - .../templates/make_acado_integrator.m.in | 49 - .../templates/make_acado_solver_forces.m.in | 61 - .../templates/make_acado_solver_hpmpc.m.in | 79 - .../templates/make_acado_solver_qpdunes.m.in | 61 - .../templates/make_acado_solver_qpoases.m.in | 67 - .../templates/make_acado_solver_qpoases3.m.in | 67 - .../make_acado_solver_sfunction.m.in | 251 - .../templates/makefile.EH_qpdunes.in | 43 - .../templates/makefile.EH_qpoases.in | 53 - .../templates/makefile.EH_qpoases3.in | 53 - .../templates/makefile.forces.in | 49 - .../templates/makefile.hpmpc.in | 26 - .../templates/makefile.integrator.in | 40 - .../templates/makefile.qpdunes.in | 42 - .../templates/makefile.qpoases.in | 52 - .../templates/makefile.qpoases3.in | 52 - .../templates/qpdunes_interface.in | 77 - .../templates/qpdunes_split_interface.in | 96 - .../templates/qpoases3_interface.c.in | 60 - .../templates/qpoases3_interface.h.in | 46 - .../templates/qpoases_interface.cpp.in | 51 - .../templates/qpoases_interface.hpp.in | 46 - .../code_generation/templates/templates.hpp | 61 - .../templates/templates.hpp.in | 61 - .../include/acado/conic_program/banded_cp.hpp | 152 - .../include/acado/conic_program/banded_cp.ipp | 67 - .../include/acado/conic_program/dense_cp.hpp | 430 -- .../include/acado/conic_program/dense_cp.ipp | 78 - .../acado/conic_solver/banded_cp_solver.hpp | 158 - .../acado/conic_solver/banded_cp_solver.ipp | 46 - .../condensing_based_cp_solver.hpp | 291 - .../condensing_based_cp_solver.ipp | 106 - .../acado/conic_solver/dense_cp_solver.hpp | 138 - .../acado/conic_solver/dense_qp_solver.hpp | 251 - .../acado/conic_solver/dense_qp_solver.ipp | 79 - .../algebraic_consistency_constraint.hpp | 179 - .../algebraic_consistency_constraint.ipp | 150 - .../acado/constraint/boundary_constraint.hpp | 143 - .../acado/constraint/boundary_constraint.ipp | 76 - .../acado/constraint/box_constraint.hpp | 144 - .../acado/constraint/box_constraint.ipp | 48 - .../include/acado/constraint/constraint.hpp | 507 -- .../include/acado/constraint/constraint.ipp | 257 - .../acado/constraint/constraint_element.hpp | 319 -- .../acado/constraint/constraint_element.ipp | 128 - .../constraint/coupled_path_constraint.hpp | 142 - .../constraint/coupled_path_constraint.ipp | 77 - .../acado/constraint/path_constraint.hpp | 147 - .../acado/constraint/path_constraint.ipp | 100 - .../acado/constraint/point_constraint.hpp | 173 - .../acado/constraint/point_constraint.ipp | 64 - .../control_law/clipping_functionality.hpp | 253 - .../control_law/clipping_functionality.ipp | 63 - .../include/acado/control_law/control_law.hpp | 356 -- .../include/acado/control_law/control_law.ipp | 60 - .../acado/control_law/feedforward_law.hpp | 216 - .../control_law/linear_state_feedback.hpp | 220 - .../acado/control_law/pid_controller.hpp | 295 - .../acado/control_law/pid_controller.ipp | 56 - .../include/acado/controller/controller.hpp | 446 -- .../include/acado/controller/controller.ipp | 174 - phonelibs/acado/include/acado/curve/curve.hpp | 318 -- phonelibs/acado/include/acado/curve/curve.ipp | 79 - .../collocation_method.hpp | 160 - .../collocation_method.ipp | 43 - .../dynamic_discretization.hpp | 319 -- .../dynamic_discretization.ipp | 57 - .../integration_algorithm.hpp | 393 -- .../shooting_method.hpp | 228 - .../shooting_method.ipp | 43 - .../acado/dynamic_system/dynamic_system.hpp | 351 -- .../acado/dynamic_system/dynamic_system.ipp | 253 - .../acado/estimator/dynamic_estimator.hpp | 119 - .../acado/estimator/dynamic_estimator.ipp | 46 - .../include/acado/estimator/estimator.hpp | 177 - .../include/acado/estimator/estimator.ipp | 137 - .../include/acado/estimator/kalman_filter.hpp | 112 - .../external_packages/eigen3/COPYING.BSD | 26 - .../external_packages/eigen3/COPYING.GPL | 674 --- .../external_packages/eigen3/COPYING.LGPL | 502 -- .../external_packages/eigen3/COPYING.MINPACK | 52 - .../external_packages/eigen3/COPYING.MPL2 | 373 -- .../external_packages/eigen3/COPYING.README | 18 - .../external_packages/eigen3/Eigen/Array | 11 - .../external_packages/eigen3/Eigen/Cholesky | 32 - .../eigen3/Eigen/CholmodSupport | 45 - .../acado/external_packages/eigen3/Eigen/Core | 376 -- .../external_packages/eigen3/Eigen/Dense | 7 - .../external_packages/eigen3/Eigen/Eigen | 2 - .../eigen3/Eigen/Eigen2Support | 82 - .../eigen3/Eigen/Eigenvalues | 48 - .../external_packages/eigen3/Eigen/Geometry | 63 - .../eigen3/Eigen/Householder | 23 - .../eigen3/Eigen/IterativeLinearSolvers | 40 - .../external_packages/eigen3/Eigen/Jacobi | 26 - .../acado/external_packages/eigen3/Eigen/LU | 41 - .../eigen3/Eigen/LeastSquares | 32 - .../eigen3/Eigen/MetisSupport | 28 - .../eigen3/Eigen/OrderingMethods | 66 - .../eigen3/Eigen/PaStiXSupport | 46 - .../eigen3/Eigen/PardisoSupport | 30 - .../acado/external_packages/eigen3/Eigen/QR | 45 - .../eigen3/Eigen/QtAlignedMalloc | 34 - .../eigen3/Eigen/SPQRSupport | 29 - .../acado/external_packages/eigen3/Eigen/SVD | 37 - .../external_packages/eigen3/Eigen/Sparse | 27 - .../eigen3/Eigen/SparseCholesky | 47 - .../external_packages/eigen3/Eigen/SparseCore | 64 - .../external_packages/eigen3/Eigen/SparseLU | 49 - .../external_packages/eigen3/Eigen/SparseQR | 33 - .../external_packages/eigen3/Eigen/StdDeque | 27 - .../external_packages/eigen3/Eigen/StdList | 26 - .../external_packages/eigen3/Eigen/StdVector | 27 - .../eigen3/Eigen/SuperLUSupport | 59 - .../eigen3/Eigen/UmfPackSupport | 36 - .../eigen3/Eigen/src/Cholesky/LDLT.h | 600 --- .../eigen3/Eigen/src/Cholesky/LLT.h | 490 -- .../eigen3/Eigen/src/Cholesky/LLT_MKL.h | 102 - .../Eigen/src/CholmodSupport/CholmodSupport.h | 604 --- .../eigen3/Eigen/src/Core/Array.h | 308 -- .../eigen3/Eigen/src/Core/ArrayBase.h | 228 - .../eigen3/Eigen/src/Core/ArrayWrapper.h | 254 - .../eigen3/Eigen/src/Core/Assign.h | 583 -- .../eigen3/Eigen/src/Core/Assign_MKL.h | 224 - .../eigen3/Eigen/src/Core/BandMatrix.h | 334 -- .../eigen3/Eigen/src/Core/Block.h | 405 -- .../eigen3/Eigen/src/Core/BooleanRedux.h | 154 - .../eigen3/Eigen/src/Core/CommaInitializer.h | 143 - .../eigen3/Eigen/src/Core/CoreIterators.h | 61 - .../eigen3/Eigen/src/Core/CwiseBinaryOp.h | 229 - .../eigen3/Eigen/src/Core/CwiseNullaryOp.h | 864 --- .../eigen3/Eigen/src/Core/CwiseUnaryOp.h | 126 - .../eigen3/Eigen/src/Core/CwiseUnaryView.h | 139 - .../eigen3/Eigen/src/Core/DenseBase.h | 521 -- .../eigen3/Eigen/src/Core/DenseCoeffsBase.h | 754 --- .../eigen3/Eigen/src/Core/DenseStorage.h | 331 -- .../eigen3/Eigen/src/Core/Diagonal.h | 237 - .../eigen3/Eigen/src/Core/DiagonalMatrix.h | 313 -- .../eigen3/Eigen/src/Core/DiagonalProduct.h | 130 - .../eigen3/Eigen/src/Core/Dot.h | 263 - .../eigen3/Eigen/src/Core/EigenBase.h | 161 - .../eigen3/Eigen/src/Core/Flagged.h | 140 - .../Eigen/src/Core/ForceAlignedAccess.h | 146 - .../eigen3/Eigen/src/Core/Functors.h | 985 ---- .../eigen3/Eigen/src/Core/Fuzzy.h | 150 - .../eigen3/Eigen/src/Core/GeneralProduct.h | 635 --- .../eigen3/Eigen/src/Core/GenericPacketMath.h | 350 -- .../eigen3/Eigen/src/Core/GlobalFunctions.h | 92 - .../eigen3/Eigen/src/Core/IO.h | 249 - .../eigen3/Eigen/src/Core/Map.h | 192 - .../eigen3/Eigen/src/Core/MapBase.h | 242 - .../eigen3/Eigen/src/Core/MathFunctions.h | 768 --- .../eigen3/Eigen/src/Core/Matrix.h | 405 -- .../eigen3/Eigen/src/Core/MatrixBase.h | 515 -- .../eigen3/Eigen/src/Core/NestByValue.h | 111 - .../eigen3/Eigen/src/Core/NoAlias.h | 134 - .../eigen3/Eigen/src/Core/NumTraits.h | 150 - .../eigen3/Eigen/src/Core/PermutationMatrix.h | 688 --- .../eigen3/Eigen/src/Core/PlainObjectBase.h | 782 --- .../eigen3/Eigen/src/Core/ProductBase.h | 278 - .../eigen3/Eigen/src/Core/Random.h | 152 - .../eigen3/Eigen/src/Core/Redux.h | 408 -- .../eigen3/Eigen/src/Core/Ref.h | 255 - .../eigen3/Eigen/src/Core/Replicate.h | 177 - .../eigen3/Eigen/src/Core/ReturnByValue.h | 88 - .../eigen3/Eigen/src/Core/Reverse.h | 224 - .../eigen3/Eigen/src/Core/Select.h | 162 - .../eigen3/Eigen/src/Core/SelfAdjointView.h | 314 -- .../eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h | 197 - .../eigen3/Eigen/src/Core/SolveTriangular.h | 260 - .../eigen3/Eigen/src/Core/StableNorm.h | 190 - .../eigen3/Eigen/src/Core/Stride.h | 108 - .../eigen3/Eigen/src/Core/Swap.h | 126 - .../eigen3/Eigen/src/Core/Transpose.h | 417 -- .../eigen3/Eigen/src/Core/Transpositions.h | 436 -- .../eigen3/Eigen/src/Core/TriangularMatrix.h | 830 --- .../eigen3/Eigen/src/Core/VectorBlock.h | 95 - .../eigen3/Eigen/src/Core/VectorwiseOp.h | 641 --- .../eigen3/Eigen/src/Core/Visitor.h | 237 - .../Eigen/src/Core/arch/AltiVec/Complex.h | 217 - .../Eigen/src/Core/arch/AltiVec/PacketMath.h | 501 -- .../Eigen/src/Core/arch/Default/Settings.h | 49 - .../eigen3/Eigen/src/Core/arch/NEON/Complex.h | 253 - .../Eigen/src/Core/arch/NEON/PacketMath.h | 410 -- .../eigen3/Eigen/src/Core/arch/SSE/Complex.h | 442 -- .../Eigen/src/Core/arch/SSE/MathFunctions.h | 464 -- .../Eigen/src/Core/arch/SSE/PacketMath.h | 648 --- .../src/Core/products/CoeffBasedProduct.h | 441 -- .../Core/products/GeneralBlockPanelKernel.h | 1335 ----- .../src/Core/products/GeneralMatrixMatrix.h | 427 -- .../products/GeneralMatrixMatrixTriangular.h | 278 - .../GeneralMatrixMatrixTriangular_MKL.h | 146 - .../Core/products/GeneralMatrixMatrix_MKL.h | 118 - .../src/Core/products/GeneralMatrixVector.h | 573 -- .../Core/products/GeneralMatrixVector_MKL.h | 131 - .../Eigen/src/Core/products/Parallelizer.h | 159 - .../Core/products/SelfadjointMatrixMatrix.h | 436 -- .../products/SelfadjointMatrixMatrix_MKL.h | 295 - .../Core/products/SelfadjointMatrixVector.h | 281 - .../products/SelfadjointMatrixVector_MKL.h | 114 - .../src/Core/products/SelfadjointProduct.h | 123 - .../Core/products/SelfadjointRank2Update.h | 93 - .../Core/products/TriangularMatrixMatrix.h | 427 -- .../products/TriangularMatrixMatrix_MKL.h | 309 -- .../Core/products/TriangularMatrixVector.h | 348 -- .../products/TriangularMatrixVector_MKL.h | 247 - .../Core/products/TriangularSolverMatrix.h | 329 -- .../products/TriangularSolverMatrix_MKL.h | 155 - .../Core/products/TriangularSolverVector.h | 139 - .../eigen3/Eigen/src/Core/util/BlasUtil.h | 264 - .../eigen3/Eigen/src/Core/util/Constants.h | 438 -- .../src/Core/util/DisableStupidWarnings.h | 40 - .../Eigen/src/Core/util/ForwardDeclarations.h | 299 -- .../eigen3/Eigen/src/Core/util/MKL_support.h | 109 - .../eigen3/Eigen/src/Core/util/Macros.h | 418 -- .../eigen3/Eigen/src/Core/util/Memory.h | 981 ---- .../eigen3/Eigen/src/Core/util/Meta.h | 243 - .../eigen3/Eigen/src/Core/util/NonMPL2.h | 3 - .../src/Core/util/ReenableStupidWarnings.h | 14 - .../eigen3/Eigen/src/Core/util/StaticAssert.h | 206 - .../eigen3/Eigen/src/Core/util/XprHelper.h | 469 -- .../eigen3/Eigen/src/Eigen2Support/Block.h | 126 - .../eigen3/Eigen/src/Eigen2Support/Cwise.h | 192 - .../Eigen/src/Eigen2Support/CwiseOperators.h | 298 - .../src/Eigen2Support/Geometry/AlignedBox.h | 159 - .../Eigen/src/Eigen2Support/Geometry/All.h | 115 - .../src/Eigen2Support/Geometry/AngleAxis.h | 214 - .../src/Eigen2Support/Geometry/Hyperplane.h | 254 - .../Eigen2Support/Geometry/ParametrizedLine.h | 141 - .../src/Eigen2Support/Geometry/Quaternion.h | 495 -- .../src/Eigen2Support/Geometry/Rotation2D.h | 145 - .../src/Eigen2Support/Geometry/RotationBase.h | 123 - .../src/Eigen2Support/Geometry/Scaling.h | 167 - .../src/Eigen2Support/Geometry/Transform.h | 786 --- .../src/Eigen2Support/Geometry/Translation.h | 184 - .../eigen3/Eigen/src/Eigen2Support/LU.h | 120 - .../eigen3/Eigen/src/Eigen2Support/Lazy.h | 71 - .../Eigen/src/Eigen2Support/LeastSquares.h | 170 - .../eigen3/Eigen/src/Eigen2Support/Macros.h | 20 - .../Eigen/src/Eigen2Support/MathFunctions.h | 57 - .../eigen3/Eigen/src/Eigen2Support/Memory.h | 45 - .../eigen3/Eigen/src/Eigen2Support/Meta.h | 75 - .../eigen3/Eigen/src/Eigen2Support/Minor.h | 117 - .../eigen3/Eigen/src/Eigen2Support/QR.h | 67 - .../eigen3/Eigen/src/Eigen2Support/SVD.h | 638 --- .../src/Eigen2Support/TriangularSolver.h | 42 - .../Eigen/src/Eigen2Support/VectorBlock.h | 94 - .../src/Eigenvalues/ComplexEigenSolver.h | 333 -- .../Eigen/src/Eigenvalues/ComplexSchur.h | 456 -- .../Eigen/src/Eigenvalues/ComplexSchur_MKL.h | 94 - .../Eigen/src/Eigenvalues/EigenSolver.h | 598 --- .../src/Eigenvalues/GeneralizedEigenSolver.h | 341 -- .../GeneralizedSelfAdjointEigenSolver.h | 227 - .../src/Eigenvalues/HessenbergDecomposition.h | 373 -- .../src/Eigenvalues/MatrixBaseEigenvalues.h | 160 - .../eigen3/Eigen/src/Eigenvalues/RealQZ.h | 624 --- .../eigen3/Eigen/src/Eigenvalues/RealSchur.h | 529 -- .../Eigen/src/Eigenvalues/RealSchur_MKL.h | 83 - .../src/Eigenvalues/SelfAdjointEigenSolver.h | 802 --- .../Eigenvalues/SelfAdjointEigenSolver_MKL.h | 92 - .../src/Eigenvalues/Tridiagonalization.h | 557 -- .../eigen3/Eigen/src/Geometry/AlignedBox.h | 375 -- .../eigen3/Eigen/src/Geometry/AngleAxis.h | 233 - .../eigen3/Eigen/src/Geometry/EulerAngles.h | 104 - .../eigen3/Eigen/src/Geometry/Homogeneous.h | 307 -- .../eigen3/Eigen/src/Geometry/Hyperplane.h | 270 - .../eigen3/Eigen/src/Geometry/OrthoMethods.h | 218 - .../Eigen/src/Geometry/ParametrizedLine.h | 195 - .../eigen3/Eigen/src/Geometry/Quaternion.h | 775 --- .../eigen3/Eigen/src/Geometry/Rotation2D.h | 157 - .../eigen3/Eigen/src/Geometry/RotationBase.h | 206 - .../eigen3/Eigen/src/Geometry/Scaling.h | 166 - .../eigen3/Eigen/src/Geometry/Transform.h | 1440 ----- .../eigen3/Eigen/src/Geometry/Translation.h | 206 - .../eigen3/Eigen/src/Geometry/Umeyama.h | 177 - .../Eigen/src/Geometry/arch/Geometry_SSE.h | 115 - .../Eigen/src/Householder/BlockHouseholder.h | 68 - .../Eigen/src/Householder/Householder.h | 171 - .../src/Householder/HouseholderSequence.h | 441 -- .../BasicPreconditioners.h | 149 - .../src/IterativeLinearSolvers/BiCGSTAB.h | 275 - .../ConjugateGradient.h | 265 - .../IterativeLinearSolvers/IncompleteLUT.h | 467 -- .../IterativeSolverBase.h | 254 - .../eigen3/Eigen/src/Jacobi/Jacobi.h | 433 -- .../eigen3/Eigen/src/LU/Determinant.h | 101 - .../eigen3/Eigen/src/LU/FullPivLU.h | 742 --- .../eigen3/Eigen/src/LU/Inverse.h | 400 -- .../eigen3/Eigen/src/LU/PartialPivLU.h | 501 -- .../eigen3/Eigen/src/LU/PartialPivLU_MKL.h | 85 - .../eigen3/Eigen/src/LU/arch/Inverse_SSE.h | 329 -- .../Eigen/src/MetisSupport/MetisSupport.h | 137 - .../eigen3/Eigen/src/OrderingMethods/Amd.h | 435 -- .../Eigen/src/OrderingMethods/Eigen_Colamd.h | 1850 ------- .../Eigen/src/OrderingMethods/Ordering.h | 150 - .../Eigen/src/PaStiXSupport/PaStiXSupport.h | 721 --- .../Eigen/src/PardisoSupport/PardisoSupport.h | 592 -- .../eigen3/Eigen/src/QR/ColPivHouseholderQR.h | 579 -- .../Eigen/src/QR/ColPivHouseholderQR_MKL.h | 99 - .../Eigen/src/QR/FullPivHouseholderQR.h | 623 --- .../eigen3/Eigen/src/QR/HouseholderQR.h | 374 -- .../eigen3/Eigen/src/QR/HouseholderQR_MKL.h | 69 - .../src/SPQRSupport/SuiteSparseQRSupport.h | 306 -- .../eigen3/Eigen/src/SVD/JacobiSVD.h | 879 --- .../eigen3/Eigen/src/SVD/JacobiSVD_MKL.h | 92 - .../Eigen/src/SVD/UpperBidiagonalization.h | 148 - .../src/SparseCholesky/SimplicialCholesky.h | 667 --- .../SparseCholesky/SimplicialCholesky_impl.h | 199 - .../eigen3/Eigen/src/SparseCore/AmbiVector.h | 373 -- .../Eigen/src/SparseCore/CompressedStorage.h | 233 - .../ConservativeSparseSparseProduct.h | 245 - .../Eigen/src/SparseCore/MappedSparseMatrix.h | 179 - .../eigen3/Eigen/src/SparseCore/SparseBlock.h | 405 -- .../Eigen/src/SparseCore/SparseColEtree.h | 204 - .../src/SparseCore/SparseCwiseBinaryOp.h | 324 -- .../Eigen/src/SparseCore/SparseCwiseUnaryOp.h | 163 - .../Eigen/src/SparseCore/SparseDenseProduct.h | 301 -- .../src/SparseCore/SparseDiagonalProduct.h | 196 - .../eigen3/Eigen/src/SparseCore/SparseDot.h | 101 - .../eigen3/Eigen/src/SparseCore/SparseFuzzy.h | 26 - .../Eigen/src/SparseCore/SparseMatrix.h | 1258 ----- .../Eigen/src/SparseCore/SparseMatrixBase.h | 451 -- .../Eigen/src/SparseCore/SparsePermutation.h | 148 - .../Eigen/src/SparseCore/SparseProduct.h | 187 - .../eigen3/Eigen/src/SparseCore/SparseRedux.h | 45 - .../src/SparseCore/SparseSelfAdjointView.h | 507 -- .../SparseSparseProductWithPruning.h | 149 - .../Eigen/src/SparseCore/SparseTranspose.h | 63 - .../src/SparseCore/SparseTriangularView.h | 179 - .../eigen3/Eigen/src/SparseCore/SparseUtil.h | 171 - .../Eigen/src/SparseCore/SparseVector.h | 447 -- .../eigen3/Eigen/src/SparseCore/SparseView.h | 99 - .../Eigen/src/SparseCore/TriangularSolver.h | 334 -- .../eigen3/Eigen/src/SparseLU/SparseLU.h | 756 --- .../eigen3/Eigen/src/SparseLU/SparseLUImpl.h | 64 - .../Eigen/src/SparseLU/SparseLU_Memory.h | 222 - .../Eigen/src/SparseLU/SparseLU_Structs.h | 111 - .../src/SparseLU/SparseLU_SupernodalMatrix.h | 298 - .../Eigen/src/SparseLU/SparseLU_Utils.h | 80 - .../Eigen/src/SparseLU/SparseLU_column_bmod.h | 180 - .../Eigen/src/SparseLU/SparseLU_column_dfs.h | 177 - .../src/SparseLU/SparseLU_copy_to_ucol.h | 106 - .../Eigen/src/SparseLU/SparseLU_gemm_kernel.h | 279 - .../src/SparseLU/SparseLU_heap_relax_snode.h | 127 - .../Eigen/src/SparseLU/SparseLU_kernel_bmod.h | 130 - .../Eigen/src/SparseLU/SparseLU_panel_bmod.h | 223 - .../Eigen/src/SparseLU/SparseLU_panel_dfs.h | 258 - .../Eigen/src/SparseLU/SparseLU_pivotL.h | 134 - .../Eigen/src/SparseLU/SparseLU_pruneL.h | 135 - .../Eigen/src/SparseLU/SparseLU_relax_snode.h | 83 - .../eigen3/Eigen/src/SparseQR/SparseQR.h | 654 --- .../eigen3/Eigen/src/StlSupport/StdDeque.h | 134 - .../eigen3/Eigen/src/StlSupport/StdList.h | 114 - .../eigen3/Eigen/src/StlSupport/StdVector.h | 126 - .../eigen3/Eigen/src/StlSupport/details.h | 84 - .../Eigen/src/SuperLUSupport/SuperLUSupport.h | 1026 ---- .../Eigen/src/UmfPackSupport/UmfPackSupport.h | 432 -- .../eigen3/Eigen/src/misc/Image.h | 84 - .../eigen3/Eigen/src/misc/Kernel.h | 81 - .../eigen3/Eigen/src/misc/Solve.h | 76 - .../eigen3/Eigen/src/misc/SparseSolve.h | 128 - .../eigen3/Eigen/src/misc/blas.h | 658 --- .../Eigen/src/plugins/ArrayCwiseBinaryOps.h | 211 - .../Eigen/src/plugins/ArrayCwiseUnaryOps.h | 203 - .../eigen3/Eigen/src/plugins/BlockMethods.h | 901 ---- .../Eigen/src/plugins/CommonCwiseBinaryOps.h | 46 - .../Eigen/src/plugins/CommonCwiseUnaryOps.h | 172 - .../Eigen/src/plugins/MatrixCwiseBinaryOps.h | 126 - .../Eigen/src/plugins/MatrixCwiseUnaryOps.h | 67 - .../eigen3/signature_of_eigen3_matrix_library | 1 - .../eigen3/unsupported/Eigen/AdolcForward | 156 - .../eigen3/unsupported/Eigen/AlignedVector3 | 190 - .../eigen3/unsupported/Eigen/AutoDiff | 40 - .../eigen3/unsupported/Eigen/BVH | 95 - .../eigen3/unsupported/Eigen/FFT | 418 -- .../eigen3/unsupported/Eigen/IterativeSolvers | 45 - .../eigen3/unsupported/Eigen/KroneckerProduct | 34 - .../unsupported/Eigen/LevenbergMarquardt | 45 - .../eigen3/unsupported/Eigen/MPRealSupport | 203 - .../eigen3/unsupported/Eigen/MatrixFunctions | 447 -- .../unsupported/Eigen/MoreVectorization | 24 - .../unsupported/Eigen/NonLinearOptimization | 134 - .../eigen3/unsupported/Eigen/NumericalDiff | 56 - .../eigen3/unsupported/Eigen/OpenGLSupport | 317 -- .../eigen3/unsupported/Eigen/Polynomials | 138 - .../eigen3/unsupported/Eigen/Skyline | 39 - .../eigen3/unsupported/Eigen/SparseExtra | 56 - .../eigen3/unsupported/Eigen/Splines | 31 - .../Eigen/src/AutoDiff/AutoDiffJacobian.h | 83 - .../Eigen/src/AutoDiff/AutoDiffScalar.h | 642 --- .../Eigen/src/AutoDiff/AutoDiffVector.h | 220 - .../unsupported/Eigen/src/BVH/BVAlgorithms.h | 293 - .../eigen3/unsupported/Eigen/src/BVH/KdBVH.h | 222 - .../unsupported/Eigen/src/FFT/ei_fftw_impl.h | 261 - .../Eigen/src/FFT/ei_kissfft_impl.h | 420 -- .../IterativeSolvers/ConstrainedConjGrad.h | 185 - .../Eigen/src/IterativeSolvers/DGMRES.h | 542 -- .../Eigen/src/IterativeSolvers/GMRES.h | 379 -- .../src/IterativeSolvers/IncompleteCholesky.h | 278 - .../Eigen/src/IterativeSolvers/IncompleteLU.h | 113 - .../IterativeSolvers/IterationController.h | 154 - .../Eigen/src/IterativeSolvers/MINRES.h | 302 -- .../Eigen/src/IterativeSolvers/Scaling.h | 185 - .../KroneckerProduct/KroneckerTensorProduct.h | 244 - .../src/MatrixFunctions/MatrixExponential.h | 451 -- .../src/MatrixFunctions/MatrixFunction.h | 591 -- .../MatrixFunctions/MatrixFunctionAtomic.h | 131 - .../src/MatrixFunctions/MatrixLogarithm.h | 486 -- .../Eigen/src/MatrixFunctions/MatrixPower.h | 509 -- .../src/MatrixFunctions/MatrixSquareRoot.h | 466 -- .../Eigen/src/MatrixFunctions/StemFunction.h | 105 - .../src/MoreVectorization/MathFunctions.h | 95 - .../HybridNonLinearSolver.h | 601 --- .../LevenbergMarquardt.h | 650 --- .../Eigen/src/NonLinearOptimization/chkder.h | 66 - .../Eigen/src/NonLinearOptimization/covar.h | 70 - .../Eigen/src/NonLinearOptimization/dogleg.h | 107 - .../Eigen/src/NonLinearOptimization/fdjac1.h | 79 - .../Eigen/src/NonLinearOptimization/lmpar.h | 298 - .../Eigen/src/NonLinearOptimization/qrsolv.h | 91 - .../Eigen/src/NonLinearOptimization/r1mpyq.h | 30 - .../Eigen/src/NonLinearOptimization/r1updt.h | 99 - .../Eigen/src/NonLinearOptimization/rwupdt.h | 49 - .../Eigen/src/NumericalDiff/NumericalDiff.h | 130 - .../Eigen/src/Polynomials/Companion.h | 276 - .../Eigen/src/Polynomials/PolynomialSolver.h | 389 -- .../Eigen/src/Polynomials/PolynomialUtils.h | 143 - .../Eigen/src/Skyline/SkylineInplaceLU.h | 352 -- .../Eigen/src/Skyline/SkylineMatrix.h | 862 --- .../Eigen/src/Skyline/SkylineMatrixBase.h | 212 - .../Eigen/src/Skyline/SkylineProduct.h | 295 - .../Eigen/src/Skyline/SkylineStorage.h | 259 - .../Eigen/src/Skyline/SkylineUtil.h | 89 - .../SparseExtra/BlockOfDynamicSparseMatrix.h | 122 - .../src/SparseExtra/DynamicSparseMatrix.h | 357 -- .../Eigen/src/SparseExtra/MarketIO.h | 273 - .../src/SparseExtra/MatrixMarketIterator.h | 232 - .../Eigen/src/SparseExtra/RandomSetter.h | 327 -- .../unsupported/Eigen/src/Splines/Spline.h | 474 -- .../Eigen/src/Splines/SplineFitting.h | 156 - .../unsupported/Eigen/src/Splines/SplineFwd.h | 86 - .../include/acado/function/c_function.hpp | 316 -- .../include/acado/function/c_operator.hpp | 484 -- .../acado/function/differential_equation.hpp | 286 - .../acado/function/differential_equation.ipp | 124 - .../discretized_differential_equation.hpp | 112 - .../discretized_differential_equation.ipp | 46 - .../acado/function/evaluation_point.hpp | 206 - .../acado/function/evaluation_point.ipp | 111 - .../acado/include/acado/function/function.hpp | 50 - .../acado/include/acado/function/function.ipp | 84 - .../include/acado/function/function_.hpp | 545 -- .../function/function_evaluation_tree.hpp | 519 -- .../function/function_evaluation_tree.ipp | 53 - .../include/acado/function/function_fwd.hpp | 53 - .../include/acado/function/ocp_iterate.hpp | 226 - .../include/acado/function/ocp_iterate.ipp | 104 - .../include/acado/function/output_fcn.hpp | 137 - .../include/acado/function/output_fcn.ipp | 55 - .../acado/function/t_evaluation_point.hpp | 318 -- .../acado/function/t_evaluation_point.ipp | 83 - .../include/acado/function/transition.hpp | 117 - .../include/acado/function/transition.ipp | 58 - .../include/acado/integrator/integrator.hpp | 740 --- .../include/acado/integrator/integrator.ipp | 112 - .../acado/integrator/integrator_bdf.hpp | 653 --- .../acado/integrator/integrator_bdf.ipp | 51 - .../integrator/integrator_discretized_ode.hpp | 126 - .../integrator/integrator_discretized_ode.ipp | 42 - .../acado/integrator/integrator_fwd.hpp | 69 - .../acado/integrator/integrator_lyapunov.hpp | 508 -- .../acado/integrator/integrator_lyapunov.ipp | 51 - .../integrator/integrator_lyapunov45.hpp | 96 - .../integrator/integrator_lyapunov45.ipp | 42 - .../integrator/integrator_runge_kutta.hpp | 497 -- .../integrator/integrator_runge_kutta.ipp | 51 - .../integrator/integrator_runge_kutta12.hpp | 104 - .../integrator/integrator_runge_kutta12.ipp | 42 - .../integrator/integrator_runge_kutta23.hpp | 99 - .../integrator/integrator_runge_kutta23.ipp | 42 - .../integrator/integrator_runge_kutta45.hpp | 98 - .../integrator/integrator_runge_kutta45.ipp | 42 - .../integrator/integrator_runge_kutta78.hpp | 99 - .../integrator/integrator_runge_kutta78.ipp | 42 - .../acado/matrix_vector/acado_mat_file.hpp | 80 - .../acado/matrix_vector/block_matrix.hpp | 229 - .../acado/matrix_vector/block_matrix.ipp | 175 - .../include/acado/matrix_vector/matrix.hpp | 484 -- .../acado/matrix_vector/matrix_vector.hpp | 47 - .../matrix_vector/matrix_vector_tools.hpp | 42 - .../include/acado/matrix_vector/t_matrix.hpp | 629 --- .../include/acado/matrix_vector/vector.hpp | 340 -- .../bfgs_update.hpp | 209 - .../bfgs_update.ipp | 63 - .../constant_hessian.hpp | 128 - .../exact_hessian.hpp | 135 - .../gauss_newton_approximation.hpp | 131 - .../gauss_newton_approximation_bfgs.hpp | 131 - .../nlp_derivative_approximation.hpp | 144 - .../nlp_derivative_approximation.ipp | 51 - .../include/acado/nlp_solver/ip_method.hpp | 119 - .../include/acado/nlp_solver/ip_method.ipp | 47 - .../include/acado/nlp_solver/nlp_solver.hpp | 200 - .../include/acado/nlp_solver/nlp_solver.ipp | 58 - .../acado/nlp_solver/scp_evaluation.hpp | 200 - .../acado/nlp_solver/scp_evaluation.ipp | 101 - .../acado/nlp_solver/scp_merit_function.hpp | 135 - .../include/acado/nlp_solver/scp_method.hpp | 290 - .../include/acado/nlp_solver/scp_method.ipp | 95 - .../include/acado/nlp_solver/scp_step.hpp | 140 - .../acado/nlp_solver/scp_step_fullstep.hpp | 113 - .../acado/nlp_solver/scp_step_linesearch.hpp | 128 - .../include/acado/noise/colored_noise.hpp | 182 - .../include/acado/noise/colored_noise.ipp | 47 - .../include/acado/noise/gaussian_noise.hpp | 283 - .../include/acado/noise/gaussian_noise.ipp | 125 - phonelibs/acado/include/acado/noise/noise.hpp | 214 - phonelibs/acado/include/acado/noise/noise.ipp | 94 - .../include/acado/noise/uniform_noise.hpp | 246 - .../include/acado/noise/uniform_noise.ipp | 56 - .../include/acado/objective/lagrange_term.hpp | 129 - .../include/acado/objective/lagrange_term.ipp | 92 - .../include/acado/objective/lsq_end_term.hpp | 178 - .../include/acado/objective/lsq_end_term.ipp | 76 - .../include/acado/objective/lsq_term.hpp | 189 - .../include/acado/objective/lsq_term.ipp | 128 - .../include/acado/objective/mayer_term.hpp | 137 - .../include/acado/objective/mayer_term.ipp | 53 - .../include/acado/objective/objective.hpp | 496 -- .../include/acado/objective/objective.ipp | 159 - .../acado/objective/objective_element.hpp | 292 - .../acado/objective/objective_element.ipp | 95 - .../include/acado/ocp/model_container.hpp | 454 -- .../acado/include/acado/ocp/model_data.hpp | 500 -- .../ocp/multi_objective_functionality.hpp | 92 - .../ocp/multi_objective_functionality.ipp | 66 - phonelibs/acado/include/acado/ocp/nlp.hpp | 63 - phonelibs/acado/include/acado/ocp/ocp.hpp | 405 -- .../optimization_algorithm/mhe_algorithm.hpp | 149 - .../multi_objective_algorithm.hpp | 293 - .../multi_objective_algorithm.ipp | 337 -- .../optimization_algorithm.hpp | 136 - .../optimization_algorithm_base.hpp | 257 - .../parameter_estimation_algorithm.hpp | 159 - .../parameter_estimation_algorithm.ipp | 47 - .../real_time_algorithm.hpp | 416 -- .../real_time_algorithm.ipp | 47 - .../weight_generation.hpp | 132 - .../acado/include/acado/process/process.hpp | 636 --- .../acado/include/acado/process/process.ipp | 196 - .../adaptive_reference_trajectory.hpp | 195 - .../adaptive_reference_trajectory.ipp | 47 - .../periodic_reference_trajectory.hpp | 152 - .../periodic_reference_trajectory.ipp | 47 - .../reference_trajectory.hpp | 209 - .../reference_trajectory.ipp | 56 - .../simulated_reference_trajectory.hpp | 201 - .../static_reference_trajectory.hpp | 226 - .../static_reference_trajectory.ipp | 47 - .../acado/set_arithmetics/interval.hpp | 188 - .../acado/set_arithmetics/interval.ipp | 308 -- .../acado/set_arithmetics/set_arithmetics.hpp | 45 - .../acado/set_arithmetics/taylor_model.hpp | 245 - .../acado/set_arithmetics/taylor_model.ipp | 269 - .../acado/set_arithmetics/taylor_variable.hpp | 380 -- .../acado/set_arithmetics/taylor_variable.ipp | 1307 ----- .../simulation_block.hpp | 165 - .../simulation_block.ipp | 90 - .../simulation_environment.hpp | 383 -- .../simulation_environment.ipp | 207 - .../conjugate_gradient_method.hpp | 213 - .../conjugate_gradient_method.ipp | 43 - .../normal_conjugate_gradient_method.hpp | 139 - .../normal_conjugate_gradient_method.ipp | 43 - .../acado/sparse_solver/sparse_solver.hpp | 191 - .../acado/sparse_solver/sparse_solver.ipp | 43 - .../symmetric_conjugate_gradient_method.hpp | 145 - .../symmetric_conjugate_gradient_method.ipp | 43 - .../symbolic_expression/acado_syntax.hpp | 154 - .../constraint_component.hpp | 188 - .../constraint_component.ipp | 226 - .../acado/symbolic_expression/expression.hpp | 410 -- .../acado/symbolic_expression/expression.ipp | 87 - .../acado/symbolic_expression/lyapunov.hpp | 136 - .../symbolic_expression.hpp | 52 - .../symbolic_expression/variable_types.hpp | 245 - .../include/acado/symbolic_operator/acos.hpp | 109 - .../acado/symbolic_operator/addition.hpp | 350 -- .../include/acado/symbolic_operator/asin.hpp | 108 - .../include/acado/symbolic_operator/atan.hpp | 107 - .../symbolic_operator/binary_operator.hpp | 492 -- .../include/acado/symbolic_operator/cos.hpp | 110 - .../symbolic_operator/doubleconstant.hpp | 465 -- .../symbolic_operator/evaluation_base.hpp | 83 - .../symbolic_operator/evaluation_template.hpp | 209 - .../include/acado/symbolic_operator/exp.hpp | 120 - .../acado/symbolic_operator/logarithm.hpp | 120 - .../symbolic_operator/nonsmooth_operator.hpp | 540 -- .../acado/symbolic_operator/operator.hpp | 655 --- .../include/acado/symbolic_operator/power.hpp | 357 -- .../acado/symbolic_operator/powerint.hpp | 485 -- .../acado/symbolic_operator/product.hpp | 349 -- .../acado/symbolic_operator/projection.hpp | 564 -- .../acado/symbolic_operator/quotient.hpp | 352 -- .../include/acado/symbolic_operator/sin.hpp | 109 - .../symbolic_operator/smooth_operator.hpp | 535 -- .../acado/symbolic_operator/subtraction.hpp | 347 -- .../symbolic_operator/symbolic_index_list.hpp | 294 - .../symbolic_operator/symbolic_index_list.ipp | 395 -- .../symbolic_operator/symbolic_operator.hpp | 70 - .../symbolic_operator_fwd.hpp | 78 - .../include/acado/symbolic_operator/tan.hpp | 109 - .../symbolic_operator/tree_projection.hpp | 294 - .../symbolic_operator/unary_operator.hpp | 481 -- .../acado/transfer_device/actuator.hpp | 404 -- .../acado/transfer_device/actuator.ipp | 127 - .../include/acado/transfer_device/sensor.hpp | 277 - .../include/acado/transfer_device/sensor.ipp | 83 - .../acado/transfer_device/transfer_device.hpp | 195 - .../acado/transfer_device/transfer_device.ipp | 97 - .../user_interaction/algorithmic_base.hpp | 615 --- .../user_interaction/algorithmic_base.ipp | 270 - .../acado/user_interaction/log_record.hpp | 705 --- .../acado/user_interaction/log_record.ipp | 359 -- .../acado/user_interaction/logging.hpp | 288 - .../acado/user_interaction/logging.ipp | 143 - .../acado/user_interaction/options.hpp | 485 -- .../acado/user_interaction/options_list.hpp | 300 -- .../acado/user_interaction/options_list.ipp | 86 - .../user_interaction/plot_collection.hpp | 188 - .../user_interaction/plot_collection.ipp | 81 - .../acado/user_interaction/plot_window.hpp | 783 --- .../acado/user_interaction/plot_window.ipp | 221 - .../user_interaction/plot_window_subplot.hpp | 459 -- .../user_interaction/plot_window_subplot.ipp | 260 - .../acado/user_interaction/plotting.hpp | 209 - .../acado/user_interaction/plotting.ipp | 88 - .../user_interaction/user_interaction.hpp | 180 - .../include/acado/utils/acado_constants.hpp | 101 - .../include/acado/utils/acado_debugging.hpp | 60 - .../acado/utils/acado_default_options.hpp | 114 - .../include/acado/utils/acado_io_utils.hpp | 248 - .../acado/utils/acado_message_handling.hpp | 243 - .../acado/utils/acado_message_handling.ipp | 130 - .../acado/utils/acado_namespace_macros.hpp | 67 - .../acado/include/acado/utils/acado_types.hpp | 1245 ----- .../acado/include/acado/utils/acado_utils.hpp | 157 - .../acado/utils/matlab_acado_utils.hpp | 157 - .../ellipsoidal_integrator.hpp | 199 - .../ellipsoidal_integrator.ipp | 428 -- .../include/acado/variables_grid/grid.hpp | 626 --- .../include/acado/variables_grid/grid.ipp | 326 -- .../acado/variables_grid/matrix_variable.hpp | 213 - .../acado/variables_grid/matrix_variable.ipp | 53 - .../variables_grid/matrix_variables_grid.hpp | 1243 ----- .../variables_grid/matrix_variables_grid.ipp | 666 --- .../variables_grid/variable_settings.hpp | 469 -- .../variables_grid/variable_settings.ipp | 296 - .../acado/variables_grid/variables_grid.hpp | 660 --- .../acado/variables_grid/variables_grid.ipp | 118 - phonelibs/acado/x86_64/lib/libacado_casadi.a | 3 - phonelibs/acado/x86_64/lib/libacado_csparse.a | 3 - phonelibs/acado/x86_64/lib/libacado_qpoases.a | 3 - phonelibs/acado/x86_64/lib/libacado_toolkit.a | 3 - .../acado/x86_64/lib/libacado_toolkit_s.so | 1 - .../acado/x86_64/lib/libacado_toolkit_s.so.1 | 1 - .../lib/libacado_toolkit_s.so.1.2.2beta | 3 - release/files_common | 2 - selfdrive/controls/lib/lateral_mpc/.gitignore | 2 - selfdrive/controls/lib/lateral_mpc/SConscript | 48 - .../controls/lib/lateral_mpc/__init__.py | 0 .../controls/lib/lateral_mpc/generator.cpp | 107 - .../controls/lib/lateral_mpc/lateral_mpc.c | 109 - .../acado_auxiliary_functions.c | 212 - .../acado_auxiliary_functions.h | 138 - .../lateral_mpc/lib_mpc_export/acado_common.h | 354 -- .../lib_mpc_export/acado_integrator.c | 240 - .../acado_qpoases_interface.cpp | 70 - .../acado_qpoases_interface.hpp | 65 - .../lateral_mpc/lib_mpc_export/acado_solver.c | 3384 ------------ .../controls/lib/lateral_mpc/libmpc_py.py | 32 - selfdrive/controls/lib/lead_mpc.py | 111 - .../controls/lib/lead_mpc_lib/generator.cpp | 97 - .../acado_auxiliary_functions.c | 212 - .../acado_auxiliary_functions.h | 138 - .../lib_mpc_export/acado_common.h | 354 -- .../lib_mpc_export/acado_integrator.c | 159 - .../acado_qpoases_interface.cpp | 70 - .../acado_qpoases_interface.hpp | 65 - .../lib_mpc_export/acado_solver.c | 4782 ----------------- .../controls/lib/lead_mpc_lib/libmpc_py.py | 41 - .../lib/lead_mpc_lib/longitudinal_mpc.c | 173 - selfdrive/controls/lib/long_mpc.py | 73 - .../lib/longitudinal_mpc_lib/generator.cpp | 82 - .../acado_auxiliary_functions.c | 212 - .../acado_auxiliary_functions.h | 138 - .../lib_mpc_export/acado_common.h | 372 -- .../lib_mpc_export/acado_integrator.c | 250 - .../acado_qpoases_interface.cpp | 70 - .../acado_qpoases_interface.hpp | 65 - .../lib_mpc_export/acado_solver.c | 1932 ------- .../lib/longitudinal_mpc_lib/libmpc_py.py | 34 - .../longitudinal_mpc_lib/longitudinal_mpc.c | 108 - 847 files changed, 196915 deletions(-) delete mode 100644 phonelibs/acado/01.patch delete mode 100755 phonelibs/acado/build.sh delete mode 100644 phonelibs/acado/include/acado/acado_code_generation.hpp delete mode 100644 phonelibs/acado/include/acado/acado_controller.hpp delete mode 100644 phonelibs/acado/include/acado/acado_gnuplot.hpp delete mode 100644 phonelibs/acado/include/acado/acado_integrators.hpp delete mode 100644 phonelibs/acado/include/acado/acado_optimal_control.hpp delete mode 100644 phonelibs/acado/include/acado/acado_toolkit.hpp delete mode 100644 phonelibs/acado/include/acado/bindings/acado_csparse/acado_csparse.hpp delete mode 100644 phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.hpp delete mode 100644 phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.ipp delete mode 100644 phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.hpp delete mode 100644 phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.ipp delete mode 100644 phonelibs/acado/include/acado/clock/clock.hpp delete mode 100644 phonelibs/acado/include/acado/clock/clock.ipp delete mode 100644 phonelibs/acado/include/acado/clock/real_clock.hpp delete mode 100644 phonelibs/acado/include/acado/clock/real_clock.ipp delete mode 100644 phonelibs/acado/include/acado/clock/simulation_clock.hpp delete mode 100644 phonelibs/acado/include/acado/clock/simulation_clock.ipp delete mode 100644 phonelibs/acado/include/acado/code_generation/code_generation.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_acado_function.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_algorithm_factory.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_argument.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_argument_internal.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_argument_list.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_arithmetic_statement.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_auxiliary_functions.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_cholesky_decomposition.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_common_header.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_data.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_data_declaration.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_data_internal.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_exact_hessian_cn2.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_exact_hessian_qpdunes.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_file.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_for_loop.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_forces_generator.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_forces_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_function.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_function_call.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_function_declaration.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_cn2.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_forces.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_qpdunes.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2_factorization.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_condensed.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_forces.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_generic.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_hpmpc.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_gauss_newton_qpdunes.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_hessian_regularization.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_hpmpc_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_index.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_index_node.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_module.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_nlp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_qpdunes_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_qpoases3_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_qpoases_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_simulink_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_split_qpdunes_interface.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_statement.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_statement_block.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_statement_string.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_templated_file.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_variable.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/export_variable_internal.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/dirk3_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/dirk4_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/dirk5_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/dirk_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/discrete_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk2_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk3_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk4_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk_3sweep_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk_adjoint_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk_export.ipp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/erk_fob_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/explicit_euler_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/export_auxiliary_sim_functions.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/export_matlab_integrator.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre2_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre4_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre6_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre8_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/integrator_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/integrator_export_types.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/integrator_generation.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_export.ipp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_forward_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_adjoint_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_feedback_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_fob_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_forward_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_symmetric_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/irk_symmetric_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/lifted_erk_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/narx_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/radau_IIA1_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/radau_IIA3_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/radau_IIA5_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/register_exported_integrators.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/rk_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/integrators/rk_sensitivities_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/export_cholesky_solver.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/gaussian_elimination_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/householder_qr_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_simplified_newton_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_single_newton_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_simplified_newton_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_single_newton_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_generation.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/memory_allocator.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/object_pool.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/ocp_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/register_nlp_solvers.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/sim_export.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_EH_solver_mex.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.h.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.h.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_common_header.h.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.py.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_hessian_regularization.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_solver_mex.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.h.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/dummy_test_file.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/forces_interface.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/hpmpc_interface.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/integrator_mex.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpdunes.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases3.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_block_solver_qpdunes.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_integrator.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_forces.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_hpmpc.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpdunes.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases3.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_sfunction.m.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpdunes.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases3.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.forces.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.hpmpc.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.integrator.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.qpdunes.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases3.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpdunes_interface.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpdunes_split_interface.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.c.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.h.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.cpp.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.hpp.in delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/templates.hpp delete mode 100644 phonelibs/acado/include/acado/code_generation/templates/templates.hpp.in delete mode 100644 phonelibs/acado/include/acado/conic_program/banded_cp.hpp delete mode 100644 phonelibs/acado/include/acado/conic_program/banded_cp.ipp delete mode 100644 phonelibs/acado/include/acado/conic_program/dense_cp.hpp delete mode 100644 phonelibs/acado/include/acado/conic_program/dense_cp.ipp delete mode 100644 phonelibs/acado/include/acado/conic_solver/banded_cp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/conic_solver/banded_cp_solver.ipp delete mode 100644 phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.ipp delete mode 100644 phonelibs/acado/include/acado/conic_solver/dense_cp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/conic_solver/dense_qp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/conic_solver/dense_qp_solver.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/boundary_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/boundary_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/box_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/box_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/constraint_element.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/constraint_element.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/coupled_path_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/coupled_path_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/path_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/path_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/constraint/point_constraint.hpp delete mode 100644 phonelibs/acado/include/acado/constraint/point_constraint.ipp delete mode 100644 phonelibs/acado/include/acado/control_law/clipping_functionality.hpp delete mode 100644 phonelibs/acado/include/acado/control_law/clipping_functionality.ipp delete mode 100644 phonelibs/acado/include/acado/control_law/control_law.hpp delete mode 100644 phonelibs/acado/include/acado/control_law/control_law.ipp delete mode 100644 phonelibs/acado/include/acado/control_law/feedforward_law.hpp delete mode 100644 phonelibs/acado/include/acado/control_law/linear_state_feedback.hpp delete mode 100644 phonelibs/acado/include/acado/control_law/pid_controller.hpp delete mode 100644 phonelibs/acado/include/acado/control_law/pid_controller.ipp delete mode 100644 phonelibs/acado/include/acado/controller/controller.hpp delete mode 100644 phonelibs/acado/include/acado/controller/controller.ipp delete mode 100644 phonelibs/acado/include/acado/curve/curve.hpp delete mode 100644 phonelibs/acado/include/acado/curve/curve.ipp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/collocation_method.hpp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/collocation_method.ipp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.hpp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.ipp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/integration_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/shooting_method.hpp delete mode 100644 phonelibs/acado/include/acado/dynamic_discretization/shooting_method.ipp delete mode 100644 phonelibs/acado/include/acado/dynamic_system/dynamic_system.hpp delete mode 100644 phonelibs/acado/include/acado/dynamic_system/dynamic_system.ipp delete mode 100644 phonelibs/acado/include/acado/estimator/dynamic_estimator.hpp delete mode 100644 phonelibs/acado/include/acado/estimator/dynamic_estimator.ipp delete mode 100644 phonelibs/acado/include/acado/estimator/estimator.hpp delete mode 100644 phonelibs/acado/include/acado/estimator/estimator.ipp delete mode 100644 phonelibs/acado/include/acado/estimator/kalman_filter.hpp delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.BSD delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.GPL delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.LGPL delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MINPACK delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MPL2 delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/COPYING.README delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Array delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Cholesky delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/CholmodSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Core delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Dense delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen2Support delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigenvalues delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Geometry delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Householder delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/IterativeLinearSolvers delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Jacobi delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LU delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LeastSquares delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/MetisSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/OrderingMethods delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PaStiXSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PardisoSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QR delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QtAlignedMalloc delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SPQRSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SVD delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Sparse delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCholesky delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCore delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseLU delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseQR delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdDeque delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdList delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdVector delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SuperLUSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/UmfPackSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LDLT.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Array.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayWrapper.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BandMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Block.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BooleanRedux.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CommaInitializer.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CoreIterators.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseBinaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseNullaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryView.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseCoeffsBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseStorage.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Diagonal.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Dot.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/EigenBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Flagged.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ForceAlignedAccess.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Functors.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Fuzzy.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GeneralProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GenericPacketMath.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GlobalFunctions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/IO.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Map.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MapBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MathFunctions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Matrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MatrixBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NestByValue.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NoAlias.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NumTraits.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PermutationMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PlainObjectBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ProductBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Random.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Redux.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Ref.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Replicate.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ReturnByValue.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Reverse.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Select.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/SelfAdjointView.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/SelfCwiseBinaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/SolveTriangular.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/StableNorm.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Stride.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Swap.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Transpose.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Transpositions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/TriangularMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/VectorBlock.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/VectorwiseOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Visitor.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/AltiVec/Complex.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/Default/Settings.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/NEON/Complex.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/NEON/PacketMath.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/SSE/Complex.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/SSE/MathFunctions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/arch/SSE/PacketMath.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/CoeffBasedProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralBlockPanelKernel.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixMatrix_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/GeneralMatrixVector_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/Parallelizer.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointMatrixMatrix_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointMatrixVector_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/SelfadjointRank2Update.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularMatrixMatrix_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularMatrixVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularMatrixVector_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularSolverMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularSolverMatrix_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/products/TriangularSolverVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/BlasUtil.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/Constants.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/DisableStupidWarnings.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/ForwardDeclarations.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/MKL_support.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/Macros.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/Memory.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/Meta.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/NonMPL2.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/ReenableStupidWarnings.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/StaticAssert.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/util/XprHelper.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Block.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Cwise.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/CwiseOperators.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/AlignedBox.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/All.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/AngleAxis.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Hyperplane.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/ParametrizedLine.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Quaternion.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Rotation2D.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/RotationBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Scaling.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Transform.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Geometry/Translation.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/LU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Lazy.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/LeastSquares.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Macros.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/MathFunctions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Memory.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Meta.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/Minor.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/QR.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/SVD.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/TriangularSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigen2Support/VectorBlock.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/ComplexEigenSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/ComplexSchur.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/ComplexSchur_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/EigenSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/HessenbergDecomposition.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/RealQZ.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/RealSchur.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/RealSchur_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Eigenvalues/Tridiagonalization.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/AlignedBox.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/AngleAxis.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/EulerAngles.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Homogeneous.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Hyperplane.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/OrthoMethods.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/ParametrizedLine.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Quaternion.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Rotation2D.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/RotationBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Scaling.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Transform.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Translation.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/Umeyama.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Geometry/arch/Geometry_SSE.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Householder/BlockHouseholder.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Householder/Householder.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Householder/HouseholderSequence.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Jacobi/Jacobi.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/Determinant.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/FullPivLU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/Inverse.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/PartialPivLU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/PartialPivLU_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/LU/arch/Inverse_SSE.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/MetisSupport/MetisSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/OrderingMethods/Amd.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/OrderingMethods/Eigen_Colamd.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/OrderingMethods/Ordering.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/PaStiXSupport/PaStiXSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/PardisoSupport/PardisoSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/QR/ColPivHouseholderQR.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/QR/ColPivHouseholderQR_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/QR/FullPivHouseholderQR.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/QR/HouseholderQR.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/QR/HouseholderQR_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SVD/JacobiSVD.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SVD/JacobiSVD_MKL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SVD/UpperBidiagonalization.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/AmbiVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/CompressedStorage.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/MappedSparseMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseBlock.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseColEtree.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseCwiseBinaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseCwiseUnaryOp.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseDenseProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseDiagonalProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseDot.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseFuzzy.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparsePermutation.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseRedux.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseSelfAdjointView.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseSparseProductWithPruning.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseTranspose.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseTriangularView.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseUtil.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/SparseView.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseCore/TriangularSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLUImpl.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_Memory.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_Structs.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_Utils.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_column_bmod.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_column_dfs.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_gemm_kernel.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_kernel_bmod.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_panel_bmod.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_panel_dfs.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_pivotL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_pruneL.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseLU/SparseLU_relax_snode.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SparseQR/SparseQR.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/StlSupport/StdDeque.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/StlSupport/StdList.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/StlSupport/StdVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/StlSupport/details.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/SuperLUSupport/SuperLUSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/UmfPackSupport/UmfPackSupport.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/misc/Image.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/misc/Kernel.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/misc/Solve.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/misc/SparseSolve.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/misc/blas.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/ArrayCwiseBinaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/ArrayCwiseUnaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/BlockMethods.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/CommonCwiseBinaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/CommonCwiseUnaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/MatrixCwiseBinaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/plugins/MatrixCwiseUnaryOps.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/signature_of_eigen3_matrix_library delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/AdolcForward delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/AlignedVector3 delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/AutoDiff delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/BVH delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/FFT delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/IterativeSolvers delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/KroneckerProduct delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/LevenbergMarquardt delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/MPRealSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/MatrixFunctions delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/MoreVectorization delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/NonLinearOptimization delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/NumericalDiff delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/OpenGLSupport delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/Polynomials delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/Skyline delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/SparseExtra delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/Splines delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffJacobian.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffScalar.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/AutoDiff/AutoDiffVector.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/BVH/BVAlgorithms.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/BVH/KdBVH.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/FFT/ei_fftw_impl.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/FFT/ei_kissfft_impl.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/DGMRES.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/GMRES.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteCholesky.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/IterationController.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/MINRES.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/IterativeSolvers/Scaling.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixPower.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MatrixFunctions/StemFunction.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/MoreVectorization/MathFunctions.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/chkder.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/covar.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/dogleg.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/lmpar.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/r1updt.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Polynomials/Companion.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Polynomials/PolynomialSolver.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Polynomials/PolynomialUtils.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineProduct.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineStorage.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Skyline/SkylineUtil.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/SparseExtra/MarketIO.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/SparseExtra/RandomSetter.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Splines/Spline.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Splines/SplineFitting.h delete mode 100644 phonelibs/acado/include/acado/external_packages/eigen3/unsupported/Eigen/src/Splines/SplineFwd.h delete mode 100644 phonelibs/acado/include/acado/function/c_function.hpp delete mode 100644 phonelibs/acado/include/acado/function/c_operator.hpp delete mode 100644 phonelibs/acado/include/acado/function/differential_equation.hpp delete mode 100644 phonelibs/acado/include/acado/function/differential_equation.ipp delete mode 100644 phonelibs/acado/include/acado/function/discretized_differential_equation.hpp delete mode 100644 phonelibs/acado/include/acado/function/discretized_differential_equation.ipp delete mode 100644 phonelibs/acado/include/acado/function/evaluation_point.hpp delete mode 100644 phonelibs/acado/include/acado/function/evaluation_point.ipp delete mode 100644 phonelibs/acado/include/acado/function/function.hpp delete mode 100644 phonelibs/acado/include/acado/function/function.ipp delete mode 100644 phonelibs/acado/include/acado/function/function_.hpp delete mode 100644 phonelibs/acado/include/acado/function/function_evaluation_tree.hpp delete mode 100644 phonelibs/acado/include/acado/function/function_evaluation_tree.ipp delete mode 100644 phonelibs/acado/include/acado/function/function_fwd.hpp delete mode 100644 phonelibs/acado/include/acado/function/ocp_iterate.hpp delete mode 100644 phonelibs/acado/include/acado/function/ocp_iterate.ipp delete mode 100644 phonelibs/acado/include/acado/function/output_fcn.hpp delete mode 100644 phonelibs/acado/include/acado/function/output_fcn.ipp delete mode 100644 phonelibs/acado/include/acado/function/t_evaluation_point.hpp delete mode 100644 phonelibs/acado/include/acado/function/t_evaluation_point.ipp delete mode 100644 phonelibs/acado/include/acado/function/transition.hpp delete mode 100644 phonelibs/acado/include/acado/function/transition.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_bdf.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_bdf.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_discretized_ode.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_discretized_ode.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_fwd.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_lyapunov.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_lyapunov.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_lyapunov45.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_lyapunov45.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta12.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta12.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta23.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta23.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta45.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta45.ipp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta78.hpp delete mode 100644 phonelibs/acado/include/acado/integrator/integrator_runge_kutta78.ipp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/acado_mat_file.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/block_matrix.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/block_matrix.ipp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/matrix.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/matrix_vector.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/matrix_vector_tools.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/t_matrix.hpp delete mode 100644 phonelibs/acado/include/acado/matrix_vector/vector.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/bfgs_update.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/bfgs_update.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/constant_hessian.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/exact_hessian.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/gauss_newton_approximation.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/gauss_newton_approximation_bfgs.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/nlp_derivative_approximation.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_derivative_approximation/nlp_derivative_approximation.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/ip_method.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/ip_method.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/nlp_solver.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/nlp_solver.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_evaluation.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_evaluation.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_merit_function.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_method.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_method.ipp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_step.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_step_fullstep.hpp delete mode 100644 phonelibs/acado/include/acado/nlp_solver/scp_step_linesearch.hpp delete mode 100644 phonelibs/acado/include/acado/noise/colored_noise.hpp delete mode 100644 phonelibs/acado/include/acado/noise/colored_noise.ipp delete mode 100644 phonelibs/acado/include/acado/noise/gaussian_noise.hpp delete mode 100644 phonelibs/acado/include/acado/noise/gaussian_noise.ipp delete mode 100644 phonelibs/acado/include/acado/noise/noise.hpp delete mode 100644 phonelibs/acado/include/acado/noise/noise.ipp delete mode 100644 phonelibs/acado/include/acado/noise/uniform_noise.hpp delete mode 100644 phonelibs/acado/include/acado/noise/uniform_noise.ipp delete mode 100644 phonelibs/acado/include/acado/objective/lagrange_term.hpp delete mode 100644 phonelibs/acado/include/acado/objective/lagrange_term.ipp delete mode 100644 phonelibs/acado/include/acado/objective/lsq_end_term.hpp delete mode 100644 phonelibs/acado/include/acado/objective/lsq_end_term.ipp delete mode 100644 phonelibs/acado/include/acado/objective/lsq_term.hpp delete mode 100644 phonelibs/acado/include/acado/objective/lsq_term.ipp delete mode 100644 phonelibs/acado/include/acado/objective/mayer_term.hpp delete mode 100644 phonelibs/acado/include/acado/objective/mayer_term.ipp delete mode 100644 phonelibs/acado/include/acado/objective/objective.hpp delete mode 100644 phonelibs/acado/include/acado/objective/objective.ipp delete mode 100644 phonelibs/acado/include/acado/objective/objective_element.hpp delete mode 100644 phonelibs/acado/include/acado/objective/objective_element.ipp delete mode 100644 phonelibs/acado/include/acado/ocp/model_container.hpp delete mode 100644 phonelibs/acado/include/acado/ocp/model_data.hpp delete mode 100644 phonelibs/acado/include/acado/ocp/multi_objective_functionality.hpp delete mode 100644 phonelibs/acado/include/acado/ocp/multi_objective_functionality.ipp delete mode 100644 phonelibs/acado/include/acado/ocp/nlp.hpp delete mode 100644 phonelibs/acado/include/acado/ocp/ocp.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/mhe_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/multi_objective_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/multi_objective_algorithm.ipp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/optimization_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/optimization_algorithm_base.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/parameter_estimation_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/parameter_estimation_algorithm.ipp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/real_time_algorithm.hpp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/real_time_algorithm.ipp delete mode 100644 phonelibs/acado/include/acado/optimization_algorithm/weight_generation.hpp delete mode 100644 phonelibs/acado/include/acado/process/process.hpp delete mode 100644 phonelibs/acado/include/acado/process/process.ipp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/adaptive_reference_trajectory.hpp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/adaptive_reference_trajectory.ipp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/periodic_reference_trajectory.hpp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/periodic_reference_trajectory.ipp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/reference_trajectory.hpp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/reference_trajectory.ipp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/simulated_reference_trajectory.hpp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/static_reference_trajectory.hpp delete mode 100644 phonelibs/acado/include/acado/reference_trajectory/static_reference_trajectory.ipp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/interval.hpp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/interval.ipp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/set_arithmetics.hpp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/taylor_model.hpp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/taylor_model.ipp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/taylor_variable.hpp delete mode 100644 phonelibs/acado/include/acado/set_arithmetics/taylor_variable.ipp delete mode 100644 phonelibs/acado/include/acado/simulation_environment/simulation_block.hpp delete mode 100644 phonelibs/acado/include/acado/simulation_environment/simulation_block.ipp delete mode 100644 phonelibs/acado/include/acado/simulation_environment/simulation_environment.hpp delete mode 100644 phonelibs/acado/include/acado/simulation_environment/simulation_environment.ipp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/conjugate_gradient_method.hpp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/conjugate_gradient_method.ipp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/normal_conjugate_gradient_method.hpp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/normal_conjugate_gradient_method.ipp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/sparse_solver.hpp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/sparse_solver.ipp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/symmetric_conjugate_gradient_method.hpp delete mode 100644 phonelibs/acado/include/acado/sparse_solver/symmetric_conjugate_gradient_method.ipp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/acado_syntax.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/constraint_component.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/constraint_component.ipp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/expression.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/expression.ipp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/lyapunov.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/symbolic_expression.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_expression/variable_types.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/acos.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/addition.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/asin.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/atan.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/binary_operator.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/cos.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/doubleconstant.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/evaluation_base.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/evaluation_template.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/exp.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/logarithm.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/nonsmooth_operator.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/operator.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/power.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/powerint.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/product.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/projection.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/quotient.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/sin.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/smooth_operator.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/subtraction.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/symbolic_index_list.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/symbolic_index_list.ipp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/symbolic_operator.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/symbolic_operator_fwd.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/tan.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/tree_projection.hpp delete mode 100644 phonelibs/acado/include/acado/symbolic_operator/unary_operator.hpp delete mode 100644 phonelibs/acado/include/acado/transfer_device/actuator.hpp delete mode 100644 phonelibs/acado/include/acado/transfer_device/actuator.ipp delete mode 100644 phonelibs/acado/include/acado/transfer_device/sensor.hpp delete mode 100644 phonelibs/acado/include/acado/transfer_device/sensor.ipp delete mode 100644 phonelibs/acado/include/acado/transfer_device/transfer_device.hpp delete mode 100644 phonelibs/acado/include/acado/transfer_device/transfer_device.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/algorithmic_base.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/algorithmic_base.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/log_record.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/log_record.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/logging.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/logging.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/options.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/options_list.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/options_list.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_collection.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_collection.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_window.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_window.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_window_subplot.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plot_window_subplot.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plotting.hpp delete mode 100644 phonelibs/acado/include/acado/user_interaction/plotting.ipp delete mode 100644 phonelibs/acado/include/acado/user_interaction/user_interaction.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_constants.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_debugging.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_default_options.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_io_utils.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_message_handling.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_message_handling.ipp delete mode 100644 phonelibs/acado/include/acado/utils/acado_namespace_macros.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_types.hpp delete mode 100644 phonelibs/acado/include/acado/utils/acado_utils.hpp delete mode 100644 phonelibs/acado/include/acado/utils/matlab_acado_utils.hpp delete mode 100644 phonelibs/acado/include/acado/validated_integrator/ellipsoidal_integrator.hpp delete mode 100644 phonelibs/acado/include/acado/validated_integrator/ellipsoidal_integrator.ipp delete mode 100644 phonelibs/acado/include/acado/variables_grid/grid.hpp delete mode 100644 phonelibs/acado/include/acado/variables_grid/grid.ipp delete mode 100644 phonelibs/acado/include/acado/variables_grid/matrix_variable.hpp delete mode 100644 phonelibs/acado/include/acado/variables_grid/matrix_variable.ipp delete mode 100644 phonelibs/acado/include/acado/variables_grid/matrix_variables_grid.hpp delete mode 100644 phonelibs/acado/include/acado/variables_grid/matrix_variables_grid.ipp delete mode 100644 phonelibs/acado/include/acado/variables_grid/variable_settings.hpp delete mode 100644 phonelibs/acado/include/acado/variables_grid/variable_settings.ipp delete mode 100644 phonelibs/acado/include/acado/variables_grid/variables_grid.hpp delete mode 100644 phonelibs/acado/include/acado/variables_grid/variables_grid.ipp delete mode 100644 phonelibs/acado/x86_64/lib/libacado_casadi.a delete mode 100644 phonelibs/acado/x86_64/lib/libacado_csparse.a delete mode 100644 phonelibs/acado/x86_64/lib/libacado_qpoases.a delete mode 100644 phonelibs/acado/x86_64/lib/libacado_toolkit.a delete mode 120000 phonelibs/acado/x86_64/lib/libacado_toolkit_s.so delete mode 120000 phonelibs/acado/x86_64/lib/libacado_toolkit_s.so.1 delete mode 100644 phonelibs/acado/x86_64/lib/libacado_toolkit_s.so.1.2.2beta delete mode 100644 selfdrive/controls/lib/lateral_mpc/.gitignore delete mode 100644 selfdrive/controls/lib/lateral_mpc/SConscript delete mode 100644 selfdrive/controls/lib/lateral_mpc/__init__.py delete mode 100644 selfdrive/controls/lib/lateral_mpc/generator.cpp delete mode 100644 selfdrive/controls/lib/lateral_mpc/lateral_mpc.c delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_auxiliary_functions.c delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_auxiliary_functions.h delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_common.h delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_integrator.c delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_qpoases_interface.cpp delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_qpoases_interface.hpp delete mode 100644 selfdrive/controls/lib/lateral_mpc/lib_mpc_export/acado_solver.c delete mode 100644 selfdrive/controls/lib/lateral_mpc/libmpc_py.py delete mode 100644 selfdrive/controls/lib/lead_mpc.py delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/generator.cpp delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_auxiliary_functions.c delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_auxiliary_functions.h delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_common.h delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_integrator.c delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_qpoases_interface.cpp delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_qpoases_interface.hpp delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/lib_mpc_export/acado_solver.c delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/libmpc_py.py delete mode 100644 selfdrive/controls/lib/lead_mpc_lib/longitudinal_mpc.c delete mode 100644 selfdrive/controls/lib/long_mpc.py delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/generator.cpp delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_auxiliary_functions.c delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_auxiliary_functions.h delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_common.h delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_integrator.c delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_qpoases_interface.cpp delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_qpoases_interface.hpp delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/lib_mpc_export/acado_solver.c delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/libmpc_py.py delete mode 100644 selfdrive/controls/lib/longitudinal_mpc_lib/longitudinal_mpc.c diff --git a/SConstruct b/SConstruct index efdfb52693..263f213f6e 100644 --- a/SConstruct +++ b/SConstruct @@ -37,10 +37,6 @@ AddOption('--compile_db', action='store_true', help='build clang compilation database') -AddOption('--mpc-generate', - action='store_true', - help='regenerates the mpc sources') - AddOption('--snpe', action='store_true', help='use SNPE on PC') diff --git a/phonelibs/acado/01.patch b/phonelibs/acado/01.patch deleted file mode 100644 index 7adfe970fe..0000000000 --- a/phonelibs/acado/01.patch +++ /dev/null @@ -1,28 +0,0 @@ -From a1b2938bcf0b2bbb9156ed9ee922bc5b5a38cea7 Mon Sep 17 00:00:00 2001 -From: heyyeh12 -Date: Sat, 27 Apr 2019 09:08:48 -0400 -Subject: [PATCH] fixes issue #261 binding to temporary object - ---- - acado/code_generation/export_function_declaration.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/acado/code_generation/export_function_declaration.cpp b/acado/code_generation/export_function_declaration.cpp -index d6450b50..46a3269f 100644 ---- a/acado/code_generation/export_function_declaration.cpp -+++ b/acado/code_generation/export_function_declaration.cpp -@@ -36,12 +36,12 @@ - - BEGIN_NAMESPACE_ACADO - -- -+const ExportFunction& _ff = ExportFunction(); - // - // PUBLIC MEMBER FUNCTIONS: - // - --ExportFunctionDeclaration::ExportFunctionDeclaration( ) : ExportStatement( ), f( ExportFunction() ) -+ExportFunctionDeclaration::ExportFunctionDeclaration( ) : ExportStatement( ), f( _ff ) - {} - - diff --git a/phonelibs/acado/build.sh b/phonelibs/acado/build.sh deleted file mode 100755 index 60288ea62e..0000000000 --- a/phonelibs/acado/build.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env sh -set -e - -rm -rf acado -git clone https://github.com/acado/acado.git -cd acado -git reset --hard 5adb8cbcff5a5464706a48eaf073218ac87c9044 - -# Clang 8 fixes -git apply ../01.patch -sed -i '100d' cmake/CompilerOptions.cmake -sed -i '100d' cmake/CompilerOptions.cmake - -mkdir build -cd build -cmake -DACADO_WITH_EXAMPLES=OFF -DACADO_BUILD_STATIC=ON -DCMAKE_INSTALL_PREFIX="$HOME/openpilot/phonelibs/acado" .. -make -j$(nproc) -make install - -cd .. -cd .. - -rm -r x86_64 -mkdir x86_64 -mv lib x86_64/lib -cp acado/build/lib/* x86_64/lib/ - -rm -rf acado -rm -r share diff --git a/phonelibs/acado/include/acado/acado_code_generation.hpp b/phonelibs/acado/include/acado/acado_code_generation.hpp deleted file mode 100644 index 2e0d10a215..0000000000 --- a/phonelibs/acado/include/acado/acado_code_generation.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_code_generation.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2009 - 2014 - */ - -#include diff --git a/phonelibs/acado/include/acado/acado_controller.hpp b/phonelibs/acado/include/acado/acado_controller.hpp deleted file mode 100644 index e14f632a0b..0000000000 --- a/phonelibs/acado/include/acado/acado_controller.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_controller.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/phonelibs/acado/include/acado/acado_gnuplot.hpp b/phonelibs/acado/include/acado/acado_gnuplot.hpp deleted file mode 100644 index f18f259372..0000000000 --- a/phonelibs/acado/include/acado/acado_gnuplot.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_gnuplot.hpp - * \author Milan Vukov - * \date 2014 - */ - -#include diff --git a/phonelibs/acado/include/acado/acado_integrators.hpp b/phonelibs/acado/include/acado/acado_integrators.hpp deleted file mode 100644 index 75f468f6c9..0000000000 --- a/phonelibs/acado/include/acado/acado_integrators.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_integrators.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 10.06.2009 - */ - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/phonelibs/acado/include/acado/acado_optimal_control.hpp b/phonelibs/acado/include/acado/acado_optimal_control.hpp deleted file mode 100644 index 508b6a0d3c..0000000000 --- a/phonelibs/acado/include/acado/acado_optimal_control.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_optimal_control.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 10.06.2009 - */ - - - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include diff --git a/phonelibs/acado/include/acado/acado_toolkit.hpp b/phonelibs/acado/include/acado/acado_toolkit.hpp deleted file mode 100644 index 635065d555..0000000000 --- a/phonelibs/acado/include/acado/acado_toolkit.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado_toolkit.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 10.06.2009 - */ - - - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include diff --git a/phonelibs/acado/include/acado/bindings/acado_csparse/acado_csparse.hpp b/phonelibs/acado/include/acado/bindings/acado_csparse/acado_csparse.hpp deleted file mode 100644 index f2ea35897d..0000000000 --- a/phonelibs/acado/include/acado/bindings/acado_csparse/acado_csparse.hpp +++ /dev/null @@ -1,210 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file external_packages/include/acado_csparse.hpp - * \author Boris Houska, Hans Joachim Ferreau - * \date 2009 - */ - - -#ifndef ACADO_TOOLKIT_ACADO_CSPARSE_HPP -#define ACADO_TOOLKIT_ACADO_CSPARSE_HPP - - -#include -#include - - - - -// FORWARD DECLARATIONS: -// --------------------- - struct cs_numeric ; - struct cs_symbolic; - - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief (not yet documented) - * - * \ingroup ExternalFunctionality - * - * The class ... - * - * \author Boris Houska, Hans Joachim Ferreau - */ - - - -class ACADOcsparse : public SparseSolver{ - - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - ACADOcsparse( ); - - /** Copy constructor (deep copy). */ - ACADOcsparse( const ACADOcsparse &arg ); - - /** Destructor. */ - virtual ~ACADOcsparse( ); - - /** Clone operator (deep copy). */ - virtual ACADOcsparse* clone() const; - - - /** Defines the dimension n of A \in R^{n \times n} \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue setDimension( const int &n ); - - - /** Defines the number of non-zero elements in the \n - * matrix A \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue setNumberOfEntries( const int &nDense_ ); - - - - /** Sets an index list containing the positions of the \n - * non-zero elements in the matrix A. - */ - virtual returnValue setIndices( const int *rowIdx_, - const int *colIdx_ ); - - - - /** Sets the non-zero elements of the matrix A. The double* A \n - * is assumed to contain nDense entries corresponding to \n - * non-zero elements of A. \n - */ - virtual returnValue setMatrix( double *A_ ); - - - - /** Solves the system A*x = b for the specified data. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_LINEAR_SYSTEM_NUMERICALLY_SINGULAR \n - */ - virtual returnValue solve( double *b ); - - - - /** Solves the system A^T*x = b for the specified data. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_LINEAR_SYSTEM_NUMERICALLY_SINGULAR \n - */ - virtual returnValue solveTranspose( double *b ); - - - - /** Returns the solution of the equation A*x = b if solved. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getX( double *x_ ); - - - - /** Sets the required tolerance (accuracy) for the solution of \n - * the linear equation. For large tolerances an iterative \n - * algorithm might converge earlier. \n - * \n - * Requires || A*x - b || <= TOL \n - * \n - * The norm || . || is possibly scaled by a preconditioner. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue setTolerance( double TOL_ ); - - - /** Sets the print level. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue setPrintLevel( PrintLevel printLevel_ ); - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - - - // DIMENSIONS: - // -------------------- - int dim; // dimension of the matrix A - int nDense; // number of non-zero entries in A - int *index1, *index2; // and the associated indices - - - - // DATA: - // -------------------- - double *x; // The result vector x - - - // AUXILIARY VARIABLES: - // -------------------- - cs_symbolic *S; // pointer to a struct, which contains symbolic information about the matrix - cs_numeric *N; // pointer to a struct, which contains numeric information about the matrix - - - double TOL; // The required tolerance. (default 10^(-10)) - PrintLevel printLevel; // The PrintLevel. -}; - - -CLOSE_NAMESPACE_ACADO - -#endif - -/* - * end of file - */ - diff --git a/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.hpp b/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.hpp deleted file mode 100644 index f028aa2f39..0000000000 --- a/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.hpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file external_packages/acado_gnuplot/gnuplot_window.hpp - * \author Boris Houska, Hans Joachim Ferreau, Milan Vukov - * \date 2009-2013 - */ - - -#ifndef ACADO_TOOLKIT_ACADO_2_GNUPLOT_HPP -#define ACADO_TOOLKIT_ACADO_2_GNUPLOT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Provides an interface to Gnuplot for plotting algorithmic outputs. - * - * \ingroup ExternalFunctionality - * - * The acado2gnuplot interface provides the functionality to easiliy - * plot data which is available in the ACADO Toolkit format. The methods - * that are implemented in this interface convert ACADO sturctures into - * a format that can be read by the program Gnuplot. - * - * \author Boris Houska, Hans Joachim Ferreau, Milan Vukov - */ - - -class GnuplotWindow : public PlotWindow -{ - - // PUBLIC FUNCTIONS: - // ----------------- - - public: - - /** Default constructor. */ - GnuplotWindow( ); - - /** Constructor which takes the plot frequency. - * - * @param[in] _frequency Frequency determining at which time instants the window is to be plotted. - */ - GnuplotWindow( PlotFrequency _frequency - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GnuplotWindow( const GnuplotWindow& arg - ); - - /** Destructor. */ - virtual ~GnuplotWindow( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GnuplotWindow& operator=( const GnuplotWindow& arg - ); - - - /** Clone operator returning a base class pointer to a deep copy - * of respective class instance. - * - * \return Base class pointer to a deep copy of respective class instance - */ - virtual PlotWindow* clone( ) const; - - - /** Initializes the Gnuplot-thread. - * - * \return SUCCESSFUL_RETURN, \n - * RET_PLOT_WINDOW_CAN_NOT_BE_OPEN - */ - virtual returnValue init( ); - - - /** Actually sets-up and plots the data in a Gnuplot window. - * - * @param[in] _frequency Frequency determining at which time instants the window is to be plotted. - * - * \return SUCCESSFUL_RETURN, \n - * RET_PLOTTING_FAILED, \n - * RET_INVALID_ARGUMENTS, \n - * RET_PLOT_WINDOW_CAN_NOT_BE_OPEN - */ - virtual returnValue replot( PlotFrequency _frequency = PLOT_IN_ANY_CASE - ); - - - /** Runs the Gnuplot window in waiting mode until a mouse event - * occurs. - * - * \return SUCCESSFUL_RETURN - */ - returnValue waitForMouseEvents( ); - - /** Returns whether a mouse event has occured. - * - * @param[out] mouseX X coordinate of mouse click. - * @param[out] mouseX Y coordinate of mouse click. - * - * \return BT_TRUE iff mouse event occured, \n - * BT_FALSE otherwise - */ - BooleanType getMouseEvent( double& mouseX, - double& mouseY - ); - - /** Waits until a mouse event occurs. - * - * @param[out] mouseX X coordinate of mouse click. - * @param[out] mouseX Y coordinate of mouse click. - * - * \return SUCCESSFUL_RETURN, \n - * RET_NOT_YET_IMPLEMENTED - */ - returnValue waitForMouseEvent( double& mouseX, - double& mouseY - ); - - - - // PROTECTED FUNCTIONS: - // -------------------- - - protected: - /** Sets-up and plots the data in a Gnuplot window. - * - * \return SUCCESSFUL_RETURN, \n - * RET_PLOTTING_FAILED, \n - * RET_INVALID_ARGUMENTS, \n - * RET_PLOT_WINDOW_CAN_NOT_BE_OPEN - */ - returnValue sendDataToGnuplot( ); - - - /** Generates string in Gnuplot syntax for plotting in given plot mode. - * - * @param[in] plotMode Plot mode whose string needs to be generated, see the PlotMode documentation for details. - * @param[out] plotModeString String in Gnuplot syntax for plotting in given plot mode. - * - * \return SUCCESSFUL_RETURN - */ - returnValue getPlotModeString( PlotMode plotMode, - std::string& plotModeString - ) const; - - /** Generates string in Gnuplot syntax for plotting in given plot style. - * - * @param[in] _type Type of variable to be plotted. - * @param[out] plotStyleString String in Gnuplot syntax for plotting in given plot style. - * - * \return SUCCESSFUL_RETURN - */ - returnValue getPlotStyleString( VariableType _type, - std::string& plotStyleString - ) const; - - /** Generates string in Gnuplot syntax for plotting given data grid. - * - * @param[in] _dataGrid Date grid to be plotted. - * @param[out] _plotDataString String in Gnuplot syntax for plotting given data grid. - * - * \return SUCCESSFUL_RETURN - */ - returnValue obtainPlotDataString( VariablesGrid& _dataGrid, - std::string& _plotDataString - ) const; - - - - // PROTECTED DATA MEMBERS: - // ----------------------- - - protected: - - FILE* gnuPipe; /**< Pipe to Gnuplot. */ - - BooleanType mouseEvent; /**< Flag indicating whether window should wait for mouse events. */ - - static int counter; /**< Static counter for counting the number of GnuplotWindows. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ACADO_2_GNUPLOT_HPP - -/* - * end of file - */ - diff --git a/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.ipp b/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.ipp deleted file mode 100644 index d1bc06f3b3..0000000000 --- a/phonelibs/acado/include/acado/bindings/acado_gnuplot/gnuplot_window.ipp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file external_packages/acado_gnuplot/gnuplot_window.ipp - * \author Boris Houska, Hans Joachim Ferreau - * \date 2009 - */ - - -BEGIN_NAMESPACE_ACADO - - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -// -// PROTECTED MEMBER FUNCTIONS: -// - - - - - -CLOSE_NAMESPACE_ACADO - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.hpp b/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.hpp deleted file mode 100644 index bd1d743840..0000000000 --- a/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.hpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file external_packages/include/acado_qpoases/qp_solver_qpoases.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 19.08.2008 - */ - - -#ifndef ACADO_TOOLKIT_QP_SOLVER_QPOASES_HPP -#define ACADO_TOOLKIT_QP_SOLVER_QPOASES_HPP - - -#include - -namespace qpOASES -{ - class SQProblem; -} - -BEGIN_NAMESPACE_ACADO - -/** - * \brief (not yet documented) - * - * \ingroup ExternalFunctionality - * - * The class QPsolver_qpOASES interfaces the qpOASES software package - * for solving convex quadratic programming (QP) problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class QPsolver_qpOASES : public DenseQPsolver -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. */ - QPsolver_qpOASES( ); - - QPsolver_qpOASES( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - QPsolver_qpOASES( const QPsolver_qpOASES& rhs ); - - /** Destructor. */ - virtual ~QPsolver_qpOASES( ); - - /** Assignment operator (deep copy). */ - QPsolver_qpOASES& operator=( const QPsolver_qpOASES& rhs ); - - - virtual DenseCPsolver* clone( ) const; - - virtual DenseQPsolver* cloneDenseQPsolver( ) const; - - - /** Solves the QP. */ - virtual returnValue solve( DenseCP *cp_ ); - - - /** Solves QP using at most iterations. - * \return SUCCESSFUL_RETURN \n - * RET_QP_SOLUTION_REACHED_LIMIT \n - * RET_QP_SOLUTION_FAILED \n - * RET_INITIALIZE_FIRST */ - virtual returnValue solve( double* H, /**< Hessian matrix of neighbouring QP to be solved. */ - double* A, /**< Constraint matrix of neighbouring QP to be solved. */ - double* g, /**< Gradient of neighbouring QP to be solved. */ - double* lb, /**< Lower bounds of neighbouring QP to be solved. */ - double* ub, /**< Upper bounds of neighbouring QP to be solved. */ - double* lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - double* ubA, /**< Upper constraints' bounds of neighbouring QP to be solved. */ - uint maxIter /**< Maximum number of iterations. */ - ); - - /** Solves QP using at most iterations. */ - virtual returnValue solve( DMatrix *H, /**< Hessian matrix of neighbouring QP to be solved. */ - DMatrix *A, /**< Constraint matrix of neighbouring QP to be solved. */ - DVector *g, /**< Gradient of neighbouring QP to be solved. */ - DVector *lb, /**< Lower bounds of neighbouring QP to be solved. */ - DVector *ub, /**< Upper bounds of neighbouring QP to be solved. */ - DVector *lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - DVector *ubA, /**< Upper constraints' bounds of neighbouring QP to be solved. */ - uint maxIter /**< Maximum number of iterations. */ - ); - - - /** Performs exactly one QP iteration. - * \return SUCCESSFUL_RETURN \n - * RET_QP_SOLUTION_REACHED_LIMIT \n - * RET_QP_SOLUTION_FAILED \n - * RET_INITIALIZE_FIRST */ - virtual returnValue step( double* H, /**< Hessian matrix of neighbouring QP to be solved. */ - double* A, /**< Constraint matrix of neighbouring QP to be solved. */ - double* g, /**< Gradient of neighbouring QP to be solved. */ - double* lb, /**< Lower bounds of neighbouring QP to be solved. */ - double* ub, /**< Upper bounds of neighbouring QP to be solved. */ - double* lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - double* ubA /**< Upper constraints' bounds of neighbouring QP to be solved. */ - ); - - /** Performs exactly one QP iteration. - * \return SUCCESSFUL_RETURN \n - * RET_QP_SOLUTION_REACHED_LIMIT \n - * RET_QP_SOLUTION_FAILED \n - * RET_INITIALIZE_FIRST */ - virtual returnValue step( DMatrix *H, /**< Hessian matrix of neighbouring QP to be solved. */ - DMatrix *A, /**< Constraint matrix of neighbouring QP to be solved. */ - DVector *g, /**< Gradient of neighbouring QP to be solved. */ - DVector *lb, /**< Lower bounds of neighbouring QP to be solved. */ - DVector *ub, /**< Upper bounds of neighbouring QP to be solved. */ - DVector *lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - DVector *ubA /**< Upper constraints' bounds of neighbouring QP to be solved. */ - ); - - - /** Returns primal solution vector if QP has been solved. - * \return SUCCESSFUL_RETURN \n - * RET_QP_NOT_SOLVED */ - virtual returnValue getPrimalSolution( DVector& xOpt /**< OUTPUT: primal solution vector. */ - ) const; - - /** Returns dual solution vector if QP has been solved. - * \return SUCCESSFUL_RETURN \n - * RET_QP_NOT_SOLVED */ - virtual returnValue getDualSolution( DVector& yOpt /**< OUTPUT: dual solution vector. */ - ) const; - - /** Returns optimal objective function value. - * \return finite value: Optimal objective function value (QP has been solved) \n - +INFTY: QP has not been solved or is infeasible \n - -INFTY: QP is unbounded */ - virtual double getObjVal( ) const; - - - virtual uint getNumberOfVariables( ) const; - virtual uint getNumberOfConstraints( ) const; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &var ); - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &H, DMatrix &var ); - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - /** Setups QP object. - * \return SUCCESSFUL_RETURN \n - * RET_QP_INIT_FAILED */ - virtual returnValue setupQPobject( uint nV, /**< Number of QP variables. */ - uint nC /**< Number of QP constraints (without bounds). */ - ); - - returnValue updateQPstatus( int ret - ); - - - - // - // DATA MEMBERS: - // - protected: - qpOASES::SQProblem* qp; -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_QP_SOLVER_QPOASES_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.ipp b/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.ipp deleted file mode 100644 index 99d4be779b..0000000000 --- a/phonelibs/acado/include/acado/bindings/acado_qpoases/qp_solver_qpoases.ipp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file external_packages/include/acado_qpoases/qp_solver_qpoases.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 19.08.2008 - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - - -CLOSE_NAMESPACE_ACADO - - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/clock.hpp b/phonelibs/acado/include/acado/clock/clock.hpp deleted file mode 100644 index c2fbc5a0cc..0000000000 --- a/phonelibs/acado/include/acado/clock/clock.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/clock.hpp -* \author Hans Joachim Ferreau, Boris Houska -*/ - - -#ifndef ACADO_TOOLKIT_CLOCK_HPP -#define ACADO_TOOLKIT_CLOCK_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for all kind of time measurements. - * - * \ingroup BasicDataStructures - * - * The class Clock serves as base class for all kind of time measurements, - * both real and simulated ones. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class Clock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - Clock( ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - Clock( const Clock &rhs - ); - - /** Destructor. - */ - virtual ~Clock(); - - /** Assignment Operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - Clock& operator=( const Clock &rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual Clock* clone( ) const = 0; - - - /** Initializes the clock with given initial time. - * - * @param[in] _initialTime Initial time. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue init( double _initialTime - ); - - /** Initializes the clock with initial time zero. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue reset( ); - - - /** Starts time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue start( ) = 0; - - /** Shifts measured time by a given offset. - * - * @param[in] _timeShift Time offset. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue step( double _timeShift - ) = 0; - - /** Stops time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue stop ( ) = 0; - - - /** Returns elapsed time. - * - * @param[in] _elapsedTime Elapsed time. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY - */ - virtual returnValue getTime( double& _elapsedTime - ); - - /** Returns elapsed time. - * - * \return >= 0: elapsed time, \n - * -INFTY: internal error - */ - virtual double getTime( ); - - - /** Returns current status of clock, see documentation of ClockStatus for details. - * - * \return Current status of clock - */ - inline ClockStatus getStatus( ) const; - - - - // - // PROTECTED MEMBERS: - // - protected: - double elapsedTime; /**< Elapsed time since last reset. */ - ClockStatus status; /**< Status of clock. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -// collect all remaining headers of clock directory -#include -#include - - -#endif // ACADO_TOOLKIT_CLOCK_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/clock.ipp b/phonelibs/acado/include/acado/clock/clock.ipp deleted file mode 100644 index 06fa99de6f..0000000000 --- a/phonelibs/acado/include/acado/clock/clock.ipp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/clock.ipp -* \author Boris Houska, Hans Joachim Ferreau -* \date 13.06.2008 -*/ - - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - -inline ClockStatus Clock::getStatus( ) const -{ - return status; -} - - -CLOSE_NAMESPACE_ACADO - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/real_clock.hpp b/phonelibs/acado/include/acado/clock/real_clock.hpp deleted file mode 100644 index 0ad42dd394..0000000000 --- a/phonelibs/acado/include/acado/clock/real_clock.hpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/real_clock.hpp -* \author Boris Houska, Hans Joachim Ferreau -*/ - - -#ifndef ACADO_TOOLKIT_REAL_CLOCK_HPP -#define ACADO_TOOLKIT_REAL_CLOCK_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows real time measurements based on the system's clock. - * - * \ingroup BasicDataStructures - * - * The class RealClock allows real time measurements based on the - * system's clock. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class RealClock : public Clock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - RealClock(); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - RealClock( const RealClock &rhs - ); - - /** Destructor. - */ - virtual ~RealClock( ); - - /** Assignment Operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - RealClock& operator=( const RealClock &rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual Clock* clone( ) const; - - - /** Starts time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue start( ); - - /** Shifts measured time by a given offset. - * - * @param[in] _timeShift Time offset. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue step( double _timeShift - ); - - /** Stops time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY, \n - * RET_NO_SYSTEM_TIME - */ - virtual returnValue stop( ); - - - - // - // PROTECTED MEMBERS: - // - protected: - - double lastTimeInstant; /**< Last time instant at which start() has been called. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -//#include - - -#endif // ACADO_TOOLKIT_REAL_CLOCK_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/real_clock.ipp b/phonelibs/acado/include/acado/clock/real_clock.ipp deleted file mode 100644 index a094ab4453..0000000000 --- a/phonelibs/acado/include/acado/clock/real_clock.ipp +++ /dev/null @@ -1,49 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/real_clock.ipp -* \author Boris Houska, Hans Joachim Ferreau -* \date 13.06.2008 -*/ - - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - -CLOSE_NAMESPACE_ACADO - - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/simulation_clock.hpp b/phonelibs/acado/include/acado/clock/simulation_clock.hpp deleted file mode 100644 index 177fa8a6bb..0000000000 --- a/phonelibs/acado/include/acado/clock/simulation_clock.hpp +++ /dev/null @@ -1,132 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/simulation_clock.hpp -* \author Boris Houska, Hans Joachim Ferreau -*/ - - -#ifndef ACADO_TOOLKIT_SIMULATION_CLOCK_HPP -#define ACADO_TOOLKIT_SIMULATION_CLOCK_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Simulates real time measurements for simulations. - * - * \ingroup BasicDataStructures - * - * The class SimulationClock simulates real time measurements for - * simulations within the SimulationEnvironment. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class SimulationClock : public Clock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - SimulationClock(); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - SimulationClock( const SimulationClock& rhs - ); - - /** Destructor. - */ - virtual ~SimulationClock( ); - - /** Assignment Operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - SimulationClock& operator=( const SimulationClock& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual Clock* clone( ) const; - - - /** Starts time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY - */ - virtual returnValue start( ); - - /** Shifts measured time by a given offset. - * - * @param[in] _timeShift Time offset. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY - */ - virtual returnValue step( double _timeShift - ); - - /** Stops time measurement. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CLOCK_NOT_READY - */ - virtual returnValue stop( ); - - - // - // PROTECTED MEMBERS: - // - protected: -}; - - -CLOSE_NAMESPACE_ACADO - - -//#include - - -#endif // ACADO_TOOLKIT_SIMULATION_CLOCK_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/clock/simulation_clock.ipp b/phonelibs/acado/include/acado/clock/simulation_clock.ipp deleted file mode 100644 index 2bf889e77f..0000000000 --- a/phonelibs/acado/include/acado/clock/simulation_clock.ipp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/clock/simulation_clock.ipp -* \author Boris Houska, Hans Joachim Ferreau -* \date 13.06.2008 -*/ - - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - -CLOSE_NAMESPACE_ACADO - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/code_generation/code_generation.hpp b/phonelibs/acado/include/acado/code_generation/code_generation.hpp deleted file mode 100644 index 81850525e4..0000000000 --- a/phonelibs/acado/include/acado/code_generation/code_generation.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/code_generation/code_generation.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov, Rien Quirynen - * \date 2010 - 2014 - */ - -#ifndef ACADO_TOOLKIT_CODE_GENERATION_HPP -#define ACADO_TOOLKIT_CODE_GENERATION_HPP - -#include -#include -#include -#include -#include - -#endif // ACADO_TOOLKIT_CODE_GENERATION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_acado_function.hpp b/phonelibs/acado/include/acado/code_generation/export_acado_function.hpp deleted file mode 100644 index 988b5ff452..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_acado_function.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_ode_function.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_ODE_FUNCTION_HPP -#define ACADO_TOOLKIT_EXPORT_ODE_FUNCTION_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class Function; - -/** - * \brief Allows to export code of an ACADO function. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportAcadoFunction allows to export code of an ACADO function. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportAcadoFunction : public ExportFunction -{ -public: - /** Default constructor. */ - ExportAcadoFunction( ); - - /** Constructor which takes the differential equation to be exported - * as well as the name of the exported ODE. - * - * @param[in] _f Differential equation to be exported. - * @param[in] _name Name of exported ODE function. - */ - ExportAcadoFunction( const Function& _f, - const std::string& _name = "acadoFcn" - ); - - /** Constructor which takes name of a function only. - * - * This way, we can define an "external symbolic function" with the - * following prototype: - * \verbatim - * void (const real_t* in, real_t* out); - * \endverbatim - * - * @param[in] _name Name of exported ODE function. - */ - ExportAcadoFunction( const std::string& _name - ); - - /** Destructor. */ - virtual ~ExportAcadoFunction( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - /** Initializes ODE function export by taking the differential equation - * to be exported as well as the name of the exported ODE. - * - * @param[in] _f Differential equation to be exported. - * @param[in] _name Name of exported ODE function. - * @param[in] _numX The number of states that are needed to evaluate the system of differential equations - * (needed when the number of equations is not equal to the number of given states). - * @param[in] _numXA The number of algebraic states in the input for the evaluation of the system of equations. - * @param[in] _numU The number of control inputs given for the evaluation of the system of equations. - * @param[in] _numP The number of parameters given for the evaluation of the system of equations. - * @param[in] _numDX The number of differential state derivatives given for the evaluation of the system of equations. - */ - returnValue init( const Function& _f, - const std::string& _name = "acadoFcn", - const uint _numX = 0, - const uint _numXA = 0, - const uint _numU = 0, - const uint _numP = 0, - const uint _numDX = 0, - const uint _numOD = 0 - ); - - /** Exports data declaration of the ODE function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports forward declaration of the ODE function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportForwardDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the ODE function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] string Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Returns whether function has been defined. - * - * \return true iff function has been defined, \n - * false otherwise - */ - virtual bool isDefined( ) const; - - /** Get output dimension of the ACADO function. */ - unsigned getFunctionDim( void ); - - /** Get global export variable - a variable that holds intermediate values. */ - returnValue setGlobalExportVariable(const ExportVariable& var); - - /** Set global export variable - a variable that holds intermediate values. */ - ExportVariable getGlobalExportVariable( ) const; - - /** A helper function to check whether a function is external. */ - bool isExternal() const; - -protected: - /** The number of states that are needed to evaluate the system of differential equations. - * If this number isn't specified, then it will be set to the number of equations (minus - * the number of algebraic states). */ - unsigned numX; - /** The number of algebraic states in the input for the evaluation of the system of - * equations (similar to numX). */ - unsigned numXA; - /** The number of control inputs given for the evaluation of the system of equations - * (similar to numX). */ - unsigned numU; - /** The number of parameters given for the evaluation of the system of equations. */ - unsigned numP; - /** The number of differential state derivatives given for the evaluation of the - * system of equations. */ - unsigned numDX; - /** The number of "online data" objects. */ - unsigned numOD; - /** ACADO function to be exported. */ - std::shared_ptr< Function > f; - /** A variable that holds intermediate values. */ - ExportVariable globalVar; - /** Flag indicating whether the symbolic function is external or not. */ - bool external; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FUNCTION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_algorithm.hpp b/phonelibs/acado/include/acado/code_generation/export_algorithm.hpp deleted file mode 100644 index 5afd8c0022..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_algorithm.hpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/export_algorithm.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_ALGORITHM_HPP -#define ACADO_TOOLKIT_EXPORT_ALGORITHM_HPP - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export automatically generated algorithms for fast model predictive control - * - * \ingroup NumericalAlgorithms - * - * The class ExportAlgorithm allows to export automatically generated - * algorithms for fast model predictive control. - * - * \author Hans Joachim Ferreau, Milan Vukov, Boris Houska - */ -class ExportAlgorithm : public AlgorithmicBase -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportAlgorithm( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = std::string() - ); - - /** Destructor. */ - virtual ~ExportAlgorithm( ); - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const = 0; - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** Sets the variables dimensions (ODE). - * - * @param[in] _NX New number of differential states. - * @param[in] _NU New number of control inputs. - * @param[in] _NP New number of parameters. - * @param[in] _NI New number of control intervals. (using _N resulted in a strange error when compiling with cygwin!) - * - * \return SUCCESSFUL_RETURN - */ - returnValue setDimensions( uint _NX = 0, - uint _NU = 0, - uint _NP = 0, - uint _NI = 0, - uint _NOD = 0 - ); - - - /** Sets the variables dimensions (DAE). - * - * @param[in] _NX New number of differential states. - * @param[in] _NDX New number of differential states derivatives. - * @param[in] _NXA New number of algebraic states. - * @param[in] _NU New number of control inputs. - * @param[in] _NP New number of parameters. - * @param[in] _NI New number of control intervals. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setDimensions( uint _NX, - uint _NDX, - uint _NXA, - uint _NU, - uint _NP, - uint _NI, - uint _NOD - ); - - - /** Returns number of differential states. - * - * \return Number of differential states - */ - uint getNX( ) const; - - /** Returns number of algebraic states. - * - * \return Number of algebraic states - */ - uint getNXA( ) const; - - /** Returns the number of differential states derivatives. - * - * \return The requested number of differential state derivatives - */ - uint getNDX( ) const; - - /** Returns number of control inputs. - * - * \return Number of control inputs - */ - uint getNU( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - uint getNP( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - uint getNOD( ) const; - - /** Returns number of control intervals. - * - * \return Number of control intervals - */ - uint getN( ) const; - - void setNY( uint NY_ ); - uint getNY( ) const; - - void setNYN( uint NYN_ ); - uint getNYN( ) const; - - protected: - - uint NX; /**< Number of differential states. */ - uint NDX; /**< Number of differential states derivatives. */ - uint NXA; /**< Number of algebraic states. */ - uint NU; /**< Number of control inputs. */ - uint NP; /**< Number of parameters. */ - uint NOD; /**< Number of "online data" values. */ - uint N; /**< Number of control intervals. */ - - uint NY; /**< Number of references/measurements, nodes 0,..., N - 1. */ - uint NYN; /**< Number of references/measurements, node N. */ - - std::string commonHeaderName; /**< Name of common header file. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_ALGORITHM_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_algorithm_factory.hpp b/phonelibs/acado/include/acado/code_generation/export_algorithm_factory.hpp deleted file mode 100644 index 13fdd541ee..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_algorithm_factory.hpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** \file include/code_generation/export_algorithm_factory.hpp - * \author Milan Vukov - * \date 2012 - * */ - -#ifndef ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP -#define ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP - -#include -#include -#include - -#include - -BEGIN_NAMESPACE_ACADO - -/** \brief Factory for creation of exported algorithms. - * - * Note that the class is implemented as a singleton - * - * \author Milan Vukov - * \date 2012 - 2013 - * */ -template -< - /** Base class, derived from ExportAlgorithm class. */ - class AlgorithmBase, - /** Type identifier. */ - typename AlgorithmType -> -class ExportAlgorithmFactory -{ -public: - /** Helper type. */ - typedef AlgorithmBase* (*exportAlgorithmCreator)(UserInteraction* _userInteraction, const std::string &_commonHeaderName); - - /** Static creator function. */ - static ExportAlgorithmFactory& instance() - { - static ExportAlgorithmFactory instance; - return instance; - } - - /** Function for algorithm registration. */ - bool registerAlgorithm( const AlgorithmType& id, - exportAlgorithmCreator creator) - { - bool status = associations_.insert( - typename idToProductMap::value_type(id, creator)).second; - - if ( status == true ) - return true; - - return false; - } - - /** Function to unregister an algorithm. */ - bool unregisterAlgorithm( const AlgorithmType& id) - { - bool status = associations_.erase( id ) == 1; - - if ( status == true ) - return true; - - return false; - } - - /** Function to create an instance of an algorithm. */ - AlgorithmBase* createAlgorithm( UserInteraction* _userInteraction, - const std::string& _commonHeaderName, - const AlgorithmType& id) - { - typename idToProductMap::const_iterator it = associations_.find( id ); - if (it != associations_.end()) - { - return (it->second)(_userInteraction, _commonHeaderName); - } - - LOG( LVL_DEBUG ) << "Algorithm is not registered!" << std::endl; - - return NULL; - } - -private: - typedef std::map idToProductMap; - - idToProductMap associations_; - - ExportAlgorithmFactory() - {} - - ExportAlgorithmFactory(const ExportAlgorithmFactory&); - - ExportAlgorithmFactory& operator=(const ExportAlgorithmFactory&); - - ~ExportAlgorithmFactory() - {} -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_ALGORITHM_FACTORY_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_argument.hpp b/phonelibs/acado/include/acado/code_generation/export_argument.hpp deleted file mode 100644 index 57ca4f2722..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_argument.hpp +++ /dev/null @@ -1,211 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_argument.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP -#define ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP - -#include -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - - -class ExportArgumentInternal; - - -/** - * \brief Defines a matrix-valued variable that can be passed as argument to exported functions. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportArgument defines a matrix-valued variable that - * can be passed as argument to exported functions. By default, all entries - * of an arguments are undefined, but each of its component can be set to - * a fixed value if known beforehand. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -class ExportArgument : public ExportData -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ExportArgument( ); - - /** Constructor which takes the name, type - * and dimensions of the argument. - * - * @param[in] _name Name of the argument. - * @param[in] _nRows Number of rows of the argument. - * @param[in] _nCols Number of columns of the argument. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - * @param[in] _addressIdx If an address index is specified, not the argument itself but - * a pointer to this address within the memory of the argument is passed. - */ - ExportArgument( const std::string& _name, - uint _nRows = 1, - uint _nCols = 1, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callByValue = false, - const ExportIndex& _addressIdx = emptyConstExportIndex, - const std::string& _prefix = std::string() - ); - - /** Constructor which takes the name and type of the argument. - * Moreover, it initializes the argument with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - * @param[in] _addressIdx If an address index is specified, not the argument itself but - * a pointer to this address within the memory of the argument is passed. - */ - ExportArgument( const std::string& _name, - const DMatrixPtr& _data, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callByValue = false, - const ExportIndex& _addressIdx = emptyConstExportIndex, - const std::string& _prefix = std::string() - ); - - ExportArgument( const DMatrix& _data - ); - - ExportArgumentInternal* operator->(); - - const ExportArgumentInternal* operator->() const; - - /** Returns a copy of the argument with address index set to given location. - * - * @param[in] rowIdx Row index of the adress. - * @param[in] colIdx Column index of the adress. - * - * \return Copy of the argument with address index set to given location - */ - ExportArgument getAddress( const ExportIndex& _rowIdx, - const ExportIndex& _colIdx = emptyConstExportIndex - ) const; - - /** Returns a string containing the address of the argument to be called. - * If an address index has been set, the string contains a pointer to the - * desired location. The string also depends on whether the argument is - * to be called by value or not. - * - * \return String containing the address of the argument - */ - const std::string getAddressString( bool withDataStruct = true - ) const; - - - /** Returns number of rows of the argument. - * - * \return Number of rows of the argument - */ - virtual uint getNumRows( ) const; - - /** Returns number of columns of the argument. - * - * \return Number of columns of the argument - */ - virtual uint getNumCols( ) const; - - /** Returns total dimension of the argument. - * - * \return Total dimension of the argument - */ - virtual uint getDim( ) const; - - - /** Returns whether all components of the argument are given. - * - * \return true iff all components of the argument have given values, \n - * false otherwise - */ - virtual bool isGiven( ) const; - - /** Returns whether argument is to be called by value. - * - * \return true iff argument is to be called by value, \n - * false otherwise - */ - bool isCalledByValue( ) const; - - /** Specifies to call argument by value. - * - * \return SUCCESSFUL_RETURN - */ - returnValue callByValue( ); - - - - /** Exports declaration of the argument into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export declaration. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; -}; - - -static const ExportArgument emptyConstExportArgument; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_ARGUMENT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_argument_internal.hpp b/phonelibs/acado/include/acado/code_generation/export_argument_internal.hpp deleted file mode 100644 index 87e035b635..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_argument_internal.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_argument.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP -#define ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP - -#include -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -class ExportArithmeticStatement; -class ExportIndex; - - -/** - * \brief Defines a matrix-valued variable that can be passed as argument to exported functions. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportArgumentInternal defines a matrix-valued variable that - * can be passed as argument to exported functions. By default, all entries - * of an arguments are undefined, but each of its component can be set to - * a fixed value if known beforehand. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -class ExportArgumentInternal : public ExportDataInternal -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ExportArgumentInternal( ); - - /** Constructor which takes the name and type of the argument. - * Moreover, it initializes the argument with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - * @param[in] _addressIdx If an address index is specified, not the argument itself but - * a pointer to this address within the memory of the argument is passed. - */ - ExportArgumentInternal( const std::string& _name, - const DMatrixPtr& _data, - ExportType _type, - ExportStruct _dataStruct, - bool _callByValue, - const ExportIndex& _addressIdx, - const std::string& _prefix - ); - - /** Destructor. */ - virtual ~ExportArgumentInternal( ); - - virtual ExportArgumentInternal* clone() const; - - /** Deep copy data members. */ - virtual void deepCopyMembers( std::map& already_copied - ); - - /** Returns a copy of the argument with address index set to given location. - * - * @param[in] rowIdx Row index of the adress. - * @param[in] colIdx Column index of the adress. - * - * \return Copy of the argument with address index set to given location - */ - ExportArgument getAddress( const ExportIndex& rowIdx, - const ExportIndex& colIdx = emptyConstExportIndex - ) const; - - /** Returns a string containing the address of the argument to be called. - * If an address index has been set, the string contains a pointer to the - * desired location. The string also depends on whether the argument is - * to be called by value or not. - * - * \return std::string containing the address of the argument - */ - const std::string getAddressString( bool withDataStruct = true - ) const; - - - /** Returns number of rows of the argument. - * - * \return Number of rows of the argument - */ - virtual uint getNumRows( ) const; - - /** Returns number of columns of the argument. - * - * \return Number of columns of the argument - */ - virtual uint getNumCols( ) const; - - /** Returns total dimension of the argument. - * - * \return Total dimension of the argument - */ - virtual uint getDim( ) const; - - - /** Returns whether all components of the argument are given. - * - * \return true iff all components of the argument have given values, \n - * false otherwise - */ - virtual bool isGiven( ) const; - - /** Returns whether argument is to be called by value. - * - * \return true iff argument is to be called by value, \n - * false otherwise - */ - bool isCalledByValue( ) const; - - /** Specifies to call argument by value. - * - * \return SUCCESSFUL_RETURN - */ - returnValue callByValue( ); - - /** Exports declaration of the argument into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export declaration. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Returns column dimension of the argument. - * - * \return Column dimension of the argument - */ - virtual uint getColDim( ) const; - - /** Returns total index of given component within memory. - * - * @param[in] rowIdx Row index of the component. - * @param[in] colIdx Column index of the component. - * - * \return Total index of given component - */ - virtual ExportIndex getTotalIdx( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - - protected: - - DMatrixPtr data; /**< DMatrix containing the values of each component of the argument - * (by default, all entries are undefined). */ - ExportIndex addressIdx; /**< Address index in case not the argument itself but a pointer to - * this address within the memory of the argument is to be passed. */ - bool callItByValue; /**< Flag indicating whether argument it to be called by value. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_ARGUMENT_INTERNAL_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_argument_list.hpp b/phonelibs/acado/include/acado/code_generation/export_argument_list.hpp deleted file mode 100644 index d4c6beddc4..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_argument_list.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/code_generation/export_argument_list.hpp -* \author Hans Joachim Ferreau, Boris Houska -*/ - - - -#ifndef ACADO_TOOLKIT_EXPORT_ARGUMENT_LIST_HPP -#define ACADO_TOOLKIT_EXPORT_ARGUMENT_LIST_HPP - - -#include -#include - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to store a list of calling arguments of an ExportFunction. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportArgumentList allows to store a list of calling - * arguments of an ExportFunction. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ExportArgumentList -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /**< Default Constructor. - */ - ExportArgumentList( ); - - /** Constructor which takes up to nine calling arguments. - * - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - */ - ExportArgumentList( const ExportArgument& _argument1, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportArgumentList( const ExportArgumentList& arg - ); - - /** Destructor. - */ - virtual ~ExportArgumentList( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportArgumentList& operator=( const ExportArgumentList& rhs - ); - - - /** Adds up to nine calling arguments to the list. - * - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addArgument( const ExportArgument& _argument1, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - - /** Return number of calling arguments in list. - * - * \return Number of calling arguments - */ - uint getNumArguments( ) const; - - - /** Exports a code snippet containing all calling arguments of the list. - * Its appearance can can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - /** Removes all calling arguments to yield an empty argument list. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - - /** Specifies to include variable types into calling arguments. - * - * \return SUCCESSFUL_RETURN - */ - returnValue doIncludeType( ); - - - /** Specifies not to include variable types into calling arguments. - * - * \return SUCCESSFUL_RETURN - */ - returnValue doNotIncludeType( ); - - /** Get the list of arguments. - * - * \return Argument list - */ - const std::vector< ExportArgument >& get( ) const; - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Adds a single calling arguments to the list. - * - * @param[in] _argument Calling argument. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addSingleArgument( const ExportArgument& _argument - ); - - - // - // DATA MEMBERS: - // - protected: - - /** Array containing all calling arguments. */ - std::vector< ExportArgument > arguments; - - /** Flag indicating whether variable types are to be included in calling arguments. */ - bool includeType; -}; - - -CLOSE_NAMESPACE_ACADO - - - -#endif // ACADO_TOOLKIT_EXPORT_ARGUMENT_LIST_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/code_generation/export_arithmetic_statement.hpp b/phonelibs/acado/include/acado/code_generation/export_arithmetic_statement.hpp deleted file mode 100644 index 65dbac529a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_arithmetic_statement.hpp +++ /dev/null @@ -1,218 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_arithmetic_statement.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP -#define ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export code of different arithmetic statements. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportArithmeticStatement allows to export code of different arithmetic - * statements of the form: - * - * lhs rhs1 rhs2 rhs3, - * - * where can be "=", "+=" or "-=", - * can be "+", "-" or "*" and - * can be "+" or "-". - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportArithmeticStatement : public ExportStatement -{ - friend class ExportVariable; - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ExportArithmeticStatement( ); - - /** Constructor which takes all expressions and operators of the arithmetic statement. - * - * @param[in] _lhs Left-hand side expressions - * @param[in] _op0 Operator between left- and right-hand side expression. - * @param[in] _rhs1 First right-hand side expression. - * @param[in] _op1 Operator between first and second right-hand side expression. - * @param[in] _rhs2 Second right-hand side expression of arithmetic statement. - * @param[in] _op2 Operator between second and third right-hand side expression. - * @param[in] _rhs3 Third right-hand side expression. - */ - ExportArithmeticStatement( const ExportVariable& _lhs, - ExportStatementOperator _op0, - const ExportVariable& _rhs1, - ExportStatementOperator _op1, - const ExportVariable& _rhs2, - ExportStatementOperator _op2 = ESO_UNDEFINED, - const ExportVariable& _rhs3 = 0 - ); - - /** Destructor. */ - virtual ~ExportArithmeticStatement( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - /** Exports data declaration of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - ExportArithmeticStatement& allocate( MemoryAllocatorPtr allocator ); - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Exports source code for an addition or subtraction to given file. - * Its appearance can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _sign std::string of the operation ("+" or "-"). - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportCodeAddSubtract( std::ostream& stream, - const std::string& _sign = "+", - const std::string& _realString = "real_t", - const std::string& _intString = "int" - ) const; - - /** Exports source code for a multiplication to given file. - * Its appearance can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] transposeRhs1 Flag indicating whether rhs1 shall be transposed. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportCodeMultiply( std::ostream& stream, - bool transposeRhs1 = false, - const std::string& _realString = "real_t", - const std::string& _intString = "int" - ) const; - - /** Exports source code for an assignment to given file. - * Its appearance can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _op std::string of the assignment operation ("=", "+=" or "-="). - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportCodeAssign( std::ostream& stream, - const std::string& _op = "=", - const std::string& _realString = "real_t", - const std::string& _intString = "int" - ) const; - - - protected: - - // Refactor this guys as shared pointers - ExportVariable lhs; /**< Left-hand side expression of arithmetic statement. */ - ExportVariable rhs1; /**< First right-hand side expression of arithmetic statement. */ - ExportVariable rhs2; /**< Second right-hand side expression of arithmetic statement. */ - ExportVariable rhs3; /**< Third right-hand side expression of arithmetic statement. */ - - ExportStatementOperator op0; /**< Operator between left- and right-hand side expression of arithmetic statement. */ - ExportStatementOperator op1; /**< Operator between first and second right-hand side expression of arithmetic statement. */ - ExportStatementOperator op2; /**< Operator between second and third right-hand side expression of arithmetic statement. */ - - MemoryAllocatorPtr memAllocator; - - private: - std::string getAssignString( ) const; - - uint getNumRows( ) const; - uint getNumCols( ) const; -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_ARITHMETIC_STATEMENT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_auxiliary_functions.hpp b/phonelibs/acado/include/acado/code_generation/export_auxiliary_functions.hpp deleted file mode 100644 index 204a55c1ea..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_auxiliary_functions.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_auxiliary_functions.hpp - * \author Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_AUXILIARY_FUNCTIONS_HPP -#define ACADO_TOOLKIT_EXPORT_AUXILIARY_FUNCTIONS_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating some helper functions. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportAuxiliaryFunctions -{ -public: - - /** Default constructor. - * - * @param[in] _moduleName Module name for customization. - ** @param[in] _moduleName Module prefix for customization. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportAuxiliaryFunctions( const std::string& _headerFileName, - const std::string& _sourceFileName, - const std::string& _moduleName = "acado", - const std::string& _modulePrefix = "ACADO", - const std::string& _commonHeaderName = "", - const std::string& _realString = "double", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportAuxiliaryFunctions() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( ); - - /** Export the interface. */ - returnValue exportCode(); - -private: - - ExportTemplatedFile source; - ExportTemplatedFile header; - std::string moduleName; - std::string modulePrefix; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_AUXILIARY_FUNCTIONS_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_cholesky_decomposition.hpp b/phonelibs/acado/include/acado/code_generation/export_cholesky_decomposition.hpp deleted file mode 100644 index 35de3daf41..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_cholesky_decomposition.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_cholesky_decomposition.hpp - * \author Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_CHOLESKY_DECOMPOSITION_HPP -#define ACADO_TOOLKIT_EXPORT_CHOLESKY_DECOMPOSITION_HPP - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for exporting a function for calculation of the - * Cholesky decomposition. - * - * \ingroup NumericalAlgorithms - * - * \author Milan Vukov - */ - -class ExportCholeskyDecomposition: public ExportAlgorithm -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportCholeskyDecomposition( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportCholeskyDecomposition() - {} - - /** Initializes the different parameters of the linear solver that will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const std::string& _name, - unsigned _dim, - bool _unrolling = false - ); - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup(); - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - /** Get name of the function that perform the decomposition. */ - const std::string getName(); - -private: - - ExportVariable A; - ExportFunction fcn; - bool unrolling; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_CHOLESKY_DECOMPOSITION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_common_header.hpp b/phonelibs/acado/include/acado/code_generation/export_common_header.hpp deleted file mode 100644 index 38358be60b..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_common_header.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_common_header.hpp - * \author Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_COMMON_HEADER_HPP -#define ACADO_TOOLKIT_EXPORT_COMMON_HEADER_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Centralized place to export the common header for a generated module. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportCommonHeader : public ExportTemplatedFile -{ -public: - /** Default constructor. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentstd::string std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportCommonHeader( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportCommonHeader( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const std::string& _moduleName, - const std::string& _modulePrefix, - bool _useSinglePrecision, - bool _useComplexArithmetic, - QPSolverName _qpSolver, - const std::map >& _options, - const std::string& _variables, - const std::string& _workspace, - const std::string& _functions - ); -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_COMMON_HEADER_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_data.hpp b/phonelibs/acado/include/acado/code_generation/export_data.hpp deleted file mode 100644 index 6603dfb94f..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_data.hpp +++ /dev/null @@ -1,194 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_data.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_DATA_HPP -#define ACADO_TOOLKIT_EXPORT_DATA_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -// Forward declaration -class ExportDataInternal; - -/** - * \brief Abstract base class to define variables to be used for exporting code - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportData serves as an abstract base class to define variables - * to be used for exporting code. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportData : public CasADi::SharedObject -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. - */ - ExportData( ); - - /** Destructor. - */ - virtual ~ExportData( ); - - /** An operator for access to functions and members of the node - */ - ExportDataInternal* operator->(); - - /** An operator for const access to functions and members of the node - */ - const ExportDataInternal* operator->() const; - - /** Sets the name of the data object. - * - * @param[in] _name New name of the data object. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setName( const std::string& _name - ); - - /** Sets the data type of the data object. - * - * @param[in] _type New data type of the data object. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setType( ExportType _type - ); - - /** Sets the global data struct to which the data object belongs to. - * - * @param[in] _dataStruct New global data struct to which the data object belongs to. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setDataStruct( ExportStruct _dataStruct - ); - /** Sets the prefix which is placed before the structure name. - * - * @param[in] _prefix Prefix name. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setPrefix( const std::string& _prefix - ); - /** Returns the name of the data object. - * - * \return Name of the data object - */ - std::string getName( ) const; - - /** Returns the data type of the data object. - * - * \return Data type of the data object - */ - ExportType getType( ) const; - - /** Returns a string containing the data type of the data object. - * - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * - * \return std::string containing the data type of the data object. - */ - std::string getTypeString( const std::string& _realString = "real_t", - const std::string& _intString = "int" - ) const; - - /** Returns the global data struct to which the data object belongs to. - * - * \return Global data struct to which the data object belongs to - */ - ExportStruct getDataStruct( ) const; - - /** Returns a string containing the global data struct to which the data object belongs to. - * - * \return std::string containing the global data struct to which the data object belongs to. - */ - std::string getDataStructString( ) const; - - /** Returns a string which contains a prefix name. - * - * \return Prefix name - */ - std::string getPrefix( ) const; - - /** Returns the full name of the data object including the possible prefix - * of the global data struct. - * - * \return Full name of the data object - */ - std::string getFullName( ) const; - - - /** Exports declaration of the index variable. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - /** Returns whether the index is set to a given value. - * - * \return true iff index is set to a given value, \n - * false otherwise - */ - virtual bool isGiven( ); - - virtual returnValue setDoc(const std::string& _doc); - - virtual std::string getDoc() const; -}; - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_DATA_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_data_declaration.hpp b/phonelibs/acado/include/acado/code_generation/export_data_declaration.hpp deleted file mode 100644 index 1883ec3179..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_data_declaration.hpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_data_declaration.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_DATA_DECLARATION_HPP -#define ACADO_TOOLKIT_EXPORT_DATA_DECLARATION_HPP - - -#include -#include -#include -#include - - - -BEGIN_NAMESPACE_ACADO - - - -/** - * \brief Allows to export code containing variable declarations. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportDataDeclaration allows to export code containing variable - * declarations of different data types. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ExportDataDeclaration : public ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ExportDataDeclaration( ); - - /** Constructor taking the variable to be declared. - * - * @param[in] _data Variable to be declared. - */ - ExportDataDeclaration( const ExportVariable& _data - ); - - /** Constructor taking the index variable to be declared. - * - * @param[in] _data Index Variable to be declared. - */ - ExportDataDeclaration( const ExportIndex& _data - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportDataDeclaration( const ExportDataDeclaration& arg - ); - - /** Destructor. - */ - virtual ~ExportDataDeclaration( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportDataDeclaration& operator=( const ExportDataDeclaration& arg - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - - /** Exports source code of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - protected: - - ExportData data; /**< Variable to be declared. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_DATA_DECLARATION_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_data_internal.hpp b/phonelibs/acado/include/acado/code_generation/export_data_internal.hpp deleted file mode 100644 index 1df8f9a218..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_data_internal.hpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ -#ifndef ACADO_TOOLKIT_EXPORT_DATA_INTERNAL_HPP -#define ACADO_TOOLKIT_EXPORT_DATA_INTERNAL_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -class ExportDataInternal : public CasADi::SharedObjectNode -{ -public: - - /** Default constructor which optionally takes name and type string - * of the data object. - * - * @param[in] _name Name of the data object. - * @param[in] _type Data type of the data object. - * @param[in] _dataStruct Global data struct to which the data object belongs to (if any). - * @param[in] _prefix Optional prefix that will be put in front of the name. - */ - explicit ExportDataInternal( const std::string& _name = std::string(), - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - const std::string& _prefix = std::string() - ); - - /** Destructor. - */ - virtual ~ExportDataInternal( ); - - virtual ExportDataInternal* clone() const = 0; - - /** Sets the name of the data object. - * - * @param[in] _name New name of the data object. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setName( const std::string& _name - ); - - /** Sets the data type of the data object. - * - * @param[in] _type New data type of the data object. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setType( ExportType _type - ); - - /** Sets the global data struct to which the data object belongs to. - * - * @param[in] _dataStruct New global data struct to which the data object belongs to. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setDataStruct( ExportStruct _dataStruct - ); - - /** Sets the prefix which is placed before the structure name. - * - * @param[in] _prefix Prefix name. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setPrefix( const std::string& _prefix - ); - /** Returns the name of the data object. - * - * \return Name of the data object - */ - std::string getName( ) const; - - /** Returns the data type of the data object. - * - * \return Data type of the data object - */ - ExportType getType( ) const; - - /** Returns a string containing the data type of the data object. - * - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * - * \return std::string containing the data type of the data object. - */ - std::string getTypeString( const std::string& _realString = "real_t", - const std::string& _intString = "int" - ) const; - - /** Returns the global data struct to which the data object belongs to. - * - * \return Global data struct to which the data object belongs to - */ - ExportStruct getDataStruct( ) const; - - /** Returns a string containing the global data struct to which the data object belongs to. - * - * \return String containing the global data struct to which the data object belongs to. - */ - std::string getDataStructString( ) const; - - /** Returns a string which contains a prefix name. - * - * \return Prefix name - */ - std::string getPrefix( ) const; - - /** Returns the full name of the data object including the possible prefix - * of the global data struct. - * - * \return Full name of the data object - */ - std::string getFullName( ) const; - - - /** Exports declaration of the index variable. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const = 0; - - /** Returns whether the index is set to a given value. - * - * \return true iff index is set to a given value, \n - * false otherwise - */ - virtual bool isGiven( ) const = 0; - - virtual returnValue setDoc( const std::string& _doc ); - virtual std::string getDoc( ) const; - - // - // PROTECTED MEMBER FUNCTIONS: - // -protected: - - returnValue setFullName( void ); - -protected: - - /** Name of the data object. */ - std::string name; - - /** Data type of the data object. */ - ExportType type; - - /** Prefix, which is added before the structure name*/ - std::string prefix; - - /** Global data struct to which the data object belongs to (if any). */ - ExportStruct dataStruct; - - /** Full name of the data object including the possible prefix of the global data struct. */ - std::string fullName; - - /** Description of the variable */ - std::string description; - - -public: - static std::string fcnPrefix; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_DATA_INTERNAL_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_exact_hessian_cn2.hpp b/phonelibs/acado/include/acado/code_generation/export_exact_hessian_cn2.hpp deleted file mode 100644 index b28f76ab75..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_exact_hessian_cn2.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_exact_hessian_cn2.hpp - * \authors Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_CN2_HPP -#define ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_CN2_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief TBD - * - * \ingroup NumericalAlgorithms - * - * \authors Rien Quirynen - * - * \note Early experimental implementation - */ -class ExportExactHessianCN2 : public ExportGaussNewtonCN2 -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportExactHessianCN2( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportExactHessianCN2( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Setting up of a Hessian regularization routine */ - virtual returnValue setupHessianRegularization( void ); - -protected: - - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_CN2_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_exact_hessian_qpdunes.hpp b/phonelibs/acado/include/acado/code_generation/export_exact_hessian_qpdunes.hpp deleted file mode 100644 index 4aaf2992b4..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_exact_hessian_qpdunes.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_qpdunes.hpp - * \author Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_QPDUNES_HPP -#define ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_QPDUNES_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for export of an OCP solver using sparse QP solver qpDUNES - * - * \ingroup NumericalAlgorithms - * - * The class ExportExactHessianQpDunes allows export of an OCP solver using - * the generalized Exact-Hessian method. The underlying QP is solved using the - * structured sparse QP solver qpDUNES. - * - * \author Rien Quirynen - */ -class ExportExactHessianQpDunes : public ExportGaussNewtonQpDunes -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportExactHessianQpDunes( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportExactHessianQpDunes( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Setting up of a Hessian regularization routine */ - virtual returnValue setupHessianRegularization( void ); - -protected: - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_EXACT_HESSIAN_QPDUNES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_file.hpp b/phonelibs/acado/include/acado/code_generation/export_file.hpp deleted file mode 100644 index 51fd658822..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_file.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/export_file.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_FILE_HPP -#define ACADO_TOOLKIT_EXPORT_FILE_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export files containing automatically generated algorithms for fast model predictive control - * - * \ingroup NumericalAlgorithms - * - * The class ExportFile allows to export files containing automatically generated - * algorithms for fast model predictive control. - * - * \author Hans Joachim Ferreau, Milan Vukov, Boris Houska - */ -class ExportFile : public ExportStatementBlock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - */ - ExportFile( ); - - /** Standard constructor. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - */ - ExportFile( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportFile( ); - - - /** Setup routine. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - - /** Exports the file containing the auto-generated code. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( ) const; - - protected: - - std::string fileName; /**< Name of exported file. */ - std::string commonHeaderName; /**< Name of common header file. */ - - std::string realString; /**< std::string to be used to declare real variables. */ - std::string intString; /**< std::string to be used to declare integer variables. */ - int precision; /**< Number of digits to be used for exporting real values. */ - std::string commentString; /**< std::string to be used for exporting comments. */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FILE_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_for_loop.hpp b/phonelibs/acado/include/acado/code_generation/export_for_loop.hpp deleted file mode 100644 index 31e4916e38..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_for_loop.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/code_generation/export_for_loop.hpp -* \author Hans Joachim Ferreau, Boris Houska, Milan Vukov -* \date 2010-2011 -*/ - - - -#ifndef ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP -#define ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP - - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export code of a for-loop. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportForLoop allows to export code of a for-loop. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportForLoop : public ExportStatementBlock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor which optionally takes the name of the - * loop variable as well as other loop settings. - * - * @param[in] _loopVariable Name of the loop variable. - * @param[in] _startValue Start value of the loop counter. - * @param[in] _finalValue Final value of the loop counter. - * @param[in] _increment Increment of the loop counter. - * @param[in] _doLoopUnrolling Flag indicating whether loop shall be unrolled. - */ - ExportForLoop( const ExportIndex& _loopVariable = emptyConstExportIndex, - const ExportIndex& _startValue = emptyConstExportIndex, - const ExportIndex& _finalValue = emptyConstExportIndex, - const ExportIndex& _increment = constExportIndexValueOne, - bool _doLoopUnrolling = false - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportForLoop( const ExportForLoop& arg - ); - - /** Destructor. - */ - virtual ~ExportForLoop( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportForLoop& operator=( const ExportForLoop& arg - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - /** Initializes for-loop with given loop settings. - * - * @param[in] _loopVariable Name of the loop variable. - * @param[in] _startValue Start value of the loop counter. - * @param[in] _finalValue Final value of the loop counter. - * @param[in] _increment Increment of the loop counter. - * @param[in] _doLoopUnrolling Flag indicating whether loop shall be unrolled. - */ - returnValue init( const ExportIndex& _loopVariable, - const ExportIndex& _startValue, - const ExportIndex& _finalValue, - const ExportIndex& _increment, - bool _doLoopUnrolling - ); - - - /** Exports data declaration of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - /** Specifies to unroll for-loop. - * - * \return Reference to for-loop object - */ - ExportForLoop& unrollLoop( ); - - /** Specifies not to unroll for-loop. - * - * \return Loop-unrolled copy of for-loop object - */ - ExportForLoop& keepLoop( ); - - ExportForLoop& allocate(MemoryAllocatorPtr allocator); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Frees internal dynamic memory to yield an empty for-loop. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - private: - - returnValue sanityCheck( void ) const; - - // - // DATA MEMBERS: - // - protected: - - ExportIndex loopVariable; /**< Loop variable. */ - ExportIndex startValue; /**< Start value of the loop counter. */ - ExportIndex finalValue; /**< Final value of the loop counter. */ - ExportIndex increment; /**< Increment of the loop counter. */ - - bool doLoopUnrolling; /**< Flag indicating whether loop shall be unrolled when exporting the code. */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#endif // ACADO_TOOLKIT_EXPORT_FOR_LOOP_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/code_generation/export_forces_generator.hpp b/phonelibs/acado/include/acado/code_generation/export_forces_generator.hpp deleted file mode 100644 index 1288f57806..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_forces_generator.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_forces_generator.hpp - * \author Milan Vukov - * \date 2012 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_FORCES_GENERATOR_HPP -#define ACADO_TOOLKIT_EXPORT_FORCES_GENERATOR_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Generator of the FORCES interface, the to, be called from MATLAB - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportForcesGenerator : public ExportTemplatedFile -{ -public: - - /** Default constructor. - * - * @param[in] _templateName Name of a template. - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportForcesGenerator( const std::string& _templateName, - const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportForcesGenerator( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const unsigned _nx, - const unsigned _nu, - const unsigned _NN, - const std::vector< std::vector< unsigned > >& _lbIdx, - const std::vector< std::vector< unsigned > >& _ubIdx, - const std::vector< unsigned >& _AbDim, - const bool _constHessian, - const bool _diagHessian, - const bool _diagHessianN, - const bool _fixedInitialState, - const std::string& _solverName, - const unsigned _printLevel, - const unsigned _maxIterations, - const unsigned _parallel, - bool matlabGenerator, - bool warmStart - ); -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FORCES_GENERATOR_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_forces_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_forces_interface.hpp deleted file mode 100644 index ecc3b7a902..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_forces_interface.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_forces_interface.hpp - * \author Milan Vukov - * \date 2012 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_FORCES_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_FORCES_INTERFACE_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for configuration and export for interface to the FORCES QP solver - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportForcesInterface : public ExportTemplatedFile -{ -public: - - /** Default constructor. - * - * @param[in] _templateName Name of a template. - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentstd::string std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportForcesInterface( const std::string& _templateName, - const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportForcesInterface( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const std::string& _forcesHeader, - const std::string& _forcesParams, - const std::string& _forcesParamsObj, - const std::string& _forcesOutput, - const std::string& _forcesOutputObj, - const std::string& _forcesInfo, - const std::string& _forcesInfoObj - ); -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FORCES_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_function.hpp b/phonelibs/acado/include/acado/code_generation/export_function.hpp deleted file mode 100644 index 94f066c9dc..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_function.hpp +++ /dev/null @@ -1,303 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_function.hpp - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2013 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_FUNCTION_HPP -#define ACADO_TOOLKIT_EXPORT_FUNCTION_HPP - -#include -#include -#include -#include -#include -#include - -#include - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export code of an arbitrary function. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportFunction allows to export code of an arbitrary function. - * - */ -class ExportFunction : public ExportStatementBlock -{ -public: - /** Default constructor which optionally takes the name of the function - * as well as possible calling arguments. - * - * @param[in] _name Name of the function. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - */ - ExportFunction( const std::string& _name = "defaultFunctionName", - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Destructor. - */ - virtual ~ExportFunction( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - /** Initializes function with given name and possible calling arguments. - * - * @param[in] _name Name of the function. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const std::string& _name = "defaultFunctionName", - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Initializes function with given name and possible calling arguments. - * - * @param[in] _name Name of the function. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return Reference to initialized object - */ - ExportFunction& setup( const std::string& _name = "defaultFunctionName", - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - - /** Adds up to nine calling arguments to the function. - * - * @param[in] _name Name of the function. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addArgument( const ExportArgument& _argument1, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Assigns a return value to the function (by default, its return value is void). - * - * @param[in] _functionReturnValue New return value of the function. - * @param[in] _returnAsPointer Flag indicating whether value shall be returned as pointer. - * - * \return SUCCESSFUL_RETURN - */ - ExportFunction& setReturnValue( const ExportVariable& _functionReturnValue, - bool _returnAsPointer = false - ); - - - /** Sets the name of the function. */ - ExportFunction& setName(const std::string& _name); - - /** Returns the name of the function. */ - std::string getName( ) const; - - /** Exports data declaration of the function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] file Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports forward declaration of the function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportForwardDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the function into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export function. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Returns whether function has been defined. - * - * \return true iff function has been defined, \n - * false otherwise - */ - virtual bool isDefined( ) const; - - /** Return number of calling arguments of the function. */ - unsigned getNumArguments( ) const; - - /** Add a new index (local) index to the function */ - ExportFunction& addIndex( const ExportIndex& _index ); - - /** Add a new index (local) variable to the function. */ - ExportFunction& addVariable( const ExportVariable& _var ); - - /** Acquire a local variable. */ - virtual ExportFunction& acquire( ExportIndex& obj ); - - /** Release a local variable. */ - virtual ExportFunction& release( const ExportIndex& obj ); - - /** Set a documentation string. */ - virtual ExportFunction& doc( const std::string& _doc ); - - /** Set the function as private. If this is true, then do not export it's declaration. */ - virtual ExportFunction& setPrivate( bool _set = true ); - - /** Is function private? */ - virtual bool isPrivate() const; - -protected: - /** Frees internal dynamic memory to yield an empty function. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - /** Name of the function. */ - std::string name; - /** A description string. */ - std::string description; - - /** List of calling arguments. */ - ExportArgumentList functionArguments; - /** Return value of the function. */ - ExportVariable retVal; - /** Flag indicating whether value shall be returned as pointer. */ - bool returnAsPointer; - /** Memory allocator */ - MemoryAllocatorPtr memAllocator; - /** Array of local variables. */ - std::vector< ExportVariable > localVariables; - /** Private flag. In principle if this guy is true, do not export function declaration. */ - bool flagPrivate; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FUNCTION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_function_call.hpp b/phonelibs/acado/include/acado/code_generation/export_function_call.hpp deleted file mode 100644 index fe833f6871..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_function_call.hpp +++ /dev/null @@ -1,249 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_function_call.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_FUNCTION_CALL_HPP -#define ACADO_TOOLKIT_EXPORT_FUNCTION_CALL_HPP - -#include - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - - -/** - * \brief Allows to export code of a function call. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportFunctionCall allows to export code of a function call. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ExportFunctionCall : public ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor which optionally takes the name of the function - * to be called as well as possible calling arguments. - * - * @param[in] _name Name of the function to be called. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - */ - ExportFunctionCall( const std::string& _name = "acadoFcn", - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Constructor which optionally takes the function to be called - * as well as possible calling arguments. - * - * @param[in] _f Function to be called. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - */ - ExportFunctionCall( const ExportFunction& _f, - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportFunctionCall( const ExportFunctionCall& arg - ); - - /** Destructor. - */ - virtual ~ExportFunctionCall( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportFunctionCall& operator=( const ExportFunctionCall& arg - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - - /** Initializes function call with given name of the function and possible calling arguments. - * - * @param[in] _name Name of the function to be called. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const std::string& _name = "defaultFunctionName", - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Initializes function call with function to be called and possible calling arguments. - * - * @param[in] _f Function to be called. - * @param[in] _argument1 Calling argument no. 1. - * @param[in] _argument2 Calling argument no. 2. - * @param[in] _argument3 Calling argument no. 3. - * @param[in] _argument4 Calling argument no. 4. - * @param[in] _argument5 Calling argument no. 5. - * @param[in] _argument6 Calling argument no. 6. - * @param[in] _argument7 Calling argument no. 7. - * @param[in] _argument8 Calling argument no. 8. - * @param[in] _argument9 Calling argument no. 9. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_CALL_TO_EXPORTED_FUNCTION - */ - returnValue init( const ExportFunction& _f, - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - - /** Exports source code of the function call into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export function call. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Frees internal dynamic memory to yield an empty function call. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - - /** Sets the name of the function to be called. - * - * @param[in] _name New name of the function to be called. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setName( const std::string& _name - ); - - - protected: - - std::string name; /**< Name of function to be called. */ - ExportArgumentList functionArguments; /**< List of calling arguments. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_STATEMENT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_function_declaration.hpp b/phonelibs/acado/include/acado/code_generation/export_function_declaration.hpp deleted file mode 100644 index 40067d4ddb..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_function_declaration.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_function_declaration.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2013 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_FUNCTION_DECLARATION_HPP -#define ACADO_TOOLKIT_EXPORT_FUNCTION_DECLARATION_HPP - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** -* \brief Allows to export code containing function (forward) declarations. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportDataDeclaration allows to export code containing function - * (forward) declarations. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportFunctionDeclaration : public ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Constructor taking the function to be declared. - * - * @param[in] _f Function to be declared. - */ - ExportFunctionDeclaration( const ExportFunction& _f - ); - - /** Constructor taking the ODE function to be declared. - * - * @param[in] _f ODE function to be declared. - */ - ExportFunctionDeclaration( const ExportAcadoFunction& _f - ); - - /** Destructor. - */ - virtual ~ExportFunctionDeclaration( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - /** Exports source code of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - private: - ExportFunctionDeclaration( ); - - const ExportFunction& f; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_FUNCTION_DECLARATION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_cn2.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_cn2.hpp deleted file mode 100644 index e335acfde9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_cn2.hpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_block_cn2.hpp - * \authors Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_CN2_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_CN2_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportQpDunesInterface; - -/** - * \brief An OCP solver based on the block N^2 condensing algorithm. - * - * \ingroup NumericalAlgorithms - * - * \authors Rien Quirynen - * - * \note Still a limited experimental version - */ -class ExportGaussNewtonBlockCN2 : public ExportGaussNewtonCN2 -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonBlockCN2( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussNewtonBlockCN2( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - - uint getBlockSize( ) const; - - uint getNumberOfBlocks( ) const; - - uint getNumBlockVariables( ) const; - - virtual unsigned getNumStateBoundsPerBlock( ) const; - - -protected: - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ) = 0; - - virtual returnValue setupQPInterface( ) = 0; - - virtual returnValue setupCondensing( ); - -protected: - - ExportIndex blockI; - - std::vector< unsigned > qpConDim; - - ExportVariable qpgN; - - ExportVariable qpH; - ExportVariable qpC; - ExportVariable qpc; - ExportVariable qpLb0, qpUb0; - - ExportVariable qpLambda, qpMu; - - ExportFunction cleanup; - ExportFunction shiftQpData; - - ExportFunction evaluateConstraints; - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_CN2_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_forces.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_forces.hpp deleted file mode 100644 index 09d16e023e..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_forces.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_block_forces.hpp - * \authors Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_FORCES_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_FORCES_HPP - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -class ExportQpDunesInterface; - -/** - * \brief An OCP solver based on the block N^2 condensing algorithm, in combination with qpDUNES as the QP solver. - * - * \ingroup NumericalAlgorithms - * - * \authors Rien Quirynen - * - * \note Still a limited experimental version - */ -class ExportGaussNewtonBlockForces : public ExportGaussNewtonBlockCN2 -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonBlockForces( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussNewtonBlockForces( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - -protected: - - virtual returnValue setupCondensing( ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - -protected: - - /** \name QP interface */ - /** @{ */ - std::string qpModuleName; - std::string qpObjPrefix; - /** @} */ - - std::vector< ExportVariable > objHessians; - std::vector< ExportVariable > objGradients; - - std::vector< ExportVariable > conLB; - std::vector< ExportVariable > conUB; - std::vector< std::vector< unsigned > > conLBIndices, conUBIndices; - - std::vector< ExportVariable > conA, conAB; - ExportFunction evaluateAffineConstraints; - std::vector< unsigned > conABDimensions; - - std::vector< ExportVariable > conC; - std::vector< ExportVariable > cond; - - /** FORCES interface object. */ - std::shared_ptr< ExportForcesInterface > qpInterface; - std::shared_ptr< ExportForcesGenerator > qpGenerator; - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_QPDUNES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_qpdunes.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_qpdunes.hpp deleted file mode 100644 index a8a59ee9fa..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_block_qpdunes.hpp +++ /dev/null @@ -1,105 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_block_qpdunes.hpp - * \authors Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_QPDUNES_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_QPDUNES_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -class ExportQpDunesInterface; - -/** - * \brief An OCP solver based on the block N^2 condensing algorithm, in combination with qpDUNES as the QP solver. - * - * \ingroup NumericalAlgorithms - * - * \authors Rien Quirynen - * - * \note Still a limited experimental version - */ -class ExportGaussNewtonBlockQpDunes : public ExportGaussNewtonBlockCN2 -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonBlockQpDunes( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussNewtonBlockQpDunes( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - -protected: - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - -protected: - - /** qpDUNES interface object. */ - std::shared_ptr< ExportSplitQpDunesInterface > qpInterface; - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_BLOCK_QPDUNES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2.hpp deleted file mode 100644 index 83891a2e84..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2.hpp +++ /dev/null @@ -1,259 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_cn2.hpp - * \authors Milan Vukov, Joel Andersson, Rien Quirynen - * \date 2013 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief An OCP solver based on the N^2 condensing algorithm - * - * \ingroup NumericalAlgorithms - * - * \authors Milan Vukov, Joel Andersson - * - * \note Still a limited experimental version - */ -class ExportGaussNewtonCN2 : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonCN2( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussNewtonCN2( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - - /** Returns number of bounds on differential states. - * - * \return Number of bounds on differential states - */ - virtual unsigned getNumStateBounds( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - - virtual returnValue setupCondensing( ); - - bool performFullCondensing( ) const; - -protected: - - ExportFunction evaluateObjective; - - ExportVariable x0, Dx0; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjS1; - ExportFunction setObjQN1QN2; - - /** Variable containing the QP Hessian matrix. */ - ExportVariable H; - /** Variable containing the QP constraint matrix. */ - ExportVariable A; - - /** Variable containing the QP gradient. */ - ExportVariable g; - - /** Variable containing the lower limits on QP variables. */ - ExportVariable lb; - - /** Variable containing the upper limits on QP variables. */ - ExportVariable ub; - - /** Variable containing lower limits on QP constraints. */ - ExportVariable lbA; - - /** Variable containing upper limits on QP constraints. */ - ExportVariable ubA; - - /** Variable containing the primal QP variables. */ - ExportVariable xVars; - - /** Variable containing the dual QP variables. */ - ExportVariable yVars; - - std::vector< unsigned > xBoundsIdx; - ExportVariable lbValues, ubValues; - ExportVariable lbAValues, ubAValues; - - ExportFunction condensePrep; - ExportFunction condenseFdb; - ExportFunction expand; - - ExportVariable C, E, QDy, Qd; - - ExportFunction multGxd; - ExportFunction moveGxT; - ExportFunction multGxGx; - ExportFunction multGxGu; - ExportFunction moveGuE; - ExportFunction copyHTH; - ExportFunction copyHTH1; - ExportFunction multQ1d; - ExportFunction multQN1d; - ExportFunction multRDy; - ExportFunction multQDy; - ExportFunction multEQDy; - ExportFunction multQETGx; - ExportFunction multEDu; - ExportFunction multQ1Gx; - ExportFunction multQN1Gx; - ExportFunction multQ1Gu; - ExportFunction multQN1Gu; - - ExportFunction multHxC; - ExportFunction multHxE; - ExportFunction macHxd; - - /** \name Contraint evaluation variables */ - /** @{ */ - ExportVariable A10; - ExportVariable A20; - ExportVariable pacA01Dx0; - ExportVariable pocA02Dx0; - /** @} */ - - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - - // - // N2 condensing related - // - ExportVariable T1, T2, W1, W2; - ExportVariable sbar, w1, w2; - - ExportFunction multBTW1, macBTW1_R1, multGxTGu, macQEW2, mac_S1T_E; - ExportFunction macATw1QDy, macBTw1, macQSbarW2, macASbar, macS1TSbar; - ExportFunction expansionStep; - - // lagrange multipliers - ExportFunction expansionStep2; - - // H00 and H10 computations - ExportFunction mult_BT_T1, mac_ST_C, multGxTGx, macGxTGx; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2_factorization.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2_factorization.hpp deleted file mode 100644 index da078c5065..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_cn2_factorization.hpp +++ /dev/null @@ -1,278 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_cn2_factorization.hpp - * \authors Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_FACTORIZATION_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_FACTORIZATION_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief TBD - * - * \ingroup NumericalAlgorithms - * - * \authors Milan Vukov - * - * \note Early experimental implementation - */ -class ExportGaussNewtonCn2Factorization : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonCn2Factorization( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussNewtonCn2Factorization( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - - /** Returns number of bounds on differential states. - * - * \return Number of bounds on differential states - */ - virtual unsigned getNumStateBounds( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - - virtual returnValue setupCondensing( ); - - bool performFullCondensing( ) const; - -protected: - - ExportFunction evaluateObjective; - - ExportVariable x0, Dx0; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjQN1QN2; - - /** Variable containing the QP Hessian matrix. */ - ExportVariable H, H00, H10, H11; - /** Variable containing factorization of the QP Hessian matrix; R' * R = H. */ - ExportVariable U; - /** Variable containing the QP constraint matrix. */ - ExportVariable A; - - /** Variable containing the QP gradient. */ - ExportVariable g, g0, g1; - - /** Variable containing the lower limits on QP variables. */ - ExportVariable lb; - - /** Variable containing the upper limits on QP variables. */ - ExportVariable ub; - - /** Variable containing lower limits on QP constraints. */ - ExportVariable lbA; - - /** Variable containing upper limits on QP constraints. */ - ExportVariable ubA; - - /** Variable containing the primal QP variables. */ - ExportVariable xVars; - - /** Variable containing the dual QP variables. */ - ExportVariable yVars; - - std::vector< unsigned > xBoundsIdxRev, xBoundsIdx; - ExportVariable lbValues, ubValues; - ExportVariable lbAValues, ubAValues; - - ExportVariable Qd; - - ExportFunction condensePrep; - ExportFunction condenseFdb; - ExportFunction expand; - - ExportVariable E, QE, QGx, QDy; - - ExportFunction multGxd; - ExportFunction moveGxT; - ExportFunction multGxGx; - ExportFunction multGxGu; - ExportFunction moveGuE; - ExportFunction setBlockH11; - ExportFunction zeroBlockH11; - ExportFunction copyHTH; - ExportFunction multQ1d; - ExportFunction multQN1d; - ExportFunction multRDy; - ExportFunction multQDy; - ExportFunction multEQDy; - ExportFunction multQETGx; - ExportFunction zeroBlockH10; - ExportFunction multEDu; - ExportFunction multQ1Gx; - ExportFunction multQN1Gx; - ExportFunction multQ1Gu; - ExportFunction multQN1Gu; - ExportFunction zeroBlockH00; - ExportFunction multCTQC; - - ExportVariable A10; - ExportVariable A20; - ExportVariable pacA01Dx0; - ExportVariable pocA02Dx0; - ExportFunction multHxC; - ExportFunction multHxE; - ExportFunction macHxd; - - ExportFunction macCTSlx; - ExportFunction macETSlu; - - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - - // N2 condensing related - ExportVariable W1, W2; - ExportVariable sbar, w1, w2; - - ExportFunction mult_H_W2T_W3, mac_H_W2T_W3_R, mac_W3_G_W1T_G; - - ExportFunction multBTW1, macBTW1_R1, multGxTGu, macQEW2; - ExportFunction macATw1QDy, macBTw1, macQSbarW2, macASbar, macASbarD2; - ExportFunction expansionStep; - - ExportCholeskySolver cholSolver; - - ExportFunction mac_R_T2_B_D; - ExportFunction move_D_U; - ExportFunction mult_L_E_U; - ExportFunction updateQ; - ExportFunction mul_T2_A_L; - ExportFunction mult_BT_T1_T2; - - ExportVariable D, L; - - ExportVariable T1, T2, T3, F; - - ExportFunction mac_R_BT_F_D, mult_FT_A_L; - ExportFunction updateQ2; - ExportFunction mac_W1_T1_E_F; - ExportFunction move_GxT_T3; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CN2_FACTORIZATION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_condensed.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_condensed.hpp deleted file mode 100644 index 868260f7fd..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_condensed.hpp +++ /dev/null @@ -1,280 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_condensed.hpp - * \authors Boris Houska, Hans Joachim Ferreau, Milan Vukov - * \date 2010 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CONDENSED_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CONDENSED_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for export of Gauss-Newton condensed OCP solver - * - * \ingroup NumericalAlgorithms - * - * The class ExportGaussNewtonCondensed allows to export an OCP solver - * using the generalized Gauss-Newton method. The sparse QP is condensed - * and solved with qpOASES QP solver. - * - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportGaussNewtonCondensed : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonCondensed( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportGaussNewtonCondensed( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - - /** Returns number of bounds on differential states. - * - * \return Number of bounds on differential states - */ - virtual unsigned getNumStateBounds( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - /** Setup qpOASES interface. */ - virtual returnValue setupQPInterface( ); - - /** Setup condensing routine variables and functions. */ - virtual returnValue setupCondensing( ); - - /** Indicator for full condensing. */ - bool performFullCondensing( ) const; - -private: - - /** Current state feedback. */ - ExportVariable x0; - /** Current state feedback deviation. */ - ExportVariable Dx0; - - /** \name Objective evaluation */ - /** @{ */ - ExportFunction evaluateObjective; - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjQN1QN2; - /** @} */ - - /** \name Condensing functions and variables */ - /** @{ */ - ExportFunction condensePrep; - ExportFunction condenseFdb; - ExportFunction expand; - - ExportVariable T, E, QE, QGx, QDy, Qd; - - ExportVariable H00, H10, H11; - ExportVariable g0, g1; - - ExportCholeskySolver cholSolver; - - std::vector< unsigned > xBoundsIdx; - ExportVariable lbValues, ubValues; - ExportVariable lbAValues, ubAValues; - /** @} */ - - /** \name Helper functions */ - /** @{ */ - ExportFunction multGxd; - ExportFunction moveGxT; - ExportFunction multGxGx; - ExportFunction multGxGu; - ExportFunction moveGuE; - ExportFunction setBlockH11; - ExportFunction setBlockH11_R1; - ExportFunction zeroBlockH11; - ExportFunction copyHTH; - ExportFunction multQ1d; - ExportFunction multQN1d; - ExportFunction multRDy; - ExportFunction multQDy; - ExportFunction multEQDy; - ExportFunction multQETGx; - ExportFunction zeroBlockH10; - ExportFunction multEDu; - ExportFunction multQ1Gx; - ExportFunction multQN1Gx; - ExportFunction multQ1Gu; - ExportFunction multQN1Gu; - ExportFunction zeroBlockH00; - ExportFunction multCTQC; - - ExportFunction macCTSlx; - ExportFunction macETSlu; - - ExportFunction multHxC; - ExportFunction multHxE; - ExportFunction macHxd; - /** @} */ - - /** \name Contraint evaluation variables */ - /** @{ */ - ExportVariable A10; - ExportVariable A20; - ExportVariable pacA01Dx0; - ExportVariable pocA02Dx0; - /** @} */ - - /** \name RTI related */ - /** @{ */ - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - /** @} */ - - /** \name Covariance calculation varibables and functions */ - /** @{ */ - ExportVariable CEN, sigmaTmp, sigma, sigmaN; - ExportFunction calculateCovariance; - /** @} */ - - /** \name qpOASES interface variables */ - /** @{ */ - /** Variable containing the QP Hessian matrix. */ - ExportVariable H; - /** Variable containing factorization of the QP Hessian matrix; R' * R = H. */ - ExportVariable R; - /** Variable containing the QP constraint matrix. */ - ExportVariable A; - /** Variable containing the QP gradient. */ - ExportVariable g; - /** Variable containing the lower limits on QP variables. */ - ExportVariable lb; - /** Variable containing the upper limits on QP variables. */ - ExportVariable ub; - /** Variable containing lower limits on QP constraints. */ - ExportVariable lbA; - /** Variable containing upper limits on QP constraints. */ - ExportVariable ubA; - /** Variable containing the primal QP variables. */ - ExportVariable xVars; - /** Variable containing the dual QP variables. */ - ExportVariable yVars; - /** @} */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_CONDENSED_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_forces.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_forces.hpp deleted file mode 100644 index fb8e444ca4..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_forces.hpp +++ /dev/null @@ -1,227 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_forces.hpp - * \author Milan Vukov - * \date 2012 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_FORCES_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_FORCES_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportForcesInterface; -class ExportForcesGenerator; - -/** - * \brief A class for export of an OCP solver using sparse QP solver FORCES - * - * \ingroup NumericalAlgorithms - * - * The class ExportGaussNewtonForces allows export of and OCP solver using - * the generalized Gauss-Newton method. The underlying QP is solved using the - * structured sparse QP solver FORCES. - * - * \author Milan Vukov - */ -class ExportGaussNewtonForces : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonForces( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportGaussNewtonForces( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - - unsigned getNumLowerBounds( ) const; - - unsigned getNumUpperBounds( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - -private: - /** Current state feedback. */ - ExportVariable x0; - - /** \name Objective evaluation */ - /** @{ */ - ExportFunction evaluateObjective; - - std::vector< ExportVariable > objHessians; - std::vector< ExportVariable > objGradients; - - ExportFunction setStageH; - ExportFunction setStagef; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjQN1QN2; - ExportFunction setObjS1; - - bool diagH; - bool diagHN; - /** @} */ - - /** \name Constraint evaluation */ - /** @{ */ - std::vector< ExportVariable > conLB; - std::vector< ExportVariable > conUB; - ExportVariable lbValues, ubValues; - - unsigned numLB; - unsigned numUB; - - std::vector< std::vector< unsigned > > conLBIndices, conUBIndices; - std::vector< unsigned > conABDimensions; - std::vector< std::vector< double > > conLBValues, conUBValues; - - ExportFunction evaluateConstraints; - ExportFunction conSetGxGu; - ExportVariable conStageC; - - std::vector< ExportVariable > conC; - std::vector< ExportVariable > cond; - ExportFunction conSetd; - /** @} */ - - /** \name RTI related */ - /** @{ */ - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - /** @} */ - - /** \name Helper functions */ - /** @{ */ - ExportFunction acc; - /** @} */ - - /** \name QP interface */ - /** @{ */ - std::string qpModuleName; - std::string qpObjPrefix; - - std::shared_ptr< ExportForcesInterface > qpInterface; - std::shared_ptr< ExportForcesGenerator > qpGenerator; - /** @} */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_FORCES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_generic.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_generic.hpp deleted file mode 100644 index eb2896207c..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_generic.hpp +++ /dev/null @@ -1,212 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_generic.hpp - * \author Rien Quirynen - * \date 2017 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_GENERIC_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_GENERIC_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief TBD - * - * \ingroup NumericalAlgorithms - * - * TBD - * - * \author Milan Vukov - */ -class ExportGaussNewtonGeneric : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonGeneric( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportGaussNewtonGeneric( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - -private: - /** Current state feedback. */ - ExportVariable x0; - - /** \name Objective evaluation */ - /** @{ */ - ExportFunction evaluateObjective; - - ExportFunction setStagef; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjS1; - ExportFunction setObjQN1QN2; - - /** @} */ - - /** \name Constraint evaluation */ - /** @{ */ - ExportFunction evaluateConstraints; - ExportFunction setStagePac; - unsigned qpDimHtot; - unsigned qpDimH; - unsigned qpDimHN; - std::vector< unsigned > qpConDim; - /** @} */ - - /** \name RTI related */ - /** @{ */ - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - /** @} */ - - /** \name Helper functions */ - /** @{ */ - ExportFunction acc; - /** @} */ - - /** \name QP interface */ - /** @{ */ - - ExportVariable qpQ, qpQf, qpS, qpR; - - ExportVariable qpq, qpqf, qpr; - ExportVariable qpx, qpu; - - ExportVariable evLbValues, evUbValues; - ExportVariable evLbAValues, evUbAValues; - ExportVariable qpLb, qpUb; - - ExportVariable qpLbA, qpUbA; - - ExportVariable sigmaN; - - ExportVariable qpLambda, qpMu, qpSlacks; - - ExportVariable nIt; - -// ExportVariable qpWork; - /** @} */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_GENERIC_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_hpmpc.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_hpmpc.hpp deleted file mode 100644 index f5c1495ea0..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_hpmpc.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_hpmpc.hpp - * \author Milan Vukov, Niels van Duijkeren - * \date 2016 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_HPMPC_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_HPMPC_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportHpmpcInterface; - -/** - * \brief TBD - * - * \ingroup NumericalAlgorithms - * - * TBD - * - * \author Milan Vukov - */ -class ExportGaussNewtonHpmpc : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonHpmpc( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportGaussNewtonHpmpc( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupEvaluation( ); - - virtual returnValue setupQPInterface( ); - -private: - /** Current state feedback. */ - ExportVariable x0; - - /** \name Objective evaluation */ - /** @{ */ - ExportFunction evaluateObjective; - - ExportFunction setStagef; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjS1; - ExportFunction setObjQN1QN2; - - /** @} */ - - /** \name Constraint evaluation */ - /** @{ */ - ExportFunction evaluateConstraints; - ExportFunction setStagePac; - unsigned qpDimHtot; - unsigned qpDimH; - unsigned qpDimHN; - std::vector< unsigned > qpConDim; - /** @} */ - - /** \name RTI related */ - /** @{ */ - ExportFunction preparation; - ExportFunction feedback; - - ExportFunction getKKT; - /** @} */ - - /** \name Helper functions */ - /** @{ */ - ExportFunction acc; - /** @} */ - - /** \name QP interface */ - /** @{ */ - - ExportVariable qpQ, qpQf, qpS, qpR; - - ExportVariable qpq, qpqf, qpr; - ExportVariable qpx, qpu; - - ExportVariable evLbValues, evUbValues; - ExportVariable qpLb, qpUb; - - ExportVariable qpLbA, qpUbA; - - ExportVariable sigmaN; - - ExportVariable qpLambda, qpMu, qpSlacks; - - ExportVariable nIt; - -// ExportVariable qpWork; - - std::shared_ptr< ExportHpmpcInterface > qpInterface; - /** @} */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_HPMPC_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_qpdunes.hpp b/phonelibs/acado/include/acado/code_generation/export_gauss_newton_qpdunes.hpp deleted file mode 100644 index 4333773184..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_gauss_newton_qpdunes.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_gauss_newton_qpdunes.hpp - * \author Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_QPDUNES_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_QPDUNES_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportQpDunesInterface; - -/** - * \brief A class for export of an OCP solver using sparse QP solver qpDUNES - * - * \ingroup NumericalAlgorithms - * - * The class ExportGaussNewtonQpDunes allows export of and OCP solver using - * the generalized Gauss-Newton method. The underlying QP is solved using the - * structured sparse QP solver qpDUNES. - * - * \author Milan Vukov - */ -class ExportGaussNewtonQpDunes : public ExportNLPSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussNewtonQpDunes( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportGaussNewtonQpDunes( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - unsigned getNumQPvars( ) const; - -protected: - - /** Setting up of an objective evaluation: - * - functions and derivatives evaulation - * - creating Hessians and gradients - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupObjectiveEvaluation( void ); - - /** Set-up evaluation of constraints - * - box constraints on states and controls - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupConstraintsEvaluation( void ); - - /** Initialization of all member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ); - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ); - - /** Exports source code containing the evaluation routines of the algorithm. */ - virtual returnValue setupEvaluation( ); - - /** Setup of the glue code for the QP solver interaction. */ - virtual returnValue setupQPInterface( ); - -protected: - - /** Current state feedback. */ - ExportVariable x0; - - /** \name QP interface variables */ - /** @{ */ - ExportVariable qpH; - ExportVariable qpg; - ExportVariable qpgN; - - ExportVariable qpC; - ExportVariable qpc; - ExportVariable qpLb0, qpUb0; - ExportVariable qpLb, qpUb; - - ExportVariable lbValues, ubValues; - - ExportVariable qpA; - ExportVariable qpLbA, qpUbA; - - ExportVariable qpPrimal, qpLambda, qpMu; - /** @} */ - - /** \name Objective evaluation. */ - /** @{ */ - ExportFunction evaluateObjective; - - ExportFunction setStageH; - ExportFunction setStagef; - - ExportFunction setObjQ1Q2; - ExportFunction setObjR1R2; - ExportFunction setObjQN1QN2; - - bool diagH, diagHN; - /** @} */ - - /** \name Constraint evaluation */ - /** @{ */ - ExportFunction evaluateConstraints; - ExportFunction setStagePac; - std::vector< unsigned > qpConDim; - /** @} */ - - /** \name RTI related */ - /** @{ */ - ExportFunction preparation; - ExportFunction feedback; - /** @} */ - - /** \name qpDUNES interface functions */ - /** @{ */ - ExportFunction cleanup; - ExportFunction shiftQpData; - /** @} */ - - /** \name Auxiliary functions */ - /** @{ */ - ExportFunction getKKT; - /** @} */ - - /** \name Helper functions */ - /** @{ */ - ExportFunction acc; - /** @} */ - - /** qpDUNES interface object. */ - std::shared_ptr< ExportQpDunesInterface > qpInterface; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_NEWTON_QPDUNES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_hessian_regularization.hpp b/phonelibs/acado/include/acado/code_generation/export_hessian_regularization.hpp deleted file mode 100644 index 4da0cb2555..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_hessian_regularization.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_hessian_regularization.hpp - * \author Rien Quirynen - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_HESSIAN_REG_HPP -#define ACADO_TOOLKIT_EXPORT_HESSIAN_REG_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating code implementing a symmetric EigenValue Decomposition. - * - * \ingroup ExportHessianRegularization - * - * \author Rien Quirynen - */ -class ExportHessianRegularization : public ExportTemplatedFile -{ -public: - - /** Default constructor. - * - * @param[in] _moduleName Module name for customization. - * @param[in] _modulePrefix Module name for customization. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportHessianRegularization( const std::string& _sourceFileName, - const std::string& _moduleName = "acado", - const std::string& _modulePrefix = "ACADO", - const std::string& _commonHeaderName = "", - const std::string& _realString = "double", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportHessianRegularization() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( uint DIM, double eps ); - -private: - - std::string moduleName; - std::string modulePrefix; - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_HESSIAN_REG_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_hpmpc_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_hpmpc_interface.hpp deleted file mode 100644 index c096d77310..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_hpmpc_interface.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_hpmpc_interface.hpp - * \author Milan Vukov - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_HPMPC_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_HPMPC_INTERFACE_HPP - - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Interface generator for the HPMPC QP solver - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportHpmpcInterface : public ExportTemplatedFile -{ -public: - /** Default constructor. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentstd::string std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportHpmpcInterface( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportHpmpcInterface( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const unsigned _maxIter, - const unsigned _printLevel, - bool _useSinglePrecision, - bool _warmStart, - const std::string& _Hx, - const std::string& _Hu, - const std::string& _lbA, - const std::string& _ubA, - const unsigned _DimH, - const std::vector< unsigned >& _conDim, - const unsigned _NI, - const unsigned _NX, - const unsigned _NU - ); - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_HPMPC_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_index.hpp b/phonelibs/acado/include/acado/code_generation/export_index.hpp deleted file mode 100644 index cb6ebf746b..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_index.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_index.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -#ifndef ACADO_TOOLKIT_EXPORT_INDEX_HPP -#define ACADO_TOOLKIT_EXPORT_INDEX_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportIndexNode; -class ExportArgument; - -/** - * \brief Defines a scalar-valued index variable to be used for exporting code. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportIndex defines a scalar-valued index variable to be used for - * exporting code. Instances of this class can be used similar to usual integers - * but offer additional functionality, e.g. they allow to export arithmetic - * expressions involving indices of the form: - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -class ExportIndex : public ExportData -{ -public: - - ExportIndex(); - - ExportIndex( const int _value ); - - explicit ExportIndex( const std::string& _name, - const std::string& _prefix = std::string() - ); - - ExportIndexNode* operator->(); - - const ExportIndexNode* operator->() const; - - operator ExportArgument(); - - friend ExportIndex operator+( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - - friend ExportIndex operator-( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - - friend ExportIndex operator*( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - - friend ExportIndex operator/( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - friend ExportIndex operator%( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - friend std::string operator==( const ExportIndex& _arg1, - const ExportIndex& _arg2 - ); - - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Returns a string containing the value of the index. - * - * \return std::string containing the value of the index. - */ - const std::string get( ) const; - - /** Returns the given value of the index (if defined). - * - * \return Given value of the index or "undefinedValue". - */ - int getGivenValue( ) const; - - /** Returns whether the index is set to a given value. - * - * \return true iff index is set to a given value, \n - * false otherwise - */ - bool isGiven( ) const; - - bool isBinary() const; - - bool isVariable() const; -}; - -struct ExportIndexComparator -{ - bool operator() (const ExportIndex& val1, const ExportIndex& val2) const - { - int tmp = std::string( val1.getName() ).compare( std::string( val2.getName() ) ); - - return (tmp < 0) ? true : false; - } -}; - -const ExportIndex emptyConstExportIndex( int( 0 ) ); -const ExportIndex constExportIndexValueOne( int( 1 ) ); - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_INDEX_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_index_node.hpp b/phonelibs/acado/include/acado/code_generation/export_index_node.hpp deleted file mode 100644 index 457c0570b0..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_index_node.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/code_generation/export_index_node.hpp - * \author Milan Vukov - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_INDEX_NODE_HPP -#define ACADO_TOOLKIT_EXPORT_INDEX_NODE_HPP - -#include -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -enum ExportVariableType -{ - EVT_VARIABLE, - EVT_VALUE, - EVT_BINARY_OPERATOR -}; - -class ExportIndexNode : public ExportDataInternal -{ -public: - ExportIndexNode( const std::string& _name, - const std::string& _prefix, - const int _factor = 1, - const int _offset = 0) - : ExportDataInternal(_name, INT, ACADO_LOCAL, _prefix) - { - if ( _factor ) - { - varType = EVT_VARIABLE; - value = 0; - factor = _factor; - offset = _offset; - op = ESO_UNDEFINED; - } - else - { - varType = EVT_VALUE; - value = _offset; - factor = 1; - offset = 0; - op = ESO_UNDEFINED; - } - } - - explicit ExportIndexNode( const int _value ) - : ExportDataInternal("defaultIndexName", INT, ACADO_LOCAL, ""), - varType( EVT_VALUE ), value( _value ), factor( 1 ), offset( 0 ), op( ESO_UNDEFINED ) - {} - - ExportIndexNode( ExportStatementOperator _op, - const ExportIndex& _arg1, - const ExportIndex& _arg2 - ) - : ExportDataInternal("defaultIndexName", INT, ACADO_LOCAL, ""), - varType( EVT_BINARY_OPERATOR ), value( 0 ), factor( 1 ), offset( 0 ), - op( _op ), left( _arg1 ), right( _arg2 ) - {} - - virtual ~ExportIndexNode() - {} - - virtual ExportIndexNode* clone() const - { - return new ExportIndexNode( *this ); - } - - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /// Returns a string containing the value of the index. - const std::string get( ) const; - - - /** Returns the given value of the index (if defined). - * - * \return Given value of the index or 0 in case the index is undefined. - */ - const int getGivenValue( ) const; - - - /** Returns whether the index is set to a given value. - * - * \return true iff index is set to a given value, \n - * false otherwise - */ - virtual bool isGiven( ) const; - - bool isBinary() const - { - if (varType == EVT_BINARY_OPERATOR) - return true; - - return false; - } - - bool isVariable() const - { - if (varType == EVT_VARIABLE) - return true; - - return false; - } - - const int getFactor( ) const - { - return factor; - } - - const int getOffset( ) const - { - return offset; - } - -private: - ExportVariableType varType; - int value; - int factor; - int offset; - - int op; - ExportIndex left; - ExportIndex right; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_INDEX_NODE_HPP - diff --git a/phonelibs/acado/include/acado/code_generation/export_module.hpp b/phonelibs/acado/include/acado/code_generation/export_module.hpp deleted file mode 100644 index ce0355f2d1..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_module.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_module.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2014 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_MODULE_HPP -#define ACADO_TOOLKIT_EXPORT_MODULE_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportStatementBlock; - -/** - * \brief User-interface to automatically generate algorithms for fast model predictive control - * - * \ingroup UserInterfaces - * - * The class ExportModule is a user-interface to automatically generate tailored - * algorithms for fast model predictive control. It takes an optimal control - * problem (OCP) formulation and generates code based on given user options. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ExportModule : public UserInteraction -{ -// -// PUBLIC MEMBER FUNCTIONS: -// -public: - - /** Default constructor. */ - ExportModule( ); - - /** Destructor. - */ - virtual ~ExportModule( ); - - /** Exports all files of the auto-generated code into the given directory. - * - * @param[in] dirName Name of directory to be used to export files. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( const std::string& dirName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) = 0; - -protected: - - /** Exports main header file for using the exported algorithm. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportAcadoHeader( const std::string& _dirName, - const std::string& _fileName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const = 0; - - - /** Collects all data declarations of the auto-generated sub-modules to given - * list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - virtual returnValue collectDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const = 0; - - - /** Collects all function (forward) declarations of the auto-generated sub-modules - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - virtual returnValue collectFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - /** Sets-up default options. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setupOptions( ); - - /** Name of common header file. */ - std::string commonHeaderName; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_MODULE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_nlp_solver.hpp b/phonelibs/acado/include/acado/code_generation/export_nlp_solver.hpp deleted file mode 100644 index 885be2cc21..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_nlp_solver.hpp +++ /dev/null @@ -1,378 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_nlp_solver.hpp - * \author Milan Vukov, Rien Quirynen - * \date 2012 - 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP - -#include -#include - -#include -#include - -#include -#include - -BEGIN_NAMESPACE_ACADO - -class OCP; -class Objective; - -/** - * \brief Base class for export of NLP/OCP solvers. - * - * \ingroup NumericalAlgorithms - * - * This base class is basically used to extract information from an OCP - * object and prepare low level structures. Later, a derived class is - * actually building the solver to solve an OCP problem. - * - * \author Milan Vukov - * - * \note Based on code originally developed by Boris Houska and Hand Joachim Ferreau. - */ -class ExportNLPSolver : public ExportAlgorithm -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportNLPSolver( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportNLPSolver( ) - {} - - /** Initializes export of an algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ) = 0; - - - /** Assigns module for exporting a tailored integrator. - * - * @param[in] _integrator Integrator module. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setIntegratorExport( IntegratorExportPtr const _integrator - ); - - /** Assigns new constant for Levenberg-Marquardt regularization. - * - * @param[in] _levenbergMarquardt Non-negative constant for Levenberg-Marquardt regularization. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setLevenbergMarquardt( double _levenbergMarquardt - ); - - - /** Adds all data declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated condensing algorithm - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - - /** Exports source code of the auto-generated condensing algorithm - * into the given directory. - * - * @param[in] code Code block containing the auto-generated condensing algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** Returns number of variables in underlying QP. - * - * \return Number of variables in underlying QP - */ - virtual unsigned getNumQPvars( ) const = 0; - - /** Returns whether a single shooting state discretization is used. - * - * \return true iff single shooting state discretization is used, \n - * false otherwise - */ - bool performsSingleShooting( ) const; - - /** Set objective function - * \return SUCCESSFUL_RETURN, \n - * RET_INITIALIZE_FIRST, \n - * RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n - * RET_INVALID_ARGUMENTS - * */ - returnValue setObjective(const Objective& _objective); - returnValue setLSQObjective(const Objective& _objective); - returnValue setGeneralObjective(const Objective& _objective); - - /** Set the "complex" path and point constraints - * \return SUCCESSFUL_RETURN - * */ - returnValue setConstraints(const OCP& _ocp); - - /** Get the number of complex constraints - path + point constraints. - * \return Number of complex constraints - * */ - unsigned getNumComplexConstraints( void ); - - /** Get the number of path constraints. - * \return Number of path constraints - * */ - unsigned getNumPathConstraints( void ); - - /** Return type of weighting matrices. - * \return Type of weighting matrices. */ - unsigned weightingMatricesType( void ) const; - - /** Indicates whether initial state is fixed. */ - bool initialStateFixed( ) const; - - /** Indicates whether linear terms in the objective are used. */ - bool usingLinearTerms() const; - -protected: - - /** Setting up of a model simulation: - * - model integration - * - sensitivity generation - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupSimulation( void ); - - /** Initialization of member variables. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupVariables( ) = 0; - - /** Exports source code containing the multiplication routines of the algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupMultiplicationRoutines( ) = 0; - - /** Exports source code containing the evaluation routines of the algorithm. */ - virtual returnValue setupEvaluation( ) = 0; - - /** Setup of functions for evaluation of constraints. */ - virtual returnValue setupConstraintsEvaluation( ) = 0; - - /** Setup of functions for evaluation of auxiliary functions. */ - returnValue setupAuxiliaryFunctions(); - - /** Setup the function for evaluating the actual objective value. */ - virtual returnValue setupGetObjective(); - - /** Setup the function for evaluating the actual LSQ objective value. */ - virtual returnValue setupGetLSQObjective(); - - /** Setup the function for evaluating the actual objective value. */ - virtual returnValue setupGetGeneralObjective(); - - /** Setup of functions and variables for evaluation of arrival cost. */ - returnValue setupArrivalCostCalculation(); - - /** Setup main initialization code for the solver */ - virtual returnValue setupInitialization(); - -protected: - - /** \name Evaluation of model dynamics. */ - /** @{ */ - - /** Module for exporting a tailored integrator. */ - IntegratorExportPtr integrator; - - ExportFunction modelSimulation; - - ExportVariable state; - ExportVariable x; - ExportVariable z; - ExportVariable u; - ExportVariable od; - ExportVariable d; - - ExportVariable evGx; // stack of sensitivities w.r.t. x - ExportVariable evGu; // stack of sensitivities w.r.t. u - - /** @} */ - - /** \name Evaluation of objective */ - /** @{ */ - - /** Non-negative constant for Levenberg-Marquardt regularization. */ - double levenbergMarquardt; - - ExportVariable y, yN, Dy, DyN; - - // lagrange multipliers - ExportVariable mu; - - ExportVariable objg, objS, objSEndTerm; - ExportVariable objEvFx, objEvFu, objEvFxEnd; // aliasing - ExportVariable objEvFxx, objEvFxu, objEvFuu, objEvFxxEnd; // aliasing - - ExportVariable objAuxVar, objValueIn, objValueOut; - ExportAcadoFunction evaluateStageCost; - ExportAcadoFunction evaluateTerminalCost; - - ExportVariable Q1, Q2; - ExportVariable R1, R2; - ExportVariable S1; - ExportVariable QN1, QN2; - - ExportVariable objSlx, objSlu; - - bool diagonalH, diagonalHN; - - /** @} */ - - /** \name Evaluation of box constraints*/ - /** @{ */ - VariablesGrid uBounds; - VariablesGrid xBounds; - /** @} */ - - /** \name Evaluation of path constraints */ - /** @{ */ - unsigned dimPacH; - ExportAcadoFunction evaluatePathConstraints; - ExportVariable conAuxVar; - ExportVariable conValueIn; - ExportVariable conValueOut; - - DVector lbPathConValues, ubPathConValues; - - ExportVariable pacEvH; - ExportVariable pacEvHx, pacEvHu, pacEvHxd; - ExportVariable pacEvDDH; - /** @} */ - - /** \name Evaluation of point constraints */ - /** @{ */ - unsigned dimPocH; - std::vector< std::shared_ptr< ExportAcadoFunction > > evaluatePointConstraints; - DVector lbPointConValues, ubPointConValues; - - std::vector< DVector > pocLbStack, pocUbStack; - - ExportVariable pocEvH; - ExportVariable pocEvHx, pocEvHu, pocEvHxd; - /** @} */ - - /** \name Auxiliary functions */ - /** @{ */ - - /** Main initialization function for the solver. */ - ExportFunction initialize; - - ExportFunction shiftStates; - ExportFunction shiftControls; - ExportFunction getObjective; - ExportFunction initializeNodes; - /** @} */ - - /** \name Arrival cost related */ - /** @{ */ - ExportFunction updateArrivalCost; - - ExportCholeskyDecomposition cholObjS; - ExportCholeskyDecomposition cholSAC; - - ExportHouseholderQR acSolver; - - ExportVariable acA, acb, acP, acTmp; - // acWL and acVL are assumed to be upper triangular matrices - ExportVariable acWL, acVL, acHx, acHu, acXx, acXu, acXTilde, acHTilde; - - // Older stuff; TODO make this more unique - ExportVariable SAC, xAC, DxAC; - - ExportFunction regularizeHessian; - ExportFunction regularization; - /** @} */ - -private: - returnValue setupResidualVariables(); - returnValue setupObjectiveLinearTerms(const Objective& _objective); -}; - -/** Types of NLP/OCP solvers. */ -enum ExportNLPType -{ - GAUSS_NEWTON_CONDENSED, - GAUSS_NEWTON_CN2, - GAUSS_NEWTON_BLOCK_QPDUNES, - GAUSS_NEWTON_BLOCK_FORCES, - GAUSS_NEWTON_CN2_FACTORIZATION, - GAUSS_NEWTON_FORCES, - GAUSS_NEWTON_QPDUNES, - GAUSS_NEWTON_HPMPC, - GAUSS_NEWTON_GENERIC, - EXACT_HESSIAN_CN2, - EXACT_HESSIAN_QPDUNES -}; - -/** Factory for creation of exported NLP/OCP solvers. */ -typedef ExportAlgorithmFactory NLPSolverFactory; - -/** Shared pointer to an NLP solver. */ -typedef std::shared_ptr< ExportNLPSolver > ExportNLPSolverPtr; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_qpdunes_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_qpdunes_interface.hpp deleted file mode 100644 index d844f388c0..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_qpdunes_interface.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_qpdunes_interface.hpp - * \author Milan Vukov - * \date 2013 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_QPDUNES_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_QPDUNES_INTERFACE_HPP - - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Interface generator for the qpDUNES QP solver - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportQpDunesInterface : public ExportTemplatedFile -{ -public: - /** Default constructor. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentstd::string std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportQpDunesInterface( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportQpDunesInterface( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const unsigned _maxIter, - const unsigned _printLevel, - const std::string& _HH, - const std::string& _g, - const std::string& _gN, - const std::string& _CC, - const std::string& _c, - const std::string& _DD, - const std::string& _lb0, - const std::string& _ub0, - const std::string& _lb, - const std::string& _ub, - const std::string& _lbA, - const std::string& _ubA, - const std::string& _primal, - const std::string& _lambda, - const std::string& _mu, - const std::vector< unsigned >& conDim, - const std::string& _initialStateFixed, - const std::string& _diagH, - const std::string& _diagHN, - const unsigned _NI, - const unsigned _NX, - const unsigned _NU - ); -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_QPDUNES_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_qpoases3_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_qpoases3_interface.hpp deleted file mode 100644 index e3bb710a93..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_qpoases3_interface.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_qpoases3_interface.hpp - * \author Milan Vukov, Joachim Ferreau - * \date 2012 - 2015 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_QPOASES3_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_QPOASES3_INTERFACE_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating the glue code for interfacing qpOASES. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - * - * \note Based on code originally developed by Hans Joachim Ferreau and Boris Houska. - */ -class ExportQpOases3Interface : public ExportQpOasesInterface -{ -public: - - /** Default constructor. - * - * @param[in] _headerFileName Name of exported file for header file. - * @param[in] _sourceFileName Name of exported file for source file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportQpOases3Interface( const std::string& _headerFileName, - const std::string& _sourceFileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportQpOases3Interface() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue configure( const std::string& _prefix, - const std::string& _solverDefine, - const int nvmax, - const int ncmax, - const int nwsrmax, - const std::string& _printLevel, - bool _useSinglePrecision, - - const std::string& _commonHeader, - const std::string& _namespace, - const std::string& _primalSolution, - const std::string& _dualSolution, - const std::string& _sigma, - bool _hotstartQP, - bool _externalCholesky, - const std::string& _qpH, - const std::string& _qpR, - const std::string& _qpg, - const std::string& _qpA, - const std::string& _qplb, - const std::string& _qpub, - const std::string& _qplbA, - const std::string& _qpubA - ); - - /** Export the interface. */ - virtual returnValue exportCode(); - -protected: - -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_QPOASES3_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_qpoases_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_qpoases_interface.hpp deleted file mode 100644 index 5bd0be44a3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_qpoases_interface.hpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_qpoases_interface.hpp - * \author Milan Vukov - * \date 2012 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_QPOASES_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_QPOASES_INTERFACE_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating the glue code for interfacing qpOASES. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - * - * \note Based on code originally developed by Hans Joachim Ferreau and Boris Houska. - */ -class ExportQpOasesInterface -{ -public: - - /** Default constructor. - * - * @param[in] _headerFileName Name of exported file for header file. - * @param[in] _sourceFileName Name of exported file for source file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportQpOasesInterface( const std::string& _headerFileName, - const std::string& _sourceFileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportQpOasesInterface() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue configure( const std::string& _prefix, - const std::string& _solverDefine, - const int nvmax, - const int ncmax, - const int nwsrmax, - const std::string& _printLevel, - bool _useSinglePrecision, - const std::string& _commonHeader, - const std::string& _namespace, - const std::string& _primalSolution, - const std::string& _dualSolution, - const std::string& _sigma, - bool _hotstartQP, - bool _externalCholesky, - const std::string& _qpH, - const std::string& _qpR, - const std::string& _qpg, - const std::string& _qpA, - const std::string& _qplb, - const std::string& _qpub, - const std::string& _qplbA, - const std::string& _qpubA - ); - - /** Export the interface. */ - virtual returnValue exportCode(); - -protected: - - ExportTemplatedFile qpoHeader; - ExportTemplatedFile qpoSource; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_QPOASES_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_simulink_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_simulink_interface.hpp deleted file mode 100644 index b336c33bca..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_simulink_interface.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_simulink_interface.hpp - * \author Milan Vukov - * \date 2013 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_SIMULINK_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_SIMULINK_INTERFACE_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating the glue code and makefile - * for interfacing generated code and Simulink. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportSimulinkInterface -{ -public: - - /** Default constructor. - * - * @param[in] _moduleName Module name for customization. - * @param[in] _modulePrefix Module prefix for customization. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportSimulinkInterface( const std::string& _makefileName, - const std::string& _wrapperHeaderFileName, - const std::string& _wrapperSourceFileName, - const std::string& _moduleName = "acado", - const std::string& _modulePrefix = "ACADO", - const std::string& _commonHeaderName = "", - const std::string& _realString = "double", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportSimulinkInterface() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( unsigned N, - unsigned NX, - unsigned NDX, - unsigned NXA, - unsigned NU, - unsigned NP, - unsigned NY, - unsigned NYN, - bool _initialStateFixed, - unsigned _wMatrixType, - bool _hardcodedConstraints, - bool _useArrivalCost, - bool _compCovMatrix, - std::string _qpSolver - ); - - /** Export the interface. */ - returnValue exportCode(); - -private: - - ExportTemplatedFile makefile; - ExportTemplatedFile wrapperSource; - ExportTemplatedFile wrapperHeader; - std::string moduleName; - std::string modulePrefix; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_SIMULINK_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_split_qpdunes_interface.hpp b/phonelibs/acado/include/acado/code_generation/export_split_qpdunes_interface.hpp deleted file mode 100644 index 428f58ecd1..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_split_qpdunes_interface.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_split_qpdunes_interface.hpp - * \author Milan Vukov, Rien Quirynen - * \date 2013 - 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_SPLIT_QPDUNES_INTERFACE_HPP -#define ACADO_TOOLKIT_EXPORT_SPLIT_QPDUNES_INTERFACE_HPP - - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Interface generator for the qpDUNES QP solver - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportSplitQpDunesInterface : public ExportTemplatedFile -{ -public: - /** Default constructor. - * - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentstd::string std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportSplitQpDunesInterface( const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportSplitQpDunesInterface( ) - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const unsigned _maxIter, - const unsigned _printLevel, - const std::string& _HH, - const std::string& _g, - const std::string& _gN, - const std::string& _CC, - const std::string& _c, - const std::string& _DD, - const std::string& _lb0, - const std::string& _ub0, - const std::string& _lb, - const std::string& _ub, - const std::string& _lbA, - const std::string& _ubA, - const std::string& _primal, - const std::string& _lambda, - const std::string& _mu, - const std::vector< unsigned >& conDim, - const std::string& _initialStateFixed, - const std::string& _diagH, - const std::string& _diagHN, - const unsigned _NI, - const unsigned _NX, - const unsigned _NU - ); -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_SPLIT_QPDUNES_INTERFACE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_statement.hpp b/phonelibs/acado/include/acado/code_generation/export_statement.hpp deleted file mode 100644 index 2c137fd864..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_statement.hpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_statement.hpp - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2013 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_HPP -#define ACADO_TOOLKIT_EXPORT_STATEMENT_HPP - -#include - -#include - -BEGIN_NAMESPACE_ACADO - - -class ExportIndex; -class MemoryAllocator; - - -/** - * \brief Base class for all kind of statements to be exported by the code generation tool. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportStatement serves as a base class for all kind of statements to be exported - * by the code generation tool. - * - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Shared pointer to a statement. */ - typedef std::shared_ptr< ExportStatement > StatementPtr; - - /** A vector of shared pointer statements. */ - typedef std::vector< StatementPtr > StatementPtrArray; - - /** Shared pointer to a memory allocator */ - typedef std::shared_ptr< MemoryAllocator > MemoryAllocatorPtr; - - /** Default constructor. */ - ExportStatement( ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportStatement( const ExportStatement& arg - ); - - /** Destructor. */ - virtual ~ExportStatement( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportStatement& operator=( const ExportStatement& arg - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const = 0; - - - /** Exports data declaration of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the statement into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const = 0; - - /** Acquire an index. */ - virtual ExportStatement& acquire( ExportIndex& ) - { - return *this; - } - - /** Release an index. */ - virtual ExportStatement& release( const ExportIndex& ) - { - return *this; - } - - /** Set a memory allocator. */ - virtual ExportStatement& allocate( MemoryAllocatorPtr ) - { - return *this; - } - - - public: - static std::string fcnPrefix; - static std::string varPrefix; -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_STATEMENT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_statement_block.hpp b/phonelibs/acado/include/acado/code_generation/export_statement_block.hpp deleted file mode 100644 index 24dc03a685..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_statement_block.hpp +++ /dev/null @@ -1,312 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/code_generation/export_statement_block.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010-2013 - */ - - - -#ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP -#define ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP - - -#include -#include -#include - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportFunction; -class ExportAcadoFunction; -class ExportFunctionDeclaration; -class ExportVariable; -class ExportIndex; -class ExportDataDeclaration; - -/** - * \brief Allows to export code for a block of statements. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportStatementBlock allows to export code for a block of statements. - * - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ -class ExportStatementBlock : public ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /**< Default Constructor. - */ - ExportStatementBlock( ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportStatementBlock( const ExportStatementBlock& arg - ); - - /** Destructor. - */ - virtual ~ExportStatementBlock( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportStatementBlock& operator=( const ExportStatementBlock& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - - /** Adds a statement to the statement block. - * - * @param[in] _statement Statement to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addStatement( const ExportStatement& _statement - ); - - /** Adds a string statement to the statement block. - * - * @param[in] _statementString std::string statement to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addStatement( const std::string& _statementString - ); - - - /** Adds a function to the statement block. - * - * @param[in] _function Function to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addFunction( const ExportFunction& _function - ); - - - /** Adds a function call to the statement block. - * - * @param[in] _fName Name of function to be called. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addFunctionCall( const std::string& _fName, - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - /** Adds a function call to the statement block. - * - * @param[in] _f Function to be called. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addFunctionCall( const ExportFunction& _f, - const ExportArgument& _argument1 = emptyConstExportArgument, - const ExportArgument& _argument2 = emptyConstExportArgument, - const ExportArgument& _argument3 = emptyConstExportArgument, - const ExportArgument& _argument4 = emptyConstExportArgument, - const ExportArgument& _argument5 = emptyConstExportArgument, - const ExportArgument& _argument6 = emptyConstExportArgument, - const ExportArgument& _argument7 = emptyConstExportArgument, - const ExportArgument& _argument8 = emptyConstExportArgument, - const ExportArgument& _argument9 = emptyConstExportArgument - ); - - - /** Adds a variable declaration to the statement block. - * - * @param[in] _data Variable declaration to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addDeclaration( const ExportVariable& _data, - ExportStruct _dataStruct = ACADO_ANY - ); - - /** Adds an index declaration to the statement block. - * - * @param[in] _data Index declaration to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addDeclaration( const ExportIndex& _data, - ExportStruct _dataStruct = ACADO_ANY - ); - - /** Adds a function forward declaration to the statement block. - * - * @param[in] _f function forward declaration to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addDeclaration( const ExportFunction& _f - ); - - /** Adds a forward declaration of an ODE function to the statement block. - * - * @param[in] _f ODE function whose forward declaration is to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addDeclaration( const ExportAcadoFunction& _f - ); - - - /** Adds a line break to the statement block. - * - * @param[in] num Number of line breaks to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addLinebreak( uint num = 1 - ); - - /** Adds a comment to the statement block. - * - * @param[in] _comment Comment to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addComment( const std::string& _comment - ); - - /** Adds a comment preceded by a given number of blanks to the statement block. - * - * @param[in] _nBlanks Number of blanks. - * @param[in] _comment Comment to be added. - * - * \return SUCCESSFUL_RETURN - */ - returnValue addComment( uint _nBlanks, - const std::string& _comment - ); - - - /** Returns number of statement within statement block. - * - * \return Number of statement within statement block - */ - uint getNumStatements( ) const; - - - /** Exports data declaration of the statement block into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement block. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportDataDeclaration( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Exports source code of the statement block into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export statement block. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - /** Removes all statements to yield an empty statement block. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - /** Add a statement. */ - friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const ExportStatement& _statement); - - /** Add a string. */ - friend ExportStatementBlock& operator<<(ExportStatementBlock& _block, const std::string& _statement); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - // - // DATA MEMBERS: - // - protected: - - /** Array containing all statements of the statement block. */ - StatementPtrArray statements; -}; - - -CLOSE_NAMESPACE_ACADO - - - -#endif // ACADO_TOOLKIT_EXPORT_STATEMENT_BLOCK_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/code_generation/export_statement_string.hpp b/phonelibs/acado/include/acado/code_generation/export_statement_string.hpp deleted file mode 100644 index 17ebd1252a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_statement_string.hpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_statement_string.hpp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_STATEMENT_STRING_HPP -#define ACADO_TOOLKIT_EXPORT_STATEMENT_STRING_HPP - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export code writing a string. - * - * \ingroup AuxiliaryFunctionality - * - * The class ExportStatementstd::string allows to export code writing a string. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ExportStatementString : public ExportStatement -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor which optionally takes the string to be exported. - * - * @param[in] _statementstd::string std::string to be exported. - */ - ExportStatementString( const std::string& _statementString = std::string() - ); - - /** Destructor. - */ - virtual ~ExportStatementString( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportStatement* clone( ) const; - - - /** Exports source code of the string into given file. Its appearance can - * can be adjusted by various options. - * - * @param[in] stream Name of file to be used to export string. - * @param[in] _realSstring std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( std::ostream& stream, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - protected: - - std::string statementString; /**< std::string to be exported. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_STATEMENT_STRING_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/export_templated_file.hpp b/phonelibs/acado/include/acado/code_generation/export_templated_file.hpp deleted file mode 100644 index 79983f2e90..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_templated_file.hpp +++ /dev/null @@ -1,139 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_templated_file.hpp - * \author Milan Vukov - * \date 2012 - 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_TEMPLATED_FILE_HPP -#define ACADO_TOOLKIT_EXPORT_TEMPLATED_FILE_HPP - -#include - -#include - -BEGIN_NAMESPACE_ACADO - -class ExportQpOasesInterface; -class ExportSimulinkInterface; -class ExportAuxiliaryFunctions; - -/** - * \brief Allows export of template files. - * - * \ingroup AuxiliaryFunctionality - * - * \author Milan Vukov - */ -class ExportTemplatedFile : public ExportFile -{ -public: - - friend class ExportQpOasesInterface; - friend class ExportQpOases3Interface; - friend class ExportSimulinkInterface; - friend class ExportAuxiliaryFunctions; - friend class ExportHessianRegularization; - friend class ExportAuxiliarySimFunctions; - friend class OCPexport; - friend class SIMexport; - - /** Default constructor. - */ - ExportTemplatedFile( ); - - - /** Standard constructor. - * - * @param[in] _templateName Name of a template. - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - */ - ExportTemplatedFile( const std::string& _templateName, - const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportTemplatedFile( ) - {} - - - /** Default constructor. - * - * @param[in] _templateName Name of a template. - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( const std::string& _templateName, - const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue configure( ) - { - return fillTemplate( ); - } - -protected: - - /** Fill in the template. */ - returnValue fillTemplate( ); - /** Name of the template file. */ - std::string templateName; - /** Dictionary used to fill in the template file. */ - std::map< std::string, std::string > dictionary; - /** List of folders where templates are stored. */ - std::string folders; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_TEMPLATED_FILE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_variable.hpp b/phonelibs/acado/include/acado/code_generation/export_variable.hpp deleted file mode 100644 index 4117cb8c60..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_variable.hpp +++ /dev/null @@ -1,536 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_variable.hpp - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -#ifndef ACADO_TOOLKIT_EXPORT_VARIABLE_HPP -#define ACADO_TOOLKIT_EXPORT_VARIABLE_HPP - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -class ExportArithmeticStatement; -class ExportVariableInternal; - -/** - * \brief Defines a matrix-valued variable to be used for exporting code. - * - * \ingroup UserDataStructures - * - * The class ExportVariable defines a matrix-valued variable to be used for exporting - * code. Instances of this class can be used similar to usual DMatrix objects - * but offer additional functionality, e.g. they allow to export arithmetic - * expressions and they can be passed as argument to exported functions. By - * default, all entries of a ExportVariable are undefined, but each of its - * component can be set to a fixed value if known beforehand. - * - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -class ExportVariable : public ExportArgument -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - ExportVariable(); - - /** Constructor which takes the name, type string - * and dimensions of the variable. - * - * @param[in] _name Name of the argument. - * @param[in] _nRows Number of rows of the argument. - * @param[in] _nCols Number of columns of the argument. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - */ - ExportVariable( const std::string& _name, - uint _nRows, - uint _nCols, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string() - ); - - /** Constructor which takes the name and type string of the variable. - * Moreover, it initializes the variable with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - */ - ExportVariable( const std::string& _name, - const DMatrix& _data, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string(), - bool _isGiven = true - ); - - /** Constructor which takes the name and type string of the variable. - * Moreover, it initializes the variable with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data Shared pointer to DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - */ - ExportVariable( const std::string& _name, - const DMatrixPtr& _data, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string() - ); - - /** Constructor which takes the name and type string of the variable. - * Moreover, it initializes the variable with the dimensions of the matrix. - * - * @param[in] _nRows Name of the argument. - * @param[in] _nCols Name of the argument. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - */ - ExportVariable( unsigned _nRows, - unsigned _nCols, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string() - ); - - /** \name Constructor which converts a given matrix/vector/scalar into an ExportVariable. - * @{ */ - - template - ExportVariable( const Eigen::MatrixBase& _data - ) - { - simpleForward(DMatrix( _data )); - } - - ExportVariable( const double _data /**< Scalar used for initialization */ - ); - /** @} */ - - /** Destructor. - */ - virtual ~ExportVariable( ); - - ExportVariable clone() const; - - ExportVariableInternal* operator->(); - - const ExportVariableInternal* operator->() const; - - /** Initializes variable with given name, type string - * and dimensions of the variable. - * - * @param[in] _name Name of the argument. - * @param[in] _nRows Number of rows of the argument. - * @param[in] _nCols Number of columns of the argument. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - * - * \return Reference to initialized object - */ - ExportVariable& setup( const std::string& _name, - uint _nRows = 1, - uint _nCols = 1, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string() - ); - - /** Initializes variable with given name and type string of the variable. - * Moreover, the variable is initialized with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - * - * \return Reference to initialized object - */ - ExportVariable& setup( const std::string& _name, - const DMatrix& _data, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string(), - bool _isGiven = true - ); - - /** Returns value of given component. - * - * @param[in] rowIdx Row index of the component to be returned. - * @param[in] colIdx Column index of the component to be returned. - * - * \return SUCCESSFUL_RETURN - */ - double operator()( uint rowIdx, - uint colIdx - ) const; - - /** Returns value of given component. - * - * @param[in] totalIdx Memory location of the component to be returned. - * - * \return SUCCESSFUL_RETURN - */ - double operator()( uint totalIdx - ) const; - - /** Returns whether given component is set to zero. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to zero, \n - * false otherwise - */ - bool isZero( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns whether given component is set to one. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to one, \n - * false otherwise - */ - bool isOne( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns whether given component is set to a given value. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to a given value, \n - * false otherwise - */ - bool isGiven( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns whether all components of the variable are set to a given value. - * - * \return true iff all components of the variable are set to a given value, \n - * false otherwise - */ - bool isGiven( ) const; - - - /** Returns string containing the value of a given component. If its - * value is undefined, the string contains the address of the component. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return std::string containing the value of a given component - */ - const std::string get( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns number of rows of the variable. - * - * \return Number of rows of the variable - */ - virtual uint getNumRows( ) const; - - /** Returns number of columns of the variable. - * - * \return Number of columns of the variable - */ - virtual uint getNumCols( ) const; - - /** Returns total dimension of the variable. - * - * \return Total dimension of the variable - */ - virtual uint getDim( ) const; - - - /** Operator for adding two ExportVariables. - * - * @param[in] arg Variable to be added. - * - * \return Arithmetic statement containing the addition - */ - friend ExportArithmeticStatement operator+( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for subtracting an ExportVariable from another. - * - * @param[in] arg Variable to be subtracted. - * - * \return Arithmetic statement containing the subtraction - */ - friend ExportArithmeticStatement operator-( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for add-assigning an ExportVariable to another. - * - * @param[in] arg Variable to be add-assigned. - * - * \return Arithmetic statement containing the add-assignment - */ - friend ExportArithmeticStatement operator+=( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for subtract-assigning an ExportVariables from another. - * - * @param[in] arg Variable to be subtract-assigned. - * - * \return Arithmetic statement containing the subtract-assignment - */ - friend ExportArithmeticStatement operator-=( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for multiplying two ExportVariables. - * - * @param[in] arg Variable to be multiplied from the right. - * - * \return Arithmetic statement containing the multiplication - */ - friend ExportArithmeticStatement operator*( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for multiplying an ExportVariable to the transposed on another. - * - * @param[in] arg Variable to be multiplied from the right. - * - * \return Arithmetic statement containing the multiplication with left-hand side variable transposed - */ - friend ExportArithmeticStatement operator^( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for assigning an ExportVariable to another. - * - * @param[in] arg Variable to be assined. - * - * \return Arithmetic statement containing the assignment - */ - friend ExportArithmeticStatement operator==( const ExportVariable& arg1, - const ExportVariable& arg2 - ); - - /** Operator for assigning an arithmetic statement to an ExportVariable. - * - * @param[in] arg Arithmetic statement to be assigned. - * - * \return Arithmetic statement containing the assignment - */ - ExportArithmeticStatement operator==( ExportArithmeticStatement arg - ) const; - - /** Operator for adding an arithmetic statement to an ExportVariable. - * - * @param[in] arg Arithmetic statement to be added. - * - * \return Arithmetic statement containing the addition - */ - ExportArithmeticStatement operator+( ExportArithmeticStatement arg - ) const; - - /** Operator for subtraction an arithmetic statement from an ExportVariable. - * - * @param[in] arg Arithmetic statement to be subtracted. - * - * \return Arithmetic statement containing the subtraction - */ - ExportArithmeticStatement operator-( ExportArithmeticStatement arg - ) const; - - /** Operator for add-assigning an arithmetic statement to an ExportVariable. - * - * @param[in] arg Arithmetic statement to be add-assigned. - * - * \return Arithmetic statement containing the add-assignment - */ - ExportArithmeticStatement operator+=( ExportArithmeticStatement arg - ) const; - - /** Operator for subtract-assigning an arithmetic statement from an ExportVariable. - * - * @param[in] arg Arithmetic statement to be subtract-assigned. - * - * \return Arithmetic statement containing the subtract-assignment - */ - ExportArithmeticStatement operator-=( ExportArithmeticStatement arg - ) const; - - /** Returns a copy of the variable with transposed components. - * - * \return Copy of the variable with transposed components - */ - ExportVariable getTranspose( ) const; - - /** Returns a new variable containing only the given row of the variable. - * - * @param[in] idx Variable row index. - * - * \return New variable containing only the given row of the variable - */ - ExportVariable getRow( const ExportIndex& idx - ) const; - - /** Returns a new variable containing only the given column of the variable. - * - * @param[in] idx Variable column index. - * - * \return New variable containing only the given column of the variable - */ - ExportVariable getCol( const ExportIndex& idx - ) const; - - /** Returns a new variable containing only the given rows of the variable. - * - * @param[in] idx1 Variable index of first row of new variable. - * @param[in] idx2 Variable index following last row of new variable. - * - * \return New variable containing only the given rows of the variable - */ - ExportVariable getRows( const ExportIndex& idx1, - const ExportIndex& idx2 - ) const; - - /** Returns a new variable containing only the given columns of the variable. - * - * @param[in] idx1 Variable index of first column of new variable. - * @param[in] idx2 Variable index following last column of new variable. - * - * \return New variable containing only the given columns of the variable - */ - ExportVariable getCols( const ExportIndex& idx1, - const ExportIndex& idx2 - ) const; - - /** Returns a new variable containing only the given rows and columns of the variable. - * - * @param[in] rowIdx1 Variable index of first row of new variable. - * @param[in] rowIdx2 Variable index following last row of new variable. - * @param[in] colIdx1 Variable index of first column of new variable. - * @param[in] colIdx2 Variable index following last column of new variable. - * - * \return New variable containing only the given sub-matrix of the variable - */ - ExportVariable getSubMatrix( const ExportIndex& rowIdx1, - const ExportIndex& rowIdx2, - const ExportIndex& colIdx1, - const ExportIndex& colIdx2 - ) const; - - /** Returns element at position (rowIdx, colIdx). - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return Element at position (rowIdx, colIdx) - */ - ExportVariable getElement( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns a copy of the variable that is transformed to a row vector. - * - * \return Copy of the variable that is transformed to a row vector - */ - ExportVariable makeRowVector( ) const; - - /** Returns a copy of the variable that is transformed to a column vector. - * - * \return Copy of the variable that is transformed to a column vector - */ - ExportVariable makeColVector( ) const; - - - /** Returns whether variable is a vector. - * - * \return true iff variable is a vector, \n - * false otherwise - */ - bool isVector( ) const; - - - /** Returns the internal data matrix. - * - * \return Internal data matrix - */ - const DMatrix& getGivenMatrix( ) const; - - /** Check whether the matrix is actually a submatrix. */ - bool isSubMatrix() const; - - /** Check whether the matrix is diagonal. */ - bool isDiagonal() const; - - /** Prints contents of variable to screen. - * - * \return SUCCESSFUL_RETURN - */ - returnValue print( ) const; - - private: - void simpleForward(const DMatrix& _value); -}; - -static const ExportVariable emptyConstExportVariable; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_VARIABLE_HPP diff --git a/phonelibs/acado/include/acado/code_generation/export_variable_internal.hpp b/phonelibs/acado/include/acado/code_generation/export_variable_internal.hpp deleted file mode 100644 index 5f546c40a0..0000000000 --- a/phonelibs/acado/include/acado/code_generation/export_variable_internal.hpp +++ /dev/null @@ -1,349 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/export_variable.hpp - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_VARIABLE_INTERNAL_HPP -#define ACADO_TOOLKIT_EXPORT_VARIABLE_INTERNAL_HPP - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -class ExportArithmeticStatement; - - -/** - * \brief Defines a matrix-valued variable to be used for exporting code. - * - * \ingroup UserDataStructures - * - * The class ExportVariableInternal defines a matrix-valued variable to be used for exporting - * code. Instances of this class can be used similar to usual DMatrix objects - * but offer additional functionality, e.g. they allow to export arithmetic - * expressions and they can be passed as argument to exported functions. By - * default, all entries of a ExportVariableInternal are undefined, but each of its - * component can be set to a fixed value if known beforehand. - * - * \author Hans Joachim Ferreau, Boris Houska, Milan Vukov - */ - -class ExportVariableInternal : public ExportArgumentInternal -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ExportVariableInternal( ); - - /** Constructor which takes the name and type string of the variable. - * Moreover, it initializes the variable with the dimensions and the - * values of the given matrix. - * - * @param[in] _name Name of the argument. - * @param[in] _data DMatrix used for initialization. - * @param[in] _type Data type of the argument. - * @param[in] _dataStruct Global data struct to which the argument belongs to (if any). - * @param[in] _callByValue Flag indicating whether argument it to be called by value. - */ - ExportVariableInternal( const std::string& _name, - const DMatrixPtr& _data, - ExportType _type = REAL, - ExportStruct _dataStruct = ACADO_LOCAL, - bool _callItByValue = false, - const std::string& _prefix = std::string() - ); - - /** Destructor. - */ - virtual ~ExportVariableInternal( ); - - /** Clone constructor (deep copy). - * - * \return Pointer to cloned object. - */ - virtual ExportVariableInternal* clone() const; - - /** Returns whether given component is set to zero. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to zero, \n - * false otherwise - */ - bool isZero( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns whether given component is set to one. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to one, \n - * false otherwise - */ - bool isOne( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns whether given component is set to a given value. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return true iff given component is set to a given value, \n - * false otherwise - */ - bool isGiven( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - virtual bool isGiven() const; - - - /** Returns string containing the value of a given component. If its - * value is undefined, the string contains the address of the component. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * - * \return std::string containing the value of a given component - */ - const std::string get( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Returns number of rows of the variable. - * - * \return Number of rows of the variable - */ - virtual uint getNumRows( ) const; - - /** Returns number of columns of the variable. - * - * \return Number of columns of the variable - */ - virtual uint getNumCols( ) const; - - /** Returns total dimension of the variable. - * - * \return Total dimension of the variable - */ - virtual uint getDim( ) const; - - /** Returns a copy of the variable with transposed components. - * - * \return Copy of the variable with transposed components - */ - ExportVariable getTranspose( ) const; - - /** Returns a new variable containing only the given row of the variable. - * - * @param[in] idx Variable row index. - * - * \return New variable containing only the given row of the variable - */ - ExportVariable getRow( const ExportIndex& idx - ) const; - - /** Returns a new variable containing only the given column of the variable. - * - * @param[in] idx Variable column index. - * - * \return New variable containing only the given column of the variable - */ - ExportVariable getCol( const ExportIndex& idx - ) const; - - /** Returns a new variable containing only the given rows of the variable. - * - * @param[in] idx1 Variable index of first row of new variable. - * @param[in] idx2 Variable index following last row of new variable. - * - * \return New variable containing only the given rows of the variable - */ - ExportVariable getRows( const ExportIndex& idx1, - const ExportIndex& idx2 - ) const; - - /** Returns a new variable containing only the given columns of the variable. - * - * @param[in] idx1 Variable index of first column of new variable. - * @param[in] idx2 Variable index following last column of new variable. - * - * \return New variable containing only the given columns of the variable - */ - ExportVariable getCols( const ExportIndex& idx1, - const ExportIndex& idx2 - ) const; - - /** Returns a new variable containing only the given rows and columns of the variable. - * - * @param[in] rowIdx1 Variable index of first row of new variable. - * @param[in] rowIdx2 Variable index following last row of new variable. - * @param[in] colIdx1 Variable index of first column of new variable. - * @param[in] colIdx2 Variable index following last column of new variable. - * - * \return New variable containing only the given sub-matrix of the variable - */ - ExportVariable getSubMatrix( const ExportIndex& _rowIdx1, - const ExportIndex& _rowIdx2, - const ExportIndex& _colIdx1, - const ExportIndex& _colIdx2 - ) const; - - - /** Returns a copy of the variable that is transformed to a row vector. - * - * \return Copy of the variable that is transformed to a row vector - */ - ExportVariable makeRowVector( ) const; - - /** Returns a copy of the variable that is transformed to a column vector. - * - * \return Copy of the variable that is transformed to a column vector - */ - ExportVariable makeColVector( ) const; - - - /** Returns whether variable is a vector. - * - * \return true iff variable is a vector, \n - * false otherwise - */ - bool isVector( ) const; - - - /** Returns the internal data matrix. - * - * \return Internal data matrix - */ - const DMatrix& getGivenMatrix( ) const; - - - /** Prints contents of variable to screen. - * - * \return SUCCESSFUL_RETURN - */ - returnValue print( ) const; - - /** Check whether the matrix is actually a submatrix. */ - bool isSubMatrix() const; - - /** Check whether the matrix is diagonal. */ - bool isDiagonal() const; - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Returns column dimension of the variable. - * - * \return Column dimension of the variable - */ - virtual uint getColDim( ) const; - - /** Returns total index of given component within memory. - * - * @param[in] rowIdx Row index of the component. - * @param[in] colIdx Column index of the component. - * - * \return Total index of given component - */ - virtual ExportIndex getTotalIdx( const ExportIndex& rowIdx, - const ExportIndex& colIdx - ) const; - - /** Assigns offsets and dimensions of a sub-matrix. This function is used to - * access only a sub-matrix of the variable without copying its values to - * a new variable. - * - * @param[in] _rowOffset Variable index of first row of sub-matrix. - * @param[in] _colOffset Variable index of first column of sub-matrix. - * @param[in] _rowDim Row dimension of variable (as only the submatrix data is stored). - * @param[in] _colDim Column dimension of variable (as only the submatrix data is stored). - * @param[in] _nRows Number of rows of sub-matrix. - * @param[in] _nCols Number of columns of sub-matrix. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_ARGUMENTS - */ - returnValue setSubmatrixOffsets( const ExportIndex& _rowOffset, - const ExportIndex& _colOffset, - unsigned _rowDim = 0, - unsigned _colDim = 0, - unsigned _nRows = 0, - unsigned _nCols = 0 - ); - - - /** Returns whether given component is set to given value. - * - * @param[in] rowIdx Variable row index of the component. - * @param[in] colIdx Variable column index of the component. - * @param[in] _value Value used for comparison. - * - * \return true iff given component is set to given value, \n - * false otherwise - */ - bool hasValue( const ExportIndex& _rowIdx, - const ExportIndex& _colIdx, - double _value - ) const; - - protected: - - bool doAccessTransposed; /**< Flag indicating whether variable is to be accessed in a transposed manner. */ - - ExportIndex rowOffset; /**< Index of first row of a possible sub-matrix of the variable. */ - ExportIndex colOffset; /**< Index of first column of a possible sub-matrix of the variable. */ - unsigned rowDim; /**< Row dimension of variable (as only the submatrix data is stored). */ - unsigned colDim; /**< Column dimension of variable (as only the submatrix data is stored). */ - unsigned nRows; /**< Number of rows of a possible sub-matrix of the variable. */ - unsigned nCols; /**< Number of columns of a possible sub-matrix of the variable. */ -}; - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_VARIABLE_INTERNAL_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/dirk3_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/dirk3_export.hpp deleted file mode 100644 index 1626691ed1..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/dirk3_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/dirk3_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_DIRK3_EXPORT_HPP -#define ACADO_TOOLKIT_DIRK3_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored diagonally implicit 2-stage Runge-Kutta method of order 3 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class DiagonallyIRK3Export allows to export a tailored diagonally implicit 2-stage Runge-Kutta method of order 3 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class DiagonallyIRK3Export : public DiagonallyImplicitRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - DiagonallyIRK3Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiagonallyIRK3Export( const DiagonallyIRK3Export& arg - ); - - /** Destructor. - */ - virtual ~DiagonallyIRK3Export( ); - - protected: - -}; - -IntegratorExport* createDiagonallyIRK3Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_DIRK3_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/dirk4_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/dirk4_export.hpp deleted file mode 100644 index 0ba1820c31..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/dirk4_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/dirk4_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_DIRK4_EXPORT_HPP -#define ACADO_TOOLKIT_DIRK4_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored diagonally implicit 3-stage Runge-Kutta method of order 4 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class DiagonallyIRK4Export allows to export a tailored diagonally implicit 3-stage Runge-Kutta method of order 4 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class DiagonallyIRK4Export : public DiagonallyImplicitRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - DiagonallyIRK4Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiagonallyIRK4Export( const DiagonallyIRK4Export& arg - ); - - /** Destructor. - */ - virtual ~DiagonallyIRK4Export( ); - - protected: - -}; - -IntegratorExport* createDiagonallyIRK4Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_DIRK4_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/dirk5_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/dirk5_export.hpp deleted file mode 100644 index f612991786..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/dirk5_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/dirk5_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_DIRK5_EXPORT_HPP -#define ACADO_TOOLKIT_DIRK5_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored diagonally implicit 5-stage Runge-Kutta method of order 5 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class DiagonallyIRK5Export allows to export a tailored diagonally implicit 5-stage Runge-Kutta method of order 5 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class DiagonallyIRK5Export : public DiagonallyImplicitRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - DiagonallyIRK5Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiagonallyIRK5Export( const DiagonallyIRK5Export& arg - ); - - /** Destructor. - */ - virtual ~DiagonallyIRK5Export( ); - - protected: - -}; - -IntegratorExport* createDiagonallyIRK5Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_DIRK5_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/dirk_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/dirk_export.hpp deleted file mode 100644 index 29273394a5..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/dirk_export.hpp +++ /dev/null @@ -1,308 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/dirk_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_DIRK_EXPORT_HPP -#define ACADO_TOOLKIT_DIRK_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored diagonally implicit Runge-Kutta integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class DiagonallyImplicitRKExport allows to export a tailored diagonally implicit Runge-Kutta integrator - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class DiagonallyImplicitRKExport : public ForwardIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - DiagonallyImplicitRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiagonallyImplicitRKExport( const DiagonallyImplicitRKExport& arg - ); - - /** Destructor. - */ - virtual ~DiagonallyImplicitRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiagonallyImplicitRKExport& operator=( const DiagonallyImplicitRKExport& arg - ); - - - /** Exports the code needed to solve the system of collocation equations for the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] A1 A constant matrix defining the equations of the linear input system. - * @param[in] B1 A constant matrix defining the equations of the linear input system. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportVariable& Ah ); - - - /** Precompute as much as possible for the linear input system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareInputSystem( ExportStatementBlock& code ); - - - /** Exports the code needed to solve the system of collocation equations for the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] A3 A constant matrix defining the equations of the linear output system. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportVariable& Ah, - bool DERIVATIVES = false ); - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& index4, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - bool STATES, - uint number ); - - - /** Precompute as much as possible for the linear output system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareOutputSystem( ExportStatementBlock& code ); - - - /** Forms a constant linear system matrix for the collocation equations, given a constant jacobian and mass matrix. - * - * @param[in] jacobian given constant Jacobian matrix - * @param[in] mass given constant mass matrix - * - * \return SUCCESSFUL_RETURN - */ - virtual DMatrix formMatrix( const DMatrix& mass, const DMatrix& jacobian ); - - - /** Exports the code needed to solve the system of collocation equations for the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportVariable& det, - bool DERIVATIVES = false ); - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - const ExportVariable& det, - bool STATES, - uint number ); - - - /** Exports the evaluation of the matrix of the linear system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index1 The loop index of the outer loop. - * @param[in] index2 The loop index of the inner loop. - * @param[in] tmp_index A temporary index to be used. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] evaluateB True if the right-hand side of the linear system should also be evaluated, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateMatrix( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index, - const ExportVariable& _rk_A, - const ExportVariable& Ah, - const ExportVariable& C, - bool evaluateB, - bool DERIVATIVES ); - - - /** Exports the evaluation of the states at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateStatesImplicitSystem( ExportStatementBlock* block, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& j ); - - - /** Exports the evaluation of the right-hand side of the linear system at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateRhsImplicitSystem( ExportStatementBlock* block, - const ExportIndex& stage ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - protected: - - - - protected: - - -}; - - -// -// Create the integrator -// -inline DiagonallyImplicitRKExport* createDiagonallyImplicitRKExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName ) -{ - int sensGen; - _userInteraction->get( DYNAMIC_SENSITIVITY, sensGen ); - if ( (ExportSensitivityType)sensGen == FORWARD ) { - return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName); - } - else { - ACADOERROR( RET_INVALID_OPTION ); - return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName); - } -} - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_DIRK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/discrete_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/discrete_export.hpp deleted file mode 100644 index 5c2296d38b..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/discrete_export.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/discrete_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_DT_EXPORT_HPP -#define ACADO_TOOLKIT_DT_EXPORT_HPP - -#include - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored discrete-time 'integrator' for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class DiscreteTimeExport allows to export a tailored discrete-time 'integrator' - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class DiscreteTimeExport : public IntegratorExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - DiscreteTimeExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiscreteTimeExport( const DiscreteTimeExport& arg - ); - - /** Destructor. - */ - virtual ~DiscreteTimeExport( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - DiscreteTimeExport& operator=( const DiscreteTimeExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Sets a polynomial NARX model to be used by the integrator. - * - * @param[in] delay The delay for the states in the NARX model. - * @param[in] parms The parameters defining the polynomial NARX model. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setNARXmodel( const uint delay, const DMatrix& parms ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param rhs The expressions corresponding the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector rhs ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \param _outputDependencies A separate dependency matrix for each output. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output, - const std::vector _outputDependencies ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - - protected: - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - /** Copies all class members from given object. - * - * @param[in] arg Right-hand side object. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue copy( const DiscreteTimeExport& arg - ); - - - protected: - - ExportVariable rk_diffsTemp3; - -}; - -IntegratorExport* createDiscreteTimeExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName ); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_DT_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk2_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk2_export.hpp deleted file mode 100644 index 92f261dd56..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk2_export.hpp +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/erk2_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_ERK2_EXPORT_HPP -#define ACADO_TOOLKIT_ERK2_EXPORT_HPP - -#include - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator of order 2 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ExplicitRungeKutta2Export allows to export a tailored explicit Runge-Kutta integrator of order 2 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ExplicitRungeKutta2Export : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExplicitRungeKutta2Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExplicitRungeKutta2Export( const ExplicitRungeKutta2Export& arg - ); - - /** Destructor. - */ - virtual ~ExplicitRungeKutta2Export( ); - - protected: - -}; - -IntegratorExport* createExplicitRungeKutta2Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_ERK2_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk3_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk3_export.hpp deleted file mode 100644 index 6e03571601..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk3_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/erk3_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_ERK3_EXPORT_HPP -#define ACADO_TOOLKIT_ERK3_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator of order 3 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ExplicitRungeKutta3Export allows to export a tailored explicit Runge-Kutta integrator of order 3 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ExplicitRungeKutta3Export : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExplicitRungeKutta3Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExplicitRungeKutta3Export( const ExplicitRungeKutta3Export& arg - ); - - /** Destructor. - */ - virtual ~ExplicitRungeKutta3Export( ); - - protected: - -}; - -IntegratorExport* createExplicitRungeKutta3Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ERK3_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk4_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk4_export.hpp deleted file mode 100644 index 3fca378ada..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk4_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/erk4_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_ERK4_EXPORT_HPP -#define ACADO_TOOLKIT_ERK4_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator of order 4 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ExplicitRungeKutta4Export allows to export a tailored explicit Runge-Kutta integrator of order 4 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ExplicitRungeKutta4Export : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExplicitRungeKutta4Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExplicitRungeKutta4Export( const ExplicitRungeKutta4Export& arg - ); - - /** Destructor. - */ - virtual ~ExplicitRungeKutta4Export( ); - - protected: - -}; - -IntegratorExport* createExplicitRungeKutta4Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ERK4_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk_3sweep_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk_3sweep_export.hpp deleted file mode 100644 index 035e5c8ea9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk_3sweep_export.hpp +++ /dev/null @@ -1,146 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrators/erk_3sweep_export.hpp - * \author Rien Quirynen - * \date 2014 - */ - - -#ifndef ACADO_TOOLKIT_ERK_3SWP_EXPORT_HPP -#define ACADO_TOOLKIT_ERK_3SWP_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator with three-sweeps second order sensitivity propagation for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ThreeSweepsERKExport allows to export a tailored explicit Runge-Kutta integrator with three-sweeps second order sensitivity propagation - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ThreeSweepsERKExport : public AdjointERKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ThreeSweepsERKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ThreeSweepsERKExport( const ThreeSweepsERKExport& arg - ); - - /** Destructor. - */ - virtual ~ThreeSweepsERKExport( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - Expression returnLowerTriangular( const Expression& expr ); - - Expression symmetricDoubleProduct( const Expression& expr, const Expression& arg ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - protected: - - ExportAcadoFunction diffs_sweep3; /**< Module to export ODE. */ - ExportVariable rk_backward_sweep; /**< Variable containing intermediate results of a backward sweep of the RK integrator. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ERK_3SWP_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk_adjoint_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk_adjoint_export.hpp deleted file mode 100644 index 4c7d55233b..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk_adjoint_export.hpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrators/erk_adjoint_export.hpp - * \author Rien Quirynen - * \date 2014 - */ - - -#ifndef ACADO_TOOLKIT_ERK_ADJOINT_EXPORT_HPP -#define ACADO_TOOLKIT_ERK_ADJOINT_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator with adjoint first order sensitivity propagation for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class AdjointERKExport allows to export a tailored explicit Runge-Kutta integrator with adjoint first order sensitivity propagation - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class AdjointERKExport : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - AdjointERKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - AdjointERKExport( const AdjointERKExport& arg - ); - - /** Destructor. - */ - virtual ~AdjointERKExport( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - protected: - - ExportVariable rk_forward_sweep; /**< Variable containing intermediate results of a forward sweep of the RK integrator. */ -// ExportVariable seed_backward; /**< Variable containing the seed for a backward propagation of the RK integrator. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ERK_ADJOINT_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk_export.hpp deleted file mode 100644 index b74cd6d0b6..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk_export.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrators/erk_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_ERK_EXPORT_HPP -#define ACADO_TOOLKIT_ERK_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ExplicitRungeKuttaExport allows to export a tailored explicit Runge-Kutta integrator - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ExplicitRungeKuttaExport : public RungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExplicitRungeKuttaExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExplicitRungeKuttaExport( const ExplicitRungeKuttaExport& arg - ); - - /** Destructor. - */ - virtual ~ExplicitRungeKuttaExport( ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearInput( const DMatrix& M1, const DMatrix& A1, const DMatrix& B1 ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const Expression& rhs ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const std::string& _rhs3, const std::string& _diffs_rhs3 ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param rhs The expressions corresponding the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector rhs ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \param _outputDependencies A separate dependency matrix for each output. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output, - const std::vector _outputDependencies ); - - - protected: - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - virtual ExportVariable getAuxVariable() const; - - - protected: - - -}; - -CLOSE_NAMESPACE_ACADO - - -#include -#include -#include -#include -#include - - -#endif // ACADO_TOOLKIT_ERK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk_export.ipp b/phonelibs/acado/include/acado/code_generation/integrators/erk_export.ipp deleted file mode 100644 index 3c8e7dc420..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk_export.ipp +++ /dev/null @@ -1,73 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/erk_export.ipp - * \author Rien Quirynen - * \date 2014 - */ - - -BEGIN_NAMESPACE_ACADO - - -// -// Create the integrator -// -inline ExplicitRungeKuttaExport* createExplicitRungeKuttaExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName ) -{ - int sensGen; - _userInteraction->get( DYNAMIC_SENSITIVITY, sensGen ); - int liftedGen; - _userInteraction->get( IMPLICIT_INTEGRATOR_MODE, liftedGen ); - if ( (ImplicitIntegratorMode)liftedGen == LIFTED && ((ExportSensitivityType)sensGen == FORWARD || (ExportSensitivityType)sensGen == INEXACT) ) { - return new LiftedERKExport(_userInteraction, _commonHeaderName); - } - else if ( (ExportSensitivityType)sensGen == FORWARD || (ExportSensitivityType)sensGen == NO_SENSITIVITY ) { - return new ExplicitRungeKuttaExport(_userInteraction, _commonHeaderName); - } - else if( (ExportSensitivityType)sensGen == BACKWARD ) { - return new AdjointERKExport(_userInteraction, _commonHeaderName); - } - else if( (ExportSensitivityType)sensGen == FORWARD_OVER_BACKWARD || (ExportSensitivityType)sensGen == SYMMETRIC_FB ) { - return new ForwardOverBackwardERKExport(_userInteraction, _commonHeaderName); - } - else if( (ExportSensitivityType)sensGen == SYMMETRIC ) { - return new ThreeSweepsERKExport(_userInteraction, _commonHeaderName); - } - else { - ACADOERROR( RET_INVALID_OPTION ); - return new ExplicitRungeKuttaExport(_userInteraction, _commonHeaderName); - } -} - - -CLOSE_NAMESPACE_ACADO - - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/erk_fob_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/erk_fob_export.hpp deleted file mode 100644 index f4e9aba520..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/erk_fob_export.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrators/erk_fob_export.hpp - * \author Rien Quirynen - * \date 2014 - */ - - -#ifndef ACADO_TOOLKIT_ERK_FOB_EXPORT_HPP -#define ACADO_TOOLKIT_ERK_FOB_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator with forward-over-backward second order sensitivity propagation for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ForwardOverBackwardERKExport allows to export a tailored explicit Runge-Kutta integrator with forward-over-backward second order sensitivity propagation - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ForwardOverBackwardERKExport : public AdjointERKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ForwardOverBackwardERKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardOverBackwardERKExport( const ForwardOverBackwardERKExport& arg - ); - - /** Destructor. - */ - virtual ~ForwardOverBackwardERKExport( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - protected: - - Expression returnLowerTriangular( const Expression& expr ); - - - protected: - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_ERK_FOB_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/explicit_euler_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/explicit_euler_export.hpp deleted file mode 100644 index c15999d2b3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/explicit_euler_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/explicit_euler_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_EXPLICIT_EULER_EXPORT_HPP -#define ACADO_TOOLKIT_EXPLICIT_EULER_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Euler method for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ExplicitEulerExport allows to export a tailored explicit Euler method - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ExplicitEulerExport : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExplicitEulerExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExplicitEulerExport( const ExplicitEulerExport& arg - ); - - /** Destructor. - */ - virtual ~ExplicitEulerExport( ); - - protected: - -}; - -IntegratorExport* createExplicitEulerExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPLICIT_EULER_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/export_auxiliary_sim_functions.hpp b/phonelibs/acado/include/acado/code_generation/integrators/export_auxiliary_sim_functions.hpp deleted file mode 100644 index 73fd8f1e8d..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/export_auxiliary_sim_functions.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/integrators/export_auxiliary_sim_functions.hpp - * \author Rien Quirynen - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_AUXILIARY_SIM_FUNCTIONS_HPP -#define ACADO_TOOLKIT_EXPORT_AUXILIARY_SIM_FUNCTIONS_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief A class for generating some helper functions. - * - * \ingroup AuxiliaryFunctionality - * - * \author Rien Quirynen - */ -class ExportAuxiliarySimFunctions -{ -public: - - /** Default constructor. - * - * @param[in] _moduleName Module name for customization. - * @param[in] _modulePrefix Module prefix for customization. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportAuxiliarySimFunctions( const std::string& _headerFileName, - const std::string& _sourceFileName, - const std::string& _moduleName = "acado", - const std::string& _modulePrefix = "ACADO", - const std::string& _commonHeaderName = "", - const std::string& _realString = "double", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = std::string() - ); - - /** Destructor. */ - virtual ~ExportAuxiliarySimFunctions() - {} - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( ); - - /** Export the interface. */ - returnValue exportCode(); - -private: - - ExportTemplatedFile source; - ExportTemplatedFile header; - std::string moduleName; - std::string modulePrefix; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_AUXILIARY_SIM_FUNCTIONS_HPP diff --git a/phonelibs/acado/include/acado/code_generation/integrators/export_matlab_integrator.hpp b/phonelibs/acado/include/acado/code_generation/integrators/export_matlab_integrator.hpp deleted file mode 100644 index 64aa272155..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/export_matlab_integrator.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file ... - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_MATLAB_INTEGRATOR_HPP -#define ACADO_TOOLKIT_EXPORT_MATLAB_INTEGRATOR_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief ... - * - * \ingroup ... - * - * \author Rien Quirynen - */ -class ExportMatlabIntegrator : public ExportTemplatedFile -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _templateName Name of a template. - * @param[in] _fileName Name of exported file. - * @param[in] _commonHeaderName Name of common header file to be included. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * @param[in] _commentString std::string to be used for exporting comments. - * - * \return SUCCESSFUL_RETURN - */ - ExportMatlabIntegrator( const std::string& _templateName, - const std::string& _fileName, - const std::string& _commonHeaderName = "", - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16, - const std::string& _commentString = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportMatlabIntegrator( const ExportMatlabIntegrator& arg - ); - - /** Destructor. - */ - virtual ~ExportMatlabIntegrator( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ExportMatlabIntegrator& operator=( const ExportMatlabIntegrator& arg - ); - - /** Configure the template - * - * \return SUCCESSFUL_RETURN - */ - returnValue configure( const uint firstOrder, const uint online, const uint debugMode, const uint timingCalls, const uint numStages ); - - protected: - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_MATLAB_INTEGRATOR_HPP diff --git a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre2_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre2_export.hpp deleted file mode 100644 index ec76d061fa..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre2_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/gauss_legendre2_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_GAUSS_LEG2_EXPORT_HPP -#define ACADO_TOOLKIT_GAUSS_LEG2_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Gauss-Legendre method of order 2 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class GaussLegendre2Export allows to export a tailored Gauss-Legendre method of order 2 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class GaussLegendre2Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - GaussLegendre2Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GaussLegendre2Export( const GaussLegendre2Export& arg - ); - - /** Destructor. - */ - virtual ~GaussLegendre2Export( ); - - protected: - -}; - -IntegratorExport* createGaussLegendre2Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_GAUSS_LEG2_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre4_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre4_export.hpp deleted file mode 100644 index b0c6aa9d97..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre4_export.hpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/gauss_legendre4_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_GAUSS_LEG4_EXPORT_HPP -#define ACADO_TOOLKIT_GAUSS_LEG4_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Gauss-Legendre method of order 4 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class GaussLegendre4Export allows to export a tailored Gauss-Legendre method of order 4 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class GaussLegendre4Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - GaussLegendre4Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GaussLegendre4Export( const GaussLegendre4Export& arg - ); - - /** Destructor. - */ - virtual ~GaussLegendre4Export( ); - - protected: - -}; - -IntegratorExport* createGaussLegendre4Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_GAUSS_LEG4_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre6_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre6_export.hpp deleted file mode 100644 index 37e9d0ca0b..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre6_export.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/gauss_legendre6_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_GAUSS_LEG6_EXPORT_HPP -#define ACADO_TOOLKIT_GAUSS_LEG6_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Gauss-Legendre method of order 6 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class GaussLegendre6Export allows to export a tailored Gauss-Legendre method of order 6 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class GaussLegendre6Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - GaussLegendre6Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GaussLegendre6Export( const GaussLegendre6Export& arg - ); - - /** Destructor. - */ - virtual ~GaussLegendre6Export( ); - - protected: - -}; - -IntegratorExport* createGaussLegendre6Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_GAUSS_LEG6_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre8_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre8_export.hpp deleted file mode 100644 index 3d3e042680..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/gauss_legendre8_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/gauss_legendre8_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_GAUSS_LEG8_EXPORT_HPP -#define ACADO_TOOLKIT_GAUSS_LEG8_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Gauss-Legendre method of order 8 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class GaussLegendre8Export allows to export a tailored Gauss-Legendre method of order 8 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class GaussLegendre8Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - GaussLegendre8Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - GaussLegendre8Export( const GaussLegendre8Export& arg - ); - - /** Destructor. - */ - virtual ~GaussLegendre8Export( ); - - protected: - -}; - -IntegratorExport* createGaussLegendre8Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_GAUSS_LEG6_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/integrator_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/integrator_export.hpp deleted file mode 100644 index 47b9a3aec1..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/integrator_export.hpp +++ /dev/null @@ -1,508 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/integrator_export.hpp - * \author Hans Joachim Ferreau, Boris Houska, Rien Quirynen - * \date 2010-2011 - */ - - -#ifndef ACADO_TOOLKIT_INTEGRATOR_EXPORT_HPP -#define ACADO_TOOLKIT_INTEGRATOR_EXPORT_HPP - -#include -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class IntegratorExport allows to export a tailored integrator - * for fast model predictive control. - * - * \author Hans Joachim Ferreau, Boris Houska, Rien Quirynen - */ -class IntegratorExport : public ExportAlgorithm -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - IntegratorExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - IntegratorExport( const IntegratorExport& arg - ); - - /** Destructor. - */ - virtual ~IntegratorExport( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - IntegratorExport& operator=( const IntegratorExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ) = 0; - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ) = 0; - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearInput( const DMatrix& M1, const DMatrix& A1, const DMatrix& B1 ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const Expression& rhs ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setNonlinearFeedback( const DMatrix& C, const Expression& feedb ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const std::string& _rhs3, const std::string& _diffs_rhs3 ); - - - /** Assigns the model to be used by the integrator. - * - * @param[in] _name_ODE Name of the function, evaluating the ODE right-hand side. - * @param[in] _name_diffs_ODE Name of the function, evaluating the derivatives of the ODE right-hand side. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setModel( const std::string& _name_ODE, - const std::string& _name_diffs_ODE ); - - - /** Sets a polynomial NARX model to be used by the integrator. - * - * @param[in] delay The delay for the states in the NARX model. - * @param[in] parms The parameters defining the polynomial NARX model. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setNARXmodel( const uint delay, const DMatrix& parms ) = 0; - - - /** Passes all the necessary model data to the integrator. - * - * @param[in] data The model data. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setModelData( const ModelData& data ); - - - /** Exports the code needed to update the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to update the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& _index3, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to update the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index ); - - - /** Sets integration grid (this grid is expected to be non equidistant, otherwise use the other setGrid function). - * - * @param[in] _grid integration grid - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setGrid( const Grid& _grid ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const = 0; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param rhs The expressions corresponding the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector rhs ) = 0; - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output ) = 0; - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \param _outputDependencies A separate dependency matrix for each output. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output, - const std::vector _outputDependencies ) = 0; - - - /** Returns the grid of the integrator. \n - * - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getGrid( Grid& grid_ ) const; - - - /** Returns the number of integration steps along the prediction horizon. \n - * - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getNumSteps( DVector& _numSteps ) const; - - - /** Returns the output expressions. \n - * - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getOutputExpressions( std::vector& outputExpressions_ ) const; - - - /** Returns the output grids. \n - * - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getOutputGrids( std::vector& outputGrids_ ) const; - - - /** Returns whether the grid is equidistant. \n - * - * \return true iff the grid is equidistant, false otherwise. \n - */ - virtual bool equidistantControlGrid( ) const; - - - const std::string getNameRHS() const; - const std::string getNameDiffsRHS() const; - virtual const std::string getNameFullRHS() const; - - const std::string getNameOutputRHS() const; - const std::string getNameOutputDiffs() const; - - const std::string getNameOUTPUT( uint index ) const; - const std::string getNameDiffsOUTPUT( uint index ) const; - uint getDimOUTPUT( uint index ) const; - - - - protected: - - - /** . - * - * @param[in] A3 . - * - * \return SUCCESSFUL_RETURN - */ - DMatrix expandOutputMatrix( const DMatrix& A3 ); - - - /** Copies all class members from given object. - * - * @param[in] arg Right-hand side object. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue copy( const IntegratorExport& arg - ); - - - /** Frees internal dynamic memory to yield an empty function. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue clear( ); - - - /** Get the index of the integration interval, corresponding a certain time. - * - * @param[in] time The time. - * - * \return The index of the integration interval. - */ - uint getIntegrationInterval( double time ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - virtual ExportVariable getAuxVariable() const = 0; - - - protected: - - uint NX1; - uint NX2; - uint NX3; - uint NDX3; - uint NXA3; - - uint diffsDim; /**< This is the total number of sensitivities needed. */ - uint inputDim; /**< This is the dimension of the input to the integrator. */ - - bool timeDependant; - - DMatrix M11, A11, B11; - DMatrix A33, M33; - - bool exportRhs; /**< True if the right-hand side and their derivatives should be exported too. */ - bool crsFormat; /**< True if the CRS format is used for the jacobian of output functions. */ - - Grid grid; /**< Evaluation grid along the prediction horizon. */ - DVector numSteps; /**< The number of integration steps per shooting interval. */ - - ExportFunction fullRhs; /**< Function that evaluates the full right-hand side. */ - ExportVariable rhs_in; - ExportVariable rhs_out; - - ExportFunction integrate; /**< Function that integrates the exported ODE. */ - ExportAcadoFunction rhs; /**< Module to export ODE. */ - ExportAcadoFunction diffs_rhs; /**< Module to export the evaluation of the derivatives of the ordinary differential equations. */ - - ExportAcadoFunction lin_input; - - ExportAcadoFunction rhs3; - ExportAcadoFunction diffs_rhs3; - - ExportVariable error_code; /**< Variable containing the error code, returned by the integrator. */ - ExportVariable reset_int; /**< Variable containing the number of the current integration step. */ - ExportVariable rk_index; /**< Variable containing the number of the current shooting interval. */ - ExportVariable rk_ttt; /**< Variable containing the integration time. */ - ExportVariable rk_xxx; /**< Variable containing the current integrator state. */ - ExportVariable rk_eta; /**< Variable containing the inputs or the results of the integrator. */ - - ExportVariable rk_diffsPrev1; - ExportVariable rk_diffsNew1; - - ExportVariable rk_diffsPrev2; /**< Variable containing the sensitivities from the previous integration step. */ - ExportVariable rk_diffsNew2; /**< Variable containing the derivatives wrt the previous values. */ - ExportVariable rk_diffsTemp2; /**< Variable containing intermediate results of evaluations of the derivatives of the differential equations (ordinary and algebraic). */ - - ExportVariable rk_diffsNew3; - ExportVariable rk_diffsPrev3; - - DifferentialState x; /**< The differential states in the model. */ - DifferentialStateDerivative dx; /**< The differential state derivatives in the model. */ - AlgebraicState z; /**< The algebraic states in the model. */ - Control u; /**< The control inputs in the model. */ - OnlineData od; /**< The "online" data values in the model. */ - - std::vector outputGrids; /**< A separate grid for each output. */ - std::vector outputExpressions; /**< A separate expression for each output. */ - std::vector outputDependencies; /**< A separate dependency matrix for each output. */ - std::vector outputs; /**< Module to export output functions. */ - std::vector diffs_outputs; /**< Module to export the evaluation of the derivatives of the output functions. */ - - std::vector num_outputs; /**< A separate dimension for each output. */ -}; - -/** Factory for creation of exported integrators.*/ -typedef ExportAlgorithmFactory IntegratorExportFactory; - -/** Shared pointer to an integrator. */ -typedef std::shared_ptr< IntegratorExport > IntegratorExportPtr; - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_INTEGRATOR_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/integrator_export_types.hpp b/phonelibs/acado/include/acado/code_generation/integrators/integrator_export_types.hpp deleted file mode 100644 index 7739b06b54..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/integrator_export_types.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/integrator/integrator_export_types.hpp - * \author Hans Joachim Ferreau, Boris Houska, Rien Quirynen, Milan Vukov - * \date 2010-2014 - */ - -#ifndef ACADO_TOOLKIT_INTEGRATOR_EXPORT_TYPES_HPP -#define ACADO_TOOLKIT_INTEGRATOR_EXPORT_TYPES_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** Summarizes all available integrators for code generation. */ -enum ExportIntegratorType{ - - INT_EX_EULER, /**< Explicit Euler method. */ - INT_RK2, /**< Explicit Runge-Kutta integrator of order 2. */ - INT_RK3, /**< Explicit Runge-Kutta integrator of order 3. */ - INT_RK4, /**< Explicit Runge-Kutta integrator of order 4. */ - INT_IRK_GL2, /**< Gauss-Legendre integrator of order 2 (Continuous output Implicit Runge-Kutta). */ - INT_IRK_GL4, /**< Gauss-Legendre integrator of order 4 (Continuous output Implicit Runge-Kutta). */ - INT_IRK_GL6, /**< Gauss-Legendre integrator of order 6 (Continuous output Implicit Runge-Kutta). */ - INT_IRK_GL8, /**< Gauss-Legendre integrator of order 8 (Continuous output Implicit Runge-Kutta). */ - - INT_IRK_RIIA1, /**< Radau IIA integrator of order 1 (Continuous output Implicit Runge-Kutta). */ - INT_IRK_RIIA3, /**< Radau IIA integrator of order 3 (Continuous output Implicit Runge-Kutta). */ - INT_IRK_RIIA5, /**< Radau IIA integrator of order 5 (Continuous output Implicit Runge-Kutta). */ - - INT_DIRK3, /**< Diagonally Implicit 2-stage Runge-Kutta integrator of order 3 (Continuous output). */ - INT_DIRK4, /**< Diagonally Implicit 3-stage Runge-Kutta integrator of order 4 (Continuous output). */ - INT_DIRK5, /**< Diagonally Implicit 5-stage Runge-Kutta integrator of order 5 (Continuous output). */ - - INT_DT, /**< An algorithm which handles the simulation and sensitivity generation for a discrete time state-space model. */ - INT_NARX /**< An algorithm which handles the simulation and sensitivity generation for a NARX model. */ -}; - -/** Summarizes all possible sensitivity generation types for exported integrators. */ -enum ExportSensitivityType{ - - NO_SENSITIVITY, /**< No sensitivities are computed, if possible. */ - FORWARD, /**< Sensitivities are computed in forward mode. */ - BACKWARD, /**< Sensitivities are computed in backward mode. */ - FORWARD_OVER_BACKWARD, /**< Sensitivities (first and second order) are computed. */ - SYMMETRIC, /**< Sensitivities (first and second order) are computed. */ - SYMMETRIC_FB, /**< Sensitivities (first and second order) are computed. */ - INEXACT /**< Inexact sensitivities are computed by Newton iterations. */ -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_INTEGRATOR_EXPORT_TYPES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/integrators/integrator_generation.hpp b/phonelibs/acado/include/acado/code_generation/integrators/integrator_generation.hpp deleted file mode 100644 index 44d4800d0f..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/integrator_generation.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/code_generation/integrators/integrator_generation.hpp - * \author Rien Quirynen - * \date 2012 - */ - -#ifndef ACADO_TOOLKIT_INTEGRATOR_GENERATION_HPP -#define ACADO_TOOLKIT_INTEGRATOR_GENERATION_HPP - - -// LIST OF HEADER FILES: -// ----------------------------------------------------- - - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - #include - -// ----------------------------------------------------- - - -#endif // ACADO_TOOLKIT_INTEGRATOR_GENERATION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_export.hpp deleted file mode 100644 index d25eeced0a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_export.hpp +++ /dev/null @@ -1,606 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_IRK_EXPORT_HPP -#define ACADO_TOOLKIT_IRK_EXPORT_HPP - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored implicit Runge-Kutta integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ImplicitRungeKuttaExport allows to export a tailored implicit Runge-Kutta integrator - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class ImplicitRungeKuttaExport : public RungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ImplicitRungeKuttaExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ImplicitRungeKuttaExport( const ImplicitRungeKuttaExport& arg - ); - - /** Destructor. - */ - virtual ~ImplicitRungeKuttaExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ImplicitRungeKuttaExport& operator=( const ImplicitRungeKuttaExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** This routine sets the eigenvalues of the inverse of the AA matrix. */ - returnValue setEigenvalues( const DMatrix& _eig ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setSimplifiedTransformations( const DMatrix& _transf1, const DMatrix& _transf2 ); - returnValue setSimplifiedTransformations( const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setSingleTransformations( const double _tau, const DVector& _low_tria, const DMatrix& _transf1, const DMatrix& _transf2 ); - returnValue setSingleTransformations( const double _tau, const DVector& _low_tria, const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Assigns the model to be used by the integrator. - * - * @param[in] _rhs Name of the function, evaluating the right-hand side. - * @param[in] _diffs_rhs Name of the function, evaluating the derivatives of the right-hand side. - * - * \return SUCCESSFUL_RETURN - */ - - returnValue setModel( const std::string& _rhs, const std::string& _diffs_rhs ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param rhs The expressions corresponding the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector rhs ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output ); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param _outputNames The names of the output functions. \n - * \param _diffs_outputNames The names of the functions, evaluating the derivatives of the outputs. \n - * \param _dims_output The dimensions of the output functions. \n - * \param _outputDependencies A separate dependency matrix for each output. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector _outputNames, - const std::vector _diffs_outputNames, - const std::vector _dims_output, - const std::vector _outputDependencies ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Initializes the matrix DD, which is used to extrapolate the variables of the IRK method to the next step. - * - * \return SUCCESSFUL_RETURN - */ - returnValue initializeDDMatrix( ); - - - /** Initializes the matrix coeffs, containing coefficients of polynomials that are used to evaluate the - * continuous output (see evaluatePolynomial). - * - * \return SUCCESSFUL_RETURN - */ - returnValue initializeCoefficients( ); - - - /** Recursive function that helps with the computation of the coefficients of polynomials that are used to evaluate the - * continuous output (see initializeCoefficients), by computing the correct combinations of elements of the vector - * cc from the Butcher table. - * - * @param[in] cVec The vector with all the elements of the vector cc from the Butcher table, of which combinations - * are computed in a recursive way. - * @param[in] index An index of the vector cVec which denotes the relevant part for this invocation. - * @param[in] numEls The number of elements in the combination. - * - * \return SUCCESSFUL_RETURN - */ - DVector computeCombinations( const DVector& cVec, uint index, uint numEls ); - - - /** Returns the coefficients of the polynomial, representing the continuous output of the integrator. - * - * @param[in] time The point in the interval (0,1] for which the coefficients are returned. - * - * \return Coefficients of the polynomial, corresponding the given grid point - */ - DVector evaluatePolynomial( double time ); - - - /** Returns the coefficients of the derived polynomial, representing the derivative of the continuous output with respect to time. - * - * @param[in] time The point in the interval (0,1] for which the coefficients are returned. - * - * \return Coefficients of the polynomial, corresponding the given grid point - */ - DVector evaluateDerivedPolynomial( double time ); - - - /** Exports the evaluation of the coefficients of the polynomial, representing the continuous output of the integrator. - * - * @param[in] block The block to which the code will be exported. - * @param[in] variable The variable containing the coefficients of the polynomial. - * @param[in] grid The variable containing the grid point for the specific output. - * @param[in] h The integration step size. - * - * \return SUCCESSFUL_RETURN - */ - returnValue evaluatePolynomial( ExportStatementBlock& block, - const ExportVariable& variable, - const ExportVariable& grid, - const std::string& h ); - - - /** Exports the evaluation of the coefficients of the derived polynomial, representing the derivative of the continuous output with respect to time. - * - * @param[in] block The block to which the code will be exported. - * @param[in] variable The variable containing the coefficients of the polynomial. - * @param[in] grid The variable containing the grid point for the specific output. - * - * \return SUCCESSFUL_RETURN - */ - returnValue evaluateDerivedPolynomial( ExportStatementBlock& block, - const ExportVariable& variable, - const ExportVariable& grid ); - - - /** Returns the coefficients of the polynomial for the complete grid of the output, corresponding a certain index. - * - * @param[in] index The index of the continuous output for which the coefficients are returned. - * - * \return Coefficients of the polynomial, corresponding the given continuous output - */ - DMatrix evaluatePolynomial( uint index ); - - - /** Returns the coefficients of the derived polynomial for the complete grid of the output, corresponding a certain index. - * - * @param[in] index The index of the continuous output for which the coefficients are returned. - * - * \return Coefficients of the derived polynomial, corresponding the given continuous output - */ - DMatrix evaluateDerivedPolynomial( uint index ); - - - /** Divide the total number of measurements over the different integration steps. - * - * @param[in] index The index of the continuous output for which the division of measurements is returned. - * - * \return The division of measurements over the integration steps, corresponding the given continuous output. - */ - DVector divideMeasurements( uint index ); - - - /** Precompute as much as possible for the linear input system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareInputSystem( ExportStatementBlock& code ); - - - /** Precompute as much as possible for the linear output system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareOutputSystem( ExportStatementBlock& code ); - - - /** Forms a constant linear system matrix for the collocation equations, given a constant jacobian and mass matrix. - * - * @param[in] jacobian given constant Jacobian matrix - * @param[in] mass given constant mass matrix - * - * \return SUCCESSFUL_RETURN - */ - virtual DMatrix formMatrix( const DMatrix& mass, const DMatrix& jacobian ); - - - /** Exports the code needed to solve the system of collocation equations for the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] A1 A constant matrix defining the equations of the linear input system. - * @param[in] B1 A constant matrix defining the equations of the linear input system. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportVariable& Ah ); - - - /** Exports the code needed to solve the system of collocation equations for the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportVariable& det, - bool DERIVATIVES = false ); - - - /** Exports the code needed to solve the system of collocation equations for the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] A3 A constant matrix defining the equations of the linear output system. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportVariable& Ah, - bool DERIVATIVES = false ); - - - /** Exports the evaluation of the states at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index ); - - - /** Exports the evaluation of the states at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - returnValue evaluateStatesOutputSystem( ExportStatementBlock* block, - const ExportVariable& Ah, - const ExportIndex& stage ); - - - /** Exports the evaluation of the right-hand side of the linear system at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateRhsImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportIndex& stage ); - - - /** Exports the evaluation of the matrix of the linear system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index1 The loop index of the outer loop. - * @param[in] index2 The loop index of the inner loop. - * @param[in] tmp_index A temporary index to be used. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] evaluateB True if the right-hand side of the linear system should also be evaluated, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateMatrix( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index, - const ExportIndex& k_index, - const ExportVariable& _rk_A, - const ExportVariable& Ah, - const ExportVariable& C, - bool evaluateB, - bool DERIVATIVES ); - - - /** Prepares the structures to evaluate the continuous output and exports the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue prepareOutputEvaluation( ExportStatementBlock& code ); - - - /** Exports the necessary code for the computation of the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * @param[in] rk_tPrev The time point, defining the beginning of the current integration step (in case of an online grid). - * @param[in] time_tmp A variable used for time transformations (in case of an online grid). - * - * \return SUCCESSFUL_RETURN - */ - returnValue generateOutput( ExportStatementBlock* block, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& tmp_meas, - const ExportVariable& time_tmp, - const uint directions ); - - - /** Copies all class members from given object. - * - * @param[in] arg Right-hand side object. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue copy( const ImplicitRungeKuttaExport& arg - ); - - - /** Returns the performed number of Newton iterations. - * - * \return The performed number of Newton iterations. - */ - uint getNumIts() const; - - - /** Returns the performed number of Newton iterations for the initialization of the first step. - * - * \return The performed number of Newton iterations for the initialization of the first step. - */ - uint getNumItsInit() const; - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - virtual ExportVariable getAuxVariable() const; - - - protected: - - bool REUSE; /**< This boolean is true when the IFTR method is used instead of the IFT method. */ - bool CONTINUOUS_OUTPUT; /**< This boolean is true when continuous output needs to be provided. */ - - uint numIts; /**< This is the performed number of Newton iterations. */ - uint numItsInit; /**< This is the performed number of Newton iterations for the initialization of the first step. */ - - uint NDX2; - uint NVARS2; - - uint NVARS3; - - ExportLinearSolver* solver; /**< This is the exported linear solver that is used by the implicit Runge-Kutta method. */ - - DMatrix DD; /**< This matrix is used for the initialization of the variables for the next integration step. */ - DMatrix coeffs; /**< This matrix contains coefficients of polynomials that are used to evaluate the continuous output (see evaluatePolynomial). */ - - DVector numDX_output; - DVector numXA_output; - DVector numVARS_output; - - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable rk_rhsOutputTemp; /**< Variable containing intermediate results of evaluations of the right-hand side expression of an output function. */ - ExportVariable rk_diffsOutputTemp; /**< Variable containing intermediate results of evaluations of the derivatives of an output function. */ - ExportVariable rk_outH; /**< Variable that is used for the evaluations of the continuous output. */ - ExportVariable rk_out; /**< Variable that is used for the evaluations of the continuous output. */ - ExportVariable polynEvalVar; /**< Local variable that is used for the evaluations of the continuous output. */ - - ExportVariable stepsH; /**< Variable defining the different integration step sizes in case of a non equidistant grid. */ - - std::vector gridVariables; /**< This vector contains an ExportVariable for the grid of each continuous output. */ - std::vector totalMeas; /**< This vector contains the total number of measurements per output (per shooting or integration interval, depending on grid type). */ - - std::vector rk_outputs; /**< Variables containing the evaluations of the continuous output from the integrator. */ - std::vector polynVariables; /**< Variables containing the coefficients for the polynomial. */ - std::vector polynDerVariables; /**< Variables containing the coefficients for the derived polynomial. */ - std::vector numMeasVariables; /**< Variables containing the number of measurements per integration interval. */ - std::vector numMeas; /**< Indices containing the number of measurements that are already computed. */ - - ExportVariable rk_mat1; - ExportVariable rk_dk1; - - ExportVariable rk_A; /**< Variable containing the matrix of the linear system. */ - ExportVariable rk_b; /**< Variable containing the right-hand side of the linear system. */ - ExportVariable rk_auxSolver; /**< Variable containing auxiliary values for the exported linear solver. */ - ExportVariable rk_rhsTemp; /**< Variable containing intermediate results of evaluations of the right-hand side expression. */ - - ExportAcadoFunction lin_output; - ExportVariable rk_mat3; - ExportVariable rk_dk3; - ExportVariable rk_diffsTemp3; - - ExportVariable rk_diffK; - ExportVariable debug_mat; - - DMatrix eig; - DMatrix simplified_transf1; - DMatrix simplified_transf2; - DMatrix simplified_transf1_T; - DMatrix simplified_transf2_T; - - double tau; - DVector low_tria; - DMatrix single_transf1; - DMatrix single_transf2; - - DMatrix single_transf1_T; - DMatrix single_transf2_T; - -}; - - -CLOSE_NAMESPACE_ACADO - - -#include -#include -#include -#include -#include -#include -#include -#include - - -#endif // ACADO_TOOLKIT_IRK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_export.ipp b/phonelibs/acado/include/acado/code_generation/integrators/irk_export.ipp deleted file mode 100644 index 4a01e90e4f..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_export.ipp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_export.ipp - * \author Rien Quirynen - * \date 2013 - */ - - -BEGIN_NAMESPACE_ACADO - - -// -// Create the correct integrator -// -inline ImplicitRungeKuttaExport* createImplicitRungeKuttaExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName ) -{ - int sensGen; - _userInteraction->get( DYNAMIC_SENSITIVITY, sensGen ); - int liftedGen; - _userInteraction->get( IMPLICIT_INTEGRATOR_MODE, liftedGen ); - - if ( (ImplicitIntegratorMode)liftedGen == LIFTED && ((ExportSensitivityType)sensGen == FORWARD || (ExportSensitivityType)sensGen == INEXACT) ) { - return new ForwardLiftedIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ImplicitIntegratorMode)liftedGen == LIFTED && (ExportSensitivityType)sensGen == BACKWARD ) { - return new AdjointLiftedIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ImplicitIntegratorMode)liftedGen == LIFTED && (ExportSensitivityType)sensGen == SYMMETRIC ) { - return new SymmetricLiftedIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ImplicitIntegratorMode)liftedGen == LIFTED && (ExportSensitivityType)sensGen == FORWARD_OVER_BACKWARD ) { - return new ForwardBackwardLiftedIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ImplicitIntegratorMode)liftedGen == LIFTED_FEEDBACK && ((ExportSensitivityType)sensGen == FORWARD || (ExportSensitivityType)sensGen == INEXACT) ) { - return new FeedbackLiftedIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ExportSensitivityType)sensGen == SYMMETRIC || (ExportSensitivityType)sensGen == FORWARD_OVER_BACKWARD ) { - return new SymmetricIRKExport(_userInteraction, _commonHeaderName); - } - else if ( (ExportSensitivityType)sensGen == FORWARD ) { - return new ForwardIRKExport(_userInteraction, _commonHeaderName); - } - else if( (ExportSensitivityType)sensGen == NO_SENSITIVITY ) { - return new ImplicitRungeKuttaExport(_userInteraction, _commonHeaderName); - } - else { - ACADOERROR( RET_INVALID_OPTION ); - return new ImplicitRungeKuttaExport(_userInteraction, _commonHeaderName); - } -} - - -CLOSE_NAMESPACE_ACADO - - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_forward_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_forward_export.hpp deleted file mode 100644 index 4f3007d301..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_forward_export.hpp +++ /dev/null @@ -1,287 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_forward_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP -#define ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored implicit Runge-Kutta integrator with forward sensitivity generation for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ForwardIRKExport allows to export a tailored implicit Runge-Kutta integrator - * with forward sensitivity generation for fast model predictive control. - * - * \author Rien Quirynen - */ -class ForwardIRKExport : public ImplicitRungeKuttaExport, public RKSensitivitiesExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ForwardIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardIRKExport( const ForwardIRKExport& arg - ); - - /** Destructor. - */ - virtual ~ForwardIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardIRKExport& operator=( const ForwardIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Returns the index corresponding Compressed Row Storage (CRS) for the dependency matrix of a specific output function. - * - * @param[in] output The number of the output function. - * @param[in] row The number of the row, corresponding the element of interest. - * @param[in] col The number of the column, corresponding the element of interest. - * - * \return The CRS index. - */ - returnValue getCRSIndex( uint output, ExportIndex row, ExportIndex col ); - - - /** Precompute as much as possible for the linear input system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareInputSystem( ExportStatementBlock& code ); - - - /** Precompute as much as possible for the linear output system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareOutputSystem( ExportStatementBlock& code ); - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportVariable& Bh, - bool STATES ); - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - const ExportVariable& det, - bool STATES, - uint number ); - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& index4, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - bool STATES, - uint number ); - - - /** Exports the computation of the sensitivities for the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * @param[in] rk_tPrev The time point, defining the beginning of the current integration step (in case of an online grid). - * @param[in] time_tmp A variable used for time transformations (in case of an online grid). - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] base The number of states in stages with respect to which the sensitivities have already been computed. - * - * \return SUCCESSFUL_RETURN - */ - returnValue sensitivitiesOutputs( ExportStatementBlock* block, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportVariable& tmp_meas, - const ExportVariable& time_tmp, - bool STATES, - uint base ); - - - /** Exports the propagation of the sensitivities for the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateOutputs( ExportStatementBlock* block, - const ExportIndex& index, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& tmp_index4, - const ExportVariable& tmp_meas ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - virtual ExportVariable getAuxVariable() const; - - - protected: - - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_IRK_FORWARD_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_adjoint_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_adjoint_export.hpp deleted file mode 100644 index 85cd477bb3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_adjoint_export.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_lifted_adjoint_export.hpp - * \author Rien Quirynen - * \date 2015 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_IRK_ADJOINT_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_IRK_ADJOINT_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored lifted implicit Runge-Kutta integrator with adjoint sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class AdjointLiftedIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with adjoint sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class AdjointLiftedIRKExport : public ForwardLiftedIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - AdjointLiftedIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - AdjointLiftedIRKExport( const AdjointLiftedIRKExport& arg - ); - - /** Destructor. - */ - virtual ~AdjointLiftedIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - AdjointLiftedIRKExport& operator=( const AdjointLiftedIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - Expression returnLowerTriangular( const Expression& expr ); - - - virtual returnValue evaluateRhsSensitivities( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2 ); - - - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - - ExportAcadoFunction diffs_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - - ExportVariable rk_diffsTemp2_full; - - ExportVariable rk_S_traj; /**< Variable containing the forward trajectory of the first order sensitivities. */ -// ExportVariable rk_A_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ -// ExportVariable rk_aux_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_IRK_ADJOINT_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_feedback_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_feedback_export.hpp deleted file mode 100644 index aebfa750f3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_feedback_export.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_lifted_feedback_export.hpp - * \author Rien Quirynen - * \date 2016 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_IRK_FEEDBACK_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_IRK_FEEDBACK_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored lifted implicit Runge-Kutta integrator with forward sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class FeedbackLiftedIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with forward sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class FeedbackLiftedIRKExport : public ForwardIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - FeedbackLiftedIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - FeedbackLiftedIRKExport( const FeedbackLiftedIRKExport& arg - ); - - /** Destructor. - */ - virtual ~FeedbackLiftedIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - FeedbackLiftedIRKExport& operator=( const FeedbackLiftedIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setNonlinearFeedback( const DMatrix& C, const Expression& feedb ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Precompute as much as possible for the linear input system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setInputSystem( ); - returnValue prepareInputSystem( ExportStatementBlock& code ); - - - /** Exports the code needed to solve the system of collocation equations for the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] A1 A constant matrix defining the equations of the linear input system. - * @param[in] B1 A constant matrix defining the equations of the linear input system. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& k_index, - const ExportVariable& Ah ); - - - /** Exports the evaluation of the states at all stages. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateAllStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - virtual ExportVariable getAuxVariable() const; - - - protected: - - ExportVariable rk_seed; /**< Variable containing the forward seed. */ - ExportVariable rk_stageValues; /**< Variable containing the evaluated stage values. */ - - ExportVariable rk_Xprev; /**< Variable containing the full previous state trajectory. */ - ExportVariable rk_Uprev; /**< Variable containing the previous control trajectory. */ - - ExportVariable rk_delta; /**< Variable containing the update on the optimization variables. */ - - ExportVariable rk_xxx_lin; - ExportVariable rk_Khat_traj; - ExportVariable rk_Xhat_traj; - - // Static feedback function: - ExportAcadoFunction feedb; - DMatrix C11; - uint NF; - - DMatrix mat1, sensMat; - - ExportVariable rk_kTemp; - ExportVariable rk_dk1_tmp; - ExportVariable rk_dk2_tmp; - - ExportAcadoFunction sens_input; - ExportAcadoFunction sens_fdb; - ExportVariable rk_sensF; - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_IRK_FEEDBACK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_fob_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_fob_export.hpp deleted file mode 100644 index 343bea8db6..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_fob_export.hpp +++ /dev/null @@ -1,240 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_lifted_fob_export.hpp - * \author Rien Quirynen - * \date 2015 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_IRK_FORWARD_BACKWARD_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_IRK_FORWARD_BACKWARD_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored lifted implicit Runge-Kutta integrator with forward-over-adjoint second order sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ForwardBackwardLiftedIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with forward-over-adjoint second order sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class ForwardBackwardLiftedIRKExport : public ForwardLiftedIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ForwardBackwardLiftedIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardBackwardLiftedIRKExport( const ForwardBackwardLiftedIRKExport& arg - ); - - /** Destructor. - */ - virtual ~ForwardBackwardLiftedIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardBackwardLiftedIRKExport& operator=( const ForwardBackwardLiftedIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Exports the evaluation of the states at all stages. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateAllStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index ); - - - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - Expression returnLowerTriangular( const Expression& expr ); - - - returnValue updateHessianTerm( ExportStatementBlock* block, const ExportIndex& index1, const ExportIndex& index2 ); - - - virtual returnValue allSensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& k_index, - const ExportVariable& Bh, - bool update ); - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateRhsInexactSensitivities( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& k_index, - const ExportVariable& Ah ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - - ExportAcadoFunction diffs_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - ExportAcadoFunction adjoint_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - - ExportVariable rk_b_trans; - - ExportVariable rk_adj_diffs_tmp; - - ExportVariable rk_Khat_traj; - ExportVariable rk_Xhat_traj; - - ExportVariable rk_xxx_traj; /**< Variable containing the forward trajectory of the state values. */ - ExportVariable rk_adj_traj; /**< Variable containing the adjoint trajectory of the lambda_hat values. */ - ExportVariable rk_S_traj; /**< Variable containing the forward trajectory of the first order sensitivities. */ - ExportVariable rk_A_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - - ExportVariable rk_hess_tmp1; - ExportVariable rk_hess_tmp2; - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_IRK_FORWARD_BACKWARD_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_forward_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_forward_export.hpp deleted file mode 100644 index 32261272df..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_forward_export.hpp +++ /dev/null @@ -1,426 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_lifted_forward_export.hpp - * \author Rien Quirynen - * \date 2014 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_IRK_FORWARD_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_IRK_FORWARD_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored lifted implicit Runge-Kutta integrator with forward sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class ForwardLiftedIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with forward sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class ForwardLiftedIRKExport : public ForwardIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ForwardLiftedIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardLiftedIRKExport( const ForwardLiftedIRKExport& arg - ); - - /** Destructor. - */ - virtual ~ForwardLiftedIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - ForwardLiftedIRKExport& operator=( const ForwardLiftedIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Precompute as much as possible for the linear input system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareInputSystem( ExportStatementBlock& code ); - - - /** Precompute as much as possible for the linear output system and export the resulting definitions. - * - * @param[in] code The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue prepareOutputSystem( ExportStatementBlock& code ); - - - /** Exports the code needed to solve the system of collocation equations for the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue solveImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportVariable& det, - bool DERIVATIVES = false ); - - - /** Exports the evaluation of the inexact matrix for the linear system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index1 The loop index of the outer loop. - * @param[in] index2 The loop index of the inner loop. - * @param[in] tmp_index A temporary index to be used. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] evaluateB True if the right-hand side of the linear system should also be evaluated, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateInexactMatrix( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index, - const ExportIndex& k_index, - const ExportVariable& _rk_A, - const ExportVariable& Ah, - const ExportVariable& C, - bool evaluateB, - bool DERIVATIVES ); - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportVariable& Bh, - bool STATES ); - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateRhsInexactSensitivities( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& k_index, - const ExportVariable& Ah ); - - - /** Exports the evaluation of the states at all stages. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateAllStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index ); - - - /** Exports the evaluation of the states at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index ); - - - /** Exports the evaluation of the right-hand side of the linear system at a specific stage. - * - * @param[in] block The block to which the code will be exported. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateRhsImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportIndex& stage ); - - - virtual returnValue allSensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& k_index, - const ExportVariable& Bh, - bool update ); - - - virtual returnValue evaluateRhsSensitivities( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2 ); - - - /** Exports the code needed to update the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& index4, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - bool STATES, - uint number ); - - - /** Exports the computation of the sensitivities for the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * @param[in] rk_tPrev The time point, defining the beginning of the current integration step (in case of an online grid). - * @param[in] time_tmp A variable used for time transformations (in case of an online grid). - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] base The number of states in stages with respect to which the sensitivities have already been computed. - * - * \return SUCCESSFUL_RETURN - */ - returnValue sensitivitiesOutputs( ExportStatementBlock* block, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportVariable& tmp_meas, - const ExportVariable& time_tmp, - bool STATES, - uint base ); - - - /** Exports the propagation of the sensitivities for the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateOutputs( ExportStatementBlock* block, - const ExportIndex& index, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportIndex& tmp_index4, - const ExportVariable& tmp_meas ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - ExportAcadoFunction forward_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - ExportAcadoFunction adjoint_sweep; /**< Module to export the evaluation of an adjoint sweep of the derivatives of the ordinary differential equations. */ - ExportVariable rk_b_trans; - ExportVariable rk_adj_traj; /**< Variable containing the adjoint trajectory of the lambda_hat values. */ - ExportVariable rk_adj_diffs_tmp; - ExportVariable rk_seed2; - ExportVariable rk_xxx_traj; /**< Variable containing the forward trajectory of the state values. */ - - ExportVariable rk_diffSweep; - ExportVariable rk_I; - - ExportVariable rk_seed; /**< Variable containing the forward seed. */ - ExportVariable rk_stageValues; /**< Variable containing the evaluated stage values. */ - - ExportVariable rk_Xprev; /**< Variable containing the full previous state trajectory. */ - ExportVariable rk_Uprev; /**< Variable containing the previous control trajectory. */ - - ExportVariable rk_delta; /**< Variable containing the update on the optimization variables. */ - - ExportVariable rk_xxx_lin; - ExportVariable rk_Khat_traj; - ExportVariable rk_Xhat_traj; - - ExportVariable rk_diffK_local; - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_IRK_FORWARD_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_symmetric_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_symmetric_export.hpp deleted file mode 100644 index c6b4d1db32..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_lifted_symmetric_export.hpp +++ /dev/null @@ -1,183 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_lifted_symmetric_export.hpp - * \author Rien Quirynen - * \date 2015 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_IRK_SYMMETRIC_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_IRK_SYMMETRIC_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored lifted implicit Runge-Kutta integrator with symmetric second order sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class SymmetricLiftedIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with symmetric second order sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class SymmetricLiftedIRKExport : public ForwardLiftedIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - SymmetricLiftedIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SymmetricLiftedIRKExport( const SymmetricLiftedIRKExport& arg - ); - - /** Destructor. - */ - virtual ~SymmetricLiftedIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SymmetricLiftedIRKExport& operator=( const SymmetricLiftedIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - Expression returnLowerTriangular( const Expression& expr ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - - ExportAcadoFunction diffs_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - - ExportVariable rk_S_traj; /**< Variable containing the forward trajectory of the first order sensitivities. */ - ExportVariable rk_A_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - ExportVariable rk_aux_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - - ExportVariable rk_kkk_prev; /**< TODO. */ - ExportVariable rk_kkk_delta; /**< TODO. */ - ExportVariable rk_delta_full; /**< Variable containing the FULL update on all the variables. */ - ExportVariable rk_diff_mu; /**< Sensitivities to update the mu variables. */ - ExportVariable rk_diff_lam; /**< Sensitivities to propagate the lambda variables. */ - - ExportVariable rk_lambda; /**< The lambda variables over the shooting interval. */ - ExportVariable rk_b_mu; /**< The lambda variables over the shooting interval. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_IRK_SYMMETRIC_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/irk_symmetric_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/irk_symmetric_export.hpp deleted file mode 100644 index 4beb7194b8..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/irk_symmetric_export.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/irk_symmetric_export.hpp - * \author Rien Quirynen - * \date 2016 - */ - - -#ifndef ACADO_TOOLKIT_IRK_SYMMETRIC_EXPORT_HPP -#define ACADO_TOOLKIT_IRK_SYMMETRIC_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export a tailored implicit Runge-Kutta integrator with symmetric second order sensitivity generation for extra fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class SymmetricIRKExport allows to export a tailored lifted implicit Runge-Kutta integrator - * with symmetric second order sensitivity generation for extra fast model predictive control. - * - * \author Rien Quirynen - */ -class SymmetricIRKExport : public ForwardIRKExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - SymmetricIRKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SymmetricIRKExport( const SymmetricIRKExport& arg - ); - - /** Destructor. - */ - virtual ~SymmetricIRKExport( ); - - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SymmetricIRKExport& operator=( const SymmetricIRKExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Exports the evaluation of the states at all stages. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The matrix A of the IRK method, multiplied by the step size h. - * @param[in] index The loop index, defining the stage. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue evaluateAllStatesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& k_index, - const ExportVariable& Ah, - const ExportVariable& C, - const ExportIndex& stage, - const ExportIndex& i, - const ExportIndex& tmp_index, - const ExportIndex& tmp_index2 ); - - - /** Exports the code needed to update the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& _index3, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& stepI, - const ExportVariable& Ah, - const ExportVariable& Bh, - const ExportVariable& det, - bool STATES, - uint number ); - - - Expression returnLowerTriangular( const Expression& expr ); - - - returnValue updateHessianTerm( ExportStatementBlock* block, const ExportIndex& index1, const ExportIndex& index2 ); - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - - ExportAcadoFunction diffs_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - ExportAcadoFunction adjoint_sweep; /**< Module to export the evaluation of a forward sweep of the derivatives of the ordinary differential equations. */ - - ExportVariable rk_b_trans; - - ExportVariable rk_adj_diffs_tmp; - ExportVariable rk_seed; /**< Variable containing the forward seed. */ - - ExportVariable rk_xxx_traj; /**< Variable containing the forward trajectory of the state values. */ -// ExportVariable rk_adj_traj; /**< Variable containing the adjoint trajectory of the lambda_hat values. */ - ExportVariable rk_S_traj; /**< Variable containing the forward trajectory of the first order sensitivities. */ - ExportVariable rk_A_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - ExportVariable rk_aux_traj; /**< Variable containing the factorized matrix of the linear system over the forward trajectory. */ - -// ExportVariable rk_diff_mu; /**< Sensitivities to update the mu variables. */ -// ExportVariable rk_diff_lam; /**< Sensitivities to propagate the lambda variables. */ - -// ExportVariable rk_lambda; /**< The lambda variables over the shooting interval. */ -// ExportVariable rk_b_mu; /**< The lambda variables over the shooting interval. */ - - ExportVariable rk_hess_tmp1; - ExportVariable rk_hess_tmp2; -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_IRK_SYMMETRIC_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/lifted_erk_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/lifted_erk_export.hpp deleted file mode 100644 index b3461519a3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/lifted_erk_export.hpp +++ /dev/null @@ -1,157 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrators/lifted_erk_export.hpp - * \author Rien Quirynen - * \date 2015 - */ - - -#ifndef ACADO_TOOLKIT_LIFTED_ERK_EXPORT_HPP -#define ACADO_TOOLKIT_LIFTED_ERK_EXPORT_HPP - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored explicit Runge-Kutta integrator with a lifted Newton method to efficiently support (implicit) DAE systems for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class LiftedERKExport allows to export a tailored explicit Runge-Kutta integrator with a lifted Newton method to efficiently support (implicit) DAE systems - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class LiftedERKExport : public ExplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - LiftedERKExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - LiftedERKExport( const LiftedERKExport& arg - ); - - /** Destructor. - */ - virtual ~LiftedERKExport( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - protected: - - - /** Returns the largest global export variable. - * - * \return SUCCESSFUL_RETURN - */ - ExportVariable getAuxVariable() const; - - - protected: - - ExportAcadoFunction alg_rhs; /**< Module to export the evaluation of the derivatives of the algebraic equations. */ - - ExportLinearSolver* solver; /**< This is the exported linear solver that is used by the implicit Runge-Kutta method. */ - - ExportVariable rk_A; /**< Variable containing the matrix of the linear system. */ - ExportVariable rk_b; /**< Variable containing the right-hand side of the linear system. */ - ExportVariable rk_auxSolver; /**< Variable containing auxiliary values for the exported linear solver. */ - - ExportVariable rk_zzz; /**< Variable containing the lifted algebraic variables. */ - ExportVariable rk_zTemp; /**< Variable containing the evaluation of the algebraic equations */ - - ExportVariable rk_diffZ; /**< Variable containing the sensitivities of the algebraic variables */ - ExportVariable rk_delta; /**< Variable containing the difference of the optimization variables */ - ExportVariable rk_prev; /**< Variable containing the previous values of the optimization variables over the horizon */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_LIFTED_ERK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/narx_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/narx_export.hpp deleted file mode 100644 index f8a987205e..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/narx_export.hpp +++ /dev/null @@ -1,258 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/narx_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_NARX_EXPORT_HPP -#define ACADO_TOOLKIT_NARX_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored polynomial NARX integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class NARXExport allows to export a tailored polynomial NARX integrator - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class NARXExport : public DiscreteTimeExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - NARXExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - NARXExport( const NARXExport& arg - ); - - /** Destructor. - */ - virtual ~NARXExport( ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ); - - - /** Assigns the model to be used by the integrator. - * - * @param[in] _rhs Name of the function, evaluating the right-hand side. - * @param[in] _diffs_rhs Name of the function, evaluating the derivatives of the right-hand side. - * - * \return SUCCESSFUL_RETURN - */ - - returnValue setModel( const std::string& _rhs, const std::string& _diffs_rhs ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Exports the code needed to update the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue updateInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to update the sensitivities of the states defined by the nonlinear part. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue updateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to update the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue updateOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue propagateInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states defined by the nonlinear part. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue propagateImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index ); - - - /** Exports the code needed to propagate the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue propagateOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index ); - - - /** Sets a polynomial NARX model to be used by the integrator. - * - * @param[in] delay The delay for the states in the NARX model. - * @param[in] parms The parameters defining the polynomial NARX model. - * - * \return SUCCESSFUL_RETURN - */ - - returnValue setNARXmodel( const uint _delay, const DMatrix& _parms ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const Expression& rhs ); - - - /** . - * - * @param[in] . - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setLinearOutput( const DMatrix& M3, const DMatrix& A3, const std::string& _rhs3, const std::string& _diffs_rhs3 ); - - - protected: - - - /** Prepares a function that evaluates the complete right-hand side. - * - * \return SUCCESSFUL_RETURN - */ - returnValue prepareFullRhs( ); - - - /** .. - * - */ - returnValue formNARXpolynomial( const uint num, const uint order, uint& base, const uint index, IntermediateState& result ); - - - protected: - - uint delay; - DMatrix parms; - -}; - -IntegratorExport* createNARXExport( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_NARX_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA1_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA1_export.hpp deleted file mode 100644 index 25bf52a568..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA1_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/radau_IIA1_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_RADAU_IIA1_EXPORT_HPP -#define ACADO_TOOLKIT_RADAU_IIA1_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Radau IIA method of order 1 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class RadauIIA1Export allows to export a tailored Radau IIA method of order 1 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class RadauIIA1Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - RadauIIA1Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - RadauIIA1Export( const RadauIIA1Export& arg - ); - - /** Destructor. - */ - virtual ~RadauIIA1Export( ); - - protected: - -}; - -IntegratorExport* createRadauIIA1Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_RADAU_IIA1_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA3_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA3_export.hpp deleted file mode 100644 index c4166f4dd7..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA3_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/radau_IIA3_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_RADAU_IIA3_EXPORT_HPP -#define ACADO_TOOLKIT_RADAU_IIA3_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Radau IIA method of order 3 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class RadauIIA3Export allows to export a tailored Radau IIA method of order 3 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class RadauIIA3Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - RadauIIA3Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - RadauIIA3Export( const RadauIIA3Export& arg - ); - - /** Destructor. - */ - virtual ~RadauIIA3Export( ); - - protected: - -}; - -IntegratorExport* createRadauIIA3Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_RADAU_IIA3_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA5_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA5_export.hpp deleted file mode 100644 index 9b29d1c5c9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/radau_IIA5_export.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/radau_IIA5_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_RADAU_IIA5_EXPORT_HPP -#define ACADO_TOOLKIT_RADAU_IIA5_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Radau IIA method of order 5 for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class RadauIIA5Export allows to export a tailored Radau IIA method of order 5 - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class RadauIIA5Export : public ImplicitRungeKuttaExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - private: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - RadauIIA5Export( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - RadauIIA5Export( const RadauIIA5Export& arg - ); - - /** Destructor. - */ - virtual ~RadauIIA5Export( ); - - protected: - -}; - -IntegratorExport* createRadauIIA5Export( UserInteraction* _userInteraction, - const std::string &_commonHeaderName); - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_RADAU_IIA5_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/register_exported_integrators.hpp b/phonelibs/acado/include/acado/code_generation/integrators/register_exported_integrators.hpp deleted file mode 100644 index ae77fcf061..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/register_exported_integrators.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/code_generation/integrators/register_exported_integrators.hpp - * \author Milan Vukov - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_REGISTER_EXPORTED_INTEGRATORS_HPP -#define ACADO_TOOLKIT_REGISTER_EXPORTED_INTEGRATORS_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** \internal */ -static struct RegisterExportedIntegrators -{ - RegisterExportedIntegrators(); -} registerExportedIntegrators; -/** \endinternal */ - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_REGISTER_EXPORTED_INTEGRATORS_HPP diff --git a/phonelibs/acado/include/acado/code_generation/integrators/rk_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/rk_export.hpp deleted file mode 100644 index f8559be5b2..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/rk_export.hpp +++ /dev/null @@ -1,205 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/integrator/rk_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_RK_EXPORT_HPP -#define ACADO_TOOLKIT_RK_EXPORT_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Runge-Kutta integrator for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class RungeKuttaExport allows to export a tailored Runge-Kutta integrator - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class RungeKuttaExport : public IntegratorExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - RungeKuttaExport( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - RungeKuttaExport( const RungeKuttaExport& arg - ); - - /** Destructor. - */ - virtual ~RungeKuttaExport( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - RungeKuttaExport& operator=( const RungeKuttaExport& arg - ); - - - /** Initializes export of a tailored integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ) = 0; - - - /** This routine initializes the matrices AA, bb and cc which - * form the Butcher Tableau. */ - returnValue initializeButcherTableau( const DMatrix& _AA, const DVector& _bb, const DVector& _cc ); - - - /** This routine checks the symmetry of the cc vector from the Butcher Tableau. */ - BooleanType checkSymmetry( const DVector& _cc ); - - - /** Assigns Differential Equation to be used by the integrator. - * - * @param[in] rhs Right-hand side expression. - * - * \return SUCCESSFUL_RETURN - */ - - virtual returnValue setDifferentialEquation( const Expression& rhs ) = 0; - - - /** Sets a polynomial NARX model to be used by the integrator. - * - * @param[in] delay The delay for the states in the NARX model. - * @param[in] parms The parameters defining the polynomial NARX model. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setNARXmodel( const uint delay, const DMatrix& parms ); - - - /** Adds all data declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const = 0; - - - /** Adds all function (forward) declarations of the auto-generated integrator to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - - - /** Exports source code of the auto-generated integrator into the given directory. - * - * @param[in] code Code block containing the auto-generated integrator. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** This routine returns the number of stages of the Runge-Kutta integrator that will be exported. - */ - uint getNumStages(); - - - /** Sets up the output with the grids for the different output functions. \n - * \n - * \param outputGrids_ The vector containing a grid for each output function. \n - * \param rhs The expressions corresponding the output functions. \n - * \n - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOutput( const std::vector outputGrids_, - const std::vector rhs ) = 0; - - - - protected: - - /** Copies all class members from given object. - * - * @param[in] arg Right-hand side object. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue copy( const RungeKuttaExport& arg - ); - - - protected: - - ExportVariable rk_kkk; /**< Variable containing intermediate results of the RK integrator. */ - - DMatrix AA; /**< This matrix defines the Runge-Kutta method to be exported. */ - DVector bb, cc; /**< These vectors define the Runge-Kutta method to be exported. */ - - BooleanType is_symmetric; /**< Boolean defining whether a certain RK method is symmetric or not, which is important for backward sensitivity propagation. */ - - uint numStages; /**< This is the number of stages for the Runge-Kutta method. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_RK_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/integrators/rk_sensitivities_export.hpp b/phonelibs/acado/include/acado/code_generation/integrators/rk_sensitivities_export.hpp deleted file mode 100644 index e537d4551a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/integrators/rk_sensitivities_export.hpp +++ /dev/null @@ -1,163 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/integrators/rk_sensitivities_export.hpp - * \author Rien Quirynen - * \date 2013 - */ - - -#ifndef ACADO_TOOLKIT_RK_SENSITIVITIES_EXPORT_HPP -#define ACADO_TOOLKIT_RK_SENSITIVITIES_EXPORT_HPP - - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored Runge-Kutta sensitivity propagation for fast model predictive control. - * - * \ingroup NumericalAlgorithms - * - * The class RKSensitivitiesExport allows to export a tailored Runge-Kutta sensitivity propagation - * for fast model predictive control. - * - * \author Rien Quirynen - */ -class RKSensitivitiesExport -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - - - - protected: - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear input system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesInputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportVariable& Bh, - bool STATES ) = 0; - - - /** Exports the code needed to compute the sensitivities of the states defined by the nonlinear, fully implicit system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] det The variable that holds the determinant of the matrix in the linear system. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesImplicitSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - const ExportVariable& det, - bool STATES, - uint number ) = 0; - - - /** Exports the code needed to compute the sensitivities of the states, defined by the linear output system. - * - * @param[in] block The block to which the code will be exported. - * @param[in] Ah The variable containing the internal coefficients of the RK method, multiplied with the step size. - * @param[in] Bh The variable containing the weights of the RK method, multiplied with the step size. - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] number This number defines the stage of the state with respect to which the sensitivities are computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesOutputSystem( ExportStatementBlock* block, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& index3, - const ExportIndex& index4, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportVariable& Ah, - const ExportVariable& Bh, - bool STATES, - uint number ) = 0; - - - /** Exports the computation of the sensitivities for the continuous output. - * - * @param[in] block The block to which the code will be exported. - * @param[in] tmp_meas The number of measurements in the current integration step (in case of an online grid). - * @param[in] rk_tPrev The time point, defining the beginning of the current integration step (in case of an online grid). - * @param[in] time_tmp A variable used for time transformations (in case of an online grid). - * @param[in] STATES True if the sensitivities with respect to a state are needed, false otherwise. - * @param[in] base The number of states in stages with respect to which the sensitivities have already been computed. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue sensitivitiesOutputs( ExportStatementBlock* block, - const ExportIndex& index0, - const ExportIndex& index1, - const ExportIndex& index2, - const ExportIndex& tmp_index1, - const ExportIndex& tmp_index2, - const ExportIndex& tmp_index3, - const ExportVariable& tmp_meas, - const ExportVariable& time_tmp, - bool STATES, - uint base ) = 0; - - - protected: - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_RK_SENSITIVITIES_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/export_cholesky_solver.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/export_cholesky_solver.hpp deleted file mode 100644 index 7d041cc46e..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/export_cholesky_solver.hpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/export_cholesky_solver.hpp - * \author Milan Vukov - * \date 2014 - */ - -#ifndef ACADO_TOOLKIT_EXPORT_CHOLESKY_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_CHOLESKY_SOLVER_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Allows to export linear solver based on Cholesky factorization - * - * \ingroup NumericalAlgorithms - * - * Allows export of linear system solver, where the A matrix is a symmetric - * positive definite of dimensions n x n, and matrix B is of dimensions - * n x m, m >= 1. - * - * This class configures and exports two functions: - * - * - chol( A ), which computes Cholesky decomposition of matrix A = R' * R - * R is upper triangular. A gets overwritten by R. - * - solve(R, B), which at the moment solves the system R' * X = B. B gets - * overwritten by the solution X. - * - * \note Early experimental version. - * \note Exported solver code is based on qpOASES code. - * \todo Extend the generator to be able to solve RX = B, too. - * - * \author Milan Vukov - */ - -class ExportCholeskySolver : public ExportLinearSolver -{ -public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportCholeskySolver( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportCholeskySolver( ); - - /** Solver initialization routine. - * - * \return SUCCESSFUL_RETURN - * - * */ - returnValue init( unsigned _dimA, - unsigned _numColsB, - const std::string& _id - ); - - /** The setup routine. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue appendVariableNames( std::stringstream& string ); - - /** Get the reference to the Cholesky decomposition routine. */ - const ExportFunction& getCholeskyFunction() const; - - /** Get the reference to the solve function. */ - const ExportFunction& getSolveFunction() const; - -private: - - ExportFunction chol; - - ExportVariable B; - - unsigned nColsB; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_EXPORT_CHOLESKY_SOLVER_HPP diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/gaussian_elimination_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/gaussian_elimination_export.hpp deleted file mode 100644 index 0f58ac9dbb..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/gaussian_elimination_export.hpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/gaussian_elimination_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_GAUSS_ELIM_HPP -#define ACADO_TOOLKIT_EXPORT_GAUSS_ELIM_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export Gaussian elimination for solving linear systems of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportGaussElim allows to export Gaussian elimination - * for solving linear systems of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportGaussElim : public ExportLinearSolver -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportGaussElim( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportGaussElim( ); - - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - returnValue appendVariableNames( std::stringstream& string ); - - - /** Returns the dimension of the auxiliary variables for the linear solver. - * - * \return The dimension of the auxiliary variables for the linear solver. - */ - virtual ExportVariable getGlobalExportVariable( const uint factor ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - virtual returnValue setupSolveUpperTriangular( ExportFunction& _solveTriangular ); - - virtual returnValue setupSolve( ExportFunction& _solve, ExportFunction& _solveTriangular, ExportVariable& _swap, ExportVariable& _determinant, const std::string& absF ); - - virtual returnValue setupFactorization( ExportFunction& _solve, ExportVariable& _swap, ExportVariable& _determinant, const std::string& absF ); - - virtual returnValue setupSolveReuse( ExportFunction& _solveReuse, ExportFunction& _solveTriangular, ExportVariable& _bPerm ); - - virtual returnValue setupSolveReuseComplete( ExportFunction& _solveReuse, ExportVariable& _bPerm ); - - virtual returnValue setupSolveReuseTranspose( ExportFunction& _solveReuse, ExportVariable& _bPerm ); - - - protected: - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable rk_swap; /**< Variable that is used to swap rows for pivoting. */ - ExportVariable rk_bPerm; /**< Variable containing the reordered right-hand side. */ - ExportVariable rk_perm; /**< Variable containing the order of the rows. */ - - ExportVariable rk_bPerm_trans; /**< Variable containing ... */ - ExportVariable b_trans; /**< Variable containing ... */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_GAUSS_ELIM_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/householder_qr_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/householder_qr_export.hpp deleted file mode 100644 index 57ec22fd3d..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/householder_qr_export.hpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/householder_qr_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_HOUSE_QR_HPP -#define ACADO_TOOLKIT_EXPORT_HOUSE_QR_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export Householder QR Factorization for solving linear systems of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportHouseholderQR allows to export Householder QR Factorization - * for solving linear systems of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportHouseholderQR : public ExportLinearSolver -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportHouseholderQR( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. - */ - virtual ~ExportHouseholderQR( ); - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - returnValue appendVariableNames( std::stringstream& string ); - - - /** Returns the dimension of the auxiliary variables for the linear solver. - * - * \return The dimension of the auxiliary variables for the linear solver. - */ - virtual ExportVariable getGlobalExportVariable( const uint factor ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - protected: - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable rk_temp; /**< Variable that is used to store intermediate results that can be reused. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_HOUSE_QR_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_simplified_newton_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_simplified_newton_export.hpp deleted file mode 100644 index 2320314de9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_simplified_newton_export.hpp +++ /dev/null @@ -1,219 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/irk_3stage_simplified_newton_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SIMPLIFIED_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SIMPLIFIED_SOLVER_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored IRK solver based on Gaussian elimination of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportIRK3StageSolver allows to export a tailored IRK solver - * based on Gaussian elimination of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportIRK3StageSimplifiedNewton : public ExportGaussElim -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportIRK3StageSimplifiedNewton( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportIRK3StageSimplifiedNewton( ); - - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** This routine sets the eigenvalues of the inverse of the AA matrix. */ - returnValue setEigenvalues( const DMatrix& _eig ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setTransformations( const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - /** This routine sets the step size used in the IRK method. */ - returnValue setStepSize( double _stepsize ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue transformRightHandSide( ExportStatementBlock& code, const ExportVariable& b_mem_complex_, const ExportVariable& b_mem_real_, const ExportVariable& b_full_, const ExportVariable& transf_, const ExportIndex& index, const bool transpose ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue transformSolution( ExportStatementBlock& code, const ExportVariable& b_mem_complex_, const ExportVariable& b_mem_real_, const ExportVariable& b_full_, const ExportVariable& tranfs_, const ExportIndex& index, const bool transpose ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - returnValue appendVariableNames( std::stringstream& string ); - - - returnValue setImplicit( BooleanType _implicit ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - const std::string getNameSolveComplexFunction(); - const std::string getNameSolveComplexReuseFunction(); - const std::string getNameSolveComplexTransposeReuseFunction(); - - const std::string getNameSolveRealFunction(); - const std::string getNameSolveRealReuseFunction(); - const std::string getNameSolveRealTransposeReuseFunction(); - - - protected: - - BooleanType implicit; - double stepsize; - DMatrix eig; - DMatrix transf1; - DMatrix transf2; - DMatrix transf1_T; - DMatrix transf2_T; - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable A_complex; /**< Variable containing the matrix of the complex linear system. */ - ExportVariable b_complex; /**< Variable containing the right-hand side of the complex linear system and it will also contain the solution. */ - ExportVariable b_complex_trans; /**< Variable containing the right-hand side of the complex linear system and it will also contain the solution. */ - ExportVariable rk_perm_complex; /**< Variable containing the order of the rows. */ - - ExportVariable determinant_complex; /**< Variable containing the matrix determinant. */ - ExportVariable rk_swap_complex; /**< Variable that is used to swap rows for pivoting. */ - ExportVariable rk_bPerm_complex; /**< Variable containing the reordered right-hand side. */ - ExportVariable rk_bPerm_complex_trans; /**< Variable containing ... */ - - ExportFunction solve_complex; /**< Function that solves the complex linear system. */ - ExportFunction solveReuse_complex; /**< Function that solves a complex linear system with the same matrix, reusing previous results. */ - ExportFunction solveReuse_complexTranspose; /**< Function that solves a complex linear system with the same matrix, reusing previous results. */ - - - ExportVariable A_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable I_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable b_full; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable b_full_trans; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable rk_perm_full; /**< Variable containing the order of the rows. */ - - ExportFunction solve_full; /**< Function that solves the complete linear system. */ - ExportFunction solveReuse_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - ExportFunction solveReuseTranspose_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - - - ExportVariable A_mem_real; /**< Variable containing the factorized matrix of the real linear system. */ - ExportVariable A_mem_complex; /**< Variable containing the factorized matrix of the complex linear system. */ - ExportVariable b_mem_real; /**< Variable containing the right-hand side for the real linear system. */ - ExportVariable b_mem_complex; /**< Variable containing the right-hand side for the complex linear system. */ - ExportVariable b_mem_real_trans; /**< Variable containing the right-hand side for the real linear system. */ - ExportVariable b_mem_complex_trans; /**< Variable containing the right-hand side for the complex linear system. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SIMPLIFIED_SOLVER_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_single_newton_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_single_newton_export.hpp deleted file mode 100644 index a34ca31f7a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_3stage_single_newton_export.hpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/irk_3stage_single_newton_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SINGLE_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SINGLE_SOLVER_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored IRK solver based on Gaussian elimination of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportIRK3StageSolver allows to export a tailored IRK solver - * based on Gaussian elimination of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportIRK3StageSingleNewton : public ExportGaussElim -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportIRK3StageSingleNewton( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportIRK3StageSingleNewton( ); - - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setTransformations( const double _tau, const DVector& _low_tria, const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - /** This routine sets the step size used in the IRK method. */ - returnValue setStepSize( double _stepsize ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue performTransformation( ExportStatementBlock& code, const ExportVariable& from, const ExportVariable& to, const ExportVariable& transf, const ExportIndex& index ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - returnValue setImplicit( BooleanType _implicit ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - const std::string getNameSubSolveFunction(); - const std::string getNameSubSolveReuseFunction(); - const std::string getNameSubSolveTransposeReuseFunction(); - - - protected: - - BooleanType implicit; - double stepsize; - double tau; - DVector low_tria; - DMatrix transf1; - DMatrix transf2; - DMatrix transf1_T; - DMatrix transf2_T; - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable A_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable I_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable b_full; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable rk_perm_full; /**< Variable containing the order of the rows. */ - - ExportFunction solve_full; /**< Function that solves the complete linear system. */ - ExportFunction solveReuse_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - - ExportFunction solveReuseTranspose_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - ExportVariable b_full_trans; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable b_mem_trans; /**< Variable containing the right-hand side for the linear subsystems. */ - - ExportVariable A_mem; /**< Variable containing the factorized matrix of the linear subsystems. */ - ExportVariable b_mem; /**< Variable containing the right-hand side for the linear subsystems. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_IRK_3STAGE_SINGLE_SOLVER_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_simplified_newton_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_simplified_newton_export.hpp deleted file mode 100644 index 9f3b7fac24..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_simplified_newton_export.hpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/irk_4stage_simplified_newton_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SIMPLIFIED_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SIMPLIFIED_SOLVER_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored IRK solver based on Gaussian elimination of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportIRK3StageSolver allows to export a tailored IRK solver - * based on Gaussian elimination of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportIRK4StageSimplifiedNewton : public ExportGaussElim -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportIRK4StageSimplifiedNewton( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportIRK4StageSimplifiedNewton( ); - - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - - /** This routine sets the eigenvalues of the inverse of the AA matrix. */ - returnValue setEigenvalues( const DMatrix& _eig ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setTransformations( const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - /** This routine sets the step size used in the IRK method. */ - returnValue setStepSize( double _stepsize ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue transformRightHandSide( ExportStatementBlock& code, const ExportVariable& b_mem1, const ExportVariable& b_mem2, const ExportVariable& b_full_, const ExportVariable& transf_, const ExportIndex& index, const bool transpose ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue transformSolution( ExportStatementBlock& code, const ExportVariable& b_mem1, const ExportVariable& b_mem2, const ExportVariable& b_full_, const ExportVariable& transf_, const ExportIndex& index, const bool transpose ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - returnValue appendVariableNames( std::stringstream& string ); - - - returnValue setImplicit( BooleanType _implicit ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - const std::string getNameSolveComplexFunction(); - const std::string getNameSolveComplexReuseFunction(); - const std::string getNameSolveComplexTransposeReuseFunction(); - - - protected: - - BooleanType implicit; - double stepsize; - DMatrix eig; - DMatrix transf1; - DMatrix transf2; - DMatrix transf1_T; - DMatrix transf2_T; - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable determinant_complex; /**< Variable containing the matrix determinant. */ - ExportVariable rk_swap_complex; /**< Variable that is used to swap rows for pivoting. */ - ExportVariable rk_bPerm_complex; /**< Variable containing the reordered right-hand side. */ - ExportVariable rk_bPerm_complex_trans; /**< Variable containing the reordered right-hand side. */ - - ExportVariable A_complex; /**< Variable containing the matrix of the complex linear system. */ - ExportVariable b_complex; /**< Variable containing the right-hand side of the complex linear system and it will also contain the solution. */ - ExportVariable b_complex_trans; /**< Variable containing the right-hand side of the complex linear system and it will also contain the solution. */ - ExportVariable rk_perm_complex; /**< Variable containing the order of the rows. */ - - ExportFunction solve_complex; /**< Function that solves the complex linear system. */ - ExportFunction solveReuse_complex; /**< Function that solves a complex linear system with the same matrix, reusing previous results. */ - ExportFunction solveReuse_complexTranspose; /**< Function that solves a complex linear system with the same matrix, reusing previous results. */ - - - ExportVariable A_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable I_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable b_full; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable b_full_trans; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable rk_perm_full; /**< Variable containing the order of the rows. */ - - ExportFunction solve_full; /**< Function that solves the complete linear system. */ - ExportFunction solveReuse_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - ExportFunction solveReuseTranspose_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - - - ExportVariable A_mem_complex1; /**< Variable containing the factorized matrix of the complex linear system. */ - ExportVariable b_mem_complex1; /**< Variable containing the right-hand side for the complex linear system. */ - ExportVariable A_mem_complex2; /**< Variable containing the factorized matrix of the complex linear system. */ - ExportVariable b_mem_complex2; /**< Variable containing the right-hand side for the complex linear system. */ - - ExportVariable b_mem_complex1_trans; /**< Variable containing the right-hand side for the complex linear system. */ - ExportVariable b_mem_complex2_trans; /**< Variable containing the right-hand side for the complex linear system. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SIMPLIFIED_SOLVER_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_single_newton_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_single_newton_export.hpp deleted file mode 100644 index ff9cedccd8..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/irk_4stage_single_newton_export.hpp +++ /dev/null @@ -1,176 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/irk_4stage_single_newton_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SINGLE_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SINGLE_SOLVER_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export a tailored IRK solver based on Gaussian elimination of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportIRK4StageSolver allows to export a tailored IRK solver - * based on Gaussian elimination of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportIRK4StageSingleNewton : public ExportGaussElim -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportIRK4StageSingleNewton( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportIRK4StageSingleNewton( ); - - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ); - - /** This routine sets the transformation matrices, defined by the inverse of the AA matrix. */ - returnValue setTransformations( const double _tau, const DVector& _low_tria, const DMatrix& _transf1, const DMatrix& _transf2, const DMatrix& _transf1_T, const DMatrix& _transf2_T ); - - /** This routine sets the step size used in the IRK method. */ - returnValue setStepSize( double _stepsize ); - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue performTransformation( ExportStatementBlock& code, const ExportVariable& from, const ExportVariable& to, const ExportVariable& transf, const ExportIndex& index ); - - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ); - - - returnValue setImplicit( BooleanType _implicit ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - const std::string getNameSubSolveFunction(); - const std::string getNameSubSolveReuseFunction(); - const std::string getNameSubSolveTransposeReuseFunction(); - - - protected: - - BooleanType implicit; - double stepsize; - double tau; - DVector low_tria; - DMatrix transf1; - DMatrix transf2; - DMatrix transf1_T; - DMatrix transf2_T; - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable A_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable I_full; /**< Variable containing the matrix for the complete linear system. */ - ExportVariable b_full; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable rk_perm_full; /**< Variable containing the order of the rows. */ - - ExportFunction solve_full; /**< Function that solves the complete linear system. */ - ExportFunction solveReuse_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - - ExportFunction solveReuseTranspose_full; /**< Function that solves a complete linear system with the same matrix, reusing previous results. */ - ExportVariable b_full_trans; /**< Variable containing the right-hand side of the complete linear system and it will also contain the solution. */ - ExportVariable b_mem_trans; /**< Variable containing the right-hand side for the linear subsystems. */ - - ExportVariable A_mem; /**< Variable containing the factorized matrix of the linear subsystems. */ - ExportVariable b_mem; /**< Variable containing the right-hand side for the linear subsystems. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_IRK_4STAGE_SINGLE_SOLVER_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_export.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_export.hpp deleted file mode 100644 index fcceef0dac..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_export.hpp +++ /dev/null @@ -1,307 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/linear_solver_export.hpp - * \author Rien Quirynen - */ - - -#ifndef ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP -#define ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP - -#include -#include -#include -#include -#include -#include -#include - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to export automatically generated algorithms for solving linear systems of specific dimensions. - * - * \ingroup NumericalAlgorithms - * - * The class ExportLinearSolver allows to export automatically generated - * algorithms for solving linear systems of specific dimensions. - * - * \author Rien Quirynen - */ - -class ExportLinearSolver : public ExportAlgorithm -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] _userInteraction Pointer to corresponding user interface. - * @param[in] _commonHeaderName Name of common header file to be included. - */ - ExportLinearSolver( UserInteraction* _userInteraction = 0, - const std::string& _commonHeaderName = "" - ); - - /** Destructor. */ - virtual ~ExportLinearSolver( ); - - /** Initializes code export into given file. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setup( ) = 0; - - - /** Initializes the different parameters of the linear solver that will be exported. - * - * @param[in] newDim The dimensions of the linear system. - * @param[in] reuse A boolean that is true when more than one system of linear equations with the same - * matrix needs to be solved. This means that an algorithm will be exported expecially - * for this case, with extra optimizations by reusing as many intermediate results as possible. - * @param[in] unrolling A boolean that is true when the exported code for the linear solver needs to be unrolled - * completely. - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const uint newDim, - const bool& reuse = true, - const bool& unrolling = false - ); - - returnValue init( const uint newDim, - const uint _nRightHandSides, - const bool& reuse = true, - const bool& unrolling = false - ); - - - /** Initializes the different parameters of the linear solver that will be exported. - * - * @param[in] newDim The dimensions of the linear system. - * @param[in] reuse A boolean that is true when more than one system of linear equations with the same - * matrix needs to be solved. This means that an algorithm will be exported expecially - * for this case, with extra optimizations by reusing as many intermediate results as possible. - * @param[in] unrolling A boolean that is true when the exported code for the linear solver needs to be unrolled - * completely. - * @param[in] newId The new identifier for this linear solver to be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const uint newDim, - const bool& reuse, - const bool& unrolling, - const std::string& newId - ); - - /** \todo DOC */ - returnValue init( unsigned _nRows, - unsigned _nCols, - unsigned _nBacksolves, - bool _reuse, - bool _unroll, - const std::string& _id - ); - - /** \todo DOC */ - returnValue init( unsigned _nRows, - unsigned _nCols, - unsigned _nBacksolves, - unsigned _nRightHandSides, - bool _reuse, - bool _unroll, - const std::string& _id - ); - - /** Adds all data declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const = 0; - - - /** Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getFunctionDeclarations( ExportStatementBlock& declarations - ) const = 0; - - - /** Exports source code of the auto-generated algorithm into the given directory. - * - * @param[in] code Code block containing the auto-generated algorithm. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue getCode( ExportStatementBlock& code - ) = 0; - - - /** Appends the names of the used variables to a given stringstream. - * - * @param[in] string The string to which the names of the used variables are appended. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue appendVariableNames( std::stringstream& string ) = 0; - - - /** Returns the dimensions of the linear system. - * - * \return The dimensions of the linear system. - */ - uint getDim() const; - - - /** Returns the dimension of the auxiliary variables for the linear solver. - * - * \return The dimension of the auxiliary variables for the linear solver. - */ - virtual ExportVariable getGlobalExportVariable( const uint factor ) const; - - - /** Returns a boolean that is true when an extra algorithm will be exported for reuse. - * - * \return A boolean that is true when an extra algorithm will be exported for reuse. - */ - bool getReuse() const; - - - /** Sets the boolean that is true when an extra algorithm will be exported for reuse. - * - * @param[in] reuse The new value of this boolean. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setReuse( const bool& reuse ); - - - /** Returns a boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse. - * - * \return A boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse. - */ - bool getTranspose() const; - - - /** Sets the boolean that is true when an extra algorithm will be exported for solving a transposed linear system based on reuse. - * - * @param[in] transpose The new value of this boolean. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setTranspose( const bool& transpose ); - - - /** Returns a boolean that is true when the exported code for the linear solver needs to be unrolled - * completely. - * - * \return A boolean that is true when the exported code for the linear solver needs to be unrolled - * completely. - */ - bool getUnrolling() const; - - - /** Sets the boolean that is true when the exported code for the linear solver needs to be unrolled - * completely. - * - * @param[in] unrolling The new value of this boolean. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setUnrolling( const bool& unrolling ); - - - /** Returns a string containing the name of the function which is exported to solve the linear system. - * - * \return A string containing the name of the function which is exported to solve the linear system. - */ - const std::string getNameSolveFunction(); - - - /** Returns a string containing the name of the function which is exported to solve the linear system with - * the reuse of previous results. - * - * \return A string containing the name of the function which is exported to solve the linear system with - * the reuse of previous results. - */ - const std::string getNameSolveReuseFunction(); - const std::string getNameSolveTransposeReuseFunction(); - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - protected: - - std::string identifier; /**< This identifier allows the use of more than one exported linear solver. */ - - bool UNROLLING; /**< The boolean that defines the unrolling. */ - bool REUSE; /**< The boolean that defines the reuse. */ - bool TRANSPOSE; - uint dim; /**< The dimensions of the linear system. */ - - unsigned nRows; /**< Number of rows of matrix A. */ - unsigned nCols; /**< Number of columns of matrix A. */ - unsigned nBacksolves; /**< Number of back-solves. */ - unsigned nRightHandSides; /**< Number of back-solves. */ - - // DEFINITION OF THE EXPORTVARIABLES - ExportVariable A; /**< Variable containing the matrix of the linear system. */ - ExportVariable b; /**< Variable containing the right-hand side of the linear system and it will also contain the solution. */ - - ExportFunction solve; /**< Function that solves the linear system. */ - ExportFunction solveTriangular; /**< Function that solves the upper-triangular system. */ - ExportFunction solveReuse; /**< Function that solves a linear system with the same matrix, reusing previous results. */ - ExportFunction solveReuseTranspose; /**< Function that solves a transposed linear system with the same matrix, reusing previous results. */ - - ExportVariable determinant; /**< Variable containing the matrix determinant. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_EXPORT_LINEAR_SOLVER_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_generation.hpp b/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_generation.hpp deleted file mode 100644 index 1ba00eef3c..0000000000 --- a/phonelibs/acado/include/acado/code_generation/linear_solvers/linear_solver_generation.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/code_generation/linear_solvers/code_generation.hpp - * \author Rien Quirynen - * \date 2012 - */ - -#ifndef ACADO_TOOLKIT_LINEAR_SOLVER_GENERATION_HPP -#define ACADO_TOOLKIT_LINEAR_SOLVER_GENERATION_HPP - - -// LIST OF HEADER FILES: -// ----------------------------------------------------- - - #include - #include - #include - #include - #include - #include - #include - -// ----------------------------------------------------- - - -#endif // ACADO_TOOLKIT_LINEAR_SOLVER_GENERATION_HPP diff --git a/phonelibs/acado/include/acado/code_generation/memory_allocator.hpp b/phonelibs/acado/include/acado/code_generation/memory_allocator.hpp deleted file mode 100644 index 705d39895e..0000000000 --- a/phonelibs/acado/include/acado/code_generation/memory_allocator.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/code_generation/memory_allocator.hpp - * \author Milan Vukov - * \date 2012 - */ - -#ifndef ACADO_TOLLKIT_MEMORY_ALLOCATOR -#define ACADO_TOLLKIT_MEMORY_ALLOCATOR - -#include -#include -#include - -BEGIN_NAMESPACE_ACADO - -class MemoryAllocator -{ -public: - MemoryAllocator() - {} - - ~MemoryAllocator() - {} - - returnValue acquire(ExportIndex& _obj); - - returnValue release(const ExportIndex& _obj); - - returnValue add(const ExportIndex& _obj); - - std::vector< ExportIndex > getPool( void ); - -private: - ObjectPool indices; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOLLKIT_MEMORY_ALLOCATOR - diff --git a/phonelibs/acado/include/acado/code_generation/object_pool.hpp b/phonelibs/acado/include/acado/code_generation/object_pool.hpp deleted file mode 100644 index e99074ed4a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/object_pool.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */// Object pool, a template - -#ifndef ACADO_TOOLKIT_OBJECT_POOL -#define ACADO_TOOLKIT_OBJECT_POOL - -#include -#include -#include - -/** An object pool class that creates and reuses objects of an arbitrary type. */ -template -< - /** Type of objects to store in the pool */ - typename T, - /** Comparator for object stored in the pool */ - typename C = std::less< T > -> -class ObjectPool -{ -public: - /** Default constructor */ - ObjectPool() - {} - - /** Default destructor */ - ~ObjectPool() - {} - - /** This function enables one to explicitly put an object into the pool. - * - * In case the object is already in the pool, the function returns false. - * Otherwise, it returns true. - * */ - bool add(const T& obj) - { - typename poolMap::const_iterator it = pool.find( obj ); - if (it == pool.end()) - { - pool.insert( std::make_pair(obj, true) ); - - return true; - } - - return false; - } - - bool busy( void ) - { - if (pool.size() == 0) - return true; - - typename poolMap::const_iterator it = pool.begin(); - for (; it != pool.end(); ++it) - if (it->second == false) - return false; - - return true; - } - - /** When user code demands an object, pool first looks if there is any spare - * object to return. In case there is not any available object in the pool, - * a new object will be created and returned. - * */ - bool acquire(T& obj) - { - if ( pool.size() ) - { - typename poolMap::iterator it = pool.begin(); - for (; it != pool.end(); ++it) - { - if (it->second == false) - break; - } - - if (it != pool.end()) - { - obj = it->first; - it->second = true; - - return true; - } - } - - return false; - } - - /** This function releases an object in the pool */ - bool release(const T& obj) - { - typename poolMap::iterator it = pool.find( obj ); - if (it != pool.end()) - { - it->second = false; - - return true; - } - - return false; - } - - /** This function return a vector containing all objects in the pool */ - std::vector< T > getPool() const - { - std::vector< T > v; - - typename poolMap::const_iterator it = pool.begin(); - for (; it != pool.end(); ++it) - v.push_back( it->first ); - - return v; - } - - /** Number of objects in the pool */ - unsigned size( void ) - { - return pool.size(); - } - -private: - typedef std::map poolMap; - - poolMap pool; -}; - -#endif // ACADO_TOOLKIT_OBJECT_POOL diff --git a/phonelibs/acado/include/acado/code_generation/ocp_export.hpp b/phonelibs/acado/include/acado/code_generation/ocp_export.hpp deleted file mode 100644 index 003443f513..0000000000 --- a/phonelibs/acado/include/acado/code_generation/ocp_export.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/acado/code_generation/ocp_export.hpp - * \authors Hans Joachim Ferreau, Boris Houska, Milan Vukov - * \date 2010 - 2014 - */ - -#ifndef ACADO_TOOLKIT_OCP_EXPORT_HPP -#define ACADO_TOOLKIT_OCP_EXPORT_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -class IntegratorExport; -class ExportNLPSolver; - -/** \brief A user class for auto-generation of OCP solvers. - * - * \ingroup UserInterfaces - * - * The class OCPexport is a user-interface to automatically generate tailored - * algorithms for fast model predictive control and moving horizon estimation. - * It takes an optimal control problem (OCP) formulation and generates code - * based on given user options, e.g specifying the number of integrator steps - * or the online QP solver. - * - * \authors Boris Houska, Hans Joachim Ferreau, Milan Vukov - * - * \note Based on the old mpc_export class. - */ -class OCPexport : public ExportModule -{ -public: - - /** Default constructor. - */ - OCPexport(); - - /** Constructor which takes OCP formulation. - * - * @param[in] _ocp OCP formulation for code export. - */ - OCPexport(const OCP& _ocp); - - /** Destructor. */ - virtual ~OCPexport() - {} - - /** Exports all files of the auto-generated code into the given directory. - * - * @param[in] dirName Name of directory to be used to export files. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( const std::string& dirName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16); - - /** Prints dimensions (i.e. number of variables and constraints) - * of underlying QP. - * - * \return SUCCESSFUL_RETURN - */ - returnValue printDimensionsQP(); - -protected: - - /** Sets-up code export and initializes underlying export modules. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_OPTION, \n - * RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n - * RET_ONLY_ODE_FOR_CODE_EXPORT, \n - * RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n - * RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n - * RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n - * RET_ONLY_BOUNDS_FOR_CODE_EXPORT, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue setup(); - - /** Checks whether OCP formulation is compatible with code export capabilities. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n - * RET_ONLY_ODE_FOR_CODE_EXPORT, \n - * RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n - * RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n - * RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n - * RET_ONLY_BOUNDS_FOR_CODE_EXPORT - */ - returnValue checkConsistency() const; - - /** Collects all data declarations of the auto-generated sub-modules to given - * list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue collectDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY) const; - - /** Collects all function (forward) declarations of the auto-generated sub-modules - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue collectFunctionDeclarations(ExportStatementBlock& declarations) const; - - /** Exports main header file for using the exported MHE algorithm. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportAcadoHeader( const std::string& _dirName, - const std::string& _fileName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16) const; - - /** Shared pointer to a tailored integrator. */ - std::shared_ptr< IntegratorExport > integrator; - - /** Shared pointer to an NLP solver. */ - std::shared_ptr< ExportNLPSolver > solver; - - /** Internal copy of the OCP object. */ - OCP ocp; -}; - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_OCP_EXPORT_HPP diff --git a/phonelibs/acado/include/acado/code_generation/register_nlp_solvers.hpp b/phonelibs/acado/include/acado/code_generation/register_nlp_solvers.hpp deleted file mode 100644 index c658f26151..0000000000 --- a/phonelibs/acado/include/acado/code_generation/register_nlp_solvers.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -/** - * \file include/code_generation/register_nlp_solvers.hpp - * \author Milan Vukov - * \date 2013 - */ - -#ifndef ACADO_TOOLKIT_REGISTER_NLP_SOLVERS_HPP -#define ACADO_TOOLKIT_REGISTER_NLP_SOLVERS_HPP - -#include - -BEGIN_NAMESPACE_ACADO - -/** \internal */ -static struct RegisterNlpSolvers -{ - RegisterNlpSolvers(); -} registerNlpSolvers; -/** \endinternal */ - -CLOSE_NAMESPACE_ACADO - -#endif // ACADO_TOOLKIT_REGISTER_NLP_SOLVERS_HPP diff --git a/phonelibs/acado/include/acado/code_generation/sim_export.hpp b/phonelibs/acado/include/acado/code_generation/sim_export.hpp deleted file mode 100644 index 7a855c3e13..0000000000 --- a/phonelibs/acado/include/acado/code_generation/sim_export.hpp +++ /dev/null @@ -1,348 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/code_generation/sim_export.hpp - * \author Rien Quirynen - * \date 2012 - */ - - -#ifndef ACADO_TOOLKIT_SIM_EXPORT_HPP -#define ACADO_TOOLKIT_SIM_EXPORT_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - -class IntegratorExport; - -/** - * \brief User-interface to automatically generate simulation algorithms for fast optimal control. - * - * \ingroup UserInterfaces - * - * The class SIMexport is a user-interface to automatically generate tailored - * simulation algorithms for fast optimal control. It takes an optimal control - * problem (OCP) formulation and generates code based on given user options, - * e.g specifying the integrator and the number of integration steps. - * In addition to the export of such a simulation algorithm, the performance - * of this integrator will be evaluated on accuracy of the results and the time - * complexity. - * - * \author Rien Quirynen - */ -class SIMexport : public ExportModule, public ModelContainer -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - * - * @param[in] simIntervals The number of simulation intervals. - * @param[in] totalTime The total simulation time. - */ - SIMexport( const uint simIntervals = 1, - const double totalTime = 1.0 ); - - /** Copy constructor (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SIMexport( const SIMexport& arg - ); - - /** Destructor. - */ - virtual ~SIMexport( ); - - /** Assignment operator (deep copy). - * - * @param[in] arg Right-hand side object. - */ - SIMexport& operator=( const SIMexport& arg - ); - - - /** Exports all files of the auto-generated code into the given directory. - * - * @param[in] dirName Name of directory to be used to export files. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportCode( const std::string& dirName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ); - - - /** Exports main header file for using the exported algorithm. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportAcadoHeader( const std::string& _dirName, - const std::string& _fileName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - - /** Exports all files of the auto-generated code into the given directory and runs the test - * to evaluate the performance of the exported integrator. - * - * @param[in] dirName Name of directory to be used to export files. - * @param[in] initStates Name of the file containing the initial values of all the states. - * @param[in] controls Name of the file containing the control values over the OCP grid. - * @param[in] results Name of the file in which the integration results will be written. - * @param[in] ref Name of the file in which the reference will be written, - * to which the results of the integrator will be compared. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue exportAndRun( const std::string& dirName, -// const std::string& initStates = std::string( "initStates.txt" ), - const std::string& initStates, -// const std::string& controls = std::string( "controls.txt" ), - const std::string& controls, - const std::string& results = std::string( "results.txt" ), - const std::string& ref = std::string( "ref.txt" ) - ); - - - /** This function should be used if the user wants to provide the file containing the - * reference solution, to which the results of the integrator are compared. - * - * @param[in] reference Name of the file containing the reference. - * @param[in] outputReference The names of the files containing the reference for the output results if any. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setReference( const std::string& reference, const std::vector& outputReference = *(new std::vector()) - ); - - - /** This function sets the number of integration steps performed for the timing results. - * - * @param[in] _timingSteps The new number of integration steps performed for the timing results. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setTimingSteps( uint _timingSteps - ); - - - /** This function sets a boolean if the exported simulation code should print all the details - * about the results or not. - * - * @param[in] details true if the exported simulation code should print all the details, otherwise false - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue printDetails( bool details ); - - - - protected: - - /** Copies all class members from given object. - * - * @param[in] arg Right-hand side object. - * - * \return SUCCESSFUL_RETURN - */ - returnValue copy( const SIMexport& arg - ); - - /** Frees internal dynamic memory to yield an empty function. - * - * \return SUCCESSFUL_RETURN - */ - returnValue clear( ); - - - /** Sets-up code export and initializes underlying export modules. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_OPTION, \n - * RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n - * RET_ONLY_ODE_FOR_CODE_EXPORT, \n - * RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n - * RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n - * RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n - * RET_ONLY_BOUNDS_FOR_CODE_EXPORT, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue setup( ); - - - /** Checks whether OCP formulation is compatible with code export capabilities. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_OBJECTIVE_FOR_CODE_EXPORT, \n - * RET_ONLY_ODE_FOR_CODE_EXPORT, \n - * RET_NO_DISCRETE_ODE_FOR_CODE_EXPORT, \n - * RET_ONLY_STATES_AND_CONTROLS_FOR_CODE_EXPORT, \n - * RET_ONLY_EQUIDISTANT_GRID_FOR_CODE_EXPORT, \n - * RET_ONLY_BOUNDS_FOR_CODE_EXPORT - */ - returnValue checkConsistency( ) const; - - - /** Collects all data declarations of the auto-generated sub-modules to given - * list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue collectDataDeclarations( ExportStatementBlock& declarations, - ExportStruct dataStruct = ACADO_ANY - ) const; - - /** Collects all function (forward) declarations of the auto-generated sub-modules - * to given list of declarations. - * - * @param[in] declarations List of declarations. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNABLE_TO_EXPORT_CODE - */ - returnValue collectFunctionDeclarations( ExportStatementBlock& declarations - ) const; - - - /** Exports test file with template main function for using the - * exported simulation algorithm. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * @param[in] _resultsFile Name of the file in which the integration results will be written. - * @param[in] _outputFiles Names of the files in which the output results will be written. - * @param[in] TIMING A boolean that is true when timing results are desired. - * @param[in] jumpReference The reference factor if the reference output results are computed. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportTest( const std::string& _dirName, - const std::string& _fileName, - const std::string& _resultsFile, - const std::vector& _outputFiles, - const bool& TIMING = false, - const uint jumpReference = 1 - ) const; - - /** Exports the file evaluating the performance of the exported integrator, - * based on its results from the test and the corresponding reference results. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportEvaluation( const std::string& _dirName, - const std::string& _fileName - ) const; - - /** Exports GNU Makefile for compiling the exported MPC algorithm. - * - * @param[in] _dirName Name of directory to be used to export file. - * @param[in] _fileName Name of file to be exported. - * @param[in] _realString std::string to be used to declare real variables. - * @param[in] _intString std::string to be used to declare integer variables. - * @param[in] _precision Number of digits to be used for exporting real values. - * - * \return SUCCESSFUL_RETURN - */ - returnValue exportMakefile( const std::string& _dirName, - const std::string& _fileName, - const std::string& _realString = "real_t", - const std::string& _intString = "int", - int _precision = 16 - ) const; - - /** Compiles the exported source files and runs the corresponding test. - * - * @param[in] _dirName Name of directory in which the files are exported. - * - * \return SUCCESSFUL_RETURN - */ - returnValue executeTest( const std::string& _dirName ); - - /** This function sets the number of calls performed for the timing results. - * - * @param[in] _timingCalls The new number of calls performed for the timing results. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setTimingCalls( uint _timingCalls - ); - - protected: - - uint timingCalls; /**< The number of calls to the exported function for the timing results. */ - - double T; /**< The total simulation time. */ - IntegratorExport* integrator; /**< Module for exporting a tailored integrator. */ - - bool referenceProvided; /**< True if the user provided a file with the reference solution. */ - bool PRINT_DETAILS; /**< True if the user wants all the details about the results being printed. */ - - static const uint factorRef = 10; /**< The used factor in the number of integration steps to get the reference. */ - uint timingSteps; /**< The number of integration steps performed for the timing results. */ - - std::string _initStates; /**< Name of the file containing the initial values of all the states. */ - std::string _controls; /**< Name of the file containing the control values over the OCP grid. */ - std::string _results; /**< Name of the file in which the integration results will be written. */ - std::string _ref; /**< Name of the file in which the reference will be written, - to which the results of the integrator will be compared. */ - std::vector _refOutputFiles; /**< Names of the files in which the outputs will be written for the reference. */ - std::vector _outputFiles; /**< Names of the files in which the outputs will be written for the integrator. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - -#endif // ACADO_TOOLKIT_SIM_EXPORT_HPP - -// end of file. diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_EH_solver_mex.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_EH_solver_mex.c.in deleted file mode 100644 index 53428c7518..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_EH_solver_mex.c.in +++ /dev/null @@ -1,479 +0,0 @@ -/* -input -{ - control: optional - 0: init once, and run preparation and feedback; default behaviour - 1: initialize - 2: preparation - 3: feedback - 4: shift - x - u - mu - od - x0: depends on the type of an OCP - xAC: optional - SAC: optional - shifting: optional - { - strategy: - 1: use xEnd - 2: integrate - xEnd - uEnd - } - initialization: optional - 1: initialize by a forward simulation - else: do nothing -} - -output -{ - x - u - mu - xAC: optional - SAC: optional - info - { - status - cpuTime - kktValue - objValue - nIterations: works only for qpOASES - } -} -*/ - -/** MEX interface for the ACADO OCP solver - * - * \author Milan Vukov, milan.vukov@esat.kuleuven.be - * - * Credits: Alexander Domahidi (ETHZ), Janick Frasch (KUL, OVGU) - * - */ - -#include -#include -#include -#include - -#include "mex.h" -#include "@MODULE_NAME@_common.h" -#include "@MODULE_NAME@_auxiliary_functions.h" - -#define FREE( mem ) { if( mem ) { mxFree( mem ); mem = NULL; } } - -/* Define number of outputs */ -#define NOO 4 - -#if @MODULE_PREFIX@_NXA > 0 -#define NOO_2 NOO + 1 -#else -#define NOO_2 NOO -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 -#define NOO_3 NOO_2 + 2 -#else -#define NOO_3 NOO_2 -#endif - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -#define NOO_4 NOO_3 + 1 -#else -#define NOO_4 NOO_3 -#endif - -/** Instance of the user data structure. */ -@MODULE_PREFIX@variables @MODULE_NAME@Variables; -/** Instance of the private workspace structure. */ -@MODULE_PREFIX@workspace @MODULE_NAME@Workspace; - -/** A bit more advanced printing function. */ -void mexErrMsgTxtAdv( char* string, - ... - ) -{ - static char buffer[ 128 ]; - - va_list printArgs; - va_start(printArgs, string); - - vsprintf(buffer, string, printArgs); - va_end( printArgs ); - - mexErrMsgTxt( buffer ); -} - -/** A simple helper function. */ -void printMatrix( const char* name, - real_t* mat, - unsigned nRows, - unsigned nCols - ) -{ - unsigned r, c; - mexPrintf("%s: \n", name); - for (r = 0; r < nRows; ++r) - { - for(c = 0; c < nCols; ++c) - mexPrintf("\t%f", mat[r * nCols + c]); - mexPrintf("\n"); - } -} - -/** A function for copying data from MATLAB to C array. */ -int getArray( const unsigned mandatory, - const mxArray* source, - const int index, - const char* name, - real_t* destination, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxGetField(source, index, name); - unsigned i, j; - double* dPtr; - - if (mxPtr == NULL) - { - if ( !mandatory ) - return -1; - else - mexErrMsgTxtAdv("Field %s not found.", name); - } - - if ( !mxIsDouble( mxPtr ) ) - mexErrMsgTxtAdv("Field %s must be an array of doubles.", name); - - if (mxGetM( mxPtr ) != nRows || mxGetN( mxPtr ) != nCols ) - mexErrMsgTxtAdv("Field %s must be of size: %d x %d.", name, nRows, nCols); - - dPtr = mxGetPr( mxPtr ); - - if (destination == NULL) - destination = (real_t*)mxCalloc(nRows * nCols, sizeof( real_t )); - - if (nRows == 1 && nCols == 1) - *destination = *dPtr; - else - for (i = 0; i < nRows; ++i) - for (j = 0; j < nCols; ++j) - destination[i * nCols + j] = (real_t)dPtr[j * nRows + i]; - - return 0; -} - -void setArray( mxArray* destination, - const int index, - const char* name, - real_t* source, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxCreateDoubleMatrix(nRows, nCols, mxREAL); - double* dPtr = mxGetPr( mxPtr ); - unsigned i, j; - - if (nRows == 1 && nCols == 1) - *dPtr = *source; - else - for (i = 0; i < nRows; ++i) - for(j = 0; j < nCols; ++j) - dPtr[j * nRows + i] = (double)source[i * nCols + j]; - - mxSetField(destination, index, name, mxPtr); -} - -/** The MEX interface function. */ -void mexFunction( int nlhs, - mxArray *plhs[], - int nrhs, - const mxArray *prhs[] - ) -{ - static unsigned initialized = 0; - unsigned ctrl; - int ctrlIndex, i, j; - unsigned strategy; - unsigned initType; - real_t* xEnd = NULL; - real_t* uEnd = NULL; - const mxArray* src = prhs[ 0 ]; - - const char *infoNames[ 5 ] = {"status", "cpuTime", "kktValue", "objValue", "nIterations"}; - mxArray* info; - double status, cpuTime, kktValue, objValue; - double tmp[ 1 ]; - mxArray* shPtr; - @MODULE_NAME@_timer tmr; - double nIterations = 0; - - const char *outNames[ NOO_4 ]; - outNames[ 0 ] = "info"; - outNames[ 1 ] = "x"; - outNames[ 2 ] = "u"; - outNames[ 3 ] = "mu"; -#if @MODULE_PREFIX@_NXA - outNames[ NOO ] = "z"; -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - outNames[ NOO_2 ] = "xAC"; - outNames[NOO_2 + 1] = "SAC"; -#endif -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - outNames[ NOO_3 ] = "sigmaN"; -#endif - - if (nrhs != 1) - mexErrMsgTxt( - "This function requires exactly one input: a structure with parameters."); - - if (nlhs != 1) - mexErrMsgTxt( - "This function returns one output."); - - if( !mxIsStruct( src ) ) - mexErrMsgTxt("The function argument must be a structure."); - - /* Get the control flag. */ - if (getArray(0, src, 0, "control", tmp, 1, 1) == 0) - ctrl = (unsigned)tmp[ 0 ]; - else - ctrl = 0; - - /* Get the initialization flag. */ - if (getArray(0, src, 0, "initialization", tmp, 1, 1) == 0) - initType = (unsigned)tmp[ 0 ]; - else - initType = 0; - - /* Copy MATLAB arrays to C arrays. */ - getArray(1, src, 0, "x", @MODULE_NAME@Variables.x, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NX); - getArray(1, src, 0, "u", @MODULE_NAME@Variables.u, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NU); - getArray(1, src, 0, "mu", @MODULE_NAME@Variables.mu, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NX); - -#if @MODULE_PREFIX@_NXA - getArray(1, src, 0, "z", @MODULE_NAME@Variables.z, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NXA); -#endif - -#if @MODULE_PREFIX@_NOD - getArray(1, src, 0, "od", @MODULE_NAME@Variables.od, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NOD); -#endif - -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED - getArray(1, src, 0, "x0", @MODULE_NAME@Variables.x0, 1, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_INITIAL_STATE_FIXED */ - -#if (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - - if (!initialized) - { - @MODULE_NAME@_initializeSolver(); - } - - /* Bounds */ -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED == 1 - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); -#else - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_NX + @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_NX + @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); -#endif /* @MODULE_PREFIX@_INITIAL_STATE_FIXED == 0 */ - -#if QPOASES_NCMAX > 0 - /* Affine constraints */ - getArray(1, src, 0, "lbAValues", @MODULE_NAME@Variables.lbAValues, QPOASES_NCMAX, 1); - getArray(1, src, 0, "ubAValues", @MODULE_NAME@Variables.ubAValues, QPOASES_NCMAX, 1); -#endif /* QPOASES_NCMAX > 0 */ - -#endif /* (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - -#if (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES) - if (!initialized) { - @MODULE_NAME@_initializeSolver(); - } -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - getArray(1, src, 0, "xAC", @MODULE_NAME@Variables.xAC, @MODULE_PREFIX@_NX, 1); - getArray(1, src, 0, "SAC", @MODULE_NAME@Variables.SAC, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); - getArray(1, src, 0, "WL", @MODULE_NAME@Variables.WL, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif - - /* Shifting strategy */ - shPtr = mxGetField(src, 0, "shifting"); - if (shPtr != NULL) - { - if( !mxIsStruct( shPtr ) ) - mexErrMsgTxt("Field \"shifting\" must be defined with a structure."); - - /* Get the shifting strategy flag */ - getArray(1, shPtr, 0, "strategy", tmp, 1, 1); - strategy = (unsigned)tmp[ 0 ]; - - if (strategy > 2) - mexErrMsgTxt("Valid options for the shifting strategy are 1 or 2."); - - getArray(0, shPtr, 0, "xEnd", xEnd, @MODULE_PREFIX@_NX, 1); - getArray(0, shPtr, 0, "uEnd", uEnd, @MODULE_PREFIX@_NU, 1); - } - else - strategy = 0; - - @MODULE_NAME@_tic( &tmr ); - - /* Call solver */ - switch ( ctrl ) - { - case 0: - /* Simple operational mode. Run one RTI with optional shifting. */ - - if ( !initialized ) - { - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - -#if @MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 1 - @MODULE_NAME@_initializeSolver(); -#endif /* @MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 1 */ - - /*for( i = 0; i < ACADO_N*ACADO_RK_NIS; i++ ) { - for( j = 0; j < ACADO_RK_NSTAGES*(ACADO_NX+ACADO_NXA); j++ ) { - acadoWorkspace.rk_A_traj[i*ACADO_RK_NSTAGES*(ACADO_NX+ACADO_NXA)*ACADO_RK_NSTAGES*(ACADO_NX+ACADO_NXA)+j*ACADO_RK_NSTAGES*(ACADO_NX+ACADO_NXA)+j] = 1.0; - } - }*/ - - if (initType == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 1 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - initialized = 1; - } - else if (strategy == 1 || strategy == 2) - { -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 0 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - @MODULE_NAME@_shiftStates(strategy, xEnd, uEnd); - @MODULE_NAME@_shiftControls(uEnd); - } - - @MODULE_NAME@_preparationStep(); - - status = (double)@MODULE_NAME@_feedbackStep(); - - kktValue = @MODULE_NAME@_getKKT(); - objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - nIterations = (double)@MODULE_NAME@_getNWSR(); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - break; - - case 1: - /* Initialize */ - - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - - @MODULE_NAME@_initializeSolver(); - - if (initType == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 1 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - break; - - case 2: - /* Preparation step */ - - @MODULE_NAME@_preparationStep(); - - break; - - case 3: - /* Feedback step */ - - status = (double)@MODULE_NAME@_feedbackStep(); - - kktValue = @MODULE_NAME@_getKKT(); - objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - nIterations = (double)@MODULE_NAME@_getNWSR(); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - break; - - case 4: - /* Shifting */ - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 0 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - @MODULE_NAME@_shiftStates(strategy, xEnd, uEnd); - @MODULE_NAME@_shiftControls( uEnd ); - - break; - - default: - /* Return an error */ - mexErrMsgTxt("Unknown control code."); - } - - cpuTime = @MODULE_NAME@_toc( &tmr ); - - /* Prepare return argument */ - - plhs[ 0 ] = mxCreateStructMatrix(1, 1, NOO_4, outNames); - - setArray(plhs[ 0 ], 0, "x", @MODULE_NAME@Variables.x, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NX); - setArray(plhs[ 0 ], 0, "u", @MODULE_NAME@Variables.u, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NU); - setArray(plhs[ 0 ], 0, "mu", @MODULE_NAME@Variables.mu, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NX); -#if @MODULE_PREFIX@_NXA > 0 - setArray(plhs[ 0 ], 0, "z", @MODULE_NAME@Variables.z, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NXA); -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - setArray(plhs[ 0 ], 0, "xAC", @MODULE_NAME@Variables.xAC, @MODULE_PREFIX@_NX, 1); - setArray(plhs[ 0 ], 0, "SAC", @MODULE_NAME@Variables.SAC, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST */ - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - setArray(plhs[ 0 ], 0, "sigmaN", @MODULE_NAME@Variables.sigmaN, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - - /* Create the info structure. */ - info = mxCreateStructMatrix(1, 1, 5, infoNames); - - setArray(info, 0, "status", &status, 1, 1); - setArray(info, 0, "cpuTime", &cpuTime, 1, 1); - setArray(info, 0, "kktValue", &kktValue, 1, 1); - setArray(info, 0, "objValue", &objValue, 1, 1); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - setArray(info, 0, "nIterations", &nIterations, 1, 1); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - mxSetField(plhs[ 0 ], 0, "info", info); - - /* Cleanup of the allocated memory */ - FREE( xEnd ); - FREE( uEnd ); -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.c.in deleted file mode 100644 index 4d8758f6eb..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.c.in +++ /dev/null @@ -1,193 +0,0 @@ -#include "@MODULE_NAME@_auxiliary_functions.h" - -#include - -real_t* @MODULE_NAME@_getVariablesX( ) -{ - return @MODULE_NAME@Variables.x; -} - -real_t* @MODULE_NAME@_getVariablesU( ) -{ - return @MODULE_NAME@Variables.u; -} - -#if @MODULE_PREFIX@_NY > 0 -real_t* @MODULE_NAME@_getVariablesY( ) -{ - return @MODULE_NAME@Variables.y; -} -#endif - -#if @MODULE_PREFIX@_NYN > 0 -real_t* @MODULE_NAME@_getVariablesYN( ) -{ - return @MODULE_NAME@Variables.yN; -} -#endif - -real_t* @MODULE_NAME@_getVariablesX0( ) -{ -#if @MODULE_PREFIX@_INITIAL_VALUE_FIXED - return @MODULE_NAME@Variables.x0; -#else - return 0; -#endif -} - -/** Print differential variables. */ -void @MODULE_NAME@_printDifferentialVariables( ) -{ - int i, j; - printf("\nDifferential variables:\n[\n"); - for (i = 0; i < @MODULE_PREFIX@_N + 1; ++i) - { - for (j = 0; j < @MODULE_PREFIX@_NX; ++j) - printf("\t%e", @MODULE_NAME@Variables.x[i * @MODULE_PREFIX@_NX + j]); - printf("\n"); - } - printf("]\n\n"); -} - -/** Print control variables. */ -void @MODULE_NAME@_printControlVariables( ) -{ - int i, j; - printf("\nControl variables:\n[\n"); - for (i = 0; i < @MODULE_PREFIX@_N; ++i) - { - for (j = 0; j < @MODULE_PREFIX@_NU; ++j) - printf("\t%e", @MODULE_NAME@Variables.u[i * @MODULE_PREFIX@_NU + j]); - printf("\n"); - } - printf("]\n\n"); -} - -/** Print ACADO code generation notice. */ -void @MODULE_NAME@_printHeader( ) -{ - printf( - "\nACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.\n" - "Copyright (C) 2008-2015 by Boris Houska, Hans Joachim Ferreau,\n" - "Milan Vukov and Rien Quirynen, KU Leuven.\n" - ); - - printf( - "Developed within the Optimization in Engineering Center (OPTEC) under\n" - "supervision of Moritz Diehl. All rights reserved.\n\n" - "ACADO Toolkit is distributed under the terms of the GNU Lesser\n" - "General Public License 3 in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU Lesser General Public License for more details.\n\n" - ); -} - -#if !(defined _DSPACE) -#if (defined _WIN32 || defined _WIN64) && !(defined __MINGW32__ || defined __MINGW64__) - -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - QueryPerformanceFrequency(&t->freq); - QueryPerformanceCounter(&t->tic); -} - -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - QueryPerformanceCounter(&t->toc); - return ((t->toc.QuadPart - t->tic.QuadPart) / (real_t)t->freq.QuadPart); -} - - -#elif (defined __APPLE__) - -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - /* read current clock cycles */ - t->tic = mach_absolute_time(); -} - -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - - uint64_t duration; /* elapsed time in clock cycles*/ - - t->toc = mach_absolute_time(); - duration = t->toc - t->tic; - - /*conversion from clock cycles to nanoseconds*/ - mach_timebase_info(&(t->tinfo)); - duration *= t->tinfo.numer; - duration /= t->tinfo.denom; - - return (real_t)duration / 1e9; -} - -#else - -#if __STDC_VERSION__ >= 199901L -/* C99 mode */ - -/* read current time */ -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - gettimeofday(&t->tic, 0); -} - -/* return time passed since last call to tic on this timer */ -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - struct timeval temp; - - gettimeofday(&t->toc, 0); - - if ((t->toc.tv_usec - t->tic.tv_usec) < 0) - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec - 1; - temp.tv_usec = 1000000 + t->toc.tv_usec - t->tic.tv_usec; - } - else - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec; - temp.tv_usec = t->toc.tv_usec - t->tic.tv_usec; - } - - return (real_t)temp.tv_sec + (real_t)temp.tv_usec / 1e6; -} - -#else -/* ANSI */ - -/* read current time */ -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - clock_gettime(CLOCK_MONOTONIC, &t->tic); -} - - -/* return time passed since last call to tic on this timer */ -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - struct timespec temp; - - clock_gettime(CLOCK_MONOTONIC, &t->toc); - - if ((t->toc.tv_nsec - t->tic.tv_nsec) < 0) - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec - 1; - temp.tv_nsec = 1000000000+t->toc.tv_nsec - t->tic.tv_nsec; - } - else - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec; - temp.tv_nsec = t->toc.tv_nsec - t->tic.tv_nsec; - } - - return (real_t)temp.tv_sec + (real_t)temp.tv_nsec / 1e9; -} - -#endif /* __STDC_VERSION__ >= 199901L */ - -#endif /* (defined _WIN32 || _WIN64) */ - -#endif diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.h.in b/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.h.in deleted file mode 100644 index db5e2b9f6a..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_functions.h.in +++ /dev/null @@ -1,119 +0,0 @@ -#ifndef @MODULE_PREFIX@_AUXILIARY_FUNCTIONS_H -#define @MODULE_PREFIX@_AUXILIARY_FUNCTIONS_H - -#include "@MODULE_NAME@_common.h" - -#ifndef __MATLAB__ -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -/** Get pointer to the matrix with differential variables. */ -real_t* @MODULE_NAME@_getVariablesX( ); - -/** Get pointer to the matrix with control variables. */ -real_t* @MODULE_NAME@_getVariablesU( ); - -#if @MODULE_PREFIX@_NY > 0 -/** Get pointer to the matrix with references/measurements. */ -real_t* @MODULE_NAME@_getVariablesY( ); -#endif - -#if @MODULE_PREFIX@_NYN > 0 -/** Get pointer to the vector with references/measurement on the last node. */ -real_t* @MODULE_NAME@_getVariablesYN( ); -#endif - -/** Get pointer to the current state feedback vector. Only applicable for NMPC. */ -real_t* @MODULE_NAME@_getVariablesX0( ); - -/** Print differential variables. */ -void @MODULE_NAME@_printDifferentialVariables( ); - -/** Print control variables. */ -void @MODULE_NAME@_printControlVariables( ); - -/** Print ACADO code generation notice. */ -void @MODULE_NAME@_printHeader( ); - -/* - * A huge thanks goes to Alexander Domahidi from ETHZ, Switzerland, for - * providing us with the following timing routines. - */ - -#if !(defined _DSPACE) -#if (defined _WIN32 || defined _WIN64) && !(defined __MINGW32__ || defined __MINGW64__) - -/* Use Windows QueryPerformanceCounter for timing. */ -#include - -/** A structure for keeping internal timer data. */ -typedef struct @MODULE_NAME@_timer_ -{ - LARGE_INTEGER tic; - LARGE_INTEGER toc; - LARGE_INTEGER freq; -} @MODULE_NAME@_timer; - - -#elif (defined __APPLE__) - -#include "unistd.h" -#include - -/** A structure for keeping internal timer data. */ -typedef struct @MODULE_NAME@_timer_ -{ - uint64_t tic; - uint64_t toc; - mach_timebase_info_data_t tinfo; -} @MODULE_NAME@_timer; - -#else - -/* Use POSIX clock_gettime() for timing on non-Windows machines. */ -#include - -#if __STDC_VERSION__ >= 199901L -/* C99 mode of operation. */ - -#include -#include - -typedef struct @MODULE_NAME@_timer_ -{ - struct timeval tic; - struct timeval toc; -} @MODULE_NAME@_timer; - -#else -/* ANSI C */ - -/** A structure for keeping internal timer data. */ -typedef struct @MODULE_NAME@_timer_ -{ - struct timespec tic; - struct timespec toc; -} @MODULE_NAME@_timer; - -#endif /* __STDC_VERSION__ >= 199901L */ - -#endif /* (defined _WIN32 || defined _WIN64) */ - -/** A function for measurement of the current time. */ -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ); - -/** A function which returns the elapsed time. */ -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ); - -#endif - -#ifndef __MATLAB__ -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -#endif /* @MODULE_PREFIX@_AUXILIARY_FUNCTIONS_H */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.c.in deleted file mode 100644 index 9472675756..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.c.in +++ /dev/null @@ -1,91 +0,0 @@ -#include "@MODULE_NAME@_auxiliary_sim_functions.h" - -/** Print ACADO code generation notice. */ -void @MODULE_NAME@_printHeader( ) -{ - printf( - "\nACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.\n" - "Copyright (C) 2008-2015 by Boris Houska, Hans Joachim Ferreau,\n" - "Milan Vukov and Rien Quirynen, KU Leuven.\n" - ); - - printf( - "Developed within the Optimization in Engineering Center (OPTEC) under\n" - "supervision of Moritz Diehl. All rights reserved.\n\n" - "ACADO Toolkit is distributed under the terms of the GNU Lesser\n" - "General Public License 3 in the hope that it will be useful,\n" - "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" - "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" - "GNU Lesser General Public License for more details.\n\n" - ); -} - -#if (defined _WIN32 || _WIN64) - -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - QueryPerformanceFrequency(&t->freq); - QueryPerformanceCounter(&t->tic); -} - -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - QueryPerformanceCounter(&t->toc); - return ((t->toc.QuadPart - t->tic.QuadPart) / (real_t)t->freq.QuadPart); -} - - -#elif (defined __APPLE__) - -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - /* read current clock cycles */ - t->tic = mach_absolute_time(); -} - -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - - uint64_t duration; /* elapsed time in clock cycles*/ - - t->toc = mach_absolute_time(); - duration = t->toc - t->tic; - - /*conversion from clock cycles to nanoseconds*/ - mach_timebase_info(&(t->tinfo)); - duration *= t->tinfo.numer; - duration /= t->tinfo.denom; - - return (real_t)duration / 1e9; -} - -#else - -/* read current time */ -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ) -{ - gettimeofday(&t->tic, 0); -} - -/* return time passed since last call to tic on this timer */ -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ) -{ - struct timeval temp; - - gettimeofday(&t->toc, 0); - - if ((t->toc.tv_usec - t->tic.tv_usec) < 0) - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec - 1; - temp.tv_usec = 1000000 + t->toc.tv_usec - t->tic.tv_usec; - } - else - { - temp.tv_sec = t->toc.tv_sec - t->tic.tv_sec; - temp.tv_usec = t->toc.tv_usec - t->tic.tv_usec; - } - - return (real_t)temp.tv_sec + (real_t)temp.tv_usec / 1e6; -} - -#endif /* (defined _WIN32 || _WIN64) */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.h.in b/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.h.in deleted file mode 100644 index fa7eed6ca4..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_auxiliary_sim_functions.h.in +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef @MODULE_PREFIX@_AUXILIARY_SIM_FUNCTIONS_H -#define @MODULE_PREFIX@_AUXILIARY_SIM_FUNCTIONS_H - -#include "@MODULE_NAME@_common.h" -#include - -#ifndef __MATLAB__ -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -/** Print ACADO code generation notice. */ -void @MODULE_NAME@_printHeader( ); - -/* - * A huge thanks goes to Alexander Domahidi from ETHZ, Switzerland, for - * providing us with the following timing routines. - */ - -#if (defined _WIN32 || defined _WIN64) - -/* Use Windows QueryPerformanceCounter for timing. */ -#include - -/** A structure for keeping internal timer data. */ -typedef struct @MODULE_NAME@_timer_ -{ - LARGE_INTEGER tic; - LARGE_INTEGER toc; - LARGE_INTEGER freq; -} @MODULE_NAME@_timer; - - -#elif (defined __APPLE__) - -#include "unistd.h" -#include - -/** A structure for keeping internal timer data. */ -typedef struct @MODULE_NAME@_timer_ -{ - uint64_t tic; - uint64_t toc; - mach_timebase_info_data_t tinfo; -} @MODULE_NAME@_timer; - -#else - -/* Use POSIX clock_gettime() for timing on non-Windows machines. */ -#include - -#include -#include - -typedef struct @MODULE_NAME@_timer_ -{ - struct timeval tic; - struct timeval toc; -} @MODULE_NAME@_timer; - -#endif /* (defined _WIN32 || defined _WIN64) */ - -/** A function for measurement of the current time. */ -void @MODULE_NAME@_tic( @MODULE_NAME@_timer* t ); - -/** A function which returns the elapsed time. */ -real_t @MODULE_NAME@_toc( @MODULE_NAME@_timer* t ); - -#ifndef __MATLAB__ -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -#endif /* @MODULE_PREFIX@_AUXILIARY_SIM_FUNCTIONS_H */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_common_header.h.in b/phonelibs/acado/include/acado/code_generation/templates/acado_common_header.h.in deleted file mode 100644 index 3bfb30c5be..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_common_header.h.in +++ /dev/null @@ -1,70 +0,0 @@ -#ifndef @MODULE_PREFIX@_COMMON_H -#define @MODULE_PREFIX@_COMMON_H - -#include -#include - -#ifndef __MATLAB__ -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -/** \defgroup @MODULE_PREFIX@ ACADO CGT generated module. */ -/** @{ */ - -@QP_SOLVER_INTERFACE@ - -/* - * Common definitions - */ -@COMMON_DEFINITIONS@ - -/* - * Globally used structure definitions - */ - -/** The structure containing the user data. - * - * Via this structure the user "communicates" with the solver code. - */ -typedef struct @MODULE_PREFIX@variables_ -{ -int dummy; -@VARIABLES_DECLARATION@ -} @MODULE_PREFIX@variables; - -/** Private workspace used by the auto-generated code. - * - * Data members of this structure are private to the solver. - * In other words, the user code should not modify values of this - * structure. - */ -typedef struct @MODULE_PREFIX@workspace_ -{ -@WORKSPACE_DECLARATION@ -} @MODULE_PREFIX@workspace; - -/* - * Forward function declarations. - */ - -@FUNCTION_DECLARATIONS@ - -/* - * Extern declarations. - */ - -extern @MODULE_PREFIX@workspace @MODULE_NAME@Workspace; -extern @MODULE_PREFIX@variables @MODULE_NAME@Variables; - -/** @} */ - -#ifndef __MATLAB__ -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ -#endif /* __MATLAB__ */ - -#endif /* @MODULE_PREFIX@_COMMON_H */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.m.in b/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.m.in deleted file mode 100644 index 507ca15a08..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.m.in +++ /dev/null @@ -1,221 +0,0 @@ -clear stages params outputs codeoptions - -%% Generator for a FORCES QP solver used by the ACADO OCP solver - -% -% User options -% - -% Number of states -nx = @NX@; -% Number of controls -nu = @NU@; -% Number of discretization (shooting) nodes -N = @N@; - -% Lower and upper bounds on stage variables, for all N stages -lbIdx = { ... - @LB_IDX@ ... -}; -ubIdx = { ... - @UB_IDX@ ... -}; - -% Polytopic constraints (A_i*z_i <= b_i) on stage variables, for all N stages -AbDim = { ... - @AB_DIM@ ... -}; - -% Constant Hessian -constHessian = @CONST_HESSIAN@; -% Diagonal Hessian -diagHessian = @DIAG_HESSIAN@; -diagHessianN = @DIAG_HESSIAN_N@; -% Fixed initial state -fixedInitialState = @FIXED_INITIAL_STATE@; - -%% Define FORCES multistage problem - -stages = MultistageProblem( N ); - -for i = 1: N - if (i == 1) - - % - % Initial stage - % - - % Dimension - stages(i).dims.n = nx + nu; % number of stage variables - stages(i).dims.r = nx; % number of equality constraints - stages(i).dims.l = length( lbIdx{ i } ); % number of lower bounds - stages(i).dims.u = length( ubIdx{ i } ); % number of upper bounds - stages(i).dims.p = AbDim{ i }; % number of polytopic constraints - stages(i).dims.q = 0; % number of quadratic constraints - - % Cost - if (constHessian == 1) - if (diagHessian == 1) - params( 1 ) = newParam('H1', 1: 1: N - 1, 'cost.H', 'diag'); - else - params( 1 ) = newParam('H1', 1: 1: N - 1, 'cost.H'); - end; - else - if (diagHessian == 1) - params( 1 ) = newParam('H1', 1, 'cost.H', 'diag'); - else - params( 1 ) = newParam('H1', 1, 'cost.H'); - end; - end; - params(end + 1) = newParam('f1', 1, 'cost.f'); - - % Lower bounds - stages(i).ineq.b.lbidx = cell2mat( lbIdx{ i } ); - if (~isempty( lbIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'lb', i), i, 'ineq.b.lb'); - end; - - % Upper bounds - stages(i).ineq.b.ubidx = cell2mat( ubIdx{ i } ); - if (~isempty( ubIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'ub', i), i, 'ineq.b.ub'); - end; - - % Polytopic constraints - % stages(i).ineq.p.bidx = cell2mat( AbIdx{ i } ); - if (AbDim{ i } ~= 0) - params(end + 1) = newParam(sprintf('%s%d', 'Ab', i), i, 'ineq.p.b'); - params(end + 1) = newParam(sprintf('%s%d', 'A', i), i, 'ineq.p.A'); - end - - % equality constraints - params(end + 1) = newParam('C1', 1, 'eq.C'); - params(end + 1) = newParam('d1', 1, 'eq.c'); - - if (fixedInitialState == 1) - stages(i).eq.D = [eye(nx), zeros(nx,nu)]; - end; - - elseif (i < N) - - % - % Stages along horizon - % - - % Dimension - stages(i).dims.n = nx + nu; % number of stage variables - stages(i).dims.r = nx; % number of equality constraints - stages(i).dims.l = length( lbIdx{ i } ); % number of lower bounds - stages(i).dims.u = length( ubIdx{ i } ); % number of upper bounds - stages(i).dims.p = AbDim{ i }; % number of polytopic constraints - stages(i).dims.q = 0; % number of quadratic constraints - - % Cost - if (constHessian == 0) - if (diagHessian == 1) - params(end + 1) = newParam(sprintf('%s%d', 'H', i), i, 'cost.H', 'diag'); - else - params(end + 1) = newParam(sprintf('%s%d', 'H', i), i, 'cost.H'); - end; - end; - params(end + 1) = newParam(sprintf('%s%d', 'f', i), i, 'cost.f'); - - % Lower bounds - stages(i).ineq.b.lbidx = cell2mat( lbIdx{ i } ); - if (~isempty( lbIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'lb', i), i, 'ineq.b.lb'); - end; - - % Upper bounds - stages(i).ineq.b.ubidx = cell2mat( ubIdx{ i } ); - if (~isempty( ubIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'ub', i), i, 'ineq.b.ub'); - end; - - % Polytopic constraints - % stages(i).ineq.p.bidx = cell2mat( AbIdx{ i } ); - if (AbDim{ i } ~= 0) - params(end + 1) = newParam(sprintf('%s%d', 'Ab', i), i, 'ineq.p.b'); - params(end + 1) = newParam(sprintf('%s%d', 'A', i), i, 'ineq.p.A'); - end - - % Equality constraints - params(end + 1) = newParam(sprintf('%s%d', 'C', i), i, 'eq.C'); - params(end + 1) = newParam(sprintf('%s%d', 'd', i), i, 'eq.c'); - - stages(i).eq.D = [-eye( nx ), zeros(nx, nu)]; - - else - - % - % Final stage - % - - % Dimension - stages(i).dims.n = nx; % number of stage variables - - if (fixedInitialState == 1) - stages(i).dims.r = nx; % number of equality constraints - else - stages(i).dims.r = 0; - end; - - stages(i).dims.l = length( lbIdx{ i } ); % number of lower bounds - stages(i).dims.u = length( ubIdx{ i } ); % number of upper bounds - stages(i).dims.p = AbDim{ i }; % number of polytopic constraints - stages(i).dims.q = 0; % number of quadratic constraints - - % Cost - if (diagHessianN == 1) - params(end + 1) = newParam(sprintf('%s%d', 'H', i), i, 'cost.H', 'diag'); - else - params(end + 1) = newParam(sprintf('%s%d', 'H', i), i, 'cost.H'); - end; - params(end + 1) = newParam(sprintf('%s%d', 'f', i), i, 'cost.f'); - - % Lower bounds - stages(i).ineq.b.lbidx = cell2mat( lbIdx{ i } ); - if (~isempty( lbIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'lb', i), i, 'ineq.b.lb'); - end; - - % Upper bounds - stages(i).ineq.b.ubidx = cell2mat( ubIdx{ i } ); - if (~isempty( ubIdx{ i } )) - params(end + 1) = newParam(sprintf('%s%d', 'ub', i), i, 'ineq.b.ub'); - end; - - % Polytopic constraints - % stages(i).ineq.p.bidx = cell2mat( AbIdx{ i } ); - if (AbDim{ i } ~= 0) - params(end + 1) = newParam(sprintf('%s%d', 'Ab', i), i, 'ineq.p.b'); - params(end + 1) = newParam(sprintf('%s%d', 'A', i), i, 'ineq.p.A'); - end - - % Equality constraints - stages(i).eq.D = -eye(nx); - - if (fixedInitialState == 1) - params(end + 1) = newParam(sprintf('%s%d', 'd', i), i, 'eq.c'); - end; - - end; -end; - -%% Define outputs of the solver -for i = 1: N - outputs( i ) = newOutput(sprintf('%s%d', 'out', i), i, 1: 1: stages(i).dims.n); -end; - -%% Solver settings -codeoptions = getOptions('@SOLVER_NAME@'); - -codeoptions.overwrite = 1; % Always overwrite the existing code -codeoptions.printlevel = @PRINT_LEVEL@; -codeoptions.maxit = @MAX_ITERATIONS@; -codeoptions.parallel = @PARALLEL@; -codeoptions.init = @WARM_START@; - - -%% Generate code -generateCode(stages, params, codeoptions, outputs); diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.py.in b/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.py.in deleted file mode 100644 index cae5368a2c..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_forces_generator.py.in +++ /dev/null @@ -1,313 +0,0 @@ - -""" -Python generator for FORCES solvers. - -Dependencies: - - numpy - - scipy - - suds - - urllib - - zipfile - -Copyright 2014 Milan Vukov, KU Leuven, Juan Jerez, EMBOTECH. - -Please note that although the ACADO generated code is released under LGPL -license, FORCES generated code is licensed under terms of the GPL license. -""" - -import numpy as np - -class MultistageProblem( object ): - def __init__(self, N): - # Number of stages - self.N = N - # Initialize dimensions: - self.dims = [ - {'n': [], 'r': [], 'l': [], 'u': [], 'p': [], 'q': [], 'd': float(3)} - for k in range( N )] # d is just a dummy var - # Initialize cost structs - self.cost = [{'H': [], 'f': [], 'du': float(3)} for k in range( N )] # du is just a dummy var - # Initialize structs for equality constraints - self.eq = [{'C': [], 'c': [], 'D': [], 'd': float(3)} for k in range( N )] # d is just a dummy var - # Initialize structs for inequality constraints - self.ineq = [ - { - 'b': {'lb': [], 'lbidx': [], 'ub': [], 'ubidx': [], 'd': float(3)}, - 'p': {'A': [], 'b': [], 'd': float(3)}, - 'q': {'Q': [], 'G': [], 'r': [], 'd': float(3)} - } - for k in range( N )] # d is just a dummy var - - # Parameters - self.params = [] - # Outputs - self.outputs = [] - # Options - self.codeoptions = { - 'name': 'forces', - 'maxit': 30, - 'linesearch': - {'factor_aff': 0.9, 'factor_cc': 0.95, 'minstep': 1.e-8, 'maxstep': 0.995}, - 'accuracy': - {'mu': 1.e-06, 'ineq': 1.e-06, 'eq': 1.e-06, 'rdgap': 1.e-04}, - 'printlevel': 0, - 'init': 0, - 'optlevel': 1, - 'overwrite': 1, - 'timing': 1, - 'floattype': 'double', - 'parallel': 0, - 'clversion': 1, - 'mu0': 1.0} - - def setDims(self, stage, n, r, l, u, p, q): - if (stage < 0) or (stage > self.N - 1): - raise ValueError("Stage index must be between 0 and " + str(N - 1)) - - self.dims[ stage ][ 'n' ] = float( n ) - self.dims[ stage ][ 'r' ] = float( r ) - self.dims[ stage ][ 'l' ] = float( l ) - self.dims[ stage ][ 'u' ] = float( u ) - self.dims[ stage ][ 'p' ] = float( p ) - self.dims[ stage ][ 'q' ] = float( q ) - - def setStage(self, - stage, - H = None, f = None, - lb = None, ub = None, - C = None, c = None, D = None): - - if (stage < 0) or (stage > self.N - 1): - raise ValueError("Stage index must be between 0 and " + str(N - 1)) - - def newParam(self, name, maps2stage, maps2data, type = 'dense'): - self.params.append( (name, tuple([float( el ) for el in maps2stage]), maps2data, type) ) - - def newOutput(self, name, fromStage, idxWithinStage): - self.outputs.append( (name, fromStage, [float( el ) for el in idxWithinStage]) ) - - def _saveData(self, fileName = 'solver.mat'): - - # Type conversion from int to double - for stage in range( self.N ): - for name in ['lbidx', 'ubidx']: - data = self.ineq[ stage ][ 'b' ][ name ] - self.ineq[ stage ][ 'b' ][ name ] = [float( el ) for el in data] - - # Export stages - self.exportStages = np.array( - [(self.dims[ n ], self.cost[ n ], self.eq[ n ], self.ineq[ n ]) for n in range( self.N )], - dtype = [('dims', 'O'), ('cost', 'O'), ('eq', 'O'), ('ineq', 'O')]) - - # Max dim of all strings is set to 10 - self.exportParams = np.array(self.params, - dtype = [('name', 'S10'), ('maps2stage', 'O'), ('maps2data', 'S10'), ('type', 'S10')]) - - # Max dim of all strings is set to 10 - self.exportOutputs = np.array(self.outputs, - dtype = [('name', 'S10'), ('fromStage', 'd'), ('idxWithinStage', 'O')]) - - # Max dim of all strings is set to 10 - self.exportOptions = np.array([tuple(self.codeoptions.values())], - dtype = zip(self.codeoptions.keys(), ('d', 'd', 'd', 'O', 'd', 'd', 'd', - 'S10', 'S10', 'd', 'd', 'd', 'O'))) - - # Pack shit and save it to a file which we are gonna send to FORCES server - problem = {} - problem['outvars'] = self.exportOutputs - problem['params'] = self.exportParams - problem['stages'] = self.exportStages - problem['settings'] = self.exportOptions - - import scipy.io as sio - sio.savemat(fileName, problem, format = '5', oned_as = 'row') - - def generateCode(self, userID = "", unzip = True): - - if userID == "": - raise ValueError("userID is empty.") - - fileName = 'forces.mat' - self._saveData( fileName ) - - # write binary file as a byte string of the right format - temp = np.fromfile( open(fileName, 'rb'), 'B' ) - self.fileData = "[" - for i in range(len(temp)-1): - self.fileData += str(temp[i]) + ";" - self.fileData += str(temp[i+1]) + "]" - - # send request to server - from suds import WebFault - from suds.client import Client - - server = "http://forces.ethz.ch" - self.forcesClient = Client(server + "/CodeGen.asmx?Wsdl") - resp = self.forcesClient.service[ 0 ].generateCodeFromMatlab(userID, self.fileData) - - # retrieve files - import urllib - - usock = urllib.urlopen(server + resp) - outputfile = open("forces.zip",'w') - outputfile.write(usock.read()) - outputfile.close() - usock.close() - - if unzip is True: - import zipfile - - with zipfile.ZipFile('forces.zip', "r") as z: - z.extractall( "./forces" ) - -## Generator for a FORCES QP solver used by the ACADO OCP solver - -# -# User options -# - -# Number of states -nx = @NX@ -# Number of controls -nu = @NU@ -# Number of discretization (shooting) nodes -N = @N@ - -# Lower and upper bounds on stage variables, for all N stages -lbIdx = [ - @LB_IDX@ - ] -ubIdx = [ - @UB_IDX@ - ] - -# Constant Hessian -constHessian = @CONST_HESSIAN@ -# Diagonal Hessian -diagHessian = @DIAG_HESSIAN@ -diagHessianN = @DIAG_HESSIAN_N@ -# Fixed initial state -fixedInitialState = @FIXED_INITIAL_STATE@ - -## Define FORCES multistage problem - -stages = MultistageProblem( N ) - -for i in range( N ): - if i == 0: - # - # Initial stage - # - - # Dimension - stages.setDims(i, nx + nu, nx, len( lbIdx[ 0 ] ), len( ubIdx[ 0 ] ), 0, 0) - - # Cost - if constHessian == 1: - if diagHessian == 1: - stages.newParam('H1', range(1, N), 'cost.H', 'diag') - else: - stages.newParam('H1', range(1, N), 'cost.H') - else: - if diagHessian == 1: - stages.newParam('H1', [ 1 ], 'cost.H', 'diag') - else: - stages.newParam('H1', [ 1 ], 'cost.H') - - stages.newParam('f1', [ 1 ], 'cost.f') - - # Lower bounds - stages.ineq[ 0 ]['b']['lbidx'] = lbIdx[ 0 ] - if len( lbIdx[ 0 ] ): - stages.newParam('lb' + str(i + 1), [i + 1], 'ineq.b.lb') - # Upper bounds - stages.ineq[ 0 ]['b']['ubidx'] = ubIdx[ 0 ] - if len( ubIdx[ 0 ] ): - stages.newParam('ub' + str(i + 1), [i + 1], 'ineq.b.ub') - - # Equality constraints - stages.newParam('C1', [ 1 ], 'eq.C') - stages.newParam('d1', [ 1 ], 'eq.c') - - if fixedInitialState == 1: - stages.eq[ 0 ][ 'D' ] = np.concatenate((np.eye( nx ), np.zeros([nx, nu])), 1) - - elif i < (N - 1): - - # - # Stages along horizon - # - - # Dimension - stages.setDims(i, nx + nu, nx, len( lbIdx[ i ] ), len( ubIdx[ i ] ), 0, 0) - - # Cost - if constHessian == 0: - if diagHessian == 1: - stages.newParam('H' + str(i + 1), [i + 1], 'cost.H', 'diag') - else: - stages.newParam('H' + str(i + 1), [i + 1], 'cost.H') - - stages.newParam('f' + str(i + 1), [i + 1], 'cost.f') - - # Lower bounds - stages.ineq[ i ]['b']['lbidx'] = lbIdx[ i ] - if len( lbIdx[ i ] ): - stages.newParam('lb' + str(i + 1), [i + 1], 'ineq.b.lb') - # Upper bounds - stages.ineq[ i ]['b']['ubidx'] = ubIdx[ i ] - if len( ubIdx[ i ] ): - stages.newParam('ub' + str(i + 1), [i + 1], 'ineq.b.ub') - - # Equality constraints - stages.newParam('C' + str(i + 1), [i + 1], 'eq.C') - stages.newParam('d' + str(i + 1), [i + 1], 'eq.c') - - stages.eq[ i ][ 'D' ] = np.concatenate((-np.eye( nx ), np.zeros([nx, nu])), 1) - - else: - - # - # Final stage - # - - # Dimensions - stages.setDims(i, nx, nx if fixedInitialState == 1 else 0, - len( lbIdx[ i ] ), len( ubIdx[ i ] ), 0, 0) - # Cost - if diagHessianN == 1: - stages.newParam('H' + str(i + 1), [i + 1], 'cost.H', 'diag') - else: - stages.newParam('H' + str(i + 1), [i + 1], 'cost.H') - stages.newParam('f' + str(i + 1), [i + 1], 'cost.f') - - # Lower bounds - stages.ineq[ i ]['b']['lbidx'] = lbIdx[ i ] - if len( lbIdx[ i ] ): - stages.newParam('lb' + str(i + 1), [i + 1], 'ineq.b.lb') - # Upper bounds - stages.ineq[ i ]['b']['ubidx'] = ubIdx[ i ] - if len( ubIdx[ i ] ): - stages.newParam('ub' + str(i + 1), [i + 1], 'ineq.b.ub') - - # Equality constraints - stages.eq[ i ][ 'D' ] = -np.eye( nx ) - if fixedInitialState == 1: - stages.newParam('d' + str(i + 1), [i + 1], 'eq.c') - -## Define outputs of the solver -for i in range( N ): - stages.newOutput('out' + str(i + 1), i + 1, range(1, int(stages.dims[ i ][ 'n' ]) + 1)) - -## Solver settings -stages.codeoptions["name"] = "@SOLVER_NAME@" -stages.codeoptions["overwrite"] = 1 # Always overwrite the existing code -stages.codeoptions["printlevel"] = @PRINT_LEVEL@ -stages.codeoptions["maxit"] = @MAX_ITERATIONS@ -stages.codeoptions["parallel"] = @PARALLEL@ -stages.codeoptions["init"] = @WARM_START@ - -## Generate code -import os -userID = os.environ[ "FORCES_LICENSE" ] -stages.generateCode( userID ) diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_hessian_regularization.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_hessian_regularization.c.in deleted file mode 100644 index f8a2d85ec6..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_hessian_regularization.c.in +++ /dev/null @@ -1,290 +0,0 @@ -#include "@MODULE_NAME@_common.h" - -#define @MODULE_PREFIX@_EPS @MODULE_EPS@ -#define MIN(x,y) ( (x) < (y) ? (x) : (y) ) -#define MAX(x,y) ((x)>(y)?(x):(y)) -#define SIGN(a, b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) - -#include - -#define DIM @MODULE_DIM@ - -static real_t hypot2(real_t x, real_t y) { - return sqrt(x*x+y*y); -} - -/* Symmetric Householder reduction to tridiagonal form. */ - -static void @MODULE_NAME@_tred2(real_t *V, real_t *d, real_t *e) { - -/* This is derived from the Algol procedures tred2 by - Bowdler, Martin, Reinsch, and Wilkinson, Handbook for - Auto. Comp., Vol.ii-Linear Algebra, and the corresponding - Fortran subroutine in EISPACK. */ - - int i,j,k; - real_t f,g,h,hh; - for (j = 0; j < DIM; j++) { - d[j] = V[(DIM-1)*DIM+j]; - } - -/* Householder reduction to tridiagonal form. */ - - for (i = DIM-1; i > 0; i--) { - - /* Scale to avoid under/overflow. */ - - real_t scale = 0.0; - real_t h = 0.0; - for (k = 0; k < i; k++) { - scale = scale + fabs(d[k]); - } - if (scale == 0.0) { - e[i] = d[i-1]; - for (j = 0; j < i; j++) { - d[j] = V[(i-1)*DIM+j]; - V[i*DIM+j] = 0.0; - V[j*DIM+i] = 0.0; - } - } else { - - /* Generate Householder vector. */ - - for (k = 0; k < i; k++) { - d[k] /= scale; - h += d[k] * d[k]; - } - f = d[i-1]; - g = sqrt(h); - if (f > 0) { - g = -g; - } - e[i] = scale * g; - h = h - f * g; - d[i-1] = f - g; - for (j = 0; j < i; j++) { - e[j] = 0.0; - } - - /* Apply similarity transformation to remaining columns. */ - - for (j = 0; j < i; j++) { - f = d[j]; - V[j*DIM+i] = f; - g = e[j] + V[j*DIM+j] * f; - for (k = j+1; k <= i-1; k++) { - g += V[k*DIM+j] * d[k]; - e[k] += V[k*DIM+j] * f; - } - e[j] = g; - } - f = 0.0; - for (j = 0; j < i; j++) { - e[j] /= h; - f += e[j] * d[j]; - } - hh = f / (h + h); - for (j = 0; j < i; j++) { - e[j] -= hh * d[j]; - } - for (j = 0; j < i; j++) { - f = d[j]; - g = e[j]; - for (k = j; k <= i-1; k++) { - V[k*DIM+j] -= (f * e[k] + g * d[k]); - } - d[j] = V[(i-1)*DIM+j]; - V[i*DIM+j] = 0.0; - } - } - d[i] = h; - } - - /* Accumulate transformations. */ - - for (i = 0; i < DIM-1; i++) { - V[(DIM-1)*DIM+i] = V[i*DIM+i]; - V[i*DIM+i] = 1.0; - h = d[i+1]; - if (h != 0.0) { - for (k = 0; k <= i; k++) { - d[k] = V[k*DIM+i+1] / h; - } - for (j = 0; j <= i; j++) { - g = 0.0; - for (k = 0; k <= i; k++) { - g += V[k*DIM+i+1] * V[k*DIM+j]; - } - for (k = 0; k <= i; k++) { - V[k*DIM+j] -= g * d[k]; - } - } - } - for (k = 0; k <= i; k++) { - V[k*DIM+i+1] = 0.0; - } - } - for (j = 0; j < DIM; j++) { - d[j] = V[(DIM-1)*DIM+j]; - V[(DIM-1)*DIM+j] = 0.0; - } - V[(DIM-1)*DIM+DIM-1] = 1.0; - e[0] = 0.0; -} - -/* Symmetric tridiagonal QL algorithm. */ - -static void @MODULE_NAME@_tql2(real_t *V, real_t *d, real_t *e) { - -/* This is derived from the Algol procedures tql2, by - Bowdler, Martin, Reinsch, and Wilkinson, Handbook for - Auto. Comp., Vol.ii-Linear Algebra, and the corresponding - Fortran subroutine in EISPACK. */ - - int i,j,m,l,k; - real_t g,p,r,dl1,h,f,tst1,eps; - real_t c,c2,c3,el1,s,s2; - - for (i = 1; i < DIM; i++) { - e[i-1] = e[i]; - } - e[DIM-1] = 0.0; - - f = 0.0; - tst1 = 0.0; - eps = pow(2.0,-52.0); - for (l = 0; l < DIM; l++) { - - /* Find small subdiagonal element */ - - tst1 = MAX(tst1,fabs(d[l]) + fabs(e[l])); - m = l; - while (m < DIM) { - if (fabs(e[m]) <= eps*tst1) { - break; - } - m++; - } - - /* If m == l, d[l] is an eigenvalue, - otherwise, iterate. */ - - if (m > l) { - int iter = 0; - do { - iter = iter + 1; - /* Compute implicit shift */ - - g = d[l]; - p = (d[l+1] - g) / (2.0 * e[l]); - r = hypot2(p,1.0); - if (p < 0) { - r = -r; - } - d[l] = e[l] / (p + r); - d[l+1] = e[l] * (p + r); - dl1 = d[l+1]; - h = g - d[l]; - for (i = l+2; i < DIM; i++) { - d[i] -= h; - } - f = f + h; - - /* Implicit QL transformation. */ - - p = d[m]; - c = 1.0; - c2 = c; - c3 = c; - el1 = e[l+1]; - s = 0.0; - s2 = 0.0; - for (i = m-1; i >= l; i--) { - c3 = c2; - c2 = c; - s2 = s; - g = c * e[i]; - h = c * p; - r = hypot2(p,e[i]); - e[i+1] = s * r; - s = e[i] / r; - c = p / r; - p = c * d[i] - s * g; - d[i+1] = h + s * (c * g + s * d[i]); - - /* Accumulate transformation. */ - - for (k = 0; k < DIM; k++) { - h = V[k*DIM+i+1]; - V[k*DIM+i+1] = s * V[k*DIM+i] + c * h; - V[k*DIM+i] = c * V[k*DIM+i] - s * h; - } - } - p = -s * s2 * c3 * el1 * e[l] / dl1; - e[l] = s * p; - d[l] = c * p; - - /* Check for convergence. */ - - } while (fabs(e[l]) > eps*tst1 && iter < 20); /* (Check iteration count here.) */ - } - d[l] = d[l] + f; - e[l] = 0.0; - } -} - -void @MODULE_NAME@_eigen_decomposition(real_t *A, real_t *V, real_t *d) { - int i,j; - real_t e[DIM]; - for (i = 0; i < DIM; i++) { - for (j = 0; j < DIM; j++) { - V[i*DIM+j] = A[i*DIM+j]; - } - } - @MODULE_NAME@_tred2(V, d, e); - @MODULE_NAME@_tql2(V, d, e); -} - -void @MODULE_NAME@_reconstruct_A(real_t *A, real_t *V, real_t *d) { - int i, j, k; - for( i = 0; i < DIM; i++ ) { - for( j = 0; j <= i; j++ ) { - A[i*DIM+j] = 0.0; - for( k = 0; k < DIM; k++ ) { - A[i*DIM+j] += V[i*DIM+k]*d[k]*V[j*DIM+k]; - } - A[j*DIM+i] = A[i*DIM+j]; - } - } -} - -/* cutting regularization */ -/*void @MODULE_NAME@_regularize(real_t *A) { - int i; - real_t V[DIM*DIM]; - real_t d[DIM]; - - @MODULE_NAME@_eigen_decomposition(A, V, d); - - for (i = 0; i < DIM; i++) { - if( d[i] <= @MODULE_PREFIX@_EPS ) d[i] = @MODULE_PREFIX@_EPS; - } - - @MODULE_NAME@_reconstruct_A(A, V, d); -}*/ - -/* mirroring regularization */ -void @MODULE_NAME@_regularize(real_t *A) { - int i; - real_t V[DIM*DIM]; - real_t d[DIM]; - - @MODULE_NAME@_eigen_decomposition(A, V, d); - - for (i = 0; i < DIM; i++) { - if( d[i] >= -@MODULE_PREFIX@_EPS && d[i] <= @MODULE_PREFIX@_EPS ) d[i] = @MODULE_PREFIX@_EPS; - else if( d[i] < 0 ) d[i] = -d[i]; - } - - @MODULE_NAME@_reconstruct_A(A, V, d); -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_mex.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_solver_mex.c.in deleted file mode 100644 index 4a85c57898..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_mex.c.in +++ /dev/null @@ -1,535 +0,0 @@ -/* -input -{ - control: optional - 0: init once, and run preparation and feedback; default behaviour - 1: initialize - 2: preparation - 3: feedback - 4: shift - x - u - od - y - yN - W - WN - x0: depends on the type of an OCP - xAC: optional - SAC: optional - shifting: optional - { - strategy: - 1: use xEnd - 2: integrate - xEnd - uEnd - } - initialization: optional - 1: initialize by a forward simulation - else: do nothing -} - -output -{ - x - u - xAC: optional - SAC: optional - info - { - status - cpuTime - kktValue - objValue - nIterations: works only for qpOASES - } -} -*/ - -/** MEX interface for the @MODULE_PREFIX@ OCP solver - * - * \author Milan Vukov, milan.vukov@esat.kuleuven.be - * - * Credits: Alexander Domahidi (ETHZ), Janick Frasch (KUL, OVGU) - * - */ - -#include -#include -#include -#include - -#include "mex.h" -#include "@MODULE_NAME@_common.h" -#include "@MODULE_NAME@_auxiliary_functions.h" - -#define FREE( mem ) { if( mem ) { mxFree( mem ); mem = NULL; } } - -/* Define number of outputs */ -#define NOO 3 - -#if @MODULE_PREFIX@_NXA > 0 -#define NOO_2 NOO + 1 -#else -#define NOO_2 NOO -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 -#define NOO_3 NOO_2 + 2 -#else -#define NOO_3 NOO_2 -#endif - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -#define NOO_4 NOO_3 + 1 -#else -#define NOO_4 NOO_3 -#endif - -/** Instance of the user data structure. */ -@MODULE_PREFIX@variables @MODULE_NAME@Variables; -/** Instance of the private workspace structure. */ -@MODULE_PREFIX@workspace @MODULE_NAME@Workspace; - -#if @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_FORCES -#include "forces.h" -extern forces_info @MODULE_NAME@Forces_info; -#elif @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES -#include -extern qpData_t qpData; -#endif - -/** A bit more advanced printing function. */ -void mexErrMsgTxtAdv( char* string, - ... - ) -{ - static char buffer[ 128 ]; - - va_list printArgs; - va_start(printArgs, string); - - vsprintf(buffer, string, printArgs); - va_end( printArgs ); - - mexErrMsgTxt( buffer ); -} - -/** A simple helper function. */ -void printMatrix( const char* name, - real_t* mat, - unsigned nRows, - unsigned nCols - ) -{ - unsigned r, c; - mexPrintf("%s: \n", name); - for (r = 0; r < nRows; ++r) - { - for(c = 0; c < nCols; ++c) - mexPrintf("\t%f", mat[r * nCols + c]); - mexPrintf("\n"); - } -} - -/** A function for copying data from MATLAB to C array. */ -int getArray( const unsigned mandatory, - const mxArray* source, - const int index, - const char* name, - real_t* destination, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxGetField(source, index, name); - unsigned i, j; - double* dPtr; - - if (mxPtr == NULL) - { - if ( !mandatory ) - return -1; - else - mexErrMsgTxtAdv("Field %s not found.", name); - } - - if ( !mxIsDouble( mxPtr ) ) - mexErrMsgTxtAdv("Field %s must be an array of doubles.", name); - - if (mxGetM( mxPtr ) != nRows || mxGetN( mxPtr ) != nCols ) - mexErrMsgTxtAdv("Field %s must be of size: %d x %d.", name, nRows, nCols); - - dPtr = mxGetPr( mxPtr ); - - if (destination == NULL) - destination = (real_t*)mxCalloc(nRows * nCols, sizeof( real_t )); - - if (nRows == 1 && nCols == 1) - *destination = *dPtr; - else - for (i = 0; i < nRows; ++i) - for (j = 0; j < nCols; ++j) - destination[i * nCols + j] = (real_t)dPtr[j * nRows + i]; - - return 0; -} - -void setArray( mxArray* destination, - const int index, - const char* name, - real_t* source, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxCreateDoubleMatrix(nRows, nCols, mxREAL); - double* dPtr = mxGetPr( mxPtr ); - unsigned i, j; - - if (nRows == 1 && nCols == 1) - *dPtr = *source; - else - for (i = 0; i < nRows; ++i) - for(j = 0; j < nCols; ++j) - dPtr[j * nRows + i] = (double)source[i * nCols + j]; - - mxSetField(destination, index, name, mxPtr); -} - -/** The MEX interface function. */ -void mexFunction( int nlhs, - mxArray *plhs[], - int nrhs, - const mxArray *prhs[] - ) -{ - static unsigned initialized = 0; - unsigned ctrl; - int ctrlIndex; - unsigned strategy; - unsigned initType; - real_t* xEnd = NULL; - real_t* uEnd = NULL; - const mxArray* src = prhs[ 0 ]; - - const char *infoNames[ 5 ] = {"status", "cpuTime", "kktValue", "objValue", "nIterations"}; - mxArray* info; - real_t status, cpuTime, kktValue, objValue; - double tmp[ 1 ]; - mxArray* shPtr; -#ifndef _DSPACE - @MODULE_NAME@_timer tmr; -#endif - double nIterations = 0; - - const char *outNames[ NOO_4 ]; - outNames[ 0 ] = "info"; - outNames[ 1 ] = "x"; - outNames[ 2 ] = "u"; -#if @MODULE_PREFIX@_NXA - outNames[ NOO ] = "z"; -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - outNames[ NOO_2 ] = "xAC"; - outNames[NOO_2 + 1] = "SAC"; -#endif -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - outNames[ NOO_3 ] = "sigmaN"; -#endif - - if (nrhs != 1) - mexErrMsgTxt( - "This function requires exactly one input: a structure with parameters."); - - if (nlhs != 1) - mexErrMsgTxt( - "This function returns one output."); - - if( !mxIsStruct( src ) ) - mexErrMsgTxt("The function argument must be a structure."); - - /* Get the control flag. */ - if (getArray(0, src, 0, "control", tmp, 1, 1) == 0) - ctrl = (unsigned)tmp[ 0 ]; - else - ctrl = 0; - - /* Get the initialization flag. */ - if (getArray(0, src, 0, "initialization", tmp, 1, 1) == 0) - initType = (unsigned)tmp[ 0 ]; - else - initType = 0; - - /* Copy MATLAB arrays to C arrays. */ - getArray(1, src, 0, "x", @MODULE_NAME@Variables.x, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NX); - getArray(1, src, 0, "u", @MODULE_NAME@Variables.u, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NU); - -#if @MODULE_PREFIX@_NXA - getArray(1, src, 0, "z", @MODULE_NAME@Variables.z, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NXA); -#endif - -#if @MODULE_PREFIX@_NOD - getArray(1, src, 0, "od", @MODULE_NAME@Variables.od, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NOD); -#endif - - getArray(1, src, 0, "y", @MODULE_NAME@Variables.y, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NY); - -#if @MODULE_PREFIX@_NYN - getArray(1, src, 0, "yN", @MODULE_NAME@Variables.yN, 1, @MODULE_PREFIX@_NYN); -#endif /* @MODULE_PREFIX@_NYN */ - -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED - getArray(1, src, 0, "x0", @MODULE_NAME@Variables.x0, 1, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_INITIAL_STATE_FIXED */ - -#if @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 1 - getArray(1, src, 0, "W", @MODULE_NAME@Variables.W, @MODULE_PREFIX@_NY, @MODULE_PREFIX@_NY); - getArray(1, src, 0, "WN", @MODULE_NAME@Variables.WN, @MODULE_PREFIX@_NYN, @MODULE_PREFIX@_NYN); -#elif @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 2 - getArray(1, src, 0, "W", @MODULE_NAME@Variables.W, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NY, @MODULE_PREFIX@_NY); - getArray(1, src, 0, "WN", @MODULE_NAME@Variables.WN, @MODULE_PREFIX@_NYN, @MODULE_PREFIX@_NYN); -#endif /* @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE */ - - -#if (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) - if (!initialized) - { - @MODULE_NAME@_initializeSolver(); - } -#endif - -#if (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - /* Bounds */ -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED == 1 - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); -#else - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_NX + @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_NX + @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU, 1); -#endif /* @MODULE_PREFIX@_INITIAL_STATE_FIXED == 0 */ - -#if QPOASES_NCMAX > 0 - /* Affine constraints */ - getArray(1, src, 0, "lbAValues", @MODULE_NAME@Variables.lbAValues, QPOASES_NCMAX, 1); - getArray(1, src, 0, "ubAValues", @MODULE_NAME@Variables.ubAValues, QPOASES_NCMAX, 1); -#endif /* QPOASES_NCMAX > 0 */ - -#elif (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_FORCES) && !@MODULE_PREFIX@_BLOCK_CONDENSING - /* Bounds */ - #if (@MODULE_PREFIX@_QP_NLB > 0) - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_QP_NLB, 1); - #endif - #if (@MODULE_PREFIX@_QP_NUB > 0) - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_QP_NUB, 1); - #endif - -#elif (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES) && !@MODULE_PREFIX@_BLOCK_CONDENSING - /* Bounds */ - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_QP_NV, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_QP_NV, 1); - -#elif (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && @MODULE_PREFIX@_BLOCK_CONDENSING - /* Bounds */ - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_QP_NV, 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_QP_NV, 1); - #if (@MODULE_PREFIX@_QP_NCA > 0) - /* Affine bounds */ - getArray(1, src, 0, "lbAValues", @MODULE_NAME@Variables.lbAValues, @MODULE_PREFIX@_QP_NCA, 1); - getArray(1, src, 0, "ubAValues", @MODULE_NAME@Variables.ubAValues, @MODULE_PREFIX@_QP_NCA, 1); - #endif -#elif (@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 0) && (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_GENERIC) - /* Bounds */ - getArray(1, src, 0, "lbValues", @MODULE_NAME@Variables.lbValues, @MODULE_PREFIX@_N*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU), 1); - getArray(1, src, 0, "ubValues", @MODULE_NAME@Variables.ubValues, @MODULE_PREFIX@_N*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU), 1); - #if (@MODULE_PREFIX@_NPAC > 0) - /* Affine bounds */ - getArray(1, src, 0, "lbAValues", @MODULE_NAME@Variables.lbAValues, @MODULE_PREFIX@_N*@MODULE_PREFIX@_NPAC, 1); - getArray(1, src, 0, "ubAValues", @MODULE_NAME@Variables.ubAValues, @MODULE_PREFIX@_N*@MODULE_PREFIX@_NPAC, 1); - #endif -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - getArray(1, src, 0, "xAC", @MODULE_NAME@Variables.xAC, @MODULE_PREFIX@_NX, 1); - getArray(1, src, 0, "SAC", @MODULE_NAME@Variables.SAC, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); - getArray(1, src, 0, "WL", @MODULE_NAME@Variables.WL, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif - - /* Shifting strategy */ - shPtr = mxGetField(src, 0, "shifting"); - if (shPtr != NULL) - { - if( !mxIsStruct( shPtr ) ) - mexErrMsgTxt("Field \"shifting\" must be defined with a structure."); - - /* Get the shifting strategy flag */ - getArray(1, shPtr, 0, "strategy", tmp, 1, 1); - strategy = (unsigned)tmp[ 0 ]; - - if (strategy > 2) - mexErrMsgTxt("Valid options for the shifting strategy are 1 or 2."); - - getArray(0, shPtr, 0, "xEnd", xEnd, @MODULE_PREFIX@_NX, 1); - getArray(0, shPtr, 0, "uEnd", uEnd, @MODULE_PREFIX@_NU, 1); - } - else - strategy = 0; - -#ifndef _DSPACE - @MODULE_NAME@_tic( &tmr ); -#endif - - /* Call solver */ - switch ( ctrl ) - { - case 0: - /* Simple operational mode. Run one RTI with optional shifting. */ - - if ( !initialized ) - { - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - -#if @MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 1 - @MODULE_NAME@_initializeSolver(); -#endif /* @MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES == 1 */ - - if (initType == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 1 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - initialized = 1; - } - else if (strategy == 1 || strategy == 2) - { -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 0 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - @MODULE_NAME@_shiftStates(strategy, xEnd, uEnd); - @MODULE_NAME@_shiftControls(uEnd); - } - - @MODULE_NAME@_preparationStep(); - - status = (real_t)@MODULE_NAME@_feedbackStep(); - - kktValue = @MODULE_NAME@_getKKT(); - objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - nIterations = (double)@MODULE_NAME@_getNWSR(); -#elif @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_FORCES - nIterations = @MODULE_NAME@Forces_info.it; -#elif @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES - nIterations = qpData.log.numIter; -#endif /* @MODULE_PREFIX@_QP_SOLVER */ - - break; - - case 1: - /* Initialize */ - - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - - @MODULE_NAME@_initializeSolver(); - - if (initType == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 1 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - initialized = 1; - - break; - - case 2: - /* Preparation step */ - - @MODULE_NAME@_preparationStep(); - - break; - - case 3: - /* Feedback step */ - - status = (real_t)@MODULE_NAME@_feedbackStep(); - - kktValue = @MODULE_NAME@_getKKT(); - objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - nIterations = (double)@MODULE_NAME@_getNWSR(); -#elif @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_FORCES - nIterations = @MODULE_NAME@Forces_info.it; -#endif /* @MODULE_PREFIX@_QP_SOLVER */ - - break; - - case 4: - /* Shifting */ - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - @MODULE_NAME@_updateArrivalCost( 0 ); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 */ - - @MODULE_NAME@_shiftStates(strategy, xEnd, uEnd); - @MODULE_NAME@_shiftControls( uEnd ); - - break; - - default: - /* Return an error */ - mexErrMsgTxt("Unknown control code."); - } - -#ifndef _DSPACE - cpuTime = (real_t)@MODULE_NAME@_toc( &tmr ); -#endif - - /* Prepare return argument */ - - plhs[ 0 ] = mxCreateStructMatrix(1, 1, NOO_4, outNames); - - setArray(plhs[ 0 ], 0, "x", @MODULE_NAME@Variables.x, @MODULE_PREFIX@_N + 1, @MODULE_PREFIX@_NX); - setArray(plhs[ 0 ], 0, "u", @MODULE_NAME@Variables.u, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NU); -#if @MODULE_PREFIX@_NXA > 0 - setArray(plhs[ 0 ], 0, "z", @MODULE_NAME@Variables.z, @MODULE_PREFIX@_N, @MODULE_PREFIX@_NXA); -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - setArray(plhs[ 0 ], 0, "xAC", @MODULE_NAME@Variables.xAC, @MODULE_PREFIX@_NX, 1); - setArray(plhs[ 0 ], 0, "SAC", @MODULE_NAME@Variables.SAC, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_USE_ARRIVAL_COST */ - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - setArray(plhs[ 0 ], 0, "sigmaN", @MODULE_NAME@Variables.sigmaN, @MODULE_PREFIX@_NX, @MODULE_PREFIX@_NX); -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - - /* Create the info structure. */ - info = mxCreateStructMatrix(1, 1, 5, infoNames); - - setArray(info, 0, "status", &status, 1, 1); - setArray(info, 0, "cpuTime", &cpuTime, 1, 1); - setArray(info, 0, "kktValue", &kktValue, 1, 1); - setArray(info, 0, "objValue", &objValue, 1, 1); -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - setArray(info, 0, "nIterations", &nIterations, 1, 1); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - mxSetField(plhs[ 0 ], 0, "info", info); - - /* Cleanup of the allocated memory */ - FREE( xEnd ); - FREE( uEnd ); -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.c.in b/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.c.in deleted file mode 100644 index 04ff86cba6..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.c.in +++ /dev/null @@ -1,141 +0,0 @@ -/* - * ACADO OCP solver wrapper. - */ - -#include -#include "@MODULE_NAME@_solver_sfunction.h" -#include "@MODULE_NAME@_auxiliary_functions.h" - -/* Make instances of ACADO structures. */ -@MODULE_PREFIX@variables @MODULE_NAME@Variables; -@MODULE_PREFIX@workspace @MODULE_NAME@Workspace; - -/* Initialized indicator. */ -static unsigned initialized = 0; - -void @MODULE_NAME@_step(@MODULE_PREFIX@input* inData, @MODULE_PREFIX@output* outData) -{ - #if !(defined _DSPACE) - @MODULE_NAME@_timer tmr; - - /* Start measuring time. */ - @MODULE_NAME@_tic( &tmr ); - #endif - - /* Copy all outside world data here. */ - memcpy(&@MODULE_NAME@Variables.x, &(inData->data), sizeof( @MODULE_PREFIX@data )); /* offset necessary because of the dummy variable ! */ - - /* Call solver */ - switch ( inData->control ) - { - case 0: - /* Simple operational mode. Run one RTI with optional shifting. */ - - if ( !initialized ) - { - @MODULE_NAME@_initialize( ); - if (inData->initialization == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - - initialized = 1; - } - else if (inData->shifting == 1 || inData->shifting == 2) - { - -#if @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES - @MODULE_NAME@_shiftQpData(); -#endif - - @MODULE_NAME@_shiftStates(inData->shifting, 0, 0); - @MODULE_NAME@_shiftControls( 0 ); - } - - @MODULE_NAME@_preparationStep(); - - outData->status = @MODULE_NAME@_feedbackStep(); - - outData->kktValue = @MODULE_NAME@_getKKT(); - outData->objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - outData->nIterations = @MODULE_NAME@_getNWSR(); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - break; - - case 1: - /* Initialize */ - - @MODULE_NAME@_initialize( ); - if (inData->initialization == 1) - { - @MODULE_NAME@_initializeNodesByForwardSimulation(); - } - - initialized = 1; - - break; - - case 2: - /* Preparation step */ - - @MODULE_NAME@_preparationStep(); - - break; - - case 3: - /* Feedback step */ - - outData->status = @MODULE_NAME@_feedbackStep(); - - outData->kktValue = @MODULE_NAME@_getKKT(); - outData->objValue = @MODULE_NAME@_getObjective(); - -#if ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) - outData->nIterations = @MODULE_NAME@_getNWSR(); -#endif /* ( (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES) || (@MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPOASES3) ) */ - - break; - - case 4: - /* Shifting */ - -#if @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES - @MODULE_NAME@_shiftQpData(); -#endif - - @MODULE_NAME@_shiftStates(inData->shifting, 0, 0); - @MODULE_NAME@_shiftControls( 0 ); - - break; - - default: - /* Return default error code */ - outData->status = -1; - } - - /* Copy the data to outside world. */ - memcpy(&(outData->data), &@MODULE_NAME@Variables.x, sizeof( @MODULE_PREFIX@data )); /* offset necessary because of the dummy variable ! */ - - #if !(defined _DSPACE) - /* Read the elapsed time. */ - outData->execTime = @MODULE_NAME@_toc( &tmr ); - #endif -} - -void @MODULE_NAME@_initialize( void ) -{ - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - @MODULE_NAME@_initializeSolver(); - initialized = 0; -} - -void @MODULE_NAME@_cleanup( void ) -{ -#if @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES - /* Clean-up of the qpDUNES QP solver. */ - @MODULE_NAME@_cleanupSolver(); -#endif /* @MODULE_PREFIX@_QP_SOLVER == @MODULE_PREFIX@_QPDUNES */ -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.h.in b/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.h.in deleted file mode 100644 index ae72cfc9f3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/acado_solver_sfunction.h.in +++ /dev/null @@ -1,96 +0,0 @@ -/* - * ACADO OCP solver wrapper header. - */ - -#ifndef @MODULE_PREFIX@_SOLVER_SFUNCTION -#define @MODULE_PREFIX@_SOLVER_SFUNCTION - -/* Include the common header. */ -#include "@MODULE_NAME@_common.h" - -/** Internal data structure for communicating with the solver - * NOTE: Do not change order of the fields here - */ -typedef struct -{ - real_t x[(@MODULE_PREFIX@_N + 1) * @MODULE_PREFIX@_NX]; - -#if @MODULE_PREFIX@_NXA - real_t z[@MODULE_PREFIX@_N * @MODULE_PREFIX@_NXA]; -#endif - - real_t u[@MODULE_PREFIX@_N * @MODULE_PREFIX@_NU]; - -#if @MODULE_PREFIX@_NOD - real_t od[(@MODULE_PREFIX@_N + 1) * @MODULE_PREFIX@_NOD]; -#endif - - real_t y[@MODULE_PREFIX@_N * @MODULE_PREFIX@_NY]; - real_t yN[@MODULE_PREFIX@_NYN]; - -#if @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 1 - real_t W[@MODULE_PREFIX@_NY * @MODULE_PREFIX@_NY]; - real_t WN[@MODULE_PREFIX@_NYN * @MODULE_PREFIX@_NYN]; -#elif @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 2 - real_t W[@MODULE_PREFIX@_N * @MODULE_PREFIX@_NY * @MODULE_PREFIX@_NY]; - real_t WN[@MODULE_PREFIX@_NYN * @MODULE_PREFIX@_NYN]; -#endif - -#if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - real_t xAC[ @MODULE_PREFIX@_NX ]; - real_t SAC[@MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX]; - real_t WL[@MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX]; -#endif - -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED - real_t x0[ @MODULE_PREFIX@_NX ]; -#endif /* #if @MODULE_PREFIX@_INITIAL_STATE_FIXED */ - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - real_t sigmaN[@MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX]; -#endif - -} @MODULE_PREFIX@data; - -/** Input data structure for the ACADO OCP solver. */ -typedef struct -{ - int control; /**< Control flag. */ - int shifting; /**< Shifting strategy. */ - int initialization; /**< Initialization flag. */ - @MODULE_PREFIX@data data; /**< Input data. */ -} @MODULE_PREFIX@input; - -/** Output data structure for the ACADO OCP solver. */ -typedef struct -{ - int status; /**< Status (ATM from the QP solver). */ - int nIterations; /**< @ iteration of the QP solver. */ - real_t kktValue; /**< KKT value. */ - real_t objValue; /**< Objective value. */ - real_t execTime; /**< Execution time. */ - @MODULE_PREFIX@data data; /**< Output data. */ -} @MODULE_PREFIX@output; - -#ifdef __cplusplus -extern "C" -{ -#endif /* __cplusplus */ - -/** The step function of the solver. */ -void @MODULE_NAME@_step( - @MODULE_PREFIX@input* inData, /**< Input data. */ - @MODULE_PREFIX@output* outData /**< Output data. */ - ); - -/** Initialization of the solver. */ -void @MODULE_NAME@_initialize( void ); - -/** Cleanup of the solver. */ -void @MODULE_NAME@_cleanup( void ); - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif /* @MODULE_NAME@_SOLVER_SFUNCTION */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/dummy_test_file.in b/phonelibs/acado/include/acado/code_generation/templates/dummy_test_file.in deleted file mode 100644 index 6ba89dcd0d..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/dummy_test_file.in +++ /dev/null @@ -1,100 +0,0 @@ - -/* - -IMPORTANT: This file should serve as a starting point to develop the user -code for the OCP solver. The code below is for illustration purposes. Most -likely you will not get good results if you execute this code without any -modification(s). - -Please read the examples in order to understand how to write user code how -to run the OCP solver. You can find more info on the website: -www.acadotoolkit.org - -*/ - -#include "@MODULE_NAME@_common.h" -#include "@MODULE_NAME@_auxiliary_functions.h" - -#include - -/* Some convenient definitions. */ -#define NX @MODULE_PREFIX@_NX /* Number of differential state variables. */ -#define NXA @MODULE_PREFIX@_NXA /* Number of algebraic variables. */ -#define NU @MODULE_PREFIX@_NU /* Number of control inputs. */ -#define NOD @MODULE_PREFIX@_NOD /* Number of online data values. */ - -#define NY @MODULE_PREFIX@_NY /* Number of measurements/references on nodes 0..N - 1. */ -#define NYN @MODULE_PREFIX@_NYN /* Number of measurements/references on node N. */ - -#define N @MODULE_PREFIX@_N /* Number of intervals in the horizon. */ - -#define NUM_STEPS 10 /* Number of real-time iterations. */ -#define VERBOSE 1 /* Show iterations: 1, silent: 0. */ - -/* Global variables used by the solver. */ -@MODULE_PREFIX@variables @MODULE_NAME@Variables; -@MODULE_PREFIX@workspace @MODULE_NAME@Workspace; - -/* A template for testing of the solver. */ -int main( ) -{ - /* Some temporary variables. */ - int i, iter; - @MODULE_NAME@_timer t; - - /* Initialize the solver. */ - @MODULE_NAME@_initializeSolver(); - - /* Initialize the states and controls. */ - for (i = 0; i < NX * (N + 1); ++i) @MODULE_NAME@Variables.x[ i ] = 0.0; - for (i = 0; i < NU * N; ++i) @MODULE_NAME@Variables.u[ i ] = 0.0; - - /* Initialize the measurements/reference. */ - for (i = 0; i < NY * N; ++i) @MODULE_NAME@Variables.y[ i ] = 0.0; - for (i = 0; i < NYN; ++i) @MODULE_NAME@Variables.yN[ i ] = 0.0; - - /* MPC: initialize the current state feedback. */ -#if @MODULE_PREFIX@_INITIAL_STATE_FIXED - for (i = 0; i < NX; ++i) @MODULE_NAME@Variables.x0[ i ] = 0.1; -#endif - - if( VERBOSE ) @MODULE_NAME@_printHeader(); - - /* Prepare first step */ - @MODULE_NAME@_preparationStep(); - - /* Get the time before start of the loop. */ - @MODULE_NAME@_tic( &t ); - - /* The "real-time iterations" loop. */ - for(iter = 0; iter < NUM_STEPS; ++iter) - { - /* Perform the feedback step. */ - @MODULE_NAME@_feedbackStep( ); - - /* Apply the new control immediately to the process, first NU components. */ - - if( VERBOSE ) printf("\tReal-Time Iteration %d: KKT Tolerance = %.3e\n\n", iter, @MODULE_NAME@_getKKT() ); - - /* Optional: shift the initialization (look at @MODULE_NAME@_common.h). */ - /* @MODULE_NAME@_shiftStates(2, 0, 0); */ - /* @MODULE_NAME@_shiftControls( 0 ); */ - - /* Prepare for the next step. */ - @MODULE_NAME@_preparationStep(); - } - /* Read the elapsed time. */ - real_t te = @MODULE_NAME@_toc( &t ); - - if( VERBOSE ) printf("\n\nEnd of the RTI loop. \n\n\n"); - - /* Eye-candy. */ - - if( !VERBOSE ) - printf("\n\n Average time of one real-time iteration: %.3g microseconds\n\n", 1e6 * te / NUM_STEPS); - - @MODULE_NAME@_printDifferentialVariables(); - @MODULE_NAME@_printControlVariables(); - - return 0; -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/forces_interface.in b/phonelibs/acado/include/acado/code_generation/templates/forces_interface.in deleted file mode 100644 index 04a07b04d9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/forces_interface.in +++ /dev/null @@ -1,25 +0,0 @@ -#ifdef __cplusplus -extern "C" -{ -#endif -#include "@FORCES_HEADER@" -#ifdef __cplusplus -} -#endif - -/******************************************************************************/ -/* */ -/* FORCES interface structures */ -/* */ -/******************************************************************************/ - -@FORCES_PARAMS@ @FORCES_PARAMS_OBJ@; -@FORCES_OUTPUT@ @FORCES_OUTPUT_OBJ@; -@FORCES_INFO@ @FORCES_INFO_OBJ@; - -void initializeForces( void ) -{ - memset(&@FORCES_PARAMS_OBJ@, 0, sizeof( @FORCES_PARAMS_OBJ@ )); - memset(&@FORCES_OUTPUT_OBJ@, 0, sizeof( @FORCES_OUTPUT_OBJ@ )); - memset(&@FORCES_INFO_OBJ@, 0, sizeof( @FORCES_INFO_OBJ@ )); -} \ No newline at end of file diff --git a/phonelibs/acado/include/acado/code_generation/templates/hpmpc_interface.c.in b/phonelibs/acado/include/acado/code_generation/templates/hpmpc_interface.c.in deleted file mode 100644 index 76a53f2714..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/hpmpc_interface.c.in +++ /dev/null @@ -1,301 +0,0 @@ -/************************************************************************************************** -* * -* Author: Niels van Duijkeren, niels.vanduijkeren (at) kuleuven.be * -* based on interface by: Gianluca Frison, giaf (at) dtu.dk * -* * -**************************************************************************************************/ - -#include - -/* Stdlib for malloc */ -#include - -/* HPMPC header */ -#include - -// problem size (states, inputs, horizon) -#define NX @MODULE_PREFIX@_NX -#define NU @MODULE_PREFIX@_NU -#define N @MODULE_PREFIX@_N - -// free initial state: 0 mpc, 1 mhe -#define FREE_X0 0 - -// warm-start with user-provided solution (otherwise initialize x and u with 0 or something feasible) -#define WARM_START @WARM_START@ -#define MU0 0.0 - -// number of iterations of IP method -#define K_MAX @MAX_ITER@ - -// tolerance in the duality measure -#define MU_TOL 1e-8 - -// minimum accepted step length -#define ALPHA_MIN 1e-8 - -// infinite bound for HPMPC: use to detect dummy bounds -#define INF_BOUND 1e11 - -// Debug flag TODO -#define PC_DEBUG @PRINT_LEVEL@ - -static double* @MODULE_NAME@_work; -static int @MODULE_NAME@_hpmpc_init = 0; - -void @MODULE_NAME@_hpmpc_init_fun(int *nx, int *nu, int *nb, int **hidxb, int *ng, int N2) -{ - int hpmpc_workspace_size = hpmpc_d_ip_ocp_hard_tv_work_space_size_bytes(N, nx, nu, nb, hidxb, ng, N2); - @MODULE_NAME@_work = (real_t*)malloc(hpmpc_workspace_size); - - @MODULE_NAME@_hpmpc_init = 1; -} - -/* version dealing with equality constraitns: is lb=ub, then fix the variable (corresponding column in A or B set to zero, and updated b) */ -int @MODULE_NAME@_hpmpc_wrapper( real_t* A, real_t* B, real_t* b, - real_t* Q, real_t* Qf, real_t* S, real_t* R, - real_t* q, real_t* qf, real_t* r, - real_t* lb, real_t* ub, - real_t* C, real_t* D, real_t* lbg, real_t* ubg, real_t* CN, - real_t* x, real_t* u, - real_t* lambda, real_t* mu, - int* nIt ) -{ - int i, j, ii, offset; - int hpmpc_status = -1; - - // statistics from the IP routine - static real_t stat[5*K_MAX]; - - // array with number of path-constraints for every stage - @QP_ND_ARRAY@ - - // accumulated number of path-constraints for every stage - unsigned int nDac [N+2]; - nDac[0] = 0; - for(int i=0; i -INF_BOUND) { - hlb[0][nb[0]] = lb[i]; - hub[0][nb[0]] = ub[i]; - hidxb[0][nb[0]] = i; - ++nb[0]; - } else if (ub[i] < INF_BOUND) { - hlb[0][nb[0]] = lb[i]; - hub[0][nb[0]] = ub[i]; - hidxb[0][nb[0]] = i; - ++nb[0]; - } - } - ///middle stages - for(j=1; j -INF_BOUND) { - hlb[j][nb[j]] = lb[j*NU+i]; - hub[j][nb[j]] = ub[j*NU+i]; - hidxb[j][nb[j]] = i; - ++nb[j]; - } else if (ub[j*NU+i] < INF_BOUND) { - hlb[j][nb[j]] = lb[j*NU+i]; - hub[j][nb[j]] = ub[j*NU+i]; - hidxb[j][nb[j]] = i; - ++nb[j]; - } - } - for (i=0; i -INF_BOUND) { - hlb[j][nb[j]] = lb[offset]; - hub[j][nb[j]] = ub[offset]; - hidxb[j][nb[j]] = NU + i; - ++nb[j]; - } else if (ub[offset] < INF_BOUND) { - hlb[j][nb[j]] = lb[offset]; - hub[j][nb[j]] = ub[offset]; - hidxb[j][nb[j]] = NU + i; - ++nb[j]; - } - } - } - ///last stage (copy constraints from second to last) - nb[N] = 0; - hidxb[N] = work_idxb + N*(NX+NU); - hlb[N] = work_lb + N*(NX+NU); - hub[N] = work_ub + N*(NX+NU); - for (i=0; i -INF_BOUND) { - hlb[N][nb[N]] = lb[offset]; - hub[N][nb[N]] = ub[offset]; - hidxb[N][nb[N]] = i; - ++nb[N]; - } else if (ub[offset] < INF_BOUND) { - hlb[N][nb[N]] = lb[offset]; - hub[N][nb[N]] = ub[offset]; - hidxb[N][nb[N]] = i; - ++nb[N]; - } - } - //ng & hC & hD & hlg & hug - ///first and middle stages - for (j=0; j -#include -#include -#include - -#include "mex.h" -#include "@MODULE_NAME@_common.h" -#include "@MODULE_NAME@_auxiliary_sim_functions.h" - - -#define ONLINE_GRID @ONLINE_GRID@ -#define DEBUG_MODE @DEBUG_MODE@ -#define SENS_PROP @SENS_PROP@ -#define CALLS_TIMING @CALLS_TIMING@ -#define NUM_STAGES @NUM_STAGES@ - -/* GLOBAL VARIABLES FOR THE ACADO REAL-TIME ALGORITHM: */ -/* --------------------------------------------------- */ - @MODULE_PREFIX@variables @MODULE_NAME@Variables; - @MODULE_PREFIX@workspace @MODULE_NAME@Workspace; - - -/** A bit more advanced printing function. */ -void mexErrMsgTxtAdv( char* string, - ... - ) -{ - static char buffer[ 128 ]; - - va_list printArgs; - va_start(printArgs, string); - - vsprintf(buffer, string, printArgs); - va_end( printArgs ); - - mexErrMsgTxt( buffer ); -} - -/** A simple helper function. */ -void printMatrix( const char* name, - real_t* mat, - unsigned nRows, - unsigned nCols - ) -{ - unsigned r, c; - mexPrintf("%s: \n", name); - for (r = 0; r < nRows; ++r) - { - for(c = 0; c < nCols; ++c) - mexPrintf("\t%f", mat[r * nCols + c]); - mexPrintf("\n"); - } -} - -/** A function for copying data from MATLAB to C array. */ -int getArray( const unsigned mandatory, - const mxArray* source, - const int index, - const char* name, - real_t* destination, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxGetField(source, index, name); - unsigned i, j; - double* dPtr; - - if (mxPtr == NULL) - { - if ( !mandatory ) - return -1; - else - mexErrMsgTxtAdv("Field %s not found.", name); - } - - if ( !mxIsDouble( mxPtr ) ) - mexErrMsgTxtAdv("Field %s must be an array of doubles.", name); - - if (mxGetM( mxPtr ) != nRows || mxGetN( mxPtr ) != nCols ) - mexErrMsgTxtAdv("Field %s must be of size: %d x %d.", name, nRows, nCols); - - dPtr = mxGetPr( mxPtr ); - - if (destination == NULL) - destination = (real_t*)mxCalloc(nRows * nCols, sizeof( real_t )); - - if (nRows == 1 && nCols == 1) - *destination = *dPtr; - else - for (i = 0; i < nRows; ++i) - for (j = 0; j < nCols; ++j) - destination[i * nCols + j] = (real_t)dPtr[j * nRows + i]; - - return 0; -} - -void setArray( mxArray* destination, - const int index, - const char* name, - real_t* source, - const unsigned nRows, - const unsigned nCols - ) -{ - mxArray* mxPtr = mxCreateDoubleMatrix(nRows, nCols, mxREAL); - double* dPtr = mxGetPr( mxPtr ); - unsigned i, j; - - if (nRows == 1 && nCols == 1) - *dPtr = *source; - else - for (i = 0; i < nRows; ++i) - for(j = 0; j < nCols; ++j) - dPtr[j * nRows + i] = (double)source[i * nCols + j]; - - mxSetField(destination, index, name, mxPtr); -} - -void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { - - int error, reset, c, i, j, k; - double tmp[ 1 ]; - const mxArray* src = prhs[ 0 ]; - real_t *xnext, *sensX, *sensU, *sens2, *grid, *mat; - real_t x[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA]; - #if @MODULE_PREFIX@_NU > 0 - real_t u[@MODULE_PREFIX@_NU]; - #endif - #if @MODULE_PREFIX@_NOD > 0 - real_t od[@MODULE_PREFIX@_NOD]; - #endif - #if SENS_PROP == 2 || SENS_PROP == 3 || SENS_PROP == 4 - real_t seed[@MODULE_PREFIX@_NX]; - #endif - #if SENS_PROP == 1 - real_t next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NOD]; - #elif SENS_PROP == 2 - real_t next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NOD]; - #elif SENS_PROP == 3 - real_t next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NX*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NU*@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NOD]; - #elif SENS_PROP == 4 - int numX = @MODULE_PREFIX@_NX*(@MODULE_PREFIX@_NX+1)/2.0; - int numU = @MODULE_PREFIX@_NU*(@MODULE_PREFIX@_NU+1)/2.0; - real_t next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+numX+@MODULE_PREFIX@_NX*@MODULE_PREFIX@_NU+numU+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NOD]; - #else - real_t next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NOD]; - #endif - const char *fieldnames[4], *infonames[3]; - @MODULE_NAME@_timer tmr; - real_t start, end, time; - real_t *result_timing; - - #if @MODULE_PREFIX@_NUMOUT > 0 - real_t* out1; - #if SENS_PROP == 1 - out1 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[0]*@MODULE_PREFIX@_NOUT[0]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)*sizeof(*out1)); - #else - out1 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[0]*@MODULE_PREFIX@_NOUT[0]*sizeof(*out1)); - #endif - - #if @MODULE_PREFIX@_NUMOUT > 1 - real_t* out2; - #if SENS_PROP == 1 - out2 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[1]*@MODULE_PREFIX@_NOUT[1]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)*sizeof(*out2)); - #else - out2 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[1]*@MODULE_PREFIX@_NOUT[1]*sizeof(*out2)); - #endif - - #if @MODULE_PREFIX@_NUMOUT > 2 - real_t* out3; - #if SENS_PROP == 1 - out3 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[2]*@MODULE_PREFIX@_NOUT[2]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)*sizeof(*out3)); - #else - out3 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[2]*@MODULE_PREFIX@_NOUT[2]*sizeof(*out3)); - #endif - - #if @MODULE_PREFIX@_NUMOUT > 3 - real_t* out4; - #if SENS_PROP == 1 - out4 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[3]*@MODULE_PREFIX@_NOUT[3]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)*sizeof(*out4)); - #else - out4 = (real_t*) malloc(@MODULE_PREFIX@_NMEAS[3]*@MODULE_PREFIX@_NOUT[3]*sizeof(*out4)); - #endif - #endif - #endif - #endif - #endif - - fieldnames[0] = "value"; - fieldnames[1] = "sensX"; - fieldnames[2] = "sensU"; - fieldnames[3] = "sens2"; - - infonames[0] = "errorCode"; - infonames[1] = "clockTime"; - infonames[2] = "debugMat"; - - if (nrhs != 1) { - mexErrMsgTxt("This function requires exactly one input: a structure with parameters."); - } - - /* Copy MATLAB arrays to C arrays. */ - getArray(1, src, 0, "x", x, @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA, 1); - #if @MODULE_PREFIX@_NU > 0 - getArray(1, src, 0, "u", u, @MODULE_PREFIX@_NU, 1); - #endif - #if @MODULE_PREFIX@_NOD > 0 - getArray(1, src, 0, "od", od, @MODULE_PREFIX@_NOD, 1); - #endif - #if SENS_PROP == 2 || SENS_PROP == 3 || SENS_PROP == 4 - getArray(1, src, 0, "seed", seed, @MODULE_PREFIX@_NX, 1); - #endif - - - #if ONLINE_GRID - #if @MODULE_PREFIX@_NUMOUT > 0 - getArray(1, src, 0, "grid1", @MODULE_NAME@Variables.gridOutput0, 1, @MODULE_PREFIX@_NMEAS[0]); - - #if @MODULE_PREFIX@_NUMOUT > 1 - getArray(1, src, 0, "grid2", @MODULE_NAME@Variables.gridOutput1, 1, @MODULE_PREFIX@_NMEAS[1]); - - #if @MODULE_PREFIX@_NUMOUT > 2 - getArray(1, src, 0, "grid3", @MODULE_NAME@Variables.gridOutput2, 1, @MODULE_PREFIX@_NMEAS[2]); - - #if @MODULE_PREFIX@_NUMOUT > 3 - getArray(1, src, 0, "grid4", @MODULE_NAME@Variables.gridOutput3, 1, @MODULE_PREFIX@_NMEAS[3]); - #endif - #endif - #endif - #endif - #endif - - /* Get the reset flag. */ - if (getArray(0, src, 0, "reset", tmp, 1, 1) == 0) - reset = (unsigned)tmp[ 0 ]; - else - reset = 1; - - if (reset > 1) { - memset(&@MODULE_NAME@Workspace, 0, sizeof( @MODULE_NAME@Workspace )); - } - - #if SENS_PROP == 2 || SENS_PROP == 3 || SENS_PROP == 4 - for( i = 0; i < @MODULE_PREFIX@_NX; ++i ) { - next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+i] = seed[i]; - } - #endif - - #if @MODULE_PREFIX@_NU > 0 - for( i = 0; i < @MODULE_PREFIX@_NU; ++i ) { - #if SENS_PROP == 1 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i] = u[i]; - #elif SENS_PROP == 2 - next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU+i] = u[i]; - #elif SENS_PROP == 3 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NX*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NU*@MODULE_PREFIX@_NU+i] = u[i]; - #elif SENS_PROP == 4 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+numX+@MODULE_PREFIX@_NX*@MODULE_PREFIX@_NU+numU+i] = u[i]; - #else - next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+i] = u[i]; - #endif - } - #endif - #if @MODULE_PREFIX@_NOD > 0 - for( i = 0; i < @MODULE_PREFIX@_NOD; ++i ) { - #if SENS_PROP == 1 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NU+i] = od[i]; - #elif SENS_PROP == 2 - next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NU+i] = od[i]; - #elif SENS_PROP == 3 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NX*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NU*@MODULE_PREFIX@_NU+@MODULE_PREFIX@_NU+i] = od[i]; - #elif SENS_PROP == 4 - next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+numX+@MODULE_PREFIX@_NX*@MODULE_PREFIX@_NU+numU+@MODULE_PREFIX@_NU+i] = od[i]; - #else - next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NU+i] = od[i]; - #endif - } - #endif - - @MODULE_NAME@_tic(&tmr); - for( c = 0; c < CALLS_TIMING; ++c ) { - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - next[i] = x[i]; - } - - #if @MODULE_PREFIX@_NUMOUT > 3 - error = @MODULE_NAME@_integrate( next, out1, out2, out3, out4, reset ); - #elif @MODULE_PREFIX@_NUMOUT > 2 - error = @MODULE_NAME@_integrate( next, out1, out2, out3, reset ); - #elif @MODULE_PREFIX@_NUMOUT > 1 - error = @MODULE_NAME@_integrate( next, out1, out2, reset ); - #elif @MODULE_PREFIX@_NUMOUT > 0 - error = @MODULE_NAME@_integrate( next, out1, reset ); - #else - error = @MODULE_NAME@_integrate( next, reset ); - #endif - reset = 0; - } - time = @MODULE_NAME@_toc(&tmr)/CALLS_TIMING; - - #if SENS_PROP == 1 - plhs[0] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[0],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,1,mxREAL)); - mxSetField(plhs[0],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[0],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,@MODULE_PREFIX@_NU,mxREAL)); - #elif SENS_PROP == 2 - plhs[0] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[0],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,1,mxREAL)); - mxSetField(plhs[0],0,fieldnames[1],mxCreateDoubleMatrix(1,@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[0],0,fieldnames[2],mxCreateDoubleMatrix(1,@MODULE_PREFIX@_NU,mxREAL)); - #else - plhs[0] = mxCreateStructMatrix(1, 1, 1, fieldnames); - mxSetField(plhs[0],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,1,mxREAL)); - #endif - #if SENS_PROP == 3 || SENS_PROP == 4 - plhs[0] = mxCreateStructMatrix(1, 1, 4, fieldnames); - mxSetField(plhs[0],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,1,mxREAL)); - mxSetField(plhs[0],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[0],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA,@MODULE_PREFIX@_NU,mxREAL)); - mxSetField(plhs[0],0,fieldnames[3],mxCreateDoubleMatrix(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU,@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU,mxREAL)); - #endif - - xnext = mxGetPr(mxGetField(plhs[0],0,fieldnames[0])); - #if SENS_PROP - sensX = mxGetPr(mxGetField(plhs[0],0,fieldnames[1])); - sensU = mxGetPr(mxGetField(plhs[0],0,fieldnames[2])); - #endif - #if SENS_PROP == 3 || SENS_PROP == 4 - sens2 = mxGetPr(mxGetField(plhs[0],0,fieldnames[3])); - #endif - - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - xnext[i] = next[i]; - } - - #if SENS_PROP == 1 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+i] = next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+i*@MODULE_PREFIX@_NX+j]; - } - } - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+i] = next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - #elif SENS_PROP == 2 - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j] = next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+j]; - } - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j] = next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+@MODULE_PREFIX@_NX+j]; - } - #elif SENS_PROP == 4 || SENS_PROP == 3 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+i] = next[@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA+i*@MODULE_PREFIX@_NX+j]; - } - } - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+i] = next[@MODULE_PREFIX@_NX+(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - #endif - #if SENS_PROP == 3 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - /* NOTE: The order here is [Sxx, Sux, Suu] !! */ - for( i = 0; i < @MODULE_PREFIX@_NX; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sens2[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i] = next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+i*@MODULE_PREFIX@_NX+j]; - } - } - for( i = 0; i < @MODULE_PREFIX@_NU; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sens2[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+i] = next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NX+j]; - sens2[(@MODULE_PREFIX@_NX+i)*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+j] = sens2[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+i]; - } - } - for( i = 0; i < @MODULE_PREFIX@_NU; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sens2[(@MODULE_PREFIX@_NX+j)*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+i] = next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i*@MODULE_PREFIX@_NU+j]; - } - } - #elif SENS_PROP == 4 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - /* NOTE: The order here is the lower triangular of the full Hessian H !! */ - for( i = 0; i < @MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU; ++i ) { - for( j = 0; j <= i; ++j ) { - sens2[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i] = next[(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NX+i*(i+1)/2+j]; - sens2[i*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+j] = sens2[j*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i]; - } - } - #endif - - if (nlhs > 1+@MODULE_PREFIX@_NUMOUT) { - #if DEBUG_MODE > 0 - plhs[1+@MODULE_PREFIX@_NUMOUT] = mxCreateStructMatrix(1, 1, 3, infonames); - mxSetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[0],mxCreateDoubleScalar(error)); - mxSetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[1],mxCreateDoubleScalar(time)); - mxSetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[2],mxCreateDoubleMatrix(NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA),NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA),mxREAL)); - - mat = mxGetPr(mxGetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[2])); - for( i = 0; i < NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA); ++i ) { - for( j = 0; j < NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA); ++j ) { - mat[j*NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+i] = @MODULE_NAME@Variables.debug_mat[i*NUM_STAGES*(@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NXA)+j]; - } - } - #else - plhs[1+@MODULE_PREFIX@_NUMOUT] = mxCreateStructMatrix(1, 1, 2, infonames); - mxSetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[0],mxCreateDoubleScalar(error)); - mxSetField(plhs[1+@MODULE_PREFIX@_NUMOUT],0,infonames[1],mxCreateDoubleScalar(time)); - #endif - } - - #if @MODULE_PREFIX@_NUMOUT > 0 - if (nlhs > 1) { - #if SENS_PROP == 1 - plhs[1] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[1],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[0],@MODULE_PREFIX@_NMEAS[0],mxREAL)); - mxSetField(plhs[1],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[0]*@MODULE_PREFIX@_NMEAS[0],@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[1],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[0]*@MODULE_PREFIX@_NMEAS[0],@MODULE_PREFIX@_NU,mxREAL)); - #else - plhs[1] = mxCreateStructMatrix(1, 1, 1, fieldnames); - mxSetField(plhs[1],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[0],@MODULE_PREFIX@_NMEAS[0],mxREAL)); - #endif - - xnext = mxGetPr(mxGetField(plhs[1],0,fieldnames[0])); - #if SENS_PROP == 1 - sensX = mxGetPr(mxGetField(plhs[1],0,fieldnames[1])); - sensU = mxGetPr(mxGetField(plhs[1],0,fieldnames[2])); - #endif - - for( k = 0; k < @MODULE_PREFIX@_NMEAS[0]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[0]; ++i ) { - #if SENS_PROP == 1 - xnext[k*@MODULE_PREFIX@_NOUT[0]+i] = out1[k*@MODULE_PREFIX@_NOUT[0]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i]; - #else - xnext[k*@MODULE_PREFIX@_NOUT[0]+i] = out1[k*@MODULE_PREFIX@_NOUT[0]+i]; - #endif - } - } - - #if SENS_PROP == 1 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( k = 0; k < @MODULE_PREFIX@_NMEAS[0]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[0]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*@MODULE_PREFIX@_NOUT[0]*@MODULE_PREFIX@_NMEAS[0]+k*@MODULE_PREFIX@_NOUT[0]+i] = out1[k*@MODULE_PREFIX@_NOUT[0]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[0]+i*@MODULE_PREFIX@_NX+j]; - } - } - } - for( k = 0; k < @MODULE_PREFIX@_NMEAS[0]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[0]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*@MODULE_PREFIX@_NOUT[0]*@MODULE_PREFIX@_NMEAS[0]+k*@MODULE_PREFIX@_NOUT[0]+i] = out1[k*@MODULE_PREFIX@_NOUT[0]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[0]*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - } - #endif - free(out1); - #if @MODULE_PREFIX@_NUMOUT > 1 - if (nlhs > 2) { - #if SENS_PROP == 1 - plhs[2] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[2],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[1],@MODULE_PREFIX@_NMEAS[1],mxREAL)); - mxSetField(plhs[2],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[1]*@MODULE_PREFIX@_NMEAS[1],@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[2],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[1]*@MODULE_PREFIX@_NMEAS[1],@MODULE_PREFIX@_NU,mxREAL)); - #else - plhs[2] = mxCreateStructMatrix(1, 1, 1, fieldnames); - mxSetField(plhs[2],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[1],@MODULE_PREFIX@_NMEAS[1],mxREAL)); - #endif - - xnext = mxGetPr(mxGetField(plhs[2],0,fieldnames[0])); - #if SENS_PROP == 1 - sensX = mxGetPr(mxGetField(plhs[2],0,fieldnames[1])); - sensU = mxGetPr(mxGetField(plhs[2],0,fieldnames[2])); - #endif - - for( k = 0; k < @MODULE_PREFIX@_NMEAS[1]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[1]; ++i ) { - #if SENS_PROP == 1 - xnext[k*@MODULE_PREFIX@_NOUT[1]+i] = out2[k*@MODULE_PREFIX@_NOUT[1]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i]; - #else - xnext[k*@MODULE_PREFIX@_NOUT[1]+i] = out2[k*@MODULE_PREFIX@_NOUT[1]+i]; - #endif - } - } - - #if SENS_PROP == 1 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( k = 0; k < @MODULE_PREFIX@_NMEAS[1]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[1]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*@MODULE_PREFIX@_NOUT[1]*@MODULE_PREFIX@_NMEAS[1]+k*@MODULE_PREFIX@_NOUT[1]+i] = out2[k*@MODULE_PREFIX@_NOUT[1]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[1]+i*@MODULE_PREFIX@_NX+j]; - } - } - } - for( k = 0; k < @MODULE_PREFIX@_NMEAS[1]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[1]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*@MODULE_PREFIX@_NOUT[1]*@MODULE_PREFIX@_NMEAS[1]+k*@MODULE_PREFIX@_NOUT[1]+i] = out2[k*@MODULE_PREFIX@_NOUT[1]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[1]*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - } - #endif - free(out2); - #if @MODULE_PREFIX@_NUMOUT > 2 - if (nlhs > 3) { - #if SENS_PROP == 1 - plhs[3] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[3],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[2],@MODULE_PREFIX@_NMEAS[2],mxREAL)); - mxSetField(plhs[3],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[2]*@MODULE_PREFIX@_NMEAS[2],@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[3],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[2]*@MODULE_PREFIX@_NMEAS[2],@MODULE_PREFIX@_NU,mxREAL)); - #else - plhs[3] = mxCreateStructMatrix(1, 1, 1, fieldnames); - mxSetField(plhs[3],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[2],@MODULE_PREFIX@_NMEAS[2],mxREAL)); - #endif - - xnext = mxGetPr(mxGetField(plhs[3],0,fieldnames[0])); - #if SENS_PROP == 1 - sensX = mxGetPr(mxGetField(plhs[3],0,fieldnames[1])); - sensU = mxGetPr(mxGetField(plhs[3],0,fieldnames[2])); - #endif - - for( k = 0; k < @MODULE_PREFIX@_NMEAS[2]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[2]; ++i ) { - #if SENS_PROP == 1 - xnext[k*@MODULE_PREFIX@_NOUT[2]+i] = out3[k*@MODULE_PREFIX@_NOUT[2]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i]; - #else - xnext[k*@MODULE_PREFIX@_NOUT[2]+i] = out3[k*@MODULE_PREFIX@_NOUT[2]+i]; - #endif - } - } - - #if SENS_PROP == 1 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( k = 0; k < @MODULE_PREFIX@_NMEAS[2]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[2]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*@MODULE_PREFIX@_NOUT[2]*@MODULE_PREFIX@_NMEAS[2]+k*@MODULE_PREFIX@_NOUT[2]+i] = out3[k*@MODULE_PREFIX@_NOUT[2]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[2]+i*@MODULE_PREFIX@_NX+j]; - } - } - } - for( k = 0; k < @MODULE_PREFIX@_NMEAS[2]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[2]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*@MODULE_PREFIX@_NOUT[2]*@MODULE_PREFIX@_NMEAS[2]+k*@MODULE_PREFIX@_NOUT[2]+i] = out3[k*@MODULE_PREFIX@_NOUT[2]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[2]*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - } - #endif - free(out3); - #if @MODULE_PREFIX@_NUMOUT > 3 - if (nlhs > 4) { - #if SENS_PROP == 1 - plhs[4] = mxCreateStructMatrix(1, 1, 3, fieldnames); - mxSetField(plhs[4],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[3],@MODULE_PREFIX@_NMEAS[3],mxREAL)); - mxSetField(plhs[4],0,fieldnames[1],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[3]*@MODULE_PREFIX@_NMEAS[3],@MODULE_PREFIX@_NX,mxREAL)); - mxSetField(plhs[4],0,fieldnames[2],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[3]*@MODULE_PREFIX@_NMEAS[3],@MODULE_PREFIX@_NU,mxREAL)); - #else - plhs[4] = mxCreateStructMatrix(1, 1, 1, fieldnames); - mxSetField(plhs[4],0,fieldnames[0],mxCreateDoubleMatrix(@MODULE_PREFIX@_NOUT[3],@MODULE_PREFIX@_NMEAS[3],mxREAL)); - #endif - - xnext = mxGetPr(mxGetField(plhs[4],0,fieldnames[0])); - #if SENS_PROP == 1 - sensX = mxGetPr(mxGetField(plhs[4],0,fieldnames[1])); - sensU = mxGetPr(mxGetField(plhs[4],0,fieldnames[2])); - #endif - - for( k = 0; k < @MODULE_PREFIX@_NMEAS[3]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[3]; ++i ) { - #if SENS_PROP == 1 - xnext[k*@MODULE_PREFIX@_NOUT[3]+i] = out4[k*@MODULE_PREFIX@_NOUT[3]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+i]; - #else - xnext[k*@MODULE_PREFIX@_NOUT[3]+i] = out4[k*@MODULE_PREFIX@_NOUT[3]+i]; - #endif - } - } - - #if SENS_PROP == 1 - /* NOTE: Matlab is column-major, while C is row-major order !! */ - for( k = 0; k < @MODULE_PREFIX@_NMEAS[3]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[3]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NX; ++j ) { - sensX[j*@MODULE_PREFIX@_NOUT[3]*@MODULE_PREFIX@_NMEAS[3]+k*@MODULE_PREFIX@_NOUT[3]+i] = out4[k*@MODULE_PREFIX@_NOUT[3]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[3]+i*@MODULE_PREFIX@_NX+j]; - } - } - } - for( k = 0; k < @MODULE_PREFIX@_NMEAS[3]; ++k ) { - for( i = 0; i < @MODULE_PREFIX@_NOUT[3]; ++i ) { - for( j = 0; j < @MODULE_PREFIX@_NU; ++j ) { - sensU[j*@MODULE_PREFIX@_NOUT[3]*@MODULE_PREFIX@_NMEAS[3]+k*@MODULE_PREFIX@_NOUT[3]+i] = out4[k*@MODULE_PREFIX@_NOUT[3]*(1+@MODULE_PREFIX@_NX+@MODULE_PREFIX@_NU)+@MODULE_PREFIX@_NOUT[3]*(1+@MODULE_PREFIX@_NX)+i*@MODULE_PREFIX@_NU+j]; - } - } - } - #endif - free(out4); - } - #endif - } - #endif - } - #endif - } - #endif -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpdunes.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpdunes.m.in deleted file mode 100644 index 33eef1b1c2..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpdunes.m.in +++ /dev/null @@ -1,94 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpDUNES embedded source files - qpDUNESSources = [ ... - 'CGRoot/qpdunes/src/dual_qp.c ' ... - 'CGRoot/qpdunes/src/setup_qp.c ' ... - 'CGRoot/qpdunes/src/matrix_vector.c ' ... - 'CGRoot/qpdunes/src/qpdunes_utils.c ' ... - 'CGRoot/qpdunes/src/stage_qp_solver_clipping.c ' ... - 'CGRoot/qpdunes/src/stage_qp_solver_qpoases.cpp ' ... - ]; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/BLASReplacement.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Bounds.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Constraints.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Flipper.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Indexlist.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/LAPACKReplacement.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/LoggedSQProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Matrices.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/MessageHandling.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Options.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/OQPinterface.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/QProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/QProblemB.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SolutionAnalysis.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SQProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SubjectTo.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Utils.cpp ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_hessian_regularization.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - if ( ispc == 0 ) - CPPFLAGS = [ '-largeArrayDims -D__DEBUG__ -D__cpluplus -cxx -O -D__NO_COPYRIGHT__ -DLINUX', ' ' ]; - else - CPPFLAGS = [ '-largeArrayDims -D__cpluplus -cxx -O -DWIN32', ' ' ]; - end - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' COPTIMFLAGS="$COPTIMFLAGS -O3" ' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpdunes/include'' -I''CGRoot/qpdunes/externals/qpOASES-3.0beta/include'' -I''CGRoot/qpdunes/externals/qpOASES-3.0beta/include/qpOASES'' ' ... - ' ldFlags CPPFLAGS' ... - ' -D__MATLAB__ -D__SIMPLE_BOUNDS_ONLY__ -O CGSources qpDUNESSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpDUNESSources = regexprep(qpDUNESSources, 'CGRoot', CGRoot); -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpDUNESSources', qpDUNESSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); -CGRecipe = regexprep(CGRecipe, 'CPPFLAGS', CPPFLAGS); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases.m.in deleted file mode 100644 index 05c3de3183..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases.m.in +++ /dev/null @@ -1,68 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpoases/SRC/Bounds.cpp ' ... - 'CGRoot/qpoases/SRC/Constraints.cpp ' ... - 'CGRoot/qpoases/SRC/CyclingManager.cpp ' ... - 'CGRoot/qpoases/SRC/Indexlist.cpp ' ... - 'CGRoot/qpoases/SRC/MessageHandling.cpp ' ... - 'CGRoot/qpoases/SRC/QProblem.cpp ' ... - 'CGRoot/qpoases/SRC/QProblemB.cpp ' ... - 'CGRoot/qpoases/SRC/SubjectTo.cpp ' ... - 'CGRoot/qpoases/SRC/Utils.cpp ' ... - 'CGRoot/qpoases/SRC/EXTRAS/SolutionAnalysis.cpp ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_hessian_regularization.c ' ... - 'CGRoot/@MODULE_NAME@_qpoases_interface.cpp ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpoases'' -I''CGRoot/qpoases/INCLUDE'' -I''CGRoot/qpoases/SRC''' ... - ' ldFlags' ... - ' -D__MATLAB__ -DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases_interface.hpp" -O CGSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases3.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases3.m.in deleted file mode 100644 index b44e2be997..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_EH_solver_qpoases3.m.in +++ /dev/null @@ -1,68 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpoases3/src/Bounds.c ' ... - 'CGRoot/qpoases3/src/Constraints.c ' ... - 'CGRoot/qpoases3/src/Indexlist.c ' ... - 'CGRoot/qpoases3/src/Matrices.c ' ... - 'CGRoot/qpoases3/src/MessageHandling.c ' ... - 'CGRoot/qpoases3/src/Options.c ' ... - 'CGRoot/qpoases3/src/Flipper.c ' ... - 'CGRoot/qpoases3/src/QProblem.c ' ... - 'CGRoot/qpoases3/src/QProblemB.c ' ... - 'CGRoot/qpoases3/src/Utils.c ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_hessian_regularization.c ' ... - 'CGRoot/@MODULE_NAME@_qpoases3_interface.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpoases3'' -I''CGRoot/qpoases3/include'' -I''CGRoot/qpoases3/src''' ... - ' ldFlags' ... - ' -D__MATLAB__ -D__CODE_GENERATION__ -Dinline="" -DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases3_interface.h" -O CGSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_block_solver_qpdunes.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_block_solver_qpdunes.m.in deleted file mode 100644 index b7b8ab53cb..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_block_solver_qpdunes.m.in +++ /dev/null @@ -1,93 +0,0 @@ -function make_acado_solver( name, extern ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = 'acado_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpDUNES embedded source files - qpDUNESSources = [ ... - 'CGRoot/qpdunes/src/dual_qp.c ' ... - 'CGRoot/qpdunes/src/setup_qp.c ' ... - 'CGRoot/qpdunes/src/matrix_vector.c ' ... - 'CGRoot/qpdunes/src/qpdunes_utils.c ' ... - 'CGRoot/qpdunes/src/stage_qp_solver_clipping.c ' ... - 'CGRoot/qpdunes/src/stage_qp_solver_qpoases.cpp ' ... - ]; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/BLASReplacement.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Bounds.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Constraints.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Flipper.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Indexlist.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/LAPACKReplacement.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/LoggedSQProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Matrices.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/MessageHandling.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Options.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/OQPinterface.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/QProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/QProblemB.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SolutionAnalysis.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SQProblem.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/SubjectTo.cpp ' ... - 'CGRoot/qpdunes/externals/qpOASES-3.0beta/src/Utils.cpp ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/acado_solver_mex.c ' ... - 'CGRoot/acado_solver.c ' ... - 'CGRoot/acado_integrator.c ' ... - 'CGRoot/acado_auxiliary_functions.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - if ( ispc == 0 ) - CPPFLAGS = [ '-largeArrayDims -D__DEBUG__ -D__cpluplus -cxx -O -D__NO_COPYRIGHT__ -DLINUX', ' ' ]; - else - CPPFLAGS = [ '-largeArrayDims -D__cpluplus -cxx -O -DWIN32', ' ' ]; - end - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' COPTIMFLAGS="$COPTIMFLAGS -O3" ' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpdunes/include'' -I''CGRoot/qpdunes/externals/qpOASES-3.0beta/include'' -I''CGRoot/qpdunes/externals/qpOASES-3.0beta/include/qpOASES'' ' ... - ' ldFlags CPPFLAGS' ... - ' -D__MATLAB__ -D__SIMPLE_BOUNDS_ONLY__ -O CGSources qpDUNESSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpDUNESSources = regexprep(qpDUNESSources, 'CGRoot', CGRoot); -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpDUNESSources', qpDUNESSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); -CGRecipe = regexprep(CGRecipe, 'CPPFLAGS', CPPFLAGS); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_integrator.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_integrator.m.in deleted file mode 100644 index eb92d0ae92..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_integrator.m.in +++ /dev/null @@ -1,49 +0,0 @@ -function make_@MODULE_NAME@_integrator( name, extern ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_integrator'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % Auto-generated files - CGSources = [ ... - '@MODULE_NAME@_integrate.c ' ... - '@MODULE_NAME@_integrator.c ' ... - '@MODULE_NAME@_auxiliary_sim_functions.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot''' ... - ' ldFlags' ... - ' -D__MATLAB__ -O CGSources -output %s.%s' ... - ]; - -% Compilation -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_forces.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_forces.m.in deleted file mode 100644 index ddf04516e3..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_forces.m.in +++ /dev/null @@ -1,61 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % Call FORCES generator - @MODULE_NAME@_forces_generator; - - % FORCES source files - qpFORCESSources = [ ... - 'CGRoot/forces/obj/forces.o ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/forces/include''' ... - ' ldFlags' ... - ' -D__MATLAB__ -DUSEMEXPRINTS -O CGSources qpFORCESSources -output %s.%s' ... - ]; - -% Compilation -qpFORCESSources = regexprep(qpFORCESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpFORCESSources', qpFORCESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); -disp( ['finished mexing ' fileOut '.' mexext '!'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_hpmpc.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_hpmpc.m.in deleted file mode 100644 index b316916fbf..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_hpmpc.m.in +++ /dev/null @@ -1,79 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Check if BLASFEO and HPMPC are present - if ~exist('blasfeo','dir') - error('Directory blasfeo not found! Please download blasfeo and build shared library.'); - end - if ~exist('hpmpc','dir') - error('Directory hpmpc not found! Please download hpmpc and build shared library.'); - end - if ~(exist('blasfeo/libblasfeo.so','file') || exist('blasfeo/blasfeo.dll','file')) - error('Directory blasfeo is found, but the required shared library is not. Please build the shared library of blasfeo.'); - end - if ~(exist('hpmpc/libhpmpc.so','file') || exist('hpmpc/hpmpc.dll','file')) - error('Directory hpmpc is found, but the required shared library is not. Please build the shared library of hpmpc.'); - end - - % Root folder of code generation - CGRoot = '.'; - - % HPMPC source files - qpHPMPCSources = [ ... - '' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_hpmpc_interface.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '''-lblasfeo -lhpmpc -lrt -Wl,-rpath=PWD/blasfeo,-rpath=PWD/hpmpc'''; - elseif (ispc) - ldFlags = '-lblasfeo -lhpmpc -DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' .... - ' -L./hpmpc -L./blasfeo' ... - ' -I. -I''CGRoot'' -I./blasfeo/include -I./hpmpc/include' ... - ' LDFLAGS=ldFlags' ... - ' -D__MATLAB__ -DUSEMEXPRINTS -O CGSources qpHPMPCSources -output %s.%s' ... - ]; - - -% Compilation -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpHPMPCSources', qpHPMPCSources); -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'PWD', pwd); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); -disp( ['finished mexing ' fileOut '.' mexext '!'] ); - -% Copy blasfeo and hpmpc libraries -if(ispc) - copyfile('blasfeo/blasfeo.dll','..'); - copyfile('hpmpc/hpmpc.dll','..'); -end diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpdunes.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpdunes.m.in deleted file mode 100644 index 09c26ac59c..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpdunes.m.in +++ /dev/null @@ -1,61 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpOASES embedded source files - qpDUNESSources = [ ... - 'CGRoot/qpdunes/src/dual_qp.c ' ... - 'CGRoot/qpdunes/src/matrix_vector.c ' ... - 'CGRoot/qpdunes/src/setup_qp.c ' ... - 'CGRoot/qpdunes/src/stage_qp_solver_clipping.c ' ... - 'CGRoot/qpdunes/src/qpdunes_utils.c ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpdunes/include'' ' ... - ' ldFlags CFLAGS="$CFLAGS -std=c99 -fPIC"' ... - ' -D__MATLAB__ -D__SIMPLE_BOUNDS_ONLY__ -O CGSources qpDUNESSources -output %s.%s' ... - ]; - -% Compilation -qpDUNESSources = regexprep(qpDUNESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpDUNESSources', qpDUNESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases.m.in deleted file mode 100644 index bb6ad30883..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases.m.in +++ /dev/null @@ -1,67 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpoases/SRC/Bounds.cpp ' ... - 'CGRoot/qpoases/SRC/Constraints.cpp ' ... - 'CGRoot/qpoases/SRC/CyclingManager.cpp ' ... - 'CGRoot/qpoases/SRC/Indexlist.cpp ' ... - 'CGRoot/qpoases/SRC/MessageHandling.cpp ' ... - 'CGRoot/qpoases/SRC/QProblem.cpp ' ... - 'CGRoot/qpoases/SRC/QProblemB.cpp ' ... - 'CGRoot/qpoases/SRC/SubjectTo.cpp ' ... - 'CGRoot/qpoases/SRC/Utils.cpp ' ... - 'CGRoot/qpoases/SRC/EXTRAS/SolutionAnalysis.cpp ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_qpoases_interface.cpp ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpoases'' -I''CGRoot/qpoases/INCLUDE'' -I''CGRoot/qpoases/SRC''' ... - ' ldFlags' ... - ' -D__MATLAB__ -DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases_interface.hpp" -O CGSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases3.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases3.m.in deleted file mode 100644 index 1051f986c2..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_qpoases3.m.in +++ /dev/null @@ -1,67 +0,0 @@ -function make_@MODULE_NAME@_solver( name ) - - % Output file name, and also function name - if (nargin > 0) - fileOut = name; - else - fileOut = '@MODULE_NAME@_solver'; - end; - - % Root folder of code generation - CGRoot = '.'; - - % qpOASES embedded source files - qpOASESSources = [ ... - 'CGRoot/qpoases3/src/Bounds.c ' ... - 'CGRoot/qpoases3/src/Constraints.c ' ... - 'CGRoot/qpoases3/src/Indexlist.c ' ... - 'CGRoot/qpoases3/src/Matrices.c ' ... - 'CGRoot/qpoases3/src/MessageHandling.c ' ... - 'CGRoot/qpoases3/src/Options.c ' ... - 'CGRoot/qpoases3/src/Flipper.c ' ... - 'CGRoot/qpoases3/src/QProblem.c ' ... - 'CGRoot/qpoases3/src/QProblemB.c ' ... - 'CGRoot/qpoases3/src/Utils.c ' ... - ]; - - % Auto-generated files - CGSources = [ ... - 'CGRoot/@MODULE_NAME@_solver_mex.c ' ... - 'CGRoot/@MODULE_NAME@_solver.c ' ... - 'CGRoot/@MODULE_NAME@_integrator.c ' ... - 'CGRoot/@MODULE_NAME@_auxiliary_functions.c ' ... - 'CGRoot/@MODULE_NAME@_qpoases3_interface.c ' ... - ]; - if (nargin > 1) - CGSources = [CGSources extern]; - end - - % Adding additional linker flags for Linux - ldFlags = ''; - if (isunix() && ~ismac()) - ldFlags = '-lrt'; - elseif (ispc) - ldFlags = '-DWIN32'; - end; - - % Recipe for compilation - CGRecipe = [ ... - 'mex -O' ... - ' -I. -I''CGRoot'' -I''CGRoot/qpoases3'' -I''CGRoot/qpoases3/include'' -I''CGRoot/qpoases3/src''' ... - ' ldFlags' ... - ' -D__MATLAB__ -D__CODE_GENERATION__ -Dinline="" -DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases3_interface.h" -O CGSources qpOASESSources -output %s.%s' ... - ]; - -% Compilation -qpOASESSources = regexprep(qpOASESSources, 'CGRoot', CGRoot); -CGSources = regexprep(CGSources, 'CGRoot', CGRoot); - -CGRecipe = regexprep(CGRecipe, 'CGRoot', CGRoot); -CGRecipe = regexprep(CGRecipe, 'CGSources', CGSources); -CGRecipe = regexprep(CGRecipe, 'qpOASESSources', qpOASESSources); -CGRecipe = regexprep(CGRecipe, 'ldFlags', ldFlags); - -% disp( sprintf( CGRecipe, fileOut, mexext ) ); -fprintf( 'compiling... ' ); -eval( sprintf(CGRecipe, fileOut, mexext) ); -fprintf( ['done! --> ' fileOut '.' mexext '\n'] ); diff --git a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_sfunction.m.in b/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_sfunction.m.in deleted file mode 100644 index ccd0f11114..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/make_acado_solver_sfunction.m.in +++ /dev/null @@ -1,251 +0,0 @@ -%% Legacy code wrapper for the ACADO CGT generated OCP solver - -% Dimensions -@MODULE_PREFIX@_N = @N@; -@MODULE_PREFIX@_NX = @NX@; -@MODULE_PREFIX@_NDX = @NDX@; -@MODULE_PREFIX@_NXA = @NXA@; -@MODULE_PREFIX@_NU = @NU@; -@MODULE_PREFIX@_NOD = @NOD@; -@MODULE_PREFIX@_NY = @NY@; -@MODULE_PREFIX@_NYN = @NYN@; - -@MODULE_PREFIX@_QP_SOLVER = '@QP_SOLVER@'; -@MODULE_PREFIX@_INITIAL_STATE_FIXED = @INIT_STATE_FIXED@; -@MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE = @WEIGHT_MATRIX_TYPE@; -@MODULE_PREFIX@_HARDCODED_CONSTRAINT_VALUES = @HARCODED_CONSTRAINTS@; -@MODULE_PREFIX@_USE_ARRIVAL_COST = @ARRIVAL_COST@; -@MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX = @COV_MATRIX@; - -aSfunName = '@MODULE_NAME@_solver_sfun'; -aRealT = '@REAL_TYPE@'; -aHeaderFile = '@MODULE_NAME@_solver_sfunction.h'; - -%% Define busses - -clear avCells aInput aOutput @MODULE_PREFIX@data @MODULE_PREFIX@input @MODULE_PREFIX@output; - -% Define ACADOvariables bus: -avCells = {'@MODULE_PREFIX@data', aHeaderFile, '', 'Auto', '-1', {}}; - -idx = 1; -avCells{ 6 }{ idx } = {'x', [1, (@MODULE_PREFIX@_N + 1) * @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -avCells{ 6 }{ idx } = {'u', [1, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NU], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; - -if @MODULE_PREFIX@_NXA > 0 - avCells{ 6 }{ idx } = {'z', [1, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NXA], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -if @MODULE_PREFIX@_NOD > 0 - avCells{ 6 }{ idx } = {'od', [1, (@MODULE_PREFIX@_N + 1) * @MODULE_PREFIX@_NOD], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -avCells{ 6 }{ idx } = {'y', [1, @MODULE_PREFIX@_N * @MODULE_PREFIX@_NY], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -avCells{ 6 }{ idx } = {'yN', [1, @MODULE_PREFIX@_NYN], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; - -if @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 1 - avCells{ 6 }{ idx } = {'W', [1, @MODULE_PREFIX@_NY * @MODULE_PREFIX@_NY], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -elseif @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE == 2 - avCells{ 6 }{ idx } = {'W', [1, @MODULE_PREFIX@_NY * @MODULE_PREFIX@_N * @MODULE_PREFIX@_NY], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -if @MODULE_PREFIX@_WEIGHTING_MATRICES_TYPE ~= 0 - avCells{ 6 }{ idx } = {'WN', [1, @MODULE_PREFIX@_NYN * @MODULE_PREFIX@_NYN], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -if @MODULE_PREFIX@_USE_ARRIVAL_COST == 1 - avCells{ 6 }{ idx } = {'xAC', [1, @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; - avCells{ 6 }{ idx } = {'SAC', [1, @MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; - avCells{ 6 }{ idx } = {'WL', [1, @MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -if @MODULE_PREFIX@_INITIAL_STATE_FIXED == 1 - avCells{ 6 }{ idx } = {'x0', [1, @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - avCells{ 6 }{ idx } = {'sigmaN', [1, @MODULE_PREFIX@_NX * @MODULE_PREFIX@_NX], aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; idx = idx + 1; -end; - -% Define input bus for the Simulink component: -aInput = { ... - '@MODULE_PREFIX@input', aHeaderFile, '', ... - { - {'control', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'shifting', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'initialization', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'data', 1, '@MODULE_PREFIX@data', -1, 'real', 'Sample', 'Fixed', [], []}; ... - } - }; - -% Define output bus for the Simulink component: -aOutput = { ... - '@MODULE_PREFIX@output', aHeaderFile, '', ... - { - {'status', 1, 'int32', -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'kktValue', 1, aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'objValue', 1, aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'execTime', 1, aRealT, -1, 'real', 'Sample', 'Fixed', [], []}; ... - {'data', 1, '@MODULE_PREFIX@data', -1, 'real', 'Sample', 'Fixed', [], []}; ... - } - }; - -% Generate all structures -Simulink.Bus.cellToObject( {avCells, aInput, aOutput} ); - -%% Define S-function wrapper - -clear @MODULE_PREFIX@Def; - -@MODULE_PREFIX@Def = legacy_code('initialize'); - -if strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES') - @MODULE_PREFIX@Def.Options.language = 'C++'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES3') - @MODULE_PREFIX@Def.Options.language = 'C'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPDUNES') - @MODULE_PREFIX@Def.Options.language = 'C'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'HPMPC') - @MODULE_PREFIX@Def.Options.language = 'C'; -else - error('Unknown QP solver') -end; - - -% Define the S-function name -@MODULE_PREFIX@Def.SFunctionName = aSfunName; - -% Define source files -@MODULE_PREFIX@Def.SourceFiles = { ... - '@MODULE_NAME@_solver.c', ... - '@MODULE_NAME@_integrator.c', ... - '@MODULE_NAME@_auxiliary_functions.c', ... - '@MODULE_NAME@_solver_sfunction.c' ... - }; - -if strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES') - @MODULE_PREFIX@Def.SourceFiles{end + 1} = '@MODULE_NAME@_qpoases_interface.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/Bounds.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/Constraints.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/CyclingManager.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/Indexlist.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/MessageHandling.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/QProblem.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/QProblemB.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/SubjectTo.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/Utils.cpp'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases/SRC/EXTRAS/SolutionAnalysis.cpp'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES3') - @MODULE_PREFIX@Def.SourceFiles{end + 1} = '@MODULE_NAME@_qpoases3_interface.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Bounds.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Constraints.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Indexlist.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Matrices.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/MessageHandling.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Options.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Flipper.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/QProblem.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/QProblemB.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpoases3/src/Utils.c'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPDUNES') - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpdunes/src/dual_qp.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpdunes/src/matrix_vector.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpdunes/src/setup_qp.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpdunes/src/stage_qp_solver_clipping.c'; - @MODULE_PREFIX@Def.SourceFiles{end + 1} = 'qpdunes/src/utils.c'; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'HPMPC') - @MODULE_PREFIX@Def.SourceFiles{end + 1} = '@MODULE_NAME@_hpmpc_interface.c'; -else - error('Unknown QP solver') -end; - -% Define header files -@MODULE_PREFIX@Def.HeaderFiles = {'@MODULE_NAME@_common.h', aHeaderFile}; - -% Define include folders -if strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES') - @MODULE_PREFIX@Def.IncPaths = { ... - 'qpoases', ... - 'qpoases/INCLUDE', ... - 'qpoases/SRC' ... - }; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES3') - @MODULE_PREFIX@Def.IncPaths = { ... - 'qpoases3', ... - 'qpoases3/include', ... - 'qpoases3/src' ... - }; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPDUNES') - @MODULE_PREFIX@Def.IncPaths = { ... - 'qpdunes/include', ... - }; -elseif strcmp(@MODULE_PREFIX@_QP_SOLVER, 'HPMPC') - @MODULE_PREFIX@Def.IncPaths = { ... - 'hpmpc/include', ... - }; -else - error('Unknown QP solver') -end; - -% link against some libs maybe -ldFlags = ''; -if (isunix() && ~ismac()) -% ldFlags = [ldFlags '-lrt']; -elseif (ispc) - ldFlags = [ldFlags '-DWIN32']; -end; - -%add Hpmpc static library -if strcmp(ACADO_QP_SOLVER, 'HPMPC') - ACADODef.LibPaths = {'hpmpc'}; - ACADODef.HostLibFiles = {'libhpmpc.a'}; -end -% Add an extra option for qpOASES -iFlags = {''}; -if (~strcmp(aSfunName, 'acado_solver_sfun')) && (strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES')) - iFlags = {'-DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases_interface.hpp"'}; -end; -if strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPOASES3') - iFlags = {'-D__CODE_GENERATION__', '-DQPOASES_CUSTOM_INTERFACE="@MODULE_NAME@_qpoases3_interface.h"'}; -end; -if strcmp(@MODULE_PREFIX@_QP_SOLVER, 'QPDUNES') - iFlags = {'-D__SIMPLE_BOUNDS_ONLY__'}; -end; -if strcmp(ACADO_QP_SOLVER, 'HPMPC') - iFlags = ''; -end;i - -% Define output function declaration -@MODULE_PREFIX@Def.OutputFcnSpec = [ ... - '@MODULE_NAME@_step(' ... % Wrapper function name - '@MODULE_PREFIX@input u1[1], ' ... % Input argument - '@MODULE_PREFIX@output y1[1])' ... % Output argument - ]; -% Define init function declaration -@MODULE_PREFIX@Def.StartFcnSpec = '@MODULE_NAME@_initialize( void )'; -% Define terminate function declaration -@MODULE_PREFIX@Def.TerminateFcnSpec = '@MODULE_NAME@_cleanup( void )'; - -%% Generate S-function source file -legacy_code('sfcn_cmex_generate', @MODULE_PREFIX@Def); - -%% Compile the code -legacy_code('compile', @MODULE_PREFIX@Def, {iFlags{:}, ldFlags}); - -%% Generate a TLC file and simulation block -legacy_code('slblock_generate', @MODULE_PREFIX@Def); -legacy_code('sfcn_tlc_generate', @MODULE_PREFIX@Def); -% Mandatory, because not all the source and header files are in the same folder -legacy_code('rtwmakecfg_generate', @MODULE_PREFIX@Def); - -%% Remove dependency on the header file and regenerate the Simulink structures - -avCells{ 2 } = ''; -aInput{ 2 } = ''; -aOutput{ 2 } = ''; - -% Generate all structures -Simulink.Bus.cellToObject( {avCells, aInput, aOutput} ); - -%% Clear byproducts -clear aInput aOutput avCells idx iFlags ldFlags aSfunName aRealT aHeaderFile; diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpdunes.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpdunes.in deleted file mode 100644 index b2e7a0f43c..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpdunes.in +++ /dev/null @@ -1,43 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -std=c99 -O3 -finline-functions -I. -I./qpdunes/include -D__SIMPLE_BOUNDS_ONLY__ -CXXFLAGS = -O3 -finline-functions -I. -I./qpdunes/include -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpdunes/src/dual_qp.o \ - ./qpdunes/src/matrix_vector.o \ - ./qpdunes/src/setup_qp.o \ - ./qpdunes/src/stage_qp_solver_clipping.o \ - ./qpdunes/src/utils.o \ - acado_integrator.o \ - acado_solver.o \ - acado_auxiliary_functions.o \ - acado_hessian_regularization.o - -.PHONY: all -all: libacado_exported_rti.a test - -test: ${OBJECTS} test.o - -acado_solver.o : acado_common.h -acado_integrator.o : acado_common.h -acado_auxiliary_functions.o : acado_common.h \ - acado_auxiliary_functions.h -test.o : acado_common.h \ - acado_auxiliary_functions.h - -libacado_exported_rti.a: ${OBJECTS} - ar r $@ $? - -.PHONY : clean -clean : - -rm -f *.o *.a test qpdunes/src/*.o diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases.in deleted file mode 100644 index b76bc62cfd..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases.in +++ /dev/null @@ -1,53 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I. -I./qpoases -CXXFLAGS = -O3 -finline-functions -I. -I./qpoases -I./qpoases/INCLUDE -I./qpoases/SRC -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpoases/SRC/Bounds.o \ - ./qpoases/SRC/Constraints.o \ - ./qpoases/SRC/CyclingManager.o \ - ./qpoases/SRC/Indexlist.o \ - ./qpoases/SRC/MessageHandling.o \ - ./qpoases/SRC/QProblem.o \ - ./qpoases/SRC/QProblemB.o \ - ./qpoases/SRC/SubjectTo.o \ - ./qpoases/SRC/Utils.o \ - ./qpoases/SRC/EXTRAS/SolutionAnalysis.o \ - acado_qpoases_interface.o \ - acado_integrator.o \ - acado_solver.o \ - acado_auxiliary_functions.o \ - acado_hessian_regularization.o - -.PHONY: all -all: libacado_exported_rti.a test - -test: ${OBJECTS} test.o - -acado_qpoases_interface.o : acado_qpoases_interface.hpp -acado_solver.o : acado_common.h -acado_integrator.o : acado_common.h -acado_auxiliary_functions.o : acado_common.h \ - acado_auxiliary_functions.h -test.o : acado_common.h \ - acado_qpoases_interface.hpp \ - acado_auxiliary_functions.h - -libacado_exported_rti.a: ${OBJECTS} - ar r $@ $? - -${OBJECTS} : acado_qpoases_interface.hpp - -.PHONY : clean -clean : - -rm -f *.o *.a ./qpoases/*.o ./qpoases/SRC/*.o ./qpoases/SRC/*.a test diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases3.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases3.in deleted file mode 100644 index dc1b03c226..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.EH_qpoases3.in +++ /dev/null @@ -1,53 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I. -I./qpoases3 -I./qpoases3/include -I./qpoases3/src -CXXFLAGS = -O3 -finline-functions -I. -I./qpoases3 -I./qpoases3/include -I./qpoases3/src -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpoases3/src/Bounds.o \ - ./qpoases3/src/Constraints.o \ - ./qpoases3/src/Indexlist.o \ - ./qpoases3/src/Matrices.o \ - ./qpoases3/src/MessageHandling.o \ - ./qpoases3/src/Options.o \ - ./qpoases3/src/Flipper.o \ - ./qpoases3/src/QProblem.o \ - ./qpoases3/src/QProblemB.o \ - ./qpoases3/src/Utils.o \ - acado_qpoases3_interface.o \ - acado_integrator.o \ - acado_solver.o \ - acado_auxiliary_functions.o \ - acado_hessian_regularization.o - -.PHONY: all -all: libacado_exported_rti.a test - -test: ${OBJECTS} test.o - -acado_qpoases3_interface.o : acado_qpoases3_interface.h -acado_solver.o : acado_common.h -acado_integrator.o : acado_common.h -acado_auxiliary_functions.o : acado_common.h \ - acado_auxiliary_functions.h -test.o : acado_common.h \ - acado_qpoases3_interface.h \ - acado_auxiliary_functions.h - -libacado_exported_rti.a: ${OBJECTS} - ar r $@ $? - -${OBJECTS} : acado_qpoases3_interface.h - -.PHONY : clean -clean : - -rm -f *.o *.a ./qpoases3/*.o ./qpoases3/src/*.o ./qpoases3/src/*.a test \ No newline at end of file diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.forces.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.forces.in deleted file mode 100644 index d57cab8e07..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.forces.in +++ /dev/null @@ -1,49 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I./forces/include -CXXFLAGS = -O3 -finline-functions -I./forces/include -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -FORCES_SOURCES = \ - ./forces/src/forces.c \ - ./forces/include/forces.h - -OBJECTS = \ - ./forces/src/forces.o \ - @MODULE_NAME@_integrator.o \ - @MODULE_NAME@_solver.o \ - @MODULE_NAME@_auxiliary_functions.o - -.PHONY: all -all: lib@MODULE_NAME@_exported_rti.a - -test: ${OBJECTS} test.o - -$(FORCES_SOURCES): @MODULE_NAME@_forces_generator.py - python @MODULE_NAME@_forces_generator.py - -./forces/src/forces.o : ./forces/include/forces.h -@MODULE_NAME@_solver.o : @MODULE_NAME@_common.h -@MODULE_NAME@_integrator.o : @MODULE_NAME@_common.h -@MODULE_NAME@_auxiliary_functions.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_functions.h -test.o : @MODULE_NAME@_common.h \ - ./forces/include/forces.h \ - @MODULE_NAME@_auxiliary_functions.h - -lib@MODULE_NAME@_exported_rti.a: ${OBJECTS} - ar r $@ $? - -${OBJECTS} : @MODULE_NAME@_common.h - -.PHONY : clean -clean : - -rm -rf *.o *.a ./forces diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.hpmpc.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.hpmpc.in deleted file mode 100644 index b429a3b06f..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.hpmpc.in +++ /dev/null @@ -1,26 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -l:libhpmpc.a -l:libblasfeo.a -L./hpmpc -L./blasfeo -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I/usr/local/include -I./hpmpc/include -I./blasfeo/include -CXXFLAGS = -O3 -finline-functions -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = @MODULE_NAME@_integrator.o @MODULE_NAME@_solver.o @MODULE_NAME@_auxiliary_functions.o @MODULE_NAME@_hpmpc_interface.o - -.PHONY: all -all: lib@MODULE_NAME@_exported_rti.a test - -test: ${OBJECTS} test.o - -lib@MODULE_NAME@_exported_rti.a: ${OBJECTS} - ar r $@ $? - -clean: - rm -f *.o lib@MODULE_NAME@_exported_rti.a test diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.integrator.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.integrator.in deleted file mode 100644 index 3141f21d68..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.integrator.in +++ /dev/null @@ -1,40 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -I. -CXXFLAGS = -O3 -finline-functions -I. -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - @MODULE_NAME@_auxiliary_sim_functions.o \ - @MODULE_NAME@_integrator.o - -.PHONY: all -all: @MODULE_NAME@_test @MODULE_NAME@_compare - -@MODULE_NAME@_test: ${OBJECTS} @MODULE_NAME@_test.o - -@MODULE_NAME@_compare: ${OBJECTS} @MODULE_NAME@_compare.o - -@MODULE_NAME@_auxiliary_sim_functions.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_sim_functions.h -@MODULE_NAME@_integrator.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_sim_functions.h -@MODULE_NAME@_test.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_sim_functions.h -@MODULE_NAME@_compare.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_sim_functions.h - -${OBJECTS} : @MODULE_NAME@_auxiliary_sim_functions.h - -.PHONY : clean -clean : - -rm -f *.o *.a @MODULE_NAME@_test @MODULE_NAME@_compare - diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpdunes.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.qpdunes.in deleted file mode 100644 index 1f28c4b590..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpdunes.in +++ /dev/null @@ -1,42 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -std=c99 -O3 -finline-functions -I. -I./qpdunes/include -D__SIMPLE_BOUNDS_ONLY__ -CXXFLAGS = -O3 -finline-functions -I. -I./qpdunes/include -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpdunes/src/dual_qp.o \ - ./qpdunes/src/matrix_vector.o \ - ./qpdunes/src/setup_qp.o \ - ./qpdunes/src/stage_qp_solver_clipping.o \ - ./qpdunes/src/utils.o \ - @MODULE_NAME@_integrator.o \ - @MODULE_NAME@_solver.o \ - @MODULE_NAME@_auxiliary_functions.o - -.PHONY: all -all: lib@MODULE_NAME@_exported_rti.a test - -test: ${OBJECTS} test.o - -@MODULE_NAME@_solver.o : @MODULE_NAME@_common.h -@MODULE_NAME@_integrator.o : @MODULE_NAME@_common.h -@MODULE_NAME@_auxiliary_functions.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_functions.h -test.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_functions.h - -lib@MODULE_NAME@_exported_rti.a: ${OBJECTS} - ar r $@ $? - -.PHONY : clean -clean : - -rm -f *.o *.a test qpdunes/src/*.o \ No newline at end of file diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases.in deleted file mode 100644 index 753b03e3f1..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases.in +++ /dev/null @@ -1,52 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I. -I./qpoases -CXXFLAGS = -O3 -finline-functions -I. -I./qpoases -I./qpoases/INCLUDE -I./qpoases/SRC -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpoases/SRC/Bounds.o \ - ./qpoases/SRC/Constraints.o \ - ./qpoases/SRC/CyclingManager.o \ - ./qpoases/SRC/Indexlist.o \ - ./qpoases/SRC/MessageHandling.o \ - ./qpoases/SRC/QProblem.o \ - ./qpoases/SRC/QProblemB.o \ - ./qpoases/SRC/SubjectTo.o \ - ./qpoases/SRC/Utils.o \ - ./qpoases/SRC/EXTRAS/SolutionAnalysis.o \ - @MODULE_NAME@_qpoases_interface.o \ - @MODULE_NAME@_integrator.o \ - @MODULE_NAME@_solver.o \ - @MODULE_NAME@_auxiliary_functions.o - -.PHONY: all -all: lib@MODULE_NAME@_exported_rti.a test - -test: ${OBJECTS} test.o - -@MODULE_NAME@_qpoases_interface.o : @MODULE_NAME@_qpoases_interface.hpp -@MODULE_NAME@_solver.o : @MODULE_NAME@_common.h -@MODULE_NAME@_integrator.o : @MODULE_NAME@_common.h -@MODULE_NAME@_auxiliary_functions.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_functions.h -test.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_qpoases_interface.hpp \ - @MODULE_NAME@_auxiliary_functions.h - -lib@MODULE_NAME@_exported_rti.a: ${OBJECTS} - ar r $@ $? - -${OBJECTS} : @MODULE_NAME@_qpoases_interface.hpp - -.PHONY : clean -clean : - -rm -f *.o *.a ./qpoases/*.o ./qpoases/SRC/*.o ./qpoases/SRC/*.a test \ No newline at end of file diff --git a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases3.in b/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases3.in deleted file mode 100644 index f63d801e19..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/makefile.qpoases3.in +++ /dev/null @@ -1,52 +0,0 @@ -UNAME := $(shell uname) - -LDLIBS = -lm -lstdc++ -ifeq ($(UNAME), Linux) - LDLIBS += -lrt -endif - -CCACHE_APP := $(shell which ccache 2>/dev/null) - -CFLAGS = -O3 -finline-functions -I. -I./qpoases3 -I./qpoases3/include -I./qpoases3/src -D__CODE_GENERATION__ -CXXFLAGS = -O3 -finline-functions -I. -I./qpoases3 -I./qpoases3/include -I./qpoases3/src -CC = $(CCACHE_APP) gcc -CXX = $(CCACHE_APP) g++ - -OBJECTS = \ - ./qpoases3/src/Bounds.o \ - ./qpoases3/src/Constraints.o \ - ./qpoases3/src/Indexlist.o \ - ./qpoases3/src/Matrices.o \ - ./qpoases3/src/MessageHandling.o \ - ./qpoases3/src/Options.o \ - ./qpoases3/src/Flipper.o \ - ./qpoases3/src/QProblem.o \ - ./qpoases3/src/QProblemB.o \ - ./qpoases3/src/Utils.o \ - @MODULE_NAME@_qpoases3_interface.o \ - @MODULE_NAME@_integrator.o \ - @MODULE_NAME@_solver.o \ - @MODULE_NAME@_auxiliary_functions.o - -.PHONY: all -all: lib@MODULE_NAME@_exported_rti.a test - -test: ${OBJECTS} test.o - -@MODULE_NAME@_qpoases3_interface.o : @MODULE_NAME@_qpoases3_interface.h -@MODULE_NAME@_solver.o : @MODULE_NAME@_common.h -@MODULE_NAME@_integrator.o : @MODULE_NAME@_common.h -@MODULE_NAME@_auxiliary_functions.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_auxiliary_functions.h -test.o : @MODULE_NAME@_common.h \ - @MODULE_NAME@_qpoases3_interface.h \ - @MODULE_NAME@_auxiliary_functions.h - -lib@MODULE_NAME@_exported_rti.a: ${OBJECTS} - ar r $@ $? - -${OBJECTS} : @MODULE_NAME@_qpoases3_interface.h - -.PHONY : clean -clean : - -rm -f *.o *.a ./qpoases3/*.o ./qpoases3/src/*.o ./qpoases3/src/*.a test \ No newline at end of file diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpdunes_interface.in b/phonelibs/acado/include/acado/code_generation/templates/qpdunes_interface.in deleted file mode 100644 index fc3b88951f..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpdunes_interface.in +++ /dev/null @@ -1,77 +0,0 @@ -/******************************************************************************/ -/* */ -/* qpDUNES interface data and functions */ -/* */ -/******************************************************************************/ - -#include - -qpData_t qpData; -qpOptions_t qpOptions; - -#if @DIAG_H@ -#define QPDUNES_LS_HOMOTOPY_GRID_SEARCH 0 -#endif - -int initializeQpDunes( void ) -{ - return_t statusFlag; - int kk; - - @QP_ND_ARRAY@ - - qpOptions = qpDUNES_setupDefaultOptions(); - qpOptions.maxIter = @MAX_ITER@; - qpOptions.printLevel = @PRINT_LEVEL@; - qpOptions.stationarityTolerance = 1.e-6; - qpOptions.regParam = 1.e-6; - qpOptions.newtonHessDiagRegTolerance = 1.e-8; - qpOptions.lsType = @DIAG_H@ ? QPDUNES_LS_ACCELERATED_GRADIENT_BISECTION_LS : QPDUNES_LS_HOMOTOPY_GRID_SEARCH; -/* qpOptions.lsType = QPDUNES_LS_BACKTRACKING_LS; */ - qpOptions.lineSearchReductionFactor = 0.1; - qpOptions.lineSearchMaxStepSize = 1.; - qpOptions.maxNumLineSearchIterations = 25; - qpOptions.maxNumLineSearchRefinementIterations = 25; -/* qpOptions.regType = QPDUNES_REG_SINGULAR_DIRECTIONS; */ - qpOptions.regType = QPDUNES_REG_LEVENBERG_MARQUARDT; - - qpDUNES_setup(&qpData, @ACADO_N@, @ACADO_NX@, @ACADO_NU@, nD, &( qpOptions )); - - for (kk = 0; kk < @ACADO_N@; ++kk) - { - qpData.intervals[ kk ]->H.sparsityType = @DIAG_H@ ? QPDUNES_DIAGONAL : QPDUNES_DENSE; - } - qpData.intervals[ @ACADO_N@ ]->H.sparsityType = @DIAG_HN@ ? QPDUNES_DIAGONAL : QPDUNES_DENSE; - - statusFlag = qpDUNES_init(&qpData, @QP_H@, @QP_G@, @QP_C@, @QP_c@, @QP_LB@, @QP_UB@, @QP_D@, @QP_LBA@, @QP_UBA@); - - return (int)statusFlag; -} - -void cleanupQpDunes( void ) -{ - qpDUNES_cleanup( &qpData ); -} - -int solveQpDunes( void ) -{ - return_t statusFlag; - - statusFlag = qpDUNES_updateData(&qpData, @QP_H@, @QP_G@, @QP_C@, @QP_c@, @QP_LB@, @QP_UB@, @QP_D@, @QP_LBA@, @QP_UBA@); - if (statusFlag != QPDUNES_OK) - return (int)statusFlag; - - if ( @INITIAL_STATE_FIXED@ ) - statusFlag = qpDUNES_updateIntervalData(&qpData, qpData.intervals[ 0 ], 0, 0, 0, 0, @QP_LB_0@, @QP_UB_0@, 0, 0, 0, 0); - else - statusFlag = qpDUNES_updateIntervalData(&qpData, qpData.intervals[ @ACADO_N@ ], 0, @QP_G_N@, 0, 0, 0, 0, 0, 0, 0, 0); - if (statusFlag != QPDUNES_OK) - return (int)statusFlag; - - statusFlag = qpDUNES_solve( &qpData ); - - qpDUNES_getPrimalSol(&qpData, @QP_PRIMAL@); - qpDUNES_getDualSol(&qpData, @QP_LAMBDA@, @QP_MU@); - - return (int)statusFlag; -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpdunes_split_interface.in b/phonelibs/acado/include/acado/code_generation/templates/qpdunes_split_interface.in deleted file mode 100644 index 680fb8d3e7..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpdunes_split_interface.in +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************/ -/* */ -/* qpDUNES interface data and functions */ -/* */ -/******************************************************************************/ - -#include - -qpData_t qpData; -qpOptions_t qpOptions; - -#if @DIAG_H@ -#define QPDUNES_LS_HOMOTOPY_GRID_SEARCH 0 -#endif - -#include "@MODULE_NAME@_auxiliary_functions.h" -real_t prepareQPtime, updateQPtime, solveQPtime; - -int initializeQpDunes( void ) -{ - return_t statusFlag; - int kk; - - @QP_ND_ARRAY@ - - qpOptions = qpDUNES_setupDefaultOptions(); - qpOptions.maxIter = @MAX_ITER@; - qpOptions.printLevel = @PRINT_LEVEL@; - qpOptions.stationarityTolerance = 1.e-6; - qpOptions.regParam = 1.e-6; - qpOptions.newtonHessDiagRegTolerance = 1.e-8; - qpOptions.lsType = @DIAG_H@ ? QPDUNES_LS_ACCELERATED_GRADIENT_BISECTION_LS : QPDUNES_LS_HOMOTOPY_GRID_SEARCH; -/* qpOptions.lsType = QPDUNES_LS_BACKTRACKING_LS; */ - qpOptions.lineSearchReductionFactor = 0.1; - qpOptions.lineSearchMaxStepSize = 1.; - qpOptions.maxNumLineSearchIterations = 25; - qpOptions.maxNumLineSearchRefinementIterations = 25; -/* qpOptions.regType = QPDUNES_REG_SINGULAR_DIRECTIONS; */ - qpOptions.regType = QPDUNES_REG_LEVENBERG_MARQUARDT; - - qpDUNES_setup(&qpData, @ACADO_N@, @ACADO_NX@, @ACADO_NU@, nD, &( qpOptions )); - - for (kk = 0; kk < @ACADO_N@; ++kk) - { - qpData.intervals[ kk ]->H.sparsityType = @DIAG_H@ ? QPDUNES_DIAGONAL : QPDUNES_DENSE; - } - qpData.intervals[ @ACADO_N@ ]->H.sparsityType = @DIAG_HN@ ? QPDUNES_DIAGONAL : QPDUNES_DENSE; - - statusFlag = qpDUNES_init(&qpData, @QP_H@, @QP_G@, @QP_C@, @QP_c@, @QP_LB@, @QP_UB@, @QP_D@, @QP_LBA@, @QP_UBA@); - - return (int)statusFlag; -} - -void cleanupQpDunes( void ) -{ - qpDUNES_cleanup( &qpData ); -} - -int prepareQpDunes( void ) -{ - return_t statusFlag; - @MODULE_NAME@_timer tmr; - - @MODULE_NAME@_tic( &tmr ); - statusFlag = qpDUNES_updateData(&qpData, @QP_H@, @QP_G@, @QP_C@, @QP_c@, @QP_LB@, @QP_UB@, @QP_D@, @QP_LBA@, @QP_UBA@); - if (statusFlag != QPDUNES_OK) - return (int)statusFlag; - prepareQPtime = @MODULE_NAME@_toc( &tmr ); - - return (int)statusFlag; -} - -int solveQpDunes( void ) -{ - return_t statusFlag; - @MODULE_NAME@_timer tmr; - - @MODULE_NAME@_tic( &tmr ); - if ( @INITIAL_STATE_FIXED@ ) - statusFlag = qpDUNES_updateIntervalData(&qpData, qpData.intervals[ 0 ], 0, 0, 0, 0, @QP_LB_0@, @QP_UB_0@, 0, 0, 0, 0); - else - statusFlag = qpDUNES_updateIntervalData(&qpData, qpData.intervals[ @ACADO_N@ ], 0, @QP_G_N@, 0, 0, 0, 0, 0, 0, 0, 0); - if (statusFlag != QPDUNES_OK) - return (int)statusFlag; - updateQPtime = @MODULE_NAME@_toc( &tmr ); - - @MODULE_NAME@_tic( &tmr ); - statusFlag = qpDUNES_solve( &qpData ); - - qpDUNES_getPrimalSol(&qpData, @QP_PRIMAL@); - qpDUNES_getDualSol(&qpData, @QP_LAMBDA@, @QP_MU@); - solveQPtime = @MODULE_NAME@_toc( &tmr ); - - return (int)statusFlag; -} - diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.c.in b/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.c.in deleted file mode 100644 index 52673ed1b9..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.c.in +++ /dev/null @@ -1,60 +0,0 @@ -#include <@ACADO_COMMON_HEADER@> - -#include "qpOASES_e/@SOLVER_NAME@.h" - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -#include "qpOASES_e/extras/SolutionAnalysis.h" -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - -static int @MODULE_NAME@_@PREFIX@nWSR; - -@USE_NAMESPACE@ - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -static SolutionAnalysis @MODULE_NAME@_sa; -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - -int @MODULE_NAME@_@PREFIX@solve( void ) -{ - - returnValue retVal; - @SOLVER_NAME@ qp; - Options options; - - @MODULE_NAME@_@PREFIX@nWSR = QPOASES_NWSRMAX; - - @CTOR@; - Options_setToMPC( &options ); - @SOLVER_NAME@_setOptions( &qp,options ); - - retVal = @SOLVER_NAME@_@CALL_SOLVER@ - retVal = qpOASES_getSimpleStatus( retVal,0 ); - - /* only use solution on success, if iteration limit has been reached or if QP is infeasible! */ - if ( ( retVal == 0 ) || ( retVal == 1 ) || ( retVal == -2 ) ) - { - @SOLVER_NAME@_getPrimalSolution( &qp,@PRIMAL_SOLUTION@ ); - @SOLVER_NAME@_getDualSolution( &qp,@DUAL_SOLUTION@ ); - } - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - - if (retVal != SUCCESSFUL_RETURN) - return (int)retVal; - - retVal = @MODULE_NAME@_sa.getHessianInverse( &qp,@SIGMA@ ); - -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - - return (int)retVal; -} - -int @MODULE_NAME@_@PREFIX@getNWSR( void ) -{ - return @MODULE_NAME@_@PREFIX@nWSR; -} - -const char* @MODULE_NAME@_@PREFIX@getErrorString( int error ) -{ - return MessageHandling_getErrorCodeMessage( qpOASES_getGlobalMessageHandler(),error ); -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.h.in b/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.h.in deleted file mode 100644 index 6e464205fa..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpoases3_interface.h.in +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef @SOLVER_DEFINE@ -#define @SOLVER_DEFINE@ - -#ifdef PC_DEBUG -#include -#endif /* PC_DEBUG */ - -#include - -#ifdef __cplusplus -#define EXTERNC extern "C" -#else -#define EXTERNC -#endif - -/* - * A set of options for qpOASES_e-3.1.1 - */ - -/** Maximum number of optimization variables. */ -#define QPOASES_NVMAX @NVMAX@ -/** Maximum number of constraints. */ -#define QPOASES_NCMAX @NCMAX@ -/** Maximum number of working set recalculations. */ -#define QPOASES_NWSRMAX @NWSRMAX@ -/** Print level for qpOASES. */ -#define QPOASES_PRINTLEVEL @PRINT_LEVEL@ -/** The value of EPS */ -#define QPOASES_EPS @EPS@ -/** Internally used floating point type */ -typedef @REAL_T@ real_t; - -/* - * Forward function declarations - */ - -/** A function that calls the QP solver */ -EXTERNC int @MODULE_NAME@_@PREFIX@solve( void ); - -/** Get the number of active set changes */ -EXTERNC int @MODULE_NAME@_@PREFIX@getNWSR( void ); - -/** Get the error string. */ -const char* @MODULE_NAME@_getErrorString( int error ); - -#endif /* @SOLVER_DEFINE@ */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.cpp.in b/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.cpp.in deleted file mode 100644 index 29fc6a5087..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.cpp.in +++ /dev/null @@ -1,51 +0,0 @@ -extern "C" -{ -#include "@ACADO_COMMON_HEADER@" -} - -#include "INCLUDE/@SOLVER_NAME@.hpp" - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -#include "INCLUDE/EXTRAS/SolutionAnalysis.hpp" -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - -static int @MODULE_NAME@_@PREFIX@nWSR; - -@USE_NAMESPACE@ - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 -static SolutionAnalysis @MODULE_NAME@_sa; -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - -int @MODULE_NAME@_@PREFIX@solve( void ) -{ - @MODULE_NAME@_@PREFIX@nWSR = QPOASES_NWSRMAX; - - @CTOR@; - - returnValue retVal = qp.init(@CALL_SOLVER@); - - qp.getPrimalSolution( @PRIMAL_SOLUTION@ ); - qp.getDualSolution( @DUAL_SOLUTION@ ); - -#if @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX == 1 - - if (retVal != SUCCESSFUL_RETURN) - return (int)retVal; - - retVal = @MODULE_NAME@_sa.getHessianInverse( &qp,@SIGMA@ ); - -#endif /* @MODULE_PREFIX@_COMPUTE_COVARIANCE_MATRIX */ - - return (int)retVal; -} - -int @MODULE_NAME@_@PREFIX@getNWSR( void ) -{ - return @MODULE_NAME@_@PREFIX@nWSR; -} - -const char* @MODULE_NAME@_@PREFIX@getErrorString( int error ) -{ - return MessageHandling::getErrorString( error ); -} diff --git a/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.hpp.in b/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.hpp.in deleted file mode 100644 index 8bd4609009..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/qpoases_interface.hpp.in +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef @SOLVER_DEFINE@ -#define @SOLVER_DEFINE@ - -#ifdef PC_DEBUG -#include -#endif /* PC_DEBUG */ - -#include - -#ifdef __cplusplus -#define EXTERNC extern "C" -#else -#define EXTERNC -#endif - -/* - * A set of options for qpOASES - */ - -/** Maximum number of optimization variables. */ -#define QPOASES_NVMAX @NVMAX@ -/** Maximum number of constraints. */ -#define QPOASES_NCMAX @NCMAX@ -/** Maximum number of working set recalculations. */ -#define QPOASES_NWSRMAX @NWSRMAX@ -/** Print level for qpOASES. */ -#define QPOASES_PRINTLEVEL @PRINT_LEVEL@ -/** The value of EPS */ -#define QPOASES_EPS @EPS@ -/** Internally used floating point type */ -typedef @REAL_T@ real_t; - -/* - * Forward function declarations - */ - -/** A function that calls the QP solver */ -EXTERNC int @MODULE_NAME@_@PREFIX@solve( void ); - -/** Get the number of active set changes */ -EXTERNC int @MODULE_NAME@_@PREFIX@getNWSR( void ); - -/** Get the error string. */ -const char* @MODULE_NAME@_getErrorString( int error ); - -#endif /* @SOLVER_DEFINE@ */ diff --git a/phonelibs/acado/include/acado/code_generation/templates/templates.hpp b/phonelibs/acado/include/acado/code_generation/templates/templates.hpp deleted file mode 100644 index dee8104b21..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/templates.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef ACADO_TOOLKIT_TEMPLATES_HPP -#define ACADO_TOOLKIT_TEMPLATES_HPP - -#define TEMPLATE_PATHS "/home/batman/openpilot/phonelibs/acado/acado/acado/code_generation/templates;/home/batman/openpilot/phonelibs/acado/include/acado/code_generation/templates" - -#define INTEGRATOR_MEX_TEMPLATE "integrator_mex.c.in" -#define RHS_MEX_TEMPLATE "rhs_mex.c.in" - -#define HESSIAN_REG_SOURCE "acado_hessian_regularization.c.in" - -#define FORCES_TEMPLATE "forces_interface.in" -#define FORCES_GENERATOR "acado_forces_generator.m.in" -#define FORCES_GENERATOR_PYTHON "acado_forces_generator.py.in" -#define QPOASES_HEADER "qpoases_interface.hpp.in" -#define QPOASES_SOURCE "qpoases_interface.cpp.in" -#define QPOASES3_HEADER "qpoases3_interface.h.in" -#define QPOASES3_SOURCE "qpoases3_interface.c.in" -#define QPDUNES_TEMPLATE "qpdunes_interface.in" -#define QPDUNES_SPLIT_TEMPLATE "qpdunes_split_interface.in" - -#define AUXILIARY_FUNCTIONS_HEADER "acado_auxiliary_functions.h.in" -#define AUXILIARY_FUNCTIONS_SOURCE "acado_auxiliary_functions.c.in" -#define AUXILIARY_SIM_FUNCTIONS_HEADER "acado_auxiliary_sim_functions.h.in" -#define AUXILIARY_SIM_FUNCTIONS_SOURCE "acado_auxiliary_sim_functions.c.in" -#define SOLVER_MEX "acado_solver_mex.c.in" -#define EH_SOLVER_MEX "acado_EH_solver_mex.c.in" - -#define MAKE_MEX_FORCES "make_acado_solver_forces.m.in" -#define MAKE_MEX_HPMPC "make_acado_solver_hpmpc.m.in" -#define MAKE_MEX_QPOASES "make_acado_solver_qpoases.m.in" -#define MAKE_MEX_EH_QPOASES "make_acado_EH_solver_qpoases.m.in" -#define MAKE_MEX_QPOASES3 "make_acado_solver_qpoases3.m.in" -#define MAKE_MEX_EH_QPOASES3 "make_acado_EH_solver_qpoases3.m.in" -#define MAKE_MEX_QPDUNES "make_acado_solver_qpdunes.m.in" -#define MAKE_MEX_EH_QPDUNES "make_acado_EH_solver_qpdunes.m.in" -#define MAKE_MEX_BLOCK_QPDUNES "make_acado_block_solver_qpdunes.m.in" -#define MAKE_MEX_INTEGRATOR "make_acado_integrator.m.in" -#define MAKE_MEX_MODEL "make_acado_model.m.in" - -#define MAKEFILE_FORCES "makefile.forces.in" -#define MAKEFILE_QPOASES "makefile.qpoases.in" -#define MAKEFILE_QPOASES3 "makefile.qpoases3.in" -#define MAKEFILE_QPDUNES "makefile.qpdunes.in" -#define MAKEFILE_EH_QPOASES "makefile.EH_qpoases.in" -#define MAKEFILE_EH_QPOASES3 "" -#define MAKEFILE_EH_QPDUNES "makefile.EH_qpdunes.in" -#define MAKEFILE_HPMPC "makefile.hpmpc.in" -#define MAKEFILE_INTEGRATOR "makefile.integrator.in" - -#define MAKEFILE_SFUN_QPOASES "make_acado_solver_sfunction.m.in" -#define MAKEFILE_SFUN_QPOASES3 "make_acado_solver_sfunction.m.in" -#define SOLVER_SFUN_SOURCE "acado_solver_sfunction.c.in" -#define SOLVER_SFUN_HEADER "acado_solver_sfunction.h.in" - -#define DUMMY_TEST_FILE "dummy_test_file.in" - -#define COMMON_HEADER_TEMPLATE "acado_common_header.h.in" - -#define HPMPC_INTERFACE "hpmpc_interface.c.in" - -#endif // ACADO_TOOLKIT_TEMPLATES_HPP diff --git a/phonelibs/acado/include/acado/code_generation/templates/templates.hpp.in b/phonelibs/acado/include/acado/code_generation/templates/templates.hpp.in deleted file mode 100644 index e0d005f545..0000000000 --- a/phonelibs/acado/include/acado/code_generation/templates/templates.hpp.in +++ /dev/null @@ -1,61 +0,0 @@ -#ifndef ACADO_TOOLKIT_TEMPLATES_HPP -#define ACADO_TOOLKIT_TEMPLATES_HPP - -#define TEMPLATE_PATHS "@TEMPLATE_PATHS@" - -#define INTEGRATOR_MEX_TEMPLATE "@INTEGRATOR_MEX_TEMPLATE@" -#define RHS_MEX_TEMPLATE "@RHS_MEX_TEMPLATE@" - -#define HESSIAN_REG_SOURCE "@HESSIAN_REG_SOURCE@" - -#define FORCES_TEMPLATE "@FORCES_TEMPLATE@" -#define FORCES_GENERATOR "@FORCES_GENERATOR@" -#define FORCES_GENERATOR_PYTHON "@FORCES_GENERATOR_PYTHON@" -#define QPOASES_HEADER "@QPOASES_HEADER@" -#define QPOASES_SOURCE "@QPOASES_SOURCE@" -#define QPOASES3_HEADER "@QPOASES3_HEADER@" -#define QPOASES3_SOURCE "@QPOASES3_SOURCE@" -#define QPDUNES_TEMPLATE "@QPDUNES_TEMPLATE@" -#define QPDUNES_SPLIT_TEMPLATE "@QPDUNES_SPLIT_TEMPLATE@" - -#define AUXILIARY_FUNCTIONS_HEADER "@AUXILIARY_FUNCTIONS_HEADER@" -#define AUXILIARY_FUNCTIONS_SOURCE "@AUXILIARY_FUNCTIONS_SOURCE@" -#define AUXILIARY_SIM_FUNCTIONS_HEADER "@AUXILIARY_SIM_FUNCTIONS_HEADER@" -#define AUXILIARY_SIM_FUNCTIONS_SOURCE "@AUXILIARY_SIM_FUNCTIONS_SOURCE@" -#define SOLVER_MEX "@SOLVER_MEX@" -#define EH_SOLVER_MEX "@EH_SOLVER_MEX@" - -#define MAKE_MEX_FORCES "@MAKE_MEX_FORCES@" -#define MAKE_MEX_HPMPC "@MAKE_MEX_HPMPC@" -#define MAKE_MEX_QPOASES "@MAKE_MEX_QPOASES@" -#define MAKE_MEX_EH_QPOASES "@MAKE_MEX_EH_QPOASES@" -#define MAKE_MEX_QPOASES3 "@MAKE_MEX_QPOASES3@" -#define MAKE_MEX_EH_QPOASES3 "@MAKE_MEX_EH_QPOASES3@" -#define MAKE_MEX_QPDUNES "@MAKE_MEX_QPDUNES@" -#define MAKE_MEX_EH_QPDUNES "@MAKE_MEX_EH_QPDUNES@" -#define MAKE_MEX_BLOCK_QPDUNES "@MAKE_MEX_BLOCK_QPDUNES@" -#define MAKE_MEX_INTEGRATOR "@MAKE_MEX_INTEGRATOR@" -#define MAKE_MEX_MODEL "@MAKE_MEX_MODEL@" - -#define MAKEFILE_FORCES "@MAKEFILE_FORCES@" -#define MAKEFILE_QPOASES "@MAKEFILE_QPOASES@" -#define MAKEFILE_QPOASES3 "@MAKEFILE_QPOASES3@" -#define MAKEFILE_QPDUNES "@MAKEFILE_QPDUNES@" -#define MAKEFILE_EH_QPOASES "@MAKEFILE_EH_QPOASES@" -#define MAKEFILE_EH_QPOASES3 "@MAKEFILE_EH_QPOASES3@" -#define MAKEFILE_EH_QPDUNES "@MAKEFILE_EH_QPDUNES@" -#define MAKEFILE_HPMPC "@MAKEFILE_HPMPC@" -#define MAKEFILE_INTEGRATOR "@MAKEFILE_INTEGRATOR@" - -#define MAKEFILE_SFUN_QPOASES "@MAKEFILE_SFUN_QPOASES@" -#define MAKEFILE_SFUN_QPOASES3 "@MAKEFILE_SFUN_QPOASES3@" -#define SOLVER_SFUN_SOURCE "@SOLVER_SFUN_SOURCE@" -#define SOLVER_SFUN_HEADER "@SOLVER_SFUN_HEADER@" - -#define DUMMY_TEST_FILE "@DUMMY_TEST_FILE@" - -#define COMMON_HEADER_TEMPLATE "@COMMON_HEADER_TEMPLATE@" - -#define HPMPC_INTERFACE "@HPMPC_INTERFACE@" - -#endif // ACADO_TOOLKIT_TEMPLATES_HPP diff --git a/phonelibs/acado/include/acado/conic_program/banded_cp.hpp b/phonelibs/acado/include/acado/conic_program/banded_cp.hpp deleted file mode 100644 index 0035a3dee2..0000000000 --- a/phonelibs/acado/include/acado/conic_program/banded_cp.hpp +++ /dev/null @@ -1,152 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_program/banded_cp.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_BANDED_CP_HPP -#define ACADO_TOOLKIT_BANDED_CP_HPP - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Data class for storing conic programs arising from optimal control. - * - * \ingroup BasicDataStructures - * - * The class BandedCP (banded conic programs) is a data class - * to store conic programs that arise in the context of optimal control. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - -class BandedCP{ - - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - BandedCP( ); - - /** Copy constructor (deep copy). */ - BandedCP( const BandedCP& rhs ); - - /** Destructor. */ - virtual ~BandedCP( ); - - /** Assignment operator (deep copy). */ - BandedCP& operator=( const BandedCP& rhs ); - - - /** Returns whether or not the conic program is an LP */ - inline BooleanType isLP () const; - - /** Returns whether or not the conic program is an LP */ - inline BooleanType isQP () const; - - /** Returns whether or not the conic program is an SDP */ - inline BooleanType isSDP() const; - - - - // - // PUBLIC DATA MEMBERS: - // - public: - - - // DIMENSIONS OF THE CP: - // --------------------- - int nS; /**< Number of SDP constraints */ - - - - // BANDED CP IN BLOCK-MATRIX FORMAT: - // ----------------------------------------------------------------------------------- - - BlockMatrix hessian; /**< the Hessian matrix */ - BlockMatrix objectiveGradient; /**< the gradient of the objective */ - - BlockMatrix lowerBoundResiduum; /**< lower residuum of the bounds */ - BlockMatrix upperBoundResiduum; /**< upper residuum of the bounds */ - - BlockMatrix dynGradient; /**< the sensitivities of the ODE/DAE */ - BlockMatrix dynResiduum; /**< residuum of the ODE/DAE */ - - BlockMatrix constraintGradient; /**< the gradient of the constraints */ - BlockMatrix lowerConstraintResiduum; /**< lower residuum of the constraints */ - BlockMatrix upperConstraintResiduum; /**< upper residuum of the constraints */ - - BlockMatrix **B; /**< SDP constraint tensor */ - BlockMatrix *lbB; /**< SDP lower bounds */ - BlockMatrix *ubB; /**< SDP upper bounds */ - - - // SOLUTION OF THE BANDED CP: - // ---------------------------------------------------------------------------------- - BlockMatrix deltaX; /**< Primal solution of the banded QP */ - BlockMatrix lambdaBound; /**< Dual solution w.r.t. bounds */ - BlockMatrix lambdaDynamic; /**< Dual solution w.r.t. constraints */ - BlockMatrix lambdaConstraint; /**< Dual solution w.r.t. constraints */ - - BlockMatrix **ylbB; /**< Dual solution, SDB lower bound */ - BlockMatrix **yubB; /**< Dual solution, SDP upper bound */ - - - - // PROTECTED MEMBER FUNCTIONS: - // --------------------------- - protected: - - void copy (const BandedCP& rhs); - void clean(); -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_BANDED_CP_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_program/banded_cp.ipp b/phonelibs/acado/include/acado/conic_program/banded_cp.ipp deleted file mode 100644 index 41263e1566..0000000000 --- a/phonelibs/acado/include/acado/conic_program/banded_cp.ipp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_program/banded_cp.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - -inline BooleanType BandedCP::isLP () const{ - - if( (isQP() == BT_TRUE) && (hessian.isEmpty() == BT_TRUE) ) return BT_TRUE; - return BT_FALSE; -} - - -inline BooleanType BandedCP::isQP () const{ - - if( (isSDP() == BT_TRUE) && nS == 0 ) return BT_TRUE; - return BT_FALSE; -} - - -inline BooleanType BandedCP::isSDP() const{ - - return BT_TRUE; -} - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/conic_program/dense_cp.hpp b/phonelibs/acado/include/acado/conic_program/dense_cp.hpp deleted file mode 100644 index a8ce786369..0000000000 --- a/phonelibs/acado/include/acado/conic_program/dense_cp.hpp +++ /dev/null @@ -1,430 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_program/dense_cp.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_DENSE_CP_HPP -#define ACADO_TOOLKIT_DENSE_CP_HPP - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Data class for storing generic conic programs. - * - * \ingroup BasicDataStructures - * - * The class DenseCP (dense conic program) is a data class - * to store generic conic programs in a convenient format. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - -class DenseCP{ - - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - DenseCP( ); - - /** Copy constructor (deep copy). */ - DenseCP( const DenseCP& rhs ); - - /** Destructor. */ - virtual ~DenseCP( ); - - /** Assignment operator (deep copy). */ - DenseCP& operator=( const DenseCP& rhs ); - - - /** Constructs an empty QP with dimensions nV and nC */ - returnValue init( uint nV_, uint nC_ ); - - - -// returnValue setBounds( const DVector &lb, -// const DVector &ub ); - - - /** Returns whether or not the conic program is an LP */ - inline BooleanType isLP () const; - - /** Returns whether or not the conic program is an LP */ - inline BooleanType isQP () const; - - /** Returns whether or not the conic program is an SDP */ - inline BooleanType isSDP() const; - - - - /** Returns the number of variables */ - inline uint getNV() const; - - /** Returns the number of linear constraints */ - inline uint getNC() const; - - - /** Sets the primal and dual solution converting the dual solution \n - * into the internal format (this routine expects a vector y of \n - * dimension nV + nC, where nC is number of linear constraints and \n - * nV the number of variables (= number of bounds) ). \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - returnValue setQPsolution( const DVector &x_, const DVector &y_ ); - - - /** Sets the primal and dual solution converting the dual solution \n - * into the internal format (this routine expects a vector y of \n - * dimension nV + nC, where nC is number of linear constraints and \n - * nV the number of variables (= number of bounds) ). \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - DVector getMergedDualSolution( ) const; - - - /** Prints CP to standard ouput stream. Various settings can - * be specified defining its output format. - * - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNKNOWN_BUG - */ - returnValue print( const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP to standard ouput stream. Various settings can - * be specified defining its output format. - * - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNKNOWN_BUG - */ - returnValue print( const char* const name, - PrintScheme printScheme - ) const; - - - /** Prints CP to file with given name. Various settings can - * be specified defining its output format. - * - * @param[in] filename Filename for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printToFile( const char* const filename, - const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP to given file. Various settings can - * be specified defining its output format. - * - * @param[in] stream File for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printToFile( std::ostream& stream, - const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP to file with given name. Various settings can - * be specified defining its output format. - * - * @param[in] filename Filename for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printToFile( const char* const filename, - const char* const name, - PrintScheme printScheme - ) const; - - /** Prints CP to given file. Various settings can - * be specified defining its output format. - * - * @param[in] stream File for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printToFile( std::ostream& stream, - const char* const name, - PrintScheme printScheme - ) const; - - - /** Prints CP solution to standard ouput stream. Various settings can - * be specified defining its output format. - * - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolution( const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP solution to standard ouput stream. Various settings can - * be specified defining its output format. - * - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolution( const char* const name, - PrintScheme printScheme - ) const; - - /** Prints CP solution to file with given name. Various settings can - * be specified defining its output format. - * - * @param[in] filename Filename for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolutionToFile( const char* const filename, - const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP solution to given file. Various settings can - * be specified defining its output format. - * - * @param[in] stream File for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] startString Prefix before printing the numerical values. - * @param[in] endString Suffix after printing the numerical values. - * @param[in] width Total number of digits per single numerical value. - * @param[in] precision Number of decimals per single numerical value. - * @param[in] colSeparator Separator between the columns of the numerical values. - * @param[in] rowSeparator Separator between the rows of the numerical values. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolutionToFile( std::ostream& stream, - const char* const name = DEFAULT_LABEL, - const char* const startString = DEFAULT_START_STRING, - const char* const endString = DEFAULT_END_STRING, - uint width = DEFAULT_WIDTH, - uint precision = DEFAULT_PRECISION, - const char* const colSeparator = DEFAULT_COL_SEPARATOR, - const char* const rowSeparator = DEFAULT_ROW_SEPARATOR - ) const; - - /** Prints CP solution to file with given name. Various settings can - * be specified defining its output format. - * - * @param[in] filename Filename for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolutionToFile( const char* const filename, - const char* const name, - PrintScheme printScheme - ) const; - - /** Prints CP solution to given file. Various settings can - * be specified defining its output format. - * - * @param[in] stream File for printing. - * @param[in] name Name label to be printed before the numerical values. - * @param[in] printScheme Print scheme defining the output format of the information. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED, \n - * RET_UNKNOWN_BUG - */ - returnValue printSolutionToFile( std::ostream& stream, - const char* const name, - PrintScheme printScheme - ) const; - - - // - // PUBLIC DATA MEMBERS: - // - public: - - - // DIMENSIONS OF THE CP: - // --------------------- - - uint nS; /**< Number of SDP constraints */ - - - // DENSE CP IN MATRIX-VECTOR FORMAT: - // ------------------------------------------------------- - - DMatrix H; /**< The Hessian matrix */ - DVector g; /**< The objective gradient */ - - DVector lb; /**< Simple lower bounds */ - DVector ub; /**< Simple upper bounds */ - - DMatrix A; /**< Constraint matrix */ - DVector lbA; /**< Constraint lower bounds */ - DVector ubA; /**< Constraint upper bounds */ - - DMatrix **B; /**< SDP constraint tensor */ - DVector *lbB; /**< SDP lower bounds */ - DVector *ubB; /**< SDP upper bounds */ - - - // SOLUTION OF THE DENSE CP: - // ------------------------------------------------------- - DVector *x; /**< Primal Solution */ - - DVector *ylb; /**< Dual solution, lower bound */ - DVector *yub; /**< Dual solution, upper bound */ - - DVector *ylbA; /**< Dual solution, LP lower bound */ - DVector *yubA; /**< Dual solution, LP upper bound */ - - DVector **ylbB; /**< Dual solution, SDB lower bound */ - DVector **yubB; /**< Dual solution, SDP upper bound */ - - - - // PROTECTED MEMBER FUNCTIONS: - // --------------------------- - protected: - - void copy (const DenseCP& rhs); - void clean(); -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_DENSE_CP_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_program/dense_cp.ipp b/phonelibs/acado/include/acado/conic_program/dense_cp.ipp deleted file mode 100644 index 914e798997..0000000000 --- a/phonelibs/acado/include/acado/conic_program/dense_cp.ipp +++ /dev/null @@ -1,78 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_program/dense_cp.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - -inline BooleanType DenseCP::isLP () const{ - - if( (isQP() == BT_TRUE) && (H.isEmpty() == BT_TRUE) ) return BT_TRUE; - return BT_FALSE; -} - - -inline BooleanType DenseCP::isQP () const{ - - if( (isSDP() == BT_TRUE) && nS == 0 ) return BT_TRUE; - return BT_FALSE; -} - - -inline BooleanType DenseCP::isSDP() const{ - - return BT_TRUE; -} - - -inline uint DenseCP::getNV() const{ - - return acadoMax( (int)H.getNumRows(),(int)g.getDim() ); -} - - -inline uint DenseCP::getNC() const{ - - return A.getNumRows(); -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.hpp b/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.hpp deleted file mode 100644 index 38b81ef47e..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/banded_cp_solver.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_BANDED_CP_SOLVER_HPP -#define ACADO_TOOLKIT_BANDED_CP_SOLVER_HPP - -#include -#include - -#include -#include - - - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for algorithms solving banded conic programs arising in optimal control. - * - * \ingroup AlgorithmInterfaces - * - * The class Banded CP Solver is a base class for all - * conic solvers that are able to deal with the specific - * band structure that arises in the optimal control context. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - - - -class BandedCPsolver: public AlgorithmicBase -{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - BandedCPsolver( ); - - BandedCPsolver( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - BandedCPsolver( const BandedCPsolver& rhs ); - - /** Destructor. */ - virtual ~BandedCPsolver( ); - - /** Assignment operator (deep copy). */ - BandedCPsolver& operator=( const BandedCPsolver& rhs ); - - - /** Assignment operator (deep copy). */ - virtual BandedCPsolver* clone() const = 0; - - - /** Initializes the banded conic solver */ - virtual returnValue init( const OCPiterate &iter_ ) = 0; - - - - /** Solves a given banded conic program */ - virtual returnValue prepareSolve( BandedCP& cp - ); - - /** Solves a given banded conic program in feedback mode: \n - * \n - * \param cp the banded conic program to be solved \n - * \param DeltaX difference between state estimate and previous prediction \n - * \param DeltaP difference between current and previous parameter value \n - * \n - * \return SUCCESSFUL_RETURN (if successful) \n - * or a specific error message from the dense CP solver. \n - */ - virtual returnValue solve( BandedCP& cp - ) = 0; - - /** Solves a given banded conic program */ - virtual returnValue finalizeSolve( BandedCP& cp - ); - - - virtual returnValue getParameters ( DVector &p_ ) const = 0; - virtual returnValue getFirstControl ( DVector &u0_ ) const = 0; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &var ); - - - virtual returnValue setRealTimeParameters( const DVector& DeltaX, - const DVector& DeltaP = emptyConstVector - ); - - - virtual returnValue freezeCondensing( ); - - virtual returnValue unfreezeCondensing( ); - - - - protected: - - virtual returnValue setupOptions( ); - virtual returnValue setupLogging( ); - -}; - - -CLOSE_NAMESPACE_ACADO - - -//#include - - -#endif // ACADO_TOOLKIT_BANDED_CP_SOLVER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.ipp b/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.ipp deleted file mode 100644 index d8df7a67e6..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/banded_cp_solver.ipp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/banded_cp_solver.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.hpp b/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.hpp deleted file mode 100644 index 8461538141..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.hpp +++ /dev/null @@ -1,291 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/condensing_based_cp_solver.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP -#define ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP - -#include -#include -#include -#include - - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Solves banded conic programs arising in optimal control using condensing. - * - * \ingroup NumericalAlgorithm - * - * The class condensing based CP solver is a special solver for - * band structured conic programs that can be solved via a - * condensing technique. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - -class CondensingBasedCPsolver: public BandedCPsolver { - - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - CondensingBasedCPsolver( ); - - CondensingBasedCPsolver( UserInteraction* _userInteraction, - uint nConstraints_, - const DVector& blockDims_ - ); - - /** Copy constructor (deep copy). */ - CondensingBasedCPsolver( const CondensingBasedCPsolver& rhs ); - - /** Destructor. */ - virtual ~CondensingBasedCPsolver( ); - - /** Assignment operator (deep copy). */ - CondensingBasedCPsolver& operator=( const CondensingBasedCPsolver& rhs ); - - - /** Assignment operator (deep copy). */ - virtual BandedCPsolver* clone() const; - - - /** initializes the banded conic solver */ - virtual returnValue init( const OCPiterate &iter_ ); - - - /** Solves a given banded conic program */ - virtual returnValue prepareSolve( BandedCP& cp - ); - - /** Solves a given banded conic program in feedback mode: \n - * \n - * \param cp the banded conic program to be solved \n - * \param DeltaX difference between state estimate and previous prediction \n - * \param DeltaP difference between current and previous parameter value \n - * \n - * \return SUCCESSFUL_RETURN (if successful) \n - * or a specific error message from the dense CP solver. \n - */ - virtual returnValue solve( BandedCP& cp - ); - - /** Solves a given banded conic program */ - virtual returnValue finalizeSolve( BandedCP& cp - ); - - - inline uint getNX( ) const; - inline uint getNXA( ) const; - inline uint getNP( ) const; - inline uint getNU( ) const; - inline uint getNW( ) const; - - inline uint getNC( ) const; - inline uint getNF( ) const; - inline uint getNA( ) const; - - inline uint getNumPoints( ) const; - - - virtual returnValue getParameters ( DVector &p_ ) const; - virtual returnValue getFirstControl ( DVector &u0_ ) const; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &var ); - - - virtual returnValue setRealTimeParameters( const DVector& DeltaX, - const DVector& DeltaP = emptyConstVector - ); - - inline BooleanType areRealTimeParametersDefined( ) const; - - - virtual returnValue freezeCondensing( ); - - virtual returnValue unfreezeCondensing( ); - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Initializes QP objects. - * \return SUCCESSFUL_RETURN \n - * RET_QP_INIT_FAILED */ - virtual returnValue initializeCPsolver( InfeasibleQPhandling infeasibleQPhandling - ); - - - /** Solves current QP (or relaxation) using not more than the - * given number of iterations. - * \return SUCCESSFUL_RETURN \n - * RET_QP_INIT_FAILED */ - virtual returnValue solveQP( uint maxIter, /**< Maximum number of iterations. */ - InfeasibleQPhandling infeasibleQPhandling = IQH_UNDEFINED - ); - - - - - - virtual returnValue solveCPsubproblem( ); - - - - /** Checks whether the Hessian is positive definite and projects \n - * the Hessian based on a heuristic damping factor. If this \n - * damping factor is smaller than 0, the routine does nothing. \n - * \n - * \return SUCCESSFUL_RETURN. \n - */ - returnValue projectHessian( DMatrix &H_, double dampingFactor ); - - - // -------- - // SQP DATA - // -------- - - /** Performes the condensing of the dynamic system if necessary. - */ - returnValue condense( BandedCP& cp - ); - - - /** Expands the KKT system if necessary. - */ - returnValue expand( BandedCP& cp - ); - - - returnValue generateHessianBlockLine ( uint nn, uint rowOffset, uint& rowOffset1 ); - returnValue generateConstraintBlockLine( uint nn, uint rowOffset, uint& rowOffset1 ); - returnValue generateStateBoundBlockLine( uint nn, uint rowOffset, uint& rowOffset1 ); - returnValue generateConstraintVectors ( uint nn, uint rowOffset, uint& rowOffset1 ); - returnValue generateStateBoundVectors ( uint nn, uint rowOffset, uint& rowOffset1 ); - - - returnValue generateBoundVectors ( ); - returnValue generateObjectiveGradient( ); - - - returnValue initializeCondensingOperator( ); - - returnValue computeCondensingOperator( BandedCP& cp - ); - - - /** Determines relaxed (constraints') bounds of an infeasible QP. */ - virtual returnValue setupRelaxedQPdata( InfeasibleQPhandling infeasibleQPhandling, - DenseCP& _denseCPrelaxed /**< OUTPUT: Relaxed QP data. */ - ) const; - - /** Determines relaxed (constraints') bounds of an infeasible QP. */ - virtual returnValue setupRelaxedQPdataL1( DenseCP& _denseCPrelaxed /**< OUTPUT: Relaxed QP data. */ - ) const; - - /** Determines relaxed (constraints') bounds of an infeasible QP. */ - virtual returnValue setupRelaxedQPdataL2( DenseCP& _denseCPrelaxed /**< OUTPUT: Relaxed QP data. */ - ) const; - - - - // - // DATA MEMBERS: - // - protected: - - OCPiterate iter; - DVector blockDims; - uint nConstraints; - - CondensingStatus condensingStatus; - - - // THE CONDENSING OPERATORS: - // ----------------------------------------------------- - BlockMatrix T; /**< the condensing operator */ - BlockMatrix d; /**< the condensing offset */ - - BlockMatrix hT; - // ------------------------------------------------ - - - // DENSE QP IN BLOCK-MATRIX FORM: - // ---------------------------------------------------------------------- - - BlockMatrix HDense; /**< Hessian after condensing */ - BlockMatrix gDense; /**< Objective gradient after condensing */ - BlockMatrix ADense; /**< Constraint matrix */ - BlockMatrix lbADense; /**< Constraint lower bounds */ - BlockMatrix ubADense; /**< Constraint upper bounds */ - BlockMatrix lbDense; /**< Simple lower bounds */ - BlockMatrix ubDense; /**< Simple upper bounds */ - // ---------------------------------------------------------------------- - - - DenseCPsolver* cpSolver; - DenseQPsolver* cpSolverRelaxed; - - DenseCP denseCP; - - DVector deltaX; - DVector deltaP; -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_CONDENSING_BASED_CP_SOLVER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.ipp b/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.ipp deleted file mode 100644 index 5cf2121620..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/condensing_based_cp_solver.ipp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/condensing_based_cp_solver.ipp - * \author Boris Houska, Hans Joachim Ferreau - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - -inline uint CondensingBasedCPsolver::getNX( ) const -{ - return iter.getNX(); -} - - -inline uint CondensingBasedCPsolver::getNXA( ) const -{ - return iter.getNXA(); -} - - -inline uint CondensingBasedCPsolver::getNP( ) const -{ - return iter.getNP(); -} - -inline uint CondensingBasedCPsolver::getNU( ) const -{ - return iter.getNU(); -} - - -inline uint CondensingBasedCPsolver::getNW( ) const -{ - return iter.getNW(); -} - - -inline uint CondensingBasedCPsolver::getNC( ) const -{ - return nConstraints; -} - - -inline uint CondensingBasedCPsolver::getNF( ) const -{ - return getNX() + getNumPoints( )*getNXA() + getNP() + (getNumPoints( )-1)*getNU() + (getNumPoints( )-1)*getNW(); -} - - -inline uint CondensingBasedCPsolver::getNA( ) const -{ - return getNC() + (getNumPoints( )-1)*getNX(); -} - - -inline uint CondensingBasedCPsolver::getNumPoints( ) const -{ - return iter.getNumPoints(); -} - - -inline BooleanType CondensingBasedCPsolver::areRealTimeParametersDefined( ) const -{ - if ( ( deltaX.isEmpty( ) == BT_TRUE ) && ( deltaP.isEmpty( ) == BT_TRUE ) ) - return BT_FALSE; - else - return BT_TRUE; -} - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/conic_solver/dense_cp_solver.hpp b/phonelibs/acado/include/acado/conic_solver/dense_cp_solver.hpp deleted file mode 100644 index 866eaf8390..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/dense_cp_solver.hpp +++ /dev/null @@ -1,138 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/dense_cp_solver.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_DENSE_CP_SOLVER_HPP -#define ACADO_TOOLKIT_DENSE_CP_SOLVER_HPP - -#include -#include - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for algorithms solving conic programs. - * - * \ingroup AlgorithmInterfaces - * - * The class Dense CP Solver is a base class for all - * conic solvers that are able to solve conic problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - -class DenseCPsolver : public AlgorithmicBase -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - DenseCPsolver( ); - - DenseCPsolver( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - DenseCPsolver( const DenseCPsolver& rhs ); - - /** Destructor. */ - virtual ~DenseCPsolver( ); - - /** Assignment operator (deep copy). */ - DenseCPsolver& operator=( const DenseCPsolver& rhs ); - - - virtual DenseCPsolver* clone( ) const = 0; - - - /** initializes the dense conic solver */ - virtual returnValue init( const DenseCP *cp_ ) = 0; - - - /** Solves the CP */ - virtual returnValue solve( DenseCP *cp_ ) = 0; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &var ) = 0; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &H, DMatrix &var ) = 0; - - - - /** Returns number of iterations performed at last QP solution. \n - * \n - * \return Number of iterations performed at last QP solution \n - */ - virtual uint getNumberOfIterations( ) const = 0; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - virtual returnValue setupOptions( ); - virtual returnValue setupLogging( ); - -}; - - -CLOSE_NAMESPACE_ACADO - - -//#include - - -#endif // ACADO_TOOLKIT_DENSE_CP_SOLVER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.hpp b/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.hpp deleted file mode 100644 index 6598c413ab..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.hpp +++ /dev/null @@ -1,251 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/dense_qp_solver.hpp - * \author Boris Houska, Hans Joachim Ferreau - * \date 2010 - */ - - -#ifndef ACADO_TOOLKIT_DENSE_QP_SOLVER_HPP -#define ACADO_TOOLKIT_DENSE_QP_SOLVER_HPP - - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Abstract base class for algorithms solving quadratic programs. - * - * \ingroup AlgorithmInterfaces - * - * The class DenseQPsolver provides an abstract base class for different - * algorithms for solving quadratic programming (QP) problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ - -class DenseQPsolver : public DenseCPsolver -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - DenseQPsolver( ); - - DenseQPsolver( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - DenseQPsolver( const DenseQPsolver& rhs ); - - /** Destructor. */ - ~DenseQPsolver( ); - - /** Assignment operator (deep copy). */ - DenseQPsolver& operator=( const DenseQPsolver& rhs ); - - virtual DenseCPsolver* clone( ) const = 0; - - virtual DenseQPsolver* cloneDenseQPsolver( ) const = 0; - - - - /** Initializes QP object. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue init( const DenseCP *cp ); - - - - /** Alternative way to initialize QP object. */ - virtual returnValue init( uint nV, /**< Number of QP variables. */ - uint nC /**< Number of QP constraints (without bounds). */ - ); - - - - /** Solves the QP. */ - virtual returnValue solve( DenseCP *cp_ ); - - - /** Solves QP using at most iterations. */ - virtual returnValue solve( double* H, /**< Hessian matrix of neighbouring QP to be solved. */ - double* A, /**< Constraint matrix of neighbouring QP to be solved. */ - double* g, /**< Gradient of neighbouring QP to be solved. */ - double* lb, /**< Lower bounds of neighbouring QP to be solved. */ - double* ub, /**< Upper bounds of neighbouring QP to be solved. */ - double* lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - double* ubA, /**< Upper constraints' bounds of neighbouring QP to be solved. */ - uint maxIter /**< Maximum number of iterations. */ - ) = 0; - - /** Solves QP using at most iterations. */ - virtual returnValue solve( DMatrix *H, /**< Hessian matrix of neighbouring QP to be solved. */ - DMatrix *A, /**< Constraint matrix of neighbouring QP to be solved. */ - DVector *g, /**< Gradient of neighbouring QP to be solved. */ - DVector *lb, /**< Lower bounds of neighbouring QP to be solved. */ - DVector *ub, /**< Upper bounds of neighbouring QP to be solved. */ - DVector *lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - DVector *ubA, /**< Upper constraints' bounds of neighbouring QP to be solved. */ - uint maxIter /**< Maximum number of iterations. */ - ) = 0; - - - /** Performs exactly one QP iteration. */ - virtual returnValue step( double* H, /**< Hessian matrix of neighbouring QP to be solved. */ - double* A, /**< Constraint matrix of neighbouring QP to be solved. */ - double* g, /**< Gradient of neighbouring QP to be solved. */ - double* lb, /**< Lower bounds of neighbouring QP to be solved. */ - double* ub, /**< Upper bounds of neighbouring QP to be solved. */ - double* lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - double* ubA /**< Upper constraints' bounds of neighbouring QP to be solved. */ - ) = 0; - - - /** Performs exactly one QP iteration. */ - virtual returnValue step( DMatrix *H, /**< Hessian matrix of neighbouring QP to be solved. */ - DMatrix *A, /**< Constraint matrix of neighbouring QP to be solved. */ - DVector *g, /**< Gradient of neighbouring QP to be solved. */ - DVector *lb, /**< Lower bounds of neighbouring QP to be solved. */ - DVector *ub, /**< Upper bounds of neighbouring QP to be solved. */ - DVector *lbA, /**< Lower constraints' bounds of neighbouring QP to be solved. */ - DVector *ubA /**< Upper constraints' bounds of neighbouring QP to be solved. */ - ) = 0; - - - /** Returns QP status. - * \return QP status */ - inline QPStatus getStatus( ) const; - - /** Returns if QP (or its relaxation) has been solved. - * \return BT_TRUE iff QP has been solved */ - inline BooleanType isSolved( ) const; - - /** Returns if QP has been found to be infeasible. - * \return BT_TRUE if QP is infeasible */ - inline BooleanType isInfeasible( ) const; - - /** Returns if QP has been found to be unbounded. - * \return BT_TRUE if QP is unbounded */ - inline BooleanType isUnbounded( ) const; - - - /** Returns primal solution vector if QP has been solved. - * \return SUCCESSFUL_RETURN \n - * RET_QP_NOT_SOLVED */ - virtual returnValue getPrimalSolution( DVector& xOpt /**< OUTPUT: primal solution vector. */ - ) const = 0; - - /** Returns dual solution vector if QP has been solved. - * \return SUCCESSFUL_RETURN \n - * RET_QP_NOT_SOLVED */ - virtual returnValue getDualSolution( DVector& yOpt /**< OUTPUT: dual solution vector. */ - ) const = 0; - - - /** Returns optimal objective function value. - * \return finite value: Optimal objective function value (QP has been solved) \n - +INFTY: QP has not been solved or is infeasible \n - -INFTY: QP is unbounded */ - virtual double getObjVal( ) const = 0; - - - /** Returns number of iterations performed at last QP solution. - * \return Number of iterations performed at last QP solution */ - virtual uint getNumberOfIterations( ) const; - - virtual uint getNumberOfVariables( ) const = 0; - virtual uint getNumberOfConstraints( ) const = 0; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &var ) = 0; - - - /** Returns a variance-covariance estimate if possible or an error message otherwise. - * - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED - */ - virtual returnValue getVarianceCovariance( DMatrix &H, DMatrix &var ) = 0; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - virtual returnValue setupLogging( ); - - - /** Setups QP object. - * \return SUCCESSFUL_RETURN \n - * RET_QP_INIT_FAILED */ - virtual returnValue setupQPobject( uint nV, /**< Number of QP variables. */ - uint nC /**< Number of QP constraints (without bounds). */ - ) = 0; - - virtual returnValue makeBoundsConsistent( DenseCP *cp - ) const; - - - // - // DATA MEMBERS: - // - protected: - - QPStatus qpStatus; - int numberOfSteps; -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_QP_SOLVER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.ipp b/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.ipp deleted file mode 100644 index 9ccde810f2..0000000000 --- a/phonelibs/acado/include/acado/conic_solver/dense_qp_solver.ipp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/conic_solver/dense_qp_solver.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 2008-2010 - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - -inline QPStatus DenseQPsolver::getStatus( ) const -{ - return qpStatus; -} - - -inline BooleanType DenseQPsolver::isSolved( ) const -{ - if ( ( getStatus( ) == QPS_SOLVED ) || ( getStatus( ) == QPS_SOLVED_RELAXATION ) ) - return BT_TRUE; - else - return BT_FALSE; -} - - -inline BooleanType DenseQPsolver::isInfeasible( ) const -{ - if ( qpStatus == QPS_INFEASIBLE ) - return BT_TRUE; - else - return BT_FALSE; -} - - -inline BooleanType DenseQPsolver::isUnbounded( ) const -{ - if ( qpStatus == QPS_UNBOUNDED ) - return BT_TRUE; - else - return BT_FALSE; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.hpp b/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.hpp deleted file mode 100644 index 9c9ad8634d..0000000000 --- a/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.hpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/algebraic_consistency_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_ALGEBRAIC_CONSISTENCY_CONSTRAINT_HPP -#define ACADO_TOOLKIT_ALGEBRAIC_CONSISTENCY_CONSTRAINT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Deals with algebraic consistency constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class AlgebraicConsistencyConstraint has been introduced in order to deal with - * algebraic consistency constraints. Usually, the user does not get in touch with this - * class, as algebraic consistency constraints should automatically be introduced by - * the optimization routine. It is possible to add several DAE right-hand sides which - * will be evaluated on a grid (usually, the multiple shooting ot collocation grid) - * depending on the model stage number. In the easiest case, i.e. for one stage, the - * evaluation routine will return the algebraic residuum of the DAE at a given point. - * The differentiation of the AlgebraicConsistencyConstraint will return the derivatives - * in form of a structured block matrix, which is typically sparse. - * - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -class AlgebraicConsistencyConstraint : public ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - AlgebraicConsistencyConstraint( ); - - /** Default constructor. */ - AlgebraicConsistencyConstraint( const Grid& grid_ , /**< union grid of the constraint */ - const uint& numberOfStages /**< number of model stages */ ); - - /** Copy constructor (deep copy). */ - AlgebraicConsistencyConstraint( const AlgebraicConsistencyConstraint& rhs ); - - /** Destructor. */ - virtual ~AlgebraicConsistencyConstraint( ); - - /** Assignment operator (deep copy). */ - AlgebraicConsistencyConstraint& operator=( const AlgebraicConsistencyConstraint& rhs ); - - -// ======================================================================================= - - /** Adds a consistency constraint for a specified stage. - * \return SUCCESSFUL_RETURN - * RET_INDEX_OUT_OF_BOUNDS (if the start/end of the stage are not well defined) - */ - inline returnValue add( const uint& endOfStage_ , /**< end of the stage */ - const DifferentialEquation& dae /**< the DAE itself */ ); - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - /** Evaluates all components in this constraint and stores the \n - * residuum. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluate( const OCPiterate& iter ); - - - /** Evaluates the sensitivities of all components in this \n - * constraint. Note that the seed can be defined via the base \n - * class ConstraintElement. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities(); - - - - /** Evaluates the sensitivities and Hessian. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( int &count, const BlockMatrix &seed, BlockMatrix &hessian ); - - -// ========================================================================= - - /** returns the number of constraints */ - inline int getNC() const; - - /** returns the dimensions of the idx-th block */ - inline int getDim( const int& idx_ ); - - - // PROOTECTED MEMBER FUNCIONS: - // --------------------------- - protected: - - virtual returnValue initializeEvaluationPoints( const OCPiterate& iter - ); - - - /** only for internal use (routine which computes a part of the block - * matrix needed for forward differentiation.) */ - inline returnValue computeForwardSensitivityBlock( int offset1, int offset2, int offset3, int stageIdx, DMatrix *seed ); - - - - - // - // DATA MEMBERS: - // - protected: - - int numberOfStages ; - int counter ; - int *numberOfDifferentialStates; - int *numberOfAlgebraicStates ; - int *breakPoints ; -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_ALGEBRAIC_CONSISTENCY_CONSTRAINT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.ipp b/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.ipp deleted file mode 100644 index 64d6463171..0000000000 --- a/phonelibs/acado/include/acado/constraint/algebraic_consistency_constraint.ipp +++ /dev/null @@ -1,150 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/algebraic_consistency_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - -inline int AlgebraicConsistencyConstraint::getNC() const{ - - int tmp = 0; - int run1; - - for( run1 = 0; run1 < counter; run1++ ) - tmp += (breakPoints[run1+1] - breakPoints[run1])*numberOfAlgebraicStates[run1]; - - return tmp; -} - - -inline int AlgebraicConsistencyConstraint::getDim( const int& idx_ ){ - - ASSERT( counter == numberOfStages ); - - int run1 = 0; - int stageIdx = 0; - - while( run1 < numberOfStages ){ - if( breakPoints[run1] <= idx_ && breakPoints[run1+1] > idx_ ){ - stageIdx = run1; - break; - } - run1++; - } - ASSERT( run1 < numberOfStages ); - - return numberOfAlgebraicStates[stageIdx]; -} - - -inline returnValue AlgebraicConsistencyConstraint::add( const uint& endOfStage_ , - const DifferentialEquation& dae ){ - - ASSERT( counter < numberOfStages ); - - if( fcn == 0 ) - return ACADOERROR(RET_MEMBER_NOT_INITIALISED); - - fcn[counter] = dae; - - numberOfDifferentialStates[counter] = dae.getNumDynamicEquations (); - numberOfAlgebraicStates [counter] = dae.getNumAlgebraicEquations(); - - if( counter == 0 ) breakPoints[counter] = 0; - - breakPoints[counter+1] = endOfStage_; - - counter++; - return SUCCESSFUL_RETURN; -} - - -// PROTECTED FUNCTIONS: -// -------------------- - -inline returnValue AlgebraicConsistencyConstraint::computeForwardSensitivityBlock( int offset1, int offset2, int offset3, - int stageIdx, DMatrix *seed ){ - - int run1,run2; - returnValue returnvalue; - - int nc = numberOfAlgebraicStates[stageIdx]; - - double* dresult1 = new double[fcn[stageIdx].getDim() ]; - double* fseed1 = new double[fcn[stageIdx].getNumberOfVariables()+1]; - - if( seed != 0 ){ - int nFDirs = seed->getNumCols(); - DMatrix tmp( nc, nFDirs ); - for( run1 = 0; run1 < nFDirs; run1++ ){ - - for( run2 = 0; run2 < fcn[stageIdx].getNumberOfVariables()+1; run2++ ) - fseed1[run2] = 0.0; - - for( run2 = 0; run2 < (int) seed->getNumRows(); run2++ ) - fseed1[y_index[stageIdx][offset3+run2]] = seed->operator()(run2,run1); - - returnvalue = fcn[stageIdx].AD_forward( offset1, fseed1, dresult1 ); - - if( returnvalue != SUCCESSFUL_RETURN ){ - if( dresult1 != 0 ) delete[] dresult1; - if( fseed1 != 0 ) delete[] fseed1 ; - return ACADOERROR(returnvalue); - } - - for( run2 = 0; run2 < nc; run2++ ) - tmp( run2, run1 ) = dresult1[fcn[stageIdx].getDim() - nc + run2]; - } - dForward.setDense( offset1, offset2, tmp ); - } - - delete[] dresult1; - delete[] fseed1 ; - - return SUCCESSFUL_RETURN; -} - - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/boundary_constraint.hpp b/phonelibs/acado/include/acado/constraint/boundary_constraint.hpp deleted file mode 100644 index 5fa83a9f66..0000000000 --- a/phonelibs/acado/include/acado/constraint/boundary_constraint.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/boundary_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_BOUNDARY_CONSTRAINT_HPP -#define ACADO_TOOLKIT_BOUNDARY_CONSTRAINT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores and evaluates boundary constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class BoundaryConstraint allows to manage and evaluate constraints - * at the boundary of the horizon within optimal control problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class BoundaryConstraint : public ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - BoundaryConstraint( ); - - /** Default constructor. */ - BoundaryConstraint( const Grid& grid_ ); - - /** Copy constructor (deep copy). */ - BoundaryConstraint( const BoundaryConstraint& rhs ); - - /** Destructor. */ - virtual ~BoundaryConstraint( ); - - /** Assignment operator (deep copy). */ - BoundaryConstraint& operator=( const BoundaryConstraint& rhs ); - - - - /** Adds a boundary-constraint component. - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED (if the ConstraintElement::fcn is not initialized) - */ - inline returnValue add( const double lb_ , const Expression& arg1, - const Expression& arg2, const double ub_ ); - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - /** Evaluates all components in this constraint and stores the \n - * residuum. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluate( const OCPiterate& iter ); - - - /** Evaluates the sensitivities of all components in this \n - * constraint. Note that the seed can be defined via the base \n - * class ConstraintElement. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities(); - - - - /** Evaluates the sensitivities and Hessian. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( const DMatrix &seed, BlockMatrix &hessian ); - - - -// ========================================================================= - - /** returns the number of constraints */ - inline int getNC() const; - - - protected: - - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_BOUNDARY_CONSTRAINT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/boundary_constraint.ipp b/phonelibs/acado/include/acado/constraint/boundary_constraint.ipp deleted file mode 100644 index cf215b0169..0000000000 --- a/phonelibs/acado/include/acado/constraint/boundary_constraint.ipp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/boundary_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - - -inline int BoundaryConstraint::getNC() const{ - - if( fcn == 0 ) - return 0; - - return fcn[0].getDim(); -} - -inline returnValue BoundaryConstraint::add( const double lb_ , const Expression& arg1, - const Expression& arg2, const double ub_ ){ - - if( fcn == 0 ) - return ACADOERROR(RET_MEMBER_NOT_INITIALISED); - - fcn[0] << arg1; - fcn[1] << arg2; - - lb[0] = (double*)realloc(lb[0],fcn[0].getDim()*sizeof(double)); - ub[0] = (double*)realloc(ub[0],fcn[0].getDim()*sizeof(double)); - - ub[0][fcn[0].getDim()-1] = ub_; - lb[0][fcn[0].getDim()-1] = lb_; - - return SUCCESSFUL_RETURN; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/box_constraint.hpp b/phonelibs/acado/include/acado/constraint/box_constraint.hpp deleted file mode 100644 index a70bd78bad..0000000000 --- a/phonelibs/acado/include/acado/constraint/box_constraint.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/box_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_BOX_CONSTRAINT_HPP -#define ACADO_TOOLKIT_BOX_CONSTRAINT_HPP - - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - - -/** - * \brief Stores and evaluates box constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class BoxConstraint allows to manage and evaluate box (path) constraints - * (simple upper or lower bounds) on the optimization variables within - * optimal control problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class BoxConstraint{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - BoxConstraint( ); - - /** Copy constructor (deep copy). */ - BoxConstraint( const BoxConstraint& rhs ); - - /** Destructor. */ - virtual ~BoxConstraint( ); - - /** Assignment operator (deep copy). */ - BoxConstraint& operator=( const BoxConstraint& rhs ); - - - /** Initialization Routine. */ - returnValue init( const Grid& grid_ ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - /** Protected destructor. */ - void deleteAll(); - - - returnValue evaluateBounds( const OCPiterate& iter ); - - - /** Writes a special copy of the bounds that is needed within the - * OptimizationAlgorithm into the optimization variables. - */ - virtual returnValue getBounds( const OCPiterate& iter ); - - - - - - // - // DATA MEMBERS: - // - protected: - - Grid grid ; /**< the grid */ - - // BOUNDS: - // ---------------------- - int nb ; /**< counts the number of bounds */ - VariableType *var ; /**< variable types */ - int *index ; /**< component of the variable */ - DVector **blb ; /**< lower bounds */ - DVector **bub ; /**< upper bounds */ - - DMatrix *residuumXL ; /**< residuum of the differential states to the lower bound */ - DMatrix *residuumXU ; /**< residuum of the differential states to the upper bound */ - DMatrix *residuumXAL; /**< residuum of the algebraic states to the lower bound */ - DMatrix *residuumXAU; /**< residuum of the algebraic states to the upper bound */ - DMatrix *residuumPL ; /**< residuum of the parameters to the lower bound */ - DMatrix *residuumPU ; /**< residuum of the parameters to the upper bound */ - DMatrix *residuumUL ; /**< residuum of the controls to the lower bound */ - DMatrix *residuumUU ; /**< residuum of the controls to the upper bound */ - DMatrix *residuumWL ; /**< residuum of the disturbances to the lower bound */ - DMatrix *residuumWU ; /**< residuum of the disturbances to the upper bound */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_BOX_CONSTRAINT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/box_constraint.ipp b/phonelibs/acado/include/acado/constraint/box_constraint.ipp deleted file mode 100644 index cd0b4b5994..0000000000 --- a/phonelibs/acado/include/acado/constraint/box_constraint.ipp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/box_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/constraint.hpp b/phonelibs/acado/include/acado/constraint/constraint.hpp deleted file mode 100644 index 975497a410..0000000000 --- a/phonelibs/acado/include/acado/constraint/constraint.hpp +++ /dev/null @@ -1,507 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_CONSTRAINT_HPP -#define ACADO_TOOLKIT_CONSTRAINT_HPP - -#include -#include -#include -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores and evaluates the constraints of optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class Constraint allows to manage and evaluate the constraints - * of optimal control problems. It consists of a list of all different - * types of constraints that are derived from the base class ConstraintElement. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class Constraint : public BoxConstraint{ - - friend class OptimizationAlgorithmBase; - friend class OptimizationAlgorithm; - friend class RealTimeAlgorithm; - friend class TESTExport; - friend class ExportNLPSolver; - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - Constraint( ); - - /** Copy constructor (deep copy). */ - Constraint( const Constraint& rhs ); - - /** Destructor. */ - virtual ~Constraint( ); - - /** Assignment operator (deep copy). */ - Constraint& operator=( const Constraint& rhs ); - - - /** Initializes the constraint. - * - * \param grid_ the discretization grid. - * \param numberOfStages_ the number of stages (default = 1). - * - * \return SUCCESSFUL_RETURN - */ - returnValue init( const Grid& grid_, const int& numberOfStages_ = 1 ); - - - // =========================================================================== - // - // CONTINOUS CONSTRAINTS - // -------------------------- - // - // - // (general form lb(i) <= h( t,x(i),u(i),p,... ) <= ub(i) for all i) - // - // =========================================================================== - - - /**< adds a constraint of the form lb_ <= arg <= ub with constant lower \n - * and upper bounds. - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const double lb_, const Expression& arg, const double ub_ ); - - - /**< adds a constraint of the form lb_ <= arg <= ub where the \n - * lower bound is varying over the grid points. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const DVector lb_, const Expression& arg, const double ub_ ); - - - /**< adds a constraint of the form lb_ <= arg <= ub where the \n - * upper bound is varying over the grid points. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const double lb_, const Expression& arg, const DVector ub_ ); - - - /**< adds a constraint of the form lb_ <= arg <= ub where the \n - * upper and the lower bound are varying over the grid points. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const DVector lb_, const Expression& arg, const DVector ub_ ); - - - // =========================================================================== - // - // DISCRETE CONSTRAINTS - // -------------------------- - // - // - // (general form lb(i) <= h( t,x(i),u(i),p,... ) <= ub(i) for a given i) - // - // =========================================================================== - - - /**< adds a constraint of the form lb_ <= arg <= ub with constant lower \n - * and upper bounds. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const int index_, const double lb_, const Expression& arg, const double ub_ ); - - - // =========================================================================== - // - // COUPLED BOUNDARY CONSTRAINTS - // ---------------------------- - // - // - // (general form lb <= h_1( t_0,x(t_0),u(t_0),p,... ) - // + h_2( t_e,x(t_e),u(t_e),p,... ) <= ub(i) ) - // - // where t_0 is the first and t_e the last time point in the grid. - // - // =========================================================================== - - /**< adds a constraint of the form lb_ <= arg1(0) + arg_2(T) <= ub with \n - * constant lower and upper bounds. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const double lb_, const Expression& arg1, - const Expression& arg2, const double ub_ ); - - - - // =========================================================================== - // - // GENERAL COUPLED CONSTRAINTS - // ------------------------------- - // - // - // (general form lb <= sum_i h_i( t_i,x(t_i),u(t_i),p,... ) <= ub(i) ) - // - // - // =========================================================================== - - /**< adds a constraint of the form lb_ <= sum_i arg_i(t_i) <= ub with \n - * constant lower and upper bounds. \n - * - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - * - */ - returnValue add( const double lb_, const Expression *arguments, const double ub_ ); - - - - - // =========================================================================== - // - // ALGEBRAIC CONSISTENCY CONSTRAINTS - // ----------------------------------- - // - // =========================================================================== - - /** Adds an algebraic consistency constraint for a specified stage. This \n - * method is rather for internal use, as the optimization routine will \n - * care about the transformation of DAE optimization problems adding \n - * consistency constraints, if necessary. Note that the number of stages \n - * has to be specified in advance within the constructor of the constraint.\n - * Actually, the "endOfStage" does at the same specify the start of \n - * the next stage. Thus the DAE's should be added in the correct order. \n - * - * \return SUCCESSFUL_RETURN - * RET_INDEX_OUT_OF_BOUNDS - */ - returnValue add( const uint& endOfStage_ , /**< end of the stage */ - const DifferentialEquation& dae /**< the DAE itself */ ); - - - -// ======================================================================================= -// -// LOADING ROUTINES -// -// ======================================================================================= - - - /**< adds a (continuous) contraint. \n - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - */ - returnValue add( const ConstraintComponent& component ); - - - /**< adds a (discrete) contraint. \n - * \return SUCCESSFUL_RETURN - * RET_INFEASIBLE_CONSTRAINT - */ - returnValue add( const int index_, const ConstraintComponent& component ); - - - - -// ======================================================================================= -// -// DEFINITION OF SEEDS: -// -// ======================================================================================= - - - /** Define a forward seed in form of a block matrix. \n - * \n - * \return SUCCESFUL RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setForwardSeed( BlockMatrix *xSeed_ , /**< the seed in x -direction */ - BlockMatrix *xaSeed_, /**< the seed in xa-direction */ - BlockMatrix *pSeed_ , /**< the seed in p -direction */ - BlockMatrix *uSeed_ , /**< the seed in u -direction */ - BlockMatrix *wSeed_ , /**< the seed in w -direction */ - int order /**< the order of the seed. */ ); - - - /** Defines the first order forward seed to be \n - * the unit-directions matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setUnitForwardSeed( ); - - - - /** Define a backward seed in form of a block matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setBackwardSeed( BlockMatrix *seed, /**< the seed matrix */ - int order /**< the order of the seed.*/ ); - - - - /** Defines the first order backward seed to be \n - * a unit matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setUnitBackwardSeed( ); - - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - - returnValue evaluate( const OCPiterate& iter ); - - - - - returnValue evaluateSensitivities(); - - - /** Return the sensitivities and the hessian term contribution of the constraint \n - * components. The seed should be a (1 x getNumberOfBlocks())-matrix, which are \n - * is in an optimization context the multiplier associated with the constraint. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( const BlockMatrix &seed, BlockMatrix &hessian ); - - - - -// ======================================================================================= -// -// RESULTS OF THE EVALUATION -// -// ======================================================================================= - - - /** Returns the result for the residuum of the constraints. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getConstraintResiduum( BlockMatrix &lowerRes, /**< the lower residuum */ - BlockMatrix &upperRes /**< the upper residuum */ ); - - - /** Returns the result for the residuum of the bounds. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getBoundResiduum( BlockMatrix &lowerRes, /**< the lower residuum */ - BlockMatrix &upperRes /**< the upper residuum */ ); - - - - /** Returns the result for the forward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getForwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */, - int order /**< the order */ ); - - - - /** Returns the result for the backward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getBackwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */, - int order /**< the order */ ); - - - - - -// ========================================================================= -// -// MISCELLANEOUS: -// -// ========================================================================= - - /** returns the constraint grid */ - inline Grid& getGrid(); - - /** returns the number of constraints */ - inline int getNC(); - - /** Returns the number of differential states \n - * \return The requested number of differential states. \n - */ - inline int getNX () const; - - /** Returns the number of algebraic states \n - * \return The requested number of algebraic states. \n - */ - inline int getNXA () const; - - /** Returns the number of parameters \n - * \return The requested number of parameters. \n - */ - inline int getNP () const; - - /** Returns the number of controls \n - * \return The requested number of controls. \n - */ - inline int getNU () const; - - /** Returns the number of disturbances \n - * \return The requested number of disturbances. \n - */ - inline int getNW () const; - - - /** returns the number of constraint blocks */ - inline int getNumberOfBlocks() const; - - - /** returns the dimension of the requested sub-block */ - inline int getBlockDim( int idx ) const; - - /** returns the dimension of the requested sub-block */ - inline DVector getBlockDims( ) const; - - - - /** returns whether the constraint is affine. */ - inline BooleanType isAffine() const; - - /** returns whether object only comprises box constraints. */ - inline BooleanType isBoxConstraint() const; - - /** Returns whether or not the constraint is empty. \n - * \n - * \return BT_TRUE if no constraint is specified yet. \n - * BT_FALSE otherwise. \n - */ - BooleanType isEmpty() const; - - returnValue getPathConstraints(Function& function_, DMatrix& lb_, DMatrix& ub_) const; - - returnValue getPointConstraint(const unsigned index, Function& function_, DMatrix& lb_, DMatrix& ub_) const; - - // - // DATA MEMBERS: - // - protected: - - - BoundaryConstraint *boundary_constraint ; - CoupledPathConstraint *coupled_path_constraint ; - PathConstraint *path_constraint ; - AlgebraicConsistencyConstraint *algebraic_consistency_constraint; - PointConstraint **point_constraints ; - - - // PROTECTED MEMBER FUNCTIONS: - // --------------------------- - - protected: - - /** CAUTION: This function is protected and stictly for internal use. - * Note that e.g. the expression pointer will be deleted when using this function. - */ - returnValue add( const int index_, const double lb_, Expression* arg, const double ub_ ); - - /** CAUTION: This function is protected and strictly for internal use. - * Note that e.g. the expression pointer will be deleted when using this function. - */ - returnValue add( const DVector lb_, Expression* arg, const DVector ub_ ); - - - /** Writes a special copy of the bounds that is needed within the - * OptimizationAlgorithm into the optimization variables. - */ - virtual returnValue getBounds( const OCPiterate& iter ); - - /** Protected version of the destructor. */ - void deleteAll(); - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_CONSTRAINT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/constraint.ipp b/phonelibs/acado/include/acado/constraint/constraint.ipp deleted file mode 100644 index 23c52d950e..0000000000 --- a/phonelibs/acado/include/acado/constraint/constraint.ipp +++ /dev/null @@ -1,257 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - -inline Grid& Constraint::getGrid(){ - - return grid; -} - - -inline int Constraint::getNC(){ - - uint run1; - int nc = 0; - - if( boundary_constraint != 0 ) nc += boundary_constraint ->getNC(); - if( coupled_path_constraint != 0 ) nc += coupled_path_constraint ->getNC(); - if( path_constraint != 0 ) nc += path_constraint ->getNC(); - if( algebraic_consistency_constraint != 0 ) nc += algebraic_consistency_constraint ->getNC(); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) nc += point_constraints[run1]->getNC(); - - return nc; -} - - -inline int Constraint::getNX() const{ - - uint run1; - int n = 0; - - if( boundary_constraint != 0 ) n = acadoMax( boundary_constraint ->getNX() , n ); - if( coupled_path_constraint != 0 ) n = acadoMax( coupled_path_constraint ->getNX() , n ); - if( path_constraint != 0 ) n = acadoMax( path_constraint ->getNX() , n ); - if( algebraic_consistency_constraint != 0 ) n = acadoMax( algebraic_consistency_constraint ->getNX() , n ); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) n = acadoMax( point_constraints[run1]->getNX() , n ); - - return n; -} - - -inline int Constraint::getNXA() const{ - - uint run1; - int n = 0; - - if( boundary_constraint != 0 ) n = acadoMax( boundary_constraint ->getNXA() , n ); - if( coupled_path_constraint != 0 ) n = acadoMax( coupled_path_constraint ->getNXA() , n ); - if( path_constraint != 0 ) n = acadoMax( path_constraint ->getNXA() , n ); - if( algebraic_consistency_constraint != 0 ) n = acadoMax( algebraic_consistency_constraint ->getNXA() , n ); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) n = acadoMax( point_constraints[run1]->getNXA() , n ); - - return n; -} - - -inline int Constraint::getNP() const{ - - uint run1; - int n = 0; - - if( boundary_constraint != 0 ) n = acadoMax( boundary_constraint ->getNP() , n ); - if( coupled_path_constraint != 0 ) n = acadoMax( coupled_path_constraint ->getNP() , n ); - if( path_constraint != 0 ) n = acadoMax( path_constraint ->getNP() , n ); - if( algebraic_consistency_constraint != 0 ) n = acadoMax( algebraic_consistency_constraint ->getNP() , n ); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) n = acadoMax( point_constraints[run1]->getNP() , n ); - - return n; -} - - -inline int Constraint::getNU() const{ - - uint run1; - int n = 0; - - if( boundary_constraint != 0 ) n = acadoMax( boundary_constraint ->getNU() , n ); - if( coupled_path_constraint != 0 ) n = acadoMax( coupled_path_constraint ->getNU() , n ); - if( path_constraint != 0 ) n = acadoMax( path_constraint ->getNU() , n ); - if( algebraic_consistency_constraint != 0 ) n = acadoMax( algebraic_consistency_constraint ->getNU() , n ); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) n = acadoMax( point_constraints[run1]->getNU() , n ); - - return n; -} - - -inline int Constraint::getNW() const{ - - uint run1; - int n = 0; - - if( boundary_constraint != 0 ) n = acadoMax( boundary_constraint ->getNW() , n ); - if( coupled_path_constraint != 0 ) n = acadoMax( coupled_path_constraint ->getNW() , n ); - if( path_constraint != 0 ) n = acadoMax( path_constraint ->getNW() , n ); - if( algebraic_consistency_constraint != 0 ) n = acadoMax( algebraic_consistency_constraint ->getNW() , n ); - if( point_constraints != 0 ) - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) n = acadoMax( point_constraints[run1]->getNW() , n ); - - return n; -} - - -inline BooleanType Constraint::isAffine() const{ - - if( boundary_constraint ->isAffine() == BT_FALSE ) return BT_FALSE; - if( coupled_path_constraint ->isAffine() == BT_FALSE ) return BT_FALSE; - if( path_constraint ->isAffine() == BT_FALSE ) return BT_FALSE; - if( algebraic_consistency_constraint ->isAffine() == BT_FALSE ) return BT_FALSE; - if( point_constraints != 0 ) - for( uint run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) - if( point_constraints[run1]->isAffine() == BT_FALSE ) return BT_FALSE; - - return BT_TRUE; -} - - -inline BooleanType Constraint::isBoxConstraint() const -{ - if( boundary_constraint ->getNC() > 0 ) return BT_FALSE; - if( coupled_path_constraint ->getNC() > 0 ) return BT_FALSE; - if( algebraic_consistency_constraint->getNC() > 0 ) return BT_FALSE; - - if( path_constraint->isBoxConstraint() == BT_FALSE ) return BT_FALSE; - if( point_constraints != 0 ) - for( uint run1 = 0; run1 < grid.getNumPoints(); run1++ ) - if( point_constraints[run1] != 0 ) - if( point_constraints[run1]->isBoxConstraint() == BT_FALSE ) return BT_FALSE; - - return BT_TRUE; -} - - - -inline int Constraint::getNumberOfBlocks() const -{ - uint run1; - int nc = 0; - - const uint N = grid.getNumPoints(); - - if( boundary_constraint ->getNC() != 0 ) nc ++ ; - if( coupled_path_constraint ->getNC() != 0 ) nc ++ ; - if( path_constraint ->getNC() != 0 ) nc += N; - if( algebraic_consistency_constraint ->getNC() != 0 ) nc += N; - if( point_constraints != 0 ) - for( run1 = 0; run1 < N; run1++ ) - if( point_constraints[run1] != 0 ) nc ++; - - return nc; -} - - -inline int Constraint::getBlockDim( int idx ) const -{ - uint run1; - int nc = 0; - - const uint N = grid.getNumPoints(); - - if( boundary_constraint->getNC() != 0 ){ - if( idx == nc ) return boundary_constraint->getNC(); - nc ++ ; - } - if( coupled_path_constraint->getNC() != 0 ){ - if( idx == nc ) return coupled_path_constraint->getNC(); - nc ++ ; - } - if( path_constraint->getNC() != 0 ){ - for( run1 = 0; run1 < N; run1++ ){ - if( idx == nc ) return path_constraint->getDim( run1 ); - nc ++; - } - } - if( algebraic_consistency_constraint->getNC() != 0 ){ - for( run1 = 0; run1 < N; run1++ ){ - if( idx == nc ) return algebraic_consistency_constraint->getDim( run1 ); - nc ++; - } - } - if( point_constraints != 0 ){ - for( run1 = 0; run1 < N; run1++ ){ - if( point_constraints[run1] != 0 ){ - if( idx == nc ) return point_constraints[run1]->getNC(); - nc ++; - } - } - } - - return -1; -} - - -inline DVector Constraint::getBlockDims( ) const -{ - uint dim = getNumberOfBlocks(); - - DVector result( dim ); - for( uint i=0; i -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for all kind of constraints (except for bounds) within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class ConstraintElement serves as base class for all kind of different - * constraints (except for box constraints) within optimal control problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - ConstraintElement( ); - - /** Default constructor. */ - ConstraintElement( const Grid& grid_, int nFcn_, int nB_ ); - - /** Copy constructor (deep copy). */ - ConstraintElement( const ConstraintElement& rhs ); - - /** Destructor. */ - virtual ~ConstraintElement( ); - - /** Assignment operator (deep copy). */ - ConstraintElement& operator=( const ConstraintElement& rhs ); - - - -// ========================================================================== -// -// INITIALIZATION -// -// ========================================================================== - - - /** Initializes the Constraint Element: The dimensions and \n - * index lists. \n - * \return SUCCESSFUL_RETURN - */ - returnValue init( const OCPiterate& iter ); - - - -// ======================================================================================= -// -// DEFINITION OF SEEDS: -// -// ======================================================================================= - - - - /** Define a forward seed in form of a block matrix. \n - * \n - * \return SUCCESFUL RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setForwardSeed( BlockMatrix *xSeed_ , /**< the seed in x -direction */ - BlockMatrix *xaSeed_, /**< the seed in xa-direction */ - BlockMatrix *pSeed_ , /**< the seed in p -direction */ - BlockMatrix *uSeed_ , /**< the seed in u -direction */ - BlockMatrix *wSeed_ , /**< the seed in w -direction */ - int order /**< the order of the seed. */ ); - - - - /** Defines the first order forward seed to be \n - * the unit-directions matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setUnitForwardSeed( ); - - - - /** Define a backward seed in form of a block matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setBackwardSeed( BlockMatrix *seed, /**< the seed matrix */ - int order /**< the order of the seed.*/ ); - - - - - - -// ======================================================================================= -// -// RESULTS OF THE EVALUATION -// -// ======================================================================================= - - - /** Returns the result for the residuum. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getResiduum( BlockMatrix &lower_residuum, /**< the lower residuum */ - BlockMatrix &upper_residuum /**< the upper residuum */ ); - - - - /** Returns the result for the forward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getForwardSensitivities( BlockMatrix *D /**< the result for the - * forward sensitivi- - * ties */, - int order /**< the order */ ); - - - - /** Returns the result for the backward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getBackwardSensitivities( BlockMatrix *D /**< the result for the - * forward sensitivi- - * ties */, - int order /**< the order */ ); - - - - -// ========================================================================= -// -// MISCELLANEOUS: -// -// ========================================================================= - - - /** returns the constraint grid */ - inline Grid& getGrid(); - - /** Returns the number of differential states \n - * \return The requested number of differential states. \n - */ - inline int getNX () const; - - /** Returns the number of algebraic states \n - * \return The requested number of algebraic states. \n - */ - inline int getNXA () const; - - /** Returns the number of controls \n - * \return The requested number of controls. \n - */ - inline int getNU () const; - - /** Returns the number of parameters \n - * \return The requested number of parameters. \n - */ - inline int getNP () const; - - /** Returns the number of disturbances \n - * \return The requested number of disturbances. \n - */ - inline int getNW () const; - - - - /** returns whether the constraint element is affine. */ - inline BooleanType isAffine() const; - - returnValue get(Function& function_, DMatrix& lb_, DMatrix& ub_); - -// ========================================================================== -// -// PROTECTED MEMBER FUNCTIONS: -// -// ========================================================================== - - protected: - - virtual returnValue initializeEvaluationPoints( const OCPiterate& iter - ); - - - - // - // DATA MEMBERS: - // - protected: - - - // DEFINITIONS OF THE CONSTRAINT FUNCTION, GRID, AND BOUNDS: - // --------------------------------------------------------- - - Grid grid ; /**< the constraint grid */ - Function *fcn ; /**< the functions */ - double **lb ; /**< lower bounds */ - double **ub ; /**< upper bounds */ - - EvaluationPoint *z ; /**< the evaluation points */ - EvaluationPoint *JJ ; - - - // LOW_LEVEL EVALUATION INDICES: - // ----------------------------- - - int **y_index; /**< index lists */ - int *t_index; /**< time indices */ - - - // DIMENSIONS: - // ---------------------- - - int nx ; /**< number of diff. states */ - int na ; /**< number of alg. states */ - int nu ; /**< number of controls */ - int np ; /**< number of parameters */ - int nw ; /**< number of disturbances */ - int ny ; /**< := nx+na+nu+np+nw */ - - int nFcn ; /**< number of functions */ - int nB ; /**< number of bounds */ - - - // INPUT STORAGE: - // ------------------------ - BlockMatrix *xSeed ; /**< the 1st order forward seed in x-direction */ - BlockMatrix *xaSeed ; /**< the 1st order forward seed in x-direction */ - BlockMatrix *pSeed ; /**< the 1st order forward seed in p-direction */ - BlockMatrix *uSeed ; /**< the 1st order forward seed in u-direction */ - BlockMatrix *wSeed ; /**< the 1st order forward seed in w-direction */ - - BlockMatrix *bSeed ; /**< the 1st order backward seed */ - - BlockMatrix *xSeed2 ; /**< the 2nd order forward seed in x-direction */ - BlockMatrix *xaSeed2 ; /**< the 2nd order forward seed in x-direction */ - BlockMatrix *pSeed2 ; /**< the 2nd order forward seed in p-direction */ - BlockMatrix *uSeed2 ; /**< the 2nd order forward seed in u-direction */ - BlockMatrix *wSeed2 ; /**< the 2nd order forward seed in w-direction */ - - BlockMatrix *bSeed2 ; /**< the 2nd order backward seed */ - - - // RESULTS: - // ------------------------ - BlockMatrix residuumL; /**< the residuum vectors */ - BlockMatrix residuumU; /**< the residuum vectors */ - - BlockMatrix dForward ; /**< the first order forward derivatives */ - BlockMatrix dBackward; /**< the first order backward derivatives */ - - CondensingType condType ; /**< the condensing type */ - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_CONSTRAINT_ELEMENT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/constraint_element.ipp b/phonelibs/acado/include/acado/constraint/constraint_element.ipp deleted file mode 100644 index 135e729e72..0000000000 --- a/phonelibs/acado/include/acado/constraint/constraint_element.ipp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/constraint_element.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - - -inline Grid& ConstraintElement::getGrid(){ - - return grid; -} - - -inline int ConstraintElement::getNX () const{ - - int run1, nn; - - nn = 0; - for( run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - nn = acadoMax( fcn[run1].getNX(), nn ); - - return nn; -} - - -inline int ConstraintElement::getNXA () const{ - - int run1, nn; - - nn = 0; - for( run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - nn = acadoMax( fcn[run1].getNXA(), nn ); - - return nn; -} - - -inline int ConstraintElement::getNU () const{ - - int run1, nn; - - nn = 0; - for( run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - nn = acadoMax( fcn[run1].getNU(), nn ); - - return nn; -} - - -inline int ConstraintElement::getNP () const{ - - int run1, nn; - - nn = 0; - for( run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - nn = acadoMax( fcn[run1].getNP(), nn ); - - return nn; -} - - -inline int ConstraintElement::getNW () const{ - - int run1, nn; - - nn = 0; - for( run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - nn = acadoMax( fcn[run1].getNW(), nn ); - - return nn; -} - - -inline BooleanType ConstraintElement::isAffine() const{ - - for( int run1 = 0; run1 < nFcn; run1++ ) - if( fcn[run1].getDim() != 0 ) - if( fcn[run1].isAffine() == BT_FALSE ) - return BT_FALSE; - - return BT_TRUE; -} - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/coupled_path_constraint.hpp b/phonelibs/acado/include/acado/constraint/coupled_path_constraint.hpp deleted file mode 100644 index 63b766da59..0000000000 --- a/phonelibs/acado/include/acado/constraint/coupled_path_constraint.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/coupled_path_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_COUPLED_PATH_CONSTRAINT_HPP -#define ACADO_TOOLKIT_COUPLED_PATH_CONSTRAINT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores and evaluates coupled path constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class CoupledPathConstraint allows to manage and evaluate constraints - * along the whole horizon within optimal control problems that are coupled - * across control intervals. If the contraints are decoupled, the class - * PathConstraint should be used. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class CoupledPathConstraint : public ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - CoupledPathConstraint( ); - - /** Default constructor. */ - CoupledPathConstraint( const Grid& grid_ ); - - /** Copy constructor (deep copy). */ - CoupledPathConstraint( const CoupledPathConstraint& rhs ); - - /** Destructor. */ - virtual ~CoupledPathConstraint( ); - - /** Assignment operator (deep copy). */ - CoupledPathConstraint& operator=( const CoupledPathConstraint& rhs ); - - - /** Adds a coupled-path-constraint component. - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED (if the ConstraintElement::fcn is not initialized) - */ - inline returnValue add( const double lb_, const Expression* arg, const double ub_ ); - - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - /** Evaluates all components in this constraint and stores the \n - * residuum. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluate( const OCPiterate& iter ); - - - /** Evaluates the sensitivities of all components in this \n - * constraint. Note that the seed can be defined via the base \n - * class ConstraintElement. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities(); - - - - /** Evaluates the sensitivities and Hessian. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( const DMatrix &seed, BlockMatrix &hessian ); - - - -// ========================================================================= - - /** returns the number of constraints */ - inline int getNC() const; - - - protected: - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_COUPLED_PATH_CONSTRAINT_HPP -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/coupled_path_constraint.ipp b/phonelibs/acado/include/acado/constraint/coupled_path_constraint.ipp deleted file mode 100644 index 8d04bafd85..0000000000 --- a/phonelibs/acado/include/acado/constraint/coupled_path_constraint.ipp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/coupled_path_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - -inline int CoupledPathConstraint::getNC() const{ - - if( fcn == 0 ) - return 0; - - return fcn[0].getDim(); -} - - -inline returnValue CoupledPathConstraint::add( const double lb_, const Expression* arg, const double ub_ ){ - - uint run1; - - if( fcn == 0 ) - return ACADOERROR(RET_MEMBER_NOT_INITIALISED); - - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ) - fcn[run1] << arg[run1]; - - lb[0] = (double*)realloc(lb[0],fcn[0].getDim()*sizeof(double)); - ub[0] = (double*)realloc(ub[0],fcn[0].getDim()*sizeof(double)); - - ub[0][fcn[0].getDim()-1] = ub_; - lb[0][fcn[0].getDim()-1] = lb_; - - return SUCCESSFUL_RETURN; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/path_constraint.hpp b/phonelibs/acado/include/acado/constraint/path_constraint.hpp deleted file mode 100644 index cf35cb90b8..0000000000 --- a/phonelibs/acado/include/acado/constraint/path_constraint.hpp +++ /dev/null @@ -1,147 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/path_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_PATH_CONSTRAINT_HPP -#define ACADO_TOOLKIT_PATH_CONSTRAINT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores and evaluates path constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class PathConstraint allows to manage and evaluate constraints - * along the whole horizon within optimal control problems. Note that - * the path constraints need to be decoupled on each control interval, - * otherwise the class CouplePathConstraint has to be used. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class PathConstraint : public ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - PathConstraint( ); - - /** Default constructor. */ - PathConstraint( const Grid& grid_ ); - - /** Copy constructor (deep copy). */ - PathConstraint( const PathConstraint& rhs ); - - /** Destructor. */ - virtual ~PathConstraint( ); - - /** Assignment operator (deep copy). */ - PathConstraint& operator=( const PathConstraint& rhs ); - - -// ======================================================================================= - - /** Adds a path-constraint component. - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED (if the ConstraintElement::fcn is not initialized) - */ - inline returnValue add( const DVector lb_, const Expression& arg, const DVector ub_ ); - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - /** Evaluates all components in this constraint and stores the \n - * residuum. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluate( const OCPiterate& iter ); - - - /** Evaluates the sensitivities of all components in this \n - * constraint. Note that the seed can be defined via the base \n - * class ConstraintElement. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities(); - - - /** Evaluates the sensitivities and Hessian. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( int &count, const BlockMatrix &seed, BlockMatrix &hessian ); - - - -// ========================================================================= - - /** returns the number of constraints */ - inline int getNC() const; - - /** returns the dimension of a specified block of the constraints */ - inline int getDim( const int& idx_ ); - - - inline BooleanType isBoxConstraint( ) const; - - protected: - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_PATH_CONSTRAINT_HPP -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/path_constraint.ipp b/phonelibs/acado/include/acado/constraint/path_constraint.ipp deleted file mode 100644 index 4b4caf9162..0000000000 --- a/phonelibs/acado/include/acado/constraint/path_constraint.ipp +++ /dev/null @@ -1,100 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/path_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -BEGIN_NAMESPACE_ACADO - - - -inline int PathConstraint::getNC() const{ - - if( fcn == 0 ) - return 0; - - return (fcn[0].getDim())*((int) grid.getNumPoints()); -} - - -inline int PathConstraint::getDim( const int& idx_) -{ - if (idx_ >= (int) grid.getNumPoints()) - { - LOG( LVL_WARNING ) << "Invalid index, will be ignored" << std::endl; - } - - if(fcn == 0) - return 0; - - return fcn[0].getDim(); -} - - -inline BooleanType PathConstraint::isBoxConstraint( ) const -{ - return isAffine( ); //TODO: implement this correctly! -} - - - -inline returnValue PathConstraint::add( const DVector lb_, const Expression& arg, const DVector ub_ ){ - - uint run1; - - if( fcn == 0 ) - return ACADOERROR(RET_MEMBER_NOT_INITIALISED); - - - fcn[0] << arg; - - for( run1 = 0; run1 < grid.getNumPoints(); run1++ ){ - - lb[run1] = (double*)realloc(lb[run1],fcn[0].getDim()*sizeof(double)); - ub[run1] = (double*)realloc(ub[run1],fcn[0].getDim()*sizeof(double)); - - ub[run1][fcn[0].getDim()-1] = ub_(run1); - lb[run1][fcn[0].getDim()-1] = lb_(run1); - } - - return SUCCESSFUL_RETURN; -} - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/constraint/point_constraint.hpp b/phonelibs/acado/include/acado/constraint/point_constraint.hpp deleted file mode 100644 index b911d694d3..0000000000 --- a/phonelibs/acado/include/acado/constraint/point_constraint.hpp +++ /dev/null @@ -1,173 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/point_constraint.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - -#ifndef ACADO_TOOLKIT_POINT_CONSTRAINT_HPP -#define ACADO_TOOLKIT_POINT_CONSTRAINT_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores and evaluates pointwise constraints within optimal control problems. - * - * \ingroup BasicDataStructures - * - * The class PointConstraint allows to manage and evaluate pointwise - * constraints within optimal control problems. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class PointConstraint : public ConstraintElement{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - PointConstraint( ); - - /** Default constructor. */ - PointConstraint( const Grid& grid_, int point_index_ ); - - /** Copy constructor (deep copy). */ - PointConstraint( const PointConstraint& rhs ); - - /** Destructor. */ - virtual ~PointConstraint( ); - - /** Assignment operator (deep copy). */ - PointConstraint& operator=( const PointConstraint& rhs ); - - - - /** Adds a point-constraint component. - * \return SUCCESSFUL_RETURN - * RET_MEMBER_NOT_INITIALISED (if the ConstraintElement::fcn is not initialized) - */ - returnValue add( const double lb_, const Expression& arg, const double ub_ ); - - - -// ======================================================================================= -// -// EVALUATION ROUTINES -// -// ======================================================================================= - - - /** Evaluates all components in this constraint and stores the \n - * residuum. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluate( const OCPiterate& iter ); - - - /** Evaluates the sensitivities of all components in this \n - * constraint. Note that the seed can be defined via the base \n - * class ConstraintElement. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities(); - - - - /** Evaluates the sensitivities and Hessian. \n - * \n - * \return SUCESSFUL_RETURN \n - */ - returnValue evaluateSensitivities( const DMatrix &seed, BlockMatrix &hessian ); - - - -// ========================================================================= - - /** returns the number of constraints */ - inline int getNC() const; - - - /** returns whether object only comprises box constraints. */ - inline BooleanType isBoxConstraint( ) const; - - - /** Writes a special copy of the bounds that is needed within the - * OptimizationAlgorithm into the optimization variables. - */ - returnValue getBounds( const OCPiterate& iter ); - - - - // PROTECTED FUNCTIONS: - // -------------------- - protected: - - /** only for internal use (routine which computes a part of the block - * matrix needed for forward differentiation.) */ - returnValue computeForwardSensitivityBlock( int offset, int offset2, DMatrix *seed ); - - - - // DATA MEMBERS: - // ------------- - - protected: - - int point_index; /**< index of the constraint relative to the constraint grid */ - - int nb ; /**< counts the number of simple point bounds */ - VariableType *var ; /**< variable types */ - int *index ; /**< component of the variable */ - double *blb ; /**< lower bounds */ - double *bub ; /**< upper bounds */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_POINT_CONSTRAINT_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/constraint/point_constraint.ipp b/phonelibs/acado/include/acado/constraint/point_constraint.ipp deleted file mode 100644 index 84f7d797e5..0000000000 --- a/phonelibs/acado/include/acado/constraint/point_constraint.ipp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/constraint/point_constraint.ipp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - - - -BEGIN_NAMESPACE_ACADO - - -// -// PUBLIC MEMBER FUNCTIONS: -// - -inline int PointConstraint::getNC() const -{ - if( fcn == 0 ) - return 0; - - return fcn[0].getDim(); -} - - -inline BooleanType PointConstraint::isBoxConstraint( ) const -{ - if ( getNC( ) == nb ) - return BT_TRUE; - else - return BT_FALSE; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/control_law/clipping_functionality.hpp b/phonelibs/acado/include/acado/control_law/clipping_functionality.hpp deleted file mode 100644 index 3d6f7cf478..0000000000 --- a/phonelibs/acado/include/acado/control_law/clipping_functionality.hpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/clipping_functionality.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_CLIPPING_FUNCTIONALITY_HPP -#define ACADO_TOOLKIT_CLIPPING_FUNCTIONALITY_HPP - - -#include - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to transform the output of the ControlLaw before passing it to the Process. - * - * \ingroup AuxiliaryFunctionality - * - * The class ClippingFunctionality allows to limit the output of the - * ControlLaw before passing it as signal to control the Process. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ClippingFunctionality -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ClippingFunctionality( ); - - /** Constructor which takes dimensions of the signals to be clipped. - * - * @param[in] _nU Number of control signals to be clipped. - * @param[in] _nP Number of parameter signals to be clipped. - */ - ClippingFunctionality( uint _nU, - uint _nP = 0 - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - ClippingFunctionality( const ClippingFunctionality& rhs - ); - - /** Destructor. - */ - ~ClippingFunctionality( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - ClippingFunctionality& operator=( const ClippingFunctionality& rhs - ); - - - /** Assigns new lower limits on control signals. - * - * @param[in] _lowerLimit New lower limits on control signals. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setControlLowerLimits( const DVector& _lowerLimit - ); - - /** Assigns new lower limit on given component of the control signal. - * - * @param[in] idx Index of control signal component. - * @param[in] _lowerLimit New lower limit. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INDEX_OUT_OF_BOUNDS - */ - returnValue setControlLowerLimit( uint idx, - double _lowerLimit - ); - - /** Assigns new upper limits on control signals. - * - * @param[in] _upperLimit New upper limits on control signals. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setControlUpperLimits( const DVector& _upperLimit - ); - - /** Assigns new upper limit on given component of the control signal. - * - * @param[in] idx Index of control signal component. - * @param[in] _upperLimit New upper limit. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INDEX_OUT_OF_BOUNDS - */ - returnValue setControlUpperLimit( uint idx, - double _upperLimit - ); - - - /** Assigns new lower limits on parameter signals. - * - * @param[in] _lowerLimit New lower limits on parameter signals. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setParameterLowerLimits( const DVector& _lowerLimit - ); - - /** Assigns new lower limit on given component of the parameter signal. - * - * @param[in] idx Index of parameter signal component. - * @param[in] _lowerLimit New lower limit. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INDEX_OUT_OF_BOUNDS - */ - returnValue setParameterLowerLimit( uint idx, - double _lowerLimit - ); - - /** Assigns new upper limits on parameter signals. - * - * @param[in] _upperLimit New upper limits on parameter signals. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setParameterUpperLimits( const DVector& _upperLimit - ); - - /** Assigns new upper limit on given component of the parameter signal. - * - * @param[in] idx Index of parameter signal component. - * @param[in] _upperLimit New upper limit. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INDEX_OUT_OF_BOUNDS - */ - returnValue setParameterUpperLimit( uint idx, - double _upperLimit - ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Actually clips given control and parameter signals. - * - * @param[in,out] _u Control signal sequence to be clipped. - * @param[in,out] _p Parameter signal sequence to be clipped. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue clipSignals( VariablesGrid& _u, - VariablesGrid& _p = emptyVariablesGrid - ); - - /** Actually clips given control and parameter signals. - * - * @param[in,out] _u Control signal to be clipped. - * @param[in,out] _p Parameter signal to be clipped. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue clipSignals( DVector& _u, - DVector& _p = emptyVector - ); - - - /** Returns number of control signal limits. - * - * \return Number of control signal limits - */ - inline uint getNumControlLimits( ) const; - - /** Returns number of parameter signal limits. - * - * \return Number of parameter signal limits - */ - inline uint getNumParameterLimits( ) const; - - - - // - // DATA MEMBERS: - // - protected: - - DVector lowerLimitControls; /**< Lower limits on control signals. */ - DVector upperLimitControls; /**< Upper limits on control signals. */ - - DVector lowerLimitParameters; /**< Lower limits on parameter signals. */ - DVector upperLimitParameters; /**< Upper limits on parameter signals. */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_CLIPPING_FUNCTIONALITY_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/control_law/clipping_functionality.ipp b/phonelibs/acado/include/acado/control_law/clipping_functionality.ipp deleted file mode 100644 index fe153dcc64..0000000000 --- a/phonelibs/acado/include/acado/control_law/clipping_functionality.ipp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/clipping_functionality.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - - -BEGIN_NAMESPACE_ACADO - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -// -// PROTECTED MEMBER FUNCTIONS: -// - -inline uint ClippingFunctionality::getNumControlLimits( ) const -{ - return lowerLimitControls.getDim( ); -} - - -inline uint ClippingFunctionality::getNumParameterLimits( ) const -{ - return lowerLimitParameters.getDim( ); -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/control_law/control_law.hpp b/phonelibs/acado/include/acado/control_law/control_law.hpp deleted file mode 100644 index c9be3e4b7d..0000000000 --- a/phonelibs/acado/include/acado/control_law/control_law.hpp +++ /dev/null @@ -1,356 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/control_law.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_CONTROL_LAW_HPP -#define ACADO_TOOLKIT_CONTROL_LAW_HPP - - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for interfacing online feedback laws to be used within a Controller. - * - * \ingroup UserInterfaces - * - * The class ControlLaw serves as a base class for interfacing online - * control laws to be used within a Controller. Most prominently, the - * control law can be a RealTimeAlgorithm solving dynamic optimization - * problems. But also classical feedback laws like LQR or PID controller - * or feedforward laws can be interfaced. - * - * After initialization, the ControlLaw is evaluated with a given fixed - * sampling time by calling the step-routines. Additionally, the steps - * can be divided into a preparation step and a feedback step that actually - * computes the feedback. This feature has mainly been added to deal with - * RealTimeAlgorithm can make use of this division in order to reduce the - * feedback delay. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class ControlLaw : public SimulationBlock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - ControlLaw( ); - - /** Constructor which takes the sampling time. - * - * @param[in] _samplingTime Sampling time. - */ - ControlLaw( double _samplingTime - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - ControlLaw( const ControlLaw& rhs - ); - - /** Destructor. - */ - virtual ~ControlLaw( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - ControlLaw& operator=( const ControlLaw& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual ControlLaw* clone( ) const = 0; - - - /** Initializes algebraic states of the control law. - * - * @param[in] _xa_init Initial value for algebraic states. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue initializeAlgebraicStates( const VariablesGrid& _xa_init - ); - - /** Initializes algebraic states of the control law from data file. - * - * @param[in] fileName Name of file containing initial value for algebraic states. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED - */ - virtual returnValue initializeAlgebraicStates( const char* fileName - ); - - - /** Initializes controls of the control law. - * - * @param[in] _u_init Initial value for controls. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue initializeControls( const VariablesGrid& _u_init - ); - - /** Initializes controls of the control law from data file. - * - * @param[in] fileName Name of file containing initial value for controls. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED - */ - virtual returnValue initializeControls( const char* fileName - ); - - - /** Initializes the control law with given start values and - * performs a number of consistency checks. - * - * @param[in] _startTime Start time. - * @param[in] _x Initial value for differential states. - * @param[in] _p Initial value for parameters. - * @param[in] _yRef Initial value for reference trajectory. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CONTROLLAW_INIT_FAILED - */ - virtual returnValue init( double startTime = 0.0, - const DVector& _x = emptyConstVector, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ) = 0; - - - /** Performs next step of the control law based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory or piece of reference trajectory for next step (required for hotstarting). - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue step( double currentTime, - const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ) = 0; - - /** Performs next step of the control law based on given inputs. - * - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory or piece of reference trajectory for next step (required for hotstarting). - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue step( const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - /** Performs next feedback step of the control law based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory (if not specified during previous preparationStep). - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue feedbackStep( double currentTime, - const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - /** Performs next preparation step of the control law based on given inputs. - * - * @param[in] nextTime Time at next step. - * @param[in] _yRef Piece of reference trajectory for next step (required for hotstarting). - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue preparationStep( double nextTime = 0.0, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Shifts the data for preparating the next real-time step. - * - * \return RET_NOT_YET_IMPLEMENTED - */ - virtual returnValue shift( double timeShift = -1.0 - ); - - - /** Returns control signal as determined by the control law. - * - * @param[out] _u Control signal as determined by the control law. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue getU( DVector& _u - ) const; - - /** Returns parameter signal as determined by the control law. - * - * @param[out] _p Parameter signal as determined by the control law. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue getP( DVector& _p - ) const; - - - /** Returns number of (estimated) differential states. - * - * \return Number of (estimated) differential states - */ - virtual uint getNX( ) const; - - /** Returns number of (estimated) algebraic states. - * - * \return Number of (estimated) algebraic states - */ - virtual uint getNXA( ) const; - - /** Returns number of controls. - * - * \return Number of controls - */ - virtual uint getNU( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - virtual uint getNP( ) const; - - /** Returns number of (estimated) disturbances. - * - * \return Number of (estimated) disturbances - */ - virtual uint getNW( ) const; - - /** Returns number of process outputs. - * - * \return Number of process outputs - */ - virtual uint getNY( ) const; - - - /** Returns length of the prediction horizon (for the case a predictive control law is used). - * - * \return Length of the prediction horizon - */ - virtual double getLengthPredictionHorizon( ) const; - - /** Returns length of the control horizon (for the case a predictive control law is used). - * - * \return Length of the control horizon - */ - virtual double getLengthControlHorizon( ) const; - - - /** Returns whether the control law is based on dynamic optimization or - * a static one. - * - * \return BT_TRUE iff control law is based on dynamic optimization, \n - * BT_FALSE otherwise - */ - virtual BooleanType isDynamic( ) const = 0; - - /** Returns whether the control law is a static one or based on dynamic optimization. - * - * \return BT_TRUE iff control law is a static one, \n - * BT_FALSE otherwise - */ - virtual BooleanType isStatic( ) const = 0; - - /** Returns whether the control law is working in real-time mode. - * - * \return BT_TRUE iff control law is working in real-time mode, \n - * BT_FALSE otherwise - */ - virtual BooleanType isInRealTimeMode( ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - - DVector u; /**< First piece of time-varying control signals as determined by the control law. */ - DVector p; /**< Time-constant parameter signals as determined by the control law. */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_CONTROL_LAW_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/control_law/control_law.ipp b/phonelibs/acado/include/acado/control_law/control_law.ipp deleted file mode 100644 index d8485e4475..0000000000 --- a/phonelibs/acado/include/acado/control_law/control_law.ipp +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/control_law.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - -inline returnValue ControlLaw::getU( DVector& _u - ) const -{ - _u = u; - return SUCCESSFUL_RETURN; -} - - -inline returnValue ControlLaw::getP( DVector& _p - ) const -{ - _p = p; - return SUCCESSFUL_RETURN; -} - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/control_law/feedforward_law.hpp b/phonelibs/acado/include/acado/control_law/feedforward_law.hpp deleted file mode 100644 index 9fb7ba4a7b..0000000000 --- a/phonelibs/acado/include/acado/control_law/feedforward_law.hpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/feedforward_law.hpp - * \author Joris Gillis, Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_FEEDFORWARD_LAW_HPP -#define ACADO_TOOLKIT_FEEDFORWARD_LAW_HPP - - -#include -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - -/** - * \brief Implements a feedforward law to be used within a Controller. - * - * \ingroup UserInterfaces - * - * The class FeedforwardLaw allows to implement a predefined feedforward law to - * be evaluated at the sampling instants. - * - * \author Joris Gillis, Hans Joachim Ferreau, Boris Houska - */ -class FeedforwardLaw : public ControlLaw -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. - */ - FeedforwardLaw( ); - - /** Constructor which takes the predefined control signals as curve - * together with the sampling time. - * - * @param[in] _nx Number of differential states. - * @param[in] _u Predefined control signal. - * @param[in] _samplingTime Sampling time. - */ - FeedforwardLaw( const uint _nx, - const Curve& _u, - double _samplingTime = DEFAULT_SAMPLING_TIME - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - FeedforwardLaw( const FeedforwardLaw& rhs - ); - - /** Destructor. - */ - virtual ~FeedforwardLaw( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - FeedforwardLaw& operator=( const FeedforwardLaw& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual ControlLaw* clone( ) const; - - - /** Initializes the feedforward law with given start values and - * performs a number of consistency checks. - * - * @param[in] _startTime Start time. - * @param[in] _x Initial value for differential states. - * @param[in] _p Initial value for parameters. - * @param[in] _yRef Initial value for reference trajectory. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Performs next step of the feedforward law based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue step( double currentTime, - const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Returns number of (estimated) differential states. - * - * \return Number of (estimated) differential states - */ - virtual uint getNX( ) const; - - /** Returns number of (estimated) algebraic states. - * - * \return Number of (estimated) algebraic states - */ - virtual uint getNXA( ) const; - - /** Returns number of controls. - * - * \return Number of controls - */ - virtual uint getNU( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - virtual uint getNP( ) const; - - /** Returns number of (estimated) disturbances. - * - * \return Number of (estimated) disturbances - */ - virtual uint getNW( ) const; - - /** Returns number of process outputs. - * - * \return Number of process outputs - */ - virtual uint getNY( ) const; - - - /** Returns whether the control law is based on dynamic optimization or - * a static one. - * - * \return BT_TRUE iff control law is based on dynamic optimization, \n - * BT_FALSE otherwise - */ - virtual BooleanType isDynamic( ) const; - - /** Returns whether the control law is a static one or based on dynamic optimization. - * - * \return BT_TRUE iff control law is a static one, \n - * BT_FALSE otherwise - */ - virtual BooleanType isStatic( ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - uint nx; /**< Number of differential states. */ - Curve uRef; /**< Predefined control signal. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#endif // ACADO_TOOLKIT_FEEDFORWARD_LAW_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/control_law/linear_state_feedback.hpp b/phonelibs/acado/include/acado/control_law/linear_state_feedback.hpp deleted file mode 100644 index 750b6a86d0..0000000000 --- a/phonelibs/acado/include/acado/control_law/linear_state_feedback.hpp +++ /dev/null @@ -1,220 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/linear_state_feedback.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_LINEAR_STATE_FEEDBACK_HPP -#define ACADO_TOOLKIT_LINEAR_STATE_FEEDBACK_HPP - - -#include -#include - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Implements a linear state feedback law to be used within a Controller. - * - * \ingroup UserInterfaces - * - * The class LinearStateFeedback implements a linear state feedback law to be used - * within a Controller. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class LinearStateFeedback : public ControlLaw, public ClippingFunctionality -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. - */ - LinearStateFeedback( ); - - /** Constructor which takes the gain matrix of the linear feedback law - * together with the sampling time. - * - * @param[in] _K Linear feedback gain matrix. - * @param[in] _samplingTime Sampling time. - */ - LinearStateFeedback( const DMatrix& _K, - double _samplingTime = DEFAULT_SAMPLING_TIME - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - LinearStateFeedback( const LinearStateFeedback& rhs - ); - - /** Destructor. - */ - virtual ~LinearStateFeedback( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - LinearStateFeedback& operator=( const LinearStateFeedback& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual ControlLaw* clone( ) const; - - - /** Initializes the feedback law with given start values and - * performs a number of consistency checks. - * - * @param[in] _startTime Start time. - * @param[in] _x Initial value for differential states. - * @param[in] _p Initial value for parameters. - * @param[in] _yRef Initial value for reference trajectory. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Performs next step of the feedback law based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue step( double currentTime, - const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Returns number of (estimated) differential states. - * - * \return Number of (estimated) differential states - */ - virtual uint getNX( ) const; - - /** Returns number of (estimated) algebraic states. - * - * \return Number of (estimated) algebraic states - */ - virtual uint getNXA( ) const; - - /** Returns number of controls. - * - * \return Number of controls - */ - virtual uint getNU( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - virtual uint getNP( ) const; - - /** Returns number of (estimated) disturbances. - * - * \return Number of (estimated) disturbances - */ - virtual uint getNW( ) const; - - /** Returns number of process outputs. - * - * \return Number of process outputs - */ - virtual uint getNY( ) const; - - - /** Returns whether the control law is based on dynamic optimization or - * a static one. - * - * \return BT_TRUE iff control law is based on dynamic optimization, \n - * BT_FALSE otherwise - */ - virtual BooleanType isDynamic( ) const; - - /** Returns whether the control law is a static one or based on dynamic optimization. - * - * \return BT_TRUE iff control law is a static one, \n - * BT_FALSE otherwise - */ - virtual BooleanType isStatic( ) const; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - - DMatrix K; /**< Linear state feedback gain matrix. */ - -}; - - -CLOSE_NAMESPACE_ACADO - - - -//#include - - -#endif // ACADO_TOOLKIT_LINEAR_STATE_FEEDBACK_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/control_law/pid_controller.hpp b/phonelibs/acado/include/acado/control_law/pid_controller.hpp deleted file mode 100644 index 067a4c85b6..0000000000 --- a/phonelibs/acado/include/acado/control_law/pid_controller.hpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/pid_controller.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_PID_CONTROLLER_HPP -#define ACADO_TOOLKIT_PID_CONTROLLER_HPP - - -#include -#include - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Implements a PID control law to be used within a Controller. - * - * \ingroup UserInterfaces - * - * The class PIDcontroller implements a PID control law to be used - * within a Controller. - * - * For each input component, the weight for the proportional, integral and - * derivative term can be specified. The PID controller can be used in one - * of two different modes, depending on the number of inputs and outputs: - * - * i) nOutputs = nInputs: Each output component is determined by the sum of - * the P, I, and D weight on the corresponding input component. - * - * ii) nOutputs = 1: The component is determined by the sum of the P, I, - * and D weights on all input components. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class PIDcontroller : public ControlLaw, public ClippingFunctionality -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. - */ - PIDcontroller( ); - - /** Constructor which takes the number of inputs and outputs of the - * PID controller as well as the sampling time. - * - * @param[in] _nInputs Number of inputs. - * @param[in] _nOutputs Number of outputs. - * @param[in] _samplingTime Sampling time. - */ - PIDcontroller( uint _nInputs, - uint _nOutputs, - double _samplingTime = DEFAULT_SAMPLING_TIME - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - PIDcontroller( const PIDcontroller& rhs - ); - - /** Destructor. - */ - virtual ~PIDcontroller( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - PIDcontroller& operator=( const PIDcontroller& rhs - ); - - /** Clone constructor (deep copy). - * - * \return Pointer to deep copy of base class type - */ - virtual ControlLaw* clone( ) const; - - - /** Assigns new proportional weights to the input components. - * - * @param[in] _pWeights New proportional weights. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setProportionalWeights( const DVector& _pWeights - ); - - /** Assigns new integral weights to the input components. - * - * @param[in] _iWeights New integral weights. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setIntegralWeights( const DVector& _iWeights - ); - - /** Assigns new derivative weights to the input components. - * - * @param[in] _dWeights New derivative weights. - * - * \return SUCCESSFUL_RETURN, \n - * RET_VECTOR_DIMENSION_MISMATCH - */ - returnValue setDerivativeWeights( const DVector& _dWeights - ); - - - /** Initializes the control law with given start values and - * performs a number of consistency checks. - * - * @param[in] _startTime Start time. - * @param[in] _x Initial value for differential states. - * @param[in] _p Initial value for parameters. - * @param[in] _yRef Initial value for reference trajectory. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Performs next step of the control law based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _x Most recent value for differential states. - * @param[in] _p Most recent value for parameters. - * @param[in] _yRef Current piece of reference trajectory. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_VECTOR_DIMENSION_MISMATCH, \n - * RET_CONTROLLAW_STEP_FAILED - */ - virtual returnValue step( double currentTime, - const DVector& _x, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Returns number of input components of the PID controller. - * - * \return Number of input components - */ - inline uint getNumInputs( ) const; - - /** Returns number of output components of the PID controller. - * - * \return Number of output components - */ - inline uint getNumOutputs( ) const; - - - /** Returns number of (estimated) differential states. This is the same - * as the number of inputs. - * - * \return Number of (estimated) differential states - */ - virtual uint getNX( ) const; - - /** Returns number of (estimated) algebraic states. - * - * \return Number of (estimated) algebraic states - */ - virtual uint getNXA( ) const; - - /** Returns number of controls. This is the same - * as the number of outputs. - * - * \return Number of controls - */ - virtual uint getNU( ) const; - - /** Returns number of parameters. - * - * \return Number of parameters - */ - virtual uint getNP( ) const; - - /** Returns number of (estimated) disturbances. - * - * \return Number of (estimated) disturbances - */ - virtual uint getNW( ) const; - - /** Returns number of process outputs. - * - * \return Number of process outputs - */ - virtual uint getNY( ) const; - - - /** Returns whether the control law is based on dynamic optimization or - * a static one. - * - * \return BT_TRUE iff control law is based on dynamic optimization, \n - * BT_FALSE otherwise - */ - virtual BooleanType isDynamic( ) const; - - /** Returns whether the control law is a static one or based on dynamic optimization. - * - * \return BT_TRUE iff control law is a static one, \n - * BT_FALSE otherwise - */ - virtual BooleanType isStatic( ) const; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Actually calculates the current control action based on the - * given current error. - * - * @param[in] error Current error (difference to reference value). - * @param[out] output Current control action. - * - * \return SUCCESSFUL_RETURN - */ - returnValue determineControlAction( const DVector& error, - DVector& output - ); - - - // - // DATA MEMBERS: - // - protected: - uint nInputs; /**< Number of inputs. */ - uint nOutputs; /**< Number of outputs. */ - - DVector pWeights; /**< Proportional weights for all input components. */ - DVector iWeights; /**< Integral weights for all input components. */ - DVector dWeights; /**< Derivative weights for all input components. */ - - DVector iValue; /**< Integrated value for each input component. */ - DVector lastError; /**< Last error input (to be used for calculating the derivative via finite differences). */ -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_PID_CONTROLLER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/control_law/pid_controller.ipp b/phonelibs/acado/include/acado/control_law/pid_controller.ipp deleted file mode 100644 index 6ba57a668e..0000000000 --- a/phonelibs/acado/include/acado/control_law/pid_controller.ipp +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/control_law/pid_controller.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - - -BEGIN_NAMESPACE_ACADO - -// -// PUBLIC MEMBER FUNCTIONS: -// - -inline uint PIDcontroller::getNumInputs( ) const -{ - return nInputs; -} - - - -inline uint PIDcontroller::getNumOutputs( ) const -{ - return nOutputs; -} - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/controller/controller.hpp b/phonelibs/acado/include/acado/controller/controller.hpp deleted file mode 100644 index 09508c0ce1..0000000000 --- a/phonelibs/acado/include/acado/controller/controller.hpp +++ /dev/null @@ -1,446 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/controller/controller.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_CONTROLLER_HPP -#define ACADO_TOOLKIT_CONTROLLER_HPP - - -#include -#include - -#include - -#include -#include -#include -#include - - - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Calculates the control inputs of the Process based on the Process outputs. - * - * \ingroup UserInterfaces - * - * The class Controller is one of the two main building-blocks within the - * SimulationEnvironment and complements the Process. It contains an - * online control law (e.g. a DynamicFeedbackLaw comprising a RealTimeAlgorithm) - * for obtaining the control inputs of the Process. - * - * A state/parameter estimator as well as a ReferenceTrajectory can optionally be - * used to provide estimated quantities and a reference values to the control law. - * The reference trajectory can either be specified beforehand as member of the - * Controller or, alternatively, provided at each step in order to allow for - * reference trajectories that can be adapted online. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class Controller : public SimulationBlock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. - */ - Controller( ); - - /** Constructor which takes a control law, an estimator and a - * reference trajectory for computing the control/parameter signals. - * - * @param[in] _controlLaw Control law to be used for computing the control/parameter signals. - * @param[in] _estimator Estimator for estimating quantities required by the control law based on the process output. - * @param[in] _referenceTrajectory Reference trajectory to be used by the control law. - */ - Controller( ControlLaw& _controlLaw, - Estimator& _estimator, - ReferenceTrajectory& _referenceTrajectory = emptyReferenceTrajectory - ); - - /** Constructor which takes a control law and a reference trajectory - * for computing the control/parameter signals. - * - * @param[in] _controlLaw Control law to be used for computing the control/parameter signals. - * @param[in] _referenceTrajectory Reference trajectory to be used by the control law. - */ - Controller( ControlLaw& _controlLaw, - ReferenceTrajectory& _referenceTrajectory = emptyReferenceTrajectory - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - Controller( const Controller& rhs - ); - - /** Destructor. - */ - virtual ~Controller( ); - - /** Assignment operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - Controller& operator=( const Controller& rhs - ); - - - /** Assigns new control law to be used for computing control/parameter signals. - * - * @param[in] _controlLaw New control law. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setControlLaw( ControlLaw& _controlLaw - ); - - /** Assigns new estimator for estimating quantities required by the control law - * based on the process output. - * - * @param[in] _estimator New estimator. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setEstimator( Estimator& _estimator - ); - - /** Assigns new reference trajectory to be used by the control law. - * - * @param[in] _referenceTrajectory New reference trajectory. - * - * \return SUCCESSFUL_RETURN - */ - returnValue setReferenceTrajectory( ReferenceTrajectory& _referenceTrajectory - ); - - - /** Initializes algebraic states of the control law. - * - * @param[in] _xa_init Initial value for algebraic states. - * - * \return SUCCESSFUL_RETURN - */ - returnValue initializeAlgebraicStates( const VariablesGrid& _xa_init - ); - - /** Initializes algebraic states of the control law from data file. - * - * @param[in] fileName Name of file containing initial value for algebraic states. - * - * \return SUCCESSFUL_RETURN, \n - * RET_FILE_CAN_NOT_BE_OPENED - */ - returnValue initializeAlgebraicStates( const char* fileName - ); - - - /** Initializes the controller with given start values and - * performs a number of consistency checks. - * - * @param[in] _startTime Start time. - * @param[in] _x0 Initial value for differential states. - * @param[in] _p Initial value for parameters. - * @param[in] _yRef Initial value for reference trajectory. - * - * \note If a non-empty reference trajectory is provided, this one is used - * instead of the possibly set-up build-in one. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CONTROLLER_INIT_FAILED, \n - * RET_NO_CONTROLLAW_SPECIFIED, \n - * RET_BLOCK_DIMENSION_MISMATCH - */ - virtual returnValue init( double startTime = 0.0, - const DVector& _x0 = emptyConstVector, - const DVector& _p = emptyConstVector, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - - /** Performs next step of the contoller based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _y Most recent process output. - * @param[in] _yRef Current piece of reference trajectory or piece of reference trajectory for next step (required for hotstarting). - * - * \note If a non-empty reference trajectory is provided, this one is used - * instead of the possibly set-up build-in one. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_CONTROLLER_STEP_FAILED, \n - * RET_NO_CONTROLLAW_SPECIFIED - */ - virtual returnValue step( double currentTime, - const DVector& _y, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - /** Performs next step of the contoller based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] dim Dimension of process output. - * @param[in] _y Most recent process output. - * @param[in] _yRef Current piece of reference trajectory or piece of reference trajectory for next step (required for hotstarting). - * - * \note If a non-empty reference trajectory is provided, this one is used - * instead of the possibly set-up build-in one. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_CONTROLLER_STEP_FAILED, \n - * RET_NO_CONTROLLAW_SPECIFIED - */ - virtual returnValue step( double currentTime, - uint dim, - const double* const _y, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - /** Performs next feedback step of the contoller based on given inputs. - * - * @param[in] currentTime Current time. - * @param[in] _y Most recent process output. - * @param[in] _yRef Current piece of reference trajectory (if not specified during previous preparationStep). - * - * \note If a non-empty reference trajectory is provided, this one is used - * instead of the possibly set-up build-in one. - * - * \return SUCCESSFUL_RETURN, \n - * RET_BLOCK_NOT_READY, \n - * RET_CONTROLLER_STEP_FAILED, \n - * RET_NO_CONTROLLAW_SPECIFIED - */ - virtual returnValue feedbackStep( double currentTime, - const DVector& _y, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - /** Performs next preparation step of the contoller based on given inputs. - * - * @param[in] nextTime Time at next step. - * @param[in] _yRef Piece of reference trajectory for next step (required for hotstarting). - * - * \note If a non-empty reference trajectory is provided, this one is used - * instead of the possibly set-up build-in one. - * - * \return SUCCESSFUL_RETURN, \n - * RET_CONTROLLER_STEP_FAILED, \n - * RET_NO_CONTROLLAW_SPECIFIED - */ - virtual returnValue preparationStep( double nextTime = 0.0, - const VariablesGrid& _yRef = emptyConstVariablesGrid - ); - - virtual returnValue obtainEstimates( double currentTime, - const DVector& _y, - DVector& xEst, - DVector& pEst - ); - - - /** Returns computed control signals. - * - * @param[out] _y Computed control signals. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue getU( DVector& _u - ) const; - - /** Returns computed parameter signals. - * - * @param[out] _y Computed parameter signals. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue getP( DVector& _p - ) const; - - - /** Returns number of process outputs expected by the controller. - * - * \return Number of process outputs - */ - inline uint getNY( ) const; - - /** Returns number of control signals computed by the controller. - * - * \return Number of control signals - */ - inline uint getNU( ) const; - - /** Returns number of parameter signals computed by the controller. - * - * \return Number of parameter signals - */ - inline uint getNP( ) const; - - - /** Returns whether controller comprises a dynamic control law. - * - * \return BT_TRUE iff controller comprises a dynamic control law, \n - * BT_FALSE otherwise - */ - inline BooleanType hasDynamicControlLaw( ) const; - - /** Returns whether controller comprises a static control law. - * - * \return BT_TRUE iff controller comprises a static control law, \n - * BT_FALSE otherwise - */ - inline BooleanType hasStaticControlLaw( ) const; - - /** Returns whether controller comprises an estimator. - * - * \return BT_TRUE iff controller comprises an estimator, \n - * BT_FALSE otherwise - */ - inline BooleanType hasEstimator( ) const; - - /** Returns whether controller comprises a build-in reference trajectory. - * - * \return BT_TRUE iff controller comprises a build-in reference trajectory, \n - * BT_FALSE otherwise - */ - inline BooleanType hasReferenceTrajectory( ) const; - - - /** Returns sampling time of control law. - * - * \return Sampling time of control law. - */ - inline double getSamplingTimeControlLaw( ); - - /** Returns sampling time of estimator. - * - * \return Sampling time of estimator. - */ - inline double getSamplingTimeEstimator( ); - - - /** Determines next sampling instant of controller based on the - * sampling times of control law and estimator - * - * @param[in] currentTime Current time. - * - * \return Next sampling instant of controller. - */ - double getNextSamplingInstant( double currentTime - ); - - /** Returns previous real runtime of the controller - * (e.g. for determining computational delay). - * - * \return Previous real runtime of the controller. - */ - inline double getPreviousRealRuntime( ); - - - /** Enables the controller. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue enable( ); - - /** Disables the controller (i.e. initial values kept and no steps are performed). - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue disable( ); - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Sets-up default options. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupOptions( ); - - /** Sets-up default logging information. - * - * \return SUCCESSFUL_RETURN - */ - virtual returnValue setupLogging( ); - - - /** Returns current piece of the reference trajectory starting at given time. - * - * @param[in] tStart Start time of reference piece. - * @param[out] _yRef Current piece of the reference trajectory. - * - * \return SUCCESSFUL_RETURN, \n - * RET_INVALID_ARGUMENTS - */ - virtual returnValue getCurrentReference( double tStart, - VariablesGrid& _yRef - ) const; - - - // - // DATA MEMBERS: - // - protected: - - ControlLaw* controlLaw; /**< Control law (usually including a dynamic optimizer) to be used for computing the control/parameter signals. */ - Estimator* estimator; /**< Estimator for estimating quantities required by the control law based on the process output. */ - ReferenceTrajectory* referenceTrajectory; /**< Reference trajectory to be used by the control law. */ - - BooleanType isEnabled; /**< Flag indicating whether controller is enabled or not. */ - - RealClock controlLawClock; /**< Clock required to determine runtime of control law. */ -}; - - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_CONTROLLER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/controller/controller.ipp b/phonelibs/acado/include/acado/controller/controller.ipp deleted file mode 100644 index 742b935c55..0000000000 --- a/phonelibs/acado/include/acado/controller/controller.ipp +++ /dev/null @@ -1,174 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/controller/controller.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - - -BEGIN_NAMESPACE_ACADO - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -inline returnValue Controller::getU( DVector& _u - ) const -{ - if ( controlLaw != 0 ) - return controlLaw->getU( _u ); - else - return ACADOERROR( RET_NO_CONTROLLAW_SPECIFIED ); -} - - -inline returnValue Controller::getP( DVector& _p - ) const -{ - if ( controlLaw != 0 ) - return controlLaw->getP( _p ); - else - return ACADOERROR( RET_NO_CONTROLLAW_SPECIFIED ); -} - - - -inline uint Controller::getNY( ) const -{ - if ( estimator != 0 ) - return estimator->getNY( ); - - if ( controlLaw != 0 ) - return controlLaw->getNX( ); - - return 0; -} - - -inline uint Controller::getNU( ) const -{ - if ( controlLaw != 0 ) - return controlLaw->getNU( ); - else - return 0; -} - - -inline uint Controller::getNP( ) const -{ - if ( controlLaw != 0 ) - return controlLaw->getNP( ); - else - return 0; -} - - - -inline BooleanType Controller::hasDynamicControlLaw( ) const -{ - if ( controlLaw == 0 ) - return BT_FALSE; - - return controlLaw->isDynamic( ); -} - - -inline BooleanType Controller::hasStaticControlLaw( ) const -{ - if ( controlLaw == 0 ) - return BT_FALSE; - - return controlLaw->isStatic( ); -} - - -inline BooleanType Controller::hasEstimator( ) const -{ - if ( estimator != 0 ) - return BT_TRUE; - else - return BT_FALSE; -} - - -inline BooleanType Controller::hasReferenceTrajectory( ) const -{ - if ( referenceTrajectory != 0 ) - return BT_TRUE; - else - return BT_FALSE; -} - - - -inline double Controller::getSamplingTimeControlLaw( ) -{ - if ( controlLaw != 0 ) - return controlLaw->getSamplingTime( ); - else - return -1.0; -} - - -inline double Controller::getSamplingTimeEstimator( ) -{ - if ( estimator != 0 ) - return estimator->getSamplingTime( ); - else - return -1.0; -} - - - -inline double Controller::getPreviousRealRuntime( ) -{ - return realClock.getTime( ); -} - - -inline returnValue Controller::enable( ) -{ - isEnabled = BT_TRUE; - return SUCCESSFUL_RETURN; -} - - -inline returnValue Controller::disable( ) -{ - isEnabled = BT_FALSE; - return SUCCESSFUL_RETURN; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/curve/curve.hpp b/phonelibs/acado/include/acado/curve/curve.hpp deleted file mode 100644 index 435b97b570..0000000000 --- a/phonelibs/acado/include/acado/curve/curve.hpp +++ /dev/null @@ -1,318 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/curve/curve.hpp - * \author Boris Houska, Hans Joachim Ferreau - */ - - -#ifndef ACADO_TOOLKIT_CURVE_HPP -#define ACADO_TOOLKIT_CURVE_HPP - -#include -#include - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Allows to work with piecewise-continous function defined over a scalar time interval. - * - * \ingroup BasicDataStructures - * - * The class Curve allows to setup and evaluate piecewise-continous functions that - * are defined over a scalar time interval and map into an Vectorspace of given dimension. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class Curve{ - - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - Curve(); - - /** Copy constructor (deep copy). */ - Curve( const Curve& arg ); - - /** Destructor. */ - ~Curve( ); - - /** Assignment operator (deep copy). */ - Curve& operator=( const Curve& arg ); - - - Curve operator()( uint idx - ) const; - - /** Adds a constant piece to the curve. If other pieces of the curve have previously \n - * been added, the start time "tStart" of the time interval [tStart,tEnd] should \n - * contain the last time-point of the curve piece which has been added before. \n - * The curve is not required to be continous at the boundaries of its intervals. \n - * Note that the dimension of the constant input vector should have the same \n - * dimensions as previously added curve pieces. If no other piece has been added \n - * before, only tStart < tEnd is required, while the dimension of the curve will \n - * be set to the dimension of the vector, which is added. \n - * \n - * \param tStart start of the time interval of the curve piece to be added. \n - * \param tEnd end of the time interval to be added. \n - * \param constant the constant value of the curve on the interval [tStart,tEnd]. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_TIME_INTERVAL_NOT_VALID \n - * RET_INPUT_DIMENSION_MISMATCH \n - */ - returnValue add( double tStart, - double tEnd, - const DVector constant ); - - - /** Adds new curve pieces, which are given in a sampled form (VariablesGrid). In \n - * order to store the curve pieces as continous functions the sampled data will be \n - * interpolated depending on an interpolation mode. Note that the number of \n - * intervals, which are added, will depend on this interpolation mode. The default \n - * interpolation mode is "IM_LINEAR", i.e. linear interpolation. In this case the \n - * number of added intervals is coinciding with the number of intervals of the \n - * VariablesGrid, which is passed. For the dimension of the variables grid as well \n - * the grid's start- and endpoint the same policy as for the other "add" functions \n - * applies, i.e. the dimension should be equal to previously added pieces and the \n - * time intervals should fit together. \n - * \n - * \param sampledData the data in sampled form to be interpolated and added. \n - * \param mode the interploation mode (default: linear interpolation) \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_TIME_INTERVAL_NOT_VALID \n - * RET_INPUT_DIMENSION_MISMATCH \n - */ - returnValue add( const VariablesGrid& sampledData, InterpolationMode mode = IM_LINEAR ); - - - /** Adds a new piece to the curve, which is defined on the time interval \n - * [tStart,tEnd] to be added. The function, which is passed as an argument of this \n - * routine, should be the parameterization of the piece of curve to be added. Note \n - * that the input function "parameterization" is only allowed to depend on the time. \n - * If the parameterization depends e.g. on DifferentialStates, Controls etc. an \n - * error message will be returned. As for the other "add" routines the dimension of \n - * function as well as the time interval should fit to the previously added curve \n - * pieces. \n - * \n - * \param tStart start of the interval to be added. \n - * \param tEnd end of the time interval to be added. \n - * \param parameterization_ the parameterization of the curve on this interval. \n - * \n - * \return SUCCESSFUL_RETURN (if successful) \n - * RET_TIME_INTERVAL_NOT_VALID (if the time interval is not valid) \n - * RET_INPUT_DIMENSION_MISMATCH (if the dimension or dependencies are wrong) \n - */ - returnValue add( double tStart, - double tEnd, - const Function& parameterization_ ); - - - /** Returns the dimension of the curve. Please note that this routine will return \n - * -1 for the case that the curve is empty (cf. the routine isEmpty() ). \n - * \n - * \return the dimension of the curve or -1. \n - */ - inline int getDim( ) const; - - - /** Returns whether the curve is empty. \n - * \n - * \return BT_TRUE if the curve is empty. \n - * BT_FALSE otherwise. \n - */ - inline BooleanType isEmpty( ) const; - - - - /** Returns whether the curve is continous. \n - * \n - * \return BT_TRUE if the curve is continous. \n - * BT_FALSE otherwise. \n - */ - inline BooleanType isContinuous( ) const; - - - - /** Returns the number of intervals, on which the pieces of the curve \n - * are defined. \n - * \n - * \return the number if intervals. \n - */ - inline int getNumIntervals( ) const; - - - - /** Evaluates the curve at a given time point. This routine will store \n - * the result of the evaluation into the double *result. Note that \n - * this double pointer must be allocated by the user. Otherwise, \n - * segmentation faults might occur, which can not be prevented by \n - * this routine. For not time critical operations it is recommended to \n - * use the routine \n - * \n - * evaluate( const double t, const DVector &result ) \n - * \n - * instead, which will throw an error if a dimension mismatch occurs. \n - * However, the routine based on double* is slightly more efficient. \n - * In order to make the allocation correct, use the routines isEmpty() \n - * and getDim() first to obtain (or check) the dimension. \n - * \n - * \param t (input) the time at which the curve should be evaluated. \n - * \param result (output) the result of the evaluation. \n - * \n - * \n - * \return SUCCESSFUL_RETURN (if the evaluation was successful.) \n - * RET_INVALID_ARGUMENTS (if the double* result is NULL.) \n - * RET_INVALID_TIME_POINT (if the time point t is out of range.) \n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty) \n - */ - returnValue evaluate( double t, double *result ) const; - - - /** Evaluates the curve at a given time point. This routine will store \n - * the result of the evaluation into the DVector &result. \n - * \n - * \param t (input) the time at which the curve should be evaluated. \n - * \param result (output) the result of the evaluation. \n - * \n - * \n - * \return SUCCESSFUL_RETURN (if the evaluation was successful.) \n - * RET_INVALID_TIME_POINT (if the time point t is out of domain.)\n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty) \n - */ - returnValue evaluate( double t, DVector &result ) const; - - - /** Evaluates the curve at a given time interval. This routine will store \n - * the result of the evaluation into the VariablesGrid &result. \n - * Returns as entries in result exactly those nodes of the curve for which the \n - * node times are contained in the interval [tStart,tEnd] \n - * \n - * No interpolation is used. \n - * \n - * \param tStart (input) the start time at which the curve should be evaluated. \n - * \param tEnd (input) the end time at which the curve should be evaluated. \n - * \param result (output) the result of the evaluation. \n - * \n - * \n - * \return SUCCESSFUL_RETURN (if the evaluation was successful.) \n - * RET_INVALID_TIME_POINT (if the time point t is out of domain.)\n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty) \n - */ - - returnValue evaluate( double tStart, double tEnd, VariablesGrid &result ) const; - - - - /** Evaluates the curve at specified grid points and stores the result in form of a \n - * VariablesGrid. Note that all time points of the grid, at which the curve should be \n - * evaluated, must be contained in the domain of the curve. This domain can be \n - * obtained with the routine "getTimeDomain( double tStart, double tEnd )". \n - * \n - * \param discretizationGrid (input) the grid points at which the curve should be evaluated. \n - * \param result (output) the result of the evaluation. \n - * \n - * \n - * \return SUCCESSFUL_RETURN (if the evaluation was successful.) \n - * RET_INVALID_TIME_POINT (if at least one of the grid points is out of domain.) \n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty) \n - */ - returnValue discretize( const Grid &discretizationGrid, VariablesGrid &result ) const; - - - - /** Returns the time domain of the curve, i.e. the time points tStart and tEnd between \n - * which the curve is defined. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty.) \n - */ - returnValue getTimeDomain( double tStart, double tEnd ) const; - - - /** Returns the time domain of a piece of the curve, i.e. the interrval [tStart,tEnd] on \n - * which the piece with number "idx" is defined. \n - * \n - * \param idx (input) the index of the curve piece for which the time domain is needed. \n - * \param tStart (output) the start time of the requested interval. \n - * \param tEnd (output) the end time of the requested interval. \n - * \n - * \return SUCCESSFUL_RETURN (if the domain is successfully returned.) \n - * RET_INDEX_OUT_OF_BOUNDS (if the index "idx" is larger than getNumIntervals())\n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty.) \n - */ - returnValue getTimeDomain( const uint &idx, double tStart, double tEnd ) const; - - - - /** Returns the time domain of the curve, i.e. the time points tStart and tEnd between \n - * which the curve is defined. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_MEMBER_NOT_INITIALISED (if the curve is empty.) \n - */ - BooleanType isInTimeDomain( double t - ) const; - - - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - // - // DATA MEMBERS: - // - protected: - - uint nIntervals ; // number of intervals of the curve. - uint dim ; // the dimension of the curve. - Function **parameterization; // the parameterizations of the curve pieces - Grid *grid ; // the grid points associated with the intervals of the curve. -}; - - -CLOSE_NAMESPACE_ACADO - - -#include - - -#endif // ACADO_TOOLKIT_CURVE_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/curve/curve.ipp b/phonelibs/acado/include/acado/curve/curve.ipp deleted file mode 100644 index 2f8d5f34d3..0000000000 --- a/phonelibs/acado/include/acado/curve/curve.ipp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/curve/curve.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 31.05.2008 - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - -inline int Curve::getDim( ) const{ - - if( isEmpty() == BT_TRUE ) return 0; - return dim; -} - - -inline BooleanType Curve::isEmpty( ) const{ - - if( getNumIntervals() == 0 ) return BT_TRUE; - return BT_FALSE; -} - - -inline BooleanType Curve::isContinuous( ) const{ - - ASSERT( isEmpty() == BT_FALSE ); - - ACADOERROR(RET_NOT_IMPLEMENTED_YET); - ASSERT( 1 == 0 ); - - return BT_TRUE; -} - - - -inline int Curve::getNumIntervals() const{ - - return nIntervals; -} - - - -CLOSE_NAMESPACE_ACADO - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.hpp b/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.hpp deleted file mode 100644 index 815905f174..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/collocation_algorithm.hpp - * \author Boris Houska, Hans Joachim Ferreau - */ - - -#ifndef ACADO_TOOLKIT_COLLOCATION_METHOD_HPP -#define ACADO_TOOLKIT_COLLOCATION_METHOD_HPP - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Discretizes a DifferentialEquation by means of a collocation scheme. - * - * \ingroup NumericalAlgorithms - * - * The class CollocationMethod allows to discretize a DifferentialEquation - * for use in optimal control algorithms by means of a collocation scheme. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class CollocationMethod : public DynamicDiscretization -{ - -// -// PUBLIC MEMBER FUNCTIONS: -// - -public: - - /** Default constructor. */ - CollocationMethod(); - - CollocationMethod( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - CollocationMethod( const CollocationMethod& rhs ); - - /** Destructor. */ - virtual ~CollocationMethod( ); - - /** Assignment operator (deep copy). */ - CollocationMethod& operator=( const CollocationMethod& rhs ); - - /** Clone constructor (deep copy). */ - virtual DynamicDiscretization* clone() const; - - - - /** Set the Differential Equations stage by stage. */ - virtual returnValue addStage( const DynamicSystem &dynamicSystem_, - const Grid &stageIntervals, - const IntegratorType &integratorType_ = INT_UNKNOWN ); - - /** Set the Transition stages. */ - virtual returnValue addTransition( const Transition& transition_ ); - - - /** Deletes all stages and transitions and resets the DynamicDiscretization. */ - virtual returnValue clear(); - - - - /** Evaluates the descretized DifferentialEquation at a specified \n - * VariablesGrid. The results are written into the residuum of the \n - * type VariablesGrid. This routine is for a simple evaluation only. \n - * If sensitivities are needed use one of the routines below \n - * instead. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INVALID_ARGUMENTS \n - * or a specific error message form an underlying \n - * discretization instance. \n - */ - virtual returnValue evaluate( OCPiterate &iter ); - - - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( ); - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivitiesLifted( ); - - - /** Evaluates the sensitivities and the hessian. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( const BlockMatrix &seed, BlockMatrix &hessian ); - - - virtual BooleanType isAffine( ) const; - - - - virtual returnValue unfreeze( ); - virtual returnValue deleteAllSeeds(); - - -protected: - - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_COLLOCATION_METHOD_HPP - -// end of file - diff --git a/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.ipp b/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.ipp deleted file mode 100644 index 0fd982a7cf..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/collocation_method.ipp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/collocation_method.ipp - * \author Hans Joachim Ferreau, Boris Houska - * - */ - - - -BEGIN_NAMESPACE_ACADO - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.hpp b/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.hpp deleted file mode 100644 index 019e71297a..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.hpp +++ /dev/null @@ -1,319 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/dynamic_discretization.hpp - * \author Boris Houska, Hans Joachim Ferreau - */ - - -#ifndef ACADO_TOOLKIT_DYNAMIC_DISCRETIZATION_HPP -#define ACADO_TOOLKIT_DYNAMIC_DISCRETIZATION_HPP - - -#include -#include - -#include -#include -#include -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for discretizing a DifferentialEquation for use in optimal control algorithms. - * - * \ingroup NumericalAlgorithms - * - * The class DynamicDiscretization serves as a base class for discretizing - * a DifferentialEquation for use in optimal control algorithms. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class DynamicDiscretization : public AlgorithmicBase -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - - public: - - /** Default constructor. */ - DynamicDiscretization( ); - - DynamicDiscretization( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - DynamicDiscretization( const DynamicDiscretization& rhs ); - - /** Destructor. */ - virtual ~DynamicDiscretization( ); - - /** Assignment operator (deep copy). */ - DynamicDiscretization& operator=( const DynamicDiscretization& rhs ); - - /** Clone constructor (deep copy). */ - virtual DynamicDiscretization* clone() const = 0; - - - - /** Set the Differential Equations stage by stage. */ - virtual returnValue addStage( const DynamicSystem &dynamicSystem_, - const Grid &stageIntervals, - const IntegratorType &integratorType_ = INT_UNKNOWN ) = 0; - - /** Set the Transition stages. */ - virtual returnValue addTransition( const Transition& transition_ ) = 0; - - - /** Deletes all stages and transitions and resets the DynamicDiscretization. */ - virtual returnValue clear() = 0; - - - - /** Define a forward seed in form of a block matrix. \n - * Here, the block matrix should have N block rows, \n - * where N is the number of points of the union grid. \n - * The i-th row is associated with the i-th grid \n - * point in the union grid. Note that the direction \n - * can itself be organized in sub-blocks as long as \n - * all dimensions fit together. \n - * \n - * \return SUCCESFUL RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setForwardSeed( const BlockMatrix &xSeed_, /**< the seed in x-direction */ - const BlockMatrix &pSeed_, /**< the seed in p-direction */ - const BlockMatrix &uSeed_, /**< the seed in u-direction */ - const BlockMatrix &wSeed_ /**< the seed in w-direction */ ); - - - /** Defines the first order forward seed to be \n - * the unit-directions matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setUnitForwardSeed(); - - - - /** Define a backward seed in form of a block matrix. \n - * Here, the block matrix should have N block columns, \n - * where N is the number of points of the union grid. \n - * The i-th column is associated with the i-th grid \n - * point in the union grid. Note that the directions \n - * can itself be organized in sub-blocks as long as \n - * all dimensions fit together. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setBackwardSeed( const BlockMatrix &seed /**< the seed matrix */ ); - - - - /** Defines the first order backward seed to be \n - * a unit matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue setUnitBackwardSeed(); - - - - /** Deletes all seeds that have been set with the methods above. \n - * This function will also give the corresponding memory free. \n - * \return SUCCESSFUL_RETURN \n - * RET_NO_SEED_ALLOCATED \n - */ - virtual returnValue deleteAllSeeds(); - - - - /** Evaluates the descretized DifferentialEquation at a specified \n - * VariablesGrid. The results are written into the residuum of the \n - * type VariablesGrid. This routine is for a simple evaluation only. \n - * If sensitivities are needed use one of the routines below \n - * instead. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INVALID_ARGUMENTS \n - * or a specific error message form an underlying \n - * discretization instance. \n - */ - virtual returnValue evaluate( OCPiterate &iter ) = 0; - - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( ) = 0; - - - - /** Evaluates the sensitivities and the hessian. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( const BlockMatrix &seed, BlockMatrix &hessian ) = 0; - - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivitiesLifted( ) = 0; - - - - - /** Returns the result for the residuum. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - virtual returnValue getResiduum( BlockMatrix &residuum_ /**< the residuum */ ) const; - - - - /** Returns the result for the forward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getForwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */ ) const; - - - - /** Returns the result for the backward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - virtual returnValue getBackwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */ ) const; - - - - /**< Returns the total number of intervals. */ - inline int getNumberOfIntervals( ) const; - - - - virtual BooleanType isAffine( ) const = 0; - - - virtual returnValue unfreeze( ) = 0; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - - protected: - virtual returnValue setupOptions( ); - virtual returnValue setupLogging( ); - - void copy( const DynamicDiscretization& rhs ); - void initializeVariables(); - - uint getNumEvaluationPoints() const; - - - // - // PROTECTED MEMBERS: - // - - protected: - - Grid unionGrid ; /**< the union grids on the stages */ - int N ; /**< total number of grid points */ - PrintLevel printLevel ; /**< the print level */ - BooleanType freezeTraj ; /**< whether the trajectory should be frozen */ - - - // DIMENSIONS: - // ----------- - int nx; - int na; - int np; - int nu; - int nw; - - - // INPUT STORAGE: - // ------------------------ - BlockMatrix xSeed ; /**< the 1st order forward seed in x-direction */ - BlockMatrix pSeed ; /**< the 1st order forward seed in p-direction */ - BlockMatrix uSeed ; /**< the 1st order forward seed in u-direction */ - BlockMatrix wSeed ; /**< the 1st order forward seed in w-direction */ - - BlockMatrix bSeed ; /**< the 1st order backward seed */ - - - // RESULTS: - // ------------------------ - VariablesGrid residuum ; /**< the residuum vectors */ - BlockMatrix dForward ; /**< the first order forward derivatives */ - BlockMatrix dBackward; /**< the first order backward derivatives */ - -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - -//#include -//#include -//#include -#include -#include - - -#endif // ACADO_TOOLKIT_DYNAMIC_DISCRETIZATION_HPP - - -// end of file diff --git a/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.ipp b/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.ipp deleted file mode 100644 index 644982315d..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/dynamic_discretization.ipp +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/dynamic_discretization.ipp - * \author Hans Joachim Ferreau, Boris Houska - * - */ - - - -BEGIN_NAMESPACE_ACADO - - -// PUBLIC INLINE ROUTINES: -// ----------------------- - -inline int DynamicDiscretization::getNumberOfIntervals() const{ - - return N; -} - - - -// PROTECTED INLINE ROUTINES: -// -------------------------- - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/dynamic_discretization/integration_algorithm.hpp b/phonelibs/acado/include/acado/dynamic_discretization/integration_algorithm.hpp deleted file mode 100644 index 1712158db2..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/integration_algorithm.hpp +++ /dev/null @@ -1,393 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/integration_algorithm.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - -#ifndef ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP -#define ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP - - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief User-interface to integrate a DynamicSystem, possibly over multiple stages. - * - * \ingroup UserInterfaces - * - * The class IntegrationAlgorithm serves as a user-interface to integrate - * a DynamicSystem, possibly over multiple stages. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class IntegrationAlgorithm : public UserInteraction -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - IntegrationAlgorithm( ); - - /** Copy constructor (deep copy). */ - IntegrationAlgorithm( const IntegrationAlgorithm& rhs ); - - /** Destructor. */ - virtual ~IntegrationAlgorithm( ); - - /** Assignment operator (deep copy). */ - IntegrationAlgorithm& operator=( const IntegrationAlgorithm& rhs ); - - - /** Set the Differential Equations stage by stage. */ - virtual returnValue addStage( const DynamicSystem &dynamicSystem_, - const Grid &stageIntervals, - const IntegratorType &integratorType_ = INT_UNKNOWN ); - - /** Set the Transition stages. */ - virtual returnValue addTransition( const Transition& transition_ ); - - - /** Deletes all stages and transitions and resets the DynamicDiscretization. */ - virtual returnValue clear(); - - - /** Evaluates the descretized DifferentialEquation at a specified \n - * VariablesGrid. The results are written into the residuum of the \n - * type VariablesGrid. This routine is for a simple evaluation only. \n - * If sensitivities are needed use one of the routines below \n - * instead. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INVALID_ARGUMENTS \n - * or a specific error message form an underlying \n - * discretization instance. \n - */ - returnValue evaluate( VariablesGrid *x , /**< differential states */ - VariablesGrid *xa, /**< algebraic states */ - VariablesGrid *p , /**< parameters */ - VariablesGrid *u , /**< controls */ - VariablesGrid *w /**< disturbances */ - ); - - returnValue evaluate( OCPiterate& _iter ); - - returnValue integrate( VariablesGrid *x , /**< differential states */ - VariablesGrid *xa, /**< algebraic states */ - VariablesGrid *p , /**< parameters */ - VariablesGrid *u , /**< controls */ - VariablesGrid *w /**< disturbances */ - ); - - - /** Starts the integration of the right hand side at time t0. \n - * If neither the maximum number of allowed iteration is \n - * exceeded nor any other error occurs the functions stops the \n - * integration at time tend. \n - * \return SUCCESFUL_RETURN or \n - * a error message that depends on the specific \n - * integration routine. (cf. the corresponding header \n - * file that implements the integration routine) \n - */ - returnValue integrate( double t0 /**< the start time */, - double tend /**< the end time */, - const DVector &x0 /**< the initial state */, - const DVector &xa = emptyVector /**< the initial algebraic state */, - const DVector &p = emptyVector /**< the parameters */, - const DVector &u = emptyVector /**< the controls */, - const DVector &w = emptyVector /**< the disturbance */ - ); - - /** Starts the integration of the right hand side at time t0. \n - * If neither the maximum number of allowed iteration is \n - * exceeded nor any other error occurs the functions stops the \n - * integration at time tend. \n - * In addition, results at intermediate grid points can be \n - * stored. Note that these grid points are for storage only and \n - * have nothing to do the integrator steps. \n - * \n - * \return SUCCESFUL_RETURN or \n - * a error message that depends on the specific \n - * integration routine. (cf. the corresponding header \n - * file that implements the integration routine) \n - */ - returnValue integrate( const Grid &t /**< the grid [t0,tend] */, - const DVector &x0 /**< the initial state */, - const DVector &xa = emptyVector /**< the initial algebraic state */, - const DVector &p = emptyVector /**< the parameters */, - const DVector &u = emptyVector /**< the controls */, - const DVector &w = emptyVector /**< the disturbance */ - ); - - - /** Define a forward seed in form of a block matrix. \n - * Here, the block matrix should have N block rows, \n - * where N is the number of points of the union grid. \n - * The i-th row is associated with the i-th grid \n - * point in the union grid. Note that the direction \n - * can itself be organized in sub-blocks as long as \n - * all dimensions fit together. \n - * \n - * \return SUCCESFUL RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setForwardSeed( const BlockMatrix &xSeed_, /**< the seed in x-direction */ - const BlockMatrix &pSeed_ = emptyBlockMatrix, /**< the seed in p-direction */ - const BlockMatrix &uSeed_ = emptyBlockMatrix, /**< the seed in u-direction */ - const BlockMatrix &wSeed_ = emptyBlockMatrix /**< the seed in w-direction */ ); - - /** Define a forward seed matrix. \n - * \return SUCCESFUL RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setForwardSeed( const DVector &xSeed /**< the seed w.r.t states */, - const DVector &pSeed = emptyVector /**< the seed w.r.t parameters */, - const DVector &uSeed = emptyVector /**< the seed w.r.t controls */, - const DVector &wSeed = emptyVector /**< the seed w.r.t disturbances */ ); - - - /** Defines the first order forward seed to be \n - * the unit-directions matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setUnitForwardSeed(); - - - - /** Define a backward seed in form of a block matrix. \n - * Here, the block matrix should have N block columns, \n - * where N is the number of points of the union grid. \n - * The i-th column is associated with the i-th grid \n - * point in the union grid. Note that the directions \n - * can itself be organized in sub-blocks as long as \n - * all dimensions fit together. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setBackwardSeed( const BlockMatrix &seed /**< the seed matrix */ ); - - /** Define a backward seed \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setBackwardSeed( const DVector &seed /**< the backward seed */ ); - - /** Defines the first order backward seed to be \n - * a unit matrix. \n - * \n - * \return SUCCESFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue setUnitBackwardSeed(); - - - - /** Deletes all seeds that have been set with the methods above. \n - * This function will also give the corresponding memory free. \n - * \return SUCCESSFUL_RETURN \n - * RET_NO_SEED_ALLOCATED \n - */ - returnValue deleteAllSeeds(); - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - returnValue evaluateSensitivities( ); - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - returnValue integrateSensitivities( ); - - /** Evaluates the sensitivities and the hessian. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - returnValue evaluateSensitivities( const BlockMatrix &seed, - BlockMatrix &hessian - ); - - /** Evaluates the sensitivities and the hessian. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - returnValue integrateSensitivities( const BlockMatrix &seed, - BlockMatrix &hessian - ); - - - returnValue unfreeze( ); - - - BooleanType isAffine( ) const; - - - /** Returns the result for the differential states at - * time tend. - * - * \param xEnd the result for the states at time tend. - * - * \return SUCCESSFUL_RETURN - */ - returnValue getX( DVector& xEnd - ) const; - - /** Returns the result for the algebraic states at - * time tend. - * - * \param xaEnd the result for the algebraic states at time tend. - * - * \return SUCCESSFUL_RETURN - */ - returnValue getXA( DVector& xaEnd - ) const; - - /** Returns the requested output on the specified grid. Note \n - * that the output X will be evaluated based on polynomial \n - * interpolation depending on the order of the integrator. \n - * \n - * \param X the differential states on the grid. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_TRAJECTORY_NOT_FROZEN \n - */ - returnValue getX( VariablesGrid& X - ) const; - - - /** Returns the requested output on the specified grid. Note \n - * that the output X will be evaluated based on polynomial \n - * interpolation depending on the order of the integrator. \n - * \n - * \param XA the algebraic states on the grid. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_TRAJECTORY_NOT_FROZEN \n - */ - returnValue getXA( VariablesGrid& XA - ) const; - - - /** Returns the result for the forward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue getForwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */ - ) const; - - /** Returns the result for the forward sensitivities at the time tend. \n - * \n - * \param Dx the result for the forward sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue getForwardSensitivities( DVector &Dx - ) const; - - - /** Returns the result for the backward sensitivities in BlockMatrix form. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue getBackwardSensitivities( BlockMatrix &D /**< the result for the - * forward sensitivi- - * ties */ - ) const; - - /** Returns the result for the backward sensitivities at the time tend. \n - * \n - * \param Dx_x0 backward sensitivities w.r.t. the initial states \n - * \param Dx_p backward sensitivities w.r.t. the parameters \n - * \param Dx_u backward sensitivities w.r.t. the controls \n - * \param Dx_w backward sensitivities w.r.t. the disturbance \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INPUT_OUT_OF_RANGE \n - */ - returnValue getBackwardSensitivities( DVector &Dx_x0, - DVector &Dx_p = emptyVector, - DVector &Dx_u = emptyVector, - DVector &Dx_w = emptyVector - ) const; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - - protected: - - virtual returnValue setupOptions( ); - virtual returnValue setupLogging( ); - - - // - // PROTECTED MEMBERS: - // - - protected: - - ShootingMethod* integrationMethod; - OCPiterate iter; -}; - - -CLOSE_NAMESPACE_ACADO - - -//#include - - -#endif // ACADO_TOOLKIT_INTEGRATION_ALGORITHM_HPP - -// end of file diff --git a/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.hpp b/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.hpp deleted file mode 100644 index b31050e3a9..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.hpp +++ /dev/null @@ -1,228 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/shooting_method.hpp - * \author Boris Houska, Hans Joachim Ferreau - * - */ - -#ifndef ACADO_TOOLKIT_SHOOTING_METHOD_HPP -#define ACADO_TOOLKIT_SHOOTING_METHOD_HPP - - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Discretizes a DifferentialEquation by means of single or multiple shooting. - * - * \ingroup NumericalAlgorithms - * - * The class ShootingMethod allows to discretize a DifferentialEquation - * for use in optimal control algorithms by means of an (online) integrator - * using either single or multiple shooting. - * - * \author Boris Houska, Hans Joachim Ferreau - */ -class ShootingMethod : public DynamicDiscretization -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /** Default constructor. */ - ShootingMethod(); - - ShootingMethod( UserInteraction* _userInteraction - ); - - /** Copy constructor (deep copy). */ - ShootingMethod( const ShootingMethod& rhs ); - - /** Destructor. */ - virtual ~ShootingMethod( ); - - /** Assignment operator (deep copy). */ - ShootingMethod& operator=( const ShootingMethod& rhs ); - - /** Clone constructor (deep copy). */ - virtual DynamicDiscretization* clone() const; - - - /** Set the Differential Equations stage by stage. */ - virtual returnValue addStage( const DynamicSystem &dynamicSystem_, - const Grid &stageIntervals, - const IntegratorType &integratorType_ = INT_UNKNOWN ); - - /** Set the Transition stages. */ - virtual returnValue addTransition( const Transition& transition_ ); - - - /** Deletes all stages and transitions and resets the DynamicDiscretization. */ - virtual returnValue clear(); - - - - /** Evaluates the discretized DifferentialEquation at a specified \n - * VariablesGrid. The results are written into the residuum of the \n - * type VariablesGrid. This routine is for a simple evaluation only. \n - * If sensitivities are needed use one of the routines below \n - * instead. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_INVALID_ARGUMENTS \n - * or a specific error message form an underlying \n - * discretization instance. \n - */ - virtual returnValue evaluate( OCPiterate &iter - ); - - - /** Deletes all seeds that have been set with the methods above. \n - * This function will also give the corresponding memory free. \n - * \return SUCCESSFUL_RETURN \n - * RET_NO_SEED_ALLOCATED \n - */ - virtual returnValue deleteAllSeeds( ); - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( ); - - - /** Evaluates the sensitivities. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivitiesLifted( ); - - - /** Evaluates the sensitivities and the hessian. \n - * \n - * \return SUCCESSFUL_RETURN \n - * RET_NOT_FROZEN \n - */ - virtual returnValue evaluateSensitivities( const BlockMatrix &seed, - BlockMatrix &hessian - ); - - - virtual returnValue unfreeze( ); - - - virtual BooleanType isAffine( ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - - protected: - - returnValue deleteAll( ); - - void copy( const ShootingMethod &arg ); - - returnValue allocateIntegrator( uint idx, IntegratorType type_ ); - - - returnValue differentiateBackward( const int &idx , - const DMatrix &seed, - DMatrix &Gx , - DMatrix &Gp , - DMatrix &Gu , - DMatrix &Gw ); - - returnValue differentiateForward( const int &idx, - const DMatrix &dX , - const DMatrix &dP , - const DMatrix &dU , - const DMatrix &dW , - DMatrix &D ); - - - returnValue differentiateForwardBackward( const int &idx , - const DMatrix &dX , - const DMatrix &dP , - const DMatrix &dU , - const DMatrix &dW , - const DMatrix &seed, - DMatrix &D , - DMatrix &ddX , - DMatrix &ddP , - DMatrix &ddU , - DMatrix &ddW ); - - - returnValue update( DMatrix &G, const DMatrix &A, const DMatrix &B ); - - - /**< Writes the continous integrator output to the logging object, if this \n - * is requested. Please note, that this routine converts the VariablesGrids \n - * from the integration routine into a large matrix. Consequently, the break \n - * points need to be logged, too. \n - * \n - * \return SUCCESSFUL_RETURN \n - */ - returnValue logTrajectory( const OCPiterate &iter ); - - returnValue rescale( VariablesGrid* trajectory, - double tEndNew, - double newIntervalLength - ) const; - - // - // PROTECTED MEMBERS: - // - - protected: - - Integrator **integrator; - DMatrix breakPoints; -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_SHOOTING_METHOD_HPP - -// end of file diff --git a/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.ipp b/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.ipp deleted file mode 100644 index 594c34d177..0000000000 --- a/phonelibs/acado/include/acado/dynamic_discretization/shooting_method.ipp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - - -/** - * \file include/acado/dynamic_discretization/shooting_method.ipp - * \author Hans Joachim Ferreau, Boris Houska - * - */ - - - -BEGIN_NAMESPACE_ACADO - - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/dynamic_system/dynamic_system.hpp b/phonelibs/acado/include/acado/dynamic_system/dynamic_system.hpp deleted file mode 100644 index 03f8f4e582..0000000000 --- a/phonelibs/acado/include/acado/dynamic_system/dynamic_system.hpp +++ /dev/null @@ -1,351 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** -* \file include/acado/dynamic_system/dynamic_system.hpp -* \author Hans Joachim Ferreau, Boris Houska -*/ - - - -#ifndef ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP -#define ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP - - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Stores a DifferentialEquation together with an OutputFcn. - * - * \ingroup UserDataStructures - * - * The class DynamicSystem is a data class for storing a DifferentialEquation - * together with an OutputFcn. The dynamic system might be of hybrid nature, - * i.e. differential equation and output function might switch depending on - * a state-dependend switch function. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class DynamicSystem -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - - /**< Default Constructor. - */ - DynamicSystem( ); - - /** Constructor which takes differential equation of first stage. - * - * @param[in] _diffEqn Differential equation. - */ - DynamicSystem( const DifferentialEquation& _diffEqn - ); - - /** Constructor which takes differential equation and output function - * of first stage. - * - * @param[in] _diffEqn Differential equation. - * @param[in] _outputFcn Output function. - */ - DynamicSystem( const DifferentialEquation& _diffEqn, - const OutputFcn& _outputFcn - ); - - /** Copy constructor (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - DynamicSystem( const DynamicSystem &rhs - ); - - /** Destructor. - */ - ~DynamicSystem( ); - - /**< Assignment Operator (deep copy). - * - * @param[in] rhs Right-hand side object. - */ - DynamicSystem& operator=( const DynamicSystem& rhs - ); - - - /** Adds a new dynamic system stage comprising the given differential equation. - * - * @param[in] _diffEqn Differential equation. - * - * \return RET_NOT_YET_IMPLEMENTED, \n - * RET_INVALID_ARGUMENTS - */ - returnValue addSubsystem( const DifferentialEquation& _diffEqn - ); - - /** Adds a new dynamic system stage comprising the given differential equation - * and output function. - * - * @param[in] _diffEqn Differential equation. - * @param[in] _outputFcn Output function. - * - * \return RET_NOT_YET_IMPLEMENTED, \n - * RET_INVALID_ARGUMENTS - */ - returnValue addSubsystem( const DifferentialEquation& _diffEqn, - const OutputFcn& _outputFcn - ); - - - /** (not yet documented) - * - * @param[in] _switchFcn . - * - * \return RET_NOT_YET_IMPLEMENTED - */ - returnValue addSwitchFunction( const Function& _switchFcn - ); - - /** (not yet documented) - * - * @param[in] _selectFcn . - * - * \return RET_NOT_YET_IMPLEMENTED - */ - returnValue setSelectFunction( const Function& _selectFcn - ); - - - /** Returns dynamic subsystem at given stage. - * - * @param[in] stageIdx Index of stage. - * @param[out] _diffEqn Differential equation at given stage. - * @param[out] _outputFcn Output function at given stage. - * - * \return SUCCESSFUL_RETURN - */ - inline returnValue getSubsystem( uint stageIdx, - DifferentialEquation& _diffEqn, - OutputFcn& _outputFcn - ) const; - - /** Returns differential equation at given stage. - * - * @param[in] stageIdx Index of stage. - * - * \return Differential equation at given stage - */ - inline const DifferentialEquation& getDifferentialEquation( uint stageIdx = 0 - ) const; - - /** Returns output function at given stage. - * - * @param[in] stageIdx Index of stage. - * - * \return Output function at given stage - */ - inline const OutputFcn& getOutputFcn( uint stageIdx = 0 - ) const; - - /** (not yet documented) - * - * @param[in] _switchFcn . - * - * \return RET_NOT_YET_IMPLEMENTED - */ - inline returnValue getSwitchFunction( uint idx, - Function& _switchFcn - ) const; - - /** (not yet documented) - * - * @param[in] _selectFcn . - * - * \return RET_NOT_YET_IMPLEMENTED - */ - inline returnValue getSelectFunction( Function& _selectFcn - ) const; - - - /** Returns whether dynamic system is an ODE. - * - * \return BT_TRUE iff dynamic system is an ODE, \n - * BT_FALSE otherwise - */ - inline BooleanType isODE( ) const; - - /** Returns whether dynamic system is a DAE. - * - * \return BT_TRUE iff dynamic system is a DAE, \n - * BT_FALSE otherwise - */ - inline BooleanType isDAE( ) const; - - - /** Returns whether dynamic system is discretized in time. - * - * \return BT_TRUE iff dynamic system is discretized in time, \n - * BT_FALSE otherwise - */ - inline BooleanType isDiscretized( ) const; - - /** Returns whether dynamic system is continuous in time. - * - * \return BT_TRUE iff dynamic system is continuous in time, \n - * BT_FALSE otherwise - */ - inline BooleanType isContinuous( ) const; - - /** Returns sample time of the dynamic system. - * - * \return > 0: sample time of discretized system, \n - * -INFTY: system is time-continuous - */ - inline double getSampleTime( ) const; - - - /** Returns number of dynamic equations of the dynamic system. - * - * \return Number of dynamic equations - */ - inline uint getNumDynamicEquations( ) const; - - /** Returns number of algebraic equations of the dynamic system. - * - * \return Number of algebraic equations - */ - inline uint getNumAlgebraicEquations( ) const; - - /** Returns number of outputs of the dynamic system. - * - * \return Number of outputs equations - */ - inline uint getNumOutputs( ) const; - - - /** Returns maximum number of controls of the dynamic system. - * - * \return Maximum number of controls - */ - inline uint getNumControls( ) const; - - /** Returns maximum number of parameters of the dynamic system. - * - * \return Maximum number of parameters - */ - inline uint getNumParameters( ) const; - - /** Returns maximum number of disturbances of the dynamic system. - * - * \return Maximum number of disturbances - */ - inline uint getNumDisturbances( ) const; - - - /** Returns number of subsystems (i.e. stages) of the dynamic system. - * - * \return Number of subsystems of the dynamic system - */ - inline uint getNumSubsystems( ) const; - - /** Returns number of switch functions of the dynamic system. - * - * \return Number of switch functions of the dynamic system - */ - inline uint getNumSwitchFunctions( ) const; - - /** Returns whether dynamic system has implicit switches. - * - * \return BT_TRUE iff dynamic system has implicit switches, \n - * BT_FALSE otherwise - */ - inline BooleanType hasImplicitSwitches( ) const; - - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - /** Returns whether given differential equation is consistent with the - * existing ones at other stages. - * - * @param[in] _diffEqn Differential equation. - * - * \return BT_TRUE iff differential equation is consistent, \n - * BT_FALSE otherwise - */ - BooleanType isConsistentDiffEqn( const DifferentialEquation& _diffEqn - ) const; - - /** Returns whether given output function is consistent with the corresponding - * differential equation and existing output functions at other stages. - * - * @param[in] _outputFcn Output function. - * - * \return BT_TRUE iff output function is consistent, \n - * BT_FALSE otherwise - */ - BooleanType isConsistentOutputFcn( const OutputFcn& _outputFcn - ) const; - - - - // - // DATA MEMBERS: - // - protected: - - uint nDiffEqn; /**< Number of differential equations. */ - uint nSwitchFcn; /**< Number of switch functions. */ - - DifferentialEquation** diffEqn; /**< Differential equation(s) describing the states of the dynamic system. */ - OutputFcn** outputFcn; /**< Output function(s) for evaluating the output of the dynamic system. */ - - Function** switchFcn; /**< Function(s) for determining switches between different differential equations. */ - Function* selectFcn; /**< Function for selecting the current differential equation based on the values of the switch function(s). */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_DYNAMIC_SYSTEM_HPP - - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/dynamic_system/dynamic_system.ipp b/phonelibs/acado/include/acado/dynamic_system/dynamic_system.ipp deleted file mode 100644 index 824b9e3483..0000000000 --- a/phonelibs/acado/include/acado/dynamic_system/dynamic_system.ipp +++ /dev/null @@ -1,253 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/dynamic_system/dynamic_system.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 13.06.2008 - */ - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - -BEGIN_NAMESPACE_ACADO - - - -inline returnValue DynamicSystem::getSubsystem( uint stageIdx, - DifferentialEquation& _diffEqn, - OutputFcn& _outputFcn - ) const -{ - if ( ( diffEqn == 0 ) || ( outputFcn == 0 ) ) - return ACADOERROR( RET_MEMBER_NOT_INITIALISED ); - - if (stageIdx >= nDiffEqn) - return ACADOERROR( RET_INDEX_OUT_OF_BOUNDS ); - - _diffEqn = getDifferentialEquation( stageIdx ); - _outputFcn = getOutputFcn( stageIdx ); - - return SUCCESSFUL_RETURN; -} - - -inline const DifferentialEquation& DynamicSystem::getDifferentialEquation( uint stageIdx - ) const -{ - ASSERT( diffEqn != 0 ); - ASSERT( stageIdx < nDiffEqn ); - - return *(diffEqn[stageIdx]); -} - - -inline const OutputFcn& DynamicSystem::getOutputFcn( uint stageIdx - ) const -{ - ASSERT( outputFcn != 0 ); - ASSERT( stageIdx < nDiffEqn ); - - return *(outputFcn[stageIdx]); -} - - -inline returnValue DynamicSystem::getSwitchFunction( uint idx, - Function& _switchFcn - ) const -{ - if ( switchFcn == 0 ) - return ACADOERROR( RET_MEMBER_NOT_INITIALISED ); - - if (idx > nSwitchFcn) - return ACADOERROR( RET_INDEX_OUT_OF_BOUNDS ); - - _switchFcn = *(switchFcn[idx]); - return SUCCESSFUL_RETURN; -} - - -inline returnValue DynamicSystem::getSelectFunction( Function& _selectFcn - ) const -{ - if ( selectFcn == 0 ) - return ACADOERROR( RET_MEMBER_NOT_INITIALISED ); - - _selectFcn = *selectFcn; - return SUCCESSFUL_RETURN; -} - - - -inline BooleanType DynamicSystem::isODE( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->isODE( ); - else - return BT_TRUE; -} - - -inline BooleanType DynamicSystem::isDAE( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->isDAE( ); - else - return BT_TRUE; -} - - - -inline BooleanType DynamicSystem::isDiscretized( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->isDiscretized( ); - else - return BT_TRUE; -} - - -inline BooleanType DynamicSystem::isContinuous( ) const -{ - if ( nDiffEqn > 0 ) - { - if ( diffEqn[0]->isDiscretized( ) == BT_FALSE ) - return BT_TRUE; - else - return BT_FALSE; - } - else - return BT_TRUE; -} - - - -inline double DynamicSystem::getSampleTime( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->getStepLength( ); - else - return -INFTY; -} - - - -inline uint DynamicSystem::getNumDynamicEquations( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->getNumDynamicEquations( ); - else - return 0; -} - -inline uint DynamicSystem::getNumAlgebraicEquations( ) const -{ - if ( nDiffEqn > 0 ) - return diffEqn[0]->getNumAlgebraicEquations( ); - else - return 0; -} - - -inline uint DynamicSystem::getNumOutputs( ) const -{ - if ( nDiffEqn > 0 ) - { - if ( outputFcn[0]->isDefined( ) == BT_TRUE ) - return outputFcn[0]->getDim( ); - else - return diffEqn[0]->getNumDynamicEquations( ); - } - else - return 0; -} - - -inline uint DynamicSystem::getNumControls( ) const -{ - uint n = 0; - - for( uint i=0; igetNU( ) ) - n = (uint) diffEqn[i]->getNU( ); - - return n; -} - - -inline uint DynamicSystem::getNumParameters( ) const -{ - uint n = 0; - - for( uint i=0; igetNP( ) ) - n = (uint) diffEqn[i]->getNP( ); - - return n; -} - - -inline uint DynamicSystem::getNumDisturbances( ) const -{ - uint n = 0; - - for( uint i=0; igetNW( ) ) - n = (uint) diffEqn[i]->getNW( ); - - return n; -} - - - -inline uint DynamicSystem::getNumSubsystems( ) const -{ - return nDiffEqn; -} - - -inline uint DynamicSystem::getNumSwitchFunctions( ) const -{ - return nSwitchFcn; -} - - -inline BooleanType DynamicSystem::hasImplicitSwitches( ) const -{ - if ( getNumSubsystems( ) > 1 ) - return BT_TRUE; - else - return BT_FALSE; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/estimator/dynamic_estimator.hpp b/phonelibs/acado/include/acado/estimator/dynamic_estimator.hpp deleted file mode 100644 index 467698569e..0000000000 --- a/phonelibs/acado/include/acado/estimator/dynamic_estimator.hpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/estimator/dynamic_estimator.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_DYNAMIC_ESTIMATOR_HPP -#define ACADO_TOOLKIT_DYNAMIC_ESTIMATOR_HPP - - -#include -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Implements an online state/parameter estimator based on dynamic optimization. - * - * \ingroup UserInterfaces - * - * The class DynamicEstimator implements an online state/parameter estimators - * based on dynamic optimization. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class DynamicEstimator : public Estimator -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. */ - DynamicEstimator( ); - - /** Constructor taking minimal sub-block configuration. */ - DynamicEstimator( const RealTimeAlgorithm& _realTimeAlgorithm, /**< Dynamic optimizer. */ - double _samplingTime = DEFAULT_SAMPLING_TIME - ); - - /** Copy constructor (deep copy). */ - DynamicEstimator( const DynamicEstimator& rhs ); - - /** Destructor. */ - virtual ~DynamicEstimator( ); - - /** Assignment operator (deep copy). */ - DynamicEstimator& operator=( const DynamicEstimator& rhs ); - - virtual Estimator* clone( ) const; - - - /** Initialization. */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector - ); - - /** Executes next single step. */ - virtual returnValue step( double currentTime, - const DVector& _y - ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - RealTimeAlgorithm* realTimeAlgorithm; /**< Optimization algorithm for online OCPs. */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_DYNAMIC_ESTIMATOR_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/estimator/dynamic_estimator.ipp b/phonelibs/acado/include/acado/estimator/dynamic_estimator.ipp deleted file mode 100644 index c60148759f..0000000000 --- a/phonelibs/acado/include/acado/estimator/dynamic_estimator.ipp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/estimator/dynamic_estimator.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - - -BEGIN_NAMESPACE_ACADO - - -// -// PUBLIC MEMBER FUNCTIONS: -// - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/estimator/estimator.hpp b/phonelibs/acado/include/acado/estimator/estimator.hpp deleted file mode 100644 index d746477fdd..0000000000 --- a/phonelibs/acado/include/acado/estimator/estimator.hpp +++ /dev/null @@ -1,177 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/estimator/estimator.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_ESTIMATOR_HPP -#define ACADO_TOOLKIT_ESTIMATOR_HPP - - -#include -#include - -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Base class for interfacing online state/parameter estimators. - * - * \ingroup UserInterfaces - * - * The class Estimator serves as a base class for interfacing online - * state/parameter estimators. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class Estimator : public SimulationBlock -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Default constructor. */ - Estimator( ); - - /** Constructor taking minimal sub-block configuration. */ - Estimator( double _samplingTime - ); - - /** Copy constructor (deep copy). */ - Estimator( const Estimator& rhs ); - - /** Destructor. */ - virtual ~Estimator( ); - - /** Assignment operator (deep copy). */ - Estimator& operator=( const Estimator& rhs ); - - virtual Estimator* clone( ) const = 0; - - - /** Initialization. */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector - ); - - /** Executes next single step. */ - virtual returnValue step( double currentTime, - const DVector& _y - ) = 0; - - - /** Returns all estimator outputs. */ - inline returnValue getOutputs( DVector& _x, /**< Estimated differential states. */ - DVector& _xa, /**< Estimated algebraic states. */ - DVector& _u, /**< Estimated previous controls. */ - DVector& _p, /**< Estimated parameters. */ - DVector& _w /**< Estimated disturbances. */ - ) const; - - /** Returns estimated differential states. */ - inline returnValue getX( DVector& _x /**< OUTPUT: estimated differential states. */ - ) const; - - /** Returns estimated algebraic states. */ - inline returnValue getXA( DVector& _xa /**< OUTPUT: estimated algebraic states. */ - ) const; - - /** Returns estimated previous controls. */ - inline returnValue getU( DVector& _u /**< OUTPUT: estimated previous controls. */ - ) const; - - /** Returns estimated parameters. */ - inline returnValue getP( DVector& _p /**< OUTPUT: estimated parameters. */ - ) const; - - /** Returns estimated disturbances. */ - inline returnValue getW( DVector& _w /**< OUTPUT: estimated disturbances. */ - ) const; - - - /** Returns number of estimated differential states. - * \return Number of estimated differential states */ - inline uint getNX( ) const; - - /** Returns number of estimated algebraic states. - * \return Number of estimated algebraic states */ - inline uint getNXA( ) const; - - /** Returns number of estimated previous controls. - * \return Number of estimated previous controls */ - inline uint getNU( ) const; - - /** Returns number of estimated parameters. - * \return Number of estimated parameters */ - inline uint getNP( ) const; - - /** Returns number of estimated disturbances. - * \return Number of estimated disturbances */ - inline uint getNW( ) const; - - /** Returns number of process outputs. - * \return Number of process outputs */ - inline uint getNY( ) const; - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: - DVector x; /**< Estimated differential state. */ - DVector xa; /**< Estimated algebraic state. */ - DVector u; /**< Estimated previous controls. */ - DVector p; /**< Estimated parameters. */ - DVector w; /**< Estimated disturbances. */ -}; - - -CLOSE_NAMESPACE_ACADO - - - -#include - - -#endif // ACADO_TOOLKIT_ESTIMATOR_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/estimator/estimator.ipp b/phonelibs/acado/include/acado/estimator/estimator.ipp deleted file mode 100644 index 29f1dbad51..0000000000 --- a/phonelibs/acado/include/acado/estimator/estimator.ipp +++ /dev/null @@ -1,137 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/estimator/estimator.ipp - * \author Hans Joachim Ferreau, Boris Houska - * \date 20.08.2008 - */ - - - -BEGIN_NAMESPACE_ACADO - - -// -// PUBLIC MEMBER FUNCTIONS: -// - -inline returnValue Estimator::getOutputs( DVector& _x, - DVector& _xa, - DVector& _u, - DVector& _p, - DVector& _w - ) const -{ - _x = x; - _xa = xa; - _u = u; - _p = p; - _w = w; - - return SUCCESSFUL_RETURN; -} - -inline returnValue Estimator::getX( DVector& _x - ) const -{ - _x = x; - return SUCCESSFUL_RETURN; -} - - -inline returnValue Estimator::getXA( DVector& _xa - ) const -{ - _xa = xa; - return SUCCESSFUL_RETURN; -} - - -inline returnValue Estimator::getU( DVector& _u - ) const -{ - _u = u; - return SUCCESSFUL_RETURN; -} - - -inline returnValue Estimator::getP( DVector& _p - ) const -{ - _p = p; - return SUCCESSFUL_RETURN; -} - - -inline returnValue Estimator::getW( DVector& _w - ) const -{ - _w = w; - return SUCCESSFUL_RETURN; -} - - -inline uint Estimator::getNX( ) const -{ - return x.getDim( ); -} - - -inline uint Estimator::getNXA( ) const -{ - return xa.getDim( ); -} - - -inline uint Estimator::getNU( ) const -{ - return u.getDim( ); -} - - -inline uint Estimator::getNP( ) const -{ - return p.getDim( ); -} - - -inline uint Estimator::getNW( ) const -{ - return w.getDim( ); -} - - -inline uint Estimator::getNY( ) const -{ - return 0; -} - - - -CLOSE_NAMESPACE_ACADO - -// end of file. diff --git a/phonelibs/acado/include/acado/estimator/kalman_filter.hpp b/phonelibs/acado/include/acado/estimator/kalman_filter.hpp deleted file mode 100644 index 883beb73b6..0000000000 --- a/phonelibs/acado/include/acado/estimator/kalman_filter.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - * This file is part of ACADO Toolkit. - * - * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. - * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, - * Milan Vukov, Rien Quirynen, KU Leuven. - * Developed within the Optimization in Engineering Center (OPTEC) - * under supervision of Moritz Diehl. All rights reserved. - * - * ACADO Toolkit is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * ACADO Toolkit is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with ACADO Toolkit; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -/** - * \file include/acado/estimator/kalman_filter.hpp - * \author Hans Joachim Ferreau, Boris Houska - */ - - -#ifndef ACADO_TOOLKIT_KALMAN_FILTER_HPP -#define ACADO_TOOLKIT_KALMAN_FILTER_HPP - - -#include -#include - - -BEGIN_NAMESPACE_ACADO - - -/** - * \brief Provides a Kalman filter for state estimation. - * - * \ingroup UserInterfaces - * - * The class KalmanFilter provides a Kalman filter for state estimation. - * - * \author Hans Joachim Ferreau, Boris Houska - */ -class KalmanFilter : public Estimator -{ - // - // PUBLIC MEMBER FUNCTIONS: - // - public: - /** Constructor taking minimal sub-block configuration. */ - KalmanFilter( double _samplingTime = DEFAULT_SAMPLING_TIME - ); - - /** Copy constructor (deep copy). */ - KalmanFilter( const KalmanFilter& rhs ); - - /** Destructor. */ - virtual ~KalmanFilter( ); - - /** Assignment operator (deep copy). */ - KalmanFilter& operator=( const KalmanFilter& rhs ); - - virtual Estimator* clone( ) const; - - - /** Initialization. */ - virtual returnValue init( double startTime = 0.0, - const DVector &x0_ = emptyConstVector, - const DVector &p_ = emptyConstVector - ); - - /** Executes next single step. */ - virtual returnValue step( double currentTime, - const DVector& _y - ); - - - // - // PROTECTED MEMBER FUNCTIONS: - // - protected: - - - - // - // DATA MEMBERS: - // - protected: -}; - - -CLOSE_NAMESPACE_ACADO - - - -//#include - - -#endif // ACADO_TOOLKIT_KALMAN_FILTER_HPP - -/* - * end of file - */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.BSD b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.BSD deleted file mode 100644 index 11971ffe25..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.BSD +++ /dev/null @@ -1,26 +0,0 @@ -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ \ No newline at end of file diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.GPL b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.GPL deleted file mode 100644 index 94a9ed024d..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.GPL +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.LGPL b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.LGPL deleted file mode 100644 index 4362b49151..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.LGPL +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MINPACK b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MINPACK deleted file mode 100644 index 11d8a9a6c3..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MINPACK +++ /dev/null @@ -1,52 +0,0 @@ -Minpack Copyright Notice (1999) University of Chicago. All rights reserved - -Redistribution and use in source and binary forms, with or -without modification, are permitted provided that the -following conditions are met: - -1. Redistributions of source code must retain the above -copyright notice, this list of conditions and the following -disclaimer. - -2. Redistributions in binary form must reproduce the above -copyright notice, this list of conditions and the following -disclaimer in the documentation and/or other materials -provided with the distribution. - -3. The end-user documentation included with the -redistribution, if any, must include the following -acknowledgment: - - "This product includes software developed by the - University of Chicago, as Operator of Argonne National - Laboratory. - -Alternately, this acknowledgment may appear in the software -itself, if and wherever such third-party acknowledgments -normally appear. - -4. WARRANTY DISCLAIMER. THE SOFTWARE IS SUPPLIED "AS IS" -WITHOUT WARRANTY OF ANY KIND. THE COPYRIGHT HOLDER, THE -UNITED STATES, THE UNITED STATES DEPARTMENT OF ENERGY, AND -THEIR EMPLOYEES: (1) DISCLAIM ANY WARRANTIES, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO ANY IMPLIED WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE -OR NON-INFRINGEMENT, (2) DO NOT ASSUME ANY LEGAL LIABILITY -OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR -USEFULNESS OF THE SOFTWARE, (3) DO NOT REPRESENT THAT USE OF -THE SOFTWARE WOULD NOT INFRINGE PRIVATELY OWNED RIGHTS, (4) -DO NOT WARRANT THAT THE SOFTWARE WILL FUNCTION -UNINTERRUPTED, THAT IT IS ERROR-FREE OR THAT ANY ERRORS WILL -BE CORRECTED. - -5. LIMITATION OF LIABILITY. IN NO EVENT WILL THE COPYRIGHT -HOLDER, THE UNITED STATES, THE UNITED STATES DEPARTMENT OF -ENERGY, OR THEIR EMPLOYEES: BE LIABLE FOR ANY INDIRECT, -INCIDENTAL, CONSEQUENTIAL, SPECIAL OR PUNITIVE DAMAGES OF -ANY KIND OR NATURE, INCLUDING BUT NOT LIMITED TO LOSS OF -PROFITS OR LOSS OF DATA, FOR ANY REASON WHATSOEVER, WHETHER -SUCH LIABILITY IS ASSERTED ON THE BASIS OF CONTRACT, TORT -(INCLUDING NEGLIGENCE OR STRICT LIABILITY), OR OTHERWISE, -EVEN IF ANY OF SAID PARTIES HAS BEEN WARNED OF THE -POSSIBILITY OF SUCH LOSS OR DAMAGES. - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MPL2 b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MPL2 deleted file mode 100644 index 14e2f777f6..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.MPL2 +++ /dev/null @@ -1,373 +0,0 @@ -Mozilla Public License Version 2.0 -================================== - -1. Definitions --------------- - -1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - -1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - -1.3. "Contribution" - means Covered Software of a particular Contributor. - -1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - -1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - -1.6. "Executable Form" - means any form of the work other than Source Code Form. - -1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - -1.8. "License" - means this document. - -1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - -1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - -1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - -1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - -1.13. "Source Code Form" - means the form of the work preferred for making modifications. - -1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - -2. License Grants and Conditions --------------------------------- - -2.1. Grants - -Each Contributor hereby grants You a world-wide, royalty-free, -non-exclusive license: - -(a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - -(b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - -2.2. Effective Date - -The licenses granted in Section 2.1 with respect to any Contribution -become effective for each Contribution on the date the Contributor first -distributes such Contribution. - -2.3. Limitations on Grant Scope - -The licenses granted in this Section 2 are the only rights granted under -this License. No additional rights or licenses will be implied from the -distribution or licensing of Covered Software under this License. -Notwithstanding Section 2.1(b) above, no patent license is granted by a -Contributor: - -(a) for any code that a Contributor has removed from Covered Software; - or - -(b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - -(c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - -This License does not grant any rights in the trademarks, service marks, -or logos of any Contributor (except as may be necessary to comply with -the notice requirements in Section 3.4). - -2.4. Subsequent Licenses - -No Contributor makes additional grants as a result of Your choice to -distribute the Covered Software under a subsequent version of this -License (see Section 10.2) or under the terms of a Secondary License (if -permitted under the terms of Section 3.3). - -2.5. Representation - -Each Contributor represents that the Contributor believes its -Contributions are its original creation(s) or it has sufficient rights -to grant the rights to its Contributions conveyed by this License. - -2.6. Fair Use - -This License is not intended to limit any rights You have under -applicable copyright doctrines of fair use, fair dealing, or other -equivalents. - -2.7. Conditions - -Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted -in Section 2.1. - -3. Responsibilities -------------------- - -3.1. Distribution of Source Form - -All distribution of Covered Software in Source Code Form, including any -Modifications that You create or to which You contribute, must be under -the terms of this License. You must inform recipients that the Source -Code Form of the Covered Software is governed by the terms of this -License, and how they can obtain a copy of this License. You may not -attempt to alter or restrict the recipients' rights in the Source Code -Form. - -3.2. Distribution of Executable Form - -If You distribute Covered Software in Executable Form then: - -(a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - -(b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - -3.3. Distribution of a Larger Work - -You may create and distribute a Larger Work under terms of Your choice, -provided that You also comply with the requirements of this License for -the Covered Software. If the Larger Work is a combination of Covered -Software with a work governed by one or more Secondary Licenses, and the -Covered Software is not Incompatible With Secondary Licenses, this -License permits You to additionally distribute such Covered Software -under the terms of such Secondary License(s), so that the recipient of -the Larger Work may, at their option, further distribute the Covered -Software under the terms of either this License or such Secondary -License(s). - -3.4. Notices - -You may not remove or alter the substance of any license notices -(including copyright notices, patent notices, disclaimers of warranty, -or limitations of liability) contained within the Source Code Form of -the Covered Software, except that You may alter any license notices to -the extent required to remedy known factual inaccuracies. - -3.5. Application of Additional Terms - -You may choose to offer, and to charge a fee for, warranty, support, -indemnity or liability obligations to one or more recipients of Covered -Software. However, You may do so only on Your own behalf, and not on -behalf of any Contributor. You must make it absolutely clear that any -such warranty, support, indemnity, or liability obligation is offered by -You alone, and You hereby agree to indemnify every Contributor for any -liability incurred by such Contributor as a result of warranty, support, -indemnity or liability terms You offer. You may include additional -disclaimers of warranty and limitations of liability specific to any -jurisdiction. - -4. Inability to Comply Due to Statute or Regulation ---------------------------------------------------- - -If it is impossible for You to comply with any of the terms of this -License with respect to some or all of the Covered Software due to -statute, judicial order, or regulation then You must: (a) comply with -the terms of this License to the maximum extent possible; and (b) -describe the limitations and the code they affect. Such description must -be placed in a text file included with all distributions of the Covered -Software under this License. Except to the extent prohibited by statute -or regulation, such description must be sufficiently detailed for a -recipient of ordinary skill to be able to understand it. - -5. Termination --------------- - -5.1. The rights granted under this License will terminate automatically -if You fail to comply with any of its terms. However, if You become -compliant, then the rights granted under this License from a particular -Contributor are reinstated (a) provisionally, unless and until such -Contributor explicitly and finally terminates Your grants, and (b) on an -ongoing basis, if such Contributor fails to notify You of the -non-compliance by some reasonable means prior to 60 days after You have -come back into compliance. Moreover, Your grants from a particular -Contributor are reinstated on an ongoing basis if such Contributor -notifies You of the non-compliance by some reasonable means, this is the -first time You have received notice of non-compliance with this License -from such Contributor, and You become compliant prior to 30 days after -Your receipt of the notice. - -5.2. If You initiate litigation against any entity by asserting a patent -infringement claim (excluding declaratory judgment actions, -counter-claims, and cross-claims) alleging that a Contributor Version -directly or indirectly infringes any patent, then the rights granted to -You by any and all Contributors for the Covered Software under Section -2.1 of this License shall terminate. - -5.3. In the event of termination under Sections 5.1 or 5.2 above, all -end user license agreements (excluding distributors and resellers) which -have been validly granted by You or Your distributors under this License -prior to termination shall survive termination. - -************************************************************************ -* * -* 6. Disclaimer of Warranty * -* ------------------------- * -* * -* Covered Software is provided under this License on an "as is" * -* basis, without warranty of any kind, either expressed, implied, or * -* statutory, including, without limitation, warranties that the * -* Covered Software is free of defects, merchantable, fit for a * -* particular purpose or non-infringing. The entire risk as to the * -* quality and performance of the Covered Software is with You. * -* Should any Covered Software prove defective in any respect, You * -* (not any Contributor) assume the cost of any necessary servicing, * -* repair, or correction. This disclaimer of warranty constitutes an * -* essential part of this License. No use of any Covered Software is * -* authorized under this License except under this disclaimer. * -* * -************************************************************************ - -************************************************************************ -* * -* 7. Limitation of Liability * -* -------------------------- * -* * -* Under no circumstances and under no legal theory, whether tort * -* (including negligence), contract, or otherwise, shall any * -* Contributor, or anyone who distributes Covered Software as * -* permitted above, be liable to You for any direct, indirect, * -* special, incidental, or consequential damages of any character * -* including, without limitation, damages for lost profits, loss of * -* goodwill, work stoppage, computer failure or malfunction, or any * -* and all other commercial damages or losses, even if such party * -* shall have been informed of the possibility of such damages. This * -* limitation of liability shall not apply to liability for death or * -* personal injury resulting from such party's negligence to the * -* extent applicable law prohibits such limitation. Some * -* jurisdictions do not allow the exclusion or limitation of * -* incidental or consequential damages, so this exclusion and * -* limitation may not apply to You. * -* * -************************************************************************ - -8. Litigation -------------- - -Any litigation relating to this License may be brought only in the -courts of a jurisdiction where the defendant maintains its principal -place of business and such litigation shall be governed by laws of that -jurisdiction, without reference to its conflict-of-law provisions. -Nothing in this Section shall prevent a party's ability to bring -cross-claims or counter-claims. - -9. Miscellaneous ----------------- - -This License represents the complete agreement concerning the subject -matter hereof. If any provision of this License is held to be -unenforceable, such provision shall be reformed only to the extent -necessary to make it enforceable. Any law or regulation which provides -that the language of a contract shall be construed against the drafter -shall not be used to construe this License against a Contributor. - -10. Versions of the License ---------------------------- - -10.1. New Versions - -Mozilla Foundation is the license steward. Except as provided in Section -10.3, no one other than the license steward has the right to modify or -publish new versions of this License. Each version will be given a -distinguishing version number. - -10.2. Effect of New Versions - -You may distribute the Covered Software under the terms of the version -of the License under which You originally received the Covered Software, -or under the terms of any subsequent version published by the license -steward. - -10.3. Modified Versions - -If you create software not governed by this License, and you want to -create a new license for such software, you may create and use a -modified version of this License if you rename the license and remove -any references to the name of the license steward (except to note that -such modified license differs from this License). - -10.4. Distributing Source Code Form that is Incompatible With Secondary -Licenses - -If You choose to distribute Source Code Form that is Incompatible With -Secondary Licenses under the terms of this version of the License, the -notice described in Exhibit B of this License must be attached. - -Exhibit A - Source Code Form License Notice -------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - -If it is not possible or desirable to put the notice in a particular -file, then You may include the notice in a location (such as a LICENSE -file in a relevant directory) where a recipient would be likely to look -for such a notice. - -You may add additional accurate notices of copyright ownership. - -Exhibit B - "Incompatible With Secondary Licenses" Notice ---------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.README b/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.README deleted file mode 100644 index de5b632158..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/COPYING.README +++ /dev/null @@ -1,18 +0,0 @@ -Eigen is primarily MPL2 licensed. See COPYING.MPL2 and these links: - http://www.mozilla.org/MPL/2.0/ - http://www.mozilla.org/MPL/2.0/FAQ.html - -Some files contain third-party code under BSD or LGPL licenses, whence the other -COPYING.* files here. - -All the LGPL code is either LGPL 2.1-only, or LGPL 2.1-or-later. -For this reason, the COPYING.LGPL file contains the LGPL 2.1 text. - -If you want to guarantee that the Eigen code that you are #including is licensed -under the MPL2 and possibly more permissive licenses (like BSD), #define this -preprocessor symbol: - EIGEN_MPL2_ONLY -For example, with most compilers, you could add this to your project CXXFLAGS: - -DEIGEN_MPL2_ONLY -This will cause a compilation error to be generated if you #include any code that is -LGPL licensed. diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Array b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Array deleted file mode 100644 index 3d004fb69e..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Array +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef EIGEN_ARRAY_MODULE_H -#define EIGEN_ARRAY_MODULE_H - -// include Core first to handle Eigen2 support macros -#include "Core" - -#ifndef EIGEN2_SUPPORT - #error The Eigen/Array header does no longer exist in Eigen3. All that functionality has moved to Eigen/Core. -#endif - -#endif // EIGEN_ARRAY_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Cholesky b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Cholesky deleted file mode 100644 index f727f5d89c..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Cholesky +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef EIGEN_CHOLESKY_MODULE_H -#define EIGEN_CHOLESKY_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup Cholesky_Module Cholesky module - * - * - * - * This module provides two variants of the Cholesky decomposition for selfadjoint (hermitian) matrices. - * Those decompositions are accessible via the following MatrixBase methods: - * - MatrixBase::llt(), - * - MatrixBase::ldlt() - * - * \code - * #include - * \endcode - */ - -#include "src/misc/Solve.h" -#include "src/Cholesky/LLT.h" -#include "src/Cholesky/LDLT.h" -#ifdef EIGEN_USE_LAPACKE -#include "src/Cholesky/LLT_MKL.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_CHOLESKY_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/CholmodSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/CholmodSupport deleted file mode 100644 index 745b884e74..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/CholmodSupport +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef EIGEN_CHOLMODSUPPORT_MODULE_H -#define EIGEN_CHOLMODSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -extern "C" { - #include -} - -/** \ingroup Support_modules - * \defgroup CholmodSupport_Module CholmodSupport module - * - * This module provides an interface to the Cholmod library which is part of the suitesparse package. - * It provides the two following main factorization classes: - * - class CholmodSupernodalLLT: a supernodal LLT Cholesky factorization. - * - class CholmodDecomposiiton: a general L(D)LT Cholesky factorization with automatic or explicit runtime selection of the underlying factorization method (supernodal or simplicial). - * - * For the sake of completeness, this module also propose the two following classes: - * - class CholmodSimplicialLLT - * - class CholmodSimplicialLDLT - * Note that these classes does not bring any particular advantage compared to the built-in - * SimplicialLLT and SimplicialLDLT factorization classes. - * - * \code - * #include - * \endcode - * - * In order to use this module, the cholmod headers must be accessible from the include paths, and your binary must be linked to the cholmod library and its dependencies. - * The dependencies depend on how cholmod has been compiled. - * For a cmake based project, you can use our FindCholmod.cmake module to help you in this task. - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "src/CholmodSupport/CholmodSupport.h" - - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_CHOLMODSUPPORT_MODULE_H - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Core b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Core deleted file mode 100644 index 9131cc3fc9..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Core +++ /dev/null @@ -1,376 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2007-2011 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CORE_H -#define EIGEN_CORE_H - -// first thing Eigen does: stop the compiler from committing suicide -#include "src/Core/util/DisableStupidWarnings.h" - -// then include this file where all our macros are defined. It's really important to do it first because -// it's where we do all the alignment settings (platform detection and honoring the user's will if he -// defined e.g. EIGEN_DONT_ALIGN) so it needs to be done before we do anything with vectorization. -#include "src/Core/util/Macros.h" - -// Disable the ipa-cp-clone optimization flag with MinGW 6.x or newer (enabled by default with -O3) -// See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=556 for details. -#if defined(__MINGW32__) && EIGEN_GNUC_AT_LEAST(4,6) - #pragma GCC optimize ("-fno-ipa-cp-clone") -#endif - -#include - -// this include file manages BLAS and MKL related macros -// and inclusion of their respective header files -#include "src/Core/util/MKL_support.h" - -// if alignment is disabled, then disable vectorization. Note: EIGEN_ALIGN is the proper check, it takes into -// account both the user's will (EIGEN_DONT_ALIGN) and our own platform checks -#if !EIGEN_ALIGN - #ifndef EIGEN_DONT_VECTORIZE - #define EIGEN_DONT_VECTORIZE - #endif -#endif - -#ifdef _MSC_VER - #include // for _aligned_malloc -- need it regardless of whether vectorization is enabled - #if (_MSC_VER >= 1500) // 2008 or later - // Remember that usage of defined() in a #define is undefined by the standard. - // a user reported that in 64-bit mode, MSVC doesn't care to define _M_IX86_FP. - #if (defined(_M_IX86_FP) && (_M_IX86_FP >= 2)) || defined(_M_X64) - #define EIGEN_SSE2_ON_MSVC_2008_OR_LATER - #endif - #endif -#else - // Remember that usage of defined() in a #define is undefined by the standard - #if (defined __SSE2__) && ( (!defined __GNUC__) || (defined __INTEL_COMPILER) || EIGEN_GNUC_AT_LEAST(4,2) ) - #define EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC - #endif -#endif - -#ifndef EIGEN_DONT_VECTORIZE - - #if defined (EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC) || defined(EIGEN_SSE2_ON_MSVC_2008_OR_LATER) - - // Defines symbols for compile-time detection of which instructions are - // used. - // EIGEN_VECTORIZE_YY is defined if and only if the instruction set YY is used - #define EIGEN_VECTORIZE - #define EIGEN_VECTORIZE_SSE - #define EIGEN_VECTORIZE_SSE2 - - // Detect sse3/ssse3/sse4: - // gcc and icc defines __SSE3__, ... - // there is no way to know about this on msvc. You can define EIGEN_VECTORIZE_SSE* if you - // want to force the use of those instructions with msvc. - #ifdef __SSE3__ - #define EIGEN_VECTORIZE_SSE3 - #endif - #ifdef __SSSE3__ - #define EIGEN_VECTORIZE_SSSE3 - #endif - #ifdef __SSE4_1__ - #define EIGEN_VECTORIZE_SSE4_1 - #endif - #ifdef __SSE4_2__ - #define EIGEN_VECTORIZE_SSE4_2 - #endif - - // include files - - // This extern "C" works around a MINGW-w64 compilation issue - // https://sourceforge.net/tracker/index.php?func=detail&aid=3018394&group_id=202880&atid=983354 - // In essence, intrin.h is included by windows.h and also declares intrinsics (just as emmintrin.h etc. below do). - // However, intrin.h uses an extern "C" declaration, and g++ thus complains of duplicate declarations - // with conflicting linkage. The linkage for intrinsics doesn't matter, but at that stage the compiler doesn't know; - // so, to avoid compile errors when windows.h is included after Eigen/Core, ensure intrinsics are extern "C" here too. - // notice that since these are C headers, the extern "C" is theoretically needed anyways. - extern "C" { - // In theory we should only include immintrin.h and not the other *mmintrin.h header files directly. - // Doing so triggers some issues with ICC. However old gcc versions seems to not have this file, thus: - #ifdef __INTEL_COMPILER - #include - #else - #include - #include - #ifdef EIGEN_VECTORIZE_SSE3 - #include - #endif - #ifdef EIGEN_VECTORIZE_SSSE3 - #include - #endif - #ifdef EIGEN_VECTORIZE_SSE4_1 - #include - #endif - #ifdef EIGEN_VECTORIZE_SSE4_2 - #include - #endif - #endif - } // end extern "C" - #elif defined __ALTIVEC__ - #define EIGEN_VECTORIZE - #define EIGEN_VECTORIZE_ALTIVEC - #include - // We need to #undef all these ugly tokens defined in - // => use __vector instead of vector - #undef bool - #undef vector - #undef pixel - #elif defined __ARM_NEON__ - #define EIGEN_VECTORIZE - #define EIGEN_VECTORIZE_NEON - #include - #endif -#endif - -#if (defined _OPENMP) && (!defined EIGEN_DONT_PARALLELIZE) - #define EIGEN_HAS_OPENMP -#endif - -#ifdef EIGEN_HAS_OPENMP -#include -#endif - -// MSVC for windows mobile does not have the errno.h file -#if !(defined(_MSC_VER) && defined(_WIN32_WCE)) && !defined(__ARMCC_VERSION) -#define EIGEN_HAS_ERRNO -#endif - -#ifdef EIGEN_HAS_ERRNO -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include // for CHAR_BIT -// for min/max: -#include - -// for outputting debug info -#ifdef EIGEN_DEBUG_ASSIGN -#include -#endif - -// required for __cpuid, needs to be included after cmath -#if defined(_MSC_VER) && (defined(_M_IX86)||defined(_M_X64)) - #include -#endif - -#if defined(_CPPUNWIND) || defined(__EXCEPTIONS) - #define EIGEN_EXCEPTIONS -#endif - -#ifdef EIGEN_EXCEPTIONS - #include -#endif - -/** \brief Namespace containing all symbols from the %Eigen library. */ -namespace Eigen { - -inline static const char *SimdInstructionSetsInUse(void) { -#if defined(EIGEN_VECTORIZE_SSE4_2) - return "SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2"; -#elif defined(EIGEN_VECTORIZE_SSE4_1) - return "SSE, SSE2, SSE3, SSSE3, SSE4.1"; -#elif defined(EIGEN_VECTORIZE_SSSE3) - return "SSE, SSE2, SSE3, SSSE3"; -#elif defined(EIGEN_VECTORIZE_SSE3) - return "SSE, SSE2, SSE3"; -#elif defined(EIGEN_VECTORIZE_SSE2) - return "SSE, SSE2"; -#elif defined(EIGEN_VECTORIZE_ALTIVEC) - return "AltiVec"; -#elif defined(EIGEN_VECTORIZE_NEON) - return "ARM NEON"; -#else - return "None"; -#endif -} - -} // end namespace Eigen - -#define STAGE10_FULL_EIGEN2_API 10 -#define STAGE20_RESOLVE_API_CONFLICTS 20 -#define STAGE30_FULL_EIGEN3_API 30 -#define STAGE40_FULL_EIGEN3_STRICTNESS 40 -#define STAGE99_NO_EIGEN2_SUPPORT 99 - -#if defined EIGEN2_SUPPORT_STAGE40_FULL_EIGEN3_STRICTNESS - #define EIGEN2_SUPPORT - #define EIGEN2_SUPPORT_STAGE STAGE40_FULL_EIGEN3_STRICTNESS -#elif defined EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API - #define EIGEN2_SUPPORT - #define EIGEN2_SUPPORT_STAGE STAGE30_FULL_EIGEN3_API -#elif defined EIGEN2_SUPPORT_STAGE20_RESOLVE_API_CONFLICTS - #define EIGEN2_SUPPORT - #define EIGEN2_SUPPORT_STAGE STAGE20_RESOLVE_API_CONFLICTS -#elif defined EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API - #define EIGEN2_SUPPORT - #define EIGEN2_SUPPORT_STAGE STAGE10_FULL_EIGEN2_API -#elif defined EIGEN2_SUPPORT - // default to stage 3, that's what it's always meant - #define EIGEN2_SUPPORT_STAGE30_FULL_EIGEN3_API - #define EIGEN2_SUPPORT_STAGE STAGE30_FULL_EIGEN3_API -#else - #define EIGEN2_SUPPORT_STAGE STAGE99_NO_EIGEN2_SUPPORT -#endif - -#ifdef EIGEN2_SUPPORT -#undef minor -#endif - -// we use size_t frequently and we'll never remember to prepend it with std:: everytime just to -// ensure QNX/QCC support -using std::size_t; -// gcc 4.6.0 wants std:: for ptrdiff_t -using std::ptrdiff_t; - -/** \defgroup Core_Module Core module - * This is the main module of Eigen providing dense matrix and vector support - * (both fixed and dynamic size) with all the features corresponding to a BLAS library - * and much more... - * - * \code - * #include - * \endcode - */ - -#include "src/Core/util/Constants.h" -#include "src/Core/util/ForwardDeclarations.h" -#include "src/Core/util/Meta.h" -#include "src/Core/util/StaticAssert.h" -#include "src/Core/util/XprHelper.h" -#include "src/Core/util/Memory.h" - -#include "src/Core/NumTraits.h" -#include "src/Core/MathFunctions.h" -#include "src/Core/GenericPacketMath.h" - -#if defined EIGEN_VECTORIZE_SSE - #include "src/Core/arch/SSE/PacketMath.h" - #include "src/Core/arch/SSE/MathFunctions.h" - #include "src/Core/arch/SSE/Complex.h" -#elif defined EIGEN_VECTORIZE_ALTIVEC - #include "src/Core/arch/AltiVec/PacketMath.h" - #include "src/Core/arch/AltiVec/Complex.h" -#elif defined EIGEN_VECTORIZE_NEON - #include "src/Core/arch/NEON/PacketMath.h" - #include "src/Core/arch/NEON/Complex.h" -#endif - -#include "src/Core/arch/Default/Settings.h" - -#include "src/Core/Functors.h" -#include "src/Core/DenseCoeffsBase.h" -#include "src/Core/DenseBase.h" -#include "src/Core/MatrixBase.h" -#include "src/Core/EigenBase.h" - -#ifndef EIGEN_PARSED_BY_DOXYGEN // work around Doxygen bug triggered by Assign.h r814874 - // at least confirmed with Doxygen 1.5.5 and 1.5.6 - #include "src/Core/Assign.h" -#endif - -#include "src/Core/util/BlasUtil.h" -#include "src/Core/DenseStorage.h" -#include "src/Core/NestByValue.h" -#include "src/Core/ForceAlignedAccess.h" -#include "src/Core/ReturnByValue.h" -#include "src/Core/NoAlias.h" -#include "src/Core/PlainObjectBase.h" -#include "src/Core/Matrix.h" -#include "src/Core/Array.h" -#include "src/Core/CwiseBinaryOp.h" -#include "src/Core/CwiseUnaryOp.h" -#include "src/Core/CwiseNullaryOp.h" -#include "src/Core/CwiseUnaryView.h" -#include "src/Core/SelfCwiseBinaryOp.h" -#include "src/Core/Dot.h" -#include "src/Core/StableNorm.h" -#include "src/Core/MapBase.h" -#include "src/Core/Stride.h" -#include "src/Core/Map.h" -#include "src/Core/Block.h" -#include "src/Core/VectorBlock.h" -#include "src/Core/Ref.h" -#include "src/Core/Transpose.h" -#include "src/Core/DiagonalMatrix.h" -#include "src/Core/Diagonal.h" -#include "src/Core/DiagonalProduct.h" -#include "src/Core/PermutationMatrix.h" -#include "src/Core/Transpositions.h" -#include "src/Core/Redux.h" -#include "src/Core/Visitor.h" -#include "src/Core/Fuzzy.h" -#include "src/Core/IO.h" -#include "src/Core/Swap.h" -#include "src/Core/CommaInitializer.h" -#include "src/Core/Flagged.h" -#include "src/Core/ProductBase.h" -#include "src/Core/GeneralProduct.h" -#include "src/Core/TriangularMatrix.h" -#include "src/Core/SelfAdjointView.h" -#include "src/Core/products/GeneralBlockPanelKernel.h" -#include "src/Core/products/Parallelizer.h" -#include "src/Core/products/CoeffBasedProduct.h" -#include "src/Core/products/GeneralMatrixVector.h" -#include "src/Core/products/GeneralMatrixMatrix.h" -#include "src/Core/SolveTriangular.h" -#include "src/Core/products/GeneralMatrixMatrixTriangular.h" -#include "src/Core/products/SelfadjointMatrixVector.h" -#include "src/Core/products/SelfadjointMatrixMatrix.h" -#include "src/Core/products/SelfadjointProduct.h" -#include "src/Core/products/SelfadjointRank2Update.h" -#include "src/Core/products/TriangularMatrixVector.h" -#include "src/Core/products/TriangularMatrixMatrix.h" -#include "src/Core/products/TriangularSolverMatrix.h" -#include "src/Core/products/TriangularSolverVector.h" -#include "src/Core/BandMatrix.h" -#include "src/Core/CoreIterators.h" - -#include "src/Core/BooleanRedux.h" -#include "src/Core/Select.h" -#include "src/Core/VectorwiseOp.h" -#include "src/Core/Random.h" -#include "src/Core/Replicate.h" -#include "src/Core/Reverse.h" -#include "src/Core/ArrayBase.h" -#include "src/Core/ArrayWrapper.h" - -#ifdef EIGEN_USE_BLAS -#include "src/Core/products/GeneralMatrixMatrix_MKL.h" -#include "src/Core/products/GeneralMatrixVector_MKL.h" -#include "src/Core/products/GeneralMatrixMatrixTriangular_MKL.h" -#include "src/Core/products/SelfadjointMatrixMatrix_MKL.h" -#include "src/Core/products/SelfadjointMatrixVector_MKL.h" -#include "src/Core/products/TriangularMatrixMatrix_MKL.h" -#include "src/Core/products/TriangularMatrixVector_MKL.h" -#include "src/Core/products/TriangularSolverMatrix_MKL.h" -#endif // EIGEN_USE_BLAS - -#ifdef EIGEN_USE_MKL_VML -#include "src/Core/Assign_MKL.h" -#endif - -#include "src/Core/GlobalFunctions.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#ifdef EIGEN2_SUPPORT -#include "Eigen2Support" -#endif - -#endif // EIGEN_CORE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Dense b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Dense deleted file mode 100644 index 5768910bd8..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Dense +++ /dev/null @@ -1,7 +0,0 @@ -#include "Core" -#include "LU" -#include "Cholesky" -#include "QR" -#include "SVD" -#include "Geometry" -#include "Eigenvalues" diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen deleted file mode 100644 index 19b40ea4e7..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen +++ /dev/null @@ -1,2 +0,0 @@ -#include "Dense" -//#include "Sparse" diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen2Support b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen2Support deleted file mode 100644 index 36156d29a9..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigen2Support +++ /dev/null @@ -1,82 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN2SUPPORT_H -#define EIGEN2SUPPORT_H - -#if (!defined(EIGEN2_SUPPORT)) || (!defined(EIGEN_CORE_H)) -#error Eigen2 support must be enabled by defining EIGEN2_SUPPORT before including any Eigen header -#endif - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \ingroup Support_modules - * \defgroup Eigen2Support_Module Eigen2 support module - * This module provides a couple of deprecated functions improving the compatibility with Eigen2. - * - * To use it, define EIGEN2_SUPPORT before including any Eigen header - * \code - * #define EIGEN2_SUPPORT - * \endcode - * - */ - -#include "src/Eigen2Support/Macros.h" -#include "src/Eigen2Support/Memory.h" -#include "src/Eigen2Support/Meta.h" -#include "src/Eigen2Support/Lazy.h" -#include "src/Eigen2Support/Cwise.h" -#include "src/Eigen2Support/CwiseOperators.h" -#include "src/Eigen2Support/TriangularSolver.h" -#include "src/Eigen2Support/Block.h" -#include "src/Eigen2Support/VectorBlock.h" -#include "src/Eigen2Support/Minor.h" -#include "src/Eigen2Support/MathFunctions.h" - - -#include "src/Core/util/ReenableStupidWarnings.h" - -// Eigen2 used to include iostream -#include - -#define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \ -using Eigen::Matrix##SizeSuffix##TypeSuffix; \ -using Eigen::Vector##SizeSuffix##TypeSuffix; \ -using Eigen::RowVector##SizeSuffix##TypeSuffix; - -#define EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(TypeSuffix) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ - -#define EIGEN_USING_MATRIX_TYPEDEFS \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(i) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(f) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(d) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cf) \ -EIGEN_USING_MATRIX_TYPEDEFS_FOR_TYPE(cd) - -#define USING_PART_OF_NAMESPACE_EIGEN \ -EIGEN_USING_MATRIX_TYPEDEFS \ -using Eigen::Matrix; \ -using Eigen::MatrixBase; \ -using Eigen::ei_random; \ -using Eigen::ei_real; \ -using Eigen::ei_imag; \ -using Eigen::ei_conj; \ -using Eigen::ei_abs; \ -using Eigen::ei_abs2; \ -using Eigen::ei_sqrt; \ -using Eigen::ei_exp; \ -using Eigen::ei_log; \ -using Eigen::ei_sin; \ -using Eigen::ei_cos; - -#endif // EIGEN2SUPPORT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigenvalues b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigenvalues deleted file mode 100644 index 53c5a73a27..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Eigenvalues +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef EIGEN_EIGENVALUES_MODULE_H -#define EIGEN_EIGENVALUES_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include "Cholesky" -#include "Jacobi" -#include "Householder" -#include "LU" -#include "Geometry" - -/** \defgroup Eigenvalues_Module Eigenvalues module - * - * - * - * This module mainly provides various eigenvalue solvers. - * This module also provides some MatrixBase methods, including: - * - MatrixBase::eigenvalues(), - * - MatrixBase::operatorNorm() - * - * \code - * #include - * \endcode - */ - -#include "src/Eigenvalues/Tridiagonalization.h" -#include "src/Eigenvalues/RealSchur.h" -#include "src/Eigenvalues/EigenSolver.h" -#include "src/Eigenvalues/SelfAdjointEigenSolver.h" -#include "src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h" -#include "src/Eigenvalues/HessenbergDecomposition.h" -#include "src/Eigenvalues/ComplexSchur.h" -#include "src/Eigenvalues/ComplexEigenSolver.h" -#include "src/Eigenvalues/RealQZ.h" -#include "src/Eigenvalues/GeneralizedEigenSolver.h" -#include "src/Eigenvalues/MatrixBaseEigenvalues.h" -#ifdef EIGEN_USE_LAPACKE -#include "src/Eigenvalues/RealSchur_MKL.h" -#include "src/Eigenvalues/ComplexSchur_MKL.h" -#include "src/Eigenvalues/SelfAdjointEigenSolver_MKL.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_EIGENVALUES_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Geometry b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Geometry deleted file mode 100644 index efd9d4504c..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Geometry +++ /dev/null @@ -1,63 +0,0 @@ -#ifndef EIGEN_GEOMETRY_MODULE_H -#define EIGEN_GEOMETRY_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include "SVD" -#include "LU" -#include - -#ifndef M_PI -#define M_PI 3.14159265358979323846 -#endif - -/** \defgroup Geometry_Module Geometry module - * - * - * - * This module provides support for: - * - fixed-size homogeneous transformations - * - translation, scaling, 2D and 3D rotations - * - quaternions - * - \ref MatrixBase::cross() "cross product" - * - \ref MatrixBase::unitOrthogonal() "orthognal vector generation" - * - some linear components: parametrized-lines and hyperplanes - * - * \code - * #include - * \endcode - */ - -#include "src/Geometry/OrthoMethods.h" -#include "src/Geometry/EulerAngles.h" - -#if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS - #include "src/Geometry/Homogeneous.h" - #include "src/Geometry/RotationBase.h" - #include "src/Geometry/Rotation2D.h" - #include "src/Geometry/Quaternion.h" - #include "src/Geometry/AngleAxis.h" - #include "src/Geometry/Transform.h" - #include "src/Geometry/Translation.h" - #include "src/Geometry/Scaling.h" - #include "src/Geometry/Hyperplane.h" - #include "src/Geometry/ParametrizedLine.h" - #include "src/Geometry/AlignedBox.h" - #include "src/Geometry/Umeyama.h" - - #if defined EIGEN_VECTORIZE_SSE - #include "src/Geometry/arch/Geometry_SSE.h" - #endif -#endif - -#ifdef EIGEN2_SUPPORT -#include "src/Eigen2Support/Geometry/All.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_GEOMETRY_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Householder b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Householder deleted file mode 100644 index 6e348db5c4..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Householder +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef EIGEN_HOUSEHOLDER_MODULE_H -#define EIGEN_HOUSEHOLDER_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup Householder_Module Householder module - * This module provides Householder transformations. - * - * \code - * #include - * \endcode - */ - -#include "src/Householder/Householder.h" -#include "src/Householder/HouseholderSequence.h" -#include "src/Householder/BlockHouseholder.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_HOUSEHOLDER_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/IterativeLinearSolvers b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/IterativeLinearSolvers deleted file mode 100644 index 0f4159dc19..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/IterativeLinearSolvers +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef EIGEN_ITERATIVELINEARSOLVERS_MODULE_H -#define EIGEN_ITERATIVELINEARSOLVERS_MODULE_H - -#include "SparseCore" -#include "OrderingMethods" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** - * \defgroup IterativeLinearSolvers_Module IterativeLinearSolvers module - * - * This module currently provides iterative methods to solve problems of the form \c A \c x = \c b, where \c A is a squared matrix, usually very large and sparse. - * Those solvers are accessible via the following classes: - * - ConjugateGradient for selfadjoint (hermitian) matrices, - * - BiCGSTAB for general square matrices. - * - * These iterative solvers are associated with some preconditioners: - * - IdentityPreconditioner - not really useful - * - DiagonalPreconditioner - also called JAcobi preconditioner, work very well on diagonal dominant matrices. - * - IncompleteILUT - incomplete LU factorization with dual thresholding - * - * Such problems can also be solved using the direct sparse decomposition modules: SparseCholesky, CholmodSupport, UmfPackSupport, SuperLUSupport. - * - * \code - * #include - * \endcode - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "src/IterativeLinearSolvers/IterativeSolverBase.h" -#include "src/IterativeLinearSolvers/BasicPreconditioners.h" -#include "src/IterativeLinearSolvers/ConjugateGradient.h" -#include "src/IterativeLinearSolvers/BiCGSTAB.h" -#include "src/IterativeLinearSolvers/IncompleteLUT.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_ITERATIVELINEARSOLVERS_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Jacobi b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Jacobi deleted file mode 100644 index ba8a4dc36a..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Jacobi +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef EIGEN_JACOBI_MODULE_H -#define EIGEN_JACOBI_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup Jacobi_Module Jacobi module - * This module provides Jacobi and Givens rotations. - * - * \code - * #include - * \endcode - * - * In addition to listed classes, it defines the two following MatrixBase methods to apply a Jacobi or Givens rotation: - * - MatrixBase::applyOnTheLeft() - * - MatrixBase::applyOnTheRight(). - */ - -#include "src/Jacobi/Jacobi.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_JACOBI_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LU b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LU deleted file mode 100644 index db57955044..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LU +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef EIGEN_LU_MODULE_H -#define EIGEN_LU_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup LU_Module LU module - * This module includes %LU decomposition and related notions such as matrix inversion and determinant. - * This module defines the following MatrixBase methods: - * - MatrixBase::inverse() - * - MatrixBase::determinant() - * - * \code - * #include - * \endcode - */ - -#include "src/misc/Solve.h" -#include "src/misc/Kernel.h" -#include "src/misc/Image.h" -#include "src/LU/FullPivLU.h" -#include "src/LU/PartialPivLU.h" -#ifdef EIGEN_USE_LAPACKE -#include "src/LU/PartialPivLU_MKL.h" -#endif -#include "src/LU/Determinant.h" -#include "src/LU/Inverse.h" - -#if defined EIGEN_VECTORIZE_SSE - #include "src/LU/arch/Inverse_SSE.h" -#endif - -#ifdef EIGEN2_SUPPORT - #include "src/Eigen2Support/LU.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_LU_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LeastSquares b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LeastSquares deleted file mode 100644 index 35137c25db..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/LeastSquares +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef EIGEN_REGRESSION_MODULE_H -#define EIGEN_REGRESSION_MODULE_H - -#ifndef EIGEN2_SUPPORT -#error LeastSquares is only available in Eigen2 support mode (define EIGEN2_SUPPORT) -#endif - -// exclude from normal eigen3-only documentation -#ifdef EIGEN2_SUPPORT - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include "Eigenvalues" -#include "Geometry" - -/** \defgroup LeastSquares_Module LeastSquares module - * This module provides linear regression and related features. - * - * \code - * #include - * \endcode - */ - -#include "src/Eigen2Support/LeastSquares.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN2_SUPPORT - -#endif // EIGEN_REGRESSION_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/MetisSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/MetisSupport deleted file mode 100644 index 6a113f7a87..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/MetisSupport +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef EIGEN_METISSUPPORT_MODULE_H -#define EIGEN_METISSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -extern "C" { -#include -} - - -/** \ingroup Support_modules - * \defgroup MetisSupport_Module MetisSupport module - * - * \code - * #include - * \endcode - * This module defines an interface to the METIS reordering package (http://glaros.dtc.umn.edu/gkhome/views/metis). - * It can be used just as any other built-in method as explained in \link OrderingMethods_Module here. \endlink - */ - - -#include "src/MetisSupport/MetisSupport.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_METISSUPPORT_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/OrderingMethods b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/OrderingMethods deleted file mode 100644 index 7c0f1fffff..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/OrderingMethods +++ /dev/null @@ -1,66 +0,0 @@ -#ifndef EIGEN_ORDERINGMETHODS_MODULE_H -#define EIGEN_ORDERINGMETHODS_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** - * \defgroup OrderingMethods_Module OrderingMethods module - * - * This module is currently for internal use only - * - * It defines various built-in and external ordering methods for sparse matrices. - * They are typically used to reduce the number of elements during - * the sparse matrix decomposition (LLT, LU, QR). - * Precisely, in a preprocessing step, a permutation matrix P is computed using - * those ordering methods and applied to the columns of the matrix. - * Using for instance the sparse Cholesky decomposition, it is expected that - * the nonzeros elements in LLT(A*P) will be much smaller than that in LLT(A). - * - * - * Usage : - * \code - * #include - * \endcode - * - * A simple usage is as a template parameter in the sparse decomposition classes : - * - * \code - * SparseLU > solver; - * \endcode - * - * \code - * SparseQR > solver; - * \endcode - * - * It is possible as well to call directly a particular ordering method for your own purpose, - * \code - * AMDOrdering ordering; - * PermutationMatrix perm; - * SparseMatrix A; - * //Fill the matrix ... - * - * ordering(A, perm); // Call AMD - * \endcode - * - * \note Some of these methods (like AMD or METIS), need the sparsity pattern - * of the input matrix to be symmetric. When the matrix is structurally unsymmetric, - * Eigen computes internally the pattern of \f$A^T*A\f$ before calling the method. - * If your matrix is already symmetric (at leat in structure), you can avoid that - * by calling the method with a SelfAdjointView type. - * - * \code - * // Call the ordering on the pattern of the lower triangular matrix A - * ordering(A.selfadjointView(), perm); - * \endcode - */ - -#ifndef EIGEN_MPL2_ONLY -#include "src/OrderingMethods/Amd.h" -#endif - -#include "src/OrderingMethods/Ordering.h" -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_ORDERINGMETHODS_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PaStiXSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PaStiXSupport deleted file mode 100644 index 7c616ee5ea..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PaStiXSupport +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef EIGEN_PASTIXSUPPORT_MODULE_H -#define EIGEN_PASTIXSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include -extern "C" { -#include -#include -} - -#ifdef complex -#undef complex -#endif - -/** \ingroup Support_modules - * \defgroup PaStiXSupport_Module PaStiXSupport module - * - * This module provides an interface to the PaSTiX library. - * PaSTiX is a general \b supernodal, \b parallel and \b opensource sparse solver. - * It provides the two following main factorization classes: - * - class PastixLLT : a supernodal, parallel LLt Cholesky factorization. - * - class PastixLDLT: a supernodal, parallel LDLt Cholesky factorization. - * - class PastixLU : a supernodal, parallel LU factorization (optimized for a symmetric pattern). - * - * \code - * #include - * \endcode - * - * In order to use this module, the PaSTiX headers must be accessible from the include paths, and your binary must be linked to the PaSTiX library and its dependencies. - * The dependencies depend on how PaSTiX has been compiled. - * For a cmake based project, you can use our FindPaSTiX.cmake module to help you in this task. - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "src/PaStiXSupport/PaStiXSupport.h" - - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_PASTIXSUPPORT_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PardisoSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PardisoSupport deleted file mode 100644 index 99330ce7a7..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/PardisoSupport +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef EIGEN_PARDISOSUPPORT_MODULE_H -#define EIGEN_PARDISOSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include - -#include - -/** \ingroup Support_modules - * \defgroup PardisoSupport_Module PardisoSupport module - * - * This module brings support for the Intel(R) MKL PARDISO direct sparse solvers. - * - * \code - * #include - * \endcode - * - * In order to use this module, the MKL headers must be accessible from the include paths, and your binary must be linked to the MKL library and its dependencies. - * See this \ref TopicUsingIntelMKL "page" for more information on MKL-Eigen integration. - * - */ - -#include "src/PardisoSupport/PardisoSupport.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_PARDISOSUPPORT_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QR b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QR deleted file mode 100644 index ac5b026935..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QR +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef EIGEN_QR_MODULE_H -#define EIGEN_QR_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include "Cholesky" -#include "Jacobi" -#include "Householder" - -/** \defgroup QR_Module QR module - * - * - * - * This module provides various QR decompositions - * This module also provides some MatrixBase methods, including: - * - MatrixBase::qr(), - * - * \code - * #include - * \endcode - */ - -#include "src/misc/Solve.h" -#include "src/QR/HouseholderQR.h" -#include "src/QR/FullPivHouseholderQR.h" -#include "src/QR/ColPivHouseholderQR.h" -#ifdef EIGEN_USE_LAPACKE -#include "src/QR/HouseholderQR_MKL.h" -#include "src/QR/ColPivHouseholderQR_MKL.h" -#endif - -#ifdef EIGEN2_SUPPORT -#include "src/Eigen2Support/QR.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#ifdef EIGEN2_SUPPORT -#include "Eigenvalues" -#endif - -#endif // EIGEN_QR_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QtAlignedMalloc b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QtAlignedMalloc deleted file mode 100644 index 46f7d83b70..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/QtAlignedMalloc +++ /dev/null @@ -1,34 +0,0 @@ - -#ifndef EIGEN_QTMALLOC_MODULE_H -#define EIGEN_QTMALLOC_MODULE_H - -#include "Core" - -#if (!EIGEN_MALLOC_ALREADY_ALIGNED) - -#include "src/Core/util/DisableStupidWarnings.h" - -void *qMalloc(size_t size) -{ - return Eigen::internal::aligned_malloc(size); -} - -void qFree(void *ptr) -{ - Eigen::internal::aligned_free(ptr); -} - -void *qRealloc(void *ptr, size_t size) -{ - void* newPtr = Eigen::internal::aligned_malloc(size); - memcpy(newPtr, ptr, size); - Eigen::internal::aligned_free(ptr); - return newPtr; -} - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif - -#endif // EIGEN_QTMALLOC_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SPQRSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SPQRSupport deleted file mode 100644 index 77016442ee..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SPQRSupport +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef EIGEN_SPQRSUPPORT_MODULE_H -#define EIGEN_SPQRSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include "SuiteSparseQR.hpp" - -/** \ingroup Support_modules - * \defgroup SPQRSupport_Module SuiteSparseQR module - * - * This module provides an interface to the SPQR library, which is part of the suitesparse package. - * - * \code - * #include - * \endcode - * - * In order to use this module, the SPQR headers must be accessible from the include paths, and your binary must be linked to the SPQR library and its dependencies (Cholmod, AMD, COLAMD,...). - * For a cmake based project, you can use our FindSPQR.cmake and FindCholmod.Cmake modules - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" -#include "src/CholmodSupport/CholmodSupport.h" -#include "src/SPQRSupport/SuiteSparseQRSupport.h" - -#endif diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SVD b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SVD deleted file mode 100644 index fd310017ad..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SVD +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef EIGEN_SVD_MODULE_H -#define EIGEN_SVD_MODULE_H - -#include "QR" -#include "Householder" -#include "Jacobi" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup SVD_Module SVD module - * - * - * - * This module provides SVD decomposition for matrices (both real and complex). - * This decomposition is accessible via the following MatrixBase method: - * - MatrixBase::jacobiSvd() - * - * \code - * #include - * \endcode - */ - -#include "src/misc/Solve.h" -#include "src/SVD/JacobiSVD.h" -#if defined(EIGEN_USE_LAPACKE) && !defined(EIGEN_USE_LAPACKE_STRICT) -#include "src/SVD/JacobiSVD_MKL.h" -#endif -#include "src/SVD/UpperBidiagonalization.h" - -#ifdef EIGEN2_SUPPORT -#include "src/Eigen2Support/SVD.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_SVD_MODULE_H -/* vim: set filetype=cpp et sw=2 ts=2 ai: */ diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Sparse b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Sparse deleted file mode 100644 index 7cc9c09133..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/Sparse +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef EIGEN_SPARSE_MODULE_H -#define EIGEN_SPARSE_MODULE_H - -/** \defgroup Sparse_Module Sparse meta-module - * - * Meta-module including all related modules: - * - \ref SparseCore_Module - * - \ref OrderingMethods_Module - * - \ref SparseCholesky_Module - * - \ref SparseLU_Module - * - \ref SparseQR_Module - * - \ref IterativeLinearSolvers_Module - * - * \code - * #include - * \endcode - */ - -#include "SparseCore" -#include "OrderingMethods" -#include "SparseCholesky" -#include "SparseLU" -#include "SparseQR" -#include "IterativeLinearSolvers" - -#endif // EIGEN_SPARSE_MODULE_H - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCholesky b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCholesky deleted file mode 100644 index 9f5056aa1a..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCholesky +++ /dev/null @@ -1,47 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2013 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSECHOLESKY_MODULE_H -#define EIGEN_SPARSECHOLESKY_MODULE_H - -#include "SparseCore" -#include "OrderingMethods" - -#include "src/Core/util/DisableStupidWarnings.h" - -/** - * \defgroup SparseCholesky_Module SparseCholesky module - * - * This module currently provides two variants of the direct sparse Cholesky decomposition for selfadjoint (hermitian) matrices. - * Those decompositions are accessible via the following classes: - * - SimplicialLLt, - * - SimplicialLDLt - * - * Such problems can also be solved using the ConjugateGradient solver from the IterativeLinearSolvers module. - * - * \code - * #include - * \endcode - */ - -#ifdef EIGEN_MPL2_ONLY -#error The SparseCholesky module has nothing to offer in MPL2 only mode -#endif - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" -#include "src/SparseCholesky/SimplicialCholesky.h" - -#ifndef EIGEN_MPL2_ONLY -#include "src/SparseCholesky/SimplicialCholesky_impl.h" -#endif - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_SPARSECHOLESKY_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCore b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCore deleted file mode 100644 index 9b5be5e15a..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseCore +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef EIGEN_SPARSECORE_MODULE_H -#define EIGEN_SPARSECORE_MODULE_H - -#include "Core" - -#include "src/Core/util/DisableStupidWarnings.h" - -#include -#include -#include -#include -#include - -/** - * \defgroup SparseCore_Module SparseCore module - * - * This module provides a sparse matrix representation, and basic associatd matrix manipulations - * and operations. - * - * See the \ref TutorialSparse "Sparse tutorial" - * - * \code - * #include - * \endcode - * - * This module depends on: Core. - */ - -namespace Eigen { - -/** The type used to identify a general sparse storage. */ -struct Sparse {}; - -} - -#include "src/SparseCore/SparseUtil.h" -#include "src/SparseCore/SparseMatrixBase.h" -#include "src/SparseCore/CompressedStorage.h" -#include "src/SparseCore/AmbiVector.h" -#include "src/SparseCore/SparseMatrix.h" -#include "src/SparseCore/MappedSparseMatrix.h" -#include "src/SparseCore/SparseVector.h" -#include "src/SparseCore/SparseBlock.h" -#include "src/SparseCore/SparseTranspose.h" -#include "src/SparseCore/SparseCwiseUnaryOp.h" -#include "src/SparseCore/SparseCwiseBinaryOp.h" -#include "src/SparseCore/SparseDot.h" -#include "src/SparseCore/SparsePermutation.h" -#include "src/SparseCore/SparseRedux.h" -#include "src/SparseCore/SparseFuzzy.h" -#include "src/SparseCore/ConservativeSparseSparseProduct.h" -#include "src/SparseCore/SparseSparseProductWithPruning.h" -#include "src/SparseCore/SparseProduct.h" -#include "src/SparseCore/SparseDenseProduct.h" -#include "src/SparseCore/SparseDiagonalProduct.h" -#include "src/SparseCore/SparseTriangularView.h" -#include "src/SparseCore/SparseSelfAdjointView.h" -#include "src/SparseCore/TriangularSolver.h" -#include "src/SparseCore/SparseView.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_SPARSECORE_MODULE_H - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseLU b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseLU deleted file mode 100644 index 8527a49bd8..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseLU +++ /dev/null @@ -1,49 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2012 Désiré Nuentsa-Wakam -// Copyright (C) 2012 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SPARSELU_MODULE_H -#define EIGEN_SPARSELU_MODULE_H - -#include "SparseCore" - -/** - * \defgroup SparseLU_Module SparseLU module - * This module defines a supernodal factorization of general sparse matrices. - * The code is fully optimized for supernode-panel updates with specialized kernels. - * Please, see the documentation of the SparseLU class for more details. - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -// Ordering interface -#include "OrderingMethods" - -#include "src/SparseLU/SparseLU_gemm_kernel.h" - -#include "src/SparseLU/SparseLU_Structs.h" -#include "src/SparseLU/SparseLU_SupernodalMatrix.h" -#include "src/SparseLU/SparseLUImpl.h" -#include "src/SparseCore/SparseColEtree.h" -#include "src/SparseLU/SparseLU_Memory.h" -#include "src/SparseLU/SparseLU_heap_relax_snode.h" -#include "src/SparseLU/SparseLU_relax_snode.h" -#include "src/SparseLU/SparseLU_pivotL.h" -#include "src/SparseLU/SparseLU_panel_dfs.h" -#include "src/SparseLU/SparseLU_kernel_bmod.h" -#include "src/SparseLU/SparseLU_panel_bmod.h" -#include "src/SparseLU/SparseLU_column_dfs.h" -#include "src/SparseLU/SparseLU_column_bmod.h" -#include "src/SparseLU/SparseLU_copy_to_ucol.h" -#include "src/SparseLU/SparseLU_pruneL.h" -#include "src/SparseLU/SparseLU_Utils.h" -#include "src/SparseLU/SparseLU.h" - -#endif // EIGEN_SPARSELU_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseQR b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseQR deleted file mode 100644 index 4ee42065ee..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SparseQR +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef EIGEN_SPARSEQR_MODULE_H -#define EIGEN_SPARSEQR_MODULE_H - -#include "SparseCore" -#include "OrderingMethods" -#include "src/Core/util/DisableStupidWarnings.h" - -/** \defgroup SparseQR_Module SparseQR module - * \brief Provides QR decomposition for sparse matrices - * - * This module provides a simplicial version of the left-looking Sparse QR decomposition. - * The columns of the input matrix should be reordered to limit the fill-in during the - * decomposition. Built-in methods (COLAMD, AMD) or external methods (METIS) can be used to this end. - * See the \link OrderingMethods_Module OrderingMethods\endlink module for the list - * of built-in and external ordering methods. - * - * \code - * #include - * \endcode - * - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "OrderingMethods" -#include "src/SparseCore/SparseColEtree.h" -#include "src/SparseQR/SparseQR.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdDeque b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdDeque deleted file mode 100644 index f27234778f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdDeque +++ /dev/null @@ -1,27 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// Copyright (C) 2009 Hauke Heibel -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_STDDEQUE_MODULE_H -#define EIGEN_STDDEQUE_MODULE_H - -#include "Core" -#include - -#if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ - -#define EIGEN_DEFINE_STL_DEQUE_SPECIALIZATION(...) - -#else - -#include "src/StlSupport/StdDeque.h" - -#endif - -#endif // EIGEN_STDDEQUE_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdList b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdList deleted file mode 100644 index 225c1e18f8..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdList +++ /dev/null @@ -1,26 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Hauke Heibel -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_STDLIST_MODULE_H -#define EIGEN_STDLIST_MODULE_H - -#include "Core" -#include - -#if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ - -#define EIGEN_DEFINE_STL_LIST_SPECIALIZATION(...) - -#else - -#include "src/StlSupport/StdList.h" - -#endif - -#endif // EIGEN_STDLIST_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdVector b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdVector deleted file mode 100644 index 6b22627f6f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/StdVector +++ /dev/null @@ -1,27 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// Copyright (C) 2009 Hauke Heibel -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_STDVECTOR_MODULE_H -#define EIGEN_STDVECTOR_MODULE_H - -#include "Core" -#include - -#if (defined(_MSC_VER) && defined(_WIN64)) /* MSVC auto aligns in 64 bit builds */ - -#define EIGEN_DEFINE_STL_VECTOR_SPECIALIZATION(...) - -#else - -#include "src/StlSupport/StdVector.h" - -#endif - -#endif // EIGEN_STDVECTOR_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SuperLUSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SuperLUSupport deleted file mode 100644 index 575e14fbc2..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/SuperLUSupport +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef EIGEN_SUPERLUSUPPORT_MODULE_H -#define EIGEN_SUPERLUSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -#ifdef EMPTY -#define EIGEN_EMPTY_WAS_ALREADY_DEFINED -#endif - -typedef int int_t; -#include -#include -#include - -// slu_util.h defines a preprocessor token named EMPTY which is really polluting, -// so we remove it in favor of a SUPERLU_EMPTY token. -// If EMPTY was already defined then we don't undef it. - -#if defined(EIGEN_EMPTY_WAS_ALREADY_DEFINED) -# undef EIGEN_EMPTY_WAS_ALREADY_DEFINED -#elif defined(EMPTY) -# undef EMPTY -#endif - -#define SUPERLU_EMPTY (-1) - -namespace Eigen { struct SluMatrix; } - -/** \ingroup Support_modules - * \defgroup SuperLUSupport_Module SuperLUSupport module - * - * This module provides an interface to the SuperLU library. - * It provides the following factorization class: - * - class SuperLU: a supernodal sequential LU factorization. - * - class SuperILU: a supernodal sequential incomplete LU factorization (to be used as a preconditioner for iterative methods). - * - * \warning When including this module, you have to use SUPERLU_EMPTY instead of EMPTY which is no longer defined because it is too polluting. - * - * \code - * #include - * \endcode - * - * In order to use this module, the superlu headers must be accessible from the include paths, and your binary must be linked to the superlu library and its dependencies. - * The dependencies depend on how superlu has been compiled. - * For a cmake based project, you can use our FindSuperLU.cmake module to help you in this task. - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "src/SuperLUSupport/SuperLUSupport.h" - - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_SUPERLUSUPPORT_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/UmfPackSupport b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/UmfPackSupport deleted file mode 100644 index 984f64a841..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/UmfPackSupport +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef EIGEN_UMFPACKSUPPORT_MODULE_H -#define EIGEN_UMFPACKSUPPORT_MODULE_H - -#include "SparseCore" - -#include "src/Core/util/DisableStupidWarnings.h" - -extern "C" { -#include -} - -/** \ingroup Support_modules - * \defgroup UmfPackSupport_Module UmfPackSupport module - * - * This module provides an interface to the UmfPack library which is part of the suitesparse package. - * It provides the following factorization class: - * - class UmfPackLU: a multifrontal sequential LU factorization. - * - * \code - * #include - * \endcode - * - * In order to use this module, the umfpack headers must be accessible from the include paths, and your binary must be linked to the umfpack library and its dependencies. - * The dependencies depend on how umfpack has been compiled. - * For a cmake based project, you can use our FindUmfPack.cmake module to help you in this task. - * - */ - -#include "src/misc/Solve.h" -#include "src/misc/SparseSolve.h" - -#include "src/UmfPackSupport/UmfPackSupport.h" - -#include "src/Core/util/ReenableStupidWarnings.h" - -#endif // EIGEN_UMFPACKSUPPORT_MODULE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LDLT.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LDLT.h deleted file mode 100644 index d19cb3968d..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LDLT.h +++ /dev/null @@ -1,600 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2011 Gael Guennebaud -// Copyright (C) 2009 Keir Mierle -// Copyright (C) 2009 Benoit Jacob -// Copyright (C) 2011 Timothy E. Holy -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_LDLT_H -#define EIGEN_LDLT_H - -namespace Eigen { - -namespace internal { -template struct LDLT_Traits; -} - -/** \ingroup Cholesky_Module - * - * \class LDLT - * - * \brief Robust Cholesky decomposition of a matrix with pivoting - * - * \param MatrixType the type of the matrix of which to compute the LDL^T Cholesky decomposition - * \param UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper. - * The other triangular part won't be read. - * - * Perform a robust Cholesky decomposition of a positive semidefinite or negative semidefinite - * matrix \f$ A \f$ such that \f$ A = P^TLDL^*P \f$, where P is a permutation matrix, L - * is lower triangular with a unit diagonal and D is a diagonal matrix. - * - * The decomposition uses pivoting to ensure stability, so that L will have - * zeros in the bottom right rank(A) - n submatrix. Avoiding the square root - * on D also stabilizes the computation. - * - * Remember that Cholesky decompositions are not rank-revealing. Also, do not use a Cholesky - * decomposition to determine whether a system of equations has a solution. - * - * \sa MatrixBase::ldlt(), class LLT - */ -template class LDLT -{ - public: - typedef _MatrixType MatrixType; - enum { - RowsAtCompileTime = MatrixType::RowsAtCompileTime, - ColsAtCompileTime = MatrixType::ColsAtCompileTime, - Options = MatrixType::Options & ~RowMajorBit, // these are the options for the TmpMatrixType, we need a ColMajor matrix here! - MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, - MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, - UpLo = _UpLo - }; - typedef typename MatrixType::Scalar Scalar; - typedef typename NumTraits::Real RealScalar; - typedef typename MatrixType::Index Index; - typedef Matrix TmpMatrixType; - - typedef Transpositions TranspositionType; - typedef PermutationMatrix PermutationType; - - typedef internal::LDLT_Traits Traits; - - /** \brief Default Constructor. - * - * The default constructor is useful in cases in which the user intends to - * perform decompositions via LDLT::compute(const MatrixType&). - */ - LDLT() : m_matrix(), m_transpositions(), m_isInitialized(false) {} - - /** \brief Default Constructor with memory preallocation - * - * Like the default constructor but with preallocation of the internal data - * according to the specified problem \a size. - * \sa LDLT() - */ - LDLT(Index size) - : m_matrix(size, size), - m_transpositions(size), - m_temporary(size), - m_isInitialized(false) - {} - - /** \brief Constructor with decomposition - * - * This calculates the decomposition for the input \a matrix. - * \sa LDLT(Index size) - */ - LDLT(const MatrixType& matrix) - : m_matrix(matrix.rows(), matrix.cols()), - m_transpositions(matrix.rows()), - m_temporary(matrix.rows()), - m_isInitialized(false) - { - compute(matrix); - } - - /** Clear any existing decomposition - * \sa rankUpdate(w,sigma) - */ - void setZero() - { - m_isInitialized = false; - } - - /** \returns a view of the upper triangular matrix U */ - inline typename Traits::MatrixU matrixU() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return Traits::getU(m_matrix); - } - - /** \returns a view of the lower triangular matrix L */ - inline typename Traits::MatrixL matrixL() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return Traits::getL(m_matrix); - } - - /** \returns the permutation matrix P as a transposition sequence. - */ - inline const TranspositionType& transpositionsP() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return m_transpositions; - } - - /** \returns the coefficients of the diagonal matrix D */ - inline Diagonal vectorD() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return m_matrix.diagonal(); - } - - /** \returns true if the matrix is positive (semidefinite) */ - inline bool isPositive() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return m_sign == 1; - } - - #ifdef EIGEN2_SUPPORT - inline bool isPositiveDefinite() const - { - return isPositive(); - } - #endif - - /** \returns true if the matrix is negative (semidefinite) */ - inline bool isNegative(void) const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return m_sign == -1; - } - - /** \returns a solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * This function also supports in-place solves using the syntax x = decompositionObject.solve(x) . - * - * \note_about_checking_solutions - * - * More precisely, this method solves \f$ A x = b \f$ using the decomposition \f$ A = P^T L D L^* P \f$ - * by solving the systems \f$ P^T y_1 = b \f$, \f$ L y_2 = y_1 \f$, \f$ D y_3 = y_2 \f$, - * \f$ L^* y_4 = y_3 \f$ and \f$ P x = y_4 \f$ in succession. If the matrix \f$ A \f$ is singular, then - * \f$ D \f$ will also be singular (all the other matrices are invertible). In that case, the - * least-square solution of \f$ D y_3 = y_2 \f$ is computed. This does not mean that this function - * computes the least-square solution of \f$ A x = b \f$ is \f$ A \f$ is singular. - * - * \sa MatrixBase::ldlt() - */ - template - inline const internal::solve_retval - solve(const MatrixBase& b) const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - eigen_assert(m_matrix.rows()==b.rows() - && "LDLT::solve(): invalid number of rows of the right hand side matrix b"); - return internal::solve_retval(*this, b.derived()); - } - - #ifdef EIGEN2_SUPPORT - template - bool solve(const MatrixBase& b, ResultType *result) const - { - *result = this->solve(b); - return true; - } - #endif - - template - bool solveInPlace(MatrixBase &bAndX) const; - - LDLT& compute(const MatrixType& matrix); - - template - LDLT& rankUpdate(const MatrixBase& w, const RealScalar& alpha=1); - - /** \returns the internal LDLT decomposition matrix - * - * TODO: document the storage layout - */ - inline const MatrixType& matrixLDLT() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return m_matrix; - } - - MatrixType reconstructedMatrix() const; - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - /** \brief Reports whether previous computation was successful. - * - * \returns \c Success if computation was succesful, - * \c NumericalIssue if the matrix.appears to be negative. - */ - ComputationInfo info() const - { - eigen_assert(m_isInitialized && "LDLT is not initialized."); - return Success; - } - - protected: - - /** \internal - * Used to compute and store the Cholesky decomposition A = L D L^* = U^* D U. - * The strict upper part is used during the decomposition, the strict lower - * part correspond to the coefficients of L (its diagonal is equal to 1 and - * is not stored), and the diagonal entries correspond to D. - */ - MatrixType m_matrix; - TranspositionType m_transpositions; - TmpMatrixType m_temporary; - int m_sign; - bool m_isInitialized; -}; - -namespace internal { - -template struct ldlt_inplace; - -template<> struct ldlt_inplace -{ - template - static bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, int* sign=0) - { - using std::abs; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::RealScalar RealScalar; - typedef typename MatrixType::Index Index; - eigen_assert(mat.rows()==mat.cols()); - const Index size = mat.rows(); - - if (size <= 1) - { - transpositions.setIdentity(); - if(sign) - *sign = numext::real(mat.coeff(0,0))>0 ? 1:-1; - return true; - } - - RealScalar cutoff(0), biggest_in_corner; - - for (Index k = 0; k < size; ++k) - { - // Find largest diagonal element - Index index_of_biggest_in_corner; - biggest_in_corner = mat.diagonal().tail(size-k).cwiseAbs().maxCoeff(&index_of_biggest_in_corner); - index_of_biggest_in_corner += k; - - if(k == 0) - { - // The biggest overall is the point of reference to which further diagonals - // are compared; if any diagonal is negligible compared - // to the largest overall, the algorithm bails. - cutoff = abs(NumTraits::epsilon() * biggest_in_corner); - } - - // Finish early if the matrix is not full rank. - if(biggest_in_corner < cutoff) - { - for(Index i = k; i < size; i++) transpositions.coeffRef(i) = i; - if(sign) *sign = 0; - break; - } - - transpositions.coeffRef(k) = index_of_biggest_in_corner; - if(k != index_of_biggest_in_corner) - { - // apply the transposition while taking care to consider only - // the lower triangular part - Index s = size-index_of_biggest_in_corner-1; // trailing size after the biggest element - mat.row(k).head(k).swap(mat.row(index_of_biggest_in_corner).head(k)); - mat.col(k).tail(s).swap(mat.col(index_of_biggest_in_corner).tail(s)); - std::swap(mat.coeffRef(k,k),mat.coeffRef(index_of_biggest_in_corner,index_of_biggest_in_corner)); - for(int i=k+1;i::IsComplex) - mat.coeffRef(index_of_biggest_in_corner,k) = numext::conj(mat.coeff(index_of_biggest_in_corner,k)); - } - - // partition the matrix: - // A00 | - | - - // lu = A10 | A11 | - - // A20 | A21 | A22 - Index rs = size - k - 1; - Block A21(mat,k+1,k,rs,1); - Block A10(mat,k,0,1,k); - Block A20(mat,k+1,0,rs,k); - - if(k>0) - { - temp.head(k) = mat.diagonal().head(k).asDiagonal() * A10.adjoint(); - mat.coeffRef(k,k) -= (A10 * temp.head(k)).value(); - if(rs>0) - A21.noalias() -= A20 * temp.head(k); - } - if((rs>0) && (abs(mat.coeffRef(k,k)) > cutoff)) - A21 /= mat.coeffRef(k,k); - - if(sign) - { - // LDLT is not guaranteed to work for indefinite matrices, but let's try to get the sign right - int newSign = numext::real(mat.diagonal().coeff(index_of_biggest_in_corner)) > 0; - if(k == 0) - *sign = newSign; - else if(*sign != newSign) - *sign = 0; - } - } - - return true; - } - - // Reference for the algorithm: Davis and Hager, "Multiple Rank - // Modifications of a Sparse Cholesky Factorization" (Algorithm 1) - // Trivial rearrangements of their computations (Timothy E. Holy) - // allow their algorithm to work for rank-1 updates even if the - // original matrix is not of full rank. - // Here only rank-1 updates are implemented, to reduce the - // requirement for intermediate storage and improve accuracy - template - static bool updateInPlace(MatrixType& mat, MatrixBase& w, const typename MatrixType::RealScalar& sigma=1) - { - using numext::isfinite; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::RealScalar RealScalar; - typedef typename MatrixType::Index Index; - - const Index size = mat.rows(); - eigen_assert(mat.cols() == size && w.size()==size); - - RealScalar alpha = 1; - - // Apply the update - for (Index j = 0; j < size; j++) - { - // Check for termination due to an original decomposition of low-rank - if (!(isfinite)(alpha)) - break; - - // Update the diagonal terms - RealScalar dj = numext::real(mat.coeff(j,j)); - Scalar wj = w.coeff(j); - RealScalar swj2 = sigma*numext::abs2(wj); - RealScalar gamma = dj*alpha + swj2; - - mat.coeffRef(j,j) += swj2/alpha; - alpha += swj2/dj; - - - // Update the terms of L - Index rs = size-j-1; - w.tail(rs) -= wj * mat.col(j).tail(rs); - if(gamma != 0) - mat.col(j).tail(rs) += (sigma*numext::conj(wj)/gamma)*w.tail(rs); - } - return true; - } - - template - static bool update(MatrixType& mat, const TranspositionType& transpositions, Workspace& tmp, const WType& w, const typename MatrixType::RealScalar& sigma=1) - { - // Apply the permutation to the input w - tmp = transpositions * w; - - return ldlt_inplace::updateInPlace(mat,tmp,sigma); - } -}; - -template<> struct ldlt_inplace -{ - template - static EIGEN_STRONG_INLINE bool unblocked(MatrixType& mat, TranspositionType& transpositions, Workspace& temp, int* sign=0) - { - Transpose matt(mat); - return ldlt_inplace::unblocked(matt, transpositions, temp, sign); - } - - template - static EIGEN_STRONG_INLINE bool update(MatrixType& mat, TranspositionType& transpositions, Workspace& tmp, WType& w, const typename MatrixType::RealScalar& sigma=1) - { - Transpose matt(mat); - return ldlt_inplace::update(matt, transpositions, tmp, w.conjugate(), sigma); - } -}; - -template struct LDLT_Traits -{ - typedef const TriangularView MatrixL; - typedef const TriangularView MatrixU; - static inline MatrixL getL(const MatrixType& m) { return m; } - static inline MatrixU getU(const MatrixType& m) { return m.adjoint(); } -}; - -template struct LDLT_Traits -{ - typedef const TriangularView MatrixL; - typedef const TriangularView MatrixU; - static inline MatrixL getL(const MatrixType& m) { return m.adjoint(); } - static inline MatrixU getU(const MatrixType& m) { return m; } -}; - -} // end namespace internal - -/** Compute / recompute the LDLT decomposition A = L D L^* = U^* D U of \a matrix - */ -template -LDLT& LDLT::compute(const MatrixType& a) -{ - eigen_assert(a.rows()==a.cols()); - const Index size = a.rows(); - - m_matrix = a; - - m_transpositions.resize(size); - m_isInitialized = false; - m_temporary.resize(size); - - internal::ldlt_inplace::unblocked(m_matrix, m_transpositions, m_temporary, &m_sign); - - m_isInitialized = true; - return *this; -} - -/** Update the LDLT decomposition: given A = L D L^T, efficiently compute the decomposition of A + sigma w w^T. - * \param w a vector to be incorporated into the decomposition. - * \param sigma a scalar, +1 for updates and -1 for "downdates," which correspond to removing previously-added column vectors. Optional; default value is +1. - * \sa setZero() - */ -template -template -LDLT& LDLT::rankUpdate(const MatrixBase& w, const typename NumTraits::Real& sigma) -{ - const Index size = w.rows(); - if (m_isInitialized) - { - eigen_assert(m_matrix.rows()==size); - } - else - { - m_matrix.resize(size,size); - m_matrix.setZero(); - m_transpositions.resize(size); - for (Index i = 0; i < size; i++) - m_transpositions.coeffRef(i) = i; - m_temporary.resize(size); - m_sign = sigma>=0 ? 1 : -1; - m_isInitialized = true; - } - - internal::ldlt_inplace::update(m_matrix, m_transpositions, m_temporary, w, sigma); - - return *this; -} - -namespace internal { -template -struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef LDLT<_MatrixType,_UpLo> LDLTType; - EIGEN_MAKE_SOLVE_HELPERS(LDLTType,Rhs) - - template void evalTo(Dest& dst) const - { - eigen_assert(rhs().rows() == dec().matrixLDLT().rows()); - // dst = P b - dst = dec().transpositionsP() * rhs(); - - // dst = L^-1 (P b) - dec().matrixL().solveInPlace(dst); - - // dst = D^-1 (L^-1 P b) - // more precisely, use pseudo-inverse of D (see bug 241) - using std::abs; - using std::max; - typedef typename LDLTType::MatrixType MatrixType; - typedef typename LDLTType::Scalar Scalar; - typedef typename LDLTType::RealScalar RealScalar; - const Diagonal vectorD = dec().vectorD(); - RealScalar tolerance = (max)(vectorD.array().abs().maxCoeff() * NumTraits::epsilon(), - RealScalar(1) / NumTraits::highest()); // motivated by LAPACK's xGELSS - for (Index i = 0; i < vectorD.size(); ++i) { - if(abs(vectorD(i)) > tolerance) - dst.row(i) /= vectorD(i); - else - dst.row(i).setZero(); - } - - // dst = L^-T (D^-1 L^-1 P b) - dec().matrixU().solveInPlace(dst); - - // dst = P^-1 (L^-T D^-1 L^-1 P b) = A^-1 b - dst = dec().transpositionsP().transpose() * dst; - } -}; -} - -/** \internal use x = ldlt_object.solve(x); - * - * This is the \em in-place version of solve(). - * - * \param bAndX represents both the right-hand side matrix b and result x. - * - * \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD. - * - * This version avoids a copy when the right hand side matrix b is not - * needed anymore. - * - * \sa LDLT::solve(), MatrixBase::ldlt() - */ -template -template -bool LDLT::solveInPlace(MatrixBase &bAndX) const -{ - eigen_assert(m_isInitialized && "LDLT is not initialized."); - eigen_assert(m_matrix.rows() == bAndX.rows()); - - bAndX = this->solve(bAndX); - - return true; -} - -/** \returns the matrix represented by the decomposition, - * i.e., it returns the product: P^T L D L^* P. - * This function is provided for debug purpose. */ -template -MatrixType LDLT::reconstructedMatrix() const -{ - eigen_assert(m_isInitialized && "LDLT is not initialized."); - const Index size = m_matrix.rows(); - MatrixType res(size,size); - - // P - res.setIdentity(); - res = transpositionsP() * res; - // L^* P - res = matrixU() * res; - // D(L^*P) - res = vectorD().asDiagonal() * res; - // L(DL^*P) - res = matrixL() * res; - // P^T (LDL^*P) - res = transpositionsP().transpose() * res; - - return res; -} - -/** \cholesky_module - * \returns the Cholesky decomposition with full pivoting without square root of \c *this - */ -template -inline const LDLT::PlainObject, UpLo> -SelfAdjointView::ldlt() const -{ - return LDLT(m_matrix); -} - -/** \cholesky_module - * \returns the Cholesky decomposition with full pivoting without square root of \c *this - */ -template -inline const LDLT::PlainObject> -MatrixBase::ldlt() const -{ - return LDLT(derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_LDLT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT.h deleted file mode 100644 index 0fde2addb4..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT.h +++ /dev/null @@ -1,490 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_LLT_H -#define EIGEN_LLT_H - -namespace Eigen { - -namespace internal{ -template struct LLT_Traits; -} - -/** \ingroup Cholesky_Module - * - * \class LLT - * - * \brief Standard Cholesky decomposition (LL^T) of a matrix and associated features - * - * \param MatrixType the type of the matrix of which we are computing the LL^T Cholesky decomposition - * \param UpLo the triangular part that will be used for the decompositon: Lower (default) or Upper. - * The other triangular part won't be read. - * - * This class performs a LL^T Cholesky decomposition of a symmetric, positive definite - * matrix A such that A = LL^* = U^*U, where L is lower triangular. - * - * While the Cholesky decomposition is particularly useful to solve selfadjoint problems like D^*D x = b, - * for that purpose, we recommend the Cholesky decomposition without square root which is more stable - * and even faster. Nevertheless, this standard Cholesky decomposition remains useful in many other - * situations like generalised eigen problems with hermitian matrices. - * - * Remember that Cholesky decompositions are not rank-revealing. This LLT decomposition is only stable on positive definite matrices, - * use LDLT instead for the semidefinite case. Also, do not use a Cholesky decomposition to determine whether a system of equations - * has a solution. - * - * Example: \include LLT_example.cpp - * Output: \verbinclude LLT_example.out - * - * \sa MatrixBase::llt(), class LDLT - */ - /* HEY THIS DOX IS DISABLED BECAUSE THERE's A BUG EITHER HERE OR IN LDLT ABOUT THAT (OR BOTH) - * Note that during the decomposition, only the upper triangular part of A is considered. Therefore, - * the strict lower part does not have to store correct values. - */ -template class LLT -{ - public: - typedef _MatrixType MatrixType; - enum { - RowsAtCompileTime = MatrixType::RowsAtCompileTime, - ColsAtCompileTime = MatrixType::ColsAtCompileTime, - Options = MatrixType::Options, - MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime - }; - typedef typename MatrixType::Scalar Scalar; - typedef typename NumTraits::Real RealScalar; - typedef typename MatrixType::Index Index; - - enum { - PacketSize = internal::packet_traits::size, - AlignmentMask = int(PacketSize)-1, - UpLo = _UpLo - }; - - typedef internal::LLT_Traits Traits; - - /** - * \brief Default Constructor. - * - * The default constructor is useful in cases in which the user intends to - * perform decompositions via LLT::compute(const MatrixType&). - */ - LLT() : m_matrix(), m_isInitialized(false) {} - - /** \brief Default Constructor with memory preallocation - * - * Like the default constructor but with preallocation of the internal data - * according to the specified problem \a size. - * \sa LLT() - */ - LLT(Index size) : m_matrix(size, size), - m_isInitialized(false) {} - - LLT(const MatrixType& matrix) - : m_matrix(matrix.rows(), matrix.cols()), - m_isInitialized(false) - { - compute(matrix); - } - - /** \returns a view of the upper triangular matrix U */ - inline typename Traits::MatrixU matrixU() const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - return Traits::getU(m_matrix); - } - - /** \returns a view of the lower triangular matrix L */ - inline typename Traits::MatrixL matrixL() const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - return Traits::getL(m_matrix); - } - - /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * Since this LLT class assumes anyway that the matrix A is invertible, the solution - * theoretically exists and is unique regardless of b. - * - * Example: \include LLT_solve.cpp - * Output: \verbinclude LLT_solve.out - * - * \sa solveInPlace(), MatrixBase::llt() - */ - template - inline const internal::solve_retval - solve(const MatrixBase& b) const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - eigen_assert(m_matrix.rows()==b.rows() - && "LLT::solve(): invalid number of rows of the right hand side matrix b"); - return internal::solve_retval(*this, b.derived()); - } - - #ifdef EIGEN2_SUPPORT - template - bool solve(const MatrixBase& b, ResultType *result) const - { - *result = this->solve(b); - return true; - } - - bool isPositiveDefinite() const { return true; } - #endif - - template - void solveInPlace(MatrixBase &bAndX) const; - - LLT& compute(const MatrixType& matrix); - - /** \returns the LLT decomposition matrix - * - * TODO: document the storage layout - */ - inline const MatrixType& matrixLLT() const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - return m_matrix; - } - - MatrixType reconstructedMatrix() const; - - - /** \brief Reports whether previous computation was successful. - * - * \returns \c Success if computation was succesful, - * \c NumericalIssue if the matrix.appears to be negative. - */ - ComputationInfo info() const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - return m_info; - } - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - template - LLT rankUpdate(const VectorType& vec, const RealScalar& sigma = 1); - - protected: - /** \internal - * Used to compute and store L - * The strict upper part is not used and even not initialized. - */ - MatrixType m_matrix; - bool m_isInitialized; - ComputationInfo m_info; -}; - -namespace internal { - -template struct llt_inplace; - -template -static typename MatrixType::Index llt_rank_update_lower(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) -{ - using std::sqrt; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::RealScalar RealScalar; - typedef typename MatrixType::Index Index; - typedef typename MatrixType::ColXpr ColXpr; - typedef typename internal::remove_all::type ColXprCleaned; - typedef typename ColXprCleaned::SegmentReturnType ColXprSegment; - typedef Matrix TempVectorType; - typedef typename TempVectorType::SegmentReturnType TempVecSegment; - - Index n = mat.cols(); - eigen_assert(mat.rows()==n && vec.size()==n); - - TempVectorType temp; - - if(sigma>0) - { - // This version is based on Givens rotations. - // It is faster than the other one below, but only works for updates, - // i.e., for sigma > 0 - temp = sqrt(sigma) * vec; - - for(Index i=0; i g; - g.makeGivens(mat(i,i), -temp(i), &mat(i,i)); - - Index rs = n-i-1; - if(rs>0) - { - ColXprSegment x(mat.col(i).tail(rs)); - TempVecSegment y(temp.tail(rs)); - apply_rotation_in_the_plane(x, y, g); - } - } - } - else - { - temp = vec; - RealScalar beta = 1; - for(Index j=0; j struct llt_inplace -{ - typedef typename NumTraits::Real RealScalar; - template - static typename MatrixType::Index unblocked(MatrixType& mat) - { - using std::sqrt; - typedef typename MatrixType::Index Index; - - eigen_assert(mat.rows()==mat.cols()); - const Index size = mat.rows(); - for(Index k = 0; k < size; ++k) - { - Index rs = size-k-1; // remaining size - - Block A21(mat,k+1,k,rs,1); - Block A10(mat,k,0,1,k); - Block A20(mat,k+1,0,rs,k); - - RealScalar x = numext::real(mat.coeff(k,k)); - if (k>0) x -= A10.squaredNorm(); - if (x<=RealScalar(0)) - return k; - mat.coeffRef(k,k) = x = sqrt((double)x); - if (k>0 && rs>0) A21.noalias() -= A20 * A10.adjoint(); - if (rs>0) A21 *= RealScalar(1)/x; - } - return -1; - } - - template - static typename MatrixType::Index blocked(MatrixType& m) - { - typedef typename MatrixType::Index Index; - eigen_assert(m.rows()==m.cols()); - Index size = m.rows(); - if(size<32) - return unblocked(m); - - Index blockSize = size/8; - blockSize = (blockSize/16)*16; - blockSize = (std::min)((std::max)(blockSize,Index(8)), Index(128)); - - for (Index k=0; k A11(m,k, k, bs,bs); - Block A21(m,k+bs,k, rs,bs); - Block A22(m,k+bs,k+bs,rs,rs); - - Index ret; - if((ret=unblocked(A11))>=0) return k+ret; - if(rs>0) A11.adjoint().template triangularView().template solveInPlace(A21); - if(rs>0) A22.template selfadjointView().rankUpdate(A21,-1); // bottleneck - } - return -1; - } - - template - static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) - { - return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); - } -}; - -template struct llt_inplace -{ - typedef typename NumTraits::Real RealScalar; - - template - static EIGEN_STRONG_INLINE typename MatrixType::Index unblocked(MatrixType& mat) - { - Transpose matt(mat); - return llt_inplace::unblocked(matt); - } - template - static EIGEN_STRONG_INLINE typename MatrixType::Index blocked(MatrixType& mat) - { - Transpose matt(mat); - return llt_inplace::blocked(matt); - } - template - static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const RealScalar& sigma) - { - Transpose matt(mat); - return llt_inplace::rankUpdate(matt, vec.conjugate(), sigma); - } -}; - -template struct LLT_Traits -{ - typedef const TriangularView MatrixL; - typedef const TriangularView MatrixU; - static inline MatrixL getL(const MatrixType& m) { return m; } - static inline MatrixU getU(const MatrixType& m) { return m.adjoint(); } - static bool inplace_decomposition(MatrixType& m) - { return llt_inplace::blocked(m)==-1; } -}; - -template struct LLT_Traits -{ - typedef const TriangularView MatrixL; - typedef const TriangularView MatrixU; - static inline MatrixL getL(const MatrixType& m) { return m.adjoint(); } - static inline MatrixU getU(const MatrixType& m) { return m; } - static bool inplace_decomposition(MatrixType& m) - { return llt_inplace::blocked(m)==-1; } -}; - -} // end namespace internal - -/** Computes / recomputes the Cholesky decomposition A = LL^* = U^*U of \a matrix - * - * \returns a reference to *this - * - * Example: \include TutorialLinAlgComputeTwice.cpp - * Output: \verbinclude TutorialLinAlgComputeTwice.out - */ -template -LLT& LLT::compute(const MatrixType& a) -{ - eigen_assert(a.rows()==a.cols()); - const Index size = a.rows(); - m_matrix.resize(size, size); - m_matrix = a; - - m_isInitialized = true; - bool ok = Traits::inplace_decomposition(m_matrix); - m_info = ok ? Success : NumericalIssue; - - return *this; -} - -/** Performs a rank one update (or dowdate) of the current decomposition. - * If A = LL^* before the rank one update, - * then after it we have LL^* = A + sigma * v v^* where \a v must be a vector - * of same dimension. - */ -template -template -LLT<_MatrixType,_UpLo> LLT<_MatrixType,_UpLo>::rankUpdate(const VectorType& v, const RealScalar& sigma) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(VectorType); - eigen_assert(v.size()==m_matrix.cols()); - eigen_assert(m_isInitialized); - if(internal::llt_inplace::rankUpdate(m_matrix,v,sigma)>=0) - m_info = NumericalIssue; - else - m_info = Success; - - return *this; -} - -namespace internal { -template -struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef LLT<_MatrixType,UpLo> LLTType; - EIGEN_MAKE_SOLVE_HELPERS(LLTType,Rhs) - - template void evalTo(Dest& dst) const - { - dst = rhs(); - dec().solveInPlace(dst); - } -}; -} - -/** \internal use x = llt_object.solve(x); - * - * This is the \em in-place version of solve(). - * - * \param bAndX represents both the right-hand side matrix b and result x. - * - * \returns true always! If you need to check for existence of solutions, use another decomposition like LU, QR, or SVD. - * - * This version avoids a copy when the right hand side matrix b is not - * needed anymore. - * - * \sa LLT::solve(), MatrixBase::llt() - */ -template -template -void LLT::solveInPlace(MatrixBase &bAndX) const -{ - eigen_assert(m_isInitialized && "LLT is not initialized."); - eigen_assert(m_matrix.rows()==bAndX.rows()); - matrixL().solveInPlace(bAndX); - matrixU().solveInPlace(bAndX); -} - -/** \returns the matrix represented by the decomposition, - * i.e., it returns the product: L L^*. - * This function is provided for debug purpose. */ -template -MatrixType LLT::reconstructedMatrix() const -{ - eigen_assert(m_isInitialized && "LLT is not initialized."); - return matrixL() * matrixL().adjoint().toDenseMatrix(); -} - -/** \cholesky_module - * \returns the LLT decomposition of \c *this - */ -template -inline const LLT::PlainObject> -MatrixBase::llt() const -{ - return LLT(derived()); -} - -/** \cholesky_module - * \returns the LLT decomposition of \c *this - */ -template -inline const LLT::PlainObject, UpLo> -SelfAdjointView::llt() const -{ - return LLT(m_matrix); -} - -} // end namespace Eigen - -#endif // EIGEN_LLT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT_MKL.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT_MKL.h deleted file mode 100644 index 64daa445cf..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Cholesky/LLT_MKL.h +++ /dev/null @@ -1,102 +0,0 @@ -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ******************************************************************************** - * Content : Eigen bindings to Intel(R) MKL - * LLt decomposition based on LAPACKE_?potrf function. - ******************************************************************************** -*/ - -#ifndef EIGEN_LLT_MKL_H -#define EIGEN_LLT_MKL_H - -#include "Eigen/src/Core/util/MKL_support.h" -#include - -namespace Eigen { - -namespace internal { - -template struct mkl_llt; - -#define EIGEN_MKL_LLT(EIGTYPE, MKLTYPE, MKLPREFIX) \ -template<> struct mkl_llt \ -{ \ - template \ - static inline typename MatrixType::Index potrf(MatrixType& m, char uplo) \ - { \ - lapack_int matrix_order; \ - lapack_int size, lda, info, StorageOrder; \ - EIGTYPE* a; \ - eigen_assert(m.rows()==m.cols()); \ - /* Set up parameters for ?potrf */ \ - size = m.rows(); \ - StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \ - matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \ - a = &(m.coeffRef(0,0)); \ - lda = m.outerStride(); \ -\ - info = LAPACKE_##MKLPREFIX##potrf( matrix_order, uplo, size, (MKLTYPE*)a, lda ); \ - info = (info==0) ? Success : NumericalIssue; \ - return info; \ - } \ -}; \ -template<> struct llt_inplace \ -{ \ - template \ - static typename MatrixType::Index blocked(MatrixType& m) \ - { \ - return mkl_llt::potrf(m, 'L'); \ - } \ - template \ - static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \ - { return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \ -}; \ -template<> struct llt_inplace \ -{ \ - template \ - static typename MatrixType::Index blocked(MatrixType& m) \ - { \ - return mkl_llt::potrf(m, 'U'); \ - } \ - template \ - static typename MatrixType::Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \ - { \ - Transpose matt(mat); \ - return llt_inplace::rankUpdate(matt, vec.conjugate(), sigma); \ - } \ -}; - -EIGEN_MKL_LLT(double, double, d) -EIGEN_MKL_LLT(float, float, s) -EIGEN_MKL_LLT(dcomplex, MKL_Complex16, z) -EIGEN_MKL_LLT(scomplex, MKL_Complex8, c) - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_LLT_MKL_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h deleted file mode 100644 index 783324b0b2..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/CholmodSupport/CholmodSupport.h +++ /dev/null @@ -1,604 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CHOLMODSUPPORT_H -#define EIGEN_CHOLMODSUPPORT_H - -namespace Eigen { - -namespace internal { - -template -void cholmod_configure_matrix(CholmodType& mat) -{ - if (internal::is_same::value) - { - mat.xtype = CHOLMOD_REAL; - mat.dtype = CHOLMOD_SINGLE; - } - else if (internal::is_same::value) - { - mat.xtype = CHOLMOD_REAL; - mat.dtype = CHOLMOD_DOUBLE; - } - else if (internal::is_same >::value) - { - mat.xtype = CHOLMOD_COMPLEX; - mat.dtype = CHOLMOD_SINGLE; - } - else if (internal::is_same >::value) - { - mat.xtype = CHOLMOD_COMPLEX; - mat.dtype = CHOLMOD_DOUBLE; - } - else - { - eigen_assert(false && "Scalar type not supported by CHOLMOD"); - } -} - -} // namespace internal - -/** Wraps the Eigen sparse matrix \a mat into a Cholmod sparse matrix object. - * Note that the data are shared. - */ -template -cholmod_sparse viewAsCholmod(SparseMatrix<_Scalar,_Options,_Index>& mat) -{ - cholmod_sparse res; - res.nzmax = mat.nonZeros(); - res.nrow = mat.rows();; - res.ncol = mat.cols(); - res.p = mat.outerIndexPtr(); - res.i = mat.innerIndexPtr(); - res.x = mat.valuePtr(); - res.sorted = 1; - if(mat.isCompressed()) - { - res.packed = 1; - } - else - { - res.packed = 0; - res.nz = mat.innerNonZeroPtr(); - } - - res.dtype = 0; - res.stype = -1; - - if (internal::is_same<_Index,int>::value) - { - res.itype = CHOLMOD_INT; - } - else if (internal::is_same<_Index,UF_long>::value) - { - res.itype = CHOLMOD_LONG; - } - else - { - eigen_assert(false && "Index type not supported yet"); - } - - // setup res.xtype - internal::cholmod_configure_matrix<_Scalar>(res); - - res.stype = 0; - - return res; -} - -template -const cholmod_sparse viewAsCholmod(const SparseMatrix<_Scalar,_Options,_Index>& mat) -{ - cholmod_sparse res = viewAsCholmod(mat.const_cast_derived()); - return res; -} - -/** Returns a view of the Eigen sparse matrix \a mat as Cholmod sparse matrix. - * The data are not copied but shared. */ -template -cholmod_sparse viewAsCholmod(const SparseSelfAdjointView, UpLo>& mat) -{ - cholmod_sparse res = viewAsCholmod(mat.matrix().const_cast_derived()); - - if(UpLo==Upper) res.stype = 1; - if(UpLo==Lower) res.stype = -1; - - return res; -} - -/** Returns a view of the Eigen \b dense matrix \a mat as Cholmod dense matrix. - * The data are not copied but shared. */ -template -cholmod_dense viewAsCholmod(MatrixBase& mat) -{ - EIGEN_STATIC_ASSERT((internal::traits::Flags&RowMajorBit)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); - typedef typename Derived::Scalar Scalar; - - cholmod_dense res; - res.nrow = mat.rows(); - res.ncol = mat.cols(); - res.nzmax = res.nrow * res.ncol; - res.d = Derived::IsVectorAtCompileTime ? mat.derived().size() : mat.derived().outerStride(); - res.x = (void*)(mat.derived().data()); - res.z = 0; - - internal::cholmod_configure_matrix(res); - - return res; -} - -/** Returns a view of the Cholmod sparse matrix \a cm as an Eigen sparse matrix. - * The data are not copied but shared. */ -template -MappedSparseMatrix viewAsEigen(cholmod_sparse& cm) -{ - return MappedSparseMatrix - (cm.nrow, cm.ncol, static_cast(cm.p)[cm.ncol], - static_cast(cm.p), static_cast(cm.i),static_cast(cm.x) ); -} - -enum CholmodMode { - CholmodAuto, CholmodSimplicialLLt, CholmodSupernodalLLt, CholmodLDLt -}; - - -/** \ingroup CholmodSupport_Module - * \class CholmodBase - * \brief The base class for the direct Cholesky factorization of Cholmod - * \sa class CholmodSupernodalLLT, class CholmodSimplicialLDLT, class CholmodSimplicialLLT - */ -template -class CholmodBase : internal::noncopyable -{ - public: - typedef _MatrixType MatrixType; - enum { UpLo = _UpLo }; - typedef typename MatrixType::Scalar Scalar; - typedef typename MatrixType::RealScalar RealScalar; - typedef MatrixType CholMatrixType; - typedef typename MatrixType::Index Index; - - public: - - CholmodBase() - : m_cholmodFactor(0), m_info(Success), m_isInitialized(false) - { - cholmod_start(&m_cholmod); - } - - CholmodBase(const MatrixType& matrix) - : m_cholmodFactor(0), m_info(Success), m_isInitialized(false) - { - m_shiftOffset[0] = m_shiftOffset[1] = RealScalar(0.0); - cholmod_start(&m_cholmod); - compute(matrix); - } - - ~CholmodBase() - { - if(m_cholmodFactor) - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - cholmod_finish(&m_cholmod); - } - - inline Index cols() const { return m_cholmodFactor->n; } - inline Index rows() const { return m_cholmodFactor->n; } - - Derived& derived() { return *static_cast(this); } - const Derived& derived() const { return *static_cast(this); } - - /** \brief Reports whether previous computation was successful. - * - * \returns \c Success if computation was succesful, - * \c NumericalIssue if the matrix.appears to be negative. - */ - ComputationInfo info() const - { - eigen_assert(m_isInitialized && "Decomposition is not initialized."); - return m_info; - } - - /** Computes the sparse Cholesky decomposition of \a matrix */ - Derived& compute(const MatrixType& matrix) - { - analyzePattern(matrix); - factorize(matrix); - return derived(); - } - - /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * \sa compute() - */ - template - inline const internal::solve_retval - solve(const MatrixBase& b) const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - eigen_assert(rows()==b.rows() - && "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b"); - return internal::solve_retval(*this, b.derived()); - } - - /** \returns the solution x of \f$ A x = b \f$ using the current decomposition of A. - * - * \sa compute() - */ - template - inline const internal::sparse_solve_retval - solve(const SparseMatrixBase& b) const - { - eigen_assert(m_isInitialized && "LLT is not initialized."); - eigen_assert(rows()==b.rows() - && "CholmodDecomposition::solve(): invalid number of rows of the right hand side matrix b"); - return internal::sparse_solve_retval(*this, b.derived()); - } - - /** Performs a symbolic decomposition on the sparcity of \a matrix. - * - * This function is particularly useful when solving for several problems having the same structure. - * - * \sa factorize() - */ - void analyzePattern(const MatrixType& matrix) - { - if(m_cholmodFactor) - { - cholmod_free_factor(&m_cholmodFactor, &m_cholmod); - m_cholmodFactor = 0; - } - cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); - m_cholmodFactor = cholmod_analyze(&A, &m_cholmod); - - this->m_isInitialized = true; - this->m_info = Success; - m_analysisIsOk = true; - m_factorizationIsOk = false; - } - - /** Performs a numeric decomposition of \a matrix - * - * The given matrix must has the same sparcity than the matrix on which the symbolic decomposition has been performed. - * - * \sa analyzePattern() - */ - void factorize(const MatrixType& matrix) - { - eigen_assert(m_analysisIsOk && "You must first call analyzePattern()"); - cholmod_sparse A = viewAsCholmod(matrix.template selfadjointView()); - cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod); - - // If the factorization failed, minor is the column at which it did. On success minor == n. - this->m_info = (m_cholmodFactor->minor == m_cholmodFactor->n ? Success : NumericalIssue); - m_factorizationIsOk = true; - } - - /** Returns a reference to the Cholmod's configuration structure to get a full control over the performed operations. - * See the Cholmod user guide for details. */ - cholmod_common& cholmod() { return m_cholmod; } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** \internal */ - template - void _solve(const MatrixBase &b, MatrixBase &dest) const - { - eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); - const Index size = m_cholmodFactor->n; - EIGEN_UNUSED_VARIABLE(size); - eigen_assert(size==b.rows()); - - // note: cd stands for Cholmod Dense - Rhs& b_ref(b.const_cast_derived()); - cholmod_dense b_cd = viewAsCholmod(b_ref); - cholmod_dense* x_cd = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod); - if(!x_cd) - { - this->m_info = NumericalIssue; - } - // TODO optimize this copy by swapping when possible (be carreful with alignment, etc.) - dest = Matrix::Map(reinterpret_cast(x_cd->x),b.rows(),b.cols()); - cholmod_free_dense(&x_cd, &m_cholmod); - } - - /** \internal */ - template - void _solve(const SparseMatrix &b, SparseMatrix &dest) const - { - eigen_assert(m_factorizationIsOk && "The decomposition is not in a valid state for solving, you must first call either compute() or symbolic()/numeric()"); - const Index size = m_cholmodFactor->n; - EIGEN_UNUSED_VARIABLE(size); - eigen_assert(size==b.rows()); - - // note: cs stands for Cholmod Sparse - cholmod_sparse b_cs = viewAsCholmod(b); - cholmod_sparse* x_cs = cholmod_spsolve(CHOLMOD_A, m_cholmodFactor, &b_cs, &m_cholmod); - if(!x_cs) - { - this->m_info = NumericalIssue; - } - // TODO optimize this copy by swapping when possible (be carreful with alignment, etc.) - dest = viewAsEigen(*x_cs); - cholmod_free_sparse(&x_cs, &m_cholmod); - } - #endif // EIGEN_PARSED_BY_DOXYGEN - - - /** Sets the shift parameter that will be used to adjust the diagonal coefficients during the numerical factorization. - * - * During the numerical factorization, an offset term is added to the diagonal coefficients:\n - * \c d_ii = \a offset + \c d_ii - * - * The default is \a offset=0. - * - * \returns a reference to \c *this. - */ - Derived& setShift(const RealScalar& offset) - { - m_shiftOffset[0] = offset; - return derived(); - } - - template - void dumpMemory(Stream& /*s*/) - {} - - protected: - mutable cholmod_common m_cholmod; - cholmod_factor* m_cholmodFactor; - RealScalar m_shiftOffset[2]; - mutable ComputationInfo m_info; - bool m_isInitialized; - int m_factorizationIsOk; - int m_analysisIsOk; -}; - -/** \ingroup CholmodSupport_Module - * \class CholmodSimplicialLLT - * \brief A simplicial direct Cholesky (LLT) factorization and solver based on Cholmod - * - * This class allows to solve for A.X = B sparse linear problems via a simplicial LL^T Cholesky factorization - * using the Cholmod library. - * This simplicial variant is equivalent to Eigen's built-in SimplicialLLT class. Thefore, it has little practical interest. - * The sparse matrix A must be selfajoint and positive definite. The vectors or matrices - * X and B can be either dense or sparse. - * - * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> - * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower - * or Upper. Default is Lower. - * - * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. - * - * \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLLT - */ -template -class CholmodSimplicialLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT<_MatrixType, _UpLo> > -{ - typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLLT> Base; - using Base::m_cholmod; - - public: - - typedef _MatrixType MatrixType; - - CholmodSimplicialLLT() : Base() { init(); } - - CholmodSimplicialLLT(const MatrixType& matrix) : Base() - { - init(); - compute(matrix); - } - - ~CholmodSimplicialLLT() {} - protected: - void init() - { - m_cholmod.final_asis = 0; - m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; - m_cholmod.final_ll = 1; - } -}; - - -/** \ingroup CholmodSupport_Module - * \class CholmodSimplicialLDLT - * \brief A simplicial direct Cholesky (LDLT) factorization and solver based on Cholmod - * - * This class allows to solve for A.X = B sparse linear problems via a simplicial LDL^T Cholesky factorization - * using the Cholmod library. - * This simplicial variant is equivalent to Eigen's built-in SimplicialLDLT class. Thefore, it has little practical interest. - * The sparse matrix A must be selfajoint and positive definite. The vectors or matrices - * X and B can be either dense or sparse. - * - * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> - * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower - * or Upper. Default is Lower. - * - * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. - * - * \sa \ref TutorialSparseDirectSolvers, class CholmodSupernodalLLT, class SimplicialLDLT - */ -template -class CholmodSimplicialLDLT : public CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT<_MatrixType, _UpLo> > -{ - typedef CholmodBase<_MatrixType, _UpLo, CholmodSimplicialLDLT> Base; - using Base::m_cholmod; - - public: - - typedef _MatrixType MatrixType; - - CholmodSimplicialLDLT() : Base() { init(); } - - CholmodSimplicialLDLT(const MatrixType& matrix) : Base() - { - init(); - compute(matrix); - } - - ~CholmodSimplicialLDLT() {} - protected: - void init() - { - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; - } -}; - -/** \ingroup CholmodSupport_Module - * \class CholmodSupernodalLLT - * \brief A supernodal Cholesky (LLT) factorization and solver based on Cholmod - * - * This class allows to solve for A.X = B sparse linear problems via a supernodal LL^T Cholesky factorization - * using the Cholmod library. - * This supernodal variant performs best on dense enough problems, e.g., 3D FEM, or very high order 2D FEM. - * The sparse matrix A must be selfajoint and positive definite. The vectors or matrices - * X and B can be either dense or sparse. - * - * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> - * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower - * or Upper. Default is Lower. - * - * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. - * - * \sa \ref TutorialSparseDirectSolvers - */ -template -class CholmodSupernodalLLT : public CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT<_MatrixType, _UpLo> > -{ - typedef CholmodBase<_MatrixType, _UpLo, CholmodSupernodalLLT> Base; - using Base::m_cholmod; - - public: - - typedef _MatrixType MatrixType; - - CholmodSupernodalLLT() : Base() { init(); } - - CholmodSupernodalLLT(const MatrixType& matrix) : Base() - { - init(); - compute(matrix); - } - - ~CholmodSupernodalLLT() {} - protected: - void init() - { - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_SUPERNODAL; - } -}; - -/** \ingroup CholmodSupport_Module - * \class CholmodDecomposition - * \brief A general Cholesky factorization and solver based on Cholmod - * - * This class allows to solve for A.X = B sparse linear problems via a LL^T or LDL^T Cholesky factorization - * using the Cholmod library. The sparse matrix A must be selfajoint and positive definite. The vectors or matrices - * X and B can be either dense or sparse. - * - * This variant permits to change the underlying Cholesky method at runtime. - * On the other hand, it does not provide access to the result of the factorization. - * The default is to let Cholmod automatically choose between a simplicial and supernodal factorization. - * - * \tparam _MatrixType the type of the sparse matrix A, it must be a SparseMatrix<> - * \tparam _UpLo the triangular part that will be used for the computations. It can be Lower - * or Upper. Default is Lower. - * - * This class supports all kind of SparseMatrix<>: row or column major; upper, lower, or both; compressed or non compressed. - * - * \sa \ref TutorialSparseDirectSolvers - */ -template -class CholmodDecomposition : public CholmodBase<_MatrixType, _UpLo, CholmodDecomposition<_MatrixType, _UpLo> > -{ - typedef CholmodBase<_MatrixType, _UpLo, CholmodDecomposition> Base; - using Base::m_cholmod; - - public: - - typedef _MatrixType MatrixType; - - CholmodDecomposition() : Base() { init(); } - - CholmodDecomposition(const MatrixType& matrix) : Base() - { - init(); - compute(matrix); - } - - ~CholmodDecomposition() {} - - void setMode(CholmodMode mode) - { - switch(mode) - { - case CholmodAuto: - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_AUTO; - break; - case CholmodSimplicialLLt: - m_cholmod.final_asis = 0; - m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; - m_cholmod.final_ll = 1; - break; - case CholmodSupernodalLLt: - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_SUPERNODAL; - break; - case CholmodLDLt: - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_SIMPLICIAL; - break; - default: - break; - } - } - protected: - void init() - { - m_cholmod.final_asis = 1; - m_cholmod.supernodal = CHOLMOD_AUTO; - } -}; - -namespace internal { - -template -struct solve_retval, Rhs> - : solve_retval_base, Rhs> -{ - typedef CholmodBase<_MatrixType,_UpLo,Derived> Dec; - EIGEN_MAKE_SOLVE_HELPERS(Dec,Rhs) - - template void evalTo(Dest& dst) const - { - dec()._solve(rhs(),dst); - } -}; - -template -struct sparse_solve_retval, Rhs> - : sparse_solve_retval_base, Rhs> -{ - typedef CholmodBase<_MatrixType,_UpLo,Derived> Dec; - EIGEN_MAKE_SPARSE_SOLVE_HELPERS(Dec,Rhs) - - template void evalTo(Dest& dst) const - { - dec()._solve(rhs(),dst); - } -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_CHOLMODSUPPORT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Array.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Array.h deleted file mode 100644 index 497efff66f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Array.h +++ /dev/null @@ -1,308 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_ARRAY_H -#define EIGEN_ARRAY_H - -namespace Eigen { - -/** \class Array - * \ingroup Core_Module - * - * \brief General-purpose arrays with easy API for coefficient-wise operations - * - * The %Array class is very similar to the Matrix class. It provides - * general-purpose one- and two-dimensional arrays. The difference between the - * %Array and the %Matrix class is primarily in the API: the API for the - * %Array class provides easy access to coefficient-wise operations, while the - * API for the %Matrix class provides easy access to linear-algebra - * operations. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_ARRAY_PLUGIN. - * - * \sa \ref TutorialArrayClass, \ref TopicClassHierarchy - */ -namespace internal { -template -struct traits > : traits > -{ - typedef ArrayXpr XprKind; - typedef ArrayBase > XprBase; -}; -} - -template -class Array - : public PlainObjectBase > -{ - public: - - typedef PlainObjectBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Array) - - enum { Options = _Options }; - typedef typename Base::PlainObject PlainObject; - - protected: - template - friend struct internal::conservative_resize_like_impl; - - using Base::m_storage; - - public: - - using Base::base; - using Base::coeff; - using Base::coeffRef; - - /** - * The usage of - * using Base::operator=; - * fails on MSVC. Since the code below is working with GCC and MSVC, we skipped - * the usage of 'using'. This should be done only for operator=. - */ - template - EIGEN_STRONG_INLINE Array& operator=(const EigenBase &other) - { - return Base::operator=(other); - } - - /** Copies the value of the expression \a other into \c *this with automatic resizing. - * - * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), - * it will be initialized. - * - * Note that copying a row-vector into a vector (and conversely) is allowed. - * The resizing, if any, is then done in the appropriate way so that row-vectors - * remain row-vectors and vectors remain vectors. - */ - template - EIGEN_STRONG_INLINE Array& operator=(const ArrayBase& other) - { - return Base::_set(other); - } - - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - EIGEN_STRONG_INLINE Array& operator=(const Array& other) - { - return Base::_set(other); - } - - /** Default constructor. - * - * For fixed-size matrices, does nothing. - * - * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix - * is called a null matrix. This constructor is the unique way to create null matrices: resizing - * a matrix to 0 is not supported. - * - * \sa resize(Index,Index) - */ - EIGEN_STRONG_INLINE Array() : Base() - { - Base::_check_template_params(); - EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - // FIXME is it still needed ?? - /** \internal */ - Array(internal::constructor_without_unaligned_array_assert) - : Base(internal::constructor_without_unaligned_array_assert()) - { - Base::_check_template_params(); - EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } -#endif - - /** Constructs a vector or row-vector with given dimension. \only_for_vectors - * - * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, - * it is redundant to pass the dimension here, so it makes more sense to use the default - * constructor Matrix() instead. - */ - EIGEN_STRONG_INLINE explicit Array(Index dim) - : Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Array) - eigen_assert(dim >= 0); - eigen_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim); - EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - EIGEN_STRONG_INLINE Array(const T0& val0, const T1& val1) - { - Base::_check_template_params(); - this->template _init2(val0, val1); - } - #else - /** constructs an uninitialized matrix with \a rows rows and \a cols columns. - * - * This is useful for dynamic-size matrices. For fixed-size matrices, - * it is redundant to pass these parameters, so one should use the default constructor - * Matrix() instead. */ - Array(Index rows, Index cols); - /** constructs an initialized 2D vector with given coefficients */ - Array(const Scalar& val0, const Scalar& val1); - #endif - - /** constructs an initialized 3D vector with given coefficients */ - EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 3) - m_storage.data()[0] = val0; - m_storage.data()[1] = val1; - m_storage.data()[2] = val2; - } - /** constructs an initialized 4D vector with given coefficients */ - EIGEN_STRONG_INLINE Array(const Scalar& val0, const Scalar& val1, const Scalar& val2, const Scalar& val3) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Array, 4) - m_storage.data()[0] = val0; - m_storage.data()[1] = val1; - m_storage.data()[2] = val2; - m_storage.data()[3] = val3; - } - - explicit Array(const Scalar *data); - - /** Constructor copying the value of the expression \a other */ - template - EIGEN_STRONG_INLINE Array(const ArrayBase& other) - : Base(other.rows() * other.cols(), other.rows(), other.cols()) - { - Base::_check_template_params(); - Base::_set_noalias(other); - } - /** Copy constructor */ - EIGEN_STRONG_INLINE Array(const Array& other) - : Base(other.rows() * other.cols(), other.rows(), other.cols()) - { - Base::_check_template_params(); - Base::_set_noalias(other); - } - /** Copy constructor with in-place evaluation */ - template - EIGEN_STRONG_INLINE Array(const ReturnByValue& other) - { - Base::_check_template_params(); - Base::resize(other.rows(), other.cols()); - other.evalTo(*this); - } - - /** \sa MatrixBase::operator=(const EigenBase&) */ - template - EIGEN_STRONG_INLINE Array(const EigenBase &other) - : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols()) - { - Base::_check_template_params(); - Base::resize(other.rows(), other.cols()); - *this = other; - } - - /** Override MatrixBase::swap() since for dynamic-sized matrices of same type it is enough to swap the - * data pointers. - */ - template - void swap(ArrayBase const & other) - { this->_swap(other.derived()); } - - inline Index innerStride() const { return 1; } - inline Index outerStride() const { return this->innerSize(); } - - #ifdef EIGEN_ARRAY_PLUGIN - #include EIGEN_ARRAY_PLUGIN - #endif - - private: - - template - friend struct internal::matrix_swap_impl; -}; - -/** \defgroup arraytypedefs Global array typedefs - * \ingroup Core_Module - * - * Eigen defines several typedef shortcuts for most common 1D and 2D array types. - * - * The general patterns are the following: - * - * \c ArrayRowsColsType where \c Rows and \c Cols can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, - * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd - * for complex double. - * - * For example, \c Array33d is a fixed-size 3x3 array type of doubles, and \c ArrayXXf is a dynamic-size matrix of floats. - * - * There are also \c ArraySizeType which are self-explanatory. For example, \c Array4cf is - * a fixed-size 1D array of 4 complex floats. - * - * \sa class Array - */ - -#define EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ -/** \ingroup arraytypedefs */ \ -typedef Array Array##SizeSuffix##SizeSuffix##TypeSuffix; \ -/** \ingroup arraytypedefs */ \ -typedef Array Array##SizeSuffix##TypeSuffix; - -#define EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ -/** \ingroup arraytypedefs */ \ -typedef Array Array##Size##X##TypeSuffix; \ -/** \ingroup arraytypedefs */ \ -typedef Array Array##X##Size##TypeSuffix; - -#define EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ -EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 2, 2) \ -EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 3, 3) \ -EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, 4, 4) \ -EIGEN_MAKE_ARRAY_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ -EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ -EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ -EIGEN_MAKE_ARRAY_FIXED_TYPEDEFS(Type, TypeSuffix, 4) - -EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(int, i) -EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(float, f) -EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(double, d) -EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cf) -EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES(std::complex, cd) - -#undef EIGEN_MAKE_ARRAY_TYPEDEFS_ALL_SIZES -#undef EIGEN_MAKE_ARRAY_TYPEDEFS - -#undef EIGEN_MAKE_ARRAY_TYPEDEFS_LARGE - -#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, SizeSuffix) \ -using Eigen::Matrix##SizeSuffix##TypeSuffix; \ -using Eigen::Vector##SizeSuffix##TypeSuffix; \ -using Eigen::RowVector##SizeSuffix##TypeSuffix; - -#define EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(TypeSuffix) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 2) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 3) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, 4) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE_AND_SIZE(TypeSuffix, X) \ - -#define EIGEN_USING_ARRAY_TYPEDEFS \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(i) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(f) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(d) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cf) \ -EIGEN_USING_ARRAY_TYPEDEFS_FOR_TYPE(cd) - -} // end namespace Eigen - -#endif // EIGEN_ARRAY_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayBase.h deleted file mode 100644 index 38852600dc..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayBase.h +++ /dev/null @@ -1,228 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_ARRAYBASE_H -#define EIGEN_ARRAYBASE_H - -namespace Eigen { - -template class MatrixWrapper; - -/** \class ArrayBase - * \ingroup Core_Module - * - * \brief Base class for all 1D and 2D array, and related expressions - * - * An array is similar to a dense vector or matrix. While matrices are mathematical - * objects with well defined linear algebra operators, an array is just a collection - * of scalar values arranged in a one or two dimensionnal fashion. As the main consequence, - * all operations applied to an array are performed coefficient wise. Furthermore, - * arrays support scalar math functions of the c++ standard library (e.g., std::sin(x)), and convenient - * constructors allowing to easily write generic code working for both scalar values - * and arrays. - * - * This class is the base that is inherited by all array expression types. - * - * \tparam Derived is the derived type, e.g., an array or an expression type. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_ARRAYBASE_PLUGIN. - * - * \sa class MatrixBase, \ref TopicClassHierarchy - */ -template class ArrayBase - : public DenseBase -{ - public: -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** The base class for a given storage type. */ - typedef ArrayBase StorageBaseType; - - typedef ArrayBase Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl; - - using internal::special_scalar_op_base::Scalar, - typename NumTraits::Scalar>::Real>::operator*; - - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - - typedef DenseBase Base; - using Base::RowsAtCompileTime; - using Base::ColsAtCompileTime; - using Base::SizeAtCompileTime; - using Base::MaxRowsAtCompileTime; - using Base::MaxColsAtCompileTime; - using Base::MaxSizeAtCompileTime; - using Base::IsVectorAtCompileTime; - using Base::Flags; - using Base::CoeffReadCost; - - using Base::derived; - using Base::const_cast_derived; - using Base::rows; - using Base::cols; - using Base::size; - using Base::coeff; - using Base::coeffRef; - using Base::lazyAssign; - using Base::operator=; - using Base::operator+=; - using Base::operator-=; - using Base::operator*=; - using Base::operator/=; - - typedef typename Base::CoeffReturnType CoeffReturnType; - -#endif // not EIGEN_PARSED_BY_DOXYGEN - -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** \internal the plain matrix type corresponding to this expression. Note that is not necessarily - * exactly the return type of eval(): in the case of plain matrices, the return type of eval() is a const - * reference to a matrix, not a matrix! It is however guaranteed that the return type of eval() is either - * PlainObject or const PlainObject&. - */ - typedef Array::Scalar, - internal::traits::RowsAtCompileTime, - internal::traits::ColsAtCompileTime, - AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), - internal::traits::MaxRowsAtCompileTime, - internal::traits::MaxColsAtCompileTime - > PlainObject; - - - /** \internal Represents a matrix with all coefficients equal to one another*/ - typedef CwiseNullaryOp,Derived> ConstantReturnType; -#endif // not EIGEN_PARSED_BY_DOXYGEN - -#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::ArrayBase -# include "../plugins/CommonCwiseUnaryOps.h" -# include "../plugins/MatrixCwiseUnaryOps.h" -# include "../plugins/ArrayCwiseUnaryOps.h" -# include "../plugins/CommonCwiseBinaryOps.h" -# include "../plugins/MatrixCwiseBinaryOps.h" -# include "../plugins/ArrayCwiseBinaryOps.h" -# ifdef EIGEN_ARRAYBASE_PLUGIN -# include EIGEN_ARRAYBASE_PLUGIN -# endif -#undef EIGEN_CURRENT_STORAGE_BASE_CLASS - - /** Special case of the template operator=, in order to prevent the compiler - * from generating a default operator= (issue hit with g++ 4.1) - */ - Derived& operator=(const ArrayBase& other) - { - return internal::assign_selector::run(derived(), other.derived()); - } - - Derived& operator+=(const Scalar& scalar) - { return *this = derived() + scalar; } - Derived& operator-=(const Scalar& scalar) - { return *this = derived() - scalar; } - - template - Derived& operator+=(const ArrayBase& other); - template - Derived& operator-=(const ArrayBase& other); - - template - Derived& operator*=(const ArrayBase& other); - - template - Derived& operator/=(const ArrayBase& other); - - public: - ArrayBase& array() { return *this; } - const ArrayBase& array() const { return *this; } - - /** \returns an \link Eigen::MatrixBase Matrix \endlink expression of this array - * \sa MatrixBase::array() */ - MatrixWrapper matrix() { return derived(); } - const MatrixWrapper matrix() const { return derived(); } - -// template -// inline void evalTo(Dest& dst) const { dst = matrix(); } - - protected: - ArrayBase() : Base() {} - - private: - explicit ArrayBase(Index); - ArrayBase(Index,Index); - template explicit ArrayBase(const ArrayBase&); - protected: - // mixing arrays and matrices is not legal - template Derived& operator+=(const MatrixBase& ) - {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} - // mixing arrays and matrices is not legal - template Derived& operator-=(const MatrixBase& ) - {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} -}; - -/** replaces \c *this by \c *this - \a other. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -ArrayBase::operator-=(const ArrayBase &other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -/** replaces \c *this by \c *this + \a other. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -ArrayBase::operator+=(const ArrayBase& other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -/** replaces \c *this by \c *this * \a other coefficient wise. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -ArrayBase::operator*=(const ArrayBase& other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -/** replaces \c *this by \c *this / \a other coefficient wise. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -ArrayBase::operator/=(const ArrayBase& other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_ARRAYBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayWrapper.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayWrapper.h deleted file mode 100644 index a791bc3581..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ArrayWrapper.h +++ /dev/null @@ -1,254 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_ARRAYWRAPPER_H -#define EIGEN_ARRAYWRAPPER_H - -namespace Eigen { - -/** \class ArrayWrapper - * \ingroup Core_Module - * - * \brief Expression of a mathematical vector or matrix as an array object - * - * This class is the return type of MatrixBase::array(), and most of the time - * this is the only way it is use. - * - * \sa MatrixBase::array(), class MatrixWrapper - */ - -namespace internal { -template -struct traits > - : public traits::type > -{ - typedef ArrayXpr XprKind; -}; -} - -template -class ArrayWrapper : public ArrayBase > -{ - public: - typedef ArrayBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(ArrayWrapper) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(ArrayWrapper) - - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; - - typedef typename internal::nested::type NestedExpressionType; - - inline ArrayWrapper(ExpressionType& matrix) : m_expression(matrix) {} - - inline Index rows() const { return m_expression.rows(); } - inline Index cols() const { return m_expression.cols(); } - inline Index outerStride() const { return m_expression.outerStride(); } - inline Index innerStride() const { return m_expression.innerStride(); } - - inline ScalarWithConstIfNotLvalue* data() { return m_expression.const_cast_derived().data(); } - inline const Scalar* data() const { return m_expression.data(); } - - inline CoeffReturnType coeff(Index rowId, Index colId) const - { - return m_expression.coeff(rowId, colId); - } - - inline Scalar& coeffRef(Index rowId, Index colId) - { - return m_expression.const_cast_derived().coeffRef(rowId, colId); - } - - inline const Scalar& coeffRef(Index rowId, Index colId) const - { - return m_expression.const_cast_derived().coeffRef(rowId, colId); - } - - inline CoeffReturnType coeff(Index index) const - { - return m_expression.coeff(index); - } - - inline Scalar& coeffRef(Index index) - { - return m_expression.const_cast_derived().coeffRef(index); - } - - inline const Scalar& coeffRef(Index index) const - { - return m_expression.const_cast_derived().coeffRef(index); - } - - template - inline const PacketScalar packet(Index rowId, Index colId) const - { - return m_expression.template packet(rowId, colId); - } - - template - inline void writePacket(Index rowId, Index colId, const PacketScalar& val) - { - m_expression.const_cast_derived().template writePacket(rowId, colId, val); - } - - template - inline const PacketScalar packet(Index index) const - { - return m_expression.template packet(index); - } - - template - inline void writePacket(Index index, const PacketScalar& val) - { - m_expression.const_cast_derived().template writePacket(index, val); - } - - template - inline void evalTo(Dest& dst) const { dst = m_expression; } - - const typename internal::remove_all::type& - nestedExpression() const - { - return m_expression; - } - - /** Forwards the resizing request to the nested expression - * \sa DenseBase::resize(Index) */ - void resize(Index newSize) { m_expression.const_cast_derived().resize(newSize); } - /** Forwards the resizing request to the nested expression - * \sa DenseBase::resize(Index,Index)*/ - void resize(Index nbRows, Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); } - - protected: - NestedExpressionType m_expression; -}; - -/** \class MatrixWrapper - * \ingroup Core_Module - * - * \brief Expression of an array as a mathematical vector or matrix - * - * This class is the return type of ArrayBase::matrix(), and most of the time - * this is the only way it is use. - * - * \sa MatrixBase::matrix(), class ArrayWrapper - */ - -namespace internal { -template -struct traits > - : public traits::type > -{ - typedef MatrixXpr XprKind; -}; -} - -template -class MatrixWrapper : public MatrixBase > -{ - public: - typedef MatrixBase > Base; - EIGEN_DENSE_PUBLIC_INTERFACE(MatrixWrapper) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(MatrixWrapper) - - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; - - typedef typename internal::nested::type NestedExpressionType; - - inline MatrixWrapper(ExpressionType& a_matrix) : m_expression(a_matrix) {} - - inline Index rows() const { return m_expression.rows(); } - inline Index cols() const { return m_expression.cols(); } - inline Index outerStride() const { return m_expression.outerStride(); } - inline Index innerStride() const { return m_expression.innerStride(); } - - inline ScalarWithConstIfNotLvalue* data() { return m_expression.const_cast_derived().data(); } - inline const Scalar* data() const { return m_expression.data(); } - - inline CoeffReturnType coeff(Index rowId, Index colId) const - { - return m_expression.coeff(rowId, colId); - } - - inline Scalar& coeffRef(Index rowId, Index colId) - { - return m_expression.const_cast_derived().coeffRef(rowId, colId); - } - - inline const Scalar& coeffRef(Index rowId, Index colId) const - { - return m_expression.derived().coeffRef(rowId, colId); - } - - inline CoeffReturnType coeff(Index index) const - { - return m_expression.coeff(index); - } - - inline Scalar& coeffRef(Index index) - { - return m_expression.const_cast_derived().coeffRef(index); - } - - inline const Scalar& coeffRef(Index index) const - { - return m_expression.const_cast_derived().coeffRef(index); - } - - template - inline const PacketScalar packet(Index rowId, Index colId) const - { - return m_expression.template packet(rowId, colId); - } - - template - inline void writePacket(Index rowId, Index colId, const PacketScalar& val) - { - m_expression.const_cast_derived().template writePacket(rowId, colId, val); - } - - template - inline const PacketScalar packet(Index index) const - { - return m_expression.template packet(index); - } - - template - inline void writePacket(Index index, const PacketScalar& val) - { - m_expression.const_cast_derived().template writePacket(index, val); - } - - const typename internal::remove_all::type& - nestedExpression() const - { - return m_expression; - } - - /** Forwards the resizing request to the nested expression - * \sa DenseBase::resize(Index) */ - void resize(Index newSize) { m_expression.const_cast_derived().resize(newSize); } - /** Forwards the resizing request to the nested expression - * \sa DenseBase::resize(Index,Index)*/ - void resize(Index nbRows, Index nbCols) { m_expression.const_cast_derived().resize(nbRows,nbCols); } - - protected: - NestedExpressionType m_expression; -}; - -} // end namespace Eigen - -#endif // EIGEN_ARRAYWRAPPER_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign.h deleted file mode 100644 index 1dccc2f421..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign.h +++ /dev/null @@ -1,583 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2007 Michael Olbrich -// Copyright (C) 2006-2010 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_ASSIGN_H -#define EIGEN_ASSIGN_H - -namespace Eigen { - -namespace internal { - -/*************************************************************************** -* Part 1 : the logic deciding a strategy for traversal and unrolling * -***************************************************************************/ - -template -struct assign_traits -{ -public: - enum { - DstIsAligned = Derived::Flags & AlignedBit, - DstHasDirectAccess = Derived::Flags & DirectAccessBit, - SrcIsAligned = OtherDerived::Flags & AlignedBit, - JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned - }; - -private: - enum { - InnerSize = int(Derived::IsVectorAtCompileTime) ? int(Derived::SizeAtCompileTime) - : int(Derived::Flags)&RowMajorBit ? int(Derived::ColsAtCompileTime) - : int(Derived::RowsAtCompileTime), - InnerMaxSize = int(Derived::IsVectorAtCompileTime) ? int(Derived::MaxSizeAtCompileTime) - : int(Derived::Flags)&RowMajorBit ? int(Derived::MaxColsAtCompileTime) - : int(Derived::MaxRowsAtCompileTime), - MaxSizeAtCompileTime = Derived::SizeAtCompileTime, - PacketSize = packet_traits::size - }; - - enum { - StorageOrdersAgree = (int(Derived::IsRowMajor) == int(OtherDerived::IsRowMajor)), - MightVectorize = StorageOrdersAgree - && (int(Derived::Flags) & int(OtherDerived::Flags) & ActualPacketAccessBit), - MayInnerVectorize = MightVectorize && int(InnerSize)!=Dynamic && int(InnerSize)%int(PacketSize)==0 - && int(DstIsAligned) && int(SrcIsAligned), - MayLinearize = StorageOrdersAgree && (int(Derived::Flags) & int(OtherDerived::Flags) & LinearAccessBit), - MayLinearVectorize = MightVectorize && MayLinearize && DstHasDirectAccess - && (DstIsAligned || MaxSizeAtCompileTime == Dynamic), - /* If the destination isn't aligned, we have to do runtime checks and we don't unroll, - so it's only good for large enough sizes. */ - MaySliceVectorize = MightVectorize && DstHasDirectAccess - && (int(InnerMaxSize)==Dynamic || int(InnerMaxSize)>=3*PacketSize) - /* slice vectorization can be slow, so we only want it if the slices are big, which is - indicated by InnerMaxSize rather than InnerSize, think of the case of a dynamic block - in a fixed-size matrix */ - }; - -public: - enum { - Traversal = int(MayInnerVectorize) ? int(InnerVectorizedTraversal) - : int(MayLinearVectorize) ? int(LinearVectorizedTraversal) - : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) - : int(MayLinearize) ? int(LinearTraversal) - : int(DefaultTraversal), - Vectorized = int(Traversal) == InnerVectorizedTraversal - || int(Traversal) == LinearVectorizedTraversal - || int(Traversal) == SliceVectorizedTraversal - }; - -private: - enum { - UnrollingLimit = EIGEN_UNROLLING_LIMIT * (Vectorized ? int(PacketSize) : 1), - MayUnrollCompletely = int(Derived::SizeAtCompileTime) != Dynamic - && int(OtherDerived::CoeffReadCost) != Dynamic - && int(Derived::SizeAtCompileTime) * int(OtherDerived::CoeffReadCost) <= int(UnrollingLimit), - MayUnrollInner = int(InnerSize) != Dynamic - && int(OtherDerived::CoeffReadCost) != Dynamic - && int(InnerSize) * int(OtherDerived::CoeffReadCost) <= int(UnrollingLimit) - }; - -public: - enum { - Unrolling = (int(Traversal) == int(InnerVectorizedTraversal) || int(Traversal) == int(DefaultTraversal)) - ? ( - int(MayUnrollCompletely) ? int(CompleteUnrolling) - : int(MayUnrollInner) ? int(InnerUnrolling) - : int(NoUnrolling) - ) - : int(Traversal) == int(LinearVectorizedTraversal) - ? ( bool(MayUnrollCompletely) && bool(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) ) - : int(Traversal) == int(LinearTraversal) - ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling) : int(NoUnrolling) ) - : int(NoUnrolling) - }; - -#ifdef EIGEN_DEBUG_ASSIGN - static void debug() - { - EIGEN_DEBUG_VAR(DstIsAligned) - EIGEN_DEBUG_VAR(SrcIsAligned) - EIGEN_DEBUG_VAR(JointAlignment) - EIGEN_DEBUG_VAR(InnerSize) - EIGEN_DEBUG_VAR(InnerMaxSize) - EIGEN_DEBUG_VAR(PacketSize) - EIGEN_DEBUG_VAR(StorageOrdersAgree) - EIGEN_DEBUG_VAR(MightVectorize) - EIGEN_DEBUG_VAR(MayLinearize) - EIGEN_DEBUG_VAR(MayInnerVectorize) - EIGEN_DEBUG_VAR(MayLinearVectorize) - EIGEN_DEBUG_VAR(MaySliceVectorize) - EIGEN_DEBUG_VAR(Traversal) - EIGEN_DEBUG_VAR(UnrollingLimit) - EIGEN_DEBUG_VAR(MayUnrollCompletely) - EIGEN_DEBUG_VAR(MayUnrollInner) - EIGEN_DEBUG_VAR(Unrolling) - } -#endif -}; - -/*************************************************************************** -* Part 2 : meta-unrollers -***************************************************************************/ - -/************************ -*** Default traversal *** -************************/ - -template -struct assign_DefaultTraversal_CompleteUnrolling -{ - enum { - outer = Index / Derived1::InnerSizeAtCompileTime, - inner = Index % Derived1::InnerSizeAtCompileTime - }; - - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - dst.copyCoeffByOuterInner(outer, inner, src); - assign_DefaultTraversal_CompleteUnrolling::run(dst, src); - } -}; - -template -struct assign_DefaultTraversal_CompleteUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &, const Derived2 &) {} -}; - -template -struct assign_DefaultTraversal_InnerUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src, typename Derived1::Index outer) - { - dst.copyCoeffByOuterInner(outer, Index, src); - assign_DefaultTraversal_InnerUnrolling::run(dst, src, outer); - } -}; - -template -struct assign_DefaultTraversal_InnerUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &, const Derived2 &, typename Derived1::Index) {} -}; - -/*********************** -*** Linear traversal *** -***********************/ - -template -struct assign_LinearTraversal_CompleteUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - dst.copyCoeff(Index, src); - assign_LinearTraversal_CompleteUnrolling::run(dst, src); - } -}; - -template -struct assign_LinearTraversal_CompleteUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &, const Derived2 &) {} -}; - -/************************** -*** Inner vectorization *** -**************************/ - -template -struct assign_innervec_CompleteUnrolling -{ - enum { - outer = Index / Derived1::InnerSizeAtCompileTime, - inner = Index % Derived1::InnerSizeAtCompileTime, - JointAlignment = assign_traits::JointAlignment - }; - - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - dst.template copyPacketByOuterInner(outer, inner, src); - assign_innervec_CompleteUnrolling::size, Stop>::run(dst, src); - } -}; - -template -struct assign_innervec_CompleteUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &, const Derived2 &) {} -}; - -template -struct assign_innervec_InnerUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src, typename Derived1::Index outer) - { - dst.template copyPacketByOuterInner(outer, Index, src); - assign_innervec_InnerUnrolling::size, Stop>::run(dst, src, outer); - } -}; - -template -struct assign_innervec_InnerUnrolling -{ - static EIGEN_STRONG_INLINE void run(Derived1 &, const Derived2 &, typename Derived1::Index) {} -}; - -/*************************************************************************** -* Part 3 : implementation of all cases -***************************************************************************/ - -template::Traversal, - int Unrolling = assign_traits::Unrolling, - int Version = Specialized> -struct assign_impl; - -/************************ -*** Default traversal *** -************************/ - -template -struct assign_impl -{ - static inline void run(Derived1 &, const Derived2 &) { } -}; - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static inline void run(Derived1 &dst, const Derived2 &src) - { - const Index innerSize = dst.innerSize(); - const Index outerSize = dst.outerSize(); - for(Index outer = 0; outer < outerSize; ++outer) - for(Index inner = 0; inner < innerSize; ++inner) - dst.copyCoeffByOuterInner(outer, inner, src); - } -}; - -template -struct assign_impl -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - assign_DefaultTraversal_CompleteUnrolling - ::run(dst, src); - } -}; - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - const Index outerSize = dst.outerSize(); - for(Index outer = 0; outer < outerSize; ++outer) - assign_DefaultTraversal_InnerUnrolling - ::run(dst, src, outer); - } -}; - -/*********************** -*** Linear traversal *** -***********************/ - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static inline void run(Derived1 &dst, const Derived2 &src) - { - const Index size = dst.size(); - for(Index i = 0; i < size; ++i) - dst.copyCoeff(i, src); - } -}; - -template -struct assign_impl -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - assign_LinearTraversal_CompleteUnrolling - ::run(dst, src); - } -}; - -/************************** -*** Inner vectorization *** -**************************/ - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static inline void run(Derived1 &dst, const Derived2 &src) - { - const Index innerSize = dst.innerSize(); - const Index outerSize = dst.outerSize(); - const Index packetSize = packet_traits::size; - for(Index outer = 0; outer < outerSize; ++outer) - for(Index inner = 0; inner < innerSize; inner+=packetSize) - dst.template copyPacketByOuterInner(outer, inner, src); - } -}; - -template -struct assign_impl -{ - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - assign_innervec_CompleteUnrolling - ::run(dst, src); - } -}; - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - const Index outerSize = dst.outerSize(); - for(Index outer = 0; outer < outerSize; ++outer) - assign_innervec_InnerUnrolling - ::run(dst, src, outer); - } -}; - -/*************************** -*** Linear vectorization *** -***************************/ - -template -struct unaligned_assign_impl -{ - template - static EIGEN_STRONG_INLINE void run(const Derived&, OtherDerived&, typename Derived::Index, typename Derived::Index) {} -}; - -template <> -struct unaligned_assign_impl -{ - // MSVC must not inline this functions. If it does, it fails to optimize the - // packet access path. -#ifdef _MSC_VER - template - static EIGEN_DONT_INLINE void run(const Derived& src, OtherDerived& dst, typename Derived::Index start, typename Derived::Index end) -#else - template - static EIGEN_STRONG_INLINE void run(const Derived& src, OtherDerived& dst, typename Derived::Index start, typename Derived::Index end) -#endif - { - for (typename Derived::Index index = start; index < end; ++index) - dst.copyCoeff(index, src); - } -}; - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - const Index size = dst.size(); - typedef packet_traits PacketTraits; - enum { - packetSize = PacketTraits::size, - dstAlignment = PacketTraits::AlignedOnScalar ? Aligned : int(assign_traits::DstIsAligned) , - srcAlignment = assign_traits::JointAlignment - }; - const Index alignedStart = assign_traits::DstIsAligned ? 0 - : internal::first_aligned(&dst.coeffRef(0), size); - const Index alignedEnd = alignedStart + ((size-alignedStart)/packetSize)*packetSize; - - unaligned_assign_impl::DstIsAligned!=0>::run(src,dst,0,alignedStart); - - for(Index index = alignedStart; index < alignedEnd; index += packetSize) - { - dst.template copyPacket(index, src); - } - - unaligned_assign_impl<>::run(src,dst,alignedEnd,size); - } -}; - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static EIGEN_STRONG_INLINE void run(Derived1 &dst, const Derived2 &src) - { - enum { size = Derived1::SizeAtCompileTime, - packetSize = packet_traits::size, - alignedSize = (size/packetSize)*packetSize }; - - assign_innervec_CompleteUnrolling::run(dst, src); - assign_DefaultTraversal_CompleteUnrolling::run(dst, src); - } -}; - -/************************** -*** Slice vectorization *** -***************************/ - -template -struct assign_impl -{ - typedef typename Derived1::Index Index; - static inline void run(Derived1 &dst, const Derived2 &src) - { - typedef packet_traits PacketTraits; - enum { - packetSize = PacketTraits::size, - alignable = PacketTraits::AlignedOnScalar, - dstAlignment = alignable ? Aligned : int(assign_traits::DstIsAligned) , - srcAlignment = assign_traits::JointAlignment - }; - const Index packetAlignedMask = packetSize - 1; - const Index innerSize = dst.innerSize(); - const Index outerSize = dst.outerSize(); - const Index alignedStep = alignable ? (packetSize - dst.outerStride() % packetSize) & packetAlignedMask : 0; - Index alignedStart = ((!alignable) || assign_traits::DstIsAligned) ? 0 - : internal::first_aligned(&dst.coeffRef(0,0), innerSize); - - for(Index outer = 0; outer < outerSize; ++outer) - { - const Index alignedEnd = alignedStart + ((innerSize-alignedStart) & ~packetAlignedMask); - // do the non-vectorizable part of the assignment - for(Index inner = 0; inner(outer, inner, src); - - // do the non-vectorizable part of the assignment - for(Index inner = alignedEnd; inner((alignedStart+alignedStep)%packetSize, innerSize); - } - } -}; - -} // end namespace internal - -/*************************************************************************** -* Part 4 : implementation of DenseBase methods -***************************************************************************/ - -template -template -EIGEN_STRONG_INLINE Derived& DenseBase - ::lazyAssign(const DenseBase& other) -{ - enum{ - SameType = internal::is_same::value - }; - - EIGEN_STATIC_ASSERT_LVALUE(Derived) - EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Derived,OtherDerived) - EIGEN_STATIC_ASSERT(SameType,YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - -#ifdef EIGEN_DEBUG_ASSIGN - internal::assign_traits::debug(); -#endif - eigen_assert(rows() == other.rows() && cols() == other.cols()); - internal::assign_impl::Traversal) - : int(InvalidTraversal)>::run(derived(),other.derived()); -#ifndef EIGEN_NO_DEBUG - checkTransposeAliasing(other.derived()); -#endif - return derived(); -} - -namespace internal { - -template::Flags) & EvalBeforeAssigningBit) != 0, - bool NeedToTranspose = ((int(Derived::RowsAtCompileTime) == 1 && int(OtherDerived::ColsAtCompileTime) == 1) - | // FIXME | instead of || to please GCC 4.4.0 stupid warning "suggest parentheses around &&". - // revert to || as soon as not needed anymore. - (int(Derived::ColsAtCompileTime) == 1 && int(OtherDerived::RowsAtCompileTime) == 1)) - && int(Derived::SizeAtCompileTime) != 1> -struct assign_selector; - -template -struct assign_selector { - static EIGEN_STRONG_INLINE Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.derived()); } - template - static EIGEN_STRONG_INLINE Derived& evalTo(ActualDerived& dst, const ActualOtherDerived& other) { other.evalTo(dst); return dst; } -}; -template -struct assign_selector { - static EIGEN_STRONG_INLINE Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.eval()); } -}; -template -struct assign_selector { - static EIGEN_STRONG_INLINE Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose()); } - template - static EIGEN_STRONG_INLINE Derived& evalTo(ActualDerived& dst, const ActualOtherDerived& other) { Transpose dstTrans(dst); other.evalTo(dstTrans); return dst; } -}; -template -struct assign_selector { - static EIGEN_STRONG_INLINE Derived& run(Derived& dst, const OtherDerived& other) { return dst.lazyAssign(other.transpose().eval()); } -}; - -} // end namespace internal - -template -template -EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) -{ - return internal::assign_selector::run(derived(), other.derived()); -} - -template -EIGEN_STRONG_INLINE Derived& DenseBase::operator=(const DenseBase& other) -{ - return internal::assign_selector::run(derived(), other.derived()); -} - -template -EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const MatrixBase& other) -{ - return internal::assign_selector::run(derived(), other.derived()); -} - -template -template -EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const DenseBase& other) -{ - return internal::assign_selector::run(derived(), other.derived()); -} - -template -template -EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const EigenBase& other) -{ - return internal::assign_selector::evalTo(derived(), other.derived()); -} - -template -template -EIGEN_STRONG_INLINE Derived& MatrixBase::operator=(const ReturnByValue& other) -{ - return internal::assign_selector::evalTo(derived(), other.derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_ASSIGN_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign_MKL.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign_MKL.h deleted file mode 100644 index 7772951b91..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Assign_MKL.h +++ /dev/null @@ -1,224 +0,0 @@ -/* - Copyright (c) 2011, Intel Corporation. All rights reserved. - - Redistribution and use in source and binary forms, with or without modification, - are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Intel Corporation nor the names of its contributors may - be used to endorse or promote products derived from this software without - specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - ******************************************************************************** - * Content : Eigen bindings to Intel(R) MKL - * MKL VML support for coefficient-wise unary Eigen expressions like a=b.sin() - ******************************************************************************** -*/ - -#ifndef EIGEN_ASSIGN_VML_H -#define EIGEN_ASSIGN_VML_H - -namespace Eigen { - -namespace internal { - -template struct vml_call -{ enum { IsSupported = 0 }; }; - -template -class vml_assign_traits -{ - private: - enum { - DstHasDirectAccess = Dst::Flags & DirectAccessBit, - SrcHasDirectAccess = Src::Flags & DirectAccessBit, - - StorageOrdersAgree = (int(Dst::IsRowMajor) == int(Src::IsRowMajor)), - InnerSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::SizeAtCompileTime) - : int(Dst::Flags)&RowMajorBit ? int(Dst::ColsAtCompileTime) - : int(Dst::RowsAtCompileTime), - InnerMaxSize = int(Dst::IsVectorAtCompileTime) ? int(Dst::MaxSizeAtCompileTime) - : int(Dst::Flags)&RowMajorBit ? int(Dst::MaxColsAtCompileTime) - : int(Dst::MaxRowsAtCompileTime), - MaxSizeAtCompileTime = Dst::SizeAtCompileTime, - - MightEnableVml = vml_call::IsSupported && StorageOrdersAgree && DstHasDirectAccess && SrcHasDirectAccess - && Src::InnerStrideAtCompileTime==1 && Dst::InnerStrideAtCompileTime==1, - MightLinearize = MightEnableVml && (int(Dst::Flags) & int(Src::Flags) & LinearAccessBit), - VmlSize = MightLinearize ? MaxSizeAtCompileTime : InnerMaxSize, - LargeEnough = VmlSize==Dynamic || VmlSize>=EIGEN_MKL_VML_THRESHOLD, - MayEnableVml = MightEnableVml && LargeEnough, - MayLinearize = MayEnableVml && MightLinearize - }; - public: - enum { - Traversal = MayLinearize ? LinearVectorizedTraversal - : MayEnableVml ? InnerVectorizedTraversal - : DefaultTraversal - }; -}; - -template::Traversal > -struct vml_assign_impl - : assign_impl,Traversal,Unrolling,BuiltIn> -{ -}; - -template -struct vml_assign_impl -{ - typedef typename Derived1::Scalar Scalar; - typedef typename Derived1::Index Index; - static inline void run(Derived1& dst, const CwiseUnaryOp& src) - { - // in case we want to (or have to) skip VML at runtime we can call: - // assign_impl,Traversal,Unrolling,BuiltIn>::run(dst,src); - const Index innerSize = dst.innerSize(); - const Index outerSize = dst.outerSize(); - for(Index outer = 0; outer < outerSize; ++outer) { - const Scalar *src_ptr = src.IsRowMajor ? &(src.nestedExpression().coeffRef(outer,0)) : - &(src.nestedExpression().coeffRef(0, outer)); - Scalar *dst_ptr = dst.IsRowMajor ? &(dst.coeffRef(outer,0)) : &(dst.coeffRef(0, outer)); - vml_call::run(src.functor(), innerSize, src_ptr, dst_ptr ); - } - } -}; - -template -struct vml_assign_impl -{ - static inline void run(Derived1& dst, const CwiseUnaryOp& src) - { - // in case we want to (or have to) skip VML at runtime we can call: - // assign_impl,Traversal,Unrolling,BuiltIn>::run(dst,src); - vml_call::run(src.functor(), dst.size(), src.nestedExpression().data(), dst.data() ); - } -}; - -// Macroses - -#define EIGEN_MKL_VML_SPECIALIZE_ASSIGN(TRAVERSAL,UNROLLING) \ - template \ - struct assign_impl, TRAVERSAL, UNROLLING, Specialized> { \ - static inline void run(Derived1 &dst, const Eigen::CwiseUnaryOp &src) { \ - vml_assign_impl::run(dst, src); \ - } \ - }; - -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,NoUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,CompleteUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(DefaultTraversal,InnerUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearTraversal,NoUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearTraversal,CompleteUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,NoUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,CompleteUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(InnerVectorizedTraversal,InnerUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearVectorizedTraversal,CompleteUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(LinearVectorizedTraversal,NoUnrolling) -EIGEN_MKL_VML_SPECIALIZE_ASSIGN(SliceVectorizedTraversal,NoUnrolling) - - -#if !defined (EIGEN_FAST_MATH) || (EIGEN_FAST_MATH != 1) -#define EIGEN_MKL_VML_MODE VML_HA -#else -#define EIGEN_MKL_VML_MODE VML_LA -#endif - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE) \ - template<> struct vml_call< scalar_##EIGENOP##_op > { \ - enum { IsSupported = 1 }; \ - static inline void run( const scalar_##EIGENOP##_op& /*func*/, \ - int size, const EIGENTYPE* src, EIGENTYPE* dst) { \ - VMLOP(size, (const VMLTYPE*)src, (VMLTYPE*)dst); \ - } \ - }; - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALL_LA(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE) \ - template<> struct vml_call< scalar_##EIGENOP##_op > { \ - enum { IsSupported = 1 }; \ - static inline void run( const scalar_##EIGENOP##_op& /*func*/, \ - int size, const EIGENTYPE* src, EIGENTYPE* dst) { \ - MKL_INT64 vmlMode = EIGEN_MKL_VML_MODE; \ - VMLOP(size, (const VMLTYPE*)src, (VMLTYPE*)dst, vmlMode); \ - } \ - }; - -#define EIGEN_MKL_VML_DECLARE_POW_CALL(EIGENOP, VMLOP, EIGENTYPE, VMLTYPE) \ - template<> struct vml_call< scalar_##EIGENOP##_op > { \ - enum { IsSupported = 1 }; \ - static inline void run( const scalar_##EIGENOP##_op& func, \ - int size, const EIGENTYPE* src, EIGENTYPE* dst) { \ - EIGENTYPE exponent = func.m_exponent; \ - MKL_INT64 vmlMode = EIGEN_MKL_VML_MODE; \ - VMLOP(&size, (const VMLTYPE*)src, (const VMLTYPE*)&exponent, \ - (VMLTYPE*)dst, &vmlMode); \ - } \ - }; - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, vs##VMLOP, float, float) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, vd##VMLOP, double, double) - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_COMPLEX(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, vc##VMLOP, scomplex, MKL_Complex8) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL(EIGENOP, vz##VMLOP, dcomplex, MKL_Complex16) - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALLS_COMPLEX(EIGENOP, VMLOP) - - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL_LA(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL_LA(EIGENOP, vms##VMLOP, float, float) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL_LA(EIGENOP, vmd##VMLOP, double, double) - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_COMPLEX_LA(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL_LA(EIGENOP, vmc##VMLOP, scomplex, MKL_Complex8) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALL_LA(EIGENOP, vmz##VMLOP, dcomplex, MKL_Complex16) - -#define EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL_LA(EIGENOP, VMLOP) \ - EIGEN_MKL_VML_DECLARE_UNARY_CALLS_COMPLEX_LA(EIGENOP, VMLOP) - - -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(sin, Sin) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(asin, Asin) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(cos, Cos) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(acos, Acos) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(tan, Tan) -//EIGEN_MKL_VML_DECLARE_UNARY_CALLS(abs, Abs) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(exp, Exp) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(log, Ln) -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_LA(sqrt, Sqrt) - -EIGEN_MKL_VML_DECLARE_UNARY_CALLS_REAL(square, Sqr) - -// The vm*powx functions are not avaibale in the windows version of MKL. -#ifndef _WIN32 -EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmspowx_, float, float) -EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmdpowx_, double, double) -EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmcpowx_, scomplex, MKL_Complex8) -EIGEN_MKL_VML_DECLARE_POW_CALL(pow, vmzpowx_, dcomplex, MKL_Complex16) -#endif - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_ASSIGN_VML_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BandMatrix.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BandMatrix.h deleted file mode 100644 index ffd7fe8b30..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BandMatrix.h +++ /dev/null @@ -1,334 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_BANDMATRIX_H -#define EIGEN_BANDMATRIX_H - -namespace Eigen { - -namespace internal { - -template -class BandMatrixBase : public EigenBase -{ - public: - - enum { - Flags = internal::traits::Flags, - CoeffReadCost = internal::traits::CoeffReadCost, - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - ColsAtCompileTime = internal::traits::ColsAtCompileTime, - MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, - MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, - Supers = internal::traits::Supers, - Subs = internal::traits::Subs, - Options = internal::traits::Options - }; - typedef typename internal::traits::Scalar Scalar; - typedef Matrix DenseMatrixType; - typedef typename DenseMatrixType::Index Index; - typedef typename internal::traits::CoefficientsType CoefficientsType; - typedef EigenBase Base; - - protected: - enum { - DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) - ? 1 + Supers + Subs - : Dynamic, - SizeAtCompileTime = EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime,ColsAtCompileTime) - }; - - public: - - using Base::derived; - using Base::rows; - using Base::cols; - - /** \returns the number of super diagonals */ - inline Index supers() const { return derived().supers(); } - - /** \returns the number of sub diagonals */ - inline Index subs() const { return derived().subs(); } - - /** \returns an expression of the underlying coefficient matrix */ - inline const CoefficientsType& coeffs() const { return derived().coeffs(); } - - /** \returns an expression of the underlying coefficient matrix */ - inline CoefficientsType& coeffs() { return derived().coeffs(); } - - /** \returns a vector expression of the \a i -th column, - * only the meaningful part is returned. - * \warning the internal storage must be column major. */ - inline Block col(Index i) - { - EIGEN_STATIC_ASSERT((Options&RowMajor)==0,THIS_METHOD_IS_ONLY_FOR_COLUMN_MAJOR_MATRICES); - Index start = 0; - Index len = coeffs().rows(); - if (i<=supers()) - { - start = supers()-i; - len = (std::min)(rows(),std::max(0,coeffs().rows() - (supers()-i))); - } - else if (i>=rows()-subs()) - len = std::max(0,coeffs().rows() - (i + 1 - rows() + subs())); - return Block(coeffs(), start, i, len, 1); - } - - /** \returns a vector expression of the main diagonal */ - inline Block diagonal() - { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } - - /** \returns a vector expression of the main diagonal (const version) */ - inline const Block diagonal() const - { return Block(coeffs(),supers(),0,1,(std::min)(rows(),cols())); } - - template struct DiagonalIntReturnType { - enum { - ReturnOpposite = (Options&SelfAdjoint) && (((Index)>0 && Supers==0) || ((Index)<0 && Subs==0)), - Conjugate = ReturnOpposite && NumTraits::IsComplex, - ActualIndex = ReturnOpposite ? -Index : Index, - DiagonalSize = (RowsAtCompileTime==Dynamic || ColsAtCompileTime==Dynamic) - ? Dynamic - : (ActualIndex<0 - ? EIGEN_SIZE_MIN_PREFER_DYNAMIC(ColsAtCompileTime, RowsAtCompileTime + ActualIndex) - : EIGEN_SIZE_MIN_PREFER_DYNAMIC(RowsAtCompileTime, ColsAtCompileTime - ActualIndex)) - }; - typedef Block BuildType; - typedef typename internal::conditional,BuildType >, - BuildType>::type Type; - }; - - /** \returns a vector expression of the \a N -th sub or super diagonal */ - template inline typename DiagonalIntReturnType::Type diagonal() - { - return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); - } - - /** \returns a vector expression of the \a N -th sub or super diagonal */ - template inline const typename DiagonalIntReturnType::Type diagonal() const - { - return typename DiagonalIntReturnType::BuildType(coeffs(), supers()-N, (std::max)(0,N), 1, diagonalLength(N)); - } - - /** \returns a vector expression of the \a i -th sub or super diagonal */ - inline Block diagonal(Index i) - { - eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); - return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); - } - - /** \returns a vector expression of the \a i -th sub or super diagonal */ - inline const Block diagonal(Index i) const - { - eigen_assert((i<0 && -i<=subs()) || (i>=0 && i<=supers())); - return Block(coeffs(), supers()-i, std::max(0,i), 1, diagonalLength(i)); - } - - template inline void evalTo(Dest& dst) const - { - dst.resize(rows(),cols()); - dst.setZero(); - dst.diagonal() = diagonal(); - for (Index i=1; i<=supers();++i) - dst.diagonal(i) = diagonal(i); - for (Index i=1; i<=subs();++i) - dst.diagonal(-i) = diagonal(-i); - } - - DenseMatrixType toDenseMatrix() const - { - DenseMatrixType res(rows(),cols()); - evalTo(res); - return res; - } - - protected: - - inline Index diagonalLength(Index i) const - { return i<0 ? (std::min)(cols(),rows()+i) : (std::min)(rows(),cols()-i); } -}; - -/** - * \class BandMatrix - * \ingroup Core_Module - * - * \brief Represents a rectangular matrix with a banded storage - * - * \param _Scalar Numeric type, i.e. float, double, int - * \param Rows Number of rows, or \b Dynamic - * \param Cols Number of columns, or \b Dynamic - * \param Supers Number of super diagonal - * \param Subs Number of sub diagonal - * \param _Options A combination of either \b #RowMajor or \b #ColMajor, and of \b #SelfAdjoint - * The former controls \ref TopicStorageOrders "storage order", and defaults to - * column-major. The latter controls whether the matrix represents a selfadjoint - * matrix in which case either Supers of Subs have to be null. - * - * \sa class TridiagonalMatrix - */ - -template -struct traits > -{ - typedef _Scalar Scalar; - typedef Dense StorageKind; - typedef DenseIndex Index; - enum { - CoeffReadCost = NumTraits::ReadCost, - RowsAtCompileTime = _Rows, - ColsAtCompileTime = _Cols, - MaxRowsAtCompileTime = _Rows, - MaxColsAtCompileTime = _Cols, - Flags = LvalueBit, - Supers = _Supers, - Subs = _Subs, - Options = _Options, - DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic - }; - typedef Matrix CoefficientsType; -}; - -template -class BandMatrix : public BandMatrixBase > -{ - public: - - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::CoefficientsType CoefficientsType; - - inline BandMatrix(Index rows=Rows, Index cols=Cols, Index supers=Supers, Index subs=Subs) - : m_coeffs(1+supers+subs,cols), - m_rows(rows), m_supers(supers), m_subs(subs) - { - } - - /** \returns the number of columns */ - inline Index rows() const { return m_rows.value(); } - - /** \returns the number of rows */ - inline Index cols() const { return m_coeffs.cols(); } - - /** \returns the number of super diagonals */ - inline Index supers() const { return m_supers.value(); } - - /** \returns the number of sub diagonals */ - inline Index subs() const { return m_subs.value(); } - - inline const CoefficientsType& coeffs() const { return m_coeffs; } - inline CoefficientsType& coeffs() { return m_coeffs; } - - protected: - - CoefficientsType m_coeffs; - internal::variable_if_dynamic m_rows; - internal::variable_if_dynamic m_supers; - internal::variable_if_dynamic m_subs; -}; - -template -class BandMatrixWrapper; - -template -struct traits > -{ - typedef typename _CoefficientsType::Scalar Scalar; - typedef typename _CoefficientsType::StorageKind StorageKind; - typedef typename _CoefficientsType::Index Index; - enum { - CoeffReadCost = internal::traits<_CoefficientsType>::CoeffReadCost, - RowsAtCompileTime = _Rows, - ColsAtCompileTime = _Cols, - MaxRowsAtCompileTime = _Rows, - MaxColsAtCompileTime = _Cols, - Flags = LvalueBit, - Supers = _Supers, - Subs = _Subs, - Options = _Options, - DataRowsAtCompileTime = ((Supers!=Dynamic) && (Subs!=Dynamic)) ? 1 + Supers + Subs : Dynamic - }; - typedef _CoefficientsType CoefficientsType; -}; - -template -class BandMatrixWrapper : public BandMatrixBase > -{ - public: - - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::traits::CoefficientsType CoefficientsType; - typedef typename internal::traits::Index Index; - - inline BandMatrixWrapper(const CoefficientsType& coeffs, Index rows=_Rows, Index cols=_Cols, Index supers=_Supers, Index subs=_Subs) - : m_coeffs(coeffs), - m_rows(rows), m_supers(supers), m_subs(subs) - { - EIGEN_UNUSED_VARIABLE(cols); - //internal::assert(coeffs.cols()==cols() && (supers()+subs()+1)==coeffs.rows()); - } - - /** \returns the number of columns */ - inline Index rows() const { return m_rows.value(); } - - /** \returns the number of rows */ - inline Index cols() const { return m_coeffs.cols(); } - - /** \returns the number of super diagonals */ - inline Index supers() const { return m_supers.value(); } - - /** \returns the number of sub diagonals */ - inline Index subs() const { return m_subs.value(); } - - inline const CoefficientsType& coeffs() const { return m_coeffs; } - - protected: - - const CoefficientsType& m_coeffs; - internal::variable_if_dynamic m_rows; - internal::variable_if_dynamic m_supers; - internal::variable_if_dynamic m_subs; -}; - -/** - * \class TridiagonalMatrix - * \ingroup Core_Module - * - * \brief Represents a tridiagonal matrix with a compact banded storage - * - * \param _Scalar Numeric type, i.e. float, double, int - * \param Size Number of rows and cols, or \b Dynamic - * \param _Options Can be 0 or \b SelfAdjoint - * - * \sa class BandMatrix - */ -template -class TridiagonalMatrix : public BandMatrix -{ - typedef BandMatrix Base; - typedef typename Base::Index Index; - public: - TridiagonalMatrix(Index size = Size) : Base(size,size,Options&SelfAdjoint?0:1,1) {} - - inline typename Base::template DiagonalIntReturnType<1>::Type super() - { return Base::template diagonal<1>(); } - inline const typename Base::template DiagonalIntReturnType<1>::Type super() const - { return Base::template diagonal<1>(); } - inline typename Base::template DiagonalIntReturnType<-1>::Type sub() - { return Base::template diagonal<-1>(); } - inline const typename Base::template DiagonalIntReturnType<-1>::Type sub() const - { return Base::template diagonal<-1>(); } - protected: -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_BANDMATRIX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Block.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Block.h deleted file mode 100644 index 358b3188b3..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Block.h +++ /dev/null @@ -1,405 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_BLOCK_H -#define EIGEN_BLOCK_H - -namespace Eigen { - -/** \class Block - * \ingroup Core_Module - * - * \brief Expression of a fixed-size or dynamic-size block - * - * \param XprType the type of the expression in which we are taking a block - * \param BlockRows the number of rows of the block we are taking at compile time (optional) - * \param BlockCols the number of columns of the block we are taking at compile time (optional) - * - * This class represents an expression of either a fixed-size or dynamic-size block. It is the return - * type of DenseBase::block(Index,Index,Index,Index) and DenseBase::block(Index,Index) and - * most of the time this is the only way it is used. - * - * However, if you want to directly maniputate block expressions, - * for instance if you want to write a function returning such an expression, you - * will need to use this class. - * - * Here is an example illustrating the dynamic case: - * \include class_Block.cpp - * Output: \verbinclude class_Block.out - * - * \note Even though this expression has dynamic size, in the case where \a XprType - * has fixed size, this expression inherits a fixed maximal size which means that evaluating - * it does not cause a dynamic memory allocation. - * - * Here is an example illustrating the fixed-size case: - * \include class_FixedBlock.cpp - * Output: \verbinclude class_FixedBlock.out - * - * \sa DenseBase::block(Index,Index,Index,Index), DenseBase::block(Index,Index), class VectorBlock - */ - -namespace internal { -template -struct traits > : traits -{ - typedef typename traits::Scalar Scalar; - typedef typename traits::StorageKind StorageKind; - typedef typename traits::XprKind XprKind; - typedef typename nested::type XprTypeNested; - typedef typename remove_reference::type _XprTypeNested; - enum{ - MatrixRows = traits::RowsAtCompileTime, - MatrixCols = traits::ColsAtCompileTime, - RowsAtCompileTime = MatrixRows == 0 ? 0 : BlockRows, - ColsAtCompileTime = MatrixCols == 0 ? 0 : BlockCols, - MaxRowsAtCompileTime = BlockRows==0 ? 0 - : RowsAtCompileTime != Dynamic ? int(RowsAtCompileTime) - : int(traits::MaxRowsAtCompileTime), - MaxColsAtCompileTime = BlockCols==0 ? 0 - : ColsAtCompileTime != Dynamic ? int(ColsAtCompileTime) - : int(traits::MaxColsAtCompileTime), - XprTypeIsRowMajor = (int(traits::Flags)&RowMajorBit) != 0, - IsRowMajor = (MaxRowsAtCompileTime==1&&MaxColsAtCompileTime!=1) ? 1 - : (MaxColsAtCompileTime==1&&MaxRowsAtCompileTime!=1) ? 0 - : XprTypeIsRowMajor, - HasSameStorageOrderAsXprType = (IsRowMajor == XprTypeIsRowMajor), - InnerSize = IsRowMajor ? int(ColsAtCompileTime) : int(RowsAtCompileTime), - InnerStrideAtCompileTime = HasSameStorageOrderAsXprType - ? int(inner_stride_at_compile_time::ret) - : int(outer_stride_at_compile_time::ret), - OuterStrideAtCompileTime = HasSameStorageOrderAsXprType - ? int(outer_stride_at_compile_time::ret) - : int(inner_stride_at_compile_time::ret), - MaskPacketAccessBit = (InnerSize == Dynamic || (InnerSize % packet_traits::size) == 0) - && (InnerStrideAtCompileTime == 1) - ? PacketAccessBit : 0, - MaskAlignedBit = (InnerPanel && (OuterStrideAtCompileTime!=Dynamic) && (((OuterStrideAtCompileTime * int(sizeof(Scalar))) % 16) == 0)) ? AlignedBit : 0, - FlagsLinearAccessBit = (RowsAtCompileTime == 1 || ColsAtCompileTime == 1) ? LinearAccessBit : 0, - FlagsLvalueBit = is_lvalue::value ? LvalueBit : 0, - FlagsRowMajorBit = IsRowMajor ? RowMajorBit : 0, - Flags0 = traits::Flags & ( (HereditaryBits & ~RowMajorBit) | - DirectAccessBit | - MaskPacketAccessBit | - MaskAlignedBit), - Flags = Flags0 | FlagsLinearAccessBit | FlagsLvalueBit | FlagsRowMajorBit - }; -}; - -template::ret> class BlockImpl_dense; - -} // end namespace internal - -template class BlockImpl; - -template class Block - : public BlockImpl::StorageKind> -{ - typedef BlockImpl::StorageKind> Impl; - public: - //typedef typename Impl::Base Base; - typedef Impl Base; - EIGEN_GENERIC_PUBLIC_INTERFACE(Block) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block) - - /** Column or Row constructor - */ - inline Block(XprType& xpr, Index i) : Impl(xpr,i) - { - eigen_assert( (i>=0) && ( - ((BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) && i= 0 && BlockRows >= 1 && a_startRow + BlockRows <= xpr.rows() - && a_startCol >= 0 && BlockCols >= 1 && a_startCol + BlockCols <= xpr.cols()); - } - - /** Dynamic-size constructor - */ - inline Block(XprType& xpr, - Index a_startRow, Index a_startCol, - Index blockRows, Index blockCols) - : Impl(xpr, a_startRow, a_startCol, blockRows, blockCols) - { - eigen_assert((RowsAtCompileTime==Dynamic || RowsAtCompileTime==blockRows) - && (ColsAtCompileTime==Dynamic || ColsAtCompileTime==blockCols)); - eigen_assert(a_startRow >= 0 && blockRows >= 0 && a_startRow <= xpr.rows() - blockRows - && a_startCol >= 0 && blockCols >= 0 && a_startCol <= xpr.cols() - blockCols); - } -}; - -// The generic default implementation for dense block simplu forward to the internal::BlockImpl_dense -// that must be specialized for direct and non-direct access... -template -class BlockImpl - : public internal::BlockImpl_dense -{ - typedef internal::BlockImpl_dense Impl; - typedef typename XprType::Index Index; - public: - typedef Impl Base; - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl) - inline BlockImpl(XprType& xpr, Index i) : Impl(xpr,i) {} - inline BlockImpl(XprType& xpr, Index a_startRow, Index a_startCol) : Impl(xpr, a_startRow, a_startCol) {} - inline BlockImpl(XprType& xpr, Index a_startRow, Index a_startCol, Index blockRows, Index blockCols) - : Impl(xpr, a_startRow, a_startCol, blockRows, blockCols) {} -}; - -namespace internal { - -/** \internal Internal implementation of dense Blocks in the general case. */ -template class BlockImpl_dense - : public internal::dense_xpr_base >::type -{ - typedef Block BlockType; - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) - - class InnerIterator; - - /** Column or Row constructor - */ - inline BlockImpl_dense(XprType& xpr, Index i) - : m_xpr(xpr), - // It is a row if and only if BlockRows==1 and BlockCols==XprType::ColsAtCompileTime, - // and it is a column if and only if BlockRows==XprType::RowsAtCompileTime and BlockCols==1, - // all other cases are invalid. - // The case a 1x1 matrix seems ambiguous, but the result is the same anyway. - m_startRow( (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0), - m_startCol( (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0), - m_blockRows(BlockRows==1 ? 1 : xpr.rows()), - m_blockCols(BlockCols==1 ? 1 : xpr.cols()) - {} - - /** Fixed-size constructor - */ - inline BlockImpl_dense(XprType& xpr, Index a_startRow, Index a_startCol) - : m_xpr(xpr), m_startRow(a_startRow), m_startCol(a_startCol), - m_blockRows(BlockRows), m_blockCols(BlockCols) - {} - - /** Dynamic-size constructor - */ - inline BlockImpl_dense(XprType& xpr, - Index a_startRow, Index a_startCol, - Index blockRows, Index blockCols) - : m_xpr(xpr), m_startRow(a_startRow), m_startCol(a_startCol), - m_blockRows(blockRows), m_blockCols(blockCols) - {} - - inline Index rows() const { return m_blockRows.value(); } - inline Index cols() const { return m_blockCols.value(); } - - inline Scalar& coeffRef(Index rowId, Index colId) - { - EIGEN_STATIC_ASSERT_LVALUE(XprType) - return m_xpr.const_cast_derived() - .coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); - } - - inline const Scalar& coeffRef(Index rowId, Index colId) const - { - return m_xpr.derived() - .coeffRef(rowId + m_startRow.value(), colId + m_startCol.value()); - } - - EIGEN_STRONG_INLINE const CoeffReturnType coeff(Index rowId, Index colId) const - { - return m_xpr.coeff(rowId + m_startRow.value(), colId + m_startCol.value()); - } - - inline Scalar& coeffRef(Index index) - { - EIGEN_STATIC_ASSERT_LVALUE(XprType) - return m_xpr.const_cast_derived() - .coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - inline const Scalar& coeffRef(Index index) const - { - return m_xpr.const_cast_derived() - .coeffRef(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - inline const CoeffReturnType coeff(Index index) const - { - return m_xpr - .coeff(m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - template - inline PacketScalar packet(Index rowId, Index colId) const - { - return m_xpr.template packet - (rowId + m_startRow.value(), colId + m_startCol.value()); - } - - template - inline void writePacket(Index rowId, Index colId, const PacketScalar& val) - { - m_xpr.const_cast_derived().template writePacket - (rowId + m_startRow.value(), colId + m_startCol.value(), val); - } - - template - inline PacketScalar packet(Index index) const - { - return m_xpr.template packet - (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0)); - } - - template - inline void writePacket(Index index, const PacketScalar& val) - { - m_xpr.const_cast_derived().template writePacket - (m_startRow.value() + (RowsAtCompileTime == 1 ? 0 : index), - m_startCol.value() + (RowsAtCompileTime == 1 ? index : 0), val); - } - - #ifdef EIGEN_PARSED_BY_DOXYGEN - /** \sa MapBase::data() */ - inline const Scalar* data() const; - inline Index innerStride() const; - inline Index outerStride() const; - #endif - - const typename internal::remove_all::type& nestedExpression() const - { - return m_xpr; - } - - Index startRow() const - { - return m_startRow.value(); - } - - Index startCol() const - { - return m_startCol.value(); - } - - protected: - - const typename XprType::Nested m_xpr; - const internal::variable_if_dynamic m_startRow; - const internal::variable_if_dynamic m_startCol; - const internal::variable_if_dynamic m_blockRows; - const internal::variable_if_dynamic m_blockCols; -}; - -/** \internal Internal implementation of dense Blocks in the direct access case.*/ -template -class BlockImpl_dense - : public MapBase > -{ - typedef Block BlockType; - public: - - typedef MapBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(BlockType) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(BlockImpl_dense) - - /** Column or Row constructor - */ - inline BlockImpl_dense(XprType& xpr, Index i) - : Base(internal::const_cast_ptr(&xpr.coeffRef( - (BlockRows==1) && (BlockCols==XprType::ColsAtCompileTime) ? i : 0, - (BlockRows==XprType::RowsAtCompileTime) && (BlockCols==1) ? i : 0)), - BlockRows==1 ? 1 : xpr.rows(), - BlockCols==1 ? 1 : xpr.cols()), - m_xpr(xpr) - { - init(); - } - - /** Fixed-size constructor - */ - inline BlockImpl_dense(XprType& xpr, Index startRow, Index startCol) - : Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol))), m_xpr(xpr) - { - init(); - } - - /** Dynamic-size constructor - */ - inline BlockImpl_dense(XprType& xpr, - Index startRow, Index startCol, - Index blockRows, Index blockCols) - : Base(internal::const_cast_ptr(&xpr.coeffRef(startRow,startCol)), blockRows, blockCols), - m_xpr(xpr) - { - init(); - } - - const typename internal::remove_all::type& nestedExpression() const - { - return m_xpr; - } - - /** \sa MapBase::innerStride() */ - inline Index innerStride() const - { - return internal::traits::HasSameStorageOrderAsXprType - ? m_xpr.innerStride() - : m_xpr.outerStride(); - } - - /** \sa MapBase::outerStride() */ - inline Index outerStride() const - { - return m_outerStride; - } - - #ifndef __SUNPRO_CC - // FIXME sunstudio is not friendly with the above friend... - // META-FIXME there is no 'friend' keyword around here. Is this obsolete? - protected: - #endif - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** \internal used by allowAligned() */ - inline BlockImpl_dense(XprType& xpr, const Scalar* data, Index blockRows, Index blockCols) - : Base(data, blockRows, blockCols), m_xpr(xpr) - { - init(); - } - #endif - - protected: - void init() - { - m_outerStride = internal::traits::HasSameStorageOrderAsXprType - ? m_xpr.outerStride() - : m_xpr.innerStride(); - } - - typename XprType::Nested m_xpr; - Index m_outerStride; -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_BLOCK_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BooleanRedux.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BooleanRedux.h deleted file mode 100644 index 6e37e031a8..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/BooleanRedux.h +++ /dev/null @@ -1,154 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_ALLANDANY_H -#define EIGEN_ALLANDANY_H - -namespace Eigen { - -namespace internal { - -template -struct all_unroller -{ - enum { - col = (UnrollCount-1) / Derived::RowsAtCompileTime, - row = (UnrollCount-1) % Derived::RowsAtCompileTime - }; - - static inline bool run(const Derived &mat) - { - return all_unroller::run(mat) && mat.coeff(row, col); - } -}; - -template -struct all_unroller -{ - static inline bool run(const Derived &mat) { return mat.coeff(0, 0); } -}; - -template -struct all_unroller -{ - static inline bool run(const Derived &) { return false; } -}; - -template -struct any_unroller -{ - enum { - col = (UnrollCount-1) / Derived::RowsAtCompileTime, - row = (UnrollCount-1) % Derived::RowsAtCompileTime - }; - - static inline bool run(const Derived &mat) - { - return any_unroller::run(mat) || mat.coeff(row, col); - } -}; - -template -struct any_unroller -{ - static inline bool run(const Derived &mat) { return mat.coeff(0, 0); } -}; - -template -struct any_unroller -{ - static inline bool run(const Derived &) { return false; } -}; - -} // end namespace internal - -/** \returns true if all coefficients are true - * - * Example: \include MatrixBase_all.cpp - * Output: \verbinclude MatrixBase_all.out - * - * \sa any(), Cwise::operator<() - */ -template -inline bool DenseBase::all() const -{ - enum { - unroll = SizeAtCompileTime != Dynamic - && CoeffReadCost != Dynamic - && NumTraits::AddCost != Dynamic - && SizeAtCompileTime * (CoeffReadCost + NumTraits::AddCost) <= EIGEN_UNROLLING_LIMIT - }; - if(unroll) - return internal::all_unroller::run(derived()); - else - { - for(Index j = 0; j < cols(); ++j) - for(Index i = 0; i < rows(); ++i) - if (!coeff(i, j)) return false; - return true; - } -} - -/** \returns true if at least one coefficient is true - * - * \sa all() - */ -template -inline bool DenseBase::any() const -{ - enum { - unroll = SizeAtCompileTime != Dynamic - && CoeffReadCost != Dynamic - && NumTraits::AddCost != Dynamic - && SizeAtCompileTime * (CoeffReadCost + NumTraits::AddCost) <= EIGEN_UNROLLING_LIMIT - }; - if(unroll) - return internal::any_unroller::run(derived()); - else - { - for(Index j = 0; j < cols(); ++j) - for(Index i = 0; i < rows(); ++i) - if (coeff(i, j)) return true; - return false; - } -} - -/** \returns the number of coefficients which evaluate to true - * - * \sa all(), any() - */ -template -inline typename DenseBase::Index DenseBase::count() const -{ - return derived().template cast().template cast().sum(); -} - -/** \returns true is \c *this contains at least one Not A Number (NaN). - * - * \sa allFinite() - */ -template -inline bool DenseBase::hasNaN() const -{ - return !((derived().array()==derived().array()).all()); -} - -/** \returns true if \c *this contains only finite numbers, i.e., no NaN and no +/-INF values. - * - * \sa hasNaN() - */ -template -inline bool DenseBase::allFinite() const -{ - return !((derived()-derived()).hasNaN()); -} - -} // end namespace Eigen - -#endif // EIGEN_ALLANDANY_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CommaInitializer.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CommaInitializer.h deleted file mode 100644 index a96867af4d..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CommaInitializer.h +++ /dev/null @@ -1,143 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_COMMAINITIALIZER_H -#define EIGEN_COMMAINITIALIZER_H - -namespace Eigen { - -/** \class CommaInitializer - * \ingroup Core_Module - * - * \brief Helper class used by the comma initializer operator - * - * This class is internally used to implement the comma initializer feature. It is - * the return type of MatrixBase::operator<<, and most of the time this is the only - * way it is used. - * - * \sa \ref MatrixBaseCommaInitRef "MatrixBase::operator<<", CommaInitializer::finished() - */ -template -struct CommaInitializer -{ - typedef typename XprType::Scalar Scalar; - typedef typename XprType::Index Index; - - inline CommaInitializer(XprType& xpr, const Scalar& s) - : m_xpr(xpr), m_row(0), m_col(1), m_currentBlockRows(1) - { - m_xpr.coeffRef(0,0) = s; - } - - template - inline CommaInitializer(XprType& xpr, const DenseBase& other) - : m_xpr(xpr), m_row(0), m_col(other.cols()), m_currentBlockRows(other.rows()) - { - m_xpr.block(0, 0, other.rows(), other.cols()) = other; - } - - /* inserts a scalar value in the target matrix */ - CommaInitializer& operator,(const Scalar& s) - { - if (m_col==m_xpr.cols()) - { - m_row+=m_currentBlockRows; - m_col = 0; - m_currentBlockRows = 1; - eigen_assert(m_row - CommaInitializer& operator,(const DenseBase& other) - { - if(other.cols()==0 || other.rows()==0) - return *this; - if (m_col==m_xpr.cols()) - { - m_row+=m_currentBlockRows; - m_col = 0; - m_currentBlockRows = other.rows(); - eigen_assert(m_row+m_currentBlockRows<=m_xpr.rows() - && "Too many rows passed to comma initializer (operator<<)"); - } - eigen_assert(m_col - (m_row, m_col) = other; - else - m_xpr.block(m_row, m_col, other.rows(), other.cols()) = other; - m_col += other.cols(); - return *this; - } - - inline ~CommaInitializer() - { - eigen_assert((m_row+m_currentBlockRows) == m_xpr.rows() - && m_col == m_xpr.cols() - && "Too few coefficients passed to comma initializer (operator<<)"); - } - - /** \returns the built matrix once all its coefficients have been set. - * Calling finished is 100% optional. Its purpose is to write expressions - * like this: - * \code - * quaternion.fromRotationMatrix((Matrix3f() << axis0, axis1, axis2).finished()); - * \endcode - */ - inline XprType& finished() { return m_xpr; } - - XprType& m_xpr; // target expression - Index m_row; // current row id - Index m_col; // current col id - Index m_currentBlockRows; // current block height -}; - -/** \anchor MatrixBaseCommaInitRef - * Convenient operator to set the coefficients of a matrix. - * - * The coefficients must be provided in a row major order and exactly match - * the size of the matrix. Otherwise an assertion is raised. - * - * Example: \include MatrixBase_set.cpp - * Output: \verbinclude MatrixBase_set.out - * - * \note According the c++ standard, the argument expressions of this comma initializer are evaluated in arbitrary order. - * - * \sa CommaInitializer::finished(), class CommaInitializer - */ -template -inline CommaInitializer DenseBase::operator<< (const Scalar& s) -{ - return CommaInitializer(*static_cast(this), s); -} - -/** \sa operator<<(const Scalar&) */ -template -template -inline CommaInitializer -DenseBase::operator<<(const DenseBase& other) -{ - return CommaInitializer(*static_cast(this), other); -} - -} // end namespace Eigen - -#endif // EIGEN_COMMAINITIALIZER_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CoreIterators.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CoreIterators.h deleted file mode 100644 index 6da4683d2c..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CoreIterators.h +++ /dev/null @@ -1,61 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_COREITERATORS_H -#define EIGEN_COREITERATORS_H - -namespace Eigen { - -/* This file contains the respective InnerIterator definition of the expressions defined in Eigen/Core - */ - -/** \ingroup SparseCore_Module - * \class InnerIterator - * \brief An InnerIterator allows to loop over the element of a sparse (or dense) matrix or expression - * - * todo - */ - -// generic version for dense matrix and expressions -template class DenseBase::InnerIterator -{ - protected: - typedef typename Derived::Scalar Scalar; - typedef typename Derived::Index Index; - - enum { IsRowMajor = (Derived::Flags&RowMajorBit)==RowMajorBit }; - public: - EIGEN_STRONG_INLINE InnerIterator(const Derived& expr, Index outer) - : m_expression(expr), m_inner(0), m_outer(outer), m_end(expr.innerSize()) - {} - - EIGEN_STRONG_INLINE Scalar value() const - { - return (IsRowMajor) ? m_expression.coeff(m_outer, m_inner) - : m_expression.coeff(m_inner, m_outer); - } - - EIGEN_STRONG_INLINE InnerIterator& operator++() { m_inner++; return *this; } - - EIGEN_STRONG_INLINE Index index() const { return m_inner; } - inline Index row() const { return IsRowMajor ? m_outer : index(); } - inline Index col() const { return IsRowMajor ? index() : m_outer; } - - EIGEN_STRONG_INLINE operator bool() const { return m_inner < m_end && m_inner>=0; } - - protected: - const Derived& m_expression; - Index m_inner; - const Index m_outer; - const Index m_end; -}; - -} // end namespace Eigen - -#endif // EIGEN_COREITERATORS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseBinaryOp.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseBinaryOp.h deleted file mode 100644 index 586f77aaf3..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseBinaryOp.h +++ /dev/null @@ -1,229 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CWISE_BINARY_OP_H -#define EIGEN_CWISE_BINARY_OP_H - -namespace Eigen { - -/** \class CwiseBinaryOp - * \ingroup Core_Module - * - * \brief Generic expression where a coefficient-wise binary operator is applied to two expressions - * - * \param BinaryOp template functor implementing the operator - * \param Lhs the type of the left-hand side - * \param Rhs the type of the right-hand side - * - * This class represents an expression where a coefficient-wise binary operator is applied to two expressions. - * It is the return type of binary operators, by which we mean only those binary operators where - * both the left-hand side and the right-hand side are Eigen expressions. - * For example, the return type of matrix1+matrix2 is a CwiseBinaryOp. - * - * Most of the time, this is the only way that it is used, so you typically don't have to name - * CwiseBinaryOp types explicitly. - * - * \sa MatrixBase::binaryExpr(const MatrixBase &,const CustomBinaryOp &) const, class CwiseUnaryOp, class CwiseNullaryOp - */ - -namespace internal { -template -struct traits > -{ - // we must not inherit from traits since it has - // the potential to cause problems with MSVC - typedef typename remove_all::type Ancestor; - typedef typename traits::XprKind XprKind; - enum { - RowsAtCompileTime = traits::RowsAtCompileTime, - ColsAtCompileTime = traits::ColsAtCompileTime, - MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, - MaxColsAtCompileTime = traits::MaxColsAtCompileTime - }; - - // even though we require Lhs and Rhs to have the same scalar type (see CwiseBinaryOp constructor), - // we still want to handle the case when the result type is different. - typedef typename result_of< - BinaryOp( - typename Lhs::Scalar, - typename Rhs::Scalar - ) - >::type Scalar; - typedef typename promote_storage_type::StorageKind, - typename traits::StorageKind>::ret StorageKind; - typedef typename promote_index_type::Index, - typename traits::Index>::type Index; - typedef typename Lhs::Nested LhsNested; - typedef typename Rhs::Nested RhsNested; - typedef typename remove_reference::type _LhsNested; - typedef typename remove_reference::type _RhsNested; - enum { - LhsCoeffReadCost = _LhsNested::CoeffReadCost, - RhsCoeffReadCost = _RhsNested::CoeffReadCost, - LhsFlags = _LhsNested::Flags, - RhsFlags = _RhsNested::Flags, - SameType = is_same::value, - StorageOrdersAgree = (int(Lhs::Flags)&RowMajorBit)==(int(Rhs::Flags)&RowMajorBit), - Flags0 = (int(LhsFlags) | int(RhsFlags)) & ( - HereditaryBits - | (int(LhsFlags) & int(RhsFlags) & - ( AlignedBit - | (StorageOrdersAgree ? LinearAccessBit : 0) - | (functor_traits::PacketAccess && StorageOrdersAgree && SameType ? PacketAccessBit : 0) - ) - ) - ), - Flags = (Flags0 & ~RowMajorBit) | (LhsFlags & RowMajorBit), - CoeffReadCost = LhsCoeffReadCost + RhsCoeffReadCost + functor_traits::Cost - }; -}; -} // end namespace internal - -// we require Lhs and Rhs to have the same scalar type. Currently there is no example of a binary functor -// that would take two operands of different types. If there were such an example, then this check should be -// moved to the BinaryOp functors, on a per-case basis. This would however require a change in the BinaryOp functors, as -// currently they take only one typename Scalar template parameter. -// It is tempting to always allow mixing different types but remember that this is often impossible in the vectorized paths. -// So allowing mixing different types gives very unexpected errors when enabling vectorization, when the user tries to -// add together a float matrix and a double matrix. -#define EIGEN_CHECK_BINARY_COMPATIBILIY(BINOP,LHS,RHS) \ - EIGEN_STATIC_ASSERT((internal::functor_is_product_like::ret \ - ? int(internal::scalar_product_traits::Defined) \ - : int(internal::is_same::value)), \ - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - -template -class CwiseBinaryOpImpl; - -template -class CwiseBinaryOp : internal::no_assignment_operator, - public CwiseBinaryOpImpl< - BinaryOp, Lhs, Rhs, - typename internal::promote_storage_type::StorageKind, - typename internal::traits::StorageKind>::ret> -{ - public: - - typedef typename CwiseBinaryOpImpl< - BinaryOp, Lhs, Rhs, - typename internal::promote_storage_type::StorageKind, - typename internal::traits::StorageKind>::ret>::Base Base; - EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseBinaryOp) - - typedef typename internal::nested::type LhsNested; - typedef typename internal::nested::type RhsNested; - typedef typename internal::remove_reference::type _LhsNested; - typedef typename internal::remove_reference::type _RhsNested; - - EIGEN_STRONG_INLINE CwiseBinaryOp(const Lhs& aLhs, const Rhs& aRhs, const BinaryOp& func = BinaryOp()) - : m_lhs(aLhs), m_rhs(aRhs), m_functor(func) - { - EIGEN_CHECK_BINARY_COMPATIBILIY(BinaryOp,typename Lhs::Scalar,typename Rhs::Scalar); - // require the sizes to match - EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Lhs, Rhs) - eigen_assert(aLhs.rows() == aRhs.rows() && aLhs.cols() == aRhs.cols()); - } - - EIGEN_STRONG_INLINE Index rows() const { - // return the fixed size type if available to enable compile time optimizations - if (internal::traits::type>::RowsAtCompileTime==Dynamic) - return m_rhs.rows(); - else - return m_lhs.rows(); - } - EIGEN_STRONG_INLINE Index cols() const { - // return the fixed size type if available to enable compile time optimizations - if (internal::traits::type>::ColsAtCompileTime==Dynamic) - return m_rhs.cols(); - else - return m_lhs.cols(); - } - - /** \returns the left hand side nested expression */ - const _LhsNested& lhs() const { return m_lhs; } - /** \returns the right hand side nested expression */ - const _RhsNested& rhs() const { return m_rhs; } - /** \returns the functor representing the binary operation */ - const BinaryOp& functor() const { return m_functor; } - - protected: - LhsNested m_lhs; - RhsNested m_rhs; - const BinaryOp m_functor; -}; - -template -class CwiseBinaryOpImpl - : public internal::dense_xpr_base >::type -{ - typedef CwiseBinaryOp Derived; - public: - - typedef typename internal::dense_xpr_base >::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE( Derived ) - - EIGEN_STRONG_INLINE const Scalar coeff(Index rowId, Index colId) const - { - return derived().functor()(derived().lhs().coeff(rowId, colId), - derived().rhs().coeff(rowId, colId)); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const - { - return derived().functor().packetOp(derived().lhs().template packet(rowId, colId), - derived().rhs().template packet(rowId, colId)); - } - - EIGEN_STRONG_INLINE const Scalar coeff(Index index) const - { - return derived().functor()(derived().lhs().coeff(index), - derived().rhs().coeff(index)); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index index) const - { - return derived().functor().packetOp(derived().lhs().template packet(index), - derived().rhs().template packet(index)); - } -}; - -/** replaces \c *this by \c *this - \a other. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -MatrixBase::operator-=(const MatrixBase &other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -/** replaces \c *this by \c *this + \a other. - * - * \returns a reference to \c *this - */ -template -template -EIGEN_STRONG_INLINE Derived & -MatrixBase::operator+=(const MatrixBase& other) -{ - SelfCwiseBinaryOp, Derived, OtherDerived> tmp(derived()); - tmp = other.derived(); - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_CWISE_BINARY_OP_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseNullaryOp.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseNullaryOp.h deleted file mode 100644 index a93bab2d0f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseNullaryOp.h +++ /dev/null @@ -1,864 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CWISE_NULLARY_OP_H -#define EIGEN_CWISE_NULLARY_OP_H - -namespace Eigen { - -/** \class CwiseNullaryOp - * \ingroup Core_Module - * - * \brief Generic expression of a matrix where all coefficients are defined by a functor - * - * \param NullaryOp template functor implementing the operator - * \param PlainObjectType the underlying plain matrix/array type - * - * This class represents an expression of a generic nullary operator. - * It is the return type of the Ones(), Zero(), Constant(), Identity() and Random() methods, - * and most of the time this is the only way it is used. - * - * However, if you want to write a function returning such an expression, you - * will need to use this class. - * - * \sa class CwiseUnaryOp, class CwiseBinaryOp, DenseBase::NullaryExpr() - */ - -namespace internal { -template -struct traits > : traits -{ - enum { - Flags = (traits::Flags - & ( HereditaryBits - | (functor_has_linear_access::ret ? LinearAccessBit : 0) - | (functor_traits::PacketAccess ? PacketAccessBit : 0))) - | (functor_traits::IsRepeatable ? 0 : EvalBeforeNestingBit), - CoeffReadCost = functor_traits::Cost - }; -}; -} - -template -class CwiseNullaryOp : internal::no_assignment_operator, - public internal::dense_xpr_base< CwiseNullaryOp >::type -{ - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(CwiseNullaryOp) - - CwiseNullaryOp(Index nbRows, Index nbCols, const NullaryOp& func = NullaryOp()) - : m_rows(nbRows), m_cols(nbCols), m_functor(func) - { - eigen_assert(nbRows >= 0 - && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == nbRows) - && nbCols >= 0 - && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == nbCols)); - } - - EIGEN_STRONG_INLINE Index rows() const { return m_rows.value(); } - EIGEN_STRONG_INLINE Index cols() const { return m_cols.value(); } - - EIGEN_STRONG_INLINE const Scalar coeff(Index rowId, Index colId) const - { - return m_functor(rowId, colId); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const - { - return m_functor.packetOp(rowId, colId); - } - - EIGEN_STRONG_INLINE const Scalar coeff(Index index) const - { - return m_functor(index); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index index) const - { - return m_functor.packetOp(index); - } - - /** \returns the functor representing the nullary operation */ - const NullaryOp& functor() const { return m_functor; } - - protected: - const internal::variable_if_dynamic m_rows; - const internal::variable_if_dynamic m_cols; - const NullaryOp m_functor; -}; - - -/** \returns an expression of a matrix defined by a custom functor \a func - * - * The parameters \a rows and \a cols are the number of rows and of columns of - * the returned matrix. Must be compatible with this MatrixBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used - * instead. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -template -EIGEN_STRONG_INLINE const CwiseNullaryOp -DenseBase::NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func) -{ - return CwiseNullaryOp(rows, cols, func); -} - -/** \returns an expression of a matrix defined by a custom functor \a func - * - * The parameter \a size is the size of the returned vector. - * Must be compatible with this MatrixBase type. - * - * \only_for_vectors - * - * This variant is meant to be used for dynamic-size vector types. For fixed-size types, - * it is redundant to pass \a size as argument, so Zero() should be used - * instead. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -template -EIGEN_STRONG_INLINE const CwiseNullaryOp -DenseBase::NullaryExpr(Index size, const CustomNullaryOp& func) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - if(RowsAtCompileTime == 1) return CwiseNullaryOp(1, size, func); - else return CwiseNullaryOp(size, 1, func); -} - -/** \returns an expression of a matrix defined by a custom functor \a func - * - * This variant is only for fixed-size DenseBase types. For dynamic-size types, you - * need to use the variants taking size arguments. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -template -EIGEN_STRONG_INLINE const CwiseNullaryOp -DenseBase::NullaryExpr(const CustomNullaryOp& func) -{ - return CwiseNullaryOp(RowsAtCompileTime, ColsAtCompileTime, func); -} - -/** \returns an expression of a constant matrix of value \a value - * - * The parameters \a nbRows and \a nbCols are the number of rows and of columns of - * the returned matrix. Must be compatible with this DenseBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a nbRows and \a nbCols as arguments, so Zero() should be used - * instead. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Constant(Index nbRows, Index nbCols, const Scalar& value) -{ - return DenseBase::NullaryExpr(nbRows, nbCols, internal::scalar_constant_op(value)); -} - -/** \returns an expression of a constant matrix of value \a value - * - * The parameter \a size is the size of the returned vector. - * Must be compatible with this DenseBase type. - * - * \only_for_vectors - * - * This variant is meant to be used for dynamic-size vector types. For fixed-size types, - * it is redundant to pass \a size as argument, so Zero() should be used - * instead. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Constant(Index size, const Scalar& value) -{ - return DenseBase::NullaryExpr(size, internal::scalar_constant_op(value)); -} - -/** \returns an expression of a constant matrix of value \a value - * - * This variant is only for fixed-size DenseBase types. For dynamic-size types, you - * need to use the variants taking size arguments. - * - * The template parameter \a CustomNullaryOp is the type of the functor. - * - * \sa class CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Constant(const Scalar& value) -{ - EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) - return DenseBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_constant_op(value)); -} - -/** - * \brief Sets a linearly space vector. - * - * The function generates 'size' equally spaced values in the closed interval [low,high]. - * This particular version of LinSpaced() uses sequential access, i.e. vector access is - * assumed to be a(0), a(1), ..., a(size). This assumption allows for better vectorization - * and yields faster code than the random access version. - * - * When size is set to 1, a vector of length 1 containing 'high' is returned. - * - * \only_for_vectors - * - * Example: \include DenseBase_LinSpaced_seq.cpp - * Output: \verbinclude DenseBase_LinSpaced_seq.out - * - * \sa setLinSpaced(Index,const Scalar&,const Scalar&), LinSpaced(Index,Scalar,Scalar), CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::SequentialLinSpacedReturnType -DenseBase::LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); -} - -/** - * \copydoc DenseBase::LinSpaced(Sequential_t, Index, const Scalar&, const Scalar&) - * Special version for fixed size types which does not require the size parameter. - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::SequentialLinSpacedReturnType -DenseBase::LinSpaced(Sequential_t, const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) - return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); -} - -/** - * \brief Sets a linearly space vector. - * - * The function generates 'size' equally spaced values in the closed interval [low,high]. - * When size is set to 1, a vector of length 1 containing 'high' is returned. - * - * \only_for_vectors - * - * Example: \include DenseBase_LinSpaced.cpp - * Output: \verbinclude DenseBase_LinSpaced.out - * - * \sa setLinSpaced(Index,const Scalar&,const Scalar&), LinSpaced(Sequential_t,Index,const Scalar&,const Scalar&,Index), CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType -DenseBase::LinSpaced(Index size, const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return DenseBase::NullaryExpr(size, internal::linspaced_op(low,high,size)); -} - -/** - * \copydoc DenseBase::LinSpaced(Index, const Scalar&, const Scalar&) - * Special version for fixed size types which does not require the size parameter. - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::RandomAccessLinSpacedReturnType -DenseBase::LinSpaced(const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) - return DenseBase::NullaryExpr(Derived::SizeAtCompileTime, internal::linspaced_op(low,high,Derived::SizeAtCompileTime)); -} - -/** \returns true if all coefficients in this matrix are approximately equal to \a val, to within precision \a prec */ -template -bool DenseBase::isApproxToConstant -(const Scalar& val, const RealScalar& prec) const -{ - for(Index j = 0; j < cols(); ++j) - for(Index i = 0; i < rows(); ++i) - if(!internal::isApprox(this->coeff(i, j), val, prec)) - return false; - return true; -} - -/** This is just an alias for isApproxToConstant(). - * - * \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */ -template -bool DenseBase::isConstant -(const Scalar& val, const RealScalar& prec) const -{ - return isApproxToConstant(val, prec); -} - -/** Alias for setConstant(): sets all coefficients in this expression to \a val. - * - * \sa setConstant(), Constant(), class CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE void DenseBase::fill(const Scalar& val) -{ - setConstant(val); -} - -/** Sets all coefficients in this expression to \a value. - * - * \sa fill(), setConstant(Index,const Scalar&), setConstant(Index,Index,const Scalar&), setZero(), setOnes(), Constant(), class CwiseNullaryOp, setZero(), setOnes() - */ -template -EIGEN_STRONG_INLINE Derived& DenseBase::setConstant(const Scalar& val) -{ - return derived() = Constant(rows(), cols(), val); -} - -/** Resizes to the given \a size, and sets all coefficients in this expression to the given \a value. - * - * \only_for_vectors - * - * Example: \include Matrix_setConstant_int.cpp - * Output: \verbinclude Matrix_setConstant_int.out - * - * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setConstant(Index size, const Scalar& val) -{ - resize(size); - return setConstant(val); -} - -/** Resizes to the given size, and sets all coefficients in this expression to the given \a value. - * - * \param nbRows the new number of rows - * \param nbCols the new number of columns - * \param val the value to which all coefficients are set - * - * Example: \include Matrix_setConstant_int_int.cpp - * Output: \verbinclude Matrix_setConstant_int_int.out - * - * \sa MatrixBase::setConstant(const Scalar&), setConstant(Index,const Scalar&), class CwiseNullaryOp, MatrixBase::Constant(const Scalar&) - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setConstant(Index nbRows, Index nbCols, const Scalar& val) -{ - resize(nbRows, nbCols); - return setConstant(val); -} - -/** - * \brief Sets a linearly space vector. - * - * The function generates 'size' equally spaced values in the closed interval [low,high]. - * When size is set to 1, a vector of length 1 containing 'high' is returned. - * - * \only_for_vectors - * - * Example: \include DenseBase_setLinSpaced.cpp - * Output: \verbinclude DenseBase_setLinSpaced.out - * - * \sa CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(Index newSize, const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return derived() = Derived::NullaryExpr(newSize, internal::linspaced_op(low,high,newSize)); -} - -/** - * \brief Sets a linearly space vector. - * - * The function fill *this with equally spaced values in the closed interval [low,high]. - * When size is set to 1, a vector of length 1 containing 'high' is returned. - * - * \only_for_vectors - * - * \sa setLinSpaced(Index, const Scalar&, const Scalar&), CwiseNullaryOp - */ -template -EIGEN_STRONG_INLINE Derived& DenseBase::setLinSpaced(const Scalar& low, const Scalar& high) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return setLinSpaced(size(), low, high); -} - -// zero: - -/** \returns an expression of a zero matrix. - * - * The parameters \a rows and \a cols are the number of rows and of columns of - * the returned matrix. Must be compatible with this MatrixBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a rows and \a cols as arguments, so Zero() should be used - * instead. - * - * Example: \include MatrixBase_zero_int_int.cpp - * Output: \verbinclude MatrixBase_zero_int_int.out - * - * \sa Zero(), Zero(Index) - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Zero(Index nbRows, Index nbCols) -{ - return Constant(nbRows, nbCols, Scalar(0)); -} - -/** \returns an expression of a zero vector. - * - * The parameter \a size is the size of the returned vector. - * Must be compatible with this MatrixBase type. - * - * \only_for_vectors - * - * This variant is meant to be used for dynamic-size vector types. For fixed-size types, - * it is redundant to pass \a size as argument, so Zero() should be used - * instead. - * - * Example: \include MatrixBase_zero_int.cpp - * Output: \verbinclude MatrixBase_zero_int.out - * - * \sa Zero(), Zero(Index,Index) - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Zero(Index size) -{ - return Constant(size, Scalar(0)); -} - -/** \returns an expression of a fixed-size zero matrix or vector. - * - * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you - * need to use the variants taking size arguments. - * - * Example: \include MatrixBase_zero.cpp - * Output: \verbinclude MatrixBase_zero.out - * - * \sa Zero(Index), Zero(Index,Index) - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Zero() -{ - return Constant(Scalar(0)); -} - -/** \returns true if *this is approximately equal to the zero matrix, - * within the precision given by \a prec. - * - * Example: \include MatrixBase_isZero.cpp - * Output: \verbinclude MatrixBase_isZero.out - * - * \sa class CwiseNullaryOp, Zero() - */ -template -bool DenseBase::isZero(const RealScalar& prec) const -{ - for(Index j = 0; j < cols(); ++j) - for(Index i = 0; i < rows(); ++i) - if(!internal::isMuchSmallerThan(this->coeff(i, j), static_cast(1), prec)) - return false; - return true; -} - -/** Sets all coefficients in this expression to zero. - * - * Example: \include MatrixBase_setZero.cpp - * Output: \verbinclude MatrixBase_setZero.out - * - * \sa class CwiseNullaryOp, Zero() - */ -template -EIGEN_STRONG_INLINE Derived& DenseBase::setZero() -{ - return setConstant(Scalar(0)); -} - -/** Resizes to the given \a size, and sets all coefficients in this expression to zero. - * - * \only_for_vectors - * - * Example: \include Matrix_setZero_int.cpp - * Output: \verbinclude Matrix_setZero_int.out - * - * \sa DenseBase::setZero(), setZero(Index,Index), class CwiseNullaryOp, DenseBase::Zero() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setZero(Index newSize) -{ - resize(newSize); - return setConstant(Scalar(0)); -} - -/** Resizes to the given size, and sets all coefficients in this expression to zero. - * - * \param nbRows the new number of rows - * \param nbCols the new number of columns - * - * Example: \include Matrix_setZero_int_int.cpp - * Output: \verbinclude Matrix_setZero_int_int.out - * - * \sa DenseBase::setZero(), setZero(Index), class CwiseNullaryOp, DenseBase::Zero() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setZero(Index nbRows, Index nbCols) -{ - resize(nbRows, nbCols); - return setConstant(Scalar(0)); -} - -// ones: - -/** \returns an expression of a matrix where all coefficients equal one. - * - * The parameters \a nbRows and \a nbCols are the number of rows and of columns of - * the returned matrix. Must be compatible with this MatrixBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a rows and \a cols as arguments, so Ones() should be used - * instead. - * - * Example: \include MatrixBase_ones_int_int.cpp - * Output: \verbinclude MatrixBase_ones_int_int.out - * - * \sa Ones(), Ones(Index), isOnes(), class Ones - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Ones(Index nbRows, Index nbCols) -{ - return Constant(nbRows, nbCols, Scalar(1)); -} - -/** \returns an expression of a vector where all coefficients equal one. - * - * The parameter \a newSize is the size of the returned vector. - * Must be compatible with this MatrixBase type. - * - * \only_for_vectors - * - * This variant is meant to be used for dynamic-size vector types. For fixed-size types, - * it is redundant to pass \a size as argument, so Ones() should be used - * instead. - * - * Example: \include MatrixBase_ones_int.cpp - * Output: \verbinclude MatrixBase_ones_int.out - * - * \sa Ones(), Ones(Index,Index), isOnes(), class Ones - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Ones(Index newSize) -{ - return Constant(newSize, Scalar(1)); -} - -/** \returns an expression of a fixed-size matrix or vector where all coefficients equal one. - * - * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you - * need to use the variants taking size arguments. - * - * Example: \include MatrixBase_ones.cpp - * Output: \verbinclude MatrixBase_ones.out - * - * \sa Ones(Index), Ones(Index,Index), isOnes(), class Ones - */ -template -EIGEN_STRONG_INLINE const typename DenseBase::ConstantReturnType -DenseBase::Ones() -{ - return Constant(Scalar(1)); -} - -/** \returns true if *this is approximately equal to the matrix where all coefficients - * are equal to 1, within the precision given by \a prec. - * - * Example: \include MatrixBase_isOnes.cpp - * Output: \verbinclude MatrixBase_isOnes.out - * - * \sa class CwiseNullaryOp, Ones() - */ -template -bool DenseBase::isOnes -(const RealScalar& prec) const -{ - return isApproxToConstant(Scalar(1), prec); -} - -/** Sets all coefficients in this expression to one. - * - * Example: \include MatrixBase_setOnes.cpp - * Output: \verbinclude MatrixBase_setOnes.out - * - * \sa class CwiseNullaryOp, Ones() - */ -template -EIGEN_STRONG_INLINE Derived& DenseBase::setOnes() -{ - return setConstant(Scalar(1)); -} - -/** Resizes to the given \a newSize, and sets all coefficients in this expression to one. - * - * \only_for_vectors - * - * Example: \include Matrix_setOnes_int.cpp - * Output: \verbinclude Matrix_setOnes_int.out - * - * \sa MatrixBase::setOnes(), setOnes(Index,Index), class CwiseNullaryOp, MatrixBase::Ones() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setOnes(Index newSize) -{ - resize(newSize); - return setConstant(Scalar(1)); -} - -/** Resizes to the given size, and sets all coefficients in this expression to one. - * - * \param nbRows the new number of rows - * \param nbCols the new number of columns - * - * Example: \include Matrix_setOnes_int_int.cpp - * Output: \verbinclude Matrix_setOnes_int_int.out - * - * \sa MatrixBase::setOnes(), setOnes(Index), class CwiseNullaryOp, MatrixBase::Ones() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setOnes(Index nbRows, Index nbCols) -{ - resize(nbRows, nbCols); - return setConstant(Scalar(1)); -} - -// Identity: - -/** \returns an expression of the identity matrix (not necessarily square). - * - * The parameters \a nbRows and \a nbCols are the number of rows and of columns of - * the returned matrix. Must be compatible with this MatrixBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a rows and \a cols as arguments, so Identity() should be used - * instead. - * - * Example: \include MatrixBase_identity_int_int.cpp - * Output: \verbinclude MatrixBase_identity_int_int.out - * - * \sa Identity(), setIdentity(), isIdentity() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType -MatrixBase::Identity(Index nbRows, Index nbCols) -{ - return DenseBase::NullaryExpr(nbRows, nbCols, internal::scalar_identity_op()); -} - -/** \returns an expression of the identity matrix (not necessarily square). - * - * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you - * need to use the variant taking size arguments. - * - * Example: \include MatrixBase_identity.cpp - * Output: \verbinclude MatrixBase_identity.out - * - * \sa Identity(Index,Index), setIdentity(), isIdentity() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::IdentityReturnType -MatrixBase::Identity() -{ - EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) - return MatrixBase::NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_identity_op()); -} - -/** \returns true if *this is approximately equal to the identity matrix - * (not necessarily square), - * within the precision given by \a prec. - * - * Example: \include MatrixBase_isIdentity.cpp - * Output: \verbinclude MatrixBase_isIdentity.out - * - * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), setIdentity() - */ -template -bool MatrixBase::isIdentity -(const RealScalar& prec) const -{ - for(Index j = 0; j < cols(); ++j) - { - for(Index i = 0; i < rows(); ++i) - { - if(i == j) - { - if(!internal::isApprox(this->coeff(i, j), static_cast(1), prec)) - return false; - } - else - { - if(!internal::isMuchSmallerThan(this->coeff(i, j), static_cast(1), prec)) - return false; - } - } - } - return true; -} - -namespace internal { - -template=16)> -struct setIdentity_impl -{ - static EIGEN_STRONG_INLINE Derived& run(Derived& m) - { - return m = Derived::Identity(m.rows(), m.cols()); - } -}; - -template -struct setIdentity_impl -{ - typedef typename Derived::Index Index; - static EIGEN_STRONG_INLINE Derived& run(Derived& m) - { - m.setZero(); - const Index size = (std::min)(m.rows(), m.cols()); - for(Index i = 0; i < size; ++i) m.coeffRef(i,i) = typename Derived::Scalar(1); - return m; - } -}; - -} // end namespace internal - -/** Writes the identity expression (not necessarily square) into *this. - * - * Example: \include MatrixBase_setIdentity.cpp - * Output: \verbinclude MatrixBase_setIdentity.out - * - * \sa class CwiseNullaryOp, Identity(), Identity(Index,Index), isIdentity() - */ -template -EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity() -{ - return internal::setIdentity_impl::run(derived()); -} - -/** \brief Resizes to the given size, and writes the identity expression (not necessarily square) into *this. - * - * \param nbRows the new number of rows - * \param nbCols the new number of columns - * - * Example: \include Matrix_setIdentity_int_int.cpp - * Output: \verbinclude Matrix_setIdentity_int_int.out - * - * \sa MatrixBase::setIdentity(), class CwiseNullaryOp, MatrixBase::Identity() - */ -template -EIGEN_STRONG_INLINE Derived& MatrixBase::setIdentity(Index nbRows, Index nbCols) -{ - derived().resize(nbRows, nbCols); - return setIdentity(); -} - -/** \returns an expression of the i-th unit (basis) vector. - * - * \only_for_vectors - * - * \sa MatrixBase::Unit(Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index newSize, Index i) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return BasisReturnType(SquareMatrixType::Identity(newSize,newSize), i); -} - -/** \returns an expression of the i-th unit (basis) vector. - * - * \only_for_vectors - * - * This variant is for fixed-size vector only. - * - * \sa MatrixBase::Unit(Index,Index), MatrixBase::UnitX(), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::Unit(Index i) -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - return BasisReturnType(SquareMatrixType::Identity(),i); -} - -/** \returns an expression of the X axis unit vector (1{,0}^*) - * - * \only_for_vectors - * - * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitX() -{ return Derived::Unit(0); } - -/** \returns an expression of the Y axis unit vector (0,1{,0}^*) - * - * \only_for_vectors - * - * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitY() -{ return Derived::Unit(1); } - -/** \returns an expression of the Z axis unit vector (0,0,1{,0}^*) - * - * \only_for_vectors - * - * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitZ() -{ return Derived::Unit(2); } - -/** \returns an expression of the W axis unit vector (0,0,0,1) - * - * \only_for_vectors - * - * \sa MatrixBase::Unit(Index,Index), MatrixBase::Unit(Index), MatrixBase::UnitY(), MatrixBase::UnitZ(), MatrixBase::UnitW() - */ -template -EIGEN_STRONG_INLINE const typename MatrixBase::BasisReturnType MatrixBase::UnitW() -{ return Derived::Unit(3); } - -} // end namespace Eigen - -#endif // EIGEN_CWISE_NULLARY_OP_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryOp.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryOp.h deleted file mode 100644 index f2de749f92..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryOp.h +++ /dev/null @@ -1,126 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CWISE_UNARY_OP_H -#define EIGEN_CWISE_UNARY_OP_H - -namespace Eigen { - -/** \class CwiseUnaryOp - * \ingroup Core_Module - * - * \brief Generic expression where a coefficient-wise unary operator is applied to an expression - * - * \param UnaryOp template functor implementing the operator - * \param XprType the type of the expression to which we are applying the unary operator - * - * This class represents an expression where a unary operator is applied to an expression. - * It is the return type of all operations taking exactly 1 input expression, regardless of the - * presence of other inputs such as scalars. For example, the operator* in the expression 3*matrix - * is considered unary, because only the right-hand side is an expression, and its - * return type is a specialization of CwiseUnaryOp. - * - * Most of the time, this is the only way that it is used, so you typically don't have to name - * CwiseUnaryOp types explicitly. - * - * \sa MatrixBase::unaryExpr(const CustomUnaryOp &) const, class CwiseBinaryOp, class CwiseNullaryOp - */ - -namespace internal { -template -struct traits > - : traits -{ - typedef typename result_of< - UnaryOp(typename XprType::Scalar) - >::type Scalar; - typedef typename XprType::Nested XprTypeNested; - typedef typename remove_reference::type _XprTypeNested; - enum { - Flags = _XprTypeNested::Flags & ( - HereditaryBits | LinearAccessBit | AlignedBit - | (functor_traits::PacketAccess ? PacketAccessBit : 0)), - CoeffReadCost = _XprTypeNested::CoeffReadCost + functor_traits::Cost - }; -}; -} - -template -class CwiseUnaryOpImpl; - -template -class CwiseUnaryOp : internal::no_assignment_operator, - public CwiseUnaryOpImpl::StorageKind> -{ - public: - - typedef typename CwiseUnaryOpImpl::StorageKind>::Base Base; - EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp) - - inline CwiseUnaryOp(const XprType& xpr, const UnaryOp& func = UnaryOp()) - : m_xpr(xpr), m_functor(func) {} - - EIGEN_STRONG_INLINE Index rows() const { return m_xpr.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return m_xpr.cols(); } - - /** \returns the functor representing the unary operation */ - const UnaryOp& functor() const { return m_functor; } - - /** \returns the nested expression */ - const typename internal::remove_all::type& - nestedExpression() const { return m_xpr; } - - /** \returns the nested expression */ - typename internal::remove_all::type& - nestedExpression() { return m_xpr.const_cast_derived(); } - - protected: - typename XprType::Nested m_xpr; - const UnaryOp m_functor; -}; - -// This is the generic implementation for dense storage. -// It can be used for any expression types implementing the dense concept. -template -class CwiseUnaryOpImpl - : public internal::dense_xpr_base >::type -{ - public: - - typedef CwiseUnaryOp Derived; - typedef typename internal::dense_xpr_base >::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Derived) - - EIGEN_STRONG_INLINE const Scalar coeff(Index rowId, Index colId) const - { - return derived().functor()(derived().nestedExpression().coeff(rowId, colId)); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const - { - return derived().functor().packetOp(derived().nestedExpression().template packet(rowId, colId)); - } - - EIGEN_STRONG_INLINE const Scalar coeff(Index index) const - { - return derived().functor()(derived().nestedExpression().coeff(index)); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index index) const - { - return derived().functor().packetOp(derived().nestedExpression().template packet(index)); - } -}; - -} // end namespace Eigen - -#endif // EIGEN_CWISE_UNARY_OP_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryView.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryView.h deleted file mode 100644 index b2638d3265..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/CwiseUnaryView.h +++ /dev/null @@ -1,139 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_CWISE_UNARY_VIEW_H -#define EIGEN_CWISE_UNARY_VIEW_H - -namespace Eigen { - -/** \class CwiseUnaryView - * \ingroup Core_Module - * - * \brief Generic lvalue expression of a coefficient-wise unary operator of a matrix or a vector - * - * \param ViewOp template functor implementing the view - * \param MatrixType the type of the matrix we are applying the unary operator - * - * This class represents a lvalue expression of a generic unary view operator of a matrix or a vector. - * It is the return type of real() and imag(), and most of the time this is the only way it is used. - * - * \sa MatrixBase::unaryViewExpr(const CustomUnaryOp &) const, class CwiseUnaryOp - */ - -namespace internal { -template -struct traits > - : traits -{ - typedef typename result_of< - ViewOp(typename traits::Scalar) - >::type Scalar; - typedef typename MatrixType::Nested MatrixTypeNested; - typedef typename remove_all::type _MatrixTypeNested; - enum { - Flags = (traits<_MatrixTypeNested>::Flags & (HereditaryBits | LvalueBit | LinearAccessBit | DirectAccessBit)), - CoeffReadCost = traits<_MatrixTypeNested>::CoeffReadCost + functor_traits::Cost, - MatrixTypeInnerStride = inner_stride_at_compile_time::ret, - // need to cast the sizeof's from size_t to int explicitly, otherwise: - // "error: no integral type can represent all of the enumerator values - InnerStrideAtCompileTime = MatrixTypeInnerStride == Dynamic - ? int(Dynamic) - : int(MatrixTypeInnerStride) * int(sizeof(typename traits::Scalar) / sizeof(Scalar)), - OuterStrideAtCompileTime = outer_stride_at_compile_time::ret == Dynamic - ? int(Dynamic) - : outer_stride_at_compile_time::ret * int(sizeof(typename traits::Scalar) / sizeof(Scalar)) - }; -}; -} - -template -class CwiseUnaryViewImpl; - -template -class CwiseUnaryView : public CwiseUnaryViewImpl::StorageKind> -{ - public: - - typedef typename CwiseUnaryViewImpl::StorageKind>::Base Base; - EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryView) - - inline CwiseUnaryView(const MatrixType& mat, const ViewOp& func = ViewOp()) - : m_matrix(mat), m_functor(func) {} - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryView) - - EIGEN_STRONG_INLINE Index rows() const { return m_matrix.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return m_matrix.cols(); } - - /** \returns the functor representing unary operation */ - const ViewOp& functor() const { return m_functor; } - - /** \returns the nested expression */ - const typename internal::remove_all::type& - nestedExpression() const { return m_matrix; } - - /** \returns the nested expression */ - typename internal::remove_all::type& - nestedExpression() { return m_matrix.const_cast_derived(); } - - protected: - // FIXME changed from MatrixType::Nested because of a weird compilation error with sun CC - typename internal::nested::type m_matrix; - ViewOp m_functor; -}; - -template -class CwiseUnaryViewImpl - : public internal::dense_xpr_base< CwiseUnaryView >::type -{ - public: - - typedef CwiseUnaryView Derived; - typedef typename internal::dense_xpr_base< CwiseUnaryView >::type Base; - - EIGEN_DENSE_PUBLIC_INTERFACE(Derived) - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(CwiseUnaryViewImpl) - - inline Scalar* data() { return &coeffRef(0); } - inline const Scalar* data() const { return &coeff(0); } - - inline Index innerStride() const - { - return derived().nestedExpression().innerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); - } - - inline Index outerStride() const - { - return derived().nestedExpression().outerStride() * sizeof(typename internal::traits::Scalar) / sizeof(Scalar); - } - - EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const - { - return derived().functor()(derived().nestedExpression().coeff(row, col)); - } - - EIGEN_STRONG_INLINE CoeffReturnType coeff(Index index) const - { - return derived().functor()(derived().nestedExpression().coeff(index)); - } - - EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) - { - return derived().functor()(const_cast_derived().nestedExpression().coeffRef(row, col)); - } - - EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) - { - return derived().functor()(const_cast_derived().nestedExpression().coeffRef(index)); - } -}; - -} // end namespace Eigen - -#endif // EIGEN_CWISE_UNARY_VIEW_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseBase.h deleted file mode 100644 index c5800f6c8c..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseBase.h +++ /dev/null @@ -1,521 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2007-2010 Benoit Jacob -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DENSEBASE_H -#define EIGEN_DENSEBASE_H - -namespace Eigen { - -namespace internal { - -// The index type defined by EIGEN_DEFAULT_DENSE_INDEX_TYPE must be a signed type. -// This dummy function simply aims at checking that at compile time. -static inline void check_DenseIndex_is_signed() { - EIGEN_STATIC_ASSERT(NumTraits::IsSigned,THE_INDEX_TYPE_MUST_BE_A_SIGNED_TYPE); -} - -} // end namespace internal - -/** \class DenseBase - * \ingroup Core_Module - * - * \brief Base class for all dense matrices, vectors, and arrays - * - * This class is the base that is inherited by all dense objects (matrix, vector, arrays, - * and related expression types). The common Eigen API for dense objects is contained in this class. - * - * \tparam Derived is the derived type, e.g., a matrix type or an expression. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_DENSEBASE_PLUGIN. - * - * \sa \ref TopicClassHierarchy - */ -template class DenseBase -#ifndef EIGEN_PARSED_BY_DOXYGEN - : public internal::special_scalar_op_base::Scalar, - typename NumTraits::Scalar>::Real> -#else - : public DenseCoeffsBase -#endif // not EIGEN_PARSED_BY_DOXYGEN -{ - public: - using internal::special_scalar_op_base::Scalar, - typename NumTraits::Scalar>::Real>::operator*; - - class InnerIterator; - - typedef typename internal::traits::StorageKind StorageKind; - - /** \brief The type of indices - * \details To change this, \c \#define the preprocessor symbol \c EIGEN_DEFAULT_DENSE_INDEX_TYPE. - * \sa \ref TopicPreprocessorDirectives. - */ - typedef typename internal::traits::Index Index; - - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - - typedef DenseCoeffsBase Base; - using Base::derived; - using Base::const_cast_derived; - using Base::rows; - using Base::cols; - using Base::size; - using Base::rowIndexByOuterInner; - using Base::colIndexByOuterInner; - using Base::coeff; - using Base::coeffByOuterInner; - using Base::packet; - using Base::packetByOuterInner; - using Base::writePacket; - using Base::writePacketByOuterInner; - using Base::coeffRef; - using Base::coeffRefByOuterInner; - using Base::copyCoeff; - using Base::copyCoeffByOuterInner; - using Base::copyPacket; - using Base::copyPacketByOuterInner; - using Base::operator(); - using Base::operator[]; - using Base::x; - using Base::y; - using Base::z; - using Base::w; - using Base::stride; - using Base::innerStride; - using Base::outerStride; - using Base::rowStride; - using Base::colStride; - typedef typename Base::CoeffReturnType CoeffReturnType; - - enum { - - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - /**< The number of rows at compile-time. This is just a copy of the value provided - * by the \a Derived type. If a value is not known at compile-time, - * it is set to the \a Dynamic constant. - * \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */ - - ColsAtCompileTime = internal::traits::ColsAtCompileTime, - /**< The number of columns at compile-time. This is just a copy of the value provided - * by the \a Derived type. If a value is not known at compile-time, - * it is set to the \a Dynamic constant. - * \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */ - - - SizeAtCompileTime = (internal::size_at_compile_time::RowsAtCompileTime, - internal::traits::ColsAtCompileTime>::ret), - /**< This is equal to the number of coefficients, i.e. the number of - * rows times the number of columns, or to \a Dynamic if this is not - * known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */ - - MaxRowsAtCompileTime = internal::traits::MaxRowsAtCompileTime, - /**< This value is equal to the maximum possible number of rows that this expression - * might have. If this expression might have an arbitrarily high number of rows, - * this value is set to \a Dynamic. - * - * This value is useful to know when evaluating an expression, in order to determine - * whether it is possible to avoid doing a dynamic memory allocation. - * - * \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime - */ - - MaxColsAtCompileTime = internal::traits::MaxColsAtCompileTime, - /**< This value is equal to the maximum possible number of columns that this expression - * might have. If this expression might have an arbitrarily high number of columns, - * this value is set to \a Dynamic. - * - * This value is useful to know when evaluating an expression, in order to determine - * whether it is possible to avoid doing a dynamic memory allocation. - * - * \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime - */ - - MaxSizeAtCompileTime = (internal::size_at_compile_time::MaxRowsAtCompileTime, - internal::traits::MaxColsAtCompileTime>::ret), - /**< This value is equal to the maximum possible number of coefficients that this expression - * might have. If this expression might have an arbitrarily high number of coefficients, - * this value is set to \a Dynamic. - * - * This value is useful to know when evaluating an expression, in order to determine - * whether it is possible to avoid doing a dynamic memory allocation. - * - * \sa SizeAtCompileTime, MaxRowsAtCompileTime, MaxColsAtCompileTime - */ - - IsVectorAtCompileTime = internal::traits::MaxRowsAtCompileTime == 1 - || internal::traits::MaxColsAtCompileTime == 1, - /**< This is set to true if either the number of rows or the number of - * columns is known at compile-time to be equal to 1. Indeed, in that case, - * we are dealing with a column-vector (if there is only one column) or with - * a row-vector (if there is only one row). */ - - Flags = internal::traits::Flags, - /**< This stores expression \ref flags flags which may or may not be inherited by new expressions - * constructed from this one. See the \ref flags "list of flags". - */ - - IsRowMajor = int(Flags) & RowMajorBit, /**< True if this expression has row-major storage order. */ - - InnerSizeAtCompileTime = int(IsVectorAtCompileTime) ? int(SizeAtCompileTime) - : int(IsRowMajor) ? int(ColsAtCompileTime) : int(RowsAtCompileTime), - - CoeffReadCost = internal::traits::CoeffReadCost, - /**< This is a rough measure of how expensive it is to read one coefficient from - * this expression. - */ - - InnerStrideAtCompileTime = internal::inner_stride_at_compile_time::ret, - OuterStrideAtCompileTime = internal::outer_stride_at_compile_time::ret - }; - - enum { ThisConstantIsPrivateInPlainObjectBase }; - - /** \returns the number of nonzero coefficients which is in practice the number - * of stored coefficients. */ - inline Index nonZeros() const { return size(); } - /** \returns true if either the number of rows or the number of columns is equal to 1. - * In other words, this function returns - * \code rows()==1 || cols()==1 \endcode - * \sa rows(), cols(), IsVectorAtCompileTime. */ - - /** \returns the outer size. - * - * \note For a vector, this returns just 1. For a matrix (non-vector), this is the major dimension - * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of columns for a - * column-major matrix, and the number of rows for a row-major matrix. */ - Index outerSize() const - { - return IsVectorAtCompileTime ? 1 - : int(IsRowMajor) ? this->rows() : this->cols(); - } - - /** \returns the inner size. - * - * \note For a vector, this is just the size. For a matrix (non-vector), this is the minor dimension - * with respect to the \ref TopicStorageOrders "storage order", i.e., the number of rows for a - * column-major matrix, and the number of columns for a row-major matrix. */ - Index innerSize() const - { - return IsVectorAtCompileTime ? this->size() - : int(IsRowMajor) ? this->cols() : this->rows(); - } - - /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are - * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does - * nothing else. - */ - void resize(Index newSize) - { - EIGEN_ONLY_USED_FOR_DEBUG(newSize); - eigen_assert(newSize == this->size() - && "DenseBase::resize() does not actually allow to resize."); - } - /** Only plain matrices/arrays, not expressions, may be resized; therefore the only useful resize methods are - * Matrix::resize() and Array::resize(). The present method only asserts that the new size equals the old size, and does - * nothing else. - */ - void resize(Index nbRows, Index nbCols) - { - EIGEN_ONLY_USED_FOR_DEBUG(nbRows); - EIGEN_ONLY_USED_FOR_DEBUG(nbCols); - eigen_assert(nbRows == this->rows() && nbCols == this->cols() - && "DenseBase::resize() does not actually allow to resize."); - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - - /** \internal Represents a matrix with all coefficients equal to one another*/ - typedef CwiseNullaryOp,Derived> ConstantReturnType; - /** \internal Represents a vector with linearly spaced coefficients that allows sequential access only. */ - typedef CwiseNullaryOp,Derived> SequentialLinSpacedReturnType; - /** \internal Represents a vector with linearly spaced coefficients that allows random access. */ - typedef CwiseNullaryOp,Derived> RandomAccessLinSpacedReturnType; - /** \internal the return type of MatrixBase::eigenvalues() */ - typedef Matrix::Scalar>::Real, internal::traits::ColsAtCompileTime, 1> EigenvaluesReturnType; - -#endif // not EIGEN_PARSED_BY_DOXYGEN - - /** Copies \a other into *this. \returns a reference to *this. */ - template - Derived& operator=(const DenseBase& other); - - /** Special case of the template operator=, in order to prevent the compiler - * from generating a default operator= (issue hit with g++ 4.1) - */ - Derived& operator=(const DenseBase& other); - - template - Derived& operator=(const EigenBase &other); - - template - Derived& operator+=(const EigenBase &other); - - template - Derived& operator-=(const EigenBase &other); - - template - Derived& operator=(const ReturnByValue& func); - -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** Copies \a other into *this without evaluating other. \returns a reference to *this. */ - template - Derived& lazyAssign(const DenseBase& other); -#endif // not EIGEN_PARSED_BY_DOXYGEN - - CommaInitializer operator<< (const Scalar& s); - - template - const Flagged flagged() const; - - template - CommaInitializer operator<< (const DenseBase& other); - - Eigen::Transpose transpose(); - typedef typename internal::add_const >::type ConstTransposeReturnType; - ConstTransposeReturnType transpose() const; - void transposeInPlace(); -#ifndef EIGEN_NO_DEBUG - protected: - template - void checkTransposeAliasing(const OtherDerived& other) const; - public: -#endif - - - static const ConstantReturnType - Constant(Index rows, Index cols, const Scalar& value); - static const ConstantReturnType - Constant(Index size, const Scalar& value); - static const ConstantReturnType - Constant(const Scalar& value); - - static const SequentialLinSpacedReturnType - LinSpaced(Sequential_t, Index size, const Scalar& low, const Scalar& high); - static const RandomAccessLinSpacedReturnType - LinSpaced(Index size, const Scalar& low, const Scalar& high); - static const SequentialLinSpacedReturnType - LinSpaced(Sequential_t, const Scalar& low, const Scalar& high); - static const RandomAccessLinSpacedReturnType - LinSpaced(const Scalar& low, const Scalar& high); - - template - static const CwiseNullaryOp - NullaryExpr(Index rows, Index cols, const CustomNullaryOp& func); - template - static const CwiseNullaryOp - NullaryExpr(Index size, const CustomNullaryOp& func); - template - static const CwiseNullaryOp - NullaryExpr(const CustomNullaryOp& func); - - static const ConstantReturnType Zero(Index rows, Index cols); - static const ConstantReturnType Zero(Index size); - static const ConstantReturnType Zero(); - static const ConstantReturnType Ones(Index rows, Index cols); - static const ConstantReturnType Ones(Index size); - static const ConstantReturnType Ones(); - - void fill(const Scalar& value); - Derived& setConstant(const Scalar& value); - Derived& setLinSpaced(Index size, const Scalar& low, const Scalar& high); - Derived& setLinSpaced(const Scalar& low, const Scalar& high); - Derived& setZero(); - Derived& setOnes(); - Derived& setRandom(); - - template - bool isApprox(const DenseBase& other, - const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isMuchSmallerThan(const RealScalar& other, - const RealScalar& prec = NumTraits::dummy_precision()) const; - template - bool isMuchSmallerThan(const DenseBase& other, - const RealScalar& prec = NumTraits::dummy_precision()) const; - - bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isZero(const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isOnes(const RealScalar& prec = NumTraits::dummy_precision()) const; - - inline bool hasNaN() const; - inline bool allFinite() const; - - inline Derived& operator*=(const Scalar& other); - inline Derived& operator/=(const Scalar& other); - - typedef typename internal::add_const_on_value_type::type>::type EvalReturnType; - /** \returns the matrix or vector obtained by evaluating this expression. - * - * Notice that in the case of a plain matrix or vector (not an expression) this function just returns - * a const reference, in order to avoid a useless copy. - */ - EIGEN_STRONG_INLINE EvalReturnType eval() const - { - // Even though MSVC does not honor strong inlining when the return type - // is a dynamic matrix, we desperately need strong inlining for fixed - // size types on MSVC. - return typename internal::eval::type(derived()); - } - - /** swaps *this with the expression \a other. - * - */ - template - void swap(const DenseBase& other, - int = OtherDerived::ThisConstantIsPrivateInPlainObjectBase) - { - SwapWrapper(derived()).lazyAssign(other.derived()); - } - - /** swaps *this with the matrix or array \a other. - * - */ - template - void swap(PlainObjectBase& other) - { - SwapWrapper(derived()).lazyAssign(other.derived()); - } - - - inline const NestByValue nestByValue() const; - inline const ForceAlignedAccess forceAlignedAccess() const; - inline ForceAlignedAccess forceAlignedAccess(); - template inline const typename internal::conditional,Derived&>::type forceAlignedAccessIf() const; - template inline typename internal::conditional,Derived&>::type forceAlignedAccessIf(); - - Scalar sum() const; - Scalar mean() const; - Scalar trace() const; - - Scalar prod() const; - - typename internal::traits::Scalar minCoeff() const; - typename internal::traits::Scalar maxCoeff() const; - - template - typename internal::traits::Scalar minCoeff(IndexType* row, IndexType* col) const; - template - typename internal::traits::Scalar maxCoeff(IndexType* row, IndexType* col) const; - template - typename internal::traits::Scalar minCoeff(IndexType* index) const; - template - typename internal::traits::Scalar maxCoeff(IndexType* index) const; - - template - typename internal::result_of::Scalar)>::type - redux(const BinaryOp& func) const; - - template - void visit(Visitor& func) const; - - inline const WithFormat format(const IOFormat& fmt) const; - - /** \returns the unique coefficient of a 1x1 expression */ - CoeffReturnType value() const - { - EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) - eigen_assert(this->rows() == 1 && this->cols() == 1); - return derived().coeff(0,0); - } - - bool all(void) const; - bool any(void) const; - Index count() const; - - typedef VectorwiseOp RowwiseReturnType; - typedef const VectorwiseOp ConstRowwiseReturnType; - typedef VectorwiseOp ColwiseReturnType; - typedef const VectorwiseOp ConstColwiseReturnType; - - ConstRowwiseReturnType rowwise() const; - RowwiseReturnType rowwise(); - ConstColwiseReturnType colwise() const; - ColwiseReturnType colwise(); - - static const CwiseNullaryOp,Derived> Random(Index rows, Index cols); - static const CwiseNullaryOp,Derived> Random(Index size); - static const CwiseNullaryOp,Derived> Random(); - - template - const Select - select(const DenseBase& thenMatrix, - const DenseBase& elseMatrix) const; - - template - inline const Select - select(const DenseBase& thenMatrix, const typename ThenDerived::Scalar& elseScalar) const; - - template - inline const Select - select(const typename ElseDerived::Scalar& thenScalar, const DenseBase& elseMatrix) const; - - template RealScalar lpNorm() const; - - template - const Replicate replicate() const; - const Replicate replicate(Index rowFacor,Index colFactor) const; - - typedef Reverse ReverseReturnType; - typedef const Reverse ConstReverseReturnType; - ReverseReturnType reverse(); - ConstReverseReturnType reverse() const; - void reverseInPlace(); - -#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::DenseBase -# include "../plugins/BlockMethods.h" -# ifdef EIGEN_DENSEBASE_PLUGIN -# include EIGEN_DENSEBASE_PLUGIN -# endif -#undef EIGEN_CURRENT_STORAGE_BASE_CLASS - -#ifdef EIGEN2_SUPPORT - - Block corner(CornerType type, Index cRows, Index cCols); - const Block corner(CornerType type, Index cRows, Index cCols) const; - template - Block corner(CornerType type); - template - const Block corner(CornerType type) const; - -#endif // EIGEN2_SUPPORT - - - // disable the use of evalTo for dense objects with a nice compilation error - template inline void evalTo(Dest& ) const - { - EIGEN_STATIC_ASSERT((internal::is_same::value),THE_EVAL_EVALTO_FUNCTION_SHOULD_NEVER_BE_CALLED_FOR_DENSE_OBJECTS); - } - - protected: - /** Default constructor. Do nothing. */ - DenseBase() - { - /* Just checks for self-consistency of the flags. - * Only do it when debugging Eigen, as this borders on paranoiac and could slow compilation down - */ -#ifdef EIGEN_INTERNAL_DEBUGGING - EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, int(IsRowMajor)) - && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, int(!IsRowMajor))), - INVALID_STORAGE_ORDER_FOR_THIS_VECTOR_EXPRESSION) -#endif - } - - private: - explicit DenseBase(int); - DenseBase(int,int); - template explicit DenseBase(const DenseBase&); -}; - -} // end namespace Eigen - -#endif // EIGEN_DENSEBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseCoeffsBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseCoeffsBase.h deleted file mode 100644 index 3c890f2159..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseCoeffsBase.h +++ /dev/null @@ -1,754 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DENSECOEFFSBASE_H -#define EIGEN_DENSECOEFFSBASE_H - -namespace Eigen { - -namespace internal { -template struct add_const_on_value_type_if_arithmetic -{ - typedef typename conditional::value, T, typename add_const_on_value_type::type>::type type; -}; -} - -/** \brief Base class providing read-only coefficient access to matrices and arrays. - * \ingroup Core_Module - * \tparam Derived Type of the derived class - * \tparam #ReadOnlyAccessors Constant indicating read-only access - * - * This class defines the \c operator() \c const function and friends, which can be used to read specific - * entries of a matrix or array. - * - * \sa DenseCoeffsBase, DenseCoeffsBase, - * \ref TopicClassHierarchy - */ -template -class DenseCoeffsBase : public EigenBase -{ - public: - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - - // Explanation for this CoeffReturnType typedef. - // - This is the return type of the coeff() method. - // - The LvalueBit means exactly that we can offer a coeffRef() method, which means exactly that we can get references - // to coeffs, which means exactly that we can have coeff() return a const reference (as opposed to returning a value). - // - The is_artihmetic check is required since "const int", "const double", etc. will cause warnings on some systems - // while the declaration of "const T", where T is a non arithmetic type does not. Always returning "const Scalar&" is - // not possible, since the underlying expressions might not offer a valid address the reference could be referring to. - typedef typename internal::conditional::Flags&LvalueBit), - const Scalar&, - typename internal::conditional::value, Scalar, const Scalar>::type - >::type CoeffReturnType; - - typedef typename internal::add_const_on_value_type_if_arithmetic< - typename internal::packet_traits::type - >::type PacketReturnType; - - typedef EigenBase Base; - using Base::rows; - using Base::cols; - using Base::size; - using Base::derived; - - EIGEN_STRONG_INLINE Index rowIndexByOuterInner(Index outer, Index inner) const - { - return int(Derived::RowsAtCompileTime) == 1 ? 0 - : int(Derived::ColsAtCompileTime) == 1 ? inner - : int(Derived::Flags)&RowMajorBit ? outer - : inner; - } - - EIGEN_STRONG_INLINE Index colIndexByOuterInner(Index outer, Index inner) const - { - return int(Derived::ColsAtCompileTime) == 1 ? 0 - : int(Derived::RowsAtCompileTime) == 1 ? inner - : int(Derived::Flags)&RowMajorBit ? inner - : outer; - } - - /** Short version: don't use this function, use - * \link operator()(Index,Index) const \endlink instead. - * - * Long version: this function is similar to - * \link operator()(Index,Index) const \endlink, but without the assertion. - * Use this for limiting the performance cost of debugging code when doing - * repeated coefficient access. Only use this when it is guaranteed that the - * parameters \a row and \a col are in range. - * - * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this - * function equivalent to \link operator()(Index,Index) const \endlink. - * - * \sa operator()(Index,Index) const, coeffRef(Index,Index), coeff(Index) const - */ - EIGEN_STRONG_INLINE CoeffReturnType coeff(Index row, Index col) const - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - return derived().coeff(row, col); - } - - EIGEN_STRONG_INLINE CoeffReturnType coeffByOuterInner(Index outer, Index inner) const - { - return coeff(rowIndexByOuterInner(outer, inner), - colIndexByOuterInner(outer, inner)); - } - - /** \returns the coefficient at given the given row and column. - * - * \sa operator()(Index,Index), operator[](Index) - */ - EIGEN_STRONG_INLINE CoeffReturnType operator()(Index row, Index col) const - { - eigen_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - return derived().coeff(row, col); - } - - /** Short version: don't use this function, use - * \link operator[](Index) const \endlink instead. - * - * Long version: this function is similar to - * \link operator[](Index) const \endlink, but without the assertion. - * Use this for limiting the performance cost of debugging code when doing - * repeated coefficient access. Only use this when it is guaranteed that the - * parameter \a index is in range. - * - * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this - * function equivalent to \link operator[](Index) const \endlink. - * - * \sa operator[](Index) const, coeffRef(Index), coeff(Index,Index) const - */ - - EIGEN_STRONG_INLINE CoeffReturnType - coeff(Index index) const - { - eigen_internal_assert(index >= 0 && index < size()); - return derived().coeff(index); - } - - - /** \returns the coefficient at given index. - * - * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. - * - * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, - * z() const, w() const - */ - - EIGEN_STRONG_INLINE CoeffReturnType - operator[](Index index) const - { - #ifndef EIGEN2_SUPPORT - EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, - THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) - #endif - eigen_assert(index >= 0 && index < size()); - return derived().coeff(index); - } - - /** \returns the coefficient at given index. - * - * This is synonymous to operator[](Index) const. - * - * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. - * - * \sa operator[](Index), operator()(Index,Index) const, x() const, y() const, - * z() const, w() const - */ - - EIGEN_STRONG_INLINE CoeffReturnType - operator()(Index index) const - { - eigen_assert(index >= 0 && index < size()); - return derived().coeff(index); - } - - /** equivalent to operator[](0). */ - - EIGEN_STRONG_INLINE CoeffReturnType - x() const { return (*this)[0]; } - - /** equivalent to operator[](1). */ - - EIGEN_STRONG_INLINE CoeffReturnType - y() const { return (*this)[1]; } - - /** equivalent to operator[](2). */ - - EIGEN_STRONG_INLINE CoeffReturnType - z() const { return (*this)[2]; } - - /** equivalent to operator[](3). */ - - EIGEN_STRONG_INLINE CoeffReturnType - w() const { return (*this)[3]; } - - /** \internal - * \returns the packet of coefficients starting at the given row and column. It is your responsibility - * to ensure that a packet really starts there. This method is only available on expressions having the - * PacketAccessBit. - * - * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select - * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets - * starting at an address which is a multiple of the packet size. - */ - - template - EIGEN_STRONG_INLINE PacketReturnType packet(Index row, Index col) const - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - return derived().template packet(row,col); - } - - - /** \internal */ - template - EIGEN_STRONG_INLINE PacketReturnType packetByOuterInner(Index outer, Index inner) const - { - return packet(rowIndexByOuterInner(outer, inner), - colIndexByOuterInner(outer, inner)); - } - - /** \internal - * \returns the packet of coefficients starting at the given index. It is your responsibility - * to ensure that a packet really starts there. This method is only available on expressions having the - * PacketAccessBit and the LinearAccessBit. - * - * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select - * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets - * starting at an address which is a multiple of the packet size. - */ - - template - EIGEN_STRONG_INLINE PacketReturnType packet(Index index) const - { - eigen_internal_assert(index >= 0 && index < size()); - return derived().template packet(index); - } - - protected: - // explanation: DenseBase is doing "using ..." on the methods from DenseCoeffsBase. - // But some methods are only available in the DirectAccess case. - // So we add dummy methods here with these names, so that "using... " doesn't fail. - // It's not private so that the child class DenseBase can access them, and it's not public - // either since it's an implementation detail, so has to be protected. - void coeffRef(); - void coeffRefByOuterInner(); - void writePacket(); - void writePacketByOuterInner(); - void copyCoeff(); - void copyCoeffByOuterInner(); - void copyPacket(); - void copyPacketByOuterInner(); - void stride(); - void innerStride(); - void outerStride(); - void rowStride(); - void colStride(); -}; - -/** \brief Base class providing read/write coefficient access to matrices and arrays. - * \ingroup Core_Module - * \tparam Derived Type of the derived class - * \tparam #WriteAccessors Constant indicating read/write access - * - * This class defines the non-const \c operator() function and friends, which can be used to write specific - * entries of a matrix or array. This class inherits DenseCoeffsBase which - * defines the const variant for reading specific entries. - * - * \sa DenseCoeffsBase, \ref TopicClassHierarchy - */ -template -class DenseCoeffsBase : public DenseCoeffsBase -{ - public: - - typedef DenseCoeffsBase Base; - - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - - using Base::coeff; - using Base::rows; - using Base::cols; - using Base::size; - using Base::derived; - using Base::rowIndexByOuterInner; - using Base::colIndexByOuterInner; - using Base::operator[]; - using Base::operator(); - using Base::x; - using Base::y; - using Base::z; - using Base::w; - - /** Short version: don't use this function, use - * \link operator()(Index,Index) \endlink instead. - * - * Long version: this function is similar to - * \link operator()(Index,Index) \endlink, but without the assertion. - * Use this for limiting the performance cost of debugging code when doing - * repeated coefficient access. Only use this when it is guaranteed that the - * parameters \a row and \a col are in range. - * - * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this - * function equivalent to \link operator()(Index,Index) \endlink. - * - * \sa operator()(Index,Index), coeff(Index, Index) const, coeffRef(Index) - */ - EIGEN_STRONG_INLINE Scalar& coeffRef(Index row, Index col) - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - return derived().coeffRef(row, col); - } - - EIGEN_STRONG_INLINE Scalar& - coeffRefByOuterInner(Index outer, Index inner) - { - return coeffRef(rowIndexByOuterInner(outer, inner), - colIndexByOuterInner(outer, inner)); - } - - /** \returns a reference to the coefficient at given the given row and column. - * - * \sa operator[](Index) - */ - - EIGEN_STRONG_INLINE Scalar& - operator()(Index row, Index col) - { - eigen_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - return derived().coeffRef(row, col); - } - - - /** Short version: don't use this function, use - * \link operator[](Index) \endlink instead. - * - * Long version: this function is similar to - * \link operator[](Index) \endlink, but without the assertion. - * Use this for limiting the performance cost of debugging code when doing - * repeated coefficient access. Only use this when it is guaranteed that the - * parameters \a row and \a col are in range. - * - * If EIGEN_INTERNAL_DEBUGGING is defined, an assertion will be made, making this - * function equivalent to \link operator[](Index) \endlink. - * - * \sa operator[](Index), coeff(Index) const, coeffRef(Index,Index) - */ - - EIGEN_STRONG_INLINE Scalar& - coeffRef(Index index) - { - eigen_internal_assert(index >= 0 && index < size()); - return derived().coeffRef(index); - } - - /** \returns a reference to the coefficient at given index. - * - * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. - * - * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() - */ - - EIGEN_STRONG_INLINE Scalar& - operator[](Index index) - { - #ifndef EIGEN2_SUPPORT - EIGEN_STATIC_ASSERT(Derived::IsVectorAtCompileTime, - THE_BRACKET_OPERATOR_IS_ONLY_FOR_VECTORS__USE_THE_PARENTHESIS_OPERATOR_INSTEAD) - #endif - eigen_assert(index >= 0 && index < size()); - return derived().coeffRef(index); - } - - /** \returns a reference to the coefficient at given index. - * - * This is synonymous to operator[](Index). - * - * This method is allowed only for vector expressions, and for matrix expressions having the LinearAccessBit. - * - * \sa operator[](Index) const, operator()(Index,Index), x(), y(), z(), w() - */ - - EIGEN_STRONG_INLINE Scalar& - operator()(Index index) - { - eigen_assert(index >= 0 && index < size()); - return derived().coeffRef(index); - } - - /** equivalent to operator[](0). */ - - EIGEN_STRONG_INLINE Scalar& - x() { return (*this)[0]; } - - /** equivalent to operator[](1). */ - - EIGEN_STRONG_INLINE Scalar& - y() { return (*this)[1]; } - - /** equivalent to operator[](2). */ - - EIGEN_STRONG_INLINE Scalar& - z() { return (*this)[2]; } - - /** equivalent to operator[](3). */ - - EIGEN_STRONG_INLINE Scalar& - w() { return (*this)[3]; } - - /** \internal - * Stores the given packet of coefficients, at the given row and column of this expression. It is your responsibility - * to ensure that a packet really starts there. This method is only available on expressions having the - * PacketAccessBit. - * - * The \a LoadMode parameter may have the value \a #Aligned or \a #Unaligned. Its effect is to select - * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets - * starting at an address which is a multiple of the packet size. - */ - - template - EIGEN_STRONG_INLINE void writePacket - (Index row, Index col, const typename internal::packet_traits::type& val) - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - derived().template writePacket(row,col,val); - } - - - /** \internal */ - template - EIGEN_STRONG_INLINE void writePacketByOuterInner - (Index outer, Index inner, const typename internal::packet_traits::type& val) - { - writePacket(rowIndexByOuterInner(outer, inner), - colIndexByOuterInner(outer, inner), - val); - } - - /** \internal - * Stores the given packet of coefficients, at the given index in this expression. It is your responsibility - * to ensure that a packet really starts there. This method is only available on expressions having the - * PacketAccessBit and the LinearAccessBit. - * - * The \a LoadMode parameter may have the value \a Aligned or \a Unaligned. Its effect is to select - * the appropriate vectorization instruction. Aligned access is faster, but is only possible for packets - * starting at an address which is a multiple of the packet size. - */ - template - EIGEN_STRONG_INLINE void writePacket - (Index index, const typename internal::packet_traits::type& val) - { - eigen_internal_assert(index >= 0 && index < size()); - derived().template writePacket(index,val); - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - - /** \internal Copies the coefficient at position (row,col) of other into *this. - * - * This method is overridden in SwapWrapper, allowing swap() assignments to share 99% of their code - * with usual assignments. - * - * Outside of this internal usage, this method has probably no usefulness. It is hidden in the public API dox. - */ - - template - EIGEN_STRONG_INLINE void copyCoeff(Index row, Index col, const DenseBase& other) - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - derived().coeffRef(row, col) = other.derived().coeff(row, col); - } - - /** \internal Copies the coefficient at the given index of other into *this. - * - * This method is overridden in SwapWrapper, allowing swap() assignments to share 99% of their code - * with usual assignments. - * - * Outside of this internal usage, this method has probably no usefulness. It is hidden in the public API dox. - */ - - template - EIGEN_STRONG_INLINE void copyCoeff(Index index, const DenseBase& other) - { - eigen_internal_assert(index >= 0 && index < size()); - derived().coeffRef(index) = other.derived().coeff(index); - } - - - template - EIGEN_STRONG_INLINE void copyCoeffByOuterInner(Index outer, Index inner, const DenseBase& other) - { - const Index row = rowIndexByOuterInner(outer,inner); - const Index col = colIndexByOuterInner(outer,inner); - // derived() is important here: copyCoeff() may be reimplemented in Derived! - derived().copyCoeff(row, col, other); - } - - /** \internal Copies the packet at position (row,col) of other into *this. - * - * This method is overridden in SwapWrapper, allowing swap() assignments to share 99% of their code - * with usual assignments. - * - * Outside of this internal usage, this method has probably no usefulness. It is hidden in the public API dox. - */ - - template - EIGEN_STRONG_INLINE void copyPacket(Index row, Index col, const DenseBase& other) - { - eigen_internal_assert(row >= 0 && row < rows() - && col >= 0 && col < cols()); - derived().template writePacket(row, col, - other.derived().template packet(row, col)); - } - - /** \internal Copies the packet at the given index of other into *this. - * - * This method is overridden in SwapWrapper, allowing swap() assignments to share 99% of their code - * with usual assignments. - * - * Outside of this internal usage, this method has probably no usefulness. It is hidden in the public API dox. - */ - - template - EIGEN_STRONG_INLINE void copyPacket(Index index, const DenseBase& other) - { - eigen_internal_assert(index >= 0 && index < size()); - derived().template writePacket(index, - other.derived().template packet(index)); - } - - /** \internal */ - template - EIGEN_STRONG_INLINE void copyPacketByOuterInner(Index outer, Index inner, const DenseBase& other) - { - const Index row = rowIndexByOuterInner(outer,inner); - const Index col = colIndexByOuterInner(outer,inner); - // derived() is important here: copyCoeff() may be reimplemented in Derived! - derived().template copyPacket< OtherDerived, StoreMode, LoadMode>(row, col, other); - } -#endif - -}; - -/** \brief Base class providing direct read-only coefficient access to matrices and arrays. - * \ingroup Core_Module - * \tparam Derived Type of the derived class - * \tparam #DirectAccessors Constant indicating direct access - * - * This class defines functions to work with strides which can be used to access entries directly. This class - * inherits DenseCoeffsBase which defines functions to access entries read-only using - * \c operator() . - * - * \sa \ref TopicClassHierarchy - */ -template -class DenseCoeffsBase : public DenseCoeffsBase -{ - public: - - typedef DenseCoeffsBase Base; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename NumTraits::Real RealScalar; - - using Base::rows; - using Base::cols; - using Base::size; - using Base::derived; - - /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. - * - * \sa outerStride(), rowStride(), colStride() - */ - inline Index innerStride() const - { - return derived().innerStride(); - } - - /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns - * in a column-major matrix). - * - * \sa innerStride(), rowStride(), colStride() - */ - inline Index outerStride() const - { - return derived().outerStride(); - } - - // FIXME shall we remove it ? - inline Index stride() const - { - return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); - } - - /** \returns the pointer increment between two consecutive rows. - * - * \sa innerStride(), outerStride(), colStride() - */ - inline Index rowStride() const - { - return Derived::IsRowMajor ? outerStride() : innerStride(); - } - - /** \returns the pointer increment between two consecutive columns. - * - * \sa innerStride(), outerStride(), rowStride() - */ - inline Index colStride() const - { - return Derived::IsRowMajor ? innerStride() : outerStride(); - } -}; - -/** \brief Base class providing direct read/write coefficient access to matrices and arrays. - * \ingroup Core_Module - * \tparam Derived Type of the derived class - * \tparam #DirectWriteAccessors Constant indicating direct access - * - * This class defines functions to work with strides which can be used to access entries directly. This class - * inherits DenseCoeffsBase which defines functions to access entries read/write using - * \c operator(). - * - * \sa \ref TopicClassHierarchy - */ -template -class DenseCoeffsBase - : public DenseCoeffsBase -{ - public: - - typedef DenseCoeffsBase Base; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename NumTraits::Real RealScalar; - - using Base::rows; - using Base::cols; - using Base::size; - using Base::derived; - - /** \returns the pointer increment between two consecutive elements within a slice in the inner direction. - * - * \sa outerStride(), rowStride(), colStride() - */ - inline Index innerStride() const - { - return derived().innerStride(); - } - - /** \returns the pointer increment between two consecutive inner slices (for example, between two consecutive columns - * in a column-major matrix). - * - * \sa innerStride(), rowStride(), colStride() - */ - inline Index outerStride() const - { - return derived().outerStride(); - } - - // FIXME shall we remove it ? - inline Index stride() const - { - return Derived::IsVectorAtCompileTime ? innerStride() : outerStride(); - } - - /** \returns the pointer increment between two consecutive rows. - * - * \sa innerStride(), outerStride(), colStride() - */ - inline Index rowStride() const - { - return Derived::IsRowMajor ? outerStride() : innerStride(); - } - - /** \returns the pointer increment between two consecutive columns. - * - * \sa innerStride(), outerStride(), rowStride() - */ - inline Index colStride() const - { - return Derived::IsRowMajor ? innerStride() : outerStride(); - } -}; - -namespace internal { - -template -struct first_aligned_impl -{ - static inline typename Derived::Index run(const Derived&) - { return 0; } -}; - -template -struct first_aligned_impl -{ - static inline typename Derived::Index run(const Derived& m) - { - return internal::first_aligned(&m.const_cast_derived().coeffRef(0,0), m.size()); - } -}; - -/** \internal \returns the index of the first element of the array that is well aligned for vectorization. - * - * There is also the variant first_aligned(const Scalar*, Integer) defined in Memory.h. See it for more - * documentation. - */ -template -static inline typename Derived::Index first_aligned(const Derived& m) -{ - return first_aligned_impl - - ::run(m); -} - -template::ret> -struct inner_stride_at_compile_time -{ - enum { ret = traits::InnerStrideAtCompileTime }; -}; - -template -struct inner_stride_at_compile_time -{ - enum { ret = 0 }; -}; - -template::ret> -struct outer_stride_at_compile_time -{ - enum { ret = traits::OuterStrideAtCompileTime }; -}; - -template -struct outer_stride_at_compile_time -{ - enum { ret = 0 }; -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_DENSECOEFFSBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseStorage.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseStorage.h deleted file mode 100644 index 3e7f9c1b7a..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DenseStorage.h +++ /dev/null @@ -1,331 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2009 Benoit Jacob -// Copyright (C) 2010 Hauke Heibel -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MATRIXSTORAGE_H -#define EIGEN_MATRIXSTORAGE_H - -#ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN - #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN EIGEN_DENSE_STORAGE_CTOR_PLUGIN; -#else - #define EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN -#endif - -namespace Eigen { - -namespace internal { - -struct constructor_without_unaligned_array_assert {}; - -/** \internal - * Static array. If the MatrixOrArrayOptions require auto-alignment, the array will be automatically aligned: - * to 16 bytes boundary if the total size is a multiple of 16 bytes. - */ -template -struct plain_array -{ - T array[Size]; - - plain_array() - { - EIGEN_STATIC_ASSERT(Size * sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); - } - - plain_array(constructor_without_unaligned_array_assert) - { - EIGEN_STATIC_ASSERT(Size * sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); - } -}; - -#if defined(EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT) - #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) -#elif EIGEN_GNUC_AT_LEAST(4,7) - // GCC 4.7 is too aggressive in its optimizations and remove the alignement test based on the fact the array is declared to be aligned. - // See this bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53900 - // Hiding the origin of the array pointer behind a function argument seems to do the trick even if the function is inlined: - template - EIGEN_ALWAYS_INLINE PtrType eigen_unaligned_array_assert_workaround_gcc47(PtrType array) { return array; } - #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ - eigen_assert((reinterpret_cast(eigen_unaligned_array_assert_workaround_gcc47(array)) & sizemask) == 0 \ - && "this assertion is explained here: " \ - "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ - " **** READ THIS WEB PAGE !!! ****"); -#else - #define EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(sizemask) \ - eigen_assert((reinterpret_cast(array) & sizemask) == 0 \ - && "this assertion is explained here: " \ - "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" \ - " **** READ THIS WEB PAGE !!! ****"); -#endif - -template -struct plain_array -{ - EIGEN_USER_ALIGN16 T array[Size]; - - plain_array() - { - EIGEN_MAKE_UNALIGNED_ARRAY_ASSERT(0xf); - EIGEN_STATIC_ASSERT(Size * sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); - } - - plain_array(constructor_without_unaligned_array_assert) - { - EIGEN_STATIC_ASSERT(Size * sizeof(T) <= 128 * 128 * 8, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG); - } -}; - -template -struct plain_array -{ - EIGEN_USER_ALIGN16 T array[1]; - plain_array() {} - plain_array(constructor_without_unaligned_array_assert) {} -}; - -} // end namespace internal - -/** \internal - * - * \class DenseStorage - * \ingroup Core_Module - * - * \brief Stores the data of a matrix - * - * This class stores the data of fixed-size, dynamic-size or mixed matrices - * in a way as compact as possible. - * - * \sa Matrix - */ -template class DenseStorage; - -// purely fixed-size matrix -template class DenseStorage -{ - internal::plain_array m_data; - public: - inline DenseStorage() {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) - : m_data(internal::constructor_without_unaligned_array_assert()) {} - inline DenseStorage(DenseIndex,DenseIndex,DenseIndex) {} - inline void swap(DenseStorage& other) { std::swap(m_data,other.m_data); } - static inline DenseIndex rows(void) {return _Rows;} - static inline DenseIndex cols(void) {return _Cols;} - inline void conservativeResize(DenseIndex,DenseIndex,DenseIndex) {} - inline void resize(DenseIndex,DenseIndex,DenseIndex) {} - inline const T *data() const { return m_data.array; } - inline T *data() { return m_data.array; } -}; - -// null matrix -template class DenseStorage -{ - public: - inline DenseStorage() {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) {} - inline DenseStorage(DenseIndex,DenseIndex,DenseIndex) {} - inline void swap(DenseStorage& ) {} - static inline DenseIndex rows(void) {return _Rows;} - static inline DenseIndex cols(void) {return _Cols;} - inline void conservativeResize(DenseIndex,DenseIndex,DenseIndex) {} - inline void resize(DenseIndex,DenseIndex,DenseIndex) {} - inline const T *data() const { return 0; } - inline T *data() { return 0; } -}; - -// more specializations for null matrices; these are necessary to resolve ambiguities -template class DenseStorage -: public DenseStorage { }; - -template class DenseStorage -: public DenseStorage { }; - -template class DenseStorage -: public DenseStorage { }; - -// dynamic-size matrix with fixed-size storage -template class DenseStorage -{ - internal::plain_array m_data; - DenseIndex m_rows; - DenseIndex m_cols; - public: - inline DenseStorage() : m_rows(0), m_cols(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) - : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0), m_cols(0) {} - inline DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) : m_rows(nbRows), m_cols(nbCols) {} - inline void swap(DenseStorage& other) - { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); } - inline DenseIndex rows() const {return m_rows;} - inline DenseIndex cols() const {return m_cols;} - inline void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) { m_rows = nbRows; m_cols = nbCols; } - inline void resize(DenseIndex, DenseIndex nbRows, DenseIndex nbCols) { m_rows = nbRows; m_cols = nbCols; } - inline const T *data() const { return m_data.array; } - inline T *data() { return m_data.array; } -}; - -// dynamic-size matrix with fixed-size storage and fixed width -template class DenseStorage -{ - internal::plain_array m_data; - DenseIndex m_rows; - public: - inline DenseStorage() : m_rows(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) - : m_data(internal::constructor_without_unaligned_array_assert()), m_rows(0) {} - inline DenseStorage(DenseIndex, DenseIndex nbRows, DenseIndex) : m_rows(nbRows) {} - inline void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } - inline DenseIndex rows(void) const {return m_rows;} - inline DenseIndex cols(void) const {return _Cols;} - inline void conservativeResize(DenseIndex, DenseIndex nbRows, DenseIndex) { m_rows = nbRows; } - inline void resize(DenseIndex, DenseIndex nbRows, DenseIndex) { m_rows = nbRows; } - inline const T *data() const { return m_data.array; } - inline T *data() { return m_data.array; } -}; - -// dynamic-size matrix with fixed-size storage and fixed height -template class DenseStorage -{ - internal::plain_array m_data; - DenseIndex m_cols; - public: - inline DenseStorage() : m_cols(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) - : m_data(internal::constructor_without_unaligned_array_assert()), m_cols(0) {} - inline DenseStorage(DenseIndex, DenseIndex, DenseIndex nbCols) : m_cols(nbCols) {} - inline void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } - inline DenseIndex rows(void) const {return _Rows;} - inline DenseIndex cols(void) const {return m_cols;} - inline void conservativeResize(DenseIndex, DenseIndex, DenseIndex nbCols) { m_cols = nbCols; } - inline void resize(DenseIndex, DenseIndex, DenseIndex nbCols) { m_cols = nbCols; } - inline const T *data() const { return m_data.array; } - inline T *data() { return m_data.array; } -}; - -// purely dynamic matrix. -template class DenseStorage -{ - T *m_data; - DenseIndex m_rows; - DenseIndex m_cols; - public: - inline DenseStorage() : m_data(0), m_rows(0), m_cols(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) - : m_data(0), m_rows(0), m_cols(0) {} - inline DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols) - : m_data(internal::conditional_aligned_new_auto(size)), m_rows(nbRows), m_cols(nbCols) - { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN } - inline ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); } - inline void swap(DenseStorage& other) - { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); std::swap(m_cols,other.m_cols); } - inline DenseIndex rows(void) const {return m_rows;} - inline DenseIndex cols(void) const {return m_cols;} - inline void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols) - { - m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*m_cols); - m_rows = nbRows; - m_cols = nbCols; - } - void resize(DenseIndex size, DenseIndex nbRows, DenseIndex nbCols) - { - if(size != m_rows*m_cols) - { - internal::conditional_aligned_delete_auto(m_data, m_rows*m_cols); - if (size) - m_data = internal::conditional_aligned_new_auto(size); - else - m_data = 0; - EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN - } - m_rows = nbRows; - m_cols = nbCols; - } - inline const T *data() const { return m_data; } - inline T *data() { return m_data; } -}; - -// matrix with dynamic width and fixed height (so that matrix has dynamic size). -template class DenseStorage -{ - T *m_data; - DenseIndex m_cols; - public: - inline DenseStorage() : m_data(0), m_cols(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_cols(0) {} - inline DenseStorage(DenseIndex size, DenseIndex, DenseIndex nbCols) : m_data(internal::conditional_aligned_new_auto(size)), m_cols(nbCols) - { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN } - inline ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, _Rows*m_cols); } - inline void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_cols,other.m_cols); } - static inline DenseIndex rows(void) {return _Rows;} - inline DenseIndex cols(void) const {return m_cols;} - inline void conservativeResize(DenseIndex size, DenseIndex, DenseIndex nbCols) - { - m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, _Rows*m_cols); - m_cols = nbCols; - } - EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex, DenseIndex nbCols) - { - if(size != _Rows*m_cols) - { - internal::conditional_aligned_delete_auto(m_data, _Rows*m_cols); - if (size) - m_data = internal::conditional_aligned_new_auto(size); - else - m_data = 0; - EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN - } - m_cols = nbCols; - } - inline const T *data() const { return m_data; } - inline T *data() { return m_data; } -}; - -// matrix with dynamic height and fixed width (so that matrix has dynamic size). -template class DenseStorage -{ - T *m_data; - DenseIndex m_rows; - public: - inline DenseStorage() : m_data(0), m_rows(0) {} - inline DenseStorage(internal::constructor_without_unaligned_array_assert) : m_data(0), m_rows(0) {} - inline DenseStorage(DenseIndex size, DenseIndex nbRows, DenseIndex) : m_data(internal::conditional_aligned_new_auto(size)), m_rows(nbRows) - { EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN } - inline ~DenseStorage() { internal::conditional_aligned_delete_auto(m_data, _Cols*m_rows); } - inline void swap(DenseStorage& other) { std::swap(m_data,other.m_data); std::swap(m_rows,other.m_rows); } - inline DenseIndex rows(void) const {return m_rows;} - static inline DenseIndex cols(void) {return _Cols;} - inline void conservativeResize(DenseIndex size, DenseIndex nbRows, DenseIndex) - { - m_data = internal::conditional_aligned_realloc_new_auto(m_data, size, m_rows*_Cols); - m_rows = nbRows; - } - EIGEN_STRONG_INLINE void resize(DenseIndex size, DenseIndex nbRows, DenseIndex) - { - if(size != m_rows*_Cols) - { - internal::conditional_aligned_delete_auto(m_data, _Cols*m_rows); - if (size) - m_data = internal::conditional_aligned_new_auto(size); - else - m_data = 0; - EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN - } - m_rows = nbRows; - } - inline const T *data() const { return m_data; } - inline T *data() { return m_data; } -}; - -} // end namespace Eigen - -#endif // EIGEN_MATRIX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Diagonal.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Diagonal.h deleted file mode 100644 index aab8007b3f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Diagonal.h +++ /dev/null @@ -1,237 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2007-2009 Benoit Jacob -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DIAGONAL_H -#define EIGEN_DIAGONAL_H - -namespace Eigen { - -/** \class Diagonal - * \ingroup Core_Module - * - * \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix - * - * \param MatrixType the type of the object in which we are taking a sub/main/super diagonal - * \param DiagIndex the index of the sub/super diagonal. The default is 0 and it means the main diagonal. - * A positive value means a superdiagonal, a negative value means a subdiagonal. - * You can also use Dynamic so the index can be set at runtime. - * - * The matrix is not required to be square. - * - * This class represents an expression of the main diagonal, or any sub/super diagonal - * of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Index) and most of the - * time this is the only way it is used. - * - * \sa MatrixBase::diagonal(), MatrixBase::diagonal(Index) - */ - -namespace internal { -template -struct traits > - : traits -{ - typedef typename nested::type MatrixTypeNested; - typedef typename remove_reference::type _MatrixTypeNested; - typedef typename MatrixType::StorageKind StorageKind; - enum { - RowsAtCompileTime = (int(DiagIndex) == DynamicIndex || int(MatrixType::SizeAtCompileTime) == Dynamic) ? Dynamic - : (EIGEN_PLAIN_ENUM_MIN(MatrixType::RowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0), - MatrixType::ColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))), - ColsAtCompileTime = 1, - MaxRowsAtCompileTime = int(MatrixType::MaxSizeAtCompileTime) == Dynamic ? Dynamic - : DiagIndex == DynamicIndex ? EIGEN_SIZE_MIN_PREFER_FIXED(MatrixType::MaxRowsAtCompileTime, - MatrixType::MaxColsAtCompileTime) - : (EIGEN_PLAIN_ENUM_MIN(MatrixType::MaxRowsAtCompileTime - EIGEN_PLAIN_ENUM_MAX(-DiagIndex, 0), - MatrixType::MaxColsAtCompileTime - EIGEN_PLAIN_ENUM_MAX( DiagIndex, 0))), - MaxColsAtCompileTime = 1, - MaskLvalueBit = is_lvalue::value ? LvalueBit : 0, - Flags = (unsigned int)_MatrixTypeNested::Flags & (HereditaryBits | LinearAccessBit | MaskLvalueBit | DirectAccessBit) & ~RowMajorBit, - CoeffReadCost = _MatrixTypeNested::CoeffReadCost, - MatrixTypeOuterStride = outer_stride_at_compile_time::ret, - InnerStrideAtCompileTime = MatrixTypeOuterStride == Dynamic ? Dynamic : MatrixTypeOuterStride+1, - OuterStrideAtCompileTime = 0 - }; -}; -} - -template class Diagonal - : public internal::dense_xpr_base< Diagonal >::type -{ - public: - - enum { DiagIndex = _DiagIndex }; - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Diagonal) - - inline Diagonal(MatrixType& matrix, Index a_index = DiagIndex) : m_matrix(matrix), m_index(a_index) {} - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Diagonal) - - inline Index rows() const - { return m_index.value()<0 ? (std::min)(m_matrix.cols(),m_matrix.rows()+m_index.value()) : (std::min)(m_matrix.rows(),m_matrix.cols()-m_index.value()); } - - inline Index cols() const { return 1; } - - inline Index innerStride() const - { - return m_matrix.outerStride() + 1; - } - - inline Index outerStride() const - { - return 0; - } - - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; - - inline ScalarWithConstIfNotLvalue* data() { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); } - inline const Scalar* data() const { return &(m_matrix.const_cast_derived().coeffRef(rowOffset(), colOffset())); } - - inline Scalar& coeffRef(Index row, Index) - { - EIGEN_STATIC_ASSERT_LVALUE(MatrixType) - return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset()); - } - - inline const Scalar& coeffRef(Index row, Index) const - { - return m_matrix.const_cast_derived().coeffRef(row+rowOffset(), row+colOffset()); - } - - inline CoeffReturnType coeff(Index row, Index) const - { - return m_matrix.coeff(row+rowOffset(), row+colOffset()); - } - - inline Scalar& coeffRef(Index idx) - { - EIGEN_STATIC_ASSERT_LVALUE(MatrixType) - return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset()); - } - - inline const Scalar& coeffRef(Index idx) const - { - return m_matrix.const_cast_derived().coeffRef(idx+rowOffset(), idx+colOffset()); - } - - inline CoeffReturnType coeff(Index idx) const - { - return m_matrix.coeff(idx+rowOffset(), idx+colOffset()); - } - - const typename internal::remove_all::type& - nestedExpression() const - { - return m_matrix; - } - - int index() const - { - return m_index.value(); - } - - protected: - typename MatrixType::Nested m_matrix; - const internal::variable_if_dynamicindex m_index; - - private: - // some compilers may fail to optimize std::max etc in case of compile-time constants... - EIGEN_STRONG_INLINE Index absDiagIndex() const { return m_index.value()>0 ? m_index.value() : -m_index.value(); } - EIGEN_STRONG_INLINE Index rowOffset() const { return m_index.value()>0 ? 0 : -m_index.value(); } - EIGEN_STRONG_INLINE Index colOffset() const { return m_index.value()>0 ? m_index.value() : 0; } - // triger a compile time error is someone try to call packet - template typename MatrixType::PacketReturnType packet(Index) const; - template typename MatrixType::PacketReturnType packet(Index,Index) const; -}; - -/** \returns an expression of the main diagonal of the matrix \c *this - * - * \c *this is not required to be square. - * - * Example: \include MatrixBase_diagonal.cpp - * Output: \verbinclude MatrixBase_diagonal.out - * - * \sa class Diagonal */ -template -inline typename MatrixBase::DiagonalReturnType -MatrixBase::diagonal() -{ - return derived(); -} - -/** This is the const version of diagonal(). */ -template -inline typename MatrixBase::ConstDiagonalReturnType -MatrixBase::diagonal() const -{ - return ConstDiagonalReturnType(derived()); -} - -/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this - * - * \c *this is not required to be square. - * - * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 - * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. - * - * Example: \include MatrixBase_diagonal_int.cpp - * Output: \verbinclude MatrixBase_diagonal_int.out - * - * \sa MatrixBase::diagonal(), class Diagonal */ -template -inline typename MatrixBase::template DiagonalIndexReturnType::Type -MatrixBase::diagonal(Index index) -{ - return typename DiagonalIndexReturnType::Type(derived(), index); -} - -/** This is the const version of diagonal(Index). */ -template -inline typename MatrixBase::template ConstDiagonalIndexReturnType::Type -MatrixBase::diagonal(Index index) const -{ - return typename ConstDiagonalIndexReturnType::Type(derived(), index); -} - -/** \returns an expression of the \a DiagIndex-th sub or super diagonal of the matrix \c *this - * - * \c *this is not required to be square. - * - * The template parameter \a DiagIndex represent a super diagonal if \a DiagIndex > 0 - * and a sub diagonal otherwise. \a DiagIndex == 0 is equivalent to the main diagonal. - * - * Example: \include MatrixBase_diagonal_template_int.cpp - * Output: \verbinclude MatrixBase_diagonal_template_int.out - * - * \sa MatrixBase::diagonal(), class Diagonal */ -template -template -inline typename MatrixBase::template DiagonalIndexReturnType::Type -MatrixBase::diagonal() -{ - return derived(); -} - -/** This is the const version of diagonal(). */ -template -template -inline typename MatrixBase::template ConstDiagonalIndexReturnType::Type -MatrixBase::diagonal() const -{ - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_DIAGONAL_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalMatrix.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalMatrix.h deleted file mode 100644 index e6c220f419..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalMatrix.h +++ /dev/null @@ -1,313 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// Copyright (C) 2007-2009 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DIAGONALMATRIX_H -#define EIGEN_DIAGONALMATRIX_H - -namespace Eigen { - -#ifndef EIGEN_PARSED_BY_DOXYGEN -template -class DiagonalBase : public EigenBase -{ - public: - typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; - typedef typename DiagonalVectorType::Scalar Scalar; - typedef typename DiagonalVectorType::RealScalar RealScalar; - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - - enum { - RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - MaxRowsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, - MaxColsAtCompileTime = DiagonalVectorType::MaxSizeAtCompileTime, - IsVectorAtCompileTime = 0, - Flags = 0 - }; - - typedef Matrix DenseMatrixType; - typedef DenseMatrixType DenseType; - typedef DiagonalMatrix PlainObject; - - inline const Derived& derived() const { return *static_cast(this); } - inline Derived& derived() { return *static_cast(this); } - - DenseMatrixType toDenseMatrix() const { return derived(); } - template - void evalTo(MatrixBase &other) const; - template - void addTo(MatrixBase &other) const - { other.diagonal() += diagonal(); } - template - void subTo(MatrixBase &other) const - { other.diagonal() -= diagonal(); } - - inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); } - inline DiagonalVectorType& diagonal() { return derived().diagonal(); } - - inline Index rows() const { return diagonal().size(); } - inline Index cols() const { return diagonal().size(); } - - /** \returns the diagonal matrix product of \c *this by the matrix \a matrix. - */ - template - const DiagonalProduct - operator*(const MatrixBase &matrix) const - { - return DiagonalProduct(matrix.derived(), derived()); - } - - inline const DiagonalWrapper, const DiagonalVectorType> > - inverse() const - { - return diagonal().cwiseInverse(); - } - - inline const DiagonalWrapper, const DiagonalVectorType> > - operator*(const Scalar& scalar) const - { - return diagonal() * scalar; - } - friend inline const DiagonalWrapper, const DiagonalVectorType> > - operator*(const Scalar& scalar, const DiagonalBase& other) - { - return other.diagonal() * scalar; - } - - #ifdef EIGEN2_SUPPORT - template - bool isApprox(const DiagonalBase& other, typename NumTraits::Real precision = NumTraits::dummy_precision()) const - { - return diagonal().isApprox(other.diagonal(), precision); - } - template - bool isApprox(const MatrixBase& other, typename NumTraits::Real precision = NumTraits::dummy_precision()) const - { - return toDenseMatrix().isApprox(other, precision); - } - #endif -}; - -template -template -void DiagonalBase::evalTo(MatrixBase &other) const -{ - other.setZero(); - other.diagonal() = diagonal(); -} -#endif - -/** \class DiagonalMatrix - * \ingroup Core_Module - * - * \brief Represents a diagonal matrix with its storage - * - * \param _Scalar the type of coefficients - * \param SizeAtCompileTime the dimension of the matrix, or Dynamic - * \param MaxSizeAtCompileTime the dimension of the matrix, or Dynamic. This parameter is optional and defaults - * to SizeAtCompileTime. Most of the time, you do not need to specify it. - * - * \sa class DiagonalWrapper - */ - -namespace internal { -template -struct traits > - : traits > -{ - typedef Matrix<_Scalar,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1> DiagonalVectorType; - typedef Dense StorageKind; - typedef DenseIndex Index; - enum { - Flags = LvalueBit - }; -}; -} -template -class DiagonalMatrix - : public DiagonalBase > -{ - public: - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef typename internal::traits::DiagonalVectorType DiagonalVectorType; - typedef const DiagonalMatrix& Nested; - typedef _Scalar Scalar; - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - #endif - - protected: - - DiagonalVectorType m_diagonal; - - public: - - /** const version of diagonal(). */ - inline const DiagonalVectorType& diagonal() const { return m_diagonal; } - /** \returns a reference to the stored vector of diagonal coefficients. */ - inline DiagonalVectorType& diagonal() { return m_diagonal; } - - /** Default constructor without initialization */ - inline DiagonalMatrix() {} - - /** Constructs a diagonal matrix with given dimension */ - inline DiagonalMatrix(Index dim) : m_diagonal(dim) {} - - /** 2D constructor. */ - inline DiagonalMatrix(const Scalar& x, const Scalar& y) : m_diagonal(x,y) {} - - /** 3D constructor. */ - inline DiagonalMatrix(const Scalar& x, const Scalar& y, const Scalar& z) : m_diagonal(x,y,z) {} - - /** Copy constructor. */ - template - inline DiagonalMatrix(const DiagonalBase& other) : m_diagonal(other.diagonal()) {} - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** copy constructor. prevent a default copy constructor from hiding the other templated constructor */ - inline DiagonalMatrix(const DiagonalMatrix& other) : m_diagonal(other.diagonal()) {} - #endif - - /** generic constructor from expression of the diagonal coefficients */ - template - explicit inline DiagonalMatrix(const MatrixBase& other) : m_diagonal(other) - {} - - /** Copy operator. */ - template - DiagonalMatrix& operator=(const DiagonalBase& other) - { - m_diagonal = other.diagonal(); - return *this; - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - DiagonalMatrix& operator=(const DiagonalMatrix& other) - { - m_diagonal = other.diagonal(); - return *this; - } - #endif - - /** Resizes to given size. */ - inline void resize(Index size) { m_diagonal.resize(size); } - /** Sets all coefficients to zero. */ - inline void setZero() { m_diagonal.setZero(); } - /** Resizes and sets all coefficients to zero. */ - inline void setZero(Index size) { m_diagonal.setZero(size); } - /** Sets this matrix to be the identity matrix of the current size. */ - inline void setIdentity() { m_diagonal.setOnes(); } - /** Sets this matrix to be the identity matrix of the given size. */ - inline void setIdentity(Index size) { m_diagonal.setOnes(size); } -}; - -/** \class DiagonalWrapper - * \ingroup Core_Module - * - * \brief Expression of a diagonal matrix - * - * \param _DiagonalVectorType the type of the vector of diagonal coefficients - * - * This class is an expression of a diagonal matrix, but not storing its own vector of diagonal coefficients, - * instead wrapping an existing vector expression. It is the return type of MatrixBase::asDiagonal() - * and most of the time this is the only way that it is used. - * - * \sa class DiagonalMatrix, class DiagonalBase, MatrixBase::asDiagonal() - */ - -namespace internal { -template -struct traits > -{ - typedef _DiagonalVectorType DiagonalVectorType; - typedef typename DiagonalVectorType::Scalar Scalar; - typedef typename DiagonalVectorType::Index Index; - typedef typename DiagonalVectorType::StorageKind StorageKind; - enum { - RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - ColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - MaxRowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - MaxColsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, - Flags = traits::Flags & LvalueBit - }; -}; -} - -template -class DiagonalWrapper - : public DiagonalBase >, internal::no_assignment_operator -{ - public: - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef _DiagonalVectorType DiagonalVectorType; - typedef DiagonalWrapper Nested; - #endif - - /** Constructor from expression of diagonal coefficients to wrap. */ - inline DiagonalWrapper(DiagonalVectorType& a_diagonal) : m_diagonal(a_diagonal) {} - - /** \returns a const reference to the wrapped expression of diagonal coefficients. */ - const DiagonalVectorType& diagonal() const { return m_diagonal; } - - protected: - typename DiagonalVectorType::Nested m_diagonal; -}; - -/** \returns a pseudo-expression of a diagonal matrix with *this as vector of diagonal coefficients - * - * \only_for_vectors - * - * Example: \include MatrixBase_asDiagonal.cpp - * Output: \verbinclude MatrixBase_asDiagonal.out - * - * \sa class DiagonalWrapper, class DiagonalMatrix, diagonal(), isDiagonal() - **/ -template -inline const DiagonalWrapper -MatrixBase::asDiagonal() const -{ - return derived(); -} - -/** \returns true if *this is approximately equal to a diagonal matrix, - * within the precision given by \a prec. - * - * Example: \include MatrixBase_isDiagonal.cpp - * Output: \verbinclude MatrixBase_isDiagonal.out - * - * \sa asDiagonal() - */ -template -bool MatrixBase::isDiagonal(const RealScalar& prec) const -{ - using std::abs; - if(cols() != rows()) return false; - RealScalar maxAbsOnDiagonal = static_cast(-1); - for(Index j = 0; j < cols(); ++j) - { - RealScalar absOnDiagonal = abs(coeff(j,j)); - if(absOnDiagonal > maxAbsOnDiagonal) maxAbsOnDiagonal = absOnDiagonal; - } - for(Index j = 0; j < cols(); ++j) - for(Index i = 0; i < j; ++i) - { - if(!internal::isMuchSmallerThan(coeff(i, j), maxAbsOnDiagonal, prec)) return false; - if(!internal::isMuchSmallerThan(coeff(j, i), maxAbsOnDiagonal, prec)) return false; - } - return true; -} - -} // end namespace Eigen - -#endif // EIGEN_DIAGONALMATRIX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalProduct.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalProduct.h deleted file mode 100644 index c03a0c2e12..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/DiagonalProduct.h +++ /dev/null @@ -1,130 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2007-2009 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DIAGONALPRODUCT_H -#define EIGEN_DIAGONALPRODUCT_H - -namespace Eigen { - -namespace internal { -template -struct traits > - : traits -{ - typedef typename scalar_product_traits::ReturnType Scalar; - enum { - RowsAtCompileTime = MatrixType::RowsAtCompileTime, - ColsAtCompileTime = MatrixType::ColsAtCompileTime, - MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, - MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, - - _StorageOrder = MatrixType::Flags & RowMajorBit ? RowMajor : ColMajor, - _ScalarAccessOnDiag = !((int(_StorageOrder) == ColMajor && int(ProductOrder) == OnTheLeft) - ||(int(_StorageOrder) == RowMajor && int(ProductOrder) == OnTheRight)), - _SameTypes = is_same::value, - // FIXME currently we need same types, but in the future the next rule should be the one - //_Vectorizable = bool(int(MatrixType::Flags)&PacketAccessBit) && ((!_PacketOnDiag) || (_SameTypes && bool(int(DiagonalType::DiagonalVectorType::Flags)&PacketAccessBit))), - _Vectorizable = bool(int(MatrixType::Flags)&PacketAccessBit) && _SameTypes && (_ScalarAccessOnDiag || (bool(int(DiagonalType::DiagonalVectorType::Flags)&PacketAccessBit))), - _LinearAccessMask = (RowsAtCompileTime==1 || ColsAtCompileTime==1) ? LinearAccessBit : 0, - - Flags = ((HereditaryBits|_LinearAccessMask) & (unsigned int)(MatrixType::Flags)) | (_Vectorizable ? PacketAccessBit : 0) | AlignedBit,//(int(MatrixType::Flags)&int(DiagonalType::DiagonalVectorType::Flags)&AlignedBit), - CoeffReadCost = NumTraits::MulCost + MatrixType::CoeffReadCost + DiagonalType::DiagonalVectorType::CoeffReadCost - }; -}; -} - -template -class DiagonalProduct : internal::no_assignment_operator, - public MatrixBase > -{ - public: - - typedef MatrixBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(DiagonalProduct) - - inline DiagonalProduct(const MatrixType& matrix, const DiagonalType& diagonal) - : m_matrix(matrix), m_diagonal(diagonal) - { - eigen_assert(diagonal.diagonal().size() == (ProductOrder == OnTheLeft ? matrix.rows() : matrix.cols())); - } - - EIGEN_STRONG_INLINE Index rows() const { return m_matrix.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return m_matrix.cols(); } - - EIGEN_STRONG_INLINE const Scalar coeff(Index row, Index col) const - { - return m_diagonal.diagonal().coeff(ProductOrder == OnTheLeft ? row : col) * m_matrix.coeff(row, col); - } - - EIGEN_STRONG_INLINE const Scalar coeff(Index idx) const - { - enum { - StorageOrder = int(MatrixType::Flags) & RowMajorBit ? RowMajor : ColMajor - }; - return coeff(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index row, Index col) const - { - enum { - StorageOrder = Flags & RowMajorBit ? RowMajor : ColMajor - }; - const Index indexInDiagonalVector = ProductOrder == OnTheLeft ? row : col; - return packet_impl(row,col,indexInDiagonalVector,typename internal::conditional< - ((int(StorageOrder) == RowMajor && int(ProductOrder) == OnTheLeft) - ||(int(StorageOrder) == ColMajor && int(ProductOrder) == OnTheRight)), internal::true_type, internal::false_type>::type()); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet(Index idx) const - { - enum { - StorageOrder = int(MatrixType::Flags) & RowMajorBit ? RowMajor : ColMajor - }; - return packet(int(StorageOrder)==ColMajor?idx:0,int(StorageOrder)==ColMajor?0:idx); - } - - protected: - template - EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::true_type) const - { - return internal::pmul(m_matrix.template packet(row, col), - internal::pset1(m_diagonal.diagonal().coeff(id))); - } - - template - EIGEN_STRONG_INLINE PacketScalar packet_impl(Index row, Index col, Index id, internal::false_type) const - { - enum { - InnerSize = (MatrixType::Flags & RowMajorBit) ? MatrixType::ColsAtCompileTime : MatrixType::RowsAtCompileTime, - DiagonalVectorPacketLoadMode = (LoadMode == Aligned && (((InnerSize%16) == 0) || (int(DiagonalType::DiagonalVectorType::Flags)&AlignedBit)==AlignedBit) ? Aligned : Unaligned) - }; - return internal::pmul(m_matrix.template packet(row, col), - m_diagonal.diagonal().template packet(id)); - } - - typename MatrixType::Nested m_matrix; - typename DiagonalType::Nested m_diagonal; -}; - -/** \returns the diagonal matrix product of \c *this by the diagonal matrix \a diagonal. - */ -template -template -inline const DiagonalProduct -MatrixBase::operator*(const DiagonalBase &a_diagonal) const -{ - return DiagonalProduct(derived(), a_diagonal.derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_DIAGONALPRODUCT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Dot.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Dot.h deleted file mode 100644 index ca39dbd739..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Dot.h +++ /dev/null @@ -1,263 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2008, 2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DOT_H -#define EIGEN_DOT_H - -namespace Eigen { - -namespace internal { - -// helper function for dot(). The problem is that if we put that in the body of dot(), then upon calling dot -// with mismatched types, the compiler emits errors about failing to instantiate cwiseProduct BEFORE -// looking at the static assertions. Thus this is a trick to get better compile errors. -template -struct dot_nocheck -{ - typedef typename scalar_product_traits::Scalar,typename traits::Scalar>::ReturnType ResScalar; - static inline ResScalar run(const MatrixBase& a, const MatrixBase& b) - { - return a.template binaryExpr::Scalar,typename traits::Scalar> >(b).sum(); - } -}; - -template -struct dot_nocheck -{ - typedef typename scalar_product_traits::Scalar,typename traits::Scalar>::ReturnType ResScalar; - static inline ResScalar run(const MatrixBase& a, const MatrixBase& b) - { - return a.transpose().template binaryExpr::Scalar,typename traits::Scalar> >(b).sum(); - } -}; - -} // end namespace internal - -/** \returns the dot product of *this with other. - * - * \only_for_vectors - * - * \note If the scalar type is complex numbers, then this function returns the hermitian - * (sesquilinear) dot product, conjugate-linear in the first variable and linear in the - * second variable. - * - * \sa squaredNorm(), norm() - */ -template -template -typename internal::scalar_product_traits::Scalar,typename internal::traits::Scalar>::ReturnType -MatrixBase::dot(const MatrixBase& other) const -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) - EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) - typedef internal::scalar_conj_product_op func; - EIGEN_CHECK_BINARY_COMPATIBILIY(func,Scalar,typename OtherDerived::Scalar); - - eigen_assert(size() == other.size()); - - return internal::dot_nocheck::run(*this, other); -} - -#ifdef EIGEN2_SUPPORT -/** \returns the dot product of *this with other, with the Eigen2 convention that the dot product is linear in the first variable - * (conjugating the second variable). Of course this only makes a difference in the complex case. - * - * This method is only available in EIGEN2_SUPPORT mode. - * - * \only_for_vectors - * - * \sa dot() - */ -template -template -typename internal::traits::Scalar -MatrixBase::eigen2_dot(const MatrixBase& other) const -{ - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - EIGEN_STATIC_ASSERT_VECTOR_ONLY(OtherDerived) - EIGEN_STATIC_ASSERT_SAME_VECTOR_SIZE(Derived,OtherDerived) - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - eigen_assert(size() == other.size()); - - return internal::dot_nocheck::run(other,*this); -} -#endif - - -//---------- implementation of L2 norm and related functions ---------- - -/** \returns, for vectors, the squared \em l2 norm of \c *this, and for matrices the Frobenius norm. - * In both cases, it consists in the sum of the square of all the matrix entries. - * For vectors, this is also equals to the dot product of \c *this with itself. - * - * \sa dot(), norm() - */ -template -EIGEN_STRONG_INLINE typename NumTraits::Scalar>::Real MatrixBase::squaredNorm() const -{ - return numext::real((*this).cwiseAbs2().sum()); -} - -/** \returns, for vectors, the \em l2 norm of \c *this, and for matrices the Frobenius norm. - * In both cases, it consists in the square root of the sum of the square of all the matrix entries. - * For vectors, this is also equals to the square root of the dot product of \c *this with itself. - * - * \sa dot(), squaredNorm() - */ -template -inline typename NumTraits::Scalar>::Real MatrixBase::norm() const -{ - using std::sqrt; - return sqrt((double)squaredNorm()); -} - -/** \returns an expression of the quotient of *this by its own norm. - * - * \only_for_vectors - * - * \sa norm(), normalize() - */ -template -inline const typename MatrixBase::PlainObject -MatrixBase::normalized() const -{ - typedef typename internal::nested::type Nested; - typedef typename internal::remove_reference::type _Nested; - _Nested n(derived()); - return n / n.norm(); -} - -/** Normalizes the vector, i.e. divides it by its own norm. - * - * \only_for_vectors - * - * \sa norm(), normalized() - */ -template -inline void MatrixBase::normalize() -{ - *this /= norm(); -} - -//---------- implementation of other norms ---------- - -namespace internal { - -template -struct lpNorm_selector -{ - typedef typename NumTraits::Scalar>::Real RealScalar; - static inline RealScalar run(const MatrixBase& m) - { - using std::pow; - return pow(m.cwiseAbs().array().pow(p).sum(), RealScalar(1)/p); - } -}; - -template -struct lpNorm_selector -{ - static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) - { - return m.cwiseAbs().sum(); - } -}; - -template -struct lpNorm_selector -{ - static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) - { - return m.norm(); - } -}; - -template -struct lpNorm_selector -{ - static inline typename NumTraits::Scalar>::Real run(const MatrixBase& m) - { - return m.cwiseAbs().maxCoeff(); - } -}; - -} // end namespace internal - -/** \returns the \f$ \ell^p \f$ norm of *this, that is, returns the p-th root of the sum of the p-th powers of the absolute values - * of the coefficients of *this. If \a p is the special value \a Eigen::Infinity, this function returns the \f$ \ell^\infty \f$ - * norm, that is the maximum of the absolute values of the coefficients of *this. - * - * \sa norm() - */ -template -template -inline typename NumTraits::Scalar>::Real -MatrixBase::lpNorm() const -{ - return internal::lpNorm_selector::run(*this); -} - -//---------- implementation of isOrthogonal / isUnitary ---------- - -/** \returns true if *this is approximately orthogonal to \a other, - * within the precision given by \a prec. - * - * Example: \include MatrixBase_isOrthogonal.cpp - * Output: \verbinclude MatrixBase_isOrthogonal.out - */ -template -template -bool MatrixBase::isOrthogonal -(const MatrixBase& other, const RealScalar& prec) const -{ - typename internal::nested::type nested(derived()); - typename internal::nested::type otherNested(other.derived()); - return numext::abs2(nested.dot(otherNested)) <= prec * prec * nested.squaredNorm() * otherNested.squaredNorm(); -} - -/** \returns true if *this is approximately an unitary matrix, - * within the precision given by \a prec. In the case where the \a Scalar - * type is real numbers, a unitary matrix is an orthogonal matrix, whence the name. - * - * \note This can be used to check whether a family of vectors forms an orthonormal basis. - * Indeed, \c m.isUnitary() returns true if and only if the columns (equivalently, the rows) of m form an - * orthonormal basis. - * - * Example: \include MatrixBase_isUnitary.cpp - * Output: \verbinclude MatrixBase_isUnitary.out - */ -template -bool MatrixBase::isUnitary(const RealScalar& prec) const -{ - typename Derived::Nested nested(derived()); - for(Index i = 0; i < cols(); ++i) - { - if(!internal::isApprox(nested.col(i).squaredNorm(), static_cast(1), prec)) - return false; - for(Index j = 0; j < i; ++j) - if(!internal::isMuchSmallerThan(nested.col(i).dot(nested.col(j)), static_cast(1), prec)) - return false; - } - return true; -} - -} // end namespace Eigen - -#endif // EIGEN_DOT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/EigenBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/EigenBase.h deleted file mode 100644 index 2b8dd1b706..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/EigenBase.h +++ /dev/null @@ -1,161 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Benoit Jacob -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_EIGENBASE_H -#define EIGEN_EIGENBASE_H - -namespace Eigen { - -/** Common base class for all classes T such that MatrixBase has an operator=(T) and a constructor MatrixBase(T). - * - * In other words, an EigenBase object is an object that can be copied into a MatrixBase. - * - * Besides MatrixBase-derived classes, this also includes special matrix classes such as diagonal matrices, etc. - * - * Notice that this class is trivial, it is only used to disambiguate overloaded functions. - * - * \sa \ref TopicClassHierarchy - */ -template struct EigenBase -{ -// typedef typename internal::plain_matrix_type::type PlainObject; - - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - - /** \returns a reference to the derived object */ - Derived& derived() { return *static_cast(this); } - /** \returns a const reference to the derived object */ - const Derived& derived() const { return *static_cast(this); } - - inline Derived& const_cast_derived() const - { return *static_cast(const_cast(this)); } - inline const Derived& const_derived() const - { return *static_cast(this); } - - /** \returns the number of rows. \sa cols(), RowsAtCompileTime */ - inline Index rows() const { return derived().rows(); } - /** \returns the number of columns. \sa rows(), ColsAtCompileTime*/ - inline Index cols() const { return derived().cols(); } - /** \returns the number of coefficients, which is rows()*cols(). - * \sa rows(), cols(), SizeAtCompileTime. */ - inline Index size() const { return rows() * cols(); } - - /** \internal Don't use it, but do the equivalent: \code dst = *this; \endcode */ - template inline void evalTo(Dest& dst) const - { derived().evalTo(dst); } - - /** \internal Don't use it, but do the equivalent: \code dst += *this; \endcode */ - template inline void addTo(Dest& dst) const - { - // This is the default implementation, - // derived class can reimplement it in a more optimized way. - typename Dest::PlainObject res(rows(),cols()); - evalTo(res); - dst += res; - } - - /** \internal Don't use it, but do the equivalent: \code dst -= *this; \endcode */ - template inline void subTo(Dest& dst) const - { - // This is the default implementation, - // derived class can reimplement it in a more optimized way. - typename Dest::PlainObject res(rows(),cols()); - evalTo(res); - dst -= res; - } - - /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheRight(*this); \endcode */ - template inline void applyThisOnTheRight(Dest& dst) const - { - // This is the default implementation, - // derived class can reimplement it in a more optimized way. - dst = dst * this->derived(); - } - - /** \internal Don't use it, but do the equivalent: \code dst.applyOnTheLeft(*this); \endcode */ - template inline void applyThisOnTheLeft(Dest& dst) const - { - // This is the default implementation, - // derived class can reimplement it in a more optimized way. - dst = this->derived() * dst; - } - -}; - -/*************************************************************************** -* Implementation of matrix base methods -***************************************************************************/ - -/** \brief Copies the generic expression \a other into *this. - * - * \details The expression must provide a (templated) evalTo(Derived& dst) const - * function which does the actual job. In practice, this allows any user to write - * its own special matrix without having to modify MatrixBase - * - * \returns a reference to *this. - */ -template -template -Derived& DenseBase::operator=(const EigenBase &other) -{ - other.derived().evalTo(derived()); - return derived(); -} - -template -template -Derived& DenseBase::operator+=(const EigenBase &other) -{ - other.derived().addTo(derived()); - return derived(); -} - -template -template -Derived& DenseBase::operator-=(const EigenBase &other) -{ - other.derived().subTo(derived()); - return derived(); -} - -/** replaces \c *this by \c *this * \a other. - * - * \returns a reference to \c *this - */ -template -template -inline Derived& -MatrixBase::operator*=(const EigenBase &other) -{ - other.derived().applyThisOnTheRight(derived()); - return derived(); -} - -/** replaces \c *this by \c *this * \a other. It is equivalent to MatrixBase::operator*=(). - */ -template -template -inline void MatrixBase::applyOnTheRight(const EigenBase &other) -{ - other.derived().applyThisOnTheRight(derived()); -} - -/** replaces \c *this by \c *this * \a other. */ -template -template -inline void MatrixBase::applyOnTheLeft(const EigenBase &other) -{ - other.derived().applyThisOnTheLeft(derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_EIGENBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Flagged.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Flagged.h deleted file mode 100644 index 1f2955fc1d..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Flagged.h +++ /dev/null @@ -1,140 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_FLAGGED_H -#define EIGEN_FLAGGED_H - -namespace Eigen { - -/** \class Flagged - * \ingroup Core_Module - * - * \brief Expression with modified flags - * - * \param ExpressionType the type of the object of which we are modifying the flags - * \param Added the flags added to the expression - * \param Removed the flags removed from the expression (has priority over Added). - * - * This class represents an expression whose flags have been modified. - * It is the return type of MatrixBase::flagged() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::flagged() - */ - -namespace internal { -template -struct traits > : traits -{ - enum { Flags = (ExpressionType::Flags | Added) & ~Removed }; -}; -} - -template class Flagged - : public MatrixBase > -{ - public: - - typedef MatrixBase Base; - - EIGEN_DENSE_PUBLIC_INTERFACE(Flagged) - typedef typename internal::conditional::ret, - ExpressionType, const ExpressionType&>::type ExpressionTypeNested; - typedef typename ExpressionType::InnerIterator InnerIterator; - - inline Flagged(const ExpressionType& matrix) : m_matrix(matrix) {} - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - inline Index outerStride() const { return m_matrix.outerStride(); } - inline Index innerStride() const { return m_matrix.innerStride(); } - - inline CoeffReturnType coeff(Index row, Index col) const - { - return m_matrix.coeff(row, col); - } - - inline CoeffReturnType coeff(Index index) const - { - return m_matrix.coeff(index); - } - - inline const Scalar& coeffRef(Index row, Index col) const - { - return m_matrix.const_cast_derived().coeffRef(row, col); - } - - inline const Scalar& coeffRef(Index index) const - { - return m_matrix.const_cast_derived().coeffRef(index); - } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_matrix.const_cast_derived().coeffRef(row, col); - } - - inline Scalar& coeffRef(Index index) - { - return m_matrix.const_cast_derived().coeffRef(index); - } - - template - inline const PacketScalar packet(Index row, Index col) const - { - return m_matrix.template packet(row, col); - } - - template - inline void writePacket(Index row, Index col, const PacketScalar& x) - { - m_matrix.const_cast_derived().template writePacket(row, col, x); - } - - template - inline const PacketScalar packet(Index index) const - { - return m_matrix.template packet(index); - } - - template - inline void writePacket(Index index, const PacketScalar& x) - { - m_matrix.const_cast_derived().template writePacket(index, x); - } - - const ExpressionType& _expression() const { return m_matrix; } - - template - typename ExpressionType::PlainObject solveTriangular(const MatrixBase& other) const; - - template - void solveTriangularInPlace(const MatrixBase& other) const; - - protected: - ExpressionTypeNested m_matrix; -}; - -/** \returns an expression of *this with added and removed flags - * - * This is mostly for internal use. - * - * \sa class Flagged - */ -template -template -inline const Flagged -DenseBase::flagged() const -{ - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_FLAGGED_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ForceAlignedAccess.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ForceAlignedAccess.h deleted file mode 100644 index 807c7a2934..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ForceAlignedAccess.h +++ /dev/null @@ -1,146 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_FORCEALIGNEDACCESS_H -#define EIGEN_FORCEALIGNEDACCESS_H - -namespace Eigen { - -/** \class ForceAlignedAccess - * \ingroup Core_Module - * - * \brief Enforce aligned packet loads and stores regardless of what is requested - * - * \param ExpressionType the type of the object of which we are forcing aligned packet access - * - * This class is the return type of MatrixBase::forceAlignedAccess() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::forceAlignedAccess() - */ - -namespace internal { -template -struct traits > : public traits -{}; -} - -template class ForceAlignedAccess - : public internal::dense_xpr_base< ForceAlignedAccess >::type -{ - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(ForceAlignedAccess) - - inline ForceAlignedAccess(const ExpressionType& matrix) : m_expression(matrix) {} - - inline Index rows() const { return m_expression.rows(); } - inline Index cols() const { return m_expression.cols(); } - inline Index outerStride() const { return m_expression.outerStride(); } - inline Index innerStride() const { return m_expression.innerStride(); } - - inline const CoeffReturnType coeff(Index row, Index col) const - { - return m_expression.coeff(row, col); - } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_expression.const_cast_derived().coeffRef(row, col); - } - - inline const CoeffReturnType coeff(Index index) const - { - return m_expression.coeff(index); - } - - inline Scalar& coeffRef(Index index) - { - return m_expression.const_cast_derived().coeffRef(index); - } - - template - inline const PacketScalar packet(Index row, Index col) const - { - return m_expression.template packet(row, col); - } - - template - inline void writePacket(Index row, Index col, const PacketScalar& x) - { - m_expression.const_cast_derived().template writePacket(row, col, x); - } - - template - inline const PacketScalar packet(Index index) const - { - return m_expression.template packet(index); - } - - template - inline void writePacket(Index index, const PacketScalar& x) - { - m_expression.const_cast_derived().template writePacket(index, x); - } - - operator const ExpressionType&() const { return m_expression; } - - protected: - const ExpressionType& m_expression; - - private: - ForceAlignedAccess& operator=(const ForceAlignedAccess&); -}; - -/** \returns an expression of *this with forced aligned access - * \sa forceAlignedAccessIf(),class ForceAlignedAccess - */ -template -inline const ForceAlignedAccess -MatrixBase::forceAlignedAccess() const -{ - return ForceAlignedAccess(derived()); -} - -/** \returns an expression of *this with forced aligned access - * \sa forceAlignedAccessIf(), class ForceAlignedAccess - */ -template -inline ForceAlignedAccess -MatrixBase::forceAlignedAccess() -{ - return ForceAlignedAccess(derived()); -} - -/** \returns an expression of *this with forced aligned access if \a Enable is true. - * \sa forceAlignedAccess(), class ForceAlignedAccess - */ -template -template -inline typename internal::add_const_on_value_type,Derived&>::type>::type -MatrixBase::forceAlignedAccessIf() const -{ - return derived(); -} - -/** \returns an expression of *this with forced aligned access if \a Enable is true. - * \sa forceAlignedAccess(), class ForceAlignedAccess - */ -template -template -inline typename internal::conditional,Derived&>::type -MatrixBase::forceAlignedAccessIf() -{ - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_FORCEALIGNEDACCESS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Functors.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Functors.h deleted file mode 100644 index 04fb217323..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Functors.h +++ /dev/null @@ -1,985 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_FUNCTORS_H -#define EIGEN_FUNCTORS_H - -namespace Eigen { - -namespace internal { - -// associative functors: - -/** \internal - * \brief Template functor to compute the sum of two scalars - * - * \sa class CwiseBinaryOp, MatrixBase::operator+, class VectorwiseOp, MatrixBase::sum() - */ -template struct scalar_sum_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_sum_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b) const { return a + b; } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::padd(a,b); } - template - EIGEN_STRONG_INLINE const Scalar predux(const Packet& a) const - { return internal::predux(a); } -}; -template -struct functor_traits > { - enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasAdd - }; -}; - -/** \internal - * \brief Template functor to compute the product of two scalars - * - * \sa class CwiseBinaryOp, Cwise::operator*(), class VectorwiseOp, MatrixBase::redux() - */ -template struct scalar_product_op { - enum { - // TODO vectorize mixed product - Vectorizable = is_same::value && packet_traits::HasMul && packet_traits::HasMul - }; - typedef typename scalar_product_traits::ReturnType result_type; - EIGEN_EMPTY_STRUCT_CTOR(scalar_product_op) - EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const { return a * b; } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::pmul(a,b); } - template - EIGEN_STRONG_INLINE const result_type predux(const Packet& a) const - { return internal::predux_mul(a); } -}; -template -struct functor_traits > { - enum { - Cost = (NumTraits::MulCost + NumTraits::MulCost)/2, // rough estimate! - PacketAccess = scalar_product_op::Vectorizable - }; -}; - -/** \internal - * \brief Template functor to compute the conjugate product of two scalars - * - * This is a short cut for conj(x) * y which is needed for optimization purpose; in Eigen2 support mode, this becomes x * conj(y) - */ -template struct scalar_conj_product_op { - - enum { - Conj = NumTraits::IsComplex - }; - - typedef typename scalar_product_traits::ReturnType result_type; - - EIGEN_EMPTY_STRUCT_CTOR(scalar_conj_product_op) - EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const - { return conj_helper().pmul(a,b); } - - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return conj_helper().pmul(a,b); } -}; -template -struct functor_traits > { - enum { - Cost = NumTraits::MulCost, - PacketAccess = internal::is_same::value && packet_traits::HasMul - }; -}; - -/** \internal - * \brief Template functor to compute the min of two scalars - * - * \sa class CwiseBinaryOp, MatrixBase::cwiseMin, class VectorwiseOp, MatrixBase::minCoeff() - */ -template struct scalar_min_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_min_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b) const { using std::min; return (min)(a, b); } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::pmin(a,b); } - template - EIGEN_STRONG_INLINE const Scalar predux(const Packet& a) const - { return internal::predux_min(a); } -}; -template -struct functor_traits > { - enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasMin - }; -}; - -/** \internal - * \brief Template functor to compute the max of two scalars - * - * \sa class CwiseBinaryOp, MatrixBase::cwiseMax, class VectorwiseOp, MatrixBase::maxCoeff() - */ -template struct scalar_max_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_max_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b) const { using std::max; return (max)(a, b); } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::pmax(a,b); } - template - EIGEN_STRONG_INLINE const Scalar predux(const Packet& a) const - { return internal::predux_max(a); } -}; -template -struct functor_traits > { - enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasMax - }; -}; - -/** \internal - * \brief Template functor to compute the hypot of two scalars - * - * \sa MatrixBase::stableNorm(), class Redux - */ -template struct scalar_hypot_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_hypot_op) -// typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& _x, const Scalar& _y) const - { - using std::max; - using std::min; - using std::sqrt; - Scalar p = (max)(_x, _y); - Scalar q = (min)(_x, _y); - Scalar qp = q/p; - return p * sqrt(Scalar(1) + qp*qp); - } -}; -template -struct functor_traits > { - enum { Cost = 5 * NumTraits::MulCost, PacketAccess=0 }; -}; - -/** \internal - * \brief Template functor to compute the pow of two scalars - */ -template struct scalar_binary_pow_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_binary_pow_op) - inline Scalar operator() (const Scalar& a, const OtherScalar& b) const { return numext::pow(a, b); } -}; -template -struct functor_traits > { - enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false }; -}; - -// other binary functors: - -/** \internal - * \brief Template functor to compute the difference of two scalars - * - * \sa class CwiseBinaryOp, MatrixBase::operator- - */ -template struct scalar_difference_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_difference_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a, const Scalar& b) const { return a - b; } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::psub(a,b); } -}; -template -struct functor_traits > { - enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasSub - }; -}; - -/** \internal - * \brief Template functor to compute the quotient of two scalars - * - * \sa class CwiseBinaryOp, Cwise::operator/() - */ -template struct scalar_quotient_op { - enum { - // TODO vectorize mixed product - Vectorizable = is_same::value && packet_traits::HasDiv && packet_traits::HasDiv - }; - typedef typename scalar_product_traits::ReturnType result_type; - EIGEN_EMPTY_STRUCT_CTOR(scalar_quotient_op) - EIGEN_STRONG_INLINE const result_type operator() (const LhsScalar& a, const RhsScalar& b) const { return a / b; } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a, const Packet& b) const - { return internal::pdiv(a,b); } -}; -template -struct functor_traits > { - enum { - Cost = (NumTraits::MulCost + NumTraits::MulCost), // rough estimate! - PacketAccess = scalar_quotient_op::Vectorizable - }; -}; - - - -/** \internal - * \brief Template functor to compute the and of two booleans - * - * \sa class CwiseBinaryOp, ArrayBase::operator&& - */ -struct scalar_boolean_and_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_boolean_and_op) - EIGEN_STRONG_INLINE bool operator() (const bool& a, const bool& b) const { return a && b; } -}; -template<> struct functor_traits { - enum { - Cost = NumTraits::AddCost, - PacketAccess = false - }; -}; - -/** \internal - * \brief Template functor to compute the or of two booleans - * - * \sa class CwiseBinaryOp, ArrayBase::operator|| - */ -struct scalar_boolean_or_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_boolean_or_op) - EIGEN_STRONG_INLINE bool operator() (const bool& a, const bool& b) const { return a || b; } -}; -template<> struct functor_traits { - enum { - Cost = NumTraits::AddCost, - PacketAccess = false - }; -}; - -// unary functors: - -/** \internal - * \brief Template functor to compute the opposite of a scalar - * - * \sa class CwiseUnaryOp, MatrixBase::operator- - */ -template struct scalar_opposite_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_opposite_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { return -a; } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const - { return internal::pnegate(a); } -}; -template -struct functor_traits > -{ enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasNegate }; -}; - -/** \internal - * \brief Template functor to compute the absolute value of a scalar - * - * \sa class CwiseUnaryOp, Cwise::abs - */ -template struct scalar_abs_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_abs_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { using std::abs; return abs(a); } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const - { return internal::pabs(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = NumTraits::AddCost, - PacketAccess = packet_traits::HasAbs - }; -}; - -/** \internal - * \brief Template functor to compute the squared absolute value of a scalar - * - * \sa class CwiseUnaryOp, Cwise::abs2 - */ -template struct scalar_abs2_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_abs2_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE const result_type operator() (const Scalar& a) const { return numext::abs2(a); } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const - { return internal::pmul(a,a); } -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasAbs2 }; }; - -/** \internal - * \brief Template functor to compute the conjugate of a complex value - * - * \sa class CwiseUnaryOp, MatrixBase::conjugate() - */ -template struct scalar_conjugate_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_conjugate_op) - EIGEN_STRONG_INLINE const Scalar operator() (const Scalar& a) const { using numext::conj; return conj(a); } - template - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const { return internal::pconj(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = NumTraits::IsComplex ? NumTraits::AddCost : 0, - PacketAccess = packet_traits::HasConj - }; -}; - -/** \internal - * \brief Template functor to cast a scalar to another type - * - * \sa class CwiseUnaryOp, MatrixBase::cast() - */ -template -struct scalar_cast_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_cast_op) - typedef NewType result_type; - EIGEN_STRONG_INLINE const NewType operator() (const Scalar& a) const { return cast(a); } -}; -template -struct functor_traits > -{ enum { Cost = is_same::value ? 0 : NumTraits::AddCost, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to extract the real part of a complex - * - * \sa class CwiseUnaryOp, MatrixBase::real() - */ -template -struct scalar_real_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_real_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return numext::real(a); } -}; -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to extract the imaginary part of a complex - * - * \sa class CwiseUnaryOp, MatrixBase::imag() - */ -template -struct scalar_imag_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE result_type operator() (const Scalar& a) const { return numext::imag(a); } -}; -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to extract the real part of a complex as a reference - * - * \sa class CwiseUnaryOp, MatrixBase::real() - */ -template -struct scalar_real_ref_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_real_ref_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return numext::real_ref(*const_cast(&a)); } -}; -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to extract the imaginary part of a complex as a reference - * - * \sa class CwiseUnaryOp, MatrixBase::imag() - */ -template -struct scalar_imag_ref_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_imag_ref_op) - typedef typename NumTraits::Real result_type; - EIGEN_STRONG_INLINE result_type& operator() (const Scalar& a) const { return numext::imag_ref(*const_cast(&a)); } -}; -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -/** \internal - * - * \brief Template functor to compute the exponential of a scalar - * - * \sa class CwiseUnaryOp, Cwise::exp() - */ -template struct scalar_exp_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_exp_op) - inline const Scalar operator() (const Scalar& a) const { using std::exp; return exp(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::pexp(a); } -}; -template -struct functor_traits > -{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasExp }; }; - -/** \internal - * - * \brief Template functor to compute the logarithm of a scalar - * - * \sa class CwiseUnaryOp, Cwise::log() - */ -template struct scalar_log_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_log_op) - inline const Scalar operator() (const Scalar& a) const { using std::log; return log(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::plog(a); } -}; -template -struct functor_traits > -{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = packet_traits::HasLog }; }; - -/** \internal - * \brief Template functor to multiply a scalar by a fixed other one - * - * \sa class CwiseUnaryOp, MatrixBase::operator*, MatrixBase::operator/ - */ -/* NOTE why doing the pset1() in packetOp *is* an optimization ? - * indeed it seems better to declare m_other as a Packet and do the pset1() once - * in the constructor. However, in practice: - * - GCC does not like m_other as a Packet and generate a load every time it needs it - * - on the other hand GCC is able to moves the pset1() outside the loop :) - * - simpler code ;) - * (ICC and gcc 4.4 seems to perform well in both cases, the issue is visible with y = a*x + b*y) - */ -template -struct scalar_multiple_op { - typedef typename packet_traits::type Packet; - // FIXME default copy constructors seems bugged with std::complex<> - EIGEN_STRONG_INLINE scalar_multiple_op(const scalar_multiple_op& other) : m_other(other.m_other) { } - EIGEN_STRONG_INLINE scalar_multiple_op(const Scalar& other) : m_other(other) { } - EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a * m_other; } - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const - { return internal::pmul(a, pset1(m_other)); } - typename add_const_on_value_type::Nested>::type m_other; -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; - -template -struct scalar_multiple2_op { - typedef typename scalar_product_traits::ReturnType result_type; - EIGEN_STRONG_INLINE scalar_multiple2_op(const scalar_multiple2_op& other) : m_other(other.m_other) { } - EIGEN_STRONG_INLINE scalar_multiple2_op(const Scalar2& other) : m_other(other) { } - EIGEN_STRONG_INLINE result_type operator() (const Scalar1& a) const { return a * m_other; } - typename add_const_on_value_type::Nested>::type m_other; -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to divide a scalar by a fixed other one - * - * This functor is used to implement the quotient of a matrix by - * a scalar where the scalar type is not necessarily a floating point type. - * - * \sa class CwiseUnaryOp, MatrixBase::operator/ - */ -template -struct scalar_quotient1_op { - typedef typename packet_traits::type Packet; - // FIXME default copy constructors seems bugged with std::complex<> - EIGEN_STRONG_INLINE scalar_quotient1_op(const scalar_quotient1_op& other) : m_other(other.m_other) { } - EIGEN_STRONG_INLINE scalar_quotient1_op(const Scalar& other) : m_other(other) {} - EIGEN_STRONG_INLINE Scalar operator() (const Scalar& a) const { return a / m_other; } - EIGEN_STRONG_INLINE const Packet packetOp(const Packet& a) const - { return internal::pdiv(a, pset1(m_other)); } - typename add_const_on_value_type::Nested>::type m_other; -}; -template -struct functor_traits > -{ enum { Cost = 2 * NumTraits::MulCost, PacketAccess = packet_traits::HasDiv }; }; - -// nullary functors - -template -struct scalar_constant_op { - typedef typename packet_traits::type Packet; - EIGEN_STRONG_INLINE scalar_constant_op(const scalar_constant_op& other) : m_other(other.m_other) { } - EIGEN_STRONG_INLINE scalar_constant_op(const Scalar& other) : m_other(other) { } - template - EIGEN_STRONG_INLINE const Scalar operator() (Index, Index = 0) const { return m_other; } - template - EIGEN_STRONG_INLINE const Packet packetOp(Index, Index = 0) const { return internal::pset1(m_other); } - const Scalar m_other; -}; -template -struct functor_traits > -// FIXME replace this packet test by a safe one -{ enum { Cost = 1, PacketAccess = packet_traits::Vectorizable, IsRepeatable = true }; }; - -template struct scalar_identity_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_identity_op) - template - EIGEN_STRONG_INLINE const Scalar operator() (Index row, Index col) const { return row==col ? Scalar(1) : Scalar(0); } -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::AddCost, PacketAccess = false, IsRepeatable = true }; }; - -template struct linspaced_op_impl; - -// linear access for packet ops: -// 1) initialization -// base = [low, ..., low] + ([step, ..., step] * [-size, ..., 0]) -// 2) each step (where size is 1 for coeff access or PacketSize for packet access) -// base += [size*step, ..., size*step] -// -// TODO: Perhaps it's better to initialize lazily (so not in the constructor but in packetOp) -// in order to avoid the padd() in operator() ? -template -struct linspaced_op_impl -{ - typedef typename packet_traits::type Packet; - - linspaced_op_impl(const Scalar& low, const Scalar& step) : - m_low(low), m_step(step), - m_packetStep(pset1(packet_traits::size*step)), - m_base(padd(pset1(low), pmul(pset1(step),plset(-packet_traits::size)))) {} - - template - EIGEN_STRONG_INLINE const Scalar operator() (Index i) const - { - m_base = padd(m_base, pset1(m_step)); - return m_low+Scalar(i)*m_step; - } - - template - EIGEN_STRONG_INLINE const Packet packetOp(Index) const { return m_base = padd(m_base,m_packetStep); } - - const Scalar m_low; - const Scalar m_step; - const Packet m_packetStep; - mutable Packet m_base; -}; - -// random access for packet ops: -// 1) each step -// [low, ..., low] + ( [step, ..., step] * ( [i, ..., i] + [0, ..., size] ) ) -template -struct linspaced_op_impl -{ - typedef typename packet_traits::type Packet; - - linspaced_op_impl(const Scalar& low, const Scalar& step) : - m_low(low), m_step(step), - m_lowPacket(pset1(m_low)), m_stepPacket(pset1(m_step)), m_interPacket(plset(0)) {} - - template - EIGEN_STRONG_INLINE const Scalar operator() (Index i) const { return m_low+i*m_step; } - - template - EIGEN_STRONG_INLINE const Packet packetOp(Index i) const - { return internal::padd(m_lowPacket, pmul(m_stepPacket, padd(pset1(i),m_interPacket))); } - - const Scalar m_low; - const Scalar m_step; - const Packet m_lowPacket; - const Packet m_stepPacket; - const Packet m_interPacket; -}; - -// ----- Linspace functor ---------------------------------------------------------------- - -// Forward declaration (we default to random access which does not really give -// us a speed gain when using packet access but it allows to use the functor in -// nested expressions). -template struct linspaced_op; -template struct functor_traits< linspaced_op > -{ enum { Cost = 1, PacketAccess = packet_traits::HasSetLinear, IsRepeatable = true }; }; -template struct linspaced_op -{ - typedef typename packet_traits::type Packet; - linspaced_op(const Scalar& low, const Scalar& high, DenseIndex num_steps) : impl((num_steps==1 ? high : low), (num_steps==1 ? Scalar() : (high-low)/(num_steps-1))) {} - - template - EIGEN_STRONG_INLINE const Scalar operator() (Index i) const { return impl(i); } - - // We need this function when assigning e.g. a RowVectorXd to a MatrixXd since - // there row==0 and col is used for the actual iteration. - template - EIGEN_STRONG_INLINE const Scalar operator() (Index row, Index col) const - { - eigen_assert(col==0 || row==0); - return impl(col + row); - } - - template - EIGEN_STRONG_INLINE const Packet packetOp(Index i) const { return impl.packetOp(i); } - - // We need this function when assigning e.g. a RowVectorXd to a MatrixXd since - // there row==0 and col is used for the actual iteration. - template - EIGEN_STRONG_INLINE const Packet packetOp(Index row, Index col) const - { - eigen_assert(col==0 || row==0); - return impl.packetOp(col + row); - } - - // This proxy object handles the actual required temporaries, the different - // implementations (random vs. sequential access) as well as the - // correct piping to size 2/4 packet operations. - const linspaced_op_impl impl; -}; - -// all functors allow linear access, except scalar_identity_op. So we fix here a quick meta -// to indicate whether a functor allows linear access, just always answering 'yes' except for -// scalar_identity_op. -// FIXME move this to functor_traits adding a functor_default -template struct functor_has_linear_access { enum { ret = 1 }; }; -template struct functor_has_linear_access > { enum { ret = 0 }; }; - -// In Eigen, any binary op (Product, CwiseBinaryOp) require the Lhs and Rhs to have the same scalar type, except for multiplication -// where the mixing of different types is handled by scalar_product_traits -// In particular, real * complex is allowed. -// FIXME move this to functor_traits adding a functor_default -template struct functor_is_product_like { enum { ret = 0 }; }; -template struct functor_is_product_like > { enum { ret = 1 }; }; -template struct functor_is_product_like > { enum { ret = 1 }; }; -template struct functor_is_product_like > { enum { ret = 1 }; }; - - -/** \internal - * \brief Template functor to add a scalar to a fixed other one - * \sa class CwiseUnaryOp, Array::operator+ - */ -/* If you wonder why doing the pset1() in packetOp() is an optimization check scalar_multiple_op */ -template -struct scalar_add_op { - typedef typename packet_traits::type Packet; - // FIXME default copy constructors seems bugged with std::complex<> - inline scalar_add_op(const scalar_add_op& other) : m_other(other.m_other) { } - inline scalar_add_op(const Scalar& other) : m_other(other) { } - inline Scalar operator() (const Scalar& a) const { return a + m_other; } - inline const Packet packetOp(const Packet& a) const - { return internal::padd(a, pset1(m_other)); } - const Scalar m_other; -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::AddCost, PacketAccess = packet_traits::HasAdd }; }; - -/** \internal - * \brief Template functor to compute the square root of a scalar - * \sa class CwiseUnaryOp, Cwise::sqrt() - */ -template struct scalar_sqrt_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_sqrt_op) - inline const Scalar operator() (const Scalar& a) const { using std::sqrt; return sqrt(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::psqrt(a); } -}; -template -struct functor_traits > -{ enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasSqrt - }; -}; - -/** \internal - * \brief Template functor to compute the cosine of a scalar - * \sa class CwiseUnaryOp, ArrayBase::cos() - */ -template struct scalar_cos_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_cos_op) - inline Scalar operator() (const Scalar& a) const { using std::cos; return cos(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::pcos(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasCos - }; -}; - -/** \internal - * \brief Template functor to compute the sine of a scalar - * \sa class CwiseUnaryOp, ArrayBase::sin() - */ -template struct scalar_sin_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_sin_op) - inline const Scalar operator() (const Scalar& a) const { using std::sin; return sin(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::psin(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasSin - }; -}; - - -/** \internal - * \brief Template functor to compute the tan of a scalar - * \sa class CwiseUnaryOp, ArrayBase::tan() - */ -template struct scalar_tan_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_tan_op) - inline const Scalar operator() (const Scalar& a) const { using std::tan; return tan(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::ptan(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasTan - }; -}; - -/** \internal - * \brief Template functor to compute the arc cosine of a scalar - * \sa class CwiseUnaryOp, ArrayBase::acos() - */ -template struct scalar_acos_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_acos_op) - inline const Scalar operator() (const Scalar& a) const { using std::acos; return acos(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::pacos(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasACos - }; -}; - -/** \internal - * \brief Template functor to compute the arc sine of a scalar - * \sa class CwiseUnaryOp, ArrayBase::asin() - */ -template struct scalar_asin_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_asin_op) - inline const Scalar operator() (const Scalar& a) const { using std::asin; return asin(a); } - typedef typename packet_traits::type Packet; - inline Packet packetOp(const Packet& a) const { return internal::pasin(a); } -}; -template -struct functor_traits > -{ - enum { - Cost = 5 * NumTraits::MulCost, - PacketAccess = packet_traits::HasASin - }; -}; - -/** \internal - * \brief Template functor to raise a scalar to a power - * \sa class CwiseUnaryOp, Cwise::pow - */ -template -struct scalar_pow_op { - // FIXME default copy constructors seems bugged with std::complex<> - inline scalar_pow_op(const scalar_pow_op& other) : m_exponent(other.m_exponent) { } - inline scalar_pow_op(const Scalar& exponent) : m_exponent(exponent) {} - inline Scalar operator() (const Scalar& a) const { return numext::pow(a, m_exponent); } - const Scalar m_exponent; -}; -template -struct functor_traits > -{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false }; }; - -/** \internal - * \brief Template functor to compute the quotient between a scalar and array entries. - * \sa class CwiseUnaryOp, Cwise::inverse() - */ -template -struct scalar_inverse_mult_op { - scalar_inverse_mult_op(const Scalar& other) : m_other(other) {} - inline Scalar operator() (const Scalar& a) const { return m_other / a; } - template - inline const Packet packetOp(const Packet& a) const - { return internal::pdiv(pset1(m_other),a); } - Scalar m_other; -}; - -/** \internal - * \brief Template functor to compute the inverse of a scalar - * \sa class CwiseUnaryOp, Cwise::inverse() - */ -template -struct scalar_inverse_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_inverse_op) - inline Scalar operator() (const Scalar& a) const { return Scalar(1)/a; } - template - inline const Packet packetOp(const Packet& a) const - { return internal::pdiv(pset1(Scalar(1)),a); } -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasDiv }; }; - -/** \internal - * \brief Template functor to compute the square of a scalar - * \sa class CwiseUnaryOp, Cwise::square() - */ -template -struct scalar_square_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_square_op) - inline Scalar operator() (const Scalar& a) const { return a*a; } - template - inline const Packet packetOp(const Packet& a) const - { return internal::pmul(a,a); } -}; -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; - -/** \internal - * \brief Template functor to compute the cube of a scalar - * \sa class CwiseUnaryOp, Cwise::cube() - */ -template -struct scalar_cube_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_cube_op) - inline Scalar operator() (const Scalar& a) const { return a*a*a; } - template - inline const Packet packetOp(const Packet& a) const - { return internal::pmul(a,pmul(a,a)); } -}; -template -struct functor_traits > -{ enum { Cost = 2*NumTraits::MulCost, PacketAccess = packet_traits::HasMul }; }; - -// default functor traits for STL functors: - -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = NumTraits::MulCost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = NumTraits::AddCost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = NumTraits::AddCost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = NumTraits::AddCost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1 + functor_traits::Cost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 1 + functor_traits::Cost, PacketAccess = false }; }; - -#ifdef EIGEN_STDEXT_SUPPORT - -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = 0, PacketAccess = false }; }; - -template -struct functor_traits > > -{ enum { Cost = 0, PacketAccess = false }; }; - -template -struct functor_traits > > -{ enum { Cost = 0, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost + functor_traits::Cost, PacketAccess = false }; }; - -template -struct functor_traits > -{ enum { Cost = functor_traits::Cost + functor_traits::Cost + functor_traits::Cost, PacketAccess = false }; }; - -#endif // EIGEN_STDEXT_SUPPORT - -// allow to add new functors and specializations of functor_traits from outside Eigen. -// this macro is really needed because functor_traits must be specialized after it is declared but before it is used... -#ifdef EIGEN_FUNCTORS_PLUGIN -#include EIGEN_FUNCTORS_PLUGIN -#endif - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_FUNCTORS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Fuzzy.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Fuzzy.h deleted file mode 100644 index fe63bd2984..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Fuzzy.h +++ /dev/null @@ -1,150 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2008 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_FUZZY_H -#define EIGEN_FUZZY_H - -namespace Eigen { - -namespace internal -{ - -template::IsInteger> -struct isApprox_selector -{ - static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) - { - using std::min; - typename internal::nested::type nested(x); - typename internal::nested::type otherNested(y); - return (nested - otherNested).cwiseAbs2().sum() <= prec * prec * (min)(nested.cwiseAbs2().sum(), otherNested.cwiseAbs2().sum()); - } -}; - -template -struct isApprox_selector -{ - static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar&) - { - return x.matrix() == y.matrix(); - } -}; - -template::IsInteger> -struct isMuchSmallerThan_object_selector -{ - static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec) - { - return x.cwiseAbs2().sum() <= numext::abs2(prec) * y.cwiseAbs2().sum(); - } -}; - -template -struct isMuchSmallerThan_object_selector -{ - static bool run(const Derived& x, const OtherDerived&, const typename Derived::RealScalar&) - { - return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); - } -}; - -template::IsInteger> -struct isMuchSmallerThan_scalar_selector -{ - static bool run(const Derived& x, const typename Derived::RealScalar& y, const typename Derived::RealScalar& prec) - { - return x.cwiseAbs2().sum() <= numext::abs2(prec * y); - } -}; - -template -struct isMuchSmallerThan_scalar_selector -{ - static bool run(const Derived& x, const typename Derived::RealScalar&, const typename Derived::RealScalar&) - { - return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix(); - } -}; - -} // end namespace internal - - -/** \returns \c true if \c *this is approximately equal to \a other, within the precision - * determined by \a prec. - * - * \note The fuzzy compares are done multiplicatively. Two vectors \f$ v \f$ and \f$ w \f$ - * are considered to be approximately equal within precision \f$ p \f$ if - * \f[ \Vert v - w \Vert \leqslant p\,\min(\Vert v\Vert, \Vert w\Vert). \f] - * For matrices, the comparison is done using the Hilbert-Schmidt norm (aka Frobenius norm - * L2 norm). - * - * \note Because of the multiplicativeness of this comparison, one can't use this function - * to check whether \c *this is approximately equal to the zero matrix or vector. - * Indeed, \c isApprox(zero) returns false unless \c *this itself is exactly the zero matrix - * or vector. If you want to test whether \c *this is zero, use internal::isMuchSmallerThan(const - * RealScalar&, RealScalar) instead. - * - * \sa internal::isMuchSmallerThan(const RealScalar&, RealScalar) const - */ -template -template -bool DenseBase::isApprox( - const DenseBase& other, - const RealScalar& prec -) const -{ - return internal::isApprox_selector::run(derived(), other.derived(), prec); -} - -/** \returns \c true if the norm of \c *this is much smaller than \a other, - * within the precision determined by \a prec. - * - * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is - * considered to be much smaller than \f$ x \f$ within precision \f$ p \f$ if - * \f[ \Vert v \Vert \leqslant p\,\vert x\vert. \f] - * - * For matrices, the comparison is done using the Hilbert-Schmidt norm. For this reason, - * the value of the reference scalar \a other should come from the Hilbert-Schmidt norm - * of a reference matrix of same dimensions. - * - * \sa isApprox(), isMuchSmallerThan(const DenseBase&, RealScalar) const - */ -template -bool DenseBase::isMuchSmallerThan( - const typename NumTraits::Real& other, - const RealScalar& prec -) const -{ - return internal::isMuchSmallerThan_scalar_selector::run(derived(), other, prec); -} - -/** \returns \c true if the norm of \c *this is much smaller than the norm of \a other, - * within the precision determined by \a prec. - * - * \note The fuzzy compares are done multiplicatively. A vector \f$ v \f$ is - * considered to be much smaller than a vector \f$ w \f$ within precision \f$ p \f$ if - * \f[ \Vert v \Vert \leqslant p\,\Vert w\Vert. \f] - * For matrices, the comparison is done using the Hilbert-Schmidt norm. - * - * \sa isApprox(), isMuchSmallerThan(const RealScalar&, RealScalar) const - */ -template -template -bool DenseBase::isMuchSmallerThan( - const DenseBase& other, - const RealScalar& prec -) const -{ - return internal::isMuchSmallerThan_object_selector::run(derived(), other.derived(), prec); -} - -} // end namespace Eigen - -#endif // EIGEN_FUZZY_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GeneralProduct.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GeneralProduct.h deleted file mode 100644 index 2a59d94645..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GeneralProduct.h +++ /dev/null @@ -1,635 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2008 Benoit Jacob -// Copyright (C) 2008-2011 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_GENERAL_PRODUCT_H -#define EIGEN_GENERAL_PRODUCT_H - -namespace Eigen { - -/** \class GeneralProduct - * \ingroup Core_Module - * - * \brief Expression of the product of two general matrices or vectors - * - * \param LhsNested the type used to store the left-hand side - * \param RhsNested the type used to store the right-hand side - * \param ProductMode the type of the product - * - * This class represents an expression of the product of two general matrices. - * We call a general matrix, a dense matrix with full storage. For instance, - * This excludes triangular, selfadjoint, and sparse matrices. - * It is the return type of the operator* between general matrices. Its template - * arguments are determined automatically by ProductReturnType. Therefore, - * GeneralProduct should never be used direclty. To determine the result type of a - * function which involves a matrix product, use ProductReturnType::Type. - * - * \sa ProductReturnType, MatrixBase::operator*(const MatrixBase&) - */ -template::value> -class GeneralProduct; - -enum { - Large = 2, - Small = 3 -}; - -namespace internal { - -template struct product_type_selector; - -template struct product_size_category -{ - enum { is_large = MaxSize == Dynamic || - Size >= EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD, - value = is_large ? Large - : Size == 1 ? 1 - : Small - }; -}; - -template struct product_type -{ - typedef typename remove_all::type _Lhs; - typedef typename remove_all::type _Rhs; - enum { - MaxRows = _Lhs::MaxRowsAtCompileTime, - Rows = _Lhs::RowsAtCompileTime, - MaxCols = _Rhs::MaxColsAtCompileTime, - Cols = _Rhs::ColsAtCompileTime, - MaxDepth = EIGEN_SIZE_MIN_PREFER_FIXED(_Lhs::MaxColsAtCompileTime, - _Rhs::MaxRowsAtCompileTime), - Depth = EIGEN_SIZE_MIN_PREFER_FIXED(_Lhs::ColsAtCompileTime, - _Rhs::RowsAtCompileTime), - LargeThreshold = EIGEN_CACHEFRIENDLY_PRODUCT_THRESHOLD - }; - - // the splitting into different lines of code here, introducing the _select enums and the typedef below, - // is to work around an internal compiler error with gcc 4.1 and 4.2. -private: - enum { - rows_select = product_size_category::value, - cols_select = product_size_category::value, - depth_select = product_size_category::value - }; - typedef product_type_selector selector; - -public: - enum { - value = selector::ret - }; -#ifdef EIGEN_DEBUG_PRODUCT - static void debug() - { - EIGEN_DEBUG_VAR(Rows); - EIGEN_DEBUG_VAR(Cols); - EIGEN_DEBUG_VAR(Depth); - EIGEN_DEBUG_VAR(rows_select); - EIGEN_DEBUG_VAR(cols_select); - EIGEN_DEBUG_VAR(depth_select); - EIGEN_DEBUG_VAR(value); - } -#endif -}; - - -/* The following allows to select the kind of product at compile time - * based on the three dimensions of the product. - * This is a compile time mapping from {1,Small,Large}^3 -> {product types} */ -// FIXME I'm not sure the current mapping is the ideal one. -template struct product_type_selector { enum { ret = OuterProduct }; }; -template struct product_type_selector<1, 1, Depth> { enum { ret = InnerProduct }; }; -template<> struct product_type_selector<1, 1, 1> { enum { ret = InnerProduct }; }; -template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector<1, Small,Small> { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = LazyCoeffBasedProductMode }; }; -template<> struct product_type_selector<1, Large,Small> { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector<1, Large,Large> { enum { ret = GemvProduct }; }; -template<> struct product_type_selector<1, Small,Large> { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = GemvProduct }; }; -template<> struct product_type_selector { enum { ret = CoeffBasedProductMode }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; -template<> struct product_type_selector { enum { ret = GemmProduct }; }; - -} // end namespace internal - -/** \class ProductReturnType - * \ingroup Core_Module - * - * \brief Helper class to get the correct and optimized returned type of operator* - * - * \param Lhs the type of the left-hand side - * \param Rhs the type of the right-hand side - * \param ProductMode the type of the product (determined automatically by internal::product_mode) - * - * This class defines the typename Type representing the optimized product expression - * between two matrix expressions. In practice, using ProductReturnType::Type - * is the recommended way to define the result type of a function returning an expression - * which involve a matrix product. The class Product should never be - * used directly. - * - * \sa class Product, MatrixBase::operator*(const MatrixBase&) - */ -template -struct ProductReturnType -{ - // TODO use the nested type to reduce instanciations ???? -// typedef typename internal::nested::type LhsNested; -// typedef typename internal::nested::type RhsNested; - - typedef GeneralProduct Type; -}; - -template -struct ProductReturnType -{ - typedef typename internal::nested::type >::type LhsNested; - typedef typename internal::nested::type >::type RhsNested; - typedef CoeffBasedProduct Type; -}; - -template -struct ProductReturnType -{ - typedef typename internal::nested::type >::type LhsNested; - typedef typename internal::nested::type >::type RhsNested; - typedef CoeffBasedProduct Type; -}; - -// this is a workaround for sun CC -template -struct LazyProductReturnType : public ProductReturnType -{}; - -/*********************************************************************** -* Implementation of Inner Vector Vector Product -***********************************************************************/ - -// FIXME : maybe the "inner product" could return a Scalar -// instead of a 1x1 matrix ?? -// Pro: more natural for the user -// Cons: this could be a problem if in a meta unrolled algorithm a matrix-matrix -// product ends up to a row-vector times col-vector product... To tackle this use -// case, we could have a specialization for Block with: operator=(Scalar x); - -namespace internal { - -template -struct traits > - : traits::ReturnType,1,1> > -{}; - -} - -template -class GeneralProduct - : internal::no_assignment_operator, - public Matrix::ReturnType,1,1> -{ - typedef Matrix::ReturnType,1,1> Base; - public: - GeneralProduct(const Lhs& lhs, const Rhs& rhs) - { - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - Base::coeffRef(0,0) = (lhs.transpose().cwiseProduct(rhs)).sum(); - } - - /** Convertion to scalar */ - operator const typename Base::Scalar() const { - return Base::coeff(0,0); - } -}; - -/*********************************************************************** -* Implementation of Outer Vector Vector Product -***********************************************************************/ - -namespace internal { - -// Column major -template -EIGEN_DONT_INLINE void outer_product_selector_run(const ProductType& prod, Dest& dest, const Func& func, const false_type&) -{ - typedef typename Dest::Index Index; - // FIXME make sure lhs is sequentially stored - // FIXME not very good if rhs is real and lhs complex while alpha is real too - const Index cols = dest.cols(); - for (Index j=0; j -EIGEN_DONT_INLINE void outer_product_selector_run(const ProductType& prod, Dest& dest, const Func& func, const true_type&) { - typedef typename Dest::Index Index; - // FIXME make sure rhs is sequentially stored - // FIXME not very good if lhs is real and rhs complex while alpha is real too - const Index rows = dest.rows(); - for (Index i=0; i -struct traits > - : traits, Lhs, Rhs> > -{}; - -} - -template -class GeneralProduct - : public ProductBase, Lhs, Rhs> -{ - template struct IsRowMajor : internal::conditional<(int(T::Flags)&RowMajorBit), internal::true_type, internal::false_type>::type {}; - - public: - EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct) - - GeneralProduct(const Lhs& lhs, const Rhs& rhs) : Base(lhs,rhs) - { - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - } - - struct set { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() = src; } }; - struct add { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() += src; } }; - struct sub { template void operator()(const Dst& dst, const Src& src) const { dst.const_cast_derived() -= src; } }; - struct adds { - Scalar m_scale; - adds(const Scalar& s) : m_scale(s) {} - template void operator()(const Dst& dst, const Src& src) const { - dst.const_cast_derived() += m_scale * src; - } - }; - - template - inline void evalTo(Dest& dest) const { - internal::outer_product_selector_run(*this, dest, set(), IsRowMajor()); - } - - template - inline void addTo(Dest& dest) const { - internal::outer_product_selector_run(*this, dest, add(), IsRowMajor()); - } - - template - inline void subTo(Dest& dest) const { - internal::outer_product_selector_run(*this, dest, sub(), IsRowMajor()); - } - - template void scaleAndAddTo(Dest& dest, const Scalar& alpha) const - { - internal::outer_product_selector_run(*this, dest, adds(alpha), IsRowMajor()); - } -}; - -/*********************************************************************** -* Implementation of General Matrix Vector Product -***********************************************************************/ - -/* According to the shape/flags of the matrix we have to distinghish 3 different cases: - * 1 - the matrix is col-major, BLAS compatible and M is large => call fast BLAS-like colmajor routine - * 2 - the matrix is row-major, BLAS compatible and N is large => call fast BLAS-like rowmajor routine - * 3 - all other cases are handled using a simple loop along the outer-storage direction. - * Therefore we need a lower level meta selector. - * Furthermore, if the matrix is the rhs, then the product has to be transposed. - */ -namespace internal { - -template -struct traits > - : traits, Lhs, Rhs> > -{}; - -template -struct gemv_selector; - -} // end namespace internal - -template -class GeneralProduct - : public ProductBase, Lhs, Rhs> -{ - public: - EIGEN_PRODUCT_PUBLIC_INTERFACE(GeneralProduct) - - typedef typename Lhs::Scalar LhsScalar; - typedef typename Rhs::Scalar RhsScalar; - - GeneralProduct(const Lhs& a_lhs, const Rhs& a_rhs) : Base(a_lhs,a_rhs) - { -// EIGEN_STATIC_ASSERT((internal::is_same::value), -// YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - } - - enum { Side = Lhs::IsVectorAtCompileTime ? OnTheLeft : OnTheRight }; - typedef typename internal::conditional::type MatrixType; - - template void scaleAndAddTo(Dest& dst, const Scalar& alpha) const - { - eigen_assert(m_lhs.rows() == dst.rows() && m_rhs.cols() == dst.cols()); - internal::gemv_selector::HasUsableDirectAccess)>::run(*this, dst, alpha); - } -}; - -namespace internal { - -// The vector is on the left => transposition -template -struct gemv_selector -{ - template - static void run(const ProductType& prod, Dest& dest, const typename ProductType::Scalar& alpha) - { - Transpose destT(dest); - enum { OtherStorageOrder = StorageOrder == RowMajor ? ColMajor : RowMajor }; - gemv_selector - ::run(GeneralProduct,Transpose, GemvProduct> - (prod.rhs().transpose(), prod.lhs().transpose()), destT, alpha); - } -}; - -template struct gemv_static_vector_if; - -template -struct gemv_static_vector_if -{ - EIGEN_STRONG_INLINE Scalar* data() { eigen_internal_assert(false && "should never be called"); return 0; } -}; - -template -struct gemv_static_vector_if -{ - EIGEN_STRONG_INLINE Scalar* data() { return 0; } -}; - -template -struct gemv_static_vector_if -{ - #if EIGEN_ALIGN_STATICALLY - internal::plain_array m_data; - EIGEN_STRONG_INLINE Scalar* data() { return m_data.array; } - #else - // Some architectures cannot align on the stack, - // => let's manually enforce alignment by allocating more data and return the address of the first aligned element. - enum { - ForceAlignment = internal::packet_traits::Vectorizable, - PacketSize = internal::packet_traits::size - }; - internal::plain_array m_data; - EIGEN_STRONG_INLINE Scalar* data() { - return ForceAlignment - ? reinterpret_cast((reinterpret_cast(m_data.array) & ~(size_t(15))) + 16) - : m_data.array; - } - #endif -}; - -template<> struct gemv_selector -{ - template - static inline void run(const ProductType& prod, Dest& dest, const typename ProductType::Scalar& alpha) - { - typedef typename ProductType::Index Index; - typedef typename ProductType::LhsScalar LhsScalar; - typedef typename ProductType::RhsScalar RhsScalar; - typedef typename ProductType::Scalar ResScalar; - typedef typename ProductType::RealScalar RealScalar; - typedef typename ProductType::ActualLhsType ActualLhsType; - typedef typename ProductType::ActualRhsType ActualRhsType; - typedef typename ProductType::LhsBlasTraits LhsBlasTraits; - typedef typename ProductType::RhsBlasTraits RhsBlasTraits; - typedef Map, Aligned> MappedDest; - - ActualLhsType actualLhs = LhsBlasTraits::extract(prod.lhs()); - ActualRhsType actualRhs = RhsBlasTraits::extract(prod.rhs()); - - ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs()) - * RhsBlasTraits::extractScalarFactor(prod.rhs()); - - enum { - // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 - // on, the other hand it is good for the cache to pack the vector anyways... - EvalToDestAtCompileTime = Dest::InnerStrideAtCompileTime==1, - ComplexByReal = (NumTraits::IsComplex) && (!NumTraits::IsComplex), - MightCannotUseDest = (Dest::InnerStrideAtCompileTime!=1) || ComplexByReal - }; - - gemv_static_vector_if static_dest; - - bool alphaIsCompatible = (!ComplexByReal) || (numext::imag(actualAlpha)==RealScalar(0)); - bool evalToDest = EvalToDestAtCompileTime && alphaIsCompatible; - - RhsScalar compatibleAlpha = get_factor::run(actualAlpha); - - ei_declare_aligned_stack_constructed_variable(ResScalar,actualDestPtr,dest.size(), - evalToDest ? dest.data() : static_dest.data()); - - if(!evalToDest) - { - #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN - int size = dest.size(); - EIGEN_DENSE_STORAGE_CTOR_PLUGIN - #endif - if(!alphaIsCompatible) - { - MappedDest(actualDestPtr, dest.size()).setZero(); - compatibleAlpha = RhsScalar(1); - } - else - MappedDest(actualDestPtr, dest.size()) = dest; - } - - general_matrix_vector_product - ::run( - actualLhs.rows(), actualLhs.cols(), - actualLhs.data(), actualLhs.outerStride(), - actualRhs.data(), actualRhs.innerStride(), - actualDestPtr, 1, - compatibleAlpha); - - if (!evalToDest) - { - if(!alphaIsCompatible) - dest += actualAlpha * MappedDest(actualDestPtr, dest.size()); - else - dest = MappedDest(actualDestPtr, dest.size()); - } - } -}; - -template<> struct gemv_selector -{ - template - static void run(const ProductType& prod, Dest& dest, const typename ProductType::Scalar& alpha) - { - typedef typename ProductType::LhsScalar LhsScalar; - typedef typename ProductType::RhsScalar RhsScalar; - typedef typename ProductType::Scalar ResScalar; - typedef typename ProductType::Index Index; - typedef typename ProductType::ActualLhsType ActualLhsType; - typedef typename ProductType::ActualRhsType ActualRhsType; - typedef typename ProductType::_ActualRhsType _ActualRhsType; - typedef typename ProductType::LhsBlasTraits LhsBlasTraits; - typedef typename ProductType::RhsBlasTraits RhsBlasTraits; - - typename add_const::type actualLhs = LhsBlasTraits::extract(prod.lhs()); - typename add_const::type actualRhs = RhsBlasTraits::extract(prod.rhs()); - - ResScalar actualAlpha = alpha * LhsBlasTraits::extractScalarFactor(prod.lhs()) - * RhsBlasTraits::extractScalarFactor(prod.rhs()); - - enum { - // FIXME find a way to allow an inner stride on the result if packet_traits::size==1 - // on, the other hand it is good for the cache to pack the vector anyways... - DirectlyUseRhs = _ActualRhsType::InnerStrideAtCompileTime==1 - }; - - gemv_static_vector_if static_rhs; - - ei_declare_aligned_stack_constructed_variable(RhsScalar,actualRhsPtr,actualRhs.size(), - DirectlyUseRhs ? const_cast(actualRhs.data()) : static_rhs.data()); - - if(!DirectlyUseRhs) - { - #ifdef EIGEN_DENSE_STORAGE_CTOR_PLUGIN - int size = actualRhs.size(); - EIGEN_DENSE_STORAGE_CTOR_PLUGIN - #endif - Map(actualRhsPtr, actualRhs.size()) = actualRhs; - } - - general_matrix_vector_product - ::run( - actualLhs.rows(), actualLhs.cols(), - actualLhs.data(), actualLhs.outerStride(), - actualRhsPtr, 1, - dest.data(), dest.innerStride(), - actualAlpha); - } -}; - -template<> struct gemv_selector -{ - template - static void run(const ProductType& prod, Dest& dest, const typename ProductType::Scalar& alpha) - { - typedef typename Dest::Index Index; - // TODO makes sure dest is sequentially stored in memory, otherwise use a temp - const Index size = prod.rhs().rows(); - for(Index k=0; k struct gemv_selector -{ - template - static void run(const ProductType& prod, Dest& dest, const typename ProductType::Scalar& alpha) - { - typedef typename Dest::Index Index; - // TODO makes sure rhs is sequentially stored in memory, otherwise use a temp - const Index rows = prod.rows(); - for(Index i=0; i -template -inline const typename ProductReturnType::Type -MatrixBase::operator*(const MatrixBase &other) const -{ - // A note regarding the function declaration: In MSVC, this function will sometimes - // not be inlined since DenseStorage is an unwindable object for dynamic - // matrices and product types are holding a member to store the result. - // Thus it does not help tagging this function with EIGEN_STRONG_INLINE. - enum { - ProductIsValid = Derived::ColsAtCompileTime==Dynamic - || OtherDerived::RowsAtCompileTime==Dynamic - || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), - AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, - SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) - }; - // note to the lost user: - // * for a dot product use: v1.dot(v2) - // * for a coeff-wise product use: v1.cwiseProduct(v2) - EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), - INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) - EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), - INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) - EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) -#ifdef EIGEN_DEBUG_PRODUCT - internal::product_type::debug(); -#endif - return typename ProductReturnType::Type(derived(), other.derived()); -} - -/** \returns an expression of the matrix product of \c *this and \a other without implicit evaluation. - * - * The returned product will behave like any other expressions: the coefficients of the product will be - * computed once at a time as requested. This might be useful in some extremely rare cases when only - * a small and no coherent fraction of the result's coefficients have to be computed. - * - * \warning This version of the matrix product can be much much slower. So use it only if you know - * what you are doing and that you measured a true speed improvement. - * - * \sa operator*(const MatrixBase&) - */ -template -template -const typename LazyProductReturnType::Type -MatrixBase::lazyProduct(const MatrixBase &other) const -{ - enum { - ProductIsValid = Derived::ColsAtCompileTime==Dynamic - || OtherDerived::RowsAtCompileTime==Dynamic - || int(Derived::ColsAtCompileTime)==int(OtherDerived::RowsAtCompileTime), - AreVectors = Derived::IsVectorAtCompileTime && OtherDerived::IsVectorAtCompileTime, - SameSizes = EIGEN_PREDICATE_SAME_MATRIX_SIZE(Derived,OtherDerived) - }; - // note to the lost user: - // * for a dot product use: v1.dot(v2) - // * for a coeff-wise product use: v1.cwiseProduct(v2) - EIGEN_STATIC_ASSERT(ProductIsValid || !(AreVectors && SameSizes), - INVALID_VECTOR_VECTOR_PRODUCT__IF_YOU_WANTED_A_DOT_OR_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTIONS) - EIGEN_STATIC_ASSERT(ProductIsValid || !(SameSizes && !AreVectors), - INVALID_MATRIX_PRODUCT__IF_YOU_WANTED_A_COEFF_WISE_PRODUCT_YOU_MUST_USE_THE_EXPLICIT_FUNCTION) - EIGEN_STATIC_ASSERT(ProductIsValid || SameSizes, INVALID_MATRIX_PRODUCT) - - return typename LazyProductReturnType::Type(derived(), other.derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_PRODUCT_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GenericPacketMath.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GenericPacketMath.h deleted file mode 100644 index 5f783ebeee..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GenericPacketMath.h +++ /dev/null @@ -1,350 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_GENERIC_PACKET_MATH_H -#define EIGEN_GENERIC_PACKET_MATH_H - -namespace Eigen { - -namespace internal { - -/** \internal - * \file GenericPacketMath.h - * - * Default implementation for types not supported by the vectorization. - * In practice these functions are provided to make easier the writing - * of generic vectorized code. - */ - -#ifndef EIGEN_DEBUG_ALIGNED_LOAD -#define EIGEN_DEBUG_ALIGNED_LOAD -#endif - -#ifndef EIGEN_DEBUG_UNALIGNED_LOAD -#define EIGEN_DEBUG_UNALIGNED_LOAD -#endif - -#ifndef EIGEN_DEBUG_ALIGNED_STORE -#define EIGEN_DEBUG_ALIGNED_STORE -#endif - -#ifndef EIGEN_DEBUG_UNALIGNED_STORE -#define EIGEN_DEBUG_UNALIGNED_STORE -#endif - -struct default_packet_traits -{ - enum { - HasAdd = 1, - HasSub = 1, - HasMul = 1, - HasNegate = 1, - HasAbs = 1, - HasAbs2 = 1, - HasMin = 1, - HasMax = 1, - HasConj = 1, - HasSetLinear = 1, - - HasDiv = 0, - HasSqrt = 0, - HasExp = 0, - HasLog = 0, - HasPow = 0, - - HasSin = 0, - HasCos = 0, - HasTan = 0, - HasASin = 0, - HasACos = 0, - HasATan = 0 - }; -}; - -template struct packet_traits : default_packet_traits -{ - typedef T type; - enum { - Vectorizable = 0, - size = 1, - AlignedOnScalar = 0 - }; - enum { - HasAdd = 0, - HasSub = 0, - HasMul = 0, - HasNegate = 0, - HasAbs = 0, - HasAbs2 = 0, - HasMin = 0, - HasMax = 0, - HasConj = 0, - HasSetLinear = 0 - }; -}; - -/** \internal \returns a + b (coeff-wise) */ -template inline Packet -padd(const Packet& a, - const Packet& b) { return a+b; } - -/** \internal \returns a - b (coeff-wise) */ -template inline Packet -psub(const Packet& a, - const Packet& b) { return a-b; } - -/** \internal \returns -a (coeff-wise) */ -template inline Packet -pnegate(const Packet& a) { return -a; } - -/** \internal \returns conj(a) (coeff-wise) */ -template inline Packet -pconj(const Packet& a) { return numext::conj(a); } - -/** \internal \returns a * b (coeff-wise) */ -template inline Packet -pmul(const Packet& a, - const Packet& b) { return a*b; } - -/** \internal \returns a / b (coeff-wise) */ -template inline Packet -pdiv(const Packet& a, - const Packet& b) { return a/b; } - -/** \internal \returns the min of \a a and \a b (coeff-wise) */ -template inline Packet -pmin(const Packet& a, - const Packet& b) { using std::min; return (min)(a, b); } - -/** \internal \returns the max of \a a and \a b (coeff-wise) */ -template inline Packet -pmax(const Packet& a, - const Packet& b) { using std::max; return (max)(a, b); } - -/** \internal \returns the absolute value of \a a */ -template inline Packet -pabs(const Packet& a) { using std::abs; return abs(a); } - -/** \internal \returns the bitwise and of \a a and \a b */ -template inline Packet -pand(const Packet& a, const Packet& b) { return a & b; } - -/** \internal \returns the bitwise or of \a a and \a b */ -template inline Packet -por(const Packet& a, const Packet& b) { return a | b; } - -/** \internal \returns the bitwise xor of \a a and \a b */ -template inline Packet -pxor(const Packet& a, const Packet& b) { return a ^ b; } - -/** \internal \returns the bitwise andnot of \a a and \a b */ -template inline Packet -pandnot(const Packet& a, const Packet& b) { return a & (!b); } - -/** \internal \returns a packet version of \a *from, from must be 16 bytes aligned */ -template inline Packet -pload(const typename unpacket_traits::type* from) { return *from; } - -/** \internal \returns a packet version of \a *from, (un-aligned load) */ -template inline Packet -ploadu(const typename unpacket_traits::type* from) { return *from; } - -/** \internal \returns a packet with elements of \a *from duplicated. - * For instance, for a packet of 8 elements, 4 scalar will be read from \a *from and - * duplicated to form: {from[0],from[0],from[1],from[1],,from[2],from[2],,from[3],from[3]} - * Currently, this function is only used for scalar * complex products. - */ -template inline Packet -ploaddup(const typename unpacket_traits::type* from) { return *from; } - -/** \internal \returns a packet with constant coefficients \a a, e.g.: (a,a,a,a) */ -template inline Packet -pset1(const typename unpacket_traits::type& a) { return a; } - -/** \internal \brief Returns a packet with coefficients (a,a+1,...,a+packet_size-1). */ -template inline typename packet_traits::type -plset(const Scalar& a) { return a; } - -/** \internal copy the packet \a from to \a *to, \a to must be 16 bytes aligned */ -template inline void pstore(Scalar* to, const Packet& from) -{ (*to) = from; } - -/** \internal copy the packet \a from to \a *to, (un-aligned store) */ -template inline void pstoreu(Scalar* to, const Packet& from) -{ (*to) = from; } - -/** \internal tries to do cache prefetching of \a addr */ -template inline void prefetch(const Scalar* addr) -{ -#if !defined(_MSC_VER) -__builtin_prefetch(addr); -#endif -} - -/** \internal \returns the first element of a packet */ -template inline typename unpacket_traits::type pfirst(const Packet& a) -{ return a; } - -/** \internal \returns a packet where the element i contains the sum of the packet of \a vec[i] */ -template inline Packet -preduxp(const Packet* vecs) { return vecs[0]; } - -/** \internal \returns the sum of the elements of \a a*/ -template inline typename unpacket_traits::type predux(const Packet& a) -{ return a; } - -/** \internal \returns the product of the elements of \a a*/ -template inline typename unpacket_traits::type predux_mul(const Packet& a) -{ return a; } - -/** \internal \returns the min of the elements of \a a*/ -template inline typename unpacket_traits::type predux_min(const Packet& a) -{ return a; } - -/** \internal \returns the max of the elements of \a a*/ -template inline typename unpacket_traits::type predux_max(const Packet& a) -{ return a; } - -/** \internal \returns the reversed elements of \a a*/ -template inline Packet preverse(const Packet& a) -{ return a; } - - -/** \internal \returns \a a with real and imaginary part flipped (for complex type only) */ -template inline Packet pcplxflip(const Packet& a) -{ - // FIXME: uncomment the following in case we drop the internal imag and real functions. -// using std::imag; -// using std::real; - return Packet(imag(a),real(a)); -} - -/************************** -* Special math functions -***************************/ - -/** \internal \returns the sine of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet psin(const Packet& a) { using std::sin; return sin(a); } - -/** \internal \returns the cosine of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet pcos(const Packet& a) { using std::cos; return cos(a); } - -/** \internal \returns the tan of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet ptan(const Packet& a) { using std::tan; return tan(a); } - -/** \internal \returns the arc sine of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet pasin(const Packet& a) { using std::asin; return asin(a); } - -/** \internal \returns the arc cosine of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet pacos(const Packet& a) { using std::acos; return acos(a); } - -/** \internal \returns the exp of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet pexp(const Packet& a) { using std::exp; return exp(a); } - -/** \internal \returns the log of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet plog(const Packet& a) { using std::log; return log(a); } - -/** \internal \returns the square-root of \a a (coeff-wise) */ -template EIGEN_DECLARE_FUNCTION_ALLOWING_MULTIPLE_DEFINITIONS -Packet psqrt(const Packet& a) { using std::sqrt; return sqrt(a); } - -/*************************************************************************** -* The following functions might not have to be overwritten for vectorized types -***************************************************************************/ - -/** \internal copy a packet with constant coeficient \a a (e.g., [a,a,a,a]) to \a *to. \a to must be 16 bytes aligned */ -// NOTE: this function must really be templated on the packet type (think about different packet types for the same scalar type) -template -inline void pstore1(typename unpacket_traits::type* to, const typename unpacket_traits::type& a) -{ - pstore(to, pset1(a)); -} - -/** \internal \returns a * b + c (coeff-wise) */ -template inline Packet -pmadd(const Packet& a, - const Packet& b, - const Packet& c) -{ return padd(pmul(a, b),c); } - -/** \internal \returns a packet version of \a *from. - * If LoadMode equals #Aligned, \a from must be 16 bytes aligned */ -template -inline Packet ploadt(const typename unpacket_traits::type* from) -{ - if(LoadMode == Aligned) - return pload(from); - else - return ploadu(from); -} - -/** \internal copy the packet \a from to \a *to. - * If StoreMode equals #Aligned, \a to must be 16 bytes aligned */ -template -inline void pstoret(Scalar* to, const Packet& from) -{ - if(LoadMode == Aligned) - pstore(to, from); - else - pstoreu(to, from); -} - -/** \internal default implementation of palign() allowing partial specialization */ -template -struct palign_impl -{ - // by default data are aligned, so there is nothing to be done :) - static inline void run(PacketType&, const PacketType&) {} -}; - -/** \internal update \a first using the concatenation of the packet_size minus \a Offset last elements - * of \a first and \a Offset first elements of \a second. - * - * This function is currently only used to optimize matrix-vector products on unligned matrices. - * It takes 2 packets that represent a contiguous memory array, and returns a packet starting - * at the position \a Offset. For instance, for packets of 4 elements, we have: - * Input: - * - first = {f0,f1,f2,f3} - * - second = {s0,s1,s2,s3} - * Output: - * - if Offset==0 then {f0,f1,f2,f3} - * - if Offset==1 then {f1,f2,f3,s0} - * - if Offset==2 then {f2,f3,s0,s1} - * - if Offset==3 then {f3,s0,s1,s3} - */ -template -inline void palign(PacketType& first, const PacketType& second) -{ - palign_impl::run(first,second); -} - -/*************************************************************************** -* Fast complex products (GCC generates a function call which is very slow) -***************************************************************************/ - -template<> inline std::complex pmul(const std::complex& a, const std::complex& b) -{ return std::complex(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); } - -template<> inline std::complex pmul(const std::complex& a, const std::complex& b) -{ return std::complex(real(a)*real(b) - imag(a)*imag(b), imag(a)*real(b) + real(a)*imag(b)); } - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_GENERIC_PACKET_MATH_H - diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GlobalFunctions.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GlobalFunctions.h deleted file mode 100644 index 2acf977233..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/GlobalFunctions.h +++ /dev/null @@ -1,92 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2010-2012 Gael Guennebaud -// Copyright (C) 2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_GLOBAL_FUNCTIONS_H -#define EIGEN_GLOBAL_FUNCTIONS_H - -#define EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(NAME,FUNCTOR) \ - template \ - inline const Eigen::CwiseUnaryOp, const Derived> \ - NAME(const Eigen::ArrayBase& x) { \ - return x.derived(); \ - } - -#define EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(NAME,FUNCTOR) \ - \ - template \ - struct NAME##_retval > \ - { \ - typedef const Eigen::CwiseUnaryOp, const Derived> type; \ - }; \ - template \ - struct NAME##_impl > \ - { \ - static inline typename NAME##_retval >::type run(const Eigen::ArrayBase& x) \ - { \ - return x.derived(); \ - } \ - }; - - -namespace Eigen -{ - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(real,scalar_real_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(imag,scalar_imag_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(conj,scalar_conjugate_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sin,scalar_sin_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(cos,scalar_cos_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(asin,scalar_asin_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(acos,scalar_acos_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(tan,scalar_tan_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(exp,scalar_exp_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(log,scalar_log_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(abs,scalar_abs_op) - EIGEN_ARRAY_DECLARE_GLOBAL_UNARY(sqrt,scalar_sqrt_op) - - template - inline const Eigen::CwiseUnaryOp, const Derived> - pow(const Eigen::ArrayBase& x, const typename Derived::Scalar& exponent) { - return x.derived().pow(exponent); - } - - template - inline const Eigen::CwiseBinaryOp, const Derived, const Derived> - pow(const Eigen::ArrayBase& x, const Eigen::ArrayBase& exponents) - { - return Eigen::CwiseBinaryOp, const Derived, const Derived>( - x.derived(), - exponents.derived() - ); - } - - /** - * \brief Component-wise division of a scalar by array elements. - **/ - template - inline const Eigen::CwiseUnaryOp, const Derived> - operator/(const typename Derived::Scalar& s, const Eigen::ArrayBase& a) - { - return Eigen::CwiseUnaryOp, const Derived>( - a.derived(), - Eigen::internal::scalar_inverse_mult_op(s) - ); - } - - namespace internal - { - EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(real,scalar_real_op) - EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(imag,scalar_imag_op) - EIGEN_ARRAY_DECLARE_GLOBAL_EIGEN_UNARY(abs2,scalar_abs2_op) - } -} - -// TODO: cleanly disable those functions that are not supported on Array (numext::real_ref, internal::random, internal::isApprox...) - -#endif // EIGEN_GLOBAL_FUNCTIONS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/IO.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/IO.h deleted file mode 100644 index c8d5f6379b..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/IO.h +++ /dev/null @@ -1,249 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2008 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_IO_H -#define EIGEN_IO_H - -namespace Eigen { - -enum { DontAlignCols = 1 }; -enum { StreamPrecision = -1, - FullPrecision = -2 }; - -namespace internal { -template -std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt); -} - -/** \class IOFormat - * \ingroup Core_Module - * - * \brief Stores a set of parameters controlling the way matrices are printed - * - * List of available parameters: - * - \b precision number of digits for floating point values, or one of the special constants \c StreamPrecision and \c FullPrecision. - * The default is the special value \c StreamPrecision which means to use the - * stream's own precision setting, as set for instance using \c cout.precision(3). The other special value - * \c FullPrecision means that the number of digits will be computed to match the full precision of each floating-point - * type. - * - \b flags an OR-ed combination of flags, the default value is 0, the only currently available flag is \c DontAlignCols which - * allows to disable the alignment of columns, resulting in faster code. - * - \b coeffSeparator string printed between two coefficients of the same row - * - \b rowSeparator string printed between two rows - * - \b rowPrefix string printed at the beginning of each row - * - \b rowSuffix string printed at the end of each row - * - \b matPrefix string printed at the beginning of the matrix - * - \b matSuffix string printed at the end of the matrix - * - * Example: \include IOFormat.cpp - * Output: \verbinclude IOFormat.out - * - * \sa DenseBase::format(), class WithFormat - */ -struct IOFormat -{ - /** Default contructor, see class IOFormat for the meaning of the parameters */ - IOFormat(int _precision = StreamPrecision, int _flags = 0, - const std::string& _coeffSeparator = " ", - const std::string& _rowSeparator = "\n", const std::string& _rowPrefix="", const std::string& _rowSuffix="", - const std::string& _matPrefix="", const std::string& _matSuffix="") - : matPrefix(_matPrefix), matSuffix(_matSuffix), rowPrefix(_rowPrefix), rowSuffix(_rowSuffix), rowSeparator(_rowSeparator), - rowSpacer(""), coeffSeparator(_coeffSeparator), precision(_precision), flags(_flags) - { - int i = int(matSuffix.length())-1; - while (i>=0 && matSuffix[i]!='\n') - { - rowSpacer += ' '; - i--; - } - } - std::string matPrefix, matSuffix; - std::string rowPrefix, rowSuffix, rowSeparator, rowSpacer; - std::string coeffSeparator; - int precision; - int flags; -}; - -/** \class WithFormat - * \ingroup Core_Module - * - * \brief Pseudo expression providing matrix output with given format - * - * \param ExpressionType the type of the object on which IO stream operations are performed - * - * This class represents an expression with stream operators controlled by a given IOFormat. - * It is the return type of DenseBase::format() - * and most of the time this is the only way it is used. - * - * See class IOFormat for some examples. - * - * \sa DenseBase::format(), class IOFormat - */ -template -class WithFormat -{ - public: - - WithFormat(const ExpressionType& matrix, const IOFormat& format) - : m_matrix(matrix), m_format(format) - {} - - friend std::ostream & operator << (std::ostream & s, const WithFormat& wf) - { - return internal::print_matrix(s, wf.m_matrix.eval(), wf.m_format); - } - - protected: - const typename ExpressionType::Nested m_matrix; - IOFormat m_format; -}; - -/** \returns a WithFormat proxy object allowing to print a matrix the with given - * format \a fmt. - * - * See class IOFormat for some examples. - * - * \sa class IOFormat, class WithFormat - */ -template -inline const WithFormat -DenseBase::format(const IOFormat& fmt) const -{ - return WithFormat(derived(), fmt); -} - -namespace internal { - -template -struct significant_decimals_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline int run() - { - using std::ceil; - using std::log; - return cast(ceil(-log(NumTraits::epsilon())/log(RealScalar(10)))); - } -}; - -template -struct significant_decimals_default_impl -{ - static inline int run() - { - return 0; - } -}; - -template -struct significant_decimals_impl - : significant_decimals_default_impl::IsInteger> -{}; - -/** \internal - * print the matrix \a _m to the output stream \a s using the output format \a fmt */ -template -std::ostream & print_matrix(std::ostream & s, const Derived& _m, const IOFormat& fmt) -{ - if(_m.size() == 0) - { - s << fmt.matPrefix << fmt.matSuffix; - return s; - } - - typename Derived::Nested m = _m; - typedef typename Derived::Scalar Scalar; - typedef typename Derived::Index Index; - - Index width = 0; - - std::streamsize explicit_precision; - if(fmt.precision == StreamPrecision) - { - explicit_precision = 0; - } - else if(fmt.precision == FullPrecision) - { - if (NumTraits::IsInteger) - { - explicit_precision = 0; - } - else - { - explicit_precision = significant_decimals_impl::run(); - } - } - else - { - explicit_precision = fmt.precision; - } - - bool align_cols = !(fmt.flags & DontAlignCols); - if(align_cols) - { - // compute the largest width - for(Index j = 1; j < m.cols(); ++j) - for(Index i = 0; i < m.rows(); ++i) - { - std::stringstream sstr; - if(explicit_precision) sstr.precision(explicit_precision); - sstr << m.coeff(i,j); - width = std::max(width, Index(sstr.str().length())); - } - } - std::streamsize old_precision = 0; - if(explicit_precision) old_precision = s.precision(explicit_precision); - s << fmt.matPrefix; - for(Index i = 0; i < m.rows(); ++i) - { - if (i) - s << fmt.rowSpacer; - s << fmt.rowPrefix; - if(width) s.width(width); - s << m.coeff(i, 0); - for(Index j = 1; j < m.cols(); ++j) - { - s << fmt.coeffSeparator; - if (width) s.width(width); - s << m.coeff(i, j); - } - s << fmt.rowSuffix; - if( i < m.rows() - 1) - s << fmt.rowSeparator; - } - s << fmt.matSuffix; - if(explicit_precision) s.precision(old_precision); - return s; -} - -} // end namespace internal - -/** \relates DenseBase - * - * Outputs the matrix, to the given stream. - * - * If you wish to print the matrix with a format different than the default, use DenseBase::format(). - * - * It is also possible to change the default format by defining EIGEN_DEFAULT_IO_FORMAT before including Eigen headers. - * If not defined, this will automatically be defined to Eigen::IOFormat(), that is the Eigen::IOFormat with default parameters. - * - * \sa DenseBase::format() - */ -template -std::ostream & operator << -(std::ostream & s, - const DenseBase & m) -{ - return internal::print_matrix(s, m.eval(), EIGEN_DEFAULT_IO_FORMAT); -} - -} // end namespace Eigen - -#endif // EIGEN_IO_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Map.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Map.h deleted file mode 100644 index f804c89d63..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Map.h +++ /dev/null @@ -1,192 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2007-2010 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MAP_H -#define EIGEN_MAP_H - -namespace Eigen { - -/** \class Map - * \ingroup Core_Module - * - * \brief A matrix or vector expression mapping an existing array of data. - * - * \tparam PlainObjectType the equivalent matrix type of the mapped data - * \tparam MapOptions specifies whether the pointer is \c #Aligned, or \c #Unaligned. - * The default is \c #Unaligned. - * \tparam StrideType optionally specifies strides. By default, Map assumes the memory layout - * of an ordinary, contiguous array. This can be overridden by specifying strides. - * The type passed here must be a specialization of the Stride template, see examples below. - * - * This class represents a matrix or vector expression mapping an existing array of data. - * It can be used to let Eigen interface without any overhead with non-Eigen data structures, - * such as plain C arrays or structures from other libraries. By default, it assumes that the - * data is laid out contiguously in memory. You can however override this by explicitly specifying - * inner and outer strides. - * - * Here's an example of simply mapping a contiguous array as a \ref TopicStorageOrders "column-major" matrix: - * \include Map_simple.cpp - * Output: \verbinclude Map_simple.out - * - * If you need to map non-contiguous arrays, you can do so by specifying strides: - * - * Here's an example of mapping an array as a vector, specifying an inner stride, that is, the pointer - * increment between two consecutive coefficients. Here, we're specifying the inner stride as a compile-time - * fixed value. - * \include Map_inner_stride.cpp - * Output: \verbinclude Map_inner_stride.out - * - * Here's an example of mapping an array while specifying an outer stride. Here, since we're mapping - * as a column-major matrix, 'outer stride' means the pointer increment between two consecutive columns. - * Here, we're specifying the outer stride as a runtime parameter. Note that here \c OuterStride<> is - * a short version of \c OuterStride because the default template parameter of OuterStride - * is \c Dynamic - * \include Map_outer_stride.cpp - * Output: \verbinclude Map_outer_stride.out - * - * For more details and for an example of specifying both an inner and an outer stride, see class Stride. - * - * \b Tip: to change the array of data mapped by a Map object, you can use the C++ - * placement new syntax: - * - * Example: \include Map_placement_new.cpp - * Output: \verbinclude Map_placement_new.out - * - * This class is the return type of PlainObjectBase::Map() but can also be used directly. - * - * \sa PlainObjectBase::Map(), \ref TopicStorageOrders - */ - -namespace internal { -template -struct traits > - : public traits -{ - typedef traits TraitsBase; - typedef typename PlainObjectType::Index Index; - typedef typename PlainObjectType::Scalar Scalar; - enum { - InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime == 0 - ? int(PlainObjectType::InnerStrideAtCompileTime) - : int(StrideType::InnerStrideAtCompileTime), - OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime == 0 - ? int(PlainObjectType::OuterStrideAtCompileTime) - : int(StrideType::OuterStrideAtCompileTime), - HasNoInnerStride = InnerStrideAtCompileTime == 1, - HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0, - HasNoStride = HasNoInnerStride && HasNoOuterStride, - IsAligned = bool(EIGEN_ALIGN) && ((int(MapOptions)&Aligned)==Aligned), - IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic, - KeepsPacketAccess = bool(HasNoInnerStride) - && ( bool(IsDynamicSize) - || HasNoOuterStride - || ( OuterStrideAtCompileTime!=Dynamic - && ((static_cast(sizeof(Scalar))*OuterStrideAtCompileTime)%16)==0 ) ), - Flags0 = TraitsBase::Flags & (~NestByRefBit), - Flags1 = IsAligned ? (int(Flags0) | AlignedBit) : (int(Flags0) & ~AlignedBit), - Flags2 = (bool(HasNoStride) || bool(PlainObjectType::IsVectorAtCompileTime)) - ? int(Flags1) : int(Flags1 & ~LinearAccessBit), - Flags3 = is_lvalue::value ? int(Flags2) : (int(Flags2) & ~LvalueBit), - Flags = KeepsPacketAccess ? int(Flags3) : (int(Flags3) & ~PacketAccessBit) - }; -private: - enum { Options }; // Expressions don't have Options -}; -} - -template class Map - : public MapBase > -{ - public: - - typedef MapBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Map) - - typedef typename Base::PointerType PointerType; -#if EIGEN2_SUPPORT_STAGE <= STAGE30_FULL_EIGEN3_API - typedef const Scalar* PointerArgType; - inline PointerType cast_to_pointer_type(PointerArgType ptr) { return const_cast(ptr); } -#else - typedef PointerType PointerArgType; - inline PointerType cast_to_pointer_type(PointerArgType ptr) { return ptr; } -#endif - - inline Index innerStride() const - { - return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; - } - - inline Index outerStride() const - { - return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() - : IsVectorAtCompileTime ? this->size() - : int(Flags)&RowMajorBit ? this->cols() - : this->rows(); - } - - /** Constructor in the fixed-size case. - * - * \param dataPtr pointer to the array to map - * \param a_stride optional Stride object, passing the strides. - */ - inline Map(PointerArgType dataPtr, const StrideType& a_stride = StrideType()) - : Base(cast_to_pointer_type(dataPtr)), m_stride(a_stride) - { - PlainObjectType::Base::_check_template_params(); - } - - /** Constructor in the dynamic-size vector case. - * - * \param dataPtr pointer to the array to map - * \param a_size the size of the vector expression - * \param a_stride optional Stride object, passing the strides. - */ - inline Map(PointerArgType dataPtr, Index a_size, const StrideType& a_stride = StrideType()) - : Base(cast_to_pointer_type(dataPtr), a_size), m_stride(a_stride) - { - PlainObjectType::Base::_check_template_params(); - } - - /** Constructor in the dynamic-size matrix case. - * - * \param dataPtr pointer to the array to map - * \param nbRows the number of rows of the matrix expression - * \param nbCols the number of columns of the matrix expression - * \param a_stride optional Stride object, passing the strides. - */ - inline Map(PointerArgType dataPtr, Index nbRows, Index nbCols, const StrideType& a_stride = StrideType()) - : Base(cast_to_pointer_type(dataPtr), nbRows, nbCols), m_stride(a_stride) - { - PlainObjectType::Base::_check_template_params(); - } - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Map) - - protected: - StrideType m_stride; -}; - -template -inline Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> - ::Array(const Scalar *data) -{ - this->_set_noalias(Eigen::Map(data)); -} - -template -inline Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> - ::Matrix(const Scalar *data) -{ - this->_set_noalias(Eigen::Map(data)); -} - -} // end namespace Eigen - -#endif // EIGEN_MAP_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MapBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MapBase.h deleted file mode 100644 index 6876de588c..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MapBase.h +++ /dev/null @@ -1,242 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2007-2010 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MAPBASE_H -#define EIGEN_MAPBASE_H - -#define EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) \ - EIGEN_STATIC_ASSERT((int(internal::traits::Flags) & LinearAccessBit) || Derived::IsVectorAtCompileTime, \ - YOU_ARE_TRYING_TO_USE_AN_INDEX_BASED_ACCESSOR_ON_AN_EXPRESSION_THAT_DOES_NOT_SUPPORT_THAT) - -namespace Eigen { - -/** \class MapBase - * \ingroup Core_Module - * - * \brief Base class for Map and Block expression with direct access - * - * \sa class Map, class Block - */ -template class MapBase - : public internal::dense_xpr_base::type -{ - public: - - typedef typename internal::dense_xpr_base::type Base; - enum { - RowsAtCompileTime = internal::traits::RowsAtCompileTime, - ColsAtCompileTime = internal::traits::ColsAtCompileTime, - SizeAtCompileTime = Base::SizeAtCompileTime - }; - - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - typedef typename internal::conditional< - bool(internal::is_lvalue::value), - Scalar *, - const Scalar *>::type - PointerType; - - using Base::derived; -// using Base::RowsAtCompileTime; -// using Base::ColsAtCompileTime; -// using Base::SizeAtCompileTime; - using Base::MaxRowsAtCompileTime; - using Base::MaxColsAtCompileTime; - using Base::MaxSizeAtCompileTime; - using Base::IsVectorAtCompileTime; - using Base::Flags; - using Base::IsRowMajor; - - using Base::rows; - using Base::cols; - using Base::size; - using Base::coeff; - using Base::coeffRef; - using Base::lazyAssign; - using Base::eval; - - using Base::innerStride; - using Base::outerStride; - using Base::rowStride; - using Base::colStride; - - // bug 217 - compile error on ICC 11.1 - using Base::operator=; - - typedef typename Base::CoeffReturnType CoeffReturnType; - - inline Index rows() const { return m_rows.value(); } - inline Index cols() const { return m_cols.value(); } - - /** Returns a pointer to the first coefficient of the matrix or vector. - * - * \note When addressing this data, make sure to honor the strides returned by innerStride() and outerStride(). - * - * \sa innerStride(), outerStride() - */ - inline const Scalar* data() const { return m_data; } - - inline const Scalar& coeff(Index rowId, Index colId) const - { - return m_data[colId * colStride() + rowId * rowStride()]; - } - - inline const Scalar& coeff(Index index) const - { - EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) - return m_data[index * innerStride()]; - } - - inline const Scalar& coeffRef(Index rowId, Index colId) const - { - return this->m_data[colId * colStride() + rowId * rowStride()]; - } - - inline const Scalar& coeffRef(Index index) const - { - EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) - return this->m_data[index * innerStride()]; - } - - template - inline PacketScalar packet(Index rowId, Index colId) const - { - return internal::ploadt - (m_data + (colId * colStride() + rowId * rowStride())); - } - - template - inline PacketScalar packet(Index index) const - { - EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) - return internal::ploadt(m_data + index * innerStride()); - } - - inline MapBase(PointerType dataPtr) : m_data(dataPtr), m_rows(RowsAtCompileTime), m_cols(ColsAtCompileTime) - { - EIGEN_STATIC_ASSERT_FIXED_SIZE(Derived) - checkSanity(); - } - - inline MapBase(PointerType dataPtr, Index vecSize) - : m_data(dataPtr), - m_rows(RowsAtCompileTime == Dynamic ? vecSize : Index(RowsAtCompileTime)), - m_cols(ColsAtCompileTime == Dynamic ? vecSize : Index(ColsAtCompileTime)) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) - eigen_assert(vecSize >= 0); - eigen_assert(dataPtr == 0 || SizeAtCompileTime == Dynamic || SizeAtCompileTime == vecSize); - checkSanity(); - } - - inline MapBase(PointerType dataPtr, Index nbRows, Index nbCols) - : m_data(dataPtr), m_rows(nbRows), m_cols(nbCols) - { - eigen_assert( (dataPtr == 0) - || ( nbRows >= 0 && (RowsAtCompileTime == Dynamic || RowsAtCompileTime == nbRows) - && nbCols >= 0 && (ColsAtCompileTime == Dynamic || ColsAtCompileTime == nbCols))); - checkSanity(); - } - - protected: - - void checkSanity() const - { - EIGEN_STATIC_ASSERT(EIGEN_IMPLIES(internal::traits::Flags&PacketAccessBit, - internal::inner_stride_at_compile_time::ret==1), - PACKET_ACCESS_REQUIRES_TO_HAVE_INNER_STRIDE_FIXED_TO_1); - eigen_assert(EIGEN_IMPLIES(internal::traits::Flags&AlignedBit, (size_t(m_data) % 16) == 0) - && "data is not aligned"); - } - - PointerType m_data; - const internal::variable_if_dynamic m_rows; - const internal::variable_if_dynamic m_cols; -}; - -template class MapBase - : public MapBase -{ - public: - - typedef MapBase Base; - - typedef typename Base::Scalar Scalar; - typedef typename Base::PacketScalar PacketScalar; - typedef typename Base::Index Index; - typedef typename Base::PointerType PointerType; - - using Base::derived; - using Base::rows; - using Base::cols; - using Base::size; - using Base::coeff; - using Base::coeffRef; - - using Base::innerStride; - using Base::outerStride; - using Base::rowStride; - using Base::colStride; - - typedef typename internal::conditional< - internal::is_lvalue::value, - Scalar, - const Scalar - >::type ScalarWithConstIfNotLvalue; - - inline const Scalar* data() const { return this->m_data; } - inline ScalarWithConstIfNotLvalue* data() { return this->m_data; } // no const-cast here so non-const-correct code will give a compile error - - inline ScalarWithConstIfNotLvalue& coeffRef(Index row, Index col) - { - return this->m_data[col * colStride() + row * rowStride()]; - } - - inline ScalarWithConstIfNotLvalue& coeffRef(Index index) - { - EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) - return this->m_data[index * innerStride()]; - } - - template - inline void writePacket(Index row, Index col, const PacketScalar& val) - { - internal::pstoret - (this->m_data + (col * colStride() + row * rowStride()), val); - } - - template - inline void writePacket(Index index, const PacketScalar& val) - { - EIGEN_STATIC_ASSERT_INDEX_BASED_ACCESS(Derived) - internal::pstoret - (this->m_data + index * innerStride(), val); - } - - explicit inline MapBase(PointerType dataPtr) : Base(dataPtr) {} - inline MapBase(PointerType dataPtr, Index vecSize) : Base(dataPtr, vecSize) {} - inline MapBase(PointerType dataPtr, Index nbRows, Index nbCols) : Base(dataPtr, nbRows, nbCols) {} - - Derived& operator=(const MapBase& other) - { - Base::Base::operator=(other); - return derived(); - } - - using Base::Base::operator=; -}; - -} // end namespace Eigen - -#endif // EIGEN_MAPBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MathFunctions.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MathFunctions.h deleted file mode 100644 index 2bfc5ebd98..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MathFunctions.h +++ /dev/null @@ -1,768 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MATHFUNCTIONS_H -#define EIGEN_MATHFUNCTIONS_H - -namespace Eigen { - -namespace internal { - -/** \internal \struct global_math_functions_filtering_base - * - * What it does: - * Defines a typedef 'type' as follows: - * - if type T has a member typedef Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl, then - * global_math_functions_filtering_base::type is a typedef for it. - * - otherwise, global_math_functions_filtering_base::type is a typedef for T. - * - * How it's used: - * To allow to defined the global math functions (like sin...) in certain cases, like the Array expressions. - * When you do sin(array1+array2), the object array1+array2 has a complicated expression type, all what you want to know - * is that it inherits ArrayBase. So we implement a partial specialization of sin_impl for ArrayBase. - * So we must make sure to use sin_impl > and not sin_impl, otherwise our partial specialization - * won't be used. How does sin know that? That's exactly what global_math_functions_filtering_base tells it. - * - * How it's implemented: - * SFINAE in the style of enable_if. Highly susceptible of breaking compilers. With GCC, it sure does work, but if you replace - * the typename dummy by an integer template parameter, it doesn't work anymore! - */ - -template -struct global_math_functions_filtering_base -{ - typedef T type; -}; - -template struct always_void { typedef void type; }; - -template -struct global_math_functions_filtering_base - ::type - > -{ - typedef typename T::Eigen_BaseClassForSpecializationOfGlobalMathFuncImpl type; -}; - -#define EIGEN_MATHFUNC_IMPL(func, scalar) Eigen::internal::func##_impl::type> -#define EIGEN_MATHFUNC_RETVAL(func, scalar) typename Eigen::internal::func##_retval::type>::type - -/**************************************************************************** -* Implementation of real * -****************************************************************************/ - -template::IsComplex> -struct real_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x) - { - return x; - } -}; - -template -struct real_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x) - { - using std::real; - return real(x); - } -}; - -template struct real_impl : real_default_impl {}; - -template -struct real_retval -{ - typedef typename NumTraits::Real type; -}; - - -/**************************************************************************** -* Implementation of imag * -****************************************************************************/ - -template::IsComplex> -struct imag_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar&) - { - return RealScalar(0); - } -}; - -template -struct imag_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x) - { - using std::imag; - return imag(x); - } -}; - -template struct imag_impl : imag_default_impl {}; - -template -struct imag_retval -{ - typedef typename NumTraits::Real type; -}; - -/**************************************************************************** -* Implementation of real_ref * -****************************************************************************/ - -template -struct real_ref_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar& run(Scalar& x) - { - return reinterpret_cast(&x)[0]; - } - static inline const RealScalar& run(const Scalar& x) - { - return reinterpret_cast(&x)[0]; - } -}; - -template -struct real_ref_retval -{ - typedef typename NumTraits::Real & type; -}; - -/**************************************************************************** -* Implementation of imag_ref * -****************************************************************************/ - -template -struct imag_ref_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar& run(Scalar& x) - { - return reinterpret_cast(&x)[1]; - } - static inline const RealScalar& run(const Scalar& x) - { - return reinterpret_cast(&x)[1]; - } -}; - -template -struct imag_ref_default_impl -{ - static inline Scalar run(Scalar&) - { - return Scalar(0); - } - static inline const Scalar run(const Scalar&) - { - return Scalar(0); - } -}; - -template -struct imag_ref_impl : imag_ref_default_impl::IsComplex> {}; - -template -struct imag_ref_retval -{ - typedef typename NumTraits::Real & type; -}; - -/**************************************************************************** -* Implementation of conj * -****************************************************************************/ - -template::IsComplex> -struct conj_impl -{ - static inline Scalar run(const Scalar& x) - { - return x; - } -}; - -template -struct conj_impl -{ - static inline Scalar run(const Scalar& x) - { - using std::conj; - return conj(x); - } -}; - -template -struct conj_retval -{ - typedef Scalar type; -}; - -/**************************************************************************** -* Implementation of abs2 * -****************************************************************************/ - -template -struct abs2_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x) - { - return x*x; - } -}; - -template -struct abs2_impl > -{ - static inline RealScalar run(const std::complex& x) - { - return real(x)*real(x) + imag(x)*imag(x); - } -}; - -template -struct abs2_retval -{ - typedef typename NumTraits::Real type; -}; - -/**************************************************************************** -* Implementation of norm1 * -****************************************************************************/ - -template -struct norm1_default_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x) - { - using std::abs; - return abs(real(x)) + abs(imag(x)); - } -}; - -template -struct norm1_default_impl -{ - static inline Scalar run(const Scalar& x) - { - using std::abs; - return abs(x); - } -}; - -template -struct norm1_impl : norm1_default_impl::IsComplex> {}; - -template -struct norm1_retval -{ - typedef typename NumTraits::Real type; -}; - -/**************************************************************************** -* Implementation of hypot * -****************************************************************************/ - -template -struct hypot_impl -{ - typedef typename NumTraits::Real RealScalar; - static inline RealScalar run(const Scalar& x, const Scalar& y) - { - using std::max; - using std::min; - using std::abs; - using std::sqrt; - RealScalar _x = abs(x); - RealScalar _y = abs(y); - RealScalar p = (max)(_x, _y); - if(p==RealScalar(0)) return 0; - RealScalar q = (min)(_x, _y); - RealScalar qp = q/p; - return p * sqrt(RealScalar(1) + qp*qp); - } -}; - -template -struct hypot_retval -{ - typedef typename NumTraits::Real type; -}; - -/**************************************************************************** -* Implementation of cast * -****************************************************************************/ - -template -struct cast_impl -{ - static inline NewType run(const OldType& x) - { - return static_cast(x); - } -}; - -// here, for once, we're plainly returning NewType: we don't want cast to do weird things. - -template -inline NewType cast(const OldType& x) -{ - return cast_impl::run(x); -} - -/**************************************************************************** -* Implementation of atanh2 * -****************************************************************************/ - -template -struct atanh2_default_impl -{ - typedef Scalar retval; - typedef typename NumTraits::Real RealScalar; - static inline Scalar run(const Scalar& x, const Scalar& y) - { - using std::abs; - using std::log; - using std::sqrt; - Scalar z = x / y; - if (y == Scalar(0) || abs(z) > sqrt(NumTraits::epsilon())) - return RealScalar(0.5) * log((y + x) / (y - x)); - else - return z + z*z*z / RealScalar(3); - } -}; - -template -struct atanh2_default_impl -{ - static inline Scalar run(const Scalar&, const Scalar&) - { - EIGEN_STATIC_ASSERT_NON_INTEGER(Scalar) - return Scalar(0); - } -}; - -template -struct atanh2_impl : atanh2_default_impl::IsInteger> {}; - -template -struct atanh2_retval -{ - typedef Scalar type; -}; - -/**************************************************************************** -* Implementation of pow * -****************************************************************************/ - -template -struct pow_default_impl -{ - typedef Scalar retval; - static inline Scalar run(const Scalar& x, const Scalar& y) - { - using std::pow; - return pow(x, y); - } -}; - -template -struct pow_default_impl -{ - static inline Scalar run(Scalar x, Scalar y) - { - Scalar res(1); - eigen_assert(!NumTraits::IsSigned || y >= 0); - if(y & 1) res *= x; - y >>= 1; - while(y) - { - x *= x; - if(y&1) res *= x; - y >>= 1; - } - return res; - } -}; - -template -struct pow_impl : pow_default_impl::IsInteger> {}; - -template -struct pow_retval -{ - typedef Scalar type; -}; - -/**************************************************************************** -* Implementation of random * -****************************************************************************/ - -template -struct random_default_impl {}; - -template -struct random_impl : random_default_impl::IsComplex, NumTraits::IsInteger> {}; - -template -struct random_retval -{ - typedef Scalar type; -}; - -template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y); -template inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(); - -template -struct random_default_impl -{ - static inline Scalar run(const Scalar& x, const Scalar& y) - { - return x + (y-x) * Scalar(std::rand()) / Scalar(RAND_MAX); - } - static inline Scalar run() - { - return run(Scalar(NumTraits::IsSigned ? -1 : 0), Scalar(1)); - } -}; - -enum { - floor_log2_terminate, - floor_log2_move_up, - floor_log2_move_down, - floor_log2_bogus -}; - -template struct floor_log2_selector -{ - enum { middle = (lower + upper) / 2, - value = (upper <= lower + 1) ? int(floor_log2_terminate) - : (n < (1 << middle)) ? int(floor_log2_move_down) - : (n==0) ? int(floor_log2_bogus) - : int(floor_log2_move_up) - }; -}; - -template::value> -struct floor_log2 {}; - -template -struct floor_log2 -{ - enum { value = floor_log2::middle>::value }; -}; - -template -struct floor_log2 -{ - enum { value = floor_log2::middle, upper>::value }; -}; - -template -struct floor_log2 -{ - enum { value = (n >= ((unsigned int)(1) << (lower+1))) ? lower+1 : lower }; -}; - -template -struct floor_log2 -{ - // no value, error at compile time -}; - -template -struct random_default_impl -{ - typedef typename NumTraits::NonInteger NonInteger; - - static inline Scalar run(const Scalar& x, const Scalar& y) - { - return x + Scalar((NonInteger(y)-x+1) * std::rand() / (RAND_MAX + NonInteger(1))); - } - - static inline Scalar run() - { -#ifdef EIGEN_MAKING_DOCS - return run(Scalar(NumTraits::IsSigned ? -10 : 0), Scalar(10)); -#else - enum { rand_bits = floor_log2<(unsigned int)(RAND_MAX)+1>::value, - scalar_bits = sizeof(Scalar) * CHAR_BIT, - shift = EIGEN_PLAIN_ENUM_MAX(0, int(rand_bits) - int(scalar_bits)), - offset = NumTraits::IsSigned ? (1 << (EIGEN_PLAIN_ENUM_MIN(rand_bits,scalar_bits)-1)) : 0 - }; - return Scalar((std::rand() >> shift) - offset); -#endif - } -}; - -template -struct random_default_impl -{ - static inline Scalar run(const Scalar& x, const Scalar& y) - { - return Scalar(random(real(x), real(y)), - random(imag(x), imag(y))); - } - static inline Scalar run() - { - typedef typename NumTraits::Real RealScalar; - return Scalar(random(), random()); - } -}; - -template -inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random(const Scalar& x, const Scalar& y) -{ - return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(x, y); -} - -template -inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() -{ - return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(); -} - -} // end namespace internal - -/**************************************************************************** -* Generic math function * -****************************************************************************/ - -namespace numext { - -template -inline EIGEN_MATHFUNC_RETVAL(real, Scalar) real(const Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(real, Scalar)::run(x); -} - -template -inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) >::type real_ref(const Scalar& x) -{ - return internal::real_ref_impl::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(real_ref, Scalar) real_ref(Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(real_ref, Scalar)::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(imag, Scalar) imag(const Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(imag, Scalar)::run(x); -} - -template -inline typename internal::add_const_on_value_type< EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) >::type imag_ref(const Scalar& x) -{ - return internal::imag_ref_impl::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(imag_ref, Scalar) imag_ref(Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(imag_ref, Scalar)::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(conj, Scalar) conj(const Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(conj, Scalar)::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(abs2, Scalar) abs2(const Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(abs2, Scalar)::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(norm1, Scalar) norm1(const Scalar& x) -{ - return EIGEN_MATHFUNC_IMPL(norm1, Scalar)::run(x); -} - -template -inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y) -{ - return EIGEN_MATHFUNC_IMPL(hypot, Scalar)::run(x, y); -} - -template -inline EIGEN_MATHFUNC_RETVAL(atanh2, Scalar) atanh2(const Scalar& x, const Scalar& y) -{ - return EIGEN_MATHFUNC_IMPL(atanh2, Scalar)::run(x, y); -} - -template -inline EIGEN_MATHFUNC_RETVAL(pow, Scalar) pow(const Scalar& x, const Scalar& y) -{ - return EIGEN_MATHFUNC_IMPL(pow, Scalar)::run(x, y); -} - -// std::isfinite is non standard, so let's define our own version, -// even though it is not very efficient. -template bool (isfinite)(const T& x) -{ - return x::highest() && x>NumTraits::lowest(); -} - -} // end namespace numext - -namespace internal { - -/**************************************************************************** -* Implementation of fuzzy comparisons * -****************************************************************************/ - -template -struct scalar_fuzzy_default_impl {}; - -template -struct scalar_fuzzy_default_impl -{ - typedef typename NumTraits::Real RealScalar; - template - static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) - { - using std::abs; - return abs(x) <= abs(y) * prec; - } - static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) - { - using std::min; - using std::abs; - return abs(x - y) <= (min)(abs(x), abs(y)) * prec; - } - static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar& prec) - { - return x <= y || isApprox(x, y, prec); - } -}; - -template -struct scalar_fuzzy_default_impl -{ - typedef typename NumTraits::Real RealScalar; - template - static inline bool isMuchSmallerThan(const Scalar& x, const Scalar&, const RealScalar&) - { - return x == Scalar(0); - } - static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar&) - { - return x == y; - } - static inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, const RealScalar&) - { - return x <= y; - } -}; - -template -struct scalar_fuzzy_default_impl -{ - typedef typename NumTraits::Real RealScalar; - template - static inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, const RealScalar& prec) - { - return numext::abs2(x) <= numext::abs2(y) * prec * prec; - } - static inline bool isApprox(const Scalar& x, const Scalar& y, const RealScalar& prec) - { - using std::min; - return numext::abs2(x - y) <= (min)(numext::abs2(x), numext::abs2(y)) * prec * prec; - } -}; - -template -struct scalar_fuzzy_impl : scalar_fuzzy_default_impl::IsComplex, NumTraits::IsInteger> {}; - -template -inline bool isMuchSmallerThan(const Scalar& x, const OtherScalar& y, - typename NumTraits::Real precision = NumTraits::dummy_precision()) -{ - return scalar_fuzzy_impl::template isMuchSmallerThan(x, y, precision); -} - -template -inline bool isApprox(const Scalar& x, const Scalar& y, - typename NumTraits::Real precision = NumTraits::dummy_precision()) -{ - return scalar_fuzzy_impl::isApprox(x, y, precision); -} - -template -inline bool isApproxOrLessThan(const Scalar& x, const Scalar& y, - typename NumTraits::Real precision = NumTraits::dummy_precision()) -{ - return scalar_fuzzy_impl::isApproxOrLessThan(x, y, precision); -} - -/****************************************** -*** The special case of the bool type *** -******************************************/ - -template<> struct random_impl -{ - static inline bool run() - { - return random(0,1)==0 ? false : true; - } -}; - -template<> struct scalar_fuzzy_impl -{ - typedef bool RealScalar; - - template - static inline bool isMuchSmallerThan(const bool& x, const bool&, const bool&) - { - return !x; - } - - static inline bool isApprox(bool x, bool y, bool) - { - return x == y; - } - - static inline bool isApproxOrLessThan(const bool& x, const bool& y, const bool&) - { - return (!x) || y; - } - -}; - - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_MATHFUNCTIONS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Matrix.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Matrix.h deleted file mode 100644 index 0ba5d90cc6..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Matrix.h +++ /dev/null @@ -1,405 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2010 Benoit Jacob -// Copyright (C) 2008-2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MATRIX_H -#define EIGEN_MATRIX_H - -namespace Eigen { - -/** \class Matrix - * \ingroup Core_Module - * - * \brief The matrix class, also used for vectors and row-vectors - * - * The %Matrix class is the work-horse for all \em dense (\ref dense "note") matrices and vectors within Eigen. - * Vectors are matrices with one column, and row-vectors are matrices with one row. - * - * The %Matrix class encompasses \em both fixed-size and dynamic-size objects (\ref fixedsize "note"). - * - * The first three template parameters are required: - * \tparam _Scalar \anchor matrix_tparam_scalar Numeric type, e.g. float, double, int or std::complex. - * User defined sclar types are supported as well (see \ref user_defined_scalars "here"). - * \tparam _Rows Number of rows, or \b Dynamic - * \tparam _Cols Number of columns, or \b Dynamic - * - * The remaining template parameters are optional -- in most cases you don't have to worry about them. - * \tparam _Options \anchor matrix_tparam_options A combination of either \b #RowMajor or \b #ColMajor, and of either - * \b #AutoAlign or \b #DontAlign. - * The former controls \ref TopicStorageOrders "storage order", and defaults to column-major. The latter controls alignment, which is required - * for vectorization. It defaults to aligning matrices except for fixed sizes that aren't a multiple of the packet size. - * \tparam _MaxRows Maximum number of rows. Defaults to \a _Rows (\ref maxrows "note"). - * \tparam _MaxCols Maximum number of columns. Defaults to \a _Cols (\ref maxrows "note"). - * - * Eigen provides a number of typedefs covering the usual cases. Here are some examples: - * - * \li \c Matrix2d is a 2x2 square matrix of doubles (\c Matrix) - * \li \c Vector4f is a vector of 4 floats (\c Matrix) - * \li \c RowVector3i is a row-vector of 3 ints (\c Matrix) - * - * \li \c MatrixXf is a dynamic-size matrix of floats (\c Matrix) - * \li \c VectorXf is a dynamic-size vector of floats (\c Matrix) - * - * \li \c Matrix2Xf is a partially fixed-size (dynamic-size) matrix of floats (\c Matrix) - * \li \c MatrixX3d is a partially dynamic-size (fixed-size) matrix of double (\c Matrix) - * - * See \link matrixtypedefs this page \endlink for a complete list of predefined \em %Matrix and \em Vector typedefs. - * - * You can access elements of vectors and matrices using normal subscripting: - * - * \code - * Eigen::VectorXd v(10); - * v[0] = 0.1; - * v[1] = 0.2; - * v(0) = 0.3; - * v(1) = 0.4; - * - * Eigen::MatrixXi m(10, 10); - * m(0, 1) = 1; - * m(0, 2) = 2; - * m(0, 3) = 3; - * \endcode - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_MATRIX_PLUGIN. - * - * Some notes: - * - *
- *
\anchor dense Dense versus sparse:
- *
This %Matrix class handles dense, not sparse matrices and vectors. For sparse matrices and vectors, see the Sparse module. - * - * Dense matrices and vectors are plain usual arrays of coefficients. All the coefficients are stored, in an ordinary contiguous array. - * This is unlike Sparse matrices and vectors where the coefficients are stored as a list of nonzero coefficients.
- * - *
\anchor fixedsize Fixed-size versus dynamic-size:
- *
Fixed-size means that the numbers of rows and columns are known are compile-time. In this case, Eigen allocates the array - * of coefficients as a fixed-size array, as a class member. This makes sense for very small matrices, typically up to 4x4, sometimes up - * to 16x16. Larger matrices should be declared as dynamic-size even if one happens to know their size at compile-time. - * - * Dynamic-size means that the numbers of rows or columns are not necessarily known at compile-time. In this case they are runtime - * variables, and the array of coefficients is allocated dynamically on the heap. - * - * Note that \em dense matrices, be they Fixed-size or Dynamic-size, do not expand dynamically in the sense of a std::map. - * If you want this behavior, see the Sparse module.
- * - *
\anchor maxrows _MaxRows and _MaxCols:
- *
In most cases, one just leaves these parameters to the default values. - * These parameters mean the maximum size of rows and columns that the matrix may have. They are useful in cases - * when the exact numbers of rows and columns are not known are compile-time, but it is known at compile-time that they cannot - * exceed a certain value. This happens when taking dynamic-size blocks inside fixed-size matrices: in this case _MaxRows and _MaxCols - * are the dimensions of the original matrix, while _Rows and _Cols are Dynamic.
- *
- * - * \see MatrixBase for the majority of the API methods for matrices, \ref TopicClassHierarchy, - * \ref TopicStorageOrders - */ - -namespace internal { -template -struct traits > -{ - typedef _Scalar Scalar; - typedef Dense StorageKind; - typedef DenseIndex Index; - typedef MatrixXpr XprKind; - enum { - RowsAtCompileTime = _Rows, - ColsAtCompileTime = _Cols, - MaxRowsAtCompileTime = _MaxRows, - MaxColsAtCompileTime = _MaxCols, - Flags = compute_matrix_flags<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::ret, - CoeffReadCost = NumTraits::ReadCost, - Options = _Options, - InnerStrideAtCompileTime = 1, - OuterStrideAtCompileTime = (Options&RowMajor) ? ColsAtCompileTime : RowsAtCompileTime - }; -}; -} - -template -class Matrix - : public PlainObjectBase > -{ - public: - - /** \brief Base class typedef. - * \sa PlainObjectBase - */ - typedef PlainObjectBase Base; - - enum { Options = _Options }; - - EIGEN_DENSE_PUBLIC_INTERFACE(Matrix) - - typedef typename Base::PlainObject PlainObject; - - using Base::base; - using Base::coeffRef; - - /** - * \brief Assigns matrices to each other. - * - * \note This is a special case of the templated operator=. Its purpose is - * to prevent a default operator= from hiding the templated operator=. - * - * \callgraph - */ - EIGEN_STRONG_INLINE Matrix& operator=(const Matrix& other) - { - return Base::_set(other); - } - - /** \internal - * \brief Copies the value of the expression \a other into \c *this with automatic resizing. - * - * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), - * it will be initialized. - * - * Note that copying a row-vector into a vector (and conversely) is allowed. - * The resizing, if any, is then done in the appropriate way so that row-vectors - * remain row-vectors and vectors remain vectors. - */ - template - EIGEN_STRONG_INLINE Matrix& operator=(const MatrixBase& other) - { - return Base::_set(other); - } - - /* Here, doxygen failed to copy the brief information when using \copydoc */ - - /** - * \brief Copies the generic expression \a other into *this. - * \copydetails DenseBase::operator=(const EigenBase &other) - */ - template - EIGEN_STRONG_INLINE Matrix& operator=(const EigenBase &other) - { - return Base::operator=(other); - } - - template - EIGEN_STRONG_INLINE Matrix& operator=(const ReturnByValue& func) - { - return Base::operator=(func); - } - - /** \brief Default constructor. - * - * For fixed-size matrices, does nothing. - * - * For dynamic-size matrices, creates an empty matrix of size 0. Does not allocate any array. Such a matrix - * is called a null matrix. This constructor is the unique way to create null matrices: resizing - * a matrix to 0 is not supported. - * - * \sa resize(Index,Index) - */ - EIGEN_STRONG_INLINE Matrix() : Base() - { - Base::_check_template_params(); - EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - - // FIXME is it still needed - Matrix(internal::constructor_without_unaligned_array_assert) - : Base(internal::constructor_without_unaligned_array_assert()) - { Base::_check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED } - - /** \brief Constructs a vector or row-vector with given dimension. \only_for_vectors - * - * Note that this is only useful for dynamic-size vectors. For fixed-size vectors, - * it is redundant to pass the dimension here, so it makes more sense to use the default - * constructor Matrix() instead. - */ - EIGEN_STRONG_INLINE explicit Matrix(Index dim) - : Base(dim, RowsAtCompileTime == 1 ? 1 : dim, ColsAtCompileTime == 1 ? 1 : dim) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_ONLY(Matrix) - eigen_assert(dim >= 0); - eigen_assert(SizeAtCompileTime == Dynamic || SizeAtCompileTime == dim); - EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - EIGEN_STRONG_INLINE Matrix(const T0& x, const T1& y) - { - Base::_check_template_params(); - Base::template _init2(x, y); - } - #else - /** \brief Constructs an uninitialized matrix with \a rows rows and \a cols columns. - * - * This is useful for dynamic-size matrices. For fixed-size matrices, - * it is redundant to pass these parameters, so one should use the default constructor - * Matrix() instead. */ - Matrix(Index rows, Index cols); - /** \brief Constructs an initialized 2D vector with given coefficients */ - Matrix(const Scalar& x, const Scalar& y); - #endif - - /** \brief Constructs an initialized 3D vector with given coefficients */ - EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 3) - m_storage.data()[0] = x; - m_storage.data()[1] = y; - m_storage.data()[2] = z; - } - /** \brief Constructs an initialized 4D vector with given coefficients */ - EIGEN_STRONG_INLINE Matrix(const Scalar& x, const Scalar& y, const Scalar& z, const Scalar& w) - { - Base::_check_template_params(); - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(Matrix, 4) - m_storage.data()[0] = x; - m_storage.data()[1] = y; - m_storage.data()[2] = z; - m_storage.data()[3] = w; - } - - explicit Matrix(const Scalar *data); - - /** \brief Constructor copying the value of the expression \a other */ - template - EIGEN_STRONG_INLINE Matrix(const MatrixBase& other) - : Base(other.rows() * other.cols(), other.rows(), other.cols()) - { - // This test resides here, to bring the error messages closer to the user. Normally, these checks - // are performed deeply within the library, thus causing long and scary error traces. - EIGEN_STATIC_ASSERT((internal::is_same::value), - YOU_MIXED_DIFFERENT_NUMERIC_TYPES__YOU_NEED_TO_USE_THE_CAST_METHOD_OF_MATRIXBASE_TO_CAST_NUMERIC_TYPES_EXPLICITLY) - - Base::_check_template_params(); - Base::_set_noalias(other); - } - /** \brief Copy constructor */ - EIGEN_STRONG_INLINE Matrix(const Matrix& other) - : Base(other.rows() * other.cols(), other.rows(), other.cols()) - { - Base::_check_template_params(); - Base::_set_noalias(other); - } - /** \brief Copy constructor with in-place evaluation */ - template - EIGEN_STRONG_INLINE Matrix(const ReturnByValue& other) - { - Base::_check_template_params(); - Base::resize(other.rows(), other.cols()); - other.evalTo(*this); - } - - /** \brief Copy constructor for generic expressions. - * \sa MatrixBase::operator=(const EigenBase&) - */ - template - EIGEN_STRONG_INLINE Matrix(const EigenBase &other) - : Base(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols()) - { - Base::_check_template_params(); - Base::resize(other.rows(), other.cols()); - // FIXME/CHECK: isn't *this = other.derived() more efficient. it allows to - // go for pure _set() implementations, right? - *this = other; - } - - /** \internal - * \brief Override MatrixBase::swap() since for dynamic-sized matrices - * of same type it is enough to swap the data pointers. - */ - template - void swap(MatrixBase const & other) - { this->_swap(other.derived()); } - - inline Index innerStride() const { return 1; } - inline Index outerStride() const { return this->innerSize(); } - - /////////// Geometry module /////////// - - template - explicit Matrix(const RotationBase& r); - template - Matrix& operator=(const RotationBase& r); - - #ifdef EIGEN2_SUPPORT - template - explicit Matrix(const eigen2_RotationBase& r); - template - Matrix& operator=(const eigen2_RotationBase& r); - #endif - - // allow to extend Matrix outside Eigen - #ifdef EIGEN_MATRIX_PLUGIN - #include EIGEN_MATRIX_PLUGIN - #endif - - protected: - template - friend struct internal::conservative_resize_like_impl; - - using Base::m_storage; -}; - -/** \defgroup matrixtypedefs Global matrix typedefs - * - * \ingroup Core_Module - * - * Eigen defines several typedef shortcuts for most common matrix and vector types. - * - * The general patterns are the following: - * - * \c MatrixSizeType where \c Size can be \c 2,\c 3,\c 4 for fixed size square matrices or \c X for dynamic size, - * and where \c Type can be \c i for integer, \c f for float, \c d for double, \c cf for complex float, \c cd - * for complex double. - * - * For example, \c Matrix3d is a fixed-size 3x3 matrix type of doubles, and \c MatrixXf is a dynamic-size matrix of floats. - * - * There are also \c VectorSizeType and \c RowVectorSizeType which are self-explanatory. For example, \c Vector4cf is - * a fixed-size vector of 4 complex floats. - * - * \sa class Matrix - */ - -#define EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Size, SizeSuffix) \ -/** \ingroup matrixtypedefs */ \ -typedef Matrix Matrix##SizeSuffix##TypeSuffix; \ -/** \ingroup matrixtypedefs */ \ -typedef Matrix Vector##SizeSuffix##TypeSuffix; \ -/** \ingroup matrixtypedefs */ \ -typedef Matrix RowVector##SizeSuffix##TypeSuffix; - -#define EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, Size) \ -/** \ingroup matrixtypedefs */ \ -typedef Matrix Matrix##Size##X##TypeSuffix; \ -/** \ingroup matrixtypedefs */ \ -typedef Matrix Matrix##X##Size##TypeSuffix; - -#define EIGEN_MAKE_TYPEDEFS_ALL_SIZES(Type, TypeSuffix) \ -EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 2, 2) \ -EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 3, 3) \ -EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, 4, 4) \ -EIGEN_MAKE_TYPEDEFS(Type, TypeSuffix, Dynamic, X) \ -EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 2) \ -EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 3) \ -EIGEN_MAKE_FIXED_TYPEDEFS(Type, TypeSuffix, 4) - -EIGEN_MAKE_TYPEDEFS_ALL_SIZES(int, i) -EIGEN_MAKE_TYPEDEFS_ALL_SIZES(float, f) -EIGEN_MAKE_TYPEDEFS_ALL_SIZES(double, d) -EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cf) -EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cd) - -#undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES -#undef EIGEN_MAKE_TYPEDEFS -#undef EIGEN_MAKE_FIXED_TYPEDEFS - -} // end namespace Eigen - -#endif // EIGEN_MATRIX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MatrixBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MatrixBase.h deleted file mode 100644 index 9193b6abb3..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/MatrixBase.h +++ /dev/null @@ -1,515 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2009 Benoit Jacob -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_MATRIXBASE_H -#define EIGEN_MATRIXBASE_H - -namespace Eigen { - -/** \class MatrixBase - * \ingroup Core_Module - * - * \brief Base class for all dense matrices, vectors, and expressions - * - * This class is the base that is inherited by all matrix, vector, and related expression - * types. Most of the Eigen API is contained in this class, and its base classes. Other important - * classes for the Eigen API are Matrix, and VectorwiseOp. - * - * Note that some methods are defined in other modules such as the \ref LU_Module LU module - * for all functions related to matrix inversions. - * - * \tparam Derived is the derived type, e.g. a matrix type, or an expression, etc. - * - * When writing a function taking Eigen objects as argument, if you want your function - * to take as argument any matrix, vector, or expression, just let it take a - * MatrixBase argument. As an example, here is a function printFirstRow which, given - * a matrix, vector, or expression \a x, prints the first row of \a x. - * - * \code - template - void printFirstRow(const Eigen::MatrixBase& x) - { - cout << x.row(0) << endl; - } - * \endcode - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_MATRIXBASE_PLUGIN. - * - * \sa \ref TopicClassHierarchy - */ -template class MatrixBase - : public DenseBase -{ - public: -#ifndef EIGEN_PARSED_BY_DOXYGEN - typedef MatrixBase StorageBaseType; - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - - typedef DenseBase Base; - using Base::RowsAtCompileTime; - using Base::ColsAtCompileTime; - using Base::SizeAtCompileTime; - using Base::MaxRowsAtCompileTime; - using Base::MaxColsAtCompileTime; - using Base::MaxSizeAtCompileTime; - using Base::IsVectorAtCompileTime; - using Base::Flags; - using Base::CoeffReadCost; - - using Base::derived; - using Base::const_cast_derived; - using Base::rows; - using Base::cols; - using Base::size; - using Base::coeff; - using Base::coeffRef; - using Base::lazyAssign; - using Base::eval; - using Base::operator+=; - using Base::operator-=; - using Base::operator*=; - using Base::operator/=; - - typedef typename Base::CoeffReturnType CoeffReturnType; - typedef typename Base::ConstTransposeReturnType ConstTransposeReturnType; - typedef typename Base::RowXpr RowXpr; - typedef typename Base::ColXpr ColXpr; -#endif // not EIGEN_PARSED_BY_DOXYGEN - - - -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** type of the equivalent square matrix */ - typedef Matrix SquareMatrixType; -#endif // not EIGEN_PARSED_BY_DOXYGEN - - /** \returns the size of the main diagonal, which is min(rows(),cols()). - * \sa rows(), cols(), SizeAtCompileTime. */ - inline Index diagonalSize() const { return (std::min)(rows(),cols()); } - - /** \brief The plain matrix type corresponding to this expression. - * - * This is not necessarily exactly the return type of eval(). In the case of plain matrices, - * the return type of eval() is a const reference to a matrix, not a matrix! It is however guaranteed - * that the return type of eval() is either PlainObject or const PlainObject&. - */ - typedef Matrix::Scalar, - internal::traits::RowsAtCompileTime, - internal::traits::ColsAtCompileTime, - AutoAlign | (internal::traits::Flags&RowMajorBit ? RowMajor : ColMajor), - internal::traits::MaxRowsAtCompileTime, - internal::traits::MaxColsAtCompileTime - > PlainObject; - -#ifndef EIGEN_PARSED_BY_DOXYGEN - /** \internal Represents a matrix with all coefficients equal to one another*/ - typedef CwiseNullaryOp,Derived> ConstantReturnType; - /** \internal the return type of MatrixBase::adjoint() */ - typedef typename internal::conditional::IsComplex, - CwiseUnaryOp, ConstTransposeReturnType>, - ConstTransposeReturnType - >::type AdjointReturnType; - /** \internal Return type of eigenvalues() */ - typedef Matrix, internal::traits::ColsAtCompileTime, 1, ColMajor> EigenvaluesReturnType; - /** \internal the return type of identity */ - typedef CwiseNullaryOp,Derived> IdentityReturnType; - /** \internal the return type of unit vectors */ - typedef Block, SquareMatrixType>, - internal::traits::RowsAtCompileTime, - internal::traits::ColsAtCompileTime> BasisReturnType; -#endif // not EIGEN_PARSED_BY_DOXYGEN - -#define EIGEN_CURRENT_STORAGE_BASE_CLASS Eigen::MatrixBase -# include "../plugins/CommonCwiseUnaryOps.h" -# include "../plugins/CommonCwiseBinaryOps.h" -# include "../plugins/MatrixCwiseUnaryOps.h" -# include "../plugins/MatrixCwiseBinaryOps.h" -# ifdef EIGEN_MATRIXBASE_PLUGIN -# include EIGEN_MATRIXBASE_PLUGIN -# endif -#undef EIGEN_CURRENT_STORAGE_BASE_CLASS - - /** Special case of the template operator=, in order to prevent the compiler - * from generating a default operator= (issue hit with g++ 4.1) - */ - Derived& operator=(const MatrixBase& other); - - // We cannot inherit here via Base::operator= since it is causing - // trouble with MSVC. - - template - Derived& operator=(const DenseBase& other); - - template - Derived& operator=(const EigenBase& other); - - template - Derived& operator=(const ReturnByValue& other); - -#ifndef EIGEN_PARSED_BY_DOXYGEN - template - Derived& lazyAssign(const ProductBase& other); - - template - Derived& lazyAssign(const MatrixPowerProduct& other); -#endif // not EIGEN_PARSED_BY_DOXYGEN - - template - Derived& operator+=(const MatrixBase& other); - template - Derived& operator-=(const MatrixBase& other); - - template - const typename ProductReturnType::Type - operator*(const MatrixBase &other) const; - - template - const typename LazyProductReturnType::Type - lazyProduct(const MatrixBase &other) const; - - template - Derived& operator*=(const EigenBase& other); - - template - void applyOnTheLeft(const EigenBase& other); - - template - void applyOnTheRight(const EigenBase& other); - - template - const DiagonalProduct - operator*(const DiagonalBase &diagonal) const; - - template - typename internal::scalar_product_traits::Scalar,typename internal::traits::Scalar>::ReturnType - dot(const MatrixBase& other) const; - - #ifdef EIGEN2_SUPPORT - template - Scalar eigen2_dot(const MatrixBase& other) const; - #endif - - RealScalar squaredNorm() const; - RealScalar norm() const; - RealScalar stableNorm() const; - RealScalar blueNorm() const; - RealScalar hypotNorm() const; - const PlainObject normalized() const; - void normalize(); - - const AdjointReturnType adjoint() const; - void adjointInPlace(); - - typedef Diagonal DiagonalReturnType; - DiagonalReturnType diagonal(); - typedef typename internal::add_const >::type ConstDiagonalReturnType; - ConstDiagonalReturnType diagonal() const; - - template struct DiagonalIndexReturnType { typedef Diagonal Type; }; - template struct ConstDiagonalIndexReturnType { typedef const Diagonal Type; }; - - template typename DiagonalIndexReturnType::Type diagonal(); - template typename ConstDiagonalIndexReturnType::Type diagonal() const; - - // Note: The "MatrixBase::" prefixes are added to help MSVC9 to match these declarations with the later implementations. - // On the other hand they confuse MSVC8... - #if (defined _MSC_VER) && (_MSC_VER >= 1500) // 2008 or later - typename MatrixBase::template DiagonalIndexReturnType::Type diagonal(Index index); - typename MatrixBase::template ConstDiagonalIndexReturnType::Type diagonal(Index index) const; - #else - typename DiagonalIndexReturnType::Type diagonal(Index index); - typename ConstDiagonalIndexReturnType::Type diagonal(Index index) const; - #endif - - #ifdef EIGEN2_SUPPORT - template typename internal::eigen2_part_return_type::type part(); - template const typename internal::eigen2_part_return_type::type part() const; - - // huuuge hack. make Eigen2's matrix.part() work in eigen3. Problem: Diagonal is now a class template instead - // of an integer constant. Solution: overload the part() method template wrt template parameters list. - template class U> - const DiagonalWrapper part() const - { return diagonal().asDiagonal(); } - #endif // EIGEN2_SUPPORT - - template struct TriangularViewReturnType { typedef TriangularView Type; }; - template struct ConstTriangularViewReturnType { typedef const TriangularView Type; }; - - template typename TriangularViewReturnType::Type triangularView(); - template typename ConstTriangularViewReturnType::Type triangularView() const; - - template struct SelfAdjointViewReturnType { typedef SelfAdjointView Type; }; - template struct ConstSelfAdjointViewReturnType { typedef const SelfAdjointView Type; }; - - template typename SelfAdjointViewReturnType::Type selfadjointView(); - template typename ConstSelfAdjointViewReturnType::Type selfadjointView() const; - - const SparseView sparseView(const Scalar& m_reference = Scalar(0), - const typename NumTraits::Real& m_epsilon = NumTraits::dummy_precision()) const; - static const IdentityReturnType Identity(); - static const IdentityReturnType Identity(Index rows, Index cols); - static const BasisReturnType Unit(Index size, Index i); - static const BasisReturnType Unit(Index i); - static const BasisReturnType UnitX(); - static const BasisReturnType UnitY(); - static const BasisReturnType UnitZ(); - static const BasisReturnType UnitW(); - - const DiagonalWrapper asDiagonal() const; - const PermutationWrapper asPermutation() const; - - Derived& setIdentity(); - Derived& setIdentity(Index rows, Index cols); - - bool isIdentity(const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isDiagonal(const RealScalar& prec = NumTraits::dummy_precision()) const; - - bool isUpperTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isLowerTriangular(const RealScalar& prec = NumTraits::dummy_precision()) const; - - template - bool isOrthogonal(const MatrixBase& other, - const RealScalar& prec = NumTraits::dummy_precision()) const; - bool isUnitary(const RealScalar& prec = NumTraits::dummy_precision()) const; - - /** \returns true if each coefficients of \c *this and \a other are all exactly equal. - * \warning When using floating point scalar values you probably should rather use a - * fuzzy comparison such as isApprox() - * \sa isApprox(), operator!= */ - template - inline bool operator==(const MatrixBase& other) const - { return cwiseEqual(other).all(); } - - /** \returns true if at least one pair of coefficients of \c *this and \a other are not exactly equal to each other. - * \warning When using floating point scalar values you probably should rather use a - * fuzzy comparison such as isApprox() - * \sa isApprox(), operator== */ - template - inline bool operator!=(const MatrixBase& other) const - { return cwiseNotEqual(other).any(); } - - NoAlias noalias(); - - inline const ForceAlignedAccess forceAlignedAccess() const; - inline ForceAlignedAccess forceAlignedAccess(); - template inline typename internal::add_const_on_value_type,Derived&>::type>::type forceAlignedAccessIf() const; - template inline typename internal::conditional,Derived&>::type forceAlignedAccessIf(); - - Scalar trace() const; - -/////////// Array module /////////// - - template RealScalar lpNorm() const; - - MatrixBase& matrix() { return *this; } - const MatrixBase& matrix() const { return *this; } - - /** \returns an \link Eigen::ArrayBase Array \endlink expression of this matrix - * \sa ArrayBase::matrix() */ - ArrayWrapper array() { return derived(); } - const ArrayWrapper array() const { return derived(); } - -/////////// LU module /////////// - - const FullPivLU fullPivLu() const; - const PartialPivLU partialPivLu() const; - - #if EIGEN2_SUPPORT_STAGE < STAGE20_RESOLVE_API_CONFLICTS - const LU lu() const; - #endif - - #ifdef EIGEN2_SUPPORT - const LU eigen2_lu() const; - #endif - - #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS - const PartialPivLU lu() const; - #endif - - #ifdef EIGEN2_SUPPORT - template - void computeInverse(MatrixBase *result) const { - *result = this->inverse(); - } - #endif - - const internal::inverse_impl inverse() const; - template - void computeInverseAndDetWithCheck( - ResultType& inverse, - typename ResultType::Scalar& determinant, - bool& invertible, - const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() - ) const; - template - void computeInverseWithCheck( - ResultType& inverse, - bool& invertible, - const RealScalar& absDeterminantThreshold = NumTraits::dummy_precision() - ) const; - Scalar determinant() const; - -/////////// Cholesky module /////////// - - const LLT llt() const; - const LDLT ldlt() const; - -/////////// QR module /////////// - - const HouseholderQR householderQr() const; - const ColPivHouseholderQR colPivHouseholderQr() const; - const FullPivHouseholderQR fullPivHouseholderQr() const; - - #ifdef EIGEN2_SUPPORT - const QR qr() const; - #endif - - EigenvaluesReturnType eigenvalues() const; - RealScalar operatorNorm() const; - -/////////// SVD module /////////// - - JacobiSVD jacobiSvd(unsigned int computationOptions = 0) const; - - #ifdef EIGEN2_SUPPORT - SVD svd() const; - #endif - -/////////// Geometry module /////////// - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /// \internal helper struct to form the return type of the cross product - template struct cross_product_return_type { - typedef typename internal::scalar_product_traits::Scalar,typename internal::traits::Scalar>::ReturnType Scalar; - typedef Matrix type; - }; - #endif // EIGEN_PARSED_BY_DOXYGEN - template - typename cross_product_return_type::type - cross(const MatrixBase& other) const; - template - PlainObject cross3(const MatrixBase& other) const; - PlainObject unitOrthogonal(void) const; - Matrix eulerAngles(Index a0, Index a1, Index a2) const; - - #if EIGEN2_SUPPORT_STAGE > STAGE20_RESOLVE_API_CONFLICTS - ScalarMultipleReturnType operator*(const UniformScaling& s) const; - // put this as separate enum value to work around possible GCC 4.3 bug (?) - enum { HomogeneousReturnTypeDirection = ColsAtCompileTime==1?Vertical:Horizontal }; - typedef Homogeneous HomogeneousReturnType; - HomogeneousReturnType homogeneous() const; - #endif - - enum { - SizeMinusOne = SizeAtCompileTime==Dynamic ? Dynamic : SizeAtCompileTime-1 - }; - typedef Block::ColsAtCompileTime==1 ? SizeMinusOne : 1, - internal::traits::ColsAtCompileTime==1 ? 1 : SizeMinusOne> ConstStartMinusOne; - typedef CwiseUnaryOp::Scalar>, - const ConstStartMinusOne > HNormalizedReturnType; - - const HNormalizedReturnType hnormalized() const; - -////////// Householder module /////////// - - void makeHouseholderInPlace(Scalar& tau, RealScalar& beta); - template - void makeHouseholder(EssentialPart& essential, - Scalar& tau, RealScalar& beta) const; - template - void applyHouseholderOnTheLeft(const EssentialPart& essential, - const Scalar& tau, - Scalar* workspace); - template - void applyHouseholderOnTheRight(const EssentialPart& essential, - const Scalar& tau, - Scalar* workspace); - -///////// Jacobi module ///////// - - template - void applyOnTheLeft(Index p, Index q, const JacobiRotation& j); - template - void applyOnTheRight(Index p, Index q, const JacobiRotation& j); - -///////// MatrixFunctions module ///////// - - typedef typename internal::stem_function::type StemFunction; - const MatrixExponentialReturnValue exp() const; - const MatrixFunctionReturnValue matrixFunction(StemFunction f) const; - const MatrixFunctionReturnValue cosh() const; - const MatrixFunctionReturnValue sinh() const; - const MatrixFunctionReturnValue cos() const; - const MatrixFunctionReturnValue sin() const; - const MatrixSquareRootReturnValue sqrt() const; - const MatrixLogarithmReturnValue log() const; - const MatrixPowerReturnValue pow(const RealScalar& p) const; - -#ifdef EIGEN2_SUPPORT - template - Derived& operator+=(const Flagged, 0, - EvalBeforeAssigningBit>& other); - - template - Derived& operator-=(const Flagged, 0, - EvalBeforeAssigningBit>& other); - - /** \deprecated because .lazy() is deprecated - * Overloaded for cache friendly product evaluation */ - template - Derived& lazyAssign(const Flagged& other) - { return lazyAssign(other._expression()); } - - template - const Flagged marked() const; - const Flagged lazy() const; - - inline const Cwise cwise() const; - inline Cwise cwise(); - - VectorBlock start(Index size); - const VectorBlock start(Index size) const; - VectorBlock end(Index size); - const VectorBlock end(Index size) const; - template VectorBlock start(); - template const VectorBlock start() const; - template VectorBlock end(); - template const VectorBlock end() const; - - Minor minor(Index row, Index col); - const Minor minor(Index row, Index col) const; -#endif - - protected: - MatrixBase() : Base() {} - - private: - explicit MatrixBase(int); - MatrixBase(int,int); - template explicit MatrixBase(const MatrixBase&); - protected: - // mixing arrays and matrices is not legal - template Derived& operator+=(const ArrayBase& ) - {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} - // mixing arrays and matrices is not legal - template Derived& operator-=(const ArrayBase& ) - {EIGEN_STATIC_ASSERT(std::ptrdiff_t(sizeof(typename OtherDerived::Scalar))==-1,YOU_CANNOT_MIX_ARRAYS_AND_MATRICES); return *this;} -}; - -} // end namespace Eigen - -#endif // EIGEN_MATRIXBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NestByValue.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NestByValue.h deleted file mode 100644 index a893b1761b..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NestByValue.h +++ /dev/null @@ -1,111 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_NESTBYVALUE_H -#define EIGEN_NESTBYVALUE_H - -namespace Eigen { - -/** \class NestByValue - * \ingroup Core_Module - * - * \brief Expression which must be nested by value - * - * \param ExpressionType the type of the object of which we are requiring nesting-by-value - * - * This class is the return type of MatrixBase::nestByValue() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::nestByValue() - */ - -namespace internal { -template -struct traits > : public traits -{}; -} - -template class NestByValue - : public internal::dense_xpr_base< NestByValue >::type -{ - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(NestByValue) - - inline NestByValue(const ExpressionType& matrix) : m_expression(matrix) {} - - inline Index rows() const { return m_expression.rows(); } - inline Index cols() const { return m_expression.cols(); } - inline Index outerStride() const { return m_expression.outerStride(); } - inline Index innerStride() const { return m_expression.innerStride(); } - - inline const CoeffReturnType coeff(Index row, Index col) const - { - return m_expression.coeff(row, col); - } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_expression.const_cast_derived().coeffRef(row, col); - } - - inline const CoeffReturnType coeff(Index index) const - { - return m_expression.coeff(index); - } - - inline Scalar& coeffRef(Index index) - { - return m_expression.const_cast_derived().coeffRef(index); - } - - template - inline const PacketScalar packet(Index row, Index col) const - { - return m_expression.template packet(row, col); - } - - template - inline void writePacket(Index row, Index col, const PacketScalar& x) - { - m_expression.const_cast_derived().template writePacket(row, col, x); - } - - template - inline const PacketScalar packet(Index index) const - { - return m_expression.template packet(index); - } - - template - inline void writePacket(Index index, const PacketScalar& x) - { - m_expression.const_cast_derived().template writePacket(index, x); - } - - operator const ExpressionType&() const { return m_expression; } - - protected: - const ExpressionType m_expression; -}; - -/** \returns an expression of the temporary version of *this. - */ -template -inline const NestByValue -DenseBase::nestByValue() const -{ - return NestByValue(derived()); -} - -} // end namespace Eigen - -#endif // EIGEN_NESTBYVALUE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NoAlias.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NoAlias.h deleted file mode 100644 index 768bfb18ca..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NoAlias.h +++ /dev/null @@ -1,134 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_NOALIAS_H -#define EIGEN_NOALIAS_H - -namespace Eigen { - -/** \class NoAlias - * \ingroup Core_Module - * - * \brief Pseudo expression providing an operator = assuming no aliasing - * - * \param ExpressionType the type of the object on which to do the lazy assignment - * - * This class represents an expression with special assignment operators - * assuming no aliasing between the target expression and the source expression. - * More precisely it alloas to bypass the EvalBeforeAssignBit flag of the source expression. - * It is the return type of MatrixBase::noalias() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::noalias() - */ -template class StorageBase> -class NoAlias -{ - typedef typename ExpressionType::Scalar Scalar; - public: - NoAlias(ExpressionType& expression) : m_expression(expression) {} - - /** Behaves like MatrixBase::lazyAssign(other) - * \sa MatrixBase::lazyAssign() */ - template - EIGEN_STRONG_INLINE ExpressionType& operator=(const StorageBase& other) - { return internal::assign_selector::run(m_expression,other.derived()); } - - /** \sa MatrixBase::operator+= */ - template - EIGEN_STRONG_INLINE ExpressionType& operator+=(const StorageBase& other) - { - typedef SelfCwiseBinaryOp, ExpressionType, OtherDerived> SelfAdder; - SelfAdder tmp(m_expression); - typedef typename internal::nested::type OtherDerivedNested; - typedef typename internal::remove_all::type _OtherDerivedNested; - internal::assign_selector::run(tmp,OtherDerivedNested(other.derived())); - return m_expression; - } - - /** \sa MatrixBase::operator-= */ - template - EIGEN_STRONG_INLINE ExpressionType& operator-=(const StorageBase& other) - { - typedef SelfCwiseBinaryOp, ExpressionType, OtherDerived> SelfAdder; - SelfAdder tmp(m_expression); - typedef typename internal::nested::type OtherDerivedNested; - typedef typename internal::remove_all::type _OtherDerivedNested; - internal::assign_selector::run(tmp,OtherDerivedNested(other.derived())); - return m_expression; - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - template - EIGEN_STRONG_INLINE ExpressionType& operator+=(const ProductBase& other) - { other.derived().addTo(m_expression); return m_expression; } - - template - EIGEN_STRONG_INLINE ExpressionType& operator-=(const ProductBase& other) - { other.derived().subTo(m_expression); return m_expression; } - - template - EIGEN_STRONG_INLINE ExpressionType& operator+=(const CoeffBasedProduct& other) - { return m_expression.derived() += CoeffBasedProduct(other.lhs(), other.rhs()); } - - template - EIGEN_STRONG_INLINE ExpressionType& operator-=(const CoeffBasedProduct& other) - { return m_expression.derived() -= CoeffBasedProduct(other.lhs(), other.rhs()); } - - template - ExpressionType& operator=(const ReturnByValue& func) - { return m_expression = func; } -#endif - - ExpressionType& expression() const - { - return m_expression; - } - - protected: - ExpressionType& m_expression; -}; - -/** \returns a pseudo expression of \c *this with an operator= assuming - * no aliasing between \c *this and the source expression. - * - * More precisely, noalias() allows to bypass the EvalBeforeAssignBit flag. - * Currently, even though several expressions may alias, only product - * expressions have this flag. Therefore, noalias() is only usefull when - * the source expression contains a matrix product. - * - * Here are some examples where noalias is usefull: - * \code - * D.noalias() = A * B; - * D.noalias() += A.transpose() * B; - * D.noalias() -= 2 * A * B.adjoint(); - * \endcode - * - * On the other hand the following example will lead to a \b wrong result: - * \code - * A.noalias() = A * B; - * \endcode - * because the result matrix A is also an operand of the matrix product. Therefore, - * there is no alternative than evaluating A * B in a temporary, that is the default - * behavior when you write: - * \code - * A = A * B; - * \endcode - * - * \sa class NoAlias - */ -template -NoAlias MatrixBase::noalias() -{ - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_NOALIAS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NumTraits.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NumTraits.h deleted file mode 100644 index bac9e50b85..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/NumTraits.h +++ /dev/null @@ -1,150 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_NUMTRAITS_H -#define EIGEN_NUMTRAITS_H - -namespace Eigen { - -/** \class NumTraits - * \ingroup Core_Module - * - * \brief Holds information about the various numeric (i.e. scalar) types allowed by Eigen. - * - * \param T the numeric type at hand - * - * This class stores enums, typedefs and static methods giving information about a numeric type. - * - * The provided data consists of: - * \li A typedef \a Real, giving the "real part" type of \a T. If \a T is already real, - * then \a Real is just a typedef to \a T. If \a T is \c std::complex then \a Real - * is a typedef to \a U. - * \li A typedef \a NonInteger, giving the type that should be used for operations producing non-integral values, - * such as quotients, square roots, etc. If \a T is a floating-point type, then this typedef just gives - * \a T again. Note however that many Eigen functions such as internal::sqrt simply refuse to - * take integers. Outside of a few cases, Eigen doesn't do automatic type promotion. Thus, this typedef is - * only intended as a helper for code that needs to explicitly promote types. - * \li A typedef \a Nested giving the type to use to nest a value inside of the expression tree. If you don't know what - * this means, just use \a T here. - * \li An enum value \a IsComplex. It is equal to 1 if \a T is a \c std::complex - * type, and to 0 otherwise. - * \li An enum value \a IsInteger. It is equal to \c 1 if \a T is an integer type such as \c int, - * and to \c 0 otherwise. - * \li Enum values ReadCost, AddCost and MulCost representing a rough estimate of the number of CPU cycles needed - * to by move / add / mul instructions respectively, assuming the data is already stored in CPU registers. - * Stay vague here. No need to do architecture-specific stuff. - * \li An enum value \a IsSigned. It is equal to \c 1 if \a T is a signed type and to 0 if \a T is unsigned. - * \li An enum value \a RequireInitialization. It is equal to \c 1 if the constructor of the numeric type \a T must - * be called, and to 0 if it is safe not to call it. Default is 0 if \a T is an arithmetic type, and 1 otherwise. - * \li An epsilon() function which, unlike std::numeric_limits::epsilon(), returns a \a Real instead of a \a T. - * \li A dummy_precision() function returning a weak epsilon value. It is mainly used as a default - * value by the fuzzy comparison operators. - * \li highest() and lowest() functions returning the highest and lowest possible values respectively. - */ - -template struct GenericNumTraits -{ - enum { - IsInteger = std::numeric_limits::is_integer, - IsSigned = std::numeric_limits::is_signed, - IsComplex = 0, - RequireInitialization = internal::is_arithmetic::value ? 0 : 1, - ReadCost = 1, - AddCost = 1, - MulCost = 1 - }; - - typedef T Real; - typedef typename internal::conditional< - IsInteger, - typename internal::conditional::type, - T - >::type NonInteger; - typedef T Nested; - - static inline Real epsilon() { return std::numeric_limits::epsilon(); } - static inline Real dummy_precision() - { - // make sure to override this for floating-point types - return Real(0); - } - static inline T highest() { return (std::numeric_limits::max)(); } - static inline T lowest() { return IsInteger ? (std::numeric_limits::min)() : (-(std::numeric_limits::max)()); } - -#ifdef EIGEN2_SUPPORT - enum { - HasFloatingPoint = !IsInteger - }; - typedef NonInteger FloatingPoint; -#endif -}; - -template struct NumTraits : GenericNumTraits -{}; - -template<> struct NumTraits - : GenericNumTraits -{ - static inline float dummy_precision() { return 1e-5f; } -}; - -template<> struct NumTraits : GenericNumTraits -{ - static inline double dummy_precision() { return 1e-12; } -}; - -template<> struct NumTraits - : GenericNumTraits -{ - static inline long double dummy_precision() { return 1e-15l; } -}; - -template struct NumTraits > - : GenericNumTraits > -{ - typedef _Real Real; - enum { - IsComplex = 1, - RequireInitialization = NumTraits<_Real>::RequireInitialization, - ReadCost = 2 * NumTraits<_Real>::ReadCost, - AddCost = 2 * NumTraits::AddCost, - MulCost = 4 * NumTraits::MulCost + 2 * NumTraits::AddCost - }; - - static inline Real epsilon() { return NumTraits::epsilon(); } - static inline Real dummy_precision() { return NumTraits::dummy_precision(); } -}; - -template -struct NumTraits > -{ - typedef Array ArrayType; - typedef typename NumTraits::Real RealScalar; - typedef Array Real; - typedef typename NumTraits::NonInteger NonIntegerScalar; - typedef Array NonInteger; - typedef ArrayType & Nested; - - enum { - IsComplex = NumTraits::IsComplex, - IsInteger = NumTraits::IsInteger, - IsSigned = NumTraits::IsSigned, - RequireInitialization = 1, - ReadCost = ArrayType::SizeAtCompileTime==Dynamic ? Dynamic : ArrayType::SizeAtCompileTime * NumTraits::ReadCost, - AddCost = ArrayType::SizeAtCompileTime==Dynamic ? Dynamic : ArrayType::SizeAtCompileTime * NumTraits::AddCost, - MulCost = ArrayType::SizeAtCompileTime==Dynamic ? Dynamic : ArrayType::SizeAtCompileTime * NumTraits::MulCost - }; - - static inline RealScalar epsilon() { return NumTraits::epsilon(); } - static inline RealScalar dummy_precision() { return NumTraits::dummy_precision(); } -}; - -} // end namespace Eigen - -#endif // EIGEN_NUMTRAITS_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PermutationMatrix.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PermutationMatrix.h deleted file mode 100644 index 4fc5dd3189..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PermutationMatrix.h +++ /dev/null @@ -1,688 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009 Benoit Jacob -// Copyright (C) 2009-2011 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_PERMUTATIONMATRIX_H -#define EIGEN_PERMUTATIONMATRIX_H - -namespace Eigen { - -template class PermutedImpl; - -/** \class PermutationBase - * \ingroup Core_Module - * - * \brief Base class for permutations - * - * \param Derived the derived class - * - * This class is the base class for all expressions representing a permutation matrix, - * internally stored as a vector of integers. - * The convention followed here is that if \f$ \sigma \f$ is a permutation, the corresponding permutation matrix - * \f$ P_\sigma \f$ is such that if \f$ (e_1,\ldots,e_p) \f$ is the canonical basis, we have: - * \f[ P_\sigma(e_i) = e_{\sigma(i)}. \f] - * This convention ensures that for any two permutations \f$ \sigma, \tau \f$, we have: - * \f[ P_{\sigma\circ\tau} = P_\sigma P_\tau. \f] - * - * Permutation matrices are square and invertible. - * - * Notice that in addition to the member functions and operators listed here, there also are non-member - * operator* to multiply any kind of permutation object with any kind of matrix expression (MatrixBase) - * on either side. - * - * \sa class PermutationMatrix, class PermutationWrapper - */ - -namespace internal { - -template -struct permut_matrix_product_retval; -template -struct permut_sparsematrix_product_retval; -enum PermPermProduct_t {PermPermProduct}; - -} // end namespace internal - -template -class PermutationBase : public EigenBase -{ - typedef internal::traits Traits; - typedef EigenBase Base; - public: - - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef typename Traits::IndicesType IndicesType; - enum { - Flags = Traits::Flags, - CoeffReadCost = Traits::CoeffReadCost, - RowsAtCompileTime = Traits::RowsAtCompileTime, - ColsAtCompileTime = Traits::ColsAtCompileTime, - MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime, - MaxColsAtCompileTime = Traits::MaxColsAtCompileTime - }; - typedef typename Traits::Scalar Scalar; - typedef typename Traits::Index Index; - typedef Matrix - DenseMatrixType; - typedef PermutationMatrix - PlainPermutationType; - using Base::derived; - #endif - - /** Copies the other permutation into *this */ - template - Derived& operator=(const PermutationBase& other) - { - indices() = other.indices(); - return derived(); - } - - /** Assignment from the Transpositions \a tr */ - template - Derived& operator=(const TranspositionsBase& tr) - { - setIdentity(tr.size()); - for(Index k=size()-1; k>=0; --k) - applyTranspositionOnTheRight(k,tr.coeff(k)); - return derived(); - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - Derived& operator=(const PermutationBase& other) - { - indices() = other.indices(); - return derived(); - } - #endif - - /** \returns the number of rows */ - inline Index rows() const { return Index(indices().size()); } - - /** \returns the number of columns */ - inline Index cols() const { return Index(indices().size()); } - - /** \returns the size of a side of the respective square matrix, i.e., the number of indices */ - inline Index size() const { return Index(indices().size()); } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - void evalTo(MatrixBase& other) const - { - other.setZero(); - for (int i=0; i=0 && j>=0 && i=0 && j>=0 && i inverse() const - { return derived(); } - /** \returns the tranpose permutation matrix. - * - * \note \note_try_to_help_rvo - */ - inline Transpose transpose() const - { return derived(); } - - /**** multiplication helpers to hopefully get RVO ****/ - - -#ifndef EIGEN_PARSED_BY_DOXYGEN - protected: - template - void assignTranspose(const PermutationBase& other) - { - for (int i=0; i - void assignProduct(const Lhs& lhs, const Rhs& rhs) - { - eigen_assert(lhs.cols() == rhs.rows()); - for (int i=0; i - inline PlainPermutationType operator*(const PermutationBase& other) const - { return PlainPermutationType(internal::PermPermProduct, derived(), other.derived()); } - - /** \returns the product of a permutation with another inverse permutation. - * - * \note \note_try_to_help_rvo - */ - template - inline PlainPermutationType operator*(const Transpose >& other) const - { return PlainPermutationType(internal::PermPermProduct, *this, other.eval()); } - - /** \returns the product of an inverse permutation with another permutation. - * - * \note \note_try_to_help_rvo - */ - template friend - inline PlainPermutationType operator*(const Transpose >& other, const PermutationBase& perm) - { return PlainPermutationType(internal::PermPermProduct, other.eval(), perm); } - - protected: - -}; - -/** \class PermutationMatrix - * \ingroup Core_Module - * - * \brief Permutation matrix - * - * \param SizeAtCompileTime the number of rows/cols, or Dynamic - * \param MaxSizeAtCompileTime the maximum number of rows/cols, or Dynamic. This optional parameter defaults to SizeAtCompileTime. Most of the time, you should not have to specify it. - * \param IndexType the interger type of the indices - * - * This class represents a permutation matrix, internally stored as a vector of integers. - * - * \sa class PermutationBase, class PermutationWrapper, class DiagonalMatrix - */ - -namespace internal { -template -struct traits > - : traits > -{ - typedef IndexType Index; - typedef Matrix IndicesType; -}; -} - -template -class PermutationMatrix : public PermutationBase > -{ - typedef PermutationBase Base; - typedef internal::traits Traits; - public: - - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef typename Traits::IndicesType IndicesType; - #endif - - inline PermutationMatrix() - {} - - /** Constructs an uninitialized permutation matrix of given size. - */ - inline PermutationMatrix(int size) : m_indices(size) - {} - - /** Copy constructor. */ - template - inline PermutationMatrix(const PermutationBase& other) - : m_indices(other.indices()) {} - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** Standard copy constructor. Defined only to prevent a default copy constructor - * from hiding the other templated constructor */ - inline PermutationMatrix(const PermutationMatrix& other) : m_indices(other.indices()) {} - #endif - - /** Generic constructor from expression of the indices. The indices - * array has the meaning that the permutations sends each integer i to indices[i]. - * - * \warning It is your responsibility to check that the indices array that you passes actually - * describes a permutation, i.e., each value between 0 and n-1 occurs exactly once, where n is the - * array's size. - */ - template - explicit inline PermutationMatrix(const MatrixBase& a_indices) : m_indices(a_indices) - {} - - /** Convert the Transpositions \a tr to a permutation matrix */ - template - explicit PermutationMatrix(const TranspositionsBase& tr) - : m_indices(tr.size()) - { - *this = tr; - } - - /** Copies the other permutation into *this */ - template - PermutationMatrix& operator=(const PermutationBase& other) - { - m_indices = other.indices(); - return *this; - } - - /** Assignment from the Transpositions \a tr */ - template - PermutationMatrix& operator=(const TranspositionsBase& tr) - { - return Base::operator=(tr.derived()); - } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - PermutationMatrix& operator=(const PermutationMatrix& other) - { - m_indices = other.m_indices; - return *this; - } - #endif - - /** const version of indices(). */ - const IndicesType& indices() const { return m_indices; } - /** \returns a reference to the stored array representing the permutation. */ - IndicesType& indices() { return m_indices; } - - - /**** multiplication helpers to hopefully get RVO ****/ - -#ifndef EIGEN_PARSED_BY_DOXYGEN - template - PermutationMatrix(const Transpose >& other) - : m_indices(other.nestedPermutation().size()) - { - for (int i=0; i - PermutationMatrix(internal::PermPermProduct_t, const Lhs& lhs, const Rhs& rhs) - : m_indices(lhs.indices().size()) - { - Base::assignProduct(lhs,rhs); - } -#endif - - protected: - - IndicesType m_indices; -}; - - -namespace internal { -template -struct traits,_PacketAccess> > - : traits > -{ - typedef IndexType Index; - typedef Map, _PacketAccess> IndicesType; -}; -} - -template -class Map,_PacketAccess> - : public PermutationBase,_PacketAccess> > -{ - typedef PermutationBase Base; - typedef internal::traits Traits; - public: - - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef typename Traits::IndicesType IndicesType; - typedef typename IndicesType::Scalar Index; - #endif - - inline Map(const Index* indicesPtr) - : m_indices(indicesPtr) - {} - - inline Map(const Index* indicesPtr, Index size) - : m_indices(indicesPtr,size) - {} - - /** Copies the other permutation into *this */ - template - Map& operator=(const PermutationBase& other) - { return Base::operator=(other.derived()); } - - /** Assignment from the Transpositions \a tr */ - template - Map& operator=(const TranspositionsBase& tr) - { return Base::operator=(tr.derived()); } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - Map& operator=(const Map& other) - { - m_indices = other.m_indices; - return *this; - } - #endif - - /** const version of indices(). */ - const IndicesType& indices() const { return m_indices; } - /** \returns a reference to the stored array representing the permutation. */ - IndicesType& indices() { return m_indices; } - - protected: - - IndicesType m_indices; -}; - -/** \class PermutationWrapper - * \ingroup Core_Module - * - * \brief Class to view a vector of integers as a permutation matrix - * - * \param _IndicesType the type of the vector of integer (can be any compatible expression) - * - * This class allows to view any vector expression of integers as a permutation matrix. - * - * \sa class PermutationBase, class PermutationMatrix - */ - -struct PermutationStorage {}; - -template class TranspositionsWrapper; -namespace internal { -template -struct traits > -{ - typedef PermutationStorage StorageKind; - typedef typename _IndicesType::Scalar Scalar; - typedef typename _IndicesType::Scalar Index; - typedef _IndicesType IndicesType; - enum { - RowsAtCompileTime = _IndicesType::SizeAtCompileTime, - ColsAtCompileTime = _IndicesType::SizeAtCompileTime, - MaxRowsAtCompileTime = IndicesType::MaxRowsAtCompileTime, - MaxColsAtCompileTime = IndicesType::MaxColsAtCompileTime, - Flags = 0, - CoeffReadCost = _IndicesType::CoeffReadCost - }; -}; -} - -template -class PermutationWrapper : public PermutationBase > -{ - typedef PermutationBase Base; - typedef internal::traits Traits; - public: - - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef typename Traits::IndicesType IndicesType; - #endif - - inline PermutationWrapper(const IndicesType& a_indices) - : m_indices(a_indices) - {} - - /** const version of indices(). */ - const typename internal::remove_all::type& - indices() const { return m_indices; } - - protected: - - typename IndicesType::Nested m_indices; -}; - -/** \returns the matrix with the permutation applied to the columns. - */ -template -inline const internal::permut_matrix_product_retval -operator*(const MatrixBase& matrix, - const PermutationBase &permutation) -{ - return internal::permut_matrix_product_retval - - (permutation.derived(), matrix.derived()); -} - -/** \returns the matrix with the permutation applied to the rows. - */ -template -inline const internal::permut_matrix_product_retval - -operator*(const PermutationBase &permutation, - const MatrixBase& matrix) -{ - return internal::permut_matrix_product_retval - - (permutation.derived(), matrix.derived()); -} - -namespace internal { - -template -struct traits > -{ - typedef typename MatrixType::PlainObject ReturnType; -}; - -template -struct permut_matrix_product_retval - : public ReturnByValue > -{ - typedef typename remove_all::type MatrixTypeNestedCleaned; - typedef typename MatrixType::Index Index; - - permut_matrix_product_retval(const PermutationType& perm, const MatrixType& matrix) - : m_permutation(perm), m_matrix(matrix) - {} - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - template inline void evalTo(Dest& dst) const - { - const Index n = Side==OnTheLeft ? rows() : cols(); - - if(is_same::value && extract_data(dst) == extract_data(m_matrix)) - { - // apply the permutation inplace - Matrix mask(m_permutation.size()); - mask.fill(false); - Index r = 0; - while(r < m_permutation.size()) - { - // search for the next seed - while(r=m_permutation.size()) - break; - // we got one, let's follow it until we are back to the seed - Index k0 = r++; - Index kPrev = k0; - mask.coeffRef(k0) = true; - for(Index k=m_permutation.indices().coeff(k0); k!=k0; k=m_permutation.indices().coeff(k)) - { - Block(dst, k) - .swap(Block - (dst,((Side==OnTheLeft) ^ Transposed) ? k0 : kPrev)); - - mask.coeffRef(k) = true; - kPrev = k; - } - } - } - else - { - for(int i = 0; i < n; ++i) - { - Block - (dst, ((Side==OnTheLeft) ^ Transposed) ? m_permutation.indices().coeff(i) : i) - - = - - Block - (m_matrix, ((Side==OnTheRight) ^ Transposed) ? m_permutation.indices().coeff(i) : i); - } - } - } - - protected: - const PermutationType& m_permutation; - typename MatrixType::Nested m_matrix; -}; - -/* Template partial specialization for transposed/inverse permutations */ - -template -struct traits > > - : traits -{}; - -} // end namespace internal - -template -class Transpose > - : public EigenBase > > -{ - typedef Derived PermutationType; - typedef typename PermutationType::IndicesType IndicesType; - typedef typename PermutationType::PlainPermutationType PlainPermutationType; - public: - - #ifndef EIGEN_PARSED_BY_DOXYGEN - typedef internal::traits Traits; - typedef typename Derived::DenseMatrixType DenseMatrixType; - enum { - Flags = Traits::Flags, - CoeffReadCost = Traits::CoeffReadCost, - RowsAtCompileTime = Traits::RowsAtCompileTime, - ColsAtCompileTime = Traits::ColsAtCompileTime, - MaxRowsAtCompileTime = Traits::MaxRowsAtCompileTime, - MaxColsAtCompileTime = Traits::MaxColsAtCompileTime - }; - typedef typename Traits::Scalar Scalar; - #endif - - Transpose(const PermutationType& p) : m_permutation(p) {} - - inline int rows() const { return m_permutation.rows(); } - inline int cols() const { return m_permutation.cols(); } - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - void evalTo(MatrixBase& other) const - { - other.setZero(); - for (int i=0; i friend - inline const internal::permut_matrix_product_retval - operator*(const MatrixBase& matrix, const Transpose& trPerm) - { - return internal::permut_matrix_product_retval(trPerm.m_permutation, matrix.derived()); - } - - /** \returns the matrix with the inverse permutation applied to the rows. - */ - template - inline const internal::permut_matrix_product_retval - operator*(const MatrixBase& matrix) const - { - return internal::permut_matrix_product_retval(m_permutation, matrix.derived()); - } - - const PermutationType& nestedPermutation() const { return m_permutation; } - - protected: - const PermutationType& m_permutation; -}; - -template -const PermutationWrapper MatrixBase::asPermutation() const -{ - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_PERMUTATIONMATRIX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PlainObjectBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PlainObjectBase.h deleted file mode 100644 index af0a479c76..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/PlainObjectBase.h +++ /dev/null @@ -1,782 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2009 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_DENSESTORAGEBASE_H -#define EIGEN_DENSESTORAGEBASE_H - -#if defined(EIGEN_INITIALIZE_MATRICES_BY_ZERO) -# define EIGEN_INITIALIZE_COEFFS -# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED for(int i=0;i::quiet_NaN(); -#else -# undef EIGEN_INITIALIZE_COEFFS -# define EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED -#endif - -namespace Eigen { - -namespace internal { - -template struct check_rows_cols_for_overflow { - template - static EIGEN_ALWAYS_INLINE void run(Index, Index) - { - } -}; - -template<> struct check_rows_cols_for_overflow { - template - static EIGEN_ALWAYS_INLINE void run(Index rows, Index cols) - { - // http://hg.mozilla.org/mozilla-central/file/6c8a909977d3/xpcom/ds/CheckedInt.h#l242 - // we assume Index is signed - Index max_index = (size_t(1) << (8 * sizeof(Index) - 1)) - 1; // assume Index is signed - bool error = (rows == 0 || cols == 0) ? false - : (rows > max_index / cols); - if (error) - throw_std_bad_alloc(); - } -}; - -template struct conservative_resize_like_impl; - -template struct matrix_swap_impl; - -} // end namespace internal - -/** \class PlainObjectBase - * \brief %Dense storage base class for matrices and arrays. - * - * This class can be extended with the help of the plugin mechanism described on the page - * \ref TopicCustomizingEigen by defining the preprocessor symbol \c EIGEN_PLAINOBJECTBASE_PLUGIN. - * - * \sa \ref TopicClassHierarchy - */ -#ifdef EIGEN_PARSED_BY_DOXYGEN -namespace internal { - -// this is a warkaround to doxygen not being able to understand the inheritence logic -// when it is hidden by the dense_xpr_base helper struct. -template struct dense_xpr_base_dispatcher_for_doxygen;// : public MatrixBase {}; -/** This class is just a workaround for Doxygen and it does not not actually exist. */ -template -struct dense_xpr_base_dispatcher_for_doxygen > - : public MatrixBase > {}; -/** This class is just a workaround for Doxygen and it does not not actually exist. */ -template -struct dense_xpr_base_dispatcher_for_doxygen > - : public ArrayBase > {}; - -} // namespace internal - -template -class PlainObjectBase : public internal::dense_xpr_base_dispatcher_for_doxygen -#else -template -class PlainObjectBase : public internal::dense_xpr_base::type -#endif -{ - public: - enum { Options = internal::traits::Options }; - typedef typename internal::dense_xpr_base::type Base; - - typedef typename internal::traits::StorageKind StorageKind; - typedef typename internal::traits::Index Index; - typedef typename internal::traits::Scalar Scalar; - typedef typename internal::packet_traits::type PacketScalar; - typedef typename NumTraits::Real RealScalar; - typedef Derived DenseType; - - using Base::RowsAtCompileTime; - using Base::ColsAtCompileTime; - using Base::SizeAtCompileTime; - using Base::MaxRowsAtCompileTime; - using Base::MaxColsAtCompileTime; - using Base::MaxSizeAtCompileTime; - using Base::IsVectorAtCompileTime; - using Base::Flags; - - template friend class Eigen::Map; - friend class Eigen::Map; - typedef Eigen::Map MapType; - friend class Eigen::Map; - typedef const Eigen::Map ConstMapType; - friend class Eigen::Map; - typedef Eigen::Map AlignedMapType; - friend class Eigen::Map; - typedef const Eigen::Map ConstAlignedMapType; - template struct StridedMapType { typedef Eigen::Map type; }; - template struct StridedConstMapType { typedef Eigen::Map type; }; - template struct StridedAlignedMapType { typedef Eigen::Map type; }; - template struct StridedConstAlignedMapType { typedef Eigen::Map type; }; - - protected: - DenseStorage m_storage; - - public: - enum { NeedsToAlign = SizeAtCompileTime != Dynamic && (internal::traits::Flags & AlignedBit) != 0 }; - EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF(NeedsToAlign) - - Base& base() { return *static_cast(this); } - const Base& base() const { return *static_cast(this); } - - EIGEN_STRONG_INLINE Index rows() const { return m_storage.rows(); } - EIGEN_STRONG_INLINE Index cols() const { return m_storage.cols(); } - - EIGEN_STRONG_INLINE const Scalar& coeff(Index rowId, Index colId) const - { - if(Flags & RowMajorBit) - return m_storage.data()[colId + rowId * m_storage.cols()]; - else // column-major - return m_storage.data()[rowId + colId * m_storage.rows()]; - } - - EIGEN_STRONG_INLINE const Scalar& coeff(Index index) const - { - return m_storage.data()[index]; - } - - EIGEN_STRONG_INLINE Scalar& coeffRef(Index rowId, Index colId) - { - if(Flags & RowMajorBit) - return m_storage.data()[colId + rowId * m_storage.cols()]; - else // column-major - return m_storage.data()[rowId + colId * m_storage.rows()]; - } - - EIGEN_STRONG_INLINE Scalar& coeffRef(Index index) - { - return m_storage.data()[index]; - } - - EIGEN_STRONG_INLINE const Scalar& coeffRef(Index rowId, Index colId) const - { - if(Flags & RowMajorBit) - return m_storage.data()[colId + rowId * m_storage.cols()]; - else // column-major - return m_storage.data()[rowId + colId * m_storage.rows()]; - } - - EIGEN_STRONG_INLINE const Scalar& coeffRef(Index index) const - { - return m_storage.data()[index]; - } - - /** \internal */ - template - EIGEN_STRONG_INLINE PacketScalar packet(Index rowId, Index colId) const - { - return internal::ploadt - (m_storage.data() + (Flags & RowMajorBit - ? colId + rowId * m_storage.cols() - : rowId + colId * m_storage.rows())); - } - - /** \internal */ - template - EIGEN_STRONG_INLINE PacketScalar packet(Index index) const - { - return internal::ploadt(m_storage.data() + index); - } - - /** \internal */ - template - EIGEN_STRONG_INLINE void writePacket(Index rowId, Index colId, const PacketScalar& val) - { - internal::pstoret - (m_storage.data() + (Flags & RowMajorBit - ? colId + rowId * m_storage.cols() - : rowId + colId * m_storage.rows()), val); - } - - /** \internal */ - template - EIGEN_STRONG_INLINE void writePacket(Index index, const PacketScalar& val) - { - internal::pstoret(m_storage.data() + index, val); - } - - /** \returns a const pointer to the data array of this matrix */ - EIGEN_STRONG_INLINE const Scalar *data() const - { return m_storage.data(); } - - /** \returns a pointer to the data array of this matrix */ - EIGEN_STRONG_INLINE Scalar *data() - { return m_storage.data(); } - - /** Resizes \c *this to a \a rows x \a cols matrix. - * - * This method is intended for dynamic-size matrices, although it is legal to call it on any - * matrix as long as fixed dimensions are left unchanged. If you only want to change the number - * of rows and/or of columns, you can use resize(NoChange_t, Index), resize(Index, NoChange_t). - * - * If the current number of coefficients of \c *this exactly matches the - * product \a rows * \a cols, then no memory allocation is performed and - * the current values are left unchanged. In all other cases, including - * shrinking, the data is reallocated and all previous values are lost. - * - * Example: \include Matrix_resize_int_int.cpp - * Output: \verbinclude Matrix_resize_int_int.out - * - * \sa resize(Index) for vectors, resize(NoChange_t, Index), resize(Index, NoChange_t) - */ - EIGEN_STRONG_INLINE void resize(Index nbRows, Index nbCols) - { - eigen_assert( EIGEN_IMPLIES(RowsAtCompileTime!=Dynamic,nbRows==RowsAtCompileTime) - && EIGEN_IMPLIES(ColsAtCompileTime!=Dynamic,nbCols==ColsAtCompileTime) - && EIGEN_IMPLIES(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic,nbRows<=MaxRowsAtCompileTime) - && EIGEN_IMPLIES(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic,nbCols<=MaxColsAtCompileTime) - && nbRows>=0 && nbCols>=0 && "Invalid sizes when resizing a matrix or array."); - internal::check_rows_cols_for_overflow::run(nbRows, nbCols); - #ifdef EIGEN_INITIALIZE_COEFFS - Index size = nbRows*nbCols; - bool size_changed = size != this->size(); - m_storage.resize(size, nbRows, nbCols); - if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - #else - internal::check_rows_cols_for_overflow::run(nbRows, nbCols); - m_storage.resize(nbRows*nbCols, nbRows, nbCols); - #endif - } - - /** Resizes \c *this to a vector of length \a size - * - * \only_for_vectors. This method does not work for - * partially dynamic matrices when the static dimension is anything other - * than 1. For example it will not work with Matrix. - * - * Example: \include Matrix_resize_int.cpp - * Output: \verbinclude Matrix_resize_int.out - * - * \sa resize(Index,Index), resize(NoChange_t, Index), resize(Index, NoChange_t) - */ - inline void resize(Index size) - { - EIGEN_STATIC_ASSERT_VECTOR_ONLY(PlainObjectBase) - eigen_assert(((SizeAtCompileTime == Dynamic && (MaxSizeAtCompileTime==Dynamic || size<=MaxSizeAtCompileTime)) || SizeAtCompileTime == size) && size>=0); - #ifdef EIGEN_INITIALIZE_COEFFS - bool size_changed = size != this->size(); - #endif - if(RowsAtCompileTime == 1) - m_storage.resize(size, 1, size); - else - m_storage.resize(size, size, 1); - #ifdef EIGEN_INITIALIZE_COEFFS - if(size_changed) EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - #endif - } - - /** Resizes the matrix, changing only the number of columns. For the parameter of type NoChange_t, just pass the special value \c NoChange - * as in the example below. - * - * Example: \include Matrix_resize_NoChange_int.cpp - * Output: \verbinclude Matrix_resize_NoChange_int.out - * - * \sa resize(Index,Index) - */ - inline void resize(NoChange_t, Index nbCols) - { - resize(rows(), nbCols); - } - - /** Resizes the matrix, changing only the number of rows. For the parameter of type NoChange_t, just pass the special value \c NoChange - * as in the example below. - * - * Example: \include Matrix_resize_int_NoChange.cpp - * Output: \verbinclude Matrix_resize_int_NoChange.out - * - * \sa resize(Index,Index) - */ - inline void resize(Index nbRows, NoChange_t) - { - resize(nbRows, cols()); - } - - /** Resizes \c *this to have the same dimensions as \a other. - * Takes care of doing all the checking that's needed. - * - * Note that copying a row-vector into a vector (and conversely) is allowed. - * The resizing, if any, is then done in the appropriate way so that row-vectors - * remain row-vectors and vectors remain vectors. - */ - template - EIGEN_STRONG_INLINE void resizeLike(const EigenBase& _other) - { - const OtherDerived& other = _other.derived(); - internal::check_rows_cols_for_overflow::run(other.rows(), other.cols()); - const Index othersize = other.rows()*other.cols(); - if(RowsAtCompileTime == 1) - { - eigen_assert(other.rows() == 1 || other.cols() == 1); - resize(1, othersize); - } - else if(ColsAtCompileTime == 1) - { - eigen_assert(other.rows() == 1 || other.cols() == 1); - resize(othersize, 1); - } - else resize(other.rows(), other.cols()); - } - - /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. - * - * The method is intended for matrices of dynamic size. If you only want to change the number - * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or - * conservativeResize(Index, NoChange_t). - * - * Matrices are resized relative to the top-left element. In case values need to be - * appended to the matrix they will be uninitialized. - */ - EIGEN_STRONG_INLINE void conservativeResize(Index nbRows, Index nbCols) - { - internal::conservative_resize_like_impl::run(*this, nbRows, nbCols); - } - - /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. - * - * As opposed to conservativeResize(Index rows, Index cols), this version leaves - * the number of columns unchanged. - * - * In case the matrix is growing, new rows will be uninitialized. - */ - EIGEN_STRONG_INLINE void conservativeResize(Index nbRows, NoChange_t) - { - // Note: see the comment in conservativeResize(Index,Index) - conservativeResize(nbRows, cols()); - } - - /** Resizes the matrix to \a rows x \a cols while leaving old values untouched. - * - * As opposed to conservativeResize(Index rows, Index cols), this version leaves - * the number of rows unchanged. - * - * In case the matrix is growing, new columns will be uninitialized. - */ - EIGEN_STRONG_INLINE void conservativeResize(NoChange_t, Index nbCols) - { - // Note: see the comment in conservativeResize(Index,Index) - conservativeResize(rows(), nbCols); - } - - /** Resizes the vector to \a size while retaining old values. - * - * \only_for_vectors. This method does not work for - * partially dynamic matrices when the static dimension is anything other - * than 1. For example it will not work with Matrix. - * - * When values are appended, they will be uninitialized. - */ - EIGEN_STRONG_INLINE void conservativeResize(Index size) - { - internal::conservative_resize_like_impl::run(*this, size); - } - - /** Resizes the matrix to \a rows x \a cols of \c other, while leaving old values untouched. - * - * The method is intended for matrices of dynamic size. If you only want to change the number - * of rows and/or of columns, you can use conservativeResize(NoChange_t, Index) or - * conservativeResize(Index, NoChange_t). - * - * Matrices are resized relative to the top-left element. In case values need to be - * appended to the matrix they will copied from \c other. - */ - template - EIGEN_STRONG_INLINE void conservativeResizeLike(const DenseBase& other) - { - internal::conservative_resize_like_impl::run(*this, other); - } - - /** This is a special case of the templated operator=. Its purpose is to - * prevent a default operator= from hiding the templated operator=. - */ - EIGEN_STRONG_INLINE Derived& operator=(const PlainObjectBase& other) - { - return _set(other); - } - - /** \sa MatrixBase::lazyAssign() */ - template - EIGEN_STRONG_INLINE Derived& lazyAssign(const DenseBase& other) - { - _resize_to_match(other); - return Base::lazyAssign(other.derived()); - } - - template - EIGEN_STRONG_INLINE Derived& operator=(const ReturnByValue& func) - { - resize(func.rows(), func.cols()); - return Base::operator=(func); - } - - EIGEN_STRONG_INLINE PlainObjectBase() : m_storage() - { -// _check_template_params(); -// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - -#ifndef EIGEN_PARSED_BY_DOXYGEN - // FIXME is it still needed ? - /** \internal */ - PlainObjectBase(internal::constructor_without_unaligned_array_assert) - : m_storage(internal::constructor_without_unaligned_array_assert()) - { -// _check_template_params(); EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } -#endif - - EIGEN_STRONG_INLINE PlainObjectBase(Index a_size, Index nbRows, Index nbCols) - : m_storage(a_size, nbRows, nbCols) - { -// _check_template_params(); -// EIGEN_INITIALIZE_COEFFS_IF_THAT_OPTION_IS_ENABLED - } - - /** \copydoc MatrixBase::operator=(const EigenBase&) - */ - template - EIGEN_STRONG_INLINE Derived& operator=(const EigenBase &other) - { - _resize_to_match(other); - Base::operator=(other.derived()); - return this->derived(); - } - - /** \sa MatrixBase::operator=(const EigenBase&) */ - template - EIGEN_STRONG_INLINE PlainObjectBase(const EigenBase &other) - : m_storage(other.derived().rows() * other.derived().cols(), other.derived().rows(), other.derived().cols()) - { - _check_template_params(); - internal::check_rows_cols_for_overflow::run(other.derived().rows(), other.derived().cols()); - Base::operator=(other.derived()); - } - - /** \name Map - * These are convenience functions returning Map objects. The Map() static functions return unaligned Map objects, - * while the AlignedMap() functions return aligned Map objects and thus should be called only with 16-byte-aligned - * \a data pointers. - * - * \see class Map - */ - //@{ - static inline ConstMapType Map(const Scalar* data) - { return ConstMapType(data); } - static inline MapType Map(Scalar* data) - { return MapType(data); } - static inline ConstMapType Map(const Scalar* data, Index size) - { return ConstMapType(data, size); } - static inline MapType Map(Scalar* data, Index size) - { return MapType(data, size); } - static inline ConstMapType Map(const Scalar* data, Index rows, Index cols) - { return ConstMapType(data, rows, cols); } - static inline MapType Map(Scalar* data, Index rows, Index cols) - { return MapType(data, rows, cols); } - - static inline ConstAlignedMapType MapAligned(const Scalar* data) - { return ConstAlignedMapType(data); } - static inline AlignedMapType MapAligned(Scalar* data) - { return AlignedMapType(data); } - static inline ConstAlignedMapType MapAligned(const Scalar* data, Index size) - { return ConstAlignedMapType(data, size); } - static inline AlignedMapType MapAligned(Scalar* data, Index size) - { return AlignedMapType(data, size); } - static inline ConstAlignedMapType MapAligned(const Scalar* data, Index rows, Index cols) - { return ConstAlignedMapType(data, rows, cols); } - static inline AlignedMapType MapAligned(Scalar* data, Index rows, Index cols) - { return AlignedMapType(data, rows, cols); } - - template - static inline typename StridedConstMapType >::type Map(const Scalar* data, const Stride& stride) - { return typename StridedConstMapType >::type(data, stride); } - template - static inline typename StridedMapType >::type Map(Scalar* data, const Stride& stride) - { return typename StridedMapType >::type(data, stride); } - template - static inline typename StridedConstMapType >::type Map(const Scalar* data, Index size, const Stride& stride) - { return typename StridedConstMapType >::type(data, size, stride); } - template - static inline typename StridedMapType >::type Map(Scalar* data, Index size, const Stride& stride) - { return typename StridedMapType >::type(data, size, stride); } - template - static inline typename StridedConstMapType >::type Map(const Scalar* data, Index rows, Index cols, const Stride& stride) - { return typename StridedConstMapType >::type(data, rows, cols, stride); } - template - static inline typename StridedMapType >::type Map(Scalar* data, Index rows, Index cols, const Stride& stride) - { return typename StridedMapType >::type(data, rows, cols, stride); } - - template - static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, const Stride& stride) - { return typename StridedConstAlignedMapType >::type(data, stride); } - template - static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, const Stride& stride) - { return typename StridedAlignedMapType >::type(data, stride); } - template - static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index size, const Stride& stride) - { return typename StridedConstAlignedMapType >::type(data, size, stride); } - template - static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index size, const Stride& stride) - { return typename StridedAlignedMapType >::type(data, size, stride); } - template - static inline typename StridedConstAlignedMapType >::type MapAligned(const Scalar* data, Index rows, Index cols, const Stride& stride) - { return typename StridedConstAlignedMapType >::type(data, rows, cols, stride); } - template - static inline typename StridedAlignedMapType >::type MapAligned(Scalar* data, Index rows, Index cols, const Stride& stride) - { return typename StridedAlignedMapType >::type(data, rows, cols, stride); } - //@} - - using Base::setConstant; - Derived& setConstant(Index size, const Scalar& value); - Derived& setConstant(Index rows, Index cols, const Scalar& value); - - using Base::setZero; - Derived& setZero(Index size); - Derived& setZero(Index rows, Index cols); - - using Base::setOnes; - Derived& setOnes(Index size); - Derived& setOnes(Index rows, Index cols); - - using Base::setRandom; - Derived& setRandom(Index size); - Derived& setRandom(Index rows, Index cols); - - #ifdef EIGEN_PLAINOBJECTBASE_PLUGIN - #include EIGEN_PLAINOBJECTBASE_PLUGIN - #endif - - protected: - /** \internal Resizes *this in preparation for assigning \a other to it. - * Takes care of doing all the checking that's needed. - * - * Note that copying a row-vector into a vector (and conversely) is allowed. - * The resizing, if any, is then done in the appropriate way so that row-vectors - * remain row-vectors and vectors remain vectors. - */ - template - EIGEN_STRONG_INLINE void _resize_to_match(const EigenBase& other) - { - #ifdef EIGEN_NO_AUTOMATIC_RESIZING - eigen_assert((this->size()==0 || (IsVectorAtCompileTime ? (this->size() == other.size()) - : (rows() == other.rows() && cols() == other.cols()))) - && "Size mismatch. Automatic resizing is disabled because EIGEN_NO_AUTOMATIC_RESIZING is defined"); - EIGEN_ONLY_USED_FOR_DEBUG(other); - #else - resizeLike(other); - #endif - } - - /** - * \brief Copies the value of the expression \a other into \c *this with automatic resizing. - * - * *this might be resized to match the dimensions of \a other. If *this was a null matrix (not already initialized), - * it will be initialized. - * - * Note that copying a row-vector into a vector (and conversely) is allowed. - * The resizing, if any, is then done in the appropriate way so that row-vectors - * remain row-vectors and vectors remain vectors. - * - * \sa operator=(const MatrixBase&), _set_noalias() - * - * \internal - */ - template - EIGEN_STRONG_INLINE Derived& _set(const DenseBase& other) - { - _set_selector(other.derived(), typename internal::conditional(int(OtherDerived::Flags) & EvalBeforeAssigningBit), internal::true_type, internal::false_type>::type()); - return this->derived(); - } - - template - EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::true_type&) { _set_noalias(other.eval()); } - - template - EIGEN_STRONG_INLINE void _set_selector(const OtherDerived& other, const internal::false_type&) { _set_noalias(other); } - - /** \internal Like _set() but additionally makes the assumption that no aliasing effect can happen (which - * is the case when creating a new matrix) so one can enforce lazy evaluation. - * - * \sa operator=(const MatrixBase&), _set() - */ - template - EIGEN_STRONG_INLINE Derived& _set_noalias(const DenseBase& other) - { - // I don't think we need this resize call since the lazyAssign will anyways resize - // and lazyAssign will be called by the assign selector. - //_resize_to_match(other); - // the 'false' below means to enforce lazy evaluation. We don't use lazyAssign() because - // it wouldn't allow to copy a row-vector into a column-vector. - return internal::assign_selector::run(this->derived(), other.derived()); - } - - template - EIGEN_STRONG_INLINE void _init2(Index nbRows, Index nbCols, typename internal::enable_if::type* = 0) - { - EIGEN_STATIC_ASSERT(bool(NumTraits::IsInteger) && - bool(NumTraits::IsInteger), - FLOATING_POINT_ARGUMENT_PASSED__INTEGER_WAS_EXPECTED) - resize(nbRows,nbCols); - } - template - EIGEN_STRONG_INLINE void _init2(const Scalar& val0, const Scalar& val1, typename internal::enable_if::type* = 0) - { - EIGEN_STATIC_ASSERT_VECTOR_SPECIFIC_SIZE(PlainObjectBase, 2) - m_storage.data()[0] = val0; - m_storage.data()[1] = val1; - } - - template - friend struct internal::matrix_swap_impl; - - /** \internal generic implementation of swap for dense storage since for dynamic-sized matrices of same type it is enough to swap the - * data pointers. - */ - template - void _swap(DenseBase const & other) - { - enum { SwapPointers = internal::is_same::value && Base::SizeAtCompileTime==Dynamic }; - internal::matrix_swap_impl::run(this->derived(), other.const_cast_derived()); - } - - public: -#ifndef EIGEN_PARSED_BY_DOXYGEN - static EIGEN_STRONG_INLINE void _check_template_params() - { - EIGEN_STATIC_ASSERT((EIGEN_IMPLIES(MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1, (Options&RowMajor)==RowMajor) - && EIGEN_IMPLIES(MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1, (Options&RowMajor)==0) - && ((RowsAtCompileTime == Dynamic) || (RowsAtCompileTime >= 0)) - && ((ColsAtCompileTime == Dynamic) || (ColsAtCompileTime >= 0)) - && ((MaxRowsAtCompileTime == Dynamic) || (MaxRowsAtCompileTime >= 0)) - && ((MaxColsAtCompileTime == Dynamic) || (MaxColsAtCompileTime >= 0)) - && (MaxRowsAtCompileTime == RowsAtCompileTime || RowsAtCompileTime==Dynamic) - && (MaxColsAtCompileTime == ColsAtCompileTime || ColsAtCompileTime==Dynamic) - && (Options & (DontAlign|RowMajor)) == Options), - INVALID_MATRIX_TEMPLATE_PARAMETERS) - } -#endif - -private: - enum { ThisConstantIsPrivateInPlainObjectBase }; -}; - -template -struct internal::conservative_resize_like_impl -{ - typedef typename Derived::Index Index; - static void run(DenseBase& _this, Index rows, Index cols) - { - if (_this.rows() == rows && _this.cols() == cols) return; - EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) - - if ( ( Derived::IsRowMajor && _this.cols() == cols) || // row-major and we change only the number of rows - (!Derived::IsRowMajor && _this.rows() == rows) ) // column-major and we change only the number of columns - { - internal::check_rows_cols_for_overflow::run(rows, cols); - _this.derived().m_storage.conservativeResize(rows*cols,rows,cols); - } - else - { - // The storage order does not allow us to use reallocation. - typename Derived::PlainObject tmp(rows,cols); - const Index common_rows = (std::min)(rows, _this.rows()); - const Index common_cols = (std::min)(cols, _this.cols()); - tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); - _this.derived().swap(tmp); - } - } - - static void run(DenseBase& _this, const DenseBase& other) - { - if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; - - // Note: Here is space for improvement. Basically, for conservativeResize(Index,Index), - // neither RowsAtCompileTime or ColsAtCompileTime must be Dynamic. If only one of the - // dimensions is dynamic, one could use either conservativeResize(Index rows, NoChange_t) or - // conservativeResize(NoChange_t, Index cols). For these methods new static asserts like - // EIGEN_STATIC_ASSERT_DYNAMIC_ROWS and EIGEN_STATIC_ASSERT_DYNAMIC_COLS would be good. - EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(Derived) - EIGEN_STATIC_ASSERT_DYNAMIC_SIZE(OtherDerived) - - if ( ( Derived::IsRowMajor && _this.cols() == other.cols()) || // row-major and we change only the number of rows - (!Derived::IsRowMajor && _this.rows() == other.rows()) ) // column-major and we change only the number of columns - { - const Index new_rows = other.rows() - _this.rows(); - const Index new_cols = other.cols() - _this.cols(); - _this.derived().m_storage.conservativeResize(other.size(),other.rows(),other.cols()); - if (new_rows>0) - _this.bottomRightCorner(new_rows, other.cols()) = other.bottomRows(new_rows); - else if (new_cols>0) - _this.bottomRightCorner(other.rows(), new_cols) = other.rightCols(new_cols); - } - else - { - // The storage order does not allow us to use reallocation. - typename Derived::PlainObject tmp(other); - const Index common_rows = (std::min)(tmp.rows(), _this.rows()); - const Index common_cols = (std::min)(tmp.cols(), _this.cols()); - tmp.block(0,0,common_rows,common_cols) = _this.block(0,0,common_rows,common_cols); - _this.derived().swap(tmp); - } - } -}; - -namespace internal { - -template -struct conservative_resize_like_impl -{ - typedef typename Derived::Index Index; - static void run(DenseBase& _this, Index size) - { - const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : size; - const Index new_cols = Derived::RowsAtCompileTime==1 ? size : 1; - _this.derived().m_storage.conservativeResize(size,new_rows,new_cols); - } - - static void run(DenseBase& _this, const DenseBase& other) - { - if (_this.rows() == other.rows() && _this.cols() == other.cols()) return; - - const Index num_new_elements = other.size() - _this.size(); - - const Index new_rows = Derived::RowsAtCompileTime==1 ? 1 : other.rows(); - const Index new_cols = Derived::RowsAtCompileTime==1 ? other.cols() : 1; - _this.derived().m_storage.conservativeResize(other.size(),new_rows,new_cols); - - if (num_new_elements > 0) - _this.tail(num_new_elements) = other.tail(num_new_elements); - } -}; - -template -struct matrix_swap_impl -{ - static inline void run(MatrixTypeA& a, MatrixTypeB& b) - { - a.base().swap(b); - } -}; - -template -struct matrix_swap_impl -{ - static inline void run(MatrixTypeA& a, MatrixTypeB& b) - { - static_cast(a).m_storage.swap(static_cast(b).m_storage); - } -}; - -} // end namespace internal - -} // end namespace Eigen - -#endif // EIGEN_DENSESTORAGEBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ProductBase.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ProductBase.h deleted file mode 100644 index a494b5f870..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ProductBase.h +++ /dev/null @@ -1,278 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_PRODUCTBASE_H -#define EIGEN_PRODUCTBASE_H - -namespace Eigen { - -/** \class ProductBase - * \ingroup Core_Module - * - */ - -namespace internal { -template -struct traits > -{ - typedef MatrixXpr XprKind; - typedef typename remove_all<_Lhs>::type Lhs; - typedef typename remove_all<_Rhs>::type Rhs; - typedef typename scalar_product_traits::ReturnType Scalar; - typedef typename promote_storage_type::StorageKind, - typename traits::StorageKind>::ret StorageKind; - typedef typename promote_index_type::Index, - typename traits::Index>::type Index; - enum { - RowsAtCompileTime = traits::RowsAtCompileTime, - ColsAtCompileTime = traits::ColsAtCompileTime, - MaxRowsAtCompileTime = traits::MaxRowsAtCompileTime, - MaxColsAtCompileTime = traits::MaxColsAtCompileTime, - Flags = (MaxRowsAtCompileTime==1 ? RowMajorBit : 0) - | EvalBeforeNestingBit | EvalBeforeAssigningBit | NestByRefBit, - // Note that EvalBeforeNestingBit and NestByRefBit - // are not used in practice because nested is overloaded for products - CoeffReadCost = 0 // FIXME why is it needed ? - }; -}; -} - -#define EIGEN_PRODUCT_PUBLIC_INTERFACE(Derived) \ - typedef ProductBase Base; \ - EIGEN_DENSE_PUBLIC_INTERFACE(Derived) \ - typedef typename Base::LhsNested LhsNested; \ - typedef typename Base::_LhsNested _LhsNested; \ - typedef typename Base::LhsBlasTraits LhsBlasTraits; \ - typedef typename Base::ActualLhsType ActualLhsType; \ - typedef typename Base::_ActualLhsType _ActualLhsType; \ - typedef typename Base::RhsNested RhsNested; \ - typedef typename Base::_RhsNested _RhsNested; \ - typedef typename Base::RhsBlasTraits RhsBlasTraits; \ - typedef typename Base::ActualRhsType ActualRhsType; \ - typedef typename Base::_ActualRhsType _ActualRhsType; \ - using Base::m_lhs; \ - using Base::m_rhs; - -template -class ProductBase : public MatrixBase -{ - public: - typedef MatrixBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(ProductBase) - - typedef typename Lhs::Nested LhsNested; - typedef typename internal::remove_all::type _LhsNested; - typedef internal::blas_traits<_LhsNested> LhsBlasTraits; - typedef typename LhsBlasTraits::DirectLinearAccessType ActualLhsType; - typedef typename internal::remove_all::type _ActualLhsType; - typedef typename internal::traits::Scalar LhsScalar; - - typedef typename Rhs::Nested RhsNested; - typedef typename internal::remove_all::type _RhsNested; - typedef internal::blas_traits<_RhsNested> RhsBlasTraits; - typedef typename RhsBlasTraits::DirectLinearAccessType ActualRhsType; - typedef typename internal::remove_all::type _ActualRhsType; - typedef typename internal::traits::Scalar RhsScalar; - - // Diagonal of a product: no need to evaluate the arguments because they are going to be evaluated only once - typedef CoeffBasedProduct FullyLazyCoeffBaseProductType; - - public: - - typedef typename Base::PlainObject PlainObject; - - ProductBase(const Lhs& a_lhs, const Rhs& a_rhs) - : m_lhs(a_lhs), m_rhs(a_rhs) - { - eigen_assert(a_lhs.cols() == a_rhs.rows() - && "invalid matrix product" - && "if you wanted a coeff-wise or a dot product use the respective explicit functions"); - } - - inline Index rows() const { return m_lhs.rows(); } - inline Index cols() const { return m_rhs.cols(); } - - template - inline void evalTo(Dest& dst) const { dst.setZero(); scaleAndAddTo(dst,Scalar(1)); } - - template - inline void addTo(Dest& dst) const { scaleAndAddTo(dst,Scalar(1)); } - - template - inline void subTo(Dest& dst) const { scaleAndAddTo(dst,Scalar(-1)); } - - template - inline void scaleAndAddTo(Dest& dst, const Scalar& alpha) const { derived().scaleAndAddTo(dst,alpha); } - - const _LhsNested& lhs() const { return m_lhs; } - const _RhsNested& rhs() const { return m_rhs; } - - // Implicit conversion to the nested type (trigger the evaluation of the product) - operator const PlainObject& () const - { - m_result.resize(m_lhs.rows(), m_rhs.cols()); - derived().evalTo(m_result); - return m_result; - } - - const Diagonal diagonal() const - { return FullyLazyCoeffBaseProductType(m_lhs, m_rhs); } - - template - const Diagonal diagonal() const - { return FullyLazyCoeffBaseProductType(m_lhs, m_rhs); } - - const Diagonal diagonal(Index index) const - { return FullyLazyCoeffBaseProductType(m_lhs, m_rhs).diagonal(index); } - - // restrict coeff accessors to 1x1 expressions. No need to care about mutators here since this isnt a Lvalue expression - typename Base::CoeffReturnType coeff(Index row, Index col) const - { -#ifdef EIGEN2_SUPPORT - return lhs().row(row).cwiseProduct(rhs().col(col).transpose()).sum(); -#else - EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) - eigen_assert(this->rows() == 1 && this->cols() == 1); - Matrix result = *this; - return result.coeff(row,col); -#endif - } - - typename Base::CoeffReturnType coeff(Index i) const - { - EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) - eigen_assert(this->rows() == 1 && this->cols() == 1); - Matrix result = *this; - return result.coeff(i); - } - - const Scalar& coeffRef(Index row, Index col) const - { - EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) - eigen_assert(this->rows() == 1 && this->cols() == 1); - return derived().coeffRef(row,col); - } - - const Scalar& coeffRef(Index i) const - { - EIGEN_STATIC_ASSERT_SIZE_1x1(Derived) - eigen_assert(this->rows() == 1 && this->cols() == 1); - return derived().coeffRef(i); - } - - protected: - - LhsNested m_lhs; - RhsNested m_rhs; - - mutable PlainObject m_result; -}; - -// here we need to overload the nested rule for products -// such that the nested type is a const reference to a plain matrix -namespace internal { -template -struct nested, N, PlainObject> -{ - typedef PlainObject const& type; -}; -} - -template -class ScaledProduct; - -// Note that these two operator* functions are not defined as member -// functions of ProductBase, because, otherwise we would have to -// define all overloads defined in MatrixBase. Furthermore, Using -// "using Base::operator*" would not work with MSVC. -// -// Also note that here we accept any compatible scalar types -template -const ScaledProduct -operator*(const ProductBase& prod, const typename Derived::Scalar& x) -{ return ScaledProduct(prod.derived(), x); } - -template -typename internal::enable_if::value, - const ScaledProduct >::type -operator*(const ProductBase& prod, const typename Derived::RealScalar& x) -{ return ScaledProduct(prod.derived(), x); } - - -template -const ScaledProduct -operator*(const typename Derived::Scalar& x,const ProductBase& prod) -{ return ScaledProduct(prod.derived(), x); } - -template -typename internal::enable_if::value, - const ScaledProduct >::type -operator*(const typename Derived::RealScalar& x,const ProductBase& prod) -{ return ScaledProduct(prod.derived(), x); } - -namespace internal { -template -struct traits > - : traits, - typename NestedProduct::_LhsNested, - typename NestedProduct::_RhsNested> > -{ - typedef typename traits::StorageKind StorageKind; -}; -} - -template -class ScaledProduct - : public ProductBase, - typename NestedProduct::_LhsNested, - typename NestedProduct::_RhsNested> -{ - public: - typedef ProductBase, - typename NestedProduct::_LhsNested, - typename NestedProduct::_RhsNested> Base; - typedef typename Base::Scalar Scalar; - typedef typename Base::PlainObject PlainObject; -// EIGEN_PRODUCT_PUBLIC_INTERFACE(ScaledProduct) - - ScaledProduct(const NestedProduct& prod, const Scalar& x) - : Base(prod.lhs(),prod.rhs()), m_prod(prod), m_alpha(x) {} - - template - inline void evalTo(Dest& dst) const { dst.setZero(); scaleAndAddTo(dst, Scalar(1)); } - - template - inline void addTo(Dest& dst) const { scaleAndAddTo(dst, Scalar(1)); } - - template - inline void subTo(Dest& dst) const { scaleAndAddTo(dst, Scalar(-1)); } - - template - inline void scaleAndAddTo(Dest& dst, const Scalar& a_alpha) const { m_prod.derived().scaleAndAddTo(dst,a_alpha * m_alpha); } - - const Scalar& alpha() const { return m_alpha; } - - protected: - const NestedProduct& m_prod; - Scalar m_alpha; -}; - -/** \internal - * Overloaded to perform an efficient C = (A*B).lazy() */ -template -template -Derived& MatrixBase::lazyAssign(const ProductBase& other) -{ - other.derived().evalTo(derived()); - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_PRODUCTBASE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Random.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Random.h deleted file mode 100644 index 480fea408d..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Random.h +++ /dev/null @@ -1,152 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_RANDOM_H -#define EIGEN_RANDOM_H - -namespace Eigen { - -namespace internal { - -template struct scalar_random_op { - EIGEN_EMPTY_STRUCT_CTOR(scalar_random_op) - template - inline const Scalar operator() (Index, Index = 0) const { return random(); } -}; - -template -struct functor_traits > -{ enum { Cost = 5 * NumTraits::MulCost, PacketAccess = false, IsRepeatable = false }; }; - -} // end namespace internal - -/** \returns a random matrix expression - * - * The parameters \a rows and \a cols are the number of rows and of columns of - * the returned matrix. Must be compatible with this MatrixBase type. - * - * This variant is meant to be used for dynamic-size matrix types. For fixed-size types, - * it is redundant to pass \a rows and \a cols as arguments, so Random() should be used - * instead. - * - * Example: \include MatrixBase_random_int_int.cpp - * Output: \verbinclude MatrixBase_random_int_int.out - * - * This expression has the "evaluate before nesting" flag so that it will be evaluated into - * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected - * behavior with expressions involving random matrices. - * - * \sa MatrixBase::setRandom(), MatrixBase::Random(Index), MatrixBase::Random() - */ -template -inline const CwiseNullaryOp::Scalar>, Derived> -DenseBase::Random(Index rows, Index cols) -{ - return NullaryExpr(rows, cols, internal::scalar_random_op()); -} - -/** \returns a random vector expression - * - * The parameter \a size is the size of the returned vector. - * Must be compatible with this MatrixBase type. - * - * \only_for_vectors - * - * This variant is meant to be used for dynamic-size vector types. For fixed-size types, - * it is redundant to pass \a size as argument, so Random() should be used - * instead. - * - * Example: \include MatrixBase_random_int.cpp - * Output: \verbinclude MatrixBase_random_int.out - * - * This expression has the "evaluate before nesting" flag so that it will be evaluated into - * a temporary vector whenever it is nested in a larger expression. This prevents unexpected - * behavior with expressions involving random matrices. - * - * \sa MatrixBase::setRandom(), MatrixBase::Random(Index,Index), MatrixBase::Random() - */ -template -inline const CwiseNullaryOp::Scalar>, Derived> -DenseBase::Random(Index size) -{ - return NullaryExpr(size, internal::scalar_random_op()); -} - -/** \returns a fixed-size random matrix or vector expression - * - * This variant is only for fixed-size MatrixBase types. For dynamic-size types, you - * need to use the variants taking size arguments. - * - * Example: \include MatrixBase_random.cpp - * Output: \verbinclude MatrixBase_random.out - * - * This expression has the "evaluate before nesting" flag so that it will be evaluated into - * a temporary matrix whenever it is nested in a larger expression. This prevents unexpected - * behavior with expressions involving random matrices. - * - * \sa MatrixBase::setRandom(), MatrixBase::Random(Index,Index), MatrixBase::Random(Index) - */ -template -inline const CwiseNullaryOp::Scalar>, Derived> -DenseBase::Random() -{ - return NullaryExpr(RowsAtCompileTime, ColsAtCompileTime, internal::scalar_random_op()); -} - -/** Sets all coefficients in this expression to random values. - * - * Example: \include MatrixBase_setRandom.cpp - * Output: \verbinclude MatrixBase_setRandom.out - * - * \sa class CwiseNullaryOp, setRandom(Index), setRandom(Index,Index) - */ -template -inline Derived& DenseBase::setRandom() -{ - return *this = Random(rows(), cols()); -} - -/** Resizes to the given \a newSize, and sets all coefficients in this expression to random values. - * - * \only_for_vectors - * - * Example: \include Matrix_setRandom_int.cpp - * Output: \verbinclude Matrix_setRandom_int.out - * - * \sa MatrixBase::setRandom(), setRandom(Index,Index), class CwiseNullaryOp, MatrixBase::Random() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setRandom(Index newSize) -{ - resize(newSize); - return setRandom(); -} - -/** Resizes to the given size, and sets all coefficients in this expression to random values. - * - * \param nbRows the new number of rows - * \param nbCols the new number of columns - * - * Example: \include Matrix_setRandom_int_int.cpp - * Output: \verbinclude Matrix_setRandom_int_int.out - * - * \sa MatrixBase::setRandom(), setRandom(Index), class CwiseNullaryOp, MatrixBase::Random() - */ -template -EIGEN_STRONG_INLINE Derived& -PlainObjectBase::setRandom(Index nbRows, Index nbCols) -{ - resize(nbRows, nbCols); - return setRandom(); -} - -} // end namespace Eigen - -#endif // EIGEN_RANDOM_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Redux.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Redux.h deleted file mode 100644 index 50548fa9a0..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Redux.h +++ /dev/null @@ -1,408 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008 Gael Guennebaud -// Copyright (C) 2006-2008 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_REDUX_H -#define EIGEN_REDUX_H - -namespace Eigen { - -namespace internal { - -// TODO -// * implement other kind of vectorization -// * factorize code - -/*************************************************************************** -* Part 1 : the logic deciding a strategy for vectorization and unrolling -***************************************************************************/ - -template -struct redux_traits -{ -public: - enum { - PacketSize = packet_traits::size, - InnerMaxSize = int(Derived::IsRowMajor) - ? Derived::MaxColsAtCompileTime - : Derived::MaxRowsAtCompileTime - }; - - enum { - MightVectorize = (int(Derived::Flags)&ActualPacketAccessBit) - && (functor_traits::PacketAccess), - MayLinearVectorize = MightVectorize && (int(Derived::Flags)&LinearAccessBit), - MaySliceVectorize = MightVectorize && int(InnerMaxSize)>=3*PacketSize - }; - -public: - enum { - Traversal = int(MayLinearVectorize) ? int(LinearVectorizedTraversal) - : int(MaySliceVectorize) ? int(SliceVectorizedTraversal) - : int(DefaultTraversal) - }; - -public: - enum { - Cost = ( Derived::SizeAtCompileTime == Dynamic - || Derived::CoeffReadCost == Dynamic - || (Derived::SizeAtCompileTime!=1 && functor_traits::Cost == Dynamic) - ) ? Dynamic - : Derived::SizeAtCompileTime * Derived::CoeffReadCost - + (Derived::SizeAtCompileTime-1) * functor_traits::Cost, - UnrollingLimit = EIGEN_UNROLLING_LIMIT * (int(Traversal) == int(DefaultTraversal) ? 1 : int(PacketSize)) - }; - -public: - enum { - Unrolling = Cost != Dynamic && Cost <= UnrollingLimit - ? CompleteUnrolling - : NoUnrolling - }; -}; - -/*************************************************************************** -* Part 2 : unrollers -***************************************************************************/ - -/*** no vectorization ***/ - -template -struct redux_novec_unroller -{ - enum { - HalfLength = Length/2 - }; - - typedef typename Derived::Scalar Scalar; - - static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func& func) - { - return func(redux_novec_unroller::run(mat,func), - redux_novec_unroller::run(mat,func)); - } -}; - -template -struct redux_novec_unroller -{ - enum { - outer = Start / Derived::InnerSizeAtCompileTime, - inner = Start % Derived::InnerSizeAtCompileTime - }; - - typedef typename Derived::Scalar Scalar; - - static EIGEN_STRONG_INLINE Scalar run(const Derived &mat, const Func&) - { - return mat.coeffByOuterInner(outer, inner); - } -}; - -// This is actually dead code and will never be called. It is required -// to prevent false warnings regarding failed inlining though -// for 0 length run() will never be called at all. -template -struct redux_novec_unroller -{ - typedef typename Derived::Scalar Scalar; - static EIGEN_STRONG_INLINE Scalar run(const Derived&, const Func&) { return Scalar(); } -}; - -/*** vectorization ***/ - -template -struct redux_vec_unroller -{ - enum { - PacketSize = packet_traits::size, - HalfLength = Length/2 - }; - - typedef typename Derived::Scalar Scalar; - typedef typename packet_traits::type PacketScalar; - - static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func& func) - { - return func.packetOp( - redux_vec_unroller::run(mat,func), - redux_vec_unroller::run(mat,func) ); - } -}; - -template -struct redux_vec_unroller -{ - enum { - index = Start * packet_traits::size, - outer = index / int(Derived::InnerSizeAtCompileTime), - inner = index % int(Derived::InnerSizeAtCompileTime), - alignment = (Derived::Flags & AlignedBit) ? Aligned : Unaligned - }; - - typedef typename Derived::Scalar Scalar; - typedef typename packet_traits::type PacketScalar; - - static EIGEN_STRONG_INLINE PacketScalar run(const Derived &mat, const Func&) - { - return mat.template packetByOuterInner(outer, inner); - } -}; - -/*************************************************************************** -* Part 3 : implementation of all cases -***************************************************************************/ - -template::Traversal, - int Unrolling = redux_traits::Unrolling -> -struct redux_impl; - -template -struct redux_impl -{ - typedef typename Derived::Scalar Scalar; - typedef typename Derived::Index Index; - static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func) - { - eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); - Scalar res; - res = mat.coeffByOuterInner(0, 0); - for(Index i = 1; i < mat.innerSize(); ++i) - res = func(res, mat.coeffByOuterInner(0, i)); - for(Index i = 1; i < mat.outerSize(); ++i) - for(Index j = 0; j < mat.innerSize(); ++j) - res = func(res, mat.coeffByOuterInner(i, j)); - return res; - } -}; - -template -struct redux_impl - : public redux_novec_unroller -{}; - -template -struct redux_impl -{ - typedef typename Derived::Scalar Scalar; - typedef typename packet_traits::type PacketScalar; - typedef typename Derived::Index Index; - - static Scalar run(const Derived& mat, const Func& func) - { - const Index size = mat.size(); - eigen_assert(size && "you are using an empty matrix"); - const Index packetSize = packet_traits::size; - const Index alignedStart = internal::first_aligned(mat); - enum { - alignment = bool(Derived::Flags & DirectAccessBit) || bool(Derived::Flags & AlignedBit) - ? Aligned : Unaligned - }; - const Index alignedSize2 = ((size-alignedStart)/(2*packetSize))*(2*packetSize); - const Index alignedSize = ((size-alignedStart)/(packetSize))*(packetSize); - const Index alignedEnd2 = alignedStart + alignedSize2; - const Index alignedEnd = alignedStart + alignedSize; - Scalar res; - if(alignedSize) - { - PacketScalar packet_res0 = mat.template packet(alignedStart); - if(alignedSize>packetSize) // we have at least two packets to partly unroll the loop - { - PacketScalar packet_res1 = mat.template packet(alignedStart+packetSize); - for(Index index = alignedStart + 2*packetSize; index < alignedEnd2; index += 2*packetSize) - { - packet_res0 = func.packetOp(packet_res0, mat.template packet(index)); - packet_res1 = func.packetOp(packet_res1, mat.template packet(index+packetSize)); - } - - packet_res0 = func.packetOp(packet_res0,packet_res1); - if(alignedEnd>alignedEnd2) - packet_res0 = func.packetOp(packet_res0, mat.template packet(alignedEnd2)); - } - res = func.predux(packet_res0); - - for(Index index = 0; index < alignedStart; ++index) - res = func(res,mat.coeff(index)); - - for(Index index = alignedEnd; index < size; ++index) - res = func(res,mat.coeff(index)); - } - else // too small to vectorize anything. - // since this is dynamic-size hence inefficient anyway for such small sizes, don't try to optimize. - { - res = mat.coeff(0); - for(Index index = 1; index < size; ++index) - res = func(res,mat.coeff(index)); - } - - return res; - } -}; - -template -struct redux_impl -{ - typedef typename Derived::Scalar Scalar; - typedef typename packet_traits::type PacketScalar; - typedef typename Derived::Index Index; - - static Scalar run(const Derived& mat, const Func& func) - { - eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); - const Index innerSize = mat.innerSize(); - const Index outerSize = mat.outerSize(); - enum { - packetSize = packet_traits::size - }; - const Index packetedInnerSize = ((innerSize)/packetSize)*packetSize; - Scalar res; - if(packetedInnerSize) - { - PacketScalar packet_res = mat.template packet(0,0); - for(Index j=0; j(j,i)); - - res = func.predux(packet_res); - for(Index j=0; j::run(mat, func); - } - - return res; - } -}; - -template -struct redux_impl -{ - typedef typename Derived::Scalar Scalar; - typedef typename packet_traits::type PacketScalar; - enum { - PacketSize = packet_traits::size, - Size = Derived::SizeAtCompileTime, - VectorizedSize = (Size / PacketSize) * PacketSize - }; - static EIGEN_STRONG_INLINE Scalar run(const Derived& mat, const Func& func) - { - eigen_assert(mat.rows()>0 && mat.cols()>0 && "you are using an empty matrix"); - Scalar res = func.predux(redux_vec_unroller::run(mat,func)); - if (VectorizedSize != Size) - res = func(res,redux_novec_unroller::run(mat,func)); - return res; - } -}; - -} // end namespace internal - -/*************************************************************************** -* Part 4 : public API -***************************************************************************/ - - -/** \returns the result of a full redux operation on the whole matrix or vector using \a func - * - * The template parameter \a BinaryOp is the type of the functor \a func which must be - * an associative operator. Both current STL and TR1 functor styles are handled. - * - * \sa DenseBase::sum(), DenseBase::minCoeff(), DenseBase::maxCoeff(), MatrixBase::colwise(), MatrixBase::rowwise() - */ -template -template -EIGEN_STRONG_INLINE typename internal::result_of::Scalar)>::type -DenseBase::redux(const Func& func) const -{ - typedef typename internal::remove_all::type ThisNested; - return internal::redux_impl - ::run(derived(), func); -} - -/** \returns the minimum of all coefficients of \c *this. - * \warning the result is undefined if \c *this contains NaN. - */ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::minCoeff() const -{ - return this->redux(Eigen::internal::scalar_min_op()); -} - -/** \returns the maximum of all coefficients of \c *this. - * \warning the result is undefined if \c *this contains NaN. - */ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::maxCoeff() const -{ - return this->redux(Eigen::internal::scalar_max_op()); -} - -/** \returns the sum of all coefficients of *this - * - * \sa trace(), prod(), mean() - */ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::sum() const -{ - if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) - return Scalar(0); - return this->redux(Eigen::internal::scalar_sum_op()); -} - -/** \returns the mean of all coefficients of *this -* -* \sa trace(), prod(), sum() -*/ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::mean() const -{ - return Scalar(this->redux(Eigen::internal::scalar_sum_op())) / Scalar(this->size()); -} - -/** \returns the product of all coefficients of *this - * - * Example: \include MatrixBase_prod.cpp - * Output: \verbinclude MatrixBase_prod.out - * - * \sa sum(), mean(), trace() - */ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -DenseBase::prod() const -{ - if(SizeAtCompileTime==0 || (SizeAtCompileTime==Dynamic && size()==0)) - return Scalar(1); - return this->redux(Eigen::internal::scalar_product_op()); -} - -/** \returns the trace of \c *this, i.e. the sum of the coefficients on the main diagonal. - * - * \c *this can be any matrix, not necessarily square. - * - * \sa diagonal(), sum() - */ -template -EIGEN_STRONG_INLINE typename internal::traits::Scalar -MatrixBase::trace() const -{ - return derived().diagonal().sum(); -} - -} // end namespace Eigen - -#endif // EIGEN_REDUX_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Ref.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Ref.h deleted file mode 100644 index aba795bdb7..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Ref.h +++ /dev/null @@ -1,255 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2012 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_REF_H -#define EIGEN_REF_H - -namespace Eigen { - -template class RefBase; -template,OuterStride<> >::type > class Ref; - -/** \class Ref - * \ingroup Core_Module - * - * \brief A matrix or vector expression mapping an existing expressions - * - * \tparam PlainObjectType the equivalent matrix type of the mapped data - * \tparam Options specifies whether the pointer is \c #Aligned, or \c #Unaligned. - * The default is \c #Unaligned. - * \tparam StrideType optionally specifies strides. By default, Ref implies a contiguous storage along the inner dimension (inner stride==1), - * but accept a variable outer stride (leading dimension). - * This can be overridden by specifying strides. - * The type passed here must be a specialization of the Stride template, see examples below. - * - * This class permits to write non template functions taking Eigen's object as parameters while limiting the number of copies. - * A Ref<> object can represent either a const expression or a l-value: - * \code - * // in-out argument: - * void foo1(Ref x); - * - * // read-only const argument: - * void foo2(const Ref& x); - * \endcode - * - * In the in-out case, the input argument must satisfies the constraints of the actual Ref<> type, otherwise a compilation issue will be triggered. - * By default, a Ref can reference any dense vector expression of float having a contiguous memory layout. - * Likewise, a Ref can reference any column major dense matrix expression of float whose column's elements are contiguously stored with - * the possibility to have a constant space inbetween each column, i.e.: the inner stride mmust be equal to 1, but the outer-stride (or leading dimension), - * can be greater than the number of rows. - * - * In the const case, if the input expression does not match the above requirement, then it is evaluated into a temporary before being passed to the function. - * Here are some examples: - * \code - * MatrixXf A; - * VectorXf a; - * foo1(a.head()); // OK - * foo1(A.col()); // OK - * foo1(A.row()); // compilation error because here innerstride!=1 - * foo2(A.row()); // The row is copied into a contiguous temporary - * foo2(2*a); // The expression is evaluated into a temporary - * foo2(A.col().segment(2,4)); // No temporary - * \endcode - * - * The range of inputs that can be referenced without temporary can be enlarged using the last two template parameter. - * Here is an example accepting an innerstride!=1: - * \code - * // in-out argument: - * void foo3(Ref > x); - * foo3(A.row()); // OK - * \endcode - * The downside here is that the function foo3 might be significantly slower than foo1 because it won't be able to exploit vectorization, and will involved more - * expensive address computations even if the input is contiguously stored in memory. To overcome this issue, one might propose to overloads internally calling a - * template function, e.g.: - * \code - * // in the .h: - * void foo(const Ref& A); - * void foo(const Ref >& A); - * - * // in the .cpp: - * template void foo_impl(const TypeOfA& A) { - * ... // crazy code goes here - * } - * void foo(const Ref& A) { foo_impl(A); } - * void foo(const Ref >& A) { foo_impl(A); } - * \endcode - * - * - * \sa PlainObjectBase::Map(), \ref TopicStorageOrders - */ - -namespace internal { - -template -struct traits > - : public traits > -{ - typedef _PlainObjectType PlainObjectType; - typedef _StrideType StrideType; - enum { - Options = _Options - }; - - template struct match { - enum { - HasDirectAccess = internal::has_direct_access::ret, - StorageOrderMatch = PlainObjectType::IsVectorAtCompileTime || ((PlainObjectType::Flags&RowMajorBit)==(Derived::Flags&RowMajorBit)), - InnerStrideMatch = int(StrideType::InnerStrideAtCompileTime)==int(Dynamic) - || int(StrideType::InnerStrideAtCompileTime)==int(Derived::InnerStrideAtCompileTime) - || (int(StrideType::InnerStrideAtCompileTime)==0 && int(Derived::InnerStrideAtCompileTime)==1), - OuterStrideMatch = Derived::IsVectorAtCompileTime - || int(StrideType::OuterStrideAtCompileTime)==int(Dynamic) || int(StrideType::OuterStrideAtCompileTime)==int(Derived::OuterStrideAtCompileTime), - AlignmentMatch = (_Options!=Aligned) || ((PlainObjectType::Flags&AlignedBit)==0) || ((traits::Flags&AlignedBit)==AlignedBit), - MatchAtCompileTime = HasDirectAccess && StorageOrderMatch && InnerStrideMatch && OuterStrideMatch && AlignmentMatch - }; - typedef typename internal::conditional::type type; - }; - -}; - -template -struct traits > : public traits {}; - -} - -template class RefBase - : public MapBase -{ - typedef typename internal::traits::PlainObjectType PlainObjectType; - typedef typename internal::traits::StrideType StrideType; - -public: - - typedef MapBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(RefBase) - - inline Index innerStride() const - { - return StrideType::InnerStrideAtCompileTime != 0 ? m_stride.inner() : 1; - } - - inline Index outerStride() const - { - return StrideType::OuterStrideAtCompileTime != 0 ? m_stride.outer() - : IsVectorAtCompileTime ? this->size() - : int(Flags)&RowMajorBit ? this->cols() - : this->rows(); - } - - RefBase() - : Base(0,RowsAtCompileTime==Dynamic?0:RowsAtCompileTime,ColsAtCompileTime==Dynamic?0:ColsAtCompileTime), - // Stride<> does not allow default ctor for Dynamic strides, so let' initialize it with dummy values: - m_stride(StrideType::OuterStrideAtCompileTime==Dynamic?0:StrideType::OuterStrideAtCompileTime, - StrideType::InnerStrideAtCompileTime==Dynamic?0:StrideType::InnerStrideAtCompileTime) - {} - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(RefBase) - -protected: - - typedef Stride StrideBase; - - template - void construct(Expression& expr) - { - if(PlainObjectType::RowsAtCompileTime==1) - { - eigen_assert(expr.rows()==1 || expr.cols()==1); - ::new (static_cast(this)) Base(expr.data(), 1, expr.size()); - } - else if(PlainObjectType::ColsAtCompileTime==1) - { - eigen_assert(expr.rows()==1 || expr.cols()==1); - ::new (static_cast(this)) Base(expr.data(), expr.size(), 1); - } - else - ::new (static_cast(this)) Base(expr.data(), expr.rows(), expr.cols()); - ::new (&m_stride) StrideBase(StrideType::OuterStrideAtCompileTime==0?0:expr.outerStride(), - StrideType::InnerStrideAtCompileTime==0?0:expr.innerStride()); - } - - StrideBase m_stride; -}; - - -template class Ref - : public RefBase > -{ - typedef internal::traits Traits; - public: - - typedef RefBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Ref) - - - #ifndef EIGEN_PARSED_BY_DOXYGEN - template - inline Ref(PlainObjectBase& expr, - typename internal::enable_if::MatchAtCompileTime),Derived>::type* = 0) - { - Base::construct(expr); - } - template - inline Ref(const DenseBase& expr, - typename internal::enable_if::value&&bool(Traits::template match::MatchAtCompileTime)),Derived>::type* = 0, - int = Derived::ThisConstantIsPrivateInPlainObjectBase) - #else - template - inline Ref(DenseBase& expr) - #endif - { - Base::construct(expr.const_cast_derived()); - } - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Ref) - -}; - -// this is the const ref version -template class Ref - : public RefBase > -{ - typedef internal::traits Traits; - public: - - typedef RefBase Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Ref) - - template - inline Ref(const DenseBase& expr) - { -// std::cout << match_helper::HasDirectAccess << "," << match_helper::OuterStrideMatch << "," << match_helper::InnerStrideMatch << "\n"; -// std::cout << int(StrideType::OuterStrideAtCompileTime) << " - " << int(Derived::OuterStrideAtCompileTime) << "\n"; -// std::cout << int(StrideType::InnerStrideAtCompileTime) << " - " << int(Derived::InnerStrideAtCompileTime) << "\n"; - construct(expr.derived(), typename Traits::template match::type()); - } - - protected: - - template - void construct(const Expression& expr,internal::true_type) - { - Base::construct(expr); - } - - template - void construct(const Expression& expr, internal::false_type) - { - m_object.lazyAssign(expr); - Base::construct(m_object); - } - - protected: - TPlainObjectType m_object; -}; - -} // end namespace Eigen - -#endif // EIGEN_REF_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Replicate.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Replicate.h deleted file mode 100644 index dde86a8349..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Replicate.h +++ /dev/null @@ -1,177 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_REPLICATE_H -#define EIGEN_REPLICATE_H - -namespace Eigen { - -/** - * \class Replicate - * \ingroup Core_Module - * - * \brief Expression of the multiple replication of a matrix or vector - * - * \param MatrixType the type of the object we are replicating - * - * This class represents an expression of the multiple replication of a matrix or vector. - * It is the return type of DenseBase::replicate() and most of the time - * this is the only way it is used. - * - * \sa DenseBase::replicate() - */ - -namespace internal { -template -struct traits > - : traits -{ - typedef typename MatrixType::Scalar Scalar; - typedef typename traits::StorageKind StorageKind; - typedef typename traits::XprKind XprKind; - enum { - Factor = (RowFactor==Dynamic || ColFactor==Dynamic) ? Dynamic : RowFactor*ColFactor - }; - typedef typename nested::type MatrixTypeNested; - typedef typename remove_reference::type _MatrixTypeNested; - enum { - RowsAtCompileTime = RowFactor==Dynamic || int(MatrixType::RowsAtCompileTime)==Dynamic - ? Dynamic - : RowFactor * MatrixType::RowsAtCompileTime, - ColsAtCompileTime = ColFactor==Dynamic || int(MatrixType::ColsAtCompileTime)==Dynamic - ? Dynamic - : ColFactor * MatrixType::ColsAtCompileTime, - //FIXME we don't propagate the max sizes !!! - MaxRowsAtCompileTime = RowsAtCompileTime, - MaxColsAtCompileTime = ColsAtCompileTime, - IsRowMajor = MaxRowsAtCompileTime==1 && MaxColsAtCompileTime!=1 ? 1 - : MaxColsAtCompileTime==1 && MaxRowsAtCompileTime!=1 ? 0 - : (MatrixType::Flags & RowMajorBit) ? 1 : 0, - Flags = (_MatrixTypeNested::Flags & HereditaryBits & ~RowMajorBit) | (IsRowMajor ? RowMajorBit : 0), - CoeffReadCost = _MatrixTypeNested::CoeffReadCost - }; -}; -} - -template class Replicate - : public internal::dense_xpr_base< Replicate >::type -{ - typedef typename internal::traits::MatrixTypeNested MatrixTypeNested; - typedef typename internal::traits::_MatrixTypeNested _MatrixTypeNested; - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Replicate) - - template - inline explicit Replicate(const OriginalMatrixType& a_matrix) - : m_matrix(a_matrix), m_rowFactor(RowFactor), m_colFactor(ColFactor) - { - EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), - THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) - eigen_assert(RowFactor!=Dynamic && ColFactor!=Dynamic); - } - - template - inline Replicate(const OriginalMatrixType& a_matrix, Index rowFactor, Index colFactor) - : m_matrix(a_matrix), m_rowFactor(rowFactor), m_colFactor(colFactor) - { - EIGEN_STATIC_ASSERT((internal::is_same::type,OriginalMatrixType>::value), - THE_MATRIX_OR_EXPRESSION_THAT_YOU_PASSED_DOES_NOT_HAVE_THE_EXPECTED_TYPE) - } - - inline Index rows() const { return m_matrix.rows() * m_rowFactor.value(); } - inline Index cols() const { return m_matrix.cols() * m_colFactor.value(); } - - inline Scalar coeff(Index rowId, Index colId) const - { - // try to avoid using modulo; this is a pure optimization strategy - const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 - : RowFactor==1 ? rowId - : rowId%m_matrix.rows(); - const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 - : ColFactor==1 ? colId - : colId%m_matrix.cols(); - - return m_matrix.coeff(actual_row, actual_col); - } - template - inline PacketScalar packet(Index rowId, Index colId) const - { - const Index actual_row = internal::traits::RowsAtCompileTime==1 ? 0 - : RowFactor==1 ? rowId - : rowId%m_matrix.rows(); - const Index actual_col = internal::traits::ColsAtCompileTime==1 ? 0 - : ColFactor==1 ? colId - : colId%m_matrix.cols(); - - return m_matrix.template packet(actual_row, actual_col); - } - - const _MatrixTypeNested& nestedExpression() const - { - return m_matrix; - } - - protected: - MatrixTypeNested m_matrix; - const internal::variable_if_dynamic m_rowFactor; - const internal::variable_if_dynamic m_colFactor; -}; - -/** - * \return an expression of the replication of \c *this - * - * Example: \include MatrixBase_replicate.cpp - * Output: \verbinclude MatrixBase_replicate.out - * - * \sa VectorwiseOp::replicate(), DenseBase::replicate(Index,Index), class Replicate - */ -template -template -inline const Replicate -DenseBase::replicate() const -{ - return Replicate(derived()); -} - -/** - * \return an expression of the replication of \c *this - * - * Example: \include MatrixBase_replicate_int_int.cpp - * Output: \verbinclude MatrixBase_replicate_int_int.out - * - * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate - */ -template -inline const Replicate -DenseBase::replicate(Index rowFactor,Index colFactor) const -{ - return Replicate(derived(),rowFactor,colFactor); -} - -/** - * \return an expression of the replication of each column (or row) of \c *this - * - * Example: \include DirectionWise_replicate_int.cpp - * Output: \verbinclude DirectionWise_replicate_int.out - * - * \sa VectorwiseOp::replicate(), DenseBase::replicate(), class Replicate - */ -template -const typename VectorwiseOp::ReplicateReturnType -VectorwiseOp::replicate(Index factor) const -{ - return typename VectorwiseOp::ReplicateReturnType - (_expression(),Direction==Vertical?factor:1,Direction==Horizontal?factor:1); -} - -} // end namespace Eigen - -#endif // EIGEN_REPLICATE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ReturnByValue.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ReturnByValue.h deleted file mode 100644 index d66c24ba0f..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/ReturnByValue.h +++ /dev/null @@ -1,88 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2009-2010 Gael Guennebaud -// Copyright (C) 2009-2010 Benoit Jacob -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_RETURNBYVALUE_H -#define EIGEN_RETURNBYVALUE_H - -namespace Eigen { - -/** \class ReturnByValue - * \ingroup Core_Module - * - */ - -namespace internal { - -template -struct traits > - : public traits::ReturnType> -{ - enum { - // We're disabling the DirectAccess because e.g. the constructor of - // the Block-with-DirectAccess expression requires to have a coeffRef method. - // Also, we don't want to have to implement the stride stuff. - Flags = (traits::ReturnType>::Flags - | EvalBeforeNestingBit) & ~DirectAccessBit - }; -}; - -/* The ReturnByValue object doesn't even have a coeff() method. - * So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix. - * So internal::nested always gives the plain return matrix type. - * - * FIXME: I don't understand why we need this specialization: isn't this taken care of by the EvalBeforeNestingBit ?? - */ -template -struct nested, n, PlainObject> -{ - typedef typename traits::ReturnType type; -}; - -} // end namespace internal - -template class ReturnByValue - : internal::no_assignment_operator, public internal::dense_xpr_base< ReturnByValue >::type -{ - public: - typedef typename internal::traits::ReturnType ReturnType; - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(ReturnByValue) - - template - inline void evalTo(Dest& dst) const - { static_cast(this)->evalTo(dst); } - inline Index rows() const { return static_cast(this)->rows(); } - inline Index cols() const { return static_cast(this)->cols(); } - -#ifndef EIGEN_PARSED_BY_DOXYGEN -#define Unusable YOU_ARE_TRYING_TO_ACCESS_A_SINGLE_COEFFICIENT_IN_A_SPECIAL_EXPRESSION_WHERE_THAT_IS_NOT_ALLOWED_BECAUSE_THAT_WOULD_BE_INEFFICIENT - class Unusable{ - Unusable(const Unusable&) {} - Unusable& operator=(const Unusable&) {return *this;} - }; - const Unusable& coeff(Index) const { return *reinterpret_cast(this); } - const Unusable& coeff(Index,Index) const { return *reinterpret_cast(this); } - Unusable& coeffRef(Index) { return *reinterpret_cast(this); } - Unusable& coeffRef(Index,Index) { return *reinterpret_cast(this); } -#endif -}; - -template -template -Derived& DenseBase::operator=(const ReturnByValue& other) -{ - other.evalTo(derived()); - return derived(); -} - -} // end namespace Eigen - -#endif // EIGEN_RETURNBYVALUE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Reverse.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Reverse.h deleted file mode 100644 index e30ae3d281..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Reverse.h +++ /dev/null @@ -1,224 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2006-2008 Benoit Jacob -// Copyright (C) 2009 Ricard Marxer -// Copyright (C) 2009-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_REVERSE_H -#define EIGEN_REVERSE_H - -namespace Eigen { - -/** \class Reverse - * \ingroup Core_Module - * - * \brief Expression of the reverse of a vector or matrix - * - * \param MatrixType the type of the object of which we are taking the reverse - * - * This class represents an expression of the reverse of a vector. - * It is the return type of MatrixBase::reverse() and VectorwiseOp::reverse() - * and most of the time this is the only way it is used. - * - * \sa MatrixBase::reverse(), VectorwiseOp::reverse() - */ - -namespace internal { - -template -struct traits > - : traits -{ - typedef typename MatrixType::Scalar Scalar; - typedef typename traits::StorageKind StorageKind; - typedef typename traits::XprKind XprKind; - typedef typename nested::type MatrixTypeNested; - typedef typename remove_reference::type _MatrixTypeNested; - enum { - RowsAtCompileTime = MatrixType::RowsAtCompileTime, - ColsAtCompileTime = MatrixType::ColsAtCompileTime, - MaxRowsAtCompileTime = MatrixType::MaxRowsAtCompileTime, - MaxColsAtCompileTime = MatrixType::MaxColsAtCompileTime, - - // let's enable LinearAccess only with vectorization because of the product overhead - LinearAccess = ( (Direction==BothDirections) && (int(_MatrixTypeNested::Flags)&PacketAccessBit) ) - ? LinearAccessBit : 0, - - Flags = int(_MatrixTypeNested::Flags) & (HereditaryBits | LvalueBit | PacketAccessBit | LinearAccess), - - CoeffReadCost = _MatrixTypeNested::CoeffReadCost - }; -}; - -template struct reverse_packet_cond -{ - static inline PacketScalar run(const PacketScalar& x) { return preverse(x); } -}; - -template struct reverse_packet_cond -{ - static inline PacketScalar run(const PacketScalar& x) { return x; } -}; - -} // end namespace internal - -template class Reverse - : public internal::dense_xpr_base< Reverse >::type -{ - public: - - typedef typename internal::dense_xpr_base::type Base; - EIGEN_DENSE_PUBLIC_INTERFACE(Reverse) - using Base::IsRowMajor; - - // next line is necessary because otherwise const version of operator() - // is hidden by non-const version defined in this file - using Base::operator(); - - protected: - enum { - PacketSize = internal::packet_traits::size, - IsColMajor = !IsRowMajor, - ReverseRow = (Direction == Vertical) || (Direction == BothDirections), - ReverseCol = (Direction == Horizontal) || (Direction == BothDirections), - OffsetRow = ReverseRow && IsColMajor ? PacketSize : 1, - OffsetCol = ReverseCol && IsRowMajor ? PacketSize : 1, - ReversePacket = (Direction == BothDirections) - || ((Direction == Vertical) && IsColMajor) - || ((Direction == Horizontal) && IsRowMajor) - }; - typedef internal::reverse_packet_cond reverse_packet; - public: - - inline Reverse(const MatrixType& matrix) : m_matrix(matrix) { } - - EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Reverse) - - inline Index rows() const { return m_matrix.rows(); } - inline Index cols() const { return m_matrix.cols(); } - - inline Index innerStride() const - { - return -m_matrix.innerStride(); - } - - inline Scalar& operator()(Index row, Index col) - { - eigen_assert(row >= 0 && row < rows() && col >= 0 && col < cols()); - return coeffRef(row, col); - } - - inline Scalar& coeffRef(Index row, Index col) - { - return m_matrix.const_cast_derived().coeffRef(ReverseRow ? m_matrix.rows() - row - 1 : row, - ReverseCol ? m_matrix.cols() - col - 1 : col); - } - - inline CoeffReturnType coeff(Index row, Index col) const - { - return m_matrix.coeff(ReverseRow ? m_matrix.rows() - row - 1 : row, - ReverseCol ? m_matrix.cols() - col - 1 : col); - } - - inline CoeffReturnType coeff(Index index) const - { - return m_matrix.coeff(m_matrix.size() - index - 1); - } - - inline Scalar& coeffRef(Index index) - { - return m_matrix.const_cast_derived().coeffRef(m_matrix.size() - index - 1); - } - - inline Scalar& operator()(Index index) - { - eigen_assert(index >= 0 && index < m_matrix.size()); - return coeffRef(index); - } - - template - inline const PacketScalar packet(Index row, Index col) const - { - return reverse_packet::run(m_matrix.template packet( - ReverseRow ? m_matrix.rows() - row - OffsetRow : row, - ReverseCol ? m_matrix.cols() - col - OffsetCol : col)); - } - - template - inline void writePacket(Index row, Index col, const PacketScalar& x) - { - m_matrix.const_cast_derived().template writePacket( - ReverseRow ? m_matrix.rows() - row - OffsetRow : row, - ReverseCol ? m_matrix.cols() - col - OffsetCol : col, - reverse_packet::run(x)); - } - - template - inline const PacketScalar packet(Index index) const - { - return internal::preverse(m_matrix.template packet( m_matrix.size() - index - PacketSize )); - } - - template - inline void writePacket(Index index, const PacketScalar& x) - { - m_matrix.const_cast_derived().template writePacket(m_matrix.size() - index - PacketSize, internal::preverse(x)); - } - - const typename internal::remove_all::type& - nestedExpression() const - { - return m_matrix; - } - - protected: - typename MatrixType::Nested m_matrix; -}; - -/** \returns an expression of the reverse of *this. - * - * Example: \include MatrixBase_reverse.cpp - * Output: \verbinclude MatrixBase_reverse.out - * - */ -template -inline typename DenseBase::ReverseReturnType -DenseBase::reverse() -{ - return derived(); -} - -/** This is the const version of reverse(). */ -template -inline const typename DenseBase::ConstReverseReturnType -DenseBase::reverse() const -{ - return derived(); -} - -/** This is the "in place" version of reverse: it reverses \c *this. - * - * In most cases it is probably better to simply use the reversed expression - * of a matrix. However, when reversing the matrix data itself is really needed, - * then this "in-place" version is probably the right choice because it provides - * the following additional features: - * - less error prone: doing the same operation with .reverse() requires special care: - * \code m = m.reverse().eval(); \endcode - * - this API allows to avoid creating a temporary (the current implementation creates a temporary, but that could be avoided using swap) - * - it allows future optimizations (cache friendliness, etc.) - * - * \sa reverse() */ -template -inline void DenseBase::reverseInPlace() -{ - derived() = derived().reverse().eval(); -} - -} // end namespace Eigen - -#endif // EIGEN_REVERSE_H diff --git a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Select.h b/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Select.h deleted file mode 100644 index 87993bbb55..0000000000 --- a/phonelibs/acado/include/acado/external_packages/eigen3/Eigen/src/Core/Select.h +++ /dev/null @@ -1,162 +0,0 @@ -// This file is part of Eigen, a lightweight C++ template library -// for linear algebra. -// -// Copyright (C) 2008-2010 Gael Guennebaud -// -// This Source Code Form is subject to the terms of the Mozilla -// Public License v. 2.0. If a copy of the MPL was not distributed -// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. - -#ifndef EIGEN_SELECT_H -#define EIGEN_SELECT_H - -namespace Eigen { - -/** \class Select - * \ingroup Core_Module - * - * \brief Expression of a coefficient wise version of the C++ ternary operator ?: - * - * \param ConditionMatrixType the type of the \em condition expression which must be a boolean matrix - * \param ThenMatrixType the type of the \em then expression - * \param ElseMatrixType the type of the \em else expression - * - * This class represents an expression of a coefficient wise version of the C++ ternary operator ?:. - * It is the return type of DenseBase::select() and most of the time this is the only way it is used. - * - * \sa DenseBase::select(const DenseBase&, const DenseBase&) const - */ - -namespace internal { -template -struct traits > - : traits -{ - typedef typename traits::Scalar Scalar; - typedef Dense StorageKind; - typedef typename traits::XprKind XprKind; - typedef typename ConditionMatrixType::Nested ConditionMatrixNested; - typedef typename ThenMatrixType::Nested ThenMatrixNested; - typedef typename ElseMatrixType::Nested ElseMatrixNested; - enum { - RowsAtCompileTime = ConditionMatrixType::RowsAtCompileTime, - ColsAtCompileTime = ConditionMatrixType::ColsAtCompileTime, - MaxRowsAtCompileTime = ConditionMatrixType::MaxRowsAtCompileTime, - MaxColsAtCompileTime = ConditionMatrixType::MaxColsAtCompileTime, - Flags = (unsigned int)ThenMatrixType::Flags & ElseMatrixType::Flags & HereditaryBits, - CoeffReadCost = traits::type>::CoeffReadCost - + EIGEN_SIZE_MAX(traits::type>::CoeffReadCost, - traits::type>::CoeffReadCost) - }; -}; -} - -template -class Select : internal::no_assignment_operator, - public internal::dense_xpr_base< Select >::type -{ - public: - - typedef typename internal::dense_xpr_base