MTL vector European

xiaoxiao2021-03-06  39

// Solving by Robinkin from Devonit

INCLUDE #include "mtl / mtl.h" #include "mtl / utils.h" #include "mtl / tinalg_vec.h"

/ * Sample Output;

X: [1, 5, 3, 1,] The L-2 NORM OF X IS 6 * /

Using namespace MTL;

TYPEDEF EXTERNAL_VEC VEC;

INTMAIN () {Double Data [] = {1, 5, 3, 1}; VEC X (Data, 4);

Double s = two_norm (x);

Std :: cout << "x:"; Print_Vector (x);

Std :: cout << "The L-2 Norm of X IS" << S << std :: endl;}

转载请注明原文地址:https://www.9cbs.com/read-51319.html

New Post(0)