File: lsolve.tex

package info (click to toggle)
cadabra2 2.3.6.8-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 77,508 kB
  • sloc: ansic: 132,438; cpp: 86,549; python: 1,365; javascript: 191; xml: 182; sh: 180; objc: 53; makefile: 38
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}