Difference between revisions of "Array Manipulation"

From ZCubes Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 +
*[[ Z%5E3_Map_Reduce | Map Reduce]]
 +
  
  
Line 49: Line 51:
  
 
b=a.chunks(10)
 
b=a.chunks(10)
b.$$(SUM)
+
</br>b.$$(SUM)
  
 
{| class="wikitable"|-
 
{| class="wikitable"|-
Line 74: Line 76:
  
  
*[[ Z3 | << Z3 Home ]]
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
 
==ARRAY FUNCTIONS==
 
A listing of the Array functions are given below:
 
 
Function name  Parameter
 
{|border="1" cellpadding="5" cellspacing="0"
 
|-
 
! Function Name !! Parameters
 
|-
 
| [[Array.$()|$]] ||
 
|-
 
| [[Array.$$()|$$]] ||
 
|-
 
| [[Array.$$$()|$$$]] ||
 
|-
 
| [[Array.$$F()|$$F]] ||
 
|-
 
| [[Array.$A()|$A ]] || Parameter
 
|-
 
| [[Array.$C()|$C ]] ||
 
|-
 
| [[Array.$CELLS()|$CELLS ]] ||
 
|-
 
| [[Array.$d()|$d ]] ||
 
|-
 
| [[Array.$diag()|$diag ]] ||
 
|-
 
| [[Array.$dth()|$dth ]] ||
 
|-
 
| [[Array.$R()|$R ]] ||
 
|-
 
| [[Array.$X()|$X ]] ||
 
|-
 
| [[Array.$x()|$x ]] ||
 
|-
 
| [[Array.$_()|$_]] ||
 
|-
 
| [[Array.__$()|__$ ]] ||
 
|-
 
| [[Array.ac()|ac ]] ||
 
|-
 
| [[Array.accumulate()|accumulate ]] || Total
 
|-
 
| [[Array.accumulatewith()|accumulatewith ]] || "CumulateFunction,CurrentResult"
 
|-
 
| [[Array.across()|across ]] || "OtherArray, Function"
 
|-
 
| [[Array.add()|add ]] || Thing
 
|-
 
| [[Array.addcolumn()|addcolumn ]] || NumberOfColumns
 
|-
 
| [[Array.addrow()|addrow ]] || NumberOfRows
 
|-
 
| [[Array.addsequence()|addsequence ]] || "InFront,StartFrom,OptionalSequenceArray"
 
|-
 
| [[Array.adjoint()|adjoint ]] || Array
 
|-
 
| [[Array.aggregate()|aggregate ]] || "Columns,Function, Params"
 
|-
 
| [[Array.any()|any ]] || Count
 
|-
 
| [[Array.appendfunction()|appendfunction ]] || Function
 
|-
 
| [[Array.ar()|ar ]] ||
 
|-
 
| [[Array.async()|async ]] || "Iterator, CallBack"
 
|-
 
| [[Array.atindex()|atindex ]] ||
 
|-
 
| [[Array.atnode()|atnode ]] || "Function,SubtractByArray,ScaleByArray,DoNotShowIndices"
 
|-
 
| [[Array.backward()|backward ]] || "Function, StartValue"
 
|-
 
| [[Array.bindcolumn()|bindcolumn ]] ||
 
|-
 
| [[Array.branch()|branch ]] ||
 
|-
 
| [[Array.branchvalues()|branchvalues ]] ||
 
|-
 
| [[Array.c()|c ]] ||
 
|-
 
| [[Array.calci()|calci ]] ||
 
|-
 
| [[Array.car()|car ]] ||
 
|-
 
| [[Array.cartesianproduct()|cartesianproduct ]] || IsWithoutFlatten
 
|-
 
| [[Array.cdr()|cdr ]] ||
 
|-
 
| [[Array.cell()|cell ]] || "Row, Column, Width, Height"
 
|-
 
| [[Array.cells()|cells ]] ||
 
|-
 
| [[Array.checktype()|checktype ]] || "TypeArray,ForceCheckOnVariables"
 
|-
 
| [[Array.chunks()|chunks ]] || ChunkSize
 
|-
 
| [[Array.ci()|ci ]] ||
 
|-
 
| [[Array.clean()|clean ]] || "Expression, ReplaceWith"
 
|-
 
| [[Array.clear()|clear ]] || FillWith
 
|-
 
| [[Array.clearcopy()|clearcopy ]] || FillWith
 
|-
 
| [[Array.clearrepeats()|clearrepeats ]] ||
 
|-
 
| [[Array.clone()|clone ]] ||
 
|-
 
| [[Array.colconcat()|colconcat ]] ||
 
|-
 
| [[Array.colcount()|colcount ]] ||
 
|-
 
| [[Array.collect()|collect ]] ||
 
|-
 
| [[Array.collectasvector()|collectasvector ]] ||
 
|-
 
| [[Array.collectwhile()|collectwhile ]] ||
 
|-
 
| [[Array.collectwhileasvector()|collectwhileasvector ]] ||
 
|-
 
| [[Array.column()|column ]] ||
 
|-
 
| [[Array.columnconcat()|columnconcat ]] ||
 
|-
 
| [[Array.columns()|columns ]] ||
 
|-
 
| [[Array.compare()|compare ]] ||
 
|-
 
| [[Array.concatall()|concatall ]] || "LimitArray, IncludeEdges"
 
|-
 
| [[Array.converge()|converge ]] || "Function, NumberOfIterations, Accuracy, Converge"
 
|-
 
| [[Array.copy()|copy ]] ||
 
|-
 
| [[Array.core()|core ]] ||
 
|-
 
| [[Array.count()|count ]] || FirstLevelOnly
 
|-
 
| [[Array.crosstab()|crosstab ]] || "RowSet, ColSet,PageSet,DataSet"
 
|-
 
| [[Array.cube()|cube ]] ||
 
|-
 
| [[Array.cumcolumn()|cumcolumn ]] ||
 
|-
 
| [[Array.cumcolumns()|cumcolumns ]] ||
 
|-
 
| [[Array.cumcolumnswith()|cumcolumnswith ]] ||
 
|-
 
| [[Array.cumcolumnwith()|cumcolumnwith ]] ||
 
|-
 
| [[Array.cumrow()|cumrow ]] ||
 
|-
 
| [[Array.cumrows()|cumrows ]] ||
 
|-
 
| [[Array.cumrowswith()|cumrowswith ]] ||
 
|-
 
| [[Array.cumrowwith()|cumrowwith ]] ||
 
|-
 
| [[Array.cumulate()|cumulate ]] ||
 
|-
 
| [[Array.data()|data ]] ||
 
|-
 
| [[Array.dc()|dc ]] ||
 
|-
 
| [[Array.deal()|deal ]] || "Within, ManyInEach"
 
|-
 
| [[Array.deepcopy()|deepcopy ]] ||
 
|-
 
| [[Array.deletecolumn()|deletecolumn ]] || Where
 
|-
 
| [[Array.deleterow()|deleterow ]] || Where
 
|-
 
| [[Array.det()|det ]] || Array
 
|-
 
| [[Array.determinant()|determinant ]] ||
 
|-
 
| [[Array.dim()|dim ]] ||
 
|-
 
| [[Array.div()|div ]] ||
 
|-
 
| [[Array.divide()|divide ]] ||
 
|-
 
| [[Array.dr()|dr ]] ||
 
|-
 
| [[Array.drop()|drop ]] ||
 
|-
 
| [[Array.dropwhile()|dropwhile ]] ||
 
|-
 
| [[Array.dropwhileasvector()|dropwhileasvector ]] ||
 
|-
 
| [[Array.eighteenth()|eighteenth ]] ||
 
|-
 
| [[Array.eighth()|eighth ]] ||
 
|-
 
| [[Array.eleventh()|eleventh ]] ||
 
|-
 
| [[Array.equal()|equal ]] || "Array, CheckLength, StartFrom"
 
|-
 
| [[Array.equalvalues()|equalvalues ]] || "Array, CheckLength, StartFrom"
 
|-
 
| [[Array.eval()|eval ]] ||
 
|-
 
| [[Array.except()|except ]] ||
 
|-
 
| [[Array.exec()|exec ]] ||
 
|-
 
| [[Array.explode()|explode ]] || "StartIndex, By, RecurseTillLevel "
 
|-
 
| [[Array.extract()|extract ]] ||
 
|-
 
| [[Array.few()|few ]] ||
 
|-
 
| [[Array.fifteenth()|fifteenth ]] || Function
 
|-
 
| [[Array.fifth()|fifth ]] ||
 
|-
 
| [[Array.fillwith()|fillwith ]] ||
 
|-
 
| [[Array.filtermatches()|filtermatches ]] || "MatchIdenticalMatrix, OnlyMatches"
 
|-
 
| [[Array.filteroncolumn()|filteroncolumn ]] || "Condition, ExtractColumns, FilterOnColumn"
 
|-
 
| [[Array.filteroncondition()|filteroncondition ]] || "TakeDropOrAllFlag, Function, Parameter"
 
|-
 
| [[Array.filteronrow()|filteronrow ]] || "Condition, ExtractColumns, FilterOnColumn"
 
|-
 
| [[Array.findcellref()|findcellref ]] || Values
 
|-
 
| [[Array.first()|first ]] || Count
 
|-
 
| [[Array.firstelement()|firstelement ]] || Count
 
|-
 
| [[Array.firsthalf()|firsthalf ]] ||
 
|-
 
| [[Array.fixat()|fixat ]] || "Index,Fix"
 
|-
 
| [[Array.fjoin()|fjoin ]] || "HeadLength, JoinString"
 
|-
 
| [[Array.flatten()|flatten ]] ||
 
|-
 
| [[Array.flip()|flip ]] ||
 
|-
 
| [[Array.flipparts()|flipparts ]] ||
 
|-
 
| [[Array.fold()|fold ]] || "AtFoldValue, AtReverseFoldValue"
 
|-
 
| [[Array.foldl()|foldl ]] || "Function, StartSeed"
 
|-
 
| [[Array.foldr()|foldr ]] || "Function, StartSeed"
 
|-
 
| [[Array.forward()|forward ]] || "Function, StartValue"
 
|-
 
| [[Array.fourteenth()|fourteenth ]] ||
 
|-
 
| [[Array.fourth()|fourth ]] ||
 
|-
 
| [[Array.fourths()|fourths ]] ||
 
|-
 
| [[Array.funcjoin()|funcjoin ]] || "HeadLength, FindString, FirstString, MidString, LastString"
 
|-
 
| [[Array.gettype()|gettype ]] ||
 
|-
 
| [[Array.graph()|graph ]] || Mode
 
|-
 
| [[Array.graphin()|graphin ]] ||
 
|-
 
| [[Array.half()|half ]] ||
 
|-
 
| [[Array.halves()|halves ]] ||
 
|-
 
| [[Array.hderef()|hderef ]] || Array
 
|-
 
| [[Array.head()|head ]] ||
 
|-
 
| [[Array.headings()|headings ]] ||
 
|-
 
| [[Array.hindex()|hindex ]] ||
 
|-
 
| [[Array.hundredth()|hundredth ]] ||
 
|-
 
| [[Array.i()|i ]] || PreviousArray
 
|-
 
| [[Array.ic()|ic ]] ||
 
|-
 
| [[Array.ids()|ids ]] ||
 
|-
 
| [[Array.implode()|implode ]] || RecurseTillLevel
 
|-
 
| [[Array.inc()|inc ]] ||
 
|-
 
| [[Array.include()|include ]] ||
 
|-
 
| [[Array.indices()|indices ]] || "Function,SubtractByArray,ScaleByArray,DoNotShowIndices,RowArray"
 
|-
 
| [[Array.injoin()|injoin ]] || JoinWith
 
|-
 
| [[Array.insert()|insert ]] || "Value, AfterLastFlag"
 
|-
 
| [[Array.insertcolumn()|insertcolumn ]] || "Index, NumberOfColumns"
 
|-
 
| [[Array.insertrow()|insertrow ]] || "Index, NumberOfRows"
 
|-
 
| [[Array.inverse()|inverse ]] || Array
 
|-
 
| [[Array.ir()|ir ]] ||
 
|-
 
| [[Array.is()|is ]] || "Thing, IsNot"
 
|-
 
| [[Array.is1d()|is1d ]] ||
 
|-
 
| [[Array.is2d()|is2d ]] ||
 
|-
 
| [[Array.isFalse()|isFalse ]] ||
 
|-
 
| [[Array.islikelytype()|islikelytype ]] ||
 
|-
 
| [[Array.isnotnull()|isnotnull ]] ||
 
|-
 
| [[Array.isnull()|isnull ]] ||
 
|-
 
| [[Array.isTrue()|isTrue ]] ||
 
|-
 
| [[Array.istype()|istype ]] ||
 
|-
 
| [[Array.j()|j ]] ||
 
|-
 
| [[Array.joincolumnswith()|joincolumnswith ]] || "ArrayOfJoinCharacters,IsRepeat"
 
|-
 
| [[Array.joinrowswith()|joinrowswith ]] || "ArrayOfJoinCharacters,IsRepeat"
 
|-
 
| [[Array.joinwith()|joinwith ]] ||
 
|-
 
| [[Array.jq()|jq ]] ||
 
|-
 
| [[Array.keep()|keep ]] ||
 
|-
 
| [[Array.last()|last ]] || Count
 
|-
 
| [[Array.lastelement()|lastelement ]] || Count
 
|-
 
| [[Array.list()|list ]] ||
 
|-
 
| [[Array.lookup()|lookup ]] ||
 
|-
 
| [[Array.make()|make ]] ||
 
|-
 
| [[Array.make1to2d()|make1to2d ]] || ReplaceOriginal
 
|-
 
| [[Array.makecore()|makecore ]] ||
 
|-
 
| [[Array.makekeyarray()|makekeyarray ]] || Recursive
 
|-
 
| [[Array.maplist()|maplist ]] || fun
 
|-
 
| [[Array.mapper()|mapper ]] || Function
 
|-
 
| [[Array.maprow()|maprow ]] || Function
 
|-
 
| [[Array.mask()|mask ]] ||
 
|-
 
| [[Array.match()|match ]] || Expression
 
|-
 
| [[Array.matchcolumn()|matchcolumn ]] || "Expression, Column"
 
|-
 
| [[Array.matchindex()|matchindex ]] || "Expression, IndexThenFromMatch"
 
|-
 
| [[Array.matchrow()|matchrow ]] || "Expression, Row"
 
|-
 
| [[Array.matchvalue()|matchvalue ]] || "Expression, IndexThenFromMatch"
 
|-
 
| [[Array.merge()|merge ]] || "OtherArray, Function"
 
|-
 
| [[Array.mergecolumns()|mergecolumns ]] || OtherArray
 
|-
 
| [[Array.mergeio()|mergeio ]] ||
 
|-
 
| [[Array.mergerows()|mergerows ]] ||
 
|-
 
| [[Array.mid()|mid ]] || "From,Count"
 
|-
 
| [[Array.millionth()|millionth ]] ||
 
|-
 
| [[Array.multiply()|multiply ]] ||
 
|-
 
| [[Array.nicejoin()|nicejoin ]] || "JoinString, EndString, SubArrayString"
 
|-
 
| [[Array.nineteenth()|nineteenth ]] ||
 
|-
 
| [[Array.nineth()|nineth ]] ||
 
|-
 
| [[Array.nodeindex()|nodeindex ]] ||
 
|-
 
| [[Array.notinclude()|notinclude ]] || Item
 
|-
 
| [[Array.notwithinlimits()|notwithinlimits ]] || "LimitArray, IncludeEdges"
 
|-
 
| [[Array.nth()|nth ]] || "Nth, Count"
 
|-
 
| [[Array.ntimes()|ntimes ]] || "Function, NumberOfIterations, Accuracy, Converge"
 
|-
 
| [[Array.nullifyobjects()|nullifyobjects ]] || Recursive
 
|-
 
| [[Array.numbers()|numbers ]] || ForceCheckOnVariables
 
|-
 
| [[Array.o()|o ]] ||
 
|-
 
| [[Array.objects()|objects ]] ||
 
|-
 
| [[Array.of()|of ]] ||
 
|-
 
| [[Array.otherthan()|otherthan ]] || ArrayWithElementsToExclude
 
|-
 
| [[Array.pack()|pack ]] ||
 
|-
 
| [[Array.pad()|pad ]] || "Length, PadString"
 
|-
 
| [[Array.pair()|pair ]] || "Value, OnRight"
 
|-
 
| [[Array.pairmatch()|pairmatch ]] || "AtFoldValue, AtReverseFoldValue, StartFrom"
 
|-
 
| [[Array.partitiononcondition()|partitiononcondition ]] || "TakeDropOrAllFlag, Function, Parameter"
 
|-
 
| [[Array.parts()|parts ]] || "NumberOfParts, SpecificPart"
 
|-
 
| [[Array.pastefolds()|pastefolds ]] || MidOnly
 
|-
 
| [[Array.pick()|pick ]] || "StyleString, JoinString"
 
|-
 
| [[Array.pieces()|pieces ]] || " Width, Function"
 
|-
 
| [[Array.pip()|pip ]] ||
 
|-
 
| [[Array.pipall()|pipall ]] ||
 
|-
 
| [[Array.pipallwithslice()|pipallwithslice ]] ||
 
|-
 
| [[Array.plot()|plot ]] ||
 
|-
 
| [[Array.prefix()|prefix ]] ||
 
|-
 
| [[Array.primitives()|primitives ]] ||
 
|-
 
| [[Array.print()|print ]] ||
 
|-
 
| [[Array.printf()|printf ]] ||
 
|-
 
| [[Array.r()|r ]] ||
 
|-
 
| [[Array.rand()|rand ]] ||
 
|-
 
| [[Array.random()|random ]] || "Base,Numbers"
 
|-
 
| [[Array.remove()|remove ]] ||
 
|-
 
| [[Array.removeByVal()|removeByVal ]] || Value
 
|-
 
| [[Array.removeindices()|removeindices ]] ||
 
|-
 
| [[Array.removewith()|removewith ]] ||
 
|-
 
| [[Array.repeatntimes()|repeatntimes ]] || "Function, NumberOfIterations, Accuracy, Converge"
 
|-
 
| [[Array.replace()|replace ]] || "ExpressionArrayOrValues, ReplaceWith"
 
|-
 
| [[Array.replicate()|replicate ]] || Count
 
|-
 
| [[Array.rest()|rest ]] || "Start, Count"
 
|-
 
| [[Array.result()|result ]] ||
 
|-
 
| [[Array.reverselevel()|reverselevel ]] || Level
 
|-
 
| [[Array.reversepip()|reversepip ]] ||
 
|-
 
| [[Array.reversesort()|reversesort ]] || Function
 
|-
 
| [[Array.ri()|ri ]] ||
 
|-
 
| [[Array.rotate()|rotate ]] || NumberOfSteps
 
|-
 
| [[Array.rotatecolumns()|rotatecolumns ]] || NumberOfSteps
 
|-
 
| [[Array.rotaterows()|rotaterows ]] || NumberOfSteps
 
|-
 
| [[Array.row()|row ]] ||
 
|-
 
| [[Array.rowconcat()|rowconcat ]] || OtherArray
 
|-
 
| [[Array.rowcount()|rowcount ]] ||
 
|-
 
| [[Array.rowlengths()|rowlengths ]] || Function
 
|-
 
| [[Array.rowpush()|rowpush ]] || OtherArray
 
|-
 
| [[Array.rows()|rows ]] ||
 
|-
 
| [[Array.rslice()|rslice ]] ||
 
|-
 
| [[Array.second()|second ]] ||
 
|-
 
| [[Array.secondhalf()|secondhalf ]] ||
 
|-
 
| [[Array.seq()|seq ]] || "StartIndex, By"
 
|-
 
| [[Array.set()|set ]] ||
 
|-
 
| [[Array.setaxis()|setaxis ]] || "Axis, ColumnValues"
 
|-
 
| [[Array.setcolumn()|setcolumn ]] || "Column, ColumnValues"
 
|-
 
| [[Array.setHeadings()|setHeadings ]] ||
 
|-
 
| [[Array.setrow()|setrow ]] || "Row, Array"
 
|-
 
| [[Array.setunit()|setunit ]] ||
 
|-
 
| [[Array.seventeenth()|seventeenth ]] ||
 
|-
 
| [[Array.seventh()|seventh ]] ||
 
|-
 
| [[Array.shiftlevel()|shiftlevel ]] || "Level, NumberOfTimes"
 
|-
 
| [[Array.shuffle()|shuffle ]] ||
 
|-
 
| [[Array.sixteenth()|sixteenth ]] ||
 
|-
 
| [[Array.sixth()|sixth ]] ||
 
|-
 
| [[Array.size()|size ]] ||
 
|-
 
| [[Array.size2d()|size2d ]] ||
 
|-
 
| [[Array.slices()|slices ]] || SliceExpression
 
|-
 
| [[Array.slides()|slides ]] ||
 
|-
 
| [[Array.sortrecursively()|sortrecursively ]] ||
 
|-
 
| [[Array.sortwith()|sortwith ]] ||
 
|-
 
| [[Array.specialprint()|specialprint ]] || "Trimmed,TabLevel"
 
|-
 
| [[Array.spliteach()|spliteach ]] || "SplitExpression, RetainSplitterAlsoInResult"
 
|-
 
| [[Array.splitwhile()|splitwhile ]] ||
 
|-
 
| [[Array.splitwhileasvector()|splitwhileasvector ]] ||
 
|-
 
| [[Array.stringlist()|stringlist ]] ||
 
|-
 
| [[Array.subtract()|subtract ]] ||
 
|-
 
| [[Array.suchthat()|suchthat ]] ||
 
|-
 
| [[Array.suchthatasvector()|suchthatasvector ]] ||
 
|-
 
| [[Array.suffix()|suffix ]] ||
 
|-
 
| [[Array.t()|t ]] ||
 
|-
 
| [[Array.table()|table ]] ||
 
|-
 
| [[Array.tablelookup()|tablelookup ]] || "RowValueMatch, ColumnValueMatch"
 
|-
 
| [[Array.tail()|tail ]] ||
 
|-
 
| [[Array.takewhile()|takewhile ]] ||
 
|-
 
| [[Array.takewhileasvector()|takewhileasvector ]] ||
 
|-
 
| [[Array.tenth()|tenth ]] ||
 
|-
 
| [[Array.third()|third ]] ||
 
|-
 
| [[Array.thirds()|thirds ]] ||
 
|-
 
| [[Array.thirteenth()|thirteenth ]] ||
 
|-
 
| [[Array.thousandth()|thousandth ]] ||
 
|-
 
| [[Array.tofunctions()|tofunctions ]] ||
 
|-
 
| [[Array.toobjectformat()|toobjectformat ]] ||
 
|-
 
| [[Array.totree()|totree ]] ||
 
|-
 
| [[Array.transpose()|transpose ]] || IncludeHeader
 
|-
 
| [[Array.truefalse()|truefalse ]] || "IsCheckTrueFunctionList,IsCheckFalseFunctionList,DoFlattenFirst"
 
|-
 
| [[Array.twelfth()|twelfth ]] ||
 
|-
 
| [[Array.twentieth()|twentieth ]] ||
 
|-
 
| [[Array.twod()|twod ]] ||
 
|-
 
| [[Array.type()|type ]] ||
 
|-
 
| [[Array.uncrosstab()|uncrosstab ]] || UptoColumn
 
|-
 
| [[Array.unimplode()|unimplode ]] || RecurseTillLevel
 
|-
 
| [[Array.unimplodeleaf()|unimplodeleaf ]] ||
 
|-
 
| [[Array.unitsof()|unitsof ]] ||
 
|-
 
| [[Array.unwrapleaf()|unwrapleaf ]] ||
 
|-
 
| [[Array.unzip()|unzip ]] ||
 
|-
 
| [[Array.value()|value ]] || Function
 
|-
 
| [[Array.where()|where ]] || Term
 
|-
 
| [[Array.withinlimits()|withinlimits ]] || "LimitArray, IncludeEdges"
 
|-
 
| [[Array.withouttail()|withouttail ]] ||
 
|-
 
| [[Array.X$()|X$ ]] ||
 
|-
 
| [[Array.x$()|x$ ]] || "FunctionArray, OffsetArray, ScaleArray, GiveIndicesAlso,DoCentering"
 
|-
 
| [[Array.xy()|xy ]] ||
 
|-
 
| [[Array.xypanel()|xypanel ]] || "FunctionArray, OffsetArray, ScaleArray, GiveIndicesAlso"
 
|-
 
| [[Array.z3()|z3 ]] ||
 
|-
 
| [[Array.zero()|zero ]] || "ValueInstead, PreserveStructure"
 
|-
 
| [[Array.zip()|zip ]] || OtherArray
 
|-
 
| [[Array.ZJSON()|ZJSON ]] ||
 
|-
 
| [[Array.zoompip()|zoompip ]] ||
 
|-
 
|㪭㭲 ||
 
  
|}
 
  
  
 +
*[[ Z%5E3_Array_Manipulation_Member_Functions | Listing of Z3 Array Manipulation Member Functions]]
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
*[[ Z%5E3_Language_Documentation | Z3 Language Documentation]]
 
*[[ Z3 | << Z3 Home ]]
 
*[[ Z3 | << Z3 Home ]]

Latest revision as of 09:13, 31 December 2021

Introduction to Array Manipulation



Arrays/Sets/Matrices are fundamental data structures in z^3. Manipulation of such data structures are often done using custom code in most languages. However, z^3 offers a ton of Array member functions that make it a breeze to handle and manipulate such data structures.

For example, take .chunks().

a=1..100;

This creates a list of 100 numbers. Now, let us make them into chunks of 10 each.

a.chunks(10)

gives

1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50
51 52 53 54 55 56 57 58 59 60
61 62 63 64 65 66 67 68 69 70
71 72 73 74 75 76 77 78 79 80
81 82 83 84 85 86 87 88 89 90
91 92 93 94 95 96 97 98 99 100


Simple, isn't it?

The result gives a 10x10 matrix filled with the sequence of numbers from 1 to 100.

Let us say we want to calculate the sum of each row in this 10x10 matrix. The $$ row wise mapping function comes to the rescue.

b=a.chunks(10)
b.$$(SUM)

55
155
255
355
455
555
655
755
855
955