src/Matrix/col_vector.cc
/*  Function  Output                       Description
    --------  ------  ---------------------------------------------------------
      norm    double  Returns the vector norm, sq.rt. of sum of squares
      sum     complex Returns the sum ov all vector elements
     maxRe    double  Returns largest real value in the vector
     maxIm    double  Returns largest imaginary value in the vector
     maxZ     complex Returns largest complex (biggest norm) value in vector
     minRe    double  Returns smallest real value in the vector
     minIm    double  Returns smallest imaginary value in the vector
     minZ     complex Returns smallest complex (biggest norm) value in vector
      max      int    Returns index of largest (  real, imag, norm } element
      min      int    Returns index of smallest { real, imag, norm } element
     flip     void    Inverses the element order in the vector
     zero     void    Sets all elements to zero
     sort     vector  Returns integer array of sorted indices

  The vector norm is given by 

                     [ size-1          ]
                     |  ---            |
                     |  \            2 |            2                 *
          Norm = sqrt|  /  |<i|cvec>|  |, |<i|cvec>| = <i|cvec>*<i|cvec>
                     |  ---            |
                     [  i=0            ]

  & the following definitions apply to the max, min, and sort functions:
       
                          type         max/min
                            0       norm (default)
                           <0         imaginary                         
                           >0           real                                 */
Function  Output                       Description

norm    double  Returns the vector norm, sq.rt. of sum of squares
sum     complex Returns the sum ov all vector elements
maxRe    double  Returns largest real value in the vector
maxIm    double  Returns largest imaginary value in the vector
maxZ     complex Returns largest complex (biggest norm) value in vector
minRe    double  Returns smallest real value in the vector
minIm    double  Returns smallest imaginary value in the vector
minZ     complex Returns smallest complex (biggest norm) value in vector
max      int    Returns index of largest (  real, imag, norm } element
min      int    Returns index of smallest { real, imag, norm } element
flip     void    Inverses the element order in the vector
zero     void    Sets all elements to zero
sort     vector  Returns integer array of sorted indices

The vector norm is given by



& the following definitions apply to the max, min, and sort functions.

type         max/min
0       norm (default)
<0         imaginary
>0           real
Function Output Description norm double Returns the vector norm sq . rt . of sum of squares sum complex Returns the sum ov all vector elements maxRe double Returns largest real value in the vector maxIm double Returns largest imaginary value in the vector maxZ complex Returns largest complex ( biggest norm ) value in vector minRe double Returns smallest real value in the vector minIm double Returns smallest imaginary value in the vector minZ complex Returns smallest complex ( biggest norm ) value in vector max int Returns index of largest ( real imag norm } element min int Returns index of smallest { real imag norm } element flip void Inverses the element order in the vector zero void Sets all elements to zero sort vector Returns integer array of sorted indices The vector norm is given by & the following definitions apply to the max min and sort functions . type max / min 0 norm ( default ) <0 imaginary > 0 real
double col_vector::norm() const
  {
  int n=size();
  double d=0;
  for (int i=0; i<n; i++)
    d += square_norm(get(i));
  return sqrt(d);
  }
double col_vector :: norm ( ) const { int n = size ( ) ; double d = 0 ; for ( int i = 0 ; i < n ; i ++ ) d += square_norm ( get ( i ) ) ; return sqrt ( d ) ; }
Function  Output                       Description
  
norm    double  Returns the vector norm, sq.rt.
Function Output Description norm double Returns the vector norm sq . rt .