C language function:IdentityMatrix sample codes

Search sample code in the internet.It is the result.


TITLE : IdentityMatrix function (Windows)
D2D1_MATRIX_3X2_F IdentityMatrix(void);.......
http://msdn.microsoft.com/en-us/library/windows/desktop/dd372258(v=vs.85).aspx


TITLE : Identity matrix - Rosetta Code
INPUT "Enter size of matrix: " size% PROCidentitymatrix(size%, im()) FOR r% = 0 TO size%-1 FOR c% = 0 TO size%-1 PRINT im(r%, c%),; NEXT PRINT NEXT r% END DEF PROCidentitymatrix(s%, RETURN m()) LOCAL i% DIM m(s%-1, s%-1) FOR i% = 0 TO s%-1 m(i%,i%) = 1 NEXT ENDPROC.......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
MODULE Algebras;IMPORT StdLog,Strings; TYPE Matrix = POINTER TO ARRAY OF ARRAY OF INTEGER; PROCEDURE NewIdentityMatrix(n: INTEGER): Matrix;VAR m: Matrix; i: INTEGER;BEGIN NEW(m,n,n); FOR i := 0 TO n - 1 DO m[i,i] := 1; END; RETURN m;END NewIdentityMatrix; PROCEDURE Show(m: Matrix);VAR i,j: INTEGER;BEGIN FOR i := 0 TO LEN(m,0) - 1 DO FOR j := 0 TO LEN(m,1) - 1 DO StdLog.Int(m[i,j]); END; StdLog.Ln ENDEND Show; PROCEDURE Do*;BEGIN Show(NewIdentityMatrix(5));END Do;END Algebras........
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
function IdentityMatrix(n) $ X:=zeros(n,n); $ for i=1 to n $ X[i,i]:=1; $ end; $ return X; $endfunction.......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
(2..6).each { order -> def iMatrix = makeIdentityMatrix(order) iMatrix.each { println it } println()}.......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
> LinearAlgebra:-IdentityMatrix( 4 ); [1 0 0 0] [ ] [0 1 0 0] [ ] [0 0 1 0] [ ] [0 0 0 1].......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
proc identityMatrix(n): auto = result = newSeq[seq[int]](n) for i in 0 .. < result.len: result[i] = newSeq[int](n) result[i][i] = 1.......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
program IdentityMatrix(input, output); var matrix: array of array of integer; n, i, j: integer; begin write('Size of matrix: '); readln(n); setlength(matrix, n, n); for i := 0 to n - 1 do matrix[i,i] := 1; for i := 0 to n - 1 do begin for j := 0 to n - 1 do write (matrix[i,j], ' '); writeln; end;end........
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
size = 5im = newlist(size, size)identityMatrix(size, im)for r = 1 to size for c = 1 to size see im[r][c] next see nlnext func identityMatrix s, m m = newlist(s, s) for i = 1 to s m[i][i] = 1 next return m func newlist x, y if isstring(x) x=0+x ok if isstring(y) y=0+y ok alist = list(x) for t in alist t = list(y) next return alist.......
http://rosettacode.org/wiki/Identity_matrix
TITLE : Identity matrix - Rosetta Code
def identityMatrix(n:Int)=Array.tabulate(n,n)((x,y) => if(x==y) 1 else 0)def printMatrix[T](m:Array[Array[T]])=m map (_.mkString("[", ", ", "]")) mkString "\n" printMatrix(identityMatrix(5)).......
http://rosettacode.org/wiki/Identity_matrix
search Google

https://www.google.com/#q=IdentityMatrix