/** * Returns the current non-zero non-missing value w_{ij} of the covariate. */ double DyadicCovariateValueIterator::value() const { if (!this->valid()) { throw InvalidIteratorException(); } return this->lcurrent->second; }
void String::Swap(Pointer<Iterator<char>>& lhs, Pointer<Iterator<char>>& rhs) { try { StringIterator& first = dynamic_cast<StringIterator&>(*lhs); StringIterator& second = dynamic_cast<StringIterator&>(*rhs); if (this != first._string || this != second._string) { throw InvalidIteratorException(); } else if (lhs->IsDone() || rhs->IsDone()) { throw IteratorOutOfBoundException(); } Lupus::Swap(_data[first._current], _data[second._current]); } catch (...) { throw InvalidIteratorException(); } }
/** * Returns the current actor j with a non-zero non-missing value * w_{ij} of the covariate. */ int DyadicCovariateValueIterator::actor() const { if (!this->valid()) { throw InvalidIteratorException(); } return this->lcurrent->first; }