Contents

la_vector_from_matrix_diagonal(_:_:)

Creates a vector from the specified diagonal of the matrix.

Declaration

func la_vector_from_matrix_diagonal(_ matrix: la_object_t, _ matrix_diagonal: la_index_t) -> la_object_t

Parameters

  • matrix:

    Matrix from which to create the vector.

  • matrix_diagonal:

    The index of the diagonal to create the vector from.

Return Value

The resulting vector is a length x 1 vector where length is min(rows(matrix),cols(matrix)-abs(matrix_diagonal)

Discussion

Creates a vector from the specified diagonal of the matrix. If the value for matrix_diagonal is less than zero and abs(matrix_diagonal) > rows(matrix)-1, or if matrix_diagonal is greater than zero and matrix_diagonal > cols(matrix)-1, LA_INVALID_PARAMETER_ERROR is returned.

If matrix is a splat, LA_INVALID_PARAMETER_ERROR is returned.

Always returns a vector_length x 1 vector.

See Also

Functions