Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

joneqdaniel/alcvx

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alcvx

Aligned C Vector Extension single-header math library

Status

DONE

  • integral scalar types i.e. f32, f64, b8, u8, s8, i8, c8
  • arbitrary length vec(t,n) and vec_ext(t,n) power of two types and ALCVX load/cast
  • bitceil, isarray, countof, countargs, emptyargs, perm
  • OpenMP SIMD linear dot product and sum
  • vec(t,n) cross3 product using perm3

TODO

  • use bit_ceil and align modes
  • array initializer list duplicate for copy assign for types of arbitrary length based on HolyBlackCat/macro_sequence_for
  • emulated recursion iteration based on __COUNTER__ for integer sequence
  • determinant, laplace expansion and cross4
  • levi-civita symbol
  • generic n-dim hodge star operator
  • motor/rotor/quat and oct/sed/ten types
vec(f32,3) a = {4,2,0};
vec(f32,3) b = dup(a);

Usage

#include <stdlib.h>
#include <stdio.h>
#include <alcvx.h>

int main(int argc, char** argv)
{
     vec(u16,3) src[2] = { {1,2,3}, {4,5,6} };
     vec(u16,3) dst;
     dup_ext(dst,src[0]);
     printf("%hu %hu %hu %hu\n", dst[0],dst[1],dst[2],dst[3]);

     exit(EXIT_SUCCESS);
}
[1.000000 2.000000 3.000000 0.000000]  4/12
[1.000000 4.000000 9.000000 0.000000] 16/16
[1 2 3 0]  8/ 8
Morty Proxy This is a proxified and sanitized view of the page, visit original site.