File: rtest_scalarp.mac

package info (click to toggle)
maxima 5.27.0-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 120,648 kB
  • sloc: lisp: 322,503; fortran: 14,666; perl: 14,343; tcl: 11,031; sh: 4,146; makefile: 2,047; ansic: 471; awk: 24; sed: 10
file content (70 lines) | stat: -rw-r--r-- 914 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
(kill (all), 0);
0;

(remvalue(a,b,c,d,x,y),0);
0$

(declare([a,b],scalar),0);
0$

(sc : [-5 ,0, 8, 7.8, 1.23b0, %pi, %phi, %i, sqrt(1+%pi), a, a*b, a+b, a/b,a^3, b^a, a^sqrt(2)],0);
0$

(buggy : [],0);
0$

(for si in sc do if not(scalarp(si)) then buggy : cons(si,buggy),0);
0$

buggy;
[]$

(nsc : [x,x+y,x*y,x^3, x = y, x < y, x^^5, cosh(x), sqrt(x), [5,x], matrix([1,2],[3,4])],0);
0$

(buggy : [],0);
0$

(for si in nsc do if scalarp(si) then buggy : cons(si,buggy),0);
0$

buggy;
[]$

determinant(matrix([1,2],[3,4]));
-2$

determinant(matrix([a,b],[c,d]));
a*d - b * c$

determinant(a);
a$

is(verbify(op(determinant(x))) = 'determinant);
true$

determinant(sqrt(5));
sqrt(5)$

determinant(7*%i + 5);
7*%i + 5$

block([matrix_element_add:'f, matrix_element_mult:'g],
  determinant( matrix([a,b],[c,d]) ) );
f(f(0,g(1,a,d)),g(-1,b,c))$

(remove([a,b],scalar),0);
0$

(remvalue(sc, nsc,buggy),0);
0$