/*------------------------------------------------------------------------------*
 * File Name:math_utils.h 														*
 * Creation: SDB 5/14/03														*
 * Purpose: Origin's basic math related routines								*
 * Copyright (c) Originlab Corp.	2003										*
 * All Rights Reserved															*
 * 																				*
 * Modification Log:															*
 *	Leo 08/29/05 ALL_FUNCTIONS_HAVE_LLVC_COUNTERPARTS							*
 *------------------------------------------------------------------------------*/
 
///Leo 08/29/05 ALL_FUNCTIONS_HAVE_LLVC_COUNTERPARTS, Thus commented out

////////////////////////////////////////////////////////////////////////////////////
//#define _DBINT(_STR, _INT)	out_int(_STR, _INT);
//#define _DBMGS(_STR)		out_str(_STR);
//#define _DB_LIST(_STR)		nlsf_list_params(_STR);	
//
//#ifndef _MATH_UTILS_H
//#define _MATH_UTILS_H
//	
//// Comments last updated by Frank on 08/08/2005
///**
//	This function perform Adjacent Averaging Smoothing on the curve.
//	The parameter nOption specifies the methods to handle the ends of the data.
//Parameter:
//	crvSignal= [modify]  the original data need to smooth and the result after smoothing
//	nPts= [Input] the degree of the smoothing which specified the number of points of 
//	          the smoothing window
//	nOption= [Input]  the methods to handle the ends of the data
//		0: Missing Values Method. 
//	  	1: Reflected Method. Uses w[i] in place of the missing w[-i] and w[n-i-1] in place 
//	  	     of the missing w[n+i-1]. 
//		2: Wrap Method. Uses w[n-i] in place of the missing w[-i] and vice-versa.
//		3: End Weighted Method. Uses w[0] in place of the missing w[-i] and w[n-1] in place of 
//		     the missing w[n+i-1].
//Return:
//	0: Successfully called. 
//	-1: Invalid method number.
//	-2: Invalid curve or empty curve.
//*/
//int smooth_adjave(Curve& crvSignal, int nPts = 5, int nOption = 0);
//
//// Adjacent Averaging Smoothing with missing value end-points-method.
//void smooth_missvalue(vectorbase& vbSignal, int nleft);
//
////Adjacent Averaging Smoothing with reflected end-points-method.
//void smooth_reflected(vectorbase& vbSignal, int nleft);
//
//// Adjacent Averaging Smoothing with wrap end-points-method.
//int smooth_wrap(vectorbase& vbSignal, int nleft);
//	
//// Adjacent Averaging Smoothing with end weighted method.
//void smooth_endweighted(vectorbase& vbSignal, int nleft);
//
//// Comments last updated by Frank on 08/08/2005
///**
//	This function smooth the curve using the Savitzky-Golay filter method.
//Parameter:
//	crvSignal = [Modify] the curve need to smooth and the smoothing results.
//	nPolyOrder= [Input] the degree of the polynomial filters.
//	nPtsLeft= [Input] the number of left points to the target one which are included in
//	        the calculation.
//	nPtsRight= [Input]  the number of points on the right of the target one.
//Return:
//	0: Successfully called
//	-1: The degree nPolyOrder must less than nPtsLeft+nPtsRight.
//	-2: nPtsLeft+nPtsRight must less than the size of the curve.
//	-3: Invalid curve or empty curve.
//	-4: Positive needed for nPolyOrder and nPtsLeft and nPtsRight.
//	positive: NAG error codes 
//*/
//int smooth_sg(Curve& crvSignal, int nPolyOrder = 2, int nPtsLeft = 2, int nPtsRight = 2);
//
//// Comments last updated by Frank on 08/08/2005
///**
//	This function smooth the curve by FFT filter
//Parameter:
//	crvSignal = [modify], the curve need to smooth and the results after smoothing
//	nPts = [input] the number of data points considered at a time
//Return:
//	0: Successfully called
//	-1: Invalid curve.
//	-2: nPts should be positive
//	-3: Error occurs when perform FFT
//	-4: Error occurs when perform IFFT	
//*/
//int smooth_fft(Curve& crvSignal, int nPts = 5);
//
//#endif //_MATH_UTILS_H
//

///End ALL_FUNCTIONS_HAVE_LLVC_COUNTERPARTS