459 |
} |
} |
460 |
} |
} |
461 |
|
|
462 |
|
template <typename UnaryFunction> |
463 |
|
inline void tensor_unary_operation(const int size, |
464 |
|
const double *arg1, |
465 |
|
double * argRes, |
466 |
|
UnaryFunction operation) |
467 |
|
{ |
468 |
|
for (int i = 0; i < size; ++i) { |
469 |
|
argRes[i] = operation(arg1[i]); |
470 |
|
} |
471 |
|
return; |
472 |
|
} |
473 |
|
|
474 |
template <typename BinaryFunction> |
template <typename BinaryFunction> |
475 |
inline void tensor_binary_operation(const int size, |
inline void tensor_binary_operation(const int size, |
476 |
const double *arg1, |
const double *arg1, |