Method: Flock.cityblock_distance

Defined in:
ext/flock.c

.cityblock_distance(vector1, vector2, mask1 = identity, mask2 = identity) ⇒ Object

Cityblock distance measure

Parameters:

  • vector1 (Array)

    Numeric vector

  • vector2 (Array)

    Numeric vector

  • mask1 (Array) (defaults to: identity)

    Optional mask for vector1

  • mask2 (Array) (defaults to: identity)

    Optional mask for vector2



468
469
470
471
472
# File 'ext/flock.c', line 468

VALUE rb_cityblock(int argc, VALUE *argv, VALUE self) {
    VALUE v1, v2, m1, m2;
    rb_scan_args(argc, argv, "22", &v1, &v2, &m1, &m2);
    return rb_distance(v1, m1, v2, m2, cityblock);
}