Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Nektar
Nektar
Commits
14a1129f
Commit
14a1129f
authored
Jun 28, 2017
by
Dave Moxey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linear algebra block transpose ASSERTL2
parent
b8637fa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
24 deletions
+32
-24
library/LibUtilities/LinearAlgebra/BlockMatrix.cpp
library/LibUtilities/LinearAlgebra/BlockMatrix.cpp
+32
-24
No files found.
library/LibUtilities/LinearAlgebra/BlockMatrix.cpp
View file @
14a1129f
...
...
@@ -166,12 +166,14 @@ namespace Nektar
const
typename
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
InnerType
*
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
GetBlockPtr
(
unsigned
int
row
,
unsigned
int
column
)
const
{
ASSERTL2
(
row
<
m_numberOfBlockRows
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
column
<
m_numberOfBlockColumns
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
row
<
m_numberOfBlockRows
:
row
<
m_numberOfBlockColumns
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
column
<
m_numberOfBlockColumns
:
column
<
m_numberOfBlockColumns
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
int
x
=
CalculateBlockIndex
(
row
,
column
);
if
(
x
==
-
1
)
{
...
...
@@ -187,12 +189,14 @@ namespace Nektar
boost
::
shared_ptr
<
const
typename
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
InnerType
>
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
GetBlock
(
unsigned
int
row
,
unsigned
int
column
)
const
{
ASSERTL2
(
row
<
m_numberOfBlockRows
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
column
<
m_numberOfBlockColumns
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
row
<
m_numberOfBlockRows
:
row
<
m_numberOfBlockColumns
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
column
<
m_numberOfBlockColumns
:
column
<
m_numberOfBlockRows
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
int
x
=
CalculateBlockIndex
(
row
,
column
);
if
(
x
<
0
)
{
...
...
@@ -208,12 +212,14 @@ namespace Nektar
boost
::
shared_ptr
<
typename
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
InnerType
>&
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
GetBlock
(
unsigned
int
row
,
unsigned
int
column
)
{
ASSERTL2
(
row
<
m_numberOfBlockRows
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
column
<
m_numberOfBlockColumns
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
row
<
m_numberOfBlockRows
:
row
<
m_numberOfBlockColumns
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
column
<
m_numberOfBlockColumns
:
column
<
m_numberOfBlockRows
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
int
x
=
CalculateBlockIndex
(
row
,
column
);
if
(
x
==
-
1
)
{
...
...
@@ -228,12 +234,14 @@ namespace Nektar
template
<
typename
DataType
,
typename
InnerMatrixType
>
void
NekMatrix
<
NekMatrix
<
DataType
,
InnerMatrixType
>
,
BlockMatrixTag
>::
SetBlock
(
unsigned
int
row
,
unsigned
int
column
,
boost
::
shared_ptr
<
InnerType
>&
m
)
{
ASSERTL2
(
row
<
m_numberOfBlockRows
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
column
<
m_numberOfBlockColumns
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
row
<
m_numberOfBlockRows
:
row
<
m_numberOfBlockColumns
,
std
::
string
(
"Row "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
row
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockRows
)
+
std
::
string
(
" rows"
));
ASSERTL2
(
this
->
GetTransposeFlag
()
==
'N'
?
column
<
m_numberOfBlockColumns
:
column
<
m_numberOfBlockRows
,
std
::
string
(
"Column "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
column
)
+
std
::
string
(
" requested in a block matrix with a maximum of "
)
+
boost
::
lexical_cast
<
std
::
string
>
(
m_numberOfBlockColumns
)
+
std
::
string
(
" columns"
));
m_data
[
CalculateBlockIndex
(
row
,
column
)]
=
InnerType
::
CreateWrapper
(
m
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment