示例#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
        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]));
            }
        }