def corr(args):
    if args.alg == 0:
        c = PearsonCorrelation(args.h5database)
        corr_matrix = c.find_correlations()
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(corr_matrix, f)
    elif args.alg == 1:
        c = FourierApproximation(args.h5database)
        corr_matrix = c.find_correlations(args.k, args.T, args.B, args.e)
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(corr_matrix, f)
    elif args.alg == 2:
        c = BooleanCorrelation(args.h5database, args.validate)
        boolean_corr_matrix = c.boolean_approximation(args.T)
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(boolean_corr_matrix, f)
def corr(args):
    if args.alg == 0:
        c = PearsonCorrelation(args.h5database)
        corr_matrix = c.find_correlations()
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(corr_matrix, f)
    elif args.alg == 1:
        c = FourierApproximation(args.h5database)
        corr_matrix = c.find_correlations(args.k, args.T, args.B, args.e)
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(corr_matrix, f)
    elif args.alg == 2:
        c = BooleanCorrelation(args.h5database, args.validate)
        boolean_corr_matrix = c.boolean_approximation(args.T)
        if args.out is not None:
            with open(args.out, 'wb') as f:
                pickle.dump(boolean_corr_matrix, f)