⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 balanc.dem

📁 Delphi Pascal 数据挖掘领域算法包 数值算法大全
💻 DEM
字号:
PROGRAM d11r5(input,output);
(* driver for routine BALANC *)
CONST
   np=5;
TYPE
   glnp = ARRAY [1..np] OF real;
   glnpnp = ARRAY [1..np,1..np] OF real;
VAR
   i,j : integer;
   a : glnpnp;
   c,r : glnp;

(*$I MODFILE.PAS *)
(*$I BALANC.PAS *)

BEGIN
   a[1,1] := 1.0; a[1,2] := 100.0; a[1,3] := 1.0;
   a[1,4] := 100.0; a[1,5] := 1.0;
   a[2,1] := 1.0; a[2,2] := 1.0; a[2,3] := 1.0;
   a[2,4] := 1.0; a[2,5] := 1.0;
   a[3,1] := 1.0; a[3,2] := 100.0; a[3,3] := 1.0;
   a[3,4] := 100.0; a[3,5] := 1.0;
   a[4,1] := 1.0; a[4,2] := 1.0; a[4,3] := 1.0;
   a[4,4] := 1.0; a[4,5] := 1.0;
   a[5,1] := 1.0; a[5,2] := 100.0; a[5,3] := 1.0;
   a[5,4] := 100.0; a[5,5] := 1.0;
(* write norms *)
   FOR i := 1 to np DO BEGIN
      r[i] := 0.0;
      c[i] := 0.0;
      FOR j := 1 to np DO BEGIN
         r[i] := r[i]+abs(a[i,j]);
         c[i] := c[i]+abs(a[j,i])
      END
   END;
   writeln('rows:');
   FOR i := 1 to np DO write(r[i]:12:2);
   writeln;
   writeln('columns:');
   FOR i := 1 to np DO write(c[i]:12:2);
   writeln;
   writeln;
   writeln('***** balancing matrix *****');
   writeln;
   balanc(a,np);
(* write norms *)
   FOR i := 1 to np DO BEGIN
      r[i] := 0.0;
      c[i] := 0.0;
      FOR j := 1 to np DO BEGIN
         r[i] := r[i]+abs(a[i,j]);
         c[i] := c[i]+abs(a[j,i])
      END
   END;
   writeln('rows:');
   FOR i := 1 to np DO write(r[i]:12:2);
   writeln;
   writeln('columns:');
   FOR i := 1 to np DO write(c[i]:12:2);
   writeln
END.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -