I am computing a long Table[]
, but the computation of the last few elements is taking too long, and I am afraid I will never converge.
I would like to access the part of the Table
which has been already computed and then abort the evaluation.
Is that possible and how?
Thanks.
$\begingroup$
$\endgroup$
1
-
1$\begingroup$ Apparent duplicate: (7566). Related: (8109), (18519), (35139) $\endgroup$– Mr.WizardCommented Mar 25, 2015 at 16:40
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
1
Perhaps you can adapt something like this
partial = Reap[CheckAbort[full=Table[Sow[expr]; expr, {i,1,1000}], Null]][[2,1]]
-
$\begingroup$ You could also use
TimeConstrained
instead ofCheckAbort
. $\endgroup$ Commented Mar 25, 2015 at 17:22