KFR 5 has been released

1 December 2022

KFR 5 has been released with new features and performance improvements. Multidimensional arrays, exceptions and better performance.


New Tensor class for multidimensional data (like numpy’s nparray).

Tensor class supports:

  • Slices
  • Views
  • Custom memory layout
  • Automatic vectorization for maximum performance
  • Zero-copy reshaping and transpose
  • Zero-copy conversion from STL containers

Updated Expressions

All built in expressions support multiple dimensions.

expression_traits<T> introduced to support interpreting any object as kfr expression.

Out-of-class assign operators for all input & output expressions.

Improved performance

The performance of code compiled on GCC and MSVC has been significantly improved.

MSVC build times have been reduced by up to 50% and memory consumption has been cut.

Better control of errors

KFR 5 added exception support that may be configured to throw exception, call user-supplied function or std::abort.

More functions

  • Histogram computation.
  • Normal (gaussian) distribution for random number generator.
  • Template parameter deduction for vec, so vec{1, 2} is the same as vec<int, 2>{1, 2}

KFR 4 support

KFR 4 is still supported and will get fixes and improvements but main development focuses on KFR 5.

See on GitHub