-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3079 from kuzudb/arithmetic-functions-refactor
Refactor arithmetic functions
- Loading branch information
Showing
45 changed files
with
428 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include "function/function_collection.h" | ||
|
||
#include "function/arithmetic/vector_arithmetic_functions.h" | ||
|
||
namespace kuzu { | ||
namespace function { | ||
|
||
#define SCALAR_FUNCTION(_PARAM) \ | ||
{ _PARAM::name, _PARAM::getFunctionSet } | ||
#define SCALAR_FUNCTION_ALIAS(_PARAM) \ | ||
{ _PARAM::alias, _PARAM::getFunctionSet } | ||
#define FINAL_FUNCTION \ | ||
{ nullptr, nullptr } | ||
|
||
FunctionCollection* FunctionCollection::getFunctions() { | ||
static FunctionCollection functions[] = { | ||
|
||
// Arithmetic Functions | ||
SCALAR_FUNCTION(AddFunction), SCALAR_FUNCTION(SubtractFunction), | ||
SCALAR_FUNCTION(MultiplyFunction), SCALAR_FUNCTION(DivideFunction), | ||
SCALAR_FUNCTION(ModuloFunction), SCALAR_FUNCTION(PowerFunction), | ||
SCALAR_FUNCTION(AbsFunction), SCALAR_FUNCTION(AcosFunction), SCALAR_FUNCTION(AsinFunction), | ||
SCALAR_FUNCTION(AtanFunction), SCALAR_FUNCTION(Atan2Function), | ||
SCALAR_FUNCTION(BitwiseXorFunction), SCALAR_FUNCTION(BitwiseAndFunction), | ||
SCALAR_FUNCTION(BitwiseOrFunction), SCALAR_FUNCTION(BitShiftLeftFunction), | ||
SCALAR_FUNCTION(BitShiftRightFunction), SCALAR_FUNCTION(CbrtFunction), | ||
SCALAR_FUNCTION(CeilFunction), SCALAR_FUNCTION_ALIAS(CeilFunction), | ||
SCALAR_FUNCTION(CosFunction), SCALAR_FUNCTION(CotFunction), | ||
SCALAR_FUNCTION(DegreesFunction), SCALAR_FUNCTION(EvenFunction), | ||
SCALAR_FUNCTION(FactorialFunction), SCALAR_FUNCTION(FloorFunction), | ||
SCALAR_FUNCTION(GammaFunction), SCALAR_FUNCTION(LgammaFunction), | ||
SCALAR_FUNCTION(LnFunction), SCALAR_FUNCTION(LogFunction), | ||
SCALAR_FUNCTION_ALIAS(LogFunction), SCALAR_FUNCTION(Log2Function), | ||
SCALAR_FUNCTION(NegateFunction), SCALAR_FUNCTION(PiFunction), | ||
SCALAR_FUNCTION_ALIAS(PowerFunction), SCALAR_FUNCTION(RadiansFunction), | ||
SCALAR_FUNCTION(RoundFunction), SCALAR_FUNCTION(SinFunction), SCALAR_FUNCTION(SignFunction), | ||
SCALAR_FUNCTION(SqrtFunction), SCALAR_FUNCTION(TanFunction), | ||
|
||
// End of array | ||
FINAL_FUNCTION}; | ||
|
||
return functions; | ||
} | ||
|
||
} // namespace function | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.