BitMagic-C++: xsample08.cpp File Reference

BitMagic-C++

Data Structures | Typedefs | Enumerations | Functions
xsample08.cpp File Reference
`#include <iostream>`
`#include <utility>`
`#include <vector>`
`#include <memory>`
`#include <cassert>`
`#include "bm.h"`
`#include "bmintervals.h"`
`#include "bmsparsevec_compr.h"`
Include dependency graph for xsample08.cpp:

Go to the source code of this file.

## Data Structures
struct | data_model
| Data frame object, sued to buid succinct data model. More...

## Typedefs
typedef bm::interval_enumerator< bm::bvector<> > | interval_enumerator_type
typedef std::vector< std::unique_ptr< bm::bvector<> > > | layout_vector_type
typedef bm::sparse_vector< unsigned char, bm::bvector<> > | sparse_vector_u8
typedef bm::rsc_sparse_vector< unsigned char, sparse_vector_u8 > | rsc_vector_u8
typedef std::vector< std::unique_ptr< rsc_vector_u8 > > | starnds_vector_type

## Enumerations
enum | Strand { positive =0, negative =1, unknown =2 }

## Functions
void | set_feature_strand (data_model &dm, size_t plane, bm::bvector<>::size_type pos, unsigned char strand)
void | add_object (data_model &dm, unsigned start, unsigned end, unsigned char strand)
| Register new object in the data model: [start..end] + strand. More...
void | splice_model (data_model &dm_target, const data_model &dm, bm::bvector<>::size_type start, bm::bvector<>::size_type end, bool copy_strands)
| Data model splicer. More...
void | print_model (const data_model &dm)
| This is ASCII art "renderer" for the data model. More...
int | main (void)

## Typedef Documentation

## ◆ interval_enumerator_type

typedef bm::interval_enumerator<bm::bvector<> > interval_enumerator_type

Examples
  xsample08.cpp.

Definition at line 63 of file xsample08.cpp.

## ◆ layout_vector_type

typedef std::vector<std::unique_ptr<bm::bvector<> > > layout_vector_type

Examples
  xsample08.cpp.

Definition at line 64 of file xsample08.cpp.

## ◆ rsc_vector_u8

typedef bm::rsc_sparse_vector<unsigned char, sparse_vector_u8> rsc_vector_u8

Examples
  xsample08.cpp.

Definition at line 67 of file xsample08.cpp.

## ◆ sparse_vector_u8

typedef bm::sparse_vector<unsigned char, bm::bvector<> > sparse_vector_u8

Examples
  xsample08.cpp.

Definition at line 66 of file xsample08.cpp.

## ◆ starnds_vector_type

typedef std::vector<std::unique_ptr<rsc_vector_u8> > starnds_vector_type

Examples
  xsample08.cpp.

Definition at line 68 of file xsample08.cpp.

## Enumeration Type Documentation

## ◆ Strand

enum Strand

Enumerator
positive |
negative |
unknown |

Definition at line 320 of file xsample08.cpp.

## Function Documentation

## ◆ add_object()

void add_object | ( | data_model & | dm,
|  | unsigned | start,
|  | unsigned | end,
|  | unsigned char | strand
| ) |  |

Register new object in the data model: [start..end] + strand.

Examples
  xsample08.cpp.

Definition at line 166 of file xsample08.cpp.

References bm::bvector< Alloc >::any_range(), bm::BM_GAP, data_model::layout_v, set_feature_strand(), and bm::bvector< Alloc >::set_range().

Referenced by main().

## ◆ main()

int main | ( | void |  | ) |

Examples
  xsample08.cpp.

Definition at line 324 of file xsample08.cpp.

References add_object(), negative, data_model::optimize(), positive, print_model(), splice_model(), and unknown.

## ◆ print_model()

void print_model | ( | const data_model & | dm | ) |

This is ASCII art "renderer" for the data model.

illustrates how to manipulate succinct data model to create graphics

Examples
  xsample08.cpp.

Definition at line 265 of file xsample08.cpp.

References bm::interval_enumerator< BV >::advance(), bm::interval_enumerator< BV >::end(), bm::rsc_sparse_vector< Val, SV >::get(), data_model::layout_v, bm::interval_enumerator< BV >::start(), data_model::strand_v, and bm::interval_enumerator< BV >::valid().

Referenced by main().

## ◆ set_feature_strand()

void set_feature_strand | ( | data_model & | dm,
|  | size_t | plane,
|  | bm::bvector<>::size_type | pos,
|  | unsigned char | strand
| ) |  |

Examples
  xsample08.cpp.

Definition at line 142 of file xsample08.cpp.

References bm::rsc_sparse_vector< Val, SV >::is_null(), bm::rsc_sparse_vector< Val, SV >::set(), and data_model::strand_v.

Referenced by add_object().

## ◆ splice_model()

void splice_model | ( | data_model & | dm_target,
|  | const data_model & | dm,
|  | bm::bvector<>::size_type | start,
|  | bm::bvector<>::size_type | end,
|  | bool | copy_strands
| ) |  |

Data model splicer.

Examples
  xsample08.cpp.

Definition at line 208 of file xsample08.cpp.

References data_model::add_layout(), data_model::add_strand(), bm::BM_GAP, bm::find_interval_end(), bm::find_interval_start(), data_model::layout_v, and data_model::strand_v.

Referenced by main().