Home
last modified time | relevance | path

Searched refs:cols (Results 1 – 25 of 714) sorted by relevance

12345678910>>...29

/external/eigen/test/
Darray.cpp20 Index cols = m.cols(); in array() local
22 ArrayType m1 = ArrayType::Random(rows, cols), in array()
23 m2 = ArrayType::Random(rows, cols), in array()
24 m3(rows, cols); in array()
27 RowVectorType rv1 = RowVectorType::Random(cols); in array()
34 VERIFY_IS_APPROX(m1 + s1, ArrayType::Constant(rows,cols,s1) + m1); in array()
36 VERIFY_IS_APPROX(m1 - s1, m1 - ArrayType::Constant(rows,cols,s1)); in array()
37 VERIFY_IS_APPROX(s1 - m1, ArrayType::Constant(rows,cols,s1) - m1); in array()
38 VERIFY_IS_APPROX((m1*Scalar(2)) - s2, (m1+m1) - ArrayType::Constant(rows,cols,s2) ); in array()
48 …ArrayType::Map(m1.data(), m1.rows(), m1.cols()) -= ArrayType::Map(m2.data(), m2.rows(), m2.cols()); in array()
[all …]
Darray_for_matrix.cpp20 Index cols = m.cols(); in array_for_matrix() local
22 MatrixType m1 = MatrixType::Random(rows, cols), in array_for_matrix()
23 m2 = MatrixType::Random(rows, cols), in array_for_matrix()
24 m3(rows, cols); in array_for_matrix()
27 RowVectorType rv1 = RowVectorType::Random(cols); in array_for_matrix()
34 VERIFY_IS_APPROX((m1.array() + s1).matrix(), MatrixType::Constant(rows,cols,s1) + m1); in array_for_matrix()
35 …VERIFY_IS_APPROX(((m1*Scalar(2)).array() - s2).matrix(), (m1+m1) - MatrixType::Constant(rows,cols,… in array_for_matrix()
61 VERIFY_IS_APPROX(m1.block(0,0,0,cols).colwise().sum(), RowVectorType::Zero(cols)); in array_for_matrix()
81 Index cols = m.cols(); in comparisons() local
84 c = internal::random<Index>(0, cols-1); in comparisons()
[all …]
Dmapstaticmethods.cpp72 int rows = m.rows(), cols = m.cols(); in run() local
76 PlainObjectType::Map(ptr, rows, cols).setZero(); in run()
77 PlainObjectType::MapAligned(ptr, rows, cols).setZero(); in run()
78 PlainObjectType::Map(const_ptr, rows, cols).sum(); in run()
79 PlainObjectType::MapAligned(const_ptr, rows, cols).sum(); in run()
81 PlainObjectType::Map(ptr, rows, cols, InnerStride<>(i)).setZero(); in run()
82 PlainObjectType::MapAligned(ptr, rows, cols, InnerStride<>(i)).setZero(); in run()
83 PlainObjectType::Map(const_ptr, rows, cols, InnerStride<>(i)).sum(); in run()
84 PlainObjectType::MapAligned(const_ptr, rows, cols, InnerStride<>(i)).sum(); in run()
86 PlainObjectType::Map(ptr, rows, cols, InnerStride<2>()).setZero(); in run()
[all …]
Darray_reverse.cpp23 Index cols = m.cols(); in reverse() local
27 MatrixType m1 = MatrixType::Random(rows, cols); in reverse()
33 for ( int j = 0; j < cols; j++ ) { in reverse()
34 VERIFY_IS_APPROX(m1_r(i, j), m1(rows - 1 - i, cols - 1 - j)); in reverse()
41 for ( int j = 0; j < cols; j++ ) { in reverse()
42 VERIFY_IS_APPROX(m1_rd(i, j), m1(rows - 1 - i, cols - 1 - j)); in reverse()
49 for ( int j = 0; j < cols; j++ ) { in reverse()
50 VERIFY_IS_APPROX(m1_rb(i, j), m1(rows - 1 - i, cols - 1 - j)); in reverse()
57 for ( int j = 0; j < cols; j++ ) { in reverse()
65 for ( int j = 0; j < cols; j++ ) { in reverse()
[all …]
Dcorners.cpp20 Index cols = m.cols(); in corners() local
23 Index c = internal::random<Index>(1,cols); in corners()
25 MatrixType matrix = MatrixType::Random(rows,cols); in corners()
26 const MatrixType const_matrix = MatrixType::Random(rows,cols); in corners()
29 COMPARE_CORNER(topRightCorner(r,c), block(0,cols-c,r,c)); in corners()
31 COMPARE_CORNER(bottomRightCorner(r,c), block(rows-r,cols-c,r,c)); in corners()
35 Index sc = internal::random<Index>(1,cols) - 1; in corners()
36 Index nc = internal::random<Index>(1,cols-sc); in corners()
38 COMPARE_CORNER(topRows(r), block(0,0,r,cols)); in corners()
39 COMPARE_CORNER(middleRows(sr,nr), block(sr,0,nr,cols)); in corners()
[all …]
Dresize.cpp12 template<DenseIndex rows, DenseIndex cols>
15 MatrixXf A(rows, cols); in resizeLikeTest()
17 Matrix<double, rows, cols> C; in resizeLikeTest()
20 VERIFY(B.rows() == rows && B.cols() == cols); in resizeLikeTest()
25 VERIFY(y.rows() == 1 && y.cols() == rows); in resizeLikeTest()
27 y.resize(cols); in resizeLikeTest()
29 VERIFY(x.rows() == cols && x.cols() == 1); in resizeLikeTest()
Dbandmatrix.cpp20 Index cols = _m.cols(); in bandmatrix() local
24 MatrixType m(rows,cols,supers,subs); in bandmatrix()
26 DenseMatrixType dm1(rows,cols); in bandmatrix()
44 for (int i=0; i<cols; ++i) in bandmatrix()
49 Index d = (std::min)(rows,cols); in bandmatrix()
50 Index a = std::max<Index>(0,cols-d-supers); in bandmatrix()
53 dm1.block(0,supers+1,cols-supers-1-a,cols-supers-1-a).template triangularView<Upper>().setZero(); in bandmatrix()
55 if(b>0) dm1.block(d+subs,0,b,cols).setZero(); in bandmatrix()
69 Index cols = internal::random<Index>(1,10); in test_bandmatrix() local
70 Index sups = internal::random<Index>(0,cols-1); in test_bandmatrix()
[all …]
/external/ceres-solver/internal/ceres/
Ddense_sparse_matrix.cc69 const int *cols = m.cols(); in DenseSparseMatrix() local
73 m_(rows[i], cols[i]) += values[i]; in DenseSparseMatrix()
112 m_.resize(m_.rows() + m_.cols(), m_.cols()); in AppendDiagonal()
114 m_.block(0, 0, tmp.rows(), tmp.cols()) = tmp; in AppendDiagonal()
118 m_.bottomLeftCorner(m_.cols(), m_.cols()) = in AppendDiagonal()
119 ConstVectorRef(d, m_.cols()).asDiagonal(); in AppendDiagonal()
131 return m_.rows() - m_.cols(); in num_rows()
137 return m_.cols(); in num_cols()
142 return (m_.rows() - m_.cols()) * m_.cols(); in num_nonzeros()
144 return m_.rows() * m_.cols(); in num_nonzeros()
[all …]
Dcompressed_col_sparse_matrix_utils.h72 const IntegerType* cols, in SolveUpperTriangularInPlace() argument
76 rhs_and_solution[c] /= values[cols[c + 1] - 1]; in SolveUpperTriangularInPlace()
77 for (IntegerType idx = cols[c]; idx < cols[c + 1] - 1; ++idx) { in SolveUpperTriangularInPlace()
93 const IntegerType* cols, in SolveUpperTriangularTransposeInPlace() argument
97 for (IntegerType idx = cols[c]; idx < cols[c + 1] - 1; ++idx) { in SolveUpperTriangularTransposeInPlace()
102 rhs_and_solution[c] = rhs_and_solution[c] / values[cols[c + 1] - 1]; in SolveUpperTriangularTransposeInPlace()
119 const IntegerType* cols, in SolveRTRWithSparseRHS() argument
124 solution[rhs_nonzero_index] = 1.0 / values[cols[rhs_nonzero_index + 1] - 1]; in SolveRTRWithSparseRHS()
127 for (IntegerType idx = cols[c]; idx < cols[c + 1] - 1; ++idx) { in SolveRTRWithSparseRHS()
133 solution[c] = solution[c] / values[cols[c + 1] - 1]; in SolveRTRWithSparseRHS()
[all …]
Dcompressed_col_sparse_matrix_utils_test.cc92 int* cols) { in FillBlock() argument
107 cols[offset] = col_pos + c; in FillBlock()
135 int* cols = tsm.mutable_cols(); in TEST() local
142 rows + offset, cols + offset); in TEST()
199 cols.resize(5); in SetUp()
203 cols[0] = 0; in SetUp()
207 cols[1] = 1; in SetUp()
211 cols[2] = 2; in SetUp()
217 cols[3] = 4; in SetUp()
225 cols[4] = 7; in SetUp()
[all …]
/external/eigen/bench/
Dsparse_product.cpp101 int cols = SIZE; in main() local
104 EigenSparseMatrix sm1(rows,cols), sm2(rows,cols), sm3(rows,cols), sm4(rows,cols); in main()
111 fillMatrix2(nnzPerCol, rows, cols, sm1); in main()
112 fillMatrix2(nnzPerCol, rows, cols, sm2); in main()
119 DenseMatrix m1(rows,cols), m2(rows,cols), m3(rows,cols); in main()
155 …std::cout << "Eigen sparse\t" << sm1.nonZeros()/(float(sm1.rows())*float(sm1.cols()))*100 << "% * " in main()
156 << sm2.nonZeros()/(float(sm2.rows())*float(sm2.cols()))*100 << "%\n"; in main()
254 UBlasSparse m1(rows,cols), m2(rows,cols), m3(rows,cols); in main()
267 GmmDynSparse gmmT3(rows,cols); in main()
268 GmmSparse m1(rows,cols), m2(rows,cols), m3(rows,cols); in main()
[all …]
Dsparse_transpose.cpp39 int cols = SIZE; in main() local
42 EigenSparseMatrix sm1(rows,cols), sm3(rows,cols); in main()
47 fillMatrix(density, rows, cols, sm1); in main()
52 DenseMatrix m1(rows,cols), m3(rows,cols); in main()
59 std::cout << "Non zeros: " << sm1.nonZeros()/float(sm1.rows()*sm1.cols())*100 << "%\n"; in main()
81 GmmDynSparse gmmT3(rows,cols); in main()
82 GmmSparse m1(rows,cols), m3(rows,cols); in main()
92 MtlSparse m1(rows,cols), m3(rows,cols); in main()
Dsparse_trisolver.cpp40 void fillMatrix(float density, int rows, int cols, EigenSparseTriMatrix& dst) in fillMatrix() argument
42 dst.startFill(rows*cols*density); in fillMatrix()
43 for(int j = 0; j < cols; j++) in fillMatrix()
59 int cols = SIZE; in main() local
63 EigenSparseTriMatrix sm1(rows,cols); in main()
65 DenseVector b = DenseVector::Random(cols); in main()
66 DenseVector x = DenseVector::Random(cols); in main()
72 EigenSparseTriMatrix sm1(rows, cols); in main()
73 fillMatrix(density, rows, cols, sm1); in main()
81 DenseMatrix m1(rows,cols); in main()
[all …]
Dspmv.cpp41 int cols = size; in main() local
55 cols = atoi(argv[i]+1); in main()
80 …std::cout << "SpMV " << rows << " x " << cols << " with " << nnzPerCol << " non zeros per column. … in main()
82 EigenSparseMatrix sm(rows,cols); in main()
83 DenseVector dv(cols), res(rows); in main()
91 fillMatrix2(nnzPerCol, rows, cols, sm); in main()
96 DenseMatrix dm(rows,cols), (rows,cols); in main()
137 om = oski_CreateMatCSC(sm._outerIndexPtr(), sm._innerIndexPtr(), sm._valuePtr(), rows, cols, in main()
139 ov = oski_CreateVecView(dv.data(), cols, STRIDE_UNIT); in main()
173 UblasMatrix um(rows,cols); in main()
[all …]
/external/valgrind/main/drd/tests/
Domp_matinv.c44 static elem_t* new_matrix(const int rows, const int cols) in new_matrix() argument
47 assert(cols > 0); in new_matrix()
48 return malloc(rows * cols * sizeof(elem_t)); in new_matrix()
58 static void init_matrix(elem_t* const a, const int rows, const int cols) in init_matrix() argument
65 a[i * cols + j] = 1.0 / (1 + abs(i-j)); in init_matrix()
72 const elem_t* const a, const int rows, const int cols) in print_matrix() argument
78 for (j = 0; j < cols; j++) in print_matrix()
80 printf("%g ", a[i * cols + j]); in print_matrix()
158 static void gj(elem_t* const a, const int rows, const int cols) in gj() argument
169 if (a[k * cols + i] > a[j * cols + i]) in gj()
[all …]
Dmatinv.c36 int cols; member
56 static elem_t* new_matrix(const int rows, const int cols) in new_matrix() argument
59 assert(cols > 0); in new_matrix()
60 return malloc(rows * cols * sizeof(elem_t)); in new_matrix()
70 static void init_matrix(elem_t* const a, const int rows, const int cols) in init_matrix() argument
77 a[i * cols + j] = 1.0 / (1 + abs(i-j)); in init_matrix()
84 const elem_t* const a, const int rows, const int cols) in print_matrix() argument
90 for (j = 0; j < cols; j++) in print_matrix()
92 printf("%g ", a[i * cols + j]); in print_matrix()
175 const int cols = p->cols; in gj_threadfunc() local
[all …]
/external/eigen/Eigen/src/QR/
DHouseholderQR.h76 HouseholderQR(Index rows, Index cols) in HouseholderQR() argument
77 : m_qr(rows, cols), in HouseholderQR()
78 m_hCoeffs((std::min)(rows,cols)), in HouseholderQR()
79 m_temp(cols), in HouseholderQR()
95 : m_qr(matrix.rows(), matrix.cols()), in HouseholderQR()
96 m_hCoeffs((std::min)(matrix.rows(),matrix.cols())), in HouseholderQR()
97 m_temp(matrix.cols()), in HouseholderQR()
183 inline Index cols() const { return m_qr.cols(); } in cols() function
203 …eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!… in absDeterminant()
211 …eigen_assert(m_qr.rows() == m_qr.cols() && "You can't take the determinant of a non-square matrix!… in logAbsDeterminant()
[all …]
DColPivHouseholderQR.h88 ColPivHouseholderQR(Index rows, Index cols) in ColPivHouseholderQR() argument
89 : m_qr(rows, cols), in ColPivHouseholderQR()
90 m_hCoeffs((std::min)(rows,cols)), in ColPivHouseholderQR()
91 m_colsPermutation(PermIndexType(cols)), in ColPivHouseholderQR()
92 m_colsTranspositions(cols), in ColPivHouseholderQR()
93 m_temp(cols), in ColPivHouseholderQR()
94 m_colSqNorms(cols), in ColPivHouseholderQR()
111 : m_qr(matrix.rows(), matrix.cols()), in ColPivHouseholderQR()
112 m_hCoeffs((std::min)(matrix.rows(),matrix.cols())), in ColPivHouseholderQR()
113 m_colsPermutation(PermIndexType(matrix.cols())), in ColPivHouseholderQR()
[all …]
DFullPivHouseholderQR.h94 FullPivHouseholderQR(Index rows, Index cols)
95 : m_qr(rows, cols),
96 m_hCoeffs((std::min)(rows,cols)),
97 m_rows_transpositions((std::min)(rows,cols)),
98 m_cols_transpositions((std::min)(rows,cols)),
99 m_cols_permutation(cols),
100 m_temp(cols),
117 : m_qr(matrix.rows(), matrix.cols()),
118 m_hCoeffs((std::min)(matrix.rows(), matrix.cols())),
119 m_rows_transpositions((std::min)(matrix.rows(), matrix.cols())),
[all …]
/external/eigen/doc/
DAsciiQuickReference.txt6 Matrix<double, 3, 3> A; // Fixed rows and cols. Same as Matrix3d.
7 Matrix<double, 3, Dynamic> B; // Fixed rows, dynamic cols.
20 C.cols() // size(C,2) // number of columns
27 B.resize(3, 9); // Ok; only dynamic cols changed.
30 4, 5, 6, // matrices, which are stacked along cols
36 MatrixXd::Identity(rows,cols) // eye(rows,cols)
37 C.setIdentity(rows,cols) // C = eye(rows,cols)
38 MatrixXd::Zero(rows,cols) // zeros(rows,cols)
39 C.setZero(rows,cols) // C = ones(rows,cols)
40 MatrixXd::Ones(rows,cols) // ones(rows,cols)
[all …]
/external/eigen/Eigen/src/LU/
DFullPivLU.h80 FullPivLU(Index rows, Index cols);
315 return cols() - rank(); in dimensionOfKernel()
328 return rank() == cols(); in isInjective()
353 return isInjective() && (m_lu.rows() == m_lu.cols()); in isInvertible()
366 … eigen_assert(m_lu.rows() == m_lu.cols() && "You can't take the inverse of a non-square matrix!"); in inverse()
368 (*this, MatrixType::Identity(m_lu.rows(), m_lu.cols())); in inverse()
374 inline Index cols() const { return m_lu.cols(); } in cols() function
394 FullPivLU<MatrixType>::FullPivLU(Index rows, Index cols) in FullPivLU() argument
395 : m_lu(rows, cols), in FullPivLU()
397 m_q(cols), in FullPivLU()
[all …]
/external/eigen/Eigen/src/Core/
DPlainObjectBase.h38 static EIGEN_ALWAYS_INLINE void run(Index rows, Index cols)
43 bool error = (rows == 0 || cols == 0) ? false
44 : (rows > max_index / cols);
136 EIGEN_STRONG_INLINE Index cols() const { return m_storage.cols(); }
141 return m_storage.data()[colId + rowId * m_storage.cols()];
154 return m_storage.data()[colId + rowId * m_storage.cols()];
167 return m_storage.data()[colId + rowId * m_storage.cols()];
183 ? colId + rowId * m_storage.cols()
200 ? colId + rowId * m_storage.cols()
304 resize(nbRows, cols());
[all …]
/external/eigen/test/eigen2/
Deigen2_array.cpp24 int cols = m.cols(); in array() local
26 MatrixType m1 = MatrixType::Random(rows, cols), in array()
27 m2 = MatrixType::Random(rows, cols), in array()
28 m3(rows, cols); in array()
35 VERIFY_IS_APPROX(m1.cwise() + s1, MatrixType::Constant(rows,cols,s1) + m1); in array()
36 VERIFY_IS_APPROX((m1*Scalar(2)).cwise() - s2, (m1+m1) - MatrixType::Constant(rows,cols,s2) ); in array()
59 int cols = m.cols(); in comparisons() local
62 c = ei_random<int>(0, cols-1); in comparisons()
64 MatrixType m1 = MatrixType::Random(rows, cols), in comparisons()
65 m2 = MatrixType::Random(rows, cols), in comparisons()
[all …]
Deigen2_sparse_solvers.cpp17 Matrix<Scalar,Dynamic,Dynamic> aux(refMat.rows(),refMat.cols()); in initSPD()
26 for (int j=0 ; j<sparseMat.cols(); ++j) in initSPD()
33 template<typename Scalar> void sparse_solvers(int rows, int cols) in sparse_solvers() argument
35 double density = std::max(8./(rows*cols), 0.01); in sparse_solvers()
48 SparseMatrix<Scalar> m2(rows, cols); in sparse_solvers()
49 DenseMatrix refMat2 = DenseMatrix::Zero(rows, cols); in sparse_solvers()
75 SparseMatrix<Scalar> m2(rows, cols); in sparse_solvers()
76 DenseMatrix refMat2(rows, cols); in sparse_solvers()
78 DenseVector b = DenseVector::Random(cols); in sparse_solvers()
79 DenseVector refX(cols), x(cols); in sparse_solvers()
[all …]
Dproduct.h37 int cols = m.cols(); in product() local
41 MatrixType m1 = MatrixType::Random(rows, cols), in product()
42 m2 = MatrixType::Random(rows, cols), in product()
43 m3(rows, cols), in product()
44 mzero = MatrixType::Zero(rows, cols); in product()
50 square2 = ColSquareMatrixType::Random(cols, cols), in product()
51 res2 = ColSquareMatrixType::Random(cols, cols); in product()
55 ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols); in product()
61 c = ei_random<int>(0, cols-1); in product()
87 VERIFY_IS_APPROX(MatrixType::Identity(rows, cols)(r,c), static_cast<Scalar>(r==c)); in product()
[all …]

12345678910>>...29