Changeset 3194


Ignore:
Timestamp:
Apr 22, 2014, 11:24:56 AM (9 years ago)
Author:
Peter
Message:

add missing file. see r3173

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/yat/utility/Aligner.cc

    r2881 r3194  
    8484        if (x(i-1, j-1) + score(i-1, j-1) > x(i,j)) {
    8585          x(i,j) = x(i-1, j-1) + score(i-1, j-1);
    86           cigar(i, j) = diagonal;
     86          directions(i, j) = diagonal;
    8787        }
    8888
    89         if (cigar(i, j-1) == right) {
     89        if (directions(i, j-1) == right) {
    9090          if (x(i, j-1)-horizon_gap_ > x(i,j)) {
    9191            x(i,j) = x(i,j-1) - horizon_gap_;
    92             cigar(i,j) = right;
     92            directions(i,j) = right;
    9393          }
    9494        }
    9595        else if(x(i,j-1)-horizon_gap_-open_horizon_gap_ > x(i,j)) {
    9696          x(i,j) = x(i,j-1) - horizon_gap_ - open_horizon_gap_;
    97           cigar(i,j) = right;
     97          directions(i,j) = right;
    9898        }
    9999
    100         if (cigar(i-1,j) == down) {
     100        if (directions(i-1,j) == down) {
    101101          if (x(i-1,j) - vertical_gap_ > x(i,j)) {
    102102            x(i,j) = x(i-1,j) - vertical_gap_;
    103             cigar(i,j) = down;
     103            directions(i,j) = down;
    104104          }
    105105        }
    106106        else if (x(i-1,j) - vertical_gap_ - open_vertical_gap_ > x(i,j)) {
    107107          x(i,j) = x(i-1,j) - vertical_gap_ - open_vertical_gap_;
    108           cigar(i,j) = down;
     108          directions(i,j) = down;
    109109        }
    110110      }
     
    118118
    119119
    120   Aligner::direction& Aligner::cigar(size_t i, size_t j)
     120  Aligner::direction& Aligner::directions(size_t i, size_t j)
    121121  {
    122122    return alignment_[i*columns_ + j];
  • trunk/yat/utility/Aligner.h

    r3180 r3194  
    2424*/
    2525
     26#include <boost/cstdint.hpp>
     27
    2628#include <cstddef>
     29#include <iosfwd>
    2730#include <vector>
    2831
     
    126129    const direction& alignment(size_t i, size_t j) const;
    127130
     131    /**
     132       \since new in yat 0.12
     133     */
     134    class Cigar
     135    {
     136    public:
     137      void clear(void);
     138      void push_back(uint8_t op, uint32_t len=1);
     139      void push_front(uint8_t op, uint32_t len=1);
     140      void pop_back(void);
     141      void pop_front(void);
     142      uint8_t op(size_t) const;
     143      char opchr(size_t) const;
     144      uint32_t oplen(size_t) const;
     145      uint32_t operator[](size_t) const;
     146      size_t size(void) const;
     147    private:
     148      // using compiler generated copy
     149      // Cigar(const Cigar& other);
     150      // Cigar& operator=(const Cigar&);
     151    };
     152
     153    /**
     154       \since new in yat 0.12
     155     */
     156    const Cigar cigar(size_t i, size_t j) const;
     157
    128158  private:
    129     direction& cigar(size_t i, size_t j);
     159    direction& directions(size_t i, size_t j);
    130160
    131161    size_t columns_;
     
    137167  };
    138168
     169
     170  /**
     171   */
     172  std::ostream& operator<<(std::ostream& os, const Aligner::Cigar& cigar);
     173
    139174}}} // of namespace utility, yat, and theplu
    140175
Note: See TracChangeset for help on using the changeset viewer.