示例#1
0
文件: impl.hpp 项目: Backson/mint
static inline T op1_impl(Op op, T x) {
	switch (op) {
	case OP_NEG:   return neg_impl(x);
	case OP_INV:   return inv_impl(x);
	case OP_SQ:    return sq_impl(x);
	case OP_CU:    return cu_impl(x);
	case OP_SQRT:  return sqrt_impl(x);
	case OP_SIN:   return sin_impl(x);
	case OP_COS:   return cos_impl(x);
	case OP_TAN:   return tan_impl(x);
	case OP_ASIN:  return asin_impl(x);
	case OP_ACOS:  return acos_impl(x);
	case OP_ATAN:  return atan_impl(x);
	case OP_SINH:  return sinh_impl(x);
	case OP_COSH:  return cosh_impl(x);
	case OP_TANH:  return tanh_impl(x);
	case OP_ASINH: return asinh_impl(x);
	case OP_ACOSH: return acosh_impl(x);
	case OP_ATANH: return atanh_impl(x);
	case OP_EXP:   return exp_impl(x);
	case OP_LOG:   return log_impl(x);
	case OP_ERF:   return erf_impl(x);
	case OP_ERFC:  return erfc_impl(x);
	case OP_ABS:   return abs_impl(x);
	case OP_FLOOR: return floor_impl(x);
	case OP_CEIL:  return ceil_impl(x);
	case OP_ROUND: return round_impl(x);
	case OP_TRUNC: return trunc_impl(x);
	default:       throw std::invalid_argument("Wrong number of arguments for operator");
	}
}
示例#2
0
文件: fselect.hpp 项目: 10376920/pacs
typename std::remove_pointer<T>::type inv(const T val){
  return inv_impl(val,std::is_pointer<T>());
}