help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In Octave, how do I specify that the solution to a matrix equation s


From: Lkjnlkjn Lkjnlkjn
Subject: Re: In Octave, how do I specify that the solution to a matrix equation should be over integers?
Date: Mon, 14 May 2012 23:50:20 -0700 (PDT)

No. While my previous message didn't specify any constraints on the input matrix, as I'm looking to just to be able to pass the matrix as input to a command, I can say that it is not a square matrix. I'm asking because I received a real solution, but I need it to be integer. If no solution exists in the integers, the command could just return "no solution". There doesn't have to be a unique solution. Additionally, I've included the matrix and coefficients below, so that you could try it on the kind of input I have.

Btw, I'm told that Maple has a command to solve Ax=b over Z: IntegerLinearSolve. But I don't have Maple running.

A, in sparse format (row, col, value):

1 1 1
2 1 1
3 2 1
4 3 1
5 3 1
6 4 1
7 4 1
8 4 1
9 5 1
10 5 1
11 6 1
12 6 1
13 7 1
14 9 1
15 9 1
16 10 1
17 11 1
18 12 1
19 12 1
20 13 1
21 13 1
22 14 1
23 14 1
24 14 1
25 15 1
26 15 1
27 16 1
28 17 1
29 17 1
30 17 1
31 18 1
32 19 1
33 20 1
34 20 1

Coefficients:

30
27
26
26
24
25
25
20
17
21
13
14
17
18
17
13
14
13
12
12
11
6
2
3
3
2
4
2
3
0
2
1
4
4



From: Doug Stewart <address@hidden>
To: Lkjnlkjn Lkjnlkjn <address@hidden>
Cc: "address@hidden" <address@hidden>
Sent: Sunday, May 13, 2012 10:35 PM
Subject: Re: In Octave, how do I specify that the solution to a matrix equation should be over integers?



On Sun, May 13, 2012 at 8:44 PM, Lkjnlkjn Lkjnlkjn <address@hidden> wrote:
In Octave, how do I specify that the solution to a matrix equation should be over integers? I.e., Given matrix A, vectors x and b; Ax=b. Find vector x=A^(−1)b such that all its entries are integers. While I'm primarily concerned with Octave, your answer may alternatively consider Wolfram|Alpha, or any other software available with a free online interface. If discussing Wolfram|Alpha or other systems, please also explain how to load a sparse matrix, which is currently in row, col, value format (i.e., I would prefer to do minimal format conversions).

If A is integers and its determinate is 1   then inv(A) will be integers.

Is that what you are looking for?



--
DAS

https://linuxcounter.net/user/206392.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]