mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-20 09:17:23 +01:00
[shared] StorageCartesianFunction: add a method
derivativeNameWithArgument
This commit is contained in:
@@ -46,6 +46,19 @@ StorageCartesianFunction StorageCartesianFunction::NewModel(Ion::Storage::Record
|
||||
return StorageCartesianFunction(Ion::Storage::sharedStorage()->recordNamed(nameBuffer));
|
||||
}
|
||||
|
||||
int StorageCartesianFunction::derivativeNameWithArgument(char * buffer, size_t bufferSize, char arg) {
|
||||
// Fill buffer with f(x). Keep one char for derivative sign.
|
||||
int numberOfChars = nameWithArgument(buffer, bufferSize-1, arg);
|
||||
assert(numberOfChars < bufferSize - 1);
|
||||
char * lastChar = buffer+numberOfChars;
|
||||
while (*(lastChar+1) != '(' && lastChar >= buffer) {
|
||||
*(lastChar+1) = *lastChar;
|
||||
lastChar--;
|
||||
}
|
||||
*lastChar = '\'';
|
||||
return numberOfChars+1;
|
||||
}
|
||||
|
||||
bool StorageCartesianFunction::displayDerivative() const {
|
||||
return recordData()->displayDerivative();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ public:
|
||||
//bool operator!=(const StorageCartesianFunction & other) const { return !(*(static_cast<Record *>(this)) == static_cast<Record &>(other)); }
|
||||
bool displayDerivative() const;
|
||||
void setDisplayDerivative(bool display);
|
||||
int derivativeNameWithArgument(char * buffer, size_t bufferSize, char arg);
|
||||
double approximateDerivative(double x, Poincare::Context * context) const;
|
||||
double sumBetweenBounds(double start, double end, Poincare::Context * context) const override;
|
||||
Poincare::Expression::Coordinate2D nextMinimumFrom(double start, double step, double max, Poincare::Context * context) const;
|
||||
|
||||
Reference in New Issue
Block a user