예제 #1
0
HomologieValue& HomologieValue::operator-=(const HomologieValue& rhs) {
	if (dimension() != rhs.dimension()) {
		throw DimensionException();
	}
	for (unsigned int i = 0; i < dim; ++i) {
		base[i] -= rhs[i];
	}
	return *this;
}
예제 #2
0
파일: CscMatrix.hpp 프로젝트: cmu-sei/gbtl
        void buildmatrix(RAIteratorI  i_it,
                         RAIteratorJ  j_it,
                         RAIteratorV  v_it,
                         IndexType    n,
                         AccumT       accum = AccumT())
        {
            for (IndexType idx = 0; idx < n; ++idx)
            {
                IndexType i = i_it[idx];
                IndexType j = j_it[idx];
                if ((i >= m_num_rows) || (j >= m_num_cols))
                {
                    throw DimensionException();
                }

                set_value_at(i, j, accum(get_value_at(i, j), v_it[idx]));
            }
        }