Skip to content

Commit a5c42f2

Browse files
[algorithms, numerics] Replace "exactly" with "at most" in Complexity
1 parent bf43925 commit a5c42f2

File tree

2 files changed

+45
-45
lines changed

2 files changed

+45
-45
lines changed

source/algorithms.tex

+43-43
Original file line numberDiff line numberDiff line change
@@ -3647,7 +3647,7 @@
36473647

36483648
\pnum
36493649
\complexity
3650-
Applies \tcode{f} exactly \tcode{last - first} times.
3650+
Applies \tcode{f} at most \tcode{last - first} times.
36513651

36523652
\pnum
36533653
\remarks
@@ -3678,7 +3678,7 @@
36783678

36793679
\pnum
36803680
\complexity
3681-
Applies \tcode{f} exactly \tcode{last - first} times.
3681+
Applies \tcode{f} at most \tcode{last - first} times.
36823682

36833683
\pnum
36843684
\remarks
@@ -3723,7 +3723,7 @@
37233723

37243724
\pnum
37253725
\complexity
3726-
Applies \tcode{f} and \tcode{proj} exactly \tcode{last - first} times.
3726+
Applies \tcode{f} and \tcode{proj} at most \tcode{last - first} times.
37273727

37283728
\pnum
37293729
\remarks
@@ -4188,7 +4188,7 @@
41884188
\pnum
41894189
\complexity
41904190
For the overloads with no \tcode{ExecutionPolicy},
4191-
exactly \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
4191+
at most \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
41924192
applications of the corresponding predicate,
41934193
where \tcode{i} is \tcode{adjacent_find}'s return value.
41944194
For the overloads with an \tcode{ExecutionPolicy},
@@ -4262,7 +4262,7 @@
42624262

42634263
\pnum
42644264
\complexity
4265-
Exactly \tcode{last - first} applications
4265+
At most \tcode{last - first} applications
42664266
of the corresponding predicate and any projection.
42674267
\end{itemdescr}
42684268

@@ -4536,7 +4536,7 @@
45364536
if \tcode{ForwardIterator1} and \tcode{Forward\-Iter\-ator2}
45374537
meet the requirements of random access iterators and
45384538
\tcode{last1 - first1 != last2 - first2}.
4539-
Otherwise, exactly \tcode{last1 - first1} applications
4539+
Otherwise, at most \tcode{last1 - first1} applications
45404540
of the corresponding predicate
45414541
if \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true};
45424542
otherwise, at worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
@@ -4586,7 +4586,7 @@
45864586
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
45874587
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
45884588
\end{itemize}
4589-
Otherwise, exactly \tcode{last1 - first1} applications
4589+
Otherwise, at most \tcode{last1 - first1} applications
45904590
of the corresponding predicate and projections
45914591
if \tcode{ranges::equal(\brk{}first1, last1, first2, last2, pred, proj1, proj2)}
45924592
would return \tcode{true};
@@ -5072,7 +5072,7 @@
50725072

50735073
\pnum
50745074
\complexity
5075-
Exactly $N$ assignments.
5075+
At most $N$ assignments.
50765076
\end{itemdescr}
50775077

50785078
\indexlibraryglobal{copy}%
@@ -5102,7 +5102,7 @@
51025102

51035103
\pnum
51045104
\complexity
5105-
Exactly \tcode{last - first} assignments.
5105+
At most \tcode{last - first} assignments.
51065106
\end{itemdescr}
51075107

51085108
\indexlibraryglobal{copy_n}%
@@ -5148,7 +5148,7 @@
51485148

51495149
\pnum
51505150
\complexity
5151-
Exactly $N$ assignments.
5151+
At most $N$ assignments.
51525152
\end{itemdescr}
51535153

51545154
\indexlibraryglobal{copy_if}%
@@ -5218,7 +5218,7 @@
52185218

52195219
\pnum
52205220
\complexity
5221-
Exactly \tcode{last - first} applications
5221+
At most \tcode{last - first} applications
52225222
of the corresponding predicate and any projection.
52235223

52245224
\pnum
@@ -5277,7 +5277,7 @@
52775277

52785278
\pnum
52795279
\complexity
5280-
Exactly $N$ assignments.
5280+
At most $N$ assignments.
52815281
\end{itemdescr}
52825282

52835283
\rSec2[alg.move]{Move}
@@ -5335,7 +5335,7 @@
53355335

53365336
\pnum
53375337
\complexity
5338-
Exactly $N$ assignments.
5338+
At most $N$ assignments.
53395339
\end{itemdescr}
53405340

53415341
\indexlibrary{\idxcode{move}!algorithm}%
@@ -5368,7 +5368,7 @@
53685368

53695369
\pnum
53705370
\complexity
5371-
Exactly $N$ assignments.
5371+
At most $N$ assignments.
53725372
\end{itemdescr}
53735373

53745374
\indexlibraryglobal{move_backward}%
@@ -5430,7 +5430,7 @@
54305430

54315431
\pnum
54325432
\complexity
5433-
Exactly $N$ assignments.
5433+
At most $N$ assignments.
54345434
\end{itemdescr}
54355435

54365436
\rSec2[alg.swap]{Swap}
@@ -5500,7 +5500,7 @@
55005500

55015501
\pnum
55025502
\complexity
5503-
Exactly $M$ swaps.
5503+
At most $M$ swaps.
55045504
\end{itemdescr}
55055505

55065506
\indexlibraryglobal{iter_swap}%
@@ -5642,7 +5642,7 @@
56425642

56435643
\pnum
56445644
\complexity
5645-
Exactly $N$ applications of \tcode{op} or \tcode{binary_op}, and
5645+
At most $N$ applications of \tcode{op} or \tcode{binary_op}, and
56465646
any projections.
56475647
This requirement also applies to the overload with an \tcode{ExecutionPolicy}.
56485648

@@ -5726,7 +5726,7 @@
57265726

57275727
\pnum
57285728
\complexity
5729-
Exactly \tcode{last - first} applications
5729+
At most \tcode{last - first} applications
57305730
of the corresponding predicate and any projection.
57315731
\end{itemdescr}
57325732

@@ -5837,7 +5837,7 @@
58375837

58385838
\pnum
58395839
\complexity
5840-
Exactly \tcode{last - first} applications
5840+
At most \tcode{last - first} applications
58415841
of the corresponding predicate and any projection.
58425842
\end{itemdescr}
58435843

@@ -5894,7 +5894,7 @@
58945894

58955895
\pnum
58965896
\complexity
5897-
Exactly $N$ assignments.
5897+
At most $N$ assignments.
58985898
\end{itemdescr}
58995899

59005900
\rSec2[alg.generate]{Generate}
@@ -5948,7 +5948,7 @@
59485948

59495949
\pnum
59505950
\complexity
5951-
Exactly $N$ evaluations of \tcode{gen()} and assignments.
5951+
At most $N$ evaluations of \tcode{gen()} and assignments.
59525952
\end{itemdescr}
59535953

59545954
\rSec2[alg.remove]{Remove}
@@ -6024,7 +6024,7 @@
60246024

60256025
\pnum
60266026
\complexity
6027-
Exactly \tcode{last - first} applications
6027+
At most \tcode{last - first} applications
60286028
of the corresponding predicate and any projection.
60296029

60306030
\pnum
@@ -6134,7 +6134,7 @@
61346134

61356135
\pnum
61366136
\complexity
6137-
Exactly \tcode{last - first} applications
6137+
At most \tcode{last - first} applications
61386138
of the corresponding predicate and any projection.
61396139

61406140
\pnum
@@ -6209,7 +6209,7 @@
62096209

62106210
\pnum
62116211
\complexity
6212-
For nonempty ranges, exactly \tcode{(last - first) - 1} applications
6212+
For nonempty ranges, at most \tcode{(last - first) - 1} applications
62136213
of the corresponding predicate and
62146214
no more than twice as many applications of any projection.
62156215
\end{itemdescr}
@@ -6324,7 +6324,7 @@
63246324

63256325
\pnum
63266326
\complexity
6327-
Exactly \tcode{last - first - 1} applications
6327+
At most \tcode{last - first - 1} applications
63286328
of the corresponding predicate
63296329
and no more than twice as many applications of any projection.
63306330
\end{itemdescr}
@@ -6367,7 +6367,7 @@
63676367

63686368
\pnum
63696369
\complexity
6370-
Exactly \tcode{(last - first)/2} swaps.
6370+
At most \tcode{(last - first)/2} swaps.
63716371
\end{itemdescr}
63726372

63736373
\indexlibraryglobal{reverse_copy}%
@@ -6419,7 +6419,7 @@
64196419

64206420
\pnum
64216421
\complexity
6422-
Exactly $N$ assignments.
6422+
At most $N$ assignments.
64236423
\end{itemdescr}
64246424

64256425
\rSec2[alg.rotate]{Rotate}
@@ -6533,7 +6533,7 @@
65336533

65346534
\pnum
65356535
\complexity
6536-
Exactly $N$ assignments.
6536+
At most $N$ assignments.
65376537
\end{itemdescr}
65386538

65396539
\begin{itemdecl}
@@ -6680,7 +6680,7 @@
66806680

66816681
\pnum
66826682
\complexity
6683-
Exactly \tcode{(last - first) - 1} swaps.
6683+
At most \tcode{(last - first) - 1} swaps.
66846684

66856685
\pnum
66866686
\remarks
@@ -7759,7 +7759,7 @@
77597759
\begin{itemize}
77607760
\item
77617761
For the overload with no \tcode{ExecutionPolicy},
7762-
exactly $N$ applications of the predicate and projection.
7762+
at most $N$ applications of the predicate and projection.
77637763
At most $N / 2$ swaps if the type of \tcode{first} meets
77647764
the \oldconcept{BidirectionalIterator} requirements
77657765
for the overloads in namespace \tcode{std} or
@@ -7835,7 +7835,7 @@
78357835
\item
78367836
For the overloads with no \tcode{ExecutionPolicy}, at most $N \log_2 N$ swaps,
78377837
but only \bigoh{N} swaps if there is enough extra memory.
7838-
Exactly $N$ applications of the predicate and projection.
7838+
At most $N$ applications of the predicate and projection.
78397839
\item
78407840
For the overload with an \tcode{ExecutionPolicy},
78417841
\bigoh{N \log N} swaps and \bigoh{N} applications of the predicate.
@@ -7912,7 +7912,7 @@
79127912

79137913
\pnum
79147914
\complexity
7915-
Exactly \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
7915+
At most \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
79167916
\end{itemdescr}
79177917

79187918
\indexlibraryglobal{partition_point}%
@@ -8117,7 +8117,7 @@
81178117
\begin{itemize}
81188118
\item
81198119
For the overloads with no \tcode{ExecutionPolicy}, and
8120-
if enough additional memory is available, exactly $N - 1$ comparisons.
8120+
if enough additional memory is available, at most $N - 1$ comparisons.
81218121
\item
81228122
Otherwise, \bigoh{N \log N} comparisons.
81238123
\end{itemize}
@@ -8998,7 +8998,7 @@
89988998

89998999
\pnum
90009000
\complexity
9001-
Exactly one comparison and two applications of the projection, if any.
9001+
At most one comparison and two applications of the projection, if any.
90029002

90039003
\pnum
90049004
\remarks
@@ -9041,7 +9041,7 @@
90419041

90429042
\pnum
90439043
\complexity
9044-
Exactly \tcode{ranges::distance(r) - 1} comparisons
9044+
At most \tcode{ranges::distance(r) - 1} comparisons
90459045
and twice as many applications of the projection, if any.
90469046

90479047
\pnum
@@ -9076,7 +9076,7 @@
90769076

90779077
\pnum
90789078
\complexity
9079-
Exactly one comparison and two applications of the projection, if any.
9079+
At most one comparison and two applications of the projection, if any.
90809080

90819081
\pnum
90829082
\remarks
@@ -9119,7 +9119,7 @@
91199119

91209120
\pnum
91219121
\complexity
9122-
Exactly \tcode{ranges::distance(r) - 1} comparisons
9122+
At most \tcode{ranges::distance(r) - 1} comparisons
91239123
and twice as many applications of the projection, if any.
91249124

91259125
\pnum
@@ -9156,7 +9156,7 @@
91569156

91579157
\pnum
91589158
\complexity
9159-
Exactly one comparison and two applications of the projection, if any.
9159+
At most one comparison and two applications of the projection, if any.
91609160

91619161
\pnum
91629162
\remarks
@@ -9256,7 +9256,7 @@
92569256

92579257
\pnum
92589258
\complexity
9259-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
9259+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
92609260
twice as many projections.
92619261
\end{itemdescr}
92629262

@@ -9303,7 +9303,7 @@
93039303

93049304
\pnum
93059305
\complexity
9306-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
9306+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
93079307
twice as many projections.
93089308
\end{itemdescr}
93099309

@@ -10334,7 +10334,7 @@
1033410334

1033510335
\pnum
1033610336
\complexity
10337-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
10337+
At most \tcode{(last - first) - 1} applications of the binary operation.
1033810338

1033910339
\pnum
1034010340
\remarks
@@ -10846,7 +10846,7 @@
1084610846

1084710847
\pnum
1084810848
\complexity
10849-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
10849+
At most \tcode{(last - first) - 1} applications of the binary operation.
1085010850

1085110851
\pnum
1085210852
\remarks
@@ -10881,7 +10881,7 @@
1088110881

1088210882
\pnum
1088310883
\complexity
10884-
Exactly \tcode{last - first} increments and assignments.
10884+
At most \tcode{last - first} increments and assignments.
1088510885
\end{itemdescr}
1088610886

1088710887
\indexlibraryglobal{iota}%

0 commit comments

Comments
 (0)