sparse comparison
[scilab.git] / scilab / modules / ast / tests / unit_tests / sparse.dia.ref
index a4d7cce..43a10e5 100644 (file)
@@ -318,8 +318,661 @@ cc=c+rand(6,6)*%i;
 assert_checkequal(full(ac.*c), full(ac).*c);
 assert_checkequal(full(cc.*a), cc.*full(a));
 // sparse sparse
-assert_checkequal(full(ac.*zer), full(zer));
-assert_checkequal : L'objet calculé est de type complexe, cependant il aurait dû être réel.
-at line    86 of function assert_checkequal called by :
-assert_checkequal(full((ac .* zer)), full(zer))
-at line   355 of exec file called by :
+assert_checkequal(full(ac.*zer), full(zer)*%i);
+assert_checkequal(full(zer.*ac), full(zer)*%i);
+assert_checkequal(full(ac.*a), full(ac).*full(a));
+assert_checkequal(full(bc.*b), full(bc).*full(b));
+assert_checkequal(full(a.*bc), full(a).*full(bc));
+assert_checkequal(full(b.*ac), full(b).*full(ac));
+// // complex x complex
+assert_checkequal(full(ac.*cc), full(ac).*cc);
+assert_checkequal(full(cc.*ac), cc.*full(ac));
+// sparse sparse
+assert_checkequal(full(ac.*ac), full(ac).*full(ac));
+assert_checkequal(full(bc.*bc), full(bc).*full(bc));
+assert_checkequal(full(bc.*ac), full(bc).*full(ac));
+// ----------------------------------------------------------
+// test de la transposition
+//-----------------------------------------------------------
+assert_checkequal(full(a'), full(a)');
+assert_checkequal(full(ac'), full(ac)');
+assert_checkequal(full(zer'), full(zer)' );
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+assert_checkequal(full(v'), full(v)');
+assert_checkequal(full((v')'), full(v));
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);
+assert_checkequal(full(vc'), full(vc)');
+assert_checkequal(full((vc')'), full(vc));
+// ----------------------------------------------------------
+// test des concatenation
+//-----------------------------------------------------------
+assert_checkequal(full([a]), full(a));
+assert_checkequal(full([a b]), [full(a) full(b)]);
+assert_checkequal(full([a;b]), [full(a);full(b)]);
+assert_checkequal(full([a []]), full(a));
+assert_checkequal(full([a;[]]), full(a));
+assert_checkequal(full([a zer]), [full(a) full(zer)]);
+assert_checkequal(full([zer;b]), [full(zer);full(b)]);
+assert_checkequal(full([ac]), full(ac));
+assert_checkequal(full([ac b]), [full(ac) full(b)]);
+assert_checkequal(full([ac;b]), [full(ac);full(b)]);
+assert_checkequal(full([ac []]), full(ac));
+assert_checkequal(full([ac;[]]), full(ac));
+assert_checkequal(full([a bc]), [full(a) full(bc)]);
+assert_checkequal(full([a;bc]), [full(a);full(bc)]);
+assert_checkequal(full([ac bc]), [full(ac) full(bc)]);
+assert_checkequal(full([ac;bc]), [full(ac);full(bc)]);
+// ----------------------------------------------------------
+// test des extractions
+//-----------------------------------------------------------
+af=full(a);
+assert_checkequal(full(a(1,3)), af(1,3));
+assert_checkequal(full(a(1,4)), af(1,4));
+assert_checkequal(full(a(1,:)), af(1,:));
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);vf=full(v);
+assert_checkequal(full(v(:)), vf(:));
+assert_checkequal(full(v(3:4)), vf(3:4));
+assert_checkequal(full(v([1 5])), vf([1 5]));
+assert_checkequal(full(v([4 3])), vf([4 3]));
+assert_checkequal(full(v([4 4])), vf([4 4]));
+assert_checkequal(full(v([1 1])), vf([1 1]));
+v=v';vf=vf';
+assert_checkequal(full(v(:)), vf(:));
+assert_checkequal(full(v(3:4)), vf(3:4));
+assert_checkequal(full(v([1 5])), vf([1 5]));
+assert_checkequal(full(v([4 3])), vf([4 3]));
+assert_checkequal(full(v([4 4])), vf([4 4]));
+assert_checkequal(full(v([1 1])), vf([1 1]));
+acff=full(ac);
+assert_checkequal(full(ac(1,3)), acff(1,3));
+assert_checkequal(full(ac(1,4)), acff(1,4));
+assert_checkequal(full(ac(1,:)), acff(1,:));
+vc=sparse([2 1;3 1;4 1;6 1],[10-3*%i;11;12+5*%i;13+0.5*%i],[6,1]);vcf=full(vc);
+assert_checkequal(full(vc(:)), vcf(:));
+assert_checkequal(full(vc(3:4)), vcf(3:4));
+assert_checkequal(full(vc([1 5])), vcf([1 5]));
+assert_checkequal(full(vc([4 3])), vcf([4 3]));
+assert_checkequal(full(vc([4 4])), vcf([4 4]));
+assert_checkequal(full(vc([1 1])), vcf([1 1]));
+vc=vc';vcf=vcf';
+assert_checkequal(full(vc(:)), vcf(:));
+assert_checkequal(full(vc(3:4)), vcf(3:4));
+assert_checkequal(full(vc([1 5])), vcf([1 5]));
+assert_checkequal(full(vc([4 3])), vcf([4 3]));
+assert_checkequal(full(vc([4 4])), vcf([4 4]));
+assert_checkequal(full(vc([1 1])), vcf([1 1]));
+// ----------------------------------------------------------
+// test des insertions
+//-----------------------------------------------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=sparse([1 2;1 3;1 4;1 6],[10;11;12;13],[1,6]);
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+assert_checkequal(full(a1), A);
+//  insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([1 3],:)=[Vt;2*Vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);Vt=full(vt);A([3 1],:)=[Vt;2*Vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);Vt=full(vt);A([1 3 1],:)=[Vt;2*Vt;3*Vt];
+assert_checkequal(full(a1), A);
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+assert_checkequal(full(a1), A);
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+assert_checkequal(full(a1), A);
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+assert_checkequal(full(a1), A);
+//  insert zero vector
+vt=sparse([],[],[1,6]);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);Vt=full(vt);A(1,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);Vt=full(vt);A(3,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);Vt=full(vt);A(7,:)=Vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);Vt=full(vt);A(8,:)=Vt;
+assert_checkequal(full(a1), A);
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4],10:15,[2,6]);
+a1=a;a1([1 3],:)=b;A=full(a);B=full(b);A([1 3],:)=B;
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=b;A=full(a);B=full(b);A([3 1],:)=B;
+assert_checkequal(full(a1), A);
+b=sparse([1 1;1 3;1 6;2 1;2 2;2 4;3 3;3 5],10:17,[3,6]);
+a1=a;a1([1 3 1],:)=b;A=full(a);B=full(b);A([1 3 1],:)=B;
+assert_checkequal(full(a1), A);
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=sparse([2 1;3 1;4 1;6 1],[10;11;12;13],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+assert_checkequal(full(a1), A);
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+assert_checkequal(full(a1), A);
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+assert_checkequal(full(a1), A);
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+assert_checkequal(full(a1), A);
+a=sparse([],[],[6,6]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+assert_checkequal(full(a1), A);
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;3 1;3 2;4 1;6 2],10:15,[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+assert_checkequal(full(a1), A);
+b=sparse([1 2;2 1;2 3;3 1;3 2;4 1;5 3;6 2],10:17,[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+assert_checkequal(full(a1), A);
+v=sparse([],[],[6,1]);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);V=full(v);A(:,1)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);V=full(v);A(:,2)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);V=full(v);A(:,3)=V;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);V=full(v);A(:,7)=V;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);V=full(v);A(:,8)=V;
+assert_checkequal(full(a1), A);
+b=sparse([],[],[6,2]);
+a1=a;a1(:,[1 3])=b;A=full(a);B=full(b);A(:,[1 3])=B;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);B=full(b);A(:,[3 1])=B;
+assert_checkequal(full(a1), A);
+b=sparse([],[],[6,3]);
+a1=a;a1(:,[1 3 1])=b;A=full(a);B=full(b);A(:,[1 3 1])=B;
+assert_checkequal(full(a1), A);
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 2;1 3;3 3],-(1:3),[3,3]);
+a1=a;a1(1,1)=sparse(30);A=full(a);A(1,1)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,6)=sparse(30);A=full(a);A(1,6)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,8)=sparse(30);A=full(a);A(1,8)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=full(b);
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=full(b);
+assert_checkequal(full(a1), A);
+//sparse full
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+vt=11:16;
+// full line insertion
+//----------------------
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3],:)=[vt;2*vt];A=full(a);A([1 3],:)=[vt;2*vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=[vt;2*vt];A=full(a);A([3 1],:)=[vt;2*vt];
+assert_checkequal(full(a1), A);
+a1=a;a1([1 3 1],:)=[vt;2*vt;3*vt];A=full(a);A([1 3 1],:)=[vt;2*vt;3*vt];
+assert_checkequal(full(a1), A);
+a=sparse([],[],[6,6]);
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,:)=vt;A=full(a);A(1,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(3,:)=vt;A=full(a);A(3,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(7,:)=vt;A=full(a);A(7,:)=vt;
+assert_checkequal(full(a1), A);
+a1=a;a1(8,:)=vt;A=full(a);A(8,:)=vt;
+assert_checkequal(full(a1), A);
+b=[1:6;11:16];
+a1=a;a1([1 3],:)=b;A=full(a);A([1 3],:)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([3 1],:)=b;A=full(a);A([3 1],:)=b;
+assert_checkequal(full(a1), A);
+b=[1:6;11:16;21:26];
+a1=a;a1([1 3 1],:)=b;A=full(a);A([1 3 1],:)=b;
+assert_checkequal(full(a1), A);
+// full column insertion
+//----------------------
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+v=(1:6)';
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,1)=v;A=full(a);A(:,1)=v;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,2)=v;A=full(a);A(:,2)=v;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,3)=v;A=full(a);A(:,3)=v;
+assert_checkequal(full(a1), A);
+//
+a1=a;a1(:,7)=v;A=full(a);A(:,7)=v;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,8)=v;A=full(a);A(:,8)=v;
+assert_checkequal(full(a1), A);
+b=[(1:6)' (11:16)'];
+a1=a;a1(:,[1 3])=b;A=full(a);A(:,[1 3])=b;
+assert_checkequal(full(a1), A);
+a1=a;a1(:,[3 1])=b;A=full(a);A(:,[3 1])=b;
+assert_checkequal(full(a1), A);
+b=[(1:6)' (11:16)' (21:26)'];
+a1=a;a1(:,[1 3 1])=b;A=full(a);A(:,[1 3 1])=b;
+assert_checkequal(full(a1), A);
+//********
+// row column insertion
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=-[1 2 3;4 5 6;7 8 9];
+a1=a;a1(1,1)=30;A=full(a);A(1,1)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,6)=30;A=full(a);A(1,6)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1,8)=30;A=full(a);A(1,8)=30;
+assert_checkequal(full(a1), A);
+a1=a;a1(1:3,1:3)=b;A=full(a);A(1:3,1:3)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1(1:3,6:8)=b;A=full(a);A(1:3,6:8)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1(6:8,1:3)=b;A=full(a);A(6:8,1:3)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([3 2 1],1:3)=b;A=full(a);A([3 2 1],1:3)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],1:3)=b;A=full(a);A([1 2 1],1:3)=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([3 2 1],[3 2 1])=b;A=full(a);A([3 2 1],[3 2 1])=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],[3 2 1])=b;A=full(a);A([1 2 1],[3 2 1])=b;
+assert_checkequal(full(a1), A);
+a1=a;a1([1 2 1],[1 2 1])=b;A=full(a);A([1 2 1],[1 2 1])=b;
+assert_checkequal(full(a1), A);
+// vector insertion
+v=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 8])=[5;10;33];V=full(v);V([1 2 8])=[5;10;33];
+assert_checkequal(full(v1), V);
+v1=v;v1(:)=[];
+assert_checkequal(full(v1), []);
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 8])=sparse([5;10;33]);V=full(v);V([1 2 8])=[5;10;33];
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 1])=sparse([5;10;33]);V=full(v);V([1 2 1])=[5;10;33];
+assert_checkequal(full(v1), V);
+v1=v;v1(:)=[];
+assert_checkequal(full(v1), []);
+v1=v;v1(:)=sparse([2 1],44,[6 1]);V=full(v);V(:)=[0;44;0;0;0;0];
+assert_checkequal(full(v1), V);
+v=v';
+v1=v;v1(1)=33;V=full(v);V(1)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(2)=33;V=full(v);V(2)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(8)=33;V=full(v);V(8)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 8])=[5 10 33];V=full(v);V([1 2 8])=[5 10 33];
+assert_checkequal(full(v1), V);
+v1=v;v1(1)=sparse(33);V=full(v);V(1)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(2)=sparse(33);V=full(v);V(2)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1(8)=sparse(33);V=full(v);V(8)=33;
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 8])=sparse([5 10 33]);V=full(v);V([1 2 8])=[5 10 33];
+assert_checkequal(full(v1), V);
+v1=v;v1([1 2 1])=sparse([5 10 33]);V=full(v);V([1 2 1])=[5 10 33];
+assert_checkequal(full(v1), V);
+v1=v;v1(:)=sparse([1 2],44,[1,6]);V=full(v);V(:)=[0 44 0 0 0 0];
+assert_checkequal(full(v1), V);
+v1=v;v1(1)=[];V=full(v);V(1)=[];
+assert_checkequal(full(v1), V);
+//test des comparaisons
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6]);
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(b>a), (full(b)>full(a)));
+assert_checkequal(full(b<a), (full(b)<full(a)));
+assert_checkequal(full(b>=a), (full(b)>=full(a)));
+assert_checkequal(full(b<=a), (full(b)<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(b>full(a)), (full(b)>full(a)));
+assert_checkequal(full(b<full(a)), (full(b)<full(a)));
+assert_checkequal(full(b>=full(a)), (full(b)>=full(a)));
+assert_checkequal(full(b<=full(a)), (full(b)<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(full(b)>a), (full(b)>full(a)));
+assert_checkequal(full(full(b)<a), (full(b)<full(a)));
+assert_checkequal(full(full(b)>=a), (full(b)>=full(a)));
+assert_checkequal(full(full(b)<=a), (full(b)<=full(a)));
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],-(1:9),[6 6]);
+b=sparse([1 6;1 2;6 5],[10;-1;-1],[6 6]);
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(b>a), (full(b)>full(a)));
+assert_checkequal(full(b<a), (full(b)<full(a)));
+assert_checkequal(full(b>=a), (full(b)>=full(a)));
+assert_checkequal(full(b<=a), (full(b)<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(b>full(a)), (full(b)>full(a)));
+assert_checkequal(full(b<full(a)), (full(b)<full(a)));
+assert_checkequal(full(b>=full(a)), (full(b)>=full(a)));
+assert_checkequal(full(b<=full(a)), (full(b)<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(full(b)>a), (full(b)>full(a)));
+assert_checkequal(full(full(b)<a), (full(b)<full(a)));
+assert_checkequal(full(full(b)>=a), (full(b)>=full(a)));
+assert_checkequal(full(full(b)<=a), (full(b)<=full(a)));
+a=sparse([1 1;3 1;6 1],[10 11 12],[6 1]);
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+a=a';
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+a=sparse([1 1;3 1;6 1],[-10 -11 -12],[6 1]);
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+a=a';
+assert_checkequal(full(a==a), full(a)==full(a));
+assert_checkequal(full(a<>a), (full(a)<>full(a)));
+assert_checkequal(full(a>sparse(5)), (full(a)>5));
+assert_checkequal(full(a<sparse(5)), (full(a)<5));
+assert_checkequal(full(a>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(a<=sparse(5)), (full(a)<=5));
+assert_checkequal(full(sparse(5)>a), (5>full(a)));
+assert_checkequal(full(sparse(5)<a), (5<full(a)));
+assert_checkequal(full(sparse(5)>=a), (5>=full(a)));
+assert_checkequal(full(sparse(5)<=a), (5<=full(a)));
+assert_checkequal(full(a==full(a)), full(a)==full(a));
+assert_checkequal(full(a<>full(a)), (full(a)<>full(a)));
+assert_checkequal(full(a>5), (full(a)>5));
+assert_checkequal(full(a<5), (full(a)<5));
+assert_checkequal(full(a>=5), (full(a)>=5));
+assert_checkequal(full(a<=5), (full(a)<=5));
+assert_checkequal(full(5>a), (5>full(a)));
+assert_checkequal(full(5<a), (5<full(a)));
+assert_checkequal(full(5>=a), (5>=full(a)));
+assert_checkequal(full(5<=a), (5<=full(a)));
+assert_checkequal(full(full(a)==a), full(a)==full(a));
+assert_checkequal(full(full(a)<>a), (full(a)<>full(a)));
+assert_checkequal(full(full(a)>sparse(5)), (full(a)>5));
+assert_checkequal(full(full(a)<sparse(5)), (full(a)<5));
+assert_checkequal(full(full(a)>=sparse(5)), (full(a)>=5));
+assert_checkequal(full(full(a)<=sparse(5)), (full(a)<=5));
+a=sparse([1 6;1 5;1 3;2 4;2 1;4 4;4 3;5 1;6 6],1:9,[6 6]);
+b=sparse([1 6;1 2;5 5],[10;-1;-1],[5 6]);
+assert_checkfalse(a==b);
+assert_checktrue(a<>b);