/* Copyright 1998-2011 Research Foundation State University of New York */ /* This file is part of QuB. */ /* QuB is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation, either version 3 of the License, or */ /* (at your option) any later version. */ /* QuB is distributed in the hope that it will be useful, */ /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ /* GNU General Public License for more details. */ /* You should have received a copy of the GNU General Public License, */ /* named LICENSE.txt, in the QuB program directory. If not, see */ /* . */ /* begin_html See also: Up: Index end_html */ #ifndef UBLAS_MATRIXUTIL_H #define UBLAS_MATRIXUTIL_H // This unit has eigen and svd math for boost::ublas matrices. // They are wrappers around classic qub fortran-style functions in matrixutil. #include #include "matrixutil.h" void invm(matrix& Q_in, matrix& Q_out); bool eigen_vals_vecs(matrix& Q_in, double *rvalues, double *ivalues, matrix& vectors_out, matrix& vectors_inv, std::ostream& output); void expm_eig(double *rvalues, matrix& vectors, matrix& vectors_inv, double t, matrix& tmp_nxn_diag, matrix& tmp_nxn, matrix& Q_out); void expm(matrix& Q_in, double t, matrix& Q_out); bool sv_decomp(matrix& A, matrix& U, matrix& W, matrix& Vi); bool sv_decomp(double** A, int Nr, int Nc, matrix& U, matrix& W, matrix& Vi); bool sv_invm(double** A, int n, double** Ai); #endif