// $Id$
// Version: $Name$
//
-// Copyright (C) 2005, 2006, 2008, 2009 by the deal.II authors
+// Copyright (C) 2005, 2006, 2008, 2009, 2010 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* allocated.
*/
explicit LAPACKFullMatrix (const unsigned int n = 0);
-
+
/**
* Constructor. Initialize the
* matrix as a rectangular
*/
LAPACKFullMatrix (const unsigned int rows,
const unsigned int cols);
-
- /**
+
+ /**
* Copy constructor. This
* constructor does a deep copy
* of the matrix. Therefore, it
*/
LAPACKFullMatrix<number> &
operator = (const LAPACKFullMatrix<number>&);
-
+
/**
* Assignment operator for a
* regular FullMatrix.
template <typename number2>
LAPACKFullMatrix<number> &
operator = (const FullMatrix<number2>&);
-
+
/**
* This operator assigns a scalar
* to a matrix. To avoid
*/
template <class MATRIX>
void copy_from (const MATRIX&);
-
+
/**
* Fill rectangular block.
*
const unsigned int src_offset_j = 0,
const number factor = 1.,
const bool transpose = false);
-
+
/**
* Matrix-vector-multiplication.
*
*/
void vmult_add (Vector<number> &w,
const Vector<number> &v) const;
-
+
/**
* Transpose
* matrix-vector-multiplication.
*/
void apply_lu_factorization (Vector<number>& v,
const bool transposed) const;
-
+
/**
* Compute eigenvalues of the
* matrix. After this routine has
* separate function that returns
* whatever eigenvalue is
* requested.
- *
+ *
* @note Calls the LAPACK
* function Xgeev.
*/
const bool left_eigenvectors = false);
/**
- * Compute generalized eigenvalues
+ * Compute generalized eigenvalues
* and (optionally) eigenvectors of
* a real generalized symmetric
* eigenproblem of the form
- * itype = 1: A*x=\lambda*B*x
- * itype = 2: A*B*x=\lambda*x
- * itype = 3: B*A*x=\lambda*x,
+ * itype = 1: $Ax=\lambda B x$
+ * itype = 2: $ABx=\lambda x$
+ * itype = 3: $BAx=\lambda x$,
* where A is this matrix.
* A and B are assumed to be symmetric,
* and B has to be positive definite.
* separate function that returns
* whatever eigenvalue is
* requested.
- *
+ *
* @note Calls the LAPACK
* function Xsygv. For this to
* work, ./configure has to
*/
std::complex<number>
eigenvalue (const unsigned int i) const;
-
+
/**
* Print the matrix and allow
* formatting of entries.
const char *zero_string = " ",
const double denominator = 1.,
const double threshold = 0.) const;
-
+
private:
/**
* Since LAPACK operations
* LU-factorization.
*/
std::vector<int> ipiv;
-
+
/**
* Workspace for calculating the
* inverse matrix from an LU
* factorization.
*/
std::vector<number> inv_work;
-
+
/**
* Real parts of
* eigenvalues. Filled by
* compute_eigenvalues.
*/
std::vector<number> wr;
-
+
/**
* Imaginary parts of
* eigenvalues. Filled by
* compute_eigenvalues.
*/
std::vector<number> wi;
-
+
/**
* Space where left eigenvectors
* can be stored.
*/
std::vector<number> vl;
-
+
/**
* Space where right eigenvectors
* can be stored.
for (typename MATRIX::const_iterator entry = M.begin();
entry != end; ++entry)
this->el(entry->row(), entry->column()) = entry->value();
-
+
state = LAPACKSupport::matrix;
}
{
const unsigned int i = transpose ? entry->column() : entry->row();
const unsigned int j = transpose ? entry->row() : entry->column();
-
+
const unsigned int dst_i=dst_offset_i+i-src_offset_i;
const unsigned int dst_j=dst_offset_j+j-src_offset_j;
if (dst_i<this->n_rows() && dst_j<this->n_cols())
(*this)(dst_i, dst_j) = factor * entry->value();
}
-
+
state = LAPACKSupport::matrix;
}
Assert (wr.size() == this->n_rows(), ExcInternalError());
Assert (wi.size() == this->n_rows(), ExcInternalError());
Assert (i<this->n_rows(), ExcIndexRange(i,0,this->n_rows()));
-
+
return std::complex<number>(wr[i], wi[i]);
}