コードは次のとおりです。
typedef struct Triplet
{
double value;
int row;
int column;
};
class Matrix
{
public:
//Some methods
double specialMethod(/*params*/);
private:
std::vector<Triplet> elements;
int nRows;
int nColumns;
};
specialMethod
Matrix.element の値が呼び出された後、破損しています。しかし、次のように反復する以外に何も行われません。
std::vector<Triplet>::iterator it;
std::vector<Pair> buff;
for (it = this->elements.begin(); it != this->elements.end(); ++it)
{
if (it->column = n)
{
Pair p;
p.key = it->row;
p.value = it->value;
buff.push_back(p);
}
}
どこから間違いを探し始めればよいかわかりません。