GNU Radio C++ API Reference: GF2Mat Class Reference

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
GF2Mat Class Reference

`#include <gnuradio/fec/gf2mat.h>`

## Public Member Functions
| GF2Mat ()
| Default constructor.
| GF2Mat (int m, int n)
| Construct an M x N matrix with all 0 entries.
| GF2Mat (alist _list)
| Loads the matrix from alist _list.
| GF2Mat (std::vector< std::vector< uint8_t > > X)
| Initializes the class from a 2-D vector X.
int | get_M ()
| Returns the variable M.
int | get_N ()
| Returns the variable N.
void | set_element (int i, int j, char val)
| Set the element at (i, j) coordinate to val.
char | get_element (int i, int j)
| Returns the element at coordinate (i, j).
GF2Vec | get_row (int i)
| Returns the ith row.
GF2Vec | get_col (int i)
| Returns the ith column.
GF2Vec | operator[] (int i)
| Returns the ith row.
void | print_matrix ()
| Prints the matrix H.
void | set_col (int i, GF2Vec vec)
| Sets the ith column with the given vector.
void | set_row (int i, GF2Vec vec)
| Sets the ith row with the given vector.
void | swap_cols (int i, int j)
| Swaps columns i and j.
void | add_cols (int i, int j)
| Adds column j to i and replace i with the sum.
void | add_rows (int i, int j)
| Add row j to i and replace j with the sum.
std::vector< std::vector< uint8_t > > | get_H ()
| Returns the variable H.
GF2Mat | get_G (std::vector< int > &p, int &rank)
| Obtains an equivalent representation of H for encoding.

## Constructor & Destructor Documentation

## ◆ GF2Mat() [1/4]

GF2Mat::GF2Mat | ( |  | ) |
| inline

Default constructor.

Referenced by get_G().

## ◆ GF2Mat() [2/4]

GF2Mat::GF2Mat | ( | int | m,
|  | int | n )

Construct an M x N matrix with all 0 entries.

## ◆ GF2Mat() [3/4]

GF2Mat::GF2Mat | ( | alist | _list | ) |

Loads the matrix from alist _list.

## ◆ GF2Mat() [4/4]

GF2Mat::GF2Mat | ( | std::vector< std::vector< uint8_t > > | X | ) |

Initializes the class from a 2-D vector X.

## Member Function Documentation

## ◆ add_cols()

void GF2Mat::add_cols | ( | int | i,
|  | int | j )

Adds column j to i and replace i with the sum.

## ◆ add_rows()

void GF2Mat::add_rows | ( | int | i,
|  | int | j )

Add row j to i and replace j with the sum.

## ◆ get_col()

GF2Vec GF2Mat::get_col | ( | int | i | ) |

Returns the ith column.

## ◆ get_element()

char GF2Mat::get_element | ( | int | i,
|  | int | j )

Returns the element at coordinate (i, j).

## ◆ get_G()

GF2Mat GF2Mat::get_G | ( | std::vector< int > & | p,
|  | int & | rank )

Obtains an equivalent representation of H for encoding.

For encoding a G matrix in the form [I P] obtained from the parity matrix H, by (a) Column permutations, (b) Row additions and (c) Row permutations. Details of encoding is given in section A.1 of the reference:

- "Modern Coding Theory", T Richardson and R Urbanke.

Parameters

  p | The column permutation during this operation.
  rank | The rank of the matrix.

References GF2Mat().

## ◆ get_H()

std::vector< std::vector< uint8_t > > GF2Mat::get_H | ( |  | ) |

Returns the variable H.

## ◆ get_M()

int GF2Mat::get_M | ( |  | ) |

Returns the variable M.

## ◆ get_N()

int GF2Mat::get_N | ( |  | ) |

Returns the variable N.

## ◆ get_row()

GF2Vec GF2Mat::get_row | ( | int | i | ) |

Returns the ith row.

## ◆ operator[]()

GF2Vec GF2Mat::operator[] | ( | int | i | ) |

Returns the ith row.

## ◆ print_matrix()

void GF2Mat::print_matrix | ( |  | ) |

Prints the matrix H.

## ◆ set_col()

void GF2Mat::set_col | ( | int | i,
|  | GF2Vec | vec )

Sets the ith column with the given vector.

## ◆ set_element()

void GF2Mat::set_element | ( | int | i,
|  | int | j,
|  | char | val )

Set the element at (i, j) coordinate to val.

## ◆ set_row()

void GF2Mat::set_row | ( | int | i,
|  | GF2Vec | vec )

Sets the ith row with the given vector.

## ◆ swap_cols()

void GF2Mat::swap_cols | ( | int | i,
|  | int | j )

Swaps columns i and j.

The documentation for this class was generated from the following file:

- gf2mat.h