0.0.3 • Published 5 years ago

zetamatrix v0.0.3

Weekly downloads
5
License
ISC
Repository
-
Last release
5 years ago

Zeta Matrix

Introduction

This is a simple matrix library including the following functions: 1. Addition 2. Subtraction 3. Multiplication 4. Entrywise multiplication

How to use

//Create a matrix object
var matrix = new Matrix([number of row], [number of col]);

//Add value to the matrix
matrix.write(1).write(2).write(3);

//Add all values to the matrix
matrix.writeAll(
    1, 2, 3,
    4, 5, 6,
    7, 8, 9
);
matrix.print(); //Print the matrix

1                 2                 3                 
4                 5                 6                 
7                 8                 9      

//Transpose
var matrixT = matrix.transpose(); //matrix will not changed.

//Matrix
1                 2                 3                 
4                 5                 6                 
7                 8                 9       

//MatrixT
1                 4                 7                 
2                 5                 8                 
3                 6                 9  

//Addition (add) / Subtraction (subtract) / Multiplication (multiply)
//Parameter [Const / Matrix]
matrix.add(3).print(); //Note that the matrix will be updated.
4                 5                 6                 
7                 8                 9                 
10                11                12       

matrix.add(matrixT).print();
5                 9                 13                
9                 13                17                
13                17                21

//Clone the matrix
var newMatrix = matrix.clone();
0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago

0.0.0

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago