Data update

This commit is contained in:
Ingy döt Net 2026-02-01 16:33:20 -08:00
parent 5150844a7d
commit 4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions

View file

@ -1,27 +0,0 @@
with Ada.Numerics.Real_Arrays; use Ada.Numerics.Real_Arrays;
with Ada.Text_IO; use Ada.Text_IO;
procedure Matrix_Transpose is
procedure Put (X : Real_Matrix) is
type Fixed is delta 0.01 range -500.0..500.0;
begin
for I in X'Range (1) loop
for J in X'Range (2) loop
Put (Fixed'Image (Fixed (X (I, J))));
end loop;
New_Line;
end loop;
end Put;
Matrix : constant Real_Matrix :=
( (0.0, 0.1, 0.2, 0.3),
(0.4, 0.5, 0.6, 0.7),
(0.8, 0.9, 1.0, 1.1)
);
begin
Put_Line ("Before Transposition:");
Put (Matrix);
New_Line;
Put_Line ("After Transposition:");
Put (Transpose (Matrix));
end Matrix_Transpose;

View file

@ -1,7 +0,0 @@
(require 'cl-lib)
(defun transpose (m)
(apply #'cl-mapcar #'list m))
;;test for transposition function
(transpose '((2 3 4 5) (3 5 6 9) (9 9 9 9)))

View file

@ -1,7 +0,0 @@
(defun matrix-transposition (m)
(apply #'seq-mapn (append (list #'list) m)) )
(let ((m '(( 2 0 -5 -1)
(-3 -2 -4 7)
(-1 -3 0 -6))))
(message "%s" (matrix-transposition m)) )

View file

@ -1,19 +0,0 @@
function transpose(sequence in)
sequence out
out = repeat(repeat(0,length(in)),length(in[1]))
for n = 1 to length(in) do
for m = 1 to length(in[1]) do
out[m][n] = in[n][m]
end for
end for
return out
end function
sequence m
m = {
{1,2,3,4},
{5,6,7,8},
{9,10,11,12}
}
? transpose(m)

View file

@ -1,17 +0,0 @@
class Matrix {
static function main() {
var m = [ [1, 1, 1, 1],
[2, 4, 8, 16],
[3, 9, 27, 81],
[4, 16, 64, 256],
[5, 25, 125, 625] ];
var t = [ for (i in 0...m[0].length)
[ for (j in 0...m.length) 0 ] ];
for(i in 0...m.length)
for(j in 0...m[0].length)
t[j][i] = m[i][j];
for(aa in [m, t])
for(a in aa) Sys.println(a);
}
}

View file

@ -1,13 +1,6 @@
(defun transpose (matrix)
(transpose matrix '()))
(defun transpose (matrix acc)
(cond
((lists:any
(lambda (x) (== x '()))
matrix)
acc)
('true
(let ((heads (lists:map #'car/1 matrix))
(tails (lists:map #'cdr/1 matrix)))
(transpose tails (++ acc `(,heads)))))))
(defun transpose
((`(() . ,_))
'())
((matrix)
(cons (lists:map #'car/1 matrix)
(transpose (lists:map #'cdr/1 matrix)))))

View file

@ -1,58 +0,0 @@
function transpose($a) {
$arr = @()
if($a) {
$n = $a.count - 1
if(0 -lt $n) {
$m = ($a | foreach {$_.count} | measure-object -Minimum).Minimum - 1
if( 0 -le $m) {
if (0 -lt $m) {
$arr =@(0)*($m+1)
foreach($i in 0..$m) {
$arr[$i] = foreach($j in 0..$n) {@($a[$j][$i])}
}
} else {$arr = foreach($row in $a) {$row[0]}}
}
} else {$arr = $a}
}
$arr
}
function show($a) {
if($a) {
0..($a.Count - 1) | foreach{ if($a[$_]){"$($a[$_])"}else{""} }
}
}
$a = @(@(2, 0, 7, 8),@(3, 5, 9, 1),@(4, 1, 6, 3))
"`$a ="
show $a
""
"transpose `$a ="
show (transpose $a)
""
$a = @(1)
"`$a ="
show $a
""
"transpose `$a ="
show (transpose $a)
""
"`$a ="
$a = @(1,2,3)
show $a
""
"transpose `$a ="
"$(transpose $a)"
""
"`$a ="
$a = @(@(4,7,8),@(1),@(2,3))
show $a
""
"transpose `$a ="
"$(transpose $a)"
""
"`$a ="
$a = @(@(4,7,8),@(1,5,9,0),@(2,3))
show $a
""
"transpose `$a ="
show (transpose $a)

View file

@ -1,22 +0,0 @@
function transpose($a) {
if($a) {
$n = $a.Count - 1
foreach($i in 0..$n) {
$j = 0
while($j -lt $i) {
$a[$i][$j], $a[$j][$i] = $a[$j][$i], $a[$i][$j]
$j++
}
}
}
$a
}
function show($a) {
if($a) {
0..($a.Count - 1) | foreach{ if($a[$_]){"$($a[$_])"}else{""} }
}
}
$a = @(@(2, 4, 7),@(3, 5, 9),@(4, 1, 6))
show $a
""
show (transpose $a)

View file

@ -1,2 +0,0 @@
(define (transpose m)
(apply map list m))

View file

@ -1,31 +0,0 @@
'create and display the initial matrix
WScript.StdOut.WriteLine "Initial Matrix:"
x = 4 : y = 6 : n = 1
Dim matrix()
ReDim matrix(x,y)
For i = 0 To y
For j = 0 To x
matrix(j,i) = n
If j < x Then
WScript.StdOut.Write n & vbTab
Else
WScript.StdOut.Write n
End If
n = n + 1
Next
WScript.StdOut.WriteLine
Next
'display the trasposed matrix
WScript.StdOut.WriteBlankLines(1)
WScript.StdOut.WriteLine "Transposed Matrix:"
For i = 0 To x
For j = 0 To y
If j < y Then
WScript.StdOut.Write matrix(i,j) & vbTab
Else
WScript.StdOut.Write matrix(i,j)
End If
Next
WScript.StdOut.WriteLine
Next