vt::operator#

template<typename T, size_t N>
Tensor<T, N> vt::operator+(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to add two tensors and return new tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator+(const Tensor<T, N> &lhs, const T value)#

Operator to add a vector and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be added.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator+(const T value, const Tensor<T, N> &rhs)#

Operator to add a vector and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value to be added.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator-(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to subtract two tensors and return new tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator-(const Tensor<T, N> &lhs, const T value)#

Operator to subtract a vector and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be subtracted.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator-(const T value, const Tensor<T, N> &rhs)#

Operator to subtract a vector and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor to be subtracted.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator*(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to multiply two tensors and return new tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator*(const Tensor<T, N> &lhs, const T value)#

Operator to multiply a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be multiplied.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator*(const T value, const Tensor<T, N> &rhs)#

Operator to multiply a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor to be multiplied.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator/(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to divide two tensors and return new tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator/(const Tensor<T, N> &lhs, const T value)#

Operator to divide a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be divided.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<T, N> vt::operator/(const T value, const Tensor<T, N> &rhs)#

Operator to divide a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor to be divided.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform greaten than comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be powered.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>(const Tensor<T, N> &lhs, const T value)#

Operator to perform greaten than comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>(const T value, const Tensor<T, N> &rhs)#

Operator to perform greaten than comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform less than comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<(const Tensor<T, N> &lhs, const T value)#

Operator to perform less than comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<(const T value, const Tensor<T, N> &rhs)#

Operator to perform less than comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>=(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform greaten than or equal comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>=(const Tensor<T, N> &lhs, const T value)#

Operator to perform greaten than or equal comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator>=(const T value, const Tensor<T, N> &rhs)#

Operator to perform greaten than or equal comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<=(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform less than or equal comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<=(const Tensor<T, N> &lhs, const T value)#

Operator to perform less than or equal comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator<=(const T value, const Tensor<T, N> &rhs)#

Operator to perform less than or equal comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator==(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform element-wise equality comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator==(const Tensor<T, N> &lhs, const T value)#

Operator to perform element-wise equality comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator==(const T value, const Tensor<T, N> &rhs)#

Operator to perform element-wise equality comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator!=(const Tensor<T, N> &lhs, const Tensor<T, N> &rhs)#

Operator to perform element-wise inequality comparison between two tensors.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator!=(const Tensor<T, N> &lhs, const T value)#

Operator to perform element-wise inequality comparison between a tensor and a scalar.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • lhs – The left-hand side tensor.

  • value – The scalar value to be compared.

Returns:

tensor: The new tensor object.

template<typename T, size_t N>
Tensor<bool, N> vt::operator!=(const T value, const Tensor<T, N> &rhs)#

Operator to perform element-wise inequality comparison between a scalar and a tensor.

Template Parameters:
  • T – Data type of the tensor.

  • N – Number of dimensions of the tensor.

Parameters:
  • value – The scalar value.

  • rhs – The right-hand side tensor.

Returns:

tensor: The new tensor object.