compute.h File Reference

Recognition itself. More...

#include <string>
#include <map>
#include <vector>
#include "db.h"
#include "config.h"

Include dependency graph for compute.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  res_stat
 This structure contains statistics about found prefixes. More...

Typedefs

typedef std::map< std::string,
res_stat
results
 List of found prefixes.

Functions

resultsfind_it (db *stats, const char *file, const char *condition, const char *statsstr, bool suffix=false)
 Prefix recognition itself.
void print_it (results *what, const char *where, const char *format, unsigned int app)
 Prints results. Nothing interesting.


Detailed Description

Recognition itself.

This module contains main recognition and printout function. Recognition function tries to recognize as many prefixes as it can and store results in structure used by printout function. Recognition is done by evaluating expression provided by user.

See also:
find_it() print_it() evaluate()

Typedef Documentation

typedef std::map< std::string, res_stat > results

List of found prefixes.

First item in the map is prefix itself. Second item represent some statistics about this prefix and informations, why do we think this is a prefix.


Function Documentation

results* find_it ( db stats,
const char *  file,
const char *  condition,
const char *  statsstr,
bool  suffix = false 
)

Prefix recognition itself.

This function uses mentioned condition to find prefixes. Everything what seems like prefix is saved into newly created database of results with statistics specified by parameter. If there is more then one occurrence of prefix, statistics are averaged.

Parameters:
stats Database with statistics.
file File with datas.
condition Condition on prefix.
statsstr Statistics to be computed.
suffix Do we want suffixes?
Returns:
Returns results with computed statistics.
See also:
evaluate() res_stat

References add_task(), affstring, CHECK_PTR, thread_arg::common, thread_common_arg::condition, find_it_thread(), thread_common_arg::input, thread_common_arg::prefs, thread_common_arg::stats, thread_common_arg::statsstr, thread_common_arg::suffix, VPRINTF, wait_for_empty(), and WPRINTF.

Referenced by main().


Generated on Sat Dec 20 11:32:17 2008 for Affisix by  doxygen 1.5.7.1