IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 21, 2006, 11:28:31 AM (20 years ago)
Author:
magnier
Message:

vector length initialization

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/pslib/psSparse.c

    r6872 r6943  
    3030    sparse->Bfj = psVectorAlloc (Nrows, PS_DATA_F32);
    3131    sparse->Qii = psVectorAlloc (Nrows, PS_DATA_F32);
     32    sparse->Bfj->n = Nrows;
     33    sparse->Qii->n = Nrows;
    3234
    3335    sparse->Nrows = Nrows;
     
    109111    if (output == NULL) {
    110112        output = psVectorAlloc (vector->n, PS_DATA_F32);
     113        output->n = vector->n;
    111114    }
    112115
     
    136139    // temporary storage for intermediate results
    137140    psVector *dQ = psVectorAlloc (guess->n, PS_DATA_F32);
     141    dQ->n = guess->n;
    138142
    139143    for (int j = 0; j < Niter; j++) {
     
    171175    psVector *tSi  = psVectorAlloc (Nelem, PS_DATA_S32);
    172176    psVector *tSj  = psVectorAlloc (Nelem, PS_DATA_S32);
     177    tAij->n = tSi->n = tSj->n = Nelem;
     178
    173179    for (int i = 0; i < Nelem; i++) {
    174180        int j = index->data.U32[i];
     
    213219    x->data.F32[1] = 5;
    214220    x->data.F32[2] = 7;
    215     fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     221    x->n = 3;
     222    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
     223
    216224
    217225    psVector *B = psSparseMatrixTimesVector (NULL, sparse, x);
Note: See TracChangeset for help on using the changeset viewer.