Skip to content
Snippets Groups Projects

correct parameters 'rows' and 'columns' in generate_matrix_transposition()

Merged Mikael Henriksson requested to merge matrix_transposition_height_correction into master
All threads resolved!
@@ -46,18 +46,18 @@ def generate_random_interleaver(
ProcessCollection
"""
inputorder = list(range(size))
outputorder = inputorder[:]
random.shuffle(outputorder)
inputorder, outputorder = _insert_delays(
inputorder, outputorder, min_lifetime, cyclic
inputorders = list(range(size))
outputorders = inputorders[:]
random.shuffle(outputorders)
inputorders, outputorders = _insert_delays(
inputorders, outputorders, min_lifetime, cyclic
)
return ProcessCollection(
{
PlainMemoryVariable(inputorder[i], 0, {0: outputorder[i] - inputorder[i]})
for i in range(len(inputorder))
PlainMemoryVariable(inputorder, 0, {0: outputorders[i] - inputorder})
for i, inputorder in enumerate(inputorders)
},
len(inputorder),
len(inputorders),
cyclic,
)
@@ -70,7 +70,7 @@ def generate_matrix_transposer(
) -> ProcessCollection:
r"""
Generate a ProcessCollection with memory variable corresponding to transposing a
matrix of size *rows* :math:`\times` *cols*. If *rows* is not provided, a
matrix of size *rows* :math:`\times` *cols*. If *cols* is not provided, a
square matrix of size *rows* :math:`\times` *rows* is used.
Parameters
@@ -79,7 +79,7 @@ def generate_matrix_transposer(
Number of rows in input matrix.
cols : int, optional
Number of columns in input matrix. If not provided assumed to be equal
to height, i.e., a square matrix.
to *rows*, i.e., a square matrix.
min_lifetime : int, default: 0
The minimum lifetime for a memory variable. Default is 0 meaning that at
least one variable is passed from the input to the output directly,
@@ -95,9 +95,9 @@ def generate_matrix_transposer(
cols = rows
inputorder = []
for row in range(cols):
for col in range(rows):
inputorder.append(col + rows * row)
for col in range(cols):
for row in range(rows):
inputorder.append(row + rows * col)
outputorder = []
for row in range(rows):
Loading