Skip to content

Commit 5bab547

Browse files
committed
regenerate the manual
1 parent 10f8ff2 commit 5bab547

19 files changed

+8842
-3397
lines changed

doc/devdocs/cartesian.rst

Lines changed: 65 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -138,72 +138,92 @@ Macro reference
138138

139139
.. function:: @nloops N itersym rangeexpr bodyexpr
140140

141+
.. Warning: this docstring is autogenerated.
141142
::
142-
@nloops N itersym rangeexpr preexpr bodyexpr
143-
@nloops N itersym rangeexpr preexpr postexpr bodyexpr
144-
145-
Generate ``N`` nested loops, using ``itersym`` as the prefix for
146-
the iteration variables. ``rangeexpr`` may be an
147-
anonymous-function expression, or a simple symbol ``var`` in which
148-
case the range is ``1:size(var,d)`` for dimension ``d``.
149-
150-
Optionally, you can provide "pre" and "post" expressions. These
151-
get executed first and last, respectively, in the body of each
152-
loop. For example,
153-
::
154-
155-
@nloops 2 i A d->j_d=min(i_d,5) begin
156-
s += @nref 2 A j
157-
end
158-
159-
would generate
160-
::
161-
162-
for i_2 = 1:size(A, 2)
163-
j_2 = min(i_2, 5)
164-
for i_1 = 1:size(A, 1)
165-
j_1 = min(i_1, 5)
166-
s += A[j_1,j_2]
167-
end
168-
end
169-
170-
If you want just a post-expression, supply
171-
``nothing`` for the pre-expression. Using parenthesis and
172-
semicolons, you can supply multi-statement expressions.
143+
144+
@nloops N itersym rangeexpr bodyexpr
145+
@nloops N itersym rangeexpr preexpr bodyexpr
146+
@nloops N itersym rangeexpr preexpr postexpr bodyexpr
147+
148+
Generate ``N`` nested loops, using ``itersym`` as the prefix for the iteration variables. ``rangeexpr`` may be an anonymous-function expression, or a simple symbol ``var`` in which case the range is ``1:size(var,d)`` for dimension ``d``.
149+
150+
Optionally, you can provide "pre" and "post" expressions. These get executed first and last, respectively, in the body of each loop. For example, :
151+
152+
::
153+
154+
@nloops 2 i A d->j_d=min(i_d,5) begin
155+
s += @nref 2 A j
156+
end
157+
158+
would generate :
159+
160+
::
161+
162+
for i_2 = 1:size(A, 2)
163+
j_2 = min(i_2, 5)
164+
for i_1 = 1:size(A, 1)
165+
j_1 = min(i_1, 5)
166+
s += A[j_1,j_2]
167+
end
168+
end
169+
170+
If you want just a post-expression, supply ``nothing`` for the pre-expression. Using parenthesis and semicolons, you can supply multi-statement expressions.
173171

174172
.. function:: @nref N A indexexpr
175173

176-
Generate expressions like ``A[i_1,i_2,...]``. ``indexexpr`` can
177-
either be an iteration-symbol prefix, or an anonymous-function
178-
expression.
174+
.. Warning: this docstring is autogenerated.
175+
::
176+
177+
@nref N A indexexpr
178+
179+
Generate expressions like ``A[i_1,i_2,...]``. ``indexexpr`` can either be an iteration-symbol prefix, or an anonymous-function expression.
179180

180181
.. function:: @nexprs N expr
181182

182-
Generate ``N`` expressions. ``expr`` should be an
183-
anonymous-function expression.
183+
.. Warning: this docstring is autogenerated.
184+
::
185+
186+
@nexprs N expr
187+
188+
Generate ``N`` expressions. ``expr`` should be an anonymous-function expression.
184189

185190
.. function:: @ntuple N expr
186191

187-
Generates an ``N``-tuple. ``@ntuple 2 i`` would generate ``(i_1, i_2)``, and ``@ntuple 2 k->k+1`` would generate ``(2,3)``.
192+
.. Warning: this docstring is autogenerated.
193+
::
194+
195+
@ntuple N expr
196+
197+
Generates an ``N``-tuple. ``@ntuple 2 i`` would generate ``(i_1, i_2)``, and ``@ntuple 2 k->k+1`` would generate ``(2,3)``.
188198

189199
.. function:: @nall N expr
190200

191-
``@nall 3 d->(i_d > 1)`` would generate the expression
192-
``(i_1 > 1 && i_2 > 1 && i_3 > 1)``. This can be convenient for
193-
bounds-checking.
201+
.. Warning: this docstring is autogenerated.
202+
::
203+
204+
@nall N expr
205+
206+
``@nall 3 d->(i_d > 1)`` would generate the expression ``(i_1 > 1 && i_2 > 1 && i_3 > 1)``. This can be convenient for bounds-checking.
194207

195208
.. function:: @nif N conditionexpr expr
196209

210+
.. Warning: this docstring is autogenerated.
197211
::
198-
@nif N conditionexpr expr elseexpr
199212

200-
Generates a sequence of ``if ... elseif ... else ... end`` statements. For example::
213+
@nif N conditionexpr expr
214+
@nif N conditionexpr expr elseexpr
201215

202-
@nif 3 d->(i_d >= size(A,d)) d->(error("Dimension ", d, " too big")) d->println("All OK")
216+
Generates a sequence of ``if ... elseif ... else ... end`` statements. For example:
217+
218+
::
203219

204-
would generate::
220+
@nif 3 d->(i_d >= size(A,d)) d->(error("Dimension ", d, " too big")) d->println("All OK")
221+
222+
would generate:
223+
224+
::
205225

206-
if i_1 > size(A, 1)
226+
if i_1 > size(A, 1)
207227

208228
error("Dimension ", 1, " too big")
209229
elseif i_2 > size(A, 2)

0 commit comments

Comments
 (0)