| 592 | } |
| 593 | |
| 594 | R_xlen_t findName(const std::string& name) const { |
| 595 | SEXP names = RCPP_GET_NAMES(Storage::get__()); |
| 596 | if (Rf_isNull(names)) stop("'names' attribute is null"); |
| 597 | R_xlen_t n = Rf_xlength(names); |
| 598 | for (R_xlen_t i=0; i < n; ++i) { |
| 599 | if (strcmp(name.c_str(), CHAR(STRING_ELT(names, i))) == 0) { |
| 600 | return i; |
| 601 | } |
| 602 | } |
| 603 | std::stringstream ss; |
| 604 | ss << "no name '" << name << "' found"; |
| 605 | stop(ss.str()); |
| 606 | return -1; |
| 607 | } |
| 608 | |
| 609 | protected: |
| 610 | inline int* dims() const { |