NuMojo v0.5 Release: Exciting New Features and Improvements
We’re thrilled to announce the release of NuMojo v0.5, packed with exciting new features, enhancements, and fixes designed to make working with numerical computations in Mojo more efficient and powerful. Below, we’ll dive into the highlights of this release. For more details, be sure to visit our updated documentation site.
New Features
Complex Arrays Support
NuMojo now supports complex number arrays with the introduction of ComplexNDArray
, ComplexSIMD
, and CDType
. This includes creation routines for complex arrays, providing a robust foundation for advanced numerical computations.
Type Coercion in Math Operations
We’ve added a TypeCoercion
struct that automatically calculates the resultant type when performing operations between two different data types. Type coercion is now applied across all math functions for seamless operations.
Enhanced Data Buffer Management
The new OwnData
type serves as a container for data buffers in NDArray
and Matrix
, replacing UnsafePointer
. This enhancement paves the way for array views and better memory management in the future.
Iterators for Arrays
Introducing NDIter
, an iterator for traversing array items based on memory layout. Use NDArray.nditer()
to leverage this feature for more flexible data traversal.
Tensor Conversion
Easily convert between NDArray
and MAX Tensor
using the new to_tensor
and from_tensor
functions.
Linear Algebra Enhancements
- Determinant Calculation: Use the
det
function for matrix determinant calculations. - QR Decomposition: Implemented Householder-based QR decomposition for efficient matrix factorization.
Changes and Improvements
Array Manipulation
- Memory Layout Flags: Added a
flags
property toNDArray
andMatrix
, storing details about memory layout (e.g., C-continuous, F-continuous). - Reshape Improvements: Refined
reshape
,resize
,flatten
, andravel
to work with any dimensions and orders.
Updated Methods
- Safe
load
andstore
: Renamed and enhanced the safety of these methods by adding boundary checks. - Advanced Indexing: Expanded support for indexing with lists, multi-dimensional arrays, and boolean masks.
Print Customization
Added PrintOption
for controlling string representations of arrays, shapes, and strides, with customizable formatting options.
Deprecated or Removed
- The
order
anddatatype
properties ofNDArray
have been replaced with the more robustflags
anddtype
properties. - Removed
offset
andcoefficient
properties in favor of simplified memory layout management.
Fixes
- Fixed an issue where negative index values caused overflows in
get
andset
methods. - Enhanced
__setitem__
to handle variants of integers and slices more effectively.
Documentation Updates
We’ve launched our official documentation site! This includes:
- Comprehensive guides for all NuMojo features.
- Examples and tutorials for getting started with new APIs.
- Detailed descriptions of recent changes and enhancements.
We hope you enjoy the new features and improvements in NuMojo v0.5! Don’t forget to explore our documentation for in-depth insights.