Functions | |
list | CombIdxList (counter Count, counter Choose) |
Returns a list of all index combinations according to the expression 'n choose k'. | |
void | InsList (list lL, counter iWhere, list lM) |
This function inserts a given list in a list. | |
void | InsList (list lL, counter iWhere, counter iCount) |
This function inserts a given number of entries in a list. | |
list | List (string sText, string sDel) |
Generates a list of substrings from a strings by cutting the string at delimiter strings. | |
list | List (matrix mA) |
Generates a nested list of the components of a matrix. | |
list | List (multivector vA) |
Generates a list of the components of a multivector. | |
list | List (counter iSize) |
Generates a list of size iSize. | |
list | PermIdxList (counter Count, counter Choose) |
Returns a list of index permutations that are necessary to select all possible sublists of a certain length from a given set. | |
void | RemList (list L, list F) |
Removes selected elements from a given list. | |
list | RemList (list L, counter First, counter Count) |
Removes a sublist from a list. | |
list | SubList (list L, list F) |
Returns a sublist extracted from a given list. | |
list | SubList (list L, counter First, counter Count) |
Returns a sublist extracted from a given list. | |
list | TransList (list lL, counter iLevel) |
Transposition of list elements. |
|
Returns a list of all index combinations according to the expression 'n choose k'.
?CombIdxList(4,2); results in
Constant = [[[1], [2]], [[1], [3]], [[1], [4]], [[2], [3]], [[2], [4]], [[3], [4]]] |
|
This function inserts a given list in a list.
?lL = [1,2,3]; InsList(lL, 2, [5,6]); ?lL; Output:
lL (3)=
|
|
This function inserts a given number of entries in a list.
?lL = [1,2,3]; InsList(lL, 2, 2); ?lL; Output:
lL (3)=
|
|
Generates a list of substrings from a strings by cutting the string at delimiter strings.
?lL = List("Hello World this is a test!", " "); Output:
lL (6)=
This functionality can be particularly useful when analysing a list of numbers read in from a text file. For example,
Output:
lL (3)=
|
|
Generates a nested list of the components of a matrix.
Output:
Constant (2)=
|
|
Generates a list of the components of a multivector.
Output:
lVec (8)=
|
|
Generates a list of size iSize.
|
|
Returns a list of index permutations that are necessary to select all possible sublists of a certain length from a given set.
CombIdxList are enclosed in the return of function PermIdxList . Thus if ![]() CombIdxList , then ![]() ![]() ![]() ![]() ![]() PermIdxList . Therefore the expression ?PermIdxList(3,2); results in
Constant = [[[1], [2]], [[2], [1]], [[1], [3]], [[3], [1]], [[2], [3]], [[3], [2]]] |
|
Removes selected elements from a given list.
The example results in L = [8, 7, 6, 5, 4] L = [8, 7, 5, 4] L = [7, 4] |
|
Removes a sublist from a list.
? L = [ 8,7,6,5,4,3 ]; RemList(L, 4,-1 ); // remove, starting with 4th element, up to the end ? L; RemList(L, 1,2 ); // remove, starting with 1st element, two elements ? L; This code produces the following output. L = [8, 7, 6, 5, 4] L = [8, 7, 6] L = [6] |
|
Returns a sublist extracted from a given list.
f = [ 1,2 ] in F stands e.g. for 'Take the 2nd element of the 1st element of L', that is L(1)(2) . The result might be a scalar or still a sublist. Note that this function has an equivalent expressiveness as the bracket operator ( ) applied to lists. Here is a comprehensive example,
? L = [ [ [3,1],[9,1,0] ],[ -2,7,1,8 ] ]; ? S = SubList(L, [ 1,2 ]); // = SubList(L, [ [1], [2] ]); ? S = SubList(L, [ [1,2] ]); ? S = SubList(L, [ [1,2,3] ]); ? S = SubList(L, [ [1,1,1],[2,1] ]); // = L([ [1,1,1], [2,1] ]); This code produces the following output.
L = [[[3, 1], [9, 1, 0]], [-2, 7, 1, 8]] S = [[[3, 1], [9, 1, 0]], [-2, 7, 1, 8]] S = [[9, 1, 0]] S = [0] S = [3, -2] |
|
Returns a sublist extracted from a given list.
This code produces the following output.
L = [1, 2, 3, 4, 5] Constant = [2, 3, 4] Constant = [2, 3, 4, 5] |
|
Transposition of list elements.
?lL = [[1], [2], [3]]; ?lM = TransList(lL); Output:
lL (3)=
If the list
?lL = [[1,2], [3,4,5], [6,7]]; ?lM = TransList(lL); Output:
lL (3)=
The optional parameter iLevel sets the level at which the transpose is to be executed. This only has an effect for multiply nested lists. Consider the following example.
?lL = [ [[1,2], [3,4], [5,6]], [[7,8], [9,10], [11,12]] ]; ?lM1 = TransList(lL); ?lM2 = TransList(lL, 1); Output:
lL (2)=
|