Transaction-Level Modeling Framework for Space Applications
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
Classes | |
struct | MDRDataSet |
struct | MDRMultiIndex |
struct | MDRModel |
struct | MDRModelIterator |
struct | MDRVector |
Macros | |
#define | MDR_dataset_get_row(_DATA_, _ROW_) ((_DATA_)->data + (_ROW_) * (_DATA_)->cols) |
#define | MDR_dataset_get(_DATA_, _ROW_, _COL_) (*(MDR_dataset_get_row(_DATA_,_ROW_) + (_COL_))) |
#define | MDR_dataset_get_col_n_levels(_DATA_, _COL_) (*((_DATA_)->n_levels + (_COL_))) |
#define | MDR_dataset_get_row_status(_DATA_, _ROW_) MDR_dataset_get(_DATA_,_ROW_,(_DATA_)->cols - 1) |
#define | MDR_vector_add(_VECTOR_, _ITEM_) MDR_vector_add_array(_VECTOR_,_ITEM_,1) |
#define | MDR_vector_get(_VECTOR_, _INDEX_) ((void*)((char*)(_VECTOR_)->data + ((_INDEX_) * (_VECTOR_)->elemsize))) |
#define | MDR_vector_is_empty(_VECTOR_) ((_VECTOR_)->size == 0) |
#define | MDR_vector_clear(_VECTOR_) MDR_vector_resize(_VECTOR_,0) |
Typedefs | |
typedef unsigned char | MDRDatum |
typedef unsigned int | MDRAttribute |
typedef unsigned short | MDRInstance |
typedef float | MDRRatio |
typedef float | MDRFitness |
Variables | |
char | exampleData [] |
MDRDatum | MDR_UNKNOWN = (MDRDatum)-1 |
const char | MDR_LIBRARY_VERSION [] = "0.3.3" |
#define MDR_dataset_get | ( | _DATA_, | |
_ROW_, | |||
_COL_ | |||
) | (*(MDR_dataset_get_row(_DATA_,_ROW_) + (_COL_))) |
#define MDR_dataset_get_col_n_levels | ( | _DATA_, | |
_COL_ | |||
) | (*((_DATA_)->n_levels + (_COL_))) |
#define MDR_dataset_get_row | ( | _DATA_, | |
_ROW_ | |||
) | ((_DATA_)->data + (_ROW_) * (_DATA_)->cols) |
#define MDR_dataset_get_row_status | ( | _DATA_, | |
_ROW_ | |||
) | MDR_dataset_get(_DATA_,_ROW_,(_DATA_)->cols - 1) |
Referenced by MDR_PRIVATE_model_build_cells_instance().
#define MDR_vector_add | ( | _VECTOR_, | |
_ITEM_ | |||
) | MDR_vector_add_array(_VECTOR_,_ITEM_,1) |
Referenced by MDR_dataset_read().
#define MDR_vector_clear | ( | _VECTOR_ | ) | MDR_vector_resize(_VECTOR_,0) |
Referenced by MDR_dataset_read().
#define MDR_vector_get | ( | _VECTOR_, | |
_INDEX_ | |||
) | ((void*)((char*)(_VECTOR_)->data + ((_INDEX_) * (_VECTOR_)->elemsize))) |
Referenced by MDR_PRIVATE_dataset_finish_row().
#define MDR_vector_is_empty | ( | _VECTOR_ | ) | ((_VECTOR_)->size == 0) |
typedef unsigned int MDRAttribute |
typedef float MDRFitness |
typedef unsigned short MDRInstance |
float balanced_accuracy | ( | MDRInstance * | conf_matrix, |
MDRDatum | n_status | ||
) |
References MDRModel::attr, balanced_accuracy(), d, MDR_dataset_init(), MDR_dataset_read(), MDR_dataset_release(), MDR_model_build_cell_counts(), MDR_model_build_cell_statuses(), MDR_model_compute_confusion_matrix(), MDR_model_construct_attribute(), MDR_model_init(), MDR_model_release(), MDR_model_set_attr(), MDRModel::n_attr, MDRModel::n_status, print_attribute(), print_combo(), print_conf_matrix(), print_model(), and MDRDataSet::rows.
void MDR_dataset_init | ( | MDRDataSet * | d | ) |
References MDRDataSet::cols, MDRDataSet::data, MDRDataSet::n_levels, MDRDataSet::n_status, and MDRDataSet::rows.
Referenced by main().
void MDR_dataset_read | ( | MDRDataSet * | d, |
char * | dataPtr | ||
) |
References MDRDataSet::data, MDRVector::data, i, MDR_dataset_release(), MDR_PRIVATE_dataset_finish_row(), MDR_vector_add, MDR_vector_clear, MDR_vector_detach(), MDR_vector_init(), MDR_vector_release(), MDRDataSet::n_status, and MDRVector::size.
Referenced by main().
void MDR_dataset_release | ( | MDRDataSet * | d | ) |
References MDRDataSet::cols, MDRDataSet::data, MDRDataSet::n_levels, MDRDataSet::n_status, and MDRDataSet::rows.
Referenced by main(), and MDR_dataset_read().
References MDRModel::attr, MDRModel::cell_counts, MDRModel::cell_status, MDRModel::index, MDR_model_release(), MDR_multiindex_assign(), MDRModel::n_attr, and MDRModel::n_status.
void MDR_model_begin | ( | const MDRModel * | m, |
MDRModelIterator * | i | ||
) |
References MDRModelIterator::i, and MDRModelIterator::m.
Referenced by print_model().
void MDR_model_build_cell_counts | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
const MDRInstance * | rows, | ||
MDRInstance | n_rows, | ||
int | exclude, | ||
MDRInstance * | skipped | ||
) |
References MDRModel::cell_counts, i, MDRModel::index, MDR_PRIVATE_model_build_cells_instance(), MDR_PRIVATE_model_init_cells(), MDRModel::n_attr, MDRModel::n_status, MDRDataSet::rows, and MDRMultiIndex::size.
Referenced by main().
void MDR_model_build_cell_statuses | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
const MDRInstance * | skipped, | ||
const MDRDatum * | tiePriority | ||
) |
References MDRModel::cell_counts, MDRModel::cell_status, i, MDR_UNKNOWN, MDRDataSet::n_status, and MDRModel::n_status.
Referenced by main().
void MDR_model_clear_cell_counts | ( | MDRModel * | m | ) |
References MDRModel::cell_counts, MDRModel::cell_status, MDRModel::index, MDR_multiindex_release(), and MDRModel::n_status.
void MDR_model_clear_cell_statuses | ( | MDRModel * | m | ) |
References MDRModel::cell_counts, MDRModel::cell_status, MDRModel::index, and MDR_multiindex_release().
void MDR_model_clear_cells | ( | MDRModel * | m | ) |
References MDRModel::cell_counts, MDRModel::cell_status, MDRModel::index, MDR_multiindex_release(), and MDRModel::n_status.
Referenced by MDR_model_release(), MDR_model_set_attr(), and MDR_PRIVATE_model_init_cells().
void MDR_model_compute_confusion_matrix | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
MDRInstance * | conf_matrix | ||
) |
References MDRModel::cell_counts, MDRModel::cell_status, i, MDR_UNKNOWN, and MDRModel::n_status.
Referenced by main().
void MDR_model_construct_attribute | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
const MDRInstance * | rows, | ||
MDRInstance | n_rows, | ||
int | exclude, | ||
MDRDatum * | attrib | ||
) |
References i, MDR_PRIVATE_model_construct_attribute_instance(), MDRModel::n_attr, and MDRDataSet::rows.
Referenced by main().
MDRInstance * MDR_model_get_cell_counts | ( | const MDRModelIterator * | i | ) |
References MDRModel::cell_counts, MDRModelIterator::i, MDRModelIterator::m, and MDRModel::n_status.
Referenced by print_model().
MDRDatum MDR_model_get_cell_status | ( | const MDRModelIterator * | i | ) |
References MDRModel::cell_status, MDRModelIterator::i, and MDRModelIterator::m.
Referenced by print_model().
void MDR_model_get_key | ( | const MDRModelIterator * | i, |
size_t * | key | ||
) |
References MDRModelIterator::i, MDRModel::index, MDRModelIterator::m, and MDR_multiindex_decode().
Referenced by print_model().
void MDR_model_init | ( | MDRModel * | m | ) |
References MDRModel::attr, MDRModel::cell_counts, MDRModel::cell_status, MDRModel::index, MDR_multiindex_init(), and MDRModel::n_attr.
Referenced by main().
int MDR_model_is_end | ( | const MDRModelIterator * | i | ) |
References MDRModelIterator::i, MDRModel::index, MDRModelIterator::m, and MDRMultiIndex::size.
Referenced by print_model().
void MDR_model_next | ( | MDRModelIterator * | i | ) |
References MDRModelIterator::i.
Referenced by print_model().
void MDR_model_release | ( | MDRModel * | m | ) |
References MDRModel::attr, MDR_model_clear_cells(), MDRModel::n_attr, and MDRModel::n_status.
Referenced by main(), and MDR_model_assign().
void MDR_model_set_attr | ( | MDRModel * | m, |
const MDRAttribute * | attr, | ||
MDRAttribute | n_attr | ||
) |
References MDRModel::attr, MDR_model_clear_cells(), and MDRModel::n_attr.
Referenced by main().
void MDR_multiindex_assign | ( | MDRMultiIndex * | dest, |
MDRMultiIndex * | src | ||
) |
References MDRMultiIndex::dims, MDR_multiindex_release(), and src.
Referenced by MDR_model_assign().
void MDR_multiindex_decode | ( | const MDRMultiIndex * | m, |
size_t | index, | ||
size_t * | indices | ||
) |
References MDRMultiIndex::dims, i, and MDRMultiIndex::n_dims.
Referenced by MDR_model_get_key().
size_t MDR_multiindex_encode | ( | const MDRMultiIndex * | m, |
const size_t * | indices | ||
) |
References MDRMultiIndex::dims, i, and MDRMultiIndex::n_dims.
Referenced by MDR_PRIVATE_model_build_cells_instance(), and MDR_PRIVATE_model_construct_attribute_instance().
void MDR_multiindex_init | ( | MDRMultiIndex * | m, |
const size_t * | dims, | ||
size_t | n_dims | ||
) |
References MDRMultiIndex::dims, i, MDRMultiIndex::n_dims, and MDRMultiIndex::size.
Referenced by MDR_model_init(), and MDR_PRIVATE_model_init_cells().
void MDR_multiindex_release | ( | MDRMultiIndex * | m | ) |
References MDRMultiIndex::dims, MDRMultiIndex::n_dims, and MDRMultiIndex::size.
Referenced by MDR_model_clear_cell_counts(), MDR_model_clear_cell_statuses(), MDR_model_clear_cells(), and MDR_multiindex_assign().
void MDR_PRIVATE_dataset_finish_row | ( | MDRDataSet * | d, |
MDRVector * | data, | ||
MDRVector * | sc | ||
) |
References MDRDataSet::cols, i, MDR_UNKNOWN, MDR_vector_get, MDR_vector_resize(), MDRDataSet::n_levels, MDRDataSet::rows, and MDRVector::size.
Referenced by MDR_dataset_read().
int MDR_PRIVATE_model_build_cells_instance | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
MDRInstance | row, | ||
MDRInstance * | skipped, | ||
size_t * | values | ||
) |
References MDRModel::attr, MDRModel::cell_counts, MDRModel::index, MDR_dataset_get, MDR_dataset_get_row_status, MDR_multiindex_encode(), MDR_UNKNOWN, MDRModel::n_attr, and MDRModel::n_status.
Referenced by MDR_model_build_cell_counts().
int MDR_PRIVATE_model_construct_attribute_instance | ( | MDRModel * | m, |
const MDRDataSet * | d, | ||
MDRInstance | row, | ||
MDRDatum * | attrib, | ||
size_t * | values | ||
) |
References MDRModel::attr, MDRModel::cell_status, MDRModel::index, MDR_dataset_get, MDR_multiindex_encode(), MDR_UNKNOWN, and MDRModel::n_attr.
Referenced by MDR_model_construct_attribute().
void MDR_PRIVATE_model_init_cells | ( | MDRModel * | m, |
const MDRDataSet * | d | ||
) |
References MDRModel::attr, MDRModel::cell_counts, MDRModel::cell_status, MDRDataSet::cols, i, MDRModel::index, MDR_model_clear_cells(), MDR_multiindex_init(), MDR_UNKNOWN, MDRModel::n_attr, MDRDataSet::n_levels, MDRModel::n_status, and MDRMultiIndex::size.
Referenced by MDR_model_build_cell_counts().
References MDRVector::data, MDRVector::elemsize, MDR_vector_ensure_capacity(), and MDRVector::size.
References MDRVector::capacity, MDRVector::data, MDRVector::elemsize, MDR_vector_detach(), MDR_vector_release(), and MDRVector::size.
void * MDR_vector_detach | ( | MDRVector * | v | ) |
References MDRVector::capacity, MDRVector::data, MDRVector::elemsize, and MDRVector::size.
Referenced by MDR_dataset_read(), and MDR_vector_assign().
void MDR_vector_ensure_capacity | ( | MDRVector * | v, |
size_t | capacity | ||
) |
References MDRVector::capacity, MDRVector::data, and MDRVector::elemsize.
Referenced by MDR_vector_add_array(), and MDR_vector_resize().
void MDR_vector_init | ( | MDRVector * | v, |
size_t | elemsize, | ||
size_t | init_cap | ||
) |
References MDRVector::capacity, MDRVector::data, MDRVector::elemsize, and MDRVector::size.
Referenced by MDR_dataset_read().
void MDR_vector_release | ( | MDRVector * | v | ) |
References MDRVector::capacity, MDRVector::data, MDRVector::elemsize, and MDRVector::size.
Referenced by MDR_dataset_read(), and MDR_vector_assign().
void MDR_vector_resize | ( | MDRVector * | v, |
size_t | size | ||
) |
References MDRVector::data, MDRVector::elemsize, MDR_vector_ensure_capacity(), and MDRVector::size.
Referenced by MDR_PRIVATE_dataset_finish_row().
void MDR_vector_trim | ( | MDRVector * | v | ) |
References MDRVector::capacity, MDRVector::data, MDRVector::elemsize, and MDRVector::size.
void print_attribute | ( | FILE * | out, |
const MDRDatum * | attribute, | ||
MDRInstance | n_rows | ||
) |
References i, and MDR_UNKNOWN.
Referenced by main().
void print_combo | ( | FILE * | out, |
const MDRAttribute * | attr, | ||
MDRAttribute | n_attr | ||
) |
void print_conf_matrix | ( | FILE * | out, |
MDRInstance * | conf_matrix, | ||
MDRDatum | n_status | ||
) |
void print_model | ( | FILE * | out, |
MDRModel * | m | ||
) |
References i, MDR_model_begin(), MDR_model_get_cell_counts(), MDR_model_get_cell_status(), MDR_model_get_key(), MDR_model_is_end(), MDR_model_next(), MDR_UNKNOWN, MDRModel::n_attr, and MDRModel::n_status.
Referenced by main().
char exampleData[] |