-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.html
More file actions
90 lines (76 loc) · 3.13 KB
/
math.html
File metadata and controls
90 lines (76 loc) · 3.13 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Matrix Operations · stdlib Showcase</title>
<link rel="stylesheet" href="style.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=JetBrains+Mono:wght@400;600&display=swap" rel="stylesheet" />
</head>
<body>
<nav>
<span class="nav-logo">[stdlib · showcase]</span>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="ndarray.html">NDArray</a></li>
<li><a href="math.html" class="active">Math</a></li>
<li><a href="gold.html">Gold</a></li>
</ul>
</nav>
<div class="page-header">
<small>Part 02</small>
<h1>Matrix Operations</h1>
<p>Dot product using <a href="https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/blas/base/ddot" target="_blank"><code>@stdlib/blas-base-ddot</code></a>
and Frobenius norm of matrix multiplication using <a href="https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/sqrt" target="_blank"><code>@stdlib/math-base-special-sqrt</code></a>.</p>
</div>
<div class="section">
<h2>Vector Dot Product</h2>
<div class="row" style="align-items:flex-end; gap:1.5rem">
<div>
<label>Vector A</label>
<div class="mat-grid" id="dot-a" style="grid-template-columns:repeat(4,52px)"></div>
</div>
<span class="muted" style="font-size:1.4rem">·</span>
<div>
<label>Vector B</label>
<div class="mat-grid" id="dot-b" style="grid-template-columns:repeat(4,52px)"></div>
</div>
<button class="primary" id="dot-btn" style="margin-bottom:1px">Compute</button>
</div>
<div class="output" id="dot-result">—</div>
</div>
<div class="section">
<h2>Matrix Multiplication</h2>
<div class="field" style="max-width:200px; margin-bottom:1.25rem">
<label>Matrix size</label>
<select id="mat-size">
<option value="2">2 × 2</option>
<option value="3" selected>3 × 3</option>
<option value="4">4 × 4</option>
</select>
</div>
<div class="row" style="align-items:center; gap:1.5rem; flex-wrap:wrap">
<div>
<label>Matrix A</label>
<div class="mat-grid" id="mat-a"></div>
</div>
<span class="muted" style="font-size:1.4rem">×</span>
<div>
<label>Matrix B</label>
<div class="mat-grid" id="mat-b"></div>
</div>
<button class="primary" id="mat-btn" style="margin-bottom:1px">Multiply</button>
<div id="mat-result-wrap" style="display:none">
<label>Result C = A × B</label>
<div class="mat-grid" id="mat-result"></div>
</div>
</div>
<div class="output" id="mat-norm">—</div>
</div>
<footer>
Built with <a href="https://stdlib.io" target="_blank">stdlib-js</a> · GSoC 2026
</footer>
<script src="js/math-page.js"></script>
</body>
</html>