using System; using static System.Math; using static System.Console; class main{ static void Main(){ vector c = new vector("1 1"); int n=c.size; matrix A = new matrix(n,n); var rnd=new System.Random(1); for(int i=0;i f = (z)=>{ ncalls++; return ( A*(z-c) ).norm(); }; double eps=1e-4; vector p = new vector("2 2"); p.print("broyden:\n start point:"); int nsteps = qnewton.broyden(f,ref p,eps); WriteLine($"nsteps={nsteps}"); p.print("x_min= "); Write($"f(x_min)={f(p)}\n"); WriteLine($"eps = {eps}"); vector g=qnewton.gradient(f,p); WriteLine($"gradient(f(x_min)).norm() = {g.norm()}"); if(g.norm()