File comp_rational_data.c
FileList > comp-rational_data > src > comp_rational_data.c
Go to the source code of this file
A module for compute rational tangle data: fraction, algebraic equivlance, and parity. More...
#include "comp_rational_data.h"#include "stdbool.h"#include "stdint.h"#include "stdio.h"#include "stdlib.h"
Public Static Attributes
| Type | Name |
|---|---|
| bool | comp_rational_data_executed = falseThe local computation status of the rational comp module. |
| comp_rational_data_config_t * | comp_rational_data_localcfg = NULLThe local configuration of the rational comp module. |
| comp_rational_data_result_t | comp_rational_data_localrestult = /* multi line expression */The local result of the rational comp module. |
Public Functions
| Type | Name |
|---|---|
| STATIC_INLINE_UINT8 | comp_rational_data_alg_eq (uint16_t p, uint16_t q) A private function that computes the algebraic equivalence classes for the configured tangle. |
| uint8_t | comp_rational_data_compute () A public function, calling this executes the computation on the configured tangle. |
| uint8_t | comp_rational_data_config (comp_rational_data_config_t * config_arg) The public configuration function. |
| STATIC_INLINE_UINT8 | comp_rational_data_parity (uint16_t p, uint16_t q) A private function that computes the parity for the configured tangle. |
| STATIC_INLINE_UINT8 | comp_rational_data_rat_num (uint16_t * p, uint16_t * q) A private function that computes the rational number associated to the configured tangle. |
| const comp_rational_data_result_t * | comp_rational_data_result () A public function, calling this retrieves the results of the last computation. |
| STATIC_INLINE_UINT8 | comp_rational_data_write_alg_eq (uint16_t num_eq, uint16_t den_eq) A private function that commits to store-storage_interface the algebraic equivalence classes associated to the configured tangle. |
| STATIC_INLINE_UINT8 | comp_rational_data_write_parity (char * parity) A private function that commits to store-storage_interface the parity associated to the configured tangle. |
| STATIC_INLINE_UINT8 | comp_rational_data_write_rat_num (uint16_t p, uint16_t q) A private function that commits to store-storage_interface the rational number associated to the configured tangle. |
Detailed Description
Author:
Isabel Darcy
Author:
Joe Starr
Public Static Attributes Documentation
variable comp_rational_data_executed
The local computation status of the rational comp module.
bool comp_rational_data_executed;
variable comp_rational_data_localcfg
The local configuration of the rational comp module.
comp_rational_data_config_t* comp_rational_data_localcfg;
variable comp_rational_data_localrestult
The local result of the rational comp module.
comp_rational_data_result_t comp_rational_data_localrestult;
Public Functions Documentation
function comp_rational_data_alg_eq
A private function that computes the algebraic equivalence classes for the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_alg_eq (
uint16_t p,
uint16_t q
)
Parameters:
pThe numerator for the configured tangle.qThe denominator for the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
function comp_rational_data_compute
A public function, calling this executes the computation on the configured tangle.
uint8_t comp_rational_data_compute ()
Returns:
uint8_t computation status info.
function comp_rational_data_config
The public configuration function.
uint8_t comp_rational_data_config (
comp_rational_data_config_t * config_arg
)
Parameters:
config_argThe config to set.
function comp_rational_data_parity
A private function that computes the parity for the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_parity (
uint16_t p,
uint16_t q
)
Parameters:
pThe numerator for the configured tangle.qThe denominator for the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
function comp_rational_data_rat_num
A private function that computes the rational number associated to the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_rat_num (
uint16_t * p,
uint16_t * q
)
Parameters:
pA pointer to the store-storage_interface location for the numerator of the configured tangle.qA pointer to the store-storage_interface location for the denominator of the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
function comp_rational_data_result
A public function, calling this retrieves the results of the last computation.
const comp_rational_data_result_t * comp_rational_data_result ()
Returns:
comp_rational_data_result_t Computation results.
function comp_rational_data_write_alg_eq
A private function that commits to store-storage_interface the algebraic equivalence classes associated to the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_write_alg_eq (
uint16_t num_eq,
uint16_t den_eq
)
Parameters:
num_eqThe equivlance class for the numerator closure of the configured tangle.den_eqThe equivlance class for the denominator closure of the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
function comp_rational_data_write_parity
A private function that commits to store-storage_interface the parity associated to the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_write_parity (
char * parity
)
Parameters:
parityA string indicating the parity of the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
function comp_rational_data_write_rat_num
A private function that commits to store-storage_interface the rational number associated to the configured tangle.
STATIC_INLINE_UINT8 comp_rational_data_write_rat_num (
uint16_t p,
uint16_t q
)
Parameters:
pThe numerator for the configured tangle.qThe denominator for the configured tangle.
Returns:
uint8_t A condition code for the computation. Indicates failure mode if any.
The documentation for this class was generated from the following file source/comp-rational_data/src/comp_rational_data.c