# cossoledad/numerical-lab architecture

> Architecture diagram of the GitHub repository cossoledad/numerical-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cossoledad/numerical-lab
- Repository: https://github.com/cossoledad/numerical-lab

## Overview

Numerical Lab is an interactive C teaching program: a user selects a math experiment, `src/main.c` prepares example inputs, calls the corresponding numerical routine, and prints results. The documented domain stages span root finding, integration, differentiation, ODE simulation, linear systems, regression, optimization, Monte Carlo, statistics, and numerical-error demonstrations. The sampled code confirms several direct calls from the demo entry point and the matrix solver’s internal implementation; other module links reflect README-described capabilities. The tree also includes small number, list, and string exercises invoked by the entry point. Unsampled wiring is not inferred beyond those documented capabilities.

Main entry points: [`src/main.c`](https://github.com/cossoledad/numerical-lab/blob/main/src/main.c) (Menu and demos), [`src/root.c`](https://github.com/cossoledad/numerical-lab/blob/main/src/root.c) (Root finding), [`src/integration.c`](https://github.com/cossoledad/numerical-lab/blob/main/src/integration.c) (Numerical integration), [`src/derivative.c`](https://github.com/cossoledad/numerical-lab/blob/main/src/derivative.c) (Numerical differentiation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_application["Demo application"]
  node_demo["Menu and demos<br/>[main.c]"]
end

subgraph group_numerical["Numerical methods"]
  node_root["Root finding<br/>[root.c]"]
  node_integration["Numerical integration<br/>[integration.c]"]
  node_derivative["Numerical differentiation<br/>[derivative.c]"]
  node_ode["ODE solvers<br/>[ode.c]"]
  node_matrix["Matrix and linear solve<br/>[matrix.c]"]
  node_optimize["Function minimization<br/>[optimize.c]"]
end

subgraph group_analysis["Data and error analysis"]
  node_regression["Least-squares fit<br/>[regression.c]"]
  node_montecarlo["Monte Carlo<br/>[monte_carlo.c]"]
  node_statistics["Descriptive statistics<br/>[statistics.c]"]
  node_numericerror["Floating-point error<br/>[numeric_error.c]"]
end

subgraph group_structures["C data structures"]
  node_bnumber["Big-number addition<br/>[bnumber.c]"]
  node_blist["List exercise<br/>[blist.c]"]
  node_bstring["String exercise<br/>[bstring.c]"]
end

node_user(("User"))

node_user -->|"selects experiment"| node_demo
node_demo -->|"calls solver"| node_root
node_demo -->|"calls integrator"| node_integration
node_demo -->|"calls differencer"| node_derivative
node_demo -->|"calls solver"| node_ode
node_demo -->|"calls linear solve"| node_matrix
node_demo -->|"calls fit"| node_regression
node_demo -->|"calls minimizer"| node_optimize
node_demo -->|"calls estimator"| node_montecarlo
node_demo -->|"calls analyzer"| node_statistics
node_demo -->|"runs demonstrations"| node_numericerror
node_demo -->|"uses addition"| node_bnumber
node_demo -->|"uses list"| node_blist
node_demo -->|"uses strings"| node_bstring

click node_demo "https://github.com/cossoledad/numerical-lab/blob/main/src/main.c"
click node_root "https://github.com/cossoledad/numerical-lab/blob/main/src/root.c"
click node_integration "https://github.com/cossoledad/numerical-lab/blob/main/src/integration.c"
click node_derivative "https://github.com/cossoledad/numerical-lab/blob/main/src/derivative.c"
click node_ode "https://github.com/cossoledad/numerical-lab/blob/main/src/ode.c"
click node_matrix "https://github.com/cossoledad/numerical-lab/blob/main/src/matrix.c"
click node_optimize "https://github.com/cossoledad/numerical-lab/blob/main/src/optimize.c"
click node_regression "https://github.com/cossoledad/numerical-lab/blob/main/src/regression.c"
click node_montecarlo "https://github.com/cossoledad/numerical-lab/blob/main/src/monte_carlo.c"
click node_statistics "https://github.com/cossoledad/numerical-lab/blob/main/src/statistics.c"
click node_numericerror "https://github.com/cossoledad/numerical-lab/blob/main/src/numeric_error.c"
click node_bnumber "https://github.com/cossoledad/numerical-lab/blob/main/src/bnumber.c"
click node_blist "https://github.com/cossoledad/numerical-lab/blob/main/src/blist.c"
click node_bstring "https://github.com/cossoledad/numerical-lab/blob/main/src/bstring.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_demo,node_user toneBlue
class node_root,node_integration,node_derivative,node_ode,node_matrix,node_optimize toneAmber
class node_regression,node_montecarlo,node_statistics,node_numericerror toneMint
class node_bnumber,node_blist,node_bstring toneRose
```

## Components

### Demo application

- [Menu and demos](https://github.com/cossoledad/numerical-lab/blob/main/src/main.c): `src/main.c`

### Numerical methods

- [Root finding](https://github.com/cossoledad/numerical-lab/blob/main/src/root.c): `src/root.c`
- [Numerical integration](https://github.com/cossoledad/numerical-lab/blob/main/src/integration.c): `src/integration.c`
- [Numerical differentiation](https://github.com/cossoledad/numerical-lab/blob/main/src/derivative.c): `src/derivative.c`
- [ODE solvers](https://github.com/cossoledad/numerical-lab/blob/main/src/ode.c): `src/ode.c`
- [Matrix and linear solve](https://github.com/cossoledad/numerical-lab/blob/main/src/matrix.c): `src/matrix.c`
- [Function minimization](https://github.com/cossoledad/numerical-lab/blob/main/src/optimize.c): `src/optimize.c`

### Data and error analysis

- [Least-squares fit](https://github.com/cossoledad/numerical-lab/blob/main/src/regression.c): `src/regression.c`
- [Monte Carlo](https://github.com/cossoledad/numerical-lab/blob/main/src/monte_carlo.c): `src/monte_carlo.c`
- [Descriptive statistics](https://github.com/cossoledad/numerical-lab/blob/main/src/statistics.c): `src/statistics.c`
- [Floating-point error](https://github.com/cossoledad/numerical-lab/blob/main/src/numeric_error.c): `src/numeric_error.c`

### C data structures

- [Big-number addition](https://github.com/cossoledad/numerical-lab/blob/main/src/bnumber.c): `src/bnumber.c`
- [List exercise](https://github.com/cossoledad/numerical-lab/blob/main/src/blist.c): `src/blist.c`
- [String exercise](https://github.com/cossoledad/numerical-lab/blob/main/src/bstring.c): `src/bstring.c`

### Other components

- **User**

## Connections

- User → Menu and demos: selects experiment
- Menu and demos → Root finding: calls solver
- Menu and demos → Numerical integration: calls integrator
- Menu and demos → Numerical differentiation: calls differencer
- Menu and demos → ODE solvers: calls solver
- Menu and demos → Matrix and linear solve: calls linear solve
- Menu and demos → Least-squares fit: calls fit
- Menu and demos → Function minimization: calls minimizer
- Menu and demos → Monte Carlo: calls estimator
- Menu and demos → Descriptive statistics: calls analyzer
- Menu and demos → Floating-point error: runs demonstrations
- Menu and demos → Big-number addition: uses addition
- Menu and demos → List exercise: uses list
- Menu and demos → String exercise: uses strings
