mhx / gpsdo-config Goto Github PK
View Code? Open in Web Editor NEWFind GPS reference clock configuration from set of frequencies
License: GNU General Public License v3.0
Find GPS reference clock configuration from set of frequencies
License: GNU General Public License v3.0
Re the following clause near the top of solver.cpp::find_solutions():
if (!is_div_one_or_even(f1, lcm_freq) or !is_div_one_or_even(f2, lcm_freq))
{
// NCn_LS must be 1 or even
lcm_freq *= 2;
}
It seems to me that the arguments being passed to is_div_one_or_even() in the above clause are backwards.
Reasoning:
My interpretation of what you're trying to do there is to enforce a value of lcm_freq for which NCn_LS is either unity or an even integer. (Let's ignore the unity constraint since it doesn't apply to the CMOS part.)
So, using f1 as an example, then it seems to me that what you want from the above clause is to conditionally scale lcm_freq by a factor of 2 such that
f1 == lcm_freq / NCn_LS
for some potential even value of NCn_LS. This in turn requires that lcm_freq/f1 be even. (And similarly for lcm_freq/f2.)
But the second portion of the test performed by is_div_one_or_even() divides the first arg by the second, and then tests whether that quotient is divisible by 2. So the way that the args are currently passed in the above clause, it is the ratios f1/lcm_freq and f2/lcm_freq that are being tested for even-ness, rather that their reciprocals.
If you disagree with the above reasoning, can you please explain patiently why the test is being done the way it is?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.