The R Project SVN R

Rev

Rev 6098 | Rev 6994 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6098 Rev 6191
Line 58... Line 58...
58
	    }
58
	    }
59
#endif
59
#endif
60
	}
60
	}
61
	return ans;
61
	return ans;
62
    default:
62
    default:
63
	error("illegal complex unary operator\n");
63
	error("illegal complex unary operator");
64
	return R_NilValue;	/* -Wall*/
64
	return R_NilValue;	/* -Wall*/
65
    }
65
    }
66
}
66
}
67
 
67
 
68
static void complex_div(complex *c, complex *a, complex *b)
68
static void complex_div(complex *c, complex *a, complex *b)
Line 691... Line 691...
691
    case 10004:
691
    case 10004:
692
	return cmath2(op, CAR(args), CADR(args), z_prec);
692
	return cmath2(op, CAR(args), CADR(args), z_prec);
693
    case 0:
693
    case 0:
694
	return cmath2(op, CAR(args), CADR(args), z_atan2);
694
	return cmath2(op, CAR(args), CADR(args), z_atan2);
695
    default:
695
    default:
696
	errorcall(call, "unimplemented complex function\n");
696
	errorcall(call, "unimplemented complex function");
697
	return call;		/* just for -Wall */
697
	return call;		/* just for -Wall */
698
    }
698
    }
699
}
699
}
700
 
700
 
701
SEXP do_complex(SEXP call, SEXP op, SEXP args, SEXP rho)
701
SEXP do_complex(SEXP call, SEXP op, SEXP args, SEXP rho)
Line 764... Line 764...
764
	PROTECT(zr = allocVector(REALSXP, n));
764
	PROTECT(zr = allocVector(REALSXP, n));
765
	PROTECT(zi = allocVector(REALSXP, n));
765
	PROTECT(zi = allocVector(REALSXP, n));
766
 
766
 
767
	for(i=0 ; i<n ; i++) {
767
	for(i=0 ; i<n ; i++) {
768
	    if(!R_FINITE(COMPLEX(z)[i].r) || !R_FINITE(COMPLEX(z)[i].i))
768
	    if(!R_FINITE(COMPLEX(z)[i].r) || !R_FINITE(COMPLEX(z)[i].i))
769
		errorcall(call, "invalid polynomial coefficient\n");
769
		errorcall(call, "invalid polynomial coefficient");
770
	    REAL(zr)[degree-i] = COMPLEX(z)[i].r;
770
	    REAL(zr)[degree-i] = COMPLEX(z)[i].r;
771
	    REAL(zi)[degree-i] = COMPLEX(z)[i].i;
771
	    REAL(zi)[degree-i] = COMPLEX(z)[i].i;
772
	}
772
	}
773
	F77_SYMBOL(cpoly)(REAL(zr), REAL(zi), &degree,
773
	F77_SYMBOL(cpoly)(REAL(zr), REAL(zi), &degree,
774
			  REAL(rr), REAL(ri), &fail);
774
			  REAL(rr), REAL(ri), &fail);