module mat

Matrix functions

This module provides functions for creating and handling matrix applications.


function generateMatrix

generateMatrix(b: int, c: int, arr_size: int) → List[List[int]]

Generates a matrix of random values of a given size

Args:

  • b (int): Bits per cell
  • c (int): Number of cells
  • arr_size (int): Size of the array

Returns:

  • list: List of lists representing the array

function injectFaults

injectFaults(mat: List[List[int]], error_map: List[List[float]], b: int) → int

Inject faults into an MLC matrix

Args:

  • mat (list): Matrix to inject faults into
  • error_map (dict): Error map dictionary
  • b (int): Bits per cell

Returns:

  • int: Number of injected errors in the matrix

function calcErrMagnitude

calcErrMagnitude(
    configs: List[List[List[int]]],
    in_mat: List[List[int]],
    out_mat: List[List[int]],
    errs: List[List[int]],
    errs_perc: List[List[float]]
)

Calculates the magnitude of errors difference between two matrices

Args:

  • configs (dict): Cell configuration
  • in_mat (list): Clean matrix
  • out_mat (list): Dirty/error matrix
  • errs (list): Magnitude of error appended to at index corresponding to the index of the config
  • errs_perc (list): Percent magnitude of error appended to at index corresponding to the index of the config

This file was automatically generated via lazydocs.