main/src/georegression/fitting/curves/FitPolynomialSolverTall_F64.java
public boolean process(double[] data, int offset , int length , PolynomialCurve_F64 output ) {
		int N = length/2;

		int numCoefs = output.size();

		A.reshape(N,numCoefs);
		b.reshape(N,1);
		x.reshape(numCoefs,1);

		int end = offset+length;
		for (int i = offset, idxA=0; i < end; i += 2) {
			double x = data[i];
			double y = data[i+1];

			double pow = 1.0;
			for (int j = 0; j < numCoefs; j++) {
				A.data[idxA++] = pow;
				pow *= x;
			}

			b.data[i/2] = y;
		}

		if( !solver.setA(A) )
			return false;
		solver.solve(b,x);

		for (int i = 0; i < numCoefs; i++) {
			output.set(i, x.data[i]);
		}
		return true;
	}
public boolean process(double[] data, int offset , int length , PolynomialCurve_F64 output ) {
		int N = length/2;

		int numCoefs = output.size();

		A.reshape(N,numCoefs);
		b.reshape(N,1);
		x.reshape(numCoefs,1);

		int end = offset+length;
		for (int i = offset, idxA=0; i < end; i += 2) {
			double x = data[i];
			double y = data[i+1];

			double pow = 1.0;
			for (int j = 0; j < numCoefs; j++) {
				A.data[idxA++] = pow;
				pow *= x;
			}

			b.data[i/2] = y;
		}

		if( !solver.setA(A) )
			return false;
		solver.solve(b,x);

		for (int i = 0; i < numCoefs; i++) {
			output.set(i, x.data[i]);
		}
		return true;
	}
public boolean process ( double [ ] data , int offset , int length , PolynomialCurve_F64 output ) { int N = length / 2 ; int numCoefs = output . size ( ) ; A . reshape ( N , numCoefs ) ; b . reshape ( N , 1 ) ; x . reshape ( numCoefs , 1 ) ; int end = offset + length ; for ( int i = offset , idxA = 0 ; i < end ; i += 2 ) { double x = data [ i ] ; double y = data [ i + 1 ] ; double pow = 1.0 ; for ( int j = 0 ; j < numCoefs ; j ++ ) { A . data [ idxA ++ ] = pow ; pow *= x ; } b . data [ i / 2 ] = y ; } if ( ! solver . setA ( A ) ) return false ; solver . solve ( b , x ) ; for ( int i = 0 ; i < numCoefs ; i ++ ) { output . set ( i , x . data [ i ] ) ; } return true ; }
Fits the polynomial curve to the data.

@param data interleaved input output
@param offset first element in data
@param length number of elements to read in data
@param output The fitted polynomial
@return true if solver worked or false if it didn't
Fits the polynomial curve to the data .