Skip to main content

IntegerArray

A IntegerArray.

Factories

array(const IntegerArray lhs) -> IntegerArray

Converts a container to an array.

Parameters

  • lhs: The container.

array(const IntegerArray lhs, as_integer type) -> IntegerArray

Converts a container to an array.

Parameters

  • lhs: The container.
  • type: The type of the array to create.

array(const BoolArray lhs, as_integer type) -> IntegerArray

Converts a container to an array.

Parameters

  • lhs: The container.
  • type: The type of the array to create.

array(const List list, as_integer type) -> IntegerArray

Converts a list or list of list to an array.

Parameters

  • list: The list containing the values.
  • type: The type of the container to create.

filled(const List<integer> shape, bool value, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type, filled with with the specified value.

Parameters

  • shape: The shape of the container to create.
  • value: The value with which to fill the container.
  • type: The type of the container to create.

filled(const List<integer> shape, integer value, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type, filled with with the specified value.

Parameters

  • shape: The shape of the container to create.
  • value: The value with which to fill the container.
  • type: The type of the container to create.

filled_like(const IntegerArray lhs, integer c) -> IntegerArray

Return a container with the same shape and type as a given container, filled with a prescribed value.

Parameters

  • lhs: The input container.
  • c: The constant value to fill with.

filled_like(const IntegerArray lhs, bool c) -> IntegerArray

Return a container with the same shape and type as a given container, filled with a prescribed value.

Parameters

  • lhs: The input container.
  • c: The constant value to fill with.

identity(const List<integer> shape, as_integer | as_array type) -> IntegerArray

Creates an identity matrix (or array; possibly rectangular) with the specified shape and type.

Parameters

  • shape: The shape of the container to create.
  • type: The type of the container to create.

identity_like(const IntegerArray lhs) -> IntegerArray

Return the identity with the same shape and type as a given container.

Parameters

  • lhs: The input container.

ones(const List<integer> shape, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type, filled with ones.

Parameters

  • shape: The shape of the container to create.
  • type: The type of the container to create.

ones_like(const IntegerArray lhs) -> IntegerArray

Return a container of ones with the same shape and type as a given container.

Parameters

  • lhs: The input container.

random(const List<integer> shape, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type, filled with random values.

Parameters

  • shape: The shape of the container to create.
  • type: The type of the container to create.

uninitialized(const List<integer> shape, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type.

Parameters

  • shape: The shape of the container to create.
  • type: The type of the container to create.

uninitialized_like(const IntegerArray lhs) -> IntegerArray

Return a container of uninitialized values with the same shape and type as a given container.

Parameters

  • lhs: The input container.

zeros(const List<integer> shape, as_integer | as_array type) -> IntegerArray

Creates a container with the specified shape and type, filled with zeros.

Parameters

  • shape: The shape of the container to create.
  • type: The type of the container to create.

zeros_like(const IntegerArray lhs) -> IntegerArray

Return a container of zeros with the same shape and type as a given container.

Parameters

  • lhs: The input container.

Constructors

IntegerArray() -> IntegerArray

Creates an empty IntegerArray.

IntegerArray(integer m) -> IntegerArray

Creates an m x 1 IntegerArray. The array comes out uninitialized.

Parameters

  • m: The number of rows.

IntegerArray(const List list) -> IntegerArray

Creates an IntegerArray from a list of lists of elements.

Parameters

  • list: A list of elements to populate the column array.

IntegerArray(integer m, integer n) -> IntegerArray

Creates an m x n IntegerArray. The array comes out uninitialized.

Parameters

  • m: The number of rows.
  • n: The number of columns.

Symbols

NameDescription
[]Gets or sets the element at row inds[0] and column inds[1] of the IntegerArray.

Members

NameDescription
allReturns true if all elements of the IntegerArray are finite.
all_finiteReturns true if all elements of the IntegerArray are finite.
anyReturns true if any element of the IntegerArray is finite.
blockGet a block (sub-IntegerArray) of the IntegerArray.
bottom_left_cornerGet the bottom-left corner of the IntegerArray.
bottom_right_cornerGet the bottom-right corner of the IntegerArray.
bottom_rowsGet the bottom rows of the IntegerArray.
colGet a column of the IntegerArray.
colsReturns the number of columns of a IntegerArray.
container_typeReturns the underlying container type of the IntegerArray.
countCounts the number of finite elements in the IntegerArray.
fillSets all elements of the IntegerArray lhs to the constant c.
flattenFlattens the IntegerArray in-place.
flattenedReturns a flattened copy of the IntegerArray.
flipFlips the IntegerArray along the specified dimension.
flippedReturns a IntegerArray flipped along the specified dimension.
has_nanReturns true if the IntegerArray has any NaN (not-a-number) elements.
is_approxReturns true if the IntegerArray lhs is approximately equal to the IntegerArray rhs, within the specified tolerance.
is_approx_to_constantReturns true if all elements of the IntegerArray lhs are approximately equal to the constant val.
is_arrayWhether the container is an array (which supports elementwise operations).
is_boolWhether the underlying scalar type of the IntegerArray is bool.
is_column_vectorReturns true if the container is a column-vector.
is_complexWhether the underlying scalar type of the IntegerArray is complex.
is_constantReturns true if all elements of the IntegerArray lhs are the same.
is_denseWhether the container is dense.
is_integerWhether the underlying scalar type of the IntegerArray is integer.
is_matrixWhether the container is a matrix (which supports matrix algebra).
is_much_smaller_thanReturns true if the norm of the IntegerArray lhs is much smaller than the norm of the IntegerArray rhs, within the specified tolerance.
is_onesReturns true if all elements of the IntegerArray lhs are 1.
is_realWhether the underlying scalar type of the IntegerArray is real.
is_row_vectorReturns true if the container is a row-vector.
is_scalarReturns true if the container is a scalar (or a container containing a single element).
is_sparseWhether the container is sparse.
is_vectorReturns true if the container is a vector.
is_zeroReturns true if all elements of the IntegerArray lhs are 0.
left_colsGet the left columns of the IntegerArray.
listConverts the IntegerArray arr to a list with the same elements.
lrflipFlips the IntegerArray left-right (i.e. flips each row).
lrflippedReturns a IntegerArray flipped left-right (rows; along the 1-st dimension).
middle_colsGet the middle columns of the IntegerArray.
middle_rowsGet the middle rows of the IntegerArray.
random_likeReturn a IntegerArray of random numbers with the same shape and type as a given IntegerArray.
realReturns the real component of a IntegerArray.
replicateReplicates the elements of the IntegerArray lhs in-place by the specified factors.
replicatedReplicates the elements of the IntegerArray lhs by the specified factors.
reshapeReshapes the IntegerArray in-place to the given dimensions.
reshapedReshapes the IntegerArray to the given dimensions.
resizeResizes the IntegerArray lhs to the given dimensions.
reverseReverses the IntegerArray in place.
reversedReturns a reversed copy of the IntegerArray.
right_colsGet the right columns of the IntegerArray.
rotateReturns a (counter-clockwise) rotated copy of the IntegerArray.
rotatedReturns a (counter-clockwise) rotated copy of the IntegerArray.
rowGet a row of the IntegerArray.
rowsReturns the number of rows of a IntegerArray.
scalar_typeReturns the underlying scalar type of the IntegerArray.
selectGets or sets the elements of the IntegerArray using slices.
set_blockSets a block of the IntegerArray lhs to the values in the IntegerArray rhs.
set_bottom_left_cornerGet the bottom-left corner of the IntegerArray.
set_bottom_right_cornerGet the bottom-right corner of the IntegerArray.
set_bottom_rowsGet the bottom rows of the IntegerArray.
set_colGet a column of the IntegerArray.
set_constantSets all elements of the IntegerArray lhs to the constant c.
set_left_colsGet the left columns of the IntegerArray.
set_middle_colsGet the middle columns of the IntegerArray.
set_middle_rowsGet the middle rows of the IntegerArray.
set_onesSets all elements of the IntegerArray lhs to 1.
set_randomSets all elements of the IntegerArray lhs to random values on the interval [0, 1].
set_right_colsGet the right columns of the IntegerArray.
set_rowGet a row of the IntegerArray.
set_selectAssign the values of rhs to a selection of the IntegerArray lhs.
set_top_left_cornerGet the top-left corner of the IntegerArray.
set_top_right_cornerGet the top-right corner of the IntegerArray.
set_top_rowsGet the top rows of the IntegerArray.
set_zeroSets all elements of the IntegerArray lhs to 0.
shapeReturns the shape of a IntegerArray.
shiftReturns a (periodically) shifted copy of the IntegerArray.
shiftedReturns a (periodically) shifted copy of the IntegerArray.
sizeReturns the number of elements of a IntegerArray.
swapSwaps the contents of the IntegerArray lhs and rhs.
top_left_cornerGet the top-left corner of the IntegerArray.
top_right_cornerGet the top-right corner of the IntegerArray.
top_rowsGet the top rows of the IntegerArray.
transposeTransposes the IntegerArray in place.
udflipFlips the IntegerArray up-down (i.e. flips each column).
udflippedReturns a IntegerArray flipped up-down (columns; along the 0-th dimension).
valueReturns the unique coefficient of a 1x1 IntegerArray.