1c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// This file is part of Eigen, a lightweight C++ template library
2c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// for linear algebra.
3c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath//
4c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// Copyright (C) 2010 Gael Guennebaud <gael.guennebaud@inria.fr>
5c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath//
6c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// This Source Code Form is subject to the terms of the Mozilla
7c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// Public License v. 2.0. If a copy of the MPL was not distributed
8c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath// with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
10c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath#ifndef EIGEN_TRIANGULAR_SOLVER2_H
11c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath#define EIGEN_TRIANGULAR_SOLVER2_H
12c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
13c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathnamespace Eigen {
14c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
15c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int UnitDiagBit = UnitDiag;
16c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int SelfAdjointBit = SelfAdjoint;
17c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int UpperTriangularBit = Upper;
18c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int LowerTriangularBit = Lower;
19c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
20c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int UpperTriangular = Upper;
21c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int LowerTriangular = Lower;
22c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int UnitUpperTriangular = UnitUpper;
23c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathconst unsigned int UnitLowerTriangular = UnitLower;
24c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
25c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtemplate<typename ExpressionType, unsigned int Added, unsigned int Removed>
26c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtemplate<typename OtherDerived>
27c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtypename ExpressionType::PlainObject
28c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan KamathFlagged<ExpressionType,Added,Removed>::solveTriangular(const MatrixBase<OtherDerived>& other) const
29c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath{
30c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  return m_matrix.template triangularView<Added>().solve(other.derived());
31c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath}
32c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
33c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtemplate<typename ExpressionType, unsigned int Added, unsigned int Removed>
34c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathtemplate<typename OtherDerived>
35c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamathvoid Flagged<ExpressionType,Added,Removed>::solveTriangularInPlace(const MatrixBase<OtherDerived>& other) const
36c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath{
37c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath  m_matrix.template triangularView<Added>().solveInPlace(other.derived());
38c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath}
39c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
40c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath} // end namespace Eigen
41c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath
42c981c48f5bc9aefeffc0bcb0cc3934c2fae179ddNarayan Kamath#endif // EIGEN_TRIANGULAR_SOLVER2_H
43