本文整理汇总了C++中PiecewisePolynomial::rows方法的典型用法代码示例。如果您正苦于以下问题:C++ PiecewisePolynomial::rows方法的具体用法?C++ PiecewisePolynomial::rows怎么用?C++ PiecewisePolynomial::rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PiecewisePolynomial
的用法示例。
在下文中一共展示了PiecewisePolynomial::rows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PiecewiseFunction
ExponentialPlusPiecewisePolynomial<CoefficientType>::ExponentialPlusPiecewisePolynomial(const PiecewisePolynomial<CoefficientType>& piecewise_polynomial_part) :
PiecewiseFunction(piecewise_polynomial_part),
K(Matrix<CoefficientType, Dynamic, Dynamic>::Zero(piecewise_polynomial_part.rows(), 1)),
A(Matrix<CoefficientType, Dynamic, Dynamic>::Zero(1, 1)),
alpha(Matrix<CoefficientType, Dynamic, Dynamic>::Zero(1, piecewise_polynomial_part.getNumberOfSegments())),
piecewise_polynomial_part(piecewise_polynomial_part)
{
assert(piecewise_polynomial_part.cols() == 1);
}
示例2:
bool PiecewisePolynomial<CoefficientType>::isApprox(
const PiecewisePolynomial<CoefficientType>& other, double tol) const {
if (rows() != other.rows() || cols() != other.cols()) return false;
if (!segmentTimesEqual(other, tol)) return false;
for (int segment_index = 0; segment_index < getNumberOfSegments();
segment_index++) {
const PolynomialMatrix& matrix = polynomials_[segment_index];
const PolynomialMatrix& other_matrix = other.polynomials_[segment_index];
for (Eigen::Index row = 0; row < rows(); row++) {
for (Eigen::Index col = 0; col < cols(); col++) {
if (!matrix(row, col).isApprox(other_matrix(row, col), tol))
return false;
}
}
}
return true;
}