# chem281materials/lab-3 architecture

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

- Interactive diagram: https://gitdiagram.com/chem281materials/lab-3
- Repository: https://github.com/chem281materials/lab-3

## Overview

This repository is a hands-on C++ development lab: learners prepare a containerized environment, implement and exercise a BLAS-backed linear algebra library, and inspect a deliberately leaky dummy database. The principal code workflow is the demo calling the projection API, which uses the norm and dot-product routines and delegates numerical work to BLAS. README-described setup and testing capabilities are included; the sampled source does not show the container launcher’s implementation or the internals of the test file.

Main entry points: [`develop_container.sh`](https://github.com/chem281materials/lab-3/blob/main/develop_container.sh) (Container launcher), [`DevelopmentBLAS.Dockerfile`](https://github.com/chem281materials/lab-3/blob/main/DevelopmentBLAS.Dockerfile) (BLAS image), [`example_library/include/linear_alg.h`](https://github.com/chem281materials/lab-3/blob/main/example_library/include/linear_alg.h) (Linear algebra API), [`example_library/src/linear_alg.cpp`](https://github.com/chem281materials/lab-3/blob/main/example_library/src/linear_alg.cpp) (Linear algebra routines)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_environment["Development environment"]
  node_base_image["Base image"]
  node_blas_image["BLAS image"]
  node_container_launcher["Container launcher"]
end

subgraph group_linear["Linear algebra"]
  node_blas["BLAS"]
  node_api["Linear algebra API<br/>[linear_alg.h]"]
  node_linear_impl["Linear algebra routines<br/>[linear_alg.cpp]"]
  node_demo["Projection demo<br/>[main.cpp]"]
end

subgraph group_verification["Testing and debugging"]
  node_test_suite["Unit tests"]
  node_debug_database["Leaky database demo<br/>[db_debug.cpp]"]
  node_coverage["Coverage workflow<br/>[CMakeLists.txt]"]
  node_valgrind["Valgrind"]
end

node_learner(("Learner"))

node_learner -->|"builds"| node_base_image
node_learner -->|"extends"| node_blas_image
node_learner -->|"runs"| node_container_launcher
node_container_launcher -->|"launches"| node_blas_image
node_demo -->|"calls"| node_api
node_linear_impl -->|"uses"| node_blas
node_test_suite -->|"tests"| node_api
node_learner -->|"runs"| node_debug_database
node_learner -.->|"debugs with"| node_valgrind
node_learner -.->|"generates"| node_coverage

click node_base_image "https://github.com/chem281materials/lab-3/blob/main/DevelopmentBase.Dockerfile"
click node_blas_image "https://github.com/chem281materials/lab-3/blob/main/DevelopmentBLAS.Dockerfile"
click node_container_launcher "https://github.com/chem281materials/lab-3/blob/main/develop_container.sh"
click node_api "https://github.com/chem281materials/lab-3/blob/main/example_library/include/linear_alg.h"
click node_linear_impl "https://github.com/chem281materials/lab-3/blob/main/example_library/src/linear_alg.cpp"
click node_demo "https://github.com/chem281materials/lab-3/blob/main/example_library/src/main.cpp"
click node_test_suite "https://github.com/chem281materials/lab-3/blob/main/example_library/test/linear_alg_test.cpp"
click node_debug_database "https://github.com/chem281materials/lab-3/blob/main/example_library/src/db_debug.cpp"
click node_coverage "https://github.com/chem281materials/lab-3/blob/main/example_library/CMakeLists.txt"

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_base_image,node_blas_image,node_container_launcher toneBlue
class node_blas,node_api,node_linear_impl,node_demo toneAmber
class node_test_suite,node_debug_database,node_coverage,node_valgrind toneMint
class node_learner toneIndigo
```

## Components

### Development environment

- [Base image](https://github.com/chem281materials/lab-3/blob/main/DevelopmentBase.Dockerfile): `DevelopmentBase.Dockerfile`
- [BLAS image](https://github.com/chem281materials/lab-3/blob/main/DevelopmentBLAS.Dockerfile): `DevelopmentBLAS.Dockerfile`
- [Container launcher](https://github.com/chem281materials/lab-3/blob/main/develop_container.sh): `develop_container.sh`

### Linear algebra

- **BLAS**
- [Linear algebra API](https://github.com/chem281materials/lab-3/blob/main/example_library/include/linear_alg.h): `example_library/include/linear_alg.h`
- [Linear algebra routines](https://github.com/chem281materials/lab-3/blob/main/example_library/src/linear_alg.cpp): `example_library/src/linear_alg.cpp`
- [Projection demo](https://github.com/chem281materials/lab-3/blob/main/example_library/src/main.cpp): `example_library/src/main.cpp`

### Testing and debugging

- [Unit tests](https://github.com/chem281materials/lab-3/blob/main/example_library/test/linear_alg_test.cpp): `example_library/test/linear_alg_test.cpp`
- [Leaky database demo](https://github.com/chem281materials/lab-3/blob/main/example_library/src/db_debug.cpp): `example_library/src/db_debug.cpp`
- [Coverage workflow](https://github.com/chem281materials/lab-3/blob/main/example_library/CMakeLists.txt): `example_library/CMakeLists.txt`
- **Valgrind**

### Other components

- **Learner**

## Connections

- Learner → Base image: builds
- Learner → BLAS image: extends
- Learner → Container launcher: runs
- Container launcher → BLAS image: launches
- Projection demo → Linear algebra API: calls
- Linear algebra routines → BLAS: uses
- Unit tests → Linear algebra API: tests
- Learner → Leaky database demo: runs
- Learner → Valgrind: debugs with
- Learner → Coverage workflow: generates
