Logo Search packages:      
Sourcecode: kbruch version File versions  Download package

ratio task::product ( RatioArray::iterator &  ratio_pointer,
ShortArray::iterator &  op_pointer 
) [private]

this function is needed by solve()

this function is called by the solving function to compute a given product (or div) and return the solution

Definition at line 356 of file task.cpp.

References op_vector.

Referenced by solve().

#ifdef DEBUG
    kDebug() << "task::product()";
    /* the function's parameters are pointing to the next ratio;
     * to the starting point of the product */
    ratio product (ratio_pointer->numerator(), ratio_pointer->denominator());

    do {
        switch (*op_pointer) {
        case ADD :
            product = product + *ratio_pointer++;
        case SUB :
            product = product - *ratio_pointer++;
        case MUL :
            product = product * *ratio_pointer++;
        case DIV :
            product = product / *ratio_pointer++;
    } while (op_pointer != op_vector.end());

    /* we get here if the product consists of the whole given task starting
     * at the point given by the function's parameters */
    return product;

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index