Objects and Method

The library was written in C programming language, in an object-oriented fashion. The main manipulating object type is structure blahut_cap, which contains all the setting parameters and resulting data.

The following functions are provided to manipulating an object of type blahut_cap.

blahut_cap * 
blahut_cap_init( const gsl_matrix* Q, 
		   const gsl_vector* e );
This function takes a forward transition matrix (of type gsl_matrix) and an expense schedule (of type gsl_vector) as arguments, and returns a pointer to an initialized (dynamically allocated) object of type blahut_cap, which will be used for further specifying channel and algorithm parameters, storing estimated data.

void 
blahut_cap_free( blahut_cap* cap);
Since blahut_cap is dynamically allocated, never forget to free the memory after using it. blahut_cap_free() takes a pointer to a capacity object and frees the corresponding object and all the relevant memory. Note: do not free this pointer by using free() from standard C, as some pointers in that object also pointing to dynamically allocated memory blocks.

blahut_cap * 
blahut_cap_setSRange(blahut_cap * cap, double s_L, double s_U, double step);
After an blahut_cap object has been initialized, this function is used to set the $ s$ ranges (refer to figure 2) to obtain a series of points on the C(E) curve. Different $ s$ value corresponds to expenses, $ s=0$ corresponds to unconstrained (or $ E_{max}$ ) case.

blahut_cap *
blahut_cap_calc( blahut_cap * cap );
When given a specific $ s$ , this function iterates and estimates a corresponding capacity.

blahut_ce_curve 
blahut_cap_iterate_over_s( blahut_cap * cap, const char* filename);
After setting the $ s$ range, this function starts iterating over all $ s$ values by calling blahut_cap_calc() function repeatedly.

Kefei Lu 2008-05-15