Go to the documentation of this file.
47 template<
typename Treal>
48 inline int sign(Treal value) {
69 template<
typename Treal,
typename Tfun>
71 int sign_min =
sign(fun.eval(
min));
72 int sign_max =
sign(fun.eval(
max));
73 if (sign_min == sign_max)
74 throw Failure(
"bisection(Tfun&, Treal, Treal, Treal): interval "
76 Treal middle = (
max +
min) / 2;
77 int sign_middle =
sign(fun.eval(middle));
79 if (sign_middle == sign_min) {
81 sign_min = sign_middle;
85 sign_max = sign_middle;
88 sign_middle =
sign(fun.eval(middle));
Vector< real, real > Vec_1
Definition: test_LanczosSeveralLargestEig.cc:63
void randomZeroStructure(Treal probabilityBeingZero)
Definition: MatrixSymmetric.h:588
Treal template_blas_sqrt(Treal x)
static Treal maxdiff(const Treal *f1, const Treal *f2, int size)
Definition: general.h:44
static std::string getStatsCountRead()
Definition: FileWritable.cc:364
static void testAccumulation(const Tmatrix &syFock, int size, Treal *fockfull)
Definition: API_test.cc:88
Vector< real, Vec_2 > Vec_3
Definition: test_LanczosSeveralLargestEig.cc:65
static void symv(const char *uplo, const int *n, const T *alpha, const T *A, const int *lda, const T *x, const int *incx, const T *beta, T *y, const int *incy)
Definition: mat_gblas.h:400
static Treal frobdiff(const Treal *f1, const Treal *f2, int size)
Definition: general.h:69
int main(int argc, char *argv[])
Definition: API_test.cc:2413
@ zero
Definition: matInclude.h:138
void gershgorin(Treal &lmin, Treal &lmax) const
Definition: MatrixSymmetric.h:476
static double get_wall_seconds()
Definition: bench_gemm_only.cc:49
static void trmm(const char *side, const char *uplo, const char *transa, const char *diag, const int *m, const int *n, const T *alpha, const T *A, const int *lda, T *B, const int *ldb)
Definition: mat_gblas.h:281
Matrix< real, real > Mat_1
Definition: test_LanczosSeveralLargestEig.cc:60
VectorGeneral< real, vect > normalVector
Definition: test_LanczosSeveralLargestEig.cc:72
void get_values(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const
Get values given by row and column index lists.
Definition: MatrixTriangular.h:115
void assign_from_sparse(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values)
Assign from sparse matrix given by three vectors.
Definition: MatrixSymmetric.h:176
void frob_thresh(Treal threshold)
Definition: MatrixGeneral.h:299
void get_all_values(std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &values) const
Get all values and corresponding row and column index lists, in matrix.
Definition: MatrixSymmetric.h:303
Matrix< real, Mat_1 > Mat_2
Definition: test_LanczosSeveralLargestEig.cc:61
static void setNProcs(unsigned int const nP)
Definition: matInclude.h:112
void assign_from_sparse(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values, SizesAndBlocks const &newRows, SizesAndBlocks const &newCols)
Assign from sparse matrix given by three vectors.
Definition: MatrixTriangular.h:86
Definition: API_test.cc:71
Treal template_blas_exp(Treal x)
MatrixSymmetric< real, matri > symmMatrix
Definition: test_LanczosSeveralLargestEig.cc:69
int main(int argc, char *argv[])
Definition: bench.cc:134
static unsigned int getMatrixParallelLevel()
Definition: matInclude.h:120
static Treal frobdiff(const Treal *f1, const Treal *f2, int size)
Definition: API_test.cc:2464
Treal eucl() const
Definition: VectorGeneral.h:178
static std::string getStatsTimeCopyAndAssign()
Definition: FileWritable.cc:358
@ frobNorm
Definition: matInclude.h:139
Vector< real, Vec_1 > Vec_2
Definition: test_LanczosSeveralLargestEig.cc:64
Definition: API_test.cc:78
static void gemv(const char *ta, const int *m, const int *n, const T *alpha, const T *A, const int *lda, const T *x, const int *incx, const T *beta, T *y, const int *incy)
Definition: mat_gblas.h:391
Treal eucl_thresh_congr_trans_measure(Treal const threshold, MatrixSymmetric< Treal, Tmatrix > &trA)
Definition: MatrixTriangular.h:300
ergo_real real
Definition: test.cc:46
mat::SizesAndBlocks rows
Definition: test.cc:51
static void packedtofull(const Treal *packed, Treal *full, const int size)
Definition: mat_gblas.h:1148
Treal frob() const
Definition: MatrixSymmetric.h:360
static Treal maxdiff_tri(const Treal *f1, const Treal *f2, int size)
Definition: API_test.cc:2451
Treal template_blas_fabs(Treal x)
static void setMatrixParallelLevel(unsigned int const mPL)
Definition: matInclude.h:129
Treal eucl(Treal const requestedAccuracy, int maxIter=-1) const
Definition: MatrixGeneral.h:476
Treal accumulate(const Treal &a, int row, int col)
Definition: API_test.cc:73
Matrix< real, Mat_2 > Mat_3
Definition: test_LanczosSeveralLargestEig.cc:62
mat::Matrix< ergo_real, Mat_3 > Mat_4
Definition: matrix_typedefs.h:55
void inch(const MatrixGeneral< Treal, Tmatrix > &SPD, const Treal threshold, const side looking=left, const inchversion version=unstable)
Definition: MatrixTriangular.h:150
int sign(Treal value)
Sign function returns the sign of the input.
Definition: bisection.h:48
static void pptrf(const char *uplo, const int *n, T *ap, int *info)
Definition: mat_gblas.h:263
MatrixGeneral< real, matri > normalMatrix
Definition: test_LanczosSeveralLargestEig.cc:71
MatrixTriangular< real, matri > triangMatrix
Definition: test_LanczosSeveralLargestEig.cc:70
Treal accumulate(MatrixSymmetric< Treal, Tmatrix > &A, Top &op)
Performs operation specified in 'op' on all nonzero matrix elements and sums up the result and return...
Definition: MatrixSymmetric.h:1251
Treal frob() const
Definition: MatrixTriangular.h:169
void setElementsByRule(TRule &rule)
Uses rule depending on the row and column indexes to set matrix elements The Trule class should have ...
Definition: MatrixSymmetric.h:597
int mainFun(int argc, char *argv[])
Definition: bench.cc:56
Symmetric matrix.
Definition: MatrixBase.h:51
Upper non-unit triangular matrix.
Definition: MatrixBase.h:53
void resetSizesAndBlocks(SizesAndBlocks const &newRows)
Definition: VectorGeneral.h:51
Mat_3 matri
Definition: test_LanczosSeveralLargestEig.cc:67
Treal eucl(Treal const requestedAccuracy, int maxIter=-1) const
Definition: MatrixSymmetric.h:673
Definition: LanczosLargestMagnitudeEig.h:47
Treal eucl_thresh(Treal const threshold, MatrixTriangular< Treal, Tmatrix > const *const Zptr=NULL)
Definition: MatrixSymmetric.h:857
Treal eucl(Treal const requestedAccuracy, int maxIter=-1) const
Definition: MatrixTriangular.h:257
static unsigned int getNProcs()
Definition: matInclude.h:103
Treal set(int const row, int const col)
Definition: API_test.cc:80
Treal mixed_norm_thresh(Treal const threshold)
Definition: MatrixSymmetric.h:913
bool dotIsBroken()
Definition: API_test.cc:105
static void tripackedtofull(const Treal *packed, Treal *full, const int size)
Definition: mat_gblas.h:1170
static std::string getStatsTimeRead()
Definition: FileWritable.cc:355
bool realIsSingle< float >()
Definition: API_test.cc:57
Vector class.
Definition: Matrix.h:78
static void gemm(const char *ta, const char *tb, const int *n, const int *k, const int *l, const T *alpha, const T *A, const int *lda, const T *B, const int *ldb, const T *beta, T *C, const int *ldc)
Definition: mat_gblas.h:232
void get_values(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const
Get values given by row and column index lists.
Definition: MatrixGeneral.h:173
void setElementsByRule(TRule &rule)
Definition: MatrixGeneral.h:457
Treal eucl_thresh(Treal const threshold)
Definition: MatrixTriangular.h:291
static void tptri(const char *uplo, const char *diag, const int *n, T *ap, int *info)
Definition: mat_gblas.h:275
Definition: MatrixBase.h:55
Normal matrix.
Definition: MatrixBase.h:49
void random()
Definition: MatrixSymmetric.h:584
Treal frob() const
Definition: MatrixGeneral.h:284
Xtrans< TX > transpose(TX const &A)
Transposition.
Definition: matrix_proxy.h:131
mat::SizesAndBlocks cols
Definition: test.cc:52
Definition: allocate.cc:39
static std::string getStatsCountCopyAndAssign()
Definition: FileWritable.cc:367
virtual const char * what() const
Definition: Failure.h:67
Matrix class and heart of the matrix library.
Definition: Matrix.h:115
static void resetStats()
Definition: FileWritable.cc:308
#define max(a, b)
Definition: integrator.cc:87
static void symm(const char *side, const char *uplo, const int *m, const int *n, const T *alpha, const T *A, const int *lda, const T *B, const int *ldb, const T *beta, T *C, const int *ldc)
Definition: mat_gblas.h:342
void rand()
Definition: VectorGeneral.h:108
int min(int a, int b)
Definition: lin_trans.cc:66
void randomZeroStructure(Treal probabilityBeingZero)
Definition: MatrixGeneral.h:452
void fullvector(std::vector< Treal > &fullVector) const
Definition: VectorGeneral.h:88
static void trmv(const char *uplo, const char *trans, const char *diag, const int *n, const T *A, const int *lda, T *x, const int *incx)
Definition: mat_gblas.h:409
void get_values(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > &values) const
Get values given by row and column index lists.
Definition: MatrixSymmetric.h:273
void assign_from_sparse(std::vector< int > const &rowind, std::vector< int > const &colind, std::vector< Treal > const &values, SizesAndBlocks const &newRows, SizesAndBlocks const &newCols)
Assign from sparse matrix given by three arrays.
Definition: MatrixGeneral.h:122
Vec_3 vect
Definition: test_LanczosSeveralLargestEig.cc:68
void setElementsByRule(TRule &rule)
Uses rule depending on the row and column indexes to set matrix elements The Trule class should have ...
Definition: MatrixTriangular.h:205
static std::string getStatsCountWrite()
Definition: FileWritable.cc:361
void get_all_values(std::vector< int > &rowind, std::vector< int > &colind, std::vector< Treal > &values) const
Get all values and corresponding row and column index lists, in matrix.
Definition: MatrixTriangular.h:128
Describes dimensions of matrix and its blocks on all levels.
Definition: SizesAndBlocks.h:45
static void syrk(const char *uplo, const char *trans, const int *n, const int *k, const T *alpha, const T *A, const int *lda, const T *beta, T *C, const int *ldc)
Definition: mat_gblas.h:334
int mainFun(int argc, char *argv[])
Definition: API_test.cc:122
Class used to keep track of the block sizes used at different levels in the hierarchical matrix data ...
Treal bisection(Tfun const &fun, Treal min, Treal max, Treal const tol)
Bisection algorithm for root finding.
Definition: bisection.h:70
int mainFun(int size, int parallel_level, int block_size, int block_factor_1, int block_factor_2, int block_factor_3)
Definition: bench_gemm_only.cc:60
void assignFromFull(std::vector< Treal > const &fullMat)
Definition: MatrixSymmetric.h:110
static Treal maxdiff_tri(const Treal *f1, const Treal *f2, int size)
Definition: general.h:56
Definition: mat_utils.h:43
static std::string getStatsTimeWrite()
Definition: FileWritable.cc:352
bool realIsSingle()
Definition: API_test.cc:55
void random()
Definition: MatrixTriangular.h:196
void fullMatrix(std::vector< Treal > &fullMat) const
Save matrix as full matrix.
Definition: MatrixSymmetric.h:138
Treal eucl_thresh(Treal const threshold)
Definition: MatrixGeneral.h:525
static T dot(const int *n, const T *dx, const int *incx, const T *dy, const int *incy)
Definition: mat_gblas.h:425
static Treal maxdiff(std::vector< Treal > const &f1, std::vector< Treal > const &f2)
Definition: API_test.cc:2436
int main(int argc, char *argv[])
Definition: bench_gemm_only.cc:110