Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download
Views: 8796
1
r"""
2
Check the bent function Cayley graph databases.
3
"""
4
5
#*****************************************************************************
6
# Copyright (C) 2018 Paul Leopardi [email protected]
7
#
8
# Distributed under the terms of the GNU General Public License (GPL)
9
# as published by the Free Software Foundation; either version 2 of
10
# the License, or (at your option) any later version.
11
# http://www.gnu.org/licenses/
12
#*****************************************************************************
13
14
import datetime
15
import json
16
import psycopg2
17
18
from boolean_cayley_graphs.bent_function import BentFunction
19
from boolean_cayley_graphs.bent_function_cayley_graph_classification import BentFunctionCayleyGraphClassification
20
from boolean_cayley_graphs.classification_database_psycopg2 import *
21
22
def check_bfcg_database(auth, dbname, nbr_f):
23
24
print(dbname, ":")
25
conn = connect_to_database(
26
dbname,
27
user=auth["user"],
28
password=auth["password"],
29
host=auth["host"])
30
31
for i in range(1, nbr_f + 1):
32
stri = ("%01d" if nbr_f < 10 else "%02d") % i
33
name = dbname + "_" + stri
34
print(datetime.datetime.now(), stri)
35
cgc_check = select_classification_where_name(
36
conn,
37
name)
38
cgc_check.report()
39
40
conn.close()
41
print(datetime.datetime.now())
42
43
44
with open("postgresql-auth.json") as auth_file:
45
auth = json.load(auth_file)
46
47
check_bfcg_database(auth, "p2", 1)
48
check_bfcg_database(auth, "p4", 1)
49
check_bfcg_database(auth, "p6", 4)
50
check_bfcg_database(auth, "p8", 10)
51
check_bfcg_database(auth, "sigma", 4)
52
check_bfcg_database(auth, "tau", 4)
53
54
55