Skip to content

Commit 81ddcdf

Browse files
[algorithms, numerics] Replace "exactly" with "at most" in Complexity
1 parent 454ba17 commit 81ddcdf

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

source/algorithms.tex

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -4640,7 +4640,7 @@
46404640

46414641
\pnum
46424642
\complexity
4643-
Applies \tcode{f} exactly \tcode{last - first} times.
4643+
Applies \tcode{f} at most \tcode{last - first} times.
46444644

46454645
\pnum
46464646
\remarks
@@ -4671,7 +4671,7 @@
46714671

46724672
\pnum
46734673
\complexity
4674-
Applies \tcode{f} exactly \tcode{last - first} times.
4674+
Applies \tcode{f} at most \tcode{last - first} times.
46754675

46764676
\pnum
46774677
\remarks
@@ -4716,7 +4716,7 @@
47164716

47174717
\pnum
47184718
\complexity
4719-
Applies \tcode{f} and \tcode{proj} exactly \tcode{last - first} times.
4719+
Applies \tcode{f} and \tcode{proj} at most \tcode{last - first} times.
47204720

47214721
\pnum
47224722
\remarks
@@ -5368,7 +5368,7 @@
53685368
\pnum
53695369
\complexity
53705370
For the non-parallel algorithm overloads,
5371-
exactly \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
5371+
at most \[ \min(\tcode{(i - first) + 1}, \ \tcode{(last - first) - 1}) \]
53725372
applications of the corresponding predicate,
53735373
where \tcode{i} is \tcode{adjacent_find}'s return value.
53745374
For the parallel algorithm overloads,
@@ -5463,7 +5463,7 @@
54635463

54645464
\pnum
54655465
\complexity
5466-
Exactly \tcode{last - first} applications
5466+
At most \tcode{last - first} applications
54675467
of the corresponding predicate and any projection.
54685468
\end{itemdescr}
54695469

@@ -5755,7 +5755,7 @@
57555755
if \tcode{ForwardIterator1} and \tcode{Forward\-Iter\-ator2}
57565756
meet the requirements of random access iterators and
57575757
\tcode{last1 - first1 != last2 - first2}.
5758-
Otherwise, exactly \tcode{last1 - first1} applications
5758+
Otherwise, at most \tcode{last1 - first1} applications
57595759
of the corresponding predicate
57605760
if \tcode{equal(first1, last1, first2, last2, pred)} would return \tcode{true};
57615761
otherwise, at worst \bigoh{N^2}, where $N$ has the value \tcode{last1 - first1}.
@@ -5805,7 +5805,7 @@
58055805
\tcode{R1} and \tcode{R2} each model \libconcept{sized_range}, and
58065806
\tcode{ranges::distance(r1) != ranges::distance(r2)}.
58075807
\end{itemize}
5808-
Otherwise, exactly \tcode{last1 - first1} applications
5808+
Otherwise, at most \tcode{last1 - first1} applications
58095809
of the corresponding predicate and projections
58105810
if \tcode{ranges::equal(\brk{}first1, last1, first2, last2, pred, proj1, proj2)}
58115811
would return \tcode{true};
@@ -6390,7 +6390,7 @@
63906390

63916391
\pnum
63926392
\complexity
6393-
Exactly $N$ assignments.
6393+
At most $N$ assignments.
63946394
\end{itemdescr}
63956395

63966396
\indexlibraryglobal{copy}%
@@ -6442,7 +6442,7 @@
64426442

64436443
\pnum
64446444
\complexity
6445-
Exactly $N$ assignments.
6445+
At most $N$ assignments.
64466446
\end{itemdescr}
64476447

64486448
\indexlibraryglobal{copy_n}%
@@ -6501,7 +6501,7 @@
65016501

65026502
\pnum
65036503
\complexity
6504-
Exactly $N$ assignments.
6504+
At most $N$ assignments.
65056505
\end{itemdescr}
65066506

65076507
\indexlibraryglobal{copy_if}%
@@ -6666,7 +6666,7 @@
66666666

66676667
\pnum
66686668
\complexity
6669-
Exactly $N$ assignments.
6669+
At most $N$ assignments.
66706670
\end{itemdescr}
66716671

66726672
\rSec2[alg.move]{Move}
@@ -6724,7 +6724,7 @@
67246724

67256725
\pnum
67266726
\complexity
6727-
Exactly $N$ assignments.
6727+
At most $N$ assignments.
67286728
\end{itemdescr}
67296729

67306730
\indexlibrary{\idxcode{move}!algorithm}%
@@ -6789,7 +6789,7 @@
67896789

67906790
\pnum
67916791
\complexity
6792-
Exactly $N$ assignments.
6792+
At most $N$ assignments.
67936793
\end{itemdescr}
67946794

67956795
\indexlibraryglobal{move_backward}%
@@ -6851,7 +6851,7 @@
68516851

68526852
\pnum
68536853
\complexity
6854-
Exactly $N$ assignments.
6854+
At most $N$ assignments.
68556855
\end{itemdescr}
68566856

68576857
\rSec2[alg.swap]{Swap}
@@ -6932,7 +6932,7 @@
69326932

69336933
\pnum
69346934
\complexity
6935-
Exactly $M$ swaps.
6935+
At most $M$ swaps.
69366936
\end{itemdescr}
69376937

69386938
\indexlibraryglobal{iter_swap}%
@@ -7119,7 +7119,7 @@
71197119

71207120
\pnum
71217121
\complexity
7122-
Exactly $N$ applications of \tcode{op} or \tcode{binary_op}, and
7122+
At most $N$ applications of \tcode{op} or \tcode{binary_op}, and
71237123
any projections.
71247124
This requirement also applies to the parallel algorithm overloads.
71257125

@@ -7231,7 +7231,7 @@
72317231

72327232
\pnum
72337233
\complexity
7234-
Exactly \tcode{last - first} applications
7234+
At most \tcode{last - first} applications
72357235
of the corresponding predicate and any projection.
72367236
\end{itemdescr}
72377237

@@ -7389,7 +7389,7 @@
73897389

73907390
\pnum
73917391
\complexity
7392-
Exactly $N$ applications
7392+
At most $N$ applications
73937393
of the corresponding predicate and any projection.
73947394
\end{itemdescr}
73957395

@@ -7457,7 +7457,7 @@
74577457

74587458
\pnum
74597459
\complexity
7460-
Exactly $N$ assignments.
7460+
At most $N$ assignments.
74617461
\end{itemdescr}
74627462

74637463
\rSec2[alg.generate]{Generate}
@@ -7522,7 +7522,7 @@
75227522

75237523
\pnum
75247524
\complexity
7525-
Exactly $N$ evaluations of \tcode{gen()} and assignments.
7525+
At most $N$ evaluations of \tcode{gen()} and assignments.
75267526

75277527
\pnum
75287528
\remarks
@@ -7627,7 +7627,7 @@
76277627

76287628
\pnum
76297629
\complexity
7630-
Exactly \tcode{last - first} applications
7630+
At most \tcode{last - first} applications
76317631
of the corresponding predicate and any projection.
76327632

76337633
\pnum
@@ -7878,7 +7878,7 @@
78787878

78797879
\pnum
78807880
\complexity
7881-
For nonempty ranges, exactly \tcode{(last - first) - 1} applications
7881+
For nonempty ranges, at most \tcode{(last - first) - 1} applications
78827882
of the corresponding predicate and
78837883
no more than twice as many applications of any projection.
78847884
\end{itemdescr}
@@ -8086,7 +8086,7 @@
80868086

80878087
\pnum
80888088
\complexity
8089-
Exactly \tcode{(last - first)/2} swaps.
8089+
At most \tcode{(last - first)/2} swaps.
80908090
\end{itemdescr}
80918091

80928092
\indexlibraryglobal{reverse_copy}%
@@ -8138,7 +8138,7 @@
81388138

81398139
\pnum
81408140
\complexity
8141-
Exactly $N$ assignments.
8141+
At most $N$ assignments.
81428142
\end{itemdescr}
81438143

81448144
\begin{itemdecl}
@@ -8178,7 +8178,7 @@
81788178

81798179
\pnum
81808180
\complexity
8181-
Exactly $N$ assignments.
8181+
At most $N$ assignments.
81828182
\end{itemdescr}
81838183

81848184
\rSec2[alg.rotate]{Rotate}
@@ -8310,7 +8310,7 @@
83108310

83118311
\pnum
83128312
\complexity
8313-
Exactly $N$ assignments.
8313+
At most $N$ assignments.
83148314
\end{itemdescr}
83158315

83168316
\begin{itemdecl}
@@ -8354,7 +8354,7 @@
83548354

83558355
\pnum
83568356
\complexity
8357-
Exactly $N$ assignments.
8357+
At most $N$ assignments.
83588358
\end{itemdescr}
83598359

83608360
\begin{itemdecl}
@@ -8518,7 +8518,7 @@
85188518

85198519
\pnum
85208520
\complexity
8521-
Exactly \tcode{(last - first) - 1} swaps.
8521+
At most \tcode{(last - first) - 1} swaps.
85228522

85238523
\pnum
85248524
\remarks
@@ -9742,7 +9742,7 @@
97429742
\begin{itemize}
97439743
\item
97449744
For the non-parallel algorithm overloads,
9745-
exactly $N$ applications of the predicate and projection.
9745+
at most $N$ applications of the predicate and projection.
97469746
At most $N / 2$ swaps if the type of \tcode{first} meets
97479747
the \oldconcept{BidirectionalIterator} requirements
97489748
for the overloads in namespace \tcode{std} or
@@ -9830,7 +9830,7 @@
98309830
For the non-parallel algorithm overloads,
98319831
at most $N \log_2 N$ swaps,
98329832
but only \bigoh{N} swaps if there is enough extra memory.
9833-
Exactly $N$ applications of the predicate and projection.
9833+
At most $N$ applications of the predicate and projection.
98349834
\item
98359835
For the parallel algorithm overloads,
98369836
\bigoh{N \log N} swaps and \bigoh{N} applications of the predicate.
@@ -11307,7 +11307,7 @@
1130711307

1130811308
\pnum
1130911309
\complexity
11310-
Exactly one comparison and two applications of the projection, if any.
11310+
At most one comparison and two applications of the projection, if any.
1131111311

1131211312
\pnum
1131311313
\remarks
@@ -11355,7 +11355,7 @@
1135511355

1135611356
\pnum
1135711357
\complexity
11358-
Exactly \tcode{ranges::distance(r) - 1} comparisons
11358+
At most \tcode{ranges::distance(r) - 1} comparisons
1135911359
and twice as many applications of the projection, if any.
1136011360

1136111361
\pnum
@@ -11390,7 +11390,7 @@
1139011390

1139111391
\pnum
1139211392
\complexity
11393-
Exactly one comparison and two applications of the projection, if any.
11393+
At most one comparison and two applications of the projection, if any.
1139411394

1139511395
\pnum
1139611396
\remarks
@@ -11438,7 +11438,7 @@
1143811438

1143911439
\pnum
1144011440
\complexity
11441-
Exactly \tcode{ranges::distance(r) - 1} comparisons
11441+
At most \tcode{ranges::distance(r) - 1} comparisons
1144211442
and twice as many applications of the projection, if any.
1144311443

1144411444
\pnum
@@ -11475,7 +11475,7 @@
1147511475

1147611476
\pnum
1147711477
\complexity
11478-
Exactly one comparison and two applications of the projection, if any.
11478+
At most one comparison and two applications of the projection, if any.
1147911479

1148011480
\pnum
1148111481
\remarks
@@ -11590,7 +11590,7 @@
1159011590

1159111591
\pnum
1159211592
\complexity
11593-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
11593+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
1159411594
twice as many projections.
1159511595
\end{itemdescr}
1159611596

@@ -11647,7 +11647,7 @@
1164711647

1164811648
\pnum
1164911649
\complexity
11650-
Exactly $\max(\tcode{last - first - 1}, 0)$ comparisons and
11650+
At most $\max(\tcode{last - first - 1}, 0)$ comparisons and
1165111651
twice as many projections.
1165211652
\end{itemdescr}
1165311653

@@ -12703,7 +12703,7 @@
1270312703

1270412704
\pnum
1270512705
\complexity
12706-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
12706+
At most \tcode{(last - first) - 1} applications of the binary operation.
1270712707

1270812708
\pnum
1270912709
\remarks
@@ -13215,7 +13215,7 @@
1321513215

1321613216
\pnum
1321713217
\complexity
13218-
Exactly \tcode{(last - first) - 1} applications of the binary operation.
13218+
At most \tcode{(last - first) - 1} applications of the binary operation.
1321913219

1322013220
\pnum
1322113221
\remarks
@@ -13250,7 +13250,7 @@
1325013250

1325113251
\pnum
1325213252
\complexity
13253-
Exactly \tcode{last - first} increments and assignments.
13253+
At most \tcode{last - first} increments and assignments.
1325413254
\end{itemdescr}
1325513255

1325613256
\indexlibraryglobal{iota}%

source/numerics.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3122,7 +3122,7 @@
31223122

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

@@ -4447,7 +4447,7 @@
44474447

44484448
\pnum
44494449
\complexity
4450-
Exactly $k$ invocations of \tcode{g} per attempt.
4450+
At most $k$ invocations of \tcode{g} per attempt.
44514451

44524452
\pnum
44534453
\begin{note}

0 commit comments

Comments
 (0)