...
This commit is contained in:
@@ -196,12 +196,14 @@ protected:
|
|||||||
{
|
{
|
||||||
if constexpr (pairKind != MccCoordPairKind::COORDS_KIND_GENERIC &&
|
if constexpr (pairKind != MccCoordPairKind::COORDS_KIND_GENERIC &&
|
||||||
pairKind != MccCoordPairKind::COORDS_KIND_XY) {
|
pairKind != MccCoordPairKind::COORDS_KIND_XY) {
|
||||||
if constexpr (pairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP ||
|
// if constexpr (pairKind == MccCoordPairKind::COORDS_KIND_HADEC_APP ||
|
||||||
pairKind == MccCoordPairKind::COORDS_KIND_HADEC_OBS) {
|
// pairKind == MccCoordPairKind::COORDS_KIND_HADEC_OBS) {
|
||||||
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_180_180>();
|
// _x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_180_180>();
|
||||||
} else { // RA, AZ
|
// } else { // RA, AZ
|
||||||
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
|
// _x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
_x = (double)MccAngle(_x).normalize<MccAngle::NORM_KIND_0_360>();
|
||||||
|
|
||||||
// DEC and ALT is [-90,90] degrees
|
// DEC and ALT is [-90,90] degrees
|
||||||
if constexpr (pairKind != MccCoordPairKind::COORDS_KIND_AZZD) {
|
if constexpr (pairKind != MccCoordPairKind::COORDS_KIND_AZZD) {
|
||||||
|
|||||||
@@ -532,22 +532,22 @@ protected:
|
|||||||
model = X * beta;
|
model = X * beta;
|
||||||
resi = y - model;
|
resi = y - model;
|
||||||
|
|
||||||
resi = y;
|
// resi = y;
|
||||||
|
|
||||||
for (result.final_iter = 1; result.final_iter <= comp_params.max_iter; ++result.final_iter) {
|
for (result.final_iter = 1; result.final_iter <= comp_params.max_iter; ++result.final_iter) {
|
||||||
scale = gastwirth_est(resi);
|
scale = gastwirth_est(resi);
|
||||||
|
|
||||||
tukey_weight(resi / scale, comp_params.c, weights);
|
tukey_weight(resi / scale, comp_params.c, weights);
|
||||||
|
|
||||||
Eigen::MatrixXd XtW = X.transpose() * weights.asDiagonal();
|
// Eigen::MatrixXd XtW = X.transpose() * weights.asDiagonal();
|
||||||
Eigen::MatrixXd XtWX = XtW * X;
|
// Eigen::MatrixXd XtWX = XtW * X;
|
||||||
Eigen::VectorXd XtWy = XtW * y;
|
// Eigen::VectorXd XtWy = XtW * y;
|
||||||
|
|
||||||
new_beta = XtWX.ldlt().solve(XtWy);
|
// new_beta = XtWX.ldlt().solve(XtWy);
|
||||||
|
|
||||||
// WX = weights.asDiagonal() * X;
|
WX = weights.asDiagonal() * X;
|
||||||
// Wy = weights.asDiagonal() * y;
|
Wy = weights.asDiagonal() * y;
|
||||||
// new_beta = WX.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(Wy);
|
new_beta = WX.bdcSvd(Eigen::ComputeThinU | Eigen::ComputeThinV).solve(Wy);
|
||||||
|
|
||||||
if ((new_beta - beta).norm() < comp_params.tolerance) {
|
if ((new_beta - beta).norm() < comp_params.tolerance) {
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user