Reproducibility
This part of the documentation helps in reproducing the results shown in the article titled A new nested cross approximation, authored by Vaishnavi Gujjula, Sivaram Ambikasaran. The code is available as an open source library and can be found here.
Experiment 1: Matrix-vector product with uniform distribution of particles in 2D and its comparison with the existing NCAs
Figure 2
To obtain NNCA plots of Figure 2 of the article (labeled as ‘Proposed’ in Figure 2), which is about the various numerical benchmarks of NNCA vs \(\epsilon_{ACA}\), the following steps are to be followed
Set the kernel function as \(\left(\frac{r(\log(r)-1)}{a(\log(a)-1)}\right)\chi_{r<a}+\left(\frac{\log(r)}{\log(a)}\right)\chi_{r\geq a}\) in the
getMatrixEntryfunction of theuserkernelclass located in theNNCA2D/kernel.hppfile.Run the file
NNCA2D/testFMM2D.cppusing theNNCA2D/Makefile2D.mk. After successful compilation, an executable by nameNNCA2D/testFMM2Dgets generated. Then input the following at run-time
nLevels= 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW: varied from 3 through 10
yesToUniformDistribution= 1For example, run the following command:
NNCA2D/testFMM2D 6 5 1.0 3 1
To obtain NCA by Zhao plots of Figure 2 of the article (labeled as ‘Zhao’ in Figure 2), which is about the various numerical benchmarks of NCA by Zhao vs \(\epsilon_{ACA}\), the following steps are to be followed
Set the kernel function as \(\left(\frac{r(\log(r)-1)}{a(\log(a)-1)}\right)\chi_{r<a}+\left(\frac{\log(r)}{\log(a)}\right)\chi_{r\geq a}\) in the
getMatrixEntryfunction of theuserkernelclass located in theNCA2DZhao/kernel.hppfile.Run the file
NCA2DZhao/testFMM2D.cppusing theNCA2DZhao/Makefile2D.mk. After successful compilation, an executable by nameNCA2DZhao/testFMM2Dgets generated. Then input the following at run-time
nLevels= 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW: varied from 3 through 10
yesToUniformDistribution= 1For example, run the following command:
NCA2DZhao/testFMM2D 6 5 1.0 3 1
To obtain NCA by Bebendorf plots of Figure 2 of the article (labeled as ‘Bebendorf’ in Figure 2), which is about the various numerical benchmarks of NCA by Bebendorf vs \(\epsilon_{ACA}\), the following steps are to be followed
Set the kernel function as \(\left(\frac{r(\log(r)-1)}{a(\log(a)-1)}\right)\chi_{r<a}+\left(\frac{\log(r)}{\log(a)}\right)\chi_{r\geq a}\) in the
getMatrixEntryfunction of theuserkernelclass located in theNCA2DBebendorf/kernel.hppfile.Run the file
NCA2DBebendorf/testFMM2D.cppusing theNCA2DBebendorf/Makefile2D.mk. After successful compilation, an executable by nameNCA2DBebendorf/testFMM2Dgets generated. Then input the following at run-time
nLevels= 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW: varied from 3 through 10
yesToUniformDistribution= 1For example, run the following command:
NCA2DBebendorf/testFMM2D 6 5 1.0 3 1
Figure 3
To obtain Figure 3 of the article, follow the same steps as that of Figure 2 except for the inputs at run-time. The following inputs are to be given at run-time for NCA by Zhao, NCA by Bebendorf, and NNCA.
nLevels: varied from 2 through 6nParticlesInLeafAlong1D= 5L= 1.0TOL_POW= 9yesToUniformDistribution= 1
Figure 4
To obtain Figure 4, follow the same steps as that of Figure 2 except for the definition of the kernel function. Set the kernel function as \(\left(\frac{r}{a}\right)\chi_{r<a}+\left(\frac{a}{r}\right)\chi_{r\geq a}\) in the getMatrixEntry function of the userkernel class located in the kernel.hpp file.
Figure 5
To obtain Figure 5 of the article, follow the same steps as that of Figure 3 except for the definition of the kernel function. Set the kernel function as \(\left(\frac{r}{a}\right)\chi_{r<a}+\left(\frac{a}{r}\right)\chi_{r\geq a}\) in the getMatrixEntry function of the userkernel class located in the kernel.hpp file.
Experiment 2: Matrix-vector product with Chebyshev distribution of particles in 2D
Figure 6
Line 18 of NNCA2D/testFMM2D.cpp file, which is A->set_Uniform_Nodes();, has to be commented and uncomment Line 19 of NNCA2D/testFMM2D.cpp file, which is A->set_Standard_Cheb_Nodes();. Further follow the below steps
Set the kernel function as \(\left(\frac{r(\log(r)-1)}{a(\log(a)-1)}\right)\chi_{r<a}+\left(\frac{\log(r)}{\log(a)}\right)\chi_{r\geq a}\) in the
getMatrixEntryfunction of theuserkernelclass located in theNNCA2D/kernel.hppfile.Run the file
NNCA2D/testFMM2D.cppusing theNNCA2D/Makefile2D.mk. After successful compilation, an executable by nameNNCA2D/testFMM2Dgets generated. Then input the following at run-time
nLevels= 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW: varied from 3 through 10
yesToUniformDistribution= 0For example, run the following command:
NNCA2D/testFMM2D 6 5 1.0 3 0
Figure 7
To obtain Figure 7 of the article, follow the same steps as that of Figure 6 except for the inputs at run-time. The following inputs are to be given at run-time.
nLevels: varied from 2 through 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW= 9
yesToUniformDistribution= 0For example, run the following command:
NNCA2D/testFMM2D 6 5 1.0 9 0
Experiment 3: Matrix-vector product with a uniform distribution of particles in 3D
Figure 8
To obtain NNCA plots of Figure 8 of the article, which is about the various numerical benchmarks of NNCA in 3D vs \(\epsilon_{ACA}\), the following steps are to be followed
To set the kernel function as \(\left(\frac{r}{a}\right)\chi_{r<a}+\left(\frac{a}{r}\right)\chi_{r\geq a}\), choose
Qchoiceto be 17 at run time.Run the file
NNCA3D/testFMM3D.cppusing theNNCA3D/Makefile3D.mk. After successful compilation, an executable by nameNNCA3D/testFMM3Dgets generated. Then input the following at run-time
nLevels: varied from 2 through 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW= 7
Qchoice= 17
yesToUniformDistribution= 1For example, run the following command:
NNCA3D/testFMM3D 6 5 1.0 7 17 1
Experiment 4: Matrix-vector product with Chebyshev distribution of particles in 3D
Figure 9
Line 21 of NNCA3D/testFMM3D.cpp file, which is A->set_Uniform_Nodes(h);, has to be commented and uncomment Line 22 of NNCA3D/testFMM3D.cpp file, which is A->set_Standard_Cheb_Nodes();. Then follow the below steps
To set the kernel function as \(\left(\frac{r}{a}\right)\chi_{r<a}+\left(\frac{a}{r}\right)\chi_{r\geq a}\), choose
Qchoiceto be 17 at run time.Run the file
NNCA3D/testFMM3D.cppusing theNNCA3D/Makefile3D.mk. After successful compilation, an executable by nameNNCA3D/testFMM3Dgets generated. Then input the following at run-time
nLevels: varied from 2 through 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW= 7
Qchoice= 17
yesToUniformDistribution= 0For example, run the following command:
NNCA3D/testFMM3D 6 5 1.0 7 17 0
Experiment 5: Integral equation solver in 3D
Figure 10
To obtain NNCA plots of Figure 10 of the article, which is about the various numerical benchmarks of NNCA in 3D vs \(\epsilon_{ACA}\), the following steps are to be followed
To set the kernel function as \(\left(\frac{r}{a}\right)\chi_{r<a}+\left(\frac{a}{r}\right)\chi_{r\geq a}\), choose
Qchoiceto be 17 at run time.Run the file
NNCA3D/testFMM3Dsolve.cppusing theNNCA3D/Makefile3Dsolve.mk. After successful compilation, an executable by nameNNCA3D/testFMM3Dsolvegets generated. Then input the following at run-time
nLevels: varied from 2 through 6
nParticlesInLeafAlong1D= 5
L= 1.0
TOL_POW= 7For example, run the following command:
NNCA3D/testFMM3D 6 5 1.0 7
Experiment 6: Kernel SVM in 4D
Table 5 and Figure 11
To obtain the results of Table 5 and Figure 11 of the article, which is about the performance of Fast SVM vs Normal SVM in 2D, the following steps are to be followed
Set the
KERNEL,DIM,MATVECflags in theMakefile.mkfile as belowTo get the results corresponding to the Gaussian kernel and Fast SVM use
USE_Gaussian,USE_DIM2, andUSE_AFMMnDflags in the make fileMakefile.mk.To get the results corresponding to the Gaussian kernel and Normal SVM use
USE_Gaussian,USE_DIM2, andUSE_directMatVecflags in the make fileMakefile.mk.To get the results corresponding to the Matern kernel and Fast SVM use
USE_Matern,USE_DIM2, andUSE_AFMMnDflags in the make fileMakefile.mk.To get the results corresponding to the Matern kernel and Normal SVM use
USE_Matern,USE_DIM2, andUSE_directMatVecflags in the make fileMakefile.mk.
Further run the file
FSVM/.cppusing theFSVM/Makefile3D.mk. After successful compilation, an executable by nameFSVM/testFSVMgets generated. Then inputnumPointsat runtime.numPointsis the number of points in one dimension. In 2D, the number of data points (sum of train and test data points) is square ofnumPointsand in 4D it is quadraple ofnumPoints.To reproduce the results, run the following command:
FSVM/testFSVM 75
This will print various benchmarks. Table 5 of the article is populated using these results. To obtain Figure 5, the following steps are to be followed
Run the
FSVM/matlab/plot_decision2D.mfile. It prompts the user to input the kernel being used. The prompt says “Enter 0 for Matern and 1 for Gaussian “. When this is inputed, the user could see the figures.
Table 6
To obtain the results of Table 6 of the article, which is about the performance of Fast SVM vs Normal SVM in 4D, the following steps are to be followed
Set the
KERNELflag asUSE_Matern,DIMasUSE_DIM2in theMakefile.mk. Set theMATVECflag in theMakefile.mkas below #. To get the results corresponding Fast SVM useUSE_AFMMnD. #. To get the results corresponding to Normal SVM useUSE_directMatVec.Further run the file
FSVM/.cppusing theFSVM/Makefile3D.mk. After successful compilation, an executable by nameFSVM/testFSVMgets generated. Then input the following at run-time
numPoints: 8 through 11For example, run the following command:
FSVM/testFSVM 8