Creates a new matrix based off the given vectors. @param a the first Vector, this new Matrix will have as many rows as the length of this vector @param b the second Vector, this new Matrix will have as many columns as this length of this vector
(Vec a, Vec b)
| 33 | * @param b the second Vector, this new Matrix will have as many columns as this length of this vector |
| 34 | */ |
| 35 | public DenseMatrix(Vec a, Vec b) |
| 36 | { |
| 37 | matrix = new double[a.length()][b.length()]; |
| 38 | for(int i = 0; i < a.length(); i++) |
| 39 | { |
| 40 | Vec rowVals = b.multiply(a.get(i)); |
| 41 | for(int j = 0; j < b.length(); j++) |
| 42 | matrix[i][j] = rowVals.get(j); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Creates a new matrix of zeros |