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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? corner.m

?? A comparison of methods for inverting helioseismic data
?? M
字號:
function [k_corner,info] = corner(rho,eta,fig)
%CORNER Find corner of discrete L-curve via adaptive pruning algorithm.
%
% [k_corner,info] = corner(rho,eta,fig)
%
% Returns the integer k_corner such that the corner of the log-log
% L-curve is located at ( log(rho(k_corner)) , log(eta(k_corner)) ).
%
% The vectors rho and eta must contain corresponding values of the
% residual norm || A x - b || and the solution's (semi)norm || x ||
% or || L x || for a sequence of regularized solutions, ordered such
% that rho and eta are monotonic and such that the amount of
% regularization decreases as k increases.
%
% The second output argument describes possible warnings.
% Any combination of zeros and ones is possible.
%   info = 000 : No warnings - rho and eta describe a discrete 
%                   L-curve with a corner.
%   info = 001 : Bad data - some elements of rho and/or eta are
%                   Inf, NaN, or zero.
%   info = 010 : Lack of monotonicity - rho and/or eta are not
%                   strictly monotonic.
%   info = 100 : Lack of convexity - the L-curve described by rho
%                   and eta is concave and has no corner.
%
% The warnings described above will also result in text warnings on the
% command line. Type 'warning off Corner:warnings' to disable all
% command line warnings from this function.
%
% If a third input argument is present, then a figure will show the discrete
% L-curve in log-log scale and also indicate the found corner.

% Reference: P. C. Hansen, T. K. Jensen and G. Rodriguez, "An adaptive
% pruning algorithm for the discrete L-curve criterion," J. Comp. Appl.
% Math., 198 (2007), 483-492.
  
% Per Christian Hansen and Toke Koldborg Jensen, IMM, DTU;
% Giuseppe Rodriguez, University of Cagliari, Italy; March 22, 2006.

% Initialization of data
rho = rho(:);       % Make rho and eta column vectors.
eta = eta(:);

if (nargin < 3) | isempty(fig)
    fig = 0;        % Default is no figure.
elseif fig < 0,
    fig = 0;
end

info = 0;

fin = isfinite(rho+eta);    % NaN or Inf will cause trouble.
nzr = rho.*eta~=0;          % A zero will cause trouble.
kept = find(fin & nzr);
if isempty(kept)
	error('Too many Inf/NaN/zeros found in data')
end
if length(kept) < length(rho)
	info = info + 1;
	warning('Corner:warnings', ...
           ['Bad data - Inf, NaN or zeros found in data\n' ...
            '         Continuing with the remaining data'])
end
rho = rho(kept);            % rho and eta with bad data removed.
eta = eta(kept);

if any(rho(1:end-1)<rho(2:end)) | any(eta(1:end-1)>eta(2:end))
	info = info + 10;
	warning('Corner:warnings', 'Lack of monotonicity')
end

% Prepare for adaptive algorithm.
nP = length(rho);           % Number of points.
P = log10([rho eta]);       % Coordinates of the loglog L-curve.
V = P(2:nP,:)-P(1:nP-1,:);  % The vectors defined by these coordinates.
v = sqrt(sum(V.^2,2));      % The length of the vectors.
W = V./repmat(v,1,2);       % Normalized vectors.
clist = [];                 % List of candidates.
p = min(5, nP-1);           % Number of vectors in pruned L-curve.
convex = 0;                 % Are the pruned L-curves convex?

% Sort the vectors according to the length, the longest first.
[Y,I] = sort(v);
I = flipud(I);

% Main loop -- use a series of pruned L-curves. The two functions
% 'Angles' and 'Global_Behavior' are used to locate corners of the
% pruned L-curves. Put all the corner candidates in the clist vector.
while p < (nP-1)*2
	elmts = sort(I(1:min(p, nP-1)));
    
    % First corner location algorithm
	candidate = Angles( W(elmts,:), elmts);
	if candidate>0,
		convex = 1;
	end
	if candidate & ~any(clist==candidate)
		clist = [clist;candidate];
	end
    
    % Second corner location algorithm
	candidate = Global_Behavior(P, W(elmts,:), elmts);
	if ~any(clist==candidate)
		clist = [clist; candidate];
	end
    
	p = p*2;
end

% Issue a warning and return if none of the pruned L-curves are convex.
if convex==0
	k_corner = [];
	info = info + 100;
	warning('Corner:warnings', 'Lack of convexity')
	return
end

% Put rightmost L-curve point in clist if not already there; this is
% used below to select the corner among the corner candidates.
if sum(clist==1) == 0
	clist = [1;clist];
end

% Sort the corner candidates in increasing order.
clist = sort(clist);

% Select the best corner among the corner candidates in clist. 
% The philosophy is: select the corner as the rightmost corner candidate
% in the sorted list for which going to the next corner candidate yields
% a larger increase in solution (semi)norm than decrease in residual norm,
% provided that the L-curve is convex in the given point. If this is never
% the case, then select the leftmost corner candidate in clist.

vz = find(diff(P(clist,2)) ...  % Points where the increase in solution
     >= abs(diff(P(clist,1)))); % (semi)norm is larger than or equal
                                % to the decrease in residual norm.
if length(vz)>1
	if(vz(1) == 1),  vz = vz(2:end);  end
elseif length(vz)==1
	if(vz(1) == 1),  vz = [];  end
end

if isempty(vz)		
        % No large increase in solution (semi)norm is found and the
        % leftmost corner candidate in clist is selected.
	index = clist(end);
else
        % The corner is selected as described above.
	vects = [P(clist(2:end),1)-P(clist(1:end-1),1) ...
			P(clist(2:end),2)-P(clist(1:end-1),2)];
	vects = sparse(diag(1./sqrt(sum(vects.^2,2)))) * vects;
	delta = vects(1:end-1,1).*vects(2:end,2) ...
			- vects(2:end,1).*vects(1:end-1,2);
	vv = find(delta(vz-1)<=0);
	if isempty(vv)
		index = clist(vz(end));
	else
		index = clist(vz(vv(1)));
	end
end

% Corner according to original vectors without Inf, NaN, and zeros removed.
k_corner = kept(index);

if fig  % Show log-log L-curve and indicate the found corner.
    figure(fig); clf
    diffrho2 = (max(P(:,1))-min(P(:,1)))/2;
    diffeta2 = (max(P(:,2))-min(P(:,2)))/2;
    loglog(rho, eta, 'k--o'); hold on; axis square;
    % Mark the corner.
    loglog([min(rho)/100,rho(index)],[eta(index),eta(index)],':r',... 
           [rho(index),rho(index)],[min(eta)/100,eta(index)],':r') 
    % Scale axes to same number of decades.
    if abs(diffrho2)>abs(diffeta2),
        ax(1) = min(P(:,1)); ax(2) = max(P(:,1));
        mid = min(P(:,2)) + (max(P(:,2))-min(P(:,2)))/2;
        ax(3) = mid-diffrho2; ax(4) = mid+diffrho2;
    else
        ax(3) = min(P(:,2)); ax(4) = max(P(:,2));
        mid = min(P(:,1)) + (max(P(:,1))-min(P(:,1)))/2;
        ax(1) = mid-diffeta2; ax(2) = mid+diffeta2;
    end
    ax = 10.^ax; ax(1) = ax(1)/2; axis(ax);
	xlabel('residual norm || A x - b ||_2')
	ylabel('solution (semi)norm || L x ||_2');
    title(sprintf('Discrete L-curve, corner at %d', k_corner));
end

% =========================================================================
% First corner finding routine -- based on angles

function index = Angles( W, kv)

% Wedge products
delta = W(1:end-1,1).*W(2:end,2) - W(2:end,1).*W(1:end-1,2);

[mm kk] = min(delta);
if mm < 0		% Is it really a corner?
	index = kv(kk) + 1;
else			% If there is no corner, return 0.
	index = 0;
end

% =========================================================================
% Second corner finding routine -- based on global behavior of the L-curve

function index = Global_Behavior(P, vects, elmts)

hwedge = abs(vects(:,2));  % Abs of wedge products between
                           % normalized vectors and horizontal,
                           % i.e., angle of vectors with horizontal.
[An, In] = sort(hwedge);   % Sort angles in increasing order.

% Locate vectors for describing horizontal and vertical part of L-curve.
count = 1;
ln = length(In);
mn = In(1);
mx = In(ln);
while(mn>=mx)
	mx = max([mx In(ln-count)]);
	count = count + 1;
	mn = min([mn In(count)]);
end
if count > 1
	I = 0; J = 0;
	for i=1:count
		for j=ln:-1:ln-count+1
			if(In(i) < In(j))
				I = In(i); J = In(j); break
			end
		end
		if I>0, break; end
	end
else
	I = In(1); J = In(ln);
end

% Find intersection that describes the "origin".
x3 = P(elmts(J)+1,1)+(P(elmts(I),2)-P(elmts(J)+1,2))/(P(elmts(J)+1,2) ...
			-P(elmts(J),2))*(P(elmts(J)+1,1)-P(elmts(J),1));
origin = [x3 P(elmts(I),2)];

% Find distances from the original L-curve to the "origin".  The corner
% is the point with the smallest Euclidian distance to the "origin".
dists = (origin(1)-P(:,1)).^2+(origin(2)-P(:,2)).^2;
[Y,index] = min(dists);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人午夜伦理影院| 一本久久a久久精品亚洲| 紧缚捆绑精品一区二区| 北条麻妃国产九九精品视频| 欧美日韩激情一区二区| 久久奇米777| 午夜精品福利视频网站| 成人一区二区三区视频| 2023国产精品自拍| 天堂一区二区在线免费观看| 99r国产精品| 国产欧美一区在线| 久久黄色级2电影| 欧美三电影在线| 亚洲一区二区三区三| www.亚洲免费av| 综合精品久久久| 99久久精品免费观看| 久久这里只有精品6| 美女网站色91| 日韩精品一区二区三区视频在线观看| 亚洲一区二区三区四区五区黄| 国产成人福利片| 日韩欧美激情四射| 精品综合久久久久久8888| 在线播放一区二区三区| 开心九九激情九九欧美日韩精美视频电影| 91视视频在线观看入口直接观看www | 日韩一级高清毛片| 一区二区在线免费观看| 九九九久久久精品| 久久综合一区二区| 久久成人av少妇免费| 欧美国产精品v| 在线视频你懂得一区| 亚洲va天堂va国产va久| 欧美成人一区二区三区在线观看 | 欧美国产成人在线| 欧美视频中文一区二区三区在线观看| 亚洲一区二区三区视频在线播放 | 国产亚洲婷婷免费| 成人性生交大片| 视频一区视频二区在线观看| 久久一区二区三区四区| 色综合色综合色综合色综合色综合| 亚洲mv在线观看| 欧美激情艳妇裸体舞| 777久久久精品| 一本久久a久久精品亚洲| 蜜臀国产一区二区三区在线播放| 国产婷婷色一区二区三区四区 | 国产九九视频一区二区三区| 日本一区二区成人在线| 欧美一区二区三区四区在线观看| 高清不卡一区二区| 精品在线亚洲视频| 亚洲午夜国产一区99re久久| 综合欧美亚洲日本| 国产精品色一区二区三区| 日韩一卡二卡三卡| 欧美日韩一卡二卡三卡| av成人免费在线| 99热这里都是精品| 国产一区二区三区| 国产在线视频精品一区| 国产真实乱对白精彩久久| 麻豆91精品91久久久的内涵| 亚洲国产乱码最新视频| 亚洲一级在线观看| 日产精品久久久久久久性色| 午夜精品久久久久久久99樱桃| 亚洲一级二级三级| 秋霞av亚洲一区二区三| 日本中文字幕一区| 国产一区二区三区蝌蚪| 国产成人精品午夜视频免费| 国产在线精品一区二区不卡了 | 奇米在线7777在线精品| 午夜欧美在线一二页| 国产一区二区精品在线观看| 国产美女精品人人做人人爽| 成人激情图片网| 欧美日韩美少妇| 中文字幕av免费专区久久| 亚洲免费在线看| 日本不卡中文字幕| 成人精品国产福利| 欧美另类变人与禽xxxxx| 国产亚洲综合在线| 亚洲sss视频在线视频| 国产成人综合亚洲91猫咪| 色婷婷亚洲综合| 精品99999| 亚洲成人av一区二区| 成人午夜大片免费观看| 日韩一区二区三区免费看| 亚洲狠狠丁香婷婷综合久久久| 国产伦理精品不卡| 日韩一区二区在线观看| 亚洲成人一区在线| 91碰在线视频| 欧美国产视频在线| 麻豆国产欧美一区二区三区| 成人av在线资源网站| 精品国产麻豆免费人成网站| 亚洲成人激情综合网| 欧美中文字幕久久 | 欧美视频一区二区在线观看| 亚洲图片你懂的| 91蜜桃婷婷狠狠久久综合9色| 中文字幕精品综合| 成人福利视频在线| 一区二区三区四区在线播放| 色国产精品一区在线观看| 国产精品久99| 91黄视频在线| 日本伊人精品一区二区三区观看方式| 884aa四虎影成人精品一区| 午夜欧美在线一二页| 日韩午夜av一区| 成人免费观看视频| 亚洲一卡二卡三卡四卡无卡久久| 欧美日韩免费高清一区色橹橹| 亚洲视频综合在线| 51精品视频一区二区三区| 精品一区二区三区影院在线午夜| 久久在线观看免费| 在线观看一区二区视频| 久久成人久久爱| 亚洲图片你懂的| 日韩欧美在线综合网| 不卡一区二区中文字幕| 三级成人在线视频| 国产精品毛片大码女人 | 男女激情视频一区| 国产精品久久久久久一区二区三区 | 欧美一区二区免费| 豆国产96在线|亚洲| 全部av―极品视觉盛宴亚洲| 一色屋精品亚洲香蕉网站| 欧美精品久久久久久久多人混战 | 色婷婷国产精品| 国产成人精品影院| 精品在线一区二区| 日韩精品91亚洲二区在线观看| 久久日韩精品一区二区五区| 欧美日韩中文国产| 在线影院国内精品| 91视频xxxx| 色菇凉天天综合网| 91蝌蚪国产九色| 97se亚洲国产综合自在线不卡| 国产精品一区免费视频| 亚洲综合在线免费观看| 国产婷婷色一区二区三区四区| 欧美视频一区二区三区在线观看 | 日韩一区二区影院| 欧美午夜在线观看| 一本色道久久综合亚洲aⅴ蜜桃| 国内成人自拍视频| 国产精品亚洲人在线观看| 国产精品99精品久久免费| 风流少妇一区二区| 99视频有精品| 欧美午夜在线观看| 欧美精品日韩综合在线| 精品成人a区在线观看| 国产精品国产三级国产aⅴ中文| 国产网站一区二区| 激情六月婷婷综合| 国产成人综合网| 91久久免费观看| 91精品久久久久久蜜臀| 国产日韩欧美麻豆| 亚洲午夜视频在线| 国产成人综合亚洲网站| 欧美日韩一二区| 国产亚洲va综合人人澡精品| 精品日韩av一区二区| 欧美国产精品专区| 蜜臀99久久精品久久久久久软件| 国产精品一区二区x88av| 欧美性大战久久| 国产精品初高中害羞小美女文| 亚洲国产一二三| 成人免费黄色大片| 久久久精品免费网站| 亚洲国产精品久久不卡毛片| 国产电影一区在线| 亚洲精品一区二区三区福利| 日本中文字幕一区二区有限公司| 91国偷自产一区二区三区成为亚洲经典| 日韩欧美电影一区| 免费亚洲电影在线| 91精品国产色综合久久ai换脸| 亚洲精品国产视频| 91麻豆免费视频| 亚洲卡通欧美制服中文| 91久久香蕉国产日韩欧美9色| 亚洲欧美国产高清|