From 987835afe8fc5d46cb3a6359ec80c9f035e72801 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 28 Nov 2017 19:01:51 +0100 Subject: Add module spec headers Signed-off-by: pacien --- include/common/geom.h | 32 ++++++++++++++++++++++++++++++++ include/common/matrix.h | 34 ++++++++++++++++++++++++++++++++++ include/common/time.h | 23 +++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 include/common/geom.h create mode 100644 include/common/matrix.h create mode 100644 include/common/time.h (limited to 'include/common') diff --git a/include/common/geom.h b/include/common/geom.h new file mode 100644 index 0000000..15a1d57 --- /dev/null +++ b/include/common/geom.h @@ -0,0 +1,32 @@ +#ifndef UPEM_MORPHING_GEOM +#define UPEM_MORPHING_GEOM + +/** + * File: geom.h + */ + +#include + +/** + * Type: IntVector + * An abstract 1-D vector. + */ +typedef int32_t IntVector; + +/** + * Type: CartesianVector + * An abstract 2-D vector in cartesian coordinates. + */ +typedef struct { + IntVector x, y; +} CartesianVector; + +/** + * Type: CartesianMapping + * A tuple of cartesian vectors representing a mapping. + */ +typedef struct { + CartesianVector origin, target; +} CartesianMapping; + +#endif diff --git a/include/common/matrix.h b/include/common/matrix.h new file mode 100644 index 0000000..6c35cc0 --- /dev/null +++ b/include/common/matrix.h @@ -0,0 +1,34 @@ +#ifndef UPEM_MORPHING_MATRIX +#define UPEM_MORPHING_MATRIX + +/** + * File: matrix.h + * + * See also: + * The film + */ + +#include "geom.h" + +/** + * Type: IntSquareMatrix + * Represents a square integer matrix. + */ +typedef struct { + IntVector *elements; + IntVector dim; +} IntSquareMatrix; + +/** + * Function: matrix_int_det + * Computes and returns the determinant of a square integer matrix. + * + * Parameters: + * *matrix - pointer to input matrix + * + * Returns: + * The integer determinant + */ +IntVector matrix_int_det(IntSquareMatrix *matrix); + +#endif diff --git a/include/common/time.h b/include/common/time.h new file mode 100644 index 0000000..060b7be --- /dev/null +++ b/include/common/time.h @@ -0,0 +1,23 @@ +#ifndef UPEM_MORPHING_TIME +#define UPEM_MORPHING_TIME + +/** + * File: time.h + */ + +/** + * Type: TimeVector + * An abstract time vector. + */ +typedef float TimeVector; + +/** + * Constants: Time vectors + * + * TIME_ORIGIN - the origin of times + * TIME_UNIT - a unit time vector + */ +const TimeVector TIME_ORIGIN = 0; +const TimeVector TIME_UNIT = 1; + +#endif -- cgit v1.2.3