Lines Matching refs:data
89 static tcu::Vector<float, N> mean (const vector<tcu::Vector<float, N> >& data)
92 for (int i = 0; i < (int)data.size(); i++)
93 sum += data[i];
94 return sum / tcu::Vector<float, N>((float)data.size());
97 static void uniformNfv (const glw::Functions& gl, int n, int location, int count, const float* data)
101 case 1: gl.uniform1fv(location, count, data); break;
102 case 2: gl.uniform2fv(location, count, data); break;
103 case 3: gl.uniform3fv(location, count, data); break;
104 case 4: gl.uniform4fv(location, count, data); break;
109 static void uniformNiv (const glw::Functions& gl, int n, int location, int count, const int* data)
113 case 1: gl.uniform1iv(location, count, data); break;
114 case 2: gl.uniform2iv(location, count, data); break;
115 case 3: gl.uniform3iv(location, count, data); break;
116 case 4: gl.uniform4iv(location, count, data); break;
121 static void uniformMatrixNfv (const glw::Functions& gl, int n, int location, int count, const float* data)
125 case 2: gl.uniformMatrix2fv(location, count, GL_FALSE, &data[0]); break;
126 case 3: gl.uniformMatrix3fv(location, count, GL_FALSE, &data[0]); break;
127 case 4: gl.uniformMatrix4fv(location, count, GL_FALSE, &data[0]); break;
156 * slope of the workload size vs frame time data is estimated. This slope
388 static int numDistinctX (const vector<Vec2>& data)
391 for (int i = 0; i < (int)data.size(); i++)
392 xs.insert(data[i].x());
396 static gls::LineParameters simpleLinearRegression (const vector<Vec2>& data)
398 const Vec2 mid = mean(data);
403 for (int i = 0; i < (int)data.size(); i++)
405 const Vec2 diff = data[i] - mid;
417 static float simpleLinearRegressionError (const vector<Vec2>& data)
419 if (numDistinctX(data) <= 2)
423 const gls::LineParameters estimator = simpleLinearRegression(data);
426 for (int i = 0; i < (int)data.size(); i++)
428 const float estY = estimator.offset + estimator.coefficient*data[i].x();
429 const float diff = estY - data[i].y();
433 return error / (float)data.size();
437 static float verticalVariance (const vector<Vec2>& data)
439 if (numDistinctX(data) <= 2)
443 const float meanY = mean(data).y();
446 for (int i = 0; i < (int)data.size(); i++)
448 const float diff = meanY - data[i].y();
452 return error / (float)data.size();
457 * \brief Find the x coord that divides the input data into two slopes.
465 * This function finds the x coordinate that divides the input data into
470 * This function returns a number X s.t. { pt | pt is in data, pt.x >= X }
471 * is the right line, and the rest of data is the left line.
473 static float findSlopePivotX (const vector<Vec2>& data)
476 for (int i = 0; i < (int)data.size(); i++)
477 xCoords.insert(data[i].x());
486 for (int i = 0; i < (int)data.size(); i++)
488 if (data[i].x() < *pivotX)
489 leftData.push_back(data[i]);
491 rightData.push_back(data[i]);
494 if (numDistinctX(rightData) < 3) // We don't trust the right data if there's too little of it.
522 * \brief Compute line estimators for (potentially) two-segment data.
524 * Splits the given data into left and right parts (using findSlopePivotX)
527 * Sometimes, however (especially in fragment shader cases) the data is
531 * data has zero width.
533 static SegmentedEstimator computeSegmentedEstimator (const vector<Vec2>& data)
535 const float pivotX = findSlopePivotX(data);
539 for (int i = 0; i < (int)data.size(); i++)
541 if (data[i].x() < pivotX)
542 leftData.push_back(data[i]);
544 rightData.push_back(data[i]);
553 // Left data doesn't seem credible; assume the data is just a single line.
554 const gls::LineParameters entireLine = gls::theilSenLinearRegression(data);
655 GLU_EXPECT_NO_ERROR(gl.getError(), "Upload buffer data");
988 log << TestLog::Message << "Note: the data points with x coordinate greater than or equal to " << estimator.pivotX
989 << " seem to form a rising line, and the rest of data points seem to form a near-horizontal line" << TestLog::EndMessage
993 log << TestLog::Message << "Note: the data seem to form a single line: " << lineParamsString(estimator.right) << TestLog::EndMessage;
2243 // Write the name of each distinct parameter data type into the test case name.