Skip to content

Commit 787e285

Browse files
committed
code cleanup; documentation
1 parent 95a5e4e commit 787e285

11 files changed

+63
-94
lines changed

Diff for: CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/source/
5252
# target:
5353
add_library(${PROJECT_NAME} INTERFACE)
5454

55-
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
55+
# set_target_properties(${PROJECT_NAME} PROPERTIES CXX_STANDARD 20)
5656

5757
# being a cross-platform target, we enforce standards conformance on MSVC
5858
target_compile_options(${PROJECT_NAME} INTERFACE "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/permissive->")

Diff for: include/projgeom/euclid_plane_measure.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <cmath>
4+
35
#include "euclid_plane.hpp"
46
#include "fractions.hpp"
57

@@ -121,8 +123,6 @@ namespace fun {
121123
return sbase(l1, l2, dot1(l1, l2));
122124
}
123125

124-
#include <cmath>
125-
126126
/**
127127
* @brief
128128
*

Diff for: include/projgeom/fractions.hpp

+21-35
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
// -*- coding: utf-16 -*-
22
#pragma once
33

4-
/** @file include/fractions.hpp
5-
* This is a C++ Library header.
6-
*/
7-
8-
// #include <boost/operators.hpp>
9-
// #include <cmath>
104
#include <numeric>
115
#include <type_traits>
126
#include <utility>
@@ -169,7 +163,7 @@ namespace fun {
169163
/**
170164
* @brief cross product
171165
*
172-
* @param rhs
166+
* @param[in] rhs
173167
* @return Z
174168
*/
175169
constexpr auto cross(const Fraction& rhs) const -> Z {
@@ -247,19 +241,11 @@ namespace fun {
247241
/**
248242
* @brief Equal to
249243
*
244+
* @param[in] lhs
250245
* @param[in] rhs
251246
* @return true
252247
* @return false
253248
*/
254-
255-
/**
256-
* @brief Equal to
257-
*
258-
* @param lhs
259-
* @param rhs
260-
* @return true
261-
* @return false
262-
*/
263249
constexpr friend auto operator==(Fraction lhs, Fraction rhs) -> bool {
264250
if (lhs._den == rhs._den) {
265251
return lhs._num == rhs._num;
@@ -273,8 +259,8 @@ namespace fun {
273259
/**
274260
* @brief Less than
275261
*
276-
* @param lhs
277-
* @param rhs
262+
* @param[in] lhs
263+
* @param[in] rhs
278264
* @return true
279265
* @return false
280266
*/
@@ -401,7 +387,7 @@ namespace fun {
401387
/**
402388
* @brief multiply and assign
403389
*
404-
* @param rhs
390+
* @param[in] rhs
405391
* @return Fraction&
406392
*/
407393
constexpr auto operator*=(Fraction rhs) -> Fraction& {
@@ -416,8 +402,8 @@ namespace fun {
416402
/**
417403
* @brief multiply
418404
*
419-
* @param lhs
420-
* @param rhs
405+
* @param[in] lhs
406+
* @param[in] rhs
421407
* @return Fraction
422408
*/
423409
friend constexpr auto operator*(Fraction lhs, const Fraction& rhs) -> Fraction {
@@ -427,7 +413,7 @@ namespace fun {
427413
/**
428414
* @brief multiply and assign
429415
*
430-
* @param rhs
416+
* @param[in] rhs
431417
* @return Fraction&
432418
*/
433419
constexpr auto operator*=(Z rhs) -> Fraction& {
@@ -440,8 +426,8 @@ namespace fun {
440426
/**
441427
* @brief multiply
442428
*
443-
* @param lhs
444-
* @param rhs
429+
* @param[in] lhs
430+
* @param[in] rhs
445431
* @return Fraction
446432
*/
447433
friend constexpr auto operator*(Fraction lhs, const Z& rhs) -> Fraction {
@@ -451,8 +437,8 @@ namespace fun {
451437
/**
452438
* @brief multiply
453439
*
454-
* @param lhs
455-
* @param rhs
440+
* @param[in] lhs
441+
* @param[in] rhs
456442
* @return Fraction
457443
*/
458444
friend constexpr auto operator*(const Z& lhs, Fraction rhs) -> Fraction {
@@ -462,7 +448,7 @@ namespace fun {
462448
/**
463449
* @brief divide and assign
464450
*
465-
* @param rhs
451+
* @param[in] rhs
466452
* @return Fraction&
467453
*/
468454
constexpr auto operator/=(Fraction rhs) -> Fraction& {
@@ -477,8 +463,8 @@ namespace fun {
477463
/**
478464
* @brief divide
479465
*
480-
* @param lhs
481-
* @param rhs
466+
* @param[in] lhs
467+
* @param[in] rhs
482468
* @return Fraction
483469
*/
484470
friend constexpr auto operator/(Fraction lhs, const Fraction& rhs) -> Fraction {
@@ -488,7 +474,7 @@ namespace fun {
488474
/**
489475
* @brief divide and assign
490476
*
491-
* @param rhs
477+
* @param[in] rhs
492478
* @return Fraction&
493479
*/
494480
constexpr auto operator/=(const Z& rhs) -> Fraction& {
@@ -501,8 +487,8 @@ namespace fun {
501487
/**
502488
* @brief divide
503489
*
504-
* @param lhs
505-
* @param rhs
490+
* @param[in] lhs
491+
* @param[in] rhs
506492
* @return Fraction
507493
*/
508494
friend constexpr auto operator/(Fraction lhs, const Z& rhs) -> Fraction {
@@ -512,8 +498,8 @@ namespace fun {
512498
/**
513499
* @brief divide
514500
*
515-
* @param lhs
516-
* @param rhs
501+
* @param[in] lhs
502+
* @param[in] rhs
517503
* @return Fraction
518504
*/
519505
friend constexpr auto operator/(const Z& lhs, Fraction rhs) -> Fraction {
@@ -535,7 +521,7 @@ namespace fun {
535521
/**
536522
* @brief Add
537523
*
538-
* @param rhs
524+
* @param[in] rhs
539525
* @return Fraction
540526
*/
541527
constexpr auto operator+(const Fraction& rhs) const -> Fraction {

Diff for: include/projgeom/fractions.hpp.bak

+18-18
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ namespace fun {
150150
/**
151151
* @brief cross product
152152
*
153-
* @param rhs
153+
* @param[in] rhs
154154
* @return Z
155155
*/
156156
constexpr auto cross(const Fraction& rhs) const -> Z {
@@ -374,7 +374,7 @@ namespace fun {
374374
/**
375375
* @brief multiply and assign
376376
*
377-
* @param rhs
377+
* @param[in] rhs
378378
* @return Fraction&
379379
*/
380380
constexpr auto operator*=(const Fraction& rhs) -> Fraction& {
@@ -388,8 +388,8 @@ namespace fun {
388388
/**
389389
* @brief multiply
390390
*
391-
* @param lhs
392-
* @param rhs
391+
* @param[in] lhs
392+
* @param[in] rhs
393393
* @return Fraction
394394
*/
395395
friend constexpr auto operator*(Fraction lhs, const Fraction& rhs) -> Fraction {
@@ -399,7 +399,7 @@ namespace fun {
399399
/**
400400
* @brief multiply and assign
401401
*
402-
* @param rhs
402+
* @param[in] rhs
403403
* @return Fraction&
404404
*/
405405
constexpr auto operator*=(const Z& rhs) -> Fraction& {
@@ -412,8 +412,8 @@ namespace fun {
412412
/**
413413
* @brief multiply
414414
*
415-
* @param lhs
416-
* @param rhs
415+
* @param[in] lhs
416+
* @param[in] rhs
417417
* @return Fraction
418418
*/
419419
friend constexpr auto operator*(Fraction lhs, const Z& rhs) -> Fraction {
@@ -423,8 +423,8 @@ namespace fun {
423423
/**
424424
* @brief multiply
425425
*
426-
* @param lhs
427-
* @param rhs
426+
* @param[in] lhs
427+
* @param[in] rhs
428428
* @return Fraction
429429
*/
430430
friend constexpr auto operator*(const Z& lhs, Fraction rhs) -> Fraction {
@@ -434,7 +434,7 @@ namespace fun {
434434
/**
435435
* @brief divide and assign
436436
*
437-
* @param rhs
437+
* @param[in] rhs
438438
* @return Fraction&
439439
*/
440440
constexpr auto operator/=(Fraction rhs) -> Fraction& {
@@ -448,8 +448,8 @@ namespace fun {
448448
/**
449449
* @brief divide
450450
*
451-
* @param lhs
452-
* @param rhs
451+
* @param[in] lhs
452+
* @param[in] rhs
453453
* @return Fraction
454454
*/
455455
friend constexpr auto operator/(Fraction lhs, const Fraction& rhs) -> Fraction {
@@ -459,7 +459,7 @@ namespace fun {
459459
/**
460460
* @brief divide and assign
461461
*
462-
* @param rhs
462+
* @param[in] rhs
463463
* @return Fraction&
464464
*/
465465
constexpr auto operator/=(const Z& rhs) -> Fraction& {
@@ -472,8 +472,8 @@ namespace fun {
472472
/**
473473
* @brief divide
474474
*
475-
* @param lhs
476-
* @param rhs
475+
* @param[in] lhs
476+
* @param[in] rhs
477477
* @return Fraction
478478
*/
479479
friend constexpr auto operator/(Fraction lhs, const Z& rhs) -> Fraction {
@@ -483,8 +483,8 @@ namespace fun {
483483
/**
484484
* @brief divide
485485
*
486-
* @param lhs
487-
* @param rhs
486+
* @param[in] lhs
487+
* @param[in] rhs
488488
* @return Fraction
489489
*/
490490
friend constexpr auto operator/(const Z& lhs, Fraction rhs) -> Fraction {
@@ -506,7 +506,7 @@ namespace fun {
506506
/**
507507
* @brief Add
508508
*
509-
* @param rhs
509+
* @param[in] rhs
510510
* @return Fraction
511511
*/
512512
constexpr auto operator+(const Fraction& rhs) const -> Fraction {

Diff for: include/projgeom/persp_plane.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ namespace fun {
6363
/**
6464
* @brief
6565
*
66-
* @param[in] x
66+
* @param[in] v
6767
* @return P
6868
*/
6969
[[nodiscard]] constexpr auto perp(const L& v) const -> P {

Diff for: include/projgeom/pg_common.hpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,13 @@ namespace fun {
7878
/**
7979
* @brief generic Plucker function
8080
*
81-
* @tparam _K data type
82-
* @param[in] ld lamda
83-
* @param[in] v
81+
* @tparam _T
82+
* @tparam _K
83+
* @param[in] ld
84+
* @param[in] v1
8485
* @param[in] mu
85-
* @param[in] w
86-
* @return lamda*v + mu*w
86+
* @param[in] v2
87+
* @return std::array<_K, 3>
8788
*/
8889
template <ring _T, ring _K> auto plucker_c(const _T& ld, const std::array<_K, 3>& v1,
8990
const _T& mu, const std::array<_K, 3>& v2)

Diff for: include/projgeom/pg_line.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Initially implemented by Wai-Shing Luk <[email protected]>
33
//
44

5-
/** @file include/pg_line.hpp
6-
* This is a C++ Library header.
7-
*/
8-
95
#pragma once
106

117
#include "pg_common.hpp"

Diff for: include/projgeom/pg_object.hpp

+6-8
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
// Initially implemented by Wai-Shing Luk <[email protected]>
33
//
44

5-
/** @file include/pg_object.hpp
6-
* This is a C++ Library header.
7-
*/
8-
95
#pragma once
106

117
#include "pg_common.hpp"
@@ -68,6 +64,7 @@ namespace fun {
6864
* @brief Equal to
6965
*
7066
* @param[in] rhs
67+
* @param[in] lhs
7168
* @return true if this object is equivalent to the rhs
7269
* @return false otherwise
7370
*/
@@ -82,6 +79,7 @@ namespace fun {
8279
* @brief Not equal to
8380
*
8481
* @param[in] rhs
82+
* @param[in] lhs
8583
* @return true if this object is not equivalent to the rhs
8684
* @return false otherwise
8785
*/
@@ -120,8 +118,8 @@ namespace fun {
120118
* @brief Join or meet
121119
*
122120
* @param[in] rhs
123-
* @return true if this point is equivalent to the rhs
124-
* @return false otherwise
121+
* @param[in] lhs
122+
* @return dual
125123
*/
126124
friend constexpr auto operator*(const _Self& lhs, const _Self& rhs) -> dual {
127125
return dual(cross(lhs, rhs));
@@ -132,8 +130,8 @@ namespace fun {
132130
* @brief
133131
*
134132
* @tparam P
135-
* @tparam Value_type<P>
136-
* @param[in] lda1
133+
* @tparam _K
134+
* @param[in] ld1
137135
* @param[in] p
138136
* @param[in] mu1
139137
* @param[in] q

0 commit comments

Comments
 (0)