Archived issue #0026799
NCollection_Array2's RowLength and ColLength return wrong value.
Description
Please see the implementation of these two methods RowLength and ColLength:
The RowLength() returns the column length value while ColLength() returns the row length value.
Please swap these two method implementation codes to fix the isue.
//! RowLength
Standard_Integer RowLength (void) const
{ return (myUpperCol-myLowerCol+1); }
//! ColLength
Standard_Integer ColLength (void) const
{ return (myUpperRow-myLowerRow+1); }
The RowLength() returns the column length value while ColLength() returns the row length value.
Please swap these two method implementation codes to fix the isue.
//! RowLength
Standard_Integer RowLength (void) const
{ return (myUpperCol-myLowerCol+1); }
//! ColLength
Standard_Integer ColLength (void) const
{ return (myUpperRow-myLowerRow+1); }
Steps to reproduce
N/A
Public activity
6 archived notes
Participants are labeled by their role within this record.
Hello Vico,
I guess you may be confused by names of these methods: "RowLength" means length of the row (nb. of columns), and not nb. of rows, as you probably expect. Consider array of 2 rows, 3 columns:
Array1 (1, 2, 1, 3);
11 12 13
21 22 23
Here RowLength() should return 3, and ColLength() should be 2.
I guess you may be confused by names of these methods: "RowLength" means length of the row (nb. of columns), and not nb. of rows, as you probably expect. Consider array of 2 rows, 3 columns:
Array1 (1, 2, 1, 3);
11 12 13
21 22 23
Here RowLength() should return 3, and ColLength() should be 2.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: abv
Date: Sat Oct 24 08:00:58 2015 +0300
0026799: NCollection_Array2's RowLength and ColLength return wrong value.
Comments to methods RowLength() and ColLength() improved to avoid possible misinterpretation
[revision removed]
Detailed log of new commits:
Author: abv
Date: Sat Oct 24 08:00:58 2015 +0300
0026799: NCollection_Array2's RowLength and ColLength return wrong value.
Comments to methods RowLength() and ColLength() improved to avoid possible misinterpretation
I have improved comments to these methods to avoid such kind of confusion, please review
Dear abv,
Right that i'm confused. The improved comments is clear for these two methods. Thanks for the improvement.
Right that i'm confused. The improved comments is clear for these two methods. Thanks for the improvement.
Please integrate, no testing is needed
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]