NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions
index_ungapped.h File Reference

Declarations of structures needed to implement diagonal hash to support ungapped extensions for indexed version of megablast. More...

#include <algo/blast/core/ncbi_std.h>
+ Include dependency graph for index_ungapped.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  ir_diag_data_
 Part of the hash table entry describing the diagonal. More...
 
struct  ir_hash_entry_
 Hash table entry. More...
 
struct  ir_fp_entry_
 Free memory block structure. More...
 
struct  ir_diag_hash_
 Hash table structure. More...
 

Macros

#define IR_HASH_SIZE   (4*1024)
 How many keys are there in diagonal hash table. More...
 
#define IR_DIAG(qoff, soff)   (0x10000000 + (soff) - (qoff))
 Compute diagonal identifier from subject and query offsets. More...
 
#define IR_KEY(diag)   ((diag)%IR_HASH_SIZE)
 Compute the hash key from a diagonal identifier. More...
 
#define IR_LOCATE(hash, diag, key)
 Find a hash table entry for the given diagonal. More...
 

Typedefs

typedef struct ir_diag_data_ ir_diag_data
 Part of the hash table entry describing the diagonal. More...
 
typedef struct ir_hash_entry_ ir_hash_entry
 Hash table entry. More...
 
typedef struct ir_fp_entry_ ir_fp_entry
 Free memory block structure. More...
 
typedef struct ir_diag_hash_ ir_diag_hash
 Hash table structure. More...
 

Functions

ir_diag_hashir_hash_create (void)
 Hash table constructor. More...
 
ir_diag_hashir_hash_destroy (ir_diag_hash *hash)
 Hash table destructor. More...
 
ir_hash_entryir_locate (ir_diag_hash *hash, Uint4 diag, Uint4 key)
 Find a hash table entry for the given diagonal. More...
 

Detailed Description

Declarations of structures needed to implement diagonal hash to support ungapped extensions for indexed version of megablast.

Definition in file index_ungapped.h.

Macro Definition Documentation

◆ IR_DIAG

#define IR_DIAG (   qoff,
  soff 
)    (0x10000000 + (soff) - (qoff))

Compute diagonal identifier from subject and query offsets.

Parameters
qoffQuery offset.
soffSubject offset.
Returns
Integer diagonal identifier.

Definition at line 50 of file index_ungapped.h.

◆ IR_HASH_SIZE

#define IR_HASH_SIZE   (4*1024)

How many keys are there in diagonal hash table.

Definition at line 41 of file index_ungapped.h.

◆ IR_KEY

#define IR_KEY (   diag)    ((diag)%IR_HASH_SIZE)

Compute the hash key from a diagonal identifier.

Parameters
diagDiagonal identifier.
Returns
Hash key corresponding to the diagonal.

Definition at line 58 of file index_ungapped.h.

◆ IR_LOCATE

#define IR_LOCATE (   hash,
  diag,
  key 
)
Value:
( \
((hash)->entries[(key)].diag_data.qend == 0 || \
(diag)==(hash)->entries[(key)].diag_data.diag) ? \
((hash)->entries + (key)) : \
(ir_locate(hash,diag,key)) )
ir_hash_entry * ir_locate(ir_diag_hash *hash, Uint4 diag, Uint4 key)
Find a hash table entry for the given diagonal.
const struct ncbi::grid::netcache::search::fields::KEY key
Definition: _hash_fun.h:40
static wxAcceleratorEntry entries[3]

Find a hash table entry for the given diagonal.

Parameters
hashPointer to hash table instance.
diagDiagonal identifier.
keyHash table key corresponding to the diagonal.
Returns
Pointer to ir_hash_entry representing the diagonal.

Definition at line 68 of file index_ungapped.h.

Typedef Documentation

◆ ir_diag_data

typedef struct ir_diag_data_ ir_diag_data

Part of the hash table entry describing the diagonal.

◆ ir_diag_hash

typedef struct ir_diag_hash_ ir_diag_hash

Hash table structure.

◆ ir_fp_entry

typedef struct ir_fp_entry_ ir_fp_entry

Free memory block structure.

◆ ir_hash_entry

typedef struct ir_hash_entry_ ir_hash_entry

Hash table entry.

Function Documentation

◆ ir_hash_create()

ir_diag_hash* ir_hash_create ( void  )

Hash table constructor.

Returns
A pointer to a fresh copy of a diagonal hash table, or NULL.

Definition at line 82 of file index_ungapped.c.

References calloc(), entries, ir_hash_destroy(), IR_HASH_SIZE, and result.

Referenced by MB_IndexedWordFinder(), and ShortRead_IndexedWordFinder().

◆ ir_hash_destroy()

ir_diag_hash* ir_hash_destroy ( ir_diag_hash hash)

Hash table destructor.

Parameters
hashPointer to the hash table instance to destroy.
Returns
NULL.

Definition at line 99 of file index_ungapped.c.

References free(), ir_fp_entry_destroy(), and ir_fp_entry_::next.

Referenced by ir_hash_create(), MB_IndexedWordFinder(), and ShortRead_IndexedWordFinder().

◆ ir_locate()

ir_hash_entry* ir_locate ( ir_diag_hash hash,
Uint4  diag,
Uint4  key 
)

Find a hash table entry for the given diagonal.

Parameters
hashPointer to hash table instance.
diagDiagonal identifier.
keyHash table key corresponding to the diagonal.
Returns
Pointer to ir_hash_entry representing the diagonal.

Definition at line 119 of file index_ungapped.c.

References ir_diag_data_::diag, ir_hash_entry_::diag_data, fp, ir_fp_entry_create(), ncbi::grid::netcache::search::fields::key, ir_hash_entry_::next, and tmp.

Modified on Wed May 29 18:40:44 2024 by modify_doxy.py rev. 669887