MediaWiki API result

This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.

Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.

See the complete documentation, or the API help for more information.

{
    "batchcomplete": "",
    "continue": {
        "gapcontinue": "SNOPT",
        "continue": "gapcontinue||"
    },
    "warnings": {
        "main": {
            "*": "Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/postorius/lists/mediawiki-api-announce.lists.wikimedia.org/> for notice of API deprecations and breaking changes."
        },
        "revisions": {
            "*": "Because \"rvslots\" was not specified, a legacy format has been used for the output. This format is deprecated, and in the future the new format will always be used."
        }
    },
    "query": {
        "pages": {
            "202": {
                "pageid": 202,
                "ns": 0,
                "title": "Runtest",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "[[Category:Utility Functions]]\n==Purpose==\n\nRun all selected problems defined in a problem file for a given solver.\n\n==Calling  Syntax==\n\n<pre>\nruntest(Solver, SolverAlg, probFile, probNumbs, PriLevOpt, wait, PriLev)\n</pre>\n\n==Inputs==\n\n{| class=\"wikitable\"\n!Input||Description\n|-\n|''Solver''||Name of solver, default ''conSolve''.\n|-valign=\"top\"\n|''SolverAlg''||A vector of numbers defining which of the ''Solver ''algorithms to try.   For each element in ''SolverAlg'', all ''probNumbs ''are solved. Leave empty, or set 0 if to use the default algorithm.\n|-valign=\"top\"\n|''probFile''||Problem definition file. ''probFile ''is by default set to ''con prob ''if ''Solver ''is ''conSolve'', ''uc prob'' if ''Solver ''is ''ucSolve ''and so on.\n|-\n|''probNumbs''||A vector with problem numbers to run. If empty, run all problems in ''probFile''.\n|-\n|''PriLevOpt''||Printing level in ''Solver''. Default 2, short information from each iteration.\n|-\n|''wait''||Set ''wait'' to 1 if pause after each problem. Default 1.\n|-\n|''PriLev''||Printing level in ''PrintResult''. Default 5, full information.\n|}\n\n==M-files  Used==\n\n''SolverList.m''\n\n==See Also==\n\n*[[systest]]"
                    }
                ]
            },
            "30": {
                "pageid": 30,
                "ns": 0,
                "title": "SAL",
                "revisions": [
                    {
                        "contentformat": "text/x-wiki",
                        "contentmodel": "wikitext",
                        "*": "[[Category:Manuals]]\n==Overview==\n\nThis guide contains tips and pointers for compiling TOMLAB using MathWorks' Matlab Compiler. Observe that \ncompilation is not possible with a demo license or standard license. A special standalone license is needed.\n\nA few modifications may be needed to TOMLAB before it compiles well with MathWorks' MCC. Traditionally, customers have been compiling QP solver solutions like TOMLAB /Xpress, where only a few m-files are used. Nevertheless, TOMLAB in its entirety will compile fine with a few adjustments.\n\n==Filenames==\n\nMCC 3.0 can experience problems when m-files with mixed-case names are called through ''feval''. Therefore it is recommended to write all routines using lowercase filenames only (or patch MCC 3.0, see Section 7).\nIf a program compiles fine but complains about something similar to:\n\n<pre>\nERROR: Reference to unknown function 'qp_f' from nargin in stand-alone mode.\n</pre>\n\nthe following actions will help:\n\n** Make sure that the all such files are named in the call to MCC.\n\n** Make sure that all references to them are correct. Use a search utility to locate these filenames in the m-files used.\n\n==Using the profiler==\n\nThe Matlab profiler is a very useful tool when preparing for compilation. It should be used to check which files are being used by your application.\n\n<pre>\nprofile on\n...\n...\nprofile report\n</pre>\n\n==Making a minimal copy==\n\nWhen an application runs fine in Matlab mode and one wants to compile it, it is highly recommended to make a minimal TOMLAB copy in which only the m-files and dll's being called are included. The profiler will show which files to add.\n\nThe files should be copied to a single directory, and the application checked so that it runs without ''tomlab/startup.m '' being executed (make sure that the Matlab paths for TOMLAB are not cached). Do not forget the standalone tomlablic.dll and any other dll's. Continue to fill this directory with TOMLAB m-files and dll's until the standalone application is working.\n\nOne can then compile, naming all the dll's the program is using, as well as the m-files called through ''feval''. It is usually a bit of a trial-and-error process before everything is running smoothly.\n\nThe main advantage with creating a minimal TOMLAB is that the final executable size is brought down. For example, on one user case a 4MB executable was reduced to about 700kB when only the essential files were compiled.\n\nIt is recommended not to use the universal driver routine ''tomRun'' (or the optimization toolbox interface) when compiling as it references many unnecessary files. Replace the following code:\n\n<pre>\nProb = conAssign( ... );\n...\n...\nResult = tomRun('snopt', Prob, 0);\n</pre>\nwith:\n<pre>\nProb = conAssign( ... );\n...\n...\nProb = ProbCheck(Prob, 'snopt'); Result = snoptTL(Prob);\n</pre>\n\n==A Simple Example==\n\nTo compile the following code, in ''test.m''.\n\n<source lang=\"matlab\">\n% ---------------------------------------------------------------- \nfunction f = test\n\nprobfile = 'con_prob';\nprobNumber = 10; \nask = []; \nProb = [];\n\nProb = probInit(probfile, probNumber, ask, Prob); \nResult = conSolve(Prob);\nPrintResult(Result);\n\nf = Result.f_k;\n% ----------------------------------------------------------------\n</source>\n\nwith a TOMLAB /SOL license (which means that QPOPT is chosen as the QP subsolver in conSolve), the profiler and a little trial-and-error will show that the following m-files are needed:\n\n<code>\n{|\n\n|BoundInit.m||LineSearch.m||SOLGet.m\n\n|-\n\n|ComputeQR.m||LinearConstr.m||SOLSet.m\n\n|-\n\n|CreateProbQP.m||NonlinConstr.m||StateDef.m\n\n|-\n\n|DefPar.m||PrintResult.m||checkType.m\n\n|-\n\n|GetSolver.m||ProbCheck.m||conProbSet.m\n\n|-\n\n|LagMult.m||ProbDef.m||conSolve.m\n\n|-\n\n|LineParamDef.m||ProbGate.m||conVarDef.m\n\n|-\n\n|LineParamSet.m||ResultDef.m||con_H.m\n\n|-\n\n|con_c.m||defblbu.m||nlp_dc.m\n\n|-\n\n|con_d2c.m||endSolve.m||nlp_f.m\n\n|-\n\n|con_dc.m||globalGet.m||nlp_g.m\n\n|-\n\n|con_f.m||globalSave.m||optParamDef.m\n\n|-\n\n|con_fm.m||iniSolve.m||optParamSet.m\n\n|-\n\n|con_g.m||mFiles.m||probInit.m\n\n|-\n\n|con_gm.m||nlp_H.m||qpProbSet.m\n\n|-\n\n|con_prob.m||nlp_c.m||qpVarDef.m\n\n|-\n\n|qp_Hess.m||test.m||\n\n|-\n\n|qp_f.m||tomSolve.m||\n\n|-\n\n|qp_fX.m||tomlabVersion.m||\n\n|-\n\n|qp_g.m||xnargin.m||\n\n|-\n\n|qp_gX.m||xprint.m||\n\n|-\n\n|qp_H.m||xprinte.m||\n\n|-\n\n|qp_prob.m||xxx_prob.m||\n\n|-\n\n|qpoptTL.m||||\n\n|-\n\n|}\n</code>\n\nand these dll's:\n\n<code>\n{|\n|qpopt.dll||tomlablic.dll||tomsol.dll\n|}\n</code>\n\nThe compile command to execute is:\n\n<pre>\nmcc -m test.m qpopt.dll tomsol.dll tomlablic.dll ...\n:con_prob con_f con_g con_H con_c con_dc con_d2c qp_f qp_g \n:qp_H\n</pre>\n\nNotice how a number of m-files must be named here. If not, upon execution there will be errors like:\n\n<pre>\nERROR: Reference to unknown function 'qp_f' from nargin in stand-alone mode.\n</pre>\n\nStill, there may be warnings about missing functions, however this is not a problem if one has checked which m-files are needed for the application to work. An alternative is to compile all TOMLAB m-files, but thereby increasing both size and compile time. \n\nThe example should run fine:\n\n<pre>\n>> ! test.exe\n\n===== * * * =================================================================== * * * \nTOMLAB SOL - stand-alone test license\n=====================================================================================\nProblem: con_prob - 10: Schittkowski 66. Eckhardt f_k          0.518163274278335420\n                                     User given f(x_*)         0.518163274099999960\n                                     sum(\\|constr|)            0.000000000003534950\n                                     f(x_k) + sum(|constr|)    0.518163274281870370\n                                     f(x_0)                    0.579999999999999960\n\n\nSolver: conSolve. EXIT=0. INFORM=1. \nSchittkowski SQP algorithm, analytic Hessian \nOptimal solution found\nIteration points are close\n\nFuncEv 66 GradEv 66 ConstrEv 66 Iter 43\nCPU time: 0.375000 sec. Elapsed time: 0.375000 sec. \nStarting vector x:\nx_0: 0.000000 1.050000 2.900000\nOptimal vector x:\nx_k: 0.184116 1.202155 3.327280\nUser given stationary point x_* (1): - Minimum point \nx_*: 0.184126 1.202168 3.327322\nLagrange multipliers v. Vector length 5:\nv_k: 0.000000e+000 0.000000e+000 0.000000e+000 6.654713e-001 2.000045e-001\nGradient g_k:\ng_k: -8.000000e-001 0.000000e+000 2.000000e-001 \ncErr -6.852297e-013 -2.849720e-012\nProjected gradient gPr:\ngPr: -1.006538e-006 -1.210015e-006 -4.026060e-006\n   NonLLow 1 NonLLow 2\nv: 6.654706e-001 2.000040e-001\n\n=== * * * ================================================== * * *\n</pre>\n\n==6 Potential problems==\n\nA few problems may occur when compiling TOMLAB. For example TOMLAB /MAD cannot be compiled and needs to be replaced with dummy files.\n\n===6.1 P-code===\n\nIt is not possible to compile p-coded files if they are present.\n\nThe following messages may appear when the example above is compiled:\n\n<pre>\nerror LNK2001: unresolved external symbol _mlfNGetinternalderivs. \nerror LNK2001: unresolved external symbol _mlfNGetvalue.\nerror LNK2001: unresolved external symbol _mlfNGetderivs.\n</pre>\n\nThe problem is resolved by copying the files in ''tomlab/mad/@dummy ''to ''tomlab/mad ''and removing everything else in the latter.\n\n===6.2 Mex files===\n\nIf using a more recent version of the Matlab Compiler the following error or similar may occur:\n\n<pre>\n\"C:\\PROGRAM FILES\\MATLAB\\R2006A\\BIN\\MEX.PL: Error: mbuild cannot \nlink to 'npsol.dll' directly. Instead, you must link to the file \n'npsol.lib' which corresponds to 'npsol.dll'.\"\n</pre>\n\nThe problem is resolved by renaming files with extension ''dll ''to ''mexw32''. It is also possible to update to the most recent version of TOMLAB if using version Matlab R2007a or above.\n\nThe following error may also be displayed:\n\n<pre>\nERROR: Function 'help' is not implemented in standalone mode. \n\nEXITING\n</pre>\n\nThis means that a TOMLAB dll (mex) used by application has not been named in the mcc call.\n\n===6.3 startup.m===\n\n''startup.m'' may be executed when running mcc if still in path. If so rename the file to ''startuptomlab.m.''\n\n===6.4 Shared dlls===\n\nThe shared dlls included with TOMLAB are located in ''tomlab/shared''. The location of this folder needs to be in the environment variable <code>PATH</code> for deployed units.\n\nPlease contact [mailto:support@tomopt.com support@tomopt.com] for all other problems.\n\n==7 Calling TOMLAB from C/C++==\n\nThis section describes how to create a standalone shared library with TOMLAB functionality using the MCC\ncompiler.\n\nThe guide covers MCC 3 as well as MCC 4. If using MCC 3, make sure to patch it to R13SP1.\n\n===7.1 Creating a stand alone shared library===\n\nThe procedure to create a standalone shared library of TOMLAB files is identical to creating a standalone application, except for the commands to compile and link the files. As described earlier, copy all needed m-files and mex-files to a single directory. If needed, create new m-files as an interface between TOMLAB and C/C++. These can be used as entry points to the shared library (although, all m-files can be used as entry points).\n\nA suitable entry point could be an m-file taking F, c, A, b_L, b_U, x_L and x_U matrices as input, generating a QP Prob struct out of this, and calling a suitable solver. Only the results of interest, for example the optimal vector x and objective function value, could be returned.\n\nAfter all MATLAB files have been put in a single directory, compile them into a shared library using the following command:\n\n<pre>\n> mcc -B csharedlib:<lib-name> <m-files> <mex-files>\n</pre>\n\nThis creates a shared library: <code>&lt;lib-name&gt;</code> with extension depending on platform (.dll on Windows, .so on Linux). If the client to use the shared library is written in C++ one can build a C++ shared library supporting exception handling and C++ classes for handling the MATLAB arrays. The command to compile a C++ shared library is:\n\n<pre>\n> mcc -B cpplib:<library name> <m-files> <mex-files>\n</pre>\n\nFor more detailed information about this, refer to:\n[http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/ http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/] \n\n===7.2 Calling the shared library from C/C++===\n\nThe new shared library now contains entry points for all files compiled with MCC; mex-files as well as m-files. Each m-file has two library functions that may call it:\n\n<pre>\nmlxFunctionname \nmlfFunctionname\n</pre>\n\nNotice that the first character in the function name is always upper case. The rest of the characters are always lower case, regardless of the case of the original function.\n\nThe difference between the two functions prefixed with mlx and mlf is the way the arguments are passed. The mlx-function expects the arguments like this:\n\n<pre>\nextern void mlxSolveqp(int nlhs, mxArray \\*plhs\\[\\], int nrhs, mxArray \\*prhs\\[\\]);\n</pre>\n\njust like a mex-file (Refer to the MATLAB documentation for more details and information on this.)\n\nThe mlf-function is perhaps more user friendly, as it looks more like the original function call in MATLAB. Observe that the arguments to the mlf-functions differ between MCC 3 and MCC 4.\nThe MATLAB function:\n\n<pre>\nfunction \\[x, f\\] = solveqp(F, c, A, b_L, b_U, x_L, x_U)\n</pre>\n\nis declared in the standalone library as follows when using MCC 4:\n\n<pre>\nextern void mlfSolveqp(int nargout, mxArray\\*\\* x, mxArray\\*\\* f, mxArray\\* F\n                       , mxArray\\* c, mxArray\\* A, mxArray\\* b_L\n                       , mxArray\\* b_U, mxArray\\* x_L, mxArray\\* x_U);\n</pre>\n\nA MATLAB function without left hand side arguments do not have the nargout and pointer to pointer arguments. The same MATLAB function is declared like this when using MCC 3:\n\n<pre>\nextern mxArray \\* mlfSolveqp(mxArray \\* \\* f, \n                             mxArray \\* F, \n                             mxArray \\* c, \n                             mxArray \\* A,\n                             mxArray \\* b_L, \n                             mxArray \\* b_U, \n                             mxArray \\* x_L, \n                             mxArray \\* x_U);\n</pre>\n\nThe return value is the first left hand side parameter; the MATLAB x in this case.\n\nIn order to call these function in the shared library from a client application, there are some tasks that must be completed before anything else. First of all, one has to include a header file in the application generated by the MCC compiler when compiling the library. The name of the file is the name of the library plus the extension .h. Each time the shared library is recompiled a new header file will be generated. This header file includes all necessary function declarations needed when calling a shared library, setting up input data and reading output data. No other header files need to be included in order to use the shared library. \n\nBefore using any of the MATLAB API functions, a function <code>mclInitializeApplication()</code> has to be called. This only applies to MCC 4 though. In MCC 3 there is no <code>mclInitializeApplication()</code>-function.\n\nBefore calling any of the functions in the shared library, an initialization function has to be called. The name of this function is: <code>&lt;lib-name&gt;Initialize()</code>, where <code>&lt;lib-name&gt;</code> is the name of the library (including the <code>lib</code> prefix on Linux).\n\nWhen these two (or one in MCC 3) functions have been called, all m- and mex-files are callable from within the application using the prefixes mlf or mlx. At this point the application could for example read measurement data from a device or read input data from a user interface, then formulate an optimization problem and call TOMLAB through the shared library. It is recommended to write m-files for compilation with the shared library to act as an interface between the application and TOMLAB as it is usually easier to handle MATLAB data in the MATLAB language than in C.\n\nWhen all calls to the shared library are done, a termination function should be called: <lib-name>Terminate()\nwhere <code>&lt;lib-name&gt;</code> is the name of the library (including the lib prefix on Linux).\nWhen the MATLAB API functions are not needed anymore, call <code>mclTerminateApplication()</code>. This only applies to MCC 4.\nTo compile the application, use the mbuild utility: \nOn Windows:\n\n<pre>\n> mbuild <source code files> <lib-name>.lib\n</pre>\n\nwhere <code>&lt;source code files&gt;</code> are the source code files for the application, and <code>&lt;lib-\nname&gt;</code> is the name of the shared library generated by MCC earlier.\nOn Linux:\n\n<pre>\n> mbuild <source code files> <lib-name> -L. -I.\n</pre>\n\nwhere <code>&lt;source code files&gt;</code> are the source code files for the application, and <code>&lt;lib-name&gt;</code> is the shared library generated by MCC earlier ''without ''the lib-prefix and ''without ''the extension.\n\n===7.3 TOMLAB /CPLEX QP solver example===\n\nThe TOMLAB distribution includes an example running TOMLAB /CPLEX for a QP problem from a separate\nC application. It is available in the TOMLAB distribution in the /examples/sal/sallib directory. \n\nIn summary, the example was constructed like this:\n\n# An m-file called ''solveqp.m ''was created to take simple input in the form of matrices for F, c, A, b L, b U, x L and x U. This m-file creates a QP Prob structure from these matrices and runs the TOMLAB /CPLEX solver through ''tomRun ''and returns the optimal vector x and objective function value.\n# The profiler in MATLAB was turned on and the solveqp function was called with some QP data. When a solution was obtained, the profile report command displayed the m- and mex-files used during the execution.\n# The files were copied to a project directory for the new shared library.\n# In ''xnargin.m'', some changes were made in order to have more descriptive error messages when failing to find a specific function. See ''xnargin.m ''for instructions on what to change.\n# The library was built using the MCC compiler. (See the make file for the example for details).\n# A simple client application was written creating input data for the ''solveqp.m ''function, calling it and writing the results to the screen. (See the Appendix A for example code).\n# The application was built using the mbuild command. (See the make file of the example for details).\n# The application was run, and there were some error messages reporting missing files.\n# The missing files were added to the command building the library, and the library was rebuilt.\n# Step 8 and 9 were repeated a few of times until everything was working smoothly.\n\nSource files for the simple client application (''application.c'') and the interface m-file (''solveqp.m'') are available in Appendix A of this document.\n\n==8 Calling TOMLAB from Microsoft Excel==\n\nThis section contains a simple description of how to call the TOMLAB solvers from Microsoft Excel using the\nMatlab Builder for Excel. Matlab Builder for Excel is an extension to the Matlab Compiler.\n\n===8.1 Creating a stand alone Excel Add-In===\n\nThe first step is to make a selection of TOMLAB m-files and mex-files needed in the stand alone program and to create a suitable entry point. See the beginning of section 7.1. Do not forget to include tomlablic.dll.\nAfter all Matlab files have been put in a single directory, compile them into an Excel Add-In using the following command:\n\n<pre>\n> mcc -B cexcel:<addin_name>,<addin_name>,<version_number> <m-file(s)>\n</pre>\n\nwhere <code>&lt;addin_name&gt;</code> is the name of the Add-In to create, and <code>&lt;version_number&gt;</code> is the version number of the Add-In, for example: 1.0.\n\n(Notice: This is tested using MCC 4 only.)\n\nThis creates several new files, most of which are only used temporarily during the compilation by the Matlab\nCompiler. The important files are:\n\n<pre>\n<addin_name>_<version_number>.dll\n<addin_name>.ctf\n<addin_name>.bas\n</pre>\n\nThe <code>.bas</code>-file is just an example of Excel Macro code in Visual Basic. This should be imported to the Excel workbook from where TOMLAB is called, but it often has to be modified in order to be useable. It is good as a template to start from though.\n\nThe <code>.dll</code>- and <code>.ctf</code>-files are the needed runtime files. They have to be in the same directory as the Excel workbook when making the TOMLAB calls.\n\n===8.2 Calling the Add-In from Excel===\n\nTo be able to call the Add-In, one must create a link between the Add-In and Excel. This is done through the\nVisual Basic Editor in Excel.\n\nIn Excel, start the Visual Basic Editor: <code>Tools -> Macro -> Visual Basic Editor</code>\n\nThen, in the Visual Basic Editor, import the .bas-file created during the compilation by Matlab Builder for Excel:\n<code>\nFile -> Import File...\n</code>\n\nAll m-files mentioned in the compilation command corresponds to one Visual Basic function. A function can be called from an Excel worksheet by writing something like this in a cell:\n\n<pre>\n=function_to_call(argument1, argument2, ...)\n</pre>\n\nThis could be suitable if the chosen entry point returns a scalar value. The arguments may be ranges of cells, which is an analogy for matrices in Matlab. The cell is then filled with the first element in the first returned matrix of function_to_call. In most cases this does not satisfy the needs, and one has to customize the Visual Basic code. \n\nOne is often interested in the solution vector x, and perhaps to call TOMLAB from Excel via a macro. Then the function should be rewritten as a subroutine, setting the variables/matrices to be sent to TOMLAB to ranges of the Excel worksheet. This includes both input variables/matrices and output variables/matrices. When the subroutine has been written it can be called from the menu: <code>Tools -> Macro -> Macros...</code>\n\n===8.3 TOMLAB /CPLEX LP example===\n\nThe TOMLAB distribution includes an example running TOMLAB /CPLEX for an LP problem from an Excel workbook. It is available in the TOMLAB distribution in the /examples/sal/excel directory.\n\nIn summary, the example was constructed like this:\n\n# An m-file called ''solvelp.m ''was created to take simple input in the form of matrices for c, A, x_L, x_U, b_L and b_U. This m-file simply passes the matrices to cplex.m from where the CPLEX solver is called.\n# The profiler in Matlab was turned on and the solvelp function was called with some LP data. When CPLEX returned, the profile report command displayed the m- and mex-files used during the execution.\n# These files were copied to a dedicated project directory for the new Excel example.\n# The Excel Add-In was built using the MCC compiler.\n# Excel was started and the Visual Basic Editor was opened. The example <code>.bas</code>-file was imported. The Visual Basic <code>solvelp</code> function was replaced by a <code>solvelp</code> subroutine.\n# A problem example was set up in the Excel worksheet. A push button was added and assigned the solvelp macro.\n# The workbook was saved as lpsolver.xls.\n# The macro was run by clicking on the pushbutton. No error messages appeared, and the example was done.\n# In case an error message appears, it would likely be about missing m-functions. The missing files would need to be added and the project recompiled.\n\n==9 Calling TOMLAB using MATLAB Engine==\n\nThis section describes an example of calling TOMLAB using the MATLAB Engine from a stand alone application written i C.\n\n===9.1 The MATLAB Engine and TOMLAB===\n\nA stand alone application can utilize the MATLAB Engine API to literally start a MATLAB session and run commands in it as if it was a normal MATLAB session. The application can also create MATLAB data structures and put to the workspace of the MATLAB Engine workspace. \n\nOne can use the MATLAB Engine to call TOMLAB if one wants to be able to use the TOMLAB functionality as if it was run from MATLAB directly. For example, one advantage of the MATLAB Engine is when upgrading TOMLAB. Then your applications will use the upgraded version of TOMLAB without the need of recompiling the application. A drawback with the MATLAB Engine is that a MATLAB session requires much memory and takes more time to start than a compiled stand alone TOMLAB solution.\n\nCalling TOMLAB and MATLAB using the MATLAB Engine doesn't require a TOMLAB stand alone license\n(TOMLAB SAL) or a MATLAB compiler license.\n\n===9.2 Compiling the example===\n\nIn the TOMLAB distribution in directory: /examples/sal/engine there is an example of how to call TOMLAB\nusing the MATLAB Engine.\n\nOn Windows make sure you have set the <code>PATH</code> environment properly according to the section: <code>Building the example -> Setting paths</code> in the README file in <code>/examples/sal/engine</code>. If you are using Microsoft Visual Studio C++ then call exmake.bat. If you are using another compiler then you could need to change the name of MATLAB compiler options file in exmake.bat. Some compilers need special treatment with floating point exception handling. See the MATLAB help for more information on this. The command line for compiling this stand alone application using the MATLAB Engine looks like this:\n\n<pre>\n> mex -f <engine options file> tomeng.c\n</pre>\n\nwhere <code>&lt;engine options file&gt;</code> is the options file to use for the compiler used by mex. In case of Microsoft Studio Visual C++ it is: <code><matlabroot>\\bin\\win32\\mexopts\\msvc50engmatopts.bat</code>\n\nOn Unix make sure dynamic library path is set according to the section: Building the <code>example -> Setting</code> paths in the README file in <code>/examples/sal/engine</code>. Then call <code>exmake.sh</code> to compile the application. The command line for compiling a stand alone application under Unix looks exactly as it does for Windows, but the <code>&lt;engine options file&gt;</code> is: <code>&lt;matlabroot&gt;/bin/engopts.sh</code> instead.\n\n===9.3 Running the example===\n\nThe example application sets up a QP problem by passing data to the MATLAB Engine workspace from the C part of the application. Then it uses a TOMLAB assign routine to create a TOMLAB representation of the problem and solves it using an arbitrary solver, chosen by the user. \n\nThe executable created when compiling the application should be called with two arguments:\n\n<pre>\n> tomeng <tomlab directory> <TOMLAB QP solver name>\n</pre>\n\nAssume TOMLAB is installed in c:\\tomlab on a Windows system and /usr/local/tomlab on a Unix system and we want to use snopt to solve the problem, then the execution of tomeng would look like this respectively:\n\n<pre>\n> tomeng c:\\tomlab snopt\n</pre>\n\nor\n\n<pre>\n> ./tomeng /usr/local/tomlab snopt\n</pre>\n\nIf any of the steps during program execution fails it probably is because of an invalid TOMLAB installation at the chosen TOMLAB directory, an invalid TOMLAB license or a bad solver choice.\nThe source code of this example is situated in <code>/examples/sal/engine/tomeng.c</code>.\n\n==A Example source files==\n\nSource code for the simple client application. Notice that the preprocessor flag MCC4 has to be defined when compiling this file for use with MCC 4.\n\n'''Source code for application.c'''\n\n'''Source code for the interface function '''''solveqp.m '':"
                    }
                ]
            }
        }
    }
}