1
$\begingroup$

I have several functions:

A=Function[{u},Piecewise[{{1/Sqrt[2],u==0},{1,u!=0}}]]
Cc=Function[{i,u},A[u]*Cos[((2*i+1)*u*Pi)/16]]
IDCT1=Function[{i,j},1/4*Sum[Sum[Cc[i,u]*Cc[j,v]*Q[u,v]*Y1[u,v], {v,0, 7}],{u, 0, 7}]]
IDCT2=Function[{i,j},1/4*Sum[Sum[Cc[i,u]*Cc[j,v]*Q[u,v]*Y2[u,v], {v,0, 7}],{u, 0, 7}]]

where Q is a matrix

FullSimplify accepts expressions, not functions.

How do I simplify ICDT1[i,j]*ICDT2[i,j] without rewriting everything as expressions?

$\endgroup$
  • $\begingroup$ FullSimplify[ICDT1[i, j] * ICDT2[i, j]] will already (try to) simplify the resulting expression. Would that not work? $\endgroup$ – MarcoB Mar 12 '19 at 12:38
2
$\begingroup$
IDCT = Function[{i, j}, Evaluate@FullSimplify[IDCT1[i, j]*IDCT2[i, j]]]

(takes a while to evaluate)

| improve this answer | |
$\endgroup$
  • $\begingroup$ Cannot check because it times out.... $\endgroup$ – Antonio Mar 12 '19 at 20:20
  • $\begingroup$ Try replacing FullSimplify with Simplify, Factor, or whatever you need. My point was only to show you how to stay with functions instead of expressions, not how to simplify your specific terms. $\endgroup$ – Roman Mar 13 '19 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.