@@ -80,31 +80,31 @@ protected set
8080 /// <inheritdoc />
8181 public INumericSegment < T > GetRow ( uint index )
8282 {
83- if ( index > RowCount )
83+ if ( index >= RowCount )
8484 throw new ArgumentOutOfRangeException ( nameof ( index ) , $ "Number of rows is { RowCount } but index { index } was requested") ;
8585 return new MutableTensorSegmentWrapper < T > ( Segment , index , RowCount , ColumnCount ) ;
8686 }
8787
8888 /// <inheritdoc />
8989 public virtual INumericSegment < T > GetColumn ( uint index )
9090 {
91- if ( index > ColumnCount )
91+ if ( index >= ColumnCount )
9292 throw new ArgumentOutOfRangeException ( nameof ( index ) , $ "Number of columns is { ColumnCount } but index { index } was requested") ;
9393 return new MutableTensorSegmentWrapper < T > ( Segment , index * RowCount , 1 , RowCount ) ;
9494 }
9595
9696 /// <inheritdoc />
9797 public virtual IReadOnlyNumericSegment < T > GetReadOnlyRow ( uint index )
9898 {
99- if ( index > RowCount )
99+ if ( index >= RowCount )
100100 throw new ArgumentOutOfRangeException ( nameof ( index ) , $ "Number of rows is { RowCount } but index { index } was requested") ;
101101 return new ReadOnlyTensorSegmentWrapper < T > ( Segment , index , RowCount , ColumnCount ) ;
102102 }
103103
104104 /// <inheritdoc />
105105 public virtual IReadOnlyNumericSegment < T > GetReadOnlyColumn ( uint index )
106106 {
107- if ( index > ColumnCount )
107+ if ( index >= ColumnCount )
108108 throw new ArgumentOutOfRangeException ( nameof ( index ) , $ "Number of columns is { ColumnCount } but index { index } was requested") ;
109109 return new ReadOnlyTensorSegmentWrapper < T > ( Segment , index * RowCount , 1 , RowCount ) ;
110110 }
0 commit comments