This interface provides methods for dealing with array slices, e.g. carving an array slice out of an array or writing an ArraySlice to an array.
An array slice is a sequence of elements in an array.
-
Method Summary
Modifier and TypeMethodDescriptiondev.civl.sarl.IF.expr.SymbolicExpressionarraySlice(dev.civl.sarl.IF.expr.SymbolicExpression array, ArrayToolBox.ArrayShape shape, dev.civl.sarl.IF.expr.NumericExpression[] indices, int count) Same asbut the "count" is known as having a concrete value.invalid reference
#arraySliceRead(SymbolicExpression, NumericExpression[], NumericExpression)dev.civl.sarl.IF.expr.SymbolicExpressionarraySlice(dev.civl.sarl.IF.expr.SymbolicExpression array, ArrayToolBox.ArrayShape shape, dev.civl.sarl.IF.expr.NumericExpression[] indices, dev.civl.sarl.IF.expr.NumericExpression count) Return an array slice value which is an one-dimensional array of elements of type t, where t is the base type of the given array shape (ArrayToolBox.ArrayShape.baseType).dev.civl.sarl.IF.expr.SymbolicExpressionarraySliceWrite(dev.civl.sarl.IF.expr.SymbolicExpression sliceArray, ArrayToolBox.ArrayShape sliceArrayShape, dev.civl.sarl.IF.expr.NumericExpression[] sliceIndices, dev.civl.sarl.IF.expr.NumericExpression count, dev.civl.sarl.IF.expr.SymbolicExpression targetArray, ArrayToolBox.ArrayShape targetShape, dev.civl.sarl.IF.expr.NumericExpression[] targetStartIndices) Writes an array slice s, which is represents by the three given arguments :sliceArray, sliceIndices, count, into thetargetArray, starting from the giventargetStartIndicesdev.civl.sarl.IF.expr.SymbolicExpressionmdArrayRead(dev.civl.sarl.IF.expr.SymbolicExpression array, dev.civl.sarl.IF.expr.NumericExpression[] indices) Read a multi-dimensional arraydev.civl.sarl.IF.expr.SymbolicExpressionmdArrayWrite(dev.civl.sarl.IF.expr.SymbolicExpression array, dev.civl.sarl.IF.expr.NumericExpression[] indices, dev.civl.sarl.IF.expr.SymbolicExpression value) Write a value to a multi-dimensional array
-
Method Details
-
arraySlice
dev.civl.sarl.IF.expr.SymbolicExpression arraySlice(dev.civl.sarl.IF.expr.SymbolicExpression array, ArrayToolBox.ArrayShape shape, dev.civl.sarl.IF.expr.NumericExpression[] indices, dev.civl.sarl.IF.expr.NumericExpression count) Return an array slice value which is an one-dimensional array of elements of type t, where t is the base type of the given array shape (
ArrayToolBox.ArrayShape.baseType).Notice that the
ArrayToolBox.ArrayShape.baseTypedoesn't have to be non-array type.Notice that the given indices must refer to element of the type t, i.e.
ArrayToolBox.ArrayShape.dimensions== indices.length- Parameters:
array- an arrayshape- theArrayToolBox.ArrayShapeof the given array, theArrayToolBox.ArrayShape.dimensionsmust equals to theindices.lengthindices- the indices of the element in the given array which is the first element in the returned array. (inclusive)count- the number of elements in the returned array- Returns:
- an another array that contains a consecutive part of elements of the given array.
-
arraySlice
dev.civl.sarl.IF.expr.SymbolicExpression arraySlice(dev.civl.sarl.IF.expr.SymbolicExpression array, ArrayToolBox.ArrayShape shape, dev.civl.sarl.IF.expr.NumericExpression[] indices, int count) Same asbut the "count" is known as having a concrete value.invalid reference
#arraySliceRead(SymbolicExpression, NumericExpression[], NumericExpression) -
arraySliceWrite
dev.civl.sarl.IF.expr.SymbolicExpression arraySliceWrite(dev.civl.sarl.IF.expr.SymbolicExpression sliceArray, ArrayToolBox.ArrayShape sliceArrayShape, dev.civl.sarl.IF.expr.NumericExpression[] sliceIndices, dev.civl.sarl.IF.expr.NumericExpression count, dev.civl.sarl.IF.expr.SymbolicExpression targetArray, ArrayToolBox.ArrayShape targetShape, dev.civl.sarl.IF.expr.NumericExpression[] targetStartIndices) Writes an array slice s, which is represents by the three given arguments :
sliceArray, sliceIndices, count, into thetargetArray, starting from the giventargetStartIndices- Parameters:
sliceArray- the array where the slice is carved outsliceArrayShape- theArrayToolBox.ArrayShapeof thesliceArraysliceIndices- the starting indices of the slice in thesliceArray. TheArrayToolBox.ArrayShape.dimensionsof sliceArrayShape must equal tosliceIndices.lengthcount- the number of elements in the slice, the type of the element isArrayToolBox.ArrayShape.baseTypetargetArray- the target array where the slice will be written intotargetShape- theArrayToolBox.ArrayShapeof the target array. TheArrayToolBox.ArrayShape.baseTypeof targetShape must equal to the one of sliceArrayShapetargetStartIndices- TheArrayToolBox.ArrayShape.dimensionsof targetShape must equal totargetStartIndices.length- Returns:
-
mdArrayRead
dev.civl.sarl.IF.expr.SymbolicExpression mdArrayRead(dev.civl.sarl.IF.expr.SymbolicExpression array, dev.civl.sarl.IF.expr.NumericExpression[] indices) Read a multi-dimensional array- Parameters:
array- a multi-dimensional arrayindices- indices for reading- Returns:
- The element indexed by the given indices
-
mdArrayWrite
dev.civl.sarl.IF.expr.SymbolicExpression mdArrayWrite(dev.civl.sarl.IF.expr.SymbolicExpression array, dev.civl.sarl.IF.expr.NumericExpression[] indices, dev.civl.sarl.IF.expr.SymbolicExpression value) Write a value to a multi-dimensional array- Parameters:
array- a multi-dimensional arrayindices- indices for reading- Returns:
- new array after writing
-