From 3ff7ce548390fe31033c33c675d746b14559d476 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Mar 2026 00:27:25 +0000 Subject: [PATCH 1/2] Remove dead commented code from Array.fs; add RepositoryBranch to fsproj - Remove 109 lines of outdated commented-out quickSelect implementation from Array.fs (superseded by the current Lomuto-partition version) - Add developer to FSharp.Stats.fsproj so that FsDoc source links point to the correct 'developer' branch instead of defaulting to 'main' (fixes ApiDocs wrong branch links, #338) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/FSharp.Stats/Array.fs | 109 --------------------------- src/FSharp.Stats/FSharp.Stats.fsproj | 1 + 2 files changed, 1 insertion(+), 109 deletions(-) diff --git a/src/FSharp.Stats/Array.fs b/src/FSharp.Stats/Array.fs index 4221def6..f0a3366b 100644 --- a/src/FSharp.Stats/Array.fs +++ b/src/FSharp.Stats/Array.fs @@ -141,115 +141,6 @@ module Array = let items' = Array.copy items quickSelectInPlaceWith 0 (items'.Length - 1) k items' - - - ///Old partitionSortInPlace fails with dublicates - - ///// Arranges the items between the left and right border, that all items left of the pivot element are smaller and bigger on the right. - ///// Function works in place and returns the index of the pivote element - //let partitionSortInPlace left right (items:array<'T>) = - - // // http://blog.mischel.com/2011/10/25/when-theory-meets-practice/ - // // Median of three optimization improves performance in general, - // // and eliminates worst-case behavior for sorted or reverse-sorted data. - // let center = (right + left) / 2 - // if (items.[left] > items.[right]) then - // swapInPlace left right items - // if (items.[center] < items.[left]) then - // swapInPlace center left items - // if (items.[center] > items.[right]) then - // swapInPlace center right items - // // // pick the pivot point and save it - // let pivot = items.[center] - - // let rec moveRightIndex i j = - // if (pivot < items.[j]) && (i < j) then - // moveRightIndex i (j-1) - // else - // j - - // let rec moveLeftIndex i j = - // if (items.[i] <= pivot) && (i < j) then - // moveLeftIndex (i+1) j - // else - // i - - // let rec loop i j = - // if (i < j) then - // let j' = moveRightIndex i j - // let i' = moveLeftIndex i j' - // if i'=i && j'=j then // experimental to avoid: nan compare always false - // -1 - // else - // if i' < j' then swapInPlace i' j' items - // loop i' j' - // else - // i - - // let i = loop left right - // i - - - ///// Finds the kth smallest element in an unordered array - //let inline quickSelect k (items:array<'T>) = - // let zero = LanguagePrimitives.GenericZero< 'T > - - // let rec quickSelect' (items:array<'T>) left right k = - - // // get pivot position - // let pivot = partitionSortInPlace left right items - // if pivot >= 0 then - // // if pivot is less than k, select from the right part - // if (pivot < k) then - // quickSelect' items (pivot + 1) right k - // // if pivot is greater than k, select from the left side - // elif (pivot > k) then - // quickSelect' items left (pivot - 1) k - // // if equal, return the value - // else - // items.[pivot] - // else - // zero / zero - - // let k' = k - 1 - // if k' <= 0 then - // Array.min items - // elif k' > items.Length-1 then - // Array.max items - // else - // let items' = Array.copy items - // quickSelect' items' 0 (items'.Length - 1) k' - - - ///// Finds the kth smallest element in an unordered array - ///// Works in place and can change the order of the elements in the input array - //let inline quickSelectInPlace k (items:array<'T>) : 'T = - // let zero = LanguagePrimitives.GenericZero< 'T > - - // let rec quickSelect' (items:array<'T>) left right k = - // // get pivot position - // let pivot = partitionSortInPlace left right items - // if pivot >= 0 then - // // if pivot is less than k, select from the right part - // if (pivot < k) then - // quickSelect' items (pivot + 1) right k - // // if pivot is greater than k, select from the left side - // elif (pivot > k) then - // quickSelect' items left (pivot - 1) k - // // if equal, return the value - // else - // items.[pivot] - // else - // zero / zero - - // let k' = k - 1 - // if k' <= 0 then - // Array.min items - // elif k' > items.Length-1 then - // Array.max items - // else - // quickSelect' items 0 (items.Length - 1) k' - /// Computes the Weighted Mean /// /// diff --git a/src/FSharp.Stats/FSharp.Stats.fsproj b/src/FSharp.Stats/FSharp.Stats.fsproj index a994bcd4..633a4162 100644 --- a/src/FSharp.Stats/FSharp.Stats.fsproj +++ b/src/FSharp.Stats/FSharp.Stats.fsproj @@ -23,6 +23,7 @@ F# FSharp dotnet data-science linear-algebra machine-learning fitting signal-processing statistical-testing https://github.com/fslaborg/FSharp.Stats git + developer https://github.com/fslaborg/FSharp.Stats/blob/developer/LICENSE https://github.com/fslaborg/FSharp.Stats/blob/developer/RELEASE_NOTES.md From 2800bdf7d26cfd662a5b44c70f38a3e01a5e748c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Mar 2026 00:35:29 +0000 Subject: [PATCH 2/2] ci: trigger checks