📄 mathtools604.txt
字号:
发信人: FangQ (木头虫子), 信区: MathTools
标 题: Matlab与C++接口与混合编程讨论小结(十四)
发信站: BBS 水木清华站 (Wed Nov 3 11:28:31 1999) WWW-POST
附录:Matcom C数学库函数列表(部分)
这是一个丰富的数学库,约600个函数,包括sim()函数
--------------------------------------------------------------------------
矩阵基础类
系统常数
特殊函数
异常处理函数
矩阵生成函数
操作系统资源函数
数值计算函数
数学函数
矩阵操作函数
矩阵属性函数
图形函数
颜色函数
用户介面函数
is*函数族
mex函数
字符串函数
字符串函数
字符串函数
类型转换函数
**************************************************************************
>>> 矩阵基础类
**************************************************************************
class Mm
{
DLLI Mm();
DLLI Mm(int isc, int iss, int nonzeros, int nrows, int ncols, mt_matrix_ty
pes new_type=mt_double_matrix);
DLLI Mm(int isc, int iss, int nonzeros, int new_ndims, const int new_dims[
max_ndims], mt_matrix_types new_type=mt_double_matrix);
DLLI Mm(i_o_t, const char* mname, int isglobal);
DLLI Mm(const char* mname, int m, int n);
DLLI Mm(int aisc, cMm x, cMm y, cMm dim1, op_t op, int do_dim, Mm& minmax_
idx);
DLLI Mm(m_type src);
DLLI Mm(cMm src);
DLLI Mm(cMm src, const char* mname);
DLLI Mm(const Mc& src);
DLLI Mm(cMr src, int err=1);
DLLI ~Mm();
Mm RDLLI operator =(cMm src);
void DLLI deepcopy(cMm src, mt_matrix_types new_type=mt_uninit_matrix);
void DLLI deepcopy(int isc, cMm src, mt_matrix_types new_type=mt_uninit_ma
trix);
void DLLI deepcopy(int isc, int iss, cMm src, mt_matrix_types new_type=mt_
uninit_matrix);
int DLLI getreal(int force=0) const;
int DLLI getcomplex();
void DLLI collapse();
inline int DLLI rows() const { return dims[0]; }
inline int DLLI cols() const { return dims[1]; }
int DLLI size() const;
int DLLI size(int dim) const;
int DLLI nsingleton() const;
int DLLI vectordim() const;
int DLLI length() const;
const char PDLLI getname() const { return self_name; }
const char PDLLI getname() const { return self_name; }
void DLLI setname(const char* new_name);
int DLLI isstr() const { return (flags.str!=0); }
void DLLI setstr(int newd);
inline int DLLI issparse() const { return (flags.sparse!=0); }
void DLLI setsparse(int sp);
inline int DLLI islogical() const { return (flags.logical!=0); }
{ return (flags.logical!=0); }
void DLLI setlogical(int newd);
inline int DLLI isglobal() const { return (flags.global!=0); }
inline int DLLI isstruct() const { return (fields!=NULL); }
inline int RDLLI getndims() const { return (int&)ndims; }
inline int PDLLI getdims() const { return (int*)dims; }
inline M_types RDLLI getflags() { return flags; }
inline mt_matrix_types DLLI gettype() const { return flags.type; }
inline int DLLI getnfields() const { return nfields; }
inline const char PPDLLI getfields() const { return fields; }
inline int DLLI isc() const { return (pi!=NULL); }
int DLLI issamename(const char *s) const { return s==self_name; }
int DLLI dirty() const;
int DLLI getp() const { return p; }
Mm DLLI safebr(int i0) const;
inline m_type PDLLI getpr(m_type*) const { return (m_type*)pr; }
inline m_type PDLLI getpi(m_type*) const { return (m_type*)pi; }
inline uint8 PDLLI getpr(uint8*) const { return (uint8*)pr; }
inline uint8 PDLLI getpi(uint8*) const { return (uint8*)pi; }
inline Mm PDLLI getpr(Mm*) const { return (Mm*)pr; }
inline Mm PDLLI getpi(Mm*) const { return (Mm*)pi; }
inline m_type PDLLI getpr(m_type*,int i0) const { return i0-1+(m_type*)pr;
}
}
inline m_type PDLLI getpi(m_type*,int i0) const { return i0-1+(m_type*)pi;
}
inline uint8 PDLLI getpr(uint8*,int i0) const { return i0-1+(uint8*)pr;
}
inline uint8 PDLLI getpi(uint8*,int i0) const { return i0-1+(uint8*)pi;
}
inline Mm PDLLI getpr(Mm*,int i0) const { return i0-1+(Mm*)pr; }
inline Mm PDLLI getpi(Mm*,int i0) const { return i0-1+(Mm*)pi; }
inline m_type PDLLI getpr(m_type*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(m_type*)pr; }
inline m_type PDLLI getpi(m_type*,int i0,int i1) const { return i0-1+(i1-1
inline m_type PDLLI getpi(m_type*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(m_type*)pi; }
inline uint8 PDLLI getpr(uint8*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(uint8*)pr; }
inline uint8 PDLLI getpi(uint8*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(uint8*)pi; }
inline Mm PDLLI getpr(Mm*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(Mm*)pr; }
inline Mm PDLLI getpi(Mm*,int i0,int i1) const { return i0-1+(i1-1
)*dims[0]+(Mm*)pi; }
m_type PDLLI addr() const;
m_type PDLLI addr(int i0) const;
m_type PDLLI addr(int i0,int i1) const;
m_type PDLLI addi() const;
m_type PDLLI addi(int i0) const;
m_type PDLLI addi(int i0,int i1) const;
inline int PDLLI getindex() const { return index; }
inline int RDLLI getnnz() const { return (int&)nnz; }
m_type RDLLI r() const;
m_type RDLLI r(double i0) const;
m_type RDLLI r(double i0, double i1) const;
m_type RDLLI r(double i0, double i1, double i2) const;
m_type RDLLI i() const;
m_type RDLLI i(double i0) const;
m_type RDLLI i(double i0, double i1) const;
m_type RDLLI i(double i0, double i1, double i2) const;
uint8 RDLLI ur(int i0) const;
uint8 RDLLI ur(int i0, int i1) const;
Mm RDLLI mr(int i0) const;
Mm RDLLI mr(int i0, int i1) const;
Mr DLLI member(const char* field) const { return Mr(*this, field); }
Mr DLLI operator ()(cMm i0) const { return Mr(Mr_idx_paren, *this, i0); }
Mr DLLI operator ()(cMm i0, cMm i1) const { return Mr(Mr_idx_paren, *this,
i0, i1); }
i0, i1); }
Mr DLLI operator ()(cMm i0, cMm i1, cMm i2) const { return Mr(Mr_idx_paren
, *this, i0, i1, i2); }
, *this, i0, i1, i2); }
Mr DLLI operator ()(cMm i0, cMm i1, cMm i2, cMm i3) const { return Mr(Mr_i
dx_paren, *this, i0, i1, i2, i3); }
Mr DLLI br(cMm i0) const { return Mr(Mr_idx_br,*this, i0); }
Mr DLLI br(cMm i0, cMm i1) const { return Mr(Mr_idx_br,*this, i0, i1); }
Mr DLLI br(cMm i0, cMm i1, cMm i2) const { return Mr(Mr_idx_br,*this, i0,
i1, i2); }
Mr DLLI br(cMm i0, cMm i1, cMm i2, cMm i3) const { return Mr(Mr_idx_br,*th
is, i0, i1, i2, i3); }
m_type& fastindex(double i0) const { return pr[int(i0)-1]; }
m_type& fastindex(double i0, double i1) const { return pr[int(i0)-1+(int(i
1)-1)*dims[0]]; }
void DLLI vwcopy1(cMm src, cMm v);
void DLLI vwcopy2(cMm src, cMm v, cMm w);
void DLLI vwcopyn(cMr src, cMm rhs);
void DLLI vwcopy0(cMr src);
int DLLI findfield(const char* field, int err) const;
const char PDLLI getfield(int i) const;
int DLLI addfield(const char* field,int quick);
int DLLI rmfield(const char* field);
void DLLI extend_nfields(int new_nfields);
int DLLI getclassid() const { return classid; }
void DLLI setclassid(int new_classid) { classid=new_classid; }
void DLLI reshape(const int m, const int n);
void DLLI reshape(const int new_ndims, const int new_dims[max_ndims]);
void DLLI print(int full) const;
void DLLI warn_uninit() const;
void DLLI resparse();
int DLLI search(int idx) const;
void DLLI sort();
void DLLI extend_nnz(int new_nnz);
}; // M
Mc DLLI BR(cMm src);
Mc DLLI CL(cMm src);
m_type DLLI scalar(m_type x);
m_type DLLI scalar(cMm x);
Mm DLLI switchinit(cMm x);
****************************************************************************
>>> 系统常数
**************************************************************************
**************************************
extern DLLW double DLLI nargin_val;
extern DLLW double DLLI nargout_val;
extern DLLW double DLLI nargout_val;
extern DLLW int DLLI nargin_set;
extern DLLW int DLLI nargout_set;
extern DLLW Mm DLLI TICTOC;
extern DLLW Mm DLLI ans;
extern DLLW Mm DLLI i;
extern DLLW Mm DLLI j;
extern DLLW Mm DLLI pi;
extern DLLW Mm DLLI Inf;
extern DLLW Mm DLLI NaN;
extern DLLW Mm DLLI eps;
extern DLLW Mm DLLI x_M;
extern DLLW Mm DLLI semi;
extern DLLW Mm DLLI c_p;
extern DLLW Mm DLLI nop_M;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -