Menu

power iteration problem in ViennaCL-1.7.1

Lev
2017-08-16
2017-08-26
  • Lev

    Lev - 2017-08-16

    Does anyone understand why does the very simple example below fail ?

    #define VIENNACL_WITH_UBLAS
    #include "viennacl/compressed_matrix.hpp"
    #include "viennacl/linalg/power_iter.hpp"
    using namespace boost::numeric;
    
    int main(){
            double lambda;
            ublas::compressed_matrix<double> M(10, 10), P(10,10);
            viennacl::compressed_matrix<double> C(10, 10);
            viennacl::linalg::power_iter_tag ptag(1e-6);
            M(2,2) = M(2,4) = 1; viennacl::copy(M,C);
            lambda = viennacl::linalg::eig(C, ptag);
            P = M / 2; viennacl::copy(P,C);
            std::cout << C;
            return 0;
    }
    
    /* Output of the example :
    
    ../ViennaCL-1.7.1/viennacl/backend/util.hpp:151: viennacl::backend::typesafe_host_array<T, special>::cpu_type viennacl::backend::typesafe_host_array<T, special>::operator[](viennacl::vcl_size_t) const [with T = unsigned int; bool special = false; viennacl::backend::typesafe_host_array<T, special>::cpu_type = unsigned int; viennacl::vcl_size_t = long unsigned int]: Assertion `index < size() && bool("index out of bounds")' failed.
    Aborted
    
    */
    
     

Log in to post a comment.