From 86134ccf82dcafe338e68c14e483ec98cfc94925 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 28 Apr 2020 21:31:01 -0700 Subject: struct: preparing for prototype of math library --- include/libmath.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 include/libmath.h (limited to 'include') diff --git a/include/libmath.h b/include/libmath.h new file mode 100644 index 0000000..03e8e1a --- /dev/null +++ b/include/libmath.h @@ -0,0 +1,20 @@ +#pragma once + +// ----------------------------------------------------------------------- +// Linear algebra + +/* + * Vector (double precision) + * len : dimension of space + * inc : stride to access in buffer + * buf : pointer to start of data + * NOTE: minimum buffer size MUST be len*inc + */ +typedef struct math·Vecd +{ + int len; + int inc; + double *buf; +} math·Vecd; + +double linalg·dotd(math·Vecd a, math·Vecd b); -- cgit v1.2.1