6#include <memory_resource>
7#include <nk/value/fn_handle.hpp>
8#include <nk/value/span.hpp>
9#include <nk/value/value.hpp>
19namespace nk::runtime {
21void registerStructuresRuntime(Engine &engine);
22void registerStructfunCallbackBuiltin(Engine &engine);
47 std::pmr::memory_resource *mr =
nullptr);
67 std::pmr::memory_resource *mr =
nullptr);
79 std::pmr::memory_resource *mr =
nullptr);
99 std::pmr::memory_resource *mr =
nullptr);
Core MATLAB-compatible multidimensional array and scalar value type.
Value fieldnames(const Value &s, std::pmr::memory_resource *mr=nullptr)
Field names of a struct (fn = fieldnames(s)).
Value structure(std::pmr::memory_resource *mr=nullptr)
Empty struct scalar (s = struct()).
Value getfield(const Value &s, const Value &name, std::pmr::memory_resource *mr=nullptr)
Gets the value of specified field in structure (v = getfield(s, 'field')).
Value setfield(const Value &s, const Value &name, const Value &value, std::pmr::memory_resource *mr=nullptr)
Sets the value of specified field in structure (s = setfield(s, 'field', val)).
Value orderfields(const Value &s, std::pmr::memory_resource *mr=nullptr)
Orders fields of structure array alphabetically (s = orderfields(s)).
Value rmfield(const Value &s, const Value &name, std::pmr::memory_resource *mr=nullptr)
Remove a field from a struct (s2 = rmfield(s, name)).
Value struct2cell(const Value &s, std::pmr::memory_resource *mr=nullptr)
Converts structure array to cell array of field values (c = struct2cell(s)).
Value isfield(const Value &s, const Value &name, std::pmr::memory_resource *mr=nullptr)
Test for field existence (tf = isfield(s, name)).
Value structfun(FnHandle fn, const Value &s, bool uniformOutput, std::pmr::memory_resource *mr=nullptr)
Apply a function handle to every field of a struct (y = structfun(fn, s, uniformOutput)).