'Using dot-product instead of multiplying with transpose

We have the following equation, that we want to implement into our code with arrays/matrices
h(x, y, z) = ax + by + cz

pseudeo code:

X = [a, b, c]  
A = [x, y, z]

Often I see the equation being implemented like this:

h = transpose(A) * T

Is there any difference of just using the dot product?

h = dotproduct(A, X)

Is there a specific reason why the transpose is used over the dotproduct?



Solution 1:[1]

Mathematically, there's no difference. In implementation- dotproduct(...) may actually be faster, since transpose(...) may eagerly move the elements around prior to the matrix multiplication, doing "unnecessary" work.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dillon Davis