https://cocoa.dima.unige.it/redmine/https://cocoa.dima.unige.it/redmine/redmine/favicon.ico?15088260392017-05-14T09:03:29ZCoCoA ProjectCoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61582017-05-14T09:03:29ZJohn Abbott
<ul><li><strong>Project</strong> changed from <i>CoCoALib</i> to <i>CoCoA-5</i></li><li><strong>Category</strong> deleted (<del><i>Various</i></del>)</li><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>Target version</strong> deleted (<del><i>CoCoALib-1.0</i></del>)</li><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>The old CoCoA-4 function <code>Randomize(F)</code> is essentially equivalent to:<br /><pre>
sum([random(-CoeffMax, CoeffMax)*t | t in support(F)]);
</pre><br />where <code>CoeffMax</code> is some value (perhaps 2^31?). The vagueness about the value of <code>CoeffMax</code> is one reason I prefer to make these fns obsolete.</p>
<p><code>Randomize(F)</code> is the same as <code>F := Randomized(F);</code></p>
<p>If we do decide to make them obsolete then any "see also" references in the manual should be removed.</p>
<p>We could also use my implementations above to define them in <code>obsolescent.cpkg5</code>.</p>
<p>Comments? Other ideas?</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61602017-05-15T05:48:21ZAnna Maria Bigatti
<ul><li><strong>Target version</strong> set to <i>CoCoA-5.2.2</i></li></ul><p>I sometimes miss old <code>Randomized</code>.<br />I suggest implementing it, but with explicit range: <code>randomized(f, 100);</code> randomizes in the range -100..100.<br />and maybe also <code>randomized(f, 100, 200);</code> in the range 100..200.</p>
<p>(should work for polynomials and for matrices?)</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61632017-05-15T08:36:39ZJohn Abbott
<ul><li><strong>Category</strong> set to <i>CoCoA-4 function to be added</i></li></ul><p>I thought <code>Randomize</code> in CoCoA-4 would work only for polynomials (and integers). Did it also work for matrices?</p>
<p>KISS: I do not like <code>Randomize(f, 100,200)</code> and find it hard to imagine when it could be useful.</p>
<p>If we do keep <code>Randomize</code> but with a different interface then the old is still obsolete/obsolescent.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61652017-05-15T08:59:18ZAnna Maria Bigatti
<ul></ul><p><code>L := DensePoly(P,1); randomized(L, -100,100);</code> is a nice way to make lots of random linear forms.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61662017-05-15T09:17:02ZJohn Abbott
<ul></ul><p>We could create: <code>RandomLinearForm(P,100)</code> or even <code>RandomLinearForm(P)</code> if coeff ring is finite field.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61672017-05-15T09:46:54ZAnna Maria Bigatti
<ul><li><strong>% Done</strong> changed from <i>10</i> to <i>50</i></li></ul><p>ok, you convinced me: let's declare Randomize(d) obsolete, and make (in case) explicit functions for random things.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61702017-05-15T10:31:00ZJohn Abbott
<ul></ul><p>OK, I'll do it and check in tomorrow -- too busy today.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61712017-05-16T09:35:51ZJohn Abbott
<ul></ul><p>There is also an undocumented fn called <strong><code>Rand</code></strong> in <code>misc.cpkg5</code>.<br />Should it be made obsolete? Or simply eliminated?</p>
<p><strong>NOTE</strong> I should have checked <strong>before</strong> writing. There is also an exported fn called <strong><code>Rand</code></strong> in <code>BackwardCompatible.cpkg5</code>, and there may be a call to it in <code>regularity.cpkg5</code>. I can easily change the call into a call to <code>random</code>.</p>
<p>But what about <code>BackwardCompatible.cpkg5</code>? How does it differ from <code>obsolescent.cpkg5</code>?</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61722017-05-16T11:20:33ZJohn Abbott
<ul></ul><p>There is a commented out fn called <code>RandomLinearForm</code> in <code>experimental.cpkg5</code>.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61742017-05-16T13:06:44ZAnna Maria Bigatti
<ul></ul><p>John Abbott wrote:</p>
<blockquote>
<p>But what about <code>BackwardCompatible.cpkg5</code>? How does it differ from <code>obsolescent.cpkg5</code>?</p>
</blockquote>
<p>Undecided, I suppose we can make it obsolescent and this point.</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61752017-05-16T13:21:30ZAnna Maria Bigatti
<ul></ul><p>John Abbott wrote:</p>
<blockquote>
<p>There is a commented out fn called <code>RandomLinearForm</code> in <code>experimental.cpkg5</code>.</p>
</blockquote>
<p>That's a kind of <code>randomized</code>, with huge coefficients. Good thing it is commented out ;-)</p>
<p>these are the "random" functions in cocoa-5:<br /><pre>
--> All 8 matches for "rand":
? random
? randomize
? randomized
? RandomSubset
? RandomSubsetIndices
? RandomTuple
? RandomTupleIndices
? RandomUnimodularMat
</pre><br />I think we could also add <code>RandomLinearForm(P, Lo, Hi)</code></p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61802017-05-16T13:32:11ZJohn Abbott
<ul></ul><p>Why do you want to specify <code>lo</code> and <code>hi</code> for <code>RandomLinearForm</code>?<br />Is it not enough to specify a single value N and use the symmetric range from -N to N?</p>
<p>What about when the coeff ring has non-zero characteristic? Then it might make sense to allow no range?</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=61812017-05-16T15:22:45ZAnna Maria Bigatti
<ul></ul><p>John Abbott wrote:</p>
<blockquote>
<p>Why do you want to specify <code>lo</code> and <code>hi</code> for <code>RandomLinearForm</code>?<br />Is it not enough to specify a single value N and use the symmetric range from -N to N?</p>
</blockquote>
<p>because it is more similar to <code>random</code>.</p>
<blockquote>
<p>What about when the coeff ring has non-zero characteristic? Then it might make sense to allow no range?</p>
</blockquote>
<p>well, KISS (nothing personal ;-)</p> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=65702017-11-15T16:01:09ZJohn Abbott
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/redmine/issues/1122">Feature #1122</a>: New fn: RandomLinearForm</i> added</li></ul> CoCoA-5 - Design #1067: "Randomize" and "Randomized" obsolete?https://cocoa.dima.unige.it/redmine/issues/1067?journal_id=65712017-11-15T16:02:32ZJohn Abbott
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>John Abbott</i></li><li><strong>% Done</strong> changed from <i>50</i> to <i>100</i></li><li><strong>Estimated time</strong> set to <i>1.55 h</i></li></ul><p>I shall close this issue, and create a new issue about creating <code>RandomLinearForm</code>.</p>