Re: [eigen] Feature suggestion: interior row and column ranges [patch attached]

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Thanks. Attaching examples patch after including the files in the dirs.

-- Manoj


On Tuesday 29 June 2010 03:24:01 pm Benoit Jacob wrote:
> 2010/6/29 Manoj Rajagopalan <rmanoj@xxxxxxxxx>:
> > On Tuesday 29 June 2010 02:45:30 pm Benoit Jacob wrote:
> >> 2) instead of attaching new .cpp files, please "hg add" them and
> >> generate a diff as usual (hg commit, hg export tip).
> >
> > The new .cpp files were example files. Where do I put them? I tried a
> > "find" in the working directory for other similarly named example files
> > but I couldn't find any.
>
> Full compilable examples go to doc/examples/
> That seems to be the case with your examples.
>
> Snippets go to doc/snippets/ (and are automatically completed into
> compilable form by CMake).
>
> Check it for yourself: add these files in doc/examples/, then do:
>   cmake .
>   make doc
>
> and you should get the docs generated with the output of these
> programs included.
>
> Benoit
>
> > thanks,
> > Manoj

# HG changeset patch
# User Manoj Rajagopalan <rmanoj@xxxxxxxxx>
# Date 1277911591 14400
# Node ID 10b1dc7c1e9f6d20bb9895a1c490109f2dedaa64
# Parent  3a3c6cb4a264fd9de3b2cd71d62451038da34842
Examples for DenseBase::middle{Rows,Cols}()

diff -r 3a3c6cb4a264 -r 10b1dc7c1e9f doc/examples/DenseBase_middleCols_int.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/examples/DenseBase_middleCols_int.cpp	Wed Jun 30 11:26:31 2010 -0400
@@ -0,0 +1,15 @@
+#include <Eigen/Core>
+#include <iostream>
+
+using namespace Eigen;
+using namespace std;
+
+int main(void)
+{
+    int const N = 5;
+    MatrixXi A(N,N);
+    A.setRandom();
+    cout << "A =\n" << A << '\n' << endl;
+    cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl;
+    return 0;
+}
diff -r 3a3c6cb4a264 -r 10b1dc7c1e9f doc/examples/DenseBase_middleRows_int.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/examples/DenseBase_middleRows_int.cpp	Wed Jun 30 11:26:31 2010 -0400
@@ -0,0 +1,15 @@
+#include <Eigen/Core>
+#include <iostream>
+
+using namespace Eigen;
+using namespace std;
+
+int main(void)
+{
+    int const N = 5;
+    MatrixXi A(N,N);
+    A.setRandom();
+    cout << "A =\n" << A << '\n' << endl;
+    cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
+    return 0;
+}
diff -r 3a3c6cb4a264 -r 10b1dc7c1e9f doc/examples/DenseBase_template_int_middleCols.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/examples/DenseBase_template_int_middleCols.cpp	Wed Jun 30 11:26:31 2010 -0400
@@ -0,0 +1,15 @@
+#include <Eigen/Core>
+#include <iostream>
+
+using namespace Eigen;
+using namespace std;
+
+int main(void)
+{
+    int const N = 5;
+    MatrixXi A(N,N);
+    A.setRandom();
+    cout << "A =\n" << A << '\n' << endl;
+    cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
+    return 0;
+}
diff -r 3a3c6cb4a264 -r 10b1dc7c1e9f doc/examples/DenseBase_template_int_middleRows.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/examples/DenseBase_template_int_middleRows.cpp	Wed Jun 30 11:26:31 2010 -0400
@@ -0,0 +1,15 @@
+#include <Eigen/Core>
+#include <iostream>
+
+using namespace Eigen;
+using namespace std;
+
+int main(void)
+{
+    int const N = 5;
+    MatrixXi A(N,N);
+    A.setRandom();
+    cout << "A =\n" << A << '\n' << endl;
+    cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << endl;
+    return 0;
+}


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/