Commit 41dc6375 authored by Michael Tesch's avatar Michael Tesch
Browse files

changes to bump fmt lib to 7.1.3

parent 272b1245
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -3,12 +3,15 @@
#
cmake_minimum_required (VERSION 3.1)
project (cppduals
  VERSION 0.5.1
  VERSION 0.5.2
  LANGUAGES C CXX
  )
include (GNUInstallDirs)

set (CMAKE_CXX_STANDARD 11 CACHE STRING "Which C++ standard to test against.")
if (NOT CMAKE_CXX_STANDARD)
  set (CMAKE_CXX_STANDARD 14 CACHE STRING "Which C++ standard to test against.")
endif()
message (STATUS "CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
set (CMAKE_CXX_STANDARD_REQUIRED ON)
set (CMAKE_DISABLE_IN_SOURCE_BUILD ON)
if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+11 −0
Original line number Diff line number Diff line
@@ -299,6 +299,17 @@ thus licensed under [MPL-2](http://www.mozilla.org/MPL/2.0/FAQ.html) .
ChangeLog
=========

v0.5.2
======

- change optional libfmt print support to fmt 7.1.3 (from 6.x)
- change default build standard to c++14.

v0.5.1
======

- packaging cleanup

v0.5.0
======

+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
//
// Copyright (C) 2010 Gael Guennebaud <gael.guennebaud@inria.fr>
// Copyright (C) 2010 Konstantinos Margaritis <markos@freevec.org>
// Copyright (C) 2021 Michael Tesch <tesch1@gmail.com>
//
// This Source Code Form is subject to the terms of the Mozilla
// Public License v. 2.0. If a copy of the MPL was not distributed
+21 −18
Original line number Diff line number Diff line
@@ -1254,12 +1254,13 @@ struct fmt::formatter<duals::dual<T>,Char> : public fmt::formatter<T,Char>
{
  typedef fmt::formatter<T,Char> base;
  enum style { expr, star, pair } style_ = expr;
  internal::dynamic_format_specs<Char> specs_;
  fmt::detail::dynamic_format_specs<Char> specs_;
  FMT_CONSTEXPR auto parse(format_parse_context & ctx) -> decltype(ctx.begin()) {
    using handler_type = internal::dynamic_specs_handler<format_parse_context>;
    auto type = internal::type_constant<T, Char>::value;
    internal::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
    using handler_type = fmt::detail::dynamic_specs_handler<format_parse_context>;
    auto type = fmt::detail::type_constant<T, Char>::value;
    fmt::detail::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
    auto it = ctx.begin();
    if (it != ctx.end())
      switch (*it) {
      case '$': style_ = style::expr; ctx.advance_to(++it); break;
      case '*': style_ = style::star; ctx.advance_to(++it); break;
@@ -1326,18 +1327,20 @@ struct fmt::formatter<std::complex<T>,Char> : public fmt::formatter<T,Char>
{
  typedef fmt::formatter<T,Char> base;
  enum style { expr, star, pair } style_ = expr;
  internal::dynamic_format_specs<Char> specs_;
  fmt::detail::dynamic_format_specs<Char> specs_;
  FMT_CONSTEXPR auto parse(format_parse_context & ctx) -> decltype(ctx.begin()) {
    using handler_type = internal::dynamic_specs_handler<format_parse_context>;
    auto type = internal::type_constant<T, Char>::value;
    internal::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
    using handler_type = fmt::detail::dynamic_specs_handler<format_parse_context>;
    auto type = fmt::detail::type_constant<T, Char>::value;
    fmt::detail::specs_checker<handler_type> handler(handler_type(specs_, ctx), type);
    auto it = ctx.begin();
    if (it != ctx.end()) {
      switch (*it) {
      case '$': style_ = style::expr; ctx.advance_to(++it); break;
      case '*': style_ = style::star; ctx.advance_to(++it); break;
      case ',': style_ = style::pair; ctx.advance_to(++it); break;
      default: break;
      }
    }
    parse_format_specs(ctx.begin(), ctx.end(), handler);
    //todo: fixup alignment
    return base::parse(ctx);
+2 −1
Original line number Diff line number Diff line
@@ -448,11 +448,12 @@ TEST(measure, norm) {
  b = 3;
  Rt d(1);
  MatrixD x;
  x << d;
  x.array() = d;
  MatrixD a = (MatrixD() << 1,2,3, 4,5+5_ef,6, 7,8,9).finished();
  //typename MatrixD::Index index;

  EXPECT_EQ(a.sum(), 45 + 5_ef);
  EXPECT_EQ(x.sum(), 9);
  EXPECT_NEAR(rpart(a.norm()), 16.8819430161341337282, 1e-5);
  EXPECT_NEAR(rpart(a.mean()), 5, 1e-5);
  EXPECT_NEAR(dpart(a.mean()), 0.555555555555555, 1e-5);
Loading