亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? gpproblem.m

?? HERE IS A GOOD PSO TOOL BOX
?? M
字號:
function r = gpproblem(varargin)% GPPROBLEM is a GP problem class constructor.%%	Define GP problem via:%	  problem = GPPROBLEM(obj, constr_set, type)   % pass objects as inputs%	  problem = GPPROBLEM('obj', constr_set, type) % pass objective as a string%% 	Here type should be either: 'min' or 'max'.%%	GPPROBLEM can be solved by invoking SOLVE method, i.e.,%	  problem = solve(problem)%%	GPPROBLEM object has many fields and some of the important ones are:%%	status - the status of the problem%	type - type of the problem%%	gpvars - original problem's GP variables%	new_gpvars - newly introduced GP variables (due to GGP -> GP conversion)%%	solution - GP problem solution%%	obj - the objective function%	obj_value - the objective function value%	std_obj - the standardized objective function (after GGP -> GP conversion)%%	constr - problem's original constraints%	new_constr - newly introduced constraints (due to GGP -> GP conversion)%%	std_ineq - collection of all standardized inequalities (after GGP conversion)%	std_eq - collection of all standardized equalities (after GGP conversion)%%	A - matrix A passed to internal gpposy solver%	b - vector b%	szs - vector szs %	G - matrix G%	h - vector h %	(data A, b, szs, G, and h are all sparse matrices passed to gpposy)%	%******************************************************************************% constructor calls%******************************************************************************if nargin == 0  % no argument: create an empty gp problem   r.status = 'Unsolved';  r.flag   = 0;  r.type   = [];   r.gpvars = {};   r.new_gpvars = {};  r.new_gpvars_count = 0;  r.solution = [];   r.obj       = [];   r.obj_value = [];   r.std_obj   = [];   r.constr       = [];  r.constr_value = [];  r.constr_dual  = [];  r.new_constr   = {};  r.std_ineq = {};  r.std_eq   = {};  r.A = []; r.b = []; r.szs = [];  r.G = []; r.h = [];  r.nu    = [];  r.mu    = [];  r.lambda = [];  r = class(r,'gpproblem');  return;endif nargin == 1  % copy constructor  if isa(varargin{1},'gpproblem')    F = varargin{1};    return;  else    error(['Single input to gpproblem constructor should be a GP problem.'...          char(10)           'If you are trying to form an unconstrained GP problem, then use:'...          char(10) 'gpproblem(obj, [])']);  endendif nargin == 2  % default optimization problem type is minimization  r = gpproblem(varargin{1}, varargin{2},'min');  return;endif nargin == 3  % no solution information until solve is invoked  r = gpproblem;  if( strcmp(varargin{3},'min') || strcmp(varargin{3},'max') || ...      strcmp(varargin{3},'feas') )    r.type = varargin{3};  else    error('Unknown problem type. Valid entries are ''min'', ''max'', and ''feas''.');  end  % process objective function  r.obj = varargin{1};  % assign zero value if problem objective is empty (feasibility problem)  if( isempty(r.obj) )    r.obj = 0;  end  % check that objective is a scalar (not an array)  if( length(r.obj) > 1 )    error('Objective must be a 1x1 input or an empty matrix, it cannot be an array.');  end  % make sure objective is a gp type object  if ischar(r.obj)     r.obj = evalin('caller',r.obj);  elseif isa(r.obj, 'gpvar')    r.obj = monomial(r.obj);  elseif ( isnumeric(r.obj) )    % have a feasibility problem    r.type = 'feas';    r.obj  = monomial(r.obj);  end  % create a standard GP objective function for the given problem type  switch r.type    case 'min'      [r.std_obj new_con new_vars] = standardize(r.obj,r.new_gpvars_count);      r.new_constr = {r.new_constr{:} new_con{:}};      r.new_gpvars = {r.new_gpvars{:} new_vars{:}};      r.new_gpvars_count = r.new_gpvars_count + length(new_vars);    case 'feas'      r.std_obj = monomial; % create an empty monomial as the objective    case 'max'      if( isa(r.obj, 'monomial') )        r.std_obj = 1/r.obj;      else        error('GP maximization problem is only allowed with a monomial objective.')      end  end  % populate gp problem vars with initial objective variables  r.gpvars = r.obj.gpvars;   % process constraints and return inequlities and equalities  r.constr = varargin{2};  % go through constraint set and process constraints   for k = 1:length(r.constr)    current = r.constr(k);    % add current constraint gp variables to the problem gpvars    r.gpvars = union(current.gpvars, r.gpvars);    % check for inequalities/equalities    if( strcmp(current.type, '<=') )      [std_lhs new_con new_vars] = standardize(current.lhs,r.new_gpvars_count);      r.std_ineq{end+1} = std_lhs/current.rhs;      r.new_constr = {r.new_constr{:} new_con{:}};      r.new_gpvars = {r.new_gpvars{:} new_vars{:}};      r.new_gpvars_count = r.new_gpvars_count + length(new_vars);    elseif ( strcmp(current.type, '==') )      r.std_eq{end+1} = current.lhs/current.rhs;     end  end  % go through the newly created constraints and process them   for k = 1:length(r.new_constr)    current = r.new_constr{k};    r.std_ineq{end+1} = current.lhs/current.rhs;  end   % creating matrices that will be passed to GP solvers  % count number of monomials in the objective and all constraints  if( isa(r.std_obj,'monomial') )    Arows = 1;  else    Arows = r.std_obj.mono_terms;  end  for k = 1:length(r.std_ineq)    ineq = r.std_ineq{k};    if( isa(ineq,'monomial') )      Arows = Arows + 1;    else      Arows = Arows + ineq.mono_terms;    end  end  Grows = 0;  for k = 1:length(r.std_eq)    eq = r.std_eq{k};    if( isa(eq,'monomial') )      Grows = Grows + 1;    else      Grows = Grows + eq.mono_terms;    end  end  % construct a list of all gp variables  total_gpvars = {r.gpvars{:} r.new_gpvars{:}};  Acols = length(total_gpvars); Gcols = Acols;  global GPVAR_LIST;  GPVAR_LIST = total_gpvars;  % GPVAR_LIST = unique(total_gpvars)  % matrix initialization  A = sparse(Arows,Acols);  c = sparse(Arows,1);  szs = [];  G = sparse(Grows,Gcols);  h = sparse(Grows,1);  % add objective to the matrix A  if( isa(r.std_obj,'monomial') )    szs = [1];    index_map = find_index_map(r.std_obj);    if( ~isempty(index_map) ) % it is empty if current is a constant      A(1,index_map) = r.std_obj.a;    end    if( ~isempty(r.std_obj.c) )      c(1) = r.std_obj.c;    else      c(1) = 0; % feasibility problem    end  else % standardized objective is a posynomial    szs = [r.std_obj.mono_terms];    for k=1:szs      current = r.std_obj.monomials{k};      index_map = find_index_map(current);      if( ~isempty(index_map) ) % it is empty if current is a constant        A(k,index_map) = current.a;      end      c(k) = current.c;    end  end      % add constraint inequalities to the matrix A  ptr = szs;  for k = 1:length(r.std_ineq)    ineq = r.std_ineq{k};    if( isa(ineq,'monomial') )      szs = [szs 1];      index_map = find_index_map(ineq);      ptr = ptr + 1;      A(ptr,index_map) = ineq.a;      c(ptr) = ineq.c;    else % standardized inequality is a posynomial      szs = [szs ineq.mono_terms];      for m=1:ineq.mono_terms        current = ineq.monomials{m};        index_map = find_index_map(current);        ptr = ptr + 1;        % (01/26/06 fix by rasha) fixed a bug where we did not deal         % with posyinomials containing constants        if( ~isempty(index_map) ) % it is empty if current is a constant          A(ptr,index_map) = current.a;        end        c(ptr) = current.c;      end    end      end  % add constraint equalities to the matrix G  for k = 1:length(r.std_eq)    eq = r.std_eq{k};    index_map = find_index_map(eq);    G(k,index_map) = eq.a;    h(k) = eq.c;  end  r.A = A; r.b = c; r.szs = szs;  if( length(r.std_eq) > 0 )    r.G = G; r.h = h;  end    return; % end of default (three) argument constructorend%******************************************************************************% helper functions%******************************************************************************function [index_map] = find_index_map(monomial)global GPVAR_LIST;vars = monomial.gpvars;index_map = [];for k = 1:length(vars)  [tf, loc] = ismember(vars{k}, GPVAR_LIST); % return location (index)  index_map = [index_map loc];endreturn;%******************************************************************************function [std_obj,new_constr,new_gpvars] = standardize(obj,new_gpvars_count);%******************************************************************************% standardize a generalized posynomial by converting it into GP inequalities% and reducing the original function to a GP problem valid function.%new_constr = {};new_gpvars = {};% first see if the object can be reduced using eval command% for example, we could have a monomial that was casted as a generalized posynomial, etc.obj = eval( obj, {'' []} );if( isa(obj,'gposynomial') )  % have a positive fractional power  if( isnumeric(obj.op) )     if( isa(obj.args{1},'gposynomial') )      [posy,new_con,new_vars] = standardize(obj.args{1},new_gpvars_count);      std_obj = (posy)^(obj.op);      new_gpvars_count = new_gpvars_count + length(new_vars);      new_constr = {new_constr{:} new_con{:}};      new_gpvars = {new_gpvars{:} new_vars{:}};    else % argument is a posynomial or monomial, etc.      epi_var = monomial(['temp__' num2str(new_gpvars_count)]);      new_gpvars_count = new_gpvars_count + 1;      new_gpvars{end+1} = epi_var.gpvars{:};      lhs = obj.args{1};      new_constr{end+1} = lhs <= epi_var;      std_obj = epi_var^(obj.op);     end  % have a max operation  elseif( strcmp(obj.op, 'max') )    epi_var = monomial(['temp__' num2str(new_gpvars_count)]);    new_gpvars_count = new_gpvars_count + 1;    new_gpvars{end+1} = epi_var.gpvars{:};    for k=1:length(obj.args)      if( isa(obj.args{k},'gposynomial') )        [posy,new_con,new_vars] = standardize(obj.args{k},new_gpvars_count);        new_gpvars_count = new_gpvars_count + length(new_vars);        new_constr = {new_constr{:} new_con{:}};        new_gpvars = {new_gpvars{:} new_vars{:}};        new_constr{end+1} = posy <= epi_var;      else % argument is a posynomial or monomial, etc.        lhs = obj.args{k};        new_constr{end+1} = lhs <= epi_var;      end    end    std_obj = epi_var;   % have an addition operation  elseif( strcmp(obj.op, '+') )    % have three cases depending if an argument is gposy or not    arg1_flag = isa(obj.args{1},'gposynomial');    arg2_flag = isa(obj.args{2},'gposynomial');    % could eliminate this checking but that might be too much recursion    if( arg1_flag & arg2_flag )      [std_obj1, new_con1, new_gpvars1] = standardize(obj.args{1},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars1);      [std_obj2, new_con2, new_gpvars2] = standardize(obj.args{2},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars2);      std_obj = std_obj1 + std_obj2;      new_constr = {new_constr{:} new_con1{:} new_con2{:}};      new_gpvars = {new_gpvars{:} new_gpvars1{:} new_gpvars2{:}};    elseif( arg1_flag & ~arg2_flag )      [std_obj1, new_con1, new_gpvars1] = standardize(obj.args{1},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars1);      std_obj = std_obj1 + obj.args{2};      new_constr = {new_constr{:} new_con1{:}};      new_gpvars = {new_gpvars{:} new_gpvars1{:}};    elseif( ~arg1_flag & arg2_flag )      [std_obj2, new_con2, new_gpvars2] = standardize(obj.args{2},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars2);      std_obj = obj.args{1} + std_obj2;      new_constr = {new_constr{:} new_con2{:}};      new_gpvars = {new_gpvars{:} new_gpvars2{:}};    end  % have a multiplication operation  elseif( strcmp(obj.op, '*') )    % have three cases depending if an argument is gposy or not    arg1_flag = isa(obj.args{1},'gposynomial');    arg2_flag = isa(obj.args{2},'gposynomial');    % could eliminate this checking but that might be too much recursion    if( arg1_flag & arg2_flag )      [std_obj1, new_con1, new_gpvars1] = standardize(obj.args{1},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars1);      [std_obj2, new_con2, new_gpvars2] = standardize(obj.args{2},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars2);      std_obj = std_obj1 * std_obj2;      new_constr = {new_constr{:} new_con1{:} new_con2{:}};      new_gpvars = {new_gpvars{:} new_gpvars1{:} new_gpvars2{:}};    elseif( arg1_flag & ~arg2_flag )      [std_obj1, new_con1, new_gpvars1] = standardize(obj.args{1},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars1);      std_obj = std_obj1 * obj.args{2};      new_constr = {new_constr{:} new_con1{:}};      new_gpvars = {new_gpvars{:} new_gpvars1{:}};    elseif( ~arg1_flag & arg2_flag )      [std_obj2, new_con2, new_gpvars2] = standardize(obj.args{2},new_gpvars_count);      new_gpvars_count = new_gpvars_count + length(new_gpvars2);      std_obj = obj.args{1} * std_obj2;      new_constr = {new_constr{:} new_con2{:}};      new_gpvars = {new_gpvars{:} new_gpvars2{:}};    end  endelse % we already have a posynomial or monomial, etc...  std_obj = obj;endreturn;

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91黄色在线观看| 成人动漫视频在线| 精品少妇一区二区三区在线播放| 性感美女久久精品| 91精品国产综合久久精品app| 天天影视涩香欲综合网| 欧美日韩成人在线一区| 老司机免费视频一区二区| 欧美tk—视频vk| 成人免费视频网站在线观看| 亚洲欧洲日韩一区二区三区| 在线看国产一区| 日本成人在线电影网| 久久久蜜桃精品| 9久草视频在线视频精品| 亚洲午夜羞羞片| 日韩视频一区二区三区| 丁香六月综合激情| 亚洲午夜av在线| 久久久久久夜精品精品免费| 色婷婷综合久色| 蜜臀av性久久久久av蜜臀妖精| 精品国产99国产精品| 岛国一区二区三区| 亚洲国产视频一区| 欧美大黄免费观看| 一本色道久久加勒比精品| 免费久久精品视频| 亚洲男同1069视频| 精品99999| 在线观看亚洲成人| 国产成人免费视频精品含羞草妖精 | 亚洲美女淫视频| 91精品国产综合久久久久久久久久| 国产福利视频一区二区三区| 五月婷婷色综合| 中文在线资源观看网站视频免费不卡| 欧美日韩在线一区二区| 国产大陆亚洲精品国产| 石原莉奈在线亚洲二区| 中文字幕日本乱码精品影院| 欧美精品一区二区三区蜜桃| 日本精品裸体写真集在线观看| 国产在线播放一区| 日韩**一区毛片| 亚洲另类中文字| 欧美国产国产综合| 精品成人私密视频| 国产精品伊人色| 亚洲免费在线观看视频| 2023国产一二三区日本精品2022| 欧美综合在线视频| aaa国产一区| 国内精品伊人久久久久av一坑 | 精品乱人伦小说| 欧美欧美午夜aⅴ在线观看| 91美女蜜桃在线| 国产成人在线视频免费播放| 久久国产剧场电影| 天堂av在线一区| 亚洲综合色区另类av| 亚洲欧美一区二区在线观看| 国产亚洲精品bt天堂精选| 精品sm在线观看| 欧美大度的电影原声| 日韩一二三区不卡| 日韩视频免费观看高清完整版在线观看 | 精品国产亚洲在线| 8v天堂国产在线一区二区| 在线观看免费一区| 91麻豆免费观看| 91天堂素人约啪| 95精品视频在线| 色综合激情五月| 色综合久久综合| 欧美专区在线观看一区| 一本久久综合亚洲鲁鲁五月天| 97久久久精品综合88久久| 成人免费毛片片v| 99精品桃花视频在线观看| av中文一区二区三区| 99久久99久久精品国产片果冻| 色偷偷成人一区二区三区91| 欧美视频一区二区| 7777精品伊人久久久大香线蕉超级流畅| 欧美视频一二三区| 51精品久久久久久久蜜臀| 欧美一卡在线观看| 久久丝袜美腿综合| 国产精品丝袜91| 亚洲婷婷综合久久一本伊一区| 亚洲欧美日韩电影| 亚洲第四色夜色| 久久99精品久久久久久国产越南 | 欧美一二三四在线| 亚洲精品一区二区三区影院| 久久久久久久久一| 中文幕一区二区三区久久蜜桃| 中文字幕中文在线不卡住| 亚洲黄色尤物视频| 日韩成人一级片| 国产成人三级在线观看| 91亚洲男人天堂| 6080午夜不卡| 久久网这里都是精品| 中文字幕欧美一区| 三级一区在线视频先锋 | 一区二区三区欧美在线观看| 午夜精品久久久久久久久久| 理论片日本一区| 91丨九色丨蝌蚪丨老版| 欧美高清你懂得| 国产欧美久久久精品影院| 亚洲综合在线第一页| 韩国av一区二区| 在线观看一区不卡| 亚洲精品一区二区三区影院| 亚洲狠狠丁香婷婷综合久久久| 日本不卡在线视频| 成人av资源网站| 91精品国产综合久久蜜臀| 亚洲欧洲精品成人久久奇米网 | 美女任你摸久久| 99久久久精品免费观看国产蜜| 3d动漫精品啪啪一区二区竹菊| 欧美国产日韩一二三区| 亚洲不卡在线观看| 波多野结衣中文一区| 69av一区二区三区| 一区二区中文视频| 国精产品一区一区三区mba桃花 | 日本欧美一区二区在线观看| 成人h动漫精品| 久久人人超碰精品| 日产国产欧美视频一区精品| 99re这里只有精品视频首页| 精品国产伦一区二区三区观看体验| 亚洲精品va在线观看| 成人午夜私人影院| 精品成a人在线观看| 日韩 欧美一区二区三区| 在线看一区二区| 亚洲图片激情小说| 成人白浆超碰人人人人| ww亚洲ww在线观看国产| 日韩中文字幕区一区有砖一区 | 国产偷国产偷亚洲高清人白洁| 天天色天天操综合| 欧洲一区二区av| 最新久久zyz资源站| 国产不卡视频在线播放| 日韩欧美激情四射| 美女一区二区三区| 欧美电影影音先锋| 性做久久久久久免费观看欧美| 91老师国产黑色丝袜在线| 国产精品久久久久久久午夜片| 国产成人在线视频免费播放| 欧美mv日韩mv| 久久99国内精品| 日韩欧美在线网站| 美国三级日本三级久久99| 欧美精品1区2区3区| 亚洲国产欧美在线| 5858s免费视频成人| 午夜伊人狠狠久久| 91麻豆精品国产| 蜜桃av一区二区三区电影| 日韩片之四级片| 久久精品国产77777蜜臀| 日韩欧美精品在线视频| 久久99久久久欧美国产| 欧美va亚洲va香蕉在线| 国内精品伊人久久久久av影院| 久久亚洲精华国产精华液| 国产一区二区伦理| 久久久精品综合| 北条麻妃国产九九精品视频| 专区另类欧美日韩| 欧美日韩久久久久久| 美女www一区二区| 久久精品一二三| 成人激情黄色小说| 亚洲蜜臀av乱码久久精品| 欧美日韩综合不卡| 青娱乐精品视频| 久久久综合精品| 97精品久久久久中文字幕| 天堂一区二区在线| 2020国产精品| 成人精品视频网站| 亚洲图片欧美视频| 精品久久久久久亚洲综合网| 丰满少妇在线播放bd日韩电影| 国产精品久久久久影院老司 | 色综合中文字幕国产| 亚洲美女屁股眼交3| 欧美一级黄色录像| 不卡一区二区在线| 石原莉奈在线亚洲三区|