abs_sum.cc

来自「MTL C++ Numeric Library」· CC 代码 · 共 28 行

CC
28
字号
#include <iostream>#include "mtl/utils.h"#include "mtl/mtl.h"#include "mtl/linalg_vec.h"/*  Sample output;X: [1,2,3,4,]The L-1 norm of X is 10    */using namespace mtl;intmain(){  double x_[4] = { 1, 2, 3, 4 };    double s = one_norm(array_to_vec(x_));  std::cout << "X: ";  print_vector(array_to_vec(x_));  std::cout << "The L-1 norm of X is " << s << std::endl;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?