Changes

Jump to: navigation, search

GPU621/Chapel

1,054 bytes added, 23:02, 29 November 2022
Range
const r = 1..10, // 1, 2, 3, ..., 10
r2 = 0..n, // 0, 1, 2, ..., n
r3 = lo-3..hi3; // -3, -2, -1, ..., 3=== Domain ===A domain is a first-class representation of an index set used to specify iteration spaces, define arrays, and aggregate operations such as slicing. var RD: domain(3) = {1..n, 1..n, 1..n};*The expand method returns a new domain that is expanded or contracted depending on the sign of the offset argument.*The exterior method returns a new domain that is the exterior portion of the current domain.*The interior method returns a new domain that is the interior portion of the current domain.*The translate method returns a new domain that is the current domain translated by the offset.*A subdomain is a domain that is declared in terms of a parent domain, causing it to have the same type as their parent. A subdomain represents a subset of its parent domain’s index set, though this constraint is not currently enforced by the implementation.=== Array ===Arrays in Chapel are specified using a square-bracketed expression that specifies the array’s index set, followed by the array’s element type. config const n = 5;
= Reference =
73
edits

Navigation menu