project  ..
multiloc.h
Go to the documentation of this file.
1 //
2 // Created by zf on 18-3-23.
3 //
4 
10 
11 #ifndef CPLUSPLUS_LOCATION_H
12 #define CPLUSPLUS_LOCATION_H
13 
14 #include "Eigen/Dense"/* 使用c++的eigen矩阵库*/
15 #include <vector>
16 #include <iostream>
17 #include <fstream>
18 #include <iomanip>
19 #include <ctime>
20 #include <cmath>
21 #include <algorithm>
22 #include <sys/time.h>/* 用于算法程序运行时间的统计*/
23 
24 extern int numberruncount;
25 
26 using namespace std;
27 using namespace Eigen;
28 
29 typedef vector<double> one_Tuple;
30 typedef vector<one_Tuple> two_Tuple;
31 typedef vector<two_Tuple> three_Tuple;
34 void sortarry(two_Tuple&list,int temp);
39 
40 
41 
46 bool finditems(double value,two_Tuple& list);
47 
57 bool finditems(double value,one_Tuple& list);
58 
69 int classification(const one_Tuple& list_one,three_Tuple& list);
70 
80 bool isequal(const two_Tuple& list,const two_Tuple& list1);
81 
94 void productiondot(one_Tuple& m_data,two_Tuple& angle,three_Tuple & list_three,int& numberruncount);
95 
106 void clearreplace(three_Tuple& means_result,three_Tuple& f_result,int& numberruncount);
118 void Demo4Mult_Targetlocalization(three_Tuple& f_result,two_Tuple& list_two,string& str);
130 void Demo1Single_Target(one_Tuple& angle,one_Tuple& data,MatrixXd& result);
131 
144 void Demo2(one_Tuple& m_data,two_Tuple& angle,three_Tuple& list_three,three_Tuple& list_three2);
145 
156 void Demo3count(two_Tuple& A,two_Tuple& B);
157 
168 void Demo3intersect(two_Tuple& A,two_Tuple& B, ofstream& out_stream,int numberruncount);
169 
181 void Demo3(three_Tuple& f_result,three_Tuple& list_three,string & str,int &numberruncount);
182 
196 void Demo3remove(two_Tuple& A,three_Tuple& B, ofstream& out_stream, int& numberruncount);
197 
208 bool Demo5inputdata(two_Tuple& angles,one_Tuple& m_coordinate);
209 
210 #endif //CPLUSPLUS_LOCATION_H
void sortarry(two_Tuple &list, int temp)
对一个二维的vector<vector<double>>的list进行按照每一个vector<double>的第2个元素进行升序 ...
void Demo2(one_Tuple &m_data, two_Tuple &angle, three_Tuple &list_three, three_Tuple &list_three2)
对靶点数据和测向线数据通过聚类算法得到测向线聚类坐标集合.其中m_data为所有靶点的坐标. angle为每个靶...
void Demo4Mult_Targetlocalization(three_Tuple &f_result, two_Tuple &list_two, string &str)
将测向线聚类集合送入目标定位算法中,进行目标点定位.其中f_result为输入的测向线聚类集合. list_two为所...
vector< two_Tuple > three_Tuple
Definition: multiloc.h:31
bool Demo5inputdata(two_Tuple &angles, one_Tuple &m_coordinate)
测试数据数据通过命令行进行在线输入,对输入的靶点数据坐标和测向线角度信息进行保存,剔除重复输入的信息. 输入的测向线角度信息保存在angles,输入的靶点坐标信息保存在m_coordinate.当输入出现数据格式出现错误时,返回false.正确返回true.
void productiondot(one_Tuple &m_data, two_Tuple &angle, three_Tuple &list_three, int &numberruncount)
测向线交点坐标聚类算法,即第一步读取靶点和测向线的数据信息,将两两测向线进行相交的到交点坐标. 第2步...
vector< one_Tuple > two_Tuple
Definition: multiloc.h:30
void clearreplace(three_Tuple &means_result, three_Tuple &f_result, int &numberruncount)
将坐标点聚类集合转化为测向线聚类集合.其中means_result为输入的坐标点聚类集合. f_result为输出的测向线...
vector< double > one_Tuple
Definition: multiloc.h:29
int numberruncount
void Demo3count(two_Tuple &A, two_Tuple &B)
判断测向线组中任意两类是否具有重复的测向线信息.将第一类中非重复的部分归入第2类中. A为一类的测向线聚...
bool finditems(double value, two_Tuple &list)
判断value元素是否属于2维vector中的第一个元素,如果value属于list中返回true,否则返回false.
bool isequal(const two_Tuple &list, const two_Tuple &list1)
判断两个二维vector即list和list1是否相等,如果两个相等,返回true.否则返回false.
void Demo3remove(two_Tuple &A, three_Tuple &B, ofstream &out_stream, int &numberruncount)
将测向线聚类集合进行测向线野值检测. 将重复多余的测向线信息进行删除,同时更新测向线聚类集合.将删除的测向线信息保存到文件中. f_result为一类的测向线聚类组.list_three为所有测向线聚类集合.str为删除的测向线信息以文件形式输出的路径.numberruncount为测向线 数量用于剔除独立的测向线聚类集合.
void Demo3intersect(two_Tuple &A, two_Tuple &B, ofstream &out_stream, int numberruncount)
判断测向线组中任意两类是否具有重复的测向线信息.将重复的多余的部分进行删除. A为一类的测向线聚类组. ...
int classification(const one_Tuple &list_one, three_Tuple &list)
坐标点聚类算法,即判断一维的vector<double>类型是否属于交点坐标聚类集合list中的一类,如果属于其中的一类, 则将该1维的vector归入到该类中,否则单独归为list中新的一类.
void Demo3(three_Tuple &f_result, three_Tuple &list_three, string &str, int &numberruncount)
判断一类测向线聚类组与整个测向线聚类集合中每一类是否具有重复的测向线信息.将重复多余的测向线信息进行...
void Demo1Single_Target(one_Tuple &angle, one_Tuple &data, MatrixXd &result)
单目标定位算法根据输入的测向线角度和靶点坐标求解目标点的具体位置信息. data为所有靶点的坐标.angle为...