www-ai.cs.tu-dortmund.de/de/LEHRE/VORLESUNGEN/NOPT/SS14/code/rosenbrock.html
Create a matrix for the given list l with the given number of rows(r) and column(r) # Ex. x = mat(c(1,2,3,4), 2, 2) mat <- function(l, r, c, byrow=TRUE) { len = length(l); if(!(len = r*c)) { print("Error in [...] print("Error in f(x): x must be 2x1 matrix"); return (NULL); } x1 = x[1]; x2 = x[2]; val = mat( c( -400*(x2-3*x1^2)+2, -400*x1, -400*x1, 200 ), 2, 2 ) return(val) } …