https://cocoa.dima.unige.it/redmine/https://cocoa.dima.unige.it/redmine/redmine/favicon.ico?15088260392012-07-04T16:33:23ZCoCoA ProjectCoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=5372012-07-04T16:33:23ZAnna Maria Bigatti
<ul></ul><p>another proposal<br /><pre>
RowMat(M, i);
ColMat(M, j);
</pre><br />comments?</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=30672014-08-01T06:59:56ZAnna Maria Bigatti
<ul><li><strong>Target version</strong> set to <i>CoCoALib-1.0</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=35322015-05-13T07:56:24ZRedmine Admincocoa@dima.unige.it
<ul><li><strong>Category</strong> set to <i>Data Structures</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=55782017-02-24T16:42:25ZJohn Abbott
<ul></ul>Another possibility: uglier, but possibly clearer?
<ul>
<li><strong><code>RowMatView</code></strong></li>
<li><strong><code>ColMatView</code></strong></li>
</ul>
<p>The intention is that the result should be a matrix 1xC or Rx1, right?</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=55822017-02-24T16:49:55ZJohn Abbott
<ul><li><strong>Related to</strong> <i><a class="issue tracker-1 status-2 priority-3 priority-lowest" href="/redmine/issues/1014">Bug #1014</a>: RowMat, ColMat with arg an empty list/vector</i> added</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=55832017-02-24T16:51:02ZJohn Abbott
<ul></ul><p>What should these functions do if the matrix is 0-by-C or R-by-0?<br />Return a 0-by-1 or 1-by-0 matrix?</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=56192017-03-02T14:22:46ZJohn Abbott
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>50</i></li></ul><p>Implemented (using <code>submat</code>).<br />Still have to write tests and doc.</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=64652017-11-06T13:56:21ZAnna Maria Bigatti
<ul><li><strong>Target version</strong> changed from <i>CoCoALib-1.0</i> to <i>CoCoALib-0.99600</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=70602018-06-14T13:53:22ZJohn Abbott
<ul></ul><p>I have just checked the code: it is in <code>MatrixView</code> (as one would expect).</p>
<p>I am not so happy about the names <strong><code>RowMat</code></strong> and <strong><code>ColMat</code></strong> because these names exist also for some completely different functions: ones which allow a C++ vector of <code>RingElem</code> to be viewed as a row-matrix or a col-matrix.</p>
<p>How about the names <strong><code>RowOfMat</code></strong> and <strong><code>ColOfMat</code></strong>?<br />Or even <strong><code>submat1row</code></strong> and <strong><code>submat1col</code></strong>? (uglier but maybe clearer?)</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=72132018-07-31T11:20:09ZAnna Maria Bigatti
<ul><li><strong>Target version</strong> changed from <i>CoCoALib-0.99600</i> to <i>CoCoALib-0.99650 November 2019</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=79252019-10-01T10:04:45ZJohn Abbott
<ul><li><strong>Target version</strong> changed from <i>CoCoALib-0.99650 November 2019</i> to <i>CoCoALib-0.99700</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=85992020-01-18T18:59:41ZJohn Abbott
<ul></ul><p>We could even use the names <strong><code>row</code></strong> and <strong><code>col</code></strong>, so sample uses would be <br /><pre>
MatrixView FirstRow = row(M,0);
MatrixView LastRow = row(M, NumRows(M)-1);
</pre></p>
<p>One odd aspect of this implementation is that if we want to get an element from the resulting row/column, we must supply <strong>two</strong> indices (because the result is really just a sub-matrix. For instance:<br /><pre>
MatrixView FirstCol = col(M,0);
if (FirstCol(0,0) == 1) cout << "Top left entry is 1" << endl;
</pre></p>
<p>This is rather weird! Usually we try to avoid too much weirdness.</p>
<p>Personally I would expect the result of a "get-row" or "get-col" function to produce an object which requires just a single index.</p>
<p>An advantage of the current impl (as a submatrix) is that we can directly use the chosen row/col in matrix multiplication.</p>
<p>Perhaps the correct result type(s) should be new objects which require just a single index to access the values, but if used in a context where a matrix is required are automatically converted to (or viewed as) a matrix.</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=86002020-01-18T19:05:16ZJohn Abbott
<ul></ul><p>Should the "get-row" or "get-col" function make a copy or just refer to the original matrix?</p>
<p>Making a copy could be expensive, and possibly unwanted in many contexts.<br />If a copy is required, it can be made explicitly by calling <code>DenseMat</code> (or some similar fn).</p>
<p>Refering to the original matrix might leave a "dangling pointer":<br /><pre>
M = 3x3 matrix;
auto LastRow = row(M,2);
M = 2x2 matrix;
cout << LastRow(2) << endl; /// What happens here?
</pre></p>
<p>If the matrix impl is ref counted then the object produced by <strong><code>row</code></strong> (or <strong><code>col</code></strong>) could maintain a counted pointer to the impl. This would then appear to the user as though a copy had been made.</p>
<p>Also, can elements in a row/col object be assigned to? [probably <strong>yes</strong>]<br />Should this then change the entry in the original matrix? [probably <strong>yes</strong>]<br />Assigning an element in a row object may cause an element in a col object to change value:<br /><pre>
M = 3x3 matrix;
auto FirstRow = row(M,0);
auto FirstCol = col(M,0);
FirstRow[0] = -99;
cout << FirstCol[0] << endl; // should print -99!
</pre></p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=87572020-02-12T15:43:06ZAnna Maria Bigatti
<ul><li><strong>Target version</strong> changed from <i>CoCoALib-0.99700</i> to <i>CoCoALib-0.99800</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=109972022-02-04T20:27:09ZJohn Abbott
<ul><li><strong>Target version</strong> changed from <i>CoCoALib-0.99800</i> to <i>CoCoALib-0.99850</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=120632024-02-08T20:55:26ZJohn Abbott
<ul></ul><p>What is the status of this issue? With luck we can soon close it!</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122672024-03-08T08:04:37ZAnna Maria Bigatti
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>% Done</strong> changed from <i>50</i> to <i>80</i></li></ul><p>John Abbott wrote:</p>
<blockquote>
<p>I have just checked the code: it is in <code>MatrixView</code> (as one would expect).</p>
<p>I am not so happy about the names <strong><code>RowMat</code></strong> and <strong><code>ColMat</code></strong> because these names exist also for some completely different functions: ones which allow a C++ vector of <code>RingElem</code> to be viewed as a row-matrix or a col-matrix.</p>
</blockquote>
<p>I checked: it is implemented as <strong><code>RowMat</code></strong> and I think it is good because, in both meanings, it is a <code>MatrixView</code>. I wonder what I originally wanted to use it for... I could not find any such call of <code>RowMat</code> nor awkward call of submat :-/</p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122682024-03-08T08:05:36ZAnna Maria Bigatti
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/redmine/issues/312">Feature #312</a>: LongRange(a,b) returning vector of long a..b (included)</i> added</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122702024-03-08T08:11:26ZAnna Maria Bigatti
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Feedback</i></li><li><strong>% Done</strong> changed from <i>80</i> to <i>90</i></li></ul><p>I found a good use in ex-IdealOfPoints1.C.<br />The comparison in readability between before and after is indeed quite striking:<br /><pre>
// matrix M1 = NewDenseMat(submat(M, LongRange(0,0), LongRange(0,2)));
matrix M1 = NewDenseMat(RowMat(M, 0));
</pre><br />Similarly in <code>test-MatrixForOrdering2.C</code></p> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122722024-03-08T08:15:59ZAnna Maria Bigatti
<ul><li><strong>Related to</strong> <i><a class="issue tracker-7 status-5 priority-4 priority-default closed" href="/redmine/issues/64">Design #64</a>: submat takes only vector<long></i> added</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122852024-03-08T09:13:17ZAnna Maria Bigatti
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/redmine/issues/1788">Feature #1788</a>: New MatrixView/function "FirstRows/FirstCols"?</i> added</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122862024-03-08T09:13:37ZAnna Maria Bigatti
<ul><li><strong>Subject</strong> changed from <i>MatrixView for viewing a single row or column</i> to <i>MatrixView for viewing a single row or column (RowMat, ColMat)</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122872024-03-08T09:15:06ZAnna Maria Bigatti
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/redmine/journals/12287/diff?detail_id=13536">diff</a>)</li><li><strong>Assignee</strong> set to <i>John Abbott</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=122972024-03-08T16:20:51ZAnna Maria Bigatti
<ul><li><strong>Status</strong> changed from <i>Feedback</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>90</i> to <i>100</i></li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=124702024-03-20T13:07:56ZAnna Maria Bigatti
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/redmine/journals/12470/diff?detail_id=13727">diff</a>)</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=124712024-03-20T13:08:43ZAnna Maria Bigatti
<ul><li><strong>Subject</strong> changed from <i>MatrixView for viewing a single row or column (RowMat, ColMat)</i> to <i>MatrixView/function for viewing a single row or column (RowMat, ColMat)</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/redmine/journals/12471/diff?detail_id=13729">diff</a>)</li></ul> CoCoALib - Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat)https://cocoa.dima.unige.it/redmine/issues/202?journal_id=124722024-03-20T13:09:11ZAnna Maria Bigatti
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/redmine/journals/12472/diff?detail_id=13730">diff</a>)</li></ul>