Set Functions

Revision as of 17:57, 30 March 2010 by Lchrisman (talk | contribs) (Created page with 'Category:Set Functions ''new to Analytica 4.3'' In mathematics, a ''set'' is a collection of non-repeated elements. The functions described on this page operate on sets tha…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

new to Analytica 4.3

In mathematics, a set is a collection of non-repeated elements. The functions described on this page operate on sets that are represented in Analytica as a reference to list or 1-D array. With this representation, a set is seen as an atomic element by Analytica's array abstraction, thus allowing all these functions to fully array abstract even when the collections comprising the sets are of different lengths or have different indexes.

The following demonstrates this representation:

Var A_list := ['a','b','c','d'];
Var A_set := \A_list;
...

The backslash in front of A_list turns the list into a set in the manner expected by functions here.

Suppose you have a 4-dimensional array, A, indexed by In1, In2, In3 and In4. The expression \[In4]A returns a 3-D array of sets, each set being one of the vectors indexed by In4. As seen, when using the reference operator, \ you can specify in brackets which index becomes the set dimension.

To create a set from a literal list, you must either specify the Null dimension to the reference operator, or you must surround the brackets by parentheses. You cannot simply place a backslash in front of a literal list, since the backslash operator sees brackets and assumes that the brackets are specifying the indexes to swallow. Here are two examples of how to express a literal set:

\[[[Null]]][1,2,3]
\([1,2,3])


SetContains

Function SetContains( set, element )

Returns true if element is contained in the set.

SetIntersection

Function SetUnion( sets, I, resultIndex, keepNulls )

SetUnion

Function SetUnion( sets, I, resultIndex, keepNulls )

SetDifference

Function SetDifference( originalSet, remove, remove, remove, ..., resultIndex, keepNull)
Comments


You are not allowed to post comments.