compute.cpp File Reference

Implementation of compute module. More...

#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "compute.h"
#include "helper.h"
#include "threads.h"
#include "functions.h"
#include "evaluator.h"

Include dependency graph for compute.cpp:


Data Structures

struct  thread_common_arg
 Thread shared arguments. More...
struct  thread_arg
 Thread argument. More...

Functions

void * find_it_thread (void *arg)
 Prefix recognition itself.
resultsfind_it (db *stats, const char *from, const char *condition, const char *statsstr, bool suffix)
 Prefix recognition itself.
void print_it (results *what, const char *to, const char *format, unsigned int app)
 Prints results.

Variables

unsigned int maxlen
 Maximal length of prefix.
unsigned int minlen
 Minimal length of prefix.
unsigned int longest
 Longest word from input file.
char * affstring
 How do we call that thing, that we want to recognize.

Detailed Description

Implementation of compute module.

See compute.h for details.


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().

void print_it ( results what,
const char *  to,
const char *  format,
unsigned int  app 
)

Prints results.

Prints results. Nothing interesting.

References affstring, verbose, VPRINTF, VWPRINTF, and WPRINTF.

Referenced by main().


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