- # *,/ scalar operators
- print '\t%newobject operator /;'
- print '\t%s * operator / (double val){' % arr
- print '\t\t%s * res = %s;' % (arr, ARR[arr] )
- print '\t\tcvScale(self, res, val);'
- print '\t\treturn res;'
- print '\t}'
+ for op in SCALE_OPERATORS:
+ print '\t%%newobject operator %s;' % (op)
+ print '\t%s * operator %s (double val){' % (arr, op)
+ print '\t\t%s * res = %s;' % (arr, ARR[arr] )
+ print '\t\tcvScale(self, res, %s);' % SCALE_OPERATORS[op]
+ print '\t\treturn res;'
+ print '\t}'
+ print '\t%s * operator %s= (double val){' % (arr, op)
+ print '\t\tcvScale(self, self, %s);' % SCALE_OPERATORS[op]
+ print '\t\treturn self;'
+ print '\t}'