瀏覽代碼

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

legacy
Sam Hocevar 5 年之前
父節點
當前提交
555032db18
共有 8 個檔案被更改,包括 23 行新增14 行删除
  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 查看文件

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


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


using namespace lol; using namespace lol;




+ 1
- 0
doc/samples/math/pi.cpp 查看文件

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


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


using lol::real; using lol::real;




+ 4
- 0
doc/tutorial/11_fractal.cpp 查看文件

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


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

#include "loldebug.h" #include "loldebug.h"


#define USE_REAL 0 #define USE_REAL 0


+ 1
- 1
lol-core

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

+ 11
- 9
src/lol/base/types.h 查看文件

@@ -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 #pragma once
@@ -19,9 +21,9 @@ namespace lol
typedef long double ldouble; typedef long double ldouble;


/* The “real” type used for real numbers. It’s a specialisation of the /* 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. */ /* The “half” type used for 16-bit floating point numbers. */
class half; class half;


+ 0
- 1
src/lol/math/all.h 查看文件

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


+ 2
- 1
src/t/math/polynomial.cpp 查看文件

@@ -1,7 +1,7 @@
// //
// Lol Engine — Unit tests // 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 // Lol Engine is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it // the extent permitted by applicable law. You can redistribute it
@@ -12,6 +12,7 @@


#include <lol/engine-internal.h> #include <lol/engine-internal.h>


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


namespace lol namespace lol


+ 3
- 2
src/t/math/real.cpp 查看文件

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


#include <lol/engine-internal.h> #include <lol/engine-internal.h>


#include <cmath>

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


#include <cmath>

namespace lol namespace lol
{ {




Loading…
取消
儲存