Eigen_demo: Nonlinear functions

git-svn-id: svn://ultimatepp.org/upp/trunk@14515 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2020-05-30 09:29:05 +00:00
parent d4ca363f30
commit 3b78f886f1
2 changed files with 7 additions and 2 deletions

View file

@ -125,6 +125,11 @@ CONSOLE_APP_MAIN
Cout() << "\nHere is the matrix a^T\n" << a.transpose();
Cout() << "\nHere is the conjugate of a\n" << a.conjugate();
Cout() << "\nHere is the matrix a^*\n" << a.adjoint();
VectorXd v(5);
v << 1, 2, 3, 4, 5;
Cout() << "\n\nInitial vector " << v.transpose();
Cout() << "\nReversed vector " << v.reverse().transpose();
}
Cout() << "\n\nMatrix-matrix and matrix-vector multiplication";
{

View file

@ -193,11 +193,11 @@ void NonLinearSolving() {
Cout() << "\nEquation solving FAILED!";
}
Cout() << "\n\nThis is a simpler way, using NonLinearSolver()";
Cout() << "\n\nThis is a simpler way, using SolveNonLinearEquations()";
x.setConstant(n, -1.); // Initial values
if (!NonLinearSolver(x, [&](const VectorXd &x, VectorXd &residual)->int {
if (!SolveNonLinearEquations(x, [&](const VectorXd &x, VectorXd &residual)->int {
const ptrdiff_t n = x.size();
ASSERT(residual.size() == n);