//! @copyright *this file is freware. 
//! @warning Use it at your own risk.
//! @file functional_modulus_test.cpp
//! @author Dejan D. M. Milosavljevic
//! @version 1.0
//! @date 2003
//! @please "Do not remove or change this comments"
//! @description functional modulus tests. 
//! @bug
//! @warning  Use it at your own risk.
//! @copyright *this file is freware. 

#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <algorithm>

#include "functional_modulus.hpp"

using namespace std;

template<typename N_iter >
 void print(N_iter P_begin, N_iter P_end )
   {
    for( N_iter I_iter=P_begin; I_iter != P_end; I_iter++)
       cout<< setw(2) << *I_iter << " ";
    cout << endl;    
   }

int main_modulus( int argc, char *argv[] )
 {
  cout << "--- main_modulus ---" << endl;

  vector<float>  I_left(20);
  list<float>    I_right(20,11);
  vector<float>  I_result(20);
  
  for( vector<float>::iterator I_iter = I_left.begin(); I_iter != I_left.end(); I_iter++ ) 
    *I_iter = rand()%30;   

  cout << "left   " ;
  print( I_left.begin(), I_left.end() );  
  cout << "right  " ;
  print( I_right.begin(), I_right.end() ); 
 
  transform( I_left.begin(), I_left.end(), I_right.begin(), I_result.begin(), modulus<float>() );

  cout << "result ";
  print( I_result.begin(), I_result.end() );
 
  return 0;
 }


