Skip to content

Commit dd2fbe7

Browse files
committed
v1.4.0 - copyright updates and minor refactoring
1 parent c722e62 commit dd2fbe7

22 files changed

+87
-86
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
/.vscode
1212
/build
1313
/out
14+
/VS2022/dsga/x64/Debug

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
**dsga** is a single header-only **c++20 library** that implements the **vectors** and **matrices** from the OpenGL Shading Language 4.6 specification ([pdf](https://www.khronos.org/registry/OpenGL/specs/gl/GLSLangSpec.4.60.pdf) | [html](https://registry.khronos.org/OpenGL/specs/gl/GLSLangSpec.4.60.html)). It is inspired by the spec, but does deviate in some small ways, mostly to make it work well in c++20. It is not intended to be used for rendering, just for sharing the fundamental data structures and associated functions. Our requirements in general are for things like 3D CAD/CAM applications and other geometric and algebraic things. See [motivation](docs/MOTIVATION.md) for more details. This library does not use SIMD instructions or types under the hood, beyond whatever the compiler provides through optimization.
44

5+
## Home
6+
[https://github.com/davidbrowne/dsga](https://github.com/davidbrowne/dsga)
7+
58
## Current Version
6-
v1.3.12
9+
v1.4.0
710

811
## Contents
912
* [Some Quick Examples](#some-quick-examples)
@@ -278,10 +281,10 @@ This is a c++20 library, so that needs to be the minimum standard that you tell
278281
279282
## Status
280283
281-
Current version: `v1.3.12`
284+
Current version: `v1.4.0`
282285
283286
* Everything major has some tests, but code coverage is not 100%.
284-
* [Last Released: v1.3.0](https://github.com/davidbrowne/dsga/releases/tag/v1.3.0)
287+
* [Last Released: v1.4.0](https://github.com/davidbrowne/dsga/releases/tag/v1.4.0)
285288
286289
### The next steps
287290
* Refining API documentation.
@@ -306,7 +309,7 @@ The tests have been most recently run on:
306309
307310
### Windows 11 Native
308311
309-
* **MSVC 2022 - v17.8.5**
312+
* **MSVC 2022 - v17.9.1**
310313
311314
```
312315
[doctest] doctest version is "2.4.11"
@@ -343,7 +346,7 @@ Performs all the unit tests except where there is lack of support for ```std::is
343346
344347
### Ubuntu Noble Numbat preview running in WSL2 for Windows 11
345348
346-
* **gcc 13.2.0**
349+
* **gcc 14.0.1**
347350
348351
```
349352
[doctest] doctest version is "2.4.11"
@@ -405,7 +408,7 @@ It is a common pastime for people to write these kind of vector libraries. The t
405408
[![BSL](https://img.shields.io/badge/license-BSL-blue)](https://choosealicense.com/licenses/bsl-1.0/)
406409
407410
```
408-
// Copyright David Browne 2020-2023.
411+
// Copyright David Browne 2020-2024.
409412
// Distributed under the Boost Software License, Version 1.0.
410413
// (See accompanying file LICENSE_1_0.txt or copy at
411414
// https://www.boost.org/LICENSE_1_0.txt)
@@ -419,8 +422,9 @@ The libraries we use (some just occasionally):
419422
420423
```
421424
// cxcm - a c++20 library that provides constexpr versions of some <cmath> and related functions.
425+
// https://github.com/davidbrowne/cxcm
422426
//
423-
// Copyright David Browne 2020-2023.
427+
// Copyright David Browne 2020-2024.
424428
// Distributed under the Boost Software License, Version 1.0.
425429
// (See accompanying file LICENSE_1_0.txt or copy at
426430
// https://www.boost.org/LICENSE_1_0.txt)
@@ -464,6 +468,7 @@ The libraries we use (some just occasionally):
464468
465469
```
466470
// doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD
471+
// https://github.com/doctest/doctest
467472
//
468473
// Copyright (c) 2016-2023 Viktor Kirilov
469474
//

docs/API.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2245,8 +2245,8 @@ template <bool W1, floating_point_scalar T1, std::size_t C, typename D1, bool W2
22452245
##### ```cross```
22462246
```c++
22472247
template <bool W1, floating_point_scalar T1, typename D1, bool W2, floating_point_scalar T2, typename D2>
2248-
[[nodiscard]] constexpr auto cross(const vector_base<W1, T1, 3, D1> &x,
2249-
const vector_base<W2, T2, 3, D2> &y) noexcept;
2248+
[[nodiscard]] constexpr auto cross(const vector_base<W1, T1, 3, D1> &a,
2249+
const vector_base<W2, T2, 3, D2> &b) noexcept;
22502250
```
22512251

22522252
##### ```normalize```
@@ -2282,50 +2282,53 @@ template <bool W1, floating_point_scalar T, std::size_t C, typename D1, bool W2,
22822282

22832283
##### ```lessThan```
22842284
```c++
2285-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2286-
requires non_bool_scalar<T>
2285+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
22872286
[[nodiscard]] constexpr auto lessThan(const vector_base<W1, T, C, D1> &x,
22882287
const vector_base<W2, T, C, D2> &y) noexcept;
22892288
```
22902289

22912290
##### ```lessThanEqual```
22922291
```c++
2293-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2294-
requires non_bool_scalar<T>
2292+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
22952293
[[nodiscard]] constexpr auto lessThanEqual(const vector_base<W1, T, C, D1> &x,
22962294
const vector_base<W2, T, C, D2> &y) noexcept;
22972295
```
22982296

22992297
##### ```greaterThan```
23002298
```c++
2301-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2302-
requires non_bool_scalar<T>
2299+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23032300
[[nodiscard]] constexpr auto greaterThan(const vector_base<W1, T, C, D1> &x,
23042301
const vector_base<W2, T, C, D2> &y) noexcept;
23052302
```
23062303

23072304
##### ```greaterThanEqual```
23082305
```c++
2309-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2310-
requires non_bool_scalar<T>
2306+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23112307
[[nodiscard]] constexpr auto greaterThanEqual(const vector_base<W1, T, C, D1> &x,
23122308
const vector_base<W2, T, C, D2> &y) noexcept;
23132309
```
23142310

23152311
##### ```equal```
23162312
```c++
2317-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2318-
requires non_bool_scalar<T>
2313+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23192314
[[nodiscard]] constexpr auto equal(const vector_base<W1, T, C, D1> &x,
23202315
const vector_base<W2, T, C, D2> &y) noexcept;
2316+
2317+
template <bool W1, std::size_t C, typename D1, bool W2, typename D2>
2318+
[[nodiscard]] constexpr auto equal(const vector_base<W1, bool, C, D1> &x,
2319+
const vector_base<W2, bool, C, D2> &y) noexcept;
23212320
```
23222321

23232322
##### ```notEqual```
23242323
```c++
2325-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2326-
requires non_bool_scalar<T>
2324+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23272325
[[nodiscard]] constexpr auto notEqual(const vector_base<W1, T, C, D1> &x,
23282326
const vector_base<W2, T, C, D2> &y) noexcept;
2327+
2328+
template <bool W1, std::size_t C, typename D1, bool W2, typename D2>
2329+
[[nodiscard]] constexpr auto notEqual(const vector_base<W1, bool, C, D1> &x,
2330+
const vector_base<W2, bool, C, D2> &y) noexcept;
2331+
23292332
```
23302333

23312334
##### ```any```
@@ -2362,24 +2365,29 @@ This function takes the place of GLSL function ```not```. We can't define a func
23622365

23632366
##### ```within_distance```
23642367
```c++
2365-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2366-
requires non_bool_scalar<T>
2368+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23672369
[[nodiscard]] constexpr bool within_distance(const vector_base<W1, T, C, D1> &x,
23682370
const vector_base<W2, T, C, D2> &y,
23692371
T tolerance) noexcept;
2372+
2373+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2, bool W3, typename D3>
2374+
[[nodiscard]] constexpr bool within_distance(const vector_base<W1, T, C, D1> &x,
2375+
const vector_base<W2, T, C, D2> &y,
2376+
const vector_base<W3, T, 1, D3> &tolerance) noexcept;
2377+
23702378
```
23712379
Not in GLSL. It compares the Euclidean distance between two vectors to see if they are within the tolerance. The tolerance is a strictly less-than comparison. Tolerances need to be non-negative.
23722380

23732381
##### ```within_box```
23742382
```c++
2375-
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
2383+
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
23762384
requires non_bool_scalar<T>
23772385
[[nodiscard]] constexpr bool within_box(const vector_base<W1, T, C, D1> &x,
23782386
const vector_base<W2, T, C, D2> &y,
23792387
T tolerance) noexcept;
23802388

2381-
template <bool W1, dimensional_scalar T, std::size_t C1, typename D1, bool W2, typename D2, bool W3, std::size_t C2, typename D3>
2382-
requires ((C1 == C2) || (C2 == 1)) && non_bool_scalar<T>
2389+
template <bool W1, non_bool_scalar T, std::size_t C1, typename D1, bool W2, typename D2, bool W3, std::size_t C2, typename D3>
2390+
requires ((C1 == C2) || (C2 == 1))
23832391
[[nodiscard]] constexpr bool within_box(const vector_base<W1, T, C1, D1> &x,
23842392
const vector_base<W2, T, C1, D2> &y,
23852393
const vector_base<W3, T, C2, D3> &tolerance) noexcept;

examples/angle.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/basic.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/bezier.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/compare.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/format_output.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/hash.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

examples/ostream_output.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
// Copyright David Browne 2020-2023.
2+
// Copyright David Browne 2020-2024.
33
// Distributed under the Boost Software License, Version 1.0.
44
// (See accompanying file LICENSE_1_0.txt or copy at
55
// https://www.boost.org/LICENSE_1_0.txt)

0 commit comments

Comments
 (0)