MATLAB Production Server C Client  R2021b
component: mds_c_client, module directory: deployment_server/client/c/mps, copyright: MathWorks
Data Structures | Macros | Typedefs | Enumerations | Functions
client.h File Reference
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
+ Include dependency graph for client.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  matlabStackFrame
 Entry in the MATLAB runtime stack. More...
 
struct  mpsClientRuntime
 MATLAB Production Server client API container. More...
 
struct  mpsErrorInfo
 Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context. More...
 
struct  mpsErrorInfoGeneric
 Details about an error not caused by non-200 HTTP errors or MATLAB execution errors. More...
 
struct  mpsErrorInfoHTTP
 Details about a non-200 HTTP response. More...
 
struct  mpsErrorInfoMATLAB
 Details about a MATLAB execution error. More...
 

Macros

#define MPS_CLIENT_1_0   0x00010000
 Copyright (C) 2015 The MathWorks, Inc. More...
 
#define MPS_CLIENT_1_1   0x00010001
 
#define MPS_DLL_EXPORT_SYM
 
#define MPS_DLL_IMPORT_SYM
 
#define MPS_MAX_VER   MPS_CLIENT_1_1
 
#define MPSCLIENT_PUBLISHED_API   MPS_DLL_EXPORT_SYM
 
#define MPSCLIENT_PUBLISHED_API_EXTERN_C   extern "C" MPSCLIENT_PUBLISHED_API
 
#define TMW_BITS_PER_INT   -1
 
#define TMW_BITS_PER_LONG   -1
 
#define TMW_BITS_PER_SCHAR   -1
 
#define TMW_BITS_PER_SHRT   -1
 

Typedefs

typedef UINT16_T CHAR16_T
 
typedef struct matlabStackFrame matlabStackFrame
 Entry in the MATLAB runtime stack. More...
 
typedef struct mpsArray mpsArray
 Fundamental type underlying MATLAB data. More...
 
typedef CHAR16_T mpsChar
 
typedef enum mpsClassID mpsClassID
 Flag identifying class of array. More...
 
typedef struct mpsClientConfig mpsClientConfig
 Structure containing information configuring the connection between the client and a server instance. More...
 
typedef struct mpsClientContext mpsClientContext
 Establishes a connection between a client and a server. More...
 
typedef struct mpsClientRuntime mpsClientRuntime
 MATLAB Production Server client API container. More...
 
typedef enum mpsComplexity mpsComplexity
 Flag specifying whether array has imaginary components. More...
 
typedef struct mpsErrorInfo mpsErrorInfo
 Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context. More...
 
typedef struct mpsErrorInfoGeneric mpsErrorInfoGeneric
 Details about an error not caused by non-200 HTTP errors or MATLAB execution errors. More...
 
typedef struct mpsErrorInfoHTTP mpsErrorInfoHTTP
 Details about a non-200 HTTP response. More...
 
typedef struct mpsErrorInfoMATLAB mpsErrorInfoMATLAB
 Details about a MATLAB execution error. More...
 
typedef enum mpsErrorInfoType mpsErrorInfoType
 Types of errors that can be thrown when MATLAB function invocation fails. More...
 
typedef uint64 mpsIndex
 Type that represents index values, such as indices into arrays. More...
 
typedef bool mpsLogical
 Type for logical array. More...
 
typedef uint64 mpsSize
 Type that represents size values, such as array dimensions. More...
 
typedef enum mpsStatus mpsStatus
 Error status codes for all methods which are part of the MATLAB Production Server client API. More...
 
typedef uint64_t uint64
 

Enumerations

enum  mpsClassID {
  mpsUINT8_CLASS, mpsINT8_CLASS, mpsUINT16_CLASS, mpsINT16_CLASS,
  mpsUINT32_CLASS, mpsINT32_CLASS, mpsUINT64_CLASS, mpsINT64_CLASS,
  mpsSINGLE_CLASS, mpsDOUBLE_CLASS, mpsLOGICAL_CLASS, mpsCHAR_CLASS,
  mpsSTRUCT_CLASS, mpsCELL_CLASS
}
 Flag identifying class of array. More...
 
enum  mpsComplexity { mpsREAL, mpsCOMPLEX }
 Flag specifying whether array has imaginary components. More...
 
enum  mpsErrorInfoType { MPS_HTTP_ERROR_INFO, MPS_MATLAB_ERROR_INFO, MPS_GENERIC_ERROR_INFO }
 Types of errors that can be thrown when MATLAB function invocation fails. More...
 
enum  mpsStatus { MPS_OK, MPS_FAILURE }
 Error status codes for all methods which are part of the MATLAB Production Server client API. More...
 

Functions

int mpsAddField (mpsArray *mlArr, const char *fieldname)
 Add a field to an array of struct. More...
 
char * mpsArrayToString (const mpsArray *mlArr)
 Copy the character data of a string array into a C-style string. More...
 
mpsIndex mpsCalcSingleSubscript (const mpsArray *mlArr, mpsSize nsubs, mpsIndex *subs)
 Determine how many elements there are between the beginning of an array and a given element. More...
 
mpsArraympsCreateCellArray (mpsSize ndim, const mpsSize *dims)
 Create a N-dimensional cell array. More...
 
mpsArraympsCreateCellMatrix (mpsSize m, mpsSize n)
 Create a two-dimensional cell array. More...
 
mpsArraympsCreateCharArray (mpsSize ndim, const mpsSize *dims)
 Create a N-dimensional string array. More...
 
mpsArraympsCreateCharMatrixFromStrings (mpsSize rows, const char **str)
 Create a two-dimensional string array. More...
 
mpsArraympsCreateDoubleMatrix (mpsSize m, mpsSize n, mpsComplexity complexFlag)
 Create a two-dimensional double-precision floating-point array. More...
 
mpsArraympsCreateDoubleScalar (double value)
 Create a scalar double-precision floating-point array. More...
 
mpsArraympsCreateLogicalArray (mpsSize ndim, const mpsSize *dims)
 Create a N-dimensional logical array. More...
 
mpsArraympsCreateLogicalMatrix (mpsSize m, mpsSize n)
 Create a two-dimensional logical array. More...
 
mpsArraympsCreateLogicalScalar (mpsLogical value)
 Create a scalar logical array. More...
 
mpsArraympsCreateNumericArray (mpsSize ndim, const mpsSize *dims, mpsClassID classid, mpsComplexity complexFlag)
 Create a two-dimensional numeric array. More...
 
mpsArraympsCreateNumericMatrix (mpsSize m, mpsSize n, mpsClassID classid, mpsComplexity complexFlag)
 Create a two-dimensional numeric array. More...
 
mpsArraympsCreateSparse (mpsSize m, mpsSize n, mpsSize nzmax, mpsComplexity complexFlag)
 Create a two-dimensional sparse array. More...
 
mpsArraympsCreateSparseLogicalMatrix (mpsSize m, mpsSize n, mpsSize nzmax)
 Create a two-dimensional sparse array. More...
 
mpsArraympsCreateString (const char *str)
 Create a string array. More...
 
mpsArraympsCreateStructArray (mpsSize ndim, const mpsSize *dims, int nfields, const char **fieldnames)
 Create a N-dimensional struct array. More...
 
mpsArraympsCreateStructMatrix (mpsSize m, mpsSize n, int nfields, const char **fieldnames)
 Create a two-dimensional struct array. More...
 
void mpsDestroyArray (mpsArray *mlArr)
 Deallocate the memory occupied by an array. More...
 
mpsArraympsDuplicateArray (const mpsArray *mlArr)
 Make a deep copy of input mpsArray. More...
 
void mpsFree (void *data)
 Deallocate heap space using the MATLAB memory management facility. More...
 
mpsArraympsGetCell (const mpsArray *mlArr, mpsIndex index)
 Access the contents of a cell array at a specified index. More...
 
mpsCharmpsGetChars (const mpsArray *mlArr)
 Access the data in a character array. More...
 
mpsClassID mpsGetClassID (const mpsArray *mlArr)
 Determine the class of an array. More...
 
const char * mpsGetClassName (const mpsArray *mlArr)
 Determine the class of an array. More...
 
void * mpsGetData (const mpsArray *mlArr)
 Access the real numeric data in an array. More...
 
const mpsSizempsGetDimensions (const mpsArray *mlArr)
 Determine how many elements are in each dimension of an array. More...
 
size_t mpsGetElementSize (const mpsArray *mlArr)
 Determine the number of bytes in each data element of an array. More...
 
mpsArraympsGetField (const mpsArray *mlArr, mpsIndex index, const char *fieldname)
 Access the value held in the specified element of the specified field of an array of struct. More...
 
mpsArraympsGetFieldByNumber (const mpsArray *mlArr, mpsIndex index, int fieldnumber)
 Access the value held in the specified field number at the indexed element of an array. More...
 
const char * mpsGetFieldNameByNumber (const mpsArray *mlArr, int fieldnumber)
 Determine the name of a field in an array of struct given the field number. More...
 
int mpsGetFieldNumber (const mpsArray *mlArr, const char *fieldname)
 Determine the number of a field in an array of struct given the field name. More...
 
void * mpsGetImagData (const mpsArray *mlArr)
 Access the imaginary data in an array. More...
 
const char * mpsGetInitializationErrorMessage (void)
 Returns the error message representing the failure in global initialization that sets up the programming environment for MATLAB Production Server client. More...
 
mpsIndexmpsGetIr (const mpsArray *mlArr)
 Determine the starting address of the ir array in a sparse array. More...
 
mpsIndexmpsGetJc (const mpsArray *mlArr)
 Determine the starting address of the jc array in a sparse array. More...
 
mpsLogicalmpsGetLogicals (const mpsArray *mlArr)
 Access the first logical element in an array. More...
 
size_t mpsGetM (const mpsArray *mlArr)
 Determine the first dimension of an array. More...
 
size_t mpsGetN (const mpsArray *mlArr)
 Determine the number of columns in an array. More...
 
mpsSize mpsGetNumberOfDimensions (const mpsArray *mlArr)
 Determine the number of dimensions in an array. More...
 
size_t mpsGetNumberOfElements (const mpsArray *mlArr)
 Determine how many elements are in the array. More...
 
int mpsGetNumberOfFields (const mpsArray *mlArr)
 Determine the number of fields in an array of struct. More...
 
mpsSize mpsGetNzmax (const mpsArray *mlArr)
 Determine the number of non-zero elements in a sparse array. More...
 
double * mpsGetPi (const mpsArray *mlArr)
 Access the imaginary data in an array of doubles. More...
 
double * mpsGetPr (const mpsArray *mlArr)
 Access the real data in an array of doubles. More...
 
double mpsGetScalar (const mpsArray *mlArr)
 Determine the value of the first real element of an array. More...
 
int mpsGetString (const mpsArray *mlArr, char *str, mpsSize len)
 Copy the character data of a string array into a C-style string. More...
 
mpsClientRuntimempsInitialize (void)
 Set up the programming environment for MATLAB Production Server client based on version 1.0. More...
 
mpsClientRuntimempsInitializeEx (int version)
 Set up the programming environment for MATLAB Production Server client based on the version number provided by the user. More...
 
bool mpsIsCell (const mpsArray *mlArr)
 Determine whether input is cell array. More...
 
bool mpsIsChar (const mpsArray *mlArr)
 Determine whether mpsArray represents a string array. More...
 
bool mpsIsClass (const mpsArray *mlArr, const char *classname)
 Determine whether array is member of specified class. More...
 
bool mpsIsComplex (const mpsArray *mlArr)
 Determine whether mpsArray contains an imaginary part. More...
 
bool mpsIsDouble (const mpsArray *mlArr)
 Determine whether mpsArray represents data as double-precision, floating-point numbers. More...
 
bool mpsIsEmpty (const mpsArray *mlArr)
 Determine whether array is empty. More...
 
bool mpsIsInt16 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as signed 16-bit integers. More...
 
bool mpsIsInt32 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as signed 32-bit integers. More...
 
bool mpsIsInt64 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as signed 64-bit integers. More...
 
bool mpsIsInt8 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as signed 8-bit integers. More...
 
bool mpsIsLogical (const mpsArray *mlArr)
 Determine whether mpsArray represents data as mpsLogical. More...
 
bool mpsIsLogicalScalar (const mpsArray *mlArr)
 Determine whether MATLAB treats the scalar data in the mpsArray as logical or numerical. More...
 
bool mpsIsLogicalScalarTrue (const mpsArray *mlArr)
 Determine whether scalar array is true. More...
 
bool mpsIsNumeric (const mpsArray *mlArr)
 Determine whether mpsArray contains numeric data. More...
 
bool mpsIsSingle (const mpsArray *mlArr)
 Determine whether mpsArray represents data as single-precision, floating-point numbers. More...
 
bool mpsIsSparse (const mpsArray *mlArr)
 Determine whether array is sparse. More...
 
bool mpsIsStruct (const mpsArray *mlArr)
 Determine whether input is structure array. More...
 
bool mpsIsUint16 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as unsigned 16-bit integers. More...
 
bool mpsIsUint32 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as unsigned 32-bit integers. More...
 
bool mpsIsUint64 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as unsigned 64-bit integers. More...
 
bool mpsIsUint8 (const mpsArray *mlArr)
 Determine whether mpsArray represents data as unsigned 8-bit integers. More...
 
void mpsRemoveField (mpsArray *mlArr, int fieldnumber)
 Delete a field from an array of struct. More...
 
void mpsSetCell (mpsArray *mlArr, mpsIndex index, mpsArray *value)
 Set the contents of a cell array at a specified index. More...
 
int mpsSetDimensions (mpsArray *mlArr, const mpsSize *dims, mpsSize ndim)
 Modify number of dimensions and size of each dimension of an array. More...
 
void mpsSetField (mpsArray *mlArr, mpsIndex index, const char *fieldname, mpsArray *pvalue)
 Set the value held in the specified element of the specified field of an array of struct. More...
 
void mpsSetFieldByNumber (mpsArray *mlArr, mpsIndex index, int fieldnumber, mpsArray *pvalue)
 Set the value held in the specified field number at the indexed element of an array. More...
 
void mpsSetM (mpsArray *mlArr, mpsSize m)
 Set the first dimension of an array. More...
 
void mpsSetN (mpsArray *mlArr, mpsSize n)
 Set the number of columns in an array. More...
 
void mpsSetNzmax (mpsArray *mlArr, mpsSize nzmax)
 Set the maximum number of non-zero elements in a sparse array. More...
 
void mpsTerminate (void)
 Perform global clean up of resources consumed by MATLAB Production Server client environment. More...
 

Macro Definition Documentation

◆ MPS_CLIENT_1_0

#define MPS_CLIENT_1_0   0x00010000

Copyright (C) 2015 The MathWorks, Inc.

Definition at line 7 of file client.h.

◆ MPS_CLIENT_1_1

#define MPS_CLIENT_1_1   0x00010001

Definition at line 8 of file client.h.

◆ MPS_DLL_EXPORT_SYM

#define MPS_DLL_EXPORT_SYM

Definition at line 21 of file client.h.

◆ MPS_DLL_IMPORT_SYM

#define MPS_DLL_IMPORT_SYM

Definition at line 22 of file client.h.

◆ MPS_MAX_VER

#define MPS_MAX_VER   MPS_CLIENT_1_1

Definition at line 11 of file client.h.

◆ MPSCLIENT_PUBLISHED_API

#define MPSCLIENT_PUBLISHED_API   MPS_DLL_EXPORT_SYM

Definition at line 26 of file client.h.

◆ MPSCLIENT_PUBLISHED_API_EXTERN_C

#define MPSCLIENT_PUBLISHED_API_EXTERN_C   extern "C" MPSCLIENT_PUBLISHED_API

Definition at line 32 of file client.h.

◆ TMW_BITS_PER_INT

#define TMW_BITS_PER_INT   -1

Definition at line 79 of file client.h.

◆ TMW_BITS_PER_LONG

#define TMW_BITS_PER_LONG   -1

Definition at line 91 of file client.h.

◆ TMW_BITS_PER_SCHAR

#define TMW_BITS_PER_SCHAR   -1

Definition at line 103 of file client.h.

◆ TMW_BITS_PER_SHRT

#define TMW_BITS_PER_SHRT   -1

Definition at line 115 of file client.h.

Typedef Documentation

◆ CHAR16_T

typedef UINT16_T CHAR16_T

Definition at line 136 of file client.h.

◆ matlabStackFrame

Entry in the MATLAB runtime stack.

◆ mpsArray

typedef struct mpsArray mpsArray

Fundamental type underlying MATLAB data.

Use any of the mpsCreate functions to create data, and the corresponding mpsDestroyArray function to free memory.

Definition at line 55 of file client.h.

◆ mpsChar

typedef CHAR16_T mpsChar

Definition at line 139 of file client.h.

◆ mpsClassID

typedef enum mpsClassID mpsClassID

Flag identifying class of array.

◆ mpsClientConfig

Structure containing information configuring the connection between the client and a server instance.

See also
mpsClientRuntime

Definition at line 61 of file client.h.

◆ mpsClientContext

Establishes a connection between a client and a server.

An instance of mpsClientContext should not be shared across multiple threads at the same time. In a multi-threaded environment, each thread should get its own instance of mpsClientContext.

See also
mpsClientRuntime

Definition at line 69 of file client.h.

◆ mpsClientRuntime

MATLAB Production Server client API container.

mpsClientRuntime provides functions needed to create the MATLAB Production Server client execution context, configure it, and use the execution context to execute MATLAB functions hosted by an MATLAB Production Server instance.

◆ mpsComplexity

Flag specifying whether array has imaginary components.

◆ mpsErrorInfo

typedef struct mpsErrorInfo mpsErrorInfo

Error thrown when a MATLAB function is invoked by the MATLAB Production Server client context.

◆ mpsErrorInfoGeneric

Details about an error not caused by non-200 HTTP errors or MATLAB execution errors.

◆ mpsErrorInfoHTTP

Details about a non-200 HTTP response.

◆ mpsErrorInfoMATLAB

Details about a MATLAB execution error.

◆ mpsErrorInfoType

Types of errors that can be thrown when MATLAB function invocation fails.

◆ mpsIndex

typedef uint64 mpsIndex

Type that represents index values, such as indices into arrays.

Definition at line 51 of file client.h.

◆ mpsLogical

typedef bool mpsLogical

Type for logical array.

All logical mpsArrays store their data elements as mpsLogical rather than as bool.

Definition at line 156 of file client.h.

◆ mpsSize

typedef uint64 mpsSize

Type that represents size values, such as array dimensions.

Definition at line 48 of file client.h.

◆ mpsStatus

typedef enum mpsStatus mpsStatus

Error status codes for all methods which are part of the MATLAB Production Server client API.

◆ uint64

typedef uint64_t uint64

Definition at line 44 of file client.h.

Enumeration Type Documentation

◆ mpsClassID

enum mpsClassID

Flag identifying class of array.

Enumerator
mpsUINT8_CLASS 

Identifies a numeric mpsArray whose data is stored as either unsigned char or byte.

mpsINT8_CLASS 

Identifies a numeric mpsArray whose data is stored as either char or byte.

mpsUINT16_CLASS 

Identifies a numeric mpsArray whose data is stored as unsigned short.

mpsINT16_CLASS 

Identifies a numeric mpsArray whose data is stored as short.

mpsUINT32_CLASS 

Identifies a numeric mpsArray whose data is stored as unsigned int.

mpsINT32_CLASS 

Identifies a numeric mpsArray whose data is stored as int.

mpsUINT64_CLASS 

Identifies a numeric mpsArray whose data is stored as unsigned long long.

mpsINT64_CLASS 

Identifies a numeric mpsArray whose data is stored as long long.

mpsSINGLE_CLASS 

Identifies a numeric mpsArray whose data is stored as float.

mpsDOUBLE_CLASS 

Identifies a numeric mpsArray whose data is stored as double.

mpsLOGICAL_CLASS 

Identifies a logical mpsArray.

mpsCHAR_CLASS 

Identifies a string mpsArray.

mpsSTRUCT_CLASS 

Identifies a structure mpsArray.

mpsCELL_CLASS 

Identifies a cell mpsArray.

Definition at line 269 of file client.h.

◆ mpsComplexity

Flag specifying whether array has imaginary components.

Enumerator
mpsREAL 

Identifies an mpsArray with no imaginary components.

mpsCOMPLEX 

Identifies an mpsArray with imaginary components.

Definition at line 261 of file client.h.

◆ mpsErrorInfoType

Types of errors that can be thrown when MATLAB function invocation fails.

Enumerator
MPS_HTTP_ERROR_INFO 

A non-200 HTTP response when MATLAB function in invoked from the client.

MPS_MATLAB_ERROR_INFO 

A MATLAB execution error.

MPS_GENERIC_ERROR_INFO 

Any error other than MATLAB execution error or a non-200 HTTP response.

Definition at line 159 of file client.h.

◆ mpsStatus

enum mpsStatus

Error status codes for all methods which are part of the MATLAB Production Server client API.

Enumerator
MPS_OK 

Successful invocation of a method.

MPS_FAILURE 

Failure.

Definition at line 250 of file client.h.

Function Documentation

◆ mpsAddField()

int mpsAddField ( mpsArray mlArr,
const char *  fieldname 
)

Add a field to an array of struct.

Parameters
mlArrPointer to an mpsArray of struct.
fieldnameName of the field to add.
Returns
Field number on success, or -1 if inputs are invalid or an out-of-memory condition occurs.

◆ mpsArrayToString()

char* mpsArrayToString ( const mpsArray mlArr)

Copy the character data of a string array into a C-style string.

Parameters
mlArrPointer to an mpsArray having the mpsCHAR_CLASS class.
Returns
NULL terminated string.

◆ mpsCalcSingleSubscript()

mpsIndex mpsCalcSingleSubscript ( const mpsArray mlArr,
mpsSize  nsubs,
mpsIndex subs 
)

Determine how many elements there are between the beginning of an array and a given element.

Arrays in MATLAB are stored column-major, so accessing the elements of an mpsArray using standard C indexing will produce a transposed array. This function accepts row-major dimension subscripts and calculate the proper column-major index to the the desired value.

Parameters
mlArrPointer to an mpsArray.
nsubsNumber of elements in the subs array.
subsArray of integers. Each value in the array specifies that dimension's subscript.
Returns
Number of elements, or index, between the start of the array and the specified subscript. This is the linear index equivalent of the subscripts calculated as if the array were stored column major as they are in MATLAB.

◆ mpsCreateCellArray()

mpsArray* mpsCreateCellArray ( mpsSize  ndim,
const mpsSize dims 
)

Create a N-dimensional cell array.

Parameters
ndimNumber of dimensions. If you specify a value that is less than 2, the number of dimensions is automatically set to 2.
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
Returns
Pointer to the created array.

◆ mpsCreateCellMatrix()

mpsArray* mpsCreateCellMatrix ( mpsSize  m,
mpsSize  n 
)

Create a two-dimensional cell array.

Parameters
mNumber of rows.
nNumber of columns.
Returns
Pointer to the created array.

◆ mpsCreateCharArray()

mpsArray* mpsCreateCharArray ( mpsSize  ndim,
const mpsSize dims 
)

Create a N-dimensional string array.

Parameters
ndimNumber of dimensions. If you specify a value that is less than 2, the number of dimensions is automatically set to 2.
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
Returns
Pointer to the created array.

◆ mpsCreateCharMatrixFromStrings()

mpsArray* mpsCreateCharMatrixFromStrings ( mpsSize  rows,
const char **  str 
)

Create a two-dimensional string array.

Parameters
rowsNumber of rows in the created array. The value you specify is the number of strings in str.
strArray of strings containing at least rows strings.
Returns
Pointer to the created array.

◆ mpsCreateDoubleMatrix()

mpsArray* mpsCreateDoubleMatrix ( mpsSize  m,
mpsSize  n,
mpsComplexity  complexFlag 
)

Create a two-dimensional double-precision floating-point array.

Parameters
mNumber of rows.
nNumber of columns.
complexFlagIf the array is to contain imaginary data, set to mpsCOMPLEX. Otherwise, set to mpsREAL.
Returns
Pointer to the created array.

◆ mpsCreateDoubleScalar()

mpsArray* mpsCreateDoubleScalar ( double  value)

Create a scalar double-precision floating-point array.

Parameters
valueValue to which you want to initialize the array.
Returns
Pointer to the created array.

◆ mpsCreateLogicalArray()

mpsArray* mpsCreateLogicalArray ( mpsSize  ndim,
const mpsSize dims 
)

Create a N-dimensional logical array.

Parameters
ndimNumber of dimensions. If you specify a value that is less than 2, the number of dimensions is automatically set to 2.
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
Returns
Pointer to the created array.

◆ mpsCreateLogicalMatrix()

mpsArray* mpsCreateLogicalMatrix ( mpsSize  m,
mpsSize  n 
)

Create a two-dimensional logical array.

Parameters
mNumber of rows.
nNumber of columns.
Returns
Pointer to the created array.

◆ mpsCreateLogicalScalar()

mpsArray* mpsCreateLogicalScalar ( mpsLogical  value)

Create a scalar logical array.

Parameters
valueLogical value to which you want to initialize the array.
Returns
Pointer to the created array.

◆ mpsCreateNumericArray()

mpsArray* mpsCreateNumericArray ( mpsSize  ndim,
const mpsSize dims,
mpsClassID  classid,
mpsComplexity  complexFlag 
)

Create a two-dimensional numeric array.

Parameters
ndimNumber of dimensions. If you specify a value that is less than 2, the number of dimensions is automatically set to 2.
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
classidIdentifier for the class of the array, which determines the way the numerical data is represented in memory.
complexFlagIf the array is to contain imaginary data, set to mpsCOMPLEX. Otherwise, set to mpsREAL.
Returns
Pointer to the created array.

◆ mpsCreateNumericMatrix()

mpsArray* mpsCreateNumericMatrix ( mpsSize  m,
mpsSize  n,
mpsClassID  classid,
mpsComplexity  complexFlag 
)

Create a two-dimensional numeric array.

Parameters
mNumber of rows.
nNumber of columns.
classidIdentifier for the class of the array, which determines the way the numerical data is represented in memory.
complexFlagIf the array is to contain imaginary data, set to mpsCOMPLEX. Otherwise, set to mpsREAL.
Returns
Pointer to the created array.

◆ mpsCreateSparse()

mpsArray* mpsCreateSparse ( mpsSize  m,
mpsSize  n,
mpsSize  nzmax,
mpsComplexity  complexFlag 
)

Create a two-dimensional sparse array.

Parameters
mNumber of rows.
nNumber of columns.
nzmaxNumber of elements to allocate to hold the pr, ir, and, if complexFlag is mpsCOMPLEX), pi arrays. Set the value to be greater than or equal to the number of non-zero elements you plan to put into the array, but make sure that nzmax is less than or equal to m*n.
complexFlagIf the array is to contain imaginary data, set to mpsCOMPLEX. Otherwise, set to mpsREAL.
Returns
Pointer to the created array.

◆ mpsCreateSparseLogicalMatrix()

mpsArray* mpsCreateSparseLogicalMatrix ( mpsSize  m,
mpsSize  n,
mpsSize  nzmax 
)

Create a two-dimensional sparse array.

Parameters
mNumber of rows.
nNumber of columns.
nzmaxNumber of elements to allocate to hold the data. Set the value to be greater than or equal to the number of non-zero elements you plan to put into the array, but make sure that nzmax is less than or equal to m*n.
Returns
Pointer to the created array.

◆ mpsCreateString()

mpsArray* mpsCreateString ( const char *  str)

Create a string array.

Parameters
strString that is to serve as the initial data.
Returns
Pointer to the created array.

◆ mpsCreateStructArray()

mpsArray* mpsCreateStructArray ( mpsSize  ndim,
const mpsSize dims,
int  nfields,
const char **  fieldnames 
)

Create a N-dimensional struct array.

Parameters
ndimNumber of dimensions. If you specify a value that is less than 2, the number of dimensions is automatically set to 2.
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
nfieldsNumber of fields in each element.
fieldnamesList of field names.
Returns
Pointer to the created array.

◆ mpsCreateStructMatrix()

mpsArray* mpsCreateStructMatrix ( mpsSize  m,
mpsSize  n,
int  nfields,
const char **  fieldnames 
)

Create a two-dimensional struct array.

Parameters
mNumber of rows.
nNumber of columns.
nfieldsNumber of fields in each element.
fieldnamesList of field names.
Returns
Pointer to the created array.

◆ mpsDestroyArray()

void mpsDestroyArray ( mpsArray mlArr)

Deallocate the memory occupied by an array.

mpsDestroyArray not only deallocates the memory occupied by the array's characteristics fields, but also deallocates all the array's associated data arrays, such as pr and pi for complex arrays, ir and jc for sparse arrays, fields of structure arrays, and cells of cell arrays. Do not call mpsDestroyArray on an array you are returning it in a left side argument.

Parameters
mlArrArray to destroy

◆ mpsDuplicateArray()

mpsArray* mpsDuplicateArray ( const mpsArray mlArr)

Make a deep copy of input mpsArray.

Parameters
mlArrPointer to an mpsArray to be duplicated
Returns
Duplicate copy of input mpsArray

◆ mpsFree()

void mpsFree ( void *  data)

Deallocate heap space using the MATLAB memory management facility.

Parameters
dataPointer to the beginning of any memory parcel allocated by MATLAB.

◆ mpsGetCell()

mpsArray* mpsGetCell ( const mpsArray mlArr,
mpsIndex  index 
)

Access the contents of a cell array at a specified index.

Parameters
mlArrPointer to an mpsArray cell array.
indexNumber of elements in the cell array between the first element and the desired one.
Returns
Pointer to the data in specified cell of the array.

◆ mpsGetChars()

mpsChar* mpsGetChars ( const mpsArray mlArr)

Access the data in a character array.

Parameters
mlArrPointer to an mpsArray.
Returns
Pointer to the imaginary data elements of the array.

◆ mpsGetClassID()

mpsClassID mpsGetClassID ( const mpsArray mlArr)

Determine the class of an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Numeric identifier of the class of the array.

◆ mpsGetClassName()

const char* mpsGetClassName ( const mpsArray mlArr)

Determine the class of an array.

Parameters
mlArrPointer to an mpsArray.
Returns
String identifier of the class of the array.

◆ mpsGetData()

void* mpsGetData ( const mpsArray mlArr)

Access the real numeric data in an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Pointer to the real data elements of the array.

◆ mpsGetDimensions()

const mpsSize* mpsGetDimensions ( const mpsArray mlArr)

Determine how many elements are in each dimension of an array.

Parameters
mlArrPointer to an mpsArray
Returns
Pointer to the first element in the dimensions array. Each integer in the dimensions array represents the number of elements in a particular dimension. The array is not NULL terminated.

◆ mpsGetElementSize()

size_t mpsGetElementSize ( const mpsArray mlArr)

Determine the number of bytes in each data element of an array.

Parameters
mlArrPointer to an mpsArray
Returns
Number of bytes required to store one element of the specified array.

◆ mpsGetField()

mpsArray* mpsGetField ( const mpsArray mlArr,
mpsIndex  index,
const char *  fieldname 
)

Access the value held in the specified element of the specified field of an array of struct.

Parameters
mlArrPointer to an mpsArray of struct.
indexIndex of the desired element.
fieldnameName of the field whose value you want to extract.
Returns
Pointer to the mpsArray in the specified field at the specified fieldname.

◆ mpsGetFieldByNumber()

mpsArray* mpsGetFieldByNumber ( const mpsArray mlArr,
mpsIndex  index,
int  fieldnumber 
)

Access the value held in the specified field number at the indexed element of an array.

Parameters
mlArrPointer to an mpsArray of struct.
indexIndex of the desired element.
fieldnumberNumber of a field in the struct.
Returns
Pointer to the mpsArray in the specified field for the desired element.

◆ mpsGetFieldNameByNumber()

const char* mpsGetFieldNameByNumber ( const mpsArray mlArr,
int  fieldnumber 
)

Determine the name of a field in an array of struct given the field number.

Parameters
mlArrPointer to an mpsArray of struct.
fieldnumberNumber of a field in the struct.
Returns
Pointer to the name of the specified field.

◆ mpsGetFieldNumber()

int mpsGetFieldNumber ( const mpsArray mlArr,
const char *  fieldname 
)

Determine the number of a field in an array of struct given the field name.

Parameters
mlArrPointer to an mpsArray of struct.
fieldnameName of a field in the struct.
Returns
Field number of the specified field.

◆ mpsGetImagData()

void* mpsGetImagData ( const mpsArray mlArr)

Access the imaginary data in an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Pointer to the imaginary data elements of the array.

◆ mpsGetInitializationErrorMessage()

const char* mpsGetInitializationErrorMessage ( void  )

Returns the error message representing the failure in global initialization that sets up the programming environment for MATLAB Production Server client.

◆ mpsGetIr()

mpsIndex* mpsGetIr ( const mpsArray mlArr)

Determine the starting address of the ir array in a sparse array.

Parameters
mlArrPointer to a sparse mpsArray.
Returns
Pointer to the first element in the ir array.

◆ mpsGetJc()

mpsIndex* mpsGetJc ( const mpsArray mlArr)

Determine the starting address of the jc array in a sparse array.

Parameters
mlArrPointer to a sparse mpsArray.
Returns
Pointer to the first element in the jc array.

◆ mpsGetLogicals()

mpsLogical* mpsGetLogicals ( const mpsArray mlArr)

Access the first logical element in an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Pointer to the first logical element in the array.

◆ mpsGetM()

size_t mpsGetM ( const mpsArray mlArr)

Determine the first dimension of an array.

Parameters
mlArrPointer to an mpsArray.
Returns
First dimension of the array.

◆ mpsGetN()

size_t mpsGetN ( const mpsArray mlArr)

Determine the number of columns in an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Number of columns in the array.

◆ mpsGetNumberOfDimensions()

mpsSize mpsGetNumberOfDimensions ( const mpsArray mlArr)

Determine the number of dimensions in an array.

Parameters
mlArrPointer to an mpsArray
Returns
Number of dimensions in the array.

◆ mpsGetNumberOfElements()

size_t mpsGetNumberOfElements ( const mpsArray mlArr)

Determine how many elements are in the array.

Parameters
mlArrPointer to an mpsArray
Returns
Number of elements in the array.

◆ mpsGetNumberOfFields()

int mpsGetNumberOfFields ( const mpsArray mlArr)

Determine the number of fields in an array of struct.

Parameters
mlArrPointer to an mpsArray of struct.
Returns
Number of fields.

◆ mpsGetNzmax()

mpsSize mpsGetNzmax ( const mpsArray mlArr)

Determine the number of non-zero elements in a sparse array.

Parameters
mlArrPointer to a sparse mpsArray.
Returns
Number of elements allocated to hold non-zero entries in the specified sparse array.

◆ mpsGetPi()

double* mpsGetPi ( const mpsArray mlArr)

Access the imaginary data in an array of doubles.

Parameters
mlArrPointer to an mpsArray of doubles.
Returns
Pointer to the imaginary data elements of the array.

◆ mpsGetPr()

double* mpsGetPr ( const mpsArray mlArr)

Access the real data in an array of doubles.

Parameters
mlArrPointer to an mpsArray of doubles.
Returns
Pointer to the first element of the real data.

◆ mpsGetScalar()

double mpsGetScalar ( const mpsArray mlArr)

Determine the value of the first real element of an array.

Parameters
mlArrPointer to an mpsArray.
Returns
Pointer to the value of the first real element of the array.

◆ mpsGetString()

int mpsGetString ( const mpsArray mlArr,
char *  str,
mpsSize  len 
)

Copy the character data of a string array into a C-style string.

Parameters
mlArrPointer to an mpsArray having the mpsCHAR_CLASS class.
strStarting location for the string. mpsGetString writes the character data into str and then terminates the string with a NULL character.
lenSize, in bytes, of destination buffer pointed to by str.
Returns
0 on success or if strlen == 0, and 1 on failure.

◆ mpsInitialize()

mpsClientRuntime* mpsInitialize ( void  )

Set up the programming environment for MATLAB Production Server client based on version 1.0.

This global initialization should be done just once in the program. Invoking it multiple times will return the pointer to the same underlying API struct.

Returns
A pointer to the MATLAB Production Server client API struct.

◆ mpsInitializeEx()

mpsClientRuntime* mpsInitializeEx ( int  version)

Set up the programming environment for MATLAB Production Server client based on the version number provided by the user.

This function can only be used to access the versions above 1.0. To use version 1.0, please use mpsInitialize() function. This global initialization should be done just once in the program. Invoking it multiple times will return the pointer to the same underlying API struct.

Returns
A pointer to the MATLAB Production Server client API struct corresponding to the version provided.

◆ mpsIsCell()

bool mpsIsCell ( const mpsArray mlArr)

Determine whether input is cell array.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array has the class mxCELL_CLASS, and false otherwise.

◆ mpsIsChar()

bool mpsIsChar ( const mpsArray mlArr)

Determine whether mpsArray represents a string array.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array has the class mpsCHAR_CLASS, and false otherwise.

◆ mpsIsClass()

bool mpsIsClass ( const mpsArray mlArr,
const char *  classname 
)

Determine whether array is member of specified class.

Parameters
mlArrPointer to an mpsArray
classnameArray category you are testing. You can specify any one of the following predefined constants:
Value of classname Corresponding Class
cell mpsCELL_CLASS
char mpsCHAR_CLASS
double mpsDOUBLE_CLASS
int8 mpsINT8_CLASS
int16 mpsINT16_CLASS
int32 mpsINT32_CLASS
int64 mpsINT64_CLASS
logical mpsLOGICAL_CLASS
single mpsSINGLE_CLASS
struct mpsSTRUCT_CLASS
uint8 mpsUINT8_CLASS
uint16 mpsUINT16_CLASS
uint32 mpsUINT32_CLASS
uint64 mpsUINT64_CLASS
<class_name> <class_id>

In the table, <class_name> represents the name of a specific MATLAB custom object. You can also specify one of your own class names.

Returns
True if the array has the class classname, and false otherwise.

◆ mpsIsComplex()

bool mpsIsComplex ( const mpsArray mlArr)

Determine whether mpsArray contains an imaginary part.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array contains an imaginary part, and false otherwise.

◆ mpsIsDouble()

bool mpsIsDouble ( const mpsArray mlArr)

Determine whether mpsArray represents data as double-precision, floating-point numbers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array stores its data as double-precision, floating-point numbers, and false otherwise.

◆ mpsIsEmpty()

bool mpsIsEmpty ( const mpsArray mlArr)

Determine whether array is empty.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array has no data, and false otherwise.

◆ mpsIsInt16()

bool mpsIsInt16 ( const mpsArray mlArr)

Determine whether mpsArray represents data as signed 16-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as signed 16-bit integers, and false otherwise.

◆ mpsIsInt32()

bool mpsIsInt32 ( const mpsArray mlArr)

Determine whether mpsArray represents data as signed 32-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as signed 32-bit integers, and false otherwise.

◆ mpsIsInt64()

bool mpsIsInt64 ( const mpsArray mlArr)

Determine whether mpsArray represents data as signed 64-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as signed 64-bit integers, and false otherwise.

◆ mpsIsInt8()

bool mpsIsInt8 ( const mpsArray mlArr)

Determine whether mpsArray represents data as signed 8-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as signed 8-bit integers, and false otherwise.

◆ mpsIsLogical()

bool mpsIsLogical ( const mpsArray mlArr)

Determine whether mpsArray represents data as mpsLogical.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as mpsLogical, and false otherwise.

◆ mpsIsLogicalScalar()

bool mpsIsLogicalScalar ( const mpsArray mlArr)

Determine whether MATLAB treats the scalar data in the mpsArray as logical or numerical.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as mpsLogical and has 1-by-1 dimensions, and false otherwise.

◆ mpsIsLogicalScalarTrue()

bool mpsIsLogicalScalarTrue ( const mpsArray mlArr)

Determine whether scalar array is true.

Parameters
mlArrPointer to an mpsArray
Returns
True if the value of the array's logical, scalar element is true, and false otherwise.

◆ mpsIsNumeric()

bool mpsIsNumeric ( const mpsArray mlArr)

Determine whether mpsArray contains numeric data.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array contains numeric data, and false otherwise.

◆ mpsIsSingle()

bool mpsIsSingle ( const mpsArray mlArr)

Determine whether mpsArray represents data as single-precision, floating-point numbers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array stores its data as single-precision, floating-point numbers, and false otherwise.

◆ mpsIsSparse()

bool mpsIsSparse ( const mpsArray mlArr)

Determine whether array is sparse.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array is sparse, and false otherwise.

◆ mpsIsStruct()

bool mpsIsStruct ( const mpsArray mlArr)

Determine whether input is structure array.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as mpsStruct, and false otherwise.

◆ mpsIsUint16()

bool mpsIsUint16 ( const mpsArray mlArr)

Determine whether mpsArray represents data as unsigned 16-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as unsigned 16-bit integers, and false otherwise.

◆ mpsIsUint32()

bool mpsIsUint32 ( const mpsArray mlArr)

Determine whether mpsArray represents data as unsigned 32-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as unsigned 32-bit integers, and false otherwise.

◆ mpsIsUint64()

bool mpsIsUint64 ( const mpsArray mlArr)

Determine whether mpsArray represents data as unsigned 64-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as unsigned 64-bit integers, and false otherwise.

◆ mpsIsUint8()

bool mpsIsUint8 ( const mpsArray mlArr)

Determine whether mpsArray represents data as unsigned 8-bit integers.

Parameters
mlArrPointer to an mpsArray
Returns
True if the array represents data as unsigned 8-bit integers, and false otherwise.

◆ mpsRemoveField()

void mpsRemoveField ( mpsArray mlArr,
int  fieldnumber 
)

Delete a field from an array of struct.

Parameters
mlArrPointer to an mpsArray of struct.
fieldnumberNumber of the field to delete.

◆ mpsSetCell()

void mpsSetCell ( mpsArray mlArr,
mpsIndex  index,
mpsArray value 
)

Set the contents of a cell array at a specified index.

Parameters
mlArrPointer to an mpsArray cell array.
indexNumber of elements in the cell array between the first element and the desired one.
valuePointer to new value for the cell. You can put an mpsArray of any type into a cell. You can even put another cell mpsArray into a cell.

◆ mpsSetDimensions()

int mpsSetDimensions ( mpsArray mlArr,
const mpsSize dims,
mpsSize  ndim 
)

Modify number of dimensions and size of each dimension of an array.

Parameters
mlArrPointer to an mpsArray
dimsDimensions array. Each element in the dimensions array contains the size of the array in that dimension.
ndimNumber of dimensions.
Returns
0 on success, and 1 on failure.

◆ mpsSetField()

void mpsSetField ( mpsArray mlArr,
mpsIndex  index,
const char *  fieldname,
mpsArray pvalue 
)

Set the value held in the specified element of the specified field of an array of struct.

Parameters
mlArrPointer to an mpsArray of struct.
indexIndex of the desired element.
fieldnameName of a field in the struct. The field must exist.
pvaluePointer to an mpsArray containing the data you want to assign to fieldname.

◆ mpsSetFieldByNumber()

void mpsSetFieldByNumber ( mpsArray mlArr,
mpsIndex  index,
int  fieldnumber,
mpsArray pvalue 
)

Set the value held in the specified field number at the indexed element of an array.

Parameters
mlArrPointer to an mpsArray of struct.
indexIndex of the desired element.
fieldnumberNumber of a field in the struct.
pvaluePointer to the mpsArray containing the data to set.

◆ mpsSetM()

void mpsSetM ( mpsArray mlArr,
mpsSize  m 
)

Set the first dimension of an array.

Parameters
mlArrPointer to an mpsArray.
mFirst dimension of the array.

◆ mpsSetN()

void mpsSetN ( mpsArray mlArr,
mpsSize  n 
)

Set the number of columns in an array.

Parameters
mlArrPointer to an mpsArray.
nNumber of columns in the array.

◆ mpsSetNzmax()

void mpsSetNzmax ( mpsArray mlArr,
mpsSize  nzmax 
)

Set the maximum number of non-zero elements in a sparse array.

Parameters
mlArrPointer to a sparse mpsArray.
nzmaxNumber of elements allocated to hold the arrays pointed to by ir, pr, and pi. Set nzmax greater than or equal to the number of non-zero elements in the array, but set it to be less than or equal to the number of rows times the number of columns. If you specify a value of 0, the value of nzmax is automatically set to 1.

◆ mpsTerminate()

void mpsTerminate ( void  )

Perform global clean up of resources consumed by MATLAB Production Server client environment.

This should be done just once in the application. Invoking it multiple times will have no effect.