Program Listing for File mcm_opt.h

Return to documentation for file (rcsw/algorithm/mcm_opt.h)

#pragma once

/*******************************************************************************
 * Includes
 ******************************************************************************/
#include "rcsw/rcsw.h"

/*******************************************************************************
 * Structure Definitions
 ******************************************************************************/
struct mcm_optimizer {
    size_t min_mults;

    const size_t* matrices;
    size_t size;
    size_t *results;
    size_t *route;
    size_t *ordering;
};

BEGIN_C_DECLS

/*******************************************************************************
 * API Functions
 ******************************************************************************/
RCSW_API status_t mcm_opt_init(struct mcm_optimizer * mcm,
                               const size_t * matrices,
                               size_t size);

RCSW_API void mcm_opt_destroy(struct mcm_optimizer * mcm);

RCSW_API status_t mcm_opt_optimize(struct mcm_optimizer * mcm);

RCSW_API status_t mcm_opt_print(const struct mcm_optimizer * mcm);

RCSW_API status_t mcm_opt_report(const struct mcm_optimizer * mcm,
                                 size_t * ordering);

END_C_DECLS