Jump to content

Singular value decomposition: Difference between revisions

J draft
(Created Nim solution.)
(J draft)
Line 232:
⎣-0.7071067812 0.7071067812⎦
</pre>
 
=={{header|J}}==
 
Using https://github.com/jsoftware/math_misc and providing a test matrix inline:
 
<syntaxhighlight lang=J> svd 3 0,:4 5
┌──────────────────┬──────────────┬──────────────────┐
│0.316228 _0.948683│6.7082 2.23607│0.707107 _0.707107│
│0.948683 0.316228│ │0.707107 0.707107│
└──────────────────┴──────────────┴──────────────────┘</syntaxhighlight>
 
<span style="background-color: black">File i/o is also implementable, though the current task specification (where the input matrix format is different from the output matrix format) seems unnecessary.</span>
 
=={{header|Java}}==
Line 268 ⟶ 280:
 
</pre>
 
=={{header|Julia}}==
Julia has an svd() function as part of its built-in LinearAlgebra package.
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.