Jay Foad & Adám Brudzewsky

Slides:



Advertisements
Similar presentations
V14 New Features Dan Baronet. Many new features V14 is probably the release of Dyalog with the most new features.
Advertisements

CTS130 Spreadsheet Lesson 13 Working with Lists. Copying Data between Workbooks  Use the [Copy ]and [Paste] Buttons  Use the CTRL+[C] and CTRL + [V]
Introduction to Artificial Intelligence Lecture 2: Perception & Action
Parallel Programming with v14.0. Parallel Paths to Parallel Performance 1.Parallel Compiler Research –”Concurrent Dfns Compiler” targets fine-grained.
Fall CIS 764 Database Systems Engineering L6a: Usability - Part 1 (Part 2 … case studies) L6b. Review of Homeworks (next.
Scheme & Functional Programming. ( ) >> 64 ( ) >> 666 (* ) >> 1200 (+ (* 3 5) (- 10 6)) >> 19.
Technical Road Map Morten Kromberg 0. 1 (Same Old) Focus Areas -Performance -(includes parallel computing) -Portability -(includes user interfaces) -Language.
Types in APL – The SimCorp Way Dyalog User Conference 2007 Lars Stampe Villadsen, SimCorp A/S (Denmark)
Microsoft Office XP Illustrated Introductory, Enhanced Tables and Queries Using.
Understand Tables and How to Create Them Database Administration Fundamentals LESSON 2.2.
Fall 2008Simple Parallel Algorithms1. Fall 2008Simple Parallel Algorithms2 Scalar Product of Two Vectors Let a = (a 1, a 2, …, a n ); b = (b 1, b 2, …,
Basic Java Syntax Comments Basic data types Operators and assignment.
New Language Features For Parallel and Asynchronous Execution Morten Kromberg Dyalog LTD Dyalog’13.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
#DYNA16 vecdb The Dyalog Vector Database Workshop W2: Managing Data with Dyalog Morten Kromberg, CXO.
#DYNA16 Dyalog Version 15.0 Highlights Jay Foad, John Daintree Dan Baronet, Brian Becker Morten Kromberg.
EGI-InSPIRE RI EGI-InSPIRE EGI-InSPIRE RI Storage Accounting John Gordon, STFC OMB August 2013.
Parallel Programming With Futures and Isolates Morten Kromberg, CXO.
A FIRST BOOK OF C++ CHAPTER 7 ARRAYS. OBJECTIVES In this chapter, you will learn about: One-Dimensional Arrays Array Initialization Arrays as Arguments.
Copyright © 2014, 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Eighth Edition by Tony Gaddis,
9/27/2016IT 1791 Abstraction A tool (concept) to manage complexity Hide irrelevant details; focus on the features needed Primitive date types are already.
Matrices and Vector Concepts
Excel IF Function.
dr Robert Kowalczyk WMiI UŁ
12-1 Organizing Data Using Matrices
Road Map - The User Experience
APPENDIX a WRITING SUBROUTINES IN C
Context-Sensitive Analysis
ITEC324 Principle of CS III
Data Structure Interview Question and Answers
MATHEMATICS Matrix Algebra
Documentation Need to have documentation in all programs
School of Computer Science and Engineering
V15 new features Ce printemps Dyalog annonce les nouveautes Salutations. Presentations.
Objectives Identify the built-in data types in C++
PRG 410 Competitive Success-- snaptutorial.com
PRG 410 Education for Service-- snaptutorial.com
PRG 410 Teaching Effectively-- snaptutorial.com
PRG 410 knowledge is divine-- snaptutorial.com. PRG 410 All Assignments For more classes visit PRG 410 Week 1 Individual Math Tutor.
Cross Platform Charting
7.3 Matrices.
Object Oriented Programming COP3330 / CGS5409
Fun with Total Array Ordering (TAO)
Hash Tables.
Updating GML datasets S-100 WG TSM September 2017
Webinar # April 2017 Isolates in the Cloud
Use of Mathematics using Technology (Maltlab)
Teach A level Computing: Algorithms and Data Structures
Topic 26 Two Dimensional Arrays
Proposed Version 16.0 Language Features
Recitation Outline C++ STL associative containers Examples
By Rarihwenhawi LaFrance and Allen Stauffer
Jupyter Notebooks in Dyalog APL
Stack A data structure in which elements are inserted and removed only at one end (called the top). Enforces Last-In-First-Out (LIFO) Uses of Stacks Evaluating.
APL Code Golf Autumn Tournament
April May April May June July July June August Sept August
Data Structure and Algorithms
Arrays An array is a grouping of elements of the same type that share a common base name Can have any number of elements in the array Individual elements.
Review for Final Exam.
DSTU Update Process C-CDA R2.1.
Elementary Linear Algebra
Matrix Addition
Outline Announcements Differences between FORTRAN and C
TransCAD Working with Matrices 2019/4/29.
Linked List Intro CSCE 121.
Types and Related Issues
ITEC324 Principle of CS III
Introduction to Matrices
Survey Results Respondents: 39 of 51 – 76%
Excel-eration Webinar
Presentation transcript:

Jay Foad & Adám Brudzewsky Total Array Ordering Jay Foad & Adám Brudzewsky 大道至簡   ⍒⍋

Grading ⍋'APL' 1 3 2

Grading ⍋'APL' 1 3 2

Grading [1,2,3] ⍋'APL' 1 3 2 'A' 'L' 'P' ⍨

Major Cells: Vector ┌→──┐ │APL│ └───┘

Major Cells: Matrix ┌→──┐ ↓AAA│ │PPP│ │LLL│ └───┘

Major Cells: Cube ┌→──┐ ↓AAA│ │AAA│──┐ │AAA│PP│ └───┘PP│──┐ │PPP│LL│ └───┘LL│ │LLL│ └───┘

Major Cells: mat ┌→─────┐ ↓John │ │Roger │ │Adam │ │Morten│ │Jay │ └──────┘

Major Cells: mat ⍋mat ┌→─────┐ 3 5 1 4 2 ↓John │ │Roger │ │Adam │ │Morten│ │Jay │ └──────┘

Major Cells: mat ⍋mat ┌→─────┐ 3 5 1 4 2 ↓John │ │Roger │ │Adam │ │Morten│ │Jay │ └──────┘

Major Cells: mat mat[⍋mat;] ┌→─────┐ ┌→─────┐ ↓John │ ↓Adam │ │Roger │ │Jay │ │Adam │ │John │ │Morten│ │Morten│ │Jay │ │Roger │ └──────┘ └──────┘

Sorting mat[⍋mat;] {(⊂⍋⍵)⌷⍵} mat

Sorting mat[⍋mat;] {(⊂⍋⍵)⌷⍵} mat

Sorting mat[⍋mat;] {(⊂⍒⍵)⌷⍵} mat

Sorting mat[⍋mat;] Sort ← {(⊂⍋⍵)⌷⍵}

Sorting mat[⍋mat;] Sort ← {(⊂⍋⍵)⌷⍵} Sort mat

Sorting mat[⍋mat;] Sort ← {(⊂⍋⍵)⌷⍵} Sort mat Adam Jay John Morten Roger

Sorting n ← 'Roger' 'Adam' 'Jay'

Sorting n ← 'Roger' 'Adam' 'Jay' Sort n ⍝ 16.0

Sorting n ← 'Roger' 'Adam' 'Jay' Sort n ⍝ 16.0 DOMAIN ERROR

Sorting n ← 'Roger' 'Adam' 'Jay' Sort n ⍝ 16.0 DOMAIN ERROR Sort n ⍝ 17.0

Sorting n ← 'Roger' 'Adam' 'Jay' Sort n ⍝ 16.0 DOMAIN ERROR Sort n ⍝ 17.0 ┌────┬───┬─────┐ │Adam│Jay│Roger│ └────┴───┴─────┘

⍝ That's all, folks!

Total Array Ordering

History 'Morten' 'Roger '

History 'Morten' 'Roger▉'

History A ← 'Morten' B ← 'Roger▉'

History A ← 'Morten' B ← 'Roger▉' ⍋ A ,[0.5] B 1 2

History A ← 'Morten' B ← 'Roger▉' ⍋ A ,[0.5] B 1 2 'Morten' ≺ 'Roger▉'

Total Array Ordering some other ≺ ? array array

Total Array Ordering How would you order: ⎕ ← 0 'Jay' (2 3⍴'DYALOG') (⍳9) ┌→──────────────────────────────────┐ │ ┌→──┐ ┌→──┐ ┌→────────────────┐ │ │ 0 │Jay│ ↓DYA│ │1 2 3 4 5 6 7 8 9│ │ │ └───┘ │LOG│ └~────────────────┘ │ │ └───┘ │ └∊──────────────────────────────────┘

Total Array Ordering How would you order: ⎕ ← 0 'Jay' (2 3⍴'DYALOG') (⍳9) ┌→──────────────────────────────────┐ │ ┌→──┐ ┌→──┐ ┌→────────────────┐ │ │ 0 │Jay│ ↓DYA│ │1 2 3 4 5 6 7 8 9│ │ │ └───┘ │LOG│ └~────────────────┘ │ │ └───┘ │ └∊──────────────────────────────────┘

TAO

TAO Rules

TAO some other ≺ ? array array

TAO some other ≺ ? array array

TAO some other ≺ ? array array no refs no refs

TAO Rules

TAO Rules Compatibility: simple arrays

TAO Rules Compatibility: simple arrays Consistency: (⍺≼⍵)∧(⍵≼⍺) ⇔ ⍺=⍵

TAO Rules Compatibility: simple arrays Consistency: (⍺≼⍵)∧(⍵≼⍺) ⇔ ⍺=⍵ ⍺≡⍵

TAO Rules Compatibility: simple arrays Consistency: (⍺≼⍵)∧(⍵≼⍺) ⇔ ⍺=⍵ ⍺≡⍵ ⍬≢''

TAO Rules: simple scalars

TAO Rules: simple scalars character vs character: ✓

TAO Rules: simple scalars character vs character: ✓ real number vs real number: ✓

TAO Rules: simple scalars character vs character: ✓ real number vs real number: ✓ complex: 1 ≺ 1J1 ≺ 2J¯1 ≺ 2

TAO Rules: simple scalars character vs character: ✓ real number vs real number: ✓ complex: 1 ≺ 1J1 ≺ 2J¯1 ≺ 2 number vs character: 100 ≺ 'A'

TAO Rules: simple scalars character vs character: ✓ real number vs real number: ✓ complex: 1 ≺ 1J1 ≺ 2J¯1 ≺ 2 number vs character: 100 ≺ 'A' null: ⎕NULL ≺ ¯100

TAO Rules: simple scalars ⎕NULL ≺ ¯1 ≺ 0J¯2 ≺ 0 ≺ 0J2 ≺ 1 ≺ 'A'

TAO Rules: same shape

TAO Rules: same shape ┌→───┐ ┌→───┐ │Jay▉│ │John│ └────┘ └────┘

TAO Rules: same shape ┌→───┐ ┌→───┐ │Jay▉│ │John│ └────┘ └────┘

TAO Rules: same shape ┌→───┐ ┌→───┐ │Jay▉│ │John│ └────┘ └────┘ ┌→─────────┐ ┌→─────────┐ │ ┌→─┐ │ │ ┌→─┐ │ │ │JF│ 3 1 │ │ │JD│ 2 7 │ │ └──┘ │ │ └──┘ │ └∊─────────┘ └∊─────────┘

TAO Rules: same shape ┌→───┐ ┌→───┐ │Jay▉│ │John│ └────┘ └────┘ ┌→─────────┐ ┌→─────────┐ │ ┌→─┐ │ │ ┌→─┐ │ │ │JF│ 3 1 │ │ │JD│ 2 7 │ │ └──┘ │ │ └──┘ │ └∊─────────┘ └∊─────────┘

TAO Rules: different shape CAN CAR CARPENTER CARPET CAT

TAO Rules: different shape CAN CAR CARPENTER CARPET CAT

TAO Rules: different shape CAR CARPENTER

TAO Rules: different shape CAR CARPENTER

TAO Rules: different shape CAR CARPENTER

TAO Rules: different shape CAN CAR CARPENTER CARPET CAT

TAO Rules: different shape CAN CAR CARPENTER CARPET CAT

TAO Rules: different shape ↑'CAR' 'CARPENTER'

TAO Rules: different shape ↑'CAR' 'CARPENTER' CAR▉▉▉▉▉▉ CARPENTER

TAO Rules: different shape ↑'CAR' 'CAR␀␀␀␀␀␀' CAR▉▉▉▉▉▉ CAR␀␀␀␀␀␀

TAO Rules: different shape ⍋↑'CAR' 'CAR␀␀␀␀␀␀' 2 1

TAO Rules: different shape ⍋↑'CAR' 'CAR␀␀␀␀␀␀' 2 1

TAO Rules: different shape 1 2 3 1 2 3 4

TAO Rules: different shape ¯1 ¯2 ¯3 ¯1 ¯2 ¯3 ¯4

TAO Rules: different shape ¯1 ¯2 ¯3 ¯1 ¯2 ¯3 ¯4

TAO Rules: different shape ↑(¯1 ¯2 ¯3) (¯1 ¯2 ¯3 ¯4)

TAO Rules: different shape ↑(¯1 ¯2 ¯3) (¯1 ¯2 ¯3 ¯4) ¯1 ¯2 ¯3 0 ¯1 ¯2 ¯3 ¯4

TAO Rules: different shape ⍋↑(¯1 ¯2 ¯3) (¯1 ¯2 ¯3 ¯4)

TAO Rules: different shape ⍋↑(¯1 ¯2 ¯3) (¯1 ¯2 ¯3 ¯4) 2 1

TAO Rules: different shape ⍋↑(¯1 ¯2 ¯3) (¯1 ¯2 ¯3 ¯4) 2 1

TAO Rules: different shape ¯∞

TAO Rules: different shape ¯∞ ≺ ⎕NULL ≺ ¯1 ≺ 0J¯2 ≺ 0 ≺ 0J2 ≺ 1 ≺ 'A'

TAO Rules: different shape CAR¯∞¯∞¯∞¯∞¯∞¯∞ CARPENTER

TAO Rules: different shape CAR¯∞¯∞¯∞¯∞¯∞¯∞ CARPENTER

TAO Rules: different shape 1 2 1 2 3 1 2

TAO Rules: different shape 1 2 ¯∞ 1 2 3 1 2 ¯∞ ¯∞ ¯∞ ¯∞

TAO Rules: different shape 1 2 ¯∞ 1 2 3 1 2 ¯∞ ¯∞ ¯∞ ¯∞

TAO Rules: different shape 1 2 ¯∞ 1 2 3 1 2 ¯∞ ¯∞ ¯∞ ¯∞ ≺

TAO Rules: different rank ┌→──┐ ┌→────┐ │APL│ ↓Adam │ └───┘ │Jay │ │Roger│ └─────┘

TAO Rules: different rank ┌→──┐ ┌→────┐ ↓APL│ ↓Adam │ └───┘ │Jay │ │Roger│ └─────┘

TAO Rules: different rank ┌→────┐ ┌→────┐ ↓APL¯∞¯∞│ ↓Adam │ │¯∞¯∞¯∞¯∞¯∞│ │Jay │ │¯∞¯∞¯∞¯∞¯∞│ │Roger│ └─────┘ └─────┘

TAO Rules: different rank ┌→────┐ ┌→────┐ ↓APL¯∞¯∞│ ↓Adam │ │¯∞¯∞¯∞¯∞¯∞│ │Jay │ │¯∞¯∞¯∞¯∞¯∞│ │Roger│ └─────┘ └─────┘

TAO Rules: different rank ┌→──┐ ┌→──┐ │APL│ ↓APL│ └───┘ └───┘

TAO Rules: different rank ┌→──┐ ┌→──┐ ↓APL│ ↓APL│ └───┘ └───┘

TAO Rules: different rank ┌→──┐ ┌→──┐ │APL│ ↓APL│ └───┘ └───┘ 1 2

TAO Rules: different rank scalar vector 'A' 'APL' A APL vector 1-row matrix 3⍴'APL' 1 3⍴'APL' APL APL

TAO Rules: recap simple scalars ⎕NULL ≺ nums ≺ chars same shape item-by-item in ravel order unequal shape pad with ¯∞ unequal rank prefix shape with 1s

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴''

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴''

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴'' 2 0 3⍴⍬ 2 0 3⍴''

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴'' ⍬ prototypical items '' or 2 0 0 original shapes 0 0 3 ?

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴'' ⍬ prototypical items '' 2 0 0 original shapes 0 0 3

TAO Rules: empty arrays 2 0 0⍴⍬ 0 0 3⍴⍬ ⍬ prototypical items ⍬ 2 0 0 original shapes 0 0 3

TAO Rules simple scalars ⎕NULL ≺ nums ≺ chars same shape item-by-item in ravel order unequal shape pad with ¯∞ unequal rank prefix shape with 1s both empty type then shape

TAO Scope ⍋⍵ ⍒⍵ ⍺⍸⍵

TAO: a true team effort Arthur Whitney initial suggestion Roger Hui TAO of J John Scholes model: dfns.dyalog.com/n_le.htm Roger Hui Dyalog implementation Adám Brudzewsky, Roger Hui, Jay Foad, John Scholes, Morten Kromberg

TAO: a true team effort Arthur Whitney initial suggestion Roger Hui TAO of J John Scholes model: dfns.dyalog.com/n_le.htm Roger Hui Dyalog implementation Adám Brudzewsky, Roger Hui, Jay Foad, John Scholes, Morten Kromberg

TAO: a true team effort Arthur Whitney initial suggestion Roger Hui TAO of J John Scholes model: dfns.dyalog.com/n_le.htm Roger Hui Dyalog implementation Adám Brudzewsky, Roger Hui, Jay Foad, John Scholes, Morten Kromberg

TAO: a true team effort Arthur Whitney initial suggestion Roger Hui TAO of J John Scholes model: dfns.dyalog.com/n_le.htm Roger Hui Dyalog implementation Adám Brudzewsky, Roger Hui, Jay Foad, John Scholes, Morten Kromberg

TAO: a true team effort Arthur Whitney initial suggestion Roger Hui TAO of J John Scholes model: dfns.dyalog.com/n_le.htm Roger Hui Dyalog implementation Adám Brudzewsky, Roger Hui, Jay Foad, John Scholes, Morten Kromberg

Demo Features coming in version 17.0…

Demo Phonebook Record Insertion ]load /tao/pb Sort ← {(⊂⍋⍵)⌷⍵} Sort pb pb ← Sort pb new ← 'Kromberg' 'Morten' 584 pb ⍸ new (2↑pb)⍪new⍪(2↓pb) 2(↑⍪new⍪↓)pb Into ← {(⍵⍸⍺)(↑⍪⍺⍪↓)⍵} new Into pb Spreadsheet Data Types ss ← (⎕NEW⊂'Clipboard').Array Sort ss ss[⍋ss[;1 3];] Natural Sorting )clear ]load /tao/names Digits ← {⍵∊⎕D} Digits 'my10b' CutOffs ← {1,2≠/Digits ⍵} CutOffs 'my10b' Parts ← {(CutOffs ⍵)⊂⍵} Parts 'my10b' ExecNums ← {∧/Digits ⍵:⍎⍵ ⋄ ⍵} ExecNums¨Parts 'my10b' Order ← {⍋ExecNums¨∘Parts¨⍵} Order names NatSort ← {(⊂Order ⍵)⌷⍵} NatSort names ]defs -topdown

Features coming in version 17.0 Grade and Sort anyno refs Array {(⊂⍋⍵}⌷⍵} for all ranks – fast! ⍋⍵ ⍒⍵ ⍺⍸⍵

Webinars on Thursdays at 15:00 UTC Comment and suggest to webinar@dyalog.com or @Adám in chat.stackexchange.com/rooms/52405 April 19 APL Processes and Isolates in the Clouds May 17 to be announced June 21 to be announced General APL Questions stackoverflow.com