#include "haarOct.h" DEFUN_DLD(fhaar, args, , "Y = fhaar(X,l)\ \n\nY is the Haar transform of X at depth l\n") { int ret = 0; Matrix M; if(CheckArgs(args) == 0) { M = args(0).matrix_value(); int l = args(1).int_value(); double * X = new double[M.rows()*M.cols()]; ado2c(M,X); if(M.rows() == 1) { ret = haar(X,M.cols(),l); M = adc2o(X,1,M.cols()); } else if(M.cols() == 1) { ret = haar(X,M.rows(),l); M = adc2o(X,M.rows(),1); } else { ret = haar2(X,M.rows(),M.cols(),l); M = adc2o(X,M.rows(),M.cols()); } if(ret == -1) { error("depth is too large for size of matrix"); } delete X; } else { ret = -1; } if(ret == 0) { return octave_value(M); } else { return octave_value_list(); } }