toC

Purpose

Export of PWA/PWQ function to C-code

Syntax

controller.toC('function')
controller.toC('function','filename')

Description

The function toC() exports given piecewise affine (PWA) or piecewise quadratic (PWQ) function to C-language including a binary search routine. The PWA/PWQ function must be attached to the BinTreePolyUnion object.

If the file name is not provided, the default output name is mpt_getInput.

The export routine generates two files on the output: The file mpt_getInput_mex can be compiled inside Matlab and used for fast evaluation of PWA/PWQ function. The compilation is invoked by mex routine as follows:

mex mpt_getInput_mex

The function toC() can export the floating point numbers to single or double precision. The default setting is double but this can be modified in global options

modules.geometry.unions.BinTreePolyUnion.toC.

Input Arguments

function

Name of the attached PWA/PWQ function to export.

Class: char

filename

Base name of the file to be generated.

Class: char


© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch

© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk