Skip to content

Commit 56ad45c

Browse files
[algorithms, numerics] Replace "exactly" with "at most" in Complexity
1 parent a95c5ef commit 56ad45c

File tree

2 files changed

+44
-44
lines changed

2 files changed

+44
-44
lines changed

source/algorithms.tex

+42-42
Original file line numberDiff line numberDiff line change
@@ -3631,7 +3631,7 @@
36313631

36323632
\pnum
36333633
\complexity
3634-
Applies \tcode{f} exactly \tcode{last - first} times.
3634+
Applies \tcode{f} at most \tcode{last - first} times.
36353635

36363636
\pnum
36373637
\remarks
@@ -3662,7 +3662,7 @@
36623662

36633663
\pnum
36643664
\complexity
3665-
Applies \tcode{f} exactly \tcode{last - first} times.
3665+
Applies \tcode{f} at most \tcode{last - first} times.
36663666

36673667
\pnum
36683668
\remarks
@@ -3707,7 +3707,7 @@
37073707

37083708
\pnum
37093709
\complexity
3710-
Applies \tcode{f} and \tcode{proj} exactly \tcode{last - first} times.
3710+
Applies \tcode{f} and \tcode{proj} at most \tcode{last - first} times.
37113711

37123712
\pnum
37133713
\remarks
@@ -4172,7 +4172,7 @@
41724172
\pnum
41734173
\complexity
41744174
For the overloads with no \tcode{ExecutionPolicy},
4175-
exactly \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
4175+
at most \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
41764176
applications of the corresponding predicate,
41774177
where \tcode{i} is \tcode{adjacent_find}'s return value.
41784178
For the overloads with an \tcode{ExecutionPolicy},
@@ -4246,7 +4246,7 @@
42464246

42474247
\pnum
42484248
\complexity
4249-
Exactly \tcode{last - first} applications
4249+
At most \tcode{last - first} applications
42504250
of the corresponding predicate and any projection.
42514251
\end{itemdescr}
42524252

@@ -4520,7 +4520,7 @@
45204520
if \tcode{ForwardIterator1} and \tcode{Forward\-Iter\-ator2}
45214521
meet the requirements of random access iterators and
45224522
\tcode{last1 - first1 != last2 - first2}.
4523-
Otherwise, exactly \tcode{last1 - first1} applications
4523+
Otherwise, at most \tcode{last1 - first1} applications
45244524
of the corresponding predicate
45254525
if \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true};
45264526
otherwise, at worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
@@ -4570,7 +4570,7 @@
45704570
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
45714571
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
45724572
\end{itemize}
4573-
Otherwise, exactly \tcode{last1 - first1} applications
4573+
Otherwise, at most \tcode{last1 - first1} applications
45744574
of the corresponding predicate and projections
45754575
if \tcode{ranges::equal(\brk{}first1, last1, first2, last2, pred, proj1, proj2)}
45764576
would return \tcode{true};
@@ -5056,7 +5056,7 @@
50565056

50575057
\pnum
50585058
\complexity
5059-
Exactly $N$ assignments.
5059+
At most $N$ assignments.
50605060
\end{itemdescr}
50615061

50625062
\indexlibraryglobal{copy}%
@@ -5086,7 +5086,7 @@
50865086

50875087
\pnum
50885088
\complexity
5089-
Exactly \tcode{last - first} assignments.
5089+
At most \tcode{last - first} assignments.
50905090
\end{itemdescr}
50915091

50925092
\indexlibraryglobal{copy_n}%
@@ -5132,7 +5132,7 @@
51325132

51335133
\pnum
51345134
\complexity
5135-
Exactly $N$ assignments.
5135+
At most $N$ assignments.
51365136
\end{itemdescr}
51375137

51385138
\indexlibraryglobal{copy_if}%
@@ -5202,7 +5202,7 @@
52025202

52035203
\pnum
52045204
\complexity
5205-
Exactly \tcode{last - first} applications
5205+
At most \tcode{last - first} applications
52065206
of the corresponding predicate and any projection.
52075207

52085208
\pnum
@@ -5261,7 +5261,7 @@
52615261

52625262
\pnum
52635263
\complexity
5264-
Exactly $N$ assignments.
5264+
At most $N$ assignments.
52655265
\end{itemdescr}
52665266

52675267
\rSec2[alg.move]{Move}
@@ -5319,7 +5319,7 @@
53195319

53205320
\pnum
53215321
\complexity
5322-
Exactly $N$ assignments.
5322+
At most $N$ assignments.
53235323
\end{itemdescr}
53245324

53255325
\indexlibrary{\idxcode{move}!algorithm}%
@@ -5352,7 +5352,7 @@
53525352

53535353
\pnum
53545354
\complexity
5355-
Exactly $N$ assignments.
5355+
At most $N$ assignments.
53565356
\end{itemdescr}
53575357

53585358
\indexlibraryglobal{move_backward}%
@@ -5414,7 +5414,7 @@
54145414

54155415
\pnum
54165416
\complexity
5417-
Exactly $N$ assignments.
5417+
At most $N$ assignments.
54185418
\end{itemdescr}
54195419

54205420
\rSec2[alg.swap]{Swap}
@@ -5484,7 +5484,7 @@
54845484

54855485
\pnum
54865486
\complexity
5487-
Exactly $M$ swaps.
5487+
At most $M$ swaps.
54885488
\end{itemdescr}
54895489

54905490
\indexlibraryglobal{iter_swap}%
@@ -5626,7 +5626,7 @@
56265626

56275627
\pnum
56285628
\complexity
5629-
Exactly $N$ applications of \tcode{op} or \tcode{binary_op}, and
5629+
At most $N$ applications of \tcode{op} or \tcode{binary_op}, and
56305630
any projections.
56315631
This requirement also applies to the overload with an \tcode{ExecutionPolicy}.
56325632

@@ -5710,7 +5710,7 @@
57105710

57115711
\pnum
57125712
\complexity
5713-
Exactly \tcode{last - first} applications
5713+
At most \tcode{last - first} applications
57145714
of the corresponding predicate and any projection.
57155715
\end{itemdescr}
57165716

@@ -5821,7 +5821,7 @@
58215821

58225822
\pnum
58235823
\complexity
5824-
Exactly \tcode{last - first} applications
5824+
At most \tcode{last - first} applications
58255825
of the corresponding predicate and any projection.
58265826
\end{itemdescr}
58275827

@@ -5878,7 +5878,7 @@
58785878

58795879
\pnum
58805880
\complexity
5881-
Exactly $N$ assignments.
5881+
At most $N$ assignments.
58825882
\end{itemdescr}
58835883

58845884
\rSec2[alg.generate]{Generate}
@@ -5932,7 +5932,7 @@
59325932

59335933
\pnum
59345934
\complexity
5935-
Exactly $N$ evaluations of \tcode{gen()} and assignments.
5935+
At most $N$ evaluations of \tcode{gen()} and assignments.
59365936
\end{itemdescr}
59375937

59385938
\rSec2[alg.remove]{Remove}
@@ -6008,7 +6008,7 @@
60086008

60096009
\pnum
60106010
\complexity
6011-
Exactly \tcode{last - first} applications
6011+
At most \tcode{last - first} applications
60126012
of the corresponding predicate and any projection.
60136013

60146014
\pnum
@@ -6118,7 +6118,7 @@
61186118

61196119
\pnum
61206120
\complexity
6121-
Exactly \tcode{last - first} applications
6121+
At most \tcode{last - first} applications
61226122
of the corresponding predicate and any projection.
61236123

61246124
\pnum
@@ -6193,7 +6193,7 @@
61936193

61946194
\pnum
61956195
\complexity
6196-
For nonempty ranges, exactly \tcode{(last - first) - 1} applications
6196+
For nonempty ranges, at most \tcode{(last - first) - 1} applications
61976197
of the corresponding predicate and
61986198
no more than twice as many applications of any projection.
61996199
\end{itemdescr}
@@ -6308,7 +6308,7 @@
63086308

63096309
\pnum
63106310
\complexity
6311-
Exactly \tcode{last - first - 1} applications
6311+
At most \tcode{last - first - 1} applications
63126312
of the corresponding predicate
63136313
and no more than twice as many applications of any projection.
63146314
\end{itemdescr}
@@ -6351,7 +6351,7 @@
63516351

63526352
\pnum
63536353
\complexity
6354-
Exactly \tcode{(last - first)/2} swaps.
6354+
At most \tcode{(last - first)/2} swaps.
63556355
\end{itemdescr}
63566356

63576357
\indexlibraryglobal{reverse_copy}%
@@ -6403,7 +6403,7 @@
64036403

64046404
\pnum
64056405
\complexity
6406-
Exactly $N$ assignments.
6406+
At most $N$ assignments.
64076407
\end{itemdescr}
64086408

64096409
\rSec2[alg.rotate]{Rotate}
@@ -6517,7 +6517,7 @@
65176517

65186518
\pnum
65196519
\complexity
6520-
Exactly $N$ assignments.
6520+
At most $N$ assignments.
65216521
\end{itemdescr}
65226522

65236523
\begin{itemdecl}
@@ -6664,7 +6664,7 @@
66646664

66656665
\pnum
66666666
\complexity
6667-
Exactly \tcode{(last - first) - 1} swaps.
6667+
At most \tcode{(last - first) - 1} swaps.
66686668

66696669
\pnum
66706670
\remarks
@@ -7743,7 +7743,7 @@
77437743
\begin{itemize}
77447744
\item
77457745
For the overload with no \tcode{ExecutionPolicy},
7746-
exactly $N$ applications of the predicate and projection.
7746+
at most $N$ applications of the predicate and projection.
77477747
At most $N / 2$ swaps if the type of \tcode{first} meets
77487748
the \oldconcept{BidirectionalIterator} requirements
77497749
for the overloads in namespace \tcode{std} or
@@ -7819,7 +7819,7 @@
78197819
\item
78207820
For the overloads with no \tcode{ExecutionPolicy}, at most $N \log_2 N$ swaps,
78217821
but only \bigoh{N} swaps if there is enough extra memory.
7822-
Exactly $N$ applications of the predicate and projection.
7822+
At most $N$ applications of the predicate and projection.
78237823
\item
78247824
For the overload with an \tcode{ExecutionPolicy},
78257825
\bigoh{N \log N} swaps and \bigoh{N} applications of the predicate.
@@ -7896,7 +7896,7 @@
78967896

78977897
\pnum
78987898
\complexity
7899-
Exactly \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
7899+
At most \tcode{last - first} applications of \tcode{pred} and \tcode{proj}.
79007900
\end{itemdescr}
79017901

79027902
\indexlibraryglobal{partition_point}%
@@ -8982,7 +8982,7 @@
89828982

89838983
\pnum
89848984
\complexity
8985-
Exactly one comparison and two applications of the projection, if any.
8985+
At most one comparison and two applications of the projection, if any.
89868986

89878987
\pnum
89888988
\remarks
@@ -9025,7 +9025,7 @@
90259025

90269026
\pnum
90279027
\complexity
9028-
Exactly \tcode{ranges::distance(r) - 1} comparisons
9028+
At most \tcode{ranges::distance(r) - 1} comparisons
90299029
and twice as many applications of the projection, if any.
90309030

90319031
\pnum
@@ -9060,7 +9060,7 @@
90609060

90619061
\pnum
90629062
\complexity
9063-
Exactly one comparison and two applications of the projection, if any.
9063+
At most one comparison and two applications of the projection, if any.
90649064

90659065
\pnum
90669066
\remarks
@@ -9103,7 +9103,7 @@
91039103

91049104
\pnum
91059105
\complexity
9106-
Exactly \tcode{ranges::distance(r) - 1} comparisons
9106+
At most \tcode{ranges::distance(r) - 1} comparisons
91079107
and twice as many applications of the projection, if any.
91089108

91099109
\pnum
@@ -9140,7 +9140,7 @@
91409140

91419141
\pnum
91429142
\complexity
9143-
Exactly one comparison and two applications of the projection, if any.
9143+
At most one comparison and two applications of the projection, if any.
91449144

91459145
\pnum
91469146
\remarks
@@ -9240,7 +9240,7 @@
92409240

92419241
\pnum
92429242
\complexity
9243-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
9243+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
92449244
twice as many projections.
92459245
\end{itemdescr}
92469246

@@ -9287,7 +9287,7 @@
92879287

92889288
\pnum
92899289
\complexity
9290-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
9290+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
92919291
twice as many projections.
92929292
\end{itemdescr}
92939293

@@ -10319,7 +10319,7 @@
1031910319

1032010320
\pnum
1032110321
\complexity
10322-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
10322+
At most \tcode{(last - first) - 1} applications of the binary operation.
1032310323

1032410324
\pnum
1032510325
\remarks
@@ -10831,7 +10831,7 @@
1083110831

1083210832
\pnum
1083310833
\complexity
10834-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
10834+
At most \tcode{(last - first) - 1} applications of the binary operation.
1083510835

1083610836
\pnum
1083710837
\remarks
@@ -10866,7 +10866,7 @@
1086610866

1086710867
\pnum
1086810868
\complexity
10869-
Exactly \tcode{last - first} increments and assignments.
10869+
At most \tcode{last - first} increments and assignments.
1087010870
\end{itemdescr}
1087110871

1087210872
\indexlibraryglobal{iota}%

source/numerics.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -3121,7 +3121,7 @@
31213121

31223122
\pnum
31233123
\complexity
3124-
Exactly $n \cdot \tcode{r}$ invocations
3124+
At most $n \cdot \tcode{r}$ invocations
31253125
of \tcode{e}.
31263126
\end{itemdescr}
31273127

@@ -4446,7 +4446,7 @@
44464446

44474447
\pnum
44484448
\complexity
4449-
Exactly $k$ invocations of \tcode{g} per attempt.
4449+
At most $k$ invocations of \tcode{g} per attempt.
44504450

44514451
\pnum
44524452
\begin{note}

0 commit comments

Comments
 (0)