Skip to content

Commit 2c720fb

Browse files
committed
Merge branch 'master' of github.com:sgbaird-5DOF/interp
2 parents 55e3790 + 82fb777 commit 2c720fb

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

README.md

+23-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Use the <img src=https://user-images.githubusercontent.com/45469701/116359125-a6
1717

1818
## Dependencies
1919
### MATLAB Version
20-
MATLAB R2019b or higher (mainly for the [arguments ... end syntax checking](https://www.mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html) at the beginning of functions, which is used extensively throughout). For users of R2007a - R2019a, I suggest removing the arguments ... end syntax for any functions that use this and replacing it with corresponding [inputParser()](https://www.mathworks.com/help/matlab/ref/inputparser.html) and [varargin](https://www.mathworks.com/help/matlab/ref/varargin.html) code to deal with variable input arguments, default parameter values, and repeating arguments. Alternatively, you could remove the arguments ... end syntax lines for each function and update every place that the function is called so that all input arguments are specified. Open up an issue if you need more details on this. Other functions may need to be replaced if they aren't available in early MATLAB versions.
20+
MATLAB R2019b or higher (mainly for the [arguments ... end syntax checking](https://www.mathworks.com/help/matlab/matlab_prog/function-argument-validation-1.html) at the beginning of functions, which is used extensively throughout).
2121

2222
#### R2007a - R2019a
2323
I suggest removing the arguments ... end syntax for any functions that use this and replacing it with corresponding [inputParser()](https://www.mathworks.com/help/matlab/ref/inputparser.html) and [varargin](https://www.mathworks.com/help/matlab/ref/varargin.html) code to deal with variable input arguments, default parameter values, and repeating arguments. Alternatively, you could remove the arguments ... end syntax lines for each function and update every place that the function is called so that all input arguments are specified. Open up an issue if you need more details on this. Other functions may need to be replaced if they aren't available in early MATLAB versions.
@@ -61,29 +61,47 @@ If you only want to (manually) compute distances in the VFZ sense, first you nee
6161
```matlab
6262
npts = 100;
6363
o = get_ocubo(npts); %generate some random data
64-
o = get_octpairs(o); %symmetrize (using default reference GBO)
64+
o = get_octpairs(o); %symmetrize (using default reference GBO), vecnorm(o(1,:)) == ~sqrt(2)
65+
o = normr(o); % normalize
6566
```
6667
At this point, you can get the VFZ pairwise distance matrix via:
6768
```matlab
6869
pd = pdist(o);
6970
mat = squareform(pd);
7071
```
72+
The units will be the same as is given by eq.(1) from DOI: [10.1016/j.commatsci.2021.110756](https://dx.doi.org/10.1016/j.commatsci.2021.110756).
73+
74+
<img src=https://user-images.githubusercontent.com/45469701/152618082-91d597fb-6646-4156-89d2-98540eddadaa.png width=200>
75+
76+
To convert to the traditional GBO distance, multiply $d_E$ by a factor of `2`.
77+
78+
7179
Alternatively, `pdist2()` may be of interest if you want pairwise distances between two sets of points, or `vecnorm()` if you want to calculate distances between two lists of GBOs:
7280
```matlab
7381
npts2 = 100;
82+
o1 = get_ocubo(npts1);
83+
o1 = get_octpairs(o1);
84+
o1 = normr(o1);
85+
7486
o2 = get_ocubo(npts2);
7587
o2 = get_octpairs(o2);
88+
o2 = normr(o2)
89+
7690
d = vecnorm(o1-o2,2,2); %o1 and o2 need to be the same size
7791
```
7892
If you want the "true" minimum distances (i.e. essentially the same implementation as [GB_octonion_code](https://github.com/ichesser/GB_octonion_code), but vectorized and parallelized), you may use `GBdist4.m` directly with two sets of GBOs.
7993
```matlab
80-
d = GBdist4(o1,o2);
94+
d = GBdist4(o1,o2,dtype="norm");
95+
```
96+
It depends on the application, but if you want to compute large pairwise distance matrices that are nearly identical to the traditional GBO distances, I recommend using the ensembled VFZ distance via `ensembleGBdist.m` with `K >= 10`.
97+
```matlab
98+
d = ensembleGBdist(o,o2,dtype="omega")
8199
```
82-
It depends on the application, but if you want to compute large pairwise distance matrices that are nearly identical to the traditional GBO distances, I recommend using the ensembled VFZ distance via `ensembleGBdist.m` with `K >= 10`. This will be much faster than using `GBdist4.m`. For reference, this corresponds to (from the main paper when `K==10`):
100+
This will be much faster than using `GBdist4.m`. For reference, this corresponds to (from the main paper when `K==10`):
83101
<img src=https://user-images.githubusercontent.com/45469701/116044929-bcbad780-a62e-11eb-8c59-58a4354badbb.png width=300>
84102
This is distinct from `ensembleVFZO.m`, which takes the average interpolated property from `K` different VFZs.
85103

86-
Drop me a note in "Issues" if you have something you'd like to do or something you'd like to clarify, but can't figure out among the (many) options and functions in the `interp` repo. With a few details, there's a good chance I can offer some suggestions that will save a lot of time.
104+
[Open an issue](https://github.com/sgbaird-5DOF/interp/issues/new/choose) if you have something you'd like to do or something you'd like to clarify, but can't figure out among the (many) options and functions in the `interp` repo. With a few details, there's a good chance I can offer some suggestions that will save a lot of time.
87105

88106
## Plots
89107
Most plots in the paper are produced in the script: [plotting.m](code/plotting.m). First, you need to create a dummy folder:

0 commit comments

Comments
 (0)