Comments (8)
Last call before departure closing the issue as won't fix 😃
from jsbsim.
I'm assuming he means the method should be along the following lines:
bool operator==(const FGColumnVector3& b) const {
return fabs(data[0] - b.data[0]) < 1e-13 && fabs(data[1] - b.data[1]) < 1e-13 &&
fabs(data[2] - b.data[2]) < 1e-13;
}
from jsbsim.
I'm not sure I'm getting your point: your statement is too vague. Can you please point at a place in the code where you think the usage of ==
is "not right" ?
from jsbsim.
Ping !
@jinzhu1911 It's been one month since I asked you some clarifications but got no answer. Could you please be more specific ?
from jsbsim.
In the function Comparison operator.
bool operator==(const FGColumnVector3& b) const {
return data[0] == b.data[0] && data[1] == b.data[1] && data[2] == b.data[2];
}
from jsbsim.
@jinzhu1911 Your answer isn't clear. Could you elaborate?
Please, do keep in mind that this is not the place to be cryptic.
from jsbsim.
in the function Comparison operator.
bool operator==(const FGColumnVector3& b) const {
return data[0] == b.data[0] && data[1] == b.data[1] && data[2] == b.data[2];
}
I'm assuming he means the method should be along the following lines:
bool operator==(const FGColumnVector3& b) const { return fabs(data[0] - b.data[0]) < 1e-13 && fabs(data[1] - b.data[1]) < 1e-13 && fabs(data[2] - b.data[2]) < 1e-13; }
Yes, I mean this. Thanks very much!
from jsbsim.
I'm assuming he means the method should be along the following lines:
bool operator==(const FGColumnVector3& b) const {
return fabs(data[0] - b.data[0]) < 1e-13 && fabs(data[1] - b.data[1]) < 1e-13 &&
fabs(data[2] - b.data[2]) < 1e-13;
}
Yes, I mean this. Thanks very much!
Well FGColumnVector3::operator==
tests equality of two FGColumnVector3
instances which is different from testing if they are almost equal. Test frameworks often provide the latter functionality but in that case, they let the user specify the precision with which the values are compared. C++ does not allow to specify an additional parameter to operator==
.
If that really is a problem, I'd rather add a function such as
bool AlmostEqual(const FGColumnVector3& a, const FGColumnVector3& b, double precision) {
return fabs(a[0]-b[0]) < precision && fabs(a[1]-b[1]) < precision && fabs(a[2]-b[2]) < precision;
}
and leave FGColumnVector3::operator==
as it is.
from jsbsim.
Related Issues (20)
- JSBSim Simulink Function HOT 36
- Rust HOT 13
- Can autopilot feature come to jsbsim- unreal engine 5? HOT 2
- MSVC: toupper is not a member of std HOT 1
- Missing target_include_directories in libJSBSim
- JSBSIM_ prefix in CMake options
- Cython warnings about 'tp_print' which is deprecated
- Wrong calculation of vPQRdot in FGAccelerations class HOT 4
- Fixing the mixture for JSBSim piston aircraft HOT 54
- Request: turbine spindown table or property support HOT 2
- Aircraft crashed on air when rolling consecutively HOT 15
- How Jsbsim models the "+" shaped tail fins of missiles and rockets. HOT 1
- After changing pitch and long initial conditions the yaw angle changes also for no reason HOT 1
- JSBSim interface to Matlab on Windows: throttle command from joystick doesn't work HOT 5
- Trim succeeds and results in NaN values HOT 1
- JSBSim and s-function have different results and different reactivity themselves HOT 1
- Building for Unreal 5 on Linux not working HOT 7
- Javascript alternative? HOT 2
- Linearization and simplex trim from console executable and xml script HOT 16
- FGTurbine Shutdown Spin HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsbsim.