|
| 1 | +/* |
| 2 | +* @license Apache-2.0 |
| 3 | +* |
| 4 | +* Copyright (c) 2024 The Stdlib Authors. |
| 5 | +* |
| 6 | +* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +* you may not use this file except in compliance with the License. |
| 8 | +* You may obtain a copy of the License at |
| 9 | +* |
| 10 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +* |
| 12 | +* Unless required by applicable law or agreed to in writing, software |
| 13 | +* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +* See the License for the specific language governing permissions and |
| 16 | +* limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +// TypeScript Version: 4.1 |
| 20 | + |
| 21 | +/// <reference types="@stdlib/types"/> |
| 22 | + |
| 23 | +import { Layout } from '@stdlib/types/blas'; |
| 24 | + |
| 25 | +/** |
| 26 | +* Interface describing `dlaset`. |
| 27 | +*/ |
| 28 | +interface Routine { |
| 29 | + /** |
| 30 | + * Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. |
| 31 | + * |
| 32 | + * @param order - storage layout of `A` and `B` |
| 33 | + * @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` |
| 34 | + * @param M - number of rows in matrix `A` |
| 35 | + * @param N - number of columns in matrix `A` |
| 36 | + * @param A - input matrix |
| 37 | + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) |
| 38 | + * @param alpha - number to set on off diagonal elements |
| 39 | + * @param beta - number to set on diagonal elements |
| 40 | + * @returns `A` |
| 41 | + * |
| 42 | + * @example |
| 43 | + * var Float64Array = require( '@stdlib/array/float64' ); |
| 44 | + * |
| 45 | + * var A = new Float64Array( 4 ); |
| 46 | + * |
| 47 | + * dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); |
| 48 | + * // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ] |
| 49 | + */ |
| 50 | + ( order: Layout, uplo: string, M: number, N: number, A: Float64Array, LDA: number, alpha: number, beta: number ): Float64Array; |
| 51 | + |
| 52 | + /** |
| 53 | + * Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics. |
| 54 | + * |
| 55 | + * @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` |
| 56 | + * @param M - number of rows in matrix `A` |
| 57 | + * @param N - number of columns in matrix `A` |
| 58 | + * @param A - input matrix |
| 59 | + * @param strideA1 - stride of the first dimension of `A` |
| 60 | + * @param strideA2 - stride of the second dimension of `A` |
| 61 | + * @param offsetA - starting index for `A` |
| 62 | + * @param alpha - number to set on off diagonal elements |
| 63 | + * @param beta - number to set on diagonal elements |
| 64 | + * @returns `A` |
| 65 | + * |
| 66 | + * @example |
| 67 | + * var Float64Array = require( '@stdlib/array/float64' ); |
| 68 | + * |
| 69 | + * var A = new Float64Array( 4 ); |
| 70 | + * |
| 71 | + * dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); |
| 72 | + * // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ] |
| 73 | + */ |
| 74 | + ndarray( uplo: string, M: number, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, alpha: number, beta: number ): Float64Array; |
| 75 | +} |
| 76 | + |
| 77 | +/** |
| 78 | +* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals. |
| 79 | +* |
| 80 | +* @param order - storage layout of `A` and `B` |
| 81 | +* @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A` |
| 82 | +* @param M - number of rows in matrix `A` |
| 83 | +* @param N - number of columns in matrix `A` |
| 84 | +* @param A - input matrix |
| 85 | +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) |
| 86 | +* @param alpha - number to set on off diagonal elements |
| 87 | +* @param beta - number to set on diagonal elements |
| 88 | +* @returns `A` |
| 89 | +* |
| 90 | +* @example |
| 91 | +* var Float64Array = require( '@stdlib/array/float64' ); |
| 92 | +* |
| 93 | +* var A = new Float64Array( 4 ); |
| 94 | +* |
| 95 | +* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 ); |
| 96 | +* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ] |
| 97 | +* |
| 98 | +* @example |
| 99 | +* var Float64Array = require( '@stdlib/array/float64' ); |
| 100 | +* |
| 101 | +* var A = new Float64Array( 4 ); |
| 102 | +* |
| 103 | +* dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 ); |
| 104 | +* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ] |
| 105 | +*/ |
| 106 | +declare var dlaset: Routine; |
| 107 | + |
| 108 | + |
| 109 | +// EXPORTS // |
| 110 | + |
| 111 | +export = dlaset; |
0 commit comments