linbox-team / linbox

LinBox - C++ library for exact, high-performance linear algebra
https://linbox-team.github.io/linbox
GNU Lesser General Public License v2.1
83 stars 27 forks source link

Return void for `setEntry` #135

Open Breush opened 6 years ago

Breush commented 6 years ago

In linbox/matrix/densematrix/blas-matrix.h:

field().assign(_rep[i*_col+j],a_ij); return _rep[i*_col+j]; // PG: this does not work with BitVector as _rep -> getting a Warning because BitVector operator[] does not return a reference but a boolean constructed on the fly (setEntry must return a reference [why ?])

This currently causes warnings, even if nobody uses the result value of setEntry.

bdsaunders commented 6 years ago

I agree that setEntry could generically have void return value. Supporting linbox functions that work with normal entry storage as well as packed and sliced entry storage schemes is valuable. Thus uses of refEntry should be minimized as well as of getEntry(i,j). The getEntry(x, i, j) returning reference to x is preferred and the reason for the return value is so that you can nest the getEntry call in arithmetic expressions.

On Mon, Sep 17, 2018 at 10:47 AM, A. Breust notifications@github.com wrote:

In linbox/matrix/densematrix/blas-matrix.h:

field().assign(_rep[i_col+j],a_ij); return _rep[i_col+j]; // PG: this does not work with BitVector as _rep -> getting a Warning because BitVector operator[] does not return a reference but a boolean constructed on the fly (setEntry must return a reference [why ?])

This currently causes warnings, even if nobody uses the result value of setEntry.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/linbox-team/linbox/issues/135, or mute the thread https://github.com/notifications/unsubscribe-auth/ADk6I34L87CpUyzt66kwlNY1MQ7DgCEbks5ub7X1gaJpZM4WsE30 .