General complex of dimension D
.
More...
#include <complex.hh>
Public Types | |
typedef face_bkd_iter< D > | bkd_citer |
Backward mln::Iterator type iterating on all faces. | |
typedef face_fwd_iter< D > | fwd_citer |
Forward mln::Iterator type iterating on all faces. | |
Public Member Functions | |
const void * | addr () const |
Get the address of the data of this complex. | |
complex () | |
Complex construction. | |
n_face< 0u, D > | add_face () |
Add a 0-face to the complex. | |
template<unsigned N> | |
n_face< N+1, D > | add_face (const n_faces_set< N, D > &adjacent_faces) |
Add a (N+1)-face to the complex (with N >= 0). | |
unsigned | nfaces () const |
Static manipulators. | |
template<unsigned N> | |
unsigned | nfaces_of_static_dim () const |
Return the number of N-faces . | |
unsigned | nfaces_of_dim (unsigned n) const |
Dynamic manipulators. | |
void | print (std::ostream &ostr) const |
Pretty-printing. | |
template<unsigned N> | |
void | print_faces (std::ostream &ostr) const |
Print the faces of dimension N . | |
Private Member Functions | |
template<unsigned N> | |
void | connect_ (const algebraic_n_face< N, D > &f1, const n_face< N+1, D > &f2) |
Connect two algebraic faces. | |
template<typename BinaryFunction , typename T > | |
T | fold_left_ (const BinaryFunction &f, const T &accu) const |
Functional meta-manipulators. | |
template<typename UnaryFunction > | |
UnaryFunction::result_type | apply_if_dim_matches_ (unsigned n, const UnaryFunction &f) const |
Apply a functor f to this list of n-faces. | |
Private Attributes | |
util::tracked_ptr < internal::complex_data< D > > | data_ |
The actual data of the complex. | |
Friends | |
template<unsigned D_> | |
bool | operator== (const complex< D_ > &lhs, const complex< D_ > &rhs) |
| |
class | n_face |
Accessors. | |
class | face |
template<unsigned N> | |
face_data< N, D > & | face_data_ (unsigned face_id) |
template<unsigned N> | |
const face_data< N, D > & | face_data_ (unsigned face_id) const |
General complex of dimension D
.
typedef face_bkd_iter<D> mln::topo::complex< D >::bkd_citer |
Backward mln::Iterator type iterating on all faces.
typedef face_fwd_iter<D> mln::topo::complex< D >::fwd_citer |
Forward mln::Iterator type iterating on all faces.
mln::topo::complex< D >::complex | ( | ) | [inline] |
Complex construction.
Create a new D-complex
.
n_face< 0u, D > mln::topo::complex< D >::add_face | ( | ) | [inline] |
Add a 0-face to the complex.
References mln::topo::complex< D >::data_.
Referenced by mln::io::off::internal::off_loader< I, E >::operator()().
n_face< N+1, D > mln::topo::complex< D >::add_face | ( | const n_faces_set< N, D > & | adjacent_faces | ) | [inline] |
Add a (N+1)-face to the complex (with
N
>= 0).
adjacent_faces | The (N-1 )-faces adjacent to the new N-face . |
References mln::topo::complex< D >::connect_(), mln::topo::complex< D >::data_, and mln::topo::n_faces_set< N, D >::faces().
const void * mln::topo::complex< D >::addr | ( | ) | const [inline] |
Get the address of the data of this complex.
This address is a concise and useful information to print and track the actual content of this complex.
References mln::topo::complex< D >::data_, and mln::util::tracked_ptr< T >::ptr_.
UnaryFunction::result_type mln::topo::complex< D >::apply_if_dim_matches_ | ( | unsigned | n, | |
const UnaryFunction & | f | |||
) | const [inline, private] |
Apply a functor f to this list of n-faces.
References mln::topo::complex< D >::data_.
Referenced by mln::topo::complex< D >::nfaces_of_dim().
void mln::topo::complex< D >::connect_ | ( | const algebraic_n_face< N, D > & | f1, | |
const n_face< N+1, D > & | f2 | |||
) | [inline, private] |
Connect two algebraic faces.
f1 | An algebraic face of dimension N | |
f2 | A face of dimension N + 1 |
N
must be lower or equal to D
. References mln::topo::n_face< N, D >::data(), mln::topo::make_algebraic_n_face(), and mln::topo::algebraic_n_face< N, D >::sign().
Referenced by mln::topo::complex< D >::add_face().
face_data< N, D > & mln::topo::complex< D >::face_data_ | ( | unsigned | face_id | ) | [inline, private] |
References mln::topo::complex< D >::data_.
const face_data< N, D > & mln::topo::complex< D >::face_data_ | ( | unsigned | face_id | ) | const [inline, private] |
References mln::topo::complex< D >::data_.
T mln::topo::complex< D >::fold_left_ | ( | const BinaryFunction & | f, | |
const T & | accu | |||
) | const [inline, private] |
Functional meta-manipulators.
Apply a kind of static fold left operator to the implicit list of n_faces_set using a functor f and a value accu.
Argument is called an "accumulator", but with a slightly different meaning than mln:accu members.
We might want to use TypeLists or something similar, is they provide an explicit static fold left operator.
References mln::topo::complex< D >::data_.
Referenced by mln::topo::complex< D >::nfaces().
unsigned mln::topo::complex< D >::nfaces | ( | ) | const [inline] |
Static manipulators.
These methods use statically-known input.
Return the total number of faces, whatever their dimension.
References mln::topo::complex< D >::fold_left_().
unsigned mln::topo::complex< D >::nfaces_of_dim | ( | unsigned | n | ) | const [inline] |
Dynamic manipulators.
These methods use input know as run time.
Return the number of n-faces.
Warning, this function has a complexity linear in term of N, since each n_faces_set is checked (the present implementation does not provide a direct access to n_faces_set through a dynamic value of the dimension).
References mln::topo::complex< D >::apply_if_dim_matches_().
unsigned mln::topo::complex< D >::nfaces_of_static_dim | ( | ) | const [inline] |
Return the number of N-faces
.
References mln::topo::complex< D >::data_.
void mln::topo::complex< D >::print | ( | std::ostream & | ostr | ) | const [inline] |
void mln::topo::complex< D >::print_faces | ( | std::ostream & | ostr | ) | const [inline] |
Print the faces of dimension N
.
References mln::topo::complex< D >::data_.
friend class face [friend] |
friend class n_face [friend] |
Accessors.
bool operator== | ( | const complex< D_ > & | lhs, | |
const complex< D_ > & | rhs | |||
) | [friend] |
util::tracked_ptr< internal::complex_data<D> > mln::topo::complex< D >::data_ [private] |
The actual data of the complex.
Referenced by mln::topo::complex< D >::add_face(), mln::topo::complex< D >::addr(), mln::topo::complex< D >::apply_if_dim_matches_(), mln::topo::complex< D >::face_data_(), mln::topo::complex< D >::fold_left_(), mln::topo::complex< D >::nfaces_of_static_dim(), mln::topo::operator==(), mln::topo::complex< D >::print(), and mln::topo::complex< D >::print_faces().