https://github.com/boehnen/scalamatrixlibrary
A matrix library for Scala that supports various matrix operations
https://github.com/boehnen/scalamatrixlibrary
Last synced: 2 months ago
JSON representation
A matrix library for Scala that supports various matrix operations
- Host: GitHub
- URL: https://github.com/boehnen/scalamatrixlibrary
- Owner: boehnen
- License: mit
- Created: 2019-05-10T06:57:12.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2025-01-14T19:25:08.000Z (over 1 year ago)
- Last Synced: 2025-12-29T14:46:17.917Z (6 months ago)
- Language: Java
- Size: 73.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScalaMatrixLibrary
A matrix library for Scala that supports various matrix operations
## Documentation
**Transpose: Matrix** - this method transposes the Matrix, turning all rows into columns and columns into rows; these changes are returned in a new Matrix
**Traverse (visit: Double => Unit): Unit** - calls a visit function over every element in the Matrix
**Transform (visit: Double => Double): Matrix** - creates a new matrix with the values in the current matrix transformed by visit
**RowSwap (rowA: Int, rowB: Int): Matrix** - swaps the elements of two rows; these changes are returned in a new Matrix
**ReduceSum: Matrix** - adds up the values of all elements in each rows, making and returning a new Matrix with one column
**PrintMat: Unit** - prints the entire matrix to stdout
**Index (row: Int, col: Int): Double** - returns the value of the data stored at the given indices
**GetSize: Array\[Int]** - returns the size of the Matrix as an Array
**Add (lvalue: Matrix, rvalue: Matrix): Matrix** - adds two matrices together, returning the resulting matrix.
**Subtract (lvalue: Matrix, rvalue: Matrix): Matrix** - subtracts rvalue matrix from lvalue matrix, returning the resulting matrix.
**Multiply (lvalue: Matrix, rvalue: Matrix): Matrix** - multiplies two matrices together, returning the cross product of the matrices.
**AreEqual (lvalue: Matrix, rvalue: Matrix): Boolean** - evaluates whether lvalue and rvalue are identical matrices and returns the verdict.
**Identity (dim: Int): Matrix** - returns an identity matrix of size dim.