/usr/share/gnudatalanguage/lib/identity.pro is in libgnudatalanguage0 0.9.6v2-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | ;$Id: identity.pro,v 1.3 2011/12/30 02:02:47 alaingdl Exp $
function IDENTITY, n, double=double_keyword, help=help
;+
;
; NAME:
; identity
;
; PURPOSE:
; returns an n x n identity matrix
;
; CATEGORY:
; Mathematics: Matrices
;
; CALLING SEQUENCE:
; i=IDENTITY(4)
;
; KEYWORD PARAMETERS:
; DOUBLE_KEYWORD : Keyword for double precision calculation
;
; OUTPUTS:
; The identity matrix
;
; PROCEDURE:
; Creates an n x n matrix, fills the diagonal elements with the
; value 1.0
;
; EXAMPLE:
; i = IDENTITY(4)
; print, i
; 1.00000 0.00000 0.0000 0.00000
; 0.00000 1.00000 0.0000 0.00000
; 0.00000 0.00000 1.0000 0.00000
; 0.00000 0.00000 0.0000 1.00000
;
; MODIFICATION HISTORY:
; Written by: 2004-03-20 Christopher Lee.
; 2011-12-17 G. Duvert (if n==1 !)
;
;-
; LICENCE:
; Copyright (C) 2004, 2011
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
;-
;
ON_ERROR, 2
;
if KEYWORD_SET(help) then begin
print, "function IDENTITY, n, double=double_keyword, help=help"
return, -1
endif
;
diag=INDGEN(n)
;
if (KEYWORD_SET(double_keyword)) then begin
id=DBLARR(n,n)
endif else begin
id=FLTARR(n,n)
endelse
;
id(diag,diag)=1
;
return, id
;
end
|