.. _val-concepts: Concepts and model ================== VAL provides the native value containers used by the higher-level modules. It is the scientific-data value layer: a scalar or array has a data type, a shape, storage, and a set of operations that produce new values or update an existing value in place. Value hierarchy --------------- ``BaseValue`` is the polymorphic base for every value. It exposes the data type, shape, size, textual formatting, cloning, casting, slicing, and arithmetic operations. Owned values use ``BaseValue::PointerType``, an alias for ``std::unique_ptr``. ``BaseArrayValue`` stores flattened data in an internal array container. ``ArrayValue`` supplies the typed constructors and operations. Public concrete types such as ``ArrayValueFloat64``, ``ArrayValueInt64``, ``ArrayValueBool``, and ``ArrayValueStr`` name the common specializations. Scalars and arrays ------------------ A scalar constructor creates a value with shape ``{1}``. An array constructor accepts the flattened data and an explicit shape. The shape is metadata; callers that construct an array directly must keep its element count consistent with the shape they pass. Numeric storage is canonicalized by category. Signed integers are stored as 64-bit values, unsigned integers as 64-bit values, ``Float32`` and ``Float64`` as doubles, and ``Float128`` as a long-double value. The exposed ``DataType`` records the intended public type, while the storage type determines the conversion and arithmetic implementation. Operations ---------- Arithmetic and conversion return new owned values. The ``math_*_equal`` methods update a value in place, and ``cast_as`` returns a new value with the requested data type. Shape and type mismatches raise VAL exceptions rather than silently coercing unsupported combinations. Formatting is controlled by ``snt::core::StringFormatType``. The value layer adds array delimiters, string quoting, and shape-aware rendering on top of the CORE number formatter. Continue with :doc:`Getting started ` for a typed value and its text representation, or :doc:`Workflows ` for arithmetic, casting, and inspection.