Skip to content

Commit

Permalink
rename project to zmat
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed May 1, 2019
1 parent af81887 commit 9300e18
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
20 changes: 10 additions & 10 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
#################################################################
# Makefile for Monte Carlo eXtreme (MCX)
# Makefile for ZMAT
# Qianqian Fang <q.fang at neu.edu>
# 2009/04/02
# 2019/04/30
#################################################################

BACKEND ?=

ROOTDIR ?= ..
MZIPDIR ?= $(ROOTDIR)
MCXSRC :=$(MZIPDIR)/src
ZMATDIR ?= $(ROOTDIR)
MCXSRC :=$(ZMATDIR)/src

MKDIR := mkdir

MEX=mex
AR=$(CC)

BINARY=mzip
OUTPUT_DIR=$(MZIPDIR)
BINARY=zmat
OUTPUT_DIR=$(ZMATDIR)

DOXY := doxygen
DOCDIR := $(MZIPDIR)/doc
DOXYCFG=mzip.cfg
DOCDIR := $(ZMATDIR)/doc
DOXYCFG=zmat.cfg

INCLUDEDIRS=

Expand All @@ -38,7 +38,7 @@ OUTPUTFLAG:=-o
OBJSUFFIX=.o
EXESUFFIX=

FILES=mzip
FILES=zmat

ifeq ($(findstring CYGWIN,$(PLATFORM)), CYGWIN)
CC=nvcc
Expand Down Expand Up @@ -76,7 +76,7 @@ endif

mex: CXX=$(MEX)
mex: AR=$(MEX)
mex: LINKOPT+= -cxx CLIBS='$$CLIBS -lz' CXXLIBS='$$CXXLIBS -lz' -outdir $(MZIPDIR)
mex: LINKOPT+= -cxx CLIBS='$$CLIBS -lz' CXXLIBS='$$CXXLIBS -lz' -outdir $(ZMATDIR)
mex: OUTPUT_DIR=..

all: mex
Expand Down
2 changes: 0 additions & 2 deletions src/compilemzip.m

This file was deleted.

2 changes: 2 additions & 0 deletions src/compilezmat.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mex zmat.cpp -outdir ../ CXXLIBS='$CXXLIBS -lz'

22 changes: 11 additions & 11 deletions src/mzip.cpp → src/zmat.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************//**
** \mainpage MZIP: a data compression function for MATLAB/octave
** \mainpage ZMAT: a data compression function for MATLAB/octave
**
** \author Qianqian Fang <q.fang at neu.edu>
** \copyright Qianqian Fang, 2019
Expand All @@ -10,9 +10,9 @@


/***************************************************************************//**
\file mzip.cpp
\file zmat.cpp
@brief mex function for MZIP
@brief mex function for ZMAT
*******************************************************************************/

#include <stdio.h>
Expand All @@ -31,10 +31,10 @@

enum TZipMethod {zmZlib, zmGzip};

void mzip_usage();
int mzip_keylookup(char *origkey, const char *table[]);
void zmat_usage();
int zmat_keylookup(char *origkey, const char *table[]);

/** @brief Mex function for the mzip - an interface to compress/decompress binary data
/** @brief Mex function for the zmat - an interface to compress/decompress binary data
* This is the master function to interface for zipping and unzipping a char/int8 buffer
*/

Expand All @@ -47,7 +47,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){
* If no input is given for this function, it prints help information and return.
*/
if (nrhs==0){
mzip_usage();
zmat_usage();
return;
}

Expand All @@ -59,7 +59,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){
int len=mxGetNumberOfElements(prhs[1]);
if(!mxIsChar(prhs[1]) || len==0)
mexErrMsgTxt("the 'method' field must be a non-empty string");
if((zipid=(TZipMethod)mzip_keylookup((char *)mxGetChars(plhs[1]), zipmethods))<0)
if((zipid=(TZipMethod)zmat_keylookup((char *)mxGetChars(plhs[1]), zipmethods))<0)
mexErrMsgTxt("the specified compression method is not supported");
}

Expand Down Expand Up @@ -140,8 +140,8 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){
* @brief Print a brief help information if nothing is provided
*/

void mzip_usage(){
printf("Usage:\n output=mzip(input,1,'zlib');\n\nPlease run 'help mzip' for more details.\n");
void zmat_usage(){
printf("Usage:\n output=zmat(input,1,'zlib');\n\nPlease run 'help zmat' for more details.\n");
}

/**
Expand All @@ -152,7 +152,7 @@ void mzip_usage(){
* @return if found, return the index of the string in the dictionary, otherwise -1.
*/

int mzip_keylookup(char *origkey, const char *table[]){
int zmat_keylookup(char *origkey, const char *table[]){
int i=0;
char *key=(char *)malloc(strlen(origkey)+1);
memcpy(key,origkey,strlen(origkey)+1);
Expand Down

0 comments on commit 9300e18

Please sign in to comment.