raquel-oliveira / numerical-analysis

0 stars 0 forks source link

Change matrix constructors and structure to accept matrix of functions #36

Open greati opened 7 years ago

greati commented 7 years ago

The current implementation of the constructor Matrix(int) creates an identity matrix, but only for numbers, not covering the function field, where 0 and 1 are, actually, the constant functions [](...){return 0;} and [](..){return 1;}.

It's asked to modify this implementation so that the 1 and 0 elements can be specified. In other sense, this constructor is generalized to cover more types of matrices with equal elements in all positions except for the ones in the diagonal, which is filled with an specific element.

This constructor, then, becomes Matrix(int m, int n, TField a, TField b) and creates an mxn matrix with a in the diagonal and b in the other positions.