MOAB  4.9.3pre
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  NColsBlockXpr< N >
struct  ConstNColsBlockXpr< N >
struct  NRowsBlockXpr< N >
struct  ConstNRowsBlockXpr< N >
struct  FixedBlockXpr< Rows, Cols >
struct  ConstFixedBlockXpr< Rows, Cols >
struct  FixedSegmentReturnType< Size >
struct  ConstFixedSegmentReturnType< Size >

Typedefs

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

Functions

EIGEN_DEVICE_FUNC BlockXpr block (Index startRow, Index startCol, Index blockRows, Index blockCols)
EIGEN_DEVICE_FUNC BlockXpr topRightCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
FixedBlockXpr< CRows, CCols >
::Type 
topRightCorner ()
EIGEN_DEVICE_FUNC BlockXpr topLeftCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
FixedBlockXpr< CRows, CCols >
::Type 
topLeftCorner ()
EIGEN_DEVICE_FUNC BlockXpr bottomRightCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
FixedBlockXpr< CRows, CCols >
::Type 
bottomRightCorner ()
EIGEN_DEVICE_FUNC BlockXpr bottomLeftCorner (Index cRows, Index cCols)
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC
FixedBlockXpr< CRows, CCols >
::Type 
bottomLeftCorner ()
EIGEN_DEVICE_FUNC RowsBlockXpr topRows (Index n)
EIGEN_DEVICE_FUNC RowsBlockXpr bottomRows (Index n)
EIGEN_DEVICE_FUNC RowsBlockXpr middleRows (Index startRow, Index n)
EIGEN_DEVICE_FUNC ColsBlockXpr leftCols (Index n)
EIGEN_DEVICE_FUNC ColsBlockXpr rightCols (Index n)
EIGEN_DEVICE_FUNC ColsBlockXpr middleCols (Index startCol, Index numCols)
template<int NRows, int NCols>
EIGEN_DEVICE_FUNC
FixedBlockXpr< NRows, NCols >
::Type 
block (Index startRow, Index startCol)
EIGEN_DEVICE_FUNC ColXpr col (Index i)
EIGEN_DEVICE_FUNC RowXpr row (Index i)
EIGEN_DEVICE_FUNC SegmentReturnType segment (Index start, Index n)
EIGEN_DEVICE_FUNC SegmentReturnType head (Index n)
EIGEN_DEVICE_FUNC SegmentReturnType tail (Index n)

Typedef Documentation

typedef Block<Derived> BlockXpr

expression of a block

Definition at line 32 of file BlockMethods.h.

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

expression type of a block of whole columns

Definition at line 20 of file BlockMethods.h.

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

expression type of a column

Definition at line 14 of file BlockMethods.h.

typedef const Block<const Derived> ConstBlockXpr

Definition at line 33 of file BlockMethods.h.

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

Definition at line 21 of file BlockMethods.h.

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

Definition at line 15 of file BlockMethods.h.

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

Definition at line 24 of file BlockMethods.h.

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

Definition at line 18 of file BlockMethods.h.

typedef const VectorBlock<const Derived> ConstSegmentReturnType

Definition at line 39 of file BlockMethods.h.

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

expression type of a block of whole rows

Definition at line 23 of file BlockMethods.h.

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

expression type of a row

Definition at line 17 of file BlockMethods.h.

typedef VectorBlock<Derived> SegmentReturnType

Definition at line 38 of file BlockMethods.h.


Function Documentation

const ConstFixedBlockXpr< NRows, NCols >::Type 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:

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).

Returns:
an expression of a block in *this.
Template Parameters:
NRowsnumber of rows in block as specified at compile-time
NColsnumber of columns in block as specified at compile-time
Parameters:
startRowthe first row in the block
startColthe first column in the block
blockRowsnumber of rows in block as specified at run-time
blockColsnumber of columns in block as specified at run-time

This function is mainly useful for blocks where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, blockRows should equal NRows unless NRows is Dynamic, and the same for the number of columns.

Example:

Output:

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

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

Definition at line 62 of file BlockMethods.h.

{
  return BlockXpr(derived(), startRow, startCol, blockRows, blockCols);
}
template<int NRows, int NCols>
EIGEN_DEVICE_FUNC const ConstFixedBlockXpr< NRows, NCols >::Type block ( Index  startRow,
Index  startCol 
) [inline]
Returns:
a fixed-size expression of a block in *this.

The template parameters NRows and NCols are the number of rows and columns in the block.

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

Example:

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 728 of file BlockMethods.h.

{
  return typename FixedBlockXpr<NRows,NCols>::Type(derived(), startRow, startCol);
}
const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Returns:
an expression of a bottom-left corner of *this.
Template Parameters:
CRowsnumber of rows in corner as specified at compile-time
CColsnumber of columns in corner as specified at compile-time
Parameters:
cRowsnumber of rows in corner as specified at run-time
cColsnumber of columns in corner as specified at run-time

This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.

Example:

Output:

See also:
class Block

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

Definition at line 326 of file BlockMethods.h.

{
  return BlockXpr(derived(), rows() - cRows, 0, cRows, cCols);
}
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Definition at line 349 of file BlockMethods.h.

{
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, 0);
}
const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Returns:
an expression of a bottom-right corner of *this.
Template Parameters:
CRowsnumber of rows in corner as specified at compile-time
CColsnumber of columns in corner as specified at compile-time
Parameters:
cRowsnumber of rows in corner as specified at run-time
cColsnumber of columns in corner as specified at run-time

This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.

Example:

Output:

See also:
class Block

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

Definition at line 247 of file BlockMethods.h.

{
  return BlockXpr(derived(), rows() - cRows, cols() - cCols, cRows, cCols);
}
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Definition at line 270 of file BlockMethods.h.

{
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), rows() - CRows, cols() - CCols);
}
EIGEN_DEVICE_FUNC ConstNRowsBlockXpr< N >::Type bottomRows ( Index  n = N) [inline]
Returns:
a block consisting of the bottom rows of *this.
Parameters:
nthe number of rows in the block

Example:

Output:

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

This is the const version of bottomRows(Index).

Returns:
a block consisting of the bottom rows of *this.
Template Parameters:
Nthe number of rows in the block as specified at compile-time
Parameters:
nthe number of rows in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 456 of file BlockMethods.h.

{
  return RowsBlockXpr(derived(), rows() - n, 0, n, cols());
}
EIGEN_DEVICE_FUNC ConstColXpr col ( Index  i) [inline]
Returns:
an expression of the i-th column of *this. Note that the numbering starts at 0.

Example:

Output:

See also:
row(), class Block

This is the const version of col().

Definition at line 782 of file BlockMethods.h.

{
  return ColXpr(derived(), i);
}
EIGEN_DEVICE_FUNC ConstFixedSegmentReturnType< N >::Type head ( Index  n = N) [inline]
Returns:
a dynamic-size expression of the first coefficients of *this.
Parameters:
nthe number of coefficients in the segment

Example:

Output:

Note:
Even though the returned expression has dynamic size, in the case when it is applied to a fixed-size vector, 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 head(Index).

Returns:
a fixed-size expression of the first coefficients of *this.
Template Parameters:
Nthe number of coefficients in the segment as specified at compile-time
Parameters:
nthe number of coefficients in the segment as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

See also:
class Block

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

Definition at line 861 of file BlockMethods.h.

{
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
  return SegmentReturnType(derived(), 0, n);
}
EIGEN_DEVICE_FUNC ConstNColsBlockXpr< N >::Type leftCols ( Index  n = N) [inline]
Returns:
a block consisting of the left columns of *this.
Parameters:
nthe number of columns in the block

Example:

Output:

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

This is the const version of leftCols(Index).

Returns:
a block consisting of the left columns of *this.
Template Parameters:
Nthe number of columns in the block as specified at compile-time
Parameters:
nthe number of columns in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 562 of file BlockMethods.h.

{
  return ColsBlockXpr(derived(), 0, 0, rows(), n);
}
EIGEN_DEVICE_FUNC ConstNColsBlockXpr< N >::Type middleCols ( Index  startCol,
Index  n = N 
) [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:

Output:

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

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

Returns:
a block consisting of a range of columns of *this.
Template Parameters:
Nthe number of columns in the block as specified at compile-time
Parameters:
startColthe index of the first column in the block
nthe number of columns in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 667 of file BlockMethods.h.

{
  return ColsBlockXpr(derived(), 0, startCol, rows(), numCols);
}
EIGEN_DEVICE_FUNC ConstNRowsBlockXpr< N >::Type middleRows ( Index  startRow,
Index  n = N 
) [inline]
Returns:
a block consisting of a range of rows of *this.
Parameters:
startRowthe index of the first row in the block
nthe number of rows in the block

Example:

Output:

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

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

Returns:
a block consisting of a range of rows of *this.
Template Parameters:
Nthe number of rows in the block as specified at compile-time
Parameters:
startRowthe index of the first row in the block
nthe number of rows in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 509 of file BlockMethods.h.

{
  return RowsBlockXpr(derived(), startRow, 0, n, cols());
}
EIGEN_DEVICE_FUNC ConstNColsBlockXpr< N >::Type rightCols ( Index  n = N) [inline]
Returns:
a block consisting of the right columns of *this.
Parameters:
nthe number of columns in the block

Example:

Output:

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

This is the const version of rightCols(Index).

Returns:
a block consisting of the right columns of *this.
Template Parameters:
Nthe number of columns in the block as specified at compile-time
Parameters:
nthe number of columns in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 614 of file BlockMethods.h.

{
  return ColsBlockXpr(derived(), 0, cols() - n, rows(), n);
}
EIGEN_DEVICE_FUNC ConstRowXpr row ( Index  i) [inline]
Returns:
an expression of the i-th row of *this. Note that the numbering starts at 0.

Example:

Output:

See also:
col(), class Block

This is the const version of row().

Definition at line 801 of file BlockMethods.h.

{
  return RowXpr(derived(), i);
}
EIGEN_DEVICE_FUNC ConstFixedSegmentReturnType< N >::Type segment ( Index  start,
Index  n = N 
) [inline]
Returns:
a dynamic-size expression of a segment (i.e. a vector block) in *this.
Parameters:
startthe first coefficient in the segment
nthe number of coefficients in the segment

Example:

Output:

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

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

Returns:
a fixed-size expression of a segment (i.e. a vector block) in *this
Template Parameters:
Nthe number of coefficients in the segment as specified at compile-time
Parameters:
startthe index of the first element in the segment
nthe number of coefficients in the segment as specified at compile-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

See also:
class Block

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

Definition at line 830 of file BlockMethods.h.

{
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
  return SegmentReturnType(derived(), start, n);
}
EIGEN_DEVICE_FUNC ConstFixedSegmentReturnType< N >::Type tail ( Index  n = N) [inline]
Returns:
a dynamic-size expression of the last coefficients of *this.
Parameters:
nthe number of coefficients in the segment

Example:

Output:

Note:
Even though the returned expression has dynamic size, in the case when it is applied to a fixed-size vector, 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 tail(Index).

Returns:
a fixed-size expression of the last coefficients of *this.
Template Parameters:
Nthe number of coefficients in the segment as specified at compile-time
Parameters:
nthe number of coefficients in the segment as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

See also:
class Block

This is the const version of tail<int>.

Definition at line 891 of file BlockMethods.h.

{
  EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
  return SegmentReturnType(derived(), this->size() - n, n);
}
const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Returns:
an expression of a top-left corner of *this.
Template Parameters:
CRowsnumber of rows in corner as specified at compile-time
CColsnumber of columns in corner as specified at compile-time
Parameters:
cRowsnumber of rows in corner as specified at run-time
cColsnumber of columns in corner as specified at run-time

This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.

Example:

Output:

See also:
class Block

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

Definition at line 168 of file BlockMethods.h.

{
  return BlockXpr(derived(), 0, 0, cRows, cCols);
}
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Definition at line 191 of file BlockMethods.h.

{
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, 0);
}
const ConstFixedBlockXpr< CRows, CCols >::Type 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:

Output:

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

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

Returns:
an expression of a top-right corner of *this.
Template Parameters:
CRowsnumber of rows in corner as specified at compile-time
CColsnumber of columns in corner as specified at compile-time
Parameters:
cRowsnumber of rows in corner as specified at run-time
cColsnumber of columns in corner as specified at run-time

This function is mainly useful for corners where the number of rows is specified at compile-time and the number of columns is specified at run-time, or vice versa. The compile-time and run-time information should not contradict. In other words, cRows should equal CRows unless CRows is Dynamic, and the same for the number of columns.

Example:

Output:

See also:
class Block

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

Definition at line 88 of file BlockMethods.h.

{
  return BlockXpr(derived(), 0, cols() - cCols, cRows, cCols);
}
template<int CRows, int CCols>
EIGEN_DEVICE_FUNC const ConstFixedBlockXpr< CRows, CCols >::Type topRightCorner ( ) [inline]
Returns:
an expression of a fixed-size top-right corner of *this.
Template Parameters:
CRowsthe number of rows in the corner
CColsthe number of columns in the corner

Example:

Output:

See also:
class Block, block<int,int>(Index,Index)

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

Definition at line 112 of file BlockMethods.h.

{
  return typename FixedBlockXpr<CRows,CCols>::Type(derived(), 0, cols() - CCols);
}
EIGEN_DEVICE_FUNC ConstNRowsBlockXpr< N >::Type topRows ( Index  n = N) [inline]
Returns:
a block consisting of the top rows of *this.
Parameters:
nthe number of rows in the block

Example:

Output:

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

This is the const version of topRows(Index).

Returns:
a block consisting of the top rows of *this.
Template Parameters:
Nthe number of rows in the block as specified at compile-time
Parameters:
nthe number of rows in the block as specified at run-time

The compile-time and run-time information should not contradict. In other words, n should equal N unless N is Dynamic.

Example:

Output:

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

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

Definition at line 404 of file BlockMethods.h.

{
  return RowsBlockXpr(derived(), 0, 0, n, cols());
}
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines