Skip to content

Commit

Permalink
v1.4.0 - copyright updates and minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrowne committed Feb 25, 2024
1 parent c722e62 commit dd2fbe7
Show file tree
Hide file tree
Showing 22 changed files with 87 additions and 86 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
/.vscode
/build
/out
/VS2022/dsga/x64/Debug
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

**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.

## Home
[https://github.com/davidbrowne/dsga](https://github.com/davidbrowne/dsga)

## Current Version
v1.3.12
v1.4.0

## Contents
* [Some Quick Examples](#some-quick-examples)
Expand Down Expand Up @@ -278,10 +281,10 @@ This is a c++20 library, so that needs to be the minimum standard that you tell
## Status
Current version: `v1.3.12`
Current version: `v1.4.0`
* Everything major has some tests, but code coverage is not 100%.
* [Last Released: v1.3.0](https://github.com/davidbrowne/dsga/releases/tag/v1.3.0)
* [Last Released: v1.4.0](https://github.com/davidbrowne/dsga/releases/tag/v1.4.0)
### The next steps
* Refining API documentation.
Expand All @@ -306,7 +309,7 @@ The tests have been most recently run on:
### Windows 11 Native
* **MSVC 2022 - v17.8.5**
* **MSVC 2022 - v17.9.1**
```
[doctest] doctest version is "2.4.11"
Expand Down Expand Up @@ -343,7 +346,7 @@ Performs all the unit tests except where there is lack of support for ```std::is
### Ubuntu Noble Numbat preview running in WSL2 for Windows 11
* **gcc 13.2.0**
* **gcc 14.0.1**
```
[doctest] doctest version is "2.4.11"
Expand Down Expand Up @@ -405,7 +408,7 @@ It is a common pastime for people to write these kind of vector libraries. The t
[![BSL](https://img.shields.io/badge/license-BSL-blue)](https://choosealicense.com/licenses/bsl-1.0/)
```
// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand All @@ -419,8 +422,9 @@ The libraries we use (some just occasionally):
```
// cxcm - a c++20 library that provides constexpr versions of some <cmath> and related functions.
// https://github.com/davidbrowne/cxcm
//
// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down Expand Up @@ -464,6 +468,7 @@ The libraries we use (some just occasionally):
```
// doctest.h - the lightest feature-rich C++ single-header testing framework for unit tests and TDD
// https://github.com/doctest/doctest
//
// Copyright (c) 2016-2023 Viktor Kirilov
//
Expand Down
46 changes: 27 additions & 19 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -2245,8 +2245,8 @@ template <bool W1, floating_point_scalar T1, std::size_t C, typename D1, bool W2
##### ```cross```
```c++
template <bool W1, floating_point_scalar T1, typename D1, bool W2, floating_point_scalar T2, typename D2>
[[nodiscard]] constexpr auto cross(const vector_base<W1, T1, 3, D1> &x,
const vector_base<W2, T2, 3, D2> &y) noexcept;
[[nodiscard]] constexpr auto cross(const vector_base<W1, T1, 3, D1> &a,
const vector_base<W2, T2, 3, D2> &b) noexcept;
```

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

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

##### ```lessThanEqual```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto lessThanEqual(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y) noexcept;
```

##### ```greaterThan```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto greaterThan(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y) noexcept;
```

##### ```greaterThanEqual```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto greaterThanEqual(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y) noexcept;
```

##### ```equal```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto equal(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y) noexcept;

template <bool W1, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto equal(const vector_base<W1, bool, C, D1> &x,
const vector_base<W2, bool, C, D2> &y) noexcept;
```

##### ```notEqual```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto notEqual(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y) noexcept;

template <bool W1, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr auto notEqual(const vector_base<W1, bool, C, D1> &x,
const vector_base<W2, bool, C, D2> &y) noexcept;

```

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

##### ```within_distance```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
[[nodiscard]] constexpr bool within_distance(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y,
T tolerance) noexcept;

template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2, bool W3, typename D3>
[[nodiscard]] constexpr bool within_distance(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y,
const vector_base<W3, T, 1, D3> &tolerance) noexcept;

```
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.

##### ```within_box```
```c++
template <bool W1, dimensional_scalar T, std::size_t C, typename D1, bool W2, typename D2>
template <bool W1, non_bool_scalar T, std::size_t C, typename D1, bool W2, typename D2>
requires non_bool_scalar<T>
[[nodiscard]] constexpr bool within_box(const vector_base<W1, T, C, D1> &x,
const vector_base<W2, T, C, D2> &y,
T tolerance) noexcept;

template <bool W1, dimensional_scalar T, std::size_t C1, typename D1, bool W2, typename D2, bool W3, std::size_t C2, typename D3>
requires ((C1 == C2) || (C2 == 1)) && non_bool_scalar<T>
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>
requires ((C1 == C2) || (C2 == 1))
[[nodiscard]] constexpr bool within_box(const vector_base<W1, T, C1, D1> &x,
const vector_base<W2, T, C1, D2> &y,
const vector_base<W3, T, C2, D3> &tolerance) noexcept;
Expand Down
2 changes: 1 addition & 1 deletion examples/angle.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/basic.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/bezier.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/compare.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/format_output.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/hash.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/ostream_output.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/span_convert.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/stl.cxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// Copyright David Browne 2020-2023.
// Copyright David Browne 2020-2024.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt)
Expand Down
2 changes: 1 addition & 1 deletion examples/stl.hxx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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

0 comments on commit dd2fbe7

Please sign in to comment.