SyTen

◆ isParallel() [2/2]

template<Rank rank, typename Scalar >
std::tuple< ParallelKind, Scalar, Scalar > syten::isParallel ( SparseTensor< rank, Scalar > const &  a,
SparseTensor< rank, Scalar > const &  b 
)
inline

Checks if two tensors are parallel, i.e. \( a_i = c \; b_i \quad \forall i \).

Parameters
afirst tensor
bsecond tensor
Returns
a tuple {ParallelKind, c_nominator, c_denominator}

The second tensor multiplied by \( c \) will give the first tensor if the two tensors are parallel.

References syten::SparseTensor< rank, Scalar >::dim(), syten::SparseTensor< rank, Scalar >::isSingleton(), std::make_tuple(), SYTEN_ASSERT, and syten::SparseTensor< rank, Scalar >::valSingleton().

+ Here is the call graph for this function: