write static method

void write(
  1. String path,
  2. String key,
  3. Map<String, CachedMatrix> matrices
)

Writes matrices to path under key, through a temporary file and a rename so a reader never maps a half-written cache.

Implementation

static void write(
  String path,
  String key,
  Map<String, CachedMatrix> matrices,
) => writeEach(path, key, [
  for (final MapEntry(key: name, value: m) in matrices.entries)
    (name, m.format, m.rows, m.cols),
], (name) => matrices[name]!);