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

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

?? grplot.m

?? 優化程序
?? M
字號:
function h=grPlot(V,E,kind,vkind,ekind)
% Function h=grPlot(V,E,kind,vkind,ekind) 
% draw the plot of the graph (digraph).
% Input parameters: 
%   V(n,2) or (n,3) - the coordinates of vertexes
%     (1st column - x, 2nd - y) and, maybe, 3rd - the weights;
%     n - number of vertexes.
%     If V(n,2), we write labels: numbers of vertexes,
%     if V(n,3), we write labels: the weights of vertexes.
%     If V=[], use regular n-angle.
%   E(m,2) or (m,3) - the edges of graph (arrows of digraph)
%     and their weight; 1st and 2nd elements of each row 
%     is numbers of vertexes;
%     3rd elements of each row is weight of arrow;
%     m - number of arrows.
%     If E(m,2), we write labels: numbers of edges (arrows);
%     if E(m,3), we write labels: weights of edges (arrows).
%     For disconnected graph use E=[] or h=PlotGraph(V).
%   kind - the kind of graph.
%   kind = 'g' (to draw the graph) or 'd' (to draw digraph);
%   (optional, 'g' default).
%   vkind - kind of labels for vertexes (optional).
%   ekind - kind of labels for edges or arrows (optional).
%   For vkind and ekind use the format of function FPRINTF,
%   for example, '%8.3f', '%14.10f' etc. Default value is '%d'.
%   Use '' (empty string) for don't draw labels.
% Output parameter:
%   h - handle of figure (optional).
% See also GPLOT.
% Author: Sergiy Iglin
% e-mail: siglin@yandex.ru
% personal page: http://iglin.exponenta.ru
% Acknowledgements to Mr.Howard (howardz@cc.gatech.edu)
% for testing of this algorithm.

% ============= Input data validation ==================
if nargin<1,
  error('There are no input data!')
end
if (nargin==1) & isempty(V),
  error('V is empty and E is not determined!')
end
if (nargin==2) & isempty(V) & isempty(E),
  error('V and E are empty!')
end
if ~isempty(V),
  if ~isnumeric(V),
    error('The array V must be numeric!') 
  end
  sv=size(V); % size of array V
  if length(sv)~=2,
    error('The array V must be 2D!') 
  end
  if (sv(2)<2),
    error('The array V must have 2 or 3 columns!'), 
  end
  if nargin==1, % disconnected graph
    E=[];
  end
end
if ~isempty(E), % for connected graph
  [m,n,newE]=grValidation(E);
  we=min(3,size(E,2)); % 3 for weighed edges
  E=newE;
  if isempty(V), % regular n-angle
    V=[cos(2*pi*[1:5]'/n) sin(2*pi*[1:5]'/n)];
    sv=size(V); % size of array V
  end
  if n>sv(1),
    error('Several vertexes is not determined!');
  end
else
  m=0;
end

% ============= Other arguments ==================
n=sv(1); % real number of vertexes
wv=min(3,sv(2)); % 3 for weighted vertexes
if nargin<3, % only 2 input parameters
  kind1='g';
else
  if isempty(kind),
    kind='g';
    kind1='g';
  end
  if ~ischar(kind),
    error('The argument kind must be a string!')
  else
    kind1=lower(kind(1));
  end
end
if nargin<4,
  vkind1='%d';
else
  if ~ischar(vkind),
    error('The argument vkind must be a string!')
  else
    vkind1=lower(vkind);
  end
end
if nargin<5,
  ekind1='%d';
else
  if ~ischar(ekind),
    error('The argument ekind must be a string!')
  else
    ekind1=lower(ekind);
  end
end
md=inf; % the minimal distance between vertexes
for k1=1:n-1,
  for k2=k1+1:n,
    md=min(md,sum((V(k1,:)-V(k2,:)).^2)^0.5);
  end
end
if md<eps, % identical vertexes
  error('The array V have identical rows!')
else
  V(:,1:2)=V(:,1:2)/md; % normalization
end
r=0.1; % for multiple edges
tr=linspace(pi/4,3*pi/4);
xr=0.5-cos(tr)/2^0.5;
yr=(sin(tr)-2^0.5/2)/(1-2^0.5/2);
t=linspace(-pi/2,3*pi/2); % for loops
xc=0.1*cos(t);
yc=0.1*sin(t);

% we sort the edges
if ~isempty(E),
  E=[zeros(m,1),[1:m]',E]; % 1st column for change, 2nd column is edge number
  need2=find(E(:,4)<E(:,3)); % for replace v1<->v2
  tmp=E(need2,3);
  E(need2,3)=E(need2,4);
  E(need2,4)=tmp;
  E(need2,1)=1; % 1, if v1<->v2
  [e1,ie1]=sort(E(:,3)); % sort by 1st vertex
  E1=E(ie1,:);
  for k2=E1(1,3):E1(end,3),
    num2=find(E1(:,3)==k2);
    if ~isempty(num2), % sort by 2nd vertex
      E3=E1(num2,:);
      [e3,ie3]=sort(E3(:,4));
      E4=E3(ie3,:);
      E1(num2,:)=E4;
    end
  end
  ip=find(E1(:,3)==E1(:,4)); % we find loops
  Ep=E1(ip,:); % loops
  E2=E1(setdiff([1:m],ip),:); % edges without loops
end

% we paint the graph
hh=figure;
hold on
plot(V(:,1),V(:,2),'k.','MarkerSize',20)
axis equal
h1=get(gca); % handle of current figure
if ~isempty(vkind1), % labels of vertexes
  for k=1:n,
    if wv==3,
      s=sprintf(vkind1,V(k,3));
    else
      s=sprintf(vkind1,k);
    end
    hhh=text(V(k,1)+0.05,V(k,2)-0.07,s);
%   set(hhh,'FontName','Times New Roman Cyr','FontSize',18)
  end
end

% edges (arrows)
if ~isempty(E),
  k=0;
  m2=size(E2,1); % number of edges without loops
  while k<m2,
    k=k+1; % current edge
    MyE=V(E2(k,3:4),1:2); % numbers of vertexes 1, 2
    k1=1; % we find the multiple edges
    if k<m2,
      while all(E2(k,3:4)==E2(k+k1,3:4)),
        k1=k1+1;
        if k+k1>m2,
          break;
        end
      end
    end
    ry=r*[1:k1];
    ry=ry-mean(ry); % radius
    l=norm(MyE(1,:)-MyE(2,:)); % lenght of line
    dx=MyE(2,1)-MyE(1,1);
    dy=MyE(2,2)-MyE(1,2);
    alpha=atan2(dy,dx); % angle of rotation
    cosa=cos(alpha);
    sina=sin(alpha);
    MyX=xr*l;
    for k2=1:k1, % we draw the edges (arrows)
      MyY=yr*ry(k2);
      MyXg=MyX*cosa-MyY*sina+MyE(1,1);
      MyYg=MyX*sina+MyY*cosa+MyE(1,2);
      plot(MyXg,MyYg,'k-');
      if kind1=='d', % digraph with arrows
        if E2(k+k2-1,1)==1,
          [xa,ya]=CreateArrow(MyXg(1:2),MyYg(1:2));
          fill(xa,ya,'k');
        else
          [xa,ya]=CreateArrow(MyXg(end:-1:end-1),MyYg(end:-1:end-1));
          fill(xa,ya,'k');
        end
      end
      if ~isempty(ekind1), % labels of edges (arrows)
        if we==3,
          s=sprintf(ekind1,E2(k+k2-1,5));
        else
          s=sprintf(ekind1,E2(k+k2-1,2));
        end
        text(MyXg(length(MyXg)/2),MyYg(length(MyYg)/2),s);
%        set(hhh,'FontName','Times New Roman Cyr','FontSize',18)
      end
    end
    k=k+k1-1;
  end
  % we draw the loops
  k=0;
  ml=size(Ep,1); % number of loops
  while k<ml,
    k=k+1; % current loop
    MyV=V(Ep(k,3),1:2); % vertexes
    k1=1; % we find the multiple loops
    if k<ml,
      while all(Ep(k,3:4)==Ep(k+k1,3:4)),
        k1=k1+1;
        if k+k1>ml,
          break;
        end
      end
    end
    ry=[1:k1]+1; % radius
    for k2=1:k1, % we draw the loop
      MyX=xc*ry(k2)+MyV(1);
      MyY=(yc+r)*ry(k2)+MyV(2);
      plot(MyX,MyY,'k-');
      if kind1=='d',
        [xa,ya]=CreateArrow(MyX([1 10]),MyY([1 10]));
        fill(xa,ya,'k');
      end
      if ~isempty(ekind1), % labels of edges (arrows)
        if we==3,
          s=sprintf(ekind1,Ep(k+k2-1,5));
        else
          s=sprintf(ekind1,Ep(k+k2-1,2));
        end
        hhh=text(MyX(length(MyX)/2),MyY(length(MyY)/2),s);
%        set(hhh,'FontName','Times New Roman Cyr','FontSize',18)
      end
    end
    k=k+k1-1;
  end
end
hold off
axis off
if nargout==1,
  h=hh;
end
return

function [xa,ya]=CreateArrow(x,y)
% create arrow with length 0.1 with tip x(1), y(1) 
% and direction from x(2), y(2)

xa1=[0 0.1 0.08 0.1 0]';
ya1=[0 0.03 0 -0.03 0]';
dx=diff(x);
dy=diff(y);
alpha=atan2(dy,dx); % angle of rotation
cosa=cos(alpha);
sina=sin(alpha);
xa=xa1*cosa-ya1*sina+x(1);
ya=xa1*sina+ya1*cosa+y(1);
return

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人av网站在线| 国产乱人伦偷精品视频免下载 | 国产精品萝li| 久久久影院官网| 欧美一级二级三级蜜桃| 色狠狠桃花综合| av高清不卡在线| 国产精品综合久久| 激情亚洲综合在线| 久久国产人妖系列| 久久超碰97人人做人人爱| 午夜精品爽啪视频| 一区二区三区精品在线| 一区二区三区在线免费播放| 国产精品免费av| 欧美国产日韩在线观看| 国产亚洲一本大道中文在线| 欧美精品一区视频| 久久久久久99久久久精品网站| 久久婷婷国产综合国色天香| 久久蜜桃av一区精品变态类天堂 | 亚洲色图丝袜美腿| 亚洲精品中文在线| 奇米影视一区二区三区| 老汉av免费一区二区三区| 九九热在线视频观看这里只有精品| 欧美aaa在线| av中文一区二区三区| 欧美系列日韩一区| 日韩午夜av一区| 欧美国产欧美亚州国产日韩mv天天看完整 | 色中色一区二区| 3atv在线一区二区三区| 国产亚洲一区二区三区在线观看 | 亚洲香蕉伊在人在线观| 日日夜夜免费精品视频| 国产精品资源在线| 欧美美女黄视频| 国产欧美日韩久久| 热久久久久久久| 91一区二区三区在线播放| 欧美一级日韩一级| 亚洲欧洲av一区二区三区久久| 美女尤物国产一区| 91行情网站电视在线观看高清版| 日韩免费视频一区二区| 亚洲自拍欧美精品| 99精品黄色片免费大全| 精品久久人人做人人爰| 亚洲综合色网站| 不卡影院免费观看| 国产亚洲精品超碰| 久国产精品韩国三级视频| 欧美性极品少妇| 国产精品私人影院| 国产乱国产乱300精品| 欧美一二三四区在线| 亚洲成a人片综合在线| 91久久免费观看| 亚洲欧美一区二区三区极速播放 | 久久精品免费在线观看| 韩国精品在线观看| 日韩一区二区三区精品视频| 天堂av在线一区| 欧美日韩国产电影| 日韩二区三区四区| 日韩视频永久免费| 国产在线精品一区二区| 国产日韩av一区二区| 国产一区91精品张津瑜| 精品播放一区二区| 国产精品白丝jk黑袜喷水| 久久久久国产精品人| 成人h动漫精品| 亚洲夂夂婷婷色拍ww47| 欧美日韩国产综合久久| 欧美女孩性生活视频| 久久精品国产免费| 欧美激情在线一区二区| 91黄色小视频| 免费av成人在线| 中文字幕一区二区三中文字幕| 色国产精品一区在线观看| 五月天中文字幕一区二区| 欧美va亚洲va| 色哟哟一区二区三区| 欧美午夜一区二区| 极品美女销魂一区二区三区免费 | 亚洲女人的天堂| 欧美一级午夜免费电影| 91社区在线播放| 韩日欧美一区二区三区| 成人免费在线播放视频| 欧美成人激情免费网| 欧美最猛性xxxxx直播| 精品综合久久久久久8888| 一区二区不卡在线视频 午夜欧美不卡在 | 久久嫩草精品久久久久| 欧美又粗又大又爽| 国产精品一区二区三区四区| 亚洲摸摸操操av| 中文字幕免费观看一区| 欧美videos中文字幕| 欧美精选午夜久久久乱码6080| 成人免费精品视频| 韩国三级中文字幕hd久久精品| 亚洲a一区二区| 亚洲一级电影视频| 亚洲人成在线观看一区二区| 国产日本一区二区| 国产色产综合色产在线视频| 91精品综合久久久久久| 欧美午夜在线观看| 日本久久电影网| 91麻豆成人久久精品二区三区| 风间由美性色一区二区三区| 国产一区二区三区四区五区入口 | 日韩女同互慰一区二区| 亚洲精品一区二区三区福利| 欧美精品一区男女天堂| 日韩欧美一二三| 久久精品人人做人人爽97| 国产亚洲精品福利| 中文字幕亚洲在| 亚洲人吸女人奶水| 亚洲线精品一区二区三区 | 亚洲香肠在线观看| 亚洲愉拍自拍另类高清精品| 亚洲综合在线视频| 日韩综合一区二区| 久久aⅴ国产欧美74aaa| 成人精品视频网站| 色就色 综合激情| 日韩一级免费一区| 亚洲欧洲三级电影| 日本成人超碰在线观看| 国产v日产∨综合v精品视频| 91网站最新地址| 欧美一区二区在线视频| 久久精品免视看| 亚洲va中文字幕| 国产成人综合自拍| 色狠狠桃花综合| 国产欧美精品国产国产专区| 亚洲电影欧美电影有声小说| 国产精品亚洲专一区二区三区| 91小视频免费观看| 欧美变态凌虐bdsm| 亚洲国产成人精品视频| 国产很黄免费观看久久| 欧美美女黄视频| 亚洲免费在线观看视频| 国产精品1区二区.| 日韩欧美国产一二三区| 亚洲成a人在线观看| 一本一本大道香蕉久在线精品| 国产日韩欧美激情| 国产自产v一区二区三区c| 6080午夜不卡| 午夜精品一区二区三区电影天堂| 91在线视频观看| 久久国产免费看| 欧美一区二区精美| 日韩精品欧美精品| 欧美日韩www| 三级精品在线观看| 日韩午夜小视频| 美女视频第一区二区三区免费观看网站| 一本大道久久a久久综合婷婷| 中国色在线观看另类| 国产99精品国产| 国产精品美女久久久久aⅴ国产馆| 国产精品一线二线三线精华| 精品欧美一区二区久久| 国产曰批免费观看久久久| 精品免费国产一区二区三区四区| 精品一区二区三区免费播放| 欧美丰满嫩嫩电影| 久久精品国产久精国产爱| 久久人人爽爽爽人久久久| 国产成人aaa| 亚洲欧美日韩人成在线播放| 99精品视频一区| 亚洲mv在线观看| 久久久另类综合| 色8久久人人97超碰香蕉987| 一区二区三区在线视频免费 | 91精品国产高清一区二区三区 | 26uuu久久综合| 99re成人精品视频| 蓝色福利精品导航| 亚洲人精品午夜| 久久夜色精品国产欧美乱极品| av中文字幕亚洲| 青青国产91久久久久久| 中文字幕一区二区日韩精品绯色| 欧美性受xxxx| 国产成人精品免费在线| 三级不卡在线观看| 中文字幕人成不卡一区|