File generator_rational.c
FileList > gen-rational > src > generator_rational.c
Go to the source code of this file
A module for generating rational tangles. More...
#include "generator_rational.h"#include "stdbool.h"#include "stdint.h"#include "stdio.h"#include "stdlib.h"
Public Static Attributes
| Type | Name |
|---|---|
| gen_rational_config_t * | gen_rational_localcfg = NULLThe local configuration of the rational gen module. |
Public Functions
| Type | Name |
|---|---|
| uint8_t | gen_rational_config (gen_rational_config_t * config_arg) The public configuration function. |
| STATIC_INLINE_UINT8 | gen_rational_evenperm_shift_write () The canonical form for twist vector is given as odd length. When we get something in the even class of twist vectors we can 'oddify' it by prepending a 0. This function handles prepending the zero and then writing to the cfg store-storage_interface device. |
| uint8_t | gen_rational_generate () The public generation function. When called the module will work against the current config. |
| STATIC_INLINE_UINT8 | gen_rational_proc_template (uint8_t template) A function to process a template describing the ' ', and '+' for a twist vector. A template is a bitfield where 1 is \(+\) and 0 is ' '. Example: 0101 -> [1 1+1 1+1] -> [1 2 2]. |
| STATIC_INLINE_UINT8 | gen_rational_write () A function to write the twist vector in cfg to the store-storage_interface device in cfg. |
Macros
| Type | Name |
|---|---|
| define | GEN_RATIONAL_PERM_FUNS_LEN (2u)Number of combination functions used by the module. |
Detailed Description
Author:
Isabel Darcy
Author:
Zachary Bryhtan
Author:
Joe Starr
Public Static Attributes Documentation
variable gen_rational_localcfg
The local configuration of the rational gen module.
gen_rational_config_t* gen_rational_localcfg;
Public Functions Documentation
function gen_rational_config
The public configuration function.
uint8_t gen_rational_config (
gen_rational_config_t * config_arg
)
Parameters:
config_argThe config to set.
function gen_rational_evenperm_shift_write
The canonical form for twist vector is given as odd length. When we get something in the even class of twist vectors we can 'oddify' it by prepending a 0. This function handles prepending the zero and then writing to the cfg store-storage_interface device.
STATIC_INLINE_UINT8 gen_rational_evenperm_shift_write ()
Parameters:
cfgConfiguration to work on.
Returns:
uint8_t Success/Fail flag.
function gen_rational_generate
The public generation function. When called the module will work against the current config.
uint8_t gen_rational_generate ()
Returns:
uint8_t Generation status info.
function gen_rational_proc_template
A function to process a template describing the ' ', and '+' for a twist vector. A template is a bitfield where 1 is \(+\) and 0 is ' '. Example: 0101 -> [1 1+1 1+1] -> [1 2 2].
STATIC_INLINE_UINT8 gen_rational_proc_template (
uint8_t template
)
Parameters:
templateTemplate to work on.
Returns:
uint8_t Success/Fail flag.
function gen_rational_write
A function to write the twist vector in cfg to the store-storage_interface device in cfg.
STATIC_INLINE_UINT8 gen_rational_write ()
Parameters:
cfgConfiguration to work on.
Returns:
uint8_t Success/Fail flag.
Macro Definition Documentation
define GEN_RATIONAL_PERM_FUNS_LEN
Number of combination functions used by the module.
#define GEN_RATIONAL_PERM_FUNS_LEN `(2u)`
The documentation for this class was generated from the following file source/gen-rational/src/generator_rational.c