Ejemplo n.º 1
0
 eigenelements_worker_base ( matrix_view <T,Opt> the_matrix) : mat(the_matrix) { 
  if (mat.is_empty())   TRIQS_RUNTIME_ERROR<<"eigenelements_worker : the matrix is empty : matrix =  "<<mat<<"  ";
  if (!mat.is_square())   TRIQS_RUNTIME_ERROR<<"eigenelements_worker : the matrix "<<mat<<" is not square ";
  if (!mat.indexmap().is_contiguous())   TRIQS_RUNTIME_ERROR<<"eigenelements_worker : the matrix "<<mat<<" is not contiguous in memory";
  dim = mat.dim0();
  ev.resize(dim);
  lwork = 64*dim;
  work.resize(lwork);
  uplo='U';compz='N' ;
  has_run = false;
 }
Ejemplo n.º 2
0
void show(matrix_view &view) {

    for(int r=0; r < view._rows; r++) {
        for(int c=0; c < view._cols; c++) {
            cout << view.get(c, r) << " ";
        }
        cout << endl;
    }

}
Ejemplo n.º 3
0
void rotate_view(matrix_view &view) {

    matrix_view::iterator first = view.begin();
    matrix_view::iterator n_first = view.begin();
    n_first++;
    matrix_view::iterator next = view.begin();
    next++;
    matrix_view::iterator last = view.end();

    while (first != next) {
        swap_iter(first++, next++);
        if (next == last) {
            next = n_first;
        } else if (first == n_first) {
            n_first = next;
        }
    }
    return;

}
Ejemplo n.º 4
0
 /// Swap
 friend void swap(matrix_view& A, matrix_view& B) { A.swap_me(B); }
Ejemplo n.º 5
0
 /// Copy construction
 matrix_view(matrix_view const& X) : IMPL_TYPE(X.indexmap(), X.storage()) {}
Ejemplo n.º 6
0
 /// Copy construction
 matrix_view( matrix_view const & X): impl_type(X.indexmap(),X.storage()) {}