-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrandom-discrete-morse-sql.pl
More file actions
executable file
·38 lines (24 loc) · 967 Bytes
/
Copy pathrandom-discrete-morse-sql.pl
File metadata and controls
executable file
·38 lines (24 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/local/bin/polymake --script
# Attempt to find a spherical discrete morse vector
use application "topaz";
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect("dbi:Pg:dbname=researchdata_test", '', '', {AutoCommit => 0});
my $sth = $dbh->prepare("UPDATE complexes SET type = 'S^4', recognized = true, remark = 'discrete_morse' WHERE signature = (?);");
my $fetch = $dbh->prepare("SELECT type, recognized FROM complexes WHERE signature = (?);");
require "./lib.pl"; # load common functions
my $basepath="../../researchdata";
my $regdesc=shift;
$fetch->execute($regdesc);
my @row = $fetch->fetchrow_array;
if ( ! ($row[1]) ) {
my $infile = "$basepath/json_simp_lex_bistellar_flat4/$regdesc.poly";
my $q= load_data($infile); #gen_simp_comp($regdesc);
my $p = random_discrete_morse($q, rounds => 50000, strategy=>1, try_until_reached=>[1, 0, 0, 0, 1]);
my $sph = $p->{[1,0,0,0,1]};
if ($sph) {
$sth->execute($regdesc);
}
}
$dbh->commit;