我对C ++很陌生,我有一些问题。 我在以下结构中有类似的内容:
struct Data {
size_t num_rows, num_cols, num_feat;
float *labels;
Entry *data;
inline Row GetRow(size_t i)
return Row(label[i], ?pointer to the row data...
inline Column GetColumn(size_t i)
return Row(?pointer to the col data...
inline Entry GetEntry(size_t row, size_t col)
return data[?pointer to Entry
};
struct Row {
float label;
Entry *data;
inline Entry GetEntry(size_t i) // do I need pointer here?
return data[i];
};
struct Column {
Entry *data;
inline Entry GetEntry(size_t i) // do I need pointer here?
return data[i];
};
struct Entry {
size_t feat;
float value;
Entry(size_t i_feat, bst_float fvalue) : feat(feat), value(value) {}
};
您可以查看代码内问题吗? 我该如何填写?
谢谢。