The Full Wiki

More info on Yorick (programming language)

Yorick (programming language): Wikis


Note: Many of our articles have direct quotes from sources you can cite, within the Wikipedia article! This article doesn't yet, but we're working on it! See more info or our list of citable articles.


From Wikipedia, the free encyclopedia

Usual file extensions .i
Appeared in 1996
Designed by David H. Munro
Stable release 2.1.05 (January 10, 2008)
OS Unix, Linux, Mac, Windows
License BSD
Website Yorick Home Page

Yorick is an interpreted programming language designed for numerics, graph plotting and steering large scientific simulation codes. It is quite fast due to array syntax, and extensible via C or Fortran routines. It was created in 1996 by David H. Munro of Lawrence Livermore National Laboratory.


  • Indexing

Yorick is good at manipulating elements in N-dimensional arrays conveniently with its powerful syntax.

Range of indices

Several elements can be accessed all at once:

> x=[1,2,3,4,5,6];
> x
> x(3:6)
> x(3:6:2)
> x(6:3:-2)
Arbitrary elements
> x=[[1,2,3],[4,5,6]]
> x
> x([2,1],[1,2])
> list=where(1<x)
> list
> y=x(list)
> y

Like "theading" in PDL(Perl Data Language) and "broadcasting" in Numpy ( Numeric extension for Python), Yorick has a mechanism to do this:

> x=[1,2,3]
> x
> y=[[1,2,3],[4,5,6]]
> y
> y(-,)
> x(-,)
> x(,-)
> x(,-)/y
> y=[[1.,2,3],[4,5,6]]
> x(,-)/y
Rubber index

".." is a rubber-index to represent zero or more dimensions of the array.

> x=[[1,2,3],[4,5,6]]
> x
> x(..,1)
> x(1,..)
> x(2,..,2)

"*" is a kind of rubber-index to reshape a slice(sub-array) of array to a vector.

> x(*)
Tensor multiplication

Tensor multiplication is done as follows in Yorick:


means \sum_{j=1}^{j=N}{P_{ijkl}Q_{mnj}}

> x=[[1,2,3],[4,5,6]]
> x
> y=[[7,8],[9,10],[11,12]]
> x(,+)*y(+,)
> x(+,)*y(,+)

External links

Got something to say? Make a comment.
Your name
Your email address