Skip to content

Commit 66b4ade

Browse files
committed
revert complexes_matrix<> for now
1 parent f7ead22 commit 66b4ade

File tree

2 files changed

+5
-46
lines changed

2 files changed

+5
-46
lines changed

cpp11test/src/test-matrix.cpp

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ context("matrix-C++") {
2424
expect_true(x[1].size() == 2);
2525
expect_true(x[1].stride() == 5);
2626
}
27-
2827
test_that("matrix dim attributes are correct for read only matrices") {
2928
auto getExportedValue = cpp11::package("base")["getExportedValue"];
3029

@@ -42,7 +41,6 @@ context("matrix-C++") {
4241
expect_true(x[1].size() == 61);
4342
expect_true(x[1].stride() == 87);
4443
}
45-
4644
test_that("matrix<by_column> attributes are correct") {
4745
cpp11::doubles_matrix<cpp11::by_column> x(getExportedValue("datasets", "volcano"));
4846

@@ -158,38 +156,4 @@ context("matrix-C++") {
158156
cpp11::writable::doubles_matrix<cpp11::by_row> x(5, 2);
159157
expect_error(cpp11::writable::integers_matrix<cpp11::by_column>(x));
160158
}
161-
162-
test_that("complex matrix can be created, filled, and copied") {
163-
cpp11::writable::complexes_matrix<cpp11::by_row> x(5, 2);
164-
165-
for (int i = 0; i < 5; ++i) {
166-
for (int j = 0; j < 2; ++j) {
167-
x(i, j) = std::complex<double>(i, j);
168-
}
169-
}
170-
171-
cpp11::writable::complexes_matrix<cpp11::by_column> y(5, 2);
172-
173-
for (int i = 0; i < 5; ++i) {
174-
for (int j = 0; j < 2; ++j) {
175-
y(i, j) = std::complex<double>(i, j);
176-
}
177-
}
178-
179-
cpp11::complexes_matrix<> xc = x;
180-
expect_true(x.nrow() == xc.nrow());
181-
expect_true(x.ncol() == xc.ncol());
182-
183-
cpp11::complexes_matrix<> yc = y;
184-
expect_true(y.nrow() == yc.nrow());
185-
expect_true(y.ncol() == yc.ncol());
186-
187-
// Pacha: I need to figure out how to compare complexes with testthat
188-
// for (int i = 0; i < 5; ++i) {
189-
// for (int j = 0; j < 2; ++j) {
190-
// expect_true(x(i, j) == xc(i, j));
191-
// expect_true(y(i, j) == yc(i, j));
192-
// }
193-
// }
194-
}
195159
}

inst/include/cpp11/matrix.hpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,11 @@
33
#include <iterator>
44
#include <string> // for string
55

6-
#include "cpp11/R.hpp" // for SEXP, SEXPREC, R_xlen_t, INT...
7-
#include "cpp11/r_bool.hpp" // for r_bool
8-
#include "cpp11/r_complex.hpp" // for r_complex
9-
#include "cpp11/r_string.hpp" // for r_string
10-
#include "cpp11/r_vector.hpp" // for r_vector
11-
#include "cpp11/sexp.hpp" // for sexp
6+
#include "cpp11/R.hpp" // for SEXP, SEXPREC, R_xlen_t, INT...
7+
#include "cpp11/r_bool.hpp" // for r_bool
8+
#include "cpp11/r_string.hpp" // for r_string
9+
#include "cpp11/r_vector.hpp" // for r_vector
10+
#include "cpp11/sexp.hpp" // for sexp
1211

1312
namespace cpp11 {
1413

@@ -215,8 +214,6 @@ template <typename S = by_column>
215214
using logicals_matrix = matrix<r_vector<r_bool>, r_bool, S>;
216215
template <typename S = by_column>
217216
using strings_matrix = matrix<r_vector<r_string>, r_string, S>;
218-
template <typename S = by_column>
219-
using complexes_matrix = matrix<r_vector<r_complex>, r_complex, S>;
220217

221218
namespace writable {
222219
template <typename S = by_column>
@@ -227,8 +224,6 @@ template <typename S = by_column>
227224
using logicals_matrix = matrix<r_vector<r_bool>, r_vector<r_bool>::proxy, S>;
228225
template <typename S = by_column>
229226
using strings_matrix = matrix<r_vector<r_string>, r_vector<r_string>::proxy, S>;
230-
template <typename S = by_column>
231-
using complexes_matrix = matrix<r_vector<r_complex>, r_vector<r_complex>::proxy, S>;
232227
} // namespace writable
233228

234229
// TODO: Add tests for Matrix class

0 commit comments

Comments
 (0)