You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
matchV.find_first_non_zero v_after_elim with(* now we check for contradictions and finally insert v *)
279
+
|None -> let()=Printf.printf "After rref_vec we have m:\n%s\n" (show m) in
280
+
Some m (* v is zero vector and was therefore already covered by zero *)
281
+
|Some (idx, value) ->
282
+
if idx = (num_cols m -1) then
283
+
let()=Printf.printf "After rref_vec there is no normalization\n"inNone
284
+
else
285
+
let normalized_v =V.map_f_preserves_zero (funx -> x /: value) v_after_elim in
286
+
let res = insert_v_according_to_piv m normalized_v idx pivot_positions in
287
+
let()=Printf.printf "After rref_vec we have m:\n%s\n" (show res) in
288
+
Some res
289
+
240
290
241
291
(*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.*)
242
292
(*m must be in rref form and contain the same num of cols as v*)
243
293
(*If m is empty then v is simply normalized and returned*)
244
294
(* TODO: OPTIMIZE! *)
245
-
letrref_vecmv=
295
+
(*let rref_vec m v =
246
296
let () = Printf.printf "Before rref_vec we have m:\n%sv: %s\n" (show m) (V.show v) in
247
297
match normalize @@ append_matrices m (init_with_vec v) with
248
298
| Some res -> let () = Printf.printf "After rref_vec, before removing zero rows, we have m:\n%s\n" (show res) in
249
299
Some (remove_zero_rows res)
250
-
|None -> let()=Printf.printf "After rref_vec there is no normalization\n"inNone
300
+
| None -> let () = Printf.printf "After rref_vec there is no normalization\n " in None*)
251
301
252
302
(*Similar to rref_vec_with but takes two matrices instead.*)
253
303
(*ToDo Could become inefficient for large matrices since pivot_elements are always recalculated + many row additions*)
0 commit comments