www.pudn.com > huffman.rar > Ulti.h
#include "Global.h" #include#ifndef ULTI_H #define ULTI_H extern void swap(Type* a,Type* b); extern void swapArrData(Type* arr,int pos1,int pos2); /*arr show and output*/ extern void outputListArrFloat(Type* arr,long startPos,long len,FILE* outputFile); extern void outputListArrInt(Type* arr,long startPos,long len,FILE* outputFile); extern void outputListArrInt2(int* arr,int startPos,int len,char* outputFileName); extern void outputListArrFloat2(Type* arr,int startPos,int len,char* outputFileName); extern void outputListArrIntToMatlab(int* arr,int startPos,int len,char* outputFileName); extern void outputListArrFloatToMatlab(Type* arr,int startPos,int len,char* outputFileName); extern void output2DArrInt(Type** arr,int row,int col,FILE* outputFile); extern void output2DArrFloat(Type** arr,int row,int col,FILE* outputFile); extern void show2DArrInt(Type** arr,int row,int col); extern void show2DArrFloat(Type** arr,int row,int col); extern void showArrListFloat(Type* arr,int startPos,int len); extern void showArrListInt(Type* arr,int startPos,int len); /*arr sum*/ extern Type sumArr(Type* inArr,int len); /*arr each element do by operation*/ extern void arrEachBy(Type* firstArr,Type* secondArr,Type** ansArr,int len); /*arr operation*/ extern void reverseArr(Type** arr,int len); /***Enhancded functions***/ /*mem apply and free*/ extern void twoDArrMemApply(Type*** inArr,int rowNum,int colNum); extern void listArrMemApply(Type** inArr,int len); extern void twoDArrMemFree(Type*** inArr,int rowNum); /*end of mem apply and free*/ extern void readListFloat(Type** listArr,int* len,char* listFileName); extern void read2DArrFloat(Type*** twoDArr,int* rowNum,int* colNum,char* inputFileName); /*list ulti operation*/ extern Type maxValInList(Type* inList,int len); extern Type maxAbsValInList(Type* inList,int len); extern int listNotZero(Type* inList,int len); /*matrix ulti operation*/ extern void matrixCopy(Type** sourceMatrix,Type** targetMatrix,int rowNum,int colNum); extern void listArrCopy(Type* sourceListArr,Type* targetListArr,int len); extern void listArrCopy2(Type* sourceListArr,Type* targetListArr,long sourceStartPos,long targetStartPos,long len); extern Type sumSomeRow(Type** inMatrix,int rowIndex,int colStart,int colEnd); extern Type sumSomeRowPower(Type** inMatrix,int rowIndex,int colStart,int colEnd,int powNum); extern Type sumTwoRowBy(Type** inMatrix,int rowIndex1,int rowIndex2,int colStart,int colEnd); extern Type sumArr_JKByList_K(Type** inMatrix,Type* inList,int rowIndex,int colStart,int colEnd); extern Type sumArr_KJByList_K(Type** inMatrix,Type* inList,int colIndex,int rowStart,int rowEnd); extern Type sumArr1_IKByArr2_JK(Type** inMatrix1,Type** inMatrix2,int rowIndex1,int rowIndex2,int colStart,int colEnd);//K vary from colStart to colEnd. /*random list data fill in*/ extern void radnomDataFillToList(Type* listArr,long length); extern Type eRandom(int upLimit); /*ulti file operation*/ extern FILE* createFile(char mode,char* fileName); #endif