la_diagonal_matrix_from_vector(_:_:)
Declaration
func la_diagonal_matrix_from_vector(_ vector: la_object_t, _ matrix_diagonal: la_index_t) -> la_object_tParameters
- vector:
Vector providing the data for the non-zero diagonal.
- matrix_diagonal:
The index of the non-zero diagonal.
Discussion
Create a matrix with a specified diagonal provided by a vector, and zeros in all the other entries.
Creates a new matrix with entries on the specified diagonal taken from the vector argument, and zeros in the other entries. The matrix is square, and has size length(vector) + abs(matrix_diagonal).
If matrix_diagonal is zero, the main diagonal is set. If matrix_diagonal is +1, the first superdiagonal is set. If matrix_diagonal is -2, the second subdiagonal is set.
The diagonal may be specified by a vector or by a matrix that has only one row or only one column. If the provided object is not a vector or matrix, or is a matrix with both dimensions larger than one, the returned object will have status LA_INVALID_PARAMETER_ERROR.
See Also
Functions
caxpy_(_:_:_:_:_:_:)ccopy_(_:_:_:_:_:)cdotc_(_:_:_:_:_:_:)cdotu_(_:_:_:_:_:_:)cgbmv_(_:_:_:_:_:_:_:_:_:_:_:_:_:)cgemm_(_:_:_:_:_:_:_:_:_:_:_:_:_:)cgemv_(_:_:_:_:_:_:_:_:_:_:_:)cgerc_(_:_:_:_:_:_:_:_:_:)cgeru_(_:_:_:_:_:_:_:_:_:)chbmv_(_:_:_:_:_:_:_:_:_:_:_:)chemm_(_:_:_:_:_:_:_:_:_:_:_:_:)chemv_(_:_:_:_:_:_:_:_:_:_:)cher2_(_:_:_:_:_:_:_:_:_:)cher2k_(_:_:_:_:_:_:_:_:_:_:_:_:)cher_(_:_:_:_:_:_:_:)