[pure-lang-svn] SF.net SVN: pure-lang:[830] pure/trunk/lib/primitives.pure
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-09-22 21:14:19
|
Revision: 830
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=830&view=rev
Author: agraef
Date: 2008-09-22 21:14:10 +0000 (Mon, 22 Sep 2008)
Log Message:
-----------
Add matrix reversal operations.
Modified Paths:
--------------
pure/trunk/lib/primitives.pure
Modified: pure/trunk/lib/primitives.pure
===================================================================
--- pure/trunk/lib/primitives.pure 2008-09-22 20:53:37 UTC (rev 829)
+++ pure/trunk/lib/primitives.pure 2008-09-22 21:14:10 UTC (rev 830)
@@ -532,6 +532,13 @@
x::matrix' = matrix_transpose x;
+/* Reverse a matrix. rowrev reverses the rows, colrev the columns, reverse
+ both dimensions. */
+
+rowrev x::matrix = rowcat (reverse (rows x));
+colrev x::matrix = colcat (reverse (cols x));
+reverse x::matrix = rowrev (colrev x);
+
/* Matrix conversions. */
private matrix_double matrix_complex matrix_int;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|