초기화들 - randint (명확한 세개의 인자와 불분명한 4개의 인자)

[Graphics:../Images/index_gr_2.gif]
Clear[randint]
randint[m_,n_,k_:9] :=
   Table[ Random[Integer,{-k,k}], {m},{n}]

randint[m_] := randint[m,m]

randint[m_, n_Integer?Positive, k_, r_Integer?Positive] /;
    r<=Min[m,n] :=
   Module[{p,A,done=False},
      p = Ceiling[k/r];
      While[Not[done],
         A = randint[m,r,p].randint[r,n,1];
         A = Map[(If[Abs[#]<=k,#,0])&,A,{2}];
         done = (n - Length[NullSpace[A]] == r)
      ];
      A]


Converted by Mathematica      January 18, 2000