itpp::GF2mat_sparse_alist Class Reference

Parameterized "alist" representation of sparse GF(2) matrix. More...

`#include <itpp/base/gf2mat.h>`

## Public Member Functions

| GF2mat_sparse_alist ()
| Default constructor.
| GF2mat_sparse_alist (const std::string &fname)
| Constructor, which reads alist data from a file named `fname`.
void | read (const std::string &fname)
| Read alist data from a file named `fname`.
void | write (const std::string &fname) const
| Write alist data to a file named `fname`.
GF2mat_sparse | to_sparse (bool transpose=false) const
| Convert "alist" representation to `GF2mat_sparse`.
void | from_sparse (const GF2mat_sparse &mat, bool transpose=false)
| Import "alist" representation from `GF2mat_sparse`.

## Protected Attributes

bool | data_ok
| Flag indicating that "alist" matrix data are properly set.
int | M
| Size of the matrix: `M` rows x `N` columns.
int | N
| Size of the matrix: `M` rows x `N` columns.
imat | mlist
| List of integer coordinates in the m direction with non-zero entries.
imat | nlist
| List of integer coordinates in the n direction with non-zero entries.
ivec | num_mlist
| Weight of each row m.
ivec | num_nlist
| Weight of each column n.
int | max_num_m
| Maximum weight of rows.
int | max_num_n
| Maximum weight of columns.

## Detailed Description

Parameterized "alist" representation of sparse GF(2) matrix.

Author
  Adam Piatyszek and Erik G. Larsson

This class is used to provide a parameterized representation of a `GF2mat_sparse` class. The format is compatible with the "alist" format defined by David MacKay, Matthew Davey and John Lafferty:

- http://www.inference.phy.cam.ac.uk/mackay/codes/alist.html

For examples of "alist" representation visit David MacKay's Encyclopedia of Sparse Graph Codes:

- http://www.inference.phy.cam.ac.uk/mackay/codes/data.html

Definition at line 98 of file gf2mat.h.

## Constructor & Destructor Documentation

## GF2mat_sparse_alist() [1/2]

itpp::GF2mat_sparse_alist::GF2mat_sparse_alist | ( |  | ) |

inline

Default constructor.

Definition at line 102 of file gf2mat.h.

## GF2mat_sparse_alist() [2/2]

itpp::GF2mat_sparse_alist::GF2mat_sparse_alist | ( | const std::string & | fname | ) |

Constructor, which reads alist data from a file named `fname`.

Definition at line 40 of file gf2mat.cpp.

References read().

## Member Function Documentation

## read()

void itpp::GF2mat_sparse_alist::read | ( | const std::string & | fname | ) |

Read alist data from a file named `fname`.

Definition at line 46 of file gf2mat.cpp.

References data_ok, it_assert, M, max_num_m, max_num_n, mlist, N, nlist, num_mlist, num_nlist, and itpp::Array< T >::set_size().

Referenced by GF2mat_sparse_alist().

## write()

void itpp::GF2mat_sparse_alist::write | ( | const std::string & | fname | ) | const

Write alist data to a file named `fname`.

Definition at line 156 of file gf2mat.cpp.

References data_ok, it_assert, itpp::Array< T >::length(), M, max_num_m, max_num_n, mlist, N, nlist, num_mlist, and num_nlist.

## to_sparse()

GF2mat_sparse itpp::GF2mat_sparse_alist::to_sparse | ( | bool | transpose = `false` | ) | const

Convert "alist" representation to `GF2mat_sparse`.

Parameters

  transpose | Indicates whether a matrix should be transposed during the conversion process

Definition at line 193 of file gf2mat.cpp.

References M, max_num_m, mlist, N, num_mlist, and itpp::transpose().

## from_sparse()

void itpp::GF2mat_sparse_alist::from_sparse | ( | const GF2mat_sparse & | mat,
|  | bool | transpose = `false`
| ) |  |

Import "alist" representation from `GF2mat_sparse`.

Parameters

  mat | Matrix to import
  transpose | Indicates whether a matrix should be transposed during the conversion process

Definition at line 217 of file gf2mat.cpp.

References itpp::concat(), data_ok, from_sparse(), M, itpp::max(), max_num_m, max_num_n, mlist, N, nlist, num_mlist, num_nlist, itpp::Array< T >::set_size(), itpp::Array< T >::size(), and itpp::transpose().

Referenced by from_sparse().

## Member Data Documentation

## data_ok

bool itpp::GF2mat_sparse_alist::data_ok

protected

Flag indicating that "alist" matrix data are properly set.

Definition at line 130 of file gf2mat.h.

Referenced by from_sparse(), read(), and write().

## M

int itpp::GF2mat_sparse_alist::M

protected

Size of the matrix: `M` rows x `N` columns.

Definition at line 132 of file gf2mat.h.

Referenced by from_sparse(), read(), to_sparse(), and write().

## N

int itpp::GF2mat_sparse_alist::N

protected

Size of the matrix: `M` rows x `N` columns.

Definition at line 134 of file gf2mat.h.

Referenced by from_sparse(), read(), to_sparse(), and write().

## mlist

imat itpp::GF2mat_sparse_alist::mlist

protected

List of integer coordinates in the m direction with non-zero entries.

Definition at line 136 of file gf2mat.h.

Referenced by from_sparse(), read(), to_sparse(), and write().

## nlist

imat itpp::GF2mat_sparse_alist::nlist

protected

List of integer coordinates in the n direction with non-zero entries.

Definition at line 138 of file gf2mat.h.

Referenced by from_sparse(), read(), and write().

## num_mlist

ivec itpp::GF2mat_sparse_alist::num_mlist

protected

Weight of each row m.

Definition at line 140 of file gf2mat.h.

Referenced by from_sparse(), read(), to_sparse(), and write().

## num_nlist

ivec itpp::GF2mat_sparse_alist::num_nlist

protected

Weight of each column n.

Definition at line 142 of file gf2mat.h.

Referenced by from_sparse(), read(), and write().

## max_num_m

int itpp::GF2mat_sparse_alist::max_num_m

protected

Maximum weight of rows.

Definition at line 144 of file gf2mat.h.

Referenced by from_sparse(), read(), to_sparse(), and write().

## max_num_n

int itpp::GF2mat_sparse_alist::max_num_n

protected

Maximum weight of columns.

Definition at line 146 of file gf2mat.h.

Referenced by from_sparse(), read(), and write().

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

- itpp/base/gf2mat.h
- itpp/base/gf2mat.cpp

Generated on Mon Jun 10 2024 11:49:35 for IT++ by Doxygen 1.9.8