예제 #1
0
bool Polynomial::operator==(const Polynomial& rhs) {
	if (dims != rhs.getDims())
		return false;
	for (int i = 0; i < rhs.getDims(); i++)
		if (theta[i] != rhs.theta[i])
			return false;
	return true;
}
예제 #2
0
static bool scale(Polynomial& poly, double times) {
	if (times == 0) return false;
	//std::cout << poly.getDims() << "--";
	for (int i = 0; i < poly.getDims(); i++)
		poly[i] *= times;
	return true;
}