% This function prices swaptions in the Black1976 model for any given cash-flow
% structure. It assumes (without checking) that the matrix U is an n by 5 (at least)
% matrix containing, respectively by column, the cash-flow code, the payment date
% (matlab format), the cash-flow (negative for fixed payer and positive otherwise),
% the coupon rate and finally the day-count basis. The earliest cash-flow is assumed to be
% a no coupon payment used to determine the settlement date of the swap. The coupon
% rate is expected to be constant and the strike is determined by the last coupon rate
% in line. The current date is the settlement date of the curve object, while the
% volatility matrix is assumed to be 10y by 10y (Exp-by-Mat) volatility surface.
% The option exposure is assumed to be long (option buyer) with the convention that
% a negative fixed leg cash-flow (fix payer) entails call option exposure.
% On the other side, a positive fixed leg cash-flow (fix reciever) is associated
% to a long put swaption exposure.
% U : code, date, principal, coupon, basis
% V : volatility matrix
% Curve : interest rate curve object