comparison audioDB.cpp @ 277:abfb26e08d9c audiodb-debian

Merge trunk changes -r326:386 into audiodb-debian branch. Plus new debian/changelog version. (Should have used an epoch really, but couldn't be bothered; TODO: work out a sane version numbering policy).
author mas01cr
date Tue, 01 Jul 2008 09:12:40 +0000
parents 15b8ff55ea5b
children
comparison
equal deleted inserted replaced
246:cbf51690c78c 277:abfb26e08d9c
134 verbosity = 1; 134 verbosity = 1;
135 } 135 }
136 } 136 }
137 137
138 if(args_info.size_given) { 138 if(args_info.size_given) {
139 if(args_info.datasize_given) {
140 error("both --size and --datasize given", "");
141 }
142 if(args_info.ntracks_given) {
143 error("both --size and --ntracks given", "");
144 }
145 if(args_info.datadim_given) {
146 error("both --size and --datadim given", "");
147 }
139 if (args_info.size_arg < 50 || args_info.size_arg > 32000) { 148 if (args_info.size_arg < 50 || args_info.size_arg > 32000) {
140 error("Size out of range", ""); 149 error("Size out of range", "");
141 } 150 }
142 size = (off_t) args_info.size_arg * 1000000; 151 double ratio = (double) args_info.size_arg * 1000000 / ((double) O2_DEFAULTDBSIZE);
152 /* FIXME: what's the safe way of doing this? */
153 datasize = (unsigned int) ceil(datasize * ratio);
154 ntracks = (unsigned int) ceil(ntracks * ratio);
155 } else {
156 if(args_info.datasize_given) {
157 datasize = args_info.datasize_arg;
158 }
159 if(args_info.ntracks_given) {
160 ntracks = args_info.ntracks_arg;
161 }
162 if(args_info.datadim_given) {
163 datadim = args_info.datadim_arg;
164 }
143 } 165 }
144 166
145 if(args_info.radius_given) { 167 if(args_info.radius_given) {
146 radius = args_info.radius_arg; 168 radius = args_info.radius_arg;
147 if(radius <= 0 || radius > 1000000000) { 169 if(radius <= 0 || radius > 1000000000) {
304 queryType=O2_TRACK_QUERY; 326 queryType=O2_TRACK_QUERY;
305 else if(strncmp(args_info.QUERY_arg, "point", MAXSTR)==0) 327 else if(strncmp(args_info.QUERY_arg, "point", MAXSTR)==0)
306 queryType=O2_POINT_QUERY; 328 queryType=O2_POINT_QUERY;
307 else if(strncmp(args_info.QUERY_arg, "sequence", MAXSTR)==0) 329 else if(strncmp(args_info.QUERY_arg, "sequence", MAXSTR)==0)
308 queryType=O2_SEQUENCE_QUERY; 330 queryType=O2_SEQUENCE_QUERY;
331 else if(strncmp(args_info.QUERY_arg, "nsequence", MAXSTR)==0)
332 queryType=O2_N_SEQUENCE_QUERY;
333 else if(strncmp(args_info.QUERY_arg, "onetoonensequence", MAXSTR)==0)
334 queryType=O2_ONE_TO_ONE_N_SEQUENCE_QUERY;
309 else 335 else
310 error("unsupported query type",args_info.QUERY_arg); 336 error("unsupported query type",args_info.QUERY_arg);
311 337
312 if(!args_info.exhaustive_flag){ 338 if(!args_info.exhaustive_flag){
313 queryPoint = args_info.qpoint_arg; 339 queryPoint = args_info.qpoint_arg;
315 if(queryPoint<0 || queryPoint >10000) 341 if(queryPoint<0 || queryPoint >10000)
316 error("queryPoint out of range: 0 <= queryPoint <= 10000"); 342 error("queryPoint out of range: 0 <= queryPoint <= 10000");
317 } 343 }
318 344
319 pointNN = args_info.pointnn_arg; 345 pointNN = args_info.pointnn_arg;
320 if(pointNN < 1 || pointNN > 1000) { 346 if(pointNN < 1 || pointNN > O2_MAXNN) {
321 error("pointNN out of range: 1 <= pointNN <= 1000"); 347 error("pointNN out of range: 1 <= pointNN <= 1000000");
322 } 348 }
323 trackNN = args_info.resultlength_arg; 349 trackNN = args_info.resultlength_arg;
324 if(trackNN < 1 || trackNN > 1000) { 350 if(trackNN < 1 || trackNN > O2_MAXNN) {
325 error("resultlength out of range: 1 <= resultlength <= 1000"); 351 error("resultlength out of range: 1 <= resultlength <= 1000000");
326 } 352 }
327 sequenceLength = args_info.sequencelength_arg; 353 sequenceLength = args_info.sequencelength_arg;
328 if(sequenceLength < 1 || sequenceLength > 1000) { 354 if(sequenceLength < 1 || sequenceLength > 1000) {
329 error("seqlen out of range: 1 <= seqlen <= 1000"); 355 error("seqlen out of range: 1 <= seqlen <= 1000");
330 } 356 }