Skip to content

Commit c8d9712

Browse files
authored
Merge pull request #73 from acgetchell/perf/64-bigint-bareiss-det
perf: integer-only Bareiss determinant via BigInt (#64) Closes #64
2 parents 85679b5 + 2ee3f05 commit c8d9712

3 files changed

Lines changed: 406 additions & 57 deletions

File tree

AGENTS.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,42 @@ just examples # Run all examples
160160
- Use `just changelog` to regenerate
161161
- Use `just changelog-unreleased <version>` to prepend unreleased changes
162162

163+
### GitHub CLI (`gh`)
164+
165+
When using `gh` to view issues, PRs, or other GitHub objects:
166+
167+
- **ALWAYS** use `--json` with `| cat` to avoid pager and scope errors:
168+
169+
```bash
170+
gh issue view 64 --repo acgetchell/la-stack --json title,body | cat
171+
```
172+
173+
- To extract specific fields cleanly, combine `--json` with `--jq`:
174+
175+
```bash
176+
gh issue view 64 --repo acgetchell/la-stack --json title,body --jq '.title + "\n" + .body' | cat
177+
```
178+
179+
- **AVOID** plain `gh issue view N` — it may fail with `read:project`
180+
scope errors or open a pager.
181+
182+
- For **arbitrary Markdown** (backticks, quotes, special characters) in
183+
comments, prefer `--body-file -` with a heredoc:
184+
185+
```bash
186+
gh issue comment 64 --repo acgetchell/la-stack --body-file - <<'EOF'
187+
## Heading
188+
189+
Body with `backticks`, **bold**, and apostrophes that's safe.
190+
EOF
191+
```
192+
163193
### GitHub Issues
164194
165195
Use the `gh` CLI to read, create, and edit issues:
166196
167-
- **Read**: `gh issue view <number>` (or `--json title,body,labels,milestone` for structured data)
168-
- **List**: `gh issue list` (add `--label enhancement`, `--milestone v0.3.0`, etc. to filter)
197+
- **Read**: `gh issue view <number> --json title,body,labels,milestone | cat`
198+
- **List**: `gh issue list --json number,title,labels --jq '.[] | "#\(.number) \(.title)"' | cat` (add `--label enhancement`, `--milestone v0.4.0`, etc. to filter)
169199
- **Create**: `gh issue create --title "..." --body "..." --label enhancement --label rust`
170200
- **Edit**: `gh issue edit <number> --add-label "..."`, `--milestone "..."`, `--title "..."`
171201
- **Comment**: `gh issue comment <number> --body "..."`
@@ -205,8 +235,9 @@ When creating or updating issues:
205235
- `src/lu.rs`: `Lu<const D: usize>` factorization with partial pivoting (`solve_vec`, `det`)
206236
- `src/ldlt.rs`: `Ldlt<const D: usize>` factorization without pivoting for symmetric SPD/PSD matrices (`solve_vec`, `det`)
207237
- `src/exact.rs`: exact arithmetic behind `features = ["exact"]`:
208-
- Determinants: `det_exact()`, `det_exact_f64()`, `det_sign_exact()` via Bareiss in
209-
`BigRational`; `det_sign_exact()` adds a Shewchuk-style f64 filter for fast sign resolution
238+
- Determinants: `det_exact()`, `det_exact_f64()`, `det_sign_exact()` via integer-only
239+
Bareiss in `BigInt` (`bareiss_det_int`); `det_sign_exact()` adds a Shewchuk-style
240+
f64 filter for fast sign resolution
210241
- Linear system solve: `solve_exact()`, `solve_exact_f64()` via Gaussian elimination
211242
with first-non-zero pivoting in `BigRational`
212243
- Rust tests are inline `#[cfg(test)]` modules in each `src/*.rs` file.

REFERENCES.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@ matrices, see [6].
2828

2929
### Exact determinant sign (adaptive-precision Bareiss)
3030

31-
`det_sign_exact()` uses a Shewchuk-style f64 error-bound filter [8] backed by exact Bareiss
32-
elimination [7] in `BigRational`. See `src/exact.rs` for the full architecture description.
31+
`det_sign_exact()` uses a Shewchuk-style f64 error-bound filter [8] backed by integer-only
32+
Bareiss elimination [7] in `BigInt`. Each f64 entry is decomposed into `mantissa × 2^exponent`,
33+
scaled to a common integer base, and eliminated without any `BigRational` or GCD overhead.
34+
See `src/exact.rs` for the full architecture description.
3335

3436
## References
3537

0 commit comments

Comments
 (0)