LLVM-accelerated Generic Numerical Library for Science and Machine Learning

Package Information

Version1.1.0 (2017-Mar-29)
Copyright2015-2016, Ilya Yaroshenko, Mir Team
AuthorsIlya Yaroshenko, Sebastian Wilzbach
Registered byIlya Yaroshenko




To use this package, put the following dependency into your project's dependencies section:



❗ ndslice was reworked and moved to Mir-Algorithm.

The last Mir version with old ndslice is v0.22.1.

❗️ Mir GLAS was moved to

Dub downloads License Bountysource Gitter

Latest version Circle CI



Generic Numerical Library for Science and Machine Learning.

Separated Mir Projects
Open Source Projects based on Mir


Documentation API can be found here. Read also the Mir blog.


  • mir.glas - Generic Linear Algebra Subroutines
  • mir.sparse Sparse Tensors
  • Sparse - DOK format
  • Different ranges for COO format
  • CompressedTensor - CSR/CSC formats
  • mir.sparse.blas - Sparse BLAS for CompressedTensor
  • mir.model.lda.hoffman - Online variational Bayes for latent Dirichlet allocation (Online VB LDA) for sparse documents. LDA is used for topic modeling.
  • mir.combinatorics Combinations, combinations with repeats, cartesian power, permutations.


LDC (LLVM D Compiler)
  • >=1.1.0

  • >=2.072

LinuxMac OS XWindows
64-bitBuild StatusBuild StatusBuild status
32-bitBuild StatusN/AN/A

Fast setup with the dub package manager

Latest version

Dub is the D's package manager. You can create a new project with:

dub init <project-name>

Now you need to edit the dub.json add mir as dependency.

	"dependencies": {
		"mir": "~><current-version>"
	"dflags-ldc": ["-mcpu=native"]

Now you can create an app.d file in the source folder and run your code with

dub --compiler=ldmd2

Flag --build=release and can be added for a performance boost:

dub --compiler=ldmd2 --build=release

ldmd2 is a shell on top of LDC (LLVM D Compiler).

"dflags-ldc": ["-mcpu=native"] allows LDC to optimize Mir for your CPU.


See our TODO List. Mir is very young and we are open for contributing to source code, documentation, examples and benchmarks.

Available versions

1.1.0 1.0.0 0.23.0 0.22.1 0.22.0 0.21.0 0.20.3 0.20.2 0.20.1 0.20.0 0.19.0 0.18.6 0.18.5 0.18.4 0.18.3 0.18.2 0.18.1 0.18.0 0.18.0-beta0 0.18.0-alpha1 0.18.0-alpha0 0.17.0-alpha9 0.17.0-alpha8 0.17.0-alpha7 0.17.0-alpha6 0.17.0-alpha5 0.17.0-alpha4 0.17.0-alpha3 0.17.0-alpha2 0.17.0-alpha1 0.17.0-alpha0 0.16.0-beta2 0.16.0-beta1 0.16.0-beta0 0.16.0-alpha9 0.16.0-alpha8 0.16.0-alpha7 0.16.0-alpha6 0.16.0-alpha5 0.16.0-alpha4 0.16.0-alpha3 0.16.0-alpha2 0.16.0-alpha10 0.16.0-alpha1 0.15.3 0.15.2 0.15.1-beta2 0.15.1-beta 0.15.0-beta4 0.15.0-beta3 0.15.0-beta2 0.15.0-beta 0.13.3 0.13.2 0.13.1 0.13.0 0.12.0-beta 0.11.1 0.11.0-beta2 0.11.0-beta 0.10.2 0.10.1-alpha 0.10.0-beta 0.10.0-alpha 0.9.0-beta.1 0.9.0-beta 0.9.0-alpha.1 0.9.0-alpha.0 ~master ~wilzbach-patch-2 ~wilzbach-patch-1 ~tinflex ~rglas ~newndslice ~blas ~alg ~9il-patch-3 ~9il-patch-1