select_subvector_c Class Template Reference
[CrossVector Iterator]

#include <type_vector.hpp>

List of all members.


Detailed Description

template<typename VecOfVecs, std::size_t N>
class boost::mpl::detail::select_subvector_c< VecOfVecs, N >

Converts the basis of a number

Given a non-negative integer N, and a vector of vectors VecOfVecs, returns a vector of size size<VecOfVecs>, such that the i-th element of the returned vector is the j-th element of the i-th vector in VecOfVecs, where the j-s comprise the representation of N as a number in which each digit has a different base - the size of the corresponding vector in VecOfVecs.

For example, if VecOfVecs = [[A0,A1,A2], [B0,B1,B2,B3], [C0,C1,C2,C3,C4,C5,C6], [D0,D1]] and N=17 The basis will be [3, 4, 7, 2], in which the number 17 will have a representation [2, 1, 1, 0] because 17 = 2 + (3)*1 + (3*4)*1 + (3*4*7)*0. Thus the returned vector will ve [A2, B1, C1, D0]

A more readable design would be to separate the basis conversion outside of extracting the types of VecOfVecs but that generates more types and slows down compile time.


Public Types

typedef _select_subvector<
VecOfVecs, N, size< VecOfVecs
>::value >::type 
type

The documentation for this class was generated from the following file:

Copyright © 2006 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google