mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
fix compile errors in Tridiagonalization and in doc examples
This commit is contained in:
@@ -11,10 +11,10 @@ firstTwo(MatrixBase<Derived>& v)
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
const Eigen::VectorBlock<Derived, 2>
|
||||
const Eigen::VectorBlock<const Derived, 2>
|
||||
firstTwo(const MatrixBase<Derived>& v)
|
||||
{
|
||||
return Eigen::VectorBlock<Derived, 2>(v.derived(), 0);
|
||||
return Eigen::VectorBlock<const Derived, 2>(v.derived(), 0);
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
|
||||
@@ -11,10 +11,10 @@ segmentFromRange(MatrixBase<Derived>& v, int start, int end)
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
const Eigen::VectorBlock<Derived>
|
||||
const Eigen::VectorBlock<const Derived>
|
||||
segmentFromRange(const MatrixBase<Derived>& v, int start, int end)
|
||||
{
|
||||
return Eigen::VectorBlock<Derived>(v.derived(), start, end-start);
|
||||
return Eigen::VectorBlock<const Derived>(v.derived(), start, end-start);
|
||||
}
|
||||
|
||||
int main(int, char**)
|
||||
|
||||
@@ -4,7 +4,7 @@ cout << "Here is a random self-adjoint 4x4 matrix:" << endl << A << endl << endl
|
||||
|
||||
Tridiagonalization<MatrixXcd> triOfA(A);
|
||||
MatrixXd T = triOfA.matrixT();
|
||||
cout << "The tridiagonal matrix T is:" << endl << triOfA.matrixT() << endl << endl;
|
||||
cout << "The tridiagonal matrix T is:" << endl << T << endl << endl;
|
||||
|
||||
cout << "We can also extract the diagonals of T directly ..." << endl;
|
||||
VectorXd diag = triOfA.diagonal();
|
||||
|
||||
Reference in New Issue
Block a user