MCPcopy Create free account
hub / github.com/Derious/cuMPC / resize

Function resize

dependence/eigen-3.4.0/test/array_for_matrix.cpp:216–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216template<typename MatrixTraits> void resize(const MatrixTraits& t)
217{
218 typedef typename MatrixTraits::Scalar Scalar;
219 typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
220 typedef Array<Scalar,Dynamic,Dynamic> Array2DType;
221 typedef Matrix<Scalar,Dynamic,1> VectorType;
222 typedef Array<Scalar,Dynamic,1> Array1DType;
223
224 Index rows = t.rows(), cols = t.cols();
225
226 MatrixType m(rows,cols);
227 VectorType v(rows);
228 Array2DType a2(rows,cols);
229 Array1DType a1(rows);
230
231 m.array().resize(rows+1,cols+1);
232 VERIFY(m.rows()==rows+1 && m.cols()==cols+1);
233 a2.matrix().resize(rows+1,cols+1);
234 VERIFY(a2.rows()==rows+1 && a2.cols()==cols+1);
235 v.array().resize(cols);
236 VERIFY(v.size()==cols);
237 a1.matrix().resize(cols);
238 VERIFY(a1.size()==cols);
239}
240
241template<int>
242void regression_bug_654()

Callers 1

EIGEN_DECLARE_TESTFunction · 0.70

Calls 6

rowsMethod · 0.45
colsMethod · 0.45
resizeMethod · 0.45
arrayMethod · 0.45
matrixMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected