diff -Nru treeplot-0.7.3/CMakeLists.txt treeplot-0.7.4/CMakeLists.txt --- treeplot-0.7.3/CMakeLists.txt 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/CMakeLists.txt 2008-11-27 18:20:03.000000000 +0000 @@ -8,12 +8,12 @@ SET(CPACK_INSTALL_CMAKE_PROJECTS "/home/olivier/eclipse/treeplot;treeplot;ALL;/") # cpack -G TGZ --config CPackSourceConfig.cmake -set(VERSION 0.7.3) +set(VERSION 0.7.4) # CPack version numbers for release tarball name. set(CPACK_PACKAGE_VERSION_MAJOR 0) set(CPACK_PACKAGE_VERSION_MINOR 7) -set(CPACK_PACKAGE_VERSION_PATCH 3) +set(CPACK_PACKAGE_VERSION_PATCH 4) set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Plotting phylogenetic trees") set(CPACK_PACKAGE_VENDOR "Tryphonar corp") diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/debian/changelog /tmp/5iwgCcEfVX/treeplot-0.7.4/debian/changelog --- treeplot-0.7.3/debian/changelog 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/debian/changelog 2008-11-27 18:20:03.000000000 +0000 @@ -1,3 +1,9 @@ +treeplot (0.7.4-1) intrepid; urgency=low + + * fix compilation error on amd64 architecture + + -- Olivier Langella Wed, 26 Nov 2008 11:18:51 +0200 + treeplot (0.7.3-1) intrepid; urgency=low * fix compilation error with newest gcc diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/debian/control /tmp/5iwgCcEfVX/treeplot-0.7.4/debian/control --- treeplot-0.7.3/debian/control 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/debian/control 2008-11-27 18:20:03.000000000 +0000 @@ -7,7 +7,7 @@ Uploaders: Charles Plessy , Vincent Danjean , Olivier Langella -Standards-Version: 0.7.3 +Standards-Version: 0.7.4 Build-Depends: debhelper (>= 5), libplot-dev (>= 2.4), cmake (>= 2) Package: treeplot diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/src/applications.h /tmp/5iwgCcEfVX/treeplot-0.7.4/src/applications.h --- treeplot-0.7.3/src/applications.h 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/src/applications.h 2008-11-27 18:20:03.000000000 +0000 @@ -23,6 +23,8 @@ using namespace std; +using namespace biolib::vecteurs; + class Application { public: diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/src/appltreeplot.h /tmp/5iwgCcEfVX/treeplot-0.7.4/src/appltreeplot.h --- treeplot-0.7.3/src/appltreeplot.h 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/src/appltreeplot.h 2008-11-27 18:20:03.000000000 +0000 @@ -22,7 +22,7 @@ //#include "phylogramtreeplotter.h" #include "treeplotter.h" -#define version_treeplot "0.7.3" +#define version_treeplot "0.7.4" /**Application Treeplotter *@author Olivier Langella diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/src/arbre.h /tmp/5iwgCcEfVX/treeplot-0.7.4/src/arbre.h --- treeplot-0.7.3/src/arbre.h 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/src/arbre.h 2008-11-27 18:20:03.000000000 +0000 @@ -36,6 +36,7 @@ #include "matrices.h" using namespace std; +using namespace biolib::vecteurs; class ArbreVectUINT:public vector { public: diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/src/matrices.cpp /tmp/5iwgCcEfVX/treeplot-0.7.4/src/matrices.cpp --- treeplot-0.7.3/src/matrices.cpp 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/src/matrices.cpp 2008-11-27 18:20:03.000000000 +0000 @@ -15,16 +15,12 @@ * * ***************************************************************************/ -#include -#include -#include -#include -#include -#include -using namespace std; #include"matrices.h" +namespace biolib { +namespace vecteurs { + //template int Matrice::_oformat = 1; //Format de sortie: par d�faut @@ -97,18 +93,18 @@ case 1: //rectangulaire normale _type = type; break; - case 2: //matrice triangulaire + case 2: //matrice triangulaire (distances) if (_nc == _nl) { unsigned long i,j; for (i = 0; i < _nc; i++) { for (j = 0; j < i; j++) { - if (GetCase(i,j) != GetCase(j,i)) return;// throw Matrice::Anomalie(5); + if (GetCase(i,j) != GetCase(j,i)) throw typename biolib::vecteurs::Matrice::Anomalie(5); } } _type = type; } else { -// throw Matrice::Anomalie(5); //Echec de conversion + throw typename biolib::vecteurs::Matrice::Anomalie(5); //Echec de conversion } break; default: @@ -166,9 +162,9 @@ template void Matrice::oExcel(ostream& fichier){ unsigned long i,j; - -// fichier.setf(ios::scientific); +// fichier.setf(ios::scientific); + //fichier << "coucou"; // �criture du titre for (i=0; i < _titre.size();i++) { fichier << _titre[i]; @@ -182,7 +178,7 @@ for (i=1; i<_nc; i++) fichier << '\t' << _tcol[i]; } fichier << endl; - + //�criture de la matrice for (i=0; i<_nl; i++) { if ((_flag == 1)||(_flag == 3)){ @@ -199,6 +195,114 @@ } +template void Matrice::oGnumeric(ostream& fichier){ + fichier << ""; + fichier << ""<< endl; + fichier << ""<< endl; + fichier << " "<< endl; + fichier << "WorkbookView::show_horizontal_scrollbar"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::show_vertical_scrollbar"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::show_notebook_tabs"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::do_auto_completion"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " biology softwares"<< endl; + fichier << " http://www.pge.cnrs-gif.fr/bioinfo"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " author"<< endl; + fichier << " Olivier Langella, Olivier.Langella@pge.cnrs-gif.fr"<< endl; + fichier << " "<< endl; + fichier << ""<< endl; + fichier << ""<< endl; + fichier << " Matrix 1"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; +// fichier.setf(ios::scientific); + + oGnumericSheet(fichier, "Matrix 1") ; + + fichier << " "<< endl; + fichier << " "<< endl; + +} + +template void Matrice::oGnumericSheet(ostream& fichier, const string & sheetname) const{ + unsigned long i,j, irow(0), jcol(0); + const string value_format("0.000000"); + +// fichier.imbue(); + + fichier << "" << endl; + fichier << "" << sheetname << ""<< endl; + fichier << "" << (GetNC() + 2) << ""<< endl; + fichier << "" << (GetNL() + 5 + _titre.size()) << ""<< endl; + fichier << "1.000000"<< endl; + fichier << ""<< endl; + + fichier << ""<< endl; + // �criture du titre + for (i=0; i < _titre.size();i++, irow++) { + fichier << ""; + fichier << _titre[i]; + fichier << "" << endl; + } + fichier << "#"; + if ((_flag == 2)||(_flag == 3)){ + //�tiquettes des colonnes + jcol = 1; + fichier << ""; + fichier << _tcol[0]; + fichier << "" << endl; + jcol++; + for (i=1; i<_nc; i++,jcol++) { + fichier << ""; + fichier << _tcol[i]; + fichier << "" << endl; + } + } + irow++; + + //fichier.setf(ios::scientific); + //�criture de la matrice + for (i=0; i<_nl; i++, irow++) { + if ((_flag == 1)||(_flag == 3)){ + //�tiquettes des lignes + fichier << ""; + fichier << _tlig[i]; + fichier << "" << endl; + } + jcol = 1; + for (j=0; j<_nc; j++,jcol++) { +// fichier << '\t' << _tab [i * _nc + j]; + fichier << ""; + fichier << GetCase(i,j); + fichier << "" << endl; + } + fichier << endl; + } + fichier << "" << endl; + fichier << " "<< endl; + +} + template void Matrice::oNtsys(ostream& sortie){ unsigned long i,j, k, tmaxligne(100); long pos ; @@ -207,7 +311,7 @@ // �criture du titre for (i=0; i < _titre.size();i++) { - sortie << '"'; + sortie << "\""; sortie << _titre[i]; sortie << endl; } @@ -250,7 +354,7 @@ } sortie << endl; } - + //�criture de la matrice switch (_type) { case 2: @@ -301,7 +405,7 @@ unsigned long taille(_nc * _nl); unsigned long j; T ppvaleur(_tab[0]); - + for (j=1; j < taille; j++) if (_tab[j] < ppvaleur) ppvaleur = _tab[j]; return (ppvaleur); @@ -315,6 +419,31 @@ for (j=0; j < taille; j++) if (_tab[j] < 0) _tab[j] = 0; } +template void Matrice::iGnumeric(istream& entree){ +} + +template<> void Matrice::iGnumeric(istream& entree){ + //lecture de matrices contenues dans les fichiers Gnumeric XML +#ifdef XmlParse_INCLUDED + //entree.seekg(0); + +//cerr << "void Matrice::iGnumeric(istream& entree) 1" << endl; + + try { + olivxml::ImportGnumeric parser; + parser.iParseFlux(entree); + *this = parser.get_set_of_matrix().GetConstMatrice(0); + } + catch (olivxml::ImportGnumeric::Anomalie pb){ + throw Anomalie(1); + } +//cerr << "void Matrice::iGnumeric(istream& entree)" << endl; +//cerr << "void Matrice::iGnumeric(istream& entree) apres" << endl; +#else + throw Anomalie(1); +#endif +} + template void Matrice::iNtsys(istream& entree){ //lecture de matrices contenues dans les fichiers NTSYS char car; @@ -324,7 +453,8 @@ //3=> les 2 //0=> rien unsigned long i,j, nc, nl; int miss, type; - + +//cerr << "Matrice::iNtsys(istream& entree)" << endl; entree.seekg(0); car = entree.peek(); @@ -338,14 +468,16 @@ // entree.get(car); car = entree.peek(); } - if (entree.eof()!=0) throw Anomalie(1);//erreur de lecture +//cerr << "Matrice::iNtsys(istream& entree) 2" << endl; + if ((entree.eof()!=0) || (entree.fail())) throw Anomalie(1);//erreur de lecture +//cerr << "Matrice::iNtsys(istream& entree) 3" << endl; // mot[0] = car; // mot[1] = '\0'; // type = atoi(mot); GetLigneFlot(entree, mot); //ligne 0 L23 L34 missing_value - if ((mot.GetNbMots() != 4)||(entree.eof()!=0)) throw Anomalie(1); + if ((mot.GetNbMots() != 4) || (entree.fail()) ||(entree.eof()!=0)) throw Anomalie(1); mot.GetMot(1,sousmot); type = atoi(sousmot.c_str()); @@ -355,18 +487,20 @@ //nombre de lignes mot.GetMot(2,sousmot); // entree >> mot; - if (sousmot[0] == 'L') { + if (sousmot[sousmot.size()-1] == 'L') { sousmot.Remplacer("L",""); -// titres = 1; + titres = 1; +// strcpy(mot + strlen(mot) - 1,""); } nl = atoi(sousmot.c_str()); if ((nl > 9999) ||(nl<1)) throw Anomalie(1); //nombre de colonnes mot.GetMot(3,sousmot); - if (sousmot[0] == 'L') { + if (sousmot[sousmot.size()-1] == 'L') { sousmot.Remplacer("L",""); -// titres = titres + 2; + titres = titres + 2; +// strcpy(mot + strlen(mot) - 1,""); } nc = atoi(sousmot.c_str()); if ((nc > 9999) ||(nc < 1)) throw Anomalie(1); @@ -377,29 +511,34 @@ resize(nl,nc); +//cerr << "Matrice::iNtsys(istream& entree) nc nl " << _nc << _nl << endl; _miss = miss; _type = type; _flag = titres; +//cerr << "Matrice::iNtsys(istream& entree) 2" << endl; //lecture des �tiquettes, lignes puis colonnes if ((titres == 1)||(titres == 3)){ //�tiquettes des lignes for (i=0; i<_nl; i++) { entree >> _tlig[i]; +//cerr << "Matrice::iNtsys(istream& entree) _tlig " << _tlig[i] << endl; if (entree.fail()) throw Anomalie(1);//erreur de lecture // _tlig[i].assign(mot); } } +//cerr << "Matrice::iNtsys(istream& entree) 3" << endl; if ((titres == 2)||(titres == 3)){ //�tiquettes des colonnes for (i=0; i<_nc; i++) { entree >> _tcol[i]; +//cerr << "Matrice::iNtsys(istream& entree) tcol " << _tcol[i] << endl; if (entree.fail()) throw Anomalie(1);//erreur de lecture } } - + //lecture de la matrice proprement dite switch (_type) { case 1: @@ -419,12 +558,14 @@ // cas des matrices triangulaires if (_flag == 2) _tlig = _tcol; if (_flag == 1) _tcol = _tlig; - + + entree.clear(); for (i=0; i<_nc; i++) { for (j=0; j<=i; j++) { // entree >> (long double) _tab[(i*_nc) + j]; entree >> _tab[(i*_nc) + j]; +//cerr << "Matrice::iNtsys(istream& entree) 4 " << _tab[(i*_nc) + j] << " " << i << " " << j << endl; if (entree.fail()) throw Anomalie(1);//erreur de lecture _tab[(j*_nc) + i] = _tab[(i*_nc) + j]; } @@ -435,7 +576,7 @@ throw Anomalie(1); break; } - + } template void Matrice::iPhylip(istream& entree){ @@ -444,10 +585,15 @@ ChaineCar sousmot; unsigned long nbmot; unsigned long i, j; - long nl, nc, top; + long nl(0), nc(0), top(0); - GetLigneFlot(entree, mot); - +// entree.seekg(0); + entree.clear(); + +//cerr << "Matrice::iPhylip(istream& entree)" << endl; + mot.GetLigneFlot(entree); + +//cerr << "Matrice::iPhylip(istream& entree) 2" << endl; nbmot = mot.GetNbMots(); if ((nbmot <1) || (nbmot > 2)) throw Anomalie(1); @@ -455,6 +601,7 @@ if (sousmot.EstUnChiffre() == false) throw Anomalie(1); nl = atol(sousmot.c_str()); +//cerr << "Matrice::iPhylip(istream& entree) 3" << endl; _flag = 0; if (nbmot == 1) { resize(nl,nl); @@ -471,8 +618,12 @@ // GetLigneFlot(entree, mot); GetLigneFlot(entree, mot); mot.GetMot(1,sousmot); - if (sousmot.EstUnChiffre() == false) _flag = 0; - else _flag = 1; +//cerr << "Matrice::iPhylip(istream& entree) coucou 1 " << sousmot << endl; + if (sousmot.EstUnChiffre()) _flag = 0; + else { // titre de ligne + _flag = 1; + _tlig.resize(nl); + } /* nbmot = mot.GetNbMots(); if (nbmot == (_nc + 1)) { _flag = 1; @@ -481,11 +632,12 @@ _flag = 0; } else throw Anomalie(1); -*/ +*/ entree.seekg(top); for (i = 0; i < _nl; i++) { if ((_flag == 1)||(_flag == 3)) entree >> _tlig[i]; +//cerr << "Matrice::iPhylip(istream& entree) coucou 2 " << _tlig[i] << endl; if (entree.fail()) throw Anomalie(1);//erreur de lecture for (j = 0; j < _nc; j++) { entree >> GetCase(i,j); @@ -495,9 +647,11 @@ SetType(1); SetType(2); +//cerr << "Matrice::iPhylip(istream& entree) fin" << endl; + } - + template void Matrice::iExcel(istream& entree){ //lecture de matrices contenues dans des fichiers Excel // la matrice doit �tre indiqu�e par "/" ou "#" et commencer @@ -512,7 +666,7 @@ unsigned long i,j; long nc(0), nl(0); long debut, top; - + entree.seekg(0); entree.get(car); @@ -525,7 +679,7 @@ entree.get(car); } -//cerr << "coucou excel"; +//cerr << "coucou excel 2"; if (entree.fail()) throw Anomalie(1);//erreur de lecture nc = 0; nl = 0; @@ -620,7 +774,7 @@ SetType(2); // } // catch (Matrice::Anomalie erreur) { - // cout << erreur.fmessage(erreur.le_pb); + // cout << erreur.fmessage(erreur.le_pb); // SetType(1); // } } @@ -839,7 +993,7 @@ //copie des �tiquettes des colonnes Resultat._flag = 2; Resultat._tcol = _tcol; - Resultat._tlig = _tcol; + Resultat._tlig = _tcol; } for (i = 0; i < _t ; i++) { @@ -870,7 +1024,7 @@ } if ((_flag == 1)||(_flag == 3)){ //copie des �tiquettes des lignes - Resultat._tlig = _tlig; + Resultat._tlig = _tlig; } for (i = 0; i < _t ; i++) { @@ -903,7 +1057,7 @@ } if ((_flag == 1)||(_flag == 3)){ //copie des �tiquettes des lignes - Resultat._tlig = _tlig; + Resultat._tlig = _tlig; } for (i = 0; i < _t ; i++) { @@ -915,7 +1069,7 @@ } template long double Matrice::fdet() const{ - //calcul du d�terminant d'une matrice par r�cursivit� + //calcul du d�terminant d'une matrice par r�cursivit // Olivier Langella 29 oct 98 // D'apr�s J. Lefebvre "introduction aux analyses statistiques // multidimensionnelle" p 36 @@ -932,7 +1086,7 @@ } template long double Matrice::fdetrec() const{ - //calcul du d�terminant d'une matrice par r�cursivit� + //calcul du d�terminant d'une matrice par r�cursivit // utilis� par fdet; long double det(0); unsigned long i; @@ -945,7 +1099,7 @@ return(det); } else { - + for (i=0; i < _nl; i++) { calculs = *this; calculs.SupprCol(0); @@ -1083,7 +1237,7 @@ long double temp,teta; unsigned long i, j, nc(_nc); long ind1, ind2; - + long double scarre(0), tracecar; for (i = 0 ; i <_t;i++) { @@ -1109,7 +1263,7 @@ } } } - + // calcul de teta teta = (matA._tab[(posr*nc) + poss] * 2) / (matA._tab[(posr*nc) + posr] - matA._tab[(poss*nc) + poss]); teta = atan(teta) / 2; @@ -1331,7 +1485,7 @@ }*/ template istream& operator>>(istream& ientree, Matrice& lamatrice) { - + //cerr << "coucou"; lamatrice.iFichier(ientree); //cerr << "coucou"; @@ -1342,7 +1496,7 @@ template void Matrice::oPhylip(ostream& fichier) { unsigned long i, j; - + fichier.setf(ios::scientific); /* // �criture du titre @@ -1382,7 +1536,7 @@ } template void Matrice::iFichier(istream& ientree) { - int nbformat(5),i(1); + int nbformat(6),i(1); char car; bool autre(true); @@ -1399,6 +1553,8 @@ try { ientree.clear(); ientree.seekg(0); + //ientree.seekg (0, ios::beg); + // ientree.rewind(); _titre.resize(0); //cerr << "coucou ifichier" << i << endl; iFichier(ientree,i); @@ -1410,7 +1566,8 @@ if (erreur.le_pb > 0) { autre = true; if (i == (nbformat-1)) { - cerr << erreur.fmessage(erreur.le_pb)<< endl; +// cerr << erreur.fmessage(erreur.le_pb)<< endl; + throw Anomalie(1); autre = false; } erreur.le_pb = 0; @@ -1420,6 +1577,8 @@ } } +MatriceLD::MatriceLD():Matrice() {}; + void MatriceLD::fdiagonalisation(MatriceLD & matdiag, vector& pvlp) { /******************************************************************************/ /* DIAGONALISATION DE LA MATRICE (Householder) */ @@ -1436,9 +1595,9 @@ matdiag.resize(_nc,_nc); matdiag.SetType(2); + + ps = new long double[_nc]; - ps = new (long double[_nc]); - matdiag._titre = _titre; matdiag._titre.push_back("diagonalisation par la methode Q-L"); matdiag._flag = _flag; @@ -1582,7 +1741,7 @@ c = 0; i = (_nc-1)-j+1; k = i-1; - + if ( k < 1){ *(ps+i) = *(pcov + rindice(i,k)); pvlp[i] = b; @@ -1723,11 +1882,12 @@ res._flag = res._flag + 2; //num�rotation des axes for (i=0; i < res._nc; i++) { +// strcpy(temp,"axe_"); // itoa(i + 1,temp + 4,10); // strcat(temp,""); res._tcol[i].assign("axe_"); res._tcol[i].AjEntier (i + 1); - + // res._tcol[i].assign(temp); stat._tlig[i].assign(res._tcol[i]); } @@ -1855,7 +2015,7 @@ //triangulaire inf�rieure, de type 2 pour NTSYS //pstat: matrice contenant les statistiques sur l'importance de //chaque axe dans un espace � n dimensions - //pcoord: matrice contenant les coordonn�es des OTUs (r�sultat) dans cet + //pcoord: matrice contenant les coordonn�es des OTUs (r�sultat) dans cet // espace � n dimensions MatriceLD& pmat1 = *this; @@ -1891,7 +2051,7 @@ // mdiag.normalise(&mnormalisee, pmat1, pvlp) ; - + //coordcol redimensionne pstat et pcoord pmat1.fcoordcol(pstat, pcoord, mdiag, pvlp) ; //cerr << "MatriceLD::fatd (MatriceLD& pcoord, MatriceLD& pstat) fin" << endl; @@ -1904,10 +2064,15 @@ } // Lecture de fichiers contenant plusieurs matrices +void JeuMatriceLD::iFluxXML(istream& entree) { + +} + void JeuMatriceLD::iFlux(istream& entree) { // Lecture de fichiers contenant plusieurs matrices stringstream* tampon; + bool is_xml(false); // iostream ensortie(tampon.rdbuf()); char car; ChaineCar ligne; @@ -1921,7 +2086,7 @@ entree.seekg(0); positions.push_back(0); positions.push_back(0); - + entree.get(car); while (entree.good()) { if ((car == '/') && (entree.peek() == '/')) { @@ -1936,11 +2101,20 @@ } else { GetLigneFlot(entree, ligne); + if (ligne.find("xml version=\"1.0\"", 0) > 0) { + // c'est du ricql�������s !!!!! + is_xml = true; + break; + } } positions.back() = entree.tellg(); entree.get(car); } + if (is_xml) { + iFluxXML(entree); + return; + } // remplissage du buffer de matrices for (i = 0 ; i < (positions.size() - 1); i += 2) { @@ -1989,7 +2163,10 @@ void JeuMatriceLD::oFlux(ostream& sortie, int format) const { // Ecriture de fichiers contenant plusieurs matrices - + if (format == 5) { + oGnumeric(sortie); + return; + } long i, taille(_tableau.size()); for (i=0; i < taille; i++) { @@ -2000,6 +2177,62 @@ } +void JeuMatriceLD::oGnumeric(ostream& fichier) const { +// Ecriture de fichiers contenant plusieurs matrices + long i, taille(_tableau.size()); + + fichier << ""; + fichier << ""<< endl; + fichier << ""<< endl; + fichier << " "<< endl; + fichier << "WorkbookView::show_horizontal_scrollbar"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::show_vertical_scrollbar"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::show_notebook_tabs"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " WorkbookView::do_auto_completion"<< endl; + fichier << " 4"<< endl; + fichier << " TRUE"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " biology softwares"<< endl; + fichier << " http://www.pge.cnrs-gif.fr/bioinfo"<< endl; + fichier << " "<< endl; + fichier << " "<< endl; + fichier << " author"<< endl; + fichier << " Olivier Langella, Olivier.Langella@pge.cnrs-gif.fr"<< endl; + fichier << " "<< endl; + fichier << ""<< endl; + fichier << ""<< endl; + for (i=0; i < taille; i++) { + fichier << "" << _titres[i] << ""< "<< endl; + fichier << " "<< endl; +// fichier.setf(ios::scientific); + + for (i=0; i < taille; i++) { + _tableau[i]->oGnumericSheet(fichier, _titres[i]); + } + + fichier << " "<< endl; + fichier << " "<< endl; + +} + void JeuMatriceLD::SetTitre(long i, const char * chaine) { // if ((i < 0) || (i >= _titres.size())) throw Anomalie(1); @@ -2021,3 +2254,6 @@ for (i=0 ; i < nouvtaille; i++) _tableau[i] = new MatriceLD; } + +} //namespace biolib { +} //namespace vecteurs { diff -Nru /tmp/mnYh0Z9cJF/treeplot-0.7.3/src/matrices.h /tmp/5iwgCcEfVX/treeplot-0.7.4/src/matrices.h --- treeplot-0.7.3/src/matrices.h 2008-11-07 18:54:24.000000000 +0000 +++ treeplot-0.7.4/src/matrices.h 2008-11-27 18:20:03.000000000 +0000 @@ -25,11 +25,24 @@ #ifndef MATRICES_H #define MATRICES_H +//#define WITHOUT_EXPAT +//#ifndef WITHOUT_EXPAT +//#include "expat.h" +//#endif -#include"vecteurs.h" #include +#include #include +#include +#include +#include #include +//#include +#include "vecteurs.h" + +namespace biolib { +namespace vecteurs { + class MatriceLD; class MatriceF; @@ -78,9 +91,9 @@ void SetType(int type); //type de matrice: //1 -> rectangulaire //3 -> triangulaire - virtual void resize(unsigned long nblig, unsigned long nbcol); //efface et réalloue de la mémoire - virtual void SupprCol(unsigned long); //efface et réalloue de la mémoire - virtual void SupprLig(unsigned long); //efface et réalloue de la mémoire + virtual void resize(unsigned long nblig, unsigned long nbcol); //efface et réalloue de la mémoire + virtual void SupprCol(unsigned long); //efface et réalloue de la mémoire + virtual void SupprLig(unsigned long); //efface et réalloue de la mémoire virtual bool redim(unsigned long, unsigned long); //redimensionne la matrice void ftranspose(); @@ -108,12 +121,19 @@ case 1: iExcel(entree); return; + break; case 2: iNtsys(entree); return; + break; case 4: iPhylip(entree); return; + break; + case 5: + iGnumeric(entree); + return; + break; default: return; } @@ -135,6 +155,10 @@ oPhylip(sortie); // throw Anomalie(6); break; + case 5: + oGnumeric(sortie); + // throw Anomalie(6); + break; default: break; } @@ -165,9 +189,12 @@ virtual void iNtsys(istream & entree); virtual void iExcel(istream & entree); + virtual void iGnumeric(istream & entree); virtual void iPhylip(istream & entree); void oNtsys(ostream & sortie); void oExcel(ostream & sortie); + void oGnumeric(ostream & sortie); + void oGnumericSheet(ostream& fichier, const string & sheetname) const; void oPhylip(ostream& sortie); void oXgobi(const string&); @@ -183,7 +210,8 @@ protected : - long double fdetrec() const; + + long double fdetrec() const; long rindice(long ligne, long colonne) { //if (_type == 3) if (colonne > ligne) return((colonne * _nc) + ligne); @@ -195,7 +223,7 @@ unsigned long _nl; //nb de lignes (j) unsigned int _type; //type de matrice int _miss; //missing value - unsigned int _flag; //étiquettes + unsigned int _flag; //étiquettes //1=> titres des lignes 2=> titres des colonnes //3=> les 2 //0=> rien @@ -210,11 +238,11 @@ // 1-> erreur pendant lecture de fichier // 2-> erreur dans mdiaggl - // 3-> opération impossible sur ce type de matrice + // 3-> opération impossible sur ce type de matrice // 4-> calcul impossible - // 5-> Echec de la conversion de la matrice en matrice symétrique + // 5-> Echec de la conversion de la matrice en matrice symétrique - // 6-> erreur pendant l'écriture du fichier + // 6-> erreur pendant l'écriture du fichier // 7-> acces hors bornes dans la matrice int le_pb; string _message; @@ -225,16 +253,16 @@ _message = "Erreur pendant la lecture du fichier..."; break; case 2: - _message = "Cette matrice ne peut être diagonalisée"; + _message = "Cette matrice ne peut être diagonalisée"; break; case 3: - _message = "Opération impossible sur ce type de matrice"; + _message = "Opération impossible sur ce type de matrice"; break; case 4: _message = "Calcul impossible"; break; case 5: - _message = "Echec de la conversion de la matrice en matrice symétrique"; + _message = "Echec de la conversion de la matrice en matrice symétrique"; break; case 6: _message = "Erreur pendant l'ecriture du fichier"; @@ -273,11 +301,11 @@ // les matrices class MatriceLD:public Matrice { public : - MatriceLD():Matrice() {}; + MatriceLD(); MatriceLD(long nl, long nc = 0):Matrice(nl,nc){}; MatriceLD(const MatriceLD& lamatrice):Matrice(lamatrice){}; //constructeur de copie MatriceLD(const Matrice& lamatrice):Matrice(lamatrice){}; //constructeur de copie - ~MatriceLD() {}; + virtual ~MatriceLD() {}; void fatd (MatriceLD&, MatriceLD&); void fscalaire(MatriceLD& pscalaire); @@ -313,6 +341,7 @@ ~JeuMatriceLD() {long i, t(_tableau.size()); for (i=0 ; i < t; i++) delete _tableau[i];} MatriceLD& GetMatrice(long i) {return *(_tableau[i]);} + const MatriceLD& GetConstMatrice(long i) const {return *(_tableau[i]);} MatriceLD& GetMatrice(ChaineCar chaine) { long i(_titres.Position(chaine)); if (i < 0) throw Anomalie(1); @@ -332,7 +361,10 @@ private: - vector _tableau; + void iFluxXML(istream& entree); + void oGnumeric(ostream& sortie) const; + + vector _tableau; Titre _titres; @@ -366,7 +398,10 @@ //ofstream& operator<<(ofstream& sortie,MatriceLD& lamatrice); template ofstream& operator<<(ofstream& sortie,Matrice& lamatrice); -template istream& operator>>(istream& ientree,Matrice& lamatrice); +template istringstream& operator>>(istringstream& ientree,Matrice& lamatrice); + +} //namespace biolib { +} //namespace vecteurs { #endif