I need to develop code to optimize a set or variables based on the following conditions.
- I don't have the source of function.
- The function gets a point (x,y) and generate a mapped point (x',y') using a set of parameters (around 10 parameter)(Mapping_Function)..
- I have an array of points with desire mapped ones (input[N], mapped[N]).
- I have a function that can calculate distance between two points (for example input point and mapped one). This function is in fact Euclidean distance (GetAbsError).
- I need to wrote code to optimize parameters to function so the distance between input points and mapped one became minimized (Optimize_Parameters).
The sample code is as follow:
Point[] InputPoints=GetInputPoints();
Point[] TargetMappedPoints=GetInputmappedPoints();
double[] Parameters=GetInitialParameters();
double error=1000000000;
double validerror=.000000001;
While(error> validerror)
{
Parameters=Optimize_Parameters(TargetMappedPoints,MappedPoints,Parameters);
Point[] MappedPoints=Mapping_Function(InputPoints,Parameters);
error=GetAbsError(TargetMappedPoints,MappedPoints);
}
I need to write Optimize_Parameters function to do the optimization.
How can I do this?
What library can I use to write this function?
Where can I find more information on this?
I can write it in c++ or c#, but prefer to do this in c++ as it is faster.