Functions

matlab_gs_get_last_error.c File Reference

#include <stdio.h>
#include <string.h>
#include <matrix.h>
#include <mex.h>
#include "grpc.h"
#include "matlab_gs.h"
Include dependency graph for matlab_gs_get_last_error.c:

Go to the source code of this file.

Functions

void matlab_gs_get_last_error (int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])

Detailed Description

Matlab client call

Definition in file matlab_gs_get_last_error.c.


Function Documentation

void matlab_gs_get_last_error ( int  nlhs,
mxArray *  plhs[],
int  nrhs,
const mxArray *  prhs[] 
)

Return the error_code for the last error in the right hand side by calling grpc_get_last_error.

Parameters:
nlhs - Number of left hand side arguments from Matlab
plhs - Pointer to left hand side arguments from Matlab
rlhs - Number of right hand side arguments from Matlab
plhs - Pointer to right hand side arguments from Matlab

Definition at line 30 of file matlab_gs_get_last_error.c.

{
  int i;

  if ((nlhs != 1)||(nrhs != 1)) {
    mexErrMsgTxt("Usage: num = gridsolve_errno\n");
    goto error;
  }

  plhs[0] = mxCreateDoubleMatrix(1,1,mxREAL);

  /* Use Matlab global error number */
  mxGetPr(plhs[0])[0] = (double)matlab_gs_error_num;

  return; 

 error:
  for (i=0;i<nlhs;i++) plhs[i] = mxCreateDoubleMatrix(0,0,mxREAL); 
  mexPrintf("Warning: GridSolve call failed: %d:%d: %s; %s\n", grpc_errno, grpc_minor_errno, grpc_error_string(grpc_errno), grpc_minor_error_string(grpc_minor_errno));  
  return;

}

Here is the call graph for this function:

Here is the caller graph for this function: