Commit 849fa21
Fix TypeError for nonsquare linear systems with QR factorization
Fixes #674
The issue occurred when solving nonsquare linear systems (A*u = b where A is m×n with m≠n).
On some platforms, Julia's qr function with ColumnNorm pivot returns QRPivoted with
Vector{Int32} for pivot indices, while LinearSolve's DefaultLinearSolverInit struct
expects Vector{Int64}.
This fix adds a helper function _ensure_int64_pivot that converts QRPivoted pivot
vectors from Int32 to Int64 when necessary, ensuring compatibility across all platforms.
Changes:
- Added _ensure_int64_pivot helper function to convert pivot indices to Int64
- Applied conversion in do_factorization for QRFactorization
- Applied conversion in all init_cacheval functions that return QRPivoted
- Ensured PREALLOCATED_QR_ColumnNorm uses Int64 pivot indices
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>1 parent f468950 commit 849fa21
1 file changed
+22
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
284 | 296 | | |
285 | 297 | | |
286 | 298 | | |
| |||
296 | 308 | | |
297 | 309 | | |
298 | 310 | | |
299 | | - | |
| 311 | + | |
| 312 | + | |
300 | 313 | | |
301 | 314 | | |
302 | 315 | | |
303 | 316 | | |
304 | 317 | | |
305 | | - | |
| 318 | + | |
| 319 | + | |
306 | 320 | | |
307 | 321 | | |
308 | 322 | | |
309 | 323 | | |
310 | 324 | | |
311 | | - | |
| 325 | + | |
| 326 | + | |
312 | 327 | | |
313 | 328 | | |
314 | | - | |
| 329 | + | |
| 330 | + | |
315 | 331 | | |
316 | 332 | | |
317 | 333 | | |
| |||
322 | 338 | | |
323 | 339 | | |
324 | 340 | | |
325 | | - | |
| 341 | + | |
| 342 | + | |
326 | 343 | | |
327 | 344 | | |
328 | 345 | | |
| |||
0 commit comments