I am looking for 2 things: a way to define a matrix in Swift and a way to diagonlize said matrix.
So far, I've found a way to make something that resembles a matrix using this:
var NumColumns = 2
var NumRows = 4
var array = Array<Array<Double>>()
for column in 0...NumColumns {
array.append(Array(repeating:Double(), count:NumRows))
}
print(array)
But someone told me that this will not do because after I have the matrix I will need to use a diagonalization algorithm specifically on a matrix and not something similar to a matrix.
Any ideas?