final fixes and updates for alpha3

This commit is contained in:
Benoit Jacob
2008-01-13 23:38:48 +00:00
parent 57d7b7d97b
commit 183bf54d27
7 changed files with 58 additions and 48 deletions

View File

@@ -268,10 +268,13 @@ template<typename Scalar, typename Derived>
Block<Derived> MatrixBase<Scalar, Derived>
::corner(CornerType type, int cRows, int cCols)
{
if(type == TopLeft) return Block<Derived>(ref(), 0, 0, cRows, cCols);
else if(type == TopRight) return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols);
else if(type == BottomLeft) return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols);
else if(type == BottomRight)
if(type == TopLeft)
return Block<Derived>(ref(), 0, 0, cRows, cCols);
else if(type == TopRight)
return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols);
else if(type == BottomLeft)
return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols);
else
return Block<Derived>(ref(), rows() - cRows, cols() - cCols, cRows, cCols);
}
@@ -280,10 +283,13 @@ template<typename Scalar, typename Derived>
const Block<Derived> MatrixBase<Scalar, Derived>
::corner(CornerType type, int cRows, int cCols) const
{
if(type == TopLeft) return Block<Derived>(ref(), 0, 0, cRows, cCols);
else if(type == TopRight) return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols);
else if(type == BottomLeft) return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols);
else if(type == BottomRight)
if(type == TopLeft)
return Block<Derived>(ref(), 0, 0, cRows, cCols);
else if(type == TopRight)
return Block<Derived>(ref(), 0, cols() - cCols, cRows, cCols);
else if(type == BottomLeft)
return Block<Derived>(ref(), rows() - cRows, 0, cRows, cCols);
else
return Block<Derived>(ref(), rows() - cRows, cols() - cCols, cRows, cCols);
}