示例#1
0
/** Converts a Generator object to a rational vector
 */
math::rational_vector convert_to_rational_vector(
		const Generator& g) {
	math::rational_vector p=
			math::rational_vector(g.space_dimension());
//	mpq_class q(0);
	for (unsigned int i=0; i<g.space_dimension(); ++i) {
		p[i]=Rational(g.coefficient(Variable(i)), g.divisor());
	}
	return p;
}
示例#2
0
math::double_vector convert_to_double_vector(const Generator& g) {
	math::double_vector p=
			math::double_vector(g.space_dimension());
	Rational temp;

	for (unsigned int i=0; i<g.space_dimension(); ++i) {
		temp = Rational(g.coefficient(Variable(i)), g.divisor());
		p[i] = temp.get_double();
	}
	return p;
}