Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,32 @@
|
|||
#include<hopper.h>
|
||||
#proto showarraydata(_X_)
|
||||
main:
|
||||
.stack 12
|
||||
nCols=0, nRows=0,nDims=0
|
||||
A=-1,{5,11} rand array(A),mulby(10),ceil,mov(A)
|
||||
{"ORIGINAL ARRAY :\n",A}
|
||||
|
||||
_show array data(A)
|
||||
|
||||
/* transpose */
|
||||
TA=0,{nCols,nRows} nan array(TA)
|
||||
Limit = nRows
|
||||
{nRows}gthan(nCols) do{ Limit = nCols }
|
||||
|
||||
for (i=1, {i} lethan (Limit), ++i)
|
||||
[i,i:end]get(A), [i:end,i]put(TA)
|
||||
[i:end,i]get(A), [i,i:end]put(TA)
|
||||
next
|
||||
clear mark
|
||||
{"ARRAY TRANSPOSE:\n",TA}println
|
||||
_show array data(TA)
|
||||
exit(0)
|
||||
|
||||
.locals
|
||||
show array data(A)
|
||||
{"\nSIZE ARRAY : "},size=0,size(A),cpy(size),
|
||||
dims(size,nDims)
|
||||
rows(size,nRows)
|
||||
cols(size,nCols)
|
||||
{"\nDIMENSION = ",nDims,"; ROWS = ",nRows,"; COLS = ",nCols,"\n"}, println
|
||||
back
|
||||
Loading…
Add table
Add a link
Reference in a new issue