Classes | Typedefs | Functions
BlockMethods.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ConstNColsBlockXpr< N >
struct  ConstNRowsBlockXpr< N >
struct  NColsBlockXpr< N >
struct  NRowsBlockXpr< N >

Typedefs

typedef Block< Derived,
internal::traits< Derived >
::RowsAtCompileTime, Dynamic,!IsRowMajor > 
ColsBlockXpr
typedef Block< Derived,
internal::traits< Derived >
::RowsAtCompileTime,
1,!IsRowMajor > 
ColXpr
typedef const Block< const
Derived, internal::traits
< Derived >::RowsAtCompileTime,
Dynamic,!IsRowMajor > 
ConstColsBlockXpr
typedef const Block< const
Derived, internal::traits
< Derived >::RowsAtCompileTime,
1,!IsRowMajor > 
ConstColXpr
typedef const Block< const
Derived, Dynamic,
internal::traits< Derived >
::ColsAtCompileTime,
IsRowMajor > 
ConstRowsBlockXpr
typedef const Block< const
Derived, 1, internal::traits
< Derived >::ColsAtCompileTime,
IsRowMajor > 
ConstRowXpr
typedef Block< Derived,
Dynamic, internal::traits
< Derived >::ColsAtCompileTime,
IsRowMajor > 
RowsBlockXpr
typedef Block< Derived,
1, internal::traits< Derived >
::ColsAtCompileTime,
IsRowMajor > 
RowXpr

Functions

Block< Derived > block (Index startRow, Index startCol, Index blockRows, Index blockCols)
template<int BlockRows, int BlockCols>
Block< Derived, BlockRows,
BlockCols > 
block (Index startRow, Index startCol)
Block< Derived > bottomLeftCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
Block< Derived, CRows, CCols > bottomLeftCorner ()
Block< Derived > bottomRightCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
Block< Derived, CRows, CCols > bottomRightCorner ()
RowsBlockXpr bottomRows (Index n)
template<int N>
NRowsBlockXpr< N >::Type bottomRows ()
ColXpr col (Index i)
ColsBlockXpr leftCols (Index n)
template<int N>
NColsBlockXpr< N >::Type leftCols ()
ColsBlockXpr middleCols (Index startCol, Index numCols)
template<int N>
NColsBlockXpr< N >::Type middleCols (Index startCol)
RowsBlockXpr middleRows (Index startRow, Index numRows)
template<int N>
NRowsBlockXpr< N >::Type middleRows (Index startRow)
ColsBlockXpr rightCols (Index n)
template<int N>
NColsBlockXpr< N >::Type rightCols ()
RowXpr row (Index i)
Block< Derived > topLeftCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
Block< Derived, CRows, CCols > topLeftCorner ()
Block< Derived > topRightCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
Block< Derived, CRows, CCols > topRightCorner ()
RowsBlockXpr topRows (Index n)
template<int N>
NRowsBlockXpr< N >::Type topRows ()

Typedef Documentation

typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ColsBlockXpr

Definition at line 38 of file BlockMethods.h.

typedef Block<Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ColXpr

Definition at line 32 of file BlockMethods.h.

typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, Dynamic, !IsRowMajor> ConstColsBlockXpr

Definition at line 39 of file BlockMethods.h.

typedef const Block<const Derived, internal::traits<Derived>::RowsAtCompileTime, 1, !IsRowMajor> ConstColXpr

Definition at line 33 of file BlockMethods.h.

typedef const Block<const Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowsBlockXpr

Definition at line 42 of file BlockMethods.h.

typedef const Block<const Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> ConstRowXpr

Definition at line 36 of file BlockMethods.h.

typedef Block<Derived, Dynamic, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowsBlockXpr

Definition at line 41 of file BlockMethods.h.

typedef Block<Derived, 1, internal::traits<Derived>::ColsAtCompileTime, IsRowMajor> RowXpr

Definition at line 35 of file BlockMethods.h.


Function Documentation

const Block< const Derived > block ( Index  startRow,
Index  startCol,
Index  blockRows,
Index  blockCols 
) [inline]
Returns:
a dynamic-size expression of a block in *this.
Parameters:
startRowthe first row in the block
startColthe first column in the block
blockRowsthe number of rows in the block
blockColsthe number of columns in the block

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.block(1, 1, 2, 2):" << endl << m.block(1, 1, 2, 2) << endl;
m.block(1, 1, 2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

Note:
Even though the returned expression has dynamic size, in the case when it is applied to a fixed-size matrix, it inherits a fixed maximal size, which means that evaluating it does not cause a dynamic memory allocation.
See also:
class Block, block(Index,Index)

This is the const version of block(Index,Index,Index,Index).

Definition at line 69 of file BlockMethods.h.

template<int BlockRows, int BlockCols>
const Block< const Derived, BlockRows, BlockCols > block ( Index  startRow,
Index  startCol 
) [inline]
Returns:
a fixed-size expression of a block in *this.

The template parameters BlockRows and BlockCols are the number of rows and columns in the block.

Parameters:
startRowthe first row in the block
startColthe first column in the block

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.block<2,2>(1,1):" << endl << m.block<2,2>(1,1) << endl;
m.block<2,2>(1,1).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

Note:
since block is a templated member, the keyword template has to be used if the matrix type is also a template parameter:
 m.template block<3,3>(1,1); 
See also:
class Block, block(Index,Index,Index,Index)

This is the const version of block<>(Index, Index).

Definition at line 549 of file BlockMethods.h.

const Block< const Derived > bottomLeftCorner ( Index  cRows,
Index  cCols 
) [inline]
Returns:
a dynamic-size expression of a bottom-left corner of *this.
Parameters:
cRowsthe number of rows in the corner
cColsthe number of columns in the corner

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.bottomLeftCorner(2, 2):" << endl;
cout << m.bottomLeftCorner(2, 2) << endl;
m.bottomLeftCorner(2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomLeftCorner(Index, Index).

Definition at line 229 of file BlockMethods.h.

template<int CRows, int CCols>
const Block< const Derived, CRows, CCols > bottomLeftCorner ( ) [inline]
Returns:
an expression of a fixed-size bottom-left corner of *this.

The template parameters CRows and CCols are the number of rows and columns in the corner.

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.bottomLeftCorner<2,2>():" << endl;
cout << m.bottomLeftCorner<2,2>() << endl;
m.bottomLeftCorner<2,2>().setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomLeftCorner<int, int>().

Definition at line 250 of file BlockMethods.h.

const Block< const Derived > bottomRightCorner ( Index  cRows,
Index  cCols 
) [inline]
Returns:
a dynamic-size expression of a bottom-right corner of *this.
Parameters:
cRowsthe number of rows in the corner
cColsthe number of columns in the corner

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.bottomRightCorner(2, 2):" << endl;
cout << m.bottomRightCorner(2, 2) << endl;
m.bottomRightCorner(2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomRightCorner(Index, Index).

Definition at line 184 of file BlockMethods.h.

template<int CRows, int CCols>
const Block< const Derived, CRows, CCols > bottomRightCorner ( ) [inline]
Returns:
an expression of a fixed-size bottom-right corner of *this.

The template parameters CRows and CCols are the number of rows and columns in the corner.

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.bottomRightCorner<2,2>():" << endl;
cout << m.bottomRightCorner<2,2>() << endl;
m.bottomRightCorner<2,2>().setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomRightCorner<int, int>().

Definition at line 205 of file BlockMethods.h.

ConstRowsBlockXpr bottomRows ( Index  n) [inline]
Returns:
a block consisting of the bottom rows of *this.
Parameters:
nthe number of rows in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.bottomRows(2):" << endl;
cout << a.bottomRows(2) << endl;
a.bottomRows(2).setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomRows(Index).

Definition at line 317 of file BlockMethods.h.

template<int N>
ConstNRowsBlockXpr< N >::Type bottomRows ( ) [inline]
Returns:
a block consisting of the bottom rows of *this.
Template Parameters:
Nthe number of rows in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.bottomRows<2>():" << endl;
cout << a.bottomRows<2>() << endl;
a.bottomRows<2>().setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of bottomRows<int>().

Definition at line 338 of file BlockMethods.h.

ConstColXpr col ( Index  i) [inline]
Returns:
an expression of the i-th column of *this. Note that the numbering starts at 0.

Example:

Matrix3d m = Matrix3d::Identity();
m.col(1) = Vector3d(4,5,6);
cout << m << endl;

Output:

See also:
row(), class Block

This is the const version of col().

Definition at line 567 of file BlockMethods.h.

ConstColsBlockXpr leftCols ( Index  n) [inline]
Returns:
a block consisting of the left columns of *this.
Parameters:
nthe number of columns in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.leftCols(2):" << endl;
cout << a.leftCols(2) << endl;
a.leftCols(2).setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of leftCols(Index).

Definition at line 407 of file BlockMethods.h.

template<int N>
ConstNColsBlockXpr< N >::Type leftCols ( ) [inline]
Returns:
a block consisting of the left columns of *this.
Template Parameters:
Nthe number of columns in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.leftCols<2>():" << endl;
cout << a.leftCols<2>() << endl;
a.leftCols<2>().setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of leftCols<int>().

Definition at line 428 of file BlockMethods.h.

ConstColsBlockXpr middleCols ( Index  startCol,
Index  numCols 
) [inline]
Returns:
a block consisting of a range of columns of *this.
Parameters:
startColthe index of the first column in the block
numColsthe number of columns in the block

Example:

#include <Eigen/Core>
#include <iostream>

using namespace Eigen;
using namespace std;

int main(void)
{
    int const N = 5;
    MatrixXi A(N,N);
    A.setRandom();
    cout << "A =\n" << A << '\n' << endl;
    cout << "A(1..3,:) =\n" << A.middleCols(1,3) << endl;
    return 0;
}

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of middleCols(Index,Index).

Definition at line 496 of file BlockMethods.h.

template<int N>
ConstNColsBlockXpr< N >::Type middleCols ( Index  startCol) [inline]
Returns:
a block consisting of a range of columns of *this.
Template Parameters:
Nthe number of columns in the block
Parameters:
startColthe index of the first column in the block

Example:

#include <Eigen/Core>
#include <iostream>

using namespace Eigen;
using namespace std;

int main(void)
{
    int const N = 5;
    MatrixXi A(N,N);
    A.setRandom();
    cout << "A =\n" << A << '\n' << endl;
    cout << "A(:,1..3) =\n" << A.middleCols<3>(1) << endl;
    return 0;
}

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of middleCols<int>().

Definition at line 518 of file BlockMethods.h.

ConstRowsBlockXpr middleRows ( Index  startRow,
Index  numRows 
) [inline]
Returns:
a block consisting of a range of rows of *this.
Parameters:
startRowthe index of the first row in the block
numRowsthe number of rows in the block

Example:

#include <Eigen/Core>
#include <iostream>

using namespace Eigen;
using namespace std;

int main(void)
{
    int const N = 5;
    MatrixXi A(N,N);
    A.setRandom();
    cout << "A =\n" << A << '\n' << endl;
    cout << "A(2..3,:) =\n" << A.middleRows(2,2) << endl;
    return 0;
}

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of middleRows(Index,Index).

Definition at line 362 of file BlockMethods.h.

template<int N>
ConstNRowsBlockXpr< N >::Type middleRows ( Index  startRow) [inline]
Returns:
a block consisting of a range of rows of *this.
Template Parameters:
Nthe number of rows in the block
Parameters:
startRowthe index of the first row in the block

Example:

#include <Eigen/Core>
#include <iostream>

using namespace Eigen;
using namespace std;

int main(void)
{
    int const N = 5;
    MatrixXi A(N,N);
    A.setRandom();
    cout << "A =\n" << A << '\n' << endl;
    cout << "A(1..3,:) =\n" << A.middleRows<3>(1) << endl;
    return 0;
}

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of middleRows<int>().

Definition at line 384 of file BlockMethods.h.

ConstColsBlockXpr rightCols ( Index  n) [inline]
Returns:
a block consisting of the right columns of *this.
Parameters:
nthe number of columns in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.rightCols(2):" << endl;
cout << a.rightCols(2) << endl;
a.rightCols(2).setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of rightCols(Index).

Definition at line 451 of file BlockMethods.h.

template<int N>
ConstNColsBlockXpr< N >::Type rightCols ( ) [inline]
Returns:
a block consisting of the right columns of *this.
Template Parameters:
Nthe number of columns in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.rightCols<2>():" << endl;
cout << a.rightCols<2>() << endl;
a.rightCols<2>().setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of rightCols<int>().

Definition at line 472 of file BlockMethods.h.

ConstRowXpr row ( Index  i) [inline]
Returns:
an expression of the i-th row of *this. Note that the numbering starts at 0.

Example:

Matrix3d m = Matrix3d::Identity();
m.row(1) = Vector3d(4,5,6);
cout << m << endl;

Output:

See also:
col(), class Block

This is the const version of row().

Definition at line 584 of file BlockMethods.h.

const Block< const Derived > topLeftCorner ( Index  cRows,
Index  cCols 
) [inline]
Returns:
a dynamic-size expression of a top-left corner of *this.
Parameters:
cRowsthe number of rows in the corner
cColsthe number of columns in the corner

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.topLeftCorner(2, 2):" << endl;
cout << m.topLeftCorner(2, 2) << endl;
m.topLeftCorner(2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topLeftCorner(Index, Index).

Definition at line 139 of file BlockMethods.h.

template<int CRows, int CCols>
const Block< const Derived, CRows, CCols > topLeftCorner ( ) [inline]
Returns:
an expression of a fixed-size top-left corner of *this.

The template parameters CRows and CCols are the number of rows and columns in the corner.

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.topLeftCorner<2,2>():" << endl;
cout << m.topLeftCorner<2,2>() << endl;
m.topLeftCorner<2,2>().setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topLeftCorner<int, int>().

Definition at line 160 of file BlockMethods.h.

const Block< const Derived > topRightCorner ( Index  cRows,
Index  cCols 
) [inline]
Returns:
a dynamic-size expression of a top-right corner of *this.
Parameters:
cRowsthe number of rows in the corner
cColsthe number of columns in the corner

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.topRightCorner(2, 2):" << endl;
cout << m.topRightCorner(2, 2) << endl;
m.topRightCorner(2, 2).setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topRightCorner(Index, Index).

Definition at line 93 of file BlockMethods.h.

template<int CRows, int CCols>
const Block< const Derived, CRows, CCols > topRightCorner ( ) [inline]
Returns:
an expression of a fixed-size top-right corner of *this.

The template parameters CRows and CCols are the number of rows and columns in the corner.

Example:

Matrix4i m = Matrix4i::Random();
cout << "Here is the matrix m:" << endl << m << endl;
cout << "Here is m.topRightCorner<2,2>():" << endl;
cout << m.topRightCorner<2,2>() << endl;
m.topRightCorner<2,2>().setZero();
cout << "Now the matrix m is:" << endl << m << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topRightCorner<int, int>().

Definition at line 114 of file BlockMethods.h.

ConstRowsBlockXpr topRows ( Index  n) [inline]
Returns:
a block consisting of the top rows of *this.
Parameters:
nthe number of rows in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.topRows(2):" << endl;
cout << a.topRows(2) << endl;
a.topRows(2).setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topRows(Index).

Definition at line 273 of file BlockMethods.h.

template<int N>
ConstNRowsBlockXpr< N >::Type topRows ( ) [inline]
Returns:
a block consisting of the top rows of *this.
Template Parameters:
Nthe number of rows in the block

Example:

Array44i a = Array44i::Random();
cout << "Here is the array a:" << endl << a << endl;
cout << "Here is a.topRows<2>():" << endl;
cout << a.topRows<2>() << endl;
a.topRows<2>().setZero();
cout << "Now the array a is:" << endl << a << endl;

Output:

See also:
class Block, block(Index,Index,Index,Index)

This is the const version of topRows<int>().

Definition at line 294 of file BlockMethods.h.



libicr
Author(s): Robert Krug
autogenerated on Mon Jan 6 2014 11:34:05