GooseFEM
1.4.1.dev2+g78f16df
Loading...
Searching...
No Matches
assertions.h
Go to the documentation of this file.
1
7
#ifndef GOOSEFEM_ASSERTIONS_H
8
#define GOOSEFEM_ASSERTIONS_H
9
10
#include "
config.h
"
11
12
namespace
GooseFEM
{
13
19
template
<
class
T>
20
inline
bool
is_unique
(
const
T& arg)
21
{
22
array_type::tensor<typename T::value_type, 1>
flat = xt::ravel(arg);
23
array_type::tensor<typename T::value_type, 1>
unique = xt::unique(flat);
24
array_type::tensor<typename T::value_type, 1>
sorted = xt::sort(flat);
25
26
if
(unique.size() != sorted.size()) {
27
return
false
;
28
}
29
30
return
xt::all(xt::equal(unique, sorted));
31
}
32
33
}
// namespace GooseFEM
34
35
#endif
config.h
Basic configuration:
GooseFEM::array_type::tensor
xt::xtensor< T, N > tensor
Fixed (static) rank array.
Definition
config.h:177
GooseFEM
Toolbox to perform finite element computations.
Definition
Allocate.h:14
GooseFEM::is_unique
bool is_unique(const T &arg)
Returns true is a list is unique (has not duplicate items).
Definition
assertions.h:20
GooseFEM
assertions.h
Generated by
1.10.0