mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Eigen_demo: Nonlinear functions
git-svn-id: svn://ultimatepp.org/upp/trunk@14515 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d4ca363f30
commit
3b78f886f1
2 changed files with 7 additions and 2 deletions
|
|
@ -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";
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue