Skip to content
Snippets Groups Projects
Select Git revision
  • split_files
  • develop default
  • Blockage
  • GuidoBasten
  • Anticipation_Model
  • tgf19ts
  • 313-waiting-behaviour
  • tgf19mc
  • wa_testing
  • trajectories
  • 287-waitingarea
  • 320-one-sided-closed-doors
  • kapakrit-anna
  • 311-improve-ff
  • 306-schedule-for-was
  • 294-events
  • 307-temp-close
  • 302-external-files
  • 298-sources
  • 293-statistics-crossings
  • v0.8.4
  • v0.8.3
  • v0.8.2
  • v0.8.1
  • v0.8
  • v0.7
  • v0.6
  • v0.5-alpha
  • v0.5-alpha1
  • v0.4
30 results

Configuration.h

Blame
  • tsqr_elemental.cpp 5.33 KiB
    #include <El.hpp>
    #include <stdio.h>
    #include <iostream>
    #include <vector>
    #include <stdlib.h>
    #include <cmath>
    #include <time.h>
    
    #include <boost/program_options.hpp>
    #include <omp.h>
    
    using namespace El;
    
    std::tuple<double, double> validation(DistMatrix<double,VC,  STAR>& Q, DistMatrix<double,STAR,STAR>& R, DistMatrix<double,VC,  STAR>& A){
    
        const Grid& g = A.Grid();
        const Int m = A.Height();
        const Int n = A.Width();
        const Int maxDim = Max(m,n);
        const double eps = 5*10e-16;
        const double oneNormA = OneNorm( A );
    
        // Form I - Q^H Q
        DistMatrix<double> Z(g);
    
        Identity( Z, n, n );
    
        Herk( UPPER, ADJOINT, -1.0, Q, 1.0, Z );
    
        const double infOrthogError = HermitianInfinityNorm( UPPER, Z );
    
        const double relOrthogError = infOrthogError / (eps*maxDim); 
    
        // Form A - Q R
        LocalGemm( NORMAL, NORMAL, -1.0, Q, R, 1.0, A );
    
        const double infError = InfinityNorm( A );
    
        const double relError = infError / (eps*maxDim*oneNormA);
    
        return std::make_tuple(relOrthogError, relError);
    
    }
    
    DistMatrix<double,STAR,STAR> ConstructR(AbstractDistMatrix<double>& A, qr::TreeData<double>& treeData )
    {
        if( A.RowDist() != STAR ){
    
            LogicError("Invalid row distribution for TSQR");
    
        }
    
        const Grid& g = A.Grid();
    
        DistMatrix<double,CIRC,CIRC> RRoot(g);
    
        if( A.ColRank() == 0 )
        {
            const Int n = A.Width();
    
            auto R = qr::ts::RootQR(A,treeData);
    
            auto RTop = R( IR(0,n), IR(0,n) );
    
            RRoot.CopyFromRoot( RTop );
    
            MakeTrapezoidal( UPPER, RRoot );
    
        }
        else