keyword
stringclasses
7 values
repo_name
stringlengths
8
98
file_path
stringlengths
4
244
file_extension
stringclasses
29 values
file_size
int64
0
84.1M
line_count
int64
0
1.6M
content
stringlengths
1
84.1M
language
stringclasses
14 values
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_topRows_int.cpp
.cpp
233
7
Array44i a = Array44i::Random(); cout << "Here is the array a:" << endl << a << endl; cout << "Here is a.topRows(2):" << endl; cout << a.topRows(2) << endl; a.topRows(2).setZero(); cout << "Now the array a is:" << endl << a << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_block_int_int.cpp
.cpp
244
6
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2,2>(1,1) << endl; m.block<2,2>(1,1).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_applyOnTheRight.cpp
.cpp
292
10
Matrix3f A = Matrix3f::Random(3,3), B; B << 0,1,0, 0,0,1, 1,0,0; cout << "At start, A = " << endl << A << endl; A *= B; cout << "After A *= B, A = " << endl << A << endl; A.applyOnTheRight(B); // equivalent to A *= B cout << "After applyOnTheRight, A = " << endl << A << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/EigenSolver_compute.cpp
.cpp
361
7
EigenSolver<MatrixXf> es; MatrixXf A = MatrixXf::Random(4,4); es.compute(A, /* computeEigenvectors = */ false); cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; es.compute(A + MatrixXf::Identity(4,4), false); // re-use es to compute eigenvalues of A+I cout << "The eigenvalues of A+I are: " ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_noalias.cpp
.cpp
129
4
Matrix2d a, b, c; a << 1,2,3,4; b << 5,6,7,8; c.noalias() = a * b; // this computes the product directly to c cout << c << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/TopicAliasing_block_correct.cpp
.cpp
270
8
MatrixXi mat(3,3); mat << 1, 2, 3, 4, 5, 6, 7, 8, 9; cout << "Here is the matrix mat:\n" << mat << endl; // The eval() solves the aliasing problem mat.bottomRightCorner(2,2) = mat.topLeftCorner(2,2).eval(); cout << "After the assignment, mat = \n" << mat << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_ones_int.cpp
.cpp
77
3
cout << 6 * RowVectorXi::Ones(4) << endl; cout << VectorXf::Ones(2) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_quotient.cpp
.cpp
49
3
Array3d v(2,3,4), w(4,2,3); cout << v/w << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_end_int.cpp
.cpp
226
6
RowVector4i v = RowVector4i::Random(); cout << "Here is the vector v:" << endl << v << endl; cout << "Here is v.tail(2):" << endl << v.tail(2) << endl; v.tail(2).setZero(); cout << "Now the vector v is:" << endl << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_homogeneous.cpp
.cpp
486
6
Vector3d v = Vector3d::Random(), w; Projective3d P(Matrix4d::Random()); cout << "v = [" << v.transpose() << "]^T" << endl; cout << "h.homogeneous() = [" << v.homogeneous().transpose() << "]^T" << endl; cout << "(P * v.homogeneous()) = [" << (P * v.homo...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_tan.cpp
.cpp
58
3
Array3d v(M_PI, M_PI/2, M_PI/3); cout << v.tan() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_setRandom.cpp
.cpp
72
4
Matrix4i m = Matrix4i::Zero(); m.col(1).setRandom(); cout << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/LeastSquaresNormalEquations.cpp
.cpp
192
5
MatrixXf A = MatrixXf::Random(3, 2); VectorXf b = VectorXf::Random(3); cout << "The solution using normal equations is:\n" << (A.transpose() * A).ldlt().solve(A.transpose() * b) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_product.cpp
.cpp
141
5
Array33i a = Array33i::Random(), b = Array33i::Random(); Array33i c = a * b; cout << "a:\n" << a << "\nb:\n" << b << "\nc:\n" << c << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/ComplexEigenSolver_compute.cpp
.cpp
792
17
MatrixXcf A = MatrixXcf::Random(4,4); cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl; ComplexEigenSolver<MatrixXcf> ces; ces.compute(A); cout << "The eigenvalues of A are:" << endl << ces.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << ces.eigenvectors() << endl <...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_leftCols.cpp
.cpp
242
7
Array44i a = Array44i::Random(); cout << "Here is the array a:" << endl << a << endl; cout << "Here is a.leftCols<2>():" << endl; cout << a.leftCols<2>() << endl; a.leftCols<2>().setZero(); cout << "Now the array a is:" << endl << a << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/PartialRedux_squaredNorm.cpp
.cpp
180
4
Matrix3d m = Matrix3d::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the square norm of each row:" << endl << m.rowwise().squaredNorm() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_isDiagonal.cpp
.cpp
241
7
Matrix3d m = 10000 * Matrix3d::Identity(); m(0,2) = 1; cout << "Here's the matrix m:" << endl << m << endl; cout << "m.isDiagonal() returns: " << m.isDiagonal() << endl; cout << "m.isDiagonal(1e-3) returns: " << m.isDiagonal(1e-3) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_commainit_02.cpp
.cpp
215
8
int rows=5, cols=5; MatrixXf m(rows,cols); m << (Matrix3f() << 1, 2, 3, 4, 5, 6, 7, 8, 9).finished(), MatrixXf::Zero(3,cols-3), MatrixXf::Zero(rows-3,3), MatrixXf::Identity(rows-3,cols-3); cout << m;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_equal_equal.cpp
.cpp
52
3
Array3d v(1,2,3), w(3,2,1); cout << (v==w) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/HessenbergDecomposition_compute.cpp
.cpp
339
7
MatrixXcf A = MatrixXcf::Random(4,4); HessenbergDecomposition<MatrixXcf> hd(4); hd.compute(A); cout << "The matrix H in the decomposition of A is:" << endl << hd.matrixH() << endl; hd.compute(2*A); // re-use hd to compute and store decomposition of 2A cout << "The matrix H in the decomposition of 2A is:" << endl << hd....
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tridiagonalization_householderCoefficients.cpp
.cpp
303
7
Matrix4d X = Matrix4d::Random(4,4); Matrix4d A = X + X.transpose(); cout << "Here is a random symmetric 4x4 matrix:" << endl << A << endl; Tridiagonalization<Matrix4d> triOfA(A); Vector3d hc = triOfA.householderCoefficients(); cout << "The vector of Householder coefficients is:" << endl << hc << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_computeInverseWithCheck.cpp
.cpp
318
12
Matrix3d m = Matrix3d::Random(); cout << "Here is the matrix m:" << endl << m << endl; Matrix3d inverse; bool invertible; m.computeInverseWithCheck(inverse,invertible); if(invertible) { cout << "It is invertible, and its inverse is:" << endl << inverse << endl; } else { cout << "It is not invertible." << endl; }
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_ReshapeMat2Vec.cpp
.cpp
298
11
MatrixXf M1(3,3); // Column-major storage M1 << 1, 2, 3, 4, 5, 6, 7, 8, 9; Map<RowVectorXf> v1(M1.data(), M1.size()); cout << "v1:" << endl << v1 << endl; Matrix<float,Dynamic,Dynamic,RowMajor> M2(M1); Map<RowVectorXf> v2(M2.data(), M2.size()); cout << "v2:" << endl << v2 << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_AdvancedInitialization_Zero.cpp
.cpp
332
14
std::cout << "A fixed-size array:\n"; Array33f a1 = Array33f::Zero(); std::cout << a1 << "\n\n"; std::cout << "A one-dimensional dynamic-size array:\n"; ArrayXf a2 = ArrayXf::Zero(3); std::cout << a2 << "\n\n"; std::cout << "A two-dimensional dynamic-size array:\n"; ArrayXXf a3 = ArrayXXf::Zero(3, 4); std::cout << ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Matrix_setRandom_int_int.cpp
.cpp
50
4
MatrixXf m; m.setRandom(3, 3); cout << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_sinh.cpp
.cpp
64
3
ArrayXd v = ArrayXd::LinSpaced(5,0,1); cout << sinh(v) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/HouseholderQR_solve.cpp
.cpp
357
10
typedef Matrix<float,3,3> Matrix3x3; Matrix3x3 m = Matrix3x3::Random(); Matrix3f y = Matrix3f::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix y:" << endl << y << endl; Matrix3f x; x = m.householderQr().solve(y); assert(y.isApprox(m*x)); cout << "Here is a solution x to the e...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_bottomRightCorner_int_int.cpp
.cpp
274
7
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.bottomRightCorner(2, 2):" << endl; cout << m.bottomRightCorner(2, 2) << endl; m.bottomRightCorner(2, 2).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_abs.cpp
.cpp
45
3
Array3d v(1,-2,-3); cout << v.abs() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_selfadjointView.cpp
.cpp
361
7
Matrix3i m = Matrix3i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the symmetric matrix extracted from the upper part of m:" << endl << Matrix3i(m.selfadjointView<Upper>()) << endl; cout << "Here is the symmetric matrix extracted from the lower part of m:" << endl << Matri...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/JacobiSVD_basic.cpp
.cpp
614
10
MatrixXf m = MatrixXf::Random(3,2); cout << "Here is the matrix m:" << endl << m << endl; JacobiSVD<MatrixXf> svd(m, ComputeThinU | ComputeThinV); cout << "Its singular values are:" << endl << svd.singularValues() << endl; cout << "Its left singular vectors are the columns of the thin U matrix:" << endl << svd.matrixU(...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_select.cpp
.cpp
115
7
MatrixXi m(3, 3); m << 1, 2, 3, 4, 5, 6, 7, 8, 9; m = (m.array() >= 5).select(-m, m); cout << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_round.cpp
.cpp
93
4
ArrayXd v = ArrayXd::LinSpaced(7,-2,2); cout << v << endl << endl; cout << round(v) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_identity.cpp
.cpp
50
2
cout << Matrix<double, 3, 4>::Identity() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_diagonal_template_int.cpp
.cpp
274
6
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here are the coefficients on the 1st super-diagonal and 2nd sub-diagonal of m:" << endl << m.diagonal<1>().transpose() << endl << m.diagonal<-2>().transpose() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_cos.cpp
.cpp
58
3
Array3d v(M_PI, M_PI/2, M_PI/3); cout << v.cos() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/EigenSolver_pseudoEigenvectors.cpp
.cpp
430
10
MatrixXd A = MatrixXd::Random(6,6); cout << "Here is a random 6x6 matrix, A:" << endl << A << endl << endl; EigenSolver<MatrixXd> es(A); MatrixXd D = es.pseudoEigenvalueMatrix(); MatrixXd V = es.pseudoEigenvectors(); cout << "The pseudo-eigenvalue matrix D is:" << endl << D << endl; cout << "The pseudo-eigenvector mat...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_arg.cpp
.cpp
85
4
ArrayXcf v = ArrayXcf::Random(3); cout << v << endl << endl; cout << arg(v) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_Map_rowmajor.cpp
.cpp
299
8
int array[8]; for(int i = 0; i < 8; ++i) array[i] = i; cout << "Column-major:\n" << Map<Matrix<int,2,4> >(array) << endl; cout << "Row-major:\n" << Map<Matrix<int,2,4,RowMajor> >(array) << endl; cout << "Row-major using stride:\n" << Map<Matrix<int,2,4>, Unaligned, Stride<1,4> >(array) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_eval.cpp
.cpp
467
13
Matrix2f M = Matrix2f::Random(); Matrix2f m; m = M; cout << "Here is the matrix m:" << endl << m << endl; cout << "Now we want to copy a column into a row." << endl; cout << "If we do m.col(1) = m.row(0), then m becomes:" << endl; m.col(1) = m.row(0); cout << m << endl << "which is wrong!" << endl; cout << "Now let us ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_topRows.cpp
.cpp
239
7
Array44i a = Array44i::Random(); cout << "Here is the array a:" << endl << a << endl; cout << "Here is a.topRows<2>():" << endl; cout << a.topRows<2>() << endl; a.topRows<2>().setZero(); cout << "Now the array a is:" << endl << a << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_segment_int_int.cpp
.cpp
244
6
RowVector4i v = RowVector4i::Random(); cout << "Here is the vector v:" << endl << v << endl; cout << "Here is v.segment(1, 2):" << endl << v.segment(1, 2) << endl; v.segment(1, 2).setZero(); cout << "Now the vector v is:" << endl << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/HouseholderSequence_HouseholderSequence.cpp
.cpp
1,316
32
Matrix3d v = Matrix3d::Random(); cout << "The matrix v is:" << endl; cout << v << endl; Vector3d v0(1, v(1,0), v(2,0)); cout << "The first Householder vector is: v_0 = " << v0.transpose() << endl; Vector3d v1(0, 1, v(2,1)); cout << "The second Householder vector is: v_1 = " << v1.transpose() << endl; Vector3d v2(0, 0...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/FullPivLU_solve.cpp
.cpp
413
12
Matrix<float,2,3> m = Matrix<float,2,3>::Random(); Matrix2f y = Matrix2f::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the matrix y:" << endl << y << endl; Matrix<float,3,2> x = m.fullPivLu().solve(y); if((m*x).isApprox(y)) { cout << "Here is a solution x to the equation mx=y:" << ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/RealSchur_compute.cpp
.cpp
343
7
MatrixXf A = MatrixXf::Random(4,4); RealSchur<MatrixXf> schur(4); schur.compute(A, /* computeU = */ false); cout << "The matrix T in the decomposition of A is:" << endl << schur.matrixT() << endl; schur.compute(A.inverse(), /* computeU = */ false); cout << "The matrix T in the decomposition of A^(-1) is:" << endl << sc...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_replicate.cpp
.cpp
170
5
MatrixXi m = MatrixXi::Random(2,3); cout << "Here is the matrix m:" << endl << m << endl; cout << "m.replicate<3,2>() = ..." << endl; cout << m.replicate<3,2>() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_boolean_or.cpp
.cpp
64
3
Array3d v(-1,2,1), w(-3,2,3); cout << ((v<w) || (v<0)) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_solve_multiple_rhs.cpp
.cpp
318
11
Matrix3f A(3,3); A << 1,2,3, 4,5,6, 7,8,10; Matrix<float,3,2> B; B << 3,1, 3,1, 4,1; Matrix<float,3,2> X; X = A.fullPivLu().solve(B); cout << "The solution with right-hand side (3,3,4) is:" << endl; cout << X.col(0) << endl; cout << "The solution with right-hand side (1,1,1) is:" << endl; cout << X.col(1) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_int_block_int_int_int_int.cpp
.cpp
264
6
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the block:" << endl << m.block<2, Dynamic>(1, 1, 2, 3) << endl; m.block<2, Dynamic>(1, 1, 2, 3).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_greater.cpp
.cpp
51
3
Array3d v(1,2,3), w(3,2,1); cout << (v>w) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner_int_int.cpp
.cpp
301
7
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.bottomLeftCorner<2,Dynamic>(2,2):" << endl; cout << m.bottomLeftCorner<2,Dynamic>(2,2) << endl; m.bottomLeftCorner<2,Dynamic>(2,2).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_ceil.cpp
.cpp
92
4
ArrayXd v = ArrayXd::LinSpaced(7,-2,2); cout << v << endl << endl; cout << ceil(v) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType2.cpp
.cpp
396
10
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X * X.transpose(); X = MatrixXd::Random(5,5); MatrixXd B = X * X.transpose(); GeneralizedSelfAdjointEigenSolver<MatrixXd> es(A,B,EigenvaluesOnly); cout << "The eigenvalues of the pencil (A,B) are:" << endl << es.eigenvalues() << endl; es.compute(B,A,false); cout << "The...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/ComplexEigenSolver_eigenvalues.cpp
.cpp
216
5
MatrixXcf ones = MatrixXcf::Ones(3,3); ComplexEigenSolver<MatrixXcf> ces(ones, /* computeEigenvectors = */ false); cout << "The eigenvalues of the 3x3 matrix of ones are:" << endl << ces.eigenvalues() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_col.cpp
.cpp
82
4
Matrix3d m = Matrix3d::Identity(); m.col(1) = Vector3d(4,5,6); cout << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_int_topRightCorner_int_int.cpp
.cpp
295
7
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.topRightCorner<2,Dynamic>(2,2):" << endl; cout << m.topRightCorner<2,Dynamic>(2,2) << endl; m.topRightCorner<2,Dynamic>(2,2).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_set.cpp
.cpp
290
14
Matrix3i m1; m1 << 1, 2, 3, 4, 5, 6, 7, 8, 9; cout << m1 << endl << endl; Matrix3i m2 = Matrix3i::Identity(); m2.block(0,0, 2,2) << 10, 11, 12, 13; cout << m2 << endl << endl; Vector2i v1; v1 << 14, 15; m2 << v1.transpose(), 16, v1, m1.block(1,1,2,2); cout << m2 << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_start_int.cpp
.cpp
226
6
RowVector4i v = RowVector4i::Random(); cout << "Here is the vector v:" << endl << v << endl; cout << "Here is v.head(2):" << endl << v.head(2) << endl; v.head(2).setZero(); cout << "Now the vector v is:" << endl << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/SelfAdjointView_operatorNorm.cpp
.cpp
157
4
MatrixXd ones = MatrixXd::Ones(3,3); cout << "The operator norm of the 3x3 matrix of ones is " << ones.selfadjointView<Lower>().operatorNorm() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_asin.cpp
.cpp
55
3
Array3d v(0, sqrt(2.)/2, 1); cout << v.asin() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_int_topLeftCorner_int_int.cpp
.cpp
292
7
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.topLeftCorner<2,Dynamic>(2,2):" << endl; cout << m.topLeftCorner<2,Dynamic>(2,2) << endl; m.topLeftCorner<2,Dynamic>(2,2).setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/TopicStorageOrders_example.cpp
.cpp
525
19
Matrix<int, 3, 4, ColMajor> Acolmajor; Acolmajor << 8, 2, 2, 9, 9, 1, 4, 4, 3, 5, 4, 5; cout << "The matrix A:" << endl; cout << Acolmajor << endl << endl; cout << "In memory (column-major):" << endl; for (int i = 0; i < Acolmajor.size(); i++) cout << *(Acolmajor.data() + i) << " "; cout << endl...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Matrix_resize_int_int.cpp
.cpp
407
10
MatrixXd m(2,3); m << 1,2,3,4,5,6; cout << "here's the 2x3 matrix m:" << endl << m << endl; cout << "let's resize m to 3x2. This is a conservative resizing because 2*3==3*2." << endl; m.resize(3,2); cout << "here's the 3x2 matrix m:" << endl << m << endl; cout << "now let's resize m to size 2x2. This is NOT a conservat...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_cube.cpp
.cpp
44
3
Array3d v(2,3,4); cout << v.cube() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_sqrt.cpp
.cpp
44
3
Array3d v(1,2,4); cout << v.sqrt() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Matrix_setConstant_int.cpp
.cpp
52
4
VectorXf v; v.setConstant(3, 5); cout << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_asDiagonal.cpp
.cpp
56
2
cout << Matrix3i(Vector3i(2,5,6).asDiagonal()) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_cwiseMin.cpp
.cpp
60
3
Vector3d v(2,3,4), w(4,2,3); cout << v.cwiseMin(w) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_bottomRows_int.cpp
.cpp
242
7
Array44i a = Array44i::Random(); cout << "Here is the array a:" << endl << a << endl; cout << "Here is a.bottomRows(2):" << endl; cout << a.bottomRows(2) << endl; a.bottomRows(2).setZero(); cout << "Now the array a is:" << endl << a << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_sign.cpp
.cpp
45
3
Array3d v(-3,5,0); cout << v.sign() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Map_placement_new.cpp
.cpp
182
5
int data[] = {1,2,3,4,5,6,7,8,9}; Map<RowVectorXi> v(data,4); cout << "The mapped vector v is: " << v << "\n"; new (&v) Map<RowVectorXi>(data+4,5); cout << "Now v is: " << v << "\n";
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/HessenbergDecomposition_matrixH.cpp
.cpp
391
9
Matrix4f A = MatrixXf::Random(4,4); cout << "Here is a random 4x4 matrix:" << endl << A << endl; HessenbergDecomposition<MatrixXf> hessOfA(A); MatrixXf H = hessOfA.matrixH(); cout << "The Hessenberg matrix H is:" << endl << H << endl; MatrixXf Q = hessOfA.matrixQ(); cout << "The orthogonal matrix Q is:" << endl << Q <<...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_isUnitary.cpp
.cpp
231
6
Matrix3d m = Matrix3d::Identity(); m(0,2) = 1e-4; cout << "Here's the matrix m:" << endl << m << endl; cout << "m.isUnitary() returns: " << m.isUnitary() << endl; cout << "m.isUnitary(1e-3) returns: " << m.isUnitary(1e-3) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/TopicAliasing_mult3.cpp
.cpp
86
5
MatrixXf matA(2,2); matA << 2, 0, 0, 2; matA.noalias() = matA * matA; cout << matA;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/PartialRedux_prod.cpp
.cpp
169
4
Matrix3d m = Matrix3d::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the product of each row:" << endl << m.rowwise().prod() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_random.cpp
.cpp
42
2
cout << 100 * Matrix2i::Random() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/SelfAdjointEigenSolver_compute_MatrixType.cpp
.cpp
365
8
SelfAdjointEigenSolver<MatrixXf> es(4); MatrixXf X = MatrixXf::Random(4,4); MatrixXf A = X + X.transpose(); es.compute(A); cout << "The eigenvalues of A are: " << es.eigenvalues().transpose() << endl; es.compute(A + MatrixXf::Identity(4,4)); // re-use es to compute eigenvalues of A+I cout << "The eigenvalues of A+I are...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_start.cpp
.cpp
230
6
RowVector4i v = RowVector4i::Random(); cout << "Here is the vector v:" << endl << v << endl; cout << "Here is v.head(2):" << endl << v.head<2>() << endl; v.head<2>().setZero(); cout << "Now the vector v is:" << endl << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType.cpp
.cpp
816
18
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X + X.transpose(); cout << "Here is a random symmetric 5x5 matrix, A:" << endl << A << endl << endl; SelfAdjointEigenSolver<MatrixXd> es(A); cout << "The eigenvalues of A are:" << endl << es.eigenvalues() << endl; cout << "The matrix of eigenvectors, V, is:" << endl << ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_cwiseMax.cpp
.cpp
60
3
Vector3d v(2,3,4), w(4,2,3); cout << v.cwiseMax(w) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_colwise.cpp
.cpp
287
6
Matrix3d m = Matrix3d::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the sum of each column:" << endl << m.colwise().sum() << endl; cout << "Here is the maximum absolute value of each column:" << endl << m.cwiseAbs().colwise().maxCoeff() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_times_equal.cpp
.cpp
55
4
Array3d v(1,2,3), w(2,3,0); v *= w; cout << v << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_SlicingCol.cpp
.cpp
610
11
MatrixXf M1 = MatrixXf::Random(3,8); cout << "Column major input:" << endl << M1 << "\n"; Map<MatrixXf,0,OuterStride<> > M2(M1.data(), M1.rows(), (M1.cols()+2)/3, OuterStride<>(M1.outerStride()*3)); cout << "1 column over 3:" << endl << M2 << "\n"; typedef Matrix<float,Dynamic,Dynamic,RowMajor> RowMajorMatrixXf; RowMa...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_isFinite.cpp
.cpp
104
6
Array3d v(1,2,3); v(1) *= 0.0/0.0; v(2) /= 0.0; cout << v << endl << endl; cout << isfinite(v) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_zero_int.cpp
.cpp
73
3
cout << RowVectorXi::Zero(4) << endl; cout << VectorXf::Zero(2) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_solve_triangular.cpp
.cpp
273
9
Matrix3f A; Vector3f b; A << 1,2,3, 0,5,6, 0,0,10; b << 3, 3, 4; cout << "Here is the matrix A:" << endl << A << endl; cout << "Here is the vector b:" << endl << b << endl; Vector3f x = A.triangularView<Upper>().solve(b); cout << "The solution is:" << endl << x << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_commainit_01.cpp
.cpp
70
6
Matrix3f m; m << 1, 2, 3, 4, 5, 6, 7, 8, 9; std::cout << m;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/IOFormat.cpp
.cpp
603
15
std::string sep = "\n----------------------------------------\n"; Matrix3d m1; m1 << 1.111111, 2, 3.33333, 4, 5, 6, 7, 8.888888, 9; IOFormat CommaInitFmt(StreamPrecision, DontAlignCols, ", ", ", ", "", "", " << ", ";"); IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]"); IOFormat OctaveFmt(StreamPrecision, 0, ", ", ";\n", ...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Cwise_minus.cpp
.cpp
39
3
Array3d v(1,2,3); cout << v-5 << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Matrix_setZero_int_int.cpp
.cpp
48
4
MatrixXf m; m.setZero(3, 3); cout << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/SelfAdjointEigenSolver_SelfAdjointEigenSolver_MatrixType2.cpp
.cpp
826
17
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X + X.transpose(); cout << "Here is a random symmetric matrix, A:" << endl << A << endl; X = MatrixXd::Random(5,5); MatrixXd B = X * X.transpose(); cout << "and a random postive-definite matrix, B:" << endl << B << endl << endl; GeneralizedSelfAdjointEigenSolver<MatrixX...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/DenseBase_LinSpaced.cpp
.cpp
117
3
cout << VectorXi::LinSpaced(4,7,10).transpose() << endl; cout << VectorXd::LinSpaced(5,0.0,1.0).transpose() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/ComplexSchur_matrixU.cpp
.cpp
221
5
MatrixXcf A = MatrixXcf::Random(4,4); cout << "Here is a random 4x4 matrix, A:" << endl << A << endl << endl; ComplexSchur<MatrixXcf> schurOfA(A); cout << "The unitary matrix U is:" << endl << schurOfA.matrixU() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Vectorwise_reverse.cpp
.cpp
536
11
MatrixXi m = MatrixXi::Random(3,4); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is the rowwise reverse of m:" << endl << m.rowwise().reverse() << endl; cout << "Here is the colwise reverse of m:" << endl << m.colwise().reverse() << endl; cout << "Here is the coefficient (1,0) in the rowise reve...
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_template_int_int_bottomLeftCorner.cpp
.cpp
274
7
Matrix4i m = Matrix4i::Random(); cout << "Here is the matrix m:" << endl << m << endl; cout << "Here is m.bottomLeftCorner<2,2>():" << endl; cout << m.bottomLeftCorner<2,2>() << endl; m.bottomLeftCorner<2,2>().setZero(); cout << "Now the matrix m is:" << endl << m << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_isZero.cpp
.cpp
215
6
Matrix3d m = Matrix3d::Zero(); m(0,2) = 1e-4; cout << "Here's the matrix m:" << endl << m << endl; cout << "m.isZero() returns: " << m.isZero() << endl; cout << "m.isZero(1e-3) returns: " << m.isZero(1e-3) << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tutorial_SlicingVec.cpp
.cpp
179
4
RowVectorXf v = RowVectorXf::LinSpaced(20,0,19); cout << "Input:" << endl << v << endl; Map<RowVectorXf,0,InnerStride<2> > v2(v.data(), v.size()/2); cout << "Even:" << v2 << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/MatrixBase_cast.cpp
.cpp
119
4
Matrix2d md = Matrix2d::Identity() * 0.45; Matrix2f mf = Matrix2f::Identity(); cout << md + mf.cast<double>() << endl;
C++
2D
JaeHyunLee94/mpm2d
external/eigen-3.3.9/doc/snippets/Tridiagonalization_decomposeInPlace.cpp
.cpp
475
11
MatrixXd X = MatrixXd::Random(5,5); MatrixXd A = X + X.transpose(); cout << "Here is a random symmetric 5x5 matrix:" << endl << A << endl << endl; VectorXd diag(5); VectorXd subdiag(4); internal::tridiagonalization_inplace(A, diag, subdiag, true); cout << "The orthogonal matrix Q is:" << endl << A << endl; cout << "Th...
C++