#include <iostream>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
namespace blas=boost::numeric::ublas;
template <typename T>
class Matrix<T>: public blas::matrix<T> {
public:
void testing(){ std::cout << "Testing" << std::endl;};
};
usingnamespace std;
usingnamespace blas;
int main() {
Matrix<int> test(3,3);
for (int i; i < 3; i++){
for (int j; j < 3; j++){
test(i,j) = i*j;
}
}
cout << test << endl;
}
The error that I am getting is:
1 2 3 4 5
inheritence.cc:10:7: error: ‘Matrix’ is not a template
inheritence.cc: In function ‘int main()’:
inheritence.cc:20:25: error: no matching function for call to ‘Matrix<int>::Matrix(int, int)’
inheritence.cc:10:41: note: candidates are: Matrix<int>::Matrix()
inheritence.cc:10:41: note: Matrix<int>::Matrix(const Matrix<int>&)
Now, I will admit that I am NOT an expert in template arguments or inheritance, so this is pretty cobbled together :)
Any suggestions/advice on how to resolve this problem will be welcomed.