Skip to content

candidate choice in OLTW Dixon is offset by one #31

@sildater

Description

@sildater

def select_candidate(self):

if min_idx <= len(norm_x_edge):
            self.candidate = np.array([self.ref_pointer - offset[0], min_idx])
        else:
            self.candidate = np.array(
                [min_idx - len(norm_x_edge), self.input_pointer - offset[1]]
            )

the pointer to the outer edge of the matrix in both matrices needs to be offset by one like so:

if min_idx < len(norm_x_edge):
            self.candidate = np.array([self.ref_pointer - offset[0] - 1, min_idx])
        else:
            self.candidate = np.array(
                [min_idx - len(norm_x_edge), self.input_pointer - offset[1] - 1]
            )

and the index comparison should probably be strict -> min_idx == len(norm_x_edge) means the minimzer is in the top right corner [0,-1] which is the second clause.

changing this index offset needs adjustments also in the assertion in select_next_direction

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions