[GiNaC-list] solving linear systems with ginac

Kent-Andre Mardal kent-and at simula.no
Thu Dec 15 09:55:55 CET 2005


ons, 14,.12.2005 kl. 21.03 +0300, skrev Sheplyakov Alexei:
> Hello!
> 
> On Wed, Dec 14, 2005 at 11:22:55AM +0100, Kent-Andre Mardal wrote:
> > 
> > Now, I am trying to solve a linear system, which consists of
> > 18 equations and 18 variables. The matrix and right-hand side
> > do not contain floating point numbers.
> > 
> > I have done similar things with smaller matrices
> > and I very much appreciate that GiNaC gives
> > the solution in non-floating point numbers. However,
> > in this concrete case (which is list below).
> > GiNaC is not able to solve the system
> > on my machine with 1 Gb RAM. It runs out of memory!
> 
> [snipped]
>  
> > The matrix and right-hand side are as follows:
> > 
> > Matrix:
> > [
> > [0,0,0,0,-1/5,0,0,0,0,0,0,0,0,0,-1/30,-1/10,0,0],
> > [0,0,0,0,-1/20,0,0,0,0,0,0,0,0,0,-1/20,-1/15,0,0],
> > [0,0,0,0,-1/30,0,0,0,0,0,0,0,0,0,-1/5,-1/10,0,0],
> > [0,0,0,0,0,0,1/30,1/5,0,0,0,0,0,1/10,0,0,0,0],
> > [0,0,0,0,0,0,1/20,1/20,0,0,0,0,0,1/15,0,0,0,0],
> > [0,0,0,0,0,0,1/5,1/30,0,0,0,0,0,1/10,0,0,0,0],
> > [1/30*sqrt(2),1/10*sqrt(2),0,0,1/30*sqrt(2),0,0,1/5*sqrt(2),1/10*sqrt(2),0,1/5*sqrt(2),1/30*sqrt(2),0,0,0,0,1/10*sqrt(2),1/5*sqrt(2)],
> > [1/20*sqrt(2),1/15*sqrt(2),0,0,1/20*sqrt(2),0,0,1/20*sqrt(2),1/15*sqrt(2),0,1/20*sqrt(2),1/20*sqrt(2),0,0,0,0,1/15*sqrt(2),1/20*sqrt(2)],
> > [1/5*sqrt(2),1/10*sqrt(2),0,0,1/5*sqrt(2),0,0,1/30*sqrt(2),1/10*sqrt(2),0,1/30*sqrt(2),1/5*sqrt(2),0,0,0,0,1/10*sqrt(2),1/30*sqrt(2)],
> > [1/60,1/30,0,1/360,0,1/180,1/60,1/20,0,1/180,0,1/120,1/60,1/30,0,0,1/90,1/120],
> > [1/20,1/30,0,1/180,0,1/60,1/60,1/60,0,1/180,0,1/30,1/30,1/60,0,0,1/60,1/180],
> > [1/60,1/60,0,1/120,0,1/90,1/20,1/60,0,1/180,0,1/120,1/30,1/30,0,0,1/180,1/360],
> > [0,0,1/30,1/180,1/60,1/180,0,0,1/30,1/60,1/20,1/180,0,0,1/60,1/60,1/60,1/30],
> > [0,0,1/60,1/360,1/20,1/180,0,0,1/30,1/180,1/60,1/120,0,0,1/60,1/30,1/90,1/120],
> > [0,0,1/30,1/120,1/60,1/180,0,0,1/60,1/90,1/60,1/360,0,0,1/20,1/30,1/180,1/120],
> > [0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
> > [0,0,0,-2,0,0,0,0,0,2,0,0,0,0,0,0,0,0],
> > [0,0,0,-2,0,2,0,0,0,0,0,0,0,0,0,0,0,0]]
> > rhs:
> > [[1],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]]
> 
> Try passing solve_algo::gauss as third argument to matrix::solve, e.g.
> 
> matrix result = m.solve(vars, rhs, solve_algo::gauss);
> 
> 


This does not help. 


Kent-Andre Mardal
Simula Research Laboratory 



More information about the GiNaC-list mailing list