# dnumeric 0.5.2

D Numeric Library with R syntax

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

dub.json
dub.sdl

## DNumeric

D Numeric Library with R Syntax

### Import

"dnumeric": "~>0.3.0"

or dub.sdl

dependency "dnumeric" version="~>0.3.0"

### Usage

import dnum.tensor;
import dnum.linalg;
import dnum.utils;

// Tensor Declaration
auto a = Tensor([1,2,3,4]); // Single row tensor
auto a = Tensor([1,2,3,4], Shape.Row) // Also row tensor
auto b = Tensor([1,2,3,4], Shape.Col); // Single column tensor
auto c = Tensor([[1,2],[3,4]]); // Two Dimensional Tensor

a.nrow.writeln; // The number of rows of a
b.ncol.writeln; // The number of cols of b
assert(a.nrow == b.ncol); // Same

a.transpose.writeln; // (== b)
c.transpose.writeln; // (== Tensor([[1,3],[2,4]]))

// Operation
-b.writeln; // Negation
(b - b).writeln; // Subtraction
(b * b).writeln; // Multiplication (component-wise)
(b / b).writeln; // Division
(b % b).writeln; // Matrix multiplication

// Linear Algebra
b.det.writeln; // Determinant (Using LU Decomposition)
b.inv.writeln; // Inverse (Using LU Decomposition)
b.lu[0].writeln; // LU Decomposition - L
b.lu[1].writeln; // LU Decomposition - U

// Utils
cbind(b, b).writeln; // Tensor([[1,2,1,2],[3,4,3,4]])
rbind(b, b).writeln; // Tensor([[1,2],[3,4],[1,2],[3,4]])
c.col(0).writeln; // Tensor([[1], [3]])
c.row(0).writeln; // Tensor([[1, 2]])
• Registered by Tae Geun Kim
• 0.5.2 released a month ago
• Axect/DNumeric
• BSD 3-clause
Authors:
• Tae Geun Kim
Dependencies:
none
Versions:
 0.5.2 2018-Sep-11 0.5.1 2018-Aug-23 0.5.0 2018-Aug-22 0.4.2 2018-Aug-20 0.4.1 2018-Aug-15