add a Transposition section in page 2

This commit is contained in:
Gael Guennebaud
2010-06-28 00:05:11 +02:00
parent ca29620e25
commit de1220aa62
8 changed files with 63 additions and 16 deletions

View File

@@ -26,3 +26,5 @@ foreach(snippet_src ${snippets_SRCS})
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${compile_snippet_src}
PROPERTIES OBJECT_DEPENDS ${snippet_src})
endforeach(snippet_src)
ei_add_target_property(compile_tut_arithmetic_transpose_aliasing COMPILE_FLAGS -DEIGEN_NO_DEBUG)

View File

@@ -0,0 +1,4 @@
Matrix2i a; a << 1, 2, 3, 4;
cout << "Here is the matrix a:\n" << a << endl;
a = a.transpose(); // fails
cout << "and the aliasing effect:\n" << a << endl;

View File

@@ -0,0 +1,12 @@
MatrixXcf a = MatrixXcf::Random(2,2);
cout << "Here is the matrix a\n" << a << 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;

View File

@@ -0,0 +1,4 @@
MatrixXf a(2,3); a << 1, 2, 3, 4, 5, 6;
cout << "Here is the initial matrix a:\n" << a << endl;
a.transposeInPlace();
cout << "and after being transposed:\n" << a << endl;

View File

@@ -1,5 +0,0 @@
MatrixXf a(2,2);
cout << "a is of size " << a.rows() << "x" << a.cols() << std::endl;
MatrixXf b(3,3);
a = b;
cout << "a is now of size " << a.rows() << "x" << a.cols() << std::endl;