Skip to content
pubscout

matrix2d

1.0.4, released 4 years ago by n4ze3m.site

Mathematical 2D array functions and manipulations inspired by NumPy

WASM-ready
$ flutter pub add matrix2d
Source repository

What it does

Provides mathematical operations for 2D arrays in Dart such as addition, subtraction, multiplication, transposition, and slicing. It includes support for vectorised operations, matrix reshaping, and finding minimum or maximum values.

AI-written summary of version 1.0.4, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need NumPy-like matrix operations in Dart
  • You are working with 2D lists and need common mathematical manipulations like dot products or transpositions

Skip it when

  • You need high-performance native numerical computing (consider FFI bindings instead)

Strengths

  • Simple and easy-to-use API inspired by NumPy
  • Supports a wide range of matrix operations including dot product, slicing, and reshaping

Weaknesses

  • Pure Dart implementation may lack the native performance of C-based matrix libraries for massive datasets

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0

none

import 'package:matrix2d/matrix2d.dart';

void main() {
  var zeros = m2d.zeros(2, 2);
  print(zeros);
}

Alternatives

Packages that do the same job and could replace matrix2d.

  • statistics

    Statistics package for data manipulation, mathematical functions, and Bayesian Networks.

  • advance_math

    A Dart library for mathematical programming, complex numbers, algebra, statistics, and geometry.

  • dartframe

    A data manipulation and analysis library inspired by Pandas and NumPy for Dart and Flutter.

  • starfruit

    Mathematical, collection, and statistical utility library for Dart extending dart:math.

Works with

Packages commonly used together with matrix2d: ones it builds on, ones built on it, and its own family.