1110
std::mt19937是伪随机数发生器,可生成32位整数序列,周期较长能达到
2
19937
−
1
2^{19937}-1
2 19937 − 1 ,但是占用空间较大。 C++用法 ,维基百科
linux查找指令 ,grep指令2
1111
std::shuffle使用一个随机数来打乱[first, last)之间元素的顺序。参考1 参考2
1114
std::array
1118
Hungarian/Kuhn-Munkres算法解析:link1 , 可用于ICP算法中的匹配步骤 多尺度线性最小二乘法,参考论文
1207
Eigen内参分配器aligned_allocator:eigen解释 ,使用解析 两个圆的公切线求法:公切线公式
CalculateCommonTangent ( float x1, float y1, float x2, float y2, float r1, float r2, std:: vector< std:: vector< float > > & coeffs) {
coeffs. clear ( )
}
1209
惯导坐标系名词解释:坐标系转换 ,名词解释 Yaw角计算后续步骤:
计算两个圆的公切线(A圆是当前里程计坐标系下原点和原点到当前车道线距离;B圆是当前里程计坐标系下上一帧里程计原点和上一帧原点原点到上一帧车道线距离) 在多条公切线中选择与当前车道线同侧的公切线(为啥?) 构建公切线和当前车道线的向量,通过向量计算直线夹角,即为yaw角
1221
旋转矩阵欧拉角相关:
nice函数:链接1 CMake中find_package函数的使用:就是一个搜索三方库的逻辑,目的是找到对应的.cmake文件,link1
1222
C++引用相关问题:
1LL,LL其实代表long long的缩写,1LL是为了在计算时,把int类型的变量转化为long long,然后再赋值给long long类型的变量。类似的情况还有UL(unsigned long),U(unsigned),L(long)等
1223
std::mt19937用于生成高性能随机数,详情 ;std::shuffle函数用于打乱元素顺序,洗牌算法 ,函数详解
1226
reinterpret_cast类型转换:C++类型转换之reinterpret_cast gitignore可以忽略一些文件不上传到远程repo,基础使用 ,一些详解 Eigen中norm、normalize、normalized的区别 :norm是二范数,normalize是向量除以二范数,normalized在normalize的基础上创建新变量不改变原有变量。
1227
glog的使用:github教程 constexpr用法:将运算放在编译阶段
1228
swap函数:
vector< int > vec1 ( 100000 , 0 ) , vec2 ( 100000 , 0 ) ;
vector< int > swap_vec;
for ( int i = 0 ; i < 100000 - 2 ; ++ i) {
vec1. pop_back ( ) ;
vec2. pop_back ( ) ;
}
std:: cout << "raw vec1: " << vec1. capacity ( ) << std:: endl;
vector < int > ( vec1) . swap ( vec1) ;
std:: cout << "after swap: " << vec1. capacity ( ) << std:: endl;
swap_vec. swap ( vec2) ;
std:: cout << "raw vec2: " << vec2. capacity ( ) << std:: endl;
std:: cout << "swap_vec: " << swap_vec. capacity ( ) << std:: endl;
UTM坐标系:UTM坐标系
匈牙利算法:算法简介和应用
QR分解:
void Test :: linearEquationsSolve ( const int & martix_size) {
Eigen:: MatrixXd A;
Eigen:: MatrixXd b;
Eigen:: MatrixXd x1;
Eigen:: MatrixXd x2;
A = Eigen:: MatrixXd :: Random ( martix_size, martix_size) ;
b = Eigen:: MatrixXd :: Random ( martix_size, 1 ) ;
clock_t time1 = clock ( ) ;
x1 = A. colPivHouseholderQr ( ) . solve ( b) ;
std:: cout << "QR time: " << 1000 * ( clock ( ) - time1) / ( double ) CLOCKS_PER_SEC << "ms" << std:: endl;
clock_t time2 = clock ( ) ;
x2 = A. llt ( ) . solve ( b) ;
std:: cout << "cholesky time: " << 1000 * ( clock ( ) - time2) / ( double ) CLOCKS_PER_SEC << "ms" << std:: endl;
std:: cout << "A: \n" << A << std:: endl;
std:: cout << "b: \n" << b. transpose ( ) << std:: endl;
std:: cout << "x1: \n" << x1. transpose ( ) << std:: endl;
std:: cout << "x2: \n" << x2. transpose ( ) << std:: endl;
}
数值分析相关:
1229
Ceres库的基本使用:简单入门
1230——2022年最后一个工作日了,收官!
Eigen生成复数矩阵,实数矩阵
Eigen:: MatrixXcf a = Eigen:: MatrixXcf :: Random ( 2 , 2 ) ;
Eigen:: MatrixXf b = Eigen:: MatrixXf :: Random ( 2 , 2 ) ;
cout << "Here is the matrix a\n" << a << endl;
cout << "Here is the matrix a\n" << a. real ( ) << endl;
cout << "Here is the matrix b\n" << b << endl;
cout << "Here is the matrix a^T\n" << a. transpose ( ) << endl;
cout << "Here is the conjugate of a\n" << a. conjugate ( ) << endl;
cout << "Here is the matrix a^*\n" << a. adjoint ( ) << endl;
template cast的用法 ,为了避免编译错误,使用模板类时需要注意 Eigen中Map类的用法