binary_helper< rational > Struct Template Reference

#include <rational.hpp>

Inheritance diagram for binary_helper< rational >:
void_binary_helper< rational >

List of all members.

Static Public Member Functions


Detailed Description

template<>
struct mmx::binary_helper< rational >

Definition at line 234 of file rational.hpp.


Member Function Documentation

static generic access ( const rational x,
nat  i 
) [static, inherited]
static rational assemble ( const generic v  )  [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 240 of file rational.hpp.

References mmx::vector_access().

00240                                                      {
00241     return rational (as<integer> (vector_access (v, 0))) /
00242            rational (as<integer> (vector_access (v, 1))); }

static generic disassemble ( const rational x  )  [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 237 of file rational.hpp.

References mmx::denominator(), mmx::gen_vec(), and mmx::numerator().

00237                                                         {
00238     return gen_vec (as<generic> (numerator (x)),
00239                     as<generic> (denominator (x))); }

static generic full_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 236 of file rational.hpp.

00236 { return "Rational"; }

static rational read ( const port in  )  [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 246 of file rational.hpp.

References n.

00246                                                {
00247     integer n= binary_read<integer> (in);
00248     integer d= binary_read<integer> (in);
00249     return rational (n) / rational (d); }

static string short_type_name (  )  [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 235 of file rational.hpp.

00235 { return "Q"; }

static nat size ( const rational x  )  [static, inherited]
static void write ( const port out,
const rational x 
) [inline, static]

Reimplemented from void_binary_helper< rational >.

Definition at line 243 of file rational.hpp.

References mmx::denominator(), and mmx::numerator().

00243                                                                 {
00244     binary_write<integer> (out, numerator (x));
00245     binary_write<integer> (out, denominator (x)); }


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

Generated on 6 Dec 2012 for numerix by  doxygen 1.6.1