⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ublaskrylovmatrix.cpp

📁 利用C
💻 CPP
字号:
// Copyright (C) 2006 Anders Logg.// Licensed under the GNU LGPL Version 2.1.//// First added:  2006-07-07// Last changed: 2006-07-07#include "uBlasVector.h"#include "uBlasSparseMatrix.h"#include "uBlasKrylovMatrix.h"using namespace dolfin;//-----------------------------------------------------------------------------/*void uBlasKrylovMatrix::disp(const int precision) const{  // Since we don't really have the matrix, we create the matrix by  // performing multiplication with unit vectors. Used only for debugging.    uint M = size(0);  uint N = size(1);  uBlasVector x(N), y(M);  uBlasMatrix<ublas_sparse_matrix> A(M, N);    x = 0.0;  for (unsigned int j = 0; j < N; j++)  {    x(j) = 1.0;    mult(x, y);    for (unsigned int i = 0; i < M; i++)    {      const real value = y(i);      if ( fabs(value) > DOLFIN_EPS )        A(i, j) = value;    }    x(j) = 0.0;  }  A.disp(precision);}//-----------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -