mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-19 18:40:38 +08:00
and here is the fixed-size Block class
This commit is contained in:
parent
04502cccd9
commit
1a94c28bfe
@ -18,13 +18,13 @@ int main(int, char **)
|
||||
// notice how we are mixing fixed-size and dynamic-size types.
|
||||
|
||||
cout << "In the top-left block, we put the matrix m shown above." << endl;
|
||||
m2.block(0,0,2,2) = m;
|
||||
m2.block<2,2>(0,0) = m;
|
||||
cout << "In the bottom-left block, we put the matrix m*m, which is:" << endl << m*m << endl;
|
||||
m2.block(2,0,2,2) = m * m;
|
||||
m2.block<2,2>(2,0) = m * m;
|
||||
cout << "In the top-right block, we put the matrix m+m, which is:" << endl << m+m << endl;
|
||||
m2.block(0,2,2,2) = m + m;
|
||||
m2.block<2,2>(0,2) = m + m;
|
||||
cout << "In the bottom-right block, we put the matrix m-m, which is:" << endl << m-m << endl;
|
||||
m2.block(2,2,2,2) = m - m;
|
||||
m2.block<2,2>(2,2) = m - m;
|
||||
cout << "Now the 4x4 matrix m2 is:" << endl << m2 << endl;
|
||||
|
||||
cout << "Row 0 of m2 is:" << endl << m2.row(0) << endl;
|
||||
|
@ -21,6 +21,7 @@ namespace Eigen {
|
||||
#include "Core/Row.h"
|
||||
#include "Core/Column.h"
|
||||
#include "Core/DynBlock.h"
|
||||
#include "Core/Block.h"
|
||||
#include "Core/Minor.h"
|
||||
#include "Core/Transpose.h"
|
||||
#include "Core/Conjugate.h"
|
||||
|
@ -23,8 +23,8 @@
|
||||
// License. This exception does not invalidate any other reasons why a work
|
||||
// based on this file might be covered by the GNU General Public License.
|
||||
|
||||
#ifndef EIGEN_BLOCK_H
|
||||
#define EIGEN_BLOCK_H
|
||||
#ifndef EIGEN_DYNBLOCK_H
|
||||
#define EIGEN_DYNBLOCK_H
|
||||
|
||||
template<typename MatrixType> class DynBlock
|
||||
: public MatrixBase<typename MatrixType::Scalar, DynBlock<MatrixType> >
|
||||
@ -82,4 +82,4 @@ DynBlock<Derived> MatrixBase<Scalar, Derived>
|
||||
startRow, startCol, blockRows, blockCols);
|
||||
}
|
||||
|
||||
#endif // EIGEN_BLOCK_H
|
||||
#endif // EIGEN_DYNBLOCK_H
|
||||
|
@ -85,8 +85,8 @@ template<typename Scalar, typename Derived> class MatrixBase
|
||||
|
||||
DynBlock<Derived> dynBlock(int startRow, int startCol,
|
||||
int blockRows, int blockCols) const;
|
||||
//template<int BlockRows, int BlockCols> Block<Derived, BlockRows, BlockCols>
|
||||
//block(int startRow, int startCol) const;
|
||||
template<int BlockRows, int BlockCols>
|
||||
Block<Derived, BlockRows, BlockCols> block(int startRow, int startCol) const;
|
||||
|
||||
Transpose<Derived> transpose() const;
|
||||
Conjugate<Derived> conjugate() const;
|
||||
|
@ -48,6 +48,7 @@ template<typename MatrixType> class Row;
|
||||
template<typename MatrixType> class Column;
|
||||
template<typename MatrixType> class Minor;
|
||||
template<typename MatrixType> class DynBlock;
|
||||
template<typename MatrixType, int BlockRows, int BlockCols> class Block;
|
||||
template<typename MatrixType> class Transpose;
|
||||
template<typename MatrixType> class Conjugate;
|
||||
template<typename MatrixType> class Opposite;
|
||||
|
Loading…
x
Reference in New Issue
Block a user