# polymathorg/polymath architecture

> Architecture diagram of the GitHub repository polymathorg/polymath, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/polymathorg/polymath
- Repository: https://github.com/polymathorg/polymath

## Overview

##### Main Components Organization

a) Core Mathematical Foundations
- Complex Numbers (Math-Complex)
- Quaternions (Math-Quaternion)
- Arbitrary Precision (Math-ArbitraryPrecisionFloat)
- Number Extensions (Math-Number-Extensions)

b) Scientific Computing Modules
- Statistics (Math-Statistics, Math-StatisticalMoments)
- Linear Algebra (Math-PrincipalComponentAnalysis)
- Signal Processing (Math-FastFourierTransform)
- Optimization (Math-FunctionFit)

c) Advanced Algorithms
- ODE Solvers (Math-ODE)
- Clustering (Math-Clustering)
- KD-Trees (Math-KDTree)
- TSNE (Math-TSNE)

##### Layer Structure (from bottom to top)

**[Visualization Layer]**
- ↑
**[Advanced Algorithms]**
- ↑
**[Scientific Computing]**
- ↑
**[Core Mathematics]**
- ↑
**[Pharo Platform]**

##### Key Relationships to Highlight

- How Math-Core-Process serves as a foundation
- Extension relationships (visible in the .extension.st files)
- Demonstrate how the testing framework (Math-Tests-*) corresponds to each module
- Integration with Pharo's native number system

##### Implementation Details

- Module name
- Key classes/features
- External dependencies
- Version compatibility (Pharo 9.0/10)

##### Additional Elements

Include:
- Version information
- Test coverage indicators
- Integration points with Pharo's native systems

This structure reflects PolyMath's nature as a comprehensive scientific computing library while showing its integration with the Pharo ecosystem.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles
    classDef core fill:#b3d9ff,stroke:#333
    classDef scientific fill:#90EE90,stroke:#333
    classDef advanced fill:#FFB366,stroke:#333
    classDef testing fill:#E6E6E6,stroke:#333
    classDef visualization fill:#E6B3FF,stroke:#333
    classDef platform fill:#D3D3D3,stroke:#333
    classDef support fill:#FFD700,stroke:#333

    %% Platform Layer
    subgraph Platform
        Pharo[Pharo Platform]:::platform
    end

    %% Core Mathematics Layer
    subgraph CoreMath
        Complex["Complex Numbers"]:::core
        Quaternion["Quaternions"]:::core
        ArbitraryPrecision["Arbitrary Precision"]:::core
        NumberExt["Number Extensions"]:::core
        CoreProcess["Core Processing"]:::core
    end

    %% Scientific Computing Layer
    subgraph Scientific
        Stats["Statistics"]:::scientific
        LinearAlg["Linear Algebra"]:::scientific
        SignalProc["Signal Processing"]:::scientific
        FunctionFit["Function Fitting"]:::scientific
    end

    %% Advanced Algorithms Layer
    subgraph Advanced
        ODE["ODE Solvers"]:::advanced
        Clustering["Clustering"]:::advanced
        KDTree["KD-Trees"]:::advanced
        TSNE["TSNE"]:::advanced
        AutoDiff["Automatic Differentiation"]:::advanced
    end

    %% Support Components
    subgraph Support
        Compat["Compatibility Layer"]:::support
        DataServer["Data Server Utils"]:::support
        Vis["Visualization"]:::visualization
    end

    %% Testing Framework
    subgraph Testing
        ComplexTests["Complex Tests"]:::testing
        ODETests["ODE Tests"]:::testing
        StatsTests["Statistics Tests"]:::testing
        ClusterTests["Clustering Tests"]:::testing
        KDTreeTests["KD-Tree Tests"]:::testing
    end

    %% Benchmarking
    subgraph Benchmarks
        KDTreeBench["KD-Tree Benchmarks"]:::testing
        ODEBench["ODE Benchmarks"]:::testing
    end

    %% Relationships
    Pharo --> CoreMath
    CoreProcess --> Scientific
    CoreMath --> Scientific
    Scientific --> Advanced
    Advanced --> Support
    CoreMath --> Testing
    Scientific --> Testing
    Advanced --> Testing
    Advanced --> Benchmarks

    %% Click Events
    click Complex "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Complex"
    click Quaternion "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Quaternion"
    click ArbitraryPrecision "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-ArbitraryPrecisionFloat"
    click NumberExt "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Number-Extensions"
    click Stats "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Statistics"
    click LinearAlg "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-PrincipalComponentAnalysis"
    click SignalProc "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-FastFourierTransform"
    click FunctionFit "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-FunctionFit"
    click ODE "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-ODE"
    click Clustering "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Clustering"
    click KDTree "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-KDTree"
    click TSNE "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-TSNE"
    click AutoDiff "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-AutomaticDifferenciation"
    click CoreProcess "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Core-Process"
    click Compat "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-CompatibilityUpToPharo11"
    click DataServer "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-UtilsDataServer"
    click Vis "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Visualizations"
    click KDTreeBench "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Benchmarks-KDTree"
    click ODEBench "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Benchmarks-ODE"
    click ComplexTests "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Tests-Complex"
    click ODETests "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Tests-ODE"
    click StatsTests "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Tests-Statistics"
    click ClusterTests "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Tests-Clustering"
    click KDTreeTests "https://github.com/PolyMathOrg/PolyMath/tree/master/src/Math-Tests-KDTree"
```
