Skip to content

eigen

New array types and linear-algebra functions based on the Eigen numerical template library.

eigen · New array types and linear-algebra functions based on the Eigen numerical template library.

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
100665eigeneigen1.1TYPEMITC++

PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18

Usage

Sources:

eigen version 1.1 wraps the Eigen C++ library with PostgreSQL domains and functions for three-dimensional vectors, integer/double arrays, and double matrices. It provides elementwise arithmetic, vector dot/cross products, norms and distances, set/similarity operations, matrix products, reductions, and stacking helpers.

Example

CREATE EXTENSION eigen;
SELECT vector3d_dot(
  ARRAY[1.0, 0.0, 0.0]::vector3d,
  ARRAY[0.0, 1.0, 0.0]::vector3d
);
SELECT vector3d_norm(ARRAY[3.0, 4.0, 0.0]::vector3d);

Inputs are PostgreSQL arrays constrained by domains; enforce dimensions and reject null elements before expensive operations. The source targets PostgreSQL 9.1+ and Eigen 3 but has seen no repository update since 2020 and publishes no current compatibility matrix. It also defines many generic function and operator names, so install in a planned schema and test for conflicts and numerical edge cases.

Table reader