| 1880 | } |
| 1881 | |
| 1882 | double CSC_RowIterator::Get(int idx) { |
| 1883 | while (idx > cur_idx_ && !is_end_) { |
| 1884 | auto ret = iter_fun_(nonzero_idx_); |
| 1885 | if (ret.first < 0) { |
| 1886 | is_end_ = true; |
| 1887 | break; |
| 1888 | } |
| 1889 | cur_idx_ = ret.first; |
| 1890 | cur_val_ = ret.second; |
| 1891 | ++nonzero_idx_; |
| 1892 | } |
| 1893 | if (idx == cur_idx_) { |
| 1894 | return cur_val_; |
| 1895 | } else { |
| 1896 | return 0.0f; |
| 1897 | } |
| 1898 | } |
| 1899 | |
| 1900 | std::pair<int, double> CSC_RowIterator::NextNonZero() { |
| 1901 | if (!is_end_) { |
no outgoing calls
no test coverage detected