mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-06-04 18:54:00 +08:00
Removed trailling spaces.
This commit is contained in:
parent
255689231d
commit
46885d33bf
@ -19,7 +19,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ template<typename MatrixType,
|
|||||||
assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
assert(startRow >= 0 && BlockRows >= 1 && startRow + BlockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
&& startCol >= 0 && BlockCols >= 1 && startCol + BlockCols <= matrix.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Dynamic-size constructor
|
/** Dynamic-size constructor
|
||||||
*/
|
*/
|
||||||
Block(const MatRef& matrix,
|
Block(const MatRef& matrix,
|
||||||
@ -90,9 +90,9 @@ template<typename MatrixType,
|
|||||||
assert(startRow >= 0 && blockRows >= 1 && startRow + blockRows <= matrix.rows()
|
assert(startRow >= 0 && blockRows >= 1 && startRow + blockRows <= matrix.rows()
|
||||||
&& startCol >= 0 && blockCols >= 1 && startCol + blockCols <= matrix.cols());
|
&& startCol >= 0 && blockCols >= 1 && startCol + blockCols <= matrix.cols());
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)
|
EIGEN_INHERIT_ASSIGNMENT_OPERATORS(Block)
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum{
|
enum{
|
||||||
RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime == 1 ? 1 : BlockRows,
|
RowsAtCompileTime = MatrixType::Traits::RowsAtCompileTime == 1 ? 1 : BlockRows,
|
||||||
@ -106,17 +106,17 @@ template<typename MatrixType,
|
|||||||
const Block& _ref() const { return *this; }
|
const Block& _ref() const { return *this; }
|
||||||
int _rows() const { return m_blockRows.value(); }
|
int _rows() const { return m_blockRows.value(); }
|
||||||
int _cols() const { return m_blockCols.value(); }
|
int _cols() const { return m_blockCols.value(); }
|
||||||
|
|
||||||
Scalar& _coeffRef(int row, int col)
|
Scalar& _coeffRef(int row, int col)
|
||||||
{
|
{
|
||||||
return m_matrix.coeffRef(row + m_startRow.value(), col + m_startCol.value());
|
return m_matrix.coeffRef(row + m_startRow.value(), col + m_startCol.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
Scalar _coeff(int row, int col) const
|
Scalar _coeff(int row, int col) const
|
||||||
{
|
{
|
||||||
return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value());
|
return m_matrix.coeff(row + m_startRow.value(), col + m_startCol.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
MatRef m_matrix;
|
MatRef m_matrix;
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class CwiseBinaryOp : NoOperatorEquals,
|
|||||||
typedef typename Rhs::Ref RhsRef;
|
typedef typename Rhs::Ref RhsRef;
|
||||||
friend class MatrixBase<Scalar, CwiseBinaryOp>;
|
friend class MatrixBase<Scalar, CwiseBinaryOp>;
|
||||||
typedef MatrixBase<Scalar, CwiseBinaryOp> Base;
|
typedef MatrixBase<Scalar, CwiseBinaryOp> Base;
|
||||||
|
|
||||||
CwiseBinaryOp(const LhsRef& lhs, const RhsRef& rhs)
|
CwiseBinaryOp(const LhsRef& lhs, const RhsRef& rhs)
|
||||||
: m_lhs(lhs), m_rhs(rhs)
|
: m_lhs(lhs), m_rhs(rhs)
|
||||||
{
|
{
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
//
|
//
|
||||||
// Eigen is free software; you can redistribute it and/or
|
// Eigen is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 3 of the License, or (at your option) any later version.
|
// version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Alternatively, you can redistribute it and/or
|
// Alternatively, you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
// published by the Free Software Foundation; either version 2 of
|
// published by the Free Software Foundation; either version 2 of
|
||||||
// the License, or (at your option) any later version.
|
// the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
@ -18,7 +18,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
//
|
//
|
||||||
// Eigen is free software; you can redistribute it and/or
|
// Eigen is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 3 of the License, or (at your option) any later version.
|
// version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Alternatively, you can redistribute it and/or
|
// Alternatively, you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
// published by the Free Software Foundation; either version 2 of
|
// published by the Free Software Foundation; either version 2 of
|
||||||
// the License, or (at your option) any later version.
|
// the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
@ -18,7 +18,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -53,7 +53,7 @@
|
|||||||
template<typename Scalar, typename Derived> class MatrixBase
|
template<typename Scalar, typename Derived> class MatrixBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/** \brief Some traits provided by the Derived type.
|
/** \brief Some traits provided by the Derived type.
|
||||||
*
|
*
|
||||||
* Grouping these in a nested subclass is what was needed for ICC compatibility. */
|
* Grouping these in a nested subclass is what was needed for ICC compatibility. */
|
||||||
@ -64,13 +64,13 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
* it is set to the \a Dynamic constant.
|
* it is set to the \a Dynamic constant.
|
||||||
* \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
|
* \sa MatrixBase::rows(), MatrixBase::cols(), ColsAtCompileTime, SizeAtCompileTime */
|
||||||
enum { RowsAtCompileTime = Derived::RowsAtCompileTime };
|
enum { RowsAtCompileTime = Derived::RowsAtCompileTime };
|
||||||
|
|
||||||
/** The number of columns at compile-time. This is just a copy of the value provided
|
/** The number of columns at compile-time. This is just a copy of the value provided
|
||||||
* by the \a Derived type. If a value is not known at compile-time,
|
* by the \a Derived type. If a value is not known at compile-time,
|
||||||
* it is set to the \a Dynamic constant.
|
* it is set to the \a Dynamic constant.
|
||||||
* \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
|
* \sa MatrixBase::rows(), MatrixBase::cols(), RowsAtCompileTime, SizeAtCompileTime */
|
||||||
enum { ColsAtCompileTime = Derived::ColsAtCompileTime };
|
enum { ColsAtCompileTime = Derived::ColsAtCompileTime };
|
||||||
|
|
||||||
/** This is equal to the number of coefficients, i.e. the number of
|
/** This is equal to the number of coefficients, i.e. the number of
|
||||||
* rows times the number of columns, or to \a Dynamic if this is not
|
* rows times the number of columns, or to \a Dynamic if this is not
|
||||||
* known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
|
* known at compile-time. \sa RowsAtCompileTime, ColsAtCompileTime */
|
||||||
@ -89,7 +89,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
* \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
|
* \sa RowsAtCompileTime, MaxColsAtCompileTime, MaxSizeAtCompileTime
|
||||||
*/
|
*/
|
||||||
enum { MaxRowsAtCompileTime = Derived::MaxRowsAtCompileTime };
|
enum { MaxRowsAtCompileTime = Derived::MaxRowsAtCompileTime };
|
||||||
|
|
||||||
/** This value is equal to the maximum possible number of columns that this expression
|
/** This value is equal to the maximum possible number of columns that this expression
|
||||||
* might have. If this expression might have an arbitrarily high number of columns,
|
* might have. If this expression might have an arbitrarily high number of columns,
|
||||||
* this value is set to \a Dynamic.
|
* this value is set to \a Dynamic.
|
||||||
@ -100,7 +100,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
* \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
|
* \sa ColsAtCompileTime, MaxRowsAtCompileTime, MaxSizeAtCompileTime
|
||||||
*/
|
*/
|
||||||
enum { MaxColsAtCompileTime = Derived::MaxColsAtCompileTime };
|
enum { MaxColsAtCompileTime = Derived::MaxColsAtCompileTime };
|
||||||
|
|
||||||
/** This value is equal to the maximum possible number of coefficients that this expression
|
/** This value is equal to the maximum possible number of coefficients that this expression
|
||||||
* might have. If this expression might have an arbitrarily high number of coefficients,
|
* might have. If this expression might have an arbitrarily high number of coefficients,
|
||||||
* this value is set to \a Dynamic.
|
* this value is set to \a Dynamic.
|
||||||
@ -123,7 +123,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
= Derived::RowsAtCompileTime == 1 || Derived::ColsAtCompileTime == 1
|
= Derived::RowsAtCompileTime == 1 || Derived::ColsAtCompileTime == 1
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/** This is the "reference type" used to pass objects of type MatrixBase as arguments
|
/** This is the "reference type" used to pass objects of type MatrixBase as arguments
|
||||||
* to functions. If this MatrixBase type represents an expression, then \a Ref
|
* to functions. If this MatrixBase type represents an expression, then \a Ref
|
||||||
* is just this MatrixBase type itself, i.e. expressions are just passed by value
|
* is just this MatrixBase type itself, i.e. expressions are just passed by value
|
||||||
@ -132,7 +132,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
* a typedef to MatrixRef, which works as a reference, so that matrices and vectors
|
* a typedef to MatrixRef, which works as a reference, so that matrices and vectors
|
||||||
* are passed by reference, not by value. \sa ref()*/
|
* are passed by reference, not by value. \sa ref()*/
|
||||||
typedef typename Reference<Derived>::Type Ref;
|
typedef typename Reference<Derived>::Type Ref;
|
||||||
|
|
||||||
/** This is the "real scalar" type; if the \a Scalar type is already real numbers
|
/** This is the "real scalar" type; if the \a Scalar type is already real numbers
|
||||||
* (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If
|
* (e.g. int, float or double) then \a RealScalar is just the same as \a Scalar. If
|
||||||
* \a Scalar is \a std::complex<T> then RealScalar is \a T.
|
* \a Scalar is \a std::complex<T> then RealScalar is \a T.
|
||||||
@ -297,7 +297,7 @@ template<typename Scalar, typename Derived> class MatrixBase
|
|||||||
Derived& operator-=(const MatrixBase<Scalar, OtherDerived>& other);
|
Derived& operator-=(const MatrixBase<Scalar, OtherDerived>& other);
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
Derived& operator*=(const MatrixBase<Scalar, OtherDerived>& other);
|
Derived& operator*=(const MatrixBase<Scalar, OtherDerived>& other);
|
||||||
|
|
||||||
Derived& operator*=(const Scalar& other);
|
Derived& operator*=(const Scalar& other);
|
||||||
Derived& operator/=(const Scalar& other);
|
Derived& operator/=(const Scalar& other);
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
//
|
//
|
||||||
// Eigen is free software; you can redistribute it and/or
|
// Eigen is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 3 of the License, or (at your option) any later version.
|
// version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Alternatively, you can redistribute it and/or
|
// Alternatively, you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
// published by the Free Software Foundation; either version 2 of
|
// published by the Free Software Foundation; either version 2 of
|
||||||
// the License, or (at your option) any later version.
|
// the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
@ -18,7 +18,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -30,10 +30,10 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
|||||||
{
|
{
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
|
typedef Matrix<Scalar, MatrixType::Traits::RowsAtCompileTime, 1> VectorType;
|
||||||
|
|
||||||
int rows = m.rows();
|
int rows = m.rows();
|
||||||
int cols = m.cols();
|
int cols = m.cols();
|
||||||
|
|
||||||
// this test relies a lot on Random.h, and there's not much more that we can do
|
// this test relies a lot on Random.h, and there's not much more that we can do
|
||||||
// to test it, hence I consider that we will have tested Random.h
|
// to test it, hence I consider that we will have tested Random.h
|
||||||
MatrixType m1 = MatrixType::random(rows, cols),
|
MatrixType m1 = MatrixType::random(rows, cols),
|
||||||
@ -50,7 +50,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
|||||||
|
|
||||||
int r = ei_random<int>(0, rows-1),
|
int r = ei_random<int>(0, rows-1),
|
||||||
c = ei_random<int>(0, cols-1);
|
c = ei_random<int>(0, cols-1);
|
||||||
|
|
||||||
VERIFY_IS_APPROX( v1, v1);
|
VERIFY_IS_APPROX( v1, v1);
|
||||||
VERIFY_IS_NOT_APPROX( v1, 2*v1);
|
VERIFY_IS_NOT_APPROX( v1, 2*v1);
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN( vzero, v1);
|
VERIFY_IS_MUCH_SMALLER_THAN( vzero, v1);
|
||||||
@ -63,7 +63,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
|||||||
VERIFY_IS_MUCH_SMALLER_THAN( mzero, m1);
|
VERIFY_IS_MUCH_SMALLER_THAN( mzero, m1);
|
||||||
VERIFY_IS_NOT_MUCH_SMALLER_THAN(m1, m1);
|
VERIFY_IS_NOT_MUCH_SMALLER_THAN(m1, m1);
|
||||||
VERIFY_IS_APPROX( mzero, m1-m1);
|
VERIFY_IS_APPROX( mzero, m1-m1);
|
||||||
|
|
||||||
// always test operator() on each read-only expression class,
|
// always test operator() on each read-only expression class,
|
||||||
// in order to check const-qualifiers.
|
// in order to check const-qualifiers.
|
||||||
// indeed, if an expression class (here Zero) is meant to be read-only,
|
// indeed, if an expression class (here Zero) is meant to be read-only,
|
||||||
@ -71,7 +71,7 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
|
|||||||
// should return a const-qualified object so that it is the const-qualified
|
// should return a const-qualified object so that it is the const-qualified
|
||||||
// operator() that gets called, which in turn calls _read().
|
// operator() that gets called, which in turn calls _read().
|
||||||
VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::zero(rows,cols)(r,c), static_cast<Scalar>(1));
|
VERIFY_IS_MUCH_SMALLER_THAN(MatrixType::zero(rows,cols)(r,c), static_cast<Scalar>(1));
|
||||||
|
|
||||||
// now test copying a row-vector into a (column-)vector and conversely.
|
// now test copying a row-vector into a (column-)vector and conversely.
|
||||||
square.col(r) = square.row(r).eval();
|
square.col(r) = square.row(r).eval();
|
||||||
Matrix<Scalar, 1, MatrixType::Traits::RowsAtCompileTime> rv(rows);
|
Matrix<Scalar, 1, MatrixType::Traits::RowsAtCompileTime> rv(rows);
|
||||||
|
@ -1,16 +1,17 @@
|
|||||||
// This file is part of Eigen, a lightweight C++ template library
|
// This file is part of Eigen, a lightweight C++ template library
|
||||||
// for linear algebra. Eigen itself is part of the KDE project.
|
// for linear algebra. Eigen itself is part of the KDE project.
|
||||||
//
|
//
|
||||||
|
// Copyright (C) 2008 Gael Guennebaud <g.gael@free.fr>
|
||||||
// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr>
|
// Copyright (C) 2006-2008 Benoit Jacob <jacob@math.jussieu.fr>
|
||||||
//
|
//
|
||||||
// Eigen is free software; you can redistribute it and/or
|
// Eigen is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 3 of the License, or (at your option) any later version.
|
// version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Alternatively, you can redistribute it and/or
|
// Alternatively, you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
// published by the Free Software Foundation; either version 2 of
|
// published by the Free Software Foundation; either version 2 of
|
||||||
// the License, or (at your option) any later version.
|
// the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
@ -18,7 +19,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@
|
|||||||
//
|
//
|
||||||
// Eigen is free software; you can redistribute it and/or
|
// Eigen is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU Lesser General Public
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
// License as published by the Free Software Foundation; either
|
// License as published by the Free Software Foundation; either
|
||||||
// version 3 of the License, or (at your option) any later version.
|
// version 3 of the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Alternatively, you can redistribute it and/or
|
// Alternatively, you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License as
|
// modify it under the terms of the GNU General Public License as
|
||||||
// published by the Free Software Foundation; either version 2 of
|
// published by the Free Software Foundation; either version 2 of
|
||||||
// the License, or (at your option) any later version.
|
// the License, or (at your option) any later version.
|
||||||
//
|
//
|
||||||
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
// Eigen is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||||
@ -18,7 +18,7 @@
|
|||||||
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License or the
|
||||||
// GNU General Public License for more details.
|
// GNU General Public License for more details.
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Lesser General Public
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
// License and a copy of the GNU General Public License along with
|
// License and a copy of the GNU General Public License along with
|
||||||
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
// Eigen. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
@ -78,19 +78,19 @@ template<typename MatrixType> void submatrices(const MatrixType& m)
|
|||||||
vzero = VectorType::zero(rows);
|
vzero = VectorType::zero(rows);
|
||||||
|
|
||||||
Scalar s1 = ei_random<Scalar>();
|
Scalar s1 = ei_random<Scalar>();
|
||||||
|
|
||||||
int r1 = ei_random<int>(0,rows-1);
|
int r1 = ei_random<int>(0,rows-1);
|
||||||
int r2 = ei_random<int>(r1,rows-1);
|
int r2 = ei_random<int>(r1,rows-1);
|
||||||
int c1 = ei_random<int>(0,cols-1);
|
int c1 = ei_random<int>(0,cols-1);
|
||||||
int c2 = ei_random<int>(c1,cols-1);
|
int c2 = ei_random<int>(c1,cols-1);
|
||||||
|
|
||||||
//check row() and col()
|
//check row() and col()
|
||||||
VERIFY_IS_APPROX(m1.col(c1).transpose(), m1.transpose().row(c1));
|
VERIFY_IS_APPROX(m1.col(c1).transpose(), m1.transpose().row(c1));
|
||||||
VERIFY_IS_APPROX(square.row(r1).dot(m1.col(c1)), square.lazyProduct(m1.conjugate())(r1,c1));
|
VERIFY_IS_APPROX(square.row(r1).dot(m1.col(c1)), square.lazyProduct(m1.conjugate())(r1,c1));
|
||||||
//check operator(), both constant and non-constant, on row() and col()
|
//check operator(), both constant and non-constant, on row() and col()
|
||||||
m1.row(r1) += s1 * m1.row(r2);
|
m1.row(r1) += s1 * m1.row(r2);
|
||||||
m1.col(c1) += s1 * m1.col(c2);
|
m1.col(c1) += s1 * m1.col(c2);
|
||||||
|
|
||||||
//check block()
|
//check block()
|
||||||
Matrix<Scalar,Dynamic,Dynamic> b1(1,1); b1(0,0) = m1(r1,c1);
|
Matrix<Scalar,Dynamic,Dynamic> b1(1,1); b1(0,0) = m1(r1,c1);
|
||||||
RowVectorType br1(m1.block(r1,0,1,cols));
|
RowVectorType br1(m1.block(r1,0,1,cols));
|
||||||
@ -120,7 +120,7 @@ void EigenTest::testSubmatrices()
|
|||||||
submatrices(MatrixXcf(3, 3));
|
submatrices(MatrixXcf(3, 3));
|
||||||
submatrices(MatrixXi(8, 12));
|
submatrices(MatrixXi(8, 12));
|
||||||
submatrices(MatrixXcd(20, 20));
|
submatrices(MatrixXcd(20, 20));
|
||||||
|
|
||||||
// test fixed block() separately as it is a template method so doesn't support
|
// test fixed block() separately as it is a template method so doesn't support
|
||||||
// being called as a member of a class that is itself a template parameter
|
// being called as a member of a class that is itself a template parameter
|
||||||
// (at least as of g++ 4.2)
|
// (at least as of g++ 4.2)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user