MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / CSC_RowIterator

Class CSC_RowIterator

src/c_api.cpp:454–470  ·  view source on GitHub ↗

Row iterator of on column for CSC matrix

Source from the content-addressed store, hash-verified

452
453// Row iterator of on column for CSC matrix
454class CSC_RowIterator {
455 public:
456 CSC_RowIterator(const void* col_ptr, int col_ptr_type, const int32_t* indices,
457 const void* data, int data_type, int64_t ncol_ptr, int64_t nelem, int col_idx);
458 ~CSC_RowIterator() {}
459 // return value at idx, only can access by ascent order
460 double Get(int idx);
461 // return next non-zero pair, if index < 0, means no more data
462 std::pair<int, double> NextNonZero();
463
464 private:
465 int nonzero_idx_ = 0;
466 int cur_idx_ = -1;
467 double cur_val_ = 0.0f;
468 bool is_end_ = false;
469 std::function<std::pair<int, double>(int idx)> iter_fun_;
470};
471
472// start of c_api functions
473

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected