R Under development (unstable) (2022-07-06 r82552) -- "Unsuffered Consequences" Copyright (C) 2022 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > pkgname <- "pfocal" > source(file.path(R.home("share"), "R", "examples-header.R")) > options(warn = 1) > library('pfocal') > > base::assign(".oldSearch", base::search(), pos = 'CheckExEnv') > base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv') > cleanEx() > nameEx("kernel-binomial") > ### * kernel-binomial > > flush(stderr()); flush(stdout()) > > ### Name: binomial_kernel > ### Title: Compute an Binomial kernel > ### Aliases: binomial_kernel kernel-binomial > > ### ** Examples > > > binomial_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 1 4 6 4 1 [2,] 4 16 24 16 4 [3,] 6 24 36 24 6 [4,] 4 16 24 16 4 [5,] 1 4 6 4 1 > > > > > cleanEx() > nameEx("kernel-circular") > ### * kernel-circular > > flush(stderr()); flush(stdout()) > > ### Name: smooth_uniform_circle_kernel > ### Title: Compute an Circular kernel > ### Aliases: smooth_uniform_circle_kernel kernel-circular > ### hard_uniform_circle_kernel > > ### ** Examples > > > smooth_uniform_circle_kernel(r = 3) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.000000000 0.007942803 0.3117253 0.4860527 0.3117253 0.007942803 [2,] 0.007942803 0.693194567 1.0000000 1.0000000 1.0000000 0.693194567 [3,] 0.311725319 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000 [4,] 0.486052659 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000 [5,] 0.311725319 1.000000000 1.0000000 1.0000000 1.0000000 1.000000000 [6,] 0.007942803 0.693194567 1.0000000 1.0000000 1.0000000 0.693194567 [7,] 0.000000000 0.007942803 0.3117253 0.4860527 0.3117253 0.007942803 [,7] [1,] 0.000000000 [2,] 0.007942803 [3,] 0.311725319 [4,] 0.486052659 [5,] 0.311725319 [6,] 0.007942803 [7,] 0.000000000 > hard_uniform_circle_kernel(r = 3) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0 0 0 1 0 0 0 [2,] 0 1 1 1 1 1 0 [3,] 0 1 1 1 1 1 0 [4,] 1 1 1 1 1 1 1 [5,] 0 1 1 1 1 1 0 [6,] 0 1 1 1 1 1 0 [7,] 0 0 0 1 0 0 0 > > > > > cleanEx() > nameEx("kernel-distance") > ### * kernel-distance > > flush(stderr()); flush(stdout()) > > ### Name: euclidean_distance_kernel > ### Title: Compute an Distance kernel > ### Aliases: euclidean_distance_kernel kernel-distance > ### manhattan_distance_kernel minkowski_distance_kernel > ### chebyshev_distance_kernel vertical_distance_kernel > ### horizontal_distance_kernel distance_kernel > > ### ** Examples > > > distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 2.828427 2.236068 2 2.236068 2.828427 [2,] 2.236068 1.414214 1 1.414214 2.236068 [3,] 2.000000 1.000000 0 1.000000 2.000000 [4,] 2.236068 1.414214 1 1.414214 2.236068 [5,] 2.828427 2.236068 2 2.236068 2.828427 > euclidean_distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 2.828427 2.236068 2 2.236068 2.828427 [2,] 2.236068 1.414214 1 1.414214 2.236068 [3,] 2.000000 1.000000 0 1.000000 2.000000 [4,] 2.236068 1.414214 1 1.414214 2.236068 [5,] 2.828427 2.236068 2 2.236068 2.828427 > manhattan_distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 4 3 2 3 4 [2,] 3 2 1 2 3 [3,] 2 1 0 1 2 [4,] 3 2 1 2 3 [5,] 4 3 2 3 4 > minkowski_distance_kernel(vertical_radius = 2, horizontal_radius = 2, p = 1) [,1] [,2] [,3] [,4] [,5] [1,] 4 3 2 3 4 [2,] 3 2 1 2 3 [3,] 2 1 0 1 2 [4,] 3 2 1 2 3 [5,] 4 3 2 3 4 > chebyshev_distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 2 2 2 2 2 [2,] 2 1 1 1 2 [3,] 2 1 0 1 2 [4,] 2 1 1 1 2 [5,] 2 2 2 2 2 > vertical_distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 2 2 2 2 2 [2,] 1 1 1 1 1 [3,] 0 0 0 0 0 [4,] 1 1 1 1 1 [5,] 2 2 2 2 2 > horizontal_distance_kernel(vertical_radius = 2, horizontal_radius = 2) [,1] [,2] [,3] [,4] [,5] [1,] 2 1 0 1 2 [2,] 2 1 0 1 2 [3,] 2 1 0 1 2 [4,] 2 1 0 1 2 [5,] 2 1 0 1 2 > > > > > cleanEx() > nameEx("kernel-exponential") > ### * kernel-exponential > > flush(stderr()); flush(stdout()) > > ### Name: exponential_kernel > ### Title: Compute an Exponential kernel > ### Aliases: exponential_kernel kernel-exponential > > ### ** Examples > > > exponential_kernel(beta = 2, r0 = 0.7) [,1] [,2] [,3] [1,] 0.0000000 0.1353353 0.0000000 [2,] 0.1353353 1.0000000 0.1353353 [3,] 0.0000000 0.1353353 0.0000000 > > > > > cleanEx() > nameEx("kernel-gaussian") > ### * kernel-gaussian > > flush(stderr()); flush(stdout()) > > ### Name: gaussian_kernel_confidence > ### Title: Compute a Gaussian kernel > ### Aliases: gaussian_kernel_confidence kernel-gaussian > ### gaussian_kernel_radius > > ### ** Examples > > > gaussian_kernel_confidence(vertical_r0 = 0.4, vertical_sd = 1, + horizontal_r0 = 0.5, horizontal_sd = 2) [,1] [,2] [,3] [,4] [,5] [1,] 0.01514034 0.01166897 0.01318859 0.01166897 0.01514034 [2,] 0.05478271 0.04222215 0.04772063 0.04222215 0.05478271 [3,] 0.08678126 0.06688409 0.07559422 0.06688409 0.08678126 [4,] 0.05478271 0.04222215 0.04772063 0.04222215 0.05478271 [5,] 0.01514034 0.01166897 0.01318859 0.01166897 0.01514034 > gaussian_kernel_confidence(vertical_r0 = 0.4, vertical_sd = 1, + horizontal_r0 = 0.5, horizontal_sd = 2) [,1] [,2] [,3] [,4] [,5] [1,] 0.01514034 0.01166897 0.01318859 0.01166897 0.01514034 [2,] 0.05478271 0.04222215 0.04772063 0.04222215 0.05478271 [3,] 0.08678126 0.06688409 0.07559422 0.06688409 0.08678126 [4,] 0.05478271 0.04222215 0.04772063 0.04222215 0.05478271 [5,] 0.01514034 0.01166897 0.01318859 0.01166897 0.01514034 > > > > > cleanEx() > nameEx("kernel_flip") > ### * kernel_flip > > flush(stderr()); flush(stdout()) > > ### Name: kernel_flip_horizontal > ### Title: Flip a kernel > ### Aliases: kernel_flip_horizontal kernel_flip_vertical kernel_flip_both > > ### ** Examples > > > kernel <- matrix(c( + 1, 2, 3, + 0, 1, 0, + 2, 3, 4 + ), nrow = 3, ncol = 3) > kernel_flip_horizontal(kernel) [,1] [,2] [,3] [1,] 2 0 1 [2,] 3 1 2 [3,] 4 0 3 > kernel_flip_vertical(kernel) [,1] [,2] [,3] [1,] 3 0 4 [2,] 2 1 3 [3,] 1 0 2 > kernel_flip_both(kernel) [,1] [,2] [,3] [1,] 4 0 3 [2,] 3 1 2 [3,] 2 0 1 > > > > cleanEx() > nameEx("normalize_kernel") > ### * normalize_kernel > > flush(stderr()); flush(stdout()) > > ### Name: normalize_kernel > ### Title: Normalize a kernel > ### Aliases: normalize_kernel > > ### ** Examples > > > kernel <- distance_kernel(vertical_radius = 2, horizontal_radius = 2) > kernel_norm <- normalize_kernel(kernel) > sum(kernel_norm) [1] 1 > > > > > cleanEx() > nameEx("pfocal-info") > ### * pfocal-info > > flush(stderr()); flush(stdout()) > > ### Name: pfocal_info_transform > ### Title: Retrieve kernel and arguments information > ### Aliases: pfocal_info_transform pfocal_info_reduce > ### pfocal_info_nan_policy pfocal_info_mean_divisor pfocal_info_variance > > ### ** Examples > > > # Retrieve info on different arguments > > pfocal_info_transform() [,1] [,2] [1,] "MULTIPLY" "0" [2,] "ADD" "1" [3,] "R_EXP" "2" [4,] "L_EXP" "3" [,3] [1,] "For data value 'd' and kernal value 'k', intermediate_value = (d * k)" [2,] "For data value 'd' and kernal value 'k', intermediate_value = (d + k)" [3,] "For data value 'd' and kernal value 'k', intermediate_value = (d ^ k)" [4,] "For data value 'd' and kernal value 'k', intermediate_value = (k ^ d)" > pfocal_info_reduce() [,1] [,2] [1,] "SUM" "0" [2,] "ABS_SUM" "1" [3,] "PRODUCT" "2" [4,] "ABS_PRODUCT" "3" [5,] "MIN" "4" [6,] "MAX" "5" [,3] [1,] "Accumulator starts at 0. For each intermediate value, in no particular order, acc = ( acc + iv )" [2,] "Accumulator starts at 0. For each intermediate value, in no particular order, acc = ( acc + abs(iv) )" [3,] "Accumulator starts at 1. For each intermediate value, in no particular order, acc = ( acc * iv )" [4,] "Accumulator starts at 1. For each intermediate value, in no particular order, acc = ( acc * abs(iv) )" [5,] "Accumulator starts at the highest possible value. For each intermediate value, in no particular order, acc = min( acc , iv )" [6,] "Accumulator starts at the lowest possible value. For each intermediate value, in no particular order, acc = max( acc , iv )" > pfocal_info_nan_policy() [,1] [,2] [1,] "NA" "0" [2,] "FALSE" "1" [3,] "TRUE" "2" [,3] [1,] "Fastest. Assume that there will be no NAN values. Will not crash if it is given a NAN, but makes no guarantee other than that." [2,] "Will propagate NANs aggressively." [3,] "Will discard NAN values early." > pfocal_info_mean_divisor() [,1] [,2] [1,] "ONE" "0" [2,] "KERNEL_SIZE" "1" [3,] "KERNEL_COUNT" "2" [4,] "KERNEL_SUM" "3" [5,] "KERNEL_ABS_SUM" "4" [6,] "KERNEL_PROD" "5" [7,] "KERNEL_ABS_PROD" "6" [8,] "DYNAMIC_COUNT" "7" [9,] "DYNAMIC_SUM" "8" [10,] "DYNAMIC_ABS_SUM" "9" [11,] "DYNAMIC_PROD" "10" [12,] "DYNAMIC_ABS_PROD" "11" [13,] "DYNAMIC_DATA_SUM" "12" [14,] "DYNAMIC_DATA_ABS_SUM" "13" [15,] "DYNAMIC_DATA_PROD" "14" [16,] "DYNAMIC_DATA_ABS_PROD" "15" [,3] [1,] "Does not divide the final value by anything" [2,] "Divide the final value at each point by nrow(k)*ncol(k)" [3,] "Divide the final value at each point by sum(+!is.na(k))" [4,] "Divide the final value at each point by sum(k[!is.na(k)])" [5,] "Divide the final value at each point by sum(abs(k[!is.na(k)]))" [6,] "Divide the final value at each point by prod(k[!is.na(k)])" [7,] "Divide the final value at each point by prod(abs(k[!is.na(k)]))" [8,] "Divide the final value at each point by sum(!is.na( intermediate_data )), recalculated at every point" [9,] "Divide the final value at each point by sum(intermediate_data[!is.na( intermediate_data )]), recalculated at every point" [10,] "Divide the final value at each point by sum(abs(intermediate_data[!is.na( intermediate_data )])), recalculated at every point" [11,] "Divide the final value at each point by prod(intermediate_data[!is.na( intermediate_data )]), recalculated at every point" [12,] "Divide the final value at each point by prod(abs(intermediate_data[!is.na( intermediate_data )])), recalculated at every point" [13,] "Divide the final value at each point by sum(local_data[!is.na( intermediate_data )]), recalculated at every point" [14,] "Divide the final value at each point by sum(abs(local_data[!is.na( intermediate_data )])), recalculated at every point" [15,] "Divide the final value at each point by prod(local_data[!is.na( intermediate_data )]), recalculated at every point" [16,] "Divide the final value at each point by prod(abs(local_data[!is.na( intermediate_data )])), recalculated at every point" > pfocal_info_variance() [,1] [,2] [1,] "FALSE" "0" [2,] "TRUE" "1" [,3] [1,] "Returns the value at each point" [2,] "Returns something like the variance of the intermediate values at each point.First calculate the value as normal. Then find the 'mean' by dividing the value by the mean_divisor. Then for each intermidiate value, calculate the square of the difference and 'reduce' them using the reduce_function. (ie: sum them if SUM, multiply them if PROD, take their max if MAX etc.)" > > > > > cleanEx() > nameEx("pfocal") > ### * pfocal > > flush(stderr()); flush(stdout()) > > ### Name: pfocal > ### Title: Fast, parallel implementation of grid data convolution > ### Aliases: pfocal > > ### ** Examples > > > data <- matrix(nrow = 10, ncol = 10, data = runif(10 * 10)) > kernel <- matrix(1 / 9, nrow = 3, ncol = 3) > pfocal(data = data, kernel = kernel) OMP: Warning #96: Cannot form a team with 24 threads, using 2 instead. OMP: Hint Consider unsetting KMP_DEVICE_THREAD_LIMIT (KMP_ALL_THREADS), KMP_TEAMS_THREAD_LIMIT, and OMP_THREAD_LIMIT (if any are set). p_focal.h:438:63: runtime error: addition of unsigned offset to 0x61c0000a8980 overflowed to 0x61c0000a8900 #0 0x7ff42f46d201 in .omp_outlined._debug__.169 /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal.h:438:63 #1 0x7ff42f46d201 in .omp_outlined..170 /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal.h:410:9 #2 0x7ff42f2150e2 in __kmp_invoke_microtask (/usr/local/clang/lib64/libomp.so+0xb80e2) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #3 0x7ff42f19e0e7 in __kmp_invoke_task_func (/usr/local/clang/lib64/libomp.so+0x410e7) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #4 0x7ff42f198777 in __kmp_fork_call (/usr/local/clang/lib64/libomp.so+0x3b777) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #5 0x7ff42f1892c3 in __kmpc_fork_call (/usr/local/clang/lib64/libomp.so+0x2c2c3) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #6 0x7ff42fceac90 in void p_focal::p_conv<(p_focal::TRANSFORM)0, (p_focal::REDUCE)0, (p_focal::NAN_POLICY)0, (p_focal::MEAN_DIVISOR)0, false, 64ul>(p_focal::expanded_aligned_data<64ul> const&, p_focal::expanded_aligned_data<64ul> const&, double*, bool) /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal.h:410:37 #7 0x7ff42fce96d4 in void p_focal::p_conv<(p_focal::TRANSFORM)0, 64ul>(p_focal::expanded_aligned_data<64ul> const&, p_focal::expanded_aligned_data<64ul> const&, double*, bool, p_focal::REDUCE, p_focal::NAN_POLICY, p_focal::MEAN_DIVISOR, bool) /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal_narrow.h:107:17 #8 0x7ff42fce6195 in void p_focal::p_conv<64ul>(p_focal::expanded_aligned_data<64ul> const&, p_focal::expanded_aligned_data<64ul> const&, double*, bool, p_focal::TRANSFORM, p_focal::REDUCE, p_focal::NAN_POLICY, p_focal::MEAN_DIVISOR, bool) /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal_narrow.h:134:17 #9 0x7ff42f46a81c in p_focal_cpp(Rcpp::Matrix<14, Rcpp::PreserveStorage> const&, Rcpp::Matrix<14, Rcpp::PreserveStorage> const&, double, unsigned long, unsigned long, unsigned long, unsigned long, bool, bool) /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/p_focal.cpp:157:9 #10 0x7ff42f447e05 in _pfocal_p_focal_cpp /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/RcppExports.cpp:88:34 #11 0x6e584b in R_doDotCall /data/gannet/ripley/R/svn/R-devel/src/main/dotcode.c:632:17 #12 0x84869e in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7682:21 #13 0x82994e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #14 0x891e43 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #15 0x88daef in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #16 0x84e7df in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7094:12 #17 0x82994e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #18 0x891e43 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #19 0x88daef in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #20 0x84e7df in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7094:12 #21 0x82994e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #22 0x891e43 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #23 0x88daef in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #24 0x84e7df in bcEval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:7094:12 #25 0x82994e in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:748:8 #26 0x891e43 in R_execClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c #27 0x88daef in Rf_applyClosure /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:1844:16 #28 0x82a388 in Rf_eval /data/gannet/ripley/R/svn/R-devel/src/main/eval.c:871:12 #29 0x95a176 in Rf_ReplIteration /data/gannet/ripley/R/svn/R-devel/src/main/main.c:264:2 #30 0x95d6d0 in R_ReplConsole /data/gannet/ripley/R/svn/R-devel/src/main/main.c:316:11 #31 0x95d4d9 in run_Rmainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1194:5 #32 0x95d812 in Rf_mainloop /data/gannet/ripley/R/svn/R-devel/src/main/main.c:1201:5 #33 0x4f30ba in main /data/gannet/ripley/R/svn/R-devel/src/main/Rmain.c:29:5 #34 0x7ff43f9e6b74 in __libc_start_main (/lib64/libc.so.6+0x27b74) (BuildId: 08df60634339b221bb854d4e10b7278cafde70c4) #35 0x43231d in _start (/data/gannet/ripley/R/R-clang-SAN/bin/exec/R+0x43231d) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior p_focal.h:438:63 in p_focal.h:457:46: runtime error: addition of unsigned offset to 0x61c0000a8b80 overflowed to 0x61c0000a8b78 #0 0x7ff42f46d0e3 in .omp_outlined._debug__.169 /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal.h:457:46 #1 0x7ff42f46d0e3 in .omp_outlined..170 /data/gannet/ripley/R/packages/tests-clang-SAN/pfocal/src/./p_focal.h:410:9 #2 0x7ff42f2150e2 in __kmp_invoke_microtask (/usr/local/clang/lib64/libomp.so+0xb80e2) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #3 0x7ff42f19e0e7 in __kmp_invoke_task_func (/usr/local/clang/lib64/libomp.so+0x410e7) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #4 0x7ff42f19d06c in __kmp_launch_thread (/usr/local/clang/lib64/libomp.so+0x4006c) (BuildId: 8eba3d0f3145b19407156ac55f322da7c26ffb38) #5 0x7ff42f1f4f7c in __kmp_launch_worker(void*) z_Linux_util.cpp #6 0x7ff43fbb22a4 in start_thread (/lib64/libpthread.so.0+0x92a4) (BuildId: cb444f3a31c4b82cc75ec67d583c102882a2f03b) #7 0x7ff43fabf322 in clone (/lib64/libc.so.6+0x100322) (BuildId: 08df60634339b221bb854d4e10b7278cafde70c4) SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior p_focal.h:457:46 in [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1133515 0.2407791 0.2901139 0.4107222 0.4320535 0.4459239 0.4137580 [2,] 0.2533378 0.4531735 0.4936959 0.6249609 0.6225614 0.6326012 0.5519631 [3,] 0.3445409 0.4544711 0.3907088 0.4724139 0.5340509 0.5124663 0.4610074 [4,] 0.3915235 0.5075734 0.4880611 0.4908078 0.4584883 0.4512881 0.3725238 [5,] 0.4066582 0.4932015 0.4569547 0.4814511 0.4410125 0.3920374 0.3731721 [6,] 0.4477673 0.5218479 0.5491071 0.4776902 0.4576560 0.3573618 0.4563043 [7,] 0.5234541 0.6103310 0.5066407 0.4047178 0.4216600 0.4141291 0.5093080 [8,] 0.4804608 0.6210684 0.5534359 0.4582487 0.4839645 0.4509877 0.5397404 [9,] 0.3890094 0.5659458 0.5538604 0.5264036 0.5258527 0.5795138 0.6045863 [10,] 0.2053756 0.3398245 0.3891673 0.4188967 0.4032073 0.3837165 0.4184825 [,8] [,9] [,10] [1,] 0.3924630 0.2915835 0.1606376 [2,] 0.5264345 0.4459130 0.2764467 [3,] 0.4492026 0.5039169 0.3350392 [4,] 0.4535082 0.5485239 0.4199895 [5,] 0.4698598 0.6044388 0.4152916 [6,] 0.5879136 0.6594764 0.4113776 [7,] 0.5205450 0.5383000 0.2997970 [8,] 0.4932282 0.5317978 0.3060589 [9,] 0.4849213 0.4960334 0.2595969 [10,] 0.3429222 0.3936150 0.2005107 > > > > > cleanEx() > nameEx("pfocal_fast") > ### * pfocal_fast > > flush(stderr()); flush(stdout()) > > ### Name: pfocal_fast_gaussian_radius > ### Title: Fast methods for common kernel computations > ### Aliases: pfocal_fast_gaussian_radius pfocal_fast_gaussian_confidence > ### pfocal_fast_binomial pfocal_fast_abs_rectangle pfocal_fast_separated > > ### ** Examples > > > data <- matrix(nrow = 10, ncol = 10, data = runif(10 * 10)) > > pfocal_fast_gaussian_radius(data, vertical_radius = 2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1761671 0.2384826 0.2798972 0.3214750 0.3512543 0.3436049 0.3187190 [2,] 0.2358946 0.3219348 0.3678865 0.4148297 0.4392547 0.4188557 0.3967757 [3,] 0.3101638 0.3950363 0.4217675 0.4673402 0.4855222 0.4461848 0.4271392 [4,] 0.3765567 0.4630894 0.4691680 0.5026321 0.5030844 0.4610246 0.4685880 [5,] 0.4137207 0.4915279 0.4603277 0.4732627 0.4715104 0.4368558 0.4605838 [6,] 0.4445937 0.5343046 0.5036031 0.4992690 0.4726644 0.4263558 0.4542408 [7,] 0.4368414 0.5284357 0.4887155 0.4767806 0.4635636 0.4458916 0.4925716 [8,] 0.3825747 0.4868649 0.4679933 0.4530120 0.4377084 0.4259316 0.4648448 [9,] 0.3256415 0.4207768 0.4099565 0.3983867 0.3969082 0.3929885 0.4174788 [10,] 0.2341151 0.3170920 0.3160466 0.3064603 0.3103033 0.3195655 0.3429761 [,8] [,9] [,10] [1,] 0.2961226 0.2591085 0.1777135 [2,] 0.3874166 0.3588101 0.2589602 [3,] 0.4376913 0.4235058 0.3243211 [4,] 0.5044069 0.4981678 0.3855237 [5,] 0.5069275 0.5006129 0.3911200 [6,] 0.5059392 0.5026983 0.4025093 [7,] 0.5312860 0.4947084 0.3820924 [8,] 0.4872948 0.4377636 0.3293087 [9,] 0.4202821 0.3604961 0.2694635 [10,] 0.3379826 0.2823815 0.2064688 > pfocal_fast_gaussian_confidence(data) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.1583288 0.2532181 0.3475755 0.4125017 0.4460092 0.4439499 0.4167104 [2,] 0.2607416 0.3642809 0.4418636 0.5201992 0.5730302 0.5587633 0.5153950 [3,] 0.3543839 0.4429602 0.4568208 0.5013537 0.5403303 0.5075804 0.4656057 [4,] 0.3910518 0.4669396 0.4433962 0.4643405 0.4720671 0.4234243 0.4148641 [5,] 0.3997093 0.4834959 0.4684270 0.4912174 0.4607063 0.3894152 0.4230559 [6,] 0.4515437 0.5258816 0.4912795 0.4996757 0.4525708 0.3889652 0.4543679 [7,] 0.4960642 0.5664342 0.4895033 0.4561630 0.4266197 0.4192569 0.4937763 [8,] 0.4686703 0.5758673 0.5195109 0.4719717 0.4676484 0.4842499 0.5174655 [9,] 0.3668034 0.5075969 0.5220357 0.5088883 0.5151038 0.5124386 0.5142978 [10,] 0.2188324 0.3391882 0.3763850 0.3861448 0.4010735 0.4048642 0.4219931 [,8] [,9] [,10] [1,] 0.3711057 0.2920062 0.1701562 [2,] 0.4855557 0.4173501 0.2669254 [3,] 0.4635371 0.4555772 0.3528995 [4,] 0.4521926 0.4909350 0.4237474 [5,] 0.5032795 0.5382630 0.4509229 [6,] 0.5494496 0.5456115 0.4226947 [7,] 0.5509485 0.5033638 0.3660278 [8,] 0.5126374 0.4430851 0.3282870 [9,] 0.4905361 0.4155593 0.3184285 [10,] 0.4039435 0.3263777 0.2427669 > pfocal_fast_binomial(data, vertical_radius = 2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 39.55127 64.61037 88.25563 105.70477 114.1321 113.6454 106.7694 [2,] 66.77206 94.73200 114.61500 134.58630 147.4753 143.9798 133.0341 [3,] 89.97896 113.41099 117.66856 128.67014 138.4358 131.2908 120.2818 [4,] 99.15992 119.88727 115.88746 119.41451 120.5786 109.4467 105.3793 [5,] 102.24273 124.05247 122.08519 124.80782 116.5495 100.2113 106.4609 [6,] 114.46389 134.63106 127.61965 125.67128 113.7810 100.2516 115.8924 [7,] 126.36088 146.01366 128.29623 116.08822 108.9047 108.2952 125.9421 [8,] 120.34262 148.59532 135.57247 121.62830 120.0654 125.1475 133.3273 [9,] 94.08160 130.59350 134.59611 130.22383 131.0695 132.6755 133.3278 [10,] 55.89795 86.33561 97.11893 99.47144 101.9480 104.0516 107.1402 [,8] [,9] [,10] [1,] 95.37273 74.47753 43.06574 [2,] 124.59647 106.70007 68.41494 [3,] 120.00557 118.08711 90.23963 [4,] 116.34731 127.26000 107.80103 [5,] 128.74018 139.55292 114.82847 [6,] 141.35530 142.16738 107.62562 [7,] 140.74663 129.98259 92.74184 [8,] 132.55473 116.14477 83.93370 [9,] 126.13326 108.25982 80.19024 [10,] 101.74348 84.32064 60.81586 > pfocal_fast_abs_rectangle(data, height = 2) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 0.2655087 0.4714832 1.140680 1.416785 1.303026 1.298566 1.390496 1.251949 [2,] 0.6376326 1.0201639 1.529379 2.228494 2.549652 2.806836 2.545308 2.384993 [3,] 0.9449773 1.8085569 1.727396 1.956923 2.523100 2.729300 2.051976 1.938793 [4,] 1.4810612 2.5521877 1.848355 1.456988 2.015728 2.018863 1.474355 1.471919 [5,] 1.1098897 2.2638349 1.546721 1.406367 2.096347 1.398232 1.298741 1.793391 [6,] 1.1000716 2.3676123 1.920875 2.149175 2.814916 1.489221 1.079032 2.277437 [7,] 1.8430650 3.0583827 1.614822 1.862211 2.275394 1.228425 1.152300 2.493100 [8,] 1.6054731 3.3149977 2.105303 1.297962 1.402745 1.335467 2.079762 2.499185 [9,] 1.2899118 2.6618531 2.624020 2.083733 2.041198 2.390183 2.031197 2.017868 [10,] 0.6909003 1.8483807 2.367520 2.345025 2.560031 2.493881 2.028404 2.697507 [,9] [,10] [1,] 0.7737324 0.6742889 [2,] 2.3256875 1.4457380 [3,] 2.2986329 1.8137317 [4,] 1.4058049 2.2439040 [5,] 1.8925655 2.7376232 [6,] 2.3283290 2.5360029 [7,] 2.6703513 2.1663968 [8,] 2.0871422 1.6981717 [9,] 1.5344907 1.5881348 [10,] 2.1267316 1.8045964 > > pfocal_fast_separated(data, + kernel_list = list(binomial_kernel(vertical_radius = 2, + horizontal_radius = 2), + distance_kernel(vertical_radius = 2, + horizontal_radius = 2))) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [1,] 1464.521 2046.483 2818.375 3120.041 3235.775 3287.740 3195.485 2832.833 [2,] 1959.888 2685.454 3689.735 3984.294 4051.186 4118.759 4066.950 3686.464 [3,] 2634.001 3624.924 4974.070 5336.835 5423.097 5538.684 5488.064 5006.201 [4,] 2976.300 4010.794 5443.665 5682.800 5695.161 5850.867 5855.157 5410.815 [5,] 3194.753 4167.846 5569.023 5650.069 5568.737 5721.049 5762.404 5400.337 [6,] 3310.862 4251.381 5648.831 5700.496 5584.736 5687.814 5696.362 5365.204 [7,] 3314.529 4270.897 5702.740 5850.022 5771.477 5820.414 5754.201 5392.371 [8,] 3089.686 3972.292 5322.012 5555.981 5539.478 5570.394 5474.192 5109.255 [9,] 2370.677 2986.572 3987.360 4176.047 4154.235 4146.821 4062.544 3783.742 [10,] 1816.720 2310.593 3063.760 3263.603 3266.504 3227.176 3123.825 2879.285 [,9] [,10] [1,] 2075.615 1547.098 [2,] 2706.248 2072.370 [3,] 3693.192 2832.212 [4,] 4031.479 3146.384 [5,] 4074.587 3227.911 [6,] 4091.898 3247.960 [7,] 4139.070 3245.880 [8,] 3927.158 3018.786 [9,] 2885.480 2186.909 [10,] 2168.494 1605.639 > > > > > ### *