This file is indexed.

/usr/share/doc/octave/octave.html/Set-Operations.html is in octave-doc 4.2.2-1ubuntu1.

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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.5, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Set Operations (GNU Octave)</title>

<meta name="description" content="Set Operations (GNU Octave)">
<meta name="keywords" content="Set Operations (GNU Octave)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Sets.html#Sets" rel="up" title="Sets">
<link href="Polynomial-Manipulations.html#Polynomial-Manipulations" rel="next" title="Polynomial Manipulations">
<link href="Sets.html#Sets" rel="prev" title="Sets">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">


</head>

<body lang="en">
<a name="Set-Operations"></a>
<div class="header">
<p>
Up: <a href="Sets.html#Sets" accesskey="u" rel="up">Sets</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Set-Operations-1"></a>
<h3 class="section">27.1 Set Operations</h3>

<p>Octave supports several basic set operations.  Octave can compute the union,
intersection, and difference of two sets.  Octave also supports the
<em>Exclusive Or</em> set operation.
</p>
<p>The functions for set operations all work in the same way by accepting two
input sets and returning a third set.  As an example, assume that <code>a</code> and
<code>b</code> contains two sets, then
</p>
<div class="example">
<pre class="example">union (a, b)
</pre></div>

<p>computes the union of the two sets.
</p>
<p>Finally, determining whether elements belong to a set can be done with the
<code>ismember</code> function.  Because sets are ordered this operation is very
efficient and is of order O(log2(n)) which is preferable to the <code>find</code>
function which is of order O(n).
</p>
<a name="XREFintersect"></a><dl>
<dt><a name="index-intersect"></a>: <em><var>c</var> =</em> <strong>intersect</strong> <em>(<var>a</var>, <var>b</var>)</em></dt>
<dt><a name="index-intersect-1"></a>: <em><var>c</var> =</em> <strong>intersect</strong> <em>(<var>a</var>, <var>b</var>, &quot;rows&quot;)</em></dt>
<dt><a name="index-intersect-2"></a>: <em>[<var>c</var>, <var>ia</var>, <var>ib</var>] =</em> <strong>intersect</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Return the unique elements common to both <var>a</var> and <var>b</var> sorted in
ascending order.
</p>
<p>If <var>a</var> and <var>b</var> are both row vectors then return a row vector;
Otherwise, return a column vector.  The inputs may also be cell arrays of
strings.
</p>
<p>If the optional input <code>&quot;rows&quot;</code> is given then return the common rows of
<var>a</var> and <var>b</var>.  The inputs must be 2-D matrices to use this option.
</p>
<p>If requested, return index vectors <var>ia</var> and <var>ib</var> such that
<code><var>c</var> = <var>a</var>(<var>ia</var>)</code> and <code><var>c</var> = <var>b</var>(<var>ib</var>)</code>.
</p>
</dd></dl>

<p><strong>See also:</strong> <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFunion">union</a>, <a href="#XREFsetdiff">setdiff</a>, <a href="#XREFsetxor">setxor</a>, <a href="#XREFismember">ismember</a>.
</p>

<a name="XREFunion"></a><dl>
<dt><a name="index-union"></a>: <em><var>c</var> =</em> <strong>union</strong> <em>(<var>a</var>, <var>b</var>)</em></dt>
<dt><a name="index-union-1"></a>: <em><var>c</var> =</em> <strong>union</strong> <em>(<var>a</var>, <var>b</var>, &quot;rows&quot;)</em></dt>
<dt><a name="index-union-2"></a>: <em>[<var>c</var>, <var>ia</var>, <var>ib</var>] =</em> <strong>union</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Return the unique elements that are in either <var>a</var> or <var>b</var> sorted in
ascending order.
</p>
<p>If <var>a</var> and <var>b</var> are both row vectors then return a row vector;
Otherwise, return a column vector.  The inputs may also be cell arrays of
strings.
</p>
<p>If the optional input <code>&quot;rows&quot;</code> is given then return rows that are in
either <var>a</var> or <var>b</var>.  The inputs must be 2-D matrices to use this
option.
</p>
<p>The optional outputs <var>ia</var> and <var>ib</var> are index vectors such that
<code><var>a</var>(<var>ia</var>)</code> and <code><var>b</var>(<var>ib</var>)</code> are disjoint sets
whose union is <var>c</var>.
</p>

<p><strong>See also:</strong> <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFintersect">intersect</a>, <a href="#XREFsetdiff">setdiff</a>, <a href="#XREFsetxor">setxor</a>, <a href="#XREFismember">ismember</a>.
</p></dd></dl>


<a name="XREFsetdiff"></a><dl>
<dt><a name="index-setdiff"></a>: <em><var>c</var> =</em> <strong>setdiff</strong> <em>(<var>a</var>, <var>b</var>)</em></dt>
<dt><a name="index-setdiff-1"></a>: <em><var>c</var> =</em> <strong>setdiff</strong> <em>(<var>a</var>, <var>b</var>, &quot;rows&quot;)</em></dt>
<dt><a name="index-setdiff-2"></a>: <em>[<var>c</var>, <var>ia</var>] =</em> <strong>setdiff</strong> <em>(&hellip;)</em></dt>
<dd><p>Return the unique elements in <var>a</var> that are not in <var>b</var> sorted in
ascending order.
</p>
<p>If <var>a</var> is a row vector return a column vector; Otherwise, return a
column vector.  The inputs may also be cell arrays of strings.
</p>
<p>If the optional input <code>&quot;rows&quot;</code> is given then return the rows in
<var>a</var> that are not in <var>b</var>.  The inputs must be 2-D matrices to use
this option.
</p>
<p>If requested, return the index vector <var>ia</var> such that
<code><var>c</var> = <var>a</var>(<var>ia</var>)</code>.
</p>
<p><strong>See also:</strong> <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFunion">union</a>, <a href="#XREFintersect">intersect</a>, <a href="#XREFsetxor">setxor</a>, <a href="#XREFismember">ismember</a>.
</p></dd></dl>


<a name="XREFsetxor"></a><dl>
<dt><a name="index-setxor"></a>: <em><var>c</var> =</em> <strong>setxor</strong> <em>(<var>a</var>, <var>b</var>)</em></dt>
<dt><a name="index-setxor-1"></a>: <em><var>c</var> =</em> <strong>setxor</strong> <em>(<var>a</var>, <var>b</var>, &quot;rows&quot;)</em></dt>
<dt><a name="index-setxor-2"></a>: <em>[<var>c</var>, <var>ia</var>, <var>ib</var>] =</em> <strong>setxor</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Return the unique elements exclusive to sets <var>a</var> or <var>b</var> sorted in
ascending order.
</p>
<p>If <var>a</var> and <var>b</var> are both row vectors then return a row vector;
Otherwise, return a column vector.  The inputs may also be cell arrays of
strings.
</p>
<p>If the optional input <code>&quot;rows&quot;</code> is given then return the rows exclusive
to sets <var>a</var> and <var>b</var>.  The inputs must be 2-D matrices to use this
option.
</p>
<p>If requested, return index vectors <var>ia</var> and <var>ib</var> such that
<code><var>a</var>(<var>ia</var>)</code> and <code><var>b</var>(<var>ib</var>)</code> are disjoint sets
whose union is <var>c</var>.
</p>

<p><strong>See also:</strong> <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFunion">union</a>, <a href="#XREFintersect">intersect</a>, <a href="#XREFsetdiff">setdiff</a>, <a href="#XREFismember">ismember</a>.
</p></dd></dl>


<a name="XREFismember"></a><dl>
<dt><a name="index-ismember"></a>: <em><var>tf</var> =</em> <strong>ismember</strong> <em>(<var>a</var>, <var>s</var>)</em></dt>
<dt><a name="index-ismember-1"></a>: <em><var>tf</var> =</em> <strong>ismember</strong> <em>(<var>a</var>, <var>s</var>, &quot;rows&quot;)</em></dt>
<dt><a name="index-ismember-2"></a>: <em>[<var>tf</var>, <var>s_idx</var>] =</em> <strong>ismember</strong> <em>(&hellip;)</em></dt>
<dd>
<p>Return a logical matrix <var>tf</var> with the same shape as <var>a</var> which is
true (1) if the element in <var>a</var> is found in <var>s</var> and false (0) if it
is not.
</p>
<p>If a second output argument is requested then the index into <var>s</var> of each
matching element is also returned.
</p>
<div class="example">
<pre class="example">a = [3, 10, 1];
s = [0:9];
[tf, s_idx] = ismember (a, s)
     &rArr; tf = [1, 0, 1]
     &rArr; s_idx = [4, 0, 2]
</pre></div>

<p>The inputs <var>a</var> and <var>s</var> may also be cell arrays.
</p>
<div class="example">
<pre class="example">a = {&quot;abc&quot;};
s = {&quot;abc&quot;, &quot;def&quot;};
[tf, s_idx] = ismember (a, s)
     &rArr; tf = [1, 0]
     &rArr; s_idx = [1, 0]
</pre></div>

<p>If the optional third argument <code>&quot;rows&quot;</code> is given then compare rows
in <var>a</var> with rows in <var>s</var>.  The inputs must be 2-D matrices with the
same number of columns to use this option.
</p>
<div class="example">
<pre class="example">a = [1:3; 5:7; 4:6];
s = [0:2; 1:3; 2:4; 3:5; 4:6];
[tf, s_idx] = ismember (a, s, &quot;rows&quot;)
     &rArr; tf = logical ([1; 0; 1])
     &rArr; s_idx = [2; 0; 5];
</pre></div>


<p><strong>See also:</strong> <a href="Finding-Elements-and-Checking-Conditions.html#XREFlookup">lookup</a>, <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFunion">union</a>, <a href="#XREFintersect">intersect</a>, <a href="#XREFsetdiff">setdiff</a>, <a href="#XREFsetxor">setxor</a>.
</p></dd></dl>


<a name="XREFpowerset"></a><dl>
<dt><a name="index-powerset"></a>: <em></em> <strong>powerset</strong> <em>(<var>a</var>)</em></dt>
<dt><a name="index-powerset-1"></a>: <em></em> <strong>powerset</strong> <em>(<var>a</var>, &quot;rows&quot;)</em></dt>
<dd><p>Compute the powerset (all subsets) of the set <var>a</var>.
</p>
<p>The set <var>a</var> must be a numerical matrix or a cell array of strings.  The
output will always be a cell array of either vectors or strings.
</p>
<p>With the optional argument <code>&quot;rows&quot;</code>, each row of the set <var>a</var> is
considered one element of the set.  The input must be a 2-D numeric matrix
to use this argument.
</p>

<p><strong>See also:</strong> <a href="Sets.html#XREFunique">unique</a>, <a href="#XREFunion">union</a>, <a href="#XREFintersect">intersect</a>, <a href="#XREFsetdiff">setdiff</a>, <a href="#XREFsetxor">setxor</a>, <a href="#XREFismember">ismember</a>.
</p></dd></dl>



<hr>
<div class="header">
<p>
Up: <a href="Sets.html#Sets" accesskey="u" rel="up">Sets</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>