Changes v2.3.0 to v2.4.0

jgillis edited this page Sep 25, 2015 · 13 revisions
  • The class SymbolicOCP has been renamed DaeBuilder and is being step-by-step refactored, without maintaining backwards compatibility. This can affect the ability to import models from Modelica. Part of #1358
  • The class SymbolicNLP has been renamed NlpBuilder and is being step-by-step refactored, without maintaining backwards compatibility. Cf. #1421
  • The format for autogenerated C code has changed. Generated code now includes a work vector that has to be provided by the calling function. This is part of refactoring work of CasADi's virtual machines aimed at improved efficiency and thread safety. Part of #1356
  • The way symbolic expressions are printed to screen has changed. The new way is more compact and corresponds closer to how the expressions are actually stored inside CasADi. The new format begins by defining a set of comma-separated intermediate expressions before the actual expression is defined, cf. #1408
  • Support for (short-circuiting) if-else statements and conditional switches has been added, cf. #1413.
  • The "matrix multiplication and add", mul(A, B, C) has been renamed mac(A, B, C) (for multiply-accumulate). Other overloads of mul works like before, cf. #1488.
  • The constructors of all functor classes in CasADi - e.g. SXFunction, MXFunction, Integrator etc. - has been refactored. The new syntax always begins with the display name of the function and ends with a dictionary of options. All options have to be provided via this options structure and use of "setOption" is now deprecated. Calling the "init" step is also no longer needed. In this release, both the old and the new syntaxes are still supported, but support for the old syntax will be dropped in next release. For examples and further details, see the bottom of this page and the updated user guide. Cf. #1350.
  • The way functor classes are called and evaluated numerically has been refactored. With the new syntax there are two ways of calling a functor: by (1) providing a vector or the required length or by (2) providing a dictionary using the input/output schemes of the function. Use of the syntax setInput-evaluate-getOutput for numerical evaluation should also be replaced with this new syntax. Support for the old syntax will be dropped in a future release. For more details, see the example below or the updated user guide. Cf. #1306
  • Added map & mapaccum functionality: see sysid example.
  • New feature: just-in-time (JIT) compilation: see sysid example.
  • New interfaces: ecos, mosek

Example of old and new syntax for creating and calling function objects:

New constructor syntax:

x = SX.sym('x')
# Old syntax
f = SXFunction([x],[sin(x)])
f.setOption('verbose', True)
f.init()
# New syntax
f = SXFunction('f', [x],[sin(x)], {'verbose':True}) 

New evaluation syntax:

# Old syntax
f.setInput(2.4)
f.evaluate()
y = f.getOutput()
# New syntax
[y] = f([2.4])