SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EvaluateLinearAlgebraUnaryAlgo.h
Go to the documentation of this file.
1 /*
2  For more information, please see: http://software.sci.utah.edu
3 
4  The MIT License
5 
6  Copyright (c) 2012 Scientific Computing and Imaging Institute,
7  University of Utah.
8 
9  License for the specific language governing rights and limitations under
10  Permission is hereby granted, free of charge, to any person obtaining a
11  copy of this software and associated documentation files (the "Software"),
12  to deal in the Software without restriction, including without limitation
13  the rights to use, copy, modify, merge, publish, distribute, sublicense,
14  and/or sell copies of the Software, and to permit persons to whom the
15  Software is furnished to do so, subject to the following conditions:
16 
17  The above copyright notice and this permission notice shall be included
18  in all copies or substantial portions of the Software.
19 
20  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26  DEALINGS IN THE SOFTWARE.
27 */
28 
29 #ifndef ALGORITHMS_MATH_EVALUATELINEARALGEBRAUNARY_H
30 #define ALGORITHMS_MATH_EVALUATELINEARALGEBRAUNARY_H
31 
34 #include <boost/optional.hpp>
36 
37 /// \addtogroup Algorithms_Math
38 /// @{
39 ///
40 
41 namespace SCIRun {
42 namespace Core {
43 namespace Algorithms {
44 namespace Math {
45 
46 ///
47 /// \class EvaluateLinearAlgebraUnaryAlgorithm
48 ///
49 /// \brief Computes several unary operations on general matrices
50 ///
51 /// \tparam _MatrixType the type of the matrix of which we are computing the
52 /// eigendecomposition; this is expected to be an instantiation of the Matrix
53 /// class template. Currently, only real matrices are supported.
54 ///
55 /// The eigenvalues and eigenvectors of a matrix \f$ A \f$ are scalars
56 /// \f$ \lambda \f$ and vectors \f$ v \f$ such that \f$ Av = \lambda v \f$. If
57 /// \f$ D \f$ is a diagonal matrix with the eigenvalues on the diagonal, and
58 /// \f$ V \f$ is a matrix with the eigenvectors as its columns, then \f$ A V =
59 /// V D \f$. The matrix \f$ V \f$ is almost always invertible, in which case we
60 /// have \f$ A = V D V^{-1} \f$. This is called the eigendecomposition.
61 ///
62 /// Call the function compute() to compute the eigenvalues and eigenvectors of
63 /// a given matrix. Alternatively, you can use the
64 /// EigenSolver(const MatrixType&, bool) constructor which computes the
65 /// eigenvalues and eigenvectors at construction time. Once the eigenvalue and
66 /// eigenvectors are computed, they can be retrieved with the eigenvalues() and
67 /// eigenvectors() functions. The pseudoEigenvalueMatrix() and
68 /// pseudoEigenvectors() methods allow the construction of the
69 /// pseudo-eigendecomposition.
70 ///
71 /// The documentation for EigenSolver(const MatrixType&, bool) contains an
72 /// example of the typical use of this class.
73 ///
74 /// \note The implementation is adapted from
75 /// <a href="http://math.nist.gov/javanumerics/jama/">JAMA</a> (public domain).
76 /// Their code is based on EISPACK.
77 ///
78 /// \sa MatrixBase::eigenvalues(), class ComplexEigenSolver, class SelfAdjointEigenSolver
79 ///
80 
82  {
83  public:
84  enum Operator
85  {
88  SCALAR_MULTIPLY
89  };
90 
92  typedef boost::tuple<Operator, boost::optional<double> > Parameters;
94 
96  Outputs run(const Inputs& matrix, const Parameters& params) const;
97 
98  AlgorithmOutput run_generic(const AlgorithmInput& input) const;
99  };
100 }}}}
101 
102 
103 /*! @} End of Doxygen Groups*/
104 
105 #endif
Definition: AlgorithmBase.h:296
Definition: AlgorithmBase.h:219
Computes several unary operations on general matrices.
Definition: EvaluateLinearAlgebraUnaryAlgo.h:81
#define SCISHARE
Definition: share.h:39
SCIRun::Core::Datatypes::DenseMatrixHandle Outputs
Definition: EvaluateLinearAlgebraUnaryAlgo.h:93
Operator
Definition: EvaluateLinearAlgebraUnaryAlgo.h:84
boost::tuple< Operator, boost::optional< double > > Parameters
Definition: EvaluateLinearAlgebraUnaryAlgo.h:92
Definition: AlgorithmBase.h:212
boost::shared_ptr< DenseMatrix > DenseMatrixHandle
Definition: MatrixFwd.h:52
SCIRun::Core::Datatypes::DenseMatrixConstHandle Inputs
Definition: EvaluateLinearAlgebraUnaryAlgo.h:91
boost::shared_ptr< const DenseMatrix > DenseMatrixConstHandle
Definition: MatrixFwd.h:53