Currently, we can only initialize a Matrix object using <std::vector<std::vector<double>> or <std::vector<std::vector<std::string>>.
So, if I want to create a Matrix with 1 row and 1 column I need to create a 2-D vector object and then use the init() method which seems a bit redundant.
Describe the solution you'd like
Overload init() method such that we can use a double, std::string, std::vector<double> and std::vector<std::string> to initialize a Matrix object.
Expectation
After completion, init(2) should give me a Matrix object with 1 element. Similarly, for 1-D vectors.
Currently, we can only initialize a
Matrixobject using<std::vector<std::vector<double>>or<std::vector<std::vector<std::string>>.So, if I want to create a
Matrixwith 1 row and 1 column I need to create a 2-D vector object and then use theinit()method which seems a bit redundant.Describe the solution you'd like
Overload
init()method such that we can use adouble,std::string,std::vector<double>andstd::vector<std::string>to initialize aMatrixobject.Expectation
After completion, init(2) should give me a
Matrixobject with 1 element. Similarly, for 1-D vectors.