Skip to content

RffTransform has undesirable coupling to its MatrixGenerator #699

Closed
@eerhardt

Description

@eerhardt

RffTransform has an undesirable coupling to which kind of MatrixGenerator it is using (gaussian or not).

var sub = args.Column[iinfo].MatrixGenerator;
if (!sub.IsGood())
sub = args.MatrixGenerator;
var info = ComponentCatalog.GetLoadableClassInfo(sub);
bool gaussian = info != null && info.Type == typeof(GaussianFourierSampler);

It is using the ComponentCatalog to determine which type of MatrixGenerator it was working with before actually creating it. And then depending on the Type, it is doing a different distance scaling algorithm.

This type of decision (which algorithm to use for distance scaling) should be done by the MatrixGenerator itself, and not necessarily decided by the RffTransform.

I am changing RffTransform to no longer use SubComponent. However, I can no longer tell which type of MatrixGenerator is going to be created without actually creating the generator, so I needed to make a "dummy" instance. I spoke with @yaeldekel, and we decided this was "OK" for now, since it typically only used with a small number of columns (i.e. 1).

We should consider refactoring RffTransform and the IFourierDistributionSampler types to allow RffTransform to not have to switch based on whether Gaussian sampling is used or not.

Metadata

Metadata

Assignees

Labels

APIIssues pertaining the friendly APIneed infoThis issue needs more info before triage

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions