diff --git a/matrix/bulk_operate.cpp b/matrix/bulk_operate.cpp index 744d57f6..4a3a6bb2 100644 --- a/matrix/bulk_operate.cpp +++ b/matrix/bulk_operate.cpp @@ -84,7 +84,7 @@ class basic_uops_impl: public basic_uops return "abs"; } OutType operator()(const InType &e) const { - return (OutType) std::abs(e); + return e < 0 ? ((OutType) -e) : ((OutType) e); } }; diff --git a/matrix/data_io.cpp b/matrix/data_io.cpp index 4deb389e..09919171 100644 --- a/matrix/data_io.cpp +++ b/matrix/data_io.cpp @@ -275,7 +275,7 @@ std::shared_ptr gz_file_io::read_bytes( if (ret <= 0) { if (ret < 0 || !gzeof(f)) { BOOST_LOG_TRIVIAL(fatal) << gzerror(f, &ret); - return std::unique_ptr(); + return std::unique_ptr(); } } read_bytes += ret; @@ -402,7 +402,7 @@ static size_t parse_lines(std::shared_ptr line_buf, size_t size, } if (line - buf_start < (ssize_t) size) lines.push_back(std::string(line)); - + return parser.parse(lines, df); }