MCPcopy Create free account
hub / github.com/avaxman/Directional / resize

Function resize

external/eigen/test/array_for_matrix.cpp:250–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248}
249
250template<typename MatrixTraits> void resize(const MatrixTraits& t)
251{
252 typedef typename MatrixTraits::Scalar Scalar;
253 typedef Matrix<Scalar,Dynamic,Dynamic> MatrixType;
254 typedef Array<Scalar,Dynamic,Dynamic> Array2DType;
255 typedef Matrix<Scalar,Dynamic,1> VectorType;
256 typedef Array<Scalar,Dynamic,1> Array1DType;
257
258 Index rows = t.rows(), cols = t.cols();
259
260 MatrixType m(rows,cols);
261 VectorType v(rows);
262 Array2DType a2(rows,cols);
263 Array1DType a1(rows);
264
265 m.array().resize(rows+1,cols+1);
266 VERIFY(m.rows()==rows+1 && m.cols()==cols+1);
267 a2.matrix().resize(rows+1,cols+1);
268 VERIFY(a2.rows()==rows+1 && a2.cols()==cols+1);
269 v.array().resize(cols);
270 VERIFY(v.size()==cols);
271 a1.matrix().resize(cols);
272 VERIFY(a1.size()==cols);
273}
274
275template<int>
276void 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