microsoft/qdk

Public

mirrored fromhttps://github.com/microsoft/qdkAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v1.25.1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

source/paulimer/src/main.rs

21lines · modecode

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4use paulimer::bits::BitMatrix;
5use rand::prelude::*;
6
7fn main() {
8 let mut matrix = random_bitmatrix(10000, 10000);
9 matrix.echelonize();
10}
11
12fn random_bitmatrix(rowcount: usize, columncount: usize) -> BitMatrix {
13 let mut matrix = BitMatrix::with_shape(rowcount, columncount);
14 let mut bits = std::iter::from_fn(move || Some(thread_rng().gen::<bool>()));
15 for row_index in 0..rowcount {
16 for column_index in 0..columncount {
17 matrix.set((row_index, column_index), bits.next().expect("boom"));
18 }
19 }
20 matrix
21}
22