# forum.alglib.net

ALGLIB forum
 It is currently Sat Aug 13, 2022 6:31 am

 All times are UTC

### Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

 Page 1 of 1 [ 1 post ]
 Print view Previous topic | Next topic
Author Message
 Post subject: minlmoptimize invalid usePosted: Fri Dec 14, 2018 9:35 am

Joined: Fri Dec 14, 2018 9:20 am
Posts: 1
Dear all,

I'm trying to use the Levenberg Marquardt algorithm. If I compile, I get the error "invalid use of non-static member" in the line "minlmoptimize(state, problemMeasurementEquipmentPositon);". First thought, no problem, I make the method problemMeasurementEquipmentPositon(...) static. This would work, if the called methods within this method would be static too, but they aren't. I have never had such a problem and I don't know how to solve it. I would be very grateful if somebody could help. Thanks.

Code:
void RobotProblemSolver::solveMeasurementEquipment(){

int equations=para.getNumberOfMeasurements()*3;

real_1d_array x = "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]";
real_1d_array bndl = "[-1,-1,-1,-10,-1,-1,-1,-10,-1,-1,-1,-10,-0.1,-0.1,-0.1]";
real_1d_array bndu = "[+1,+1,+1,+10,+1,+1,+1,+10,+1,+1,+1,+10,+0.1,+0.1,+0.1]";
double epsx = 0.0000000001;
ae_int_t maxits = 0;
minlmstate state;
minlmreport rep;

minlmcreatev(equations, x, 0.0001, state);
minlmsetbc(state, bndl, bndu);
minlmsetcond(state, epsx, maxits);
minlmoptimize(state, problemMeasurementEquipmentPositon);
minlmresults(state, x, rep);

Transformation t(x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],0,0,0,1);

std::cout << t.toString() << std::endl;
std::cout << "Tool: "<<x[12]<<" "<<x[13]<<" "<<x[14]<<std::endl;

}

void RobotProblemSolver::problemMeasurementEquipmentPositon(const real_1d_array &x, real_1d_array &fi, void *ptr){

double phi[6];
double coordinates[3];
Transformation pose;
Transformation toolTrans(1,0,0,x[12],
0,1,0,x[13],
0,0,1,x[14],
0,0,0,1);
Tool tool(toolTrans);

for(int i=0; i<para.getNumberOfMeasurements(); i++){

para.getMeasure(i,phi,coordinates);
robotModel.directKinematics(phi,tool,pose);

fi[i*3+0]=coordinates[0]*x[0]+coordinates[1]*x[1]+coordinates[2]*x[2]+x[3]-pose[3];
fi[i*3+1]=coordinates[0]*x[4]+coordinates[1]*x[5]+coordinates[2]*x[6]+x[7]-pose[7];
fi[i*3+2]=coordinates[0]*x[8]+coordinates[1]*x[9]+coordinates[2]*x[10]+x[11]-pose[11];
}

}

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 1 post ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for: