Skip to content

Matrix support and operations #14

@nonunknown

Description

@nonunknown

** Based on any issue? **
godotengine/godot#26793

** Solution **
Implement basic matrix operations, these are building blocks for NNs (Neural Networks) and other stuff

** API Description **

The Matrix will be a class containing the following methods:

ArrayToMatrix(arr:Array) -> void - Convert a input array to a 1 column matrix e.g: [1,2,3] will result in a matrix: [[1],[2],[3]]
MatrixToArray() -> Array - The inverse operation of the above method
PrettyPrint() -> void - Prints a Matrix the beatiful way
SetRandomData(int rows, int columns) -> void - Generate a random value with rows and columns
SetData(arr:Array) -> void - Set the matrix data e.g: [[1,2,3],[4,5,6]] a Matrix 2x3
Transpose() -> void - Rows becomes columns and vice-versa e.g: [[1,2,3],[4,5,6]] will become [[1,4],[2,5],[3,6]]
Multiply(by:Matrix) -> Matrix - Returns Matrices multiplication result
MultiplyScalar(value:float) -> Matrix - Multiply a entire matrix with a single value
Hadamard(by:Matrix) -> Matrix - Different from matrices multiplication each value from Matrix A is multiplied with each value from B
Add(by:Matrix) -> Matrix - Returns a Matrices Addition operation result
Subtract(by:Matrix) -> Matrix - Returns a Matrices Subtraction operation result

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions