Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/FSharp.Stats/Matrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1493,7 +1493,7 @@ module Matrix =
else
loop (nColI) (colI-1)

loop (nRows-2) (nRows-1)
loop (nCols-2) (nCols-1)

/// <summary>Splits a matrix along row direction according to given indices. Returns (matrix including rows according to indices, rest)</summary>
/// <remarks></remarks>
Expand Down
2 changes: 1 addition & 1 deletion tests/FSharp.Stats.Tests/FSharp.Stats.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<ItemGroup>
<PackageReference Include="altcover" Version="8.6.68" />
<PackageReference Include="Expecto" Version="10.*" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.*" />
<PackageReference Include="YoloDev.Expecto.TestSdk" Version="0.14.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="OptimizedPriorityQueue" Version="5.1.0" />
<PackageReference Include="Deedle" Version="3.0.0" />
Expand Down
31 changes: 31 additions & 0 deletions tests/FSharp.Stats.Tests/Matrix.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,37 @@ let floatImplementationDenseTests =
testCase "getRows" <| fun () ->
()
]
testList "removeCols" [
testCase "removeColAt" <| fun () ->
let m =
[|
[|0.;1.|]
[|0.;3.|]
[|0.;5.|]
|] |> Matrix.ofJaggedArray
let actual = Matrix.removeColAt 0 m
let expected =
[|
[|1.|]
[|3.|]
[|5.|]
|] |> Matrix.ofJaggedArray
Expect.equal actual expected "Matrix.removeColAt did not return the correct matrix"
]
testList "removeRows" [
testCase "removeRowAt" <| fun () ->
let m =
[|
[|0.;0.;0.;|]
[|1.;3.;5.;|]
|] |> Matrix.ofJaggedArray
let actual = Matrix.removeRowAt 1 m
let expected =
[|
[|0.;0.;0.|]
|] |> Matrix.ofJaggedArray
Expect.equal actual expected "Matrix.removeRowAt did not return the correct matrix"
]
testList "getRegion" [

testCase "get Region" <| fun () ->
Expand Down
Loading