linbox icon indicating copy to clipboard operation
linbox copied to clipboard

Return void for `setEntry`

Open Breush opened this issue 5 years ago • 1 comments

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.

Breush avatar Sep 17 '18 14:09 Breush

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 [email protected] 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 .

bdsaunders avatar Sep 17 '18 15:09 bdsaunders