mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Clang-format tests, examples, libraries, benchmarks, etc.
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
3252ecc7a4
commit
46e9cdb7fe
@@ -1,8 +1,7 @@
|
||||
typedef Matrix<float,Dynamic,2> DataMatrix;
|
||||
typedef Matrix<float, Dynamic, 2> DataMatrix;
|
||||
// let's generate some samples on the 3D plane of equation z = 2x+3y (with some noise)
|
||||
DataMatrix samples = DataMatrix::Random(12,2);
|
||||
VectorXf elevations = 2*samples.col(0) + 3*samples.col(1) + VectorXf::Random(12)*0.1;
|
||||
DataMatrix samples = DataMatrix::Random(12, 2);
|
||||
VectorXf elevations = 2 * samples.col(0) + 3 * samples.col(1) + VectorXf::Random(12) * 0.1;
|
||||
// and let's solve samples * [x y]^T = elevations in least square sense:
|
||||
Matrix<float,2,1> xy
|
||||
= (samples.adjoint() * samples).llt().solve((samples.adjoint()*elevations));
|
||||
Matrix<float, 2, 1> xy = (samples.adjoint() * samples).llt().solve((samples.adjoint() * elevations));
|
||||
cout << xy << endl;
|
||||
|
||||
Reference in New Issue
Block a user