当前位置:网站首页>GPS高程拟合抗差中误差的求取代码实现
GPS高程拟合抗差中误差的求取代码实现
2022-07-06 09:18:00 【Proletarians】
话不多说,直接上代码了,c代码
// 2.1、使用中位数法,而非算术中位法
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res =median(tmp_v_res, ns);// 观测值中数 Eq.14
// 2.1.1 求取偏离量,中心化
for (j = 0; j < ns; j++) {
tmp_v_res[j] -= median_v_res;// Eq.15
/*v_res[j] -= median_v_res;*/
if (tmp_v_res[j] < 0) tmp_v_res[j] *= -1;//取绝对值
}
// 2.1.2 使用中位数计算方差因子
qsort(tmp_v_res, ns, sizeof(double), cmpres);
median_v_res = median(tmp_v_res, ns);//观测值中数
sigma1 = median_v_res / 0.6745;// Eq.17
printf("抗差单位权中误差(weighted)sigma1= %f\n", sigma1);
/* 残差比较 */
static int cmpres(const void *p1, const void *p2){
double *q1 = (double *)p1, *q2 = (double *)p2;
double tt = (*q1) - (*q2);
return tt<-0.0 ? -1 : (tt>0.0 ? 1 : 0);
}
/* 求中位数 */
static double median(const double* A,unsigned int n){
if (n>0){
return (n & 1 == 1) ? A[(n - 1) / 2] : (A[n / 2] + A[n / 2 - 1]) / 2;
}
return 0;
}
边栏推荐
- Unity3d makes the registration login interface and realizes the scene jump
- How to improve the deletion speed of sequential class containers?
- Gateway fails to route according to the service name, and reports an error service unavailable, status=503
- Latex learning
- 2021.11.10 compilation examination
- Naive Bayesian theory derivation
- 程序设计大作业:教务管理系统(C语言)
- (1) Introduction Guide to R language - the first step of data analysis
- ORA-02030: can only select from fixed tables/views
- Unity3D基础入门之粒子系统(属性介绍+火焰粒子系统案例制作)
猜你喜欢
Office提示您的许可证不是正版弹框解决
地球围绕太阳转
Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
Unity3d, Alibaba cloud server, platform configuration
Unity场景跳转及退出
341. Flatten nested list iterator
Design and implementation of general interface open platform - (39) simple and crude implementation of API services
Walk into WPF's drawing Bing Dwen Dwen
Page performance optimization of video scene
PR 2021 quick start tutorial, first understanding the Premiere Pro working interface
随机推荐
Mysqldump error1066 error solution
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
【RTKLIB 2.4.3 b34 】版本更新简介一
Pytorch: tensor operation (I) contiguous
idea中导包方法
(5) Introduction to R language bioinformatics -- ORF and sequence analysis
Meanings and differences of PV, UV, IP, VV, CV
FairyGUI复选框与进度条的组合使用
[899]有序队列
[offer18] delete the node of the linked list
NRF24L01故障排查
JS function promotion and declaration promotion of VaR variable
FairyGUI簡單背包的制作
[offer9] implement queues with two stacks
Special palindromes of daily practice of Blue Bridge Cup
Lock wait timeout exceeded try restarting transaction
FairyGUI循環列錶
Acwing-116 pilot brother
FairyGUI条子家族(滚动条,滑动条,进度条)
Unity3D,阿里云服务器,平台配置