Commit 124ea2e0 authored by dagal's avatar dagal
Browse files

I SWEAR IT TOOK ME ONE FULL DAY TO FIND THIS BUG

parent 5f5b0138
......@@ -6,8 +6,8 @@ CC = g++
## Uncomment for using a dictionary represented as a bitmap-RRR
#export CXXFLAGS = -std=c++11 -O9 -m64 -DNDEBUG -DDICTIONARY_RRR -I libcds/includes/
#export CXXFLAGS = -std=c++11 -O9 -m64 -DNDEBUG -DEXPERIMENTS -fPIC -DDICTIONARY_RRR -I libcds/includes/
export CXXFLAGS = -std=c++11 -g -O0 -m64 -Wall -DEXPERIMENTS -fPIC -DDICTIONARY_RRR -I libcds/includes/
export CXXFLAGS = -std=c++11 -O9 -m64 -DNDEBUG -DEXPERIMENTS -fPIC -DDICTIONARY_RRR -I libcds/includes/
#export CXXFLAGS = -std=c++11 -g -O0 -m64 -Wall -DEXPERIMENTS -fPIC -DDICTIONARY_RRR -I libcds/includes/
#######################################################################
......
......@@ -6,7 +6,7 @@ set(PROJECT_VENDOR "Alberto Ordóñez")
set(PROJECT_CONTACT "alberto.ordonez@udc.es")
set(PROJECT_DESCRIPTION "libcds y derivados")
set(CMAKE_PROJECT_NAME "libcds in libcds")
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_INSTALL_PREFIX /home/alberto/software)
set(CMAKE_COMPILER_IS_GNUCXX)
......
......@@ -593,6 +593,8 @@ namespace cds_static
if (i1>i2) return 0;
assert(i2 < n);
j1 = am->map(j1); j2 = am->map(j2);
if (limits!=NULL && tu) {
std::pair<uint,uint> limit_symbols = std::make_pair<uint,uint>(j2,j1);
std::pair<uint,uint> limit_levels;
......
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import re
def main(argv):
total = 0
queries = {}
trips = {}
with open(argv[1]) as qf:
for line in qf.readlines()[::2]:
q = list(filter(None, re.split(' |,|:|\n', line)))
key = (int(q[2]),int(q[4]))
if key not in queries:
queries[key] = [(q[1],q[3])]
else:
queries[key].append((q[1],q[3]))
for line in sys.stdin.readlines():
nodes = list(filter(None, re.split(',|:|\n', line)))
try:
#total += len(queries[(int(nodes[1]),int(nodes[-2]))])
#total += sum(1 for q in queries[(int(nodes[1]),int(nodes[-2]))] if q[0] == nodes[0])
#total += sum(1 for q in queries[(int(nodes[1]),int(nodes[-2]))] if q[1] == nodes[-3])
total += sum(1 for q in queries[(int(nodes[1]),int(nodes[-2]))] if q[0] == nodes[0] and q[1] == nodes[-3])
except KeyError:
pass
print(total)
if __name__ == "__main__":
main(sys.argv)
......@@ -169,11 +169,12 @@ int buildTimesIndex(struct graphDB *graph, char *build_options, void **index) {
for (size_t j = l; j < r; j++) {
sorted_times[l+line_occ[mapper->map(wcsa->l[j])]++] = wcsa->times[j];
}
l=r;
}
}
assert(r == wcsa->n);
wcsa->linesIndex = (void *) line_wms;
{
......@@ -1298,6 +1299,7 @@ int restrict_from_x_to_y(twcsa *g, TimeQuery *query, ulong lu, ulong ru, std::ve
if (query->subtype & XY_LINE_START) {
const auto lu0 = getPsiicsa(g->myicsa, lu);
const auto ru0 = getPsiicsa(g->myicsa, ru);
assert(ru-lu == ru0-lu0);
for (const auto &startLine : startLines) {
numocc = getRange(linesWM->at(0), lu0, ru0, startLine, startLine, &res);
......@@ -1347,7 +1349,7 @@ int restrict_from_x_to_y(twcsa *g, TimeQuery *query, ulong lu, ulong ru, std::ve
numocc = getRange(linesWM->at(v), lu-stop_offset, ru-stop_offset, endLine, endLine, &res);
if (numocc && query->subtype & XY_TIME_END) {
assert(res.first > 0);
assert(numocc == res.second-res.first+1);
assert(stop_offset+res.second < g->n);
const auto jcodes = getJCodes(g, endLine, query->values[3], start_time, end_time);
numocc = getTimeRange(g, stop_offset+res.first, stop_offset+res.second, jcodes.first, jcodes.second);
......
......@@ -153,7 +153,7 @@ typedef struct {
uint nodes; //number of nodes from [0 ... nodes]
uint maxtime; //maximum time in the dataset from [0 ... maxtime-1]
uint n_traj; // number of trajectories (zeros-1)
uint n_traj; // number of trajectories (zeros)
size_t n; //number of integers in s
uint *s; //including time and edges (S[0 .. nEntries*n)
......
......@@ -218,6 +218,7 @@ int gr_readRecords(struct graphDB *graph, FILE *f ) {
separator = fgetc(f);
if (separator == '\n') {
assert(traj_len % 2 == 0);
times[i] = t;
l[i] = graph->lines->at(line);
s[i++]=data;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment