uint icon indicating copy to clipboard operation
uint copied to clipboard

`algorithms/gcd/matrix`: Is it safe to do this based on just the u128 prefix?

Open github-actions[bot] opened this issue 2 years ago • 0 comments

On 2022-06-06 @recmo wrote in 4c74c09 “Merge pull request #110 from recmo/gcd”:

Is it safe to do this based on just the u128 prefix? let (r0, r1) = q.apply_u128(r0, r1); let s = r0.leading_zeros(); let r0s = r0 << s; let r1s = r1 << s; let qn = Self::from_u64_prefix((r0s >> 64) as u64, (r1s >> 64) as u64);

        // We can return q here and have a perfectly valid single-word Lehmer GCD.
        q
        // OPT: Fix the below method to get double-word Lehmer GCD.

        // Recompute r0 and r1 and take the high bits.
        // TODO: Is it safe to do this based on just the u128 prefix?
        // let (r0, r1) = q.apply_u128(r0, r1);
        // let s = r0.leading_zeros();
        // let r0s = r0 << s;
        // let r1s = r1 << s;
        // let qn = Self::from_u64_prefix((r0s >> 64) as u64, (r1s >> 64) as
        // u64);

        // // Multiply matrices qn * q
        // qn.compose(q)
    }
}

From src/algorithms/gcd/matrix.rs:315

github-actions[bot] avatar Jun 06 '22 03:06 github-actions[bot]