Skip to content

Commit

Permalink
Use Fn.id instead of noop for stoch sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Aug 5, 2024
1 parent 45907e4 commit 4247ad4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/frontend/Ast_to_Mir.ml
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ let rec param_size transform sizedtype =
[%message "Expecting SMatrix, got " (st : Expr.Typed.t SizedType.t)]
in
let min_one d = Expr.Helpers.(binop d Minus (int 1)) in
let noop d = d in
match transform with
| Transformation.Identity | Lower _ | Upper _
|LowerUpper (_, _)
Expand All @@ -353,8 +352,8 @@ let rec param_size transform sizedtype =
| Simplex ->
shrink_eigen (fun d -> Expr.Helpers.(binop d Minus (int 1))) sizedtype
| CholeskyCorr | Correlation -> shrink_eigen k_choose_2 sizedtype
| StochasticRow -> stoch_size noop min_one sizedtype
| StochasticColumn -> stoch_size min_one noop sizedtype
| StochasticRow -> stoch_size Fn.id min_one sizedtype
| StochasticColumn -> stoch_size min_one Fn.id sizedtype
| CholeskyCov ->
(* (N * (N + 1)) / 2 + (M - N) * N *)
shrink_eigen_mat
Expand Down

0 comments on commit 4247ad4

Please sign in to comment.