changeset 27359:60bb69799591 stable

doc: Add example to show limitations of the given BLAS integer size. * doc/interpreter/install.txi: Add an example to clarify what is still not working since Octave changed to 64 bit indices. This example might also be helpful to explain the differnce between "octave-5.1.0-w64-64" and "octave-5.1.0-w64". This example makes use of double assignment, copy on write, and "single" to only require 8 GB to work on nowadays laptops as well. Without these optimizations and double precision, this example requires 32 GB.
author Kai T. Ohlhus <k.ohlhus@gmail.com>
date Thu, 29 Aug 2019 17:17:13 +0900
parents 4e632e942e84
children 89c6dfbda411 a7d21a6a7922
files doc/interpreter/install.txi
diffstat 1 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/doc/interpreter/install.txi	Tue Aug 27 11:07:07 2019 +0900
+++ b/doc/interpreter/install.txi	Thu Aug 29 17:17:13 2019 +0900
@@ -658,6 +658,40 @@
 this way.  If you wish to experiment with large arrays, the following
 information may be helpful.
 
+To determine the integer size of the BLAS library used by Octave, the
+following code can be executed:
+
+@example
+@group
+clear all;
+N = 2^31;
+## The following line requires about 8 GB of RAM!
+a = b = ones (N, 1, "single");
+c = a' * b
+@end group
+@end example
+
+If the BLAS library uses 32-bit integers, an error will be thrown:
+
+@example
+@group
+error: integer dimension or index out of range for Fortran
+INTEGER type
+@end group
+@end example
+
+Otherwise, if the BLAS library uses 64-bit integers, the result is:
+
+@example
+c = 2^31 = 2147483648
+@end example
+
+Note that the test case above usually requires twice the memory, if
+@var{a} and @var{b} are not assigned by @code{a = b = @dots{}}.
+Note further, that the data type @code{single} has a precision of
+about 23 binary bits.  In this particular example no rounding errors
+occur.
+
 The following instructions were tested with the development version of
 Octave and GCC 4.3.4 on an x86_64 Debian system and may be out of date
 now.  Please report any problems or corrections on the Octave bug