17#include "fasp_functs.h"
41 REAL eigenvalue = 0.0, temp = 1.0, L2_norm_y;
51 for ( i = maxit; i--; ) {
63 if ( (
ABS(eigenvalue - temp)/
ABS(temp)) < tol )
break;
void fasp_dvec_free(dvector *u)
Free vector data space of REAL type.
void fasp_dvec_rand(const INT n, dvector *x)
Generate fake random REAL vector in the range from 0 to 1.
void fasp_dvec_alloc(const INT m, dvector *u)
Create dvector data space of REAL type.
void fasp_dvec_cp(const dvector *x, dvector *y)
Copy dvector x to dvector y.
void fasp_blas_darray_ax(const INT n, const REAL a, REAL *x)
x = a*x
REAL fasp_dcsr_maxeig(const dCSRmat *A, const REAL tol, const INT maxit)
Approximate the largest eigenvalue of A by the power method.
void fasp_blas_dcsr_mxv(const dCSRmat *A, const REAL *x, REAL *y)
Matrix-vector multiplication y = A*x.
REAL fasp_blas_dcsr_vmv(const dCSRmat *A, const REAL *x, const REAL *y)
vector-Matrix-vector multiplication alpha = y'*A*x
REAL fasp_blas_dvec_norm2(const dvector *x)
L2 norm of dvector x.
Main header file for the FASP project.
Sparse matrix of REAL type in CSR format.
INT row
row number of matrix A, m
Vector with n entries of REAL type.
REAL * val
actual vector entries