Exemplo n.º 1
0
/*--------------------------------------------------------------------------*/
fint hov_forward_(fint* ftag,
                  fint* fm,
                  fint* fn,
                  fint* fd,
                  fint* fp,
                  fdouble* fbase,
                  fdouble* fx,
                  fdouble* fvalue,
                  fdouble* fy) {
    int rc= -1;
    int tag=*ftag, m=*fm, n=*fn, d=*fd, p=*fp;
    double* base = myalloc1(n);
    double* value = myalloc1(m);
    double*** X = myalloc3(n,p,d);
    double*** Y = myalloc3(m,p,d);
    spread1(n,fbase,base);
    spread3(n,p,d,fx,X);
    rc= hov_forward(tag,m,n,d,p,base,X,value,Y);
    pack3(m,p,d,Y,fy);
    pack1(m,value,fvalue);
    free((char*)**X);
    free((char*)*X);
    free((char*)X);
    free((char*)**Y);
    free((char*)*Y);
    free((char*)Y);
    free((char*)base);
    free((char*)value);
    return rc;
}
Exemplo n.º 2
0
/* accodec(n, tau, d, Z[n][n][d+1], B[n][n][d+1], nz[n][n])                 */
fint accodec_(fint* fn,             /* space dimension */
              fdouble* ftau,        /* scaling defaults to 1.0 */
              fint* fdeg,           /* highest degree          */
              fdouble* fa,          /* input tensor of "partial" Jacobians */
              fdouble* fb)          /* output tensor of "total" Jacobians  */
{
    int rc= 1;
    int n=*fn, deg=*fdeg;
    double tau=*ftau;
    double*** A = myalloc3(n,n,deg);
    double*** B = myalloc3(n,n,deg);
    spread3(n,n,deg,fa,A);
    accodec(n,tau,deg,A,B,0);
    pack3(n,n,deg,B,fb);
    free((char*)**A);
    free((char*)*A);
    free((char*)A);
    free((char*)**B);
    free((char*)*B);
    free((char*)B);
    return rc;
}
Exemplo n.º 3
0
/*--------------------------------------------------------------------------*/
fint hov_ti_reverse_(
    fint* ftag,
    fint* fm,
    fint* fn,
    fint* fd,
    fint* fq,
    fdouble* fu,
    fdouble* fz) {
    int rc=-1;
    int tag=*ftag, m=*fm, n=*fn, d=*fd, q=*fq;
    double*** U = myalloc3(q,m,d+1);
    double*** Z = myalloc3(q,n,d+1);
    short ** nop = 0;
    spread3(q,m,d+1,fu,U);
    rc=hov_ti_reverse(tag,m,n,d,q,U,Z,nop);
    pack3(q,n,d+1,Z,fz);
    free((char*)**Z);
    free((char*)*Z);
    free((char*)Z);
    free((char*)**U);
    free((char*)*U);
    free((char*)U);
    return rc;
}