ElfPSP_ParallelABC
Protein Structure Prediction using Parallel Artificial Bee Colony Optimization
Macros | Typedefs | Enumerations | Functions
movelem.h File Reference

Routines for manipulating MovElem units, which represent relative movements within a protein. More...

#include <stdio.h>
#include <stdlib.h>
#include "random.h"

Go to the source code of this file.

Macros

#define MOVELEM_INLINE   inline
 

Typedefs

typedef unsigned char MovElem
 Type that holds 2 movements, one for the backbone and one for the side chain. More...
 

Enumerations

enum  _MovUnits {
  FRONT = 0, LEFT = 1, RIGHT = 2, UP = 3,
  DOWN = 4
}
 Constants for making MovElem elements.
 

Functions

MOVELEM_INLINE MovElem MovElem_make (unsigned char bb, unsigned char sc)
 Creates a MovElem. More...
 
MOVELEM_INLINE MovElem MovElem_random ()
 Returns a uniformly random MovElem. More...
 
MOVELEM_INLINE unsigned char MovElem_getBB (MovElem elem)
 Returns the movement for the backbone (BB) stored in a MovElem. More...
 
MOVELEM_INLINE unsigned char MovElem_getSC (MovElem elem)
 Returns the movement for the side chain (SC) stored in a MovElem. More...
 
MOVELEM_INLINE unsigned char MovElem_to_number (MovElem elem)
 Convert a MovElem to a number. More...
 
MOVELEM_INLINE MovElem MovElem_from_number (unsigned char num)
 Convert a number to MovElem. More...
 
MOVELEM_INLINE void MovElem_print (MovElem elem, FILE *fp)
 Prints a movement in the format "%c,%c", without leading/trailing spaces. More...
 

Detailed Description

Routines for manipulating MovElem units, which represent relative movements within a protein.

We decided to encode 2 relative movements in a each byte (char), each occupying 4 bits. The most significant bits hold a relative movement for the backbone chain.

Typedef Documentation

◆ MovElem

typedef unsigned char MovElem

Type that holds 2 movements, one for the backbone and one for the side chain.

The backbone movement is on the most significant 4 bits of this type. The side chain movement is on the least significant 4 bits. The type's size is supposed to be 1 byte.

MovChain is how we refer to an array of MovElem.

Function Documentation

◆ MovElem_from_number()

MOVELEM_INLINE MovElem MovElem_from_number ( unsigned char  num)

Convert a number to MovElem.

Each possible MovElem map into a single number in interval [0, 24].

◆ MovElem_getBB()

MOVELEM_INLINE unsigned char MovElem_getBB ( MovElem  elem)

Returns the movement for the backbone (BB) stored in a MovElem.

◆ MovElem_getSC()

MOVELEM_INLINE unsigned char MovElem_getSC ( MovElem  elem)

Returns the movement for the side chain (SC) stored in a MovElem.

◆ MovElem_make()

MOVELEM_INLINE MovElem MovElem_make ( unsigned char  bb,
unsigned char  sc 
)

Creates a MovElem.

Parameters
bbThe backbone element (e.g. FRONT, LEFT)
scThe side-chain element (e.g. FRONT, LEFT)

◆ MovElem_print()

MOVELEM_INLINE void MovElem_print ( MovElem  elem,
FILE *  fp 
)

Prints a movement in the format "%c,%c", without leading/trailing spaces.

Prints to file 'fp'.

◆ MovElem_random()

MOVELEM_INLINE MovElem MovElem_random ( )

Returns a uniformly random MovElem.

◆ MovElem_to_number()

MOVELEM_INLINE unsigned char MovElem_to_number ( MovElem  elem)

Convert a MovElem to a number.

Each possible MovElem map into a single number in interval [0, 24].