I am new to C++ and recently took on the study of objective oriented programming. I wanted to write my own linear algebra module processing three dimensional vectors and 3x3 matrices. I tried to define a matrix as a class consisting of three vectors.
class vector {
public:
double n1, n2, n3;
vector (double a, double b, double c) {
n1 = a; n2 = b; n3 = c;
}
};
class matrix {
public:
vector m1, m2, m3;
matrix (vector a, vector b, vector c) {
m1 = a; m2 = b; m3 = c;
}
};
However, I am getting a compilation error:
In constructor `matrix::matrix(vector, vector, vector)':
no matching function for call to `vector::vector()'
I am guessing that the program doesnt know how to construct a matrix using the vector class i defined. However I do not understand why. If anybody could explain, i would be very grateful.