欢迎来到天天文库
浏览记录
ID:37862051
大小:265.50 KB
页数:36页
时间:2019-06-01
《matlab的C++库函数中mwArray类的接口源码》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、matlab的C++库函数中mwArray类的接口源码利用matlab的C++数学函数库进行编程,一定要对mwArray类比较熟悉才能做到游刃有余,特贴出mwArray类的接口源码,以便查阅!/*$Revision:1.56$*///Copyright(c)1995-2000,TheMathWorks,Inc.AllRightsReserved.//dblmtrx.h//PeterWebb,Sept.1994////ThemwArrayclass. Instancesofthisclassmanipulate2Darrays//ofdoub
2、leprecisionrealnumbers.#if!defined(dblmtrx_h)#definedblmtrx_h1#ifdefined(MSWIND)&&defined(_MSC_VER)#pragmawarning(disable:42914710)#endif#ifdefined(BORLAND)&&__BORLANDC__>=0x0540#include#include<_stddef.h>//Thisgetstypedefsfromstddefintoglobalnamespace#endif//THIS
3、NEEDSTOGOFIRST.Thestaticinitializerininit.hsetsthememory//managementfunctions,andneedstobeexecutedbeforeanythingelse.//Theconstructorforthisstaticvariableinitializesthelibrary.//Initializationconsistsofvarioustasks,includingsettingnumeric//constantslikeNaNandInf,andturning
4、offfloatingpointexceptions//(onnon-IEEEplatformswherethatmatters).#include"init.h"#ifdefGCC#pragmainterface#endif36#include#include"mtrxref.h"#include"mathwork.h" //Globaltypedefsanddefines#include"mlmexcpt.h" //mlm_exceptionandMLM_THROW()macros#include"stdex
5、cpt.h" //mwExceptionhierarchy#include"mwstr.h" //mwString#include"arrayidx.h"#if0#ifdefCOMPLEX_CLASS_EXISTS#include#endif#endif//IncludeprivateinformationaboutMATLABstructmatrix. Rename//MatrixtoMatlabMatrix. AlsoincludeMLM(built-in)andMLT(toolbox)//funct
6、ionprototypes.#defineMatrixMatlabMatrixextern"C"{#include"libmatlb.h"}//Endextern"C"#undefMatrix//ThesearedefinedbyMATLABforautomaticgenerationofheaderfiles//C++needsthemunadorned.#undefpublic#undefprivate//Forwarddecls.//Wecan'tincludearrayidx.hbecausethereisadependencylo
7、op//betweenmwArrayandmwArrayIndex. Therefore,forward//declaremwArrayIndexhere.classmwArrayIndex;class36mwArrayIndexList;classmwVarargin;classmwNumericSubArray;classmwEmptySqBracket;//TypedefstypedefintDimension;//Thedefaultactionistofillthearraywithzeros.Thisenumisused//by
8、themwArrayconstructors.enummwNumericInitAction{ mwEyeAct, //Placesonesonthemaindiagon
此文档下载收益归作者所有