From f407c31be897426395cb288e105d4adbd74a4b1a Mon Sep 17 00:00:00 2001 From: Chris Llanwarne Date: Tue, 18 Oct 2016 11:07:51 -0400 Subject: [PATCH] Added range and transpose functions --- SPEC.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/SPEC.md b/SPEC.md index d72adf9..b8f195d 100644 --- a/SPEC.md +++ b/SPEC.md @@ -87,6 +87,8 @@ * [File write_json(mixed)](#file-write_jsonmixed) * [Float size(File, \[String\])](#float-sizefile-string) * [String sub(String, String, String)](#string-substring-string-string) + * [Array\[Int\] range(Int)](#arrayint-rangeint) + * [Array\[Array\[X\]\] transpose(Array\[Array\[X\]\])](#arrayarrayx-transposearrayarrayx) * [Data Types & Serialization](#data-types--serialization) * [Serialization of Task Inputs](#serialization-of-task-inputs) * [Primitive Types](#primitive-types) @@ -2121,6 +2123,14 @@ Default unit is Bytes ("B"). Given 3 String parameters `input`, `pattern`, `replace`, this function will replace any occurrence matching `pattern` in `input` by `replace`. `pattern` is expected to be a [regular expression](https://en.wikipedia.org/wiki/Regular_expression). Details of regex evaluation will depend on the execution engine running the WDL. +## Array[Int] range(Int) + +Creates an array of integers of length equal to the range argument. For example `range(3)` provides the array: `(0, 1, 2)`. + +## Array[Array[X]] transpose(Array[Array[X]]) + +Transposes a two dimensional array according to the standard matrix transpose rules. For example `transpose( ((0, 1, 2), (3, 4, 5)) )` will return the rotated two-dimensional array: `((0, 3), (1, 4), (2, 5))`. + Example 1: ```wdl