Skip to content

Commit 6bfbebe

Browse files
authored
make BlockedSparse immutable, add note why other types must be mutable (#815)
* make BlockedSparse, add note why other types must be mutable * NEWS + version bump
1 parent 19c37bb commit 6bfbebe

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

NEWS.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
MixedModels v4.34.0 Release Notes
2+
==============================
3+
- `BlockedSparse` is now immutable. [#815]
4+
15
MixedModels v4.33.0 Release Notes
26
==============================
37
- `LikelihoodRatioTest` now extends `StatsAPI.HypothesisTest` and provides a method for `StatsAPI.pvalue`. [#814]
@@ -617,3 +621,4 @@ Package dependencies
617621
[#802]: https://github.com/JuliaStats/MixedModels.jl/issues/802
618622
[#810]: https://github.com/JuliaStats/MixedModels.jl/issues/810
619623
[#814]: https://github.com/JuliaStats/MixedModels.jl/issues/814
624+
[#815]: https://github.com/JuliaStats/MixedModels.jl/issues/815

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MixedModels"
22
uuid = "ff71e718-51f3-5ec2-a782-8ffcbfa3c316"
33
author = ["Phillip Alday <[email protected]>", "Douglas Bates <[email protected]>"]
4-
version = "4.33.0"
4+
version = "4.34.0"
55

66
[deps]
77
Arrow = "69666777-d1a9-59fb-9406-91d4454c9d45"

src/Xymat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ Typically, an `FeMat` represents the fixed-effects model matrix with the respons
104104
Upon construction the `xy` and `wtxy` fields refer to the same matrix
105105
"""
106106
mutable struct FeMat{T,S<:AbstractMatrix} <: AbstractMatrix{T}
107+
# XXX This struct must be mutable, because in the unweighted
108+
# case wtxy === xy and we allow users to reweight posthoc,
109+
# at which point wtxy is replaced by a new matrix
107110
xy::S
108111
wtxy::S
109112
end

src/arraytypes.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ A `SparseMatrixCSC` whose nonzeros form blocks of rows or columns or both.
6060
6161
The only time these are created are as products of `ReMat`s.
6262
"""
63-
mutable struct BlockedSparse{T,S,P} <: AbstractMatrix{T}
63+
struct BlockedSparse{T,S,P} <: AbstractMatrix{T}
6464
cscmat::SparseMatrixCSC{T,Int32}
6565
nzsasmat::Matrix{T}
6666
colblkptr::Vector{Int32}

src/remat.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ A section of a model matrix generated by a random-effects term.
1818
- `scratch`: a `Matrix{T}`
1919
"""
2020
mutable struct ReMat{T,S} <: AbstractReMat{T}
21+
# XXX This struct must be mutable, because in the unweighted
22+
# case wtz === z and we allow users to reweight posthoc,
23+
# at which point wtxy is replaced by a new matrix
2124
trm::Any
2225
refs::Vector{Int32}
2326
levels::Any

0 commit comments

Comments
 (0)