
Ublas : 
Subject: [ublas] matrixvector mapping
From: Matwey V. Kornilov (matwey.kornilov_at_[hidden])
Date: 20110202 06:22:52
Hi,
I am interested in your opinion about the following problem.
I have a matrix B with which I can do any matrix operations. In addition, I
have a thirdrank tensor A. I want to solve an inverse problem which is
defined by set of equations a_ijk x_k = b_ij. (Einstein notation is assumed
here). Then the x is simply a firstrank tensor or simply vector.
Let me recall that a vector space of nxm matrices is isomorphic with any
vector space with the same dimensionality, in particular it is isomorphic
with a vector space of vectors of n*m length. Hence, I can introduce a
bijective mapping which defines a relation between pair of indices ij and
new index p. Consequently, the initial problem may be written as following
a_pk x_k = b_p which is common form of a set of linear equations. Every
known algorithm may be applied to the problem in this form.
An issue is that it is convenient to consider B as a matrix to perform
matrix operation before solving the problem. When I want to solve the
problem I ought to consider B as a vector (and my thirdrank tensor A as a
matrix). A copying does not conform to lazy zen of ublas. I need a matrix
tovector proxy which I would be able to customize in order to implement the
mapping.
I need a piece of advice how should I deal with this.