void showVector( Vector *v ) {
  int i;

  printf( "Vector: %s\n", V_GetName( v ) );
  
  for ( i = 0; i < V_GetDim( v ); i++ )
      printf( "%.3lf ", V_GetCmp( v, i+1 ) );
  printf( "\n" );

} /* showVector */
Esempio n. 2
0
void V_SetRndCmp(QVector *V)
/* set random components of the vector V */
{
    size_t Dim, Ind;
    _LPNumber *VCmp;

    if (LASResult() == LASOK) {
        Dim = V_GetDim(V);
        VCmp = V->Cmp;
        for (Ind = 1; Ind <= Dim; Ind++) {
            VCmp[Ind] = (_LPDouble)rand() / ((_LPDouble)RAND_MAX + 1.0);
        }
        V->Multipl = 1.0;
    }
}