| Functions | |
| bmat | itpp::graycode (int m) | 
| Generate Gray code of blocklength m. 
The codes are contained as binary codewords {0,1} in the rows of the returned matrix. See also the  | |
| int | itpp::hamming_distance (const bvec &a, const bvec &b) | 
| Calculate the Hamming distance between a and b. | |
| int | itpp::weight (const bvec &a) | 
| Calculate the Hamming weight of a. | |
| vec | itpp::waterfilling (const vec &alpha, double P) | 
| Compute the water-filling solution This function computes the solution of the water-filling problem 
 subject to 
 | |
Compute the water-filling solution
This function computes the solution of the water-filling problem
![\[ \max_{p_0,...,p_{n-1}} \sum_{i=0}^{n-1} \log\left(1+p_i\alpha_i\right) \]](form_237.png) 
subject to
![\[ \sum_{i=0}^{n-1} p_i \le P \]](form_238.png) 
.
| alpha | vector of  gains (must have strictly positive elements) | |
| P | power constraint | 

 at most
 at most 
References it_assert, and itpp::length().
 1.5.8
 1.5.8