ttypt/point.h(3)islet

NAME

ttypt/point.h - Point arithmetic and utility functions for spatial operations.

SYNOPSIS

#include <stdint.h>
#include <stdio.h>

Functions

static void point_add_1 (int16_t *tar, int16_t *orig, int16_t *tr)

Add two points component-wise.

static void point_add_2 (int16_t *tar, int16_t *orig, int16_t *tr)

2D vector addition. See point_add_1() for the family docs.

static void point_add_3 (int16_t *tar, int16_t *orig, int16_t *tr)

3D vector addition. See point_add_1() for the family docs.

static void point_add_4 (int16_t *tar, int16_t *orig, int16_t *tr)

4D vector addition. See point_add_1() for the family docs.

static void point_sub_1 (int16_t *tar, int16_t *orig, int16_t *tr)

Subtract two points component-wise.

static void point_sub_2 (int16_t *tar, int16_t *orig, int16_t *tr)

2D vector subtraction. See point_sub_1() for the family docs.

static void point_sub_3 (int16_t *tar, int16_t *orig, int16_t *tr)

3D vector subtraction. See point_sub_1() for the family docs.

static void point_sub_4 (int16_t *tar, int16_t *orig, int16_t *tr)

4D vector subtraction. See point_sub_1() for the family docs.

static void point_min_1 (int16_t *tar, int16_t *a, int16_t *b)

Compute component-wise minimum of two points.

static void point_min_2 (int16_t *tar, int16_t *a, int16_t *b)

2D component-wise minimum. See point_min_1() for the family docs.

static void point_min_3 (int16_t *tar, int16_t *a, int16_t *b)

3D component-wise minimum. See point_min_1() for the family docs.

static void point_min_4 (int16_t *tar, int16_t *a, int16_t *b)

4D component-wise minimum. See point_min_1() for the family docs.

static void point_max_1 (int16_t *tar, int16_t *a, int16_t *b)

Compute component-wise maximum of two points.

static void point_max_2 (int16_t *tar, int16_t *a, int16_t *b)

2D component-wise maximum. See point_max_1() for the family docs.

static void point_max_3 (int16_t *tar, int16_t *a, int16_t *b)

3D component-wise maximum. See point_max_1() for the family docs.

static void point_max_4 (int16_t *tar, int16_t *a, int16_t *b)

4D component-wise maximum. See point_max_1() for the family docs.

static void point_copy_1 (int16_t *tar, int16_t *orig)

Copy a point (component-wise shallow copy).

static void point_copy_2 (int16_t *tar, int16_t *orig)

2D point copy (exact 4-byte move). See point_copy_1() for docs.

static void point_copy_3 (int16_t *tar, int16_t *orig)

3D point copy. See point_copy_1() for the family docs.

static void point_copy_4 (int16_t *tar, int16_t *orig)

4D point copy (exact 8-byte move). See point_copy_1() for docs.

static int32_t point_vol_1 (int16_t *p)

Compute the volume (product of all components) of a point.

static int32_t point_vol_2 (int16_t *p)

2D area. See point_vol_1() for the family docs.

static int32_t point_vol_3 (int16_t *p)

3D volume. See point_vol_1() for the family docs.

static int32_t point_vol_4 (int16_t *p)

4D volume. See point_vol_1() for the family docs.

static void point_set_1 (int16_t *tar, int16_t value)

Set all components of a point to the same value.

static void point_set_2 (int16_t *tar, int16_t value)

2D broadcast set. See point_set_1() for the family docs.

static void point_set_3 (int16_t *tar, int16_t value)

3D broadcast set. See point_set_1() for the family docs.

static void point_set_4 (int16_t *tar, int16_t value)

4D broadcast set. See point_set_1() for the family docs.

static void point_debug_1 (char *label, int16_t *p)

Print a point to stderr for debugging.

static void point_debug_2 (char *label, int16_t *p)

Print a 2D point. See point_debug_1() for the family docs.

static void point_debug_3 (char *label, int16_t *p)

Print a 3D point. See point_debug_1() for the family docs.

static void point_debug_4 (char *label, int16_t *p)

Print a 4D point. See point_debug_1() for the family docs.

static uint64_t point_idx_1 (int16_t *p, int16_t *s, int16_t *e)

Compute a linear index for a point within a bounding box.

static uint64_t point_idx_2 (int16_t *p, int16_t *s, int16_t *e)

2D row-major index. See point_idx_1() for the family docs.

static uint64_t point_idx_3 (int16_t *p, int16_t *s, int16_t *e)

3D row-major index. See point_idx_1() for the family docs.

static uint64_t point_idx_4 (int16_t *p, int16_t *s, int16_t *e)

4D row-major index. See point_idx_1() for the family docs.

static void point_add_2_32 (int32_t *tar, int32_t *orig, int32_t *tr)

2D x 32-bit vector addition. See point_add_1() for the family docs.

static void point_sub_2_32 (int32_t *tar, int32_t *orig, int32_t *tr)

2D x 32-bit vector subtraction. See point_sub_1() for the family docs.

static void point_min_2_32 (int32_t *tar, int32_t *a, int32_t *b)

2D x 32-bit component-wise minimum. See point_min_1() for the family docs.

static void point_max_2_32 (int32_t *tar, int32_t *a, int32_t *b)

2D x 32-bit component-wise maximum. See point_max_1() for the family docs.

static void point_copy_2_32 (int32_t *tar, int32_t *orig)

2D x 32-bit point copy (exact 8-byte move). See point_copy_1() for the family docs.

static uint64_t point_vol_2_32 (int32_t *p)

2D x 32-bit area. The product of two lanes (each at most 2^32-1 wide) always fits in uint64_t.

static void point_set_2_32 (int32_t *tar, int32_t value)

2D x 32-bit broadcast set. See point_set_1() for the family docs.

static void point_debug_2_32 (char *label, int32_t *p)

Print a 2D x 32-bit point. See point_debug_1() for the family docs.

static uint64_t point_idx_2_32 (int32_t *p, int32_t *s, int32_t *e)

2D x 32-bit row-major index. See point_idx_1() for the family docs.

Detailed Description

Point arithmetic and utility functions for spatial operations.

Provides helper functions for manipulating multi-dimensional points represented as int16_t arrays. These are building blocks for spatial operations in libislet.

All functions are per-dimension specializations (point_copy_1..4, etc.). There is no runtime dimension argument: pick the function matching the dimension count, so the compiler sees fully unrolled bodies.

The 2D x 32-bit config (int32_t lanes, morton_set_2_32 / islet_*_2_32) has its own same-shaped family (point_add_2_32, etc.).

Prefer the config objects (pointcfg.h: Point1_2..Point4_2, Point2_4) in application code; these inlines remain the tight-loop fast path.

Note

No bounds checking is performed for efficiency. Caller must ensure arrays have sufficient space for the dimension count used.

See also

Islet core API

Morton code helpers

Author

Generated automatically by Doxygen for islet from the source code.