src/Matrix/n_matrix.cc
// copied anyway -> use add function
copied anyway -> use add function
copied anyway - > use add function
_matrix* n_matrix::subtract_two(_matrix* mx)
  {
  if ((mx->stored_type()) == n_matrix_type)	 
    { 
    if((rows()!=mx->rows()) || (cols()!=mx->cols()))
      {
      NMxerror(51,1);				
      NMxfatal(21);				
      }
    complex *a=&((n_matrix*)mx)->data[size-1];	
    complex *b=&data[size-1];			
    for(; b>=data; b--,a--)			
      (*a)-=(*b);
    ((n_matrix*)mx)->unitary = false;		
    return mx;
    }
  else						
    return mx->subtract(this);			
  }
_matrix * n_matrix :: subtract_two ( _matrix * mx ) { if ( ( mx -> stored_type ( ) ) == n_matrix_type ) { if ( ( rows ( ) != mx -> rows ( ) ) || ( cols ( ) != mx -> cols ( ) ) ) { NMxerror ( 51 , 1 ) ; NMxfatal ( 21 ) ; } complex * a = & ( ( n_matrix * ) mx ) -> data [ size - 1 ] ; complex * b = & data [ size - 1 ] ; for ( ; b >= data ; b -- , a -- ) ( * a ) -= ( * b ) ; ( ( n_matrix * ) mx ) -> unitary = false ; return mx ; } else return mx -> subtract ( this ) ; }
copied anyway -> use add function
copied anyway - > use add function
// Subtract n_matrix from n_matrix //    Mismatched dimensions //    Cannot perform subtraction // Pointer to last element of mx // Pointer to last element of this // Subtraction elementwise // This is probably not unitary now // Subtract n_matrix to non-n_matrix, since // matrix type changes, result has to be