-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sparsification of Affine Equality Matrix #1625
base: master
Are you sure you want to change the base?
Conversation
6b07930
to
f931125
Compare
|
||
let add_empty_columns m cols = | ||
let () = Printf.printf "Before add_empty_columns m:\n%sindices: %s\n" (show m) (Array.fold_right (fun x s -> (Int.to_string x) ^ "," ^ s) cols "") in |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
@@ -337,7 +70,8 @@ | |||
V.of_array m.(n) | |||
|
|||
let remove_row m n = | |||
let new_matrix = make_matrix (num_rows m - 1) (num_cols m) A.zero in | |||
let () = Printf.printf "Before remove_row %i of m:\n%s\n" n (show m) in | |||
let new_matrix = Array.make_matrix (num_rows m - 1) (num_cols m) A.zero in |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
|
||
let set_col_with m new_col n = | ||
for i = 0 to num_rows m - 1 do | ||
m.(i).(n) <- V.nth new_col i | ||
done; m | ||
done; |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
let () = Printf.printf "Before normalizing we have m:\n%s" (show m) in | ||
if normalize_with copy then | ||
let () = Printf.printf "After normalizing we have m:\n%s" (show copy) in | ||
Some copy |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
Some copy | ||
else | ||
let () = Printf.printf "No normalization" in | ||
None |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
let m1' = copy m1 in | ||
let m2' = copy m2 in | ||
match rref_matrix_with m1' m2' with | ||
| Some m -> let () = Printf.printf "After rref_matrix m:\n %s\n" (show m) in Some m |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
let f' x y = V.to_array @@ f (V.of_array x) y in Array.map2 f' m (V.to_array v) | ||
*) | ||
|
||
let map2 f m v = |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
end | ||
let map2i_with f m v = Timing.wrap "map2i_with" (map2i_with f m) v | ||
|
||
(* Deprecated |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
let init_with_vec v = | ||
[v] | ||
|
||
let normalize m = |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.list-length-compare-n Warning
let () = Printf.printf "Before map2 we have m:\n%s\n" (show m) in | ||
let m' = copy m in | ||
map2_with f m' v; | ||
let () = Printf.printf "After map2 we have m:\n%s\n" (show m') in |
Check warning
Code scanning / Semgrep OSS
printing should be replaced with logging Warning
|
||
let map2i f m v = | ||
let () = Printf.printf "Before map2i m:\n%sv:%s\n" (show m) (V.show v) in | ||
let m' = copy m in |
Check warning
Code scanning / Semgrep OSS
Semgrep Finding: semgrep.print-not-logging Warning
|
||
let is_covered_by m1 m2 = | ||
(*Performs a partial rref reduction to check if concatenating both matrices and afterwards normalizing them would yield a matrix <> m2 *) | ||
(*Both input matrices must be in rref form!*) | ||
let () = Printf.printf "is_covered_by m1: \n%s " (show m1) in |
Check warning
Code scanning / Semgrep OSS
printing should be replaced with logging Warning
|
||
let is_covered_by m1 m2 = | ||
(*Performs a partial rref reduction to check if concatenating both matrices and afterwards normalizing them would yield a matrix <> m2 *) | ||
(*Both input matrices must be in rref form!*) | ||
let () = Printf.printf "is_covered_by m1: \n%s " (show m1) in | ||
let () = Printf.printf "is_covered_by m2 \n%s " (show m2) in |
Check warning
Code scanning / Semgrep OSS
printing should be replaced with logging Warning
This pull request contributes a sparse implementation of the Affine Equality Matrix.
This implementation is part of the assignment given by Tum practical WiSe 24/25 - Automated Bug Hunting and Beyond (IN0012, IN2106, IN4301).