如何用javascript消除(how to eliminate with javascript)
实际上,我的问题并没有完全解决......事情是,我在mvc中制作了一棵树,并且为了展开和折叠树,我添加了这个可以在下面看到的Java脚本代码。 起初我给每个人增加了一个'句柄'类
节点,然后我将添加展开它的崩溃。但在应用此代码后,我的树不能正确显示... 在图像中你可以看到'fff'和'ggg'必须处于同一个水平,因为他们都是'eee'的子女。 'ccc'似乎是'bbb'的孩子,但它也必须与'bbb'处于同一水平。因为'bbb'和'ccc'都是'aaa'的孩子....
我不知道为什么Java脚本代码不起作用。
$(document).ready(function(){jQuery(“#tree ul”)。hide();
jQuery("#tree li").prepend("<span class='handle'></span>"); jQuery("#tree li:has(ul)") .children(":first-child").addClass("collapsed") .click(function () { jQuery(this).toggleClass("collapsed expanded") .siblings("ul").toggle(); }); }); $(function () { $("ul#tree li").each(function () { as = $(this).children('a'); if (!as.length) { // $(this).hide(); } }) });
Actually,my problem is not solved completely...The thing is that i made a tree in mvc and for having expanded and collapsed tree ,i added this java script code which you can see below. at first i add a 'handle' class to each
node and then i will add collapse expanded on it.But after applying this codes my tree is not displayed properly... in the image u can see that 'fff' and 'ggg' must be in a same level because they are both children of 'eee' . 'ccc' seems to be the child of 'bbb' but it also must be in the same level as 'bbb'.Because both 'bbb' and 'ccc' are children of 'aaa'....
i dont know why java script code does not work.
$(document).ready(function () { jQuery("#tree ul").hide();
jQuery("#tree li").prepend("<span class='handle'></span>"); jQuery("#tree li:has(ul)") .children(":first-child").addClass("collapsed") .click(function () { jQuery(this).toggleClass("collapsed expanded") .siblings("ul").toggle(); }); }); $(function () { $("ul#tree li").each(function () { as = $(this).children('a'); if (!as.length) { // $(this).hide(); } }) });
原文:https://stackoverflow.com/questions/43925343
最满意答案
我通过在编译function.cpp时静态链接MKL来解决这个问题(我之前是动态链接的)。
我发现这个链接也很有帮助: https : //software.intel.com/en-us/articles/intel-mkl-custom-static-linkage
当我做动态链接时,我不清楚为什么会有这么奇怪的结果。 我能想到的是,也许一些MKL的依赖关系是从R自动加载的OpenBLAS或LAPACKE库中提取的。 我真的不知道。
I solved this problem by statically linking the MKL when compiling function.cpp (I was dynamically linking before).
I found this link also helpful: https://software.intel.com/en-us/articles/intel-mkl-custom-static-linkage
It is not clear to me why I had such strange results when I was doing the dynamic linkage. All I can think is that perhaps some of the MKL's dependencies were being pulled from OpenBLAS or LAPACKE libraries that R automatically loads. I really do not know.
相关问答
更多-
为什么浮动和双打之间存在差异? 现代CPU使用向量指令来执行浮点算术。 这些指令具有固定的吞吐量和长度,例如Intel Xeon E7530的每个核心都能够处理每个周期两个128位的加法或乘法。 这导致每个循环4个双倍或8个浮点数。 为什么我不能使用整数? ublas示例中的模板将float和double模板的矩阵乘法映射到MKL SGEMM和DGEMM函数。 当您将矩阵模板从float / double更改为int时BOOST使用矩阵乘法的参考实现,因为MKL不提供对整数矩阵乘法的支持。 Why the ...
-
我同意@ tim18你应该使用链接顾问。 但是要使用gfortran从英特尔编译测试奇异值分解程序,可以进行以下工作: gfortran -I${MKLROOT}/include -fopenmp -o dgesvd dgesvd.f \ -L${MKLROOT}/lib/ -lmkl_core -lmkl_gnu_thread -lmkl_gf_lp64 I agree with @tim18 that you should use the link advisor. However ...
-
该文档告诉您在提供的compilervars.sh脚本上使用“source”命令来使所有资源可用。 例如: 来源//bin/compilervars.sh 这会将MKL添加到include和library路径,以便编译器和链接器可以找到它们。 如果您需要更多帮助,请访问https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x您可以获得MKL特定的帮助https://software.intel. ...
-
在Unix / Linux系统上, sudo命令( S uper U ser DO )设置为使用为root用户定义的环境变量,而不是运行该命令的用户。 如果您在非标准位置安装程序,则需要以超级用户权限运行它,这可能会导致问题。 例如,在OS X系统(运行在BSD Unix上), /usr/local/bin默认不包含在PATH环境变量中。 您可以设置用户的帐户以在PATH包含此目录,但是如果您尝试将sudo与其中的程序一起使用,则无法找到它,除非您修改root的环境(或系统的环境)以包含/usr/local ...
-
您可以在[matlabroot]\bin\ARCH\mkl.dll (例如C:\ Program Files \ MATLAB \ R2013b \ bin \ win64 \ mkl.dll)找到该库,但这只是运行时库。 我认为你无能为力。 要使用英特尔MKL实际开发,您将需要标题,库等, 这些只能通过购买产品获得 。 似乎MATLAB通过extern\lib\[arch]\[compiler]的导入库libmwblas.lib和libmwlapack.lib提供了有关如何使用MEX文件中的LAPACK和 ...
-
您可以使用带有自定义分配器的std::vector ,就像这里提到的那样,以确保16字节对齐。 然后,您可以将第一个元素的地址作为MKL函数的输入指针。 重要的是你有16字节对齐,因为MKL广泛使用SIMD来提高性能。 You could use a std::vector with a custom allocator like the ones mentioned here to ensure 16 byte alignment. Then you can just take address of th ...
-
我通过在编译function.cpp时静态链接MKL来解决这个问题(我之前是动态链接的)。 我发现这个链接也很有帮助: https : //software.intel.com/en-us/articles/intel-mkl-custom-static-linkage 当我做动态链接时,我不清楚为什么会有这么奇怪的结果。 我能想到的是,也许一些MKL的依赖关系是从R自动加载的OpenBLAS或LAPACKE库中提取的。 我真的不知道。 I solved this problem by statically ...
-
为什么炒作英特尔MKL Numpy比我的PC上的ATLAS构建速度慢?(Why is hyped Intel MKL Numpy build slower than ATLAS build on my PC?)[2022-01-06]
英特尔®MKL主要针对服务器和高性能台式机和移动处理器而设计和优化。 Celeron D是一款性能相对较低的处理器,因此MKL从未针对它进行过优化。 例如,如果您检查最近的英特尔酷睿i7桌面上的SVD性能,启用MKL的NumPy可以比启用ATLAS的NumPy快80%。 请看: http : //software.intel.com/en-us/articles/numpy-scipy-with-mkl/ 顺便说一下,为了更快地响应MKL相关问题,请加入英特尔MKL论坛: http : //software ... -
两者都是正确的...你从numpy获得的v的行是M.dot(MT)的特征向量(转置将是复杂情况下的共轭转置)。 特征向量在一般情况下仅定义为乘法常数,因此您可以将v的任何行乘以不同的数字,并且它仍然是特征向量矩阵。 对v的附加约束是它是一个酉矩阵 ,它松散地转换为正交的行。 这会将每个特征向量的可用选择减少到仅2:指向任一方向的归一化特征向量。 但你仍然可以将任意行乘以-1并仍然有一个有效的v 。 如果你想测试它的矩阵,我已经加载为: >>> u, d, v = np.linalg.svd(a) >>> D ...
-
svd可以接受nu和nv参数,指定要发出的U和V的大小。 这些默认为min(# of rows, # of cols) ,默认情况下在R中表示SVD是“瘦”或经济模式SVD,而Matlab默认为完整SVD,除非您要求瘦版。 以下是如何获得完整的V : S = svd(M, nu=3, nv=4) 。 更一般地, nu=nrow(M)和nv=ncol(M) nu=nrow(M) nv=ncol(M) 。 完整示例: > M = matrix(c(2,3,4,5,1,2,3,4,0,1,2,3), nrow=3 ...