Skip to content

Commit 716d956

Browse files
author
Jack Dermody
committed
small fixes
1 parent 65743a7 commit 716d956

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

BrightData/Buffer/Composite/CompositeBufferBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ public override async Task<ReadOnlyMemory<T>> GetTypedBlock(uint blockIndex)
176176
byteOffset += await SkipFileBlock(_currentDataBlock, byteOffset, _fileBlockSizes[fileBlockIndex++]);
177177
}
178178
}
179+
currentIndex = inMemoryBlocks + inFileBlocks;
179180
}
180181

181182
// check current block

BrightData/LinearAlgebra/MutableMatrix.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)