forked from arrayfire/arrayfire
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatrixmarket.cpp
More file actions
29 lines (25 loc) · 913 Bytes
/
matrixmarket.cpp
File metadata and controls
29 lines (25 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*******************************************************
* Copyright (c) 2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include <gtest/gtest.h>
#include <testHelpers.hpp>
TEST(Sparse, ReadRealMTXFile) {
af::array out;
std::string file(MTX_TEST_DIR "HB/bcsstm02/bcsstm02.mtx");
ASSERT_TRUE(mtxReadSparseMatrix(out, file.c_str()));
}
TEST(Sparse, ReadComplexMTXFile) {
af::array out;
std::string file(MTX_TEST_DIR "HB/young4c/young4c.mtx");
ASSERT_TRUE(mtxReadSparseMatrix(out, file.c_str()));
}
TEST(Sparse, FailIntegerMTXRead) {
af::array out;
std::string file(MTX_TEST_DIR "JGD_Kocay/Trec4/Trec4.mtx");
ASSERT_FALSE(mtxReadSparseMatrix(out, file.c_str()));
}