[GiNaC-list] write access to entries of submatrices [Was: multi index storage of expressions]

Charlls Quarra charlls_quarra at yahoo.com.ar
Tue Feb 20 03:38:20 CET 2007


--- Charlls Quarra <charlls_quarra at yahoo.com.ar>
escribió:

> 
> I just noted that the following write access attempt
> will fail:
> 
> 	matrix foo(1 , 2);
> 	for (int i=0 ; i< 2 ; i++)
> 	{
> 		foo(0,i) = matrix(2,2);
> 	}
> 	ex_to<matrix>( foo(0,1) )(1,1) = 34;
> 	cout << "it was wrote -> " << ex_to<matrix>( foo( 0
> ,
> 1 ) )(1,1) << endl;
> 

ok i found that this awfully-looking hack does the
job:

( *(matrix*) & ex_to<matrix>(foo(0,1)) )(1,1) = 34;

im eager to find out what its the ginac-sanctioned way
to do it though



	

	
		
__________________________________________________ 
Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas 



More information about the GiNaC-list mailing list