Mercurial > hg > audiodb
changeset 274:1c76d5f41708 sampling
Let the user specify the number of samples to take on the command-line.
author | mas01cr |
---|---|
date | Mon, 23 Jun 2008 09:49:22 +0000 |
parents | c8c97224f3c7 |
children | 5c34b71c5ffa |
files | audioDB.cpp audioDB.h gengetopt.in sample.cpp |
diffstat | 4 files changed, 11 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/audioDB.cpp Tue Jun 17 12:27:01 2008 +0000 +++ b/audioDB.cpp Mon Jun 23 09:49:22 2008 +0000 @@ -220,6 +220,7 @@ if(sequenceLength < 1 || sequenceLength > 1000) { error("seqlen out of range: 1 <= seqlen <= 1000"); } + nsamples = args_info.nsamples_arg; return 0; }
--- a/audioDB.h Tue Jun 17 12:27:01 2008 +0000 +++ b/audioDB.h Mon Jun 23 09:49:22 2008 +0000 @@ -177,6 +177,8 @@ // Flags and parameters unsigned verbosity; // how much do we want to know? + unsigned nsamples; + //off_t size; // given size (for creation) unsigned datasize; // size in MB unsigned ntracks; @@ -294,6 +296,7 @@ powerTableLength(0), \ l2normTableLength(0), \ verbosity(1), \ + nsamples(2000), \ datasize(O2_DEFAULT_DATASIZE), \ ntracks(O2_DEFAULT_NTRACKS), \ datadim(O2_DEFAULT_DATADIM), \
--- a/gengetopt.in Tue Jun 17 12:27:01 2008 +0000 +++ b/gengetopt.in Mon Jun 23 09:49:22 2008 +0000 @@ -17,16 +17,21 @@ option "ntracks" - "capacity of database for tracks" int dependon="NEW" default="20000" optional option "datadim" - "dimensionality of stored data" int dependon="NEW" default="9" optional -section "Database Maintenance" sectiondesc="Querying, tweaking and dumping databases." +section "Database Maintenance" sectiondesc="Tweaking and dumping databases." -option "STATUS" S "output database information to stdout." dependon="database" optional option "DUMP" D "output all entries: index key size." dependon="database" optional option "output" - "output directory" string dependon="DUMP" default="audioDB.dump" optional option "L2NORM" L "unit norm vectors and norm all future inserts." dependon="database" optional option "POWER" P "turn on power flag for database." dependon="database" optional + +section "Database Information" sectiondesc="Information about databases." + +option "STATUS" S "output database information to stdout." dependon="database" optional option "SAMPLE" X "sample statistics for database." dependon="database" optional +option "nsamples" - "number of pairwise samples to take." dependon="SAMPLE" int typestr="number" default="2000" optional section "Database Insertion" sectiondesc="The following commands insert feature files, with optional keys and timestamps.\n" + option "INSERT" I "add feature vectors to an existing database." dependon="features" optional option "UPDATE" U "replace inserted vectors associated with key with new input vectors." dependon="features" dependon="key" dependon="database" optional hidden option "features" f "binary series of vectors file {int sz:ieee double[][sz]:eof}." string typestr="filename" dependon="database" optional
--- a/sample.cpp Tue Jun 17 12:27:01 2008 +0000 +++ b/sample.cpp Mon Jun 23 09:49:22 2008 +0000 @@ -99,8 +99,6 @@ double sumdist = 0; double sumlogdist = 0; - unsigned int nsamples = 20490; - for (unsigned int i = 0; i < nsamples;) { unsigned track1 = random_track(propTable, total); unsigned track2 = random_track(propTable, total);