Skip to content

Commit

Permalink
removed (const_)reference member typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
muellan committed Jul 13, 2017
1 parent 453f8b3 commit b4c587e
Show file tree
Hide file tree
Showing 26 changed files with 55 additions and 328 deletions.
13 changes: 5 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/Release
/Release_GUI
/Debug
/Profile
/Coverage
/Release*
/Debug*
/Profile*
/Coverage*
/build_*
/dev
.project
.cproject
.settings
.pydevproject

*.slo
*.lo
Expand All @@ -17,6 +17,3 @@
*.lai
*.la
*.a

design.txt
main.cpp
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2008-2013 André Müller
Copyright (c) 2008-2017 André Müller

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
AM numeric
==========

some numeric facilities for C++
Header-only numeric facilities for C++11.

All components are header-only.

## Contents
## Quick Overview

### Generic classes
- safe angle (that is tagged with its unit)
Expand All @@ -31,5 +30,5 @@ All components are header-only.


## Requirements
- requires (mostly) C++11 conforming compiler
- tested with g++ 4.7.2, g++ 4.9.2, g++ 5.1.0
- requires C++11 conforming compiler
- tested with g++ 4.7.2, g++ 4.9.2, g++ 5.1.0, g++ 5.3.1
2 changes: 1 addition & 1 deletion include/biquaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/bounded.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/bounded_angles.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/choice.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
*2008-2014 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
7 changes: 3 additions & 4 deletions include/dual.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down Expand Up @@ -74,7 +74,6 @@ class dual
//---------------------------------------------------------------
using value_type = NumberType;
using numeric_type = value_type;
using const_reference = const value_type&;


//---------------------------------------------------------------
Expand Down Expand Up @@ -194,13 +193,13 @@ class dual
//---------------------------------------------------------------
// ELEMENT ACCESS
//---------------------------------------------------------------
constexpr const_reference
constexpr const value_type&
real() const noexcept {
return r_;
}

//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
imag() const noexcept {
return i_;
}
Expand Down
2 changes: 1 addition & 1 deletion include/dual_quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/equality.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/interval.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/limits.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/narrowing.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/natural.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
10 changes: 10 additions & 0 deletions include/natural_interval.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/*****************************************************************************
*
* AM utilities
*
* released under MIT license
*
* 2008-2017 André Müller
*
*****************************************************************************/

#ifndef AMLIB_NUMERIC_NATURAL_INTERVAL_H_
#define AMLIB_NUMERIC_NATURAL_INTERVAL_H_

Expand Down
2 changes: 1 addition & 1 deletion include/param.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2015 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
22 changes: 9 additions & 13 deletions include/quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down Expand Up @@ -52,10 +52,6 @@ class quaternion
using value_type = numeric_type;
using dimension_type = dims_t;

//-----------------------------------------------------
using reference = numeric_type&;
using const_reference = const numeric_type&;


//---------------------------------------------------------------
// CONSTRUCTION / DESTRUCTION
Expand Down Expand Up @@ -145,45 +141,45 @@ class quaternion


//---------------------------------------------------------------
constexpr const_reference
constexpr const value_type&
real() const noexcept {
return w_;
}
//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
imag_i() const noexcept {
return x_;
}
//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
imag_j() const noexcept {
return y_;
}
//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
imag_k() const noexcept {
return z_;
}


//---------------------------------------------------------------
void
real(const_reference w) {
real(const value_type& w) {
w_ = w;
}
//-----------------------------------------------------
void
imag_i(const_reference x) {
imag_i(const value_type& x) {
x_ = x;
}
//-----------------------------------------------------
void
imag_j(const_reference y) {
imag_j(const value_type& y) {
y_ = y;
}
//-----------------------------------------------------
void
imag_k(const_reference z) {
imag_k(const value_type& z) {
z_ = z;
}

Expand Down
7 changes: 3 additions & 4 deletions include/rational.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down Expand Up @@ -43,7 +43,6 @@ class rational
//---------------------------------------------------------------
using value_type = IntT;
using numeric_type = value_type;
using const_reference = const value_type&;


//---------------------------------------------------------------
Expand Down Expand Up @@ -125,12 +124,12 @@ class rational
//---------------------------------------------------------------
// ACCESS
//---------------------------------------------------------------
constexpr const_reference
constexpr const value_type&
numer() const noexcept {
return n_;
}
//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
denom() const noexcept {
return d_;
}
Expand Down
2 changes: 1 addition & 1 deletion include/rounded.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
7 changes: 3 additions & 4 deletions include/scomplex.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down Expand Up @@ -71,7 +71,6 @@ class scomplex
//---------------------------------------------------------------
using value_type = NumberType;
using numeric_type = value_type;
using const_reference = const value_type&;


//---------------------------------------------------------------
Expand Down Expand Up @@ -191,13 +190,13 @@ class scomplex
//---------------------------------------------------------------
// ELEMENT ACCESS
//---------------------------------------------------------------
constexpr const_reference
constexpr const value_type&
real() const noexcept {
return r_;
}

//-----------------------------------------------------
constexpr const_reference
constexpr const value_type&
imag() const noexcept {
return i_;
}
Expand Down
2 changes: 1 addition & 1 deletion include/split_biquaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
2 changes: 1 addition & 1 deletion include/traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* released under MIT license
*
* 2008-2016 André Müller
* 2008-2017 André Müller
*
*****************************************************************************/

Expand Down
Loading

0 comments on commit b4c587e

Please sign in to comment.