Parcourir la source

math: use real.h only where necessary; improves build times.

legacy
Sam Hocevar il y a 5 ans
Parent
révision
555032db18
8 fichiers modifiés avec 23 ajouts et 14 suppressions
  1. +1
    -0
      doc/samples/benchmark/real.cpp
  2. +1
    -0
      doc/samples/math/pi.cpp
  3. +4
    -0
      doc/tutorial/11_fractal.cpp
  4. +1
    -1
      lol-core
  5. +11
    -9
      src/lol/base/types.h
  6. +0
    -1
      src/lol/math/all.h
  7. +2
    -1
      src/t/math/polynomial.cpp
  8. +3
    -2
      src/t/math/real.cpp

+ 1
- 0
doc/samples/benchmark/real.cpp Voir le fichier

@@ -17,6 +17,7 @@
#include <cstdio>

#include <lol/engine.h>
#include <lol/math/real.h>

using namespace lol;



+ 1
- 0
doc/samples/math/pi.cpp Voir le fichier

@@ -18,6 +18,7 @@
#include <iomanip>

#include <lol/engine.h>
#include <lol/math/real.h>

using lol::real;



+ 4
- 0
doc/tutorial/11_fractal.cpp Voir le fichier

@@ -18,6 +18,10 @@
#include <sstream>

#include <lol/engine.h>
#include <lol/math/vector.h>
#include <lol/math/real.h>
#include <lol/math/transform.h>

#include "loldebug.h"

#define USE_REAL 0


+ 1
- 1
lol-core

@@ -1 +1 @@
Subproject commit ca3fb5a4ba22c012ed6349aba52186a961a39341
Subproject commit e1ef913daa492bc03b233824aae71f2ee351fb21

+ 11
- 9
src/lol/base/types.h Voir le fichier

@@ -1,11 +1,13 @@
//
// Lol Engine
// Lol Engine
//
// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
// This program is free software; you can redistribute it and/or
// modify it under the terms of the Do What The Fuck You Want To
// Public License, Version 2, as published by Sam Hocevar. See
// http://www.wtfpl.net/ for more details.
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Public License, Version 2, as published by the WTFPL Task Force.
// See http://www.wtfpl.net/ for more details.
//

#pragma once
@@ -19,9 +21,9 @@ namespace lol
typedef long double ldouble;

/* The “real” type used for real numbers. It’s a specialisation of the
* “Real” template class. */
template<typename T> class Real;
typedef Real<uint32_t> real;
* “real_t” template class. */
template<typename T> class real_t;
typedef real_t<uint32_t> real;

/* The “half” type used for 16-bit floating point numbers. */
class half;


+ 0
- 1
src/lol/math/all.h Voir le fichier

@@ -14,7 +14,6 @@
#include <lol/math/functions.h>
#include <lol/math/half.h>
#include <lol/math/bigint.h>
#include <lol/math/real.h>
#include <lol/math/vector.h>
#include <lol/math/transform.h>
#include <lol/math/arraynd.h>


+ 2
- 1
src/t/math/polynomial.cpp Voir le fichier

@@ -1,7 +1,7 @@
//
// Lol Engine — Unit tests
//
// Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net>
// Copyright © 2010—2020 Sam Hocevar <sam@hocevar.net>
//
// Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
@@ -12,6 +12,7 @@

#include <lol/engine-internal.h>

#include <lol/math/real.h>
#include <lolunit.h>

namespace lol


+ 3
- 2
src/t/math/real.cpp Voir le fichier

@@ -12,10 +12,11 @@

#include <lol/engine-internal.h>

#include <cmath>

#include <lol/math/real.h>
#include <lolunit.h>

#include <cmath>

namespace lol
{



Chargement…
Annuler
Enregistrer