module row_nchconest  
! non-causal non-stationary convolution, for a row operator. Adjoint is the filter.
  use nchconest1
  use nchconest2
  use row_mod

  implicit none

  integer, private :: size_coeffs,size_coeffs1
  real,private     :: mu
  contains

  subroutine row_nchconest_init (x_in,y_in,aa_in,bb_in,size_coeffs1_in,size_coeffs2_in,mu_in)
    real, dimension(:), pointer     :: x_in,y_in 
    type(filter)                    :: aa_in,bb_in 
    integer                         :: size_coeffs1_in,size_coeffs2_in
	real                            :: mu_in

    call nchconest1_init(x_in,aa_in)
    call nchconest2_init(y_in,bb_in)
    size_coeffs1=size_coeffs1_in
    size_coeffs=size_coeffs1_in+size_coeffs2_in
    mu=mu_in

  end subroutine

  function row_nchconest_lop ( adj, add, a, y) result(stat)
    integer            :: stat 
    logical,intent(in) :: adj,add 
    real,dimension(:)  :: a,y 
    call adjnull1 (adj,add,a,y )

    call row2(nchconest1_lop,nchconest2_lop,adj,add,a(1:size_coeffs1), &
         & a(size_coeffs1+1:size_coeffs),y,mu)

    stat=1

  end function row_nchconest_lop

  subroutine row_nchconest_close()

  end subroutine row_nchconest_close

end module row_nchconest
