📄 dynamicprogramming.h
字号:
/**
* File : DynamicProgramming.h
* Author : Wind
* Email : zealotwjr@163.com
* Date : 2005-9-29
* Purpose : Dynamic Programming practise
* */
#include "../head/Matrix.h"
#ifndef DYNAMICPROGRAMMING_H_
#define DYNAMICPROGRAMMING_H_
/**
* @describ Calculate the multiply orders of matrixs.
* @param (Matrix matrixs[]) The matrixs to be calculate.
* @param (int miniMultTable[]) The integer array to store the minimun multiply times.
* eg: minimultTalb[i,j] store the minimun multiply times of matrixs
* that start from matrix[i] to matrix[j].
* @param (int bestBrokenTable[]) The integer array to store the best best broken positions.
* eg: bestBrokenTable[i,j] presents the best broken position of the matrixs multiply
* that start from matrix[i] to matrix[j].
* @param (int matrixNum) The length of matrixs[]
* @param (int m) The Chain order start position.
* @param (int n) The Chain order end position.
* @return The minimun multiply times of matrixs that start from matrix[m] to matrix[n].
* */
int matrixChainOrder(Matrix matrixs [],int miniMultTable [] , int bestBrokenTable [],int matrixNum,int m,int n );
/**
* @describ Multiply the matrixs starts from in the best order depending on the best broken table.
* @param (int bestBrokenTable []) Integer array that stores the best broken positions.
* @param (int tableLength) Length of bestBrokenTable [].
* @param (int tbColLength) Coloumn length of bestBrokenTable [].
* @param (int m) Multiply start position.
* @param (int n) Multiply end position.
* @param (char * order) String that to store and presents the multiply orders.
* @return String that that presents the multiply orders.
* */
char * matrixChainMultiply(int bestBrokenTable [],int tableLength,int tbColLength,
int m, int n,char * order);
typedef struct {
double weight;
double value;
} Item;
#endif /*DYNAMICPROGRAMMING_H_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -