File: algorithmtest.cc

package info (click to toggle)
dune-common 2.11.0-1~exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,056 kB
  • sloc: cpp: 54,404; python: 4,136; sh: 1,657; makefile: 17
file content (26 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
#include <algorithm>
#include <array>

#include <dune/common/std/algorithm.hh>
#include <dune/common/test/testsuite.hh>

int main(int argc, char** argv)
{
  using namespace Dune;
  TestSuite testSuite;

  std::array<double, 10> arr1{};
  std::array<double, 10> arr2{};

  std::fill(arr1.begin(), arr1.end(), 1.0);
  std::fill(arr2.begin(), arr2.end(), 2.0);

  auto cmp = Std::lexicographical_compare_three_way(arr1.begin(), arr1.end(), arr2.begin(), arr2.end());
  testSuite.check(cmp < 0);

  return testSuite.exit();
}