File: lsolve.tex

package info (click to toggle)
cadabra2 2.4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,732 kB
  • sloc: ansic: 133,450; cpp: 92,064; python: 1,530; javascript: 203; sh: 184; xml: 182; objc: 53; makefile: 51
file content (13 lines) | stat: -rw-r--r-- 418 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
\cdbalgorithm{lsolve}{}

Solve a system of linear equations over integers. Example,
\begin{screen}{1,2}
{ a0+2*a2 + a3= 3, -a0 - a2 + a3= - (8/3) , a3 = 3};
@lsolve(%){a0,a2,a3};
{a0 = 34/3, a2 = (-17/3), a3 = 3};
\end{screen}
Underdetermined and inconsistent systems are handled as expected:
either some coefficients are left unfixed or the system is returned
and an error message is printed.

\cdbseealgo{decompose}