@@ -85,9 +85,6 @@ module ListMatrix: AbstractMatrix =
8585
8686 let equal m1 m2 = Timing. wrap " equal" (equal m1) m2
8787
88- let sub_rows (minu : V.t ) (subt : V.t ) : V.t =
89- V. map2_f_preserves_zero (-: ) minu subt
90-
9188 let div_row (row : V.t ) (pivot : A.t ) : V.t =
9289 V. map_f_preserves_zero (fun a -> a /: pivot) row
9390
@@ -174,18 +171,6 @@ module ListMatrix: AbstractMatrix =
174171 let init_with_vec v =
175172 [v]
176173
177- let get_pivot_positions m =
178- List. mapi (fun i row -> V. findi (fun z -> z =: A. one) row) m
179-
180- let sub_rows (minu : V.t ) (subt : V.t ) : V.t =
181- V. map2_f_preserves_zero (-: ) minu subt
182-
183- let div_row (row : V.t ) (pivot : A.t ) : V.t =
184- V. map_f_preserves_zero (fun a -> a /: pivot) row
185-
186- let swap_rows m j k =
187- List. mapi (fun i row -> if i = j then List. nth m k else if i = k then List. nth m j else row) m
188-
189174 let normalize m =
190175 let () = Printf. printf " Before normalizing we have m:\n %s" (show m) in
191176 let col_count = num_cols m in
@@ -287,7 +272,6 @@ module ListMatrix: AbstractMatrix =
287272 let () = Printf. printf " After rref_vec we have m:\n %s\n " (show res) in
288273 Some res
289274
290-
291275 (* This function yields the same result as appending vector v to m and normalizing it afterwards would. However, it is usually faster than performing those ops manually.*)
292276 (* m must be in rref form and contain the same num of cols as v*)
293277 (* If m is empty then v is simply normalized and returned*)
@@ -309,15 +293,11 @@ module ListMatrix: AbstractMatrix =
309293 | Some m -> let () = Printf.printf "After rref_matrix m, before removing zero rows:\n %s\n" (show m) in Some (remove_zero_rows m)
310294 | None -> let () = Printf.printf "No normalization for rref_matrix found" in None
311295 *)
312-
313296 let rref_matrix (m1 : t ) (m2 : t ) =
314297 let big_m, small_m = if num_rows m1 > num_rows m2 then m1, m2 else m2, m1 in
315298 fst @@ List. fold_while (fun acc _ -> Option. is_some acc)
316299 (fun acc_big_m small -> rref_vec (Option. get acc_big_m) small ) (Some big_m) small_m
317300
318- let delete_row_with_pivots row pivots m2 =
319- failwith " TODO"
320-
321301 let is_covered_by m1 m2 =
322302 let rec is_linearly_independent_rref v m =
323303 let pivot_opt = V. findi_val_opt ((<> :) A. zero) v in
@@ -369,44 +349,26 @@ module ListMatrix: AbstractMatrix =
369349 (* If m is empty then v is simply normalized and returned*)
370350 failwith " deprecated"
371351
372- let rref_vec_with m v = Timing. wrap " rref_vec_with" (rref_vec_with m) v
373352 let rref_with m =
374353 failwith " deprecated"
375354
376355 let reduce_col_with m j =
377356 failwith " deprecated"
378357
379- let reduce_col_with m j = Timing. wrap " reduce_col_with" (reduce_col_with m) j
380-
381-
382- let rref_with m = Timing. wrap " rref_with" rref_with m
383-
384358 let normalize_with m =
385359 failwith " deprecated"
386360
387- let normalize_with m = Timing. wrap " normalize_with" normalize_with m
388-
389-
390361 let set_col_with m new_col n =
391362 failwith " deprecated"
392363
393- let set_col_with m new_col n = Timing. wrap " set_col" (set_col_with m new_col) n
394-
395364 let map2_with f m v =
396365 failwith " deprecated"
397366
398- let map2_with f m v = Timing. wrap " map2_with" (map2_with f m) v
399-
400367 let map2i_with f m v =
401368 failwith " deprecated"
402369
403- let map2i_with f m v = Timing. wrap " map2i_with" (map2i_with f m) v
404-
405370 let rref_matrix_with m1 m2 =
406371 (* Similar to rref_vec_with but takes two matrices instead.*)
407372 (* ToDo Could become inefficient for large matrices since pivot_elements are always recalculated + many row additions*)
408373 failwith " deprecated"
409-
410- let rref_matrix_with m1 m2 = Timing. wrap " rref_matrix_with" (rref_matrix_with m1) m2
411-
412374 end
0 commit comments