Boost logo

Ublas :

Subject: [ublas] matrix-vector mapping
From: Matwey V. Kornilov (matwey.kornilov_at_[hidden])
Date: 2011-02-02 06:22:52


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 third-rank 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 first-rank tensor or simply vector.

Let me recall that a vector space of n-x-m 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 third-rank tensor A as a
matrix). A copying does not conform to lazy zen of ublas. I need a matrix-
to-vector proxy which I would be able to customize in order to implement the

I need a piece of advice how should I deal with this.