Closed DerryMellon closed 1 year ago
This may give you some hints: https://stackoverflow.com/questions/33728107/extending-c-math-functions-to-non-fundamental-types
But I think your best option is to use the VarVisitor
and then take the sqrt of the variance manually.
I know ADL, but ADL is only valid for usage forms such as sqrt(x)
, which cannot be found using ::sqrt(x)
.
StdVisitor
is just an example. There are other visitors such as ZScoreVisitor
. I don’t want to implement all similar functions by myself.
Another option I can think of is to implement the cast operator for double for your type
I convert the data to double before putting it into the DataFrame now. thanks anyway
I have defined a custom type that supports arithmetic operations by implementing the operator +, -, *, /. This ensures my type meets the supports_arithmetic requirement. However, I'm unsure how to define a global ::sqrt function specific to my type. Could you guide me on this?