MatrixBerryCore
Namespaces | Functions
mxberry::core::check Namespace Reference

Namespaces

 lib
 

Functions

function checkcelloffunc (in inpArray, in isEmptyAllowed, in varargin)
 CHECKCELLOFFUNC checks that input variable is either a function_handle of cell of function_handle (char is converted to a cell), in case validation fails an exception is thrown. More...
 
function checkcellofstr (in inpArray, in flagVec, in varargin)
 CHECKCELLOFSTR checks that input variable is either a char or cell of strings (char is converted to a cell), in case validation fails an exception is thrown. More...
 
function checkgen (in x, in typeSpec, in varargin)
 CHECKGEN checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x)&&isa(x,'int32')||isscalar(x)' etc In case validation fails an exception is thrown. More...
 
function checkgenext (in typeSpec, in nPlaceHolders, in varargin)
 CHECKGENEXT checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x1)&&isa(x2,'int32')||isscalar(x2)' etc In case validation fails an exception is thrown. More...
 

Function Documentation

◆ checkcelloffunc()

function mxberry::core::check::checkcelloffunc ( in  inpArray,
in  isEmptyAllowed,
in  varargin 
)

CHECKCELLOFFUNC checks that input variable is either a function_handle of cell of function_handle (char is converted to a cell), in case validation fails an exception is thrown.

*  Input:
*    regular:
*        inpArray: anyType[]
*    optional:
*        isEmptyAllowed: logical[1,1] - if true, {} passes the check and
*            causes an exception otherwise, false by default
*    properties:
*        nCallerStackStepsUp: numeric[1,1] - number of steps up in the call
*            stacks for the caller, by which name the full message tag is to
*            be generated, =1 by default
*  Output:
*    inpArray: cell[1,] of char[1,]
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ checkcellofstr()

function mxberry::core::check::checkcellofstr ( in  inpArray,
in  flagVec,
in  varargin 
)

CHECKCELLOFSTR checks that input variable is either a char or cell of strings (char is converted to a cell), in case validation fails an exception is thrown.

*  Input:
*    regular:
*        inpArray: anyType[]
*    optional:
*        flagVec: logical[1,2] - contains the following flags
*            isEmptyAllowed: logical[1,1] - if true, {} passes the check and
*                causes an exception otherwise, false by default
*            isCheckedForBeingARow: logical[1,1] - if true, in
*                case inpArray is cell, it is expected to be a row
*    properties:
*        nCallerStackStepsUp: numeric[1,1] - number of steps up in the call
*            stacks for the caller, by which name the full message tag is to
*            be generated, =1 by default
* 
*  Output:
*    inpArray: cell[1,] of char[1,]
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ checkgen()

function mxberry::core::check::checkgen ( in  x,
in  typeSpec,
in  varargin 
)

CHECKGEN checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x)&&isa(x,'int32')||isscalar(x)' etc In case validation fails an exception is thrown.

*  Input:
*    regular:
*        x: anyType[]
*        typeSpec: char[1,]/function_handle - check string in
*            the folowing format: 'isnumeric(x)&&ischar(x)'
*                        OR
*            function_handle[1,1]
* 
*    optional:
*        varName: char[1,] - variable name - used optionally instead of
*            variable name determined auotmatically via inputname(1)
*    properties:
* 
*        errorTag: char[1,] - tag for MException object thrown
*            in case of error. If not specified
*            '<CALLER_NAME>wrongInput' tag is used
* 
*        errorMessage: char[1,] - error message for MException object
*            thrown in case of error. If not specified the message
*            is generated automatically.
* 
*        nCallerStackStepsUp: numeric[1,1] - number of steps up in the call
*            stacks for the caller, by which name the full message tag is to
*            be generated, =1 by default
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om

◆ checkgenext()

function mxberry::core::check::checkgenext ( in  typeSpec,
in  nPlaceHolders,
in  varargin 
)

CHECKGENEXT checks a generic condition provided by typeSpec string in the following format: 'isnumeric(x1)&&isa(x2,'int32')||isscalar(x2)' etc In case validation fails an exception is thrown.

*  Input:
*    regular:
*        typeSpec: char[1,]/function_handle - check string in
*            the folowing format: 'isnumeric(x)&&ischar(x)'
*                        OR
*            function_handle[1,1]
*        nPlaceHolders: numberic[1,1] - number of place holders/arguments in
*            typeSpec
* 
*        x1: anyType[]
*        x2: anyType[]
*        x3: anyType[]
* 
*    optional:
*        x1VarName: char[1,] - variable name - used optionally instead of
*            variable name determined auotmatically via inputname
*        x2VarName: char[1,] - same but for x2
* 
*  Example:
* 
*    mxberry.core.check.checkgenext('numel(x1)==numel(x2)',2,a,b,'Alpha')
* 
Author
Peter Gagarinov, PhD pgaga.nosp@m.rino.nosp@m.v@gma.nosp@m.il.c.nosp@m.om