a function that accepts a vector x and returns a vector F
+
x0 :
+
a vector of double, contains initial guess of variables.
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
a vector of double, contains lower bounds of the variables.
+
ub :
+
a vector of double, contains upper bounds of the variables.
+
nonlcon:
+
a function, the nonlinear constraints
+
options :
+
a list, containing the option for user to specify. See below for details.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
attainfactor:
+
The amount of over- or underachievement of the goals,γ at the solution.
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
fgoalattain solves the goal attainment problem, which is one formulation for minimizing a multiobjective optimization problem.
+Finds the minimum of a problem specified by:
+Minimise Y such that
+
+
The solver makes use of fmincon to find the minimum.
+
The fgoalattain finds out the maximum value of Y for the objectives evaluated at the starting point and
+adds that as another variable to the vector x
+This is passed to the fmincon function to get the optimised value of Y
+Hence, the algorithm used mainly is "ipopt" to obtain the optimum solution
+The relations between f(x), Y, weights and goals are added as additional non-linear inequality constraints
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
+
CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
+
GradObj : a function, representing the gradient function of the Objective in Vector Form.
+
GradCon : a function, representing the gradient of the Non-Linear Constraints (both Equality and Inequality) of the problem. It is declared in such a way that gradient of non-linear inequality constraints are defined first as a separate Matrix (cg of size m2 X n or as an empty), followed by gradient of non-linear equality constraints as a separate Matrix (ceqg of size m2 X n or as an empty) where m2 & m3 are number of non-linear inequality and equality constraints respectively.
By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of gattainObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates gattainObjfun gradient using numderivative toolbox.
+
If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.
+
Furthermore, we must enable the "GradObj" option with the statement :
+
+This will let fminimax know that the exact gradient of the objective function is known, so that it can change the calling sequence to the objective function. Note that, fGrad should be mentioned in the form of N x n where n is the number of variables, N is the number of functions in objective function.
+
The constraint function must have header :
+
[c,ceq]=confun(x)
+where x is a n x 1 matrix of doubles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints).
+On input, the variable x contains the current point and, on output, the variable c must contain the nonlinear inequality constraints and ceq must contain the nonlinear equality constraints.
+
By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of confun. In case the GradObj option is on and GradCons option is off, fminimax approximates confun gradient using numderivative toolbox.
+
If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.
+
Furthermore, we must enable the "GradCon" option with the statement :
+
+This will let fminimax know that the exact gradient of the objective function is known, so that it can change the calling sequence to the objective function.
+
The constraint derivative function must have header :
+
[dc,dceq]=confungrad(x)
+where dc is a nni x n matrix of doubles and dceq is a nne x n matrix of doubles.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum amount of CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.Iterations: The number of iterations performed during the search
+
output.Cpu_Time: The total cpu-time spend during the search
+
output.Objective_Evaluation: The number of Objective Evaluations performed during the search
+
output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
lambda.eqnonlin: The Lagrange multipliers for the non-linear equality constraints.
+
lambda.ineqnonlin: The Lagrange multipliers for the non-linear inequality constraints.
a function, representing the objective function of the problem
+
x1 :
+
a vector, containing the lower bound of the variables of size (1 X n) or (n X 1) where 'n' is the number of Variables, where n is number of Variables
+
x2 :
+
a vector, containing the upper bound of the variables of size (1 X n) or (n X 1) or (0 X 0) where 'n' is the number of Variables. If x2 is empty it means upper bound is +infinity
+
options :
+
a list, containing the option for user to specify. See below for details.
+
xopt :
+
a vector of doubles, containing the the computed solution of the optimization problem.
+
fopt :
+
a scalar of double, containing the the function value at x.
+
exitflag :
+
a scalar of integer, containing the flag which denotes the reason for termination of algorithm. See below for details.
+
output :
+
a structure, containing the information about the optimization. See below for details.
+
lambda :
+
a structure, containing the Lagrange multipliers of lower bound and upper bound at the optimized point. See below for details.
+
+
Description
+
Search the minimum of a multi-variable function on bounded interval specified by :
+Find the minimum of f(x) such that
+
+
The routine calls Ipopt for solving the Bounded Optimization problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.Iterations: The number of iterations performed during the search
+
output.Cpu_Time: The total cpu-time spend during the search
+
output.Objective_Evaluation: The number of Objective Evaluations performed during the search
+
output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
+
+
Examples
+
//Find x in R^6 such that it minimizes:
+//f(x)= sin(x1) + sin(x2) + sin(x3) + sin(x4) + sin(x5) + sin(x6)
+//-2 <= x1,x2,x3,x4,x5,x6 <= 2
+//Objective function to be minimised
+functiony=f(x)
+y=0
+fori=1:6
+y=y+sin(x(i));
+end
+endfunction
+//Variable bounds
+x1=[-2,-2,-2,-2,-2,-2];
+x2=[2,2,2,2,2,2];
+//Options
+options=list("MaxIter",[1500],"CpuTime",[100],"TolX",[1e-6])
+//Calling Ipopt
+[x,fval]=fminbnd(f,x1,x2,options)
+// Press ENTER to continue
+
+
Examples
+
//Find x in R such that it minimizes:
+//f(x)= 1/x^2
+//0 <= x <= 1000
+//Objective function to be minimised
+functiony=f(x)
+y=1/x^2
+endfunction
+//Variable bounds
+x1=[0];
+x2=[1000];
+//Calling Ipopt
+[x,fval,exitflag,output,lambda]=fminbnd(f,x1,x2)
+// Press ENTER to continue
+
+
Examples
+
//The below problem is an unbounded problem:
+//Find x in R^2 such that it minimizes:
+//f(x)= -[(x1-1)^2 + (x2-1)^2]
+//-inf <= x1,x2 <= inf
+//Objective function to be minimised
+functiony=f(x)
+y=-((x(1)-1)^2+(x(2)-1)^2);
+endfunction
+//Variable bounds
+x1=[-%inf,-%inf];
+x2=[];
+//Options
+options=list("MaxIter",[1500],"CpuTime",[100],"TolX",[1e-6])
+//Calling Ipopt
+[x,fval,exitflag,output,lambda]=fminbnd(f,x1,x2,options)
a function, representing the objective function of the problem
+
x0 :
+
a vector of doubles, containing the starting values of variables of size (1 X n) or (n X 1) where 'n' is the number of Variables
+
A :
+
a matrix of doubles, containing the coefficients of linear inequality constraints of size (m X n) where 'm' is the number of linear inequality constraints
+
b :
+
a vector of doubles, related to 'A' and containing the the Right hand side equation of the linear inequality constraints of size (m X 1)
+
Aeq :
+
a matrix of doubles, containing the coefficients of linear equality constraints of size (m1 X n) where 'm1' is the number of linear equality constraints
+
beq :
+
a vector of doubles, related to 'Aeq' and containing the the Right hand side equation of the linear equality constraints of size (m1 X 1)
+
lb :
+
a vector of doubles, containing the lower bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of Variables
+
ub :
+
a vector of doubles, containing the upper bounds of the variables of size (1 X n) or (n X 1) where 'n' is the number of Variables
+
nlc :
+
a function, representing the Non-linear Constraints functions(both Equality and Inequality) of the problem. It is declared in such a way that non-linear inequality constraints are defined first as a single row vector (c), followed by non-linear equality constraints as another single row vector (ceq). Refer Example for definition of Constraint function.
+
options :
+
a list, containing the option for user to specify. See below for details.
+
xopt :
+
a vector of doubles, cointating the computed solution of the optimization problem
+
fopt :
+
a scalar of double, containing the the function value at x
+
exitflag :
+
a scalar of integer, containing the flag which denotes the reason for termination of algorithm. See below for details.
+
output :
+
a structure, containing the information about the optimization. See below for details.
+
lambda :
+
a structure, containing the Lagrange multipliers of lower bound, upper bound and constraints at the optimized point. See below for details.
+
gradient :
+
a vector of doubles, containing the Objective's gradient of the solution.
+
hessian :
+
a matrix of doubles, containing the Lagrangian's hessian of the solution.
+
+
Description
+
Search the minimum of a constrained optimization problem specified by :
+Find the minimum of f(x) such that
+
+
The routine calls Ipopt for solving the Constrained Optimization problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
+
CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
+
GradObj : a function, representing the gradient function of the Objective in Vector Form.
+
Hessian : a function, representing the hessian function of the Lagrange in Symmetric Matrix Form with Input parameters x, Objective factor and Lambda. Refer Example for definition of Lagrangian Hessian function.
+
GradCon : a function, representing the gradient of the Non-Linear Constraints (both Equality and Inequality) of the problem. It is declared in such a way that gradient of non-linear inequality constraints are defined first as a separate Matrix (cg of size m2 X n or as an empty), followed by gradient of non-linear equality constraints as a separate Matrix (ceqg of size m2 X n or as an empty) where m2 & m3 are number of non-linear inequality and equality constraints respectively.
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum amount of CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.Iterations: The number of iterations performed during the search
+
output.Cpu_Time: The total cpu-time spend during the search
+
output.Objective_Evaluation: The number of Objective Evaluations performed during the search
+
output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
lambda.eqnonlin: The Lagrange multipliers for the non-linear equality constraints.
+
lambda.ineqnonlin: The Lagrange multipliers for the non-linear inequality constraints.
+
+
+
Examples
+
//Find x in R^2 such that it minimizes:
+//f(x)= -x1 -x2/3
+//x0=[0,0]
+//constraint-1 (c1): x1 + x2 <= 2
+//constraint-2 (c2): x1 + x2/4 <= 1
+//constraint-3 (c3): x1 - x2 <= 2
+//constraint-4 (c4): -x1/4 - x2 <= 1
+//constraint-5 (c5): -x1 - x2 <= -1
+//constraint-6 (c6): -x1 + x2 <= 2
+//constraint-7 (c7): x1 + x2 = 2
+//Objective function to be minimised
+functiony=f(x)
+y=-x(1)-x(2)/3;
+endfunction
+//Starting point, linear constraints and variable bounds
+x0=[0,0];
+A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1];
+b=[2;1;2;1;-1;2];
+Aeq=[1,1];
+beq=[2];
+lb=[];
+ub=[];
+nlc=[];
+//Gradient of objective function
+functiony=fGrad(x)
+y=[-1,-1/3];
+endfunction
+//Hessian of lagrangian
+functiony=lHess(x, obj, lambda)
+y=obj*[0,0;0,0]
+endfunction
+//Options
+options=list("GradObj",fGrad,"Hessian",lHess);
+//Calling Ipopt
+[x,fval,exitflag,output,lambda,grad,hessian]=fmincon(f,x0,A,b,Aeq,beq,lb,ub,nlc,options)
+// Press ENTER to continue
+
+
Examples
+
//Find x in R^3 such that it minimizes:
+//f(x)= x1*x2 + x2*x3
+//x0=[0.1 , 0.1 , 0.1]
+//constraint-1 (c1): x1^2 - x2^2 + x3^2 <= 2
+//constraint-2 (c2): x1^2 + x2^2 + x3^2 <= 10
+//Objective function to be minimised
+functiony=f(x)
+y=x(1)*x(2)+x(2)*x(3);
+endfunction
+//Starting point, linear constraints and variable bounds
+x0=[0.1,0.1,0.1];
+A=[];
+b=[];
+Aeq=[];
+beq=[];
+lb=[];
+ub=[];
+//Nonlinear constraints
+function[c, ceq]=nlc(x)
+c=[x(1)^2-x(2)^2+x(3)^2-2,x(1)^2+x(2)^2+x(3)^2-10];
+ceq=[];
+endfunction
+//Gradient of objective function
+functiony=fGrad(x)
+y=[x(2),x(1)+x(3),x(2)];
+endfunction
+//Hessian of the Lagrange Function
+functiony=lHess(x, obj, lambda)
+y=obj*[0,1,0;1,0,1;0,1,0]+lambda(1)*[2,0,0;0,-2,0;0,0,2]+lambda(2)*[2,0,0;0,2,0;0,0,2]
+endfunction
+//Gradient of Non-Linear Constraints
+function[cg, ceqg]=cGrad(x)
+cg=[2*x(1),-2*x(2),2*x(3);2*x(1),2*x(2),2*x(3)];
+ceqg=[];
+endfunction
+//Options
+options=list("MaxIter",[1500],"CpuTime",[500],"GradObj",fGrad,"Hessian",lHess,"GradCon",cGrad);
+//Calling Ipopt
+[x,fval,exitflag,output]=fmincon(f,x0,A,b,Aeq,beq,lb,ub,nlc,options)
+// Press ENTER to continue
+
+
Examples
+
//The below problem is an unbounded problem:
+//Find x in R^3 such that it minimizes:
+//f(x)= -(x1^2 + x2^2 + x3^2)
+//x0=[0.1 , 0.1 , 0.1]
+// x1 <= 0
+// x2 <= 0
+// x3 <= 0
+//Objective function to be minimised
+functiony=f(x)
+y=-(x(1)^2+x(2)^2+x(3)^2);
+endfunction
+//Starting point, linear constraints and variable bounds
+x0=[0.1,0.1,0.1];
+A=[];
+b=[];
+Aeq=[];
+beq=[];
+lb=[];
+ub=[0,0,0];
+//Options
+options=list("MaxIter",[1500],"CpuTime",[500]);
+//Calling Ipopt
+[x,fval,exitflag,output,lambda,grad,hessian]=fmincon(f,x0,A,b,Aeq,beq,lb,ub,[],options)
+// Press ENTER to continue
+
+
Examples
+
//The below problem is an infeasible problem:
+//Find x in R^3 such that in minimizes:
+//f(x)=x1*x2 + x2*x3
+//x0=[1,1,1]
+//constraint-1 (c1): x1^2 <= 1
+//constraint-2 (c2): x1^2 + x2^2 <= 1
+//constraint-3 (c3): x3^2 <= 1
+//constraint-4 (c4): x1^3 = 0.5
+//constraint-5 (c5): x2^2 + x3^2 = 0.75
+// 0 <= x1 <=0.6
+// 0.2 <= x2 <= inf
+// -inf <= x3 <= 1
+//Objective function to be minimised
+functiony=f(x)
+y=x(1)*x(2)+x(2)*x(3);
+endfunction
+//Starting point, linear constraints and variable bounds
+x0=[1,1,1];
+A=[];
+b=[];
+Aeq=[];
+beq=[];
+lb=[00.2,-%inf];
+ub=[0.6%inf,1];
+//Nonlinear constraints
+function[c, ceq]=nlc(x)
+c=[x(1)^2-1,x(1)^2+x(2)^2-1,x(3)^2-1];
+ceq=[x(1)^3-0.5,x(2)^2+x(3)^2-0.75];
+endfunction
+//Gradient of objective function
+functiony=fGrad(x)
+y=[x(2),x(1)+x(3),x(2)];
+endfunction
+//Hessian of the Lagrange Function
+functiony=lHess(x, obj, lambda)
+y=obj*[0,1,0;1,0,1;0,1,0]+lambda(1)*[2,0,0;0,0,0;0,0,0]+lambda(2)*[2,0,0;0,2,0;0,0,0]+lambda(3)*[0,0,0;0,0,0;0,0,2]+lambda(4)*[6*x(1),0,0;0,0,0;0,0,0]+lambda(5)*[0,0,0;0,2,0;0,0,2];
+endfunction
+//Gradient of Non-Linear Constraints
+function[cg, ceqg]=cGrad(x)
+cg=[2*x(1),0,0;2*x(1),2*x(2),0;0,0,2*x(3)];
+ceqg=[3*x(1)^2,0,0;0,2*x(2),2*x(3)];
+endfunction
+//Options
+options=list("MaxIter",[1500],"CpuTime",[500],"GradObj",fGrad,"Hessian",lHess,"GradCon",cGrad);
+//Calling Ipopt
+[x,fval,exitflag,output,lambda,grad,hessian]=fmincon(f,x0,A,b,Aeq,beq,lb,ub,nlc,options)
The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x.
+
x0 :
+
a vector of double, contains initial guess of variables.
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
a vector of double, contains lower bounds of the variables.
+
ub :
+
a vector of double, contains upper bounds of the variables.
+
nonlinfun:
+
function that computes the nonlinear inequality constraints c⋅x ≤ 0 and nonlinear equality constraints c⋅x = 0.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
maxfval:
+
a 1x1 matrix of doubles, the maximum value in vector fval
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
fminimax minimizes the worst-case (largest) value of a set of multivariable functions, starting at an initial estimate. This is generally referred to as the minimax problem.
+
+
Currently, fminimax calls fmincon which uses the ip-opt algorithm.
+
max-min problems can also be solved with fminimax, using the identity
+
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
+
CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
+
GradObj : a function, representing the gradient function of the Objective in Vector Form.
+
GradCon : a function, representing the gradient of the Non-Linear Constraints (both Equality and Inequality) of the problem. It is declared in such a way that gradient of non-linear inequality constraints are defined first as a separate Matrix (cg of size m2 X n or as an empty), followed by gradient of non-linear equality constraints as a separate Matrix (ceqg of size m2 X n or as an empty) where m2 & m3 are number of non-linear inequality and equality constraints respectively.
+where x is a n x 1 matrix of doubles and F is a m x 1 matrix of doubles where m is the total number of objective functions inside F.
+On input, the variable x contains the current point and, on output, the variable F must contain the objective function values.
+
By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of minmaxObjfun. In case the GradObj option is off and GradConstr option is on, fminimax approximates minmaxObjfun gradient using numderivative toolbox.
+
If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.
+
Furthermore, we must enable the "GradObj" option with the statement :
+
+This will let fminimax know that the exact gradient of the objective function is known, so that it can change the calling sequence to the objective function. Note that, fGrad should be mentioned in the form of N x n where n is the number of variables, N is the number of functions in objective function.
+
The constraint function must have header :
+
[c,ceq]=confun(x)
+where x is a n x 1 matrix of dominmaxUbles, c is a 1 x nni matrix of doubles and ceq is a 1 x nne matrix of doubles (nni : number of nonlinear inequality constraints, nne : number of nonlinear equality constraints).
+On input, the variable x contains the current point and, on output, the variable c must contain the nonlinear inequality constraints and ceq must contain the nonlinear equality constraints.
+
By default, the gradient options for fminimax are turned off and and fmincon does the gradient opproximation of confun. In case the GradObj option is on and GradCons option is off, fminimax approximates confun gradient using numderivative toolbox.
+
If we can provide exact gradients, we should do so since it improves the convergence speed of the optimization algorithm.
+
Furthermore, we must enable the "GradCon" option with the statement :
+
+This will let fminimax know that the exact gradient of the objective function is known, so that it can change the calling sequence to the objective function.
+
The constraint derivative function must have header :
+
[dc,dceq]=confungrad(x)
+where dc is a nni x n matrix of doubles and dceq is a nne x n matrix of doubles.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum amount of CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.Iterations: The number of iterations performed during the search
+
output.Cpu_Time: The total cpu-time spend during the search
+
output.Objective_Evaluation: The number of Objective Evaluations performed during the search
+
output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
lambda.eqnonlin: The Lagrange multipliers for the non-linear equality constraints.
+
lambda.ineqnonlin: The Lagrange multipliers for the non-linear inequality constraints.
+
+
+
Examples
+
// A basic case :
+// we provide only the objective function and the nonlinear constraint
+// function
+functionf=myfun(x)
+f(1)=2*x(1)^2+x(2)^2-48*x(1)-40*x(2)+304;//Objectives
+f(2)=-x(1)^2-3*x(2)^2;
+f(3)=x(1)+3*x(2)-18;
+f(4)=-x(1)-x(2);
+f(5)=x(1)+x(2)-8;
+endfunction
+// The initial guess
+x0=[0.1,0.1];
+// The expected solution : only 4 digits are guaranteed
+xopt=[44]
+fopt=[0-64-2-80]
+maxfopt=0
+// Run fminimax
+[x,fval,maxfval,exitflag,output,lambda]=fminimax(myfun,x0)
+// Press ENTER to continue
+
+
Examples
+
// A case where we provide the gradient of the objective
+// functions and the Jacobian matrix of the constraints.
+// The objective function and its gradient
+functionf=myfun(x)
+f(1)=2*x(1)^2+x(2)^2-48*x(1)-40*x(2)+304;
+f(2)=-x(1)^2-3*x(2)^2;
+f(3)=x(1)+3*x(2)-18;
+f(4)=-x(1)-x(2);
+f(5)=x(1)+x(2)-8;
+endfunction
+// Defining gradient of myfun
+functionG=myfungrad(x)
+G=[4*x(1)-48,-2*x(1),1,-1,1;
+2*x(2)-40,-6*x(2),3,-1,1;]'
+endfunction
+// The nonlinear constraints and the Jacobian
+// matrix of the constraints
+function[c, ceq]=confun(x)
+// Inequality constraints
+c=[1.5+x(1)*x(2)-x(1)-x(2),-x(1)*x(2)-10]
+// No nonlinear equality constraints
+ceq=[]
+endfunction
+// Defining gradient of confungrad
+function[DC, DCeq]=cgrad(x)
+// DC(:,i) = gradient of the i-th constraint
+// DC = [
+// Dc1/Dx1 Dc1/Dx2
+// Dc2/Dx1 Dc2/Dx2
+// ]
+DC=[
+x(2)-1,-x(2)
+x(1)-1,-x(1)
+]'
+DCeq=[]'
+endfunction
+// Test with both gradient of objective and gradient of constraints
+minimaxOptions=list("GradObj",myfungrad,"GradCon",cgrad);
+// The initial guess
+x0=[0,10];
+// The expected solution : only 4 digits are guaranteed
+xopt=[0.927917.93551]
+fopt=[6.73443-189.7786.73443-8.863420.86342]
+maxfopt=6.73443
+// Run fminimax
+[x,fval,maxfval,exitflag,output]=fminimax(myfun,x0,[],[],[],[],[],[],confun,minimaxOptions)
a function, representing the objective function of the problem
+
x0 :
+
a vector of doubles, containing the starting of variables.
+
options:
+
a list, containing the option for user to specify. See below for details.
+
xopt :
+
a vector of doubles, the computed solution of the optimization problem.
+
fopt :
+
a scalar of double, the function value at x.
+
exitflag :
+
a scalar of integer, containing the flag which denotes the reason for termination of algorithm. See below for details.
+
output :
+
a structure, containing the information about the optimization. See below for details.
+
gradient :
+
a vector of doubles, containing the the gradient of the solution.
+
hessian :
+
a matrix of doubles, containing the the hessian of the solution.
+
+
Description
+
Search the minimum of an unconstrained optimization problem specified by :
+Find the minimum of f(x) such that
+
+
The routine calls Ipopt for solving the Un-constrained Optimization problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.Iterations: The number of iterations performed during the search
+
output.Cpu_Time: The total cpu-time spend during the search
+
output.Objective_Evaluation: The number of Objective Evaluations performed during the search
+
output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+
+
+
Examples
+
//Find x in R^2 such that it minimizes the Rosenbrock function
+//f = 100*(x2 - x1^2)^2 + (1-x1)^2
+//Objective function to be minimised
+functiony=f(x)
+y=100*(x(2)-x(1)^2)^2+(1-x(1))^2;
+endfunction
+//Starting point
+x0=[-1,2];
+//Gradient of objective function
+functiony=fGrad(x)
+y=[-400*x(1)*x(2)+400*x(1)^3+2*x(1)-2,200*(x(2)-x(1)^2)];
+endfunction
+//Hessian of Objective Function
+functiony=fHess(x)
+y=[1200*x(1)^2-400*x(2)+2,-400*x(1);-400*x(1),200];
+endfunction
+//Options
+options=list("MaxIter",[1500],"CpuTime",[500],"Gradient",fGrad,"Hessian",fHess);
+//Calling Ipopt
+[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options)
+// Press ENTER to continue
+
+
Examples
+
//Find x in R^2 such that the below function is minimum
+//f = x1^2 + x2^2
+//Objective function to be minimised
+functiony=f(x)
+y=x(1)^2+x(2)^2;
+endfunction
+//Starting point
+x0=[2,1];
+//Calling Ipopt
+[xopt,fopt]=fminunc(f,x0)
+// Press ENTER to continue
+
+
Examples
+
//The below problem is an unbounded problem:
+//Find x in R^2 such that the below function is minimum
+//f = - x1^2 - x2^2
+//Objective function to be minimised
+functiony=f(x)
+y=-x(1)^2-x(2)^2;
+endfunction
+//Starting point
+x0=[2,1];
+//Gradient of objective function
+functiony=fGrad(x)
+y=[-2*x(1),-2*x(2)];
+endfunction
+//Hessian of Objective Function
+functiony=fHess(x)
+y=[-2,0;0,-2];
+endfunction
+//Options
+options=list("MaxIter",[1500],"CpuTime",[500],"Gradient",fGrad,"Hessian",fHess);
+//Calling Ipopt
+[xopt,fopt,exitflag,output,gradient,hessian]=fminunc(f,x0,options)
a vector of double, contains coefficients of the variables in the objective
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub.
+
ub :
+
Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub.
+
options :
+
a list containing the parameters to be set.
+
file :
+
a string describing the path to the mps file.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
status :
+
status flag returned from symphony. See below for details.
+
output :
+
The output data structure contains detailed information about the optimization process. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
OSI-CLP is used for solving the linear programming problems, OSI-CLP is a library written in C++.
+Search the minimum of a constrained linear programming problem specified by :
+
+
The routine calls Clp for solving the linear programming problem, Clp is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields. In the current version it only contains maxiter.
+
Syntax : options= list("MaxIter", [---]);
+
MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
The exitflag allows to know the status of the optimization which is given back by CLP.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Primal Infeasible
+
exitflag=2 : Dual Infeasible
+
exitflag=3 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=4 : Solution Abandoned
+
exitflag=5 : Primal objective limit reached.
+
exitflag=6 : Dual objective limit reached.
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
output.constrviolation: The max-norm of the constraint violation.
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for variable lower bounds.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
+
+
Examples
+
//Optimal problems
+//Linear program, linear inequality constraints
+c=[-1,-1/3]'
+A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
+b=[2,1,2,1,-1,2]
+[xopt,fopt,exitflag,output,lambda]=linprog(c,A,b)
+// Press ENTER to continue
+
+
Examples
+
//Linear program with Linear Inequalities and Equalities`
+c=[-1,-1/3]'
+A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
+b=[2,1,2,1,-1,2]
+Aeq=[1,1/4]
+beq=[1/2]
+[xopt,fopt,exitflag,output,lambda]=linprog(c,A,b,Aeq,beq)
+// Press ENTER to continue
+
+
Examples
+
//Linear program with all constraint types
+c=[-1,-1/3]'
+A=[1,1;1,1/4;1,-1;-1/4,-1;-1,-1;-1,1]
+b=[2,1,2,1,-1,2]
+Aeq=[1,1/4]
+beq=[1/2]
+lb=[-1,-0.5]
+ub=[1.5,1.25]
+[xopt,fopt,exitflag,output,lambda]=linprog(c,A,b,Aeq,beq,lb,ub)
+// Press ENTER to continue
+
+
Examples
+
//Primal Infeasible Problem
+c=[-1,-1,-1]'
+A=[1,2,-1]
+b=[-4]
+Aeq=[1,5,3;1,1,0]
+beq=[10,100]
+lb=[0,0,0]
+ub=[%inf,%inf,%inf]
+[xopt,fopt,exitflag,output,lambda]=linprog(c,A,b,Aeq,beq,lb,ub)
+// Press ENTER to continue
+
+
Examples
+
//Dual Infeasible Problem
+c=[3,5,-7]'
+A=[-1,-1,4;1,1,4]
+b=[-8,5]
+Aeq=[]
+beq=[]
+lb=[-%inf,-%inf,-%inf]
+ub=[%inf,%inf,%inf]
+[xopt,fopt,exitflag,output,lambda]=linprog(c,A,b,Aeq,beq,lb,ub)
+// Press ENTER to continue
a matrix of double, represents the multiplier of the solution x in the expression C⋅x - d. Number of columns in C is equal to the number of elements in x.
+
d :
+
a vector of double, represents the additive constant term in the expression C⋅x - d. Number of elements in d is equal to the number of rows in C matrix.
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
a vector of double, contains lower bounds of the variables.
+
ub :
+
a vector of double, contains upper bounds of the variables.
+
x0 :
+
a vector of double, contains initial guess of variables.
+
param :
+
a list containing the parameters to be set.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
resnorm :
+
a double, objective value returned as the scalar value norm(C⋅x-d)^2.
+
residual :
+
a vector of double, solution residuals returned as the vector d-C⋅x.
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
Search the minimum of a constrained linear least square problem specified by :
+
+
The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
output.constrviolation: The max-norm of the constraint violation.
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
+
+
Examples
+
//A simple linear least square example
+C=[20;
+-11;
+02]
+d=[1
+0
+-1];
+A=[10-2;
+-210];
+b=[4
+-4];
+[xopt,resnorm,residual,exitflag,output,lambda]=lsqlin(C,d,A,b)
+// Press ENTER to continue
a matrix of double, represents the multiplier of the solution x in the expression C⋅x - d. Number of columns in C is equal to the number of elements in x.
+
d :
+
a vector of double, represents the additive constant term in the expression C⋅x - d. Number of elements in d is equal to the number of rows in C matrix.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
resnorm :
+
a double, objective value returned as the scalar value norm(C⋅x-d)^2.
+
residual :
+
a vector of double, solution residuals returned as the vector d-C⋅x.
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
Solves nonnegative least-squares curve fitting problems specified by :
+
+
The routine calls Ipopt for solving the nonnegative least-squares curve fitting problems, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
output.constrviolation: The max-norm of the constraint violation.
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
+
+
Examples
+
// A basic lsqnonneg problem
+C=[111;
+110;
+011;
+100;
+001]
+d=[89;
+67;
+53;
+35;
+20;]
+[xopt,resnorm,residual,exitflag,output,lambda]=lsqnonneg(C,d)
a symmetric matrix of double, represents coefficients of quadratic in the quadratic problem.
+
f :
+
a vector of double, represents coefficients of linear in the quadratic problem
+
lb :
+
a vector of double, contains lower bounds of the variables.
+
ub :
+
a vector of double, contains upper bounds of the variables.
+
A :
+
a matrix of double, contains the constraint matrix conLB ≤ A⋅x ≤ conUB.
+
conLB :
+
a vector of double, contains lower bounds of the constraints conLB ≤ A⋅x ≤ conUB.
+
conUB :
+
a vector of double, contains upper bounds of the constraints conLB ≤ A⋅x ≤ conUB.
+
x0 :
+
a vector of double, contains initial guess of variables.
+
param :
+
a list containing the parameters to be set.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
Search the minimum of a constrained linear quadratic optimization problem specified by :
+
+
The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
output.constrviolation: The max-norm of the constraint violation.
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
+
+
Examples
+
//Ref : example 14 :
+//https://www.me.utexas.edu/~jensen/ORMM/supplements/methods/nlpmethod/S2_quadratic.pdf
+// min. -8*x1*x1 -16*x2*x2 + x1 + 4*x2
+// such that
+// x1 + x2 <= 5,
+// x1 <= 3,
+// x1 >= 0,
+// x2 >= 0
+H=[20
+08];
+f=[-8;-16];
+A=[11;10];
+conUB=[5;3];
+conLB=[-%inf;-%inf];
+lb=[0;0];
+ub=[%inf;%inf];
+nbVar=2;
+nbCon=2;
+[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB)
+//Press ENTER to continue
+
+
Examples
+
//Find x in R^6 such that:
+A=[1,-1,1,0,3,1;
+-1,0,-3,-4,5,6;
+2,5,3,0,1,0
+0,1,0,1,2,-1;
+-1,0,2,1,1,0];
+conLB=[1;2;3;-%inf;-%inf];
+conUB=[1;2;3;-1;2.5];
+lb=[-1000;-10000;0;-1000;-1000;-1000];
+ub=[10000;100;1.5;100;100;1000];
+//and minimize 0.5*x'⋅H⋅x + f'⋅x with
+f=[1;2;3;4;5;6];H=eye(6,6);
+nbVar=6;
+nbCon=5;
+x0=repmat(0,nbVar,1);
+param=list("MaxIter",300,"CpuTime",100);
+[xopt,fopt,exitflag,output,lambda]=qpipopt(nbVar,nbCon,H,f,lb,ub,A,conLB,conUB,x0,param)
a symmetric matrix of double, represents coefficients of quadratic in the quadratic problem.
+
f :
+
a vector of double, represents coefficients of linear in the quadratic problem
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
a vector of double, contains lower bounds of the variables.
+
ub :
+
a vector of double, contains upper bounds of the variables.
+
x0 :
+
a vector of double, contains initial guess of variables.
+
param :
+
a list containing the parameters to be set.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
exitflag :
+
The exit status. See below for details.
+
output :
+
The structure consist of statistics about the optimization. See below for details.
+
lambda :
+
The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+
+
Description
+
Search the minimum of a constrained linear quadratic optimization problem specified by :
+
+
The routine calls Ipopt for solving the quadratic problem, Ipopt is a library written in C++.
+
The options allows the user to set various parameters of the Optimization problem.
+It should be defined as type "list" and contains the following fields.
+
The exitflag allows to know the status of the optimization which is given back by Ipopt.
+
exitflag=0 : Optimal Solution Found
+
exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+
exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+
exitflag=3 : Stop at Tiny Step.
+
exitflag=4 : Solved To Acceptable Level.
+
exitflag=5 : Converged to a point of local infeasibility.
+
For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
output.constrviolation: The max-norm of the constraint violation.
+
The lambda data structure contains the Lagrange multipliers at the end
+of optimization. In the current version the values are returned only when the the solution is optimal.
+It has type "struct" and contains the following fields.
+
lambda.lower: The Lagrange multipliers for the lower bound constraints.
+
lambda.upper: The Lagrange multipliers for the upper bound constraints.
+
lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+
lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+
+
+
Examples
+
//Ref : example 14 :
+//https://www.me.utexas.edu/~jensen/ORMM/supplements/methods/nlpmethod/S2_quadratic.pdf
+// min. -8*x1*x1 -16*x2*x2 + x1 + 4*x2
+// such that
+// x1 + x2 <= 5,
+// x1 <= 3,
+// x1 >= 0,
+// x2 >= 0
+H=[20
+08];
+f=[-8;-16];
+A=[11;10];
+b=[5;3];
+lb=[0;0];
+ub=[%inf;%inf];
+[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,[],[],lb,ub)
+// Press ENTER to continue
+
+
Examples
+
//Find x in R^6 such that:
+Aeq=[1,-1,1,0,3,1;
+-1,0,-3,-4,5,6;
+2,5,3,0,1,0];
+beq=[1;2;3];
+A=[0,1,0,1,2,-1;
+-1,0,2,1,1,0];
+b=[-1;2.5];
+lb=[-1000;-10000;0;-1000;-1000;-1000];
+ub=[10000;100;1.5;100;100;1000];
+x0=repmat(0,6,1);
+param=list("MaxIter",300,"CpuTime",100);
+//and minimize 0.5*x'*H*x + f'*x with
+f=[1;2;3;4;5;6];H=eye(6,6);
+[xopt,fopt,exitflag,output,lambda]=qpipoptmat(H,f,A,b,Aeq,beq,lb,ub,x0,param)
This function adds a new constraint from scratch. Supported types of constraints are less than or equal to, more than or equal to, equal to, or ranged.
+
The last argument is only required for ranged constraints. For the other types of constraints, only the third argument is required.
+
+
Arguments
+
+
coeff
+
Sparse matrix representing coefficients of the variables in the new constraint (must have 1 row and number of columns equal to number of variables)
+
type
+
Type of the new constraint. Supported types: less than or equal to ("L"), greater than or equal to ("G"), equal to ("E"), or ranged ("R")
+
bound1
+
The first (or only) bound for the constraint
+
bound2
+
The second bound for ranged constraints. The two bounds for ranged constraints can be in any order.
Sparse matrix representing coefficients of the new variable in the existing constraints (must have 1 column and number of rows equal to number of constraints)
+
lower
+
Lower bound of the new variable
+
upper
+
Upper bound of the new variable
+
obj
+
Coefficient of the variable in the objective function
+
isInt
+
Wether the variable is constrainted to be an integer (boolean %t or %f)
This routine is used to delete columns from the original problem description.
+
+
Calling Sequence
+
sym_deleteVars(indices)
+
+
Description
+
+
Arguments
+
+
indices
+
Pointer to an integer type array indicating the indices of the column numbers(variables) to be deleted.
+
+
Return value
+
+
Returns 0 if the column numbers specified are deleted successfully and 0 if the deletion of column indices did not execute successfully and it returns with an error return value
This routine is used to get the value of a double type parameter.
+
+
Calling Sequence
+
sym_getDblParam(key)
+
+
Description
+
+
Arguments
+
+
key
+
The name of the double parameter whose value has to be retrieved. Note: should be given within " "
+
+
Return value
+
+
Returns 0 if the parameter's value has been successfully retrieved and displayed on the console ,else 1 is returned corressponding to an error value for the unsuccessful execution of the function
This routine is used to get the value of an integer type parameter.
+
+
Calling Sequence
+
sym_getIntParam(key)
+
+
Description
+
+
Arguments
+
+
key
+
The name of the integer parameter whose value has to be retrieved. Note: should be given within " "
+
+
Return value
+
+
Returns 0 if the parameter's value has been successfully retrieved and displayed on the console ,else 1 is returned corressponding to an error value for the unsuccessful execution of the function
This routine is used to get the value of a string type parameter.
+
+
Calling Sequence
+
sym_getStrParam(key)
+
+
Description
+
+
Arguments
+
+
key
+
The name of the strung parameter whose value has to be retrieved. Note: should be given within " "
+
+
Return value
+
+
Returns 0 if the parameter's value has been successfully retrieved and displayed on the console ,else 1 is returned corressponding to an error value for the unsuccessful execution of the function
This routine is used to load an instance from an MPS file.
+
+
Calling Sequence
+
sym_loadMPS(filename)
+
+
Description
+
+
Arguments
+
+
filename
+
It is a string that has the path of the .mps file to loaded.It has to be given within double quotes ("")
+
+
Return value
+
+
Returns 0 if the .mps file is loaded properly to symphony and 0 if there is an error reading the mps file or the function returns with an error return value
This function completely modifies the type of a constraint. Supported types of constraints are less than or equal to, more than or equal to, equal to, or ranged.
+
The last argument is only required for ranged constraints. For the other types of constraints, only the third argument is required.
+
+
Arguments
+
+
index
+
Index of the constraint to modify. Must be in {0,1,2,...n-1} where n is the number of constraints in the problem
+
type
+
New type of the constraint. Supported types: less than or equal to ("L"), greater than or equal to ("G"), equal to ("E"), or ranged ("R")
+
bound1
+
The first (or only) bound for the constraint
+
bound2
+
The second bound for ranged constraints. The two bounds for ranged constraints can be in any order.
a vector of double, represents coefficients of the variables in the objective.
+
isInt :
+
a vector of boolean, represents wether a variable is constrained to be an integer.
+
lb :
+
a vector of double, represents lower bounds of the variables.
+
ub :
+
a vector of double, represents upper bounds of the variables.
+
A :
+
a matrix of double, represents matrix representing the constraint matrix conLB ≤ A⋅x ≤ conUB.
+
conLB :
+
a vector of double, represents lower bounds of the constraints conLB ≤ A⋅x ≤ conUB.
+
conUB :
+
a vector of double, represents upper bounds of the constraints conLB ≤ A⋅x ≤ conUB.
+
objSense :
+
The sense (maximization/minimization) of the objective. Use 1(sym_minimize ) or -1 (sym_maximize) here.
+
options :
+
a list containing the parameters to be set.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
status :
+
status flag returned from symphony.See below for details.
+
output :
+
The output data structure contains detailed information about the optimization process. See below for details.
+
+
Description
+
Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by :
+
+
The routine calls SYMPHONY written in C by gateway files for the actual computation.
+
The status allows to know the status of the optimization which is given back by Ipopt.
+
status=227 : Optimal Solution Found
+
status=228 : Maximum CPU Time exceeded.
+
status=229 : Maximum Number of Node Limit Exceeded.
+
status=230 : Maximum Number of Iterations Limit Exceeded.
+
For more details on status see the symphony documentation, go to http://www.coin-or.org/SYMPHONY/man-5.6/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
+
+
Examples
+
//Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. "An application of mixed integer programming in a Swedish steel mill." Interfaces 7, no. 2 (1977): 39-43.
+// Objective function
+c=[350*5,330*3,310*4,280*6,500,450,400,100]';
+// Lower Bound of variable
+lb=repmat(0,8,1);
+// Upper Bound of variables
+ub=[repmat(1,4,1);repmat(%inf,4,1)];
+// Constraint Matrix
+A=[5,3,4,6,1,1,1,1;
+5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03;
+5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;]
+// Lower Bound of constraints
+conlb=[25;1.25;1.25]
+// Upper Bound of constraints
+conub=[25;1.25;1.25]
+// Row Matrix for telling symphony that the is integer or not
+isInt=[repmat(%t,1,4)repmat(%f,1,4)];
+xopt=[11017.2500.253.5]
+fopt=[8495]
+// Calling Symphony
+[x,f,status,output]=symphony(8,3,c,isInt,lb,ub,A,conlb,conub,1)
+// Press ENTER to continue
+
+
Examples
+
// An advanced case where we set some options in symphony
+// This problem is taken from
+// P.C.Chu and J.E.Beasley
+// "A genetic algorithm for the multidimensional knapsack problem",
+// Journal of Heuristics, vol. 4, 1998, pp63-86.
+// The problem to be solved is:
+// Max sum{j=1,...,n} p(j)x(j)
+// st sum{j=1,...,n} r(i,j)x(j) <= b(i) i=1,...,m
+// x(j)=0 or 1
+// The function to be maximize i.e. P(j)
+c=[5048036671103834585811856690832846813868793..
+82510028606155407976166607078666477461006608..
+87790057378848485394263059163064011699321034..
+95779866962546710515527176543885595551104783..
+959668507855986831821825868852832828799686..
+51067157574051067599663682610221140654909799..
+11626538146255994767679549069046498735658531008632]';
+//Constraint Matrix
+A=[
+//Constraint 1
+424152321581955169193582375367478162898..
+550553298577493183260224852394958282402604..
+16430821861273772191117276877415873902465..
+32087024478186622665155680101665227597354..
+5977916299884913611275173588471449266420..
+797945746464454588272383714987183731301..
+71891109567708507983808766615554282995946651298;
+//Constraint 2
+509883229569706639114727491481681948687941..
+35025357340124384660951739329146593658816..
+638717779289430851937289159260930248656833..
+8926027874129796786249354614836290893857..
+15886920650479975843158078078858364132653..
+252709129368440314287854460594512239719751..
+708670269832137356960651398893407477552805881850;
+//Constraint 3
+806361199781596669957358259888319751275177..
+88374922926528269481977190551140442867283..
+137359445584401924857448449695083357877..
+482732968113486710439747174260877474841422..
+280684330910791322404403519148948414894147..
+732979765138067582973143732624518847113..
+38297905398859414211011213398173106331254447;
+//Constraint 4
+4041978171000443073965946334448599931776..
+263980807378278841700210542636388129203110..
+817502657804662989585645113436610948919115..
+96713445449740592327167368335179909825614..
+98735017941582152577428342727565939273896..
+6898269742124667264973119151498388695846..
+68920641714735267822977302687118990323993525322;
+//Constrain 5
+4753628757745700803654196844657387518143..
+515335942701332803265922908139995845487100..
+44765364973842447542592679547136801904740..
+768460766605009158972571655772696653933..
+4205828108617586472376312719175756409440..
+4833367656379819802023559468960276767693..
+893160785311417748375362617553474915457261350635;
+];
+nbCon=size(A,1)
+nbVar=size(A,2)
+// Lower Bound of variables
+lb=repmat(0,nbVar,1)
+// Upper Bound of variables
+ub=repmat(1,nbVar,1)
+// Row Matrix for telling symphony that the is integer or not
+isInt=repmat(%t,1,nbVar)
+// Lower Bound of constraints
+conLB=repmat(0,nbCon,1);
+// Upper Bound of constraints
+conUB=[1192713727115511305613460]';
+options=list("time_limit",25);
+// The expected solution :
+// Output variables
+xopt=[0110010101000000010000101101101..
+00000000000100000100000010000110010..
+010100100101000001100000110010010]
+// Optimal value
+fopt=[24381]
+// Calling Symphony
+[x,f,status,output]=symphony(nbVar,nbCon,c,isInt,lb,ub,A,conLB,conUB,-1,options);
a vector of double, contains coefficients of the variables in the objective
+
intcon :
+
Vector of integer constraints, specified as a vector of positive integers. The values in intcon indicate the components of the decision variable x that are integer-valued. intcon has values from 1 through number of variable.
+
A :
+
a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
b :
+
a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+
Aeq :
+
a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
beq :
+
a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+
lb :
+
Lower bounds, specified as a vector or array of double. lb represents the lower bounds elementwise in lb ≤ x ≤ ub.
+
ub :
+
Upper bounds, specified as a vector or array of double. ub represents the upper bounds elementwise in lb ≤ x ≤ ub.
+
options :
+
a list containing the parameters to be set.
+
xopt :
+
a vector of double, the computed solution of the optimization problem.
+
fopt :
+
a double, the value of the function at x.
+
status :
+
status flag returned from symphony. See below for details.
+
output :
+
The output data structure contains detailed information about the optimization process. See below for details.
+
+
Description
+
Search the minimum or maximum of a constrained mixed integer linear programming optimization problem specified by :
+
+
The routine calls SYMPHONY written in C by gateway files for the actual computation.
+
The status allows to know the status of the optimization which is given back by Ipopt.
+
status=227 : Optimal Solution Found
+
status=228 : Maximum CPU Time exceeded.
+
status=229 : Maximum Number of Node Limit Exceeded.
+
status=230 : Maximum Number of Iterations Limit Exceeded.
+
For more details on status see the symphony documentation, go to http://www.coin-or.org/SYMPHONY/man-5.6/
+
The output data structure contains detailed informations about the optimization process.
+It has type "struct" and contains the following fields.
+
output.iterations: The number of iterations performed during the search
+
+
+
Examples
+
// Objective function
+// Reference: Westerberg, Carl-Henrik, Bengt Bjorklund, and Eskil Hultman. "An application of mixed integer programming in a Swedish steel mill." Interfaces 7, no. 2 (1977): 39-43.
+c=[350*5,330*3,310*4,280*6,500,450,400,100]';
+// Lower Bound of variable
+lb=repmat(0,1,8);
+// Upper Bound of variables
+ub=[repmat(1,1,4)repmat(%inf,1,4)];
+// Constraint Matrix
+Aeq=[5,3,4,6,1,1,1,1;
+5*0.05,3*0.04,4*0.05,6*0.03,0.08,0.07,0.06,0.03;
+5*0.03,3*0.03,4*0.04,6*0.04,0.06,0.07,0.08,0.09;]
+beq=[25,1.25,1.25]
+intcon=[1234];
+// Calling Symphony
+[x,f,status,output]=symphonymat(c,intcon,[],[],Aeq,beq,lb,ub)
+// Press ENTER to continue
+
+
Examples
+
// An advanced case where we set some options in symphony
+// This problem is taken from
+// P.C.Chu and J.E.Beasley
+// "A genetic algorithm for the multidimensional knapsack problem",
+// Journal of Heuristics, vol. 4, 1998, pp63-86.
+// The problem to be solved is:
+// Max sum{j=1,...,n} p(j)x(j)
+// st sum{j=1,...,n} r(i,j)x(j) <= b(i) i=1,...,m
+// x(j)=0 or 1
+// The function to be maximize i.e. P(j)
+c=-1*[5048036671103834585811856690832846813868793..
+82510028606155407976166607078666477461006608..
+87790057378848485394263059163064011699321034..
+95779866962546710515527176543885595551104783..
+959668507855986831821825868852832828799686..
+51067157574051067599663682610221140654909799..
+11626538146255994767679549069046498735658531008632]';
+//Constraint Matrix
+A=[//Constraint 1
+424152321581955169193582375367478162898..
+550553298577493183260224852394958282402604..
+16430821861273772191117276877415873902465..
+32087024478186622665155680101665227597354..
+5977916299884913611275173588471449266420..
+797945746464454588272383714987183731301..
+71891109567708507983808766615554282995946651298;
+//Constraint 2
+509883229569706639114727491481681948687941..
+35025357340124384660951739329146593658816..
+638717779289430851937289159260930248656833..
+8926027874129796786249354614836290893857..
+15886920650479975843158078078858364132653..
+252709129368440314287854460594512239719751..
+708670269832137356960651398893407477552805881850;
+//Constraint 3
+806361199781596669957358259888319751275177..
+88374922926528269481977190551140442867283..
+137359445584401924857448449695083357877..
+482732968113486710439747174260877474841422..
+280684330910791322404403519148948414894147..
+732979765138067582973143732624518847113..
+38297905398859414211011213398173106331254447;
+//Constraint 4
+4041978171000443073965946334448599931776..
+263980807378278841700210542636388129203110..
+817502657804662989585645113436610948919115..
+96713445449740592327167368335179909825614..
+98735017941582152577428342727565939273896..
+6898269742124667264973119151498388695846..
+68920641714735267822977302687118990323993525322;
+//Constrain 5
+4753628757745700803654196844657387518143..
+515335942701332803265922908139995845487100..
+44765364973842447542592679547136801904740..
+768460766605009158972571655772696653933..
+4205828108617586472376312719175756409440..
+4833367656379819802023559468960276767693..
+893160785311417748375362617553474915457261350635;
+];
+nbVar=size(c,1)
+b=[1192713727115511305613460];
+// Lower Bound of variables
+lb=repmat(0,1,nbVar)
+// Upper Bound of variables
+ub=repmat(1,1,nbVar)
+// Lower Bound of constrains
+intcon=[];
+fori=1:nbVar
+intcon=[intconi];
+end
+options=list("time_limit",25);
+// The expected solution :
+// Output variables
+xopt=[0110010101000000010000101101101..
+0000000000010000010000001000011..
+0010010100100101000001100000110010010]
+// Optimal value
+fopt=[24381]
+// Calling Symphony
+[x,f,status,output]=symphonymat(c,intcon,A,b,[],[],lb,ub,options);
+
+
diff --git a/help/en_US/scilab_en_US_help/xml_code.css b/help/en_US/scilab_en_US_help/xml_code.css
new file mode 100644
index 0000000..9e4c27f
--- /dev/null
+++ b/help/en_US/scilab_en_US_help/xml_code.css
@@ -0,0 +1,94 @@
+.xmlcomment {
+ font-style: italic;
+ color: #01a801
+}
+
+.xmldefault {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlentity {
+ font-style: normal;
+ color: #ffaa00
+}
+
+.xmlopeninstr {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlcloseinstr {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlinstrname {
+ font-style: normal;
+ color: #9965a6
+}
+
+.xmllowtag {
+ font-style: normal;
+ color: #000000
+}
+
+.xmltagname {
+ font-style: normal;
+ color: #0303ff
+}
+
+.xmllowclose {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlopencomment {
+ font-style: italic;
+ color: #01a801
+}
+
+.xmlcommentend {
+ font-style: italic;
+ color: #01a801
+}
+
+.xmlcomment {
+ font-style: italic;
+ color: #01a801
+}
+
+.xmlopencdata {
+ font-style: normal;
+ color: #c45555
+}
+
+.xmlcdataend {
+ font-style: normal;
+ color: #c45555
+}
+
+.xmlcdata {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlattributename {
+ font-style: normal;
+ color: #9965a6
+}
+
+.xmlequal {
+ font-style: normal;
+ color: #000000
+}
+
+.xmlattributevalue {
+ font-style: normal;
+ color: #973964
+}
+
+.xmlautoclose {
+ font-style: normal;
+ color: #000000
+}
diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar
new file mode 100644
index 0000000..04f7231
Binary files /dev/null and b/jar/scilab_en_US_help.jar differ
diff --git a/loader.sce b/loader.sce
new file mode 100644
index 0000000..573167b
--- /dev/null
+++ b/loader.sce
@@ -0,0 +1,10 @@
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// Generated by builder.sce: Please, do not edit this file
+
+try
+ getversion("scilab");
+catch
+ error("Scilab 5.0 or more is required.");
+end;
+
+exec(get_absolute_file_path("loader.sce")+"etc/"+"FOSSEE_Optimization_Toolbox.start");
diff --git a/macros/Checkdims.bin b/macros/Checkdims.bin
new file mode 100644
index 0000000..40e385a
Binary files /dev/null and b/macros/Checkdims.bin differ
diff --git a/macros/Checklhs.bin b/macros/Checklhs.bin
new file mode 100644
index 0000000..7156107
Binary files /dev/null and b/macros/Checklhs.bin differ
diff --git a/macros/Checkrhs.bin b/macros/Checkrhs.bin
new file mode 100644
index 0000000..2c45876
Binary files /dev/null and b/macros/Checkrhs.bin differ
diff --git a/macros/Checktype.bin b/macros/Checktype.bin
new file mode 100644
index 0000000..bbe1585
Binary files /dev/null and b/macros/Checktype.bin differ
diff --git a/macros/Checkvector.bin b/macros/Checkvector.bin
new file mode 100644
index 0000000..dfe03ab
Binary files /dev/null and b/macros/Checkvector.bin differ
diff --git a/macros/fgoalattain.bin b/macros/fgoalattain.bin
new file mode 100644
index 0000000..faa0821
Binary files /dev/null and b/macros/fgoalattain.bin differ
diff --git a/macros/fminbnd.bin b/macros/fminbnd.bin
new file mode 100644
index 0000000..97b00fc
Binary files /dev/null and b/macros/fminbnd.bin differ
diff --git a/macros/fminbnd.sci b/macros/fminbnd.sci
index 2c29b03..b8772ae 100644
--- a/macros/fminbnd.sci
+++ b/macros/fminbnd.sci
@@ -75,6 +75,7 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
// output.Cpu_Time: The total cpu-time spend during the search
// output.Objective_Evaluation: The number of Objective Evaluations performed during the search
// output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+ // output.Message: The output message for the problem
//
//
// The lambda data structure contains the Lagrange multipliers at the end
@@ -157,7 +158,7 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
//To check whether the 1st Input argument (fun) is a function or not
if (type(fun) ~= 13 & type(fun) ~= 11) then
- errmsg = msprintf(gettext("%s: Expected function for Objective (1st Parameter)"), "fmincon");
+ errmsg = msprintf(gettext("%s: Expected function for Objective (1st Parameter)"), "fminbnd");
error(errmsg);
end
@@ -198,6 +199,12 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
end
s=size(x1);
+ //To check the match between f (1st Parameter) and x1 (2nd Parameter)
+ if(execstr('init=fun(x1)','errcatch')==21) then
+ errmsg = msprintf(gettext("%s: Objective function and x1 did not match"), "fminbnd");
+ error(errmsg);
+ end
+
//To check whether the 3rd Input argument (x2) is a vector/scalar
if (type(x2) ~= 1) then
errmsg = msprintf(gettext("%s: Expected Vector/Scalar for Upper Bound Vector (3rd Parameter)"), "fminbnd");
@@ -225,9 +232,15 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
x2=x2';
end
+ //To check the match between f (1st Parameter) and x2 (3rd Parameter)
+ if(execstr('init=fun(x2)','errcatch')==21) then
+ errmsg = msprintf(gettext("%s: Objective function and x2 did not match"), "fminbnd");
+ error(errmsg);
+ end
+
//To check the contents of x1 and x2 (2nd & 3rd Parameter)
- for i = 1:s(2)
+ for i = 1:s(1)
if (x1(i) == %inf) then
errmsg = msprintf(gettext("%s: Value of Lower Bound can not be infinity"), "fminbnd");
error(errmsg);
@@ -237,7 +250,7 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
error(errmsg);
end
if(x2(i)-x1(i)<=1e-6) then
- errmsg = msprintf(gettext("%s: Difference between Upper Bound and Lower bound should be atleast > 10^6 for variable number= %d "), "fminbnd", i);
+ errmsg = msprintf(gettext("%s: Difference between Upper Bound and Lower bound should be atleast > 10^-6 for variable number= %d "), "fminbnd", i);
error(errmsg)
end
end
@@ -255,11 +268,26 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
for i = 1:(size(param))/2
select convstr(param(2*i-1),'l')
case "maxiter" then
- options(2*i) = param(2*i);
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Iteration should be a Constant"), "fminbnd");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry
+ end
case "cputime" then
- options(2*i) = param(2*i);
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Cpu-time should be a Constant"), "fminbnd");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry
+ end
case "tolx" then
- options(2*i) = param(2*i);
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Tolerance should be a Constant"), "fminbnd");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the tolerance as per user entry
+ end
else
errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fminbnd", param(2*i-1));
error(errmsg)
@@ -304,7 +332,7 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
//Calculating the values for the output
xopt = xopt';
exitflag = status;
- output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
output.Objective_Evaluation = obj_eval;
@@ -315,7 +343,7 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
if( status~=0 & status~=1 & status~=2 & status~=3 & status~=4 & status~=7 ) then
xopt=[]
fopt=[]
- output = struct("Iterations", [],"Cpu_Time",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
lambda = struct("lower",[],"upper",[]);
@@ -326,38 +354,54 @@ function [xopt,fopt,exitflag,output,lambda] = fminbnd (varargin)
case 0 then
printf("\nOptimal Solution Found.\n");
+ output.Message="Optimal Solution Found";
case 1 then
printf("\nMaximum Number of Iterations Exceeded. Output may not be optimal.\n");
+ output.Message="Maximum Number of Iterations Exceeded. Output may not be optimal";
case 2 then
- printf("\nMaximum CPU Time exceeded. Output may not be optimal.\n");
+ printf("\nMaximum CPU Time exceeded. Output may not be optimal.\n");
+ output.Message="Maximum CPU Time exceeded. Output may not be optimal";
case 3 then
printf("\nStop at Tiny Step\n");
+ output.Message="Stop at Tiny Step";
case 4 then
printf("\nSolved To Acceptable Level\n");
+ output.Message="Solved To Acceptable Level";
case 5 then
printf("\nConverged to a point of local infeasibility.\n");
+ output.Message="Converged to a point of local infeasibility";
case 6 then
printf("\nStopping optimization at current point as requested by user.\n");
+ output.Message="Stopping optimization at current point as requested by user";
case 7 then
printf("\nFeasible point for square problem found.\n");
+ output.Message="Feasible point for square problem found";
case 8 then
printf("\nIterates diverging; problem might be unbounded.\n");
+ output.Message="Iterates diverging; problem might be unbounded";
case 9 then
printf("\nRestoration Failed!\n");
+ output.Message="Restoration Failed!";
case 10 then
printf("\nError in step computation (regularization becomes too large?)!\n");
- case 12 then
+ output.Message="Error in step computation (regularization becomes too large?)!";
+ case 11 then
printf("\nProblem has too few degrees of freedom.\n");
+ output.Message="Problem has too few degrees of freedom";
+ case 12 then
+ printf("\nInvalid option thrown back by Ipopt\n");
+ output.Message="Invalid option thrown back by Ipopt";
case 13 then
- printf("\nInvalid option thrown back by Ipopt\n");
- case 14 then
printf("\nNot enough memory.\n");
+ output.Message="Not enough memory";
case 15 then
printf("\nINTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors.\n");
+ output.Message="INTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors";
else
printf("\nInvalid status returned. Notify the Toolbox authors\n");
+ output.Message="Invalid status returned. Notify the Toolbox authors";
break;
- end
+ end
endfunction
diff --git a/macros/fmincon.bin b/macros/fmincon.bin
new file mode 100644
index 0000000..c9ba515
Binary files /dev/null and b/macros/fmincon.bin differ
diff --git a/macros/fmincon.sci b/macros/fmincon.sci
index 2393649..9faefc4 100644
--- a/macros/fmincon.sci
+++ b/macros/fmincon.sci
@@ -93,6 +93,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
// output.Cpu_Time: The total cpu-time spend during the search
// output.Objective_Evaluation: The number of Objective Evaluations performed during the search
// output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+ // output.Message: The output message for the problem
//
//
// The lambda data structure contains the Lagrange multipliers at the end
@@ -260,6 +261,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
// options=list("MaxIter", [1500], "CpuTime", [500], "GradObj", fGrad, "Hessian", lHess,"GradCon", cGrad);
// //Calling Ipopt
// [x,fval,exitflag,output,lambda,grad,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options)
+ // // Press ENTER to continue
// Authors
// R.Vidyadhar , Vignesh Kannan
@@ -268,10 +270,15 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
[lhs , rhs] = argn();
//To check the number of arguments given by the user
- if ( rhs<4 | rhs==5 | rhs==7 | rhs>10 ) then
+ if ( rhs<4 | rhs>10 ) then
errmsg = msprintf(gettext("%s: Unexpected number of input arguments : %d provided while it should be 4,6,8,9,10"), "fmincon", rhs);
error(errmsg)
end
+
+ if (rhs==5 | rhs==7) then
+ errmsg = msprintf(gettext("%s: Unexpected number of input arguments : %d provided while it should be 4,6,8,9,10s"), "fmincon", rhs);
+ error(errmsg)
+ end
//Storing the Input Parameters
fun = varargin(1);
@@ -299,16 +306,10 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
end
//To check whether the 1st Input argument (fun) is a function or not
- if (type(fun) ~= 13 & type(fun) ~= 11) then
- errmsg = msprintf(gettext("%s: Expected function for Objective (1st Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", fun, "f", 1, "function");
//To check whether the 2nd Input argument (x0) is a vector/scalar
- if (type(x0) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Vector/Scalar for Starting Point (2nd Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", x0, "x0", 2, "constant");
//To check and convert the 2nd Input argument (x0) to a row vector
if((size(x0,1)~=1) & (size(x0,2)~=1)) then
@@ -346,10 +347,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
endfunction
//To check whether the 3rd Input argument (A) is a Matrix/Vector
- if (type(A) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Matrix/Vector for Constraint Matrix A (3rd parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", A, "A", 3, "constant");
//To check for correct size of A(3rd paramter)
if(size(A,2)~=s(2) & size(A,2)~=0) then
@@ -360,10 +358,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
s1=size(A);
//To check whether the 4th Input argument (b) is a vector/scalar
- if (type(b) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Vector/Scalar for b (4th Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", b, "b", 4, "constant");
//To check for the correct size of b (4th paramter) and convert it into a column vector which is required for Ipopt
if(s1(2)==0) then
@@ -389,10 +384,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
end
//To check whether the 5th Input argument (Aeq) is a matrix/vector
- if (type(Aeq) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Matrix/Vector for Equality Constraint Matrix Aeq (5th Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", Aeq, "Aeq", 5, "constant");
//To check for the correct size of Aeq (5th paramter)
if(size(Aeq,2)~=s(2) & size(Aeq,2)~=0) then
@@ -403,10 +395,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
s2=size(Aeq);
//To check whether the 6th Input argument(beq) is a vector/scalar
- if (type(beq) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Vector/Scalar for beq (6th Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", beq, "beq", 6, "constant");
//To check for the correct size of beq(6th paramter) and convert it into a column vector which is required for Ipopt
if(s2(2)==0) then
@@ -433,10 +422,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
//To check whether the 7th Input argument (lb) is a vector/scalar
- if (type(lb) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Vector/Scalar for Lower Bound Vector (7th Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", lb, "lb", 7, "constant");
//To check for the correct size and data of lb (7th paramter) and convert it into a column vector as required by Ipopt
if (size(lb,2)==0) then
@@ -459,10 +445,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
end
//To check whether the 8th Input argument (ub) is a vector/scalar
- if (type(ub) ~= 1) then
- errmsg = msprintf(gettext("%s: Expected Vector/Scalar for Upper Bound Vector (8th Parameter)"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", ub, "ub", 8, "constant");
//To check for the correct size and data of ub (8th paramter) and convert it into a column vector as required by Ipopt
if (size(ub,2)==0) then
@@ -497,7 +480,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
end
if(ub(i)-lb(i)<=1e-6) then
- errmsg = msprintf(gettext("%s: Difference between Upper Bound and Lower bound should be atleast > 10^6 for variable number= %d "), "fmincon", i);
+ errmsg = msprintf(gettext("%s: Difference between Upper Bound and Lower bound should be atleast > 10^-6 for variable number= %d "), "fmincon", i);
error(errmsg)
end
end
@@ -530,7 +513,6 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
no_nlic = size(sample_c,2);
no_nlec = size(sample_ceq,2);
no_nlc = no_nlic + no_nlec;
-
//Constructing a single output variable function for nlc
function y = addnlc(x)
[c,ceq] = nlc(x);
@@ -580,74 +562,13 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
end
//If options has been entered, then check its type for 'list'
- if (type(param) ~= 15) then
- errmsg = msprintf(gettext("%s: Options (10th parameter) should be a list"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", param, "options", 10, "list");
//If options has been entered, then check whether an even number of entires has been entered
if (modulo(size(param),2)) then
errmsg = msprintf(gettext("%s: Size of Options (list) should be even"), "fmincon");
error(errmsg);
end
-
-
- //Defining a function to calculate Gradient or Hessian if the respective user entry is OFF
- function [y,check] = gradhess(x,t)
- if t==1 then //To return Gradient
- if(execstr('y=numderivative(fun,x)','errcatch')==10000)
- y=0;
- check=1;
- else
- y=numderivative(fun,x);
- if (isreal(y)==%F) then
- y=0;
- check=1;
- else
- check=0;
- end
- end
- elseif t==2 then //To return Hessian
- if(execstr('[grad,y]=numderivative(fun,x)','errcatch')==10000)
- y=0;
- check=1;
- else
- [grad,y]=numderivative(fun,x);
- if (isreal(y)==%F) then
- y=0;
- check=1;
- else
- check=0;
- end
- end
- elseif t==3 then //To return Gradient
- if(execstr('y=numderivative(addnlc,x)','errcatch')==10000)
- y=0;
- check=1;
- else
- y=numderivative(addnlc,x);
- if (isreal(y)==%F) then
- y=0;
- check=1;
- else
- check=0;
- end
- end
- elseif t==4 then //To return Hessian
- if(execstr('[grad,y]=numderivative(addnlc,x)','errcatch')==10000)
- y=0;
- check=1;
- else
- [grad,y]=numderivative(addnlc,x);
- if (isreal(y)==%F) then
- y=0;
- check=1;
- else
- check=0;
- end
- end
- end
- endfunction
//To set default values for options, if user doesn't enter options
options = list("MaxIter", [3000], "CpuTime", [600]);
@@ -669,31 +590,65 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
//To check the user entry for options and storing it
for i = 1:(size(param))/2
select convstr(param(2*i-1),'l')
- case "maxiter" then
- options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry
+ case "maxiter" then
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Iteration should be a Constant"), "fmincon");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry
+ end
case "cputime" then
- options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Cpu-time should be a Constant"), "fmincon");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry
+ end
case "gradobj" then
- flag1=1;
- fGrad=param(2*i);
+ if (type(param(2*i))==10) then
+ if (convstr(param(2*i))=="off") then
+ flag1 =0;
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized String [%s] entered for the option- %s."), "fmincon",param(2*i), param(2*i-1));
+ error(errmsg);
+ end
+ else
+ flag1 = 1;
+ fGrad = param(2*i);
+ end
case "hessian" then
- flag2=1;
- lHess=param(2*i);
+ if (type(param(2*i))==10) then
+ if (convstr(param(2*i))=="off") then
+ flag2 =0;
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized String [%s] entered for the option- %s."), "fmincon",param(2*i), param(2*i-1));
+ error(errmsg);
+ end
+ else
+ flag2 = 1;
+ lHess = param(2*i);
+ end
case "gradcon" then
- flag3=1;
- cGrad=param(2*i);
+ if (type(param(2*i))==10) then
+ if (convstr(param(2*i))=="off") then
+ flag3 =0;
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized String [%s] entered for the option- %s."), "fmincon",param(2*i), param(2*i-1));
+ error(errmsg);
+ end
+ else
+ flag3 = 1;
+ cGrad = param(2*i);
+ end
else
errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fmincon", param(2*i-1));
error(errmsg);
end
end
- //To check for correct input of Gradient and Hessian functions from the user
+ //To check for correct input of Objective Gradient function from the user
if (flag1==1) then
- if (type(fGrad) ~= 11 & type(fGrad) ~= 13) then
- errmsg = msprintf(gettext("%s: Expected function for Gradient of Objective"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", fGrad, "fGrad", 10, "function");
if(execstr('sample_fGrad=fGrad(x0)','errcatch')==21)
errmsg = msprintf(gettext("%s: Gradient function of Objective and x0 did not match "), "fmincon");
@@ -704,32 +659,16 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
if (size(sample_fGrad,1)==s(2) & size(sample_fGrad,2)==1) then
elseif (size(sample_fGrad,1)==1 & size(sample_fGrad,2)==s(2)) then
- elseif (size(sample_fGrad,1)~=1 & size(sample_fGrad,2)~=1) then
- errmsg = msprintf(gettext("%s: Wrong Input for Objective Gradient function(10th Parameter)---->Vector function is Expected"), "fmincon");
+ else
+ errmsg = msprintf(gettext("%s: Wrong Input for Objective Gradient function(3rd Parameter)---->Row Vector function of size [1 X %d] is Expected"), "fmincon",s(2));
error(errmsg);
- end
-
- function [y,check] = fGrad1(x)
- if(execstr('y=fGrad(x)','errcatch')==32 | execstr('y=fGrad(x)','errcatch')==27)
- y = 0;
- check=1;
- else
- y=fGrad(x);
- if (isreal(y)==%F) then
- y = 0;
- check=1;
- else
- check=0;
- end
- end
- endfunction
-
+ end
end
+
+ //To check for correct input of Lagrangian Hessian function from the user
if (flag2==1) then
- if (type(lHess) ~= 11 & type(lHess) ~= 13) then
- errmsg = msprintf(gettext("%s: Expected function for Hessian of Objective"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", lHess, "lHess", 10, "function");
+
if(execstr('sample_lHess=lHess(x0,1,1:no_nlc)','errcatch')==21)
errmsg = msprintf(gettext("%s: Hessian function of Objective and x0 did not match "), "fmincon");
error(errmsg);
@@ -738,29 +677,12 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
if(size(sample_lHess,1)~=s(2) | size(sample_lHess,2)~=s(2)) then
errmsg = msprintf(gettext("%s: Wrong Input for Objective Hessian function(10th Parameter)---->Symmetric Matrix function is Expected "), "fmincon");
error(errmsg);
- end
-
- function [y,check] = lHess1(x,obj,lambda)
- if(execstr('y=lHess(x,obj,lambda)','errcatch')==32 | execstr('y=lHess(x,obj,lambda)','errcatch')==27)
- y = 0;
- check=1;
- else
- y=lHess(x,obj,lambda);
- if (isreal(y)==%F) then
- y = 0;
- check=1;
- else
- check=0;
- end
- end
- endfunction
-
+ end
end
+
+ //To check for correct input of Constraint Gradient function from the user
if (flag3==1) then
- if (type(cGrad) ~= 11 & type(cGrad) ~= 13) then
- errmsg = msprintf(gettext("%s: Expected function for Gradient of Constraint function"), "fmincon");
- error(errmsg);
- end
+ Checktype("fmincon", cGrad, "cGrad", 10, "function");
if(execstr('[sample_cGrad,sample_ceqg]=cGrad(x0)','errcatch')==21)
errmsg = msprintf(gettext("%s: Gradient function of Constraint and x0 did not match "), "fmincon");
@@ -790,36 +712,149 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
errmsg = msprintf(gettext("%s: Wrong Input for Constraint Gradient function(10th Parameter) (Refer Help)"), "fmincon");
error(errmsg);
end
-
- function [y,check] = addcGrad1(x)
- if(execstr('y=addcGrad(x)','errcatch')==32 | execstr('y=addcGrad(x)','errcatch')==27)
- y = 0;
- check=1;
- else
- y=addcGrad(x);
- if (isreal(y)==%F) then
+ end
+
+ //Defining an inbuilt Objective gradient function
+ function [y,check] = fGrad1(x)
+ if flag1==1 then
+ if(execstr('y=fGrad(x)','errcatch')==32 | execstr('y=fGrad(x)','errcatch')==27)
+ y = 0;
+ check=1;
+ else
+ y=fGrad(x);
+ if (isreal(y)==%F) then
+ y = 0;
+ check=1;
+ else
+ check=0;
+ end
+ end
+ else
+ if(execstr('y=numderivative(fun,x)','errcatch')==10000)
+ y=0;
+ check=1;
+ else
+ y=numderivative(fun,x);
+ if (isreal(y)==%F) then
+ y=0;
+ check=1;
+ else
+ check=0;
+ end
+ end
+ end
+ endfunction
+
+ //Defining an inbuilt Lagrangian Hessian function
+ function [y,check] = lHess1(x,obj,lambda)
+ if flag2==1 then
+ if(execstr('y=lHess(x,obj,lambda)','errcatch')==32 | execstr('y=lHess(x,obj,lambda)','errcatch')==27)
y = 0;
check=1;
- else
- check=0;
+ else
+ y=lHess(x,obj,lambda);
+ if (isreal(y)==%F) then
+ y = 0;
+ check=1;
+ else
+ check=0;
+ end
end
+ else
+ if(execstr('[grad,y]=numderivative(fun,x)','errcatch')==10000)
+ check1=1;
+ else
+ [grad,y1]=numderivative(fun,x);
+ if (isreal(y1)==%F) then
+ check1=1;
+ else
+ check1=0;
+ end
+ end
+
+
+ if check1==0 then
+ if no_nlc~=0 then
+ if(execstr('[grad,y]=numderivative(addnlc,x)','errcatch')==10000)
+ check2=1;
+ else
+ [grad,y2]=numderivative(addnlc,x);
+ if (isreal(y2)==%F) then
+ check2=1;
+ else
+ check2=0;
+ end
+ end
+ if check2==0 then
+ y2=matrix(y2, no_nlc*s(2)*s(2),1)
+ for i = 1:s(2)*s(2)
+ y(i)=0;
+ for j = 1:no_nlc
+ y(i)= y(i) + lambda(j)*y2((i-1)*no_nlc+j);
+ end
+ end
+
+ for i = 1:s(2)*s(2)
+ y(i) = y(i)+ obj*y1(i);
+ end
+ check=0;
+ else
+ check=1;
+ end
+ else
+ check=0;
+ for i = 1:s(2)*s(2)
+ y(i) = obj*y1(i);
+ end
+ end
+ else
+ check=1;
+ y=[0];
+ end
end
- endfunction
- end
-
- //To Convert the Gradient and Hessian into Error Debugable form
+ endfunction
+ //Defining an inbuilt Constraint gradient function
+ function [y,check] = addcGrad1(x)
+ if flag3==1 then
+ if(execstr('y=addcGrad(x)','errcatch')==32 | execstr('y=addcGrad(x)','errcatch')==27)
+ y = 0;
+ check=1;
+ else
+ y=addcGrad(x);
+ if (isreal(y)==%F) then
+ y = 0;
+ check=1;
+ else
+ check=0;
+ end
+ end
+ else
+ if(execstr('y=numderivative(addnlc,x)','errcatch')==10000)
+ y=0;
+ check=1;
+ else
+ y=numderivative(addnlc,x);
+ if (isreal(y)==%F) then
+ y=0;
+ check=1;
+ else
+ check=0;
+ end
+ end
+ end
+ endfunction
+
+ //Creating a Dummy Variable for IPopt use
+ empty=[0];
- //Dummy variable which is used by Ipopt
- empty=0;
-
//Calling the Ipopt function for solving the above problem
- [xopt,fopt,status,iter,cpu,obj_eval,dual,lambda1,zl,zu,gradient,hessian1] = solveminconp (f,gradhess,A,b,Aeq,beq,lb,ub,no_nlc,no_nlic,addnlc1,flag1,fGrad1,flag2,lHess1,flag3,addcGrad1,x0,options,empty)
+ [xopt,fopt,status,iter,cpu,obj_eval,dual,lambda1,zl,zu,gradient,hessian1] = solveminconp(f,A,b,Aeq,beq,lb,ub,no_nlc,no_nlic,addnlc1,fGrad1,lHess1,addcGrad1,x0,options,empty)
//Calculating the values for the output
xopt = xopt';
exitflag = status;
- output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
output.Objective_Evaluation = obj_eval;
@@ -857,7 +892,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
lambda.ineqlin (j) = lambda1(i)
j= j+1;
end
- lambda.ineqlin = lambda.ineqlin';
+ lambda.ineqlin = lambda.ineqlin'
end
//Converting hessian of order (1 x (numberOfVariables)^2) received from Ipopt to order (numberOfVariables x numberOfVariables)
@@ -872,7 +907,7 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
if( status~=0 & status~=1 & status~=2 & status~=3 & status~=4 & status~=7 ) then
xopt=[];
fopt=[];
- output = struct("Iterations", [],"Cpu_Time",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
lambda = struct("lower",[],"upper",[],"ineqlin",[],"eqlin",[],"ineqnonlin",[],"eqnonlin",[]);
@@ -886,37 +921,54 @@ function [xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (varargin
case 0 then
printf("\nOptimal Solution Found.\n");
+ output.Message="Optimal Solution Found";
case 1 then
printf("\nMaximum Number of Iterations Exceeded. Output may not be optimal.\n");
+ output.Message="Maximum Number of Iterations Exceeded. Output may not be optimal";
case 2 then
printf("\nMaximum CPU Time exceeded. Output may not be optimal.\n");
+ output.Message="Maximum CPU Time exceeded. Output may not be optimal";
case 3 then
printf("\nStop at Tiny Step\n");
+ output.Message="Stop at Tiny Step";
case 4 then
printf("\nSolved To Acceptable Level\n");
+ output.Message="Solved To Acceptable Level";
case 5 then
printf("\nConverged to a point of local infeasibility.\n");
+ output.Message="Converged to a point of local infeasibility";
case 6 then
printf("\nStopping optimization at current point as requested by user.\n");
+ output.Message="Stopping optimization at current point as requested by user";
case 7 then
printf("\nFeasible point for square problem found.\n");
+ output.Message="Feasible point for square problem found";
case 8 then
printf("\nIterates diverging; problem might be unbounded.\n");
+ output.Message="Iterates diverging; problem might be unbounded";
case 9 then
printf("\nRestoration Failed!\n");
+ output.Message="Restoration Failed!";
case 10 then
printf("\nError in step computation (regularization becomes too large?)!\n");
+ output.Message="Error in step computation (regularization becomes too large?)!";
case 11 then
printf("\nProblem has too few degrees of freedom.\n");
+ output.Message="Problem has too few degrees of freedom";
case 12 then
printf("\nInvalid option thrown back by Ipopt\n");
+ output.Message="Invalid option thrown back by Ipopt";
case 13 then
printf("\nNot enough memory.\n");
+ output.Message="Not enough memory";
case 15 then
printf("\nINTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors.\n");
+ output.Message="INTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors";
else
printf("\nInvalid status returned. Notify the Toolbox authors\n");
+ output.Message="Invalid status returned. Notify the Toolbox authors";
break;
end
+
endfunction
diff --git a/macros/fminimax.bin b/macros/fminimax.bin
new file mode 100644
index 0000000..c023720
Binary files /dev/null and b/macros/fminimax.bin differ
diff --git a/macros/fminimax.sci b/macros/fminimax.sci
index c775b1b..b649640 100644
--- a/macros/fminimax.sci
+++ b/macros/fminimax.sci
@@ -19,11 +19,11 @@ function [x,fval,maxfval,exitflag,output,lambda] = fminimax(varargin)
// xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub)
// xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun)
// xopt = fminimax(fun,x0,A,b,Aeq,beq,lb,ub,nonlinfun,options)
- // [xopt, fval] = fmincon(.....)
- // [xopt, fval, maxfval]= fmincon(.....)
- // [xopt, fval, maxfval, exitflag]= fmincon(.....)
- // [xopt, fval, maxfval, exitflag, output]= fmincon(.....)
- // [xopt, fval, maxfval, exitflag, output, lambda]= fmincon(.....)
+ // [xopt, fval] = fminimax(.....)
+ // [xopt, fval, maxfval]= fminimax(.....)
+ // [xopt, fval, maxfval, exitflag]= fminimax(.....)
+ // [xopt, fval, maxfval, exitflag, output]= fminimax(.....)
+ // [xopt, fval, maxfval, exitflag, output, lambda]= fminimax(.....)
//
// Parameters
// fun: The function to be minimized. fun is a function that accepts a vector x and returns a vector F, the objective functions evaluated at x.
diff --git a/macros/fminunc.bin b/macros/fminunc.bin
new file mode 100644
index 0000000..aa82fc3
Binary files /dev/null and b/macros/fminunc.bin differ
diff --git a/macros/fminunc.sci b/macros/fminunc.sci
index a936aa1..b8ff7b5 100644
--- a/macros/fminunc.sci
+++ b/macros/fminunc.sci
@@ -75,6 +75,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
// output.Cpu_Time: The total cpu-time spend during the search
// output.Objective_Evaluation: The number of Objective Evaluations performed during the search
// output.Dual_Infeasibility: The Dual Infeasiblity of the final soution
+ // output.Message: The output message for the problem
//
//
// Examples
@@ -143,7 +144,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
[lhs , rhs] = argn();
//To check the number of arguments given by the user
- if ( rhs<2 | rhs>5 ) then
+ if ( rhs<2 | rhs>3 ) then
errmsg = msprintf(gettext("%s: Unexpected number of input arguments : %d provided while should be 2 or 5"), "fminunc", rhs);
error(errmsg)
end
@@ -166,7 +167,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
//To check and convert the 2nd Input argument(x0) to a row vector
if((size(x0,1)~=1) & (size(x0,2)~=1)) then
- errmsg = msprintf(gettext("%s: Expected Row Vector or Column Vector for x0 (Initial Value) "), "fminunc", rhs);
+ errmsg = msprintf(gettext("%s: Expected Row Vector or Column Vector for x0 (Initial Value) "), "fminunc");
error(errmsg);
else
if(size(x0,2)==1) then
@@ -266,22 +267,49 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
for i = 1:(size(param))/2
select convstr(param(2*i-1),'l')
case "maxiter" then
- options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Iteration should be a Constant"), "fminunc");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum number of iterations as per user entry
+ end
case "cputime" then
- options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry
+ if (type(param(2*i))~=1) then
+ errmsg = msprintf(gettext("%s: Value for Maximum Cpu-time should be a Constant"), "fminunc");
+ error(errmsg);
+ else
+ options(2*i) = param(2*i); //Setting the maximum CPU time as per user entry
+ end
case "gradient" then
- flag1 = 1;
- fGrad = param(2*i);
+ if (type(param(2*i))==10) then
+ if (convstr(param(2*i))=="off") then
+ flag1 =0;
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized String [%s] entered for the option- %s."), "fminunc",param(2*i), param(2*i-1));
+ error(errmsg);
+ end
+ else
+ flag1 = 1;
+ fGrad = param(2*i);
+ end
case "hessian" then
- flag2 = 1;
- fHess = param(2*i);
+ if (type(param(2*i))==10) then
+ if (convstr(param(2*i))=="off") then
+ flag2 =0;
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized String [%s] entered for the option- %s."), "fminunc",param(2*i), param(2*i-1));
+ error(errmsg);
+ end
+ else
+ flag2 = 1;
+ fHess = param(2*i);
+ end
else
- errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fminbnd", param(2*i-1));
+ errmsg = msprintf(gettext("%s: Unrecognized parameter name %s."), "fminunc", param(2*i-1));
error(errmsg)
end
end
-
//To check for correct input of Gradient and Hessian functions from the user
if (flag1==1) then
if (type(fGrad) ~= 13 & type(fGrad) ~= 11) then
@@ -298,8 +326,8 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
if (size(samplefGrad,1)==s(2) & size(samplefGrad,2)==1) then
elseif (size(samplefGrad,1)==1 & size(samplefGrad,2)==s(2)) then
- elseif (size(samplefGrad,1)~=1 & size(samplefGrad,2)~=1) then
- errmsg = msprintf(gettext("%s: Wrong Input for Objective Gradient function(3rd Parameter)---->Row Vector function is Expected"), "fminunc");
+ else
+ errmsg = msprintf(gettext("%s: Wrong Input for Objective Gradient function(3rd Parameter)---->Row Vector function of size [1 X %d] is Expected"), "fminunc",s(2));
error(errmsg);
end
@@ -332,7 +360,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
samplefHess=fHess(x0);
if(size(samplefHess,1)~=s(2) | size(samplefHess,2)~=s(2)) then
- errmsg = msprintf(gettext("%s: Wrong Input for Objective Hessian function(3rd Parameter)---->Symmetric Matrix function is Expected "), "fminunc");
+ errmsg = msprintf(gettext("%s: Wrong Input for Objective Hessian function(3rd Parameter)---->Symmetric Matrix function of size [%d X %d] is Expected "), "fminunc",s(2),s(2));
error(errmsg);
end
@@ -358,7 +386,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
//Calculating the values for output
xopt = xopt';
exitflag = status;
- output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Objective_Evaluation",[],"Dual_Infeasibility",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
output.Objective_Evaluation = obj_eval;
@@ -377,7 +405,7 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
if( status~=0 & status~=1 & status~=2 & status~=3 & status~=4 & status~=7 ) then
xopt=[]
fopt=[]
- output = struct("Iterations", [],"Cpu_Time",[]);
+ output = struct("Iterations", [],"Cpu_Time",[],"Message","");
output.Iterations = iter;
output.Cpu_Time = cpu;
gradient=[]
@@ -390,38 +418,54 @@ function [xopt,fopt,exitflag,output,gradient,hessian] = fminunc (varargin)
case 0 then
printf("\nOptimal Solution Found.\n");
+ output.Message="Optimal Solution Found";
case 1 then
printf("\nMaximum Number of Iterations Exceeded. Output may not be optimal.\n");
+ output.Message="Maximum Number of Iterations Exceeded. Output may not be optimal";
case 2 then
printf("\nMaximum CPU Time exceeded. Output may not be optimal.\n");
+ output.Message="Maximum CPU Time exceeded. Output may not be optimal";
case 3 then
printf("\nStop at Tiny Step\n");
+ output.Message="Stop at Tiny Step";
case 4 then
printf("\nSolved To Acceptable Level\n");
+ output.Message="Solved To Acceptable Level";
case 5 then
printf("\nConverged to a point of local infeasibility.\n");
+ output.Message="Converged to a point of local infeasibility";
case 6 then
printf("\nStopping optimization at current point as requested by user.\n");
+ output.Message="Stopping optimization at current point as requested by user";
case 7 then
printf("\nFeasible point for square problem found.\n");
+ output.Message="Feasible point for square problem found";
case 8 then
printf("\nIterates diverging; problem might be unbounded.\n");
+ output.Message="Iterates diverging; problem might be unbounded";
case 9 then
printf("\nRestoration Failed!\n");
+ output.Message="Restoration Failed!";
case 10 then
printf("\nError in step computation (regularization becomes too large?)!\n");
- case 12 then
+ output.Message="Error in step computation (regularization becomes too large?)!";
+ case 11 then
printf("\nProblem has too few degrees of freedom.\n");
- case 13 then
+ output.Message="Problem has too few degrees of freedom";
+ case 12 then
printf("\nInvalid option thrown back by Ipopt\n");
- case 14 then
+ output.Message="Invalid option thrown back by Ipopt";
+ case 13 then
printf("\nNot enough memory.\n");
+ output.Message="Not enough memory";
case 15 then
printf("\nINTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors.\n");
+ output.Message="INTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors";
else
printf("\nInvalid status returned. Notify the Toolbox authors\n");
+ output.Message="Invalid status returned. Notify the Toolbox authors";
break;
- end
+ end
endfunction
diff --git a/macros/lib b/macros/lib
new file mode 100644
index 0000000..612b878
Binary files /dev/null and b/macros/lib differ
diff --git a/macros/linprog.bin b/macros/linprog.bin
new file mode 100644
index 0000000..1d3a5aa
Binary files /dev/null and b/macros/linprog.bin differ
diff --git a/macros/lsqcurvefit.bin b/macros/lsqcurvefit.bin
new file mode 100644
index 0000000..20a8d0d
Binary files /dev/null and b/macros/lsqcurvefit.bin differ
diff --git a/macros/lsqcurvefit.sci b/macros/lsqcurvefit.sci
new file mode 100644
index 0000000..10e8e48
--- /dev/null
+++ b/macros/lsqcurvefit.sci
@@ -0,0 +1,439 @@
+// Copyright (C) 2015 - IIT Bombay - FOSSEE
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Author: Harpreet Singh
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+function [xopt,resnorm,residual,exitflag,output,lambda] = lsqcurvefit (varargin)
+ // Solves a non linear data fitting problems.
+ //
+ // Calling Sequence
+ // xopt = lsqcurvefit(fun,x0,xdata,ydata)
+ // xopt = lsqcurvefit(fun,x0,xdata,ydata,lb,ub)
+ // xopt = lsqcurvefit(fun,x0,xdata,ydata,lb,ub,options)
+ // [xopt,resnorm] = lsqcurvefit( ... )
+ //
+ // Parameters
+ // C : a matrix of double, represents the multiplier of the solution x in the expression C⋅x - d. Number of columns in C is equal to the number of elements in x.
+ // d : a vector of double, represents the additive constant term in the expression C⋅x - d. Number of elements in d is equal to the number of rows in C matrix.
+ // A : a matrix of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+ // b : a vector of double, represents the linear coefficients in the inequality constraints A⋅x ≤ b.
+ // Aeq : a matrix of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+ // beq : a vector of double, represents the linear coefficients in the equality constraints Aeq⋅x = beq.
+ // lb : a vector of double, contains lower bounds of the variables.
+ // ub : a vector of double, contains upper bounds of the variables.
+ // x0 : a vector of double, contains initial guess of variables.
+ // param : a list containing the parameters to be set.
+ // xopt : a vector of double, the computed solution of the optimization problem.
+ // resnorm : a double, objective value returned as the scalar value norm(C⋅x-d)^2.
+ // residual : a vector of double, solution residuals returned as the vector d-C⋅x.
+ // exitflag : The exit status. See below for details.
+ // output : The structure consist of statistics about the optimization. See below for details.
+ // lambda : The structure consist of the Lagrange multipliers at the solution of problem. See below for details.
+ //
+ // Description
+ // Search the minimum of a constrained linear least square problem specified by :
+ //
+ //
+ // \begin{eqnarray}
+ // &\mbox{min}_{x}
+ // & 1/2||C⋅x - d||_2^2 \\
+ // & \text{subject to} & A⋅x \leq b \\
+ // & & Aeq⋅x = beq \\
+ // & & lb \leq x \leq ub \\
+ // \end{eqnarray}
+ //
+ //
+ // The routine calls Ipopt for solving the linear least square problem, Ipopt is a library written in C++.
+ //
+ // The options allows the user to set various parameters of the Optimization problem.
+ // It should be defined as type "list" and contains the following fields.
+ //
+ // Syntax : options= list("MaxIter", [---], "CpuTime", [---]);
+ // MaxIter : a Scalar, containing the Maximum Number of Iteration that the solver should take.
+ // CpuTime : a Scalar, containing the Maximum amount of CPU Time that the solver should take.
+ // Default Values : options = list("MaxIter", [3000], "CpuTime", [600]);
+ //
+ //
+ // The exitflag allows to know the status of the optimization which is given back by Ipopt.
+ //
+ // exitflag=0 : Optimal Solution Found
+ // exitflag=1 : Maximum Number of Iterations Exceeded. Output may not be optimal.
+ // exitflag=2 : Maximum CPU Time exceeded. Output may not be optimal.
+ // exitflag=3 : Stop at Tiny Step.
+ // exitflag=4 : Solved To Acceptable Level.
+ // exitflag=5 : Converged to a point of local infeasibility.
+ //
+ //
+ // For more details on exitflag see the ipopt documentation, go to http://www.coin-or.org/Ipopt/documentation/
+ //
+ // The output data structure contains detailed informations about the optimization process.
+ // It has type "struct" and contains the following fields.
+ //
+ // output.iterations: The number of iterations performed during the search
+ // output.constrviolation: The max-norm of the constraint violation.
+ //
+ //
+ // The lambda data structure contains the Lagrange multipliers at the end
+ // of optimization. In the current version the values are returned only when the the solution is optimal.
+ // It has type "struct" and contains the following fields.
+ //
+ // lambda.lower: The Lagrange multipliers for the lower bound constraints.
+ // lambda.upper: The Lagrange multipliers for the upper bound constraints.
+ // lambda.eqlin: The Lagrange multipliers for the linear equality constraints.
+ // lambda.ineqlin: The Lagrange multipliers for the linear inequality constraints.
+ //
+ //
+ // Examples
+ // //A simple linear least square example
+ // C = [ 2 0;
+ // -1 1;
+ // 0 2]
+ // d = [1
+ // 0
+ // -1];
+ // A = [10 -2;
+ // -2 10];
+ // b = [4
+ // -4];
+ // [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b)
+ // // Press ENTER to continue
+ //
+ // Examples
+ // //A basic example for equality, inequality constraints and variable bounds
+ // C = [1 1 1;
+ // 1 1 0;
+ // 0 1 1;
+ // 1 0 0;
+ // 0 0 1]
+ // d = [89;
+ // 67;
+ // 53;
+ // 35;
+ // 20;]
+ // A = [3 2 1;
+ // 2 3 4;
+ // 1 2 3];
+ // b = [191
+ // 209
+ // 162];
+ // Aeq = [1 2 1];
+ // beq = 10;
+ // lb = repmat(0.1,3,1);
+ // ub = repmat(4,3,1);
+ // [xopt,resnorm,residual,exitflag,output,lambda] = lsqlin(C,d,A,b,Aeq,beq,lb,ub)
+ // Authors
+ // Harpreet Singh
+
+
+ //To check the number of input and output argument
+ [lhs , rhs] = argn();
+
+ //To check the number of argument given by user
+ if ( rhs < 4 | rhs == 5 | rhs == 7 | rhs > 10 ) then
+ errmsg = msprintf(gettext("%s: Unexpected number of input arguments : %d provided while should be in the set of [4 6 8 9 10]"), "lsqlin", rhs);
+ error(errmsg)
+ end
+
+// Initializing all the values to empty matrix
+ C=[];
+ d=[];
+ A=[];
+ b=[];
+ Aeq=[];
+ beq=[];
+ lb=[];
+ ub=[];
+ x0=[];
+
+ C = varargin(1);
+ d = varargin(2);
+ A = varargin(3);
+ b = varargin(4);
+ nbVar = size(C,2);
+
+ if(nbVar == 0) then
+ errmsg = msprintf(gettext("%s: Cannot determine the number of variables because input objective coefficients is empty"), "lsqlin");
+ error(errmsg);
+ end
+
+ if ( rhs<5 ) then
+ Aeq = []
+ beq = []
+ else
+ Aeq = varargin(5);
+ beq = varargin(6);
+ end
+
+ if ( rhs<7 ) then
+ lb = repmat(-%inf,nbVar,1);
+ ub = repmat(%inf,nbVar,1);
+ else
+ lb = varargin(7);
+ ub = varargin(8);
+ end
+
+
+ if ( rhs<9 | size(varargin(9)) ==0 ) then
+ x0 = repmat(0,nbVar,1)
+ else
+ x0 = varargin(9);
+ end
+
+ if ( rhs<10 | size(varargin(10)) ==0 ) then
+ param = list();
+ else
+ param =varargin(10);
+ end
+
+ if (size(lb,2)==0) then
+ lb = repmat(-%inf,nbVar,1);
+ end
+
+ if (size(ub,2)==0) then
+ ub = repmat(%inf,nbVar,1);
+ end
+
+ if (type(param) ~= 15) then
+ errmsg = msprintf(gettext("%s: param should be a list "), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check type of variables
+ Checktype("lsqlin", C, "C", 1, "constant")
+ Checktype("lsqlin", d, "d", 2, "constant")
+ Checktype("lsqlin", A, "A", 3, "constant")
+ Checktype("lsqlin", b, "b", 4, "constant")
+ Checktype("lsqlin", Aeq, "Aeq", 5, "constant")
+ Checktype("lsqlin", beq, "beq", 6, "constant")
+ Checktype("lsqlin", lb, "lb", 7, "constant")
+ Checktype("lsqlin", ub, "ub", 8, "constant")
+ Checktype("lsqlin", x0, "x0", 9, "constant")
+
+ if (modulo(size(param),2)) then
+ errmsg = msprintf(gettext("%s: Size of parameters should be even"), "lsqlin");
+ error(errmsg);
+ end
+
+ options = list( "MaxIter" , [3000], ...
+ "CpuTime" , [600] ...
+ );
+
+ for i = 1:(size(param))/2
+
+ select convstr(param(2*i-1),'l')
+ case "maxiter" then
+ options(2*i) = param(2*i);
+ case "cputime" then
+ options(2*i) = param(2*i);
+ else
+ errmsg = msprintf(gettext("%s: Unrecognized parameter name ''%s''."), "lsqlin", param(2*i-1));
+ error(errmsg)
+ end
+ end
+
+ nbConInEq = size(A,1);
+ nbConEq = size(Aeq,1);
+
+ // Check if the user gives row vector
+ // and Changing it to a column matrix
+
+ if (size(d,2)== [nbVar]) then
+ d=d';
+ end
+
+ if (size(lb,2)== [nbVar]) then
+ lb = lb';
+ end
+
+ if (size(ub,2)== [nbVar]) then
+ ub = ub';
+ end
+
+ if (size(b,2)==nbConInEq) then
+ b = b';
+ end
+
+ if (size(beq,2)== nbConEq) then
+ beq = beq';
+ end
+
+ if (size(x0,2)== [nbVar]) then
+ x0=x0';
+ end
+
+ //Check the size of d which should equal to the number of variable
+ if ( size(d,1) ~= size(C,1)) then
+ errmsg = msprintf(gettext("%s: The number of rows in C must be equal the number of elements of d"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of inequality constraint which should be equal to the number of variables
+ if ( size(A,2) ~= nbVar & size(A,2) ~= 0) then
+ errmsg = msprintf(gettext("%s: The number of columns in A must be the same as the number of columns in C"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of equality constraint which should be equal to the number of variables
+ if ( size(Aeq,2) ~= nbVar & size(Aeq,2) ~= 0 ) then
+ errmsg = msprintf(gettext("%s: The number of columns in Aeq must be the same as the number of columns in C"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of Lower Bound which should be equal to the number of variables
+ if ( size(lb,1) ~= nbVar) then
+ errmsg = msprintf(gettext("%s: The Lower Bound is not equal to the number of variables"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of Upper Bound which should equal to the number of variables
+ if ( size(ub,1) ~= nbVar) then
+ errmsg = msprintf(gettext("%s: The Upper Bound is not equal to the number of variables"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of constraints of Lower Bound which should equal to the number of constraints
+ if ( size(b,1) ~= nbConInEq & size(b,1) ~= 0) then
+ errmsg = msprintf(gettext("%s: The number of rows in A must be the same as the number of elements of b"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of constraints of Upper Bound which should equal to the number of constraints
+ if ( size(beq,1) ~= nbConEq & size(beq,1) ~= 0) then
+ errmsg = msprintf(gettext("%s: The number of rows in Aeq must be the same as the number of elements of beq"), "lsqlin");
+ error(errmsg);
+ end
+
+ //Check the size of initial of variables which should equal to the number of variables
+ if ( size(x0,1) ~= nbVar) then
+ warnmsg = msprintf(gettext("%s: Ignoring initial guess of variables as it is not equal to the number of variables"), "lsqlin");
+ warning(warnmsg);
+ x0 = repmat(0,nbVar,1);
+ end
+
+ //Check if the user gives a matrix instead of a vector
+
+ if ((size(d,1)~=1)& (size(d,2)~=1)) then
+ errmsg = msprintf(gettext("%s: d should be a vector"), "lsqlin");
+ error(errmsg);
+ end
+
+ if (size(lb,1)~=1)& (size(lb,2)~=1) then
+ errmsg = msprintf(gettext("%s: Lower Bound should be a vector"), "lsqlin");
+ error(errmsg);
+ end
+
+ if (size(ub,1)~=1)& (size(ub,2)~=1) then
+ errmsg = msprintf(gettext("%s: Upper Bound should be a vector"), "lsqlin");
+ error(errmsg);
+ end
+
+ if (nbConInEq) then
+ if ((size(b,1)~=1)& (size(b,2)~=1)) then
+ errmsg = msprintf(gettext("%s: Constraint Lower Bound should be a vector"), "lsqlin");
+ error(errmsg);
+ end
+ end
+
+ if (nbConEq) then
+ if (size(beq,1)~=1)& (size(beq,2)~=1) then
+ errmsg = msprintf(gettext("%s: Constraint should be a vector"), "lsqlin");
+ error(errmsg);
+ end
+ end
+
+ for i = 1:nbConInEq
+ if (b(i) == -%inf)
+ errmsg = msprintf(gettext("%s: Value of b can not be negative infinity"), "lsqlin");
+ error(errmsg);
+ end
+ end
+
+ for i = 1:nbConEq
+ if (beq(i) == -%inf)
+ errmsg = msprintf(gettext("%s: Value of beq can not be negative infinity"), "lsqlin");
+ error(errmsg);
+ end
+ end
+
+ for i = 1:nbVar
+ if(lb(i)>ub(i))
+ errmsg = msprintf(gettext("%s: Problem has inconsistent variable bounds"), "lsqlin");
+ error(errmsg);
+ end
+ end
+
+ //Converting it into Quadratic Programming Problem
+
+ H = C'*C;
+ f = [-C'*d]';
+ op_add = d'*d;
+ lb = lb';
+ ub = ub';
+ x0 = x0';
+ conMatrix = [Aeq;A];
+ nbCon = size(conMatrix,1);
+ conLB = [beq; repmat(-%inf,nbConInEq,1)]';
+ conUB = [beq;b]' ;
+ [xopt,fopt,status,iter,Zl,Zu,lmbda] = solveqp(nbVar,nbCon,H,f,conMatrix,conLB,conUB,lb,ub,x0,options);
+
+ xopt = xopt';
+ residual = d-C*xopt;
+ resnorm = residual'*residual;
+ exitflag = status;
+ output = struct("Iterations" , [], ..
+ "ConstrViolation" ,[]);
+ output.Iterations = iter;
+ output.ConstrViolation = max([0;norm(Aeq*xopt-beq, 'inf');(lb'-xopt);(xopt-ub');(A*xopt-b)]);
+ lambda = struct("lower" , [], ..
+ "upper" , [], ..
+ "eqlin" , [], ..
+ "ineqlin" , []);
+
+ lambda.lower = Zl;
+ lambda.upper = Zu;
+ lambda.eqlin = lmbda(1:nbConEq);
+ lambda.ineqlin = lmbda(nbConEq+1:nbCon);
+
+ select status
+ case 0 then
+ printf("\nOptimal Solution Found.\n");
+ case 1 then
+ printf("\nMaximum Number of Iterations Exceeded. Output may not be optimal.\n");
+ case 2 then
+ printf("\nMaximum CPU Time exceeded. Output may not be optimal.\n");
+ case 3 then
+ printf("\nStop at Tiny Step\n");
+ case 4 then
+ printf("\nSolved To Acceptable Level\n");
+ case 5 then
+ printf("\nConverged to a point of local infeasibility.\n");
+ case 6 then
+ printf("\nStopping optimization at current point as requested by user.\n");
+ case 7 then
+ printf("\nFeasible point for square problem found.\n");
+ case 8 then
+ printf("\nIterates diverging; problem might be unbounded.\n");
+ case 9 then
+ printf("\nRestoration Failed!\n");
+ case 10 then
+ printf("\nError in step computation (regularization becomes too large?)!\n");
+ case 12 then
+ printf("\nProblem has too few degrees of freedom.\n");
+ case 13 then
+ printf("\nInvalid option thrown back by Ipopt\n");
+ case 14 then
+ printf("\nNot enough memory.\n");
+ case 15 then
+ printf("\nINTERNAL ERROR: Unknown SolverReturn value - Notify Ipopt Authors.\n");
+ else
+ printf("\nInvalid status returned. Notify the Toolbox authors\n");
+ break;
+ end
+
+endfunction
diff --git a/macros/lsqlin.bin b/macros/lsqlin.bin
new file mode 100644
index 0000000..7baf7be
Binary files /dev/null and b/macros/lsqlin.bin differ
diff --git a/macros/lsqnonneg.bin b/macros/lsqnonneg.bin
new file mode 100644
index 0000000..32620d0
Binary files /dev/null and b/macros/lsqnonneg.bin differ
diff --git a/macros/matrix_linprog.bin b/macros/matrix_linprog.bin
new file mode 100644
index 0000000..e3a9db3
Binary files /dev/null and b/macros/matrix_linprog.bin differ
diff --git a/macros/mps_linprog.bin b/macros/mps_linprog.bin
new file mode 100644
index 0000000..c0d2e3e
Binary files /dev/null and b/macros/mps_linprog.bin differ
diff --git a/macros/names b/macros/names
new file mode 100644
index 0000000..36793aa
--- /dev/null
+++ b/macros/names
@@ -0,0 +1,22 @@
+Checkdims
+Checklhs
+Checkrhs
+Checktype
+Checkvector
+fgoalattain
+fminbnd
+fmincon
+fminimax
+fminunc
+linprog
+lsqcurvefit
+lsqlin
+lsqnonneg
+matrix_linprog
+mps_linprog
+qpipopt
+qpipoptmat
+setOptions
+symphony
+symphony_call
+symphonymat
diff --git a/macros/qpipopt.bin b/macros/qpipopt.bin
new file mode 100644
index 0000000..e2ba3de
Binary files /dev/null and b/macros/qpipopt.bin differ
diff --git a/macros/qpipoptmat.bin b/macros/qpipoptmat.bin
new file mode 100644
index 0000000..b9c741f
Binary files /dev/null and b/macros/qpipoptmat.bin differ
diff --git a/macros/setOptions.bin b/macros/setOptions.bin
new file mode 100644
index 0000000..8d23e73
Binary files /dev/null and b/macros/setOptions.bin differ
diff --git a/macros/symphony.bin b/macros/symphony.bin
new file mode 100644
index 0000000..2c3a43a
Binary files /dev/null and b/macros/symphony.bin differ
diff --git a/macros/symphony_call.bin b/macros/symphony_call.bin
new file mode 100644
index 0000000..5e0d5e1
Binary files /dev/null and b/macros/symphony_call.bin differ
diff --git a/macros/symphonymat.bin b/macros/symphonymat.bin
new file mode 100644
index 0000000..7dffa2f
Binary files /dev/null and b/macros/symphonymat.bin differ
diff --git a/sci_gateway/cpp/cleaner.sce b/sci_gateway/cpp/cleaner.sce
new file mode 100644
index 0000000..333775c
--- /dev/null
+++ b/sci_gateway/cpp/cleaner.sce
@@ -0,0 +1,22 @@
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// Generated by builder.sce : Please, do not edit this file
+// cleaner.sce
+// ------------------------------------------------------
+curdir = pwd();
+cleaner_path = get_file_path('cleaner.sce');
+chdir(cleaner_path);
+// ------------------------------------------------------
+if fileinfo('loader.sce') <> [] then
+ mdelete('loader.sce');
+end
+// ------------------------------------------------------
+if fileinfo('libFOSSEE_Optimization_Toolbox.so') <> [] then
+ mdelete('libFOSSEE_Optimization_Toolbox.so');
+end
+// ------------------------------------------------------
+if fileinfo('libFOSSEE_Optimization_Toolbox.c') <> [] then
+ mdelete('libFOSSEE_Optimization_Toolbox.c');
+end
+// ------------------------------------------------------
+chdir(curdir);
+// ------------------------------------------------------
diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c
new file mode 100644
index 0000000..cd53066
--- /dev/null
+++ b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.c
@@ -0,0 +1,156 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include
+#include
+#include
+#include
+static int direct_gateway(char *fname,void F(void)) { F();return 0;};
+extern Gatefunc sci_sym_open;
+extern Gatefunc sci_sym_close;
+extern Gatefunc sci_sym_isEnvActive;
+extern Gatefunc sci_sym_set_defaults;
+extern Gatefunc sci_sym_set_int_param;
+extern Gatefunc sci_sym_get_int_param;
+extern Gatefunc sci_sym_set_dbl_param;
+extern Gatefunc sci_sym_get_dbl_param;
+extern Gatefunc sci_sym_set_str_param;
+extern Gatefunc sci_sym_get_str_param;
+extern Gatefunc sci_sym_getInfinity;
+extern Gatefunc sci_sym_loadProblemBasic;
+extern Gatefunc sci_sym_loadProblem;
+extern Gatefunc sci_sym_load_mps;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_get_num_int;
+extern Gatefunc sci_sym_isContinuous;
+extern Gatefunc sci_sym_isBinary;
+extern Gatefunc sci_sym_isInteger;
+extern Gatefunc sci_sym_set_continuous;
+extern Gatefunc sci_sym_set_integer;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setVarBound;
+extern Gatefunc sci_sym_setVarBound;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setObjCoeff;
+extern Gatefunc sci_sym_getObjSense;
+extern Gatefunc sci_sym_setObjSense;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_get_dbl_arr;
+extern Gatefunc sci_sym_setConstrBound;
+extern Gatefunc sci_sym_setConstrBound;
+extern Gatefunc sci_sym_setConstrType;
+extern Gatefunc sci_sym_get_matrix;
+extern Gatefunc sci_sym_get_row_sense;
+extern Gatefunc sci_sym_addConstr;
+extern Gatefunc sci_sym_addVar;
+extern Gatefunc sci_sym_delete_cols;
+extern Gatefunc sci_sym_delete_rows;
+extern Gatefunc sci_sym_getPrimalBound;
+extern Gatefunc sci_sym_setPrimalBound;
+extern Gatefunc sci_sym_setColSoln;
+extern Gatefunc sci_sym_solve;
+extern Gatefunc sci_sym_get_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_get_solver_status;
+extern Gatefunc sci_sym_getVarSoln;
+extern Gatefunc sci_sym_getObjVal;
+extern Gatefunc sci_sym_get_iteration_count;
+extern Gatefunc sci_sym_getRowActivity;
+extern Gatefunc sci_linearprog;
+extern Gatefunc sci_rmps;
+extern Gatefunc sci_solveqp;
+extern Gatefunc sci_solveminuncp;
+extern Gatefunc sci_solveminbndp;
+extern Gatefunc sci_solveminconp;
+static GenericTable Tab[]={
+ {(Myinterfun)sci_gateway,sci_sym_open,"sym_open"},
+ {(Myinterfun)sci_gateway,sci_sym_close,"sym_close"},
+ {(Myinterfun)sci_gateway,sci_sym_isEnvActive,"sym_isEnvActive"},
+ {(Myinterfun)sci_gateway,sci_sym_set_defaults,"sym_resetParams"},
+ {(Myinterfun)sci_gateway,sci_sym_set_int_param,"sym_setIntParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_int_param,"sym_getIntParam"},
+ {(Myinterfun)sci_gateway,sci_sym_set_dbl_param,"sym_setDblParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_param,"sym_getDblParam"},
+ {(Myinterfun)sci_gateway,sci_sym_set_str_param,"sym_setStrParam"},
+ {(Myinterfun)sci_gateway,sci_sym_get_str_param,"sym_getStrParam"},
+ {(Myinterfun)sci_gateway,sci_sym_getInfinity,"sym_getInfinity"},
+ {(Myinterfun)sci_gateway,sci_sym_loadProblemBasic,"sym_loadProblemBasic"},
+ {(Myinterfun)sci_gateway,sci_sym_loadProblem,"sym_loadProblem"},
+ {(Myinterfun)sci_gateway,sci_sym_load_mps,"sym_loadMPS"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumConstr"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumVar"},
+ {(Myinterfun)sci_gateway,sci_sym_get_num_int,"sym_getNumElements"},
+ {(Myinterfun)sci_gateway,sci_sym_isContinuous,"sym_isContinuous"},
+ {(Myinterfun)sci_gateway,sci_sym_isBinary,"sym_isBinary"},
+ {(Myinterfun)sci_gateway,sci_sym_isInteger,"sym_isInteger"},
+ {(Myinterfun)sci_gateway,sci_sym_set_continuous,"sym_setContinuous"},
+ {(Myinterfun)sci_gateway,sci_sym_set_integer,"sym_setInteger"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarLower"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getVarUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarLower"},
+ {(Myinterfun)sci_gateway,sci_sym_setVarBound,"sym_setVarUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getObjCoeff"},
+ {(Myinterfun)sci_gateway,sci_sym_setObjCoeff,"sym_setObjCoeff"},
+ {(Myinterfun)sci_gateway,sci_sym_getObjSense,"sym_getObjSense"},
+ {(Myinterfun)sci_gateway,sci_sym_setObjSense,"sym_setObjSense"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getRhs"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrRange"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrLower"},
+ {(Myinterfun)sci_gateway,sci_sym_get_dbl_arr,"sym_getConstrUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrLower"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrBound,"sym_setConstrUpper"},
+ {(Myinterfun)sci_gateway,sci_sym_setConstrType,"sym_setConstrType"},
+ {(Myinterfun)sci_gateway,sci_sym_get_matrix,"sym_getMatrix"},
+ {(Myinterfun)sci_gateway,sci_sym_get_row_sense,"sym_getConstrSense"},
+ {(Myinterfun)sci_gateway,sci_sym_addConstr,"sym_addConstr"},
+ {(Myinterfun)sci_gateway,sci_sym_addVar,"sym_addVar"},
+ {(Myinterfun)sci_gateway,sci_sym_delete_cols,"sym_deleteVars"},
+ {(Myinterfun)sci_gateway,sci_sym_delete_rows,"sym_deleteConstrs"},
+ {(Myinterfun)sci_gateway,sci_sym_getPrimalBound,"sym_getPrimalBound"},
+ {(Myinterfun)sci_gateway,sci_sym_setPrimalBound,"sym_setPrimalBound"},
+ {(Myinterfun)sci_gateway,sci_sym_setColSoln,"sym_setVarSoln"},
+ {(Myinterfun)sci_gateway,sci_sym_solve,"sym_solve"},
+ {(Myinterfun)sci_gateway,sci_sym_get_status,"sym_getStatus"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isOptimal"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isInfeasible"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isAbandoned"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isIterLimitReached"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTimeLimitReached"},
+ {(Myinterfun)sci_gateway,sci_sym_get_solver_status,"sym_isTargetGapAchieved"},
+ {(Myinterfun)sci_gateway,sci_sym_getVarSoln,"sym_getVarSoln"},
+ {(Myinterfun)sci_gateway,sci_sym_getObjVal,"sym_getObjVal"},
+ {(Myinterfun)sci_gateway,sci_sym_get_iteration_count,"sym_getIterCount"},
+ {(Myinterfun)sci_gateway,sci_sym_getRowActivity,"sym_getConstrActivity"},
+ {(Myinterfun)sci_gateway,sci_linearprog,"linearprog"},
+ {(Myinterfun)sci_gateway,sci_rmps,"rmps"},
+ {(Myinterfun)sci_gateway,sci_solveqp,"solveqp"},
+ {(Myinterfun)sci_gateway,sci_solveminuncp,"solveminuncp"},
+ {(Myinterfun)sci_gateway,sci_solveminbndp,"solveminbndp"},
+ {(Myinterfun)sci_gateway,sci_solveminconp,"solveminconp"},
+};
+
+int C2F(libFOSSEE_Optimization_Toolbox)()
+{
+ Rhs = Max(0, Rhs);
+ if (*(Tab[Fin-1].f) != NULL)
+ {
+ if(pvApiCtx == NULL)
+ {
+ pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+ }
+ pvApiCtx->pstName = (char*)Tab[Fin-1].name;
+ (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);
+ }
+ return 0;
+}
+#ifdef __cplusplus
+}
+#endif
diff --git a/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so
new file mode 100755
index 0000000..9a4caf4
Binary files /dev/null and b/sci_gateway/cpp/libFOSSEE_Optimization_Toolbox.so differ
diff --git a/sci_gateway/cpp/loader.sce b/sci_gateway/cpp/loader.sce
new file mode 100644
index 0000000..1ec953f
--- /dev/null
+++ b/sci_gateway/cpp/loader.sce
@@ -0,0 +1,84 @@
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// Generated by builder.sce : Please, do not edit this file
+// ----------------------------------------------------------------------------
+//
+libFOSSEE_Optimizat_path = get_absolute_file_path('loader.sce');
+//
+// ulink previous function with same name
+[bOK, ilib] = c_link('libFOSSEE_Optimization_Toolbox');
+if bOK then
+ ulink(ilib);
+end
+//
+list_functions = [ 'sym_open';
+ 'sym_close';
+ 'sym_isEnvActive';
+ 'sym_resetParams';
+ 'sym_setIntParam';
+ 'sym_getIntParam';
+ 'sym_setDblParam';
+ 'sym_getDblParam';
+ 'sym_setStrParam';
+ 'sym_getStrParam';
+ 'sym_getInfinity';
+ 'sym_loadProblemBasic';
+ 'sym_loadProblem';
+ 'sym_loadMPS';
+ 'sym_getNumConstr';
+ 'sym_getNumVar';
+ 'sym_getNumElements';
+ 'sym_isContinuous';
+ 'sym_isBinary';
+ 'sym_isInteger';
+ 'sym_setContinuous';
+ 'sym_setInteger';
+ 'sym_getVarLower';
+ 'sym_getVarUpper';
+ 'sym_setVarLower';
+ 'sym_setVarUpper';
+ 'sym_getObjCoeff';
+ 'sym_setObjCoeff';
+ 'sym_getObjSense';
+ 'sym_setObjSense';
+ 'sym_getRhs';
+ 'sym_getConstrRange';
+ 'sym_getConstrLower';
+ 'sym_getConstrUpper';
+ 'sym_setConstrLower';
+ 'sym_setConstrUpper';
+ 'sym_setConstrType';
+ 'sym_getMatrix';
+ 'sym_getConstrSense';
+ 'sym_addConstr';
+ 'sym_addVar';
+ 'sym_deleteVars';
+ 'sym_deleteConstrs';
+ 'sym_getPrimalBound';
+ 'sym_setPrimalBound';
+ 'sym_setVarSoln';
+ 'sym_solve';
+ 'sym_getStatus';
+ 'sym_isOptimal';
+ 'sym_isInfeasible';
+ 'sym_isAbandoned';
+ 'sym_isIterLimitReached';
+ 'sym_isTimeLimitReached';
+ 'sym_isTargetGapAchieved';
+ 'sym_getVarSoln';
+ 'sym_getObjVal';
+ 'sym_getIterCount';
+ 'sym_getConstrActivity';
+ 'linearprog';
+ 'rmps';
+ 'solveqp';
+ 'solveminuncp';
+ 'solveminbndp';
+ 'solveminconp';
+];
+addinter(libFOSSEE_Optimizat_path + filesep() + 'libFOSSEE_Optimization_Toolbox' + getdynlibext(), 'libFOSSEE_Optimization_Toolbox', list_functions);
+// remove temp. variables on stack
+clear libFOSSEE_Optimizat_path;
+clear bOK;
+clear ilib;
+clear list_functions;
+// ----------------------------------------------------------------------------
diff --git a/sci_gateway/cpp/minconNLP.hpp b/sci_gateway/cpp/minconNLP.hpp
index df496ce..0dcaf26 100644
--- a/sci_gateway/cpp/minconNLP.hpp
+++ b/sci_gateway/cpp/minconNLP.hpp
@@ -24,12 +24,6 @@ class minconNLP : public TNLP
Index numConstr_; //Number of constraints
- Number flag1_; //Gradient of objective ON or OFF
-
- Number flag2_; //Hessian of objective ON or OFF
-
- Number flag3_; //Jacobian of constraints ON or OFF
-
Number nonlinCon_; //Number of non-linear constraints
Number nonlinIneqCon_; //Number of non-linear inequality constraints
@@ -101,7 +95,7 @@ class minconNLP : public TNLP
public:
/** user defined constructor */
- minconNLP(Index nV, Index nC, Number *x0 ,Number *A, Number *b, Number* Aeq, Number *beq, Index Arows, Index Acols, Index brows, Index bcols, Index Aeqrows, Index Aeqcols, Index beqrows, Index beqcols, Number* LB, Number* UB, Number nlC, Number nlIC, Number f1, Number f2, Number f3) : numVars_(nV), numConstr_(nC), varGuess_(x0), A_(A), b_(b), Aeq_(Aeq), beq_(beq), Arows_(Arows), Acols_(Acols), brows_(brows), bcols_(bcols), Aeqrows_(Aeqrows), Aeqcols_(Aeqcols), beqrows_(beqrows), beqcols_(beqcols), varLB_(LB), varUB_(UB), nonlinCon_(nlC), nonlinIneqCon_(nlIC), flag1_(f1), flag2_(f2), flag3_(f3), finalX_(0), finalZl_(0), finalZu_(0), finalGradient_(0), finalHessian_(0), finalObjVal_(1e20){ }
+ minconNLP(Index nV, Index nC, Number *x0 ,Number *A, Number *b, Number* Aeq, Number *beq, Index Arows, Index Acols, Index brows, Index bcols, Index Aeqrows, Index Aeqcols, Index beqrows, Index beqcols, Number* LB, Number* UB, Number nlC, Number nlIC) : numVars_(nV), numConstr_(nC), varGuess_(x0), A_(A), b_(b), Aeq_(Aeq), beq_(beq), Arows_(Arows), Acols_(Acols), brows_(brows), bcols_(bcols), Aeqrows_(Aeqrows), Aeqcols_(Aeqcols), beqrows_(beqrows), beqcols_(beqcols), varLB_(LB), varUB_(UB), nonlinCon_(nlC), nonlinIneqCon_(nlIC), finalX_(0), finalZl_(0), finalZu_(0), finalGradient_(0), finalHessian_(0), finalObjVal_(1e20){ }
/** default destructor */
virtual ~minconNLP();
diff --git a/sci_gateway/cpp/sci_ipoptfmincon.cpp b/sci_gateway/cpp/sci_ipoptfmincon.cpp
index 551af41..18218a5 100644
--- a/sci_gateway/cpp/sci_ipoptfmincon.cpp
+++ b/sci_gateway/cpp/sci_ipoptfmincon.cpp
@@ -30,17 +30,15 @@ int sci_solveminconp(char *fname)
{
using namespace Ipopt;
- CheckInputArgument(pvApiCtx, 20, 20);
+ CheckInputArgument(pvApiCtx, 16, 16);
CheckOutputArgument(pvApiCtx, 12, 12);
// Error management variable
SciErr sciErr;
//Function pointers, input matrix(Starting point) pointer, flag variable
- int* funptr=NULL;
- int* gradhesptr=NULL;
double *x0ptr=NULL, *lbptr=NULL, *ubptr=NULL,*Aptr=NULL, *bptr=NULL, *Aeqptr=NULL, *beqptr=NULL;
- double flag1=0,flag2=0,flag3=0,nonlinCon=0,nonlinIneqCon=0;
+ double nonlinCon=0,nonlinIneqCon=0;
// Input arguments
@@ -49,7 +47,7 @@ int sci_solveminconp(char *fname)
unsigned int temp1 = 0,temp2 = 0, iret = 0;
int x0_rows=0, x0_cols=0, lb_rows=0, lb_cols=0, ub_rows=0, ub_cols=0, A_rows=0, A_cols=0, b_rows=0, b_cols=0, Aeq_rows=0, Aeq_cols=0, beq_rows=0, beq_cols=0;
- // Output arguments
+ // Output arguments
double *fX = NULL, ObjVal=0,iteration=0,cpuTime=0,fobj_eval=0;
double dual_inf, constr_viol, complementarity, kkt_error;
double *fGrad = NULL;
@@ -61,98 +59,70 @@ int sci_solveminconp(char *fname)
int int_fobj_eval, int_constr_eval, int_fobj_grad_eval, int_constr_jac_eval, int_hess_eval;
////////// Manage the input argument //////////
-
- //Objective Function
- if(getFunctionFromScilab(1,&funptr))
- {
- return 1;
- }
-
- //Function for gradient and hessian
- if(getFunctionFromScilab(2,&gradhesptr))
- {
- return 1;
- }
-
- //x0(starting point) matrix from scilab
- if(getDoubleMatrixFromScilab(18, &x0_rows, &x0_cols, &x0ptr))
- {
- return 1;
- }
-
- //Getting number of iterations
- if(getFixedSizeDoubleMatrixInList(19,2,temp1,temp2,&max_iter))
- {
- return 1;
- }
-
- //Getting Cpu Time
- if(getFixedSizeDoubleMatrixInList(19,4,temp1,temp2,&cpu_time))
- {
- return 1;
- }
+
//Getting matrix representing linear inequality constraints
- if(getDoubleMatrixFromScilab(3, &A_rows, &A_cols, &Aptr))
+ if(getDoubleMatrixFromScilab(2, &A_rows, &A_cols, &Aptr))
{
return 1;
}
//Getting matrix representing bounds of linear inequality constraints
- if(getDoubleMatrixFromScilab(4, &b_rows, &b_cols, &bptr))
+ if(getDoubleMatrixFromScilab(3, &b_rows, &b_cols, &bptr))
{
return 1;
}
//Getting matrix representing linear equality constraints
- if(getDoubleMatrixFromScilab(5, &Aeq_rows, &Aeq_cols, &Aeqptr))
+ if(getDoubleMatrixFromScilab(4, &Aeq_rows, &Aeq_cols, &Aeqptr))
{
return 1;
}
//Getting matrix representing bounds of linear inequality constraints
- if(getDoubleMatrixFromScilab(6, &beq_rows, &beq_cols, &beqptr))
+ if(getDoubleMatrixFromScilab(5, &beq_rows, &beq_cols, &beqptr))
{
return 1;
}
//Getting matrix representing linear inequality constraints
- if(getDoubleMatrixFromScilab(7, &lb_rows, &lb_cols, &lbptr))
+ if(getDoubleMatrixFromScilab(6, &lb_rows, &lb_cols, &lbptr))
{
return 1;
}
//Getting matrix representing linear inequality constraints
- if(getDoubleMatrixFromScilab(8, &ub_rows, &ub_cols, &ubptr))
+ if(getDoubleMatrixFromScilab(7, &ub_rows, &ub_cols, &ubptr))
{
return 1;
}
//Number of non-linear constraints
- if(getDoubleFromScilab(9, &nonlinCon))
+ if(getDoubleFromScilab(8, &nonlinCon))
{
return 1;
}
//Number of non-linear inequality constraints
- if(getDoubleFromScilab(10, &nonlinIneqCon))
+ if(getDoubleFromScilab(9, &nonlinIneqCon))
{
return 1;
}
-
- //Getting the required flag variables
-
- if(getDoubleFromScilab(12, &flag1))
+
+ //x0(starting point) matrix from scilab
+ if(getDoubleMatrixFromScilab(14, &x0_rows, &x0_cols, &x0ptr))
{
return 1;
}
- if(getDoubleFromScilab(14, &flag2))
+ //Getting number of iterations
+ if(getFixedSizeDoubleMatrixInList(15,2,temp1,temp2,&max_iter))
{
return 1;
}
- if(getDoubleFromScilab(16, &flag3))
+ //Getting Cpu Time
+ if(getFixedSizeDoubleMatrixInList(15,4,temp1,temp2,&cpu_time))
{
return 1;
}
@@ -164,7 +134,7 @@ int sci_solveminconp(char *fname)
// Starting Ipopt
- SmartPtr Prob = new minconNLP(nVars, nCons, x0ptr, Aptr, bptr, Aeqptr, beqptr, A_rows, A_cols, b_rows, b_cols, Aeq_rows, Aeq_cols, beq_rows, beq_cols, lbptr, ubptr, nonlinCon, nonlinIneqCon, flag1, flag2, flag3);
+ SmartPtr Prob = new minconNLP(nVars, nCons, x0ptr, Aptr, bptr, Aeqptr, beqptr, A_rows, A_cols, b_rows, b_cols, Aeq_rows, Aeq_cols, beq_rows, beq_cols, lbptr, ubptr, nonlinCon, nonlinIneqCon);
SmartPtr app = IpoptApplicationFactory();
app->RethrowNonIpoptException(true);
diff --git a/sci_gateway/cpp/sci_minconNLP.cpp b/sci_gateway/cpp/sci_minconNLP.cpp
index 2c6d6af..600aed6 100644
--- a/sci_gateway/cpp/sci_minconNLP.cpp
+++ b/sci_gateway/cpp/sci_minconNLP.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2015 - IIT Bombay - FOSSEE
+// Copyright (C) 1815 - IIT Bombay - FOSSEE
//
// Author: R.Vidyadhar & Vignesh Kannan
// Organization: FOSSEE, IIT Bombay
@@ -49,7 +49,7 @@ bool minconNLP::get_nlp_info(Index& n, Index& m, Index& nnz_jac_g, Index& nnz_h_
m=numConstr_; // Number of constraints
nnz_jac_g = n*m; // No. of elements in Jacobian of constraints
- nnz_h_lag = n*(n+1)/2; // No. of elements in lower traingle of Hessian of the Lagrangian.
+ nnz_h_lag = n*n; // No. of elements in lower traingle of Hessian of the Lagrangian.
index_style=C_STYLE; // Index style of matrices
return true;
@@ -80,7 +80,7 @@ bool minconNLP::get_bounds_info(Index n, Number* x_l, Number* x_u, Index m, Numb
//bounds of non-linear inequality constraints
for(i=0;i 10^-6 for variable number= 2
+//at line 242 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical1.sce b/tests/general_tests/fminbnd/fminbnd_logical1.sce
new file mode 100644
index 0000000..87da61d
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical1.sce
@@ -0,0 +1,38 @@
+//Find x in R^2 such that:
+//An Example which results in exceeding Maximum Iterations
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [0,0];
+x2 = [1,2];
+options=list("MaxIter", [8], "CpuTime", [500],"TolX",[1e-6]);
+
+//Output
+//
+//Maximum Number of Iterations Exceeded. Output may not be optimal.
+// lambda =
+//
+// lower: [0.0026488,0.0024921]
+// upper: [8.873D-08,4.494D-08]
+// output =
+//
+// Iterations: 8
+// Cpu_Time: 0.012
+// Objective_Evaluation: 9
+// Dual_Infeasibility: 2.632D-12
+// Message: "Maximum Number of Iterations Exceeded. Output may not be optimal"
+// exitflag =
+//
+// 1
+// fopt =
+//
+// 0.0000033
+// xopt =
+//
+// 0.0013244
+// 0.0012460
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical2.sce b/tests/general_tests/fminbnd/fminbnd_logical2.sce
new file mode 100644
index 0000000..65ebee6
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical2.sce
@@ -0,0 +1,38 @@
+//Find x in R^2 such that:
+//An Example which results in exceeding Maximum CPU-Time
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [0,0];
+x2 = [1,2];
+options=list("MaxIter", [100], "CpuTime", [0.01],"TolX",[1e-6]);
+
+//Output
+//
+//Maximum CPU Time exceeded. Output may not be optimal.
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// output =
+//
+// Iterations: 3
+// Cpu_Time: 0.012
+// Objective_Evaluation: 4
+// Dual_Infeasibility: 9.406D-11
+// Message: "Maximum CPU Time exceeded. Output may not be optimal"
+// exitflag =
+//
+// 2
+// fopt =
+//
+// 0.
+// xopt =
+//
+// 0.0381891
+// 0.0353974
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_options1.sce b/tests/general_tests/fminbnd/fminbnd_options1.sce
new file mode 100644
index 0000000..bc98cae
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_options1.sce
@@ -0,0 +1,18 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [1,2];
+x2 = [3,4];
+options=list("MaxIter", "", "CpuTime", [500],"TolX",[1e-6]);
+
+//Error
+//fminbnd: Value for Maximum Iteration should be a Constant
+//at line 261 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
diff --git a/tests/general_tests/fminbnd/fminbnd_options2.sce b/tests/general_tests/fminbnd/fminbnd_options2.sce
new file mode 100644
index 0000000..b4a9f13
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_options2.sce
@@ -0,0 +1,18 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [1,2];
+x2 = [3,4];
+options=list("MaxIter", [1000], "CpuTime", "TolX",[1e-6]);
+
+//Error
+//fminbnd: Value for Maximum Cpu-time should be a Constant
+//at line 268 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
diff --git a/tests/general_tests/fminbnd/fminbnd_options3.sce b/tests/general_tests/fminbnd/fminbnd_options3.sce
new file mode 100644
index 0000000..5699cf9
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_options3.sce
@@ -0,0 +1,17 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [1,2];
+x2 = [3,4];
+options=list("MaxIter", [1000], "CpuTime", [100], "TolX", " ");
+
+//Error
+//fminbnd: Value for Tolerance should be a Constant
+//at line 275 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options);
+
diff --git a/tests/general_tests/fminbnd/fminbnd_ub1.sce b/tests/general_tests/fminbnd/fminbnd_ub1.sce
new file mode 100644
index 0000000..daf1487
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_ub1.sce
@@ -0,0 +1,18 @@
+//Find x in R^2 such that:
+// Check if a upper bound is of correct size
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [1,2];
+x2 = [1];
+options=list("MaxIter", [1500], "CpuTime", [500],"TolX",[1e-6]);
+
+//Error
+//fminbnd: Upper Bound and Lower Bound are not matching
+//at line 213 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_ub2.sce b/tests/general_tests/fminbnd/fminbnd_ub2.sce
new file mode 100644
index 0000000..82c446d
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_ub2.sce
@@ -0,0 +1,18 @@
+//Find x in R^2 such that:
+// Check the type of Upperbound
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x1 = [1;2];
+x2 = list(2,3);
+options=list("MaxIter", [1500], "CpuTime", [500],"TolX",[1e-6]);
+
+//Error
+//fminbnd: Expected Vector/Scalar for Upper Bound Vector (3rd Parameter)
+//at line 199 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2, options)
+
diff --git a/tests/general_tests/fmincon/fmincon_A.sce b/tests/general_tests/fmincon/fmincon_A.sce
new file mode 100644
index 0000000..dd0df48
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_A.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies coefficients of linear inequality contraints of the correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4,5,6];
+b = [7,9];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Matrix of size (No of linear inequality constraints X No of Variables) or an Empty Matrix for Linear Inequality Constraint coefficient Matrix A
+//at line 343 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_A.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_Aeq.sce b/tests/general_tests/fmincon/fmincon_Aeq.sce
new file mode 100644
index 0000000..17d8756
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_Aeq.sce
@@ -0,0 +1,22 @@
+
+// Check if a user specifies coefficients of linear equality contraints of the correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [1,4,9];
+beq = [2];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Matrix of size (No of linear equality constraints X No of Variables) or an Empty Matrix for Linear Equality Constraint coefficient Matrix Aeq
+//at line 380 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
+//at line 22 of exec file called by :
+//exec fmincon_Aeq.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
diff --git a/tests/general_tests/fmincon/fmincon_b1.sce b/tests/general_tests/fmincon/fmincon_b1.sce
new file mode 100644
index 0000000..e43a866
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_b1.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies upper bounds of linear inequality contraints in accordance with starting point dimensions and coefficient matrix of linear inequality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7,9,10,20];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Row Vector (1 X number of linear inequality constraints) for b (4th Parameter)
+//at line 368 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_b.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_b2.sce b/tests/general_tests/fmincon/fmincon_b2.sce
new file mode 100644
index 0000000..65cfc90
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_b2.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies upper bounds of linear inequality contraints in accordance with starting point dimensions and coefficient matrix of linear inequality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [];
+b = [8,3];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Row Vector (1 X number of linear inequality constraints) for b (4th Parameter)
+//at line 368 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_b.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_b3.sce b/tests/general_tests/fmincon/fmincon_b3.sce
new file mode 100644
index 0000000..982ad69
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_b3.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies upper bounds of linear inequality contraints in accordance with starting point dimensions and coefficient matrix of linear inequality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [5,8];
+b = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Non empty Row/Column Vector for b (4th Parameter) for your Inputs
+//at line 360 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_b3.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_beq1.sce b/tests/general_tests/fmincon/fmincon_beq1.sce
new file mode 100644
index 0000000..6133b77
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_beq1.sce
@@ -0,0 +1,22 @@
+
+// Check if a user specifies value of linear equality contraints in accordance with starting point dimensions and coefficient matrix of linear equality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [1,4];
+beq = [2,6];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Matrix of size (No of linear equality constraints X No of Variables) or an Empty Matrix for Linear Equality Constraint coefficient Matrix Aeq
+//at line 380 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
+//at line 22 of exec file called by :
+//exec fmincon_Aeq.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
diff --git a/tests/general_tests/fmincon/fmincon_beq2.sce b/tests/general_tests/fmincon/fmincon_beq2.sce
new file mode 100644
index 0000000..7d2af88
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_beq2.sce
@@ -0,0 +1,22 @@
+
+// Check if a user specifies value of linear equality contraints in accordance with starting point dimensions and coefficient matrix of linear equality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [2,6];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: As Linear Equality Constraint coefficient Matrix Aeq (5th parameter) is empty, beq (6th Parameter) should also be empty
+//at line 392 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
+//at line 22 of exec file called by :
+//exec fmincon_beq2.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
diff --git a/tests/general_tests/fmincon/fmincon_beq3.sce b/tests/general_tests/fmincon/fmincon_beq3.sce
new file mode 100644
index 0000000..0605fdb
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_beq3.sce
@@ -0,0 +1,22 @@
+
+// Check if a user specifies value of linear equality contraints in accordance with starting point dimensions and coefficient matrix of linear equality constraints
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [7,5];
+beq = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Non empty Row/Column Vector for beq (6th Parameter)
+//at line 397 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
+//at line 22 of exec file called by :
+//exec fmincon_beq3.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq);
diff --git a/tests/general_tests/fmincon/fmincon_cputime.sce b/tests/general_tests/fmincon/fmincon_cputime.sce
new file mode 100644
index 0000000..25e5aef
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_cputime.sce
@@ -0,0 +1,56 @@
+// Example where maxiter exceeds the preset value
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+options = list("MaxIter", [150], "CpuTime", [0.005])
+
+//Output
+//Maximum CPU Time exceeded. Output may not be optimal.
+// hessian =
+//
+// 1.79D-316 3.95D-323
+// 2.12D-314 4.34D+276
+// gradient =
+//
+// 3.96 2.97
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [0,0,0,0,0,0]
+// eqlin: 0
+// ineqnonlin: [0,0]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 0
+// Cpu_Time: 0.016
+// Objective_Evaluation: 1
+// Dual_Infeasibility: 1.4815294
+// exitflag =
+//
+// 2
+// fopt =
+//
+// 0.
+// xopt =
+//
+// 1.98
+// 1.485
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub, nlc, options)
diff --git a/tests/general_tests/fmincon/fmincon_f.sce b/tests/general_tests/fmincon/fmincon_f.sce
new file mode 100644
index 0000000..ec89f33
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_f.sce
@@ -0,0 +1,18 @@
+
+// Check if a user specifies function or not
+
+fun = [];
+x0 = [1,2,3,4,5,6];
+A = [2,4,8,9,3,5];
+b = [1,5,7,3,9,6];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected type ["function"] for input argument f at input #1, but got "constant" instead.
+//at line 56 of function Checktype called by :
+//at line 297 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 18 of exec file called by :
+//exec fmincon_f.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_lb1.sce b/tests/general_tests/fmincon/fmincon_lb1.sce
new file mode 100644
index 0000000..17b8eea
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_lb1.sce
@@ -0,0 +1,24 @@
+
+//Check if lower bound is a vector
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2,4;5,9];
+ub = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Lower Bound (7th Parameter) should be a vector
+//at line 422 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_lb1.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_lb2.sce b/tests/general_tests/fmincon/fmincon_lb2.sce
new file mode 100644
index 0000000..4420a12
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_lb2.sce
@@ -0,0 +1,24 @@
+
+//Check if lower bound is row vector of correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2,4,9];
+ub = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Row Vector (1 X number of Variables) for lower bound (7th Parameter)
+//at line 430 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_lb2.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_lb3.sce b/tests/general_tests/fmincon/fmincon_lb3.sce
new file mode 100644
index 0000000..dc0b528
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_lb3.sce
@@ -0,0 +1,24 @@
+
+//Check if lower bound is column vector of correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2;4;9];
+ub = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Column Vector (number of Variables X 1) for lower bound (7th Parameter)
+//at line 425 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_lb3.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_lb4.sce b/tests/general_tests/fmincon/fmincon_lb4.sce
new file mode 100644
index 0000000..643af5a
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_lb4.sce
@@ -0,0 +1,24 @@
+
+//Check if lower bound is not infinity
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [%inf,4];
+ub = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Value of Lower Bound can not be infinity
+//at line 462 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_lb4.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_lbub.sce b/tests/general_tests/fmincon/fmincon_lbub.sce
new file mode 100644
index 0000000..d4c42ac
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_lbub.sce
@@ -0,0 +1,24 @@
+
+//Check if upper bound is greater than lower bound by atleast 1e-6
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [1,0];
+ub = [0,1];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Difference between Upper Bound and Lower bound should be atleast > 10^6 for variable number= 1
+//at line 472 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_lbub.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_logical1.sce b/tests/general_tests/fmincon/fmincon_logical1.sce
new file mode 100644
index 0000000..9cbaf57
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical1.sce
@@ -0,0 +1,45 @@
+// Example with objective function and inequality constraints
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 2. - 7.451D-09
+// - 7.451D-09 2.
+// gradient =
+//
+// 1.0000000 1.
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [9.087D-09,2.424D-08,4.546D-09,5.596D-09,1,4.544D-09]
+// eqlin: [0x0 constant]
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 8
+// Cpu_Time: 0.112
+// Objective_Evaluation: 9
+// Dual_Infeasibility: 1.299D-11
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.5
+// xopt =
+//
+// 0.5000000
+// 0.5000000
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b)
diff --git a/tests/general_tests/fmincon/fmincon_logical10.sce b/tests/general_tests/fmincon/fmincon_logical10.sce
new file mode 100644
index 0000000..45ffdf3
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical10.sce
@@ -0,0 +1,66 @@
+//Example where user provides hessian
+
+function y=f(x)
+y=x(1)*x(2)+x(2)*x(3);
+endfunction
+//Starting point, linear constraints and variable bounds
+x0=[0.1 , 0.1 , 0.1];
+A=[];
+b=[];
+Aeq=[];
+beq=[];
+lb=[];
+ub=[];
+//Nonlinear constraints
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + x(3)^2 - 2 , x(1)^2 + x(2)^2 + x(3)^2 - 10];
+ceq = [];
+endfunction
+
+//Hessian of the Lagrange Function
+function y= lHess(x,obj,lambda)
+y= obj*[0,1,0;1,0,1;0,1,0] + lambda(1)*[2,0,0;0,-2,0;0,0,2] + lambda(2)*[2,0,0;0,2,0;0,0,2]
+endfunction
+
+//Options
+options=list("MaxIter", [1500], "CpuTime", [500], "Hessian", lHess);
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 1.4142136 1.72D-322 2.12D-314
+// 1. 0. 5.82D+252
+// 1. 1.4142136 1.
+// gradient =
+//
+// 2.236068 - 3.1622776 2.236068
+// lambda =
+//
+// lower: [0,0,0]
+// upper: [0,0,0]
+// ineqlin: [0x0 constant]
+// eqlin: [0x0 constant]
+// ineqnonlin: [4.545D-09,0.7071068]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 23
+// Cpu_Time: 0.164
+// Objective_Evaluation: 24
+// Dual_Infeasibility: 6.124D-08
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// - 7.0710678
+// xopt =
+//
+// - 1.5811388
+// 2.236068
+// - 1.5811388
+
+//Calling Ipopt
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] =fmincon(f, x0,A,b,Aeq,beq,lb,ub,nlc,options)
diff --git a/tests/general_tests/fmincon/fmincon_logical11.sce b/tests/general_tests/fmincon/fmincon_logical11.sce
new file mode 100644
index 0000000..0fe17ee
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical11.sce
@@ -0,0 +1,46 @@
+// Example with objective function using log functions
+
+function y=fun(x)
+y=log(x(1)+x(2));
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// - 1.0000001 3.95D-323
+// - 1. - 1.
+// gradient =
+//
+// 1. 1.
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [9.091D-09,1.384D-08,3.304D-09,4.768D-09,1,7.281D-09]
+// eqlin: [0x0 constant]
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 13
+// Cpu_Time: 0.228
+// Objective_Evaluation: 14
+// Dual_Infeasibility: 3.040D-09
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// - 9.091D-10
+// xopt =
+//
+// 0.1243037
+// 0.8756963
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b)
diff --git a/tests/general_tests/fmincon/fmincon_logical2.sce b/tests/general_tests/fmincon/fmincon_logical2.sce
new file mode 100644
index 0000000..94e91f1
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical2.sce
@@ -0,0 +1,47 @@
+// Example with objective function, equality and inequality constraints
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [1.5]
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 2. 0.
+// 0. 2.
+// gradient =
+//
+// 1.5 0.5000000
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [9.089D-09,4.842D-08,6.059D-09,6.324D-09,2.0000001,3.637D-09]
+// eqlin: 0.5000000
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 8
+// Cpu_Time: 0.092
+// Objective_Evaluation: 9
+// Dual_Infeasibility: 1.869D-11
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.6250000
+// xopt =
+//
+// 0.7500000
+// 0.25
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b,Aeq,beq)
diff --git a/tests/general_tests/fmincon/fmincon_logical3.sce b/tests/general_tests/fmincon/fmincon_logical3.sce
new file mode 100644
index 0000000..9c56f7b
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical3.sce
@@ -0,0 +1,49 @@
+// Example with objective function, equality, inequality constraints and variable bounds
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 2. 0.
+// 0. 2.
+// gradient =
+//
+// 0.9999999 3.
+// lambda =
+//
+// lower: [1.820D-08,6.060D-09]
+// upper: [6.059D-09,0.7267088]
+// ineqlin: [0.3633544,7.251D-08,3.030D-09,3.463D-09,9.093D-09,9.096D-09]
+// eqlin: -1.3633544
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 21
+// Cpu_Time: 0.2
+// Objective_Evaluation: 26
+// Dual_Infeasibility: 9.075D-11
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 2.5
+// xopt =
+//
+// 0.5000000
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub)
diff --git a/tests/general_tests/fmincon/fmincon_logical4.sce b/tests/general_tests/fmincon/fmincon_logical4.sce
new file mode 100644
index 0000000..31221c8
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical4.sce
@@ -0,0 +1,54 @@
+// Example with objective function, equality, inequality constraints, variable bounds and non linear function
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 3970695.7 3.311D-10
+// 3.311D-10 3970695.5
+// gradient =
+//
+// 1.0000000 3.
+// lambda =
+//
+// lower: [1.818D-08,6.061D-09]
+// upper: [6.061D-09,0.7272728]
+// ineqlin: [0.3636363,7.273D-08,3.030D-09,3.463D-09,9.091D-09,9.091D-09]
+// eqlin: -2.2698905
+// ineqnonlin: [6.061D-09,0.9062541]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 20
+// Cpu_Time: 0.4
+// Objective_Evaluation: 23
+// Dual_Infeasibility: 5.171D-09
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 2.5
+// xopt =
+//
+// 0.5000000
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub,nlc)
diff --git a/tests/general_tests/fmincon/fmincon_logical5.sce b/tests/general_tests/fmincon/fmincon_logical5.sce
new file mode 100644
index 0000000..dbba29a
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical5.sce
@@ -0,0 +1,56 @@
+// Example with objective function, equality, inequality constraints, variable bounds, non linear function and options
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+options = list("MaxIter", [1500], "CpuTime", [500])
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 3970695.7 3.311D-10
+// 3.311D-10 3970695.5
+// gradient =
+//
+// 1.0000000 3.
+// lambda =
+//
+// lower: [1.818D-08,6.061D-09]
+// upper: [6.061D-09,0.7272728]
+// ineqlin: [0.3636363,7.273D-08,3.030D-09,3.463D-09,9.091D-09,9.091D-09]
+// eqlin: -2.2698905
+// ineqnonlin: [6.061D-09,0.9062541]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 20
+// Cpu_Time: 0.4
+// Objective_Evaluation: 23
+// Dual_Infeasibility: 5.171D-09
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 2.5
+// xopt =
+//
+// 0.5000000
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub, nlc, options)
diff --git a/tests/general_tests/fmincon/fmincon_logical6.sce b/tests/general_tests/fmincon/fmincon_logical6.sce
new file mode 100644
index 0000000..b99cca1
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical6.sce
@@ -0,0 +1,45 @@
+// Example with objective function using sinusoidal functions
+
+function y=fun(x)
+y=sin(x(1))+cos(x(2));
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 0.2129952 0.
+// 0. 0.2129198
+// gradient =
+//
+// 0.9770613 - 0.9770613
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [2.270D-08,1.202D-08,2.272D-09,3.316D-09,1.571D-08,0.9770613]
+// eqlin: [0x0 constant]
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 12
+// Cpu_Time: 0.132
+// Objective_Evaluation: 15
+// Dual_Infeasibility: 7.674D-10
+// exitflag =
+//
+// 0
+// fopt =
+//
+// - 0.4259168
+// xopt =
+//
+// - 0.2146019
+// 1.7853981
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b)
diff --git a/tests/general_tests/fmincon/fmincon_logical7.sce b/tests/general_tests/fmincon/fmincon_logical7.sce
new file mode 100644
index 0000000..48d83b4
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical7.sce
@@ -0,0 +1,45 @@
+// Example with objective function using exponential input
+
+function y=fun(x)
+y=exp(x(2)*x(1));
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4];
+b=[2;1];
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 0.0000010 - 0.0000007
+// - 0.0000007 0.0000005
+// gradient =
+//
+// 7.127D-08 - 5.690D-08
+// lambda =
+//
+// lower: [0,0]
+// upper: [0,0]
+// ineqlin: [6.963D-09,2.501D-09]
+// eqlin: [0x0 constant]
+// ineqnonlin: [0x0 constant]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 15
+// Cpu_Time: 0.132
+// Objective_Evaluation: 16
+// Dual_Infeasibility: 8.073D-08
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 1.500D-08
+// xopt =
+//
+// - 3.7925137
+// 4.7501487
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b)
diff --git a/tests/general_tests/fmincon/fmincon_logical8.sce b/tests/general_tests/fmincon/fmincon_logical8.sce
new file mode 100644
index 0000000..7e24211
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical8.sce
@@ -0,0 +1,60 @@
+// Example where user provides gradient of the objective function
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+function y= fGrad(x)
+y= [2*x(1),2*x(2)];
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+options = list("MaxIter", [150], "CpuTime", [500], "GradObj", fGrad)
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 3970695.6 3.311D-10
+// 3.311D-10 3970695.4
+// gradient =
+//
+// 1.0000000 3.
+// lambda =
+//
+// lower: [1.818D-08,6.061D-09]
+// upper: [6.061D-09,0.7272728]
+// ineqlin: [0.3636363,7.273D-08,3.030D-09,3.463D-09,9.091D-09,9.091D-09]
+// eqlin: -2.2698905
+// ineqnonlin: [6.061D-09,0.9062542]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 20
+// Cpu_Time: 0.852
+// Objective_Evaluation: 23
+// Dual_Infeasibility: 1.884D-09
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 2.5
+// xopt =
+//
+// 0.5000000
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub, nlc, options)
diff --git a/tests/general_tests/fmincon/fmincon_logical9.sce b/tests/general_tests/fmincon/fmincon_logical9.sce
new file mode 100644
index 0000000..129601b
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_logical9.sce
@@ -0,0 +1,63 @@
+// Example where user provides gradient of the constraints
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+//Gradient of Non-Linear Constraints
+function [cg,ceqg] = cGrad(x)
+cg=[2*x(1) , -2*x(2); 2*x(1) , 2*x(2)];
+ceqg=[];
+endfunction
+
+options = list("MaxIter", [150], "CpuTime", [500], "GradCon", cGrad)
+
+//Output
+//Optimal Solution Found.
+// hessian =
+//
+// 3353468.3 3.95D-323
+// 0. 0.
+// gradient =
+//
+// 1.0000000 3.
+// lambda =
+//
+// lower: [1.818D-08,6.061D-09]
+// upper: [6.061D-09,0.6917463]
+// ineqlin: [0.3458731,7.273D-08,3.030D-09,3.463D-09,9.091D-09,9.091D-09]
+// eqlin: -2.2520096
+// ineqnonlin: [6.061D-09,0.9061364]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 20
+// Cpu_Time: 0.34
+// Objective_Evaluation: 23
+// Dual_Infeasibility: 2.793D-09
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 2.5
+// xopt =
+//
+// 0.5000000
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub, nlc, options)
diff --git a/tests/general_tests/fmincon/fmincon_maxiter.sce b/tests/general_tests/fmincon/fmincon_maxiter.sce
new file mode 100644
index 0000000..57d46b6
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_maxiter.sce
@@ -0,0 +1,56 @@
+// Example where maxiter exceeds the preset value
+
+function y=fun(x)
+y=x(1)*x(1)+x(2)*x(2);
+endfunction
+
+x0 = [1,2];
+A=[1,1 ; 1,1/4 ; 1,-1 ; -1/4,-1 ; -1,-1 ; -1,1];
+b=[2;1;2;1;-1;2];
+Aeq = [1,3]
+beq= [5]
+lb = [0 0]
+ub = [2 1.5]
+
+function [c,ceq]=nlc(x)
+c = [x(1)^2 - x(2)^2 + 0.5 , x(1)^2 + x(2)^2 - 2.5];
+ceq = [];
+endfunction
+
+options = list("MaxIter", [15], "CpuTime", [500])
+
+//Output
+//Maximum Number of Iterations Exceeded. Output may not be optimal.
+// hessian =
+//
+// 335.44736 0.
+// 0. 335.18088
+// gradient =
+//
+// 1.0000122 2.9999999
+// lambda =
+//
+// lower: [0.1999999,0.0666667]
+// upper: [0.0666667,1803365.5]
+// ineqlin: [486161.41,0.7135096,0.0332561,0.0381089,0.1000596,0.1000605]
+// eqlin: -486461.97
+// ineqnonlin: [0.0666348,299.08034]
+// eqnonlin: [0x0 constant]
+// output =
+//
+// Iterations: 15
+// Cpu_Time: 0.252
+// Objective_Evaluation: 17
+// Dual_Infeasibility: 831041.12
+// exitflag =
+//
+// 1
+// fopt =
+//
+// 2.500006
+// xopt =
+//
+// 0.5000061
+// 1.5
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub, nlc, options)
diff --git a/tests/general_tests/fmincon/fmincon_ub1.sce b/tests/general_tests/fmincon/fmincon_ub1.sce
new file mode 100644
index 0000000..acbe99a
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_ub1.sce
@@ -0,0 +1,24 @@
+
+//Check if upper bound is a vector
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2,4];
+ub = [3,4;7,2];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Upper Bound (8th Parameter) should be a vector
+//at line 445 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_ub1.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_ub2.sce b/tests/general_tests/fmincon/fmincon_ub2.sce
new file mode 100644
index 0000000..dc4d790
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_ub2.sce
@@ -0,0 +1,24 @@
+
+//Check if upper bound is row vector of correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2,4];
+ub = [3,4,7];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Row Vector (1 X number of Variables) for upper bound (8th Parameter)
+//at line 453 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_ub2.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_ub3.sce b/tests/general_tests/fmincon/fmincon_ub3.sce
new file mode 100644
index 0000000..034abc7
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_ub3.sce
@@ -0,0 +1,24 @@
+
+//Check if lower bound is column vector of correct dimensions
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [2,4];
+ub = [3;4;7];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Column Vector (number of Variables X 1) for upper bound (8th Parameter)
+//at line 448 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_ub3.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_ub4.sce b/tests/general_tests/fmincon/fmincon_ub4.sce
new file mode 100644
index 0000000..26dc579
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_ub4.sce
@@ -0,0 +1,24 @@
+
+//Check if upper bound is not -infinity
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1,2];
+A = [3,4];
+b = [7];
+Aeq = [];
+beq = [];
+lb = [];
+ub = [-%inf,6];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Value of Upper Bound can not be negative infinity
+//at line 467 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
+//at line 24 of exec file called by :
+//exec fmincon_ub4.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b, Aeq, beq, lb, ub);
diff --git a/tests/general_tests/fmincon/fmincon_x0a.sce b/tests/general_tests/fmincon/fmincon_x0a.sce
new file mode 100644
index 0000000..68bf5f1
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_x0a.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies a starting point or not
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [];
+A = [3,4];
+b = [7,9];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Expected Row Vector or Column Vector for x0 (Starting Point) or Starting Point cannot be Empty
+//at line 305 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_x0a.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fmincon/fmincon_x0b.sce b/tests/general_tests/fmincon/fmincon_x0b.sce
new file mode 100644
index 0000000..2b72f92
--- /dev/null
+++ b/tests/general_tests/fmincon/fmincon_x0b.sce
@@ -0,0 +1,20 @@
+
+// Check if a user specifies a starting point of the correct dimensions with respect to the objective function
+
+function y=fun(x)
+y=x(1)+x(2);
+endfunction
+
+x0 = [1];
+A = [3,4];
+b = [7,9];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fmincon: Objective function and x0 did not match
+//at line 318 of function fmincon called by :
+//[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
+//at line 20 of exec file called by :
+//exec fmincon_x0b.sce
+
+[xopt,fopt,exitflag,output,lambda,gradient,hessian] = fmincon (fun, x0, A, b);
diff --git a/tests/general_tests/fminunc/fminunc_f.sce b/tests/general_tests/fminunc/fminunc_f.sce
new file mode 100644
index 0000000..7fd0e2c
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_f.sce
@@ -0,0 +1,15 @@
+//Find x in R^6 such that:
+// Check if a user specifies function or not
+
+fun = [];
+x0 = [1,2,3,4,5,6];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fminbnd: Expected function for Objective (1st Parameter)
+//at line 150 of function fminbnd called by :
+//[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, lb, ub, options);
+
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
diff --git a/tests/general_tests/fminunc/fminunc_gradient1.sce b/tests/general_tests/fminunc/fminunc_gradient1.sce
new file mode 100644
index 0000000..214ff89
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_gradient1.sce
@@ -0,0 +1,15 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", "OFn", "Hessian", "OFF");
+
+//Error
+//fminunc: Unrecognized String [OFn] entered for the option- Gradient.
+//at line 278 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_gradient2.sce b/tests/general_tests/fminunc/fminunc_gradient2.sce
new file mode 100644
index 0000000..5c1c3d3
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_gradient2.sce
@@ -0,0 +1,15 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", "", "Hessian", "OFF");
+
+//Error
+//fminunc: Unrecognized String [] entered for the option- Gradient.
+//at line 278 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_gradient3.sce b/tests/general_tests/fminunc/fminunc_gradient3.sce
new file mode 100644
index 0000000..f35f7f1
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_gradient3.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+grad = [];
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", grad, "Hessian", "OFF");
+
+//Error
+//fminunc: Expected function for Gradient of Objective
+//at line 306 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_gradient4.sce b/tests/general_tests/fminunc/fminunc_gradient4.sce
new file mode 100644
index 0000000..3a6a716
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_gradient4.sce
@@ -0,0 +1,20 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+function y = grad(x)
+ y=[2*x(1)];
+endfunction
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", grad, "Hessian", "OFF");
+
+//Error
+//fminunc: Expected function for Hessian of Objective
+//at line 313 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+//at line 20 of exec file called by :
+//exec fminunc_gradient4.sce
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_hessian1.sce b/tests/general_tests/fminunc/fminunc_hessian1.sce
new file mode 100644
index 0000000..a8ba79b
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_hessian1.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options for hessian
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", "OFF", "Hessian", "OFn");
+
+//Error
+//fminunc: Unrecognized String [OFn] entered for the option- Hessian.
+//at line 290 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_hessian2.sce b/tests/general_tests/fminunc/fminunc_hessian2.sce
new file mode 100644
index 0000000..99fd6c1
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_hessian2.sce
@@ -0,0 +1,15 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options for hessian
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", "OFf", "Hessian", "");
+
+//Error
+//fminunc: Unrecognized String [] entered for the option- Hessian.
+//at line 290 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_hessian3.sce b/tests/general_tests/fminunc/fminunc_hessian3.sce
new file mode 100644
index 0000000..7a1e625
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_hessian3.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options for hessian
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+hess = [];
+options=list("MaxIter", [1000], "CpuTime", [100], "Hessian", hess);
+
+//Error
+//fminunc: Expected function for Hessian of Objective
+//at line 341 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_hessian4.sce b/tests/general_tests/fminunc/fminunc_hessian4.sce
new file mode 100644
index 0000000..47ce1c4
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_hessian4.sce
@@ -0,0 +1,19 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options for hessian
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+function y = hess(x)
+ y=[2,0];
+endfunction
+options=list("MaxIter", [1000], "CpuTime", [100], "Gradient", "OFF", "Hessian", hess);
+
+//Error
+//fminunc: Wrong Input for Objective Hessian function(3rd Parameter)---->Symmetric Matrix function of size [2 X 2] is Expected
+//at line 353 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
diff --git a/tests/general_tests/fminunc/fminunc_logical1.sce b/tests/general_tests/fminunc/fminunc_logical1.sce
new file mode 100644
index 0000000..54c4d7f
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_logical1.sce
@@ -0,0 +1,35 @@
+//Find x in R^2 such that:
+// An Unbounded Example
+
+function y = fun(x)
+ y = -(x(1)^2 + x(2)^2);
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Output
+//
+//Iterates diverging; problem might be unbounded.
+// hessian =
+//
+// []
+// gradient =
+//
+// []
+// output =
+//
+// Iterations: 65
+// Cpu_Time: 0.112
+// Message: "Iterates diverging; problem might be unbounded"
+// exitflag =
+//
+// 8
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options)
+
diff --git a/tests/general_tests/fminunc/fminunc_logical2.sce b/tests/general_tests/fminunc/fminunc_logical2.sce
new file mode 100644
index 0000000..27d6cdd
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_logical2.sce
@@ -0,0 +1,35 @@
+//Find x in R^2 such that:
+// An Infeasible Example (Solver will show this as "Regularization becomes too large")
+
+function y = fun(x)
+ y = log(x);
+endfunction
+x0 = [1];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Output
+//
+//Error in step computation (regularization becomes too large?)!
+// hessian =
+//
+// []
+// gradient =
+//
+// []
+// output =
+//
+// Iterations: 26
+// Cpu_Time: 0.044
+// Message: "Error in step computation (regularization becomes too large?)!"
+// exitflag =
+//
+// 10
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options)
+
diff --git a/tests/general_tests/fminunc/fminunc_logical3.sce b/tests/general_tests/fminunc/fminunc_logical3.sce
new file mode 100644
index 0000000..15ea3ad
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_logical3.sce
@@ -0,0 +1,42 @@
+//Find x in R^2 such that:
+// An Example which results in exceeding Maximum Iterations
+
+function y = fun(x)
+ y = (x(1)-x(2))^2 + x(1);
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Output
+//
+//Maximum Number of Iterations Exceeded. Output may not be optimal.
+// hessian =
+//
+// 2. - 2.
+// - 2. 2.
+// gradient =
+//
+// 0.9999885 0.
+// output =
+//
+// Iterations: 1000
+// Cpu_Time: 2.112
+// Objective_Evaluation: 1001
+// Dual_Infeasibility: 0.9999885
+// Message: "Maximum Number of Iterations Exceeded. Output may not be optimal"
+// exitflag =
+//
+// 1
+// fopt =
+//
+// - 1.050D+18
+// xopt =
+//
+// 10^18 *
+//
+// - 1.0497354
+// - 1.0497354
+
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options)
+
diff --git a/tests/general_tests/fminunc/fminunc_logical4.sce b/tests/general_tests/fminunc/fminunc_logical4.sce
new file mode 100644
index 0000000..60d75c5
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_logical4.sce
@@ -0,0 +1,42 @@
+//Find x in R^2 such that:
+// An Example which results in exceeding Maximum CPU-Time
+
+function y = fun(x)
+ y = (x(1)-x(2))^2 + x(1);
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", [1.5], "Gradient", "OFF", "Hessian", "OFF");
+
+//Output
+//
+//Maximum CPU Time exceeded. Output may not be optimal.
+// hessian =
+//
+// 2. - 2.
+// - 2. 2.
+// gradient =
+//
+// 0.9998408 0.
+// output =
+//
+// Iterations: 732
+// Cpu_Time: 1.504
+// Objective_Evaluation: 733
+// Dual_Infeasibility: 0.9998408
+// Message: "Maximum CPU Time exceeded. Output may not be optimal"
+// exitflag =
+//
+// 2
+// fopt =
+//
+// 0.
+// xopt =
+//
+// 10^17 *
+//
+// - 7.6897384
+// - 7.6897384
+
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options)
+
diff --git a/tests/general_tests/fminunc/fminunc_options1.sce b/tests/general_tests/fminunc/fminunc_options1.sce
new file mode 100644
index 0000000..eb939d5
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_options1.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", "", "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fminunc: Value for Maximum Iteration should be a Constant
+//at line 261 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
diff --git a/tests/general_tests/fminunc/fminunc_options2.sce b/tests/general_tests/fminunc/fminunc_options2.sce
new file mode 100644
index 0000000..1cf09ef
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_options2.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct options or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1,2];
+options=list("MaxIter", [1000], "CpuTime", , "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fminunc: Value for Maximum Cpu-time should be a Constant
+//at line 268 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
diff --git a/tests/general_tests/fminunc/fminunc_x0a.sce b/tests/general_tests/fminunc/fminunc_x0a.sce
new file mode 100644
index 0000000..e71b455
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_x0a.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct initial guess or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fminunc: Expected Row Vector or Column Vector for x0 (Initial Value)
+//at line 160 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
diff --git a/tests/general_tests/fminunc/fminunc_x0b.sce b/tests/general_tests/fminunc/fminunc_x0b.sce
new file mode 100644
index 0000000..a08b458
--- /dev/null
+++ b/tests/general_tests/fminunc/fminunc_x0b.sce
@@ -0,0 +1,16 @@
+//Find x in R^2 such that:
+// Check if a user specifies correct initial guess or not
+
+function y = fun(x)
+ y = x(1)^2 + x(2)^2;
+endfunction
+x0 = [1];
+options=list("MaxIter", [1500], "CpuTime", [500], "Gradient", "OFF", "Hessian", "OFF");
+
+//Error
+//fminunc: Objective function and x0 did not match
+//at line 174 of function fminunc called by :
+//[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
+[xopt,fopt,exitflag,output,gradient,hessian] = fminunc (fun, x0, options);
+
diff --git a/thirdparty/linux/lib/x64/libCgl.la b/thirdparty/linux/lib/x64/libCgl.la
deleted file mode 100755
index 77507e6..0000000
--- a/thirdparty/linux/lib/x64/libCgl.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libCgl.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libCgl.so.1'
-
-# Names of this library.
-library_names='libCgl.so.1.9.4 libCgl.so.1 libCgl.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsiClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClpSolver.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsi.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libCgl.
-current=10
-age=9
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libClp.la b/thirdparty/linux/lib/x64/libClp.la
deleted file mode 100755
index 20c88dd..0000000
--- a/thirdparty/linux/lib/x64/libClp.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libClp.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libClp.so.1'
-
-# Names of this library.
-library_names='libClp.so.1.13.6 libClp.so.1 libClp.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libClp.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libClpSolver.la b/thirdparty/linux/lib/x64/libClpSolver.la
deleted file mode 100755
index 6d24542..0000000
--- a/thirdparty/linux/lib/x64/libClpSolver.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libClpSolver.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libClpSolver.so.1'
-
-# Names of this library.
-library_names='libClpSolver.so.1.13.6 libClpSolver.so.1 libClpSolver.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libClpSolver.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libCoinUtils.la b/thirdparty/linux/lib/x64/libCoinUtils.la
deleted file mode 100755
index 5760a8d..0000000
--- a/thirdparty/linux/lib/x64/libCoinUtils.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libCoinUtils.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libCoinUtils.so.3'
-
-# Names of this library.
-library_names='libCoinUtils.so.3.10.6 libCoinUtils.so.3 libCoinUtils.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for libCoinUtils.
-current=13
-age=10
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libOsi.la b/thirdparty/linux/lib/x64/libOsi.la
deleted file mode 100755
index 9f9aa3d..0000000
--- a/thirdparty/linux/lib/x64/libOsi.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsi.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsi.so.1'
-
-# Names of this library.
-library_names='libOsi.so.1.12.4 libOsi.so.1 libOsi.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libOsi.
-current=13
-age=12
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libOsiClp.la b/thirdparty/linux/lib/x64/libOsiClp.la
deleted file mode 100755
index 55f6198..0000000
--- a/thirdparty/linux/lib/x64/libOsiClp.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiClp.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiClp.so.1'
-
-# Names of this library.
-library_names='libOsiClp.so.1.13.6 libOsiClp.so.1 libOsiClp.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsi.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libOsiClp.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libOsiCommonTests.la b/thirdparty/linux/lib/x64/libOsiCommonTests.la
deleted file mode 100755
index 5df7087..0000000
--- a/thirdparty/linux/lib/x64/libOsiCommonTests.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiCommonTests.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiCommonTests.so.1'
-
-# Names of this library.
-library_names='libOsiCommonTests.so.1.12.4 libOsiCommonTests.so.1 libOsiCommonTests.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsi.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libOsiCommonTests.
-current=13
-age=12
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libOsiSym.la b/thirdparty/linux/lib/x64/libOsiSym.la
deleted file mode 100755
index a55abff..0000000
--- a/thirdparty/linux/lib/x64/libOsiSym.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiSym.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiSym.so.3'
-
-# Names of this library.
-library_names='libOsiSym.so.3.6.10 libOsiSym.so.3 libOsiSym.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libSym.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCgl.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsiClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClpSolver.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsi.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libOsiSym.
-current=9
-age=6
-revision=10
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libSym.la b/thirdparty/linux/lib/x64/libSym.la
deleted file mode 100755
index ba9cc4b..0000000
--- a/thirdparty/linux/lib/x64/libSym.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libSym.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libSym.so.3'
-
-# Names of this library.
-library_names='libSym.so.3.6.10 libSym.so.3 libSym.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCgl.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsiClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClpSolver.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libClp.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libOsi.la /home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib/libCoinUtils.la'
-
-# Version information for libSym.
-current=9
-age=6
-revision=10
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/symphony_work/SYMPHONY-5.6.10/build-debug/lib'
diff --git a/thirdparty/linux/lib/x64/libcoinblas.la b/thirdparty/linux/lib/x64/libcoinblas.la
deleted file mode 100755
index 10b255e..0000000
--- a/thirdparty/linux/lib/x64/libcoinblas.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinblas.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinblas.so.1'
-
-# Names of this library.
-library_names='libcoinblas.so.1.4.4 libcoinblas.so.1 libcoinblas.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for libcoinblas.
-current=5
-age=4
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/Downloads/Ipopt-3.12.4/build/lib'
diff --git a/thirdparty/linux/lib/x64/libcoinlapack.la b/thirdparty/linux/lib/x64/libcoinlapack.la
deleted file mode 100755
index 8ba91df..0000000
--- a/thirdparty/linux/lib/x64/libcoinlapack.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinlapack.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinlapack.so.1'
-
-# Names of this library.
-library_names='libcoinlapack.so.1.5.4 libcoinlapack.so.1 libcoinlapack.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/Downloads/Ipopt-3.12.4/build/lib/libcoinblas.la -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -lgfortran -lm -lquadmath'
-
-# Version information for libcoinlapack.
-current=6
-age=5
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/Downloads/Ipopt-3.12.4/build/lib'
diff --git a/thirdparty/linux/lib/x64/libcoinmumps.la b/thirdparty/linux/lib/x64/libcoinmumps.la
deleted file mode 100755
index e64fd30..0000000
--- a/thirdparty/linux/lib/x64/libcoinmumps.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinmumps.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinmumps.so.1'
-
-# Names of this library.
-library_names='libcoinmumps.so.1.5.4 libcoinmumps.so.1 libcoinmumps.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/Downloads/Ipopt-3.12.4/build/lib/libcoinblas.la -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.8/../../.. -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lgfortran -lm -lquadmath'
-
-# Version information for libcoinmumps.
-current=6
-age=5
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/Downloads/Ipopt-3.12.4/build/lib'
diff --git a/thirdparty/linux/lib/x64/libipopt.la b/thirdparty/linux/lib/x64/libipopt.la
deleted file mode 100755
index aebec3d..0000000
--- a/thirdparty/linux/lib/x64/libipopt.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libipopt.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libipopt.so.1'
-
-# Names of this library.
-library_names='libipopt.so.1.10.4 libipopt.so.1 libipopt.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/harpreet/Downloads/Ipopt-3.12.4/build/lib/libcoinmumps.la /home/harpreet/Downloads/Ipopt-3.12.4/build/lib/libcoinlapack.la /home/harpreet/Downloads/Ipopt-3.12.4/build/lib/libcoinblas.la -lgfortran -lquadmath -ldl'
-
-# Version information for libipopt.
-current=11
-age=10
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/harpreet/Downloads/Ipopt-3.12.4/build/lib'
diff --git a/thirdparty/linux/lib/x86/libCgl.la b/thirdparty/linux/lib/x86/libCgl.la
deleted file mode 100755
index 9b87221..0000000
--- a/thirdparty/linux/lib/x86/libCgl.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libCgl.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libCgl.so.1'
-
-# Names of this library.
-library_names='libCgl.so.1.9.4 libCgl.so.1 libCgl.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libOsiClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClpSolver.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libOsi.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libCgl.
-current=10
-age=9
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libClp.la b/thirdparty/linux/lib/x86/libClp.la
deleted file mode 100755
index 41043c0..0000000
--- a/thirdparty/linux/lib/x86/libClp.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libClp.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libClp.so.1'
-
-# Names of this library.
-library_names='libClp.so.1.13.6 libClp.so.1 libClp.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libClp.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libClpSolver.la b/thirdparty/linux/lib/x86/libClpSolver.la
deleted file mode 100755
index c6ea9d2..0000000
--- a/thirdparty/linux/lib/x86/libClpSolver.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libClpSolver.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libClpSolver.so.1'
-
-# Names of this library.
-library_names='libClpSolver.so.1.13.6 libClpSolver.so.1 libClpSolver.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libClpSolver.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libCoinUtils.la b/thirdparty/linux/lib/x86/libCoinUtils.la
deleted file mode 100755
index 7c63c02..0000000
--- a/thirdparty/linux/lib/x86/libCoinUtils.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libCoinUtils.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libCoinUtils.so.3'
-
-# Names of this library.
-library_names='libCoinUtils.so.3.10.6 libCoinUtils.so.3 libCoinUtils.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for libCoinUtils.
-current=13
-age=10
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libOsi.la b/thirdparty/linux/lib/x86/libOsi.la
deleted file mode 100755
index 7d0e442..0000000
--- a/thirdparty/linux/lib/x86/libOsi.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsi.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsi.so.1'
-
-# Names of this library.
-library_names='libOsi.so.1.12.4 libOsi.so.1 libOsi.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libOsi.
-current=13
-age=12
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libOsiClp.la b/thirdparty/linux/lib/x86/libOsiClp.la
deleted file mode 100755
index ac3e475..0000000
--- a/thirdparty/linux/lib/x86/libOsiClp.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiClp.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiClp.so.1'
-
-# Names of this library.
-library_names='libOsiClp.so.1.13.6 libOsiClp.so.1 libOsiClp.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libOsi.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libOsiClp.
-current=14
-age=13
-revision=6
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libOsiCommonTests.la b/thirdparty/linux/lib/x86/libOsiCommonTests.la
deleted file mode 100755
index 2e4e4e3..0000000
--- a/thirdparty/linux/lib/x86/libOsiCommonTests.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiCommonTests.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiCommonTests.so.1'
-
-# Names of this library.
-library_names='libOsiCommonTests.so.1.12.4 libOsiCommonTests.so.1 libOsiCommonTests.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libOsi.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libOsiCommonTests.
-current=13
-age=12
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libOsiSym.la b/thirdparty/linux/lib/x86/libOsiSym.la
deleted file mode 100755
index d520e52..0000000
--- a/thirdparty/linux/lib/x86/libOsiSym.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libOsiSym.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libOsiSym.so.3'
-
-# Names of this library.
-library_names='libOsiSym.so.3.6.10 libOsiSym.so.3 libOsiSym.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libSym.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCgl.la /home/fossee/SYMPHONY-5.6.10/build/lib/libOsiClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClpSolver.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libOsi.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libOsiSym.
-current=9
-age=6
-revision=10
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libSym.la b/thirdparty/linux/lib/x86/libSym.la
deleted file mode 100755
index b20a336..0000000
--- a/thirdparty/linux/lib/x86/libSym.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libSym.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libSym.so.3'
-
-# Names of this library.
-library_names='libSym.so.3.6.10 libSym.so.3 libSym.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/fossee/SYMPHONY-5.6.10/build/lib/libCgl.la /home/fossee/SYMPHONY-5.6.10/build/lib/libOsiClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClpSolver.la /home/fossee/SYMPHONY-5.6.10/build/lib/libClp.la /home/fossee/SYMPHONY-5.6.10/build/lib/libOsi.la /home/fossee/SYMPHONY-5.6.10/build/lib/libCoinUtils.la'
-
-# Version information for libSym.
-current=9
-age=6
-revision=10
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/fossee/SYMPHONY-5.6.10/build/lib'
diff --git a/thirdparty/linux/lib/x86/libcoinblas.la b/thirdparty/linux/lib/x86/libcoinblas.la
deleted file mode 100755
index 9386e57..0000000
--- a/thirdparty/linux/lib/x86/libcoinblas.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinblas.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinblas.so.1'
-
-# Names of this library.
-library_names='libcoinblas.so.1.4.4 libcoinblas.so.1 libcoinblas.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=''
-
-# Version information for libcoinblas.
-current=5
-age=4
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/mushirahmed/Desktop/Ipopt-3.12.4/build32_ipopt/lib'
diff --git a/thirdparty/linux/lib/x86/libcoinlapack.la b/thirdparty/linux/lib/x86/libcoinlapack.la
deleted file mode 100755
index 8c9b979..0000000
--- a/thirdparty/linux/lib/x86/libcoinlapack.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinlapack.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinlapack.so.1'
-
-# Names of this library.
-library_names='libcoinlapack.so.1.5.4 libcoinlapack.so.1 libcoinlapack.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' -lblas'
-
-# Version information for libcoinlapack.
-current=6
-age=5
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/mushirahmed/Desktop/Ipopt-3.12.4/build32_ipopt/lib'
diff --git a/thirdparty/linux/lib/x86/libcoinmumps.la b/thirdparty/linux/lib/x86/libcoinmumps.la
deleted file mode 100755
index 944fd37..0000000
--- a/thirdparty/linux/lib/x86/libcoinmumps.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libcoinmumps.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libcoinmumps.so.1'
-
-# Names of this library.
-library_names='libcoinmumps.so.1.5.4 libcoinmumps.so.1 libcoinmumps.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' -lblas -L/usr/lib/gcc/i686-linux-gnu/4.6 -L/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.6/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.6/../../.. -lgfortran -lm -lquadmath'
-
-# Version information for libcoinmumps.
-current=6
-age=5
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/mushirahmed/Desktop/Ipopt-3.12.4/build32_ipopt/lib'
diff --git a/thirdparty/linux/lib/x86/libipopt.la b/thirdparty/linux/lib/x86/libipopt.la
deleted file mode 100755
index e7d4b76..0000000
--- a/thirdparty/linux/lib/x86/libipopt.la
+++ /dev/null
@@ -1,35 +0,0 @@
-# libipopt.la - a libtool library file
-# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06)
-#
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# The name that we can dlopen(3).
-dlname='libipopt.so.1'
-
-# Names of this library.
-library_names='libipopt.so.1.10.4 libipopt.so.1 libipopt.so'
-
-# The name of the static archive.
-old_library=''
-
-# Libraries that this one depends upon.
-dependency_libs=' /home/mushirahmed/Desktop/Ipopt-3.12.4/build32_ipopt/lib/libcoinmumps.la -lgfortran -lquadmath -llapack -lblas -ldl'
-
-# Version information for libipopt.
-current=11
-age=10
-revision=4
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='/home/mushirahmed/Desktop/Ipopt-3.12.4/build32_ipopt/lib'
diff --git a/unloader.sce b/unloader.sce
new file mode 100644
index 0000000..8b09ac1
--- /dev/null
+++ b/unloader.sce
@@ -0,0 +1,14 @@
+// This file is released under the 3-clause BSD license. See COPYING-BSD.
+// Generated by builder.sce: Please, do not edit this file
+
+try
+ getversion("scilab");
+catch
+ error("Scilab 5.4 or more is required.");
+end;
+
+fileQuit = get_absolute_file_path("unloader.sce") + "etc/" + "FOSSEE_Optimization_Toolbox.quit";
+if isfile(fileQuit) then
+ exec(fileQuit);
+end
+
--
cgit