首页 \ 问答 \ C ++中最大的特征值(和相应的特征向量)(Largest eigenvalues (and corresponding eigenvectors) in C++)

C ++中最大的特征值(和相应的特征向量)(Largest eigenvalues (and corresponding eigenvectors) in C++)

当然,用C ++计算大密集矩阵的k个最大特征值和特征向量,最简单,最快速的方法(当然还有一些库)是什么? 我正在寻找相当于MATLAB的eigs函数; 我查看了Armadillo和Eigen,但找不到一个,计算所有特征值在我的情况下永远(我需要前10个特征向量用于大约30000x30000密集的非对称实矩阵)。

绝望之下,我甚至尝试用犰狳的QR分解来实现自己的功率迭代,但遇到了复杂的特征值对而放弃了。 :)


What is the easiest and fastest way (with some library, of course) to compute k largest eigenvalues and eigenvectors for a large dense matrix in C++? I'm looking for an equivalent of MATLAB's eigs function; I've looked through Armadillo and Eigen but couldn't find one, and computing all eigenvalues takes forever in my case (I need top 10 eigenvectors for an approx. 30000x30000 dense non-symmetric real matrix).

Desperate, I've even tried to implement power iterations by myself with Armadillo's QR decomposition but ran into complex pairs of eigenvalues and gave up. :)


原文:https://stackoverflow.com/questions/24468537
更新时间:2022-07-01 12:07

最满意答案

首先你需要让你的js代码处于文档准备就绪状态,

有一个事件会在您完成时间后执行,您可以使用该事件来提交表单。 看看文本为finish.countdown的行

尝试下面的代码。

$(document).ready(function(){
    function get15dayFromNow() {   

       return new Date(new Date().valueOf() + <?php echo $duration ; ?> * 60 * 1000);

           }

       var $time_spend = $('#time_spend');
          $time_spend.countdown(get15dayFromNow(), function(event) {
            $(this).val(event.strftime('%M:%S'));
          });

       var $clock = $('#clock');
        $clock.countdown(get15dayFromNow(), function(event) {
            $(this).html('Time Left :   '+'00:'+event.strftime('%M:%S'));
        })
        .on('finish.countdown', function() {
            submitForm();
        });

    function submitForm()
    {
        document.getElementById("target").submit();

    }
});

详细了解文档


First of all you need to keep you js code in document ready function,

There is an event which will execute on completion of your time, you can use that event to submit the form. Look at the line having text as finish.countdown

Try following code.

$(document).ready(function(){
    function get15dayFromNow() {   

       return new Date(new Date().valueOf() + <?php echo $duration ; ?> * 60 * 1000);

           }

       var $time_spend = $('#time_spend');
          $time_spend.countdown(get15dayFromNow(), function(event) {
            $(this).val(event.strftime('%M:%S'));
          });

       var $clock = $('#clock');
        $clock.countdown(get15dayFromNow(), function(event) {
            $(this).html('Time Left :   '+'00:'+event.strftime('%M:%S'));
        })
        .on('finish.countdown', function() {
            submitForm();
        });

    function submitForm()
    {
        document.getElementById("target").submit();

    }
});

Read more on Document

相关问答

更多
  • 这应该是jQuery的诀窍,但你需要在upload.php中直接将值写入数据库,而不是在两者之间自动提交表单... function batchUpload(){ $.ajax({ type: "GET", url: "upload.php?id=123&name=abc" }); $.ajax({ type: "GET", url: "upload.php?id=456&name=efg" }); $.a ...
  • 存储提交者IP您可以使用: memcache密钥,在最短时间后到期 临时文件“flag” 使用验证码让机器人的生活更加艰难 In the end, I used a simple MySQLi table. The MySQLi table contained three columns, 'ID' (the User's Login ID), TimesUploaded (Times uploaded within a specified, default 15, amount of minutes), ...
  • 尝试这个。 在处理表单时,将一个名为“waiting”的类添加到主体中,然后: 浏览器对游标属性的支持并不完美,但其大部分缺陷都与为游标使用自定义图像有关,而不是基于您所使用的操作系统映射到默认图标的默认关键字(如“等待”)。使用(XP和更低版本的沙漏,Windows 7中的旋转圈,在旧的Mac OS中旋转沙滩球等)。 看到: http://reference.sitepoint.com ...
  • 你可以Enter javascript代码并禁用Enter Key事件......
    javascript代码: