🧮 MATLAB THAUMATURGY DIFFICULTY: Apprentice Behavioral

The Memento of Temporal Snapshots

Capture and restore the internal state of a volatile matrix.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Divination // Chronomancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATLAB PATTERN //
classdef MatrixMemento
    properties (SetAccess = private)
        State
    end
    methods
        function obj = MatrixMemento(state)
            obj.State = state;
        end
    end
end

classdef VolatileMatrix < handle
    properties
        Data
    end
    methods
        function memento = save(obj)
            memento = MatrixMemento(obj.Data);
        end
        function restore(obj, memento)
            obj.Data = memento.State;
        end
    end
end

Memento

Preserve the ethereal configuration of your spell so that if it unravels, time may be reversed.

Runic Tags: #memento #chronomancy #state