// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009 Gael Guennebaud // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 3 of the License, or (at your option) any later version. // // Alternatively, you can redistribute it and/or // modify it under the terms of the GNU General Public License as // published by the Free Software Foundation; either version 2 of // the License, or (at your option) any later version. // // Eigen is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the // GNU General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License and a copy of the GNU General Public License along with // Eigen. If not, see . #include "main.h" template void replicate(const MatrixType& m) { /* this test covers the following files: Replicate.cpp */ typedef typename MatrixType::Index Index; typedef typename MatrixType::Scalar Scalar; typedef typename NumTraits::Real RealScalar; typedef Matrix VectorType; typedef Matrix MatrixX; typedef Matrix VectorX; Index rows = m.rows(); Index cols = m.cols(); MatrixType m1 = MatrixType::Random(rows, cols), m2 = MatrixType::Random(rows, cols); VectorType v1 = VectorType::Random(rows); MatrixX x1, x2; VectorX vx1; int f1 = internal::random(1,10), f2 = internal::random(1,10); x1.resize(rows*f1,cols*f2); for(int j=0; j())); x2.resize(rows,f1); for (int j=0; j()) ); CALL_SUBTEST_2( replicate(Vector2f()) ); CALL_SUBTEST_3( replicate(Vector3d()) ); CALL_SUBTEST_4( replicate(Vector4f()) ); CALL_SUBTEST_5( replicate(VectorXf(16)) ); CALL_SUBTEST_6( replicate(VectorXcd(10)) ); } }