コード例 #1
0
/**
 * 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;
}
コード例 #2
0
ファイル: String.cpp プロジェクト: chronos38/lupus-framework
		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();
			}
		}
コード例 #3
0
/**
 * 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;
}