/*------------------------------------------------------------ Copyright (C) 1999 by Rolf Backofen, Sebastian Will. All Rights Reserved. Permission to use, copy, modify, and distribute this software and its documentation for NON-COMMERCIAL purposes and without fee is hereby granted provided that this copyright notice appears in all copies. THE AUTHORS AND PUBLISHER MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THE AUTHORS AND PUBLISHER SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. ------------------------------------------------------------ */ #include "basicdef.hh" #include "matrices.hh" #include "printarray.hh" // ======================================================================= // // CLASS: DistanceMatrix // // AUTHOR: Rolf Backofen // // ======================================================================= // ---------------------------------------------------------------------- // DistanceMatrix construction. a and b are the strings to be aligned // sets row, col, a,b and initializes darray. // DistanceMatrix::DistanceMatrix(const Sequence &a, const Sequence &b) : matrix(a.length()+1,b.length()+1),a_(a), b_(b) { #ifndef NDEBUG cout <<"create distance matrix "<0) { pr.set(1,y,a_[i]); } // rest for (int j=0; j<=m; ++j) { if ((*this)[i][j] == INFTY) floatstr = " INF"; else if (MINUSINFTY == (*this)[i][j]) floatstr = " -INF"; else sprintf(floatstr,"%6.2f",(double)((*this)[i][j])); // cout << "|" << floatstr << "|" << endl; for (int l=0;l0) cout << ' ' << mat.a_[i]; else cout << " "; for (int j=0; j<=m; ++j) { for (int l=0;l