Skip to main content

RealArray

A RealArray.

Factories

array(const RealSparseMatrix lhs) -> RealArray

Converts a container to an array.

Parameters

  • lhs: The container.

array(const RealMatrix lhs) -> RealArray

Converts a container to an array.

Parameters

  • lhs: The container.

array(const RealArray lhs) -> RealArray

Converts a container to an array.

Parameters

  • lhs: The container.

array(const RealSparseMatrix lhs, as_real type) -> RealArray

Converts a container to an array.

Parameters

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

array(const List list, as_real type) -> RealArray

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.

array(const IntegerArray lhs, as_real type) -> RealArray

Converts a container to an array.

Parameters

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

array(const RealArray lhs, as_real type) -> RealArray

Converts a container to an array.

Parameters

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

array(const BoolArray lhs, as_real type) -> RealArray

Converts a container to an array.

Parameters

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

array(const RealMatrix lhs, as_real type) -> RealArray

Converts a container to an array.

Parameters

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

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

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_real | as_array type) -> RealArray

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, real value, as_real | as_array type) -> RealArray

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 RealArray lhs, integer c) -> RealArray

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 RealArray lhs, bool c) -> RealArray

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 RealArray lhs, real c) -> RealArray

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_real | as_array type) -> RealArray

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 RealArray lhs) -> RealArray

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

Parameters

  • lhs: The input container.

ones(const List<integer> shape, as_real | as_array type) -> RealArray

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 RealArray lhs) -> RealArray

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_real | as_array type) -> RealArray

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_real | as_array type) -> RealArray

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 RealArray lhs) -> RealArray

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_real | as_array type) -> RealArray

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 RealArray lhs) -> RealArray

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

Parameters

  • lhs: The input container.

Constructors

RealArray() -> RealArray

Creates an empty RealArray.

RealArray(integer m) -> RealArray

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

Parameters

  • m: The number of rows.

RealArray(const List list) -> RealArray

Creates an RealArray from a list of lists of elements.

Parameters

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

RealArray(integer m, integer n) -> RealArray

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

Parameters

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

Symbols

NameDescription
[]Gets or sets the elements of the RealArray using slices.

Members

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