mapmap_cpu icon indicating copy to clipboard operation
mapmap_cpu copied to clipboard

Customizing pairwise costs

Open blurgyy opened this issue 3 years ago • 1 comments

Hello, thank you for the great library!

I want to implement a custom pairwise cost functor, which takes labels and maps the labels to something else to calculate the costs. For example, if the labels are indices of some set of n-dimensional points, I want to define the pairwise costs as the distance between the points which the labels point to. Is this possible?

I have tried implementing a class derived from mapmap::PairwiseCosts, and override the get_pairwise_costs method. When I try to output the labels vector in get_pairwise_costs, sometimes it outputs undefined values (i.e. not labels). Could you please give some instructions on how to define custom pairwise costs? I would be very appreciated.

blurgyy avatar May 12 '21 08:05 blurgyy

Hi @blurgyy ,

sorry for the late answer! Can you, by any chance, post your code here? A good starting point would be pairwise_table.impl.h.

Did you use a SIMD width larger than 1? If so, my first guess is always an alignment issue...

Feel free to also e-mail me directly (see my personal webpage).

dthuerck avatar May 28 '21 00:05 dthuerck