File: l1_norm.cc

package info (click to toggle)
sopt 5.0.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,704 kB
  • sloc: cpp: 13,620; xml: 182; makefile: 6
file content (13 lines) | stat: -rw-r--r-- 334 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "sopt/maths.h"
#include "sopt/types.h"

int main(int, char const **) {
  sopt::Image<std::complex<int>> input(2, 2);
  sopt::Image<std::complex<int>> weights(2, 2);
  input << 1, -2, 3, -4;
  weights << 5, 6, 7, 8;

  if (sopt::l1_norm(input, weights) != 1 * 5 + 2 * 6 + 3 * 7 + 4 * 8) throw std::exception();

  return 0;
}