I am making a numpy equivalent library like nd4j in java but I want to implement it myself. However, I cannot find any resources online to help my research. I hope to support basic numpy features like randn and shape and dot product
I have made a barebones Matrix class but already encountered a problem. It uses generics to define the Matrix but I have to use the Object class to store the n-dimensional matrix.
public class Matrix<T> {
Object values;
int size;
Matrix() {
}
Matrix(int[] shape) {
size = shape.length;
}
Matrix(Object values) {
this.values = values;
}
}
The libary should perfrom matrix operation like numpy syntas such as
Matrix<int> m = new Matrix<T>([100,100]);
m=m*m;
m++;
m+=10;
m = m+m;
m = m^2
m = np.dot(m,m)
I will convert the java files to kotlin, as kotlin supports operator overloading