Utility Group

  • AggregateFunction
  • CycleIndices
  • MetricGij
  • OnOrOff
  • OptArgs
  • RankOneMatrix
  • UniqueVectors
  • UnitVector

  • AggregateFunction

    AggregateFunction - Create a function from an aggregate of points.

    Usage

    aggf = AggregateFunction(pts, agg, wts, PointFun, varargin)

    Interactive Documentation

     AggregateFunction - Create a function from an aggregate of points.
       
       USAGE:
    
       aggf = AggregateFunction(pts, agg, wts, @PointFun)
       aggf = AggregateFunction(pts, agg, wts, @PointFun, pfarg1, ...)
    
       INPUT:
    
       pts is d x n, 
           the set of points on which to evaluate the aggregate function
       agg is d x m, 
           a collection of points (the aggregate)
       wts is 1 x m, 
           the weighting associated with points in `agg'
       PointFun is a function handle, 
           the function which evaluates the distribution associated 
           with each point of the aggregate;
           the required interface to PointFun is:
    
           PointFun(center, points [, args])
                    center is d x 1, the center of the distribution
                    points is d x n, a list of points to evaluate
                    args are function-specific arguments
    
       Remaining arguments are passed to PointFun.
    
       OUTPUT:
    
       aggf is 1 x n, 
            the values of the aggregate function at each point in `pts';
    
       NOTES:
    
       * Each point in the aggregate is the center of a distribution
         over the whole space, given by PointFun; all of these 
         distributions are superposed to give the resulting 
         aggregate function, which is then evaluated at the 
         specified point.
    
    

    CycleIndices

    CycleIndices - Cycle the indices 1:n.

    Usage

    cycle = CycleIndices(n)

    Interactive Documentation

     CycleIndices - Cycle the indices 1:n.
       
       USAGE:
    
       cycle = CycleIndices(n)
    
       INPUT:
    
       n is a postive integer
    
       OUTPUT:
    
       cycle is an n x n array of integers ,
             the columns are the indices 1:n cyclically permuted
    
    

    MetricGij

    MetricGij - Compute components of metric from differential.

    Usage

    gij = MetricGij(diff)

    Interactive Documentation

     MetricGij - Compute components of metric from differential.
       
       USAGE:
    
       gij = MetricGij(diff)
    
       INPUT:
    
       diff is m x n x l,
            the array of n tangent vectors of dimension m at each 
            of l points
    
       OUTPUT:
    
       gij is n x n x l, 
           the metric components (dot(ti, tj)) at each of the l points
    
    

    OnOrOff

    OnOrOff - Convert on|off string to 1|0 integer.

    Usage

    toggle = OnOrOff(string)

    Interactive Documentation

     OnOrOff - Convert on|off string to 1|0 integer.
    
       USAGE:
    
       toggle = OnOrOff(string)
    
       INPUT:
    
       string is either 'on' or 'off' (case is ignored)
    
       OUTPUT:
    
       toggle is a scalar, 
              0   if string matches 'off'
              1   if string matches 'on'
      
    

    OptArgs

    OptArgs - Set options from cell array.

    Usage

    opts = OptArgs(optkeys, optargs)

    Interactive Documentation

     OptArgs - Set options from cell array.
       
       USAGE:
    
       opts = OptArgs(optkeys, optargs)
    
       INPUT:
    
       optkeys is a cell array, (of length 2*n)
               consisting of data in the form
               {string1, object1, string2, object2, ...};
               the strings are the parameter names and objects
               are the default values associated with each paramter
       optargs is a cell array, (of length 2*m)
               it is of the same form as `optkeys'; its values
               override the defaults 
       
       OUTPUT:
    
       opts is a structure,
               the fields are parameter names from `optkeys', and
               the values are either the default value or the 
               overriding value from `optargs'
    
       NOTES:  
    
       *  Values in `optkeys' which are cell arrays need to be
          contained inside another cell array; see `struct' for
          details, whereas values in `optargs' which are cell arrays 
          should not be placed in another cell array.  The difference
          arises because the resulting structure is generated by
          a call to the matlab `struct' command with argument
          `optkeys', but the structure fields are updated one by one
          using the values in `optargs'.
    
       *  The general usage of this function would be to set optkeys
          in the user function and pass varargin as optargs to update
          the default values.
    
    

    RankOneMatrix

    RankOneMatrix - Create rank one matrices (dyadics) from vectors.

    Usage

    r1mat = RankOneMatrix(vec1, vec2)

    Interactive Documentation

     RankOneMatrix - Create rank one matrices (dyadics) from vectors.
       
       USAGE:
    
       r1mat = RankOneMatrix(vec1)
       r1mat = RankOneMatrix(vec1, vec2)
    
       INPUT:
    
       vec1 is m1 x n, 
            an array of n m1-vectors 
       vec2 is m2 x n, (optional) 
            an array of n m2-vectors
    
       OUTPUT:
    
       r1mat is m1 x m2 x n, 
             an array of rank one matrices formed as c1*c2' 
             from columns c1 and c2
    
       With one argument, the second vector is taken to
       the same as the first.
    
       NOTES:
    
       *  This routine can be replaced by MultMatArray.
    
    

    UniqueVectors

    UniqueVectors - Remove near duplicates from a list of vectors.

    Usage

    [uvec, ord, iord] = UniqueVectors(vec, tol)

    Interactive Documentation

     UniqueVectors - Remove near duplicates from a list of vectors.
       
       USAGE:
    
       [uvec, ord, iord] = UniqueVectors(vec)
       [uvec, ord, iord] = UniqueVectors(vec, tol)
    
       INPUT:
    
       vec is d x n, 
           an array of n d-vectors
       tol is a scalar, (optional) 
           the tolerance for comparison; it defaults to 1.0e-14
    
       OUTPUT:
    
       uvec is d x m, 
            the set of unique vectors; two adjacent vectors are considered
            equal if each component is within the given tolerance
       ord  is an m-vector, (integer)
            which relates the input vector to the output vector, 
            i.e. uvec = vec(:, ord)
       iord is an n-vector, (integer)
            which relates the reduced vector to the original vector, 
            i.e. vec = uvec(:, iord)
    
       NOTES:
    
       *  After sorting, only adjacent entries are tested for equality
          within the tolerance.  For example, if x1 and x2 are within
          the tolerance, and x2 and x3 are within the tolerance, then 
          all 3 will be considered the same point, even though x1 and
          x3 may not be within the tolerance.  Consequently, if you
          make the tolerance too large, all the points will be
          considered the same.  Nevertheless, this routine should be 
          adequate for the its intended application (meshing), where
          the points fall into well-separated clusters.
    
    

    UnitVector

    UnitVector - Normalize an array of vectors.

    Usage

    uvec = UnitVector(vec, ipmat)

    Interactive Documentation

     UnitVector - Normalize an array of vectors.
       
       USAGE:
    
       uvec = UnitVector(vec)
       uvec = UnitVector(vec, ipmat)
    
       INPUT:
    
       vec   is m x n, 
             an array of n nonzero vectors of dimension m
       ipmat is m x m, (optional)
             this is a (SPD) matrix which defines the inner product
             on the vectors by the rule:  
                norm(v)^2 = v' * ipmat * v
             
             If `ipmat' is not specified, the usual Euclidean 
             inner product is used.
    
       OUTPUT:
    
       uvec is m x n,
            the array of unit vectors derived from `vec'