80{
84
90
91
92
93
94 unsigned ipoint, ngood(0);
95 unsigned npoints = points.size();
97 for(ipoint=0;ipoint<
npoints;ipoint++){
104 wPoint += sPoint;
105 translate2 += cPoint-sPoint;
106 ngood++;
107
108
109
110
111
112
113
114
115 }
116 }
117 if(ngood>=1){
118 wPoint *= 1.0/ngood;
119 translate2 *= 1.0/ngood;
120
123 for(ipoint=0;ipoint<
npoints;ipoint++){
132 theLcm += thePoint.cross(theDelta);
133 Vect[0] = thePoint.x();
134 Vect[1] = thePoint.y();
135 Vect[2] = thePoint.z();
137 Tens += thePoint.
mag2()*temp;
138
139
140
141
142
143
144 }
145 }
146
147 Vect[0] = theLcm.
x();
148 Vect[1] = theLcm.
y();
149 Vect[2] = theLcm.
z();
150 Rota= Tens.inverse() * Vect;
151 aRotat2 = Amg::
Vector3D(Rota[0],Rota[1],Rota[2]);
152 translate2 -= aRotat2.cross(wPoint);
153 }else{
154 aRotat2.setZero();
155 translate2.setZero();
156 }
157
159 double distsum(0.0);
162
168
169
170 for(ipoint=0;ipoint<
npoints;ipoint++){
175 distsum += (
cur - sur).
mag();
176 }
177 }
178 if (ngood!=0){
180 } else {
181 retval = std::numeric_limits<double>::infinity();
182 }
183
184
185
186
187
188
189
190
191
192
194}
Scalar mag() const
mag method
Scalar mag2() const
mag2 method - forward to squaredNorm()
#define AmgSymMatrix(dim)
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic Matrix - dynamic allocation.
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D
transform2(oldbgs, bgsname, bgnames)