Closed anranyicheng closed 1 year ago
now function from-list can do this:
(from-list '((1 2 3 4) (5 6 7 8)) '(2 4) :type 'double-float) (from-list '(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float) (from-list #(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float) (from-list #((1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float) (from-list #(#(1 2 3 4)(5 6 7 8)) '(2 4)) (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4)) (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4) :type '(complex single-float))
and result is: MAGICL> (from-list '((1 2 3 4) (5 6 7 8)) '(2 4) :type 'double-float)
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list '(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #((1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #(#(1 2 3 4)(5 6 7 8)) '(2 4))
1 2 3 4 5 6 7 8>
MAGICL> (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4))
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4) :type '(complex single-float))
1.000 + 0.000j 2.000 + 0.000j 3.000 + 0.000j 4.000 + 0.000j 5.000 + 0.000j 6.000 + 0.000j 7.000 + 0.000j 8.000 + 0.000j> MAGICL>
Thanks!
now function from-list can do this:
and result is: MAGICL> (from-list '((1 2 3 4) (5 6 7 8)) '(2 4) :type 'double-float)
<MATRIX/DOUBLE-FLOAT (2x4):
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list '(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
<MATRIX/DOUBLE-FLOAT (2x4):
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #(#(1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
<MATRIX/DOUBLE-FLOAT (2x4):
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #((1 2 3 4) #(5 6 7 8)) '(2 4) :type 'double-float)
<MATRIX/DOUBLE-FLOAT (2x4):
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list #(#(1 2 3 4)(5 6 7 8)) '(2 4))
<MATRIX/INT32 (2x4):
MAGICL> (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4))
<MATRIX/DOUBLE-FLOAT (2x4):
1.000 2.000 3.000 4.000 5.000 6.000 7.000 8.000> MAGICL> (from-list '((1.0d0 2 3 4)(5 6 7 8)) '(2 4) :type '(complex single-float))
<MATRIX/COMPLEX-SINGLE-FLOAT (2x4):
1.000 + 0.000j 2.000 + 0.000j 3.000 + 0.000j 4.000 + 0.000j 5.000 + 0.000j 6.000 + 0.000j 7.000 + 0.000j 8.000 + 0.000j> MAGICL>