# andrewboldi/math architecture

> Architecture diagram of the GitHub repository andrewboldi/math, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andrewboldi/math
- Repository: https://github.com/andrewboldi/math

## Overview

##### Main Components Organization

a) Number Sequence Generators
- Fibonacci (Fib/)
- Prime Numbers (Primes/)
- Pascal's Triangle (Pascal/)
- Factorial

b) Mathematical Constants
- Pi (Pi/)
- Euler-Mascheroni Constant

c) Mathematical Functions
- Integral Approximator
- Matrix Operations
- Totient Function

##### Implementation Layer Structure

a) Algorithm Variants Layer
- Different versions (v0, v1, v2, v3) as parallel implementations
- Them to their parent algorithm

b) Language Implementation Layer
- C (yellow)
- JavaScript/TypeScript (blue)
- Python (green)

##### Data Flow and Storage

Data storage components:
- Raw Data Files (.dat)
- Text Output Files (.txt)
- Configuration Files

##### Specific Component Details

a) Primes Component:
- Regular Primes
- Mersenne Primes
- Twin Primes
- Primality Testing (AKS)

b) Integration Component:
- Version control
- Optimization paths
- Data flow between versions

##### Implementation Details

Version progression:
- Optimization improvements
- Language-specific implementations as parallel tracks

##### Version progression and improvements

Keep the abstraction level focused on the architectural relationships while maintaining enough detail to show the distinct mathematical components and their implementations.

Remember to include:
- Clear boundaries between different mathematical domains
- Version progression paths
- Language implementation variations
- Data storage and processing flows
- Optimization paths between versions

This will provide a comprehensive view of how the different mathematical implementations relate to each other while maintaining clarity about the project's structure and evolution.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Main Components
    subgraph NumberSeq["Number Sequence Generators"]
        Fib["Fibonacci"]:::component
        Primes["Prime Numbers"]:::component
        Pascal["Pascal's Triangle"]:::component
        Factorial["Factorial"]:::component
    end

    subgraph MathConst["Mathematical Constants"]
        Pi["Pi"]:::component
        Euler["Euler-Mascheroni"]:::component
    end

    subgraph MathFunc["Mathematical Functions"]
        Integral["Integral Approximator"]:::component
        Matrix["Matrix Operations"]:::component
        Totient["Totient Function"]:::component
    end

    %% Prime Number Components
    subgraph PrimeTypes["Prime Number Types"]
        RegPrimes["Regular Primes"]:::component
        MerPrimes["Mersenne Primes"]:::component
        TwinPrimes["Twin Primes"]:::component
        AKS["AKS Primality Test"]:::component
    end

    %% Version Implementation
    subgraph Versions["Version Control"]
        direction TB
        IntegralV["Integral Versions"]:::version
        RegPrimesV["Regular Primes Versions"]:::version
        MatrixV["Matrix Versions"]:::version
        TotientV["Totient Versions"]:::version
    end

    %% Data Storage
    subgraph Storage["Data Storage"]
        direction TB
        PrimeData[("Prime Data")]:::storage
        PrimeOutput[("Prime Output")]:::storage
    end

    %% Relationships
    Primes --> PrimeTypes
    RegPrimes --> RegPrimesV
    RegPrimes --> PrimeData
    PrimeData --> PrimeOutput
    Integral --> IntegralV
    Matrix --> MatrixV
    Totient --> TotientV

    %% Styling
    classDef component fill:#f9f,stroke:#333,stroke-width:2px
    classDef version fill:#ff9,stroke:#333,stroke-width:2px
    classDef storage fill:#9ff,stroke:#333,stroke-width:2px
    
    %% Legend
    subgraph Legend
        C1["Component"]:::component
        V1["Version Control"]:::version
        S1[("Storage")]:::storage
    end

    %% Click Events
    click Fib "https://github.com/andrewboldi/math/tree/main//Fib"
    click Primes "https://github.com/andrewboldi/math/tree/main//Primes"
    click Pascal "https://github.com/andrewboldi/math/blob/main//Pascal/triangle.c"
    click Factorial "https://github.com/andrewboldi/math/blob/main//Factorial/main.py"
    click Pi "https://github.com/andrewboldi/math/tree/main//Pi"
    click Euler "https://github.com/andrewboldi/math/tree/main//Euler-Mascheroni"
    click Integral "https://github.com/andrewboldi/math/tree/main//IntegralApproximator"
    click Matrix "https://github.com/andrewboldi/math/tree/main//Matrix"
    click Totient "https://github.com/andrewboldi/math/tree/main//Totient"
    click RegPrimes "https://github.com/andrewboldi/math/tree/main//Primes/Regular"
    click MerPrimes "https://github.com/andrewboldi/math/tree/main//Primes/Mersenne"
    click TwinPrimes "https://github.com/andrewboldi/math/tree/main//Primes/Twin"
    click AKS "https://github.com/andrewboldi/math/tree/main//Primes/Primality/aks-primality-test"
    click PrimeData "https://github.com/andrewboldi/math/tree/main//Primes/Regular/data/dat"
    click PrimeOutput "https://github.com/andrewboldi/math/tree/main//Primes/Regular/data/txt"
```
