Copyright 2001--200?, Bin Han, University of Alberta, June 18, 2001 All Rights Reserved The use of this software is permitted for non-commercial, educational, and research use only. The software and/or related materials are provided "as-is" without warranty of any kind including any warranties of performance or merchantability or fitness for a particular use or purpose or for any purpose whatsoever, for the licensed product, however used. In no event shall University of Alberta and/or Bin Han be liable for any damages and/or costs, including but not limited to incidental or consequential damages of any kind, including economic damage or injury to property and lost profits, regardless of whether University of Alberta shall be advised, have reason to know, or in fact shall know of the possibility. User bears all risk relating to quality and performance of the software and/or related materials. Any use other than non-commercial, educational, or research, or any redistribution in original or modified form requires prior written authorization from the copyright holder. Report errors, mistakes, and bugs to Bin Han at bhan@ualberta.ca Send comments/suggestions to Bin Han at bhan@ualberta.ca =============Documentation of the program d2sm.c======================= This program is written in C while calling matlab engine function eig to compute eigenvalues of matrices. The program is based on the method described in the paper: Bin Han, Computing the smoothness exponent of a symmetric multivariate refinable function, preprint, (2001) You can download the above paper at http://www.ualberta.ca/~bhan/publ.htm Though this program is not optimized from point of view of computation, in general, it works fairly efficiently. This program can be easily translated into matlab routine. However, currently the matlab version of this program is NOT provided yet. ====== Instruction for using this C program ===== Purpose: To compute the Sobolev smoothness (and also Holder smoothness when the symbol of the mask is nonnegative) for a two-dimensional refinable function with a finitely supported mask and a dilation matrix. Put your 2D mask in a file using the following input format (lines between -------). -----------input mask as follows:------------ number_of_row number_of_column order_of_sum_rules i j Mask[i][j] . . . -1 ----------end of mask------- where min(i,j) >= 0 and only nonzero coefficients in a mask are needed in the above format. So, the mask is supported on [0, number_of_row-1][0, number_of_column-1] and satisfies the sum rules of order order_of_sum_rules For example, the mask for the Haar refinable function is put into 2 2 1 0 0 1.0 0 1 1.0 1 0 1.0 1 1 1.0 -1 ---Since the mask for the Haar refinable function is supported on [0,1]^2, so number_of_row=2, number_of_column=2, and since its mask satisfies the sum rules of order 1, so order_of_sum_rule=1 You need to specify the following variables. 1. set the dilation matrix by modifying the variable dilation[2][2] 2. set the type of symmetry: FullAxesSym, HexagonalSym, AxesSym, XYSYM, OriginSym. by defining ONLY one of them 3. To compute Holder smoothness, define Holder otherwise undefine Holder to compute the Sobolev smoothness 4. IsIdentityDLT, is the dilation matrix a multiple of the identity matrix? This setting is used to find the invariant space quickly. So its only purpose to increase the efficiency of the program. You may leave this as undefined. !!!!!!!!!!!!!!! Places that you must change in the program !!!!! To find the places where necessary changes are needed, check /*??? ???*/ In fact, all the places you may change is the following: ----------------------------------------------------------- /*??? Change the path for the right location of the file engine.h Also change the paths in the makefile correspondingly!!! ???*/ #include "/usr/local/matlabr12/extern/include/engine.h" /*??? The maximum number of eigvaules to be displayed, don't change it unless your output is too large ???*/ #define MaxNumEig 128 /*??? If the dilation matrix is mI_2, then use this can speed up the program since the invariant space can be easily determined. If you are not sure, then leave it as undefined here ???*/ #undef IsIdentityDLT /*??? when define Holder, compute the Holder smoothness, otherwise, compute the Sobolev smoothness ??? */ #undef Holder /*The symmetry group which must be compatible with the dilation matrix*/ /*??? choose ONLY one to the following symmetry type!!! ??? */ #define HexagonalSym /* 12 elements in the group, 30 degree rotation */ #undef FullAxesSym /* 8 elements in the group, x=0, y=0, y=x, y=-x */ #undef AxesSym /* 4 elements in the group, x=0, y=0 */ #undef XYSym /* 4 elements in the group, y=x, y=-x */ #undef OriginSym /* 2 elements in the group, a(-i,-j)=a(i,j) */ /* If mask is not symmetric, define OriginSym */ /*you need to set this dilation matrix which is isotropic and compatible with the symmetry you choose at the first part */ /*??? YOU NEED TO SET YOUR DILATION MATRIX HERE!!! THIS IS THE LAST PLACE FOR MODIFICATION ???*/ int dilation[2][2]={2,0,0,2}; -------------------------------------------------------------- Explanation of types of symmetry: FullAxesSym: x=0, y=0, y=x, y=-x AxesSym: x=0, y=0 XYSym: y=x, y=-x HexagonalSym: y=x,y=-x, plus 60 degree rotation, total 12 elements OriginSym: a(-i,-j)=a(i,j), symmetric about the origin, when the mask is not symmetric, choose this one. When the mask is not symmetric, you can define OriginSym since the mask after convolution is always symmetric about the origin. Condition assumed (!!!This version of program will not check it!!!): 1. All the eigenvalues fo dilation must have the same modulus. That is, the dilation matrix is isotropic. 2. The symmetry group FullAxesSym or HexagonalSym should compatible with the dilation matrix. I.e., M E M^{-1} \in G, E\in G. Where G is the symmetry group used. 3. The mask (for computeing Holder smoothness) or the convolution of the mask (for computing Sobolev smoothness) must be invariant under the symmetry group. 4. Stability of the refinable function is needed to obtain the exact smoothness exponent. However, the stability in many case can be deduced from the computed result. See the following paper for more details. For more details about the requirement, see the paper: Bin Han, Computing the smoothness exponent of a symmetric multivariate refinable function, preprint, (2001) Dowload the paper at: http://www.ualberta.ca/~bhan/publ.htm Remarks: If the refinable function is not stable, then the computed Sobolev smoothness is a lower bound of the actual Sobolev smoothness exponent of the refinable function. When the refinable function is stable, but the symbol of the mask is not nonnegative and you are using this program to compute the Holder smoothness exponent, then the computed Holder smoothness is an upper bound of the actual Holder smoothness exponent. Name of this program: d2sm.c If you put your mask into a file called cmask, after you compile d2sm.c using the makefile, Then you can use d2sm cmask or use d2sm cmask outputfile to put the output into the file outputfile to obtain the smoothness exponent of its refinable function. The makefile of the program is as follows: =======makefile for the program d2sm.c===== CC = gcc CFLAGS = -Wall -g INCDIR =-I/usr/local/matlabr12/extern/include LIBINC = -L/usr/local/matlabr12/extern/lib/glnx86 d2sm: d2sm.c $(CC) $(INCDIR) -o d2sm d2sm.c $(LIBINC) -leng -lmx -lm =======end of makefile for the program d2sm.c==== NOTICE: !!! You may have to change the paths in the makefile. !!! This program has been tested under Mandrake Linux 8.0 and Matlab version 12. Modified by Bin Han from several other exisiting programs (these existing programs were developed by Bin Han during the period 1997--2001 for special cases) on May 24, 2001. Tested by Bin Han on June 28, 2001 on Linux platform. Detailed documentation was added by Bin Han on June 18, 2001. Posted on Web June 28, 2001 at http://www.ualberta.ca/~bhan/publ.htm Report errors, mistakes, and bugs to Bin Han at bhan@ualberta.ca Send comments/suggestions to Bin Han at bhan@ualberta.ca Example: --------file butterfly, the mask of the butterfly scheme---- 7 7 4 0 1 -6.250000000000000000E-02 0 2 -6.250000000000000000E-02 1 0 -6.250000000000000000E-02 1 2 1.250000000000000000E-01 1 4 -6.250000000000000000E-02 2 0 -6.250000000000000000E-02 2 1 1.250000000000000000E-01 2 2 5.000000000000000000E-01 2 3 5.000000000000000000E-01 2 4 1.250000000000000000E-01 2 5 -6.250000000000000000E-02 3 2 5.000000000000000000E-01 3 3 1.000000000000000000E+00 3 4 5.000000000000000000E-01 4 1 -6.250000000000000000E-02 4 2 1.250000000000000000E-01 4 3 5.000000000000000000E-01 4 4 5.000000000000000000E-01 4 5 1.250000000000000000E-01 4 6 -6.250000000000000000E-02 5 2 -6.250000000000000000E-02 5 4 1.250000000000000000E-01 5 6 -6.250000000000000000E-02 6 4 -6.250000000000000000E-02 6 5 -6.250000000000000000E-02 -1 --------end of file butterfly---- use the setting as we set before in d2sm.c type d2sm butterfly the output is as follows: ------------------------------------------------------ The dilation matrix is=[2 0; 0 2] Computing the Sobolev (L_2) smoothness Support of Mask=[0,6][0,6], SumRule=4 Nonzero elments in the convoluted Mask is: 109 The invariant space before symmetry has 85 points The HexagonalSym symmetric invariant space has 11 points Computing Sobolev (L_2) Smoothness exponent... Computed values | Special values to be deleted! -0.0000000000000005 0.0000000000000000 1.0000000000000002 1.0000000000000000 2.0000000000000147 2.0000000000000000 2.4407654450703173 3.0000000000000000 -------------------------------------------- 2.5692482661862721 3.0000000000000000 3.0000000000000062 4.0000000000000000 3.0000000000000062 4.0000000000000000 3.0592345549296485 5.0000000000000000 3.2839697062913906 5.0000000000000000 The Sobolev (L_2) smoothness exponent = 2.4407654450703173! --------------------------------------------------------------- =============end of documentation of program d2sm.c============ =========Documentation of the program d1sm.c=============== To be added soon =============end of documentation of program d2sm.c============ =========Documentation of the program d3sm.c=============== To be added soon =============end of documentation of program d3sm.c============ ==============A complete makefile========== #Makefile for d1sm.c d2sm.c d3sm.c CC = gcc CFLAGS = -Wall -g # Libraries to link. INCDIR =-I/usr/local/matlabr12/extern/include LIBINC = -L/usr/local/matlabr12/extern/lib/glnx86 # Main program. d1sm: d1sm.c $(CC) $(INCDIR) -o d1sm d1sm.c $(LIBINC) -leng -lmx -lm d2sm: d2sm.c $(CC) $(INCDIR) -o d2sm d2sm.c $(LIBINC) -leng -lmx -lm d3sm.c: d3sm.c $(CC) $(INCDIR) -o d3sm.c d3sm.c.c $(LIBINC) -leng -lmx -lm $(OBJDIR)/%.o : $(SRCDIR)/%.c $(CC) $(DEFINES) $(CFLAGS) -c $< -o $@ # Every .c file depends on these headers. %.c : all.h touch $@ #"make clean" will kill local objects for new compile. clean : rm -f core *.o =============end of makefile========