Hi Karl, Karl Rupp <r...@iue.tuwien.ac.at> writes: > Hmm, NumPy probably won't win a user API consistency award for this > choice ;-) As you say, in such case I opt for using the NumPy matrix > convention, particularly as the PyViennaCL object is also of type Matrix().
Right :) > Coming back to the original question of how to deal with operator* for > vectors: Is > np.inner(a, b) > the most common way of computing the inner product? If so, then let's > just use a function 'inner' for this purpose. Similarly, outer() for the > outer product. operator* is then available for scaling vectors and > matrices only. At the moment, I have the following semantics for *: Matrix * Matrix -> Matrix (matrix product) Matrix * Vector -> Vector (matrix product) Matrix * Scalar -> Matrix (scalar product) Vector * Vector -> Matrix (outer product) Vector * Scalar -> Vector (scalar product) Scalar * Scalar -> Scalar (scalar product) [Vector * Matrix is undefined] I chose the outer product for the Vector*Vector operation because it seemed most operationally consistent with my choice for Matrix*Matrix and Matrix*Vector. As in NumPy, the inner product is calculated with the dot() method. Element-wise multiplication and division are provided in the element_prod() and element_div() methods. I think this is a fairly sensible scheme. I'm open to leaving Vector*Vector undefined, but it makes me a bit uneasy. I think this is because I don't want an operator to be unexpectedly unavailable. Best, T ------------------------------------------------------------------------------ Get your SQL database under version control now! Version control is standard for application code, but databases havent caught up. So what steps can you take to put your SQL databases under version control? Why should you start doing it? Read more to find out. http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel