MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / relEps

Function relEps

test/pinverse.cpp:111–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109
110template<typename T>
111double relEps(array in) {
112 typedef typename af::dtype_traits<T>::base_type InBaseType;
113 double fixed_eps = eps<T>();
114 double calc_eps = std::numeric_limits<InBaseType>::epsilon() *
115 std::max(in.dims(0), in.dims(1)) * af::max<double>(in);
116 // Use the fixed values above if calculated error tolerance is unnecessarily
117 // too small
118 return std::max(fixed_eps, calc_eps);
119}
120
121typedef ::testing::Types<float, cfloat, double, cdouble> TestTypes;
122TYPED_TEST_SUITE(Pinverse, TestTypes);

Callers

nothing calls this directly

Calls 2

maxFunction · 0.70
dimsMethod · 0.45

Tested by

no test coverage detected