| 599 | } |
| 600 | |
| 601 | XGB_DLL int XGDMatrixSliceDMatrixEx(DMatrixHandle handle, const int *idxset, xgboost::bst_ulong len, |
| 602 | DMatrixHandle *out, int allow_groups) { |
| 603 | API_BEGIN(); |
| 604 | CHECK_HANDLE(); |
| 605 | if (!allow_groups) { |
| 606 | CHECK_EQ(static_cast<std::shared_ptr<DMatrix> *>(handle)->get()->Info().group_ptr_.size(), 0U) |
| 607 | << "slice does not support group structure"; |
| 608 | } |
| 609 | DMatrix *dmat = static_cast<std::shared_ptr<DMatrix> *>(handle)->get(); |
| 610 | *out = new std::shared_ptr<DMatrix>(dmat->Slice({idxset, static_cast<std::size_t>(len)})); |
| 611 | API_END(); |
| 612 | } |
| 613 | |
| 614 | XGB_DLL int XGDMatrixFree(DMatrixHandle handle) { |
| 615 | API_BEGIN(); |
no test coverage detected