Eigen不同的方法来求矩阵的逆的效率

2023-10-27

背景

不同尺寸的矩阵,求逆使用不同的方法,会有不同的效率的.


16x16矩阵的直接求逆与PartialPivLU的效率对比(本人亲测)

1 实现代码

GetSystemTimeInMacroSecond的实现

    boost::posix_time::ptime now = boost::posix_time::microsec_clock::universal_time() + boost::posix_time::hours(8);
    long long cur_time = now.time_of_day().total_microseconds();
    return cur_time;

求逆用时评估代码

Eigen::MatrixXf x;
    Eigen::MatrixXf A = Eigen::MatrixXf::Zero(22, 22);
    Eigen::VectorXf b = Eigen::MatrixXf::Zero(22, 1);
    A << 1.34600000000000, 1.13841228110978e-18, -3.54804631550289e-17, -2.05829006182795e-19, -0.160432023690557, 0.00411124458769287, -0.000223899921724580, -0.0593112659337829, -0.0241839767166998, -0.00834748033971202, -5.37814422485606e-06, 5.23214930710842e-06, -0.0580682816915559, -0.0247053374485193, -0.00834723095360454, 1.97819241321089e-07, 0.999999990195040, 9.97072788916781e-05, 9.83279179330304e-05, 0, 0, 0,
    1.13841228110978e-18, 1.34600000000000, -3.32036915323686e-18, 0.160484535740467, 5.65533818549124e-05, 0.0112007248696078, 0.0837289215044391, -9.20550154007569e-05, 4.95864766071101e-05, -2.26259635075635e-05, 0.00198399199113416, 0.0818535878168905, 0.000219747293578020, -9.46046009141372e-05, 8.32360721203644e-07, 0.00198399998046782, -9.97169861081831e-05, 0.999999990155153, 9.87229323286820e-05, 0, 0, 0,
    - 3.54804631550289e-17, -3.32036915323686e-18, 1.34600000000000, 0.000324983605022713, -0.00204205102000001, 7.50143433983415e-05, -0.00174330315904512, 0.00320107672037773, 0.00538664534138679, -2.49931385726132e-06, 1.68957988594421e-06, 0.00221636220236278, -0.00770414705602320, 0.00350024291275525, 8.20683675049907e-07, -1.95885748867475e-07, -9.83180735701035e-05, -9.87327363243321e-05, 0.999999990292701, 0, 0, 0,
    - 2.05829006182795e-19, 0.160484535740467, 0.000324983605022713, 0.0368009077713332, 0.000450394440556140, 0.00224060694237125, 0.0171499333910333, 0.000111460617639351, 0.000231822191509620, -6.19505197893729e-06, 0.000604514119035474, 0.0167286230613098, 0.000356657959376959, -0.000161229251681464, 1.92165660849536e-07, 0.000604838471732968, -2.34113026654352e-05, 0.273495197753565, -0.0392376814557259, 0.999999990195040, 9.97072788916781e-05, 9.83279179330304e-05,
    - 0.160432023690557, 5.65533818549124e-05, -0.00204205102000001, 0.000450394440556140, 0.0349927346271823, -0.000770239409681646, -5.52580627558622e-06, 0.0135113477743587, 0.00619537343699084, 0.00225656479992005, 6.33031697594492e-07, -2.32778930395674e-07, 0.0132115377315313, 0.00612436104238307, 0.00223967166698827, 5.63540677387556e-07, -0.272298424113141, 0.000287254259750317, -0.0113390517979790, -0.000102400584293418, 0.999613987367637, 0.0277824724078660,
    0.00411124458769287, 0.0112007248696078, 7.50143433983415e-05, 0.00224060694237125, -0.000770239409681646, 0.00250513838063355, -7.96998049017821e-05, 0.00207932171781462, 0.000827490251987481, 0.000276737538215227, -2.91526011283910e-06, 0.00218079218578034, -0.00265933192175922, -0.00115248022548862, -0.000388572073708229, 5.69402771431904e-05, 0.0467420522622825, 0.0269122305302098, -0.00192157718616087, 0.0569942750587246, -0.0277314782938061, 0.997989287378462,
    - 0.000223899921724580, 0.0837289215044391, -0.00174330315904512, 0.0171499333910333, -5.52580627558622e-06, -7.96998049017821e-05, 0.0173695770953092, 9.19953701202703e-08, 5.55632170658309e-07, -2.45754961919456e-07, 0.000608127257267949, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    - 0.0593112659337829, -9.20550154007569e-05, 0.00320107672037773, 0.000111460617639351, 0.0135113477743587, 0.00207932171781462, 9.19953701202703e-08, 0.0107948324950528, 0.00507773016911412, 0.00187572295300195, 7.24739201536356e-07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    - 0.0241839767166998, 4.95864766071101e-05, 0.00538664534138679, 0.000231822191509620, 0.00619537343699084, 0.000827490251987481, 5.55632170658309e-07, 0.00507773016911412, 0.00297121709317547, 0.00113838089040340, 9.65602255182848e-07, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    - 0.00834748033971202, -2.26259635075635e-05, -2.49931385726132e-06, -6.19505197893729e-06, 0.00225656479992005, 0.000276737538215227, -2.45754961919456e-07, 0.00187572295300195, 0.00113838089040340, 0.000601080937631330, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    - 5.37814422485606e-06, 0.00198399199113416, 1.68957988594421e-06, 0.000604514119035474, 6.33031697594492e-07, -2.91526011283910e-06, 0.000608127257267949, 7.24739201536356e-07, 9.65602255182848e-07, 0, 0.000121744000000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
    5.23214930710842e-06, 0.0818535878168905, 0.00221636220236278, 0.0167286230613098, -2.32778930395674e-07, 0.00218079218578034, 0, 0, 0, 0, 0, 0.0166289413041880, 1.54987609437772e-06, -2.68840504135592e-07, 3.06177337509682e-07, 0.000600039585916120, -4.76000849622613e-05, 0.271127384428256, 0.00671673095904333, 0.998374505182241, 0.00158666949874198, -0.0569721851609907,
    - 0.0580682816915559, 0.000219747293578020, -0.00770414705602320, 0.000356657959376959, 0.0132115377315313, -0.00265933192175922, 0, 0, 0, 0, 0, 1.54987609437772e-06, 0.0105650430359955, 0.00498056352012310, 0.00185632506252512, 7.71547978523958e-07, -0.226373410990567, 0.000388885069820543, -0.0139636088181738, 0, 0.999612417060891, 0.0278391030330401,
    - 0.0247053374485193, -9.46046009141372e-05, 0.00350024291275525, -0.000161229251681464, 0.00612436104238307, -0.00115248022548862, 0, 0, 0, 0, 0, -2.68840504135592e-07, 0.00498056352012310, 0.00300667325425074, 0.00115608170315948, -7.85620278703043e-07, -0.142484112085114, -0.000395977963055969, 0.0142182917417796, 0, 0.999612417060891, 0.0278391030330401,
    - 0.00834723095360454, 8.32360721203644e-07, 8.20683675049907e-07, 1.92165660849536e-07, 0.00223967166698827, -0.000388572073708229, 0, 0, 0, 0, 0, 3.06177337509682e-07, 0.00185632506252512, 0.00115608170315948, 0.000601026402068215, 0, -0.0759883725118268, 0, 0, 0, 0.999612417060891, 0.0278391030330401,
    1.97819241321089e-07, 0.00198399998046782, -1.95885748867475e-07, 0.000604838471732968, 5.63540677387556e-07, 5.69402771431904e-05, 0, 0, 0, 0, 0, 0.000600039585916120, 7.71547978523958e-07, -7.85620278703043e-07, 0, 0.000121744000000000, 0, 0.0300000000000000, 0, 1, 0, 0,
    0.999999990195040, -9.97169861081831e-05, -9.83180735701035e-05, -2.34113026654352e-05, -0.272298424113141, 0.0467420522622825, 0, 0, 0, 0, 0, -4.76000849622613e-05, -0.226373410990567, -0.142484112085114, -0.0759883725118268, 0, 0, 0, 0, 0, 0, 0,
    9.97072788916781e-05, 0.999999990155153, -9.87327363243321e-05, 0.273495197753565, 0.000287254259750317, 0.0269122305302098, 0, 0, 0, 0, 0, 0.271127384428256, 0.000388885069820543, -0.000395977963055969, 0, 0.0300000000000000, 0, 0, 0, 0, 0, 0,
    9.83279179330304e-05, 9.87229323286820e-05, 0.999999990292701, -0.0392376814557259, -0.0113390517979790, -0.00192157718616087, 0, 0, 0, 0, 0, 0.00671673095904333, -0.0139636088181738, 0.0142182917417796, 0, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 0.999999990195040, -0.000102400584293418, 0.0569942750587246, 0, 0, 0, 0, 0, 0.998374505182241, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 9.97072788916781e-05, 0.999613987367637, -0.0277314782938061, 0, 0, 0, 0, 0, 0.00158666949874198, 0.999612417060891, 0.999612417060891, 0.999612417060891, 0, 0, 0, 0, 0, 0, 0,
    0, 0, 0, 9.83279179330304e-05, 0.0277824724078660, 0.997989287378462, 0, 0, 0, 0, 0, -0.0569721851609907, 0.0278391030330401, 0.0278391030330401, 0.0278391030330401, 0, 0, 0, 0, 0, 0, 0;


    b << 0,
    0,
    -13.2042600000000,
    -0.00318808916527274,
    0.0200325205062001,
    -0.000735890708737724,
    0.0155774925360128,
    -0.0369437528953341,
    -0.0409522547984081,
    -0.00390667008137935,
    -0.00232355145046985,
    0.413165511114724,
    2.58954781196455,
    -0.0402923712348155,
    0.00438897429704739,
    0.000278169226818484,
    -0.0678455928345908,
    0.0527586395813534,
    -0.726306425617754,
    0.000161368614991371,
    -0.0112377101793276,
    0.237950558222788;

    long long end_time ;
    long long elapsed_time;
    long long start_time = TimeUtil::GetSystemTimeInMacroSecond();
    //
//    Eigen::Vector3f x = A.colPivHouseholderQr().solve(b);
//    std::cout << "The solution is:\n" << x << std::endl;
//    long long end_time = TimeUtil::GetSystemTimeInMacroSecond();
//    long long elapsed_time = end_time - start_time;
//    cout << "inverrse matrix use colPivHouseholderQr time = " << elapsed_time << endl;

    int test_count = 1;
    long long use_time = 0;
    for (int i = 0; i < test_count; ++i)
    {
        start_time = TimeUtil::GetSystemTimeInMacroSecond();
        Eigen::PartialPivLU<Eigen::MatrixXf> ALU(A); // A的LU分解
        Eigen::MatrixXf x1 = ALU.inverse() * b; // solve Ax=b, same as x = lu.solve(b);
        //Eigen::MatrixXd x = b * lu.inverse(); // solve xA=b
        end_time = TimeUtil::GetSystemTimeInMacroSecond();
        elapsed_time = end_time - start_time;
        use_time = use_time + elapsed_time;
    }

    cout << "inverrse matrix use PartialPivLU time = " << use_time / test_count << endl;


    use_time = 0;
    for (int i = 0; i < test_count; ++i)
    {
        start_time = TimeUtil::GetSystemTimeInMacroSecond();
        Eigen::MatrixXf x2 = A.inverse() * b;
        end_time = TimeUtil::GetSystemTimeInMacroSecond();
        elapsed_time = end_time - start_time;
        use_time = use_time + elapsed_time;
    }
    cout << "inverrse matrix use inverse time = " << use_time / test_count << endl;

2 测试环境:

  1. OS:win11
  2. 硬件:Intel® Core™ i7-10510U CPU @ 1.80GHz 2.30 GHz
  3. 开发工具qt+vs编译器

3 debug计算时间(注意,时间跟配置和操作系统很大关系,个人不同,这里只是相对比较)

这里不是确定的值是因为,我会执行多次,观察值所在范围

  1. 只执行一次:变动很大,0-1000微秒都出现过
  2. 执行100次:PartialPivLU用时500-600多微秒,直接求逆用时300-400维秒
  3. 执行1000次:PartialPivLU用时300多微秒,直接求逆用时200-300多维秒
  4. 执行10000次:PartialPivLU用时[300,350]微秒,直接求逆用时[300,350]维秒

4 release计算时间(注意,时间跟配置和操作系统很大关系,个人不同,这里只是相对比较)

这里不是确定的值是因为,我会执行多次,观察值所在范围

  1. 只执行一次:变动很大,0微秒
  2. 执行100次:PartialPivLU用时[10,40]微秒,直接求逆用时[10,30]维秒
  3. 执行1000次:PartialPivLU用时[20,30]微秒,直接求逆用时[20,30]多维秒
  4. 执行10000次:PartialPivLU用时[15,18]微秒,直接求逆用时[12,14]维秒

4x4矩阵的求逆测试讨论

https://stackoverflow.com/questions/50909385/eigen-linear-solver-for-very-small-square-matrix


矩阵的逆的问题,一般类似求解:Ax=b----------------->x = A-1b

这里给出stackoverflow的一个关于这个求解的的效率的讨论:


1 测试的方法以及种类

I am using Eigen on a C++ program for solving linear equation for very small square matrix(4X4).
My test code is like

template<template <typename MatrixType> typename EigenSolver>
Vertor3d solve(){
   //Solve Ax = b and A is a real symmetric matrix and positive semidefinite

   ... // Construct 4X4 square matrix A and 4X1 vector b

   EigenSolver<Matrix4d> solver(A);
   auto x = solver.solve(b);

   ... // Compute relative error for validating
}

I test some EigenSolver which include:(测试的方法种类)

  1. FullPixLU
  2. PartialPivLU
  3. HouseholderQR
  4. ColPivHouseholderQR
  5. ColPivHouseholderQR
  6. CompleteOrthogonalDecomposition
  7. LDLT
  8. Direct Inverse

Direct Inverse is:(直接求逆是调用Eigen的接口Inverse来计算逆矩阵,然后乘上去)

template<typename MatrixType>
struct InverseSolve
{
private:
    MatrixType  inv;
public:
    InverseSolve(const MatrixType &matrix) :inv(matrix.inverse()) {
    }
    template<typename VectorType>
    auto solve(const VectorType & b) {
        return inv * b;
    }
};

2 测试的数据

all use 1000000 matrices with random double from uniform distribution [0,100].I fristly construct upper-triangle and then copy to lower-triangle.

3 测试的结果:直接求逆最快,但是精度稍微差一点

I found that the fast method is DirectInverse,Even If I linked Eigen with MKL , the result was not change.

This is the test result:
FullPixLU : 477 ms
PartialPivLU : 468 ms
HouseholderQR : 849 ms
ColPivHouseholderQR : 766 ms
ColPivHouseholderQR : 857 ms
CompleteOrthogonalDecomposition : 832 ms
LDLT : 477 ms
Direct Inverse : 88 ms

The only problem of Direct Inverse is that its relative error slightly larger than other solver but acceptble.
Is there any faster or more felegant solution for my program?Is DirectI nverse the fast solution for my program?
Direct Inverse does not use the symmetric infomation so why is Direct Inverse far faster than LDLT?

For fixed sized matrices up to 4x4, inverse() is computed directly using co-factors, 
which is very fast and requires only on division, but is expected to be slightly less accurate, in general.
The solve as you implemented it, will only require a very fast Matrix-Vector product.
You can increase the accuracy by doing a refinement-step: x=inv*b; x+=inv*(b-A*x);. 
MKL will generally not help for small fixed-sized inputs

回答一: 微小矩阵直接求逆比用求解法更快

Despite what many people suggest of never explicitly computing an inverse when you only want to solve a linear system, for very small matrices this can actually be beneficial, since there are closed-form solutions using co-factors.

All other alternatives you tested will be slower, since they will do pivoting (which implies branching), even for small fixed-sized matrices. Also, most of them will result in more divisions and be not vectorizable as good, as the direct computation.

To increase the accuracy (this technique can actually be used independent of the solver if required), you can refine an initial solution by solving the system again with the residual:

Eigen::Vector4d solveDirect(const Eigen::Matrix4d& A, const Eigen::Vector4d& b)
{
    Eigen::Matrix4d inv = A.inverse();
    Eigen::Vector4d x = inv * b;
    x += inv*(b-A*x);
    return x;
}

超大矩阵的求逆

https://stackoverflow.com/questions/39190245/eigen-get-inverse-failed-and-inverse-is-so-slow

Full-pivoting LU is known to be very slow, regardless of its implementation.

Better use PartialPivLU, which benefits from high performance matrix-matrix operations. Then to get the best of Eigen, use the 3.3-beta2 release and compile with both FMA (-mfma) and OpenMP (e.g., -fopenmp) supports, and don’t forget to enable compiler optimizations -O3. This operation should not take more than a few seconds.

Finally, do you really need to explicitly compute the inverse? If you only apply it to some vectors or matrices (i.e., A^-1 * B or B * A^-1) then better apply the inverse in factorized form rather than explicitly computing it. With Eigen 3.3:

MatrixXd A = ...;
PartialPivLU<MatrixXd> lu(A);
x = lu.inverse() * b; // solve Ax=b, same as x = lu.solve(b);
x = b * lu.inverse(); // solve xA=b

n these expressions, the inverse is not explicitly computed!

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Eigen不同的方法来求矩阵的逆的效率 的相关文章

  • 使用sqlbulkcopy之前如何创建表

    我有一个 DBF 文件 我正在尝试导入该文件 然后将其写入 SQL 表 我遇到的问题是 如果我使用 SqlBulkCopy 它需要我提前创建表 但在我的场景中这是不可能的 因为 dbf 文件不断变化 到目前为止 这是我的代码 public
  • C# 中直接从 URL 获取图像尺寸

    我正在尝试使用以下代码直接从网络上获取图片的尺寸 string image http www hephaestusproject com csharp3 png byte imageData new WebClient DownloadDa
  • C# - Visual Studio 中的 System.OutOfMemoryException

    我遇到问题 当我右键单击 Visual Studio 中的主窗体并转到 视图设计器 时 出现错误 它说 引发了 System OutOfMemoryException 类型的异常 堆栈跟踪 at System Reflection Asse
  • ASMX Web 服务,测试表单仅在本地计算机上适用于一种 WebMethod

    我有一个正在测试的 ASMX WebService 并且在大多数方法上我都可以使用测试表单进行测试 然而 我确实有一种方法 测试表上写着 The test form is only available for requests from t
  • 如何将 Visual-Studio 2010 切换到 c++11

    我是 c 编程新手 我想尝试 c 11 新功能 那么我要问的是如何切换 Visual studio 2010 才能编译 c 11 源代码 你可以参考这个表 VC10 中的 C 0x 核心语言功能 表格 http blogs msdn com
  • C语言中没有循环可以打印数组吗?

    例如 在Python中 如果我们将一个列表作为数组 它会直接用一行代码打印整个数组 有什么办法可以用C语言实现同样的事情吗 简短回答 No 对表格上几乎所有问题的简短回答 用 C 语言做 X 工作能像用 Python 一样简单吗 No 长答
  • AcceptSocket 超时?

    是否有可能AcceptSocket on a TcpListener具有超时的对象 以便它偶尔被中断 TcpListener server new TcpListener localIP port server Start while sh
  • 打开位置设置页面或提示用户启用位置

    我一直在绞尽脑汁 徒劳地谷歌搜索 我正在尝试找到一种方法来提示用户通过直接进入设置页面或仅点击屏幕上的 是 来切换位置 我见过的所有代码似乎都不起作用 有人有有效的方法吗 一个详细的例子将不胜感激 谢谢 我对 Xamarin 开发非常陌生
  • 多个线程访问一个变量

    我在正在读的一本教科书中发现了这个问题 下面也给出了解决方案 我无法理解最小值怎么可能是 2 为什么一个线程不能读取 0 而所有其他线程都执行并写入 1 而无论是1还是2 最后写入的线程仍然必须完成自己的循环 int n 0 int mai
  • 原子的 C++ 内存屏障

    在这方面我是个新手 谁能提供以下内存屏障之间差异的简化解释 窗户MemoryBarrier 围栏 mm mfence 内联汇编asm volatile memory 内在的 ReadWriteBarrier 如果没有简单的解释 一些好文章或
  • 重定向 std::cout

    我需要一个类 在其对象的生命周期内将一个 ostream 重定向到另一个 ostream 经过一番修补后 我想出了这个 include
  • 如果项目包含多个文件夹,如何使用 Add-Migration

    我想Add Migration使用我的 DbContext 但出现错误 The term add migration is not recognized as the name of a cmdlet function script fil
  • 如何在 SQLite 中检查数据库是否存在 C#

    我目前正在用 C 编写一个应用程序 并使用 sqlite 作为嵌入式数据库 我的应用程序在启动时创建一个新数据库 但如何让它检查数据库是否存在 如果它确实存在 我如何让它使用它 如果不存在如何创建一个新数据库 这是我到目前为止所拥有的 pr
  • 使用 WinAPI 连接禁用的显示设备

    我的问题是启用禁用的监视器ChangeDisplaySettingsEx 我想这不是火箭科学 但经过一番挖掘后 它看起来仍然是不可能的 我找到了一种根据找到的 Microsoft 代码示例禁用所有辅助显示器的方法here https msd
  • 在 lua 中加载 C++ 模块时出现“尝试索引字符串值”错误

    我正在尝试使用 lua 用 C 编写的函数 下面给出的是cpp文件 extern C include lua h include lauxlib h include lualib h static int add 5 lua State L
  • 如何使用“路径”查询 XDocument?

    我想查询一个XDocument给定路径的对象 例如 path to element I want 但我不知道如何继续 您可以使用以下方法System Xml XPath Extensions http msdn microsoft com
  • 包含从代码隐藏 (ASP.NET C#) 到 ASPX 中的图像概述的图像列表 [关闭]

    就目前情况而言 这个问题不太适合我们的问答形式 我们希望答案得到事实 参考资料或专业知识的支持 但这个问题可能会引发辩论 争论 民意调查或扩展讨论 如果您觉得这个问题可以改进并可能重新开放 访问帮助中心 help reopen questi
  • execlp() 系统调用输出错误

    这个非常简单的例子exec 系统调用 在这里 我试图打电话execlp 两次 但是 我没有得到例外的输出 它仅显示当前目录的第一次调用的输出 include
  • 有没有办法在 C# 中仅通过文件名查找文件?

    我们现在使用绝对路径或相对路径在 C 应用程序中查找文件 如果文件位于当前工作目录下或 路径 之一下 有没有办法仅通过名称查找文件 使用绝对路径不好 使用相对路径也不够好 因为我们可能通过重命名或移动项目文件夹来更改项目结构 如果我们的代码
  • 线程安全的有限大小队列,不使用锁

    我正在尝试编写一个主题队列 但遇到死锁和其他多线程问题 我想用Interlocked CompareExchange避免lock用法 但这段代码并没有按预期工作 它只是擦除整个队列 我在这里做错了什么 public class FixedS

随机推荐

  • 物理渲染学习笔记(三)——Cook-Torrance微表面模型

    从 Phong 到 GGX 光照模型林林总总 一直没能找机会梳理一遍 这几天依次都自己实现了一遍 也正好总结下 Microfacet 普通的着色模型假设着色的区域是一个平滑的表面 表面的方向可以用一个单一的法线向量来定义来定义 而 Micr
  • 程序员吃青春饭?程序员在35岁以后是否需要转行?你规划好了吗?

    都说程序员是一个吃青春饭的职业 都认为程序员到了35岁以后不转管理岗位就没有什么前途了 可能就要考虑换别的行业了 年龄越大可能越写不动代码了 那么程序员是不是35岁以后需要转行 我说说我自己的观点 关于程序员35岁之后是不是要转行这个问题
  • 区块链技术基础(笔记)

    一 区块链本质上是一个对等网络 peer to peer 的分布式账本数据库 二 区块链本身其实是一串链接的数据区块 其链接 指针是采用密码学哈希算法对区块头进行处理所产生的区块头哈希值 三 基本概念 1 数据区块 比特币的交易会保存在数据
  • Element ui 导航栏 刷新时高亮

    1 在组件中
  • 原理解析:JS 代码是如何被浏览器引擎编译、执行的?

    原理解析 JS 代码是如何被浏览器引擎编译 执行的 分析浏览器引擎对 JS代码的编译情况 并结合日常的 JavaScript开发经验 重新理解底层的编译解析机制 对其底层原理的理解 将有助于理解前端的跨端应用 以及一套代码生成多种小程序相关
  • csu 1809 Parenthesis 2016湖南省赛 G

    Problem acm csu edu cn csuoj problemset problem pid 1809 vjudge net contest 161962 problem G Reference blog csdn net l95
  • spring之bean注入的意义

    简而言之就是 首先 service注解在当前类的上边 表示在当前类是spring管理的一个bean 使用 autowired 将另外一个A类的实体bean注入到当前类中 让当前类具备那个A类的功能
  • Android SDK & AVD Manager

    0 前言 Android源码中的prebuilts devtools tools android程序可根据不同的参数来启动SDK Manager或AVD Manager 1 SDK Manager 1 启动 android or andro
  • Chrome 基于 Wappalyzer 查看网站所用的前端技术栈

    1 找到谷歌商店 https chrome google com webstore search wappalyzer utm source ext app menu 2 搜索 Wappalyzer 3 添加至Chrome 4 使用 插件
  • MySQL的脏读、幻读、不可重复读

    首先我们要知道 我们的脏读 幻读 不可重复读这些概念是在事务中的概念 脏读 也就是读取了未提交的数据 比如我开启了一个事务A 在里面操作一个用户表 获取里面一个用户的积分 比如此时这个用户的积分是100 此时有另外一个事务B也操作了这个用户
  • LD3320语音识别

    芯片介绍 LD3320 不需要外接任何辅助的Flash芯片 RAM芯片和AD芯片 就可以完成语音识别功能 每次识别最多可以设置50项候选识别句 每个识别句可以是单字 词组或短句 另一方面 识别句内容可以动态编辑修改 只需要主控MCU把识别关
  • 碎碎念,浅浅饮-------Day30

    这不是一篇关乎技术的文章 它偏离了我原本的计划轨迹 但是 相信它的意义会远超出任何一项技术带给我的价值 高考已经开始了 不知道在这片宁静的夜空下有多少人已经美美的睡了 香甜憨然 又有多少人这睡着的眼角还挂着泪滴 偶尔蹙起眉头 却也记载不下那
  • 固态硬盘接口类型介绍

    固态硬盘接口类型介绍 现在装机硬盘肯定会首选SSD 容量小一点不怕 后面再补一个机械硬盘不迟 SSD有着稳固和高速的优势 深受用户喜爱 然而SSD有着各种各样的尺寸和接口 并不是每一个用户的电脑都能通用 所以选购SSD硬盘前必须先了解SSD
  • ajax请求出现闪屏,jquery $.Ajax 火狐浏览器闪屏解决办法

    本文章介绍了关于jquery的async false Ajax 火狐浏览器闪屏解决办法 jquery的async false 这个属性 默认是true 异步 false 同步 代码如下 复制代码 ajax type post url pat
  • vue2知识点梳理

    Vue梳理 对于Vue 我们并不陌生 现在我们来梳理一下关于它的东西吧 知识点 1 生命周期 最基本的就是它的生命周期 beforeCreate 在 beforeCreate 生命周期函数执行时 data 和 methods 中的数据都还没
  • Open3D (C++) 点云按坐标值大小进行排序

    目录 一 概述 二 点云排序 三 结果展示 一 概述 如题 点云按坐标大小进行排序 二 点云排序 代码以按照Z坐标的大小按照从小到大进行排序为例 include
  • java输出1~100之间的全部素数的5种方法

    文章目录 一 前言 二 需求分析 2 1 什么是素数 2 2 分析 三 代码实现 3 1 方法一 根据素数的定义来遍历检查 3 2 方法二 根据判断条件2进行遍历检查 减少遍历次数 3 3 方法三 根据判断条件3进行遍历检查 减少遍历次数
  • 达梦数据库调优组合索引的使用

    调优工程中对组合索引的使用的一个小总结 一 组合索引的执行计划 首先关于几个概念 等值条件和范围条件 1 等值条件 C1 X C1 X OR C1 Y 会被优化成C1 IN X Y C1 IN X Y 这种形式的我们都叫做等值条件 2 范围
  • Linux 安装Xrdp,实现RDP连接

    linux 安装xrdp RDP 连接 安装前提 root 权限 root server 76 conf yum install xrdp root 权限 安装 yum install xrdp Loaded plugins fastest
  • Eigen不同的方法来求矩阵的逆的效率

    背景 不同尺寸的矩阵 求逆使用不同的方法 会有不同的效率的 16x16矩阵的直接求逆与PartialPivLU的效率对比 本人亲测 1 实现代码 GetSystemTimeInMacroSecond的实现 boost posix time