Singular value decomposition: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(Added alternative C++ solution) |
m (→{{header|Wren}}: Minor tidy) |
||
Line 1,167:
{{libheader|Wren-fmt}}
An embedded solution so we can use GSL to perform SVD on any m x n matrix though the example here is for a 2 x 2 matrix.
<syntaxhighlight lang="
import "./fmt" for Fmt
Line 1,203:
We now embed this Wren script in the following C program, compile and run it.
<syntaxhighlight lang="c">/* gcc
#include <stdio.h>
Line 1,316:
WrenVM* vm = wrenNewVM(&config);
const char* module = "main";
const char* fileName = "
char *script = readFile(fileName);
WrenInterpretResult result = wrenInterpret(vm, module, script);
|