ismonomial.m
来自「HERE IS A GOOD PSO TOOL BOX」· M 代码 · 共 24 行
M
24 行
function r = ismonomial(obj)% GPOSYNOMIAL/ISMONOMIAL Checks whether the input general posynomial is a monomial.%% This is true when a GP variable, a monomial, or a posynomial with a single% term are casted as a generalized posynomial.if( strcmp(obj.op,'obj') ) r = ismonomial( obj.args{:} ); return;endif( strcmp(obj.op,'*') ) r = ismonomial( obj.args{1} ) && ismonomial( obj.args{2} ); return;endif isnumeric(obj.op) r = ismonomial( obj.args{:} ); return;end% otherwise max and plus cannot give a monomialr = 0;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?