I have the following classes where I try to acces a protected member of the Base class but I get an error in eclipse "Field Factorized could not be resolved". Can someone explain to me what am I doing wrong? Why can't I access to the variable mFactorized
??
BASE CLASS
template <typename ValueType>
class AbstractDirectLinearSolver{
protected:
bool mFactorized;
public:
//Constructors, destructor
AbstractDirectLinearSolver(){
mFactorized = false;
}
virtual ~AbstractDirectLinearSolver();
//Methods
virtual void Solve(Vector<ValueType>& x, const Vector<ValueType>& b) const = 0;
virtual void Factorize(AbstractMatrix<ValueType>& A) = 0;
};
DERIVED CLASS
#include "AbstractDirectLinearSolver.hpp"
template<typename ValueType>
class CholeskySolver: public AbstractDirectLinearSolver {
private:
AbstractMatrix<ValueType> *mR; //Pointer = Abstract class NOT ALLOWS instantiation !!
public:
CholeskySolver() {
mR = NULL;
}
~CholeskySolver() {
if (this->mFactorized) { //ERROR HERE
delete mR;
}
}
void Solve(const Vector<ValueType>& x, const Vector<ValueType>& b) {
Vector<ValueType> y(mR->ApplyLowInv(b));
x = mR->ApplyLowerTransponse(y);
}
void Factorize(AbstractMatrix<ValueType>& A) {
if (mR != NULL)
delete mR;
mR = NULL;
A.CholeskyFactorization(mR);
this->mFactorized; //ERROR HERE
}
};