[Number_Theory] Add Miller-Rabin and Pollard-rho factorisation to the explorer

Abierto
#403 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
30/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
cpp
Área
backend, frontend

Línea de trabajo

Start with the primality and factorisation code in Number_Theory/src/core/NumberTheoryEngine.cpp at the cited line ranges, then inspect Number_Theory/src/widgets/FactorizationTreeWidget.cpp and the QML views. First check how the existing engine exposes algorithms to the UI and how its tests measure primality and factorisation. Done means the stated large-prime timing and factorisation example pass, with the result displayed as a tree.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area: number-theory priority: P3 size: M type: enhancement

Summary

Primality uses trial division (O(sqrt n), about 5e8 iterations near 2^63, and i*i overflows there). Factorisation, the most visual topic, exists only as an unused primeFactorization() and in the deleted widget UI.

Location

  • Number_Theory/src/core/NumberTheoryEngine.cpp:298-309
  • Number_Theory/src/core/NumberTheoryEngine.cpp:373-405
  • Number_Theory/src/widgets/FactorizationTreeWidget.cpp

Evidence

UBSan harness: testPrimality(9223372036854775783) reports NumberTheoryEngine.cpp:304:29: runtime error: signed integer overflow: 3037000505 * 3037000505 and had not finished after 120 s.

Expected

Instant deterministic primality for all 64-bit n and a factorisation tree visualisation.

Proposed fix

Implement deterministic Miller-Rabin (bases 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37) with __int128 mulmod, Pollard's rho (Brent), and a new Prime Factorization algorithm with a QML tree view. Keep trial division as an educational "step mode" for small n.

Acceptance criteria

  • isPrime(2^63-25) returns true in < 10 ms
  • Factorisation of 600851475143 -> 71 * 839 * 1471 * 6857 shown as a tree

Repository audit, November 2026 · Phase 9 · New features · evidence: found by code reading · ref core-cpp-033


Generated by Claude Code

Lenguaje dominante
C++
Estrellas
2
Forks
1
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ibra-kdbra/Math-Problems

Todos los issues de ibra-kdbra/Math-Problems

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.