⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 matrix.h

📁 液晶中TE波入射的FDTD算法
💻 H
📖 第 1 页 / 共 3 页
字号:
 * Create an N-Dimensional array to hold string data;
 * initialize all elements to 0.
 */
extern mxArray *mxCreateCharArray(int ndim, const int *dims);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a two-dimensional array to hold double-precision
 * floating-point data; initialize each data element to 0.
 */
extern mxArray *mxCreateDoubleMatrix(int m, int n, mxComplexity flag);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Get a properly typed pointer to the elements of a logical array.
 */
extern mxLogical *mxGetLogicals(const mxArray *pa);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a logical array and initialize its data elements to false.
 */
extern mxArray *mxCreateLogicalArray(int ndim, const int *dims);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a two-dimensional array to hold logical data and
 * initializes each data element to false.
 */
extern mxArray *mxCreateLogicalMatrix(unsigned int m, unsigned int n);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a logical scalar mxArray having the specified value.
 */
extern mxArray *mxCreateLogicalScalar(bool value);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Returns true if the logical scalar value is true.
 */
extern bool mxIsLogicalScalarTrue(const mxArray *pa);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a double-precision scalar mxArray initialized to the
 * value specified
 */
extern mxArray *mxCreateDoubleScalar(double value);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 2-Dimensional sparse array.
 */
extern mxArray *mxCreateSparse(int m, int n, int nzmax, mxComplexity flag);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 2-D sparse logical array
 */
extern mxArray *mxCreateSparseLogicalMatrix(int m, int n, int nzmax);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Copies characters from a MATLAB array to a char array
 * This function will attempt to perform null termination if it is possible.
 * nChars is the number of bytes in the output buffer
 */
extern void mxGetNChars(const mxArray *pa, char *buf, int nChars);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Converts a string array to a C-style string. The C-style string is in the
 * local codepage encoding. If the conversion for the entire Unicode string
 * cannot fit into the supplied character buffer, then the conversion includes
 * the last whole codepoint that will fit into the buffer. The string is thus
 * truncated at the greatest possible whole codepoint and does not split code-
 * points.
 */
extern int mxGetString(const mxArray *pa, char *buf, int buflen);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a NULL terminated C string from an mxArray of type mxCHAR_CLASS
 * Supports multibyte character sets.  The resulting string must be freed
 * with mxFree.  Returns NULL on out of memory or non-character arrays.
 */
extern char *mxArrayToString(const mxArray *pa);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 1-by-n string array initialized to str. The supplied string is
 * presumed to be in the local codepage encoding. The character data format
 * in the mxArray will be UTF-16.
 */
extern mxArray *mxCreateStringFromNChars(const char *str, int n);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 1-by-n string array initialized to null terminated string
 * where n is the length of the string.
 */
extern mxArray *mxCreateString(const char *str);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a string array initialized to the strings in str.
 */
extern mxArray *mxCreateCharMatrixFromStrings(int m, const char **str);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 2-Dimensional cell array, with each cell initialized
 * to NULL.
 */
extern mxArray *mxCreateCellMatrix(int m, int n);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create an N-Dimensional cell array, with each cell initialized
 * to NULL.
 */
extern mxArray *mxCreateCellArray(int ndim, const int *dims);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create a 2-Dimensional structure array having the specified fields;
 * initialize all values to NULL.
 */
extern mxArray *mxCreateStructMatrix(int m, int n, int nfields, const char **fieldnames);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Create an N-Dimensional structure array having the specified fields;
 * initialize all values to NULL.
 */
extern mxArray *mxCreateStructArray(int ndim, const int *dims, int nfields,
								const char **fieldnames);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Make a deep copy of an array, return a pointer to the copy.
 */
extern mxArray *mxDuplicateArray(const mxArray *in);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Set classname of an unvalidated object array.  It is illegal to
 * call this function on a previously validated object array.
 * Return 0 for success, 1 for failure.
 */
extern int mxSetClassName(mxArray *pa, const char *classname);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/* 
 * Add a field to a structure array. Returns field number on success or -1
 * if inputs are invalid or an out of memory condition occurs.
 */
extern int mxAddField(mxArray *pa, const char *fieldname);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Remove a field from a structure array.  Does nothing if no such field exists.
 * Does not destroy the field itself.
*/
extern void mxRemoveField(mxArray *pa, int field);
#ifdef __cplusplus
}
#endif


#ifdef __WATCOMC__
#ifndef __cplusplus
#pragma aux mxGetEps value [8087];
#pragma aux mxGetInf value [8087];
#pragma aux mxGetNaN value [8087];
#endif
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Function for obtaining MATLAB's concept of EPS
 */
extern double mxGetEps(void);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Function for obtaining MATLAB's concept of INF (Used in MEX-File callback).
 */
extern double mxGetInf(void);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * Function for obtaining MATLAB's concept of NaN (Used in MEX-File callback).
 */
extern double mxGetNaN(void);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * test for finiteness in a machine-independent manner
 */
extern bool mxIsFinite(
    double x                  /* value to test */
    );
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * test for infinity in a machine-independent manner
 */
extern bool mxIsInf(
    double x                  /* value to test */
    );
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * test for NaN in a machine-independent manner
 */
extern bool mxIsNaN(
    double x                  /* value to test */
    );
#ifdef __cplusplus
}
#endif


#define mxCreateFull() mxCreateFull_is_obsolete
#define mxIsFull()     mxIsFull_is_obsolete
#define mxIsString()   mxIsString_is_obsolete
#define mxFreeMatrix() mxFreeMatrix_is_obsolete


#define mxCreateScalarDouble(d) mxCreateDoubleScalar(d)

#if defined(V5_COMPAT)

#ifdef __cplusplus
extern "C" {
#endif
/*
 * NOTE: This function is obsolete and should no longer be used. Please
 *       use one of the following routines instead:
 *                         mxCreateLogicalScalar
 *                         mxCreateLogicalMatrix
 *                         mxCreateLogicalArray
 *
 * Specify that the data in an array is to be treated as Boolean data.
 */
extern void mxSetLogical(mxArray *pa);
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/*
 * NOTE: This function is obsolete and should no longer be used.
 *
 * Specify that the data in an array is to be treated as numerical
 * (as opposed to Boolean) data. 
 */
extern void mxClearLogical(mxArray *pa);
#ifdef __cplusplus
}
#endif


#else
#define mxSetLogical()     mxSetLogical_is_obsolete
#define mxClearLogical()   mxClearLogical_is_obsolete
#endif /* defined(V5_COMPAT) */


#if defined(V5_COMPAT)

#ifdef __cplusplus
extern "C" {
#endif
/* 
 * Get pointer to array name.
 */
extern const char *mxGetName(
    const mxArray *pa		/* pointer to array */
    );
#ifdef __cplusplus
}
#endif

#ifdef __cplusplus
extern "C" {
#endif
/* 
 * Set array name.  This routine copies the string pointed to by s
 * into the mxMAXNAM length character name field.
 */
extern void mxSetName(
    mxArray    *pa,		/* pointer to array */
    const char *s		/* string to copy into name */
    );
#ifdef __cplusplus
}
#endif


#else
#define mxGetName()     mxGetName_is_obsolete
#define mxSetName()     mxSetName_is_obsolete
#endif /* defined(V5_COMPAT) */



/*
mxAssert(int expression, char *error_message)
---------------------------------------------

  Similar to ANSI C's assert() macro, the mxAssert macro checks the
  value of an assertion, continuing execution only if the assertion
  holds.  If 'expression' evaluates to be true, then the mxAssert does
  nothing.  If, however, 'expression' is false, then mxAssert prints an
  error message to the MATLAB Command Window, consisting of the failed
  assertion's expression, the file name and line number where the failed
  assertion occurred, and the string 'error_message'.  'error_message'
  allows the user to specify a more understandable description of why
  the assertion failed.  (Use an empty string if no extra description
  should follow the failed assertion message.)  After a failed
  assertion, control returns to the MATLAB command line. 

  mxAssertS, (the S for Simple), takes the same inputs as mxAssert.  It 
  does not print the text of the failed assertion, only the file and 
  line where the assertion failed, and the explanatory error_message.

  Note that script MEX will turn off these assertions when building
  optimized MEX-functions, so they should be used for debugging 
  purposes only.
*/

#ifdef MATLAB_MEX_FILE
#  ifndef NDEBUG
extern
#    ifdef __cplusplus
       "C"
#    endif
void mexPrintAssertion(const char *test, 
		       const char *fname, 
		       int linenum, 
		       const char *message);

#    define mxAssert(test, message) ( (test) ? (void) 0 : mexPrintAssertion(": " #test ",", __FILE__, __LINE__, message))
#    define mxAssertS(test, message) ( (test) ? (void) 0 : mexPrintAssertion("", __FILE__, __LINE__, message))
#  else
#    define mxAssert(test, message) ((void) 0)
#    define mxAssertS(test, message) ((void) 0)
#  endif
#else
#  include <assert.h>
#  define mxAssert(test, message) assert(test)
#  define mxAssertS(test, message) assert(test)
#endif



#include <stdlib.h>


/* $Revision: 1.14.4.1 $ */
#ifdef ARGCHECK

#include "mwdebug.h" /* Prototype _d versions of API functions */

#define mxAddField(pa, fieldname)                       mxAddField_d(pa, fieldname, __FILE__, __LINE__)
#define mxArrayToString(pa)				mxArrayToString_d(pa, __FILE__, __LINE__)
#define mxCalcSingleSubscript(pa, nsubs, subs)          mxCalcSingleSubscript_d(pa, nsubs, subs, __FILE__, __LINE__) 
#define mxCalloc(nelems, size)                          mxCalloc_d(nelems, size, __FILE__, __LINE__)
#define mxCreateCellArray(ndim, dims)	                mxCreateCellArray_d(ndim, dims, __FILE__, __LINE__)
#define mxCreateCellMatrix(m, n)                        mxCreateCellMatrix_d(m, n, __FILE__, __LINE__)
#define mxCreateCharArray(ndim, dims)                   mxCreateCharArray_d(ndim, dims, __FILE__, __LINE__)
#define mxCreateCharMatrixFromStrings(m, strings)       mxCreateCharMatrixFromStrings_d(m, strings, __FILE__, __LINE__)
#define mxCreateDoubleMatrix(m, n, cplxflag)		mxCreateDoubleMatrix_d(m, n, cplxflag, __FILE__, __LINE__)
#define mxCreateDoubleScalar(value)		        mxCreateDoubleScalar_d(value, __FILE__, __LINE__)
#define mxCreateLogicalArray(ndim, dims)		mxCreateLogicalArray_d(ndim, dims, __FILE__, __LINE__)
#define mxCreateLogicalMatrix(m, n)		        mxCreateLogicalMatrix_d(m, n, __FILE__, __LINE__)
#define mxCreateLogicalScalar(value)	                mxCreateLogicalScalar_d(value, __FILE__, __LINE__)
#define mxCreateNumericArray(ndim, dims, classname, cplxflag) mxCreateNumericArray_d(ndim, dims, classname, cplxflag, __FILE__, __LINE__) 
#define mxCreateNumericMatrix(m, n, classid, cmplx_flag)      mxCreateNumericMatrix_d(m, n, classid, cmplx_flag, __FILE__, __LINE__)
#define mxCreateSparse(m, n, nzmax, cplxflag)           mxCreateSparse_d(m, n, nzmax, cplxflag, __FILE__, __LINE__) 
#define mxCreateSparseLogicalMatrix(m, n, nzmax)	mxCreateSparseLogicalMatrix_d(m, n, nzmax, __FILE__, __LINE__)
#define mxCreateString(string) mxCreateString_d(string, __FILE__, __LINE__)
#define mxCreateStructArray(ndim, dims, nfields, fieldnames)  mxCreateStructArray_d(ndim, dims, nfields, fieldnames, __FILE__, __LINE__)
#define mxCreateStructMatrix(m, n, nfields, fieldnames) mxCreateStructMatrix_d(m, n, nfields, fieldnames, __FILE__, __LINE__)
#define mxDestroyArray(pa)				mxDestroyArray_d(pa, __FILE__, __LINE__)
#define mxDuplicateArray(pa)			        mxDuplicateArray_d(pa, __FILE__, __LINE__)
#define mxFree(pm)					mxFree_d(pm, __FILE__, __LINE__)
#define mxGetChars(pa)					mxGetChars_d(pa, __FILE__, __LINE__)
#define mxGetCell(pa, index)			        mxGetCell_d(pa, index, __FILE__, __LINE__)
#define mxGetClassID(pa)				mxGetClassID_d(pa, __FILE__, __LINE__)
#define mxGetClassName(pa)				mxGetClassName_d(pa, __FILE__, __LINE__)
#define mxGetData(pa)                                   mxGetData_d(pa, __FILE__, __LINE__)
#define mxGetDimensions(pa)  			        mxGetDimensions_d(pa, __FILE__, __LINE__)
#define mxGetElementSize(pa)			        mxGetElementSize_d(pa, __FILE__, __LINE__)
#define mxGetField(pa, index, fieldname)                mxGetField_d(pa, index, fieldname, __FILE__, __LINE__)
#define mxGetFieldByNumber(pa, index, fieldnum)         mxGetFieldByNumber_d(pa, index, fieldnum, __FILE__, __LINE__)
#define mxGetFieldNameByNumber(pa, fieldnum)            mxGetFieldNameByNumber_d(pa, fieldnum, __FILE__, __LINE__)
#define mxGetFieldNumber(pa, fieldname)                 mxGetFieldNumber_d(pa, fieldname, __FILE__, __LINE__)
#define mxGetImagData(pa)                               mxGetImagData_d(pa, __FILE__, __LINE__)
#define mxGetIr(pa)                                     mxGetIr_d(pa, __FILE__, __LINE__)
#define mxGetJc(pa)                                     mxGetJc_d(pa, __FILE__, __LINE__)
#define mxGetLogicals(pa)				mxGetLogicals_d(pa, __FILE__, __LINE__)
#define mxGetNumberOfDimensions(pa)		        mxGetNumberOfDimensions_d(pa, __FILE__, __LINE__)
#define mxGetNumberOfElements(pa)		        mxGetNumberOfElements_d(pa, __FILE__, __LINE__)
#define mxGetNumberOfFields(pa)			        mxGetNumberOfFields_d(pa, __FILE__, __LINE__)
#define mxGetNzmax(pa)					mxGetNzmax_d(pa, __FILE__, __LINE__)
#define mxGetM(pa)					mxGetM_d(pa, __FILE__, __LINE__)
#define mxGetN(pa)					mxGetN_d(pa, __FILE__, __LINE__)
#define mxGetPi(pa)                                     mxGetPi_d(pa, __FILE__, __LINE__)
#define mxGetPr(pa)                                     mxGetPr_d(pa, __FILE__, __LINE__)
#define mxGetScalar(pa)					mxGetScalar_d(pa, __FILE__, __LINE__)
#define mxGetString(pa, buffer, buflen)                 mxGetString_d(pa, buffer, buflen, __FILE__, __LINE__)
#define mxIsCell(pa)					mxIsCell_d(pa, __FILE__, __LINE__)
#define mxIsChar(pa)					mxIsChar_d(pa, __FILE__, __LINE__)
#define mxIsClass(pa, classname)                        mxIsClass_d(pa, classname, __FILE__, __LINE__)
#define mxIsComplex(pa)					mxIsComplex_d(pa, __FILE__, __LINE__)
#define mxIsDouble(pa)					mxIsDouble_d(pa, __FILE__, __LINE__)
#define mxIsEmpty(pa)					mxIsEmpty_d(pa, __FILE__, __LINE__)
#define mxIsFromGlobalWS(pa)                            mxIsFromGlobalWS_d(pa, __FILE__, __LINE__)
#define mxIsInt8(pa)					mxIsInt8_d(pa, __FILE__, __LINE__)
#define mxIsInt16(pa)					mxIsInt16_d(pa, __FILE__, __LINE__)
#define mxIsInt32(pa)					mxIsInt32_d(pa, __FILE__, __LINE__)
#define mxIsLogical(pa)					mxIsLogical_d(pa, __FILE__, __LINE__)
#define mxIsNumeric(pa)					mxIsNumeric_d(pa, __FILE__, __LINE__)
#define mxIsOpaque(pa)					mxIsOpaque_d(pa, __FILE__, __LINE__)
#define mxIsObject(pa)					mxIsObject_d(pa, __FILE__, __LINE__)
#define mxIsSingle(pa)					mxIsSingle_d(pa, __FILE__, __LINE__)
#define mxIsSparse(pa)					mxIsSparse_d(pa, __FILE__, __LINE__)
#define mxIsStruct(pa)					mxIsStruct_d(pa, __FILE__, __LINE__)
#define mxIsUint8(pa)					mxIsUint8_d(pa, __FILE__, __LINE__)
#define mxIsUint16(pa)					mxIsUint16_d(pa, __FILE__, __LINE__)
#define mxIsUint32(pa)					mxIsUint32_d(pa, __FILE__, __LINE__)
#define mxIsUint64(pa)				        mxIsUint64_d(pa, __FILE__, __LINE__)
#define mxMalloc(n)			                mxMalloc_d(n, __FILE__, __LINE__)
#define mxRealloc(pm, nelems)			        mxRealloc_d(pm, nelems, __FILE__, __LINE__)
#define mxRemoveField(pa, field)		        mxRemoveField_d(pa, field, __FILE__, __LINE__)
#if !defined(MATLAB_MEX_FILE)
#define mxSetAllocFcns(callocptr, freeptr, reallocptr, mallocptr) mxSetAllocFcns_d(callocptr, freeptr, reallocptr, freeptr, __FILE__, __LINE__)
#endif /* MATLAB_MEX_FILE */
#define mxSetCell(pa, index, value)		        mxSetCell_d(pa, index, value, __FILE__, __LINE__)
#define mxSetClassName(pa, name)		        mxSetClassName_d(pa, name, __FILE__, __LINE__)
#define mxSetData(pa, pd)				mxSetData_d(pa, pd, __FILE__, __LINE__)
#define mxSetDimensions(pa, size, ndims)                mxSetDimensions_d(pa, size, ndims, __FILE__, __LINE__)
#define mxSetField(pa, index, fieldname, value)         mxSetField_d(pa, index, fieldname, value, __FILE__, __LINE__)
#define mxSetFieldByNumber(pa, index, fieldnum, value)  mxSetFieldByNumber_d(pa, index, fieldnum, value, __FILE__, __LINE__)
#define mxSetImagData(pa, pid)			        mxSetImagData_d(pa, pid, __FILE__, __LINE__)
#define mxSetIr(pa, ir)					mxSetIr_d(pa, ir, __FILE__, __LINE__)
#define mxSetJc(pa, jc)					mxSetJc_d(pa, jc, __FILE__, __LINE__)
#define mxSetM(pa, m)				        mxSetM_d(pa, m, __FILE__, __LINE__)
#define mxSetN(pa, n)				        mxSetN_d(pa, n, __FILE__, __LINE__)
#define mxSetNzmax(pa, nzmax)			        mxSetNzmax_d(pa, nzmax, __FILE__, __LINE__)
#define mxSetPi(pa, pi)					mxSetPi_d(pa, pi, __FILE__, __LINE__)
#define mxSetPr(pa, pr)					mxSetPr_d(pa, pr, __FILE__, __LINE__)
#endif

#endif /* matrix_h */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -