Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
8bf2a0ae
There was an error fetching the commit references. Please try again later.
Commit
8bf2a0ae
authored
5 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Fixed matrix reader to work with empty lines in MTX files.
parent
09af2ea2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/Matrices/MatrixReader_impl.h
+7
-7
7 additions, 7 deletions
src/TNL/Matrices/MatrixReader_impl.h
with
7 additions
and
7 deletions
src/TNL/Matrices/MatrixReader_impl.h
+
7
−
7
View file @
8bf2a0ae
...
...
@@ -17,7 +17,7 @@
#include
<TNL/Matrices/MatrixReader.h>
namespace
TNL
{
namespace
Matrices
{
namespace
Matrices
{
template
<
typename
Matrix
>
bool
MatrixReader
<
Matrix
>::
readMtxFile
(
const
String
&
fileName
,
...
...
@@ -68,7 +68,7 @@ bool MatrixReader< Matrix >::readMtxFileHostMatrix( std::istream& file,
if
(
!
computeCompressedRowLengthsFromMtxFile
(
file
,
rowLengths
,
columns
,
rows
,
symmetricMatrix
,
verbose
)
)
return
false
;
matrix
.
setCompressedRowLengths
(
rowLengths
);
if
(
!
readMatrixElementsFromMtxFile
(
file
,
matrix
,
symmetricMatrix
,
verbose
,
symReader
)
)
...
...
@@ -271,7 +271,7 @@ bool MatrixReader< Matrix >::computeCompressedRowLengthsFromMtxFile( std::istrea
timer
.
start
();
while
(
std
::
getline
(
file
,
line
)
)
{
if
(
line
[
0
]
==
'%'
)
continue
;
if
(
!
line
.
getSize
()
||
line
[
0
]
==
'%'
)
continue
;
if
(
!
dimensionsLine
)
{
dimensionsLine
=
true
;
...
...
@@ -340,10 +340,10 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
IndexType
processedElements
(
0
);
Timer
timer
;
timer
.
start
();
while
(
std
::
getline
(
file
,
line
)
)
{
if
(
line
[
0
]
==
'%'
)
continue
;
if
(
!
line
.
getSize
()
||
line
[
0
]
==
'%'
)
continue
;
if
(
!
dimensionsLine
)
{
dimensionsLine
=
true
;
...
...
@@ -371,7 +371,7 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
processedElements
++
;
}
}
file
.
clear
();
long
int
fileSize
=
file
.
tellg
();
timer
.
stop
();
...
...
@@ -379,7 +379,7 @@ bool MatrixReader< Matrix >::readMatrixElementsFromMtxFile( std::istream& file,
std
::
cout
<<
" Reading the matrix elements ... "
<<
processedElements
<<
" / "
<<
matrix
.
getNumberOfMatrixElements
()
<<
" -> "
<<
timer
.
getRealTime
()
<<
" sec. i.e. "
<<
fileSize
/
(
timer
.
getRealTime
()
*
(
1
<<
20
))
<<
"MB/s."
<<
std
::
endl
;
return
true
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment