flatironinstitute / nomad

Non-linear Matrix Decomposition library
Apache License 2.0
11 stars 1 forks source link

Merge `two_part_factor` and `two_part_factor_known_rank` #20

Closed sfohr closed 7 months ago

sfohr commented 7 months ago

As discussed in PR #16, we know the low-rank candidate's rank, therefore merging two_part_factor with two_part_factor_known_rank to reduce repeated code.

Closes #17 .

Type of change

Motivation and Context

The change avoids code repetition and matrix rank computation. It merges functions two_part_factor and two_part_factor_known_rank into a single function two_part_factor with optional argument rank. If rank is not supplied, it will be detected using numpy.linalg.matrix_rank. For the current use cases, we always now the target rank in advance. Currently, the function is used twofold:

Description

This PR introduces the following changes:

Testing

Checklist