F´ Flight Software - C/C++ Documentation
A framework for building embedded system applications to NASA flight quality standards.
Algorithms.hpp
Go to the documentation of this file.
1
// ======================================================================
2
// \title Algorithms.hpp
3
// \author sjsreehari
4
// \brief hpp file for general-purpose mathematical algorithms
5
//
6
// \copyright
7
// Copyright (C) 2026 California Institute of Technology.
8
// ALL RIGHTS RESERVED. United States Government Sponsorship
9
// acknowledged.
10
// ======================================================================
11
12
#ifndef UTILS_ALGORITHMS_HPP
13
#define UTILS_ALGORITHMS_HPP
14
15
#include <
Fw/FPrimeBasicTypes.hpp
>
16
17
namespace
Utils
{
18
namespace
Algorithms {
19
24
FwSizeType
gcd
(
FwSizeType
a,
FwSizeType
b);
25
31
FwSizeType
lcm
(
FwSizeType
a,
FwSizeType
b);
32
33
}
// namespace Algorithms
34
35
// Convenience aliases in namespace Utils
36
using
Algorithms::gcd
;
37
using
Algorithms::lcm
;
38
39
}
// namespace Utils
40
41
#endif
FwSizeType
PlatformSizeType FwSizeType
Definition:
FwSizeTypeAliasAc.h:15
Utils::Algorithms::lcm
FwSizeType lcm(FwSizeType a, FwSizeType b)
Calculate the least common multiple of two numbers Asserts that a != 0, b != 0, and that the calculat...
Definition:
Algorithms.cpp:30
FPrimeBasicTypes.hpp
Utils::Algorithms::gcd
FwSizeType gcd(FwSizeType a, FwSizeType b)
Calculate the greatest common divisor of two numbers using the Euclidean algorithm.
Definition:
Algorithms.cpp:19
Utils
Definition:
Algorithms.cpp:16
Utils
Algorithms.hpp
Generated by
1.8.14