Singular value decomposition: Difference between revisions
Content added Content deleted
(Created Nim solution.) |
(J draft) |
||
Line 232: | Line 232: | ||
⎣-0.7071067812 0.7071067812⎦ |
⎣-0.7071067812 0.7071067812⎦ |
||
</pre> |
</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}}== |
=={{header|Java}}== |
||
Line 268: | Line 280: | ||
</pre> |
</pre> |
||
=={{header|Julia}}== |
=={{header|Julia}}== |
||
Julia has an svd() function as part of its built-in LinearAlgebra package. |
Julia has an svd() function as part of its built-in LinearAlgebra package. |