/* * Copyright (C) FFLAS-FFPACK * Written by Clément Pernet * This file is Free Software and part of FFLAS-FFPACK. * * ========LICENCE======== * This file is part of the library FFLAS-FFPACK. * * FFLAS-FFPACK 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 2.1 of the License, or (at your option) any later version. * * This library 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 for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * ========LICENCE======== *. */ //-------------------------------------------------------------------------- // Test for the echelon factorisation //-------------------------------------------------------------------------- //#define __LUDIVINE_CUTOFF 1 #define __FFLASFFPACK_SEQUENTIAL #define __FFLASFFPACK_GAUSSJORDAN_BASECASE 25 #define __FFLASFFPACK_PLUQ_THRESHOLD 25 #include "fflas-ffpack/fflas-ffpack-config.h" #include #include #include #include #include "fflas-ffpack/utils/timer.h" #include "fflas-ffpack/ffpack/ffpack.h" #include "fflas-ffpack/utils/args-parser.h" #include "fflas-ffpack/utils/test-utils.h" #include "fflas-ffpack/utils/fflas_io.h" #include #include using namespace std; using namespace FFPACK; using namespace FFLAS; using Givaro::Modular; using Givaro::ModularBalanced; template bool test_colechelon(Field &F, size_t m, size_t n, size_t r, size_t iters, FFPACK::FFPACK_LU_TAG LuTag, RandIter& G, bool par) { typedef typename Field::Element Element ; Element * A = FFLAS::fflas_new (F,m,n); Element * B = FFLAS::fflas_new (F,m,n); Element * L = FFLAS::fflas_new (F,m,n); Element * U = FFLAS::fflas_new (F,n,n); Element * X = FFLAS::fflas_new (F,m,n); size_t lda = n; //!@todo check lda size_t *P = FFLAS::fflas_new(n); size_t *Q = FFLAS::fflas_new(m); size_t R = (size_t)-1; bool pass=true; for (size_t l=0;l bool test_redrowechelon(Field &F, size_t m, size_t n, size_t r, size_t iters, FFPACK::FFPACK_LU_TAG LuTag, RandIter& G, bool par) { typedef typename Field::Element Element ; Element * A = FFLAS::fflas_new (F,m,n); Element * B = FFLAS::fflas_new (F,m,n); Element * L = FFLAS::fflas_new (F,m,m); Element * U = FFLAS::fflas_new (F,m,n); Element * X = FFLAS::fflas_new (F,m,n); size_t lda = n; //!@todo check lda size_t *P = FFLAS::fflas_new(m); size_t *Q = FFLAS::fflas_new(n); size_t R = (size_t)-1; bool pass=true; for (size_t l=0;l bool run_with_field (Givaro::Integer q, uint64_t b, size_t m, size_t n, size_t r, size_t iters, uint64_t seed){ bool ok = true ; int nbit=(int)iters; while (ok && nbit){ // choose Field Field* F= chooseField(q,b,seed); if (F==nullptr) return true; typename Field::RandIter G(*F,b,seed++); std::ostringstream oss; F->write(oss); std::cout.fill('.'); std::cout<<"Checking "; std::cout.width(40); std::cout< >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,b,m,n,r,iters,seed); //ok = ok && run_with_field > >(q,b,m,n,r,iters,seed); // BUG: not available yet (missing division in the field ok = ok && run_with_field >(q,b,m,n,r,iters,seed); ok = ok && run_with_field >(q,(b?b:128_ui64),m/8+1,n/8+1,r/8+1,iters,seed); } while (loop && ok); return !ok ; } /* -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ // vim:sts=4:sw=4:ts=4:et:sr:cino=>s,f0,{0,g0,(0,\:0,t0,+0,=s