Home
last modified time | relevance | path

Searched refs:diagonal (Results 1 – 25 of 183) sorted by relevance

12345678

/external/eigen/test/
Ddiagonal.cpp12 template<typename MatrixType> void diagonal(const MatrixType& m) in diagonal() function
26 VERIFY_IS_APPROX(m1.diagonal(), m1.transpose().diagonal()); in diagonal()
27 m2.diagonal() = 2 * m1.diagonal(); in diagonal()
28 m2.diagonal()[0] *= 3; in diagonal()
40 VERIFY(m1.template diagonal<N1>().RowsAtCompileTime == m1.diagonal(N1).size()); in diagonal()
41 VERIFY(m1.template diagonal<N2>().RowsAtCompileTime == m1.diagonal(N2).size()); in diagonal()
44 m2.template diagonal<N1>() = 2 * m1.template diagonal<N1>(); in diagonal()
45 VERIFY_IS_APPROX(m2.template diagonal<N1>(), static_cast<Scalar>(2) * m1.diagonal(N1)); in diagonal()
46 m2.template diagonal<N1>()[0] *= 3; in diagonal()
47 …VERIFY_IS_APPROX(m2.template diagonal<N1>()[0], static_cast<Scalar>(6) * m1.template diagonal<N1>(… in diagonal()
[all …]
Ddiagonalmatrices.cpp47 VERIFY_IS_APPROX(ldm1.diagonal(), ldm3.diagonal()); in diagonalmatrices()
49 VERIFY_IS_APPROX(ldm1.diagonal(), ldm4.diagonal()); in diagonalmatrices()
59 VERIFY_IS_APPROX( ((ldm1 * m1)(i,j)) , ldm1.diagonal()(i) * m1(i,j) ); in diagonalmatrices()
60 VERIFY_IS_APPROX( ((ldm1 * (m1+m2))(i,j)) , ldm1.diagonal()(i) * (m1+m2)(i,j) ); in diagonalmatrices()
61 VERIFY_IS_APPROX( ((m1 * rdm1)(i,j)) , rdm1.diagonal()(j) * m1(i,j) ); in diagonalmatrices()
90 VERIFY_IS_APPROX(LeftDiagonalMatrix(ldm1*s1).diagonal(), ldm1.diagonal() * s1); in diagonalmatrices()
91 VERIFY_IS_APPROX(LeftDiagonalMatrix(s1*ldm1).diagonal(), s1 * ldm1.diagonal()); in diagonalmatrices()
Dbandmatrix.cpp28 m.diagonal().setConstant(123); in bandmatrix()
29 dm1.diagonal().setConstant(123); in bandmatrix()
32 m.diagonal(i).setConstant(static_cast<RealScalar>(i)); in bandmatrix()
33 dm1.diagonal(i).setConstant(static_cast<RealScalar>(i)); in bandmatrix()
37 m.diagonal(-i).setConstant(-static_cast<RealScalar>(i)); in bandmatrix()
38 dm1.diagonal(-i).setConstant(-static_cast<RealScalar>(i)); in bandmatrix()
Deigensolver_selfadjoint.cpp149 VERIFY_IS_APPROX(tridiag.diagonal(), tridiag.matrixT().diagonal()); in selfadjointeigensolver()
150 VERIFY_IS_APPROX(tridiag.subDiagonal(), tridiag.matrixT().template diagonal<-1>()); in selfadjointeigensolver()
156 VERIFY_IS_APPROX(tridiag.diagonal(), T.diagonal()); in selfadjointeigensolver()
157 VERIFY_IS_APPROX(tridiag.subDiagonal(), T.template diagonal<1>()); in selfadjointeigensolver()
165 …eiSymmTridiag.computeFromTridiagonal(tridiag.matrixT().diagonal(), tridiag.matrixT().diagonal(-1),… in selfadjointeigensolver()
Dtriangular.cpp130 VERIFY_IS_APPROX(m1.template selfadjointView<Upper>().diagonal(), m1.diagonal()); in triangular_square()
194 VERIFY(m2.diagonal().isMuchSmallerThan(RealScalar(1))); in triangular_rect()
197 m2.diagonal().array() -= Scalar(1); in triangular_rect()
198 VERIFY(m2.diagonal().isMuchSmallerThan(RealScalar(1))); in triangular_rect()
204 VERIFY(m2.diagonal().isMuchSmallerThan(RealScalar(1))); in triangular_rect()
207 m2.diagonal().array() -= Scalar(1); in triangular_rect()
208 VERIFY(m2.diagonal().isMuchSmallerThan(RealScalar(1))); in triangular_rect()
Dnesting_ops.cpp42 VERIFY_IS_APPROX( (m.transpose() * m).diagonal().sum(), (m.transpose() * m).diagonal().sum() ); in run_nesting_ops_1()
43 …VERIFY_IS_APPROX( (m.transpose() * m).diagonal().array().abs().sum(), (m.transpose() * m).diagonal in run_nesting_ops_1()
/external/tensorflow/tensorflow/core/api_def/base_api/
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]
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]
Dapi_def_MatrixDiagPart.pbtxt10 name: "diagonal"
12 The extracted diagonal(s) having shape
13 `diagonal.shape = input.shape[:-2] + [min(input.shape[-2:])]`.
16 summary: "Returns the batched diagonal part of a batched tensor."
18 This operation returns a tensor with the `diagonal` part
19 of the batched `input`. The `diagonal` part is computed as follows:
24 `diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n]`.
Dapi_def_DiagPart.pbtxt10 name: "diagonal"
12 The extracted diagonal.
15 summary: "Returns the diagonal part of the tensor."
17 This operation returns a tensor with the `diagonal` part
18 of the `input`. The `diagonal` part is computed as follows:
23 `diagonal[i1,..., ik] = input[i1, ..., ik, i1,..., ik]`.
Dapi_def_MatrixSetDiag.pbtxt10 name: "diagonal"
21 summary: "Returns a batched matrix tensor with new batched diagonal values."
23 Given `input` and `diagonal`, this operation returns a tensor with the
24 same shape and values as `input`, except for the main diagonal of the
25 innermost matrices. These will be overwritten by the values in `diagonal`.
29 Assume `input` has `k+1` dimensions `[I, J, K, ..., M, N]` and `diagonal` has
33 * `output[i, j, k, ..., m, n] = diagonal[i, j, k, ..., n]` for `m == n`.
/external/eigen/Eigen/src/Core/
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());
136 inline const DiagonalVectorType& diagonal() const { return m_diagonal; }
139 inline DiagonalVectorType& diagonal() { return m_diagonal; }
160 inline DiagonalMatrix(const DiagonalBase<OtherDerived>& other) : m_diagonal(other.diagonal()) {}
[all …]
DBandMatrix.h84 inline Block<CoefficientsType,1,SizeAtCompileTime> diagonal() in diagonal() function
88 inline const Block<const CoefficientsType,1,SizeAtCompileTime> diagonal() const in diagonal() function
109 template<int N> inline typename DiagonalIntReturnType<N>::Type diagonal() in diagonal() function
115 template<int N> inline const typename DiagonalIntReturnType<N>::Type diagonal() const in diagonal() function
121 inline Block<CoefficientsType,1,Dynamic> diagonal(Index i) in diagonal() function
128 inline const Block<const CoefficientsType,1,Dynamic> diagonal(Index i) const in diagonal() function
138 dst.diagonal() = diagonal(); in evalTo()
140 dst.diagonal(i) = diagonal(i); in evalTo()
142 dst.diagonal(-i) = diagonal(-i); in evalTo()
320 { return Base::template diagonal<1>(); }
[all …]
DDiagonal.h188 MatrixBase<Derived>::diagonal()
196 MatrixBase<Derived>::diagonal() const
214 MatrixBase<Derived>::diagonal(Index index)
222 MatrixBase<Derived>::diagonal(Index index) const
241 MatrixBase<Derived>::diagonal()
250 MatrixBase<Derived>::diagonal() const
/external/eigen/Eigen/src/Eigenvalues/
DTridiagonalization.h284 DiagonalReturnType diagonal() const;
307 Tridiagonalization<MatrixType>::diagonal() const
310 return m_matrix.diagonal().real();
318 return m_matrix.template diagonal<-1>().real();
446 diag = mat.diagonal().real();
447 subdiag = mat.template diagonal<-1>().real();
540 result.template diagonal<1>() = m_matrix.template diagonal<-1>().conjugate();
541 result.diagonal() = m_matrix.diagonal();
542 result.template diagonal<-1>() = m_matrix.template diagonal<-1>();
/external/eigen/Eigen/src/SVD/
DUpperBidiagonalization.h73 return HouseholderUSequenceType(m_householder, m_householder.diagonal().conjugate()); in householderU()
79 …olderVSequenceType(m_householder.conjugate(), m_householder.const_derived().template diagonal<1>()) in householderV()
94 typename MatrixType::RealScalar *diagonal,
118 .makeHouseholderInPlace(mat.coeffRef(k,k), diagonal[k]);
153 typename MatrixType::RealScalar *diagonal, in upperbidiagonalization_blocked_helper() argument
190 v_k.makeHouseholderInPlace(tau_v, diagonal[k]); in upperbidiagonalization_blocked_helper()
339 &(bidiagonal.template diagonal<0>().coeffRef(k)),
340 &(bidiagonal.template diagonal<1>().coeffRef(k)),
348 … &(bidiagonal.template diagonal<0>().coeffRef(k)),
349 … &(bidiagonal.template diagonal<1>().coeffRef(k)),
[all …]
/external/eigen/doc/
DQuickReference.dox604 view a vector \link MatrixBase::asDiagonal() as a diagonal matrix \endlink \n </td><td>\code
608 Declare a diagonal matrix</td><td>\code
610 diag1.diagonal() = vector;\endcode
612 <tr><td>Access the \link MatrixBase::diagonal() diagonal \endlink and \link MatrixBase::diagonal(In…
614 vec1 = mat1.diagonal(); mat1.diagonal() = vec1; // main diagonal
615 vec1 = mat1.diagonal(+n); mat1.diagonal(+n) = vec1; // n-th super diagonal
616 vec1 = mat1.diagonal(-n); mat1.diagonal(-n) = vec1; // n-th sub diagonal
617 vec1 = mat1.diagonal<1>(); mat1.diagonal<1>() = vec1; // first super diagonal
618 vec1 = mat1.diagonal<-2>(); mat1.diagonal<-2>() = vec1; // second sub diagonal
644 unit or null diagonal (read/write):
[all …]
Dtutorial.cpp15 m3.diagonal().setOnes(); in main()
33 m4.diagonal().block(1,2).setOnes(); in main()
34 std::cout << "*** Step 5 ***\nm4.diagonal():\n" << m4.diagonal() << std::endl; in main()
35 std::cout << "m4.diagonal().start(3)\n" << m4.diagonal().start(3) << std::endl; in main()
/external/eigen/Eigen/src/SparseCore/
DSparseAssign.h192 Index size = src.diagonal().size();
197 Map<ArrayXS>(dst.valuePtr(), size) = src.diagonal();
203 dst.diagonal() = src.diagonal();
207 { dst.diagonal() += src.diagonal(); }
210 { dst.diagonal() -= src.diagonal(); }
/external/apache-commons-math/src/main/java/org/apache/commons/math/linear/
DMatrixUtils.java202 public static RealMatrix createRealDiagonalMatrix(final double[] diagonal) { in createRealDiagonalMatrix() argument
203 final RealMatrix m = createRealMatrix(diagonal.length, diagonal.length); in createRealDiagonalMatrix()
204 for (int i = 0; i < diagonal.length; ++i) { in createRealDiagonalMatrix()
205 m.setEntry(i, i, diagonal[i]); in createRealDiagonalMatrix()
220 createFieldDiagonalMatrix(final T[] diagonal) { in createFieldDiagonalMatrix() argument
222 createFieldMatrix(diagonal[0].getField(), diagonal.length, diagonal.length); in createFieldDiagonalMatrix()
223 for (int i = 0; i < diagonal.length; ++i) { in createFieldDiagonalMatrix()
224 m.setEntry(i, i, diagonal[i]); in createFieldDiagonalMatrix()
/external/tensorflow/tensorflow/core/kernels/
Ddiag_op.cc48 const Tensor& diagonal = context->input(0); in Compute() local
49 const int num_dims = diagonal.dims(); in Compute()
55 out_shape.AddDim(diagonal.dim_size(i)); in Compute()
58 out_shape.AddDim(diagonal.dim_size(i)); in Compute()
65 diagFunc(context, diagonal.NumElements(), diagonal.flat<T>().data(), in Compute()
/external/eigen/doc/snippets/
DMatrixBase_diagonal_template_int.cpp4 << m.diagonal<1>().transpose() << endl
5 << m.diagonal<-2>().transpose() << endl;
DMatrixBase_diagonal_int.cpp4 << m.diagonal(1).transpose() << endl
5 << m.diagonal(-2).transpose() << endl;
/external/eigen/unsupported/Eigen/src/NonLinearOptimization/
Dqrsolv.h32 x = s.diagonal(); in qrsolv()
82 sdiag = s.diagonal(); in qrsolv()
83 s.diagonal() = x; in qrsolv()
/external/eigen/unsupported/Eigen/src/LevenbergMarquardt/
DLMqrsolv.h44 x = s.diagonal(); in lmqrsolv()
94 sdiag = s.diagonal(); in lmqrsolv()
95 s.diagonal() = x; in lmqrsolv()
180 sdiag = R.diagonal(); in lmqrsolv()

12345678