## Re: [Libmesh-users] Best way to perform matrix vector operation

 Re: [Libmesh-users] Best way to perform matrix vector operation From: Roy Stogner - 2014-08-12 17:13:14 ```On Tue, 12 Aug 2014, Miguel Angel Salazar de Troya wrote: > This question seems kind of dumb, but I cannot find the way to to this > operation when the vector is a Point object (for the case of the face > normals). I've seen in the file tensor_tools.h there are several functions > for inner products with TypeVector, but I cannot find a dot product of a > TypeTensor and a TypeVector. in TypeTensor: /** * Multiply a tensor and vector together, i.e. matrix-vector * product. * The tensor and vector may be of different types. */ template TypeVector::supertype> operator * (const TypeVector &) const; > Also, there seems to be two families of vector/matrices data structures. > One the TypeVector/TypeTensor and the DenseVectorBase/DenseMatrixBase, what > is the reason behind this design? One is fixed-size; the other variable-size. Fixed-size operations are easier for the compiler to optimize, but much less flexible. --- Roy ```

 [Libmesh-users] Best way to perform matrix vector operation From: Miguel Angel Salazar de Troya - 2014-08-12 17:05:36 ```Hi all This question seems kind of dumb, but I cannot find the way to to this operation when the vector is a Point object (for the case of the face normals). I've seen in the file tensor_tools.h there are several functions for inner products with TypeVector, but I cannot find a dot product of a TypeTensor and a TypeVector. I think I could use the function vector_mult in the class DenseMatrix, but I would have to copy the object Point values to a DenseVector object. Is there a better way to do this? Also, there seems to be two families of vector/matrices data structures. One the TypeVector/TypeTensor and the DenseVectorBase/DenseMatrixBase, what is the reason behind this design? Thanks Miguel -- *Miguel Angel Salazar de Troya* Graduate Research Assistant Department of Mechanical Science and Engineering University of Illinois at Urbana-Champaign (217) 550-2360 salaza11@... ```
 Re: [Libmesh-users] Best way to perform matrix vector operation From: Roy Stogner - 2014-08-12 17:13:14 ```On Tue, 12 Aug 2014, Miguel Angel Salazar de Troya wrote: > This question seems kind of dumb, but I cannot find the way to to this > operation when the vector is a Point object (for the case of the face > normals). I've seen in the file tensor_tools.h there are several functions > for inner products with TypeVector, but I cannot find a dot product of a > TypeTensor and a TypeVector. in TypeTensor: /** * Multiply a tensor and vector together, i.e. matrix-vector * product. * The tensor and vector may be of different types. */ template TypeVector::supertype> operator * (const TypeVector &) const; > Also, there seems to be two families of vector/matrices data structures. > One the TypeVector/TypeTensor and the DenseVectorBase/DenseMatrixBase, what > is the reason behind this design? One is fixed-size; the other variable-size. Fixed-size operations are easier for the compiler to optimize, but much less flexible. --- Roy ```