/usr/share/gnudatalanguage/lib/uniq.pro is in libgnudatalanguage0 0.9.7-6.
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | ;$Id: uniq.pro,v 1.2 2010/01/20 11:41:59 slayoo Exp $
;+
;
;
;
; NAME:
; UNIQ
;
;
; PURPOSE:
; Returns subscripts of unique elements of an array
; To be used with SORT
;
; CATEGORY:
; General
;
; CALLING SEQUENCE:
; res = UNIQ( Array [, Index]) ;; if Array is sorted
; res = UNIQ( Array, SORT( Array)) ;; if Array is unsorted
;
;
; KEYWORD PARAMETERS:
; None
;
; OUTPUTS:
; Indices of uniq elements of Array
; Array must be sorted. If Array is unsorted use:
; res = UNIQ( Array, SORT( Array))
;
; OPTIONAL OUTPUTS:
; None.
;
;
; COMMON BLOCKS:
; None.
;
; SIDE EFFECTS:
; None.
;
;
; RESTRICTIONS:
; None.
;
;
; PROCEDURE:
;
;
; EXAMPLE:
;
;
;
; MODIFICATION HISTORY:
; Written by: Marc Schellens
;
;
;
;-
; LICENCE:
; Copyright (C) 2004,
; 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.
;
;
;-
function UNIQ, arr, index
on_error, 2
nEl = n_elements( arr)
if nEl le 1 then return,0
if n_params() eq 1 then begin
ix = where(arr ne shift(arr, -1))
if ix[0] ne -1 then return, ix $
else return, nEl-1
endif else begin
tmp = arr[ index]
ix = where(tmp ne shift(tmp,-1))
if ix[0] ne -1 then return, index[ix] $
else return, nEl-1
endelse
end
|