<<prev file | next file >>    view single page | view frames    summary: fields | routine    details: routine

Matrix/

inter.pro

find the intersection between 2 matrices of whole numbers see also different and union

topinter Calculation

result = inter(a, b)

Return value

an array containing the set of values in both a and b. The empty set is denoted by an array with the first element equal to -1.

Parameters

a        in required

arrays of positive integers, which need not to be sorted. Duplicate elements are ignored, as they have no effect on the result

b        in required

see a

Examples

IDL> a = [2,4,6,8] IDL> b = [6,1,3,2] IDL> res=inter(a,b) 2 6 Right because 2 and 6 are in a and B.

Version history

Version

$Id: inter.pro 378 2008-08-12 12:35:46Z pinsard $

History

Known issues

Restrictions

These functions will not be efficient on sparse sets with wide ranges, as they trade memory for efficiency. The HISTOGRAM function is used, which creates arrays of size equal to the range of the resulting set.

Statistics

McCabe cyclic 9
McCabe essential 1
McCabe modular design 1
Produced by IDLdoc 2.0.