File: soft_threshhold.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 (12 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
#include "sopt/maths.h"
#include "sopt/types.h"

int main(int, char const **) {
  sopt::Array<> input(6);
  input << 1e1, 2e1, 3e1, 4e1, 1e4, 2e4;

  if (not(sopt::soft_threshhold(input, 2.5e1).head(2).array() < 1e-8).all()) throw std::exception();
  if (not(sopt::soft_threshhold(input, 2.5e1).tail(4).array() > 1e-8).all()) throw std::exception();

  return 0;
}