TABLE OF CONTENTS


CinitRoutine/cInitMultAndWeight [ Functions ]

NAME

    cInitMultAndWeight --- multiply a spline component and add it to a weighted parametric component

FUNCTION

Given a B-spline basis and a set of parameters, this curve multiplies the basis by the parameters to produce an estimate of the spline component, then weights it and adds it to an existing parametric component. It's inelegant, but fast for initialization.

SYNOPSIS

469 void cInitMultAndWeight( double *y,  double *B,  double *par,  double *weight,  int  *ny,  int *nj)

INPUTS

    y         parametric curve component, on output holds the total curve
    B         B-spline basis
    par       weights of each basis element
    weight    weight of the spline component
    ny        length of y
    nj        number of basis functions

SOURCE

473 {
474     // compute w*B%*%exp(par) + (1-w)y
475     const int c1 = 1;
476     const char trans = 'N';
477     const double onemw=1-*weight;
478     F77_CALL(dgemv)(&trans,ny,nj,weight,B,ny,par,&c1,&onemw,y,&c1);
479 }