Add Root Function and Product Function
This commit is contained in:
46
MathKit/MPProductFunction.m
Executable file
46
MathKit/MPProductFunction.m
Executable file
@@ -0,0 +1,46 @@
|
||||
//
|
||||
// MPProductFunction.m
|
||||
// MathPad
|
||||
//
|
||||
// Created by Kim Wittenburg on 10.01.15.
|
||||
// Copyright (c) 2015 Kim Wittenburg. All rights reserved.
|
||||
//
|
||||
|
||||
#import "MPProductFunction.h"
|
||||
|
||||
#import "MPProductFunctionTerm.h"
|
||||
#import "MPExpression.h"
|
||||
|
||||
|
||||
|
||||
@implementation MPProductFunction
|
||||
|
||||
MPFunctionAccessorImplementation(StartExpression, _startExpression)
|
||||
MPFunctionAccessorImplementation(TargetExpression, _targetExpression)
|
||||
MPFunctionAccessorImplementation(ProductExpression, _productExpression)
|
||||
|
||||
|
||||
- (NSArray *)childrenAccessors
|
||||
{
|
||||
return @[@"startExpression", @"targetExpression", @"productExpression"];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)expectsVariableDefinitionInChildAtIndex:(NSUInteger)index
|
||||
{
|
||||
return index == 0;
|
||||
}
|
||||
|
||||
|
||||
- (Class)functionTermClass
|
||||
{
|
||||
return [MPProductFunctionTerm class];
|
||||
}
|
||||
|
||||
|
||||
- (NSString *)description
|
||||
{
|
||||
return [NSString stringWithFormat:@"Product(From: %@; To: %@; Using: %@)", self.startExpression, self.targetExpression, self.productExpression];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user