Sponsored links: Algebra eBooks
 

Help Index

A

B

C

D

E

F

G

H

I

J

K

L

M

N

O

P

Q

R

S

T

U

V

W

X

Y

Z

The Maxima on-line user's manual

Algebra Calculator

Search:

Use_fast_arrays

-- Option variable: use_fast_arrays - if true then only two types of arrays are recognized.

1) The art-q array (t in Common Lisp) which may have several dimensions indexed by integers, and may hold any Lisp or Maxima object as an entry. To construct such an array, enter a:make_array(any,3,4); then a will have as value, an array with twelve slots, and the indexing is zero based.

load(draw);
gnuplot_reset();
multiplot_mode(none);
use_fast_arrays:true;
translate_fast_arrays:false;
remarray(all);
kill(a, f, k, x, i);
f(k, x):=(sin(3/2*k)/k)*((2/3)*cos(k*x));
a[i]:=gr2d(explicit((1)+ sum(f(k, x), k, 1, 10^(i-1)), x, -2, 2)), numer;
draw(a[1], a[2], columns=2);

2) The Hash_table array which is the default type of array created if one does b[x+1]:y^2 (and b is not already an array, a list, or a matrix - if it were one of these an error would be caused since x+1 would not be a valid subscript for an art-q array, a list or a matrix). Its indices (also known as keys) may be any object. It only takes one key at a time (b[x+1,u]:y would ignore the u). Referencing is done by b[x+1] ==> y^2. Of course the key may be a list, e.g. b[[x+1,u]]:y would be valid. This is incompatible with the old Maxima hash arrays, but saves consing.

An advantage of storing the arrays as values of the symbol is that the usual conventions about local variables of a function apply to arrays as well. The Hash_table type also uses less consing and is more efficient than the old type of Maxima hashar. To obtain consistent behaviour in translated and compiled code set translate_fast_arrays to be true.

(%o1)                                true
(%i2) 

Related Examples

arrays-define-functions-sqrt

F_1 (x) := x - 100;

F_2 (x, y) := x / y;

define (F_3 (x), sqr...

Calculate

arrays-define-functions-sqrt

f_1 (x) := x - 100;

f_2 (x, y) := x / y;

define (f_3 (x), sqr...

Calculate

arrays

described(arrays);

Calculate

arrays

a[1,2]:3;

arrays;

Calculate

arrays

described(arrays);

Calculate