How to formulate matrix multiplication and inverse using constraint program?
回答済みHello, I want to formulate a Matrix multiplication and inverse using a strictly integer constraint program, and I don't know how to proceed with it.
G = [ [-4, 2, 1],
[-2, 2, 1],
[-1, 1, 1]
]
C = [ [-2],
[2],
[1)
]
and I want to find W vector such as:
W = G(G⊺G)^−1 C
That is, G(G transpose G)inverse C
is this matrix multiplication and most importantly the INVERSE of the multiplication is possible to formulate
Help will be appreciated :)
0
-
Hi Sanket,
This isn't an optimization problem, it just requires matrix arithmetic, which can be achieved with Python and numpy for example:
import numpy as np
G = np.array([
[-4, 2, 1],
[-2, 2, 1],
[-1, 1, 1]
])
C = np.array([-2,2,1])
W = G@np.linalg.inv(G.transpose()@G)@CThen W = array([1.55431223e-15, 1.00000000e+00, 4.44089210e-16])
- Riley
1
サインインしてコメントを残してください。
コメント
1件のコメント