Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80550276
matrix.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Sep 1, 08:34
Size
395 B
Mime Type
text/x-c
Expires
Tue, Sep 3, 08:34 (2 d)
Engine
blob
Format
Raw Data
Handle
20318542
Attached To
R12662 PHPC-graded_hw_1
matrix.cc
View Options
#include "matrix.hh"
#include "matrix_coo.hh"
#include <iostream>
#include <string>
void
Matrix
::
read
(
const
std
::
string
&
fn
)
{
MatrixCOO
mat
;
mat
.
read
(
fn
);
resize
(
mat
.
m
(),
mat
.
n
());
for
(
int
z
=
0
;
z
<
mat
.
nz
();
++
z
)
{
auto
i
=
mat
.
irn
[
z
];
auto
j
=
mat
.
jcn
[
z
];
auto
a
=
mat
.
a
[
z
];
m_a
[
i
*
m_n
+
j
]
=
a
;
if
(
mat
.
is_sym
())
{
m_a
[
j
*
m_n
+
i
]
=
a
;
}
}
}
Event Timeline
Log In to Comment