vectorized_process_distance_matrix {topolow}R Documentation

Vectorized Processing of Distance Matrix for Convergence Error Calculations

Description

Efficiently processes elements of the distance matrix for calculating convergence error using pre-processed numeric representations of thresholds. This optimized version eliminates expensive string operations during optimization.

Usage

vectorized_process_distance_matrix(
  distances_numeric,
  threshold_mask,
  p_dist_mat
)

Arguments

distances_numeric

Numeric matrix. The numeric distance values (without threshold indicators)

threshold_mask

Integer matrix. Codes representing threshold types: 1 for "greater than" (>), -1 for "less than" (<), or 0 for exact values

p_dist_mat

Numeric matrix. The calculated distance matrix to compare against

Details

This function handles threshold logic for convergence error calculation by using pre-processed numeric matrices:

This function operates on entire matrices at once using vectorized operations, which is significantly faster than processing each element individually.

Value

Numeric matrix with processed distance values. Elements where threshold conditions are satisfied will contain NA.


[Package topolow version 1.0.0 Index]