test0.cpp itpp/itbase.h ../bdm/stat/libBM.h ../bdm/math/libDC.h ../bdm/math/chmat.h int int main () main #include<itpp/itbase.h> #include"../bdm/stat/libBM.h" #include"../bdm/math/libDC.h" #include"../bdm/math/chmat.h" usingnamespaceitpp; //Theselinesareneededforuseofcoutandendl usingstd::cout; usingstd::endl; intmain() { RVth=RV("{ab}"); RVr=RV("{r1r2}"); cout<<th<<r<<endl; ldmatld=ldmat("1000;0.2100;0.1-0.110;-0.90.3-0.11", "3456"); vecv="1-13-1"; cout<<"Testto_mat"<<endl; //cout<<ld<<endl; matL=ld.to_mat(); cout<<L<<endl; cout<<"Testopupdt"<<endl; cout<<"w=1"<<endl; ldmatldup=ld; ldup.opupdt(v,1); cout<<ldup.to_mat()<<endl; cout<<L+outer_product(v,v)<<endl; ldup=ld; cout<<"w=0.1"<<endl; ldup.opupdt(v,0.1); cout<<ldup.to_mat()<<endl; cout<<L+0.1*outer_product(v,v)<<endl; cout<<"Test+="<<endl; ldmatld2x=ld; ld2x+=ld; cout<<ld.to_mat()<<endl<<ld2x.to_mat()<<endl; cout<<"Test*="<<endl; ld2x=ld; ld2x*=2; cout<<ld.to_mat()<<endl<<ld2x.to_mat()<<endl; cout<<"Testldinv()"<<endl; ldmatIl=ld; ld.inv(Il);// matI=Il.to_mat()*ld.to_mat(); cout<<"ld:"<<endl<<Il.to_mat()<<"eye:"<<endl<<I<<endl; getchar(); cout<<"Testldform()"<<endl; matV="12;213"; ldmatlV(V); ldmatilV(V); lV.inv(ilV); cout<<"ld:"<<lV<<"eye:"<<V*(ilV.to_mat())<<endl; cout<<"Testlogdet()"<<endl; chmatchV(V); cout<<"ch:"<<chV.to_mat()<<endl; cout<<"log(det(V)):"<<chV.logdet()<<endl; cout<<"qform:"<<chV.qform(ones(2))<<endl; //Exitprogram: getchar(); return0; }