Home
last modified time | relevance | path

Searched full:diagonal (Results 1 – 25 of 2241) sorted by relevance

12345678910>>...90

/aosp_15_r20/external/eigen/test/
H A Ddiagonal.cpp12 template<typename MatrixType> void diagonal(const MatrixType& m) in diagonal() function
24 //check diagonal() in diagonal()
25 VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal()); in diagonal()
26 m2.diagonal() = 2 * m1.diagonal(); in diagonal()
27 m2.diagonal()[0] *= 3; in diagonal()
36 // check sub/super diagonal in diagonal()
39 VERIFY(m1.template diagonal<N1>().RowsAtCompileTime == m1.diagonal(N1).size()); in diagonal()
40 VERIFY(m1.template diagonal<N2>().RowsAtCompileTime == m1.diagonal(N2).size()); in diagonal()
43 m2.template diagonal<N1>() = 2 * m1.template diagonal<N1>(); in diagonal()
44 VERIFY_IS_APPROX(m2.template diagonal<N1>(), static_cast<Scalar>(2) * m1.diagonal(N1)); in diagonal()
[all …]
/aosp_15_r20/external/eigen/Eigen/src/Core/
H A DDiagonal.h16 /** \class Diagonal
19 * \brief Expression of a diagonal/subdiagonal/superdiagonal in a matrix
21 * \param MatrixType the type of the object in which we are taking a sub/main/super diagonal
22 …* \param DiagIndex the index of the sub/super diagonal. The default is 0 and it means the main dia…
28 * This class represents an expression of the main diagonal, or any sub/super diagonal
29 …* of a square matrix. It is the return type of MatrixBase::diagonal() and MatrixBase::diagonal(Ind…
32 * \sa MatrixBase::diagonal(), MatrixBase::diagonal(Index)
37 struct traits<Diagonal<MatrixType,DiagIndex> >
63 template<typename MatrixType, int _DiagIndex> class Diagonal
64 : public internal::dense_xpr_base< Diagonal<MatrixType,_DiagIndex> >::type
[all …]
H A DDiagonalMatrix.h49 inline const DiagonalVectorType& diagonal() const { return derived().diagonal(); } in diagonal() function
51 inline DiagonalVectorType& diagonal() { return derived().diagonal(); } in diagonal() function
54 inline Index rows() const { return diagonal().size(); } in rows()
56 inline Index cols() const { return diagonal().size(); } in cols()
71 return InverseReturnType(diagonal().cwiseInverse()); in inverse()
78 …t EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(DiagonalVectorType,Scalar,product) >(diagonal() * scalar);
84 …N_SCALAR_BINARYOP_EXPR_RETURN_TYPE(Scalar,DiagonalVectorType,product) >(scalar * other.diagonal());
96 return (diagonal() + other.diagonal()).asDiagonal();
108 return (diagonal() - other.diagonal()).asDiagonal();
117 * \brief Represents a diagonal matrix with its storage
[all …]
H A DBandMatrix.h83 /** \returns a vector expression of the main diagonal */
84 inline Block<CoefficientsType,1,SizeAtCompileTime> diagonal() in diagonal() function
87 /** \returns a vector expression of the main diagonal (const version) */
88 inline const Block<const CoefficientsType,1,SizeAtCompileTime> diagonal() const in diagonal() function
108 /** \returns a vector expression of the \a N -th sub or super diagonal */
109 template<int N> inline typename DiagonalIntReturnType<N>::Type diagonal() in diagonal() function
114 /** \returns a vector expression of the \a N -th sub or super diagonal */
115 template<int N> inline const typename DiagonalIntReturnType<N>::Type diagonal() const in diagonal() function
120 /** \returns a vector expression of the \a i -th sub or super diagonal */
121 inline Block<CoefficientsType,1,Dynamic> diagonal(Index i) in diagonal() function
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/core/api_def/base_api/
H A Dapi_def_MatrixDiagV2.pbtxt4 name: "diagonal"
10 Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main
11 diagonal, and negative value means subdiagonals. `k` can be a single integer
12 (for a single diagonal) or a pair of integers specifying the low and high ends
21 innermost dimension of `diagonal`.
29 k and the innermost dimension of `diagonal`.
35 The number to fill the area outside the specified diagonal band with.
46 "Returns a batched diagonal tensor with given batched diagonal values."
48 Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th
52 its size from `k` and the innermost dimension of `diagonal`. If only one of them
[all …]
H A Dapi_def_MatrixDiagV3.pbtxt4 name: "diagonal"
10 Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main
11 diagonal, and negative value means subdiagonals. `k` can be a single integer
12 (for a single diagonal) or a pair of integers specifying the low and high ends
21 innermost dimension of `diagonal`.
29 k and the innermost dimension of `diagonal`.
35 The number to fill the area outside the specified diagonal band with.
58 "Returns a batched diagonal tensor with given batched diagonal values."
60 Returns a tensor with the contents in `diagonal` as `k[0]`-th to `k[1]`-th
64 its size from `k` and the innermost dimension of `diagonal`. If only one of them
[all …]
H A Dapi_def_MatrixSetDiagV3.pbtxt8 name: "diagonal"
17 Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main
18 diagonal, and negative value means subdiagonals. `k` can be a single integer
19 (for a single diagonal) or a pair of integers specifying the low and high ends
41 summary: "Returns a batched matrix tensor with new batched diagonal values."
43 Given `input` and `diagonal`, this operation returns a tensor with the
45 innermost matrices. These will be overwritten by the values in `diagonal`.
48 `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`.
51 `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`,
59 = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
[all …]
H A Dapi_def_MatrixSetDiagV2.pbtxt8 name: "diagonal"
17 Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main
18 diagonal, and negative value means subdiagonals. `k` can be a single integer
19 (for a single diagonal) or a pair of integers specifying the low and high ends
29 summary: "Returns a batched matrix tensor with new batched diagonal values."
31 Given `input` and `diagonal`, this operation returns a tensor with the
33 innermost matrices. These will be overwritten by the values in `diagonal`.
36 `k[0] == k[1]`, `diagonal` has `r` dimensions `[I, J, ..., L, max_diag_len]`.
39 `max_diag_len` is the longest diagonal in the range `[k[0], k[1]]`,
47 = diagonal[i, j, ..., l, n-max(k[1], 0)] ; if n - m == k[1]
[all …]
H A Dapi_def_MatrixDiag.pbtxt4 name: "diagonal"
12 Rank `k+1`, with `output.shape = diagonal.shape + [diagonal.shape[-1]]`.
15 summary: "Returns a batched diagonal tensor with a given batched diagonal values."
17 Given a `diagonal`, this operation returns a tensor with the `diagonal` and
18 everything else padded with zeros. The diagonal is computed as follows:
20 Assume `diagonal` has `k` dimensions `[I, J, K, ..., N]`, then the output is a
23 `output[i, j, k, ..., m, n] = 1{m=n} * diagonal[i, j, k, ..., n]`.
28 # 'diagonal' is [[1, 2, 3, 4], [5, 6, 7, 8]]
30 and diagonal.shape = (2, 4)
32 tf.matrix_diag(diagonal) ==> [[[1, 0, 0, 0]
H A Dapi_def_Diag.pbtxt4 name: "diagonal"
9 summary: "Returns a diagonal tensor with a given diagonal values."
11 Given a `diagonal`, this operation returns a tensor with the `diagonal` and
12 everything else padded with zeros. The diagonal is computed as follows:
14 Assume `diagonal` has dimensions [D1,..., Dk], then the output is a tensor of
17 `output[i1,..., ik, i1,..., ik] = diagonal[i1, ..., ik]` and 0 everywhere else.
22 # 'diagonal' is [1, 2, 3, 4]
23 tf.diag(diagonal) ==> [[1, 0, 0, 0]
H A Dapi_def_MatrixDiagPartV3.pbtxt10 Diagonal offset(s). Positive value means superdiagonal, 0 refers to the main
11 diagonal, and negative value means subdiagonals. `k` can be a single integer
12 (for a single diagonal) or a pair of integers specifying the low and high ends
19 The value to fill the area outside the specified diagonal band with.
24 name: "diagonal"
25 description: "The extracted diagonal(s)."
39 summary: "Returns the batched diagonal part of a batched tensor."
54 diagonal[i, j, ..., l, n]
64 diagonal[i, j, ..., l, m, n]
70 `offset` is zero except when the alignment of the diagonal is to the right.
[all …]
/aosp_15_r20/external/eigen/doc/
H A DQuickReference.dox616 <a href="#" class="top">top</a>\section QuickRef_DiagTriSymm Diagonal, Triangular, and Self-adjoint…
619 \subsection QuickRef_Diagonal Diagonal matrices
624 view a vector \link MatrixBase::asDiagonal() as a diagonal matrix \endlink \n </td><td>\code
628 Declare a diagonal matrix</td><td>\code
630 diag1.diagonal() = vector;\endcode
632 <tr><td>Access the \link MatrixBase::diagonal() diagonal \endlink and \link MatrixBase::diagonal(In…
634 vec1 = mat1.diagonal(); mat1.diagonal() = vec1; // main diagonal
635 vec1 = mat1.diagonal(+n); mat1.diagonal(+n) = vec1; // n-th super diagonal
636 vec1 = mat1.diagonal(-n); mat1.diagonal(-n) = vec1; // n-th sub diagonal
637 vec1 = mat1.diagonal<1>(); mat1.diagonal<1>() = vec1; // first super diagonal
[all …]
/aosp_15_r20/external/eigen/Eigen/src/Eigenvalues/
H A DTridiagonalization.h47 * main diagonal and the first diagonal below and above it. The Hessenberg
90 …typename internal::add_const_on_value_type<typename Diagonal<const MatrixType>::RealReturnType>::t…
91 const Diagonal<const MatrixType>
95 …typename internal::add_const_on_value_type<typename Diagonal<const MatrixType, -1>::RealReturnType…
96 const Diagonal<const MatrixType, -1>
200 * - the diagonal and lower sub-diagonal represent the real tridiagonal
260 * returned by diagonal() and subDiagonal() instead of creating a new
264 * matrixQ(), packedMatrix(), diagonal(), subDiagonal()
272 /** \brief Returns the diagonal of the tridiagonal matrix T in the decomposition.
274 * \returns expression representing the diagonal of T
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tests/
H A Dmatrix_diag_ops_test.py53 # Aligns each diagonal row-by-row.
69 # Repacks the diagonal.
348 diagonal = params["diagonal"]
353 params["diagonal"] = array_ops.placeholder(
354 dtype, diagonal.shape, name="diagonal")
362 {params["diagonal"]: diagonal.astype(dtype)})
397 self._assertOpOutputMatchesExpected({"diagonal": vecs1}, solution1,
399 self._assertOpOutputMatchesExpected({"diagonal": vecs2}, solution2,
401 self._assertOpOutputMatchesExpected({"diagonal": vecs3}, solution3,
415 params = {"diagonal": vecs[0], "k": diag_index, "align": align}
[all …]
/aosp_15_r20/external/apache-commons-math/src/main/java/org/apache/commons/math/linear/
H A DBiDiagonalTransformer.java24 * Class transforming any matrix to bi-diagonal shape.
27 * B an m &times; n bi-diagonal matrix (lower diagonal if m &lt; n, upper diagonal
29 * <p>Transformation to bi-diagonal shape is often not a goal by itself, but it is
43 /** Main diagonal. */
46 /** Secondary diagonal. */
59 * Build the transformation to bi-diagonal shape of a matrix.
96 final double[] diagonal = (m >= n) ? main : secondary; in getU() local
114 alpha /= diagonal[k - diagOffset] * hK[k - diagOffset]; in getU()
134 * Returns the bi-diagonal matrix B of the transform.
177 final double[] diagonal = (m >= n) ? secondary : main; in getV() local
[all …]
/aosp_15_r20/external/apache-commons-math/src/main/java/org/apache/commons/math3/linear/
H A DBiDiagonalTransformer.java23 * Class transforming any matrix to bi-diagonal shape.
26 * &times; V<sup>T</sup> with U an m &times; m orthogonal matrix, B an m &times; n bi-diagonal
27 * matrix (lower diagonal if m &lt; n, upper diagonal otherwise), and V an n &times; n orthogonal
30 * <p>Transformation to bi-diagonal shape is often not a goal by itself, but it is an intermediate
43 /** Main diagonal. */
46 /** Secondary diagonal. */
59 * Build the transformation to bi-diagonal shape of a matrix.
98 final double[] diagonal = (m >= n) ? main : secondary; in getU() local
116 alpha /= diagonal[k - diagOffset] * hK[k - diagOffset]; in getU()
135 * Returns the bi-diagonal matrix B of the transform.
[all …]
/aosp_15_r20/external/eigen/unsupported/Eigen/src/LevenbergMarquardt/
H A DLMqrsolv.h40 // the diagonal, though the diagonal is restored afterward in lmqrsolv()
43 /* in particular, save the diagonal elements of r in x. */ in lmqrsolv()
44 x = s.diagonal(); in lmqrsolv()
49 /* eliminate the diagonal matrix d using a givens rotation. */ in lmqrsolv()
53 /* diagonal element using p from the qr factorization. */ in lmqrsolv()
69 /* compute the modified diagonal element of r and */ in lmqrsolv()
94 sdiag = s.diagonal(); in lmqrsolv()
95 s.diagonal() = x; in lmqrsolv()
120 // the diagonal, though the diagonal is restored afterward in lmqrsolv()
125 // Eliminate the diagonal matrix d using a givens rotation in lmqrsolv()
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/compiler/xla/client/lib/
H A Dmatrix.h32 // Returns an m x n matrix with 1s on the diagonal elements, zeros everywhere
37 // Returns a mask where the 'diagonal'-th diagonal is true and everything else
39 XlaOp GetDiagonalMask(XlaOp x, int diagonal = 0);
42 // main diagonal, and k<0 for diagonals below the main diagonal.
46 // diagonal elements (i.e., with indices [..., i, i + k]).
48 // diagonal elements (i.e., with indices [..., i - k, i]).
52 // Places diag along the kth diagonal of target.
56 // `diagonal`-th diagonal and false above that diagonal.
57 XlaOp TriangleMask(XlaOp x, int diagonal);
72 // complex diagonal to zero.
/aosp_15_r20/external/pytorch/test/
H A Dtest_functionalization.py669 # test: view ops that take a subset of the original tensor (select/diagonal)
671 y = x.clone().diagonal()
708 diagonal = torch.ops.aten.diagonal.default(clone)
709 add = torch.ops.aten.add_.Tensor(diagonal, ones); diagonal = ones = add = None
710 diagonal_1 = torch.ops.aten.diagonal.default(clone); clone = diagonal_1 = None
720 y = x.diagonal()
756 diagonal = torch.ops.aten.diagonal.default(arg0_1)
757 add = torch.ops.aten.add.Tensor(diagonal, ones); diagonal = ones = None
759 diagonal_1 = torch.ops.aten.diagonal.default(diagonal_scatter); diagonal_1 = None
769 y = x.diagonal()
[all …]
/aosp_15_r20/external/tensorflow/tensorflow/compiler/tf2xla/kernels/
H A Dmatrix_diag_ops.cc30 // Calculates the diagonal length of a diagonal.
36 // Checks if a diagonal is to be aligned left or right.
43 // Reads the diagonal packing alignment.
132 // Processes one diagonal at a time: in SetMatrixDiag()
133 // 1) Extracts a single diagonal (diag_slice). in SetMatrixDiag()
135 // 3) Masks diag_broadcast to get the right diagonal shape. in SetMatrixDiag()
146 // The 1st diagonal is created by: in SetMatrixDiag()
156 // 3) Masking diag_broadcast with a mask of the shape of the 1st diagonal. in SetMatrixDiag()
166 // Extracts a single diagonal. in SetMatrixDiag()
179 // - If the diagonal has the longest length, i.e., min(num_rows, num_cols), in SetMatrixDiag()
[all …]
/aosp_15_r20/external/executorch/kernels/portable/cpu/
H A Dop_tril.cpp42 int64_t diagonal, in apply_tril() argument
48 for (int64_t j = 0; j < std::min(num_cols, i + diagonal + 1); j++) { in apply_tril()
62 int64_t diagonal, in tril_kernel() argument
112 diagonal, in tril_kernel()
125 * other elements are set to 0, by default. Further, `diagonal` controls how the
127 * 1. `diagonal = 0`: Elements on and below the main diagonal are retained.
128 * 2. `diagonal > 0`: Similar to case (1); additional diagonals above the
130 * 3. `diagonal < 0`: Similar to case (1); additional diagonals below the
136 int64_t diagonal, in tril_out() argument
162 tril_kernel<CTYPE>(ctx, self, diagonal, out); in tril_out()
/aosp_15_r20/external/tensorflow/tensorflow/python/ops/linalg/
H A Dlinear_operator_diag.py15 """`LinearOperator` acting like a diagonal matrix."""
32 """`LinearOperator` acting like a [batch] square diagonal matrix.
34 This operator acts like a [batch] diagonal matrix `A` with shape
43 # Create a 2 x 2 diagonal linear operator.
122 The diagonal of the operator. Allowed dtypes: `float16`, `float32`,
156 raise ValueError("A real diagonal operator is always self adjoint.")
161 raise ValueError("Only square diagonal operators currently supported.")
196 message="Singular operator: Diagonal contained zero values.")
201 "Diagonal operator had diagonal entries with non-positive real part, "
205 "Real diagonal operator had non-positive diagonal entries, "
[all …]
/aosp_15_r20/hardware/google/gfxstream/third-party/glm/include/glm/gtx/
Dmatrix_operation.hpp9 /// @brief Build diagonal matrices from vectors.
27 //! Build a diagonal matrix.
33 //! Build a diagonal matrix.
39 //! Build a diagonal matrix.
45 //! Build a diagonal matrix.
51 //! Build a diagonal matrix.
57 //! Build a diagonal matrix.
63 //! Build a diagonal matrix.
69 //! Build a diagonal matrix.
75 //! Build a diagonal matrix.
/aosp_15_r20/external/oboe/samples/RhythmGame/third_party/glm/gtx/
H A Dmatrix_operation.hpp9 /// @brief Build diagonal matrices from vectors.
27 //! Build a diagonal matrix.
33 //! Build a diagonal matrix.
39 //! Build a diagonal matrix.
45 //! Build a diagonal matrix.
51 //! Build a diagonal matrix.
57 //! Build a diagonal matrix.
63 //! Build a diagonal matrix.
69 //! Build a diagonal matrix.
75 //! Build a diagonal matrix.
/aosp_15_r20/external/pytorch/benchmarks/operator_benchmark/pt/
H A Ddiag_test.py11 attr_names=["dim", "M", "N", "diagonal", "out"],
25 def init(self, dim, M, N, diagonal, out, device): argument
30 "diagonal": diagonal,
39 def forward(self, input, diagonal: int, out: bool, out_tensor):
41 return torch.diag(input, diagonal=diagonal, out=out_tensor)
43 return torch.diag(input, diagonal=diagonal)

12345678910>>...90